mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Merge branch 'master' into get_core_count
This commit is contained in:
@@ -3,7 +3,45 @@ package sys_windows
|
|||||||
|
|
||||||
foreign import dwmapi "system:Dwmapi.lib"
|
foreign import dwmapi "system:Dwmapi.lib"
|
||||||
|
|
||||||
|
DWMWINDOWATTRIBUTE :: enum {
|
||||||
|
DWMWA_NCRENDERING_ENABLED,
|
||||||
|
DWMWA_NCRENDERING_POLICY,
|
||||||
|
DWMWA_TRANSITIONS_FORCEDISABLED,
|
||||||
|
DWMWA_ALLOW_NCPAINT,
|
||||||
|
DWMWA_CAPTION_BUTTON_BOUNDS,
|
||||||
|
DWMWA_NONCLIENT_RTL_LAYOUT,
|
||||||
|
DWMWA_FORCE_ICONIC_REPRESENTATION,
|
||||||
|
DWMWA_FLIP3D_POLICY,
|
||||||
|
DWMWA_EXTENDED_FRAME_BOUNDS,
|
||||||
|
DWMWA_HAS_ICONIC_BITMAP,
|
||||||
|
DWMWA_DISALLOW_PEEK,
|
||||||
|
DWMWA_EXCLUDED_FROM_PEEK,
|
||||||
|
DWMWA_CLOAK,
|
||||||
|
DWMWA_CLOAKED,
|
||||||
|
DWMWA_FREEZE_REPRESENTATION,
|
||||||
|
DWMWA_PASSIVE_UPDATE_MODE,
|
||||||
|
DWMWA_USE_HOSTBACKDROPBRUSH,
|
||||||
|
DWMWA_USE_IMMERSIVE_DARK_MODE = 20,
|
||||||
|
DWMWA_WINDOW_CORNER_PREFERENCE = 33,
|
||||||
|
DWMWA_BORDER_COLOR,
|
||||||
|
DWMWA_CAPTION_COLOR,
|
||||||
|
DWMWA_TEXT_COLOR,
|
||||||
|
DWMWA_VISIBLE_FRAME_BORDER_THICKNESS,
|
||||||
|
DWMWA_SYSTEMBACKDROP_TYPE,
|
||||||
|
DWMWA_LAST,
|
||||||
|
}
|
||||||
|
|
||||||
|
DWMNCRENDERINGPOLICY :: enum {
|
||||||
|
DWMNCRP_USEWINDOWSTYLE,
|
||||||
|
DWMNCRP_DISABLED,
|
||||||
|
DWMNCRP_ENABLED,
|
||||||
|
DWMNCRP_LAST,
|
||||||
|
}
|
||||||
|
|
||||||
@(default_calling_convention="stdcall")
|
@(default_calling_convention="stdcall")
|
||||||
foreign dwmapi {
|
foreign dwmapi {
|
||||||
DwmFlush :: proc() -> HRESULT ---
|
DwmFlush :: proc() -> HRESULT ---
|
||||||
|
DwmIsCompositionEnabled :: proc(pfEnabled: ^BOOL) -> HRESULT ---
|
||||||
|
DwmExtendFrameIntoClientArea :: proc(hWnd: HWND, pMarInset: PMARGINS) -> HRESULT ---
|
||||||
|
DwmSetWindowAttribute :: proc(hWnd: HWND, dwAttribute: DWORD, pvAttribute: LPCVOID, cbAttribute: DWORD) -> HRESULT ---
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ foreign gdi32 {
|
|||||||
TextOutW :: proc(hdc: HDC, x, y: c_int, lpString: LPCWSTR, c: c_int) -> BOOL ---
|
TextOutW :: proc(hdc: HDC, x, y: c_int, lpString: LPCWSTR, c: c_int) -> BOOL ---
|
||||||
GetTextExtentPoint32W :: proc(hdc: HDC, lpString: LPCWSTR, c: c_int, psizl: LPSIZE) -> BOOL ---
|
GetTextExtentPoint32W :: proc(hdc: HDC, lpString: LPCWSTR, c: c_int, psizl: LPSIZE) -> BOOL ---
|
||||||
GetTextMetricsW :: proc(hdc: HDC, lptm: LPTEXTMETRICW) -> BOOL ---
|
GetTextMetricsW :: proc(hdc: HDC, lptm: LPTEXTMETRICW) -> BOOL ---
|
||||||
|
|
||||||
|
CreateSolidBrush :: proc(color: COLORREF) -> HBRUSH ---
|
||||||
}
|
}
|
||||||
|
|
||||||
RGB :: #force_inline proc "contextless" (r, g, b: u8) -> COLORREF {
|
RGB :: #force_inline proc "contextless" (r, g, b: u8) -> COLORREF {
|
||||||
|
|||||||
@@ -22,4 +22,37 @@ foreign shell32 {
|
|||||||
) -> c_int ---
|
) -> c_int ---
|
||||||
SHFileOperationW :: proc(lpFileOp: LPSHFILEOPSTRUCTW) -> c_int ---
|
SHFileOperationW :: proc(lpFileOp: LPSHFILEOPSTRUCTW) -> c_int ---
|
||||||
SHGetFolderPathW :: proc(hwnd: HWND, csidl: c_int, hToken: HANDLE, dwFlags: DWORD, pszPath: LPWSTR) -> HRESULT ---
|
SHGetFolderPathW :: proc(hwnd: HWND, csidl: c_int, hToken: HANDLE, dwFlags: DWORD, pszPath: LPWSTR) -> HRESULT ---
|
||||||
|
SHAppBarMessage :: proc(dwMessage: DWORD, pData: PAPPBARDATA) -> UINT_PTR ---
|
||||||
}
|
}
|
||||||
|
|
||||||
|
APPBARDATA :: struct {
|
||||||
|
cbSize: DWORD,
|
||||||
|
hWnd: HWND,
|
||||||
|
uCallbackMessage: UINT,
|
||||||
|
uEdge: UINT,
|
||||||
|
rc: RECT,
|
||||||
|
lParam: LPARAM,
|
||||||
|
}
|
||||||
|
PAPPBARDATA :: ^APPBARDATA
|
||||||
|
|
||||||
|
ABM_NEW :: 0x00000000
|
||||||
|
ABM_REMOVE :: 0x00000001
|
||||||
|
ABM_QUERYPOS :: 0x00000002
|
||||||
|
ABM_SETPOS :: 0x00000003
|
||||||
|
ABM_GETSTATE :: 0x00000004
|
||||||
|
ABM_GETTASKBARPOS :: 0x00000005
|
||||||
|
ABM_ACTIVATE :: 0x00000006
|
||||||
|
ABM_GETAUTOHIDEBAR :: 0x00000007
|
||||||
|
ABM_SETAUTOHIDEBAR :: 0x00000008
|
||||||
|
ABM_WINDOWPOSCHANGED :: 0x0000009
|
||||||
|
ABM_SETSTATE :: 0x0000000a
|
||||||
|
ABN_STATECHANGE :: 0x0000000
|
||||||
|
ABN_POSCHANGED :: 0x0000001
|
||||||
|
ABN_FULLSCREENAPP :: 0x0000002
|
||||||
|
ABN_WINDOWARRANGE :: 0x0000003
|
||||||
|
ABS_AUTOHIDE :: 0x0000001
|
||||||
|
ABS_ALWAYSONTOP :: 0x0000002
|
||||||
|
ABE_LEFT :: 0
|
||||||
|
ABE_TOP :: 1
|
||||||
|
ABE_RIGHT :: 2
|
||||||
|
ABE_BOTTOM :: 3
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ HHOOK :: distinct HANDLE
|
|||||||
HKEY :: distinct HANDLE
|
HKEY :: distinct HANDLE
|
||||||
HDESK :: distinct HANDLE
|
HDESK :: distinct HANDLE
|
||||||
HFONT :: distinct HANDLE
|
HFONT :: distinct HANDLE
|
||||||
|
HRGN :: distinct HANDLE
|
||||||
BOOL :: distinct b32
|
BOOL :: distinct b32
|
||||||
BYTE :: distinct u8
|
BYTE :: distinct u8
|
||||||
BOOLEAN :: distinct b8
|
BOOLEAN :: distinct b8
|
||||||
|
|||||||
@@ -123,6 +123,8 @@ foreign user32 {
|
|||||||
|
|
||||||
GetKeyState :: proc(nVirtKey: c_int) -> SHORT ---
|
GetKeyState :: proc(nVirtKey: c_int) -> SHORT ---
|
||||||
GetAsyncKeyState :: proc(vKey: c_int) -> SHORT ---
|
GetAsyncKeyState :: proc(vKey: c_int) -> SHORT ---
|
||||||
|
|
||||||
|
GetKeyboardState :: proc(lpKeyState: PBYTE) -> BOOL ---
|
||||||
|
|
||||||
MapVirtualKeyW :: proc(uCode: UINT, uMapType: UINT) -> UINT ---
|
MapVirtualKeyW :: proc(uCode: UINT, uMapType: UINT) -> UINT ---
|
||||||
|
|
||||||
@@ -203,6 +205,17 @@ foreign user32 {
|
|||||||
GetRawInputDeviceList :: proc(pRawInputDeviceList: PRAWINPUTDEVICELIST, puiNumDevices: PUINT, cbSize: UINT) -> UINT ---
|
GetRawInputDeviceList :: proc(pRawInputDeviceList: PRAWINPUTDEVICELIST, puiNumDevices: PUINT, cbSize: UINT) -> UINT ---
|
||||||
GetRegisteredRawInputDevices :: proc(pRawInputDevices: PRAWINPUTDEVICE, puiNumDevices: PUINT, cbSize: UINT) -> UINT ---
|
GetRegisteredRawInputDevices :: proc(pRawInputDevices: PRAWINPUTDEVICE, puiNumDevices: PUINT, cbSize: UINT) -> UINT ---
|
||||||
RegisterRawInputDevices :: proc(pRawInputDevices: PCRAWINPUTDEVICE, uiNumDevices: UINT, cbSize: UINT) -> BOOL ---
|
RegisterRawInputDevices :: proc(pRawInputDevices: PCRAWINPUTDEVICE, uiNumDevices: UINT, cbSize: UINT) -> BOOL ---
|
||||||
|
|
||||||
|
SetLayeredWindowAttributes :: proc(hWnd: HWND, crKey: COLORREF, bAlpha: BYTE, dwFlags: DWORD) -> BOOL ---
|
||||||
|
|
||||||
|
FillRect :: proc(hDC: HDC, lprc: ^RECT, hbr: HBRUSH) -> int ---
|
||||||
|
EqualRect :: proc(lprc1: ^RECT, lprc2: ^RECT) -> BOOL ---
|
||||||
|
|
||||||
|
GetWindowInfo :: proc(hwnd: HWND, pwi: PWINDOWINFO) -> BOOL ---
|
||||||
|
GetWindowPlacement :: proc(hWnd: HWND, lpwndpl: ^WINDOWPLACEMENT) -> BOOL ---
|
||||||
|
SetWindowRgn :: proc(hWnd: HWND, hRgn: HRGN, bRedraw: BOOL) -> int ---
|
||||||
|
CreateRectRgnIndirect :: proc(lprect: ^RECT) -> HRGN ---
|
||||||
|
GetSystemMetricsForDpi :: proc(nIndex: int, dpi: UINT) -> int ---
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateWindowW :: #force_inline proc "stdcall" (
|
CreateWindowW :: #force_inline proc "stdcall" (
|
||||||
@@ -433,3 +446,27 @@ RI_MOUSE_BUTTON_5_DOWN :: 0x0100
|
|||||||
RI_MOUSE_BUTTON_5_UP :: 0x0200
|
RI_MOUSE_BUTTON_5_UP :: 0x0200
|
||||||
RI_MOUSE_WHEEL :: 0x0400
|
RI_MOUSE_WHEEL :: 0x0400
|
||||||
RI_MOUSE_HWHEEL :: 0x0800
|
RI_MOUSE_HWHEEL :: 0x0800
|
||||||
|
|
||||||
|
WINDOWPLACEMENT :: struct {
|
||||||
|
length: UINT,
|
||||||
|
flags: UINT,
|
||||||
|
showCmd: UINT,
|
||||||
|
ptMinPosition: POINT,
|
||||||
|
ptMaxPosition: POINT,
|
||||||
|
rcNormalPosition: RECT,
|
||||||
|
rcDevice: RECT,
|
||||||
|
}
|
||||||
|
|
||||||
|
WINDOWINFO :: struct {
|
||||||
|
cbSize: DWORD,
|
||||||
|
rcWindow: RECT,
|
||||||
|
rcClient: RECT,
|
||||||
|
dwStyle: DWORD,
|
||||||
|
dwExStyle: DWORD,
|
||||||
|
dwWindowStatus: DWORD,
|
||||||
|
cxWindowBorders: UINT,
|
||||||
|
cyWindowBorders: UINT,
|
||||||
|
atomWindowType: ATOM,
|
||||||
|
wCreatorVersion: WORD,
|
||||||
|
}
|
||||||
|
PWINDOWINFO :: ^WINDOWINFO
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// +build windows
|
||||||
|
package sys_windows
|
||||||
|
|
||||||
|
foreign import uxtheme "system:UxTheme.lib"
|
||||||
|
|
||||||
|
MARGINS :: distinct [4]int
|
||||||
|
PMARGINS :: ^MARGINS
|
||||||
|
|
||||||
|
@(default_calling_convention="stdcall")
|
||||||
|
foreign uxtheme {
|
||||||
|
IsThemeActive :: proc() -> BOOL ---
|
||||||
|
}
|
||||||
@@ -562,6 +562,7 @@ gb_internal void tpool_wake_addr(Futex *addr) {
|
|||||||
if (ret >= 0) {
|
if (ret >= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ret = -ret;
|
||||||
if (ret == EINTR || ret == EFAULT) {
|
if (ret == EINTR || ret == EFAULT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -581,6 +582,7 @@ gb_internal void tpool_wait_on_addr(Futex *addr, Footex val) {
|
|||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
ret = -ret;
|
||||||
if (ret == EINTR || ret == EFAULT) {
|
if (ret == EINTR || ret == EFAULT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user