mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-03 05:08:14 +00:00
Merge branch 'master' into extend_win32_api_types
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#+build windows
|
||||
package sys_windows
|
||||
|
||||
foreign import "system:icu.lib"
|
||||
|
||||
UError :: enum i32 {
|
||||
U_ZERO_ERROR = 0,
|
||||
}
|
||||
|
||||
@(default_calling_convention="system")
|
||||
foreign icu {
|
||||
ucal_getWindowsTimeZoneID :: proc(id: wstring, len: i32, winid: wstring, winidCapacity: i32, status: ^UError) -> i32 ---
|
||||
ucal_getDefaultTimeZone :: proc(result: wstring, cap: i32, status: ^UError) -> i32 ---
|
||||
}
|
||||
@@ -4545,7 +4545,7 @@ DNS_RECORD :: struct { // aka DNS_RECORDA
|
||||
Flags: DWORD,
|
||||
dwTtl: DWORD,
|
||||
_: DWORD,
|
||||
Data: struct #raw_union {
|
||||
Data: struct #raw_union #align(4) {
|
||||
CNAME: DNS_PTR_DATAA,
|
||||
A: u32be, // Ipv4 Address
|
||||
AAAA: u128be, // Ipv6 Address
|
||||
|
||||
@@ -51,6 +51,7 @@ foreign user32 {
|
||||
IsWindowVisible :: proc(hwnd: HWND) -> BOOL ---
|
||||
IsWindowEnabled :: proc(hwnd: HWND) -> BOOL ---
|
||||
IsIconic :: proc(hwnd: HWND) -> BOOL ---
|
||||
IsZoomed :: proc(hwnd: HWND) -> BOOL ---
|
||||
BringWindowToTop :: proc(hWnd: HWND) -> BOOL ---
|
||||
GetTopWindow :: proc(hWnd: HWND) -> HWND ---
|
||||
SetForegroundWindow :: proc(hWnd: HWND) -> BOOL ---
|
||||
@@ -548,7 +549,7 @@ RI_KEY_TERMSRV_SHADOW :: 0x10
|
||||
MOUSE_MOVE_RELATIVE :: 0x00
|
||||
MOUSE_MOVE_ABSOLUTE :: 0x01
|
||||
MOUSE_VIRTUAL_DESKTOP :: 0x02
|
||||
MOUSE_ATTRIUBTTES_CHANGED :: 0x04
|
||||
MOUSE_ATTRIBUTES_CHANGED :: 0x04
|
||||
MOUSE_MOVE_NOCOALESCE :: 0x08
|
||||
|
||||
RI_MOUSE_BUTTON_1_DOWN :: 0x0001
|
||||
@@ -781,3 +782,64 @@ CF_GDIOBJLAST :: 0x03FF
|
||||
CF_OWNERDISPLAY :: 0x0080
|
||||
CF_PRIVATEFIRST :: 0x0200
|
||||
CF_PRIVATELAST :: 0x02FF
|
||||
|
||||
STICKYKEYS :: struct {
|
||||
cbSize: UINT,
|
||||
dwFlags: DWORD,
|
||||
}
|
||||
LPSTICKYKEYS :: ^STICKYKEYS
|
||||
|
||||
SKF_STICKYKEYSON :: 0x1
|
||||
SKF_AVAILABLE :: 0x2
|
||||
SKF_HOTKEYACTIVE :: 0x4
|
||||
SKF_CONFIRMHOTKEY :: 0x8
|
||||
SKF_HOTKEYSOUND :: 0x10
|
||||
SKF_INDICATOR :: 0x20
|
||||
SKF_AUDIBLEFEEDBACK :: 0x40
|
||||
SKF_TRISTATE :: 0x80
|
||||
SKF_TWOKEYSOFF :: 0x100
|
||||
SKF_LSHIFTLOCKED :: 0x10000
|
||||
SKF_RSHIFTLOCKED :: 0x20000
|
||||
SKF_LCTLLOCKED :: 0x40000
|
||||
SKF_RCTLLOCKED :: 0x80000
|
||||
SKF_LALTLOCKED :: 0x100000
|
||||
SKF_RALTLOCKED :: 0x200000
|
||||
SKF_LWINLOCKED :: 0x400000
|
||||
SKF_RWINLOCKED :: 0x800000
|
||||
SKF_LSHIFTLATCHED :: 0x1000000
|
||||
SKF_RSHIFTLATCHED :: 0x2000000
|
||||
SKF_LCTLLATCHED :: 0x4000000
|
||||
SKF_RCTLLATCHED :: 0x8000000
|
||||
SKF_LALTLATCHED :: 0x10000000
|
||||
SKF_RALTLATCHED :: 0x20000000
|
||||
|
||||
TOGGLEKEYS :: struct {
|
||||
cbSize: UINT,
|
||||
dwFlags: DWORD,
|
||||
}
|
||||
LPTOGGLEKEYS :: ^TOGGLEKEYS
|
||||
|
||||
TKF_TOGGLEKEYSON :: 0x1
|
||||
TKF_AVAILABLE :: 0x2
|
||||
TKF_HOTKEYACTIVE :: 0x4
|
||||
TKF_CONFIRMHOTKEY :: 0x8
|
||||
TKF_HOTKEYSOUND :: 0x10
|
||||
TKF_INDICATOR :: 0x20
|
||||
|
||||
FILTERKEYS :: struct {
|
||||
cbSize: UINT,
|
||||
dwFlags: DWORD,
|
||||
iWaitMSec: DWORD,
|
||||
iDelayMSec: DWORD,
|
||||
iRepeatMSec: DWORD,
|
||||
iBounceMSec: DWORD,
|
||||
}
|
||||
LPFILTERKEYS :: ^FILTERKEYS
|
||||
|
||||
FKF_FILTERKEYSON :: 0x1
|
||||
FKF_AVAILABLE :: 0x2
|
||||
FKF_HOTKEYACTIVE :: 0x4
|
||||
FKF_CONFIRMHOTKEY :: 0x8
|
||||
FKF_HOTKEYSOUND :: 0x10
|
||||
FKF_INDICATOR :: 0x20
|
||||
FKF_CLICKON :: 0x40
|
||||
|
||||
@@ -3,7 +3,7 @@ package sys_windows
|
||||
|
||||
foreign import uxtheme "system:UxTheme.lib"
|
||||
|
||||
MARGINS :: distinct [4]int
|
||||
MARGINS :: distinct [4]i32
|
||||
PMARGINS :: ^MARGINS
|
||||
|
||||
@(default_calling_convention="system")
|
||||
|
||||
@@ -251,26 +251,26 @@ SEVERITY :: enum DWORD {
|
||||
// Generic test for success on any status value (non-negative numbers indicate success).
|
||||
SUCCEEDED :: #force_inline proc "contextless" (#any_int result: int) -> bool { return result >= S_OK }
|
||||
// and the inverse
|
||||
FAILED :: #force_inline proc(#any_int result: int) -> bool { return result < S_OK }
|
||||
FAILED :: #force_inline proc "contextless" (#any_int result: int) -> bool { return result < S_OK }
|
||||
|
||||
// Generic test for error on any status value.
|
||||
IS_ERROR :: #force_inline proc(#any_int status: int) -> bool { return u32(status) >> 31 == u32(SEVERITY.ERROR) }
|
||||
IS_ERROR :: #force_inline proc "contextless" (#any_int status: int) -> bool { return u32(status) >> 31 == u32(SEVERITY.ERROR) }
|
||||
|
||||
// Return the code
|
||||
HRESULT_CODE :: #force_inline proc(#any_int hr: int) -> int { return int(u32(hr) & 0xFFFF) }
|
||||
HRESULT_CODE :: #force_inline proc "contextless" (#any_int hr: int) -> int { return int(u32(hr) & 0xFFFF) }
|
||||
|
||||
// Return the facility
|
||||
HRESULT_FACILITY :: #force_inline proc(#any_int hr: int) -> FACILITY { return FACILITY((u32(hr) >> 16) & 0x1FFF) }
|
||||
HRESULT_FACILITY :: #force_inline proc "contextless" (#any_int hr: int) -> FACILITY { return FACILITY((u32(hr) >> 16) & 0x1FFF) }
|
||||
|
||||
// Return the severity
|
||||
HRESULT_SEVERITY :: #force_inline proc(#any_int hr: int) -> SEVERITY { return SEVERITY((u32(hr) >> 31) & 0x1) }
|
||||
HRESULT_SEVERITY :: #force_inline proc "contextless" (#any_int hr: int) -> SEVERITY { return SEVERITY((u32(hr) >> 31) & 0x1) }
|
||||
|
||||
// Create an HRESULT value from component pieces
|
||||
MAKE_HRESULT :: #force_inline proc(#any_int sev: int, #any_int fac: int, #any_int code: int) -> HRESULT {
|
||||
MAKE_HRESULT :: #force_inline proc "contextless" (#any_int sev: int, #any_int fac: int, #any_int code: int) -> HRESULT {
|
||||
return HRESULT((uint(sev)<<31) | (uint(fac)<<16) | (uint(code)))
|
||||
}
|
||||
|
||||
DECODE_HRESULT :: #force_inline proc(#any_int hr: int) -> (SEVERITY, FACILITY, int) {
|
||||
DECODE_HRESULT :: #force_inline proc "contextless" (#any_int hr: int) -> (SEVERITY, FACILITY, int) {
|
||||
return HRESULT_SEVERITY(hr), HRESULT_FACILITY(hr), HRESULT_CODE(hr)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user