-
Notifications
You must be signed in to change notification settings - Fork 4
/
xtypes.nim
90 lines (79 loc) · 2.16 KB
/
xtypes.nim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
## #
## # The Sciter Engine of Terra Informatica Software, Inc.
## # http://sciter.com
## #
## # The code and information provided "as-is" without
## # warranty of any kind, either expressed or implied.
## #
## # (C) 2003-2015, Terra Informatica Software, Inc.
## #
## #
## # Sciter basic types, platform isolation declarations
## #
when not defined(windows):
include widestr
type
Rect* = object
left*: int32
top*: int32
right*: int32
bottom*: int32
Point* = object
x*: int32
y*: int32
Size* = object
cx*: int32
cy*: int32
LPCWSTR_RECEIVER* = proc (str: ptr WideCString; str_length: cuint; param: pointer) {.cdecl.}
LPCSTR_RECEIVER* = proc (str: cstring; str_length: cuint; param: pointer) {.cdecl.}
LPCBYTE_RECEIVER* = proc (str: ptr byte; num_bytes: cuint; param: pointer) {.cdecl.}
when defined(windows):
import winlean
const
whdr = "<windows.h>"
# d2hdr = "<D2d1.h>"
type
HWINDOW* = pointer
WPARAM* = ByteAddress
LPARAM* = ByteAddress
LRESULT* = ByteAddress
MSG* {.header:whdr, importc.} = object
# ID2D1RenderTarget* {.header:d2hdr, importc.} = object
# IDXGISwapChain* {.header:d2hdr, importc.} = object
# IDXGISurface* {.header:d2hdr, importc.} = object
# ID2D1Factory* {.header:d2hdr, importc.} = object
# IDWriteFactory* {.header:d2hdr, importc.} = object
when hostCPU == "amd64":
const
TARGET_64* = true
SCITER_DLL_NAME* = "sciter64.dll"
else:
const
TARGET_32* = true
SCITER_DLL_NAME* = "sciter32.dll"
when defined(posix):
const
ghdr = "<gtk/gtk.h>"
type
HWINDOW* {.header:ghdr, importc:"GtkWindow*".} = pointer
HINSTANCE* = pointer
when hostCPU == "amd64":
const
TARGET_64* = true
SCITER_DLL_NAME* = "libsciter-gtk-64.so"
else:
const
TARGET_32* = true
SCITER_DLL_NAME* = "libsciter-gtk-32.so"
when defined(osx):
type
HWINDOW* = pointer # NSView*
HINSTANCE* = pointer # NSApplication*
when hostCPU == "amd64":
const
TARGET_64* = true
SCITER_DLL_NAME* = "sciter-osx-64.dylib"
else:
const
TARGET_32* = true
SCITER_DLL_NAME* = "sciter-osx-32.dylib"