Mercurial > games > semicongine
comparison semiconginev2/old/thirdparty/x11/xresource.nim @ 1218:56781cc0fc7c compiletime-tests
did: renamge main package
author | sam <sam@basx.dev> |
---|---|
date | Wed, 17 Jul 2024 21:01:37 +0700 |
parents | semicongine/old/thirdparty/x11/xresource.nim@239adab121a3 |
children |
comparison
equal
deleted
inserted
replaced
1217:f819a874058f | 1218:56781cc0fc7c |
---|---|
1 | |
2 import | |
3 x, xlib | |
4 | |
5 #const | |
6 # libX11* = "libX11.so" | |
7 | |
8 # | |
9 # Automatically converted by H2Pas 0.99.15 from xresource.h | |
10 # The following command line parameters were used: | |
11 # -p | |
12 # -T | |
13 # -S | |
14 # -d | |
15 # -c | |
16 # xresource.h | |
17 # | |
18 | |
19 proc Xpermalloc*(para1: int32): cstring{.cdecl, dynlib: libX11, importc.} | |
20 | |
21 type | |
22 PXrmQuark* = ptr XrmQuark | |
23 XrmQuark* = int32 | |
24 | |
25 XrmQuarkList* = PXrmQuark | |
26 PXrmQuarkList* = ptr XrmQuarkList | |
27 | |
28 proc NULLQUARK*(): XrmQuark | |
29 | |
30 type | |
31 PXrmString* = ptr XrmString | |
32 XrmString* = ptr char | |
33 | |
34 proc NULLSTRING*(): XrmString | |
35 proc XrmStringToQuark*(para1: cstring): XrmQuark{.cdecl, dynlib: libX11, | |
36 importc.} | |
37 proc XrmPermStringToQuark*(para1: cstring): XrmQuark{.cdecl, dynlib: libX11, | |
38 importc.} | |
39 proc XrmQuarkToString*(para1: XrmQuark): XrmString{.cdecl, dynlib: libX11, | |
40 importc.} | |
41 proc XrmUniqueQuark*(): XrmQuark{.cdecl, dynlib: libX11, importc.} | |
42 #when defined(MACROS): | |
43 proc XrmStringsEqual*(a1, a2: cstring): bool | |
44 | |
45 type | |
46 PXrmBinding* = ptr XrmBinding | |
47 XrmBinding* = enum | |
48 XrmBindTightly, XrmBindLoosely | |
49 | |
50 XrmBindingList* = PXrmBinding | |
51 PXrmBindingList* = ptr XrmBindingList | |
52 | |
53 proc XrmStringToQuarkList*(para1: cstring, para2: XrmQuarkList){.cdecl, | |
54 dynlib: libX11, importc.} | |
55 proc XrmStringToBindingQuarkList*(para1: cstring, para2: XrmBindingList, | |
56 para3: XrmQuarkList){.cdecl, dynlib: libX11, | |
57 importc.} | |
58 | |
59 type | |
60 PXrmName* = ptr XrmName | |
61 XrmName* = XrmQuark | |
62 | |
63 PXrmNameList* = ptr XrmNameList | |
64 XrmNameList* = XrmQuarkList | |
65 | |
66 #when defined(MACROS): | |
67 proc XrmNameToString*(name: int32): XrmString | |
68 proc XrmStringToName*(str: cstring): int32 | |
69 proc XrmStringToNameList*(str: cstring, name: PXrmQuark) | |
70 | |
71 type | |
72 PXrmClass* = ptr XrmClass | |
73 XrmClass* = XrmQuark | |
74 | |
75 PXrmClassList* = ptr XrmClassList | |
76 XrmClassList* = XrmQuarkList | |
77 | |
78 #when defined(MACROS): | |
79 proc XrmClassToString*(c_class: int32): XrmString | |
80 proc XrmStringToClass*(c_class: cstring): int32 | |
81 proc XrmStringToClassList*(str: cstring, c_class: PXrmQuark) | |
82 | |
83 type | |
84 PXrmRepresentation* = ptr XrmRepresentation | |
85 XrmRepresentation* = XrmQuark | |
86 | |
87 #when defined(MACROS): | |
88 proc XrmStringToRepresentation*(str: cstring): int32 | |
89 proc XrmRepresentationToString*(thetype: int32): XrmString | |
90 | |
91 type | |
92 PXrmValue* = ptr XrmValue | |
93 XrmValue*{.final.} = object | |
94 size*: int32 | |
95 address*: XPointer | |
96 | |
97 PXrmValuePtr* = ptr XrmValuePtr | |
98 XrmValuePtr* = PXrmValue | |
99 | |
100 PXrmHashBucketRec* = ptr XrmHashBucketRec | |
101 XrmHashBucketRec*{.final.} = object | |
102 | |
103 PXrmHashBucket* = ptr XrmHashBucket | |
104 XrmHashBucket* = PXrmHashBucketRec | |
105 | |
106 PXrmHashTable* = ptr XrmHashTable | |
107 XrmHashTable* = ptr XrmHashBucket | |
108 | |
109 PXrmDatabase* = ptr XrmDatabase | |
110 XrmDatabase* = PXrmHashBucketRec | |
111 | |
112 proc XrmDestroyDatabase*(para1: XrmDatabase){.cdecl, dynlib: libX11, importc.} | |
113 proc XrmQPutResource*(para1: PXrmDatabase, para2: XrmBindingList, | |
114 para3: XrmQuarkList, para4: XrmRepresentation, | |
115 para5: PXrmValue){.cdecl, dynlib: libX11, importc.} | |
116 proc XrmPutResource*(para1: PXrmDatabase, para2: cstring, para3: cstring, | |
117 para4: PXrmValue){.cdecl, dynlib: libX11, importc.} | |
118 proc XrmQPutStringResource*(para1: PXrmDatabase, para2: XrmBindingList, | |
119 para3: XrmQuarkList, para4: cstring){.cdecl, | |
120 dynlib: libX11, importc.} | |
121 proc XrmPutStringResource*(para1: PXrmDatabase, para2: cstring, para3: cstring){. | |
122 cdecl, dynlib: libX11, importc.} | |
123 proc XrmPutLineResource*(para1: PXrmDatabase, para2: cstring){.cdecl, | |
124 dynlib: libX11, importc.} | |
125 proc XrmQGetResource*(para1: XrmDatabase, para2: XrmNameList, | |
126 para3: XrmClassList, para4: PXrmRepresentation, | |
127 para5: PXrmValue): XBool{.cdecl, dynlib: libX11, importc.} | |
128 proc XrmGetResource*(para1: XrmDatabase, para2: cstring, para3: cstring, | |
129 para4: PPchar, para5: PXrmValue): XBool{.cdecl, | |
130 dynlib: libX11, importc.} | |
131 # There is no definition of XrmSearchList | |
132 #function XrmQGetSearchList(para1:XrmDatabase; para2:XrmNameList; para3:XrmClassList; para4:XrmSearchList; para5:longint):XBool;cdecl;external libX11; | |
133 #function XrmQGetSearchResource(para1:XrmSearchList; para2:XrmName; para3:XrmClass; para4:PXrmRepresentation; para5:PXrmValue):XBool;cdecl;external libX11; | |
134 proc XrmSetDatabase*(para1: PDisplay, para2: XrmDatabase){.cdecl, | |
135 dynlib: libX11, importc.} | |
136 proc XrmGetDatabase*(para1: PDisplay): XrmDatabase{.cdecl, dynlib: libX11, | |
137 importc.} | |
138 proc XrmGetFileDatabase*(para1: cstring): XrmDatabase{.cdecl, dynlib: libX11, | |
139 importc.} | |
140 proc XrmCombineFileDatabase*(para1: cstring, para2: PXrmDatabase, para3: XBool): Status{. | |
141 cdecl, dynlib: libX11, importc.} | |
142 proc XrmGetStringDatabase*(para1: cstring): XrmDatabase{.cdecl, dynlib: libX11, | |
143 importc.} | |
144 proc XrmPutFileDatabase*(para1: XrmDatabase, para2: cstring){.cdecl, | |
145 dynlib: libX11, importc.} | |
146 proc XrmMergeDatabases*(para1: XrmDatabase, para2: PXrmDatabase){.cdecl, | |
147 dynlib: libX11, importc.} | |
148 proc XrmCombineDatabase*(para1: XrmDatabase, para2: PXrmDatabase, para3: XBool){. | |
149 cdecl, dynlib: libX11, importc.} | |
150 const | |
151 XrmEnumAllLevels* = 0 | |
152 XrmEnumOneLevel* = 1 | |
153 | |
154 type | |
155 funcbool* = proc (): XBool {.cdecl.} | |
156 | |
157 proc XrmEnumerateDatabase*(para1: XrmDatabase, para2: XrmNameList, | |
158 para3: XrmClassList, para4: int32, para5: funcbool, | |
159 para6: XPointer): XBool{.cdecl, dynlib: libX11, | |
160 importc.} | |
161 proc XrmLocaleOfDatabase*(para1: XrmDatabase): cstring{.cdecl, dynlib: libX11, | |
162 importc.} | |
163 | |
164 type | |
165 PXrmOptionKind* = ptr XrmOptionKind | |
166 XrmOptionKind* = enum | |
167 XrmoptionNoArg, XrmoptionIsArg, XrmoptionStickyArg, XrmoptionSepArg, | |
168 XrmoptionResArg, XrmoptionSkipArg, XrmoptionSkipLine, XrmoptionSkipNArgs | |
169 | |
170 PXrmOptionDescRec* = ptr XrmOptionDescRec | |
171 XrmOptionDescRec*{.final.} = object | |
172 option*: cstring | |
173 specifier*: cstring | |
174 argKind*: XrmOptionKind | |
175 value*: XPointer | |
176 | |
177 XrmOptionDescList* = PXrmOptionDescRec | |
178 PXrmOptionDescList* = ptr XrmOptionDescList | |
179 | |
180 proc XrmParseCommand*(para1: PXrmDatabase, para2: XrmOptionDescList, | |
181 para3: int32, para4: cstring, para5: ptr int32, | |
182 para6: PPchar){.cdecl, dynlib: libX11, importc.} | |
183 # implementation | |
184 | |
185 proc NULLQUARK(): XrmQuark = | |
186 result = XrmQuark(0) | |
187 | |
188 proc NULLSTRING(): XrmString = | |
189 result = nil | |
190 | |
191 #when defined(MACROS): | |
192 proc XrmStringsEqual(a1, a2: cstring): bool = | |
193 #result = (strcomp(a1, a2)) == 0 | |
194 $a1 == $a2 | |
195 | |
196 proc XrmNameToString(name: int32): XrmString = | |
197 result = XrmQuarkToString(name) | |
198 | |
199 proc XrmStringToName(str: cstring): int32 = | |
200 result = XrmStringToQuark(str) | |
201 | |
202 proc XrmStringToNameList(str: cstring, name: PXrmQuark) = | |
203 XrmStringToQuarkList(str, name) | |
204 | |
205 proc XrmClassToString(c_class: int32): XrmString = | |
206 result = XrmQuarkToString(c_class) | |
207 | |
208 proc XrmStringToClass(c_class: cstring): int32 = | |
209 result = XrmStringToQuark(c_class) | |
210 | |
211 proc XrmStringToClassList(str: cstring, c_class: PXrmQuark) = | |
212 XrmStringToQuarkList(str, c_class) | |
213 | |
214 proc XrmStringToRepresentation(str: cstring): int32 = | |
215 result = XrmStringToQuark(str) | |
216 | |
217 proc XrmRepresentationToString(thetype: int32): XrmString = | |
218 result = XrmQuarkToString(thetype) |