save before merging from upstream

This commit is contained in:
jason
2024-06-19 12:33:05 -04:00
parent 20c17ba6f9
commit a9b6d28291
2 changed files with 81 additions and 2 deletions
+17 -2
View File
@@ -38,15 +38,29 @@ foreign kernel32 {
lpNumberOfCharsWritten: LPDWORD,
lpReserved: LPVOID) -> BOOL ---
PeekConsoleInputW :: proc(hConsoleInput: HANDLE,
lpBuffer: ^INPUT_RECORD,
nLength: DWORD,
lpNumberOfEventsRead: LPDWORD) -> BOOL ---
ReadConsoleInputW :: proc(hConsoleInput: HANDLE,
lpBuffer: ^INPUT_RECORD,
nLength: DWORD,
lpNumberOfEventsRead: LPDWORD) -> BOOL ---
GetConsoleMode :: proc(hConsoleHandle: HANDLE,
lpMode: LPDWORD) -> BOOL ---
SetConsoleMode :: proc(hConsoleHandle: HANDLE,
dwMode: DWORD) -> BOOL ---
SetConsoleCursorPosition :: proc(hConsoleHandle: HANDLE,
dwCursorPosition: COORD) -> BOOL ---
dwCursorPosition: COORD) -> BOOL ---
SetConsoleTextAttribute :: proc(hConsoleOutput: HANDLE,
wAttributes: WORD) -> BOOL ---
wAttributes: WORD) -> BOOL ---
GetConsoleCP :: proc() -> UINT ---
SetConsoleCP :: proc(wCodePageID: UINT) -> BOOL ---
GetConsoleOutputCP :: proc() -> UINT ---
SetConsoleOutputCP :: proc(wCodePageID: UINT) -> BOOL ---
FlushConsoleInputBuffer :: proc(hConsoleInput: HANDLE) -> BOOL ---
GetFileInformationByHandle :: proc(hFile: HANDLE, lpFileInformation: LPBY_HANDLE_FILE_INFORMATION) -> BOOL ---
SetHandleInformation :: proc(hObject: HANDLE,
@@ -84,6 +98,7 @@ foreign kernel32 {
RemoveDirectoryW :: proc(lpPathName: LPCWSTR) -> BOOL ---
SetFileAttributesW :: proc(lpFileName: LPCWSTR, dwFileAttributes: DWORD) -> BOOL ---
SetLastError :: proc(dwErrCode: DWORD) ---
//ClearCommError :: proc(hFile: HANDLE, lpErrors: LPDWORD, lpStat: LPCOMSTAT) -> BOOL ---
GetCommandLineW :: proc() -> LPCWSTR ---
GetTempPathW :: proc(nBufferLength: DWORD, lpBuffer: LPCWSTR) -> DWORD ---
GetCurrentProcess :: proc() -> HANDLE ---
+64
View File
@@ -3974,6 +3974,70 @@ CONSOLE_CURSOR_INFO :: struct {
PCONSOLE_SCREEN_BUFFER_INFO :: ^CONSOLE_SCREEN_BUFFER_INFO
PCONSOLE_CURSOR_INFO :: ^CONSOLE_CURSOR_INFO
Event_Type :: enum WORD {
KEY_EVENT = 0x0001,
MOUSE_EVENT = 0x0002,
WINDOW_BUFFER_SIZE_EVENT = 0x0004,
MENU_EVENT = 0x0008,
FOCUS_EVENT = 0x0010,
}
INPUT_RECORD :: struct {
EventType: Event_Type,
Event: struct #raw_union {
KeyEvent: KEY_EVENT_RECORD,
MouseEvent: MOUSE_EVENT_RECORD,
WindowBufferSizeEvent: WINDOW_BUFFER_SIZE_RECORD,
MenuEvent: MENU_EVENT_RECORD,
FocusEvent: FOCUS_EVENT_RECORD,
},
}
Control_Key_State_Bits :: enum {
RIGHT_ALT_PRESSED,
LEFT_ALT_PRESSED,
RIGHT_CTRL_PRESSED,
LEFT_CTRL_PRESSED,
SHIFT_PRESSED,
NUMLOCK_ON,
SCROLLLOCK_ON,
CAPSLOCK_ON,
ENHANCED_KEY,
}
Control_Key_State :: bit_set[Control_Key_State_Bits; DWORD]
KEY_EVENT_RECORD :: struct {
bKeyDown: BOOL,
wRepeatCount: WORD,
wVirtualKeyCode: WORD,
wVirtualScanCode: WORD,
uChar: struct #raw_union {
UnicodeChar: WCHAR,
AsciiChar: CHAR,
},
dwControlKeyState: Control_Key_State,
};
MOUSE_EVENT_RECORD :: struct {
dwMousePosition: COORD,
dwButtonState: DWORD,
dwControlKeyState: DWORD,
dwEventFlags: DWORD,
}
WINDOW_BUFFER_SIZE_RECORD :: struct {
dwSize: COORD,
}
MENU_EVENT_RECORD :: struct {
dwCommandId: UINT,
}
FOCUS_EVENT_RECORD :: struct {
bSetFocus: BOOL,
}
//
// Networking
//