Module folder working
This commit is contained in:
39
programs/modules/gdi32.kl
Normal file
39
programs/modules/gdi32.kl
Normal file
@@ -0,0 +1,39 @@
|
||||
#import "kernel32.kl"
|
||||
RBGQUAD :: struct;; rgbBlue: BYTE; rgbGreen: BYTE; rgbRed: BYTE; rgbReserved: BYTE
|
||||
BITMAPINFOHEADER :: struct;; biSize: DWORD; biWidth: LONG; biHeight: LONG; biPlanes: WORD; biBitCount: WORD; biCompression: DWORD; biSizeImage: DWORD; biXPelsPerMeter: LONG; biYPelsPerMeter: LONG; biClrUsed: DWORD; biClrImportant: DWORD
|
||||
BITMAPINFO :: struct;; bmiHeader: BITMAPINFOHEADER; bmiColors: [1]RBGQUAD
|
||||
HGDIOBJ :: HANDLE
|
||||
|
||||
BI_RGB :: 0x0000
|
||||
BI_RLE8 :: 0x0001
|
||||
BI_RLE4 :: 0x0002
|
||||
BI_BITFIELDS :: 0x0003
|
||||
BI_JPEG :: 0x0004
|
||||
BI_PNG :: 0x0005
|
||||
BI_CMYK :: 0x000B
|
||||
BI_CMYKRLE8 :: 0x000C
|
||||
BI_CMYKRLE4 :: 0x000
|
||||
DIB_RGB_COLORS :: 0x00
|
||||
|
||||
SRCCOPY :: 0x00CC0020 /* dest = source */
|
||||
SRCPAINT :: 0x00EE0086 /* dest = source OR dest */
|
||||
SRCAND :: 0x008800C6 /* dest = source AND dest */
|
||||
SRCINVERT :: 0x00660046 /* dest = source XOR dest */
|
||||
SRCERASE :: 0x00440328 /* dest = source AND (NOT dest ) */
|
||||
NOTSRCCOPY :: 0x00330008 /* dest = (NOT source) */
|
||||
NOTSRCERASE :: 0x001100A6 /* dest = (NOT src) AND (NOT dest) */
|
||||
MERGECOPY :: 0x00C000CA /* dest = (source AND pattern) */
|
||||
MERGEPAINT :: 0x00BB0226 /* dest = (NOT source) OR dest */
|
||||
PATCOPY :: 0x00F00021 /* dest = pattern */
|
||||
PATPAINT :: 0x00FB0A09 /* dest = DPSnoo */
|
||||
PATINVERT :: 0x005A0049 /* dest = pattern XOR dest */
|
||||
DSTINVERT :: 0x00550009 /* dest = (NOT dest) */
|
||||
BLACKNESS :: 0x00000042 /* dest = BLACK */
|
||||
WHITENESS :: 0x00FF0062 /* dest = WHITE */
|
||||
|
||||
|
||||
// #import #foreign "gdi32.lib" @todo
|
||||
CreateDIBSection :: #foreign (hdc: HDC, pbmi: *BITMAPINFO, usage: UINT, ppvBits: **VOID, hSection: HANDLE, offset: DWORD): HBITMAP
|
||||
CreateCompatibleDC :: #foreign (hdc: HDC): HDC
|
||||
SelectObject :: #foreign (hdc: HDC, h: HGDIOBJ): HGDIOBJ
|
||||
BitBlt :: #foreign (hdc: HDC, x: int, y: int, cx: int, cy: int, hdcSrc: HDC, x1: int, y1: int, ro: DWORD): BOOL
|
||||
60
programs/modules/kernel32.kl
Normal file
60
programs/modules/kernel32.kl
Normal file
@@ -0,0 +1,60 @@
|
||||
DWORD :: U32
|
||||
LPCSTR :: *char
|
||||
LPSTR :: *char
|
||||
LPCWSTR :: *U16
|
||||
HWND :: *void
|
||||
HMENU :: *void
|
||||
HINSTANCE :: *void
|
||||
HBITMAP :: *void
|
||||
HDC :: *void
|
||||
LPVOID :: *void
|
||||
SIZE_T :: U64
|
||||
BOOL :: int
|
||||
HANDLE :: *void
|
||||
VOID :: void
|
||||
HICON :: HANDLE
|
||||
HCURSOR :: HANDLE
|
||||
HBRUSH :: HANDLE
|
||||
LPDWORD :: *DWORD
|
||||
LRESULT :: S64
|
||||
WPARAM :: U64
|
||||
LPARAM :: S64
|
||||
BYTE :: U8 // @todo? unsigned char
|
||||
WORD :: S16 // short
|
||||
LONG :: S32 // @todo long
|
||||
UINT :: U32 // @todo uint
|
||||
ATOM :: WORD
|
||||
LARGE_INTEGER :: S64
|
||||
|
||||
MEM_COMMIT :: 0x00001000
|
||||
MEM_RESERVE :: 0x00002000
|
||||
MEM_RESET :: 0x00080000
|
||||
MEM_RESET_UNDO :: 0x1000000
|
||||
MEM_DECOMMIT :: 0x00004000
|
||||
MEM_RELEASE :: 0x00008000
|
||||
|
||||
PAGE_NOACCESS :: 1
|
||||
PAGE_READONLY :: 2
|
||||
PAGE_READWRITE :: 4
|
||||
PAGE_WRITECOPY :: 8
|
||||
PAGE_EXECUTE :: 0x10; PAGE_EXECUTE_READ :: 0x20; PAGE_EXECUTE_READWRITE :: 0x40; PAGE_EXECUTE_WRITECOPY :: 0x80
|
||||
VirtualAlloc :: #foreign (lpAddress: LPVOID, dwSize: SIZE_T, flAllocationType: DWORD, flProtect: DWORD): LPVOID
|
||||
VirtualFree :: #foreign (lpAddress: LPVOID, dwSize: SIZE_T, dwFreeType: DWORD): BOOL
|
||||
|
||||
HEAP_ZERO_MEMORY :: 0x8; HEAP_NO_SERIALIZE :: 0x1; HEAP_GENERATE_EXCEPTIONS :: 0x4
|
||||
GetProcessHeap :: #foreign (): HANDLE
|
||||
HeapAlloc :: #foreign (hHeap: HANDLE, dwFlags: DWORD, dwByte: SIZE_T): LPVOID
|
||||
HeapFree :: #foreign (hHeap: HANDLE, dwFlags: DWORD, lpMe: LPVOID): BOOL
|
||||
|
||||
STD_INPUT_HANDLE :: 4294967286//(-10)->DWORD
|
||||
STD_OUTPUT_HANDLE :: 4294967285//(-11)->DWORD
|
||||
//STD_ERROR_HANDLE :: (-12)->DWORD
|
||||
GetStdHandle :: #foreign (nStdHandle: DWORD): HANDLE
|
||||
WriteConsoleA :: #foreign (hConsoleOutput: HANDLE,lpBuffer: *VOID,nNumberOfCharsToWrite: DWORD,lpNumberOfCharsWritten: LPDWORD,lpReserve: LPVOID): BOOL
|
||||
WriteConsoleW :: #foreign (hConsoleOutput: HANDLE,lpBuffer: *VOID,nNumberOfCharsToWrite: DWORD,lpNumberOfCharsWritten: LPDWORD,lpReserve: LPVOID): BOOL
|
||||
|
||||
GetLastError :: #foreign (): DWORD
|
||||
QueryPerformanceFrequency :: #foreign (lpFrequency: *LARGE_INTEGER): BOOL
|
||||
QueryPerformanceCounter :: #foreign (lpFrequency: *LARGE_INTEGER): BOOL
|
||||
Sleep :: #foreign (dwMilliseconds: DWORD)
|
||||
OutputDebugStringA :: #foreign (lpOutputString: LPCSTR)
|
||||
53
programs/modules/user32.kl
Normal file
53
programs/modules/user32.kl
Normal file
@@ -0,0 +1,53 @@
|
||||
#import "kernel32.kl"
|
||||
WNDPROC :: (hwnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT
|
||||
WNDCLASSW :: struct;; style: UINT; lpfnWndProc: WNDPROC; cbClsExtra: int; cbWndExtra: int; hInstance: HINSTANCE; hIcon: HICON; hCursor: HCURSOR; hbrBackground: HBRUSH; lpszMenuName: LPCWSTR; lpszClassName: LPCWSTR
|
||||
MSG :: struct;; hwnd: HWND; message: UINT; wParam: WPARAM; lParam: LPARAM; time: DWORD; pt: POINT; lPrivate: DWORD
|
||||
POINT :: struct;; x: LONG; y: LONG
|
||||
LPMSG :: *MSG
|
||||
|
||||
PostQuitMessage :: #foreign (nExitCode: int)
|
||||
DefWindowProcW :: #foreign (hwnd: HWND, uMsg: UINT, wParam: WPARAM, lParam: LPARAM): LRESULT
|
||||
GetDC :: #foreign (hWnd: HWND): HDC
|
||||
CreateWindowA :: #foreign (dwExStyle: DWORD, lpClassName: *char, lpWindowName: *char, dwStyle: DWORD, X: int, Y: int, nWidth: int, nHeight: int, hWndParent: HWND, hMenu: HMENU, hInstance: HINSTANCE, lpParam: *void): HWND
|
||||
CreateWindowExW :: #foreign (dwExStyle: DWORD, lpClassName: LPCWSTR, lpWindowName: LPCWSTR, dwStyle: DWORD, X: int, Y: int, nWidth: int, nHeight: int, hWndParent: HWND, hMenu: HMENU, hInstance: HINSTANCE, lpParam: LPVOID): HWND
|
||||
RegisterClassW :: #foreign (lpWndClass: *WNDCLASSW): ATOM
|
||||
ShowWindow :: #foreign (hWnd: HWND, nCmdShow: int): BOOL
|
||||
PeekMessageW :: #foreign (lpMsg: LPMSG, hWnd: HWND, wMsgFilterMin: UINT, wMsgFilterMax: UINT, wRemoveMs: UINT):BOOL
|
||||
TranslateMessage:: #foreign (lpMsg: *MSG): BOOL
|
||||
DispatchMessageW:: #foreign (lpMsg: *MSG): LRESULT
|
||||
|
||||
|
||||
WM_NULL :: 0x0000; WM_CREATE :: 0x0001; WM_DESTROY :: 0x0002; WM_MOVE :: 0x0003; WM_SIZE :: 0x0005
|
||||
WM_ACTIVATE :: 0x0006; WA_INACTIVE :: 0; WA_ACTIVE :: 1; WA_CLICKACTIVE :: 2
|
||||
WM_SETFOCUS :: 0x0007; WM_KILLFOCUS :: 0x0008; WM_ENABLE :: 0x000A; WM_SETREDRAW :: 0x000B; WM_SETTEXT :: 0x000C; WM_GETTEXT :: 0x000D; WM_GETTEXTLENGTH :: 0x000E; WM_PAINT :: 0x000F; WM_CLOSE :: 0x0010
|
||||
CW_USEDEFAULT :: -2147483648//0x80000000
|
||||
|
||||
WS_BORDER :: 0x00800000
|
||||
WS_CAPTION :: 0x00C00000
|
||||
WS_CHILD :: 0x40000000
|
||||
WS_CHILDWINDOW :: 0x40000000
|
||||
WS_CLIPCHILDREN :: 0x02000000
|
||||
WS_CLIPSIBLINGS :: 0x04000000
|
||||
WS_DISABLED :: 0x08000000
|
||||
WS_DLGFRAME :: 0x00400000
|
||||
WS_GROUP :: 0x00020000
|
||||
WS_HSCROLL :: 0x00100000
|
||||
WS_ICONIC :: 0x20000000
|
||||
WS_MAXIMIZE :: 0x01000000
|
||||
WS_MAXIMIZEBOX :: 0x00010000
|
||||
WS_MINIMIZE :: 0x20000000
|
||||
WS_MINIMIZEBOX :: 0x00020000
|
||||
WS_OVERLAPPED :: 0x00000000
|
||||
WS_POPUP :: 0x80000000
|
||||
WS_SIZEBOX :: 0x00040000
|
||||
WS_SYSMENU :: 0x00080000
|
||||
WS_TABSTOP :: 0x00010000
|
||||
WS_THICKFRAME :: 0x00040000
|
||||
WS_TILED :: 0x00000000
|
||||
WS_VISIBLE :: 0x10000000
|
||||
WS_VSCROLL :: 0x00200000
|
||||
WS_OVERLAPPEDWINDOW :: WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX
|
||||
|
||||
PM_NOREMOVE :: 0
|
||||
PM_REMOVE :: 0x0001
|
||||
PM_NOYIELD :: 0x0002
|
||||
5
programs/modules/winmm.kl
Normal file
5
programs/modules/winmm.kl
Normal file
@@ -0,0 +1,5 @@
|
||||
#import "kernel32.kl"
|
||||
|
||||
MMRESULT :: UINT
|
||||
TIMERR_NOERROR :: 0
|
||||
timeBeginPeriod :: #foreign (uPeriod: UINT): MMRESULT
|
||||
Reference in New Issue
Block a user