Skip to content

Commit a11b6a9

Browse files
authored
Merge pull request #2265 from JooperGH/more_dwmapi_bindings
More dwmapi bindings
2 parents 9785686 + fc3c76f commit a11b6a9

7 files changed

Lines changed: 121 additions & 0 deletions

File tree

core/sys/windows/dwmapi.odin

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,45 @@ package sys_windows
33

44
foreign import dwmapi "system:Dwmapi.lib"
55

6+
DWMWINDOWATTRIBUTE :: enum {
7+
DWMWA_NCRENDERING_ENABLED,
8+
DWMWA_NCRENDERING_POLICY,
9+
DWMWA_TRANSITIONS_FORCEDISABLED,
10+
DWMWA_ALLOW_NCPAINT,
11+
DWMWA_CAPTION_BUTTON_BOUNDS,
12+
DWMWA_NONCLIENT_RTL_LAYOUT,
13+
DWMWA_FORCE_ICONIC_REPRESENTATION,
14+
DWMWA_FLIP3D_POLICY,
15+
DWMWA_EXTENDED_FRAME_BOUNDS,
16+
DWMWA_HAS_ICONIC_BITMAP,
17+
DWMWA_DISALLOW_PEEK,
18+
DWMWA_EXCLUDED_FROM_PEEK,
19+
DWMWA_CLOAK,
20+
DWMWA_CLOAKED,
21+
DWMWA_FREEZE_REPRESENTATION,
22+
DWMWA_PASSIVE_UPDATE_MODE,
23+
DWMWA_USE_HOSTBACKDROPBRUSH,
24+
DWMWA_USE_IMMERSIVE_DARK_MODE = 20,
25+
DWMWA_WINDOW_CORNER_PREFERENCE = 33,
26+
DWMWA_BORDER_COLOR,
27+
DWMWA_CAPTION_COLOR,
28+
DWMWA_TEXT_COLOR,
29+
DWMWA_VISIBLE_FRAME_BORDER_THICKNESS,
30+
DWMWA_SYSTEMBACKDROP_TYPE,
31+
DWMWA_LAST,
32+
}
33+
34+
DWMNCRENDERINGPOLICY :: enum {
35+
DWMNCRP_USEWINDOWSTYLE,
36+
DWMNCRP_DISABLED,
37+
DWMNCRP_ENABLED,
38+
DWMNCRP_LAST,
39+
}
40+
641
@(default_calling_convention="stdcall")
742
foreign dwmapi {
843
DwmFlush :: proc() -> HRESULT ---
44+
DwmIsCompositionEnabled :: proc(pfEnabled: ^BOOL) -> HRESULT ---
45+
DwmExtendFrameIntoClientArea :: proc(hWnd: HWND, pMarInset: PMARGINS) -> HRESULT ---
46+
DwmSetWindowAttribute :: proc(hWnd: HWND, dwAttribute: DWORD, pvAttribute: LPCVOID, cbAttribute: DWORD) -> HRESULT ---
947
}

core/sys/windows/gdi32.odin

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ foreign gdi32 {
7979
TextOutW :: proc(hdc: HDC, x, y: c_int, lpString: LPCWSTR, c: c_int) -> BOOL ---
8080
GetTextExtentPoint32W :: proc(hdc: HDC, lpString: LPCWSTR, c: c_int, psizl: LPSIZE) -> BOOL ---
8181
GetTextMetricsW :: proc(hdc: HDC, lptm: LPTEXTMETRICW) -> BOOL ---
82+
83+
CreateSolidBrush :: proc(color: COLORREF) -> HBRUSH ---
8284
}
8385

8486
RGB :: #force_inline proc "contextless" (r, g, b: u8) -> COLORREF {

core/sys/windows/shell32.odin

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,37 @@ foreign shell32 {
2222
) -> c_int ---
2323
SHFileOperationW :: proc(lpFileOp: LPSHFILEOPSTRUCTW) -> c_int ---
2424
SHGetFolderPathW :: proc(hwnd: HWND, csidl: c_int, hToken: HANDLE, dwFlags: DWORD, pszPath: LPWSTR) -> HRESULT ---
25+
SHAppBarMessage :: proc(dwMessage: DWORD, pData: PAPPBARDATA) -> UINT_PTR ---
2526
}
27+
28+
APPBARDATA :: struct {
29+
cbSize: DWORD,
30+
hWnd: HWND,
31+
uCallbackMessage: UINT,
32+
uEdge: UINT,
33+
rc: RECT,
34+
lParam: LPARAM,
35+
}
36+
PAPPBARDATA :: ^APPBARDATA
37+
38+
ABM_NEW :: 0x00000000
39+
ABM_REMOVE :: 0x00000001
40+
ABM_QUERYPOS :: 0x00000002
41+
ABM_SETPOS :: 0x00000003
42+
ABM_GETSTATE :: 0x00000004
43+
ABM_GETTASKBARPOS :: 0x00000005
44+
ABM_ACTIVATE :: 0x00000006
45+
ABM_GETAUTOHIDEBAR :: 0x00000007
46+
ABM_SETAUTOHIDEBAR :: 0x00000008
47+
ABM_WINDOWPOSCHANGED :: 0x0000009
48+
ABM_SETSTATE :: 0x0000000a
49+
ABN_STATECHANGE :: 0x0000000
50+
ABN_POSCHANGED :: 0x0000001
51+
ABN_FULLSCREENAPP :: 0x0000002
52+
ABN_WINDOWARRANGE :: 0x0000003
53+
ABS_AUTOHIDE :: 0x0000001
54+
ABS_ALWAYSONTOP :: 0x0000002
55+
ABE_LEFT :: 0
56+
ABE_TOP :: 1
57+
ABE_RIGHT :: 2
58+
ABE_BOTTOM :: 3

core/sys/windows/types.odin

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ HHOOK :: distinct HANDLE
3838
HKEY :: distinct HANDLE
3939
HDESK :: distinct HANDLE
4040
HFONT :: distinct HANDLE
41+
HRGN :: distinct HANDLE
4142
BOOL :: distinct b32
4243
BYTE :: distinct u8
4344
BOOLEAN :: distinct b8

core/sys/windows/user32.odin

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,17 @@ foreign user32 {
205205
GetRawInputDeviceList :: proc(pRawInputDeviceList: PRAWINPUTDEVICELIST, puiNumDevices: PUINT, cbSize: UINT) -> UINT ---
206206
GetRegisteredRawInputDevices :: proc(pRawInputDevices: PRAWINPUTDEVICE, puiNumDevices: PUINT, cbSize: UINT) -> UINT ---
207207
RegisterRawInputDevices :: proc(pRawInputDevices: PCRAWINPUTDEVICE, uiNumDevices: UINT, cbSize: UINT) -> BOOL ---
208+
209+
SetLayeredWindowAttributes :: proc(hWnd: HWND, crKey: COLORREF, bAlpha: BYTE, dwFlags: DWORD) -> BOOL ---
210+
211+
FillRect :: proc(hDC: HDC, lprc: ^RECT, hbr: HBRUSH) -> int ---
212+
EqualRect :: proc(lprc1: ^RECT, lprc2: ^RECT) -> BOOL ---
213+
214+
GetWindowInfo :: proc(hwnd: HWND, pwi: PWINDOWINFO) -> BOOL ---
215+
GetWindowPlacement :: proc(hWnd: HWND, lpwndpl: ^WINDOWPLACEMENT) -> BOOL ---
216+
SetWindowRgn :: proc(hWnd: HWND, hRgn: HRGN, bRedraw: BOOL) -> int ---
217+
CreateRectRgnIndirect :: proc(lprect: ^RECT) -> HRGN ---
218+
GetSystemMetricsForDpi :: proc(nIndex: int, dpi: UINT) -> int ---
208219
}
209220

210221
CreateWindowW :: #force_inline proc "stdcall" (
@@ -435,3 +446,27 @@ RI_MOUSE_BUTTON_5_DOWN :: 0x0100
435446
RI_MOUSE_BUTTON_5_UP :: 0x0200
436447
RI_MOUSE_WHEEL :: 0x0400
437448
RI_MOUSE_HWHEEL :: 0x0800
449+
450+
WINDOWPLACEMENT :: struct {
451+
length: UINT,
452+
flags: UINT,
453+
showCmd: UINT,
454+
ptMinPosition: POINT,
455+
ptMaxPosition: POINT,
456+
rcNormalPosition: RECT,
457+
rcDevice: RECT,
458+
}
459+
460+
WINDOWINFO :: struct {
461+
cbSize: DWORD,
462+
rcWindow: RECT,
463+
rcClient: RECT,
464+
dwStyle: DWORD,
465+
dwExStyle: DWORD,
466+
dwWindowStatus: DWORD,
467+
cxWindowBorders: UINT,
468+
cyWindowBorders: UINT,
469+
atomWindowType: ATOM,
470+
wCreatorVersion: WORD,
471+
}
472+
PWINDOWINFO :: ^WINDOWINFO

core/sys/windows/ux_theme.odin

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// +build windows
2+
package sys_windows
3+
4+
foreign import uxtheme "system:UxTheme.lib"
5+
6+
MARGINS :: distinct [4]int
7+
PMARGINS :: ^MARGINS
8+
9+
@(default_calling_convention="stdcall")
10+
foreign uxtheme {
11+
IsThemeActive :: proc() -> BOOL ---
12+
}

vendor/cgltf/lib/cgltf.lib

339 KB
Binary file not shown.

0 commit comments

Comments
 (0)