Mercurial > games > semicongine
comparison semiconginev2/thirdparty/x11/xft.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/xft.nim@239adab121a3 |
children |
comparison
equal
deleted
inserted
replaced
1217:f819a874058f | 1218:56781cc0fc7c |
---|---|
1 # Converted from X11/Xft/Xft.h | |
2 import | |
3 x, | |
4 xlib, | |
5 xrender, | |
6 xutil | |
7 | |
8 const | |
9 xftLib = "libXft.so" | |
10 | |
11 # Defined in the FreeType library | |
12 type | |
13 FT_UInt* = cuint | |
14 PFT_UInt* = ptr FT_UInt | |
15 FT_Face* = object | |
16 PFT_Face* = ptr FT_Face | |
17 | |
18 # Defined in the fontconfig library | |
19 type | |
20 FcEndian* = enum | |
21 FcEndianBig, FcEndianLittle | |
22 | |
23 FcResult* = enum | |
24 FcResultMatch, FcResultNoMatch, FcResultTypeMismatch, | |
25 FcResultNoId, FcResultOutOfMemory | |
26 PFcResult* = ptr FcResult | |
27 | |
28 FcBool* = cint | |
29 | |
30 FcCharSet* = object | |
31 PFcCharSet* = ptr FcCharSet | |
32 | |
33 FcPattern* = object | |
34 PFcPattern* = ptr FcPattern | |
35 | |
36 FcFontSet* = object | |
37 nfont*: cint | |
38 sfont*: cint | |
39 fonts*: ptr PFcPattern | |
40 PFcFontSet* = ptr FcFontSet | |
41 | |
42 FcChar8* = cuchar | |
43 PFcChar8* = ptr FcChar8 | |
44 | |
45 FcChar16* = cushort | |
46 PFcChar16* = ptr FcChar16 | |
47 | |
48 FcChar32* = cuint | |
49 PFcChar32* = ptr FcChar32 | |
50 | |
51 type | |
52 XftFontInfo* = object | |
53 PXftFontInfo* = ptr XftFontInfo | |
54 XftFont* = object | |
55 ascent*: cint | |
56 descent*: cint | |
57 height*: cint | |
58 max_advance_width*: cint | |
59 charset*: PFcCharSet | |
60 pattern*: PFcPattern | |
61 PXftFont* = ptr XftFont | |
62 | |
63 XftDraw* = object | |
64 PXftDraw* = ptr XftDraw | |
65 | |
66 XftColor* = object | |
67 pixel*: culong | |
68 color*: XRenderColor | |
69 PXftColor* = ptr XftColor | |
70 | |
71 XftCharSpec* = object | |
72 ucs4*: FcChar32 | |
73 x*: cshort | |
74 y*: cshort | |
75 PXftCharSpec* = ptr XftCharSpec | |
76 | |
77 XftCharFontSpec* = object | |
78 font*: PXftFont | |
79 ucs4*: FcChar32 | |
80 x*: cshort | |
81 y*: cshort | |
82 PXftCharFontSpec* = ptr XftCharFontSpec | |
83 | |
84 XftGlyphSpec* = object | |
85 glyph*: FT_UInt | |
86 x*: cshort | |
87 y*: cshort | |
88 PXftGlyphSpec* = ptr XftGlyphSpec | |
89 | |
90 XftGlyphFontSpec* = object | |
91 font*: PXftFont | |
92 glyph*: FT_UInt | |
93 x*: cshort | |
94 y*: cshort | |
95 PXftGlyphFontSpec = ptr XftGlyphFontSpec | |
96 | |
97 # xftcolor.c | |
98 proc XftColorAllocName*( | |
99 display: PDisplay, | |
100 visual: PVisual, | |
101 cmap: Colormap, | |
102 name: cstring, | |
103 result: PXftColor | |
104 ): XBool {.cdecl, dynlib: xftLib, importc.} | |
105 | |
106 proc XftColorAllocValue*( | |
107 display: PDisplay, | |
108 visual: PVisual, | |
109 cmap: Colormap, | |
110 color: PXRenderColor, | |
111 result: PXftColor | |
112 ): XBool {.cdecl, dynlib: xftLib, importc.} | |
113 | |
114 proc XftColorFree*( | |
115 display: PDisplay, | |
116 visual: PVisual, | |
117 cmap: Colormap, | |
118 color: PXftColor | |
119 ) {.cdecl, dynlib: xftLib, importc.} | |
120 | |
121 # xftdpy.c | |
122 proc XftDefaultHasRender*( | |
123 display: PDisplay | |
124 ): XBool {.cdecl, dynlib: xftLib, importc.} | |
125 | |
126 proc XftDefaultSet*( | |
127 display: PDisplay, | |
128 defaults: PFcPattern | |
129 ): XBool {.cdecl, dynlib: xftLib, importc.} | |
130 | |
131 proc XftDefaultSubstitute*( | |
132 display: PDisplay, | |
133 screen: cint, | |
134 pattern: PFcPattern | |
135 ) {.cdecl, dynlib: xftLib, importc.} | |
136 | |
137 # xftdraw.c | |
138 proc XftDrawCreate*( | |
139 display: PDisplay, | |
140 drawable: Drawable, | |
141 visual: PVisual, | |
142 colormap: Colormap | |
143 ): PXftDraw {.cdecl, dynlib: xftLib, importc.} | |
144 | |
145 proc XftDrawCreateBitmap*( | |
146 display: PDisplay, | |
147 bitmap: Pixmap | |
148 ): PXftDraw {.cdecl, dynlib: xftLib, importc.} | |
149 | |
150 proc XftDrawCreateAlpha*( | |
151 display: PDisplay, | |
152 pixmap: Pixmap, | |
153 depth: cint | |
154 ): PXftDraw {.cdecl, dynlib: xftLib, importc.} | |
155 | |
156 proc XftDrawChange*( | |
157 draw: PXftDraw, | |
158 drawable: Drawable | |
159 ) {.cdecl, dynlib: xftLib, importc.} | |
160 | |
161 proc XftDrawDisplay*( | |
162 draw: PXftDraw | |
163 ): PDisplay {.cdecl, dynlib: xftLib, importc.} | |
164 | |
165 proc XftDrawDrawable*( | |
166 draw: PXftDraw | |
167 ): Drawable {.cdecl, dynlib: xftLib, importc.} | |
168 | |
169 proc XftDrawColormap*( | |
170 draw: PXftDraw | |
171 ): Colormap {.cdecl, dynlib: xftLib, importc.} | |
172 | |
173 proc XftDrawVisual*( | |
174 draw: PXftDraw | |
175 ): PVisual {.cdecl, dynlib: xftLib, importc.} | |
176 | |
177 proc XftDrawDestroy*( | |
178 draw: PXftDraw | |
179 ) {.cdecl, dynlib: xftLib, importc.} | |
180 | |
181 proc XftDrawPicture*( | |
182 draw: PXftDraw | |
183 ): Picture {.cdecl, dynlib: xftLib, importc.} | |
184 | |
185 proc XftDrawSrcPicture*( | |
186 draw: PXftDraw, | |
187 color: PXftColor | |
188 ): Picture {.cdecl, dynlib: xftLib, importc.} | |
189 | |
190 proc XftDrawGlyphs*( | |
191 draw: PXftDraw, | |
192 color: PXftColor, | |
193 pub: PXftFont, | |
194 x: cint, | |
195 y: cint, | |
196 glyphs: PFt_UInt, | |
197 nglyphs: cint | |
198 ) {.cdecl, dynlib: xftLib, importc.} | |
199 | |
200 proc XftDrawString8*( | |
201 draw: PXftDraw, | |
202 color: PXftColor, | |
203 pub: PXftFont, | |
204 x: cint, | |
205 y: cint, | |
206 str: PFcChar8, | |
207 len: cint | |
208 ) {.cdecl, dynlib: xftLib, importc.} | |
209 | |
210 proc XftDrawString16*( | |
211 draw: PXftDraw, | |
212 color: PXftColor, | |
213 pub: PXftFont, | |
214 x: cint, | |
215 y: cint, | |
216 str: PFcChar16, | |
217 len: cint | |
218 ) {.cdecl, dynlib: xftLib, importc.} | |
219 | |
220 proc XftDrawString32*( | |
221 draw: PXftDraw, | |
222 color: PXftColor, | |
223 pub: PXftFont, | |
224 x: cint, | |
225 y: cint, | |
226 str: PFcChar32, | |
227 len: cint | |
228 ) {.cdecl, dynlib: xftLib, importc.} | |
229 | |
230 proc XftDrawStringUtf8*( | |
231 draw: PXftDraw, | |
232 color: PXftColor, | |
233 pub: PXftFont, | |
234 x: cint, | |
235 y: cint, | |
236 str: PFcChar8, | |
237 len: cint | |
238 ) {.cdecl, dynlib: xftLib, importc.} | |
239 | |
240 proc XftDrawStringUtf16*( | |
241 draw: PXftDraw, | |
242 color: PXftColor, | |
243 pub: PXftFont, | |
244 x: cint, | |
245 y: cint, | |
246 str: PFcChar8, | |
247 len: cint | |
248 ) {.cdecl, dynlib: xftLib, importc.} | |
249 | |
250 proc XftDrawCharSpec*( | |
251 draw: PXftDraw, | |
252 color: PXftColor, | |
253 pub: PXftFont, | |
254 chars: PXftCharSpec, | |
255 len: cint | |
256 ) {.cdecl, dynlib: xftLib, importc.} | |
257 | |
258 proc XftDrawCharFontSpec*( | |
259 draw: PXftDraw, | |
260 color: PXftColor, | |
261 chars: PXftCharFontSpec, | |
262 len: cint | |
263 ) {.cdecl, dynlib: xftLib, importc.} | |
264 | |
265 proc XftDrawGlyphSpec*( | |
266 draw: PXftDraw, | |
267 color: PXftColor, | |
268 pub: PXftFont, | |
269 glyphs: PXftGlyphSpec, | |
270 len: cint | |
271 ) {.cdecl, dynlib: xftLib, importc.} | |
272 | |
273 proc XftDrawGlyphFontSpec*( | |
274 draw: PXftDraw, | |
275 color: PXftColor, | |
276 glyphs: PXftGlyphFontSpec, | |
277 len: cint | |
278 ) {.cdecl, dynlib: xftLib, importc.} | |
279 | |
280 proc XftDrawRect*( | |
281 draw: PXftDraw, | |
282 color: PXftColor, | |
283 x: cint, | |
284 y: cint, | |
285 width: cuint, | |
286 height: cuint | |
287 ) {.cdecl, dynlib: xftLib, importc.} | |
288 | |
289 proc XftDrawSetClip*( | |
290 draw: PXftDraw, | |
291 r: Region | |
292 ): XBool {.cdecl, dynlib: xftLib, importc.} | |
293 | |
294 proc XftDrawSetClipRectangles*( | |
295 draw: PXftDraw, | |
296 xOrigin: cint, | |
297 yOrigin: cint, | |
298 rects: PXRectangle, | |
299 n: cint | |
300 ): XBool {.cdecl, dynlib: xftLib, importc.} | |
301 | |
302 proc XftDrawSetSubwindowMode*( | |
303 draw: PXftDraw, | |
304 mode: cint | |
305 ) {.cdecl, dynlib: xftLib, importc.} | |
306 | |
307 # xftextent.c | |
308 proc XftGlyphExtents*( | |
309 display: PDisplay, | |
310 pub: PXftFont, | |
311 glyphs: PFT_UInt, | |
312 nglyphs: cint, | |
313 extends: PXGlyphInfo | |
314 ) {.cdecl, dynlib: xftLib, importc.} | |
315 | |
316 proc XftTextExtents8*( | |
317 display: PDisplay, | |
318 pub: PXftFont, | |
319 str: PFcChar8, | |
320 len: cint, | |
321 extents: PXGlyphInfo | |
322 ) {.cdecl, dynlib: xftLib, importc.} | |
323 | |
324 proc XftTextExtents16*( | |
325 display: PDisplay, | |
326 pub: PXftFont, | |
327 str: PFcChar16, | |
328 len: cint, | |
329 extents: PXGlyphInfo | |
330 ) {.cdecl, dynlib: xftLib, importc.} | |
331 | |
332 proc XftTextExtents32*( | |
333 display: PDisplay, | |
334 pub: PXftFont, | |
335 str: PFcChar32, | |
336 len: cint, | |
337 extents: PXGlyphInfo | |
338 ) {.cdecl, dynlib: xftLib, importc.} | |
339 | |
340 proc XftTextExtentsUtf8*( | |
341 display: PDisplay, | |
342 pub: PXftFont, | |
343 str: PFcChar8, | |
344 len: cint, | |
345 extents: PXGlyphInfo | |
346 ) {.cdecl, dynlib: xftLib, importc.} | |
347 | |
348 proc XftTextExtentsUtf16*( | |
349 display: PDisplay, | |
350 pub: PXftFont, | |
351 str: PFcChar8, | |
352 endian: FcEndian, | |
353 len: cint, | |
354 extents: PXGlyphInfo | |
355 ) {.cdecl, dynlib: xftLib, importc.} | |
356 | |
357 # xftfont.c | |
358 proc XftFontMatch*( | |
359 display: PDisplay, | |
360 screen: cint, | |
361 pattern: PFcPattern, | |
362 result: PFcResult | |
363 ): PFcPattern {.cdecl, dynlib: xftLib, importc.} | |
364 | |
365 # Expects display to be nil as an argument | |
366 proc XftFontOpen*( | |
367 display: PDisplay, | |
368 screen: cint | |
369 ): PXftFont {.cdecl, dynlib: xftLib, importc, varargs.} | |
370 | |
371 proc XftFontOpenName*( | |
372 display: PDisplay, | |
373 screen: cint, | |
374 name: cstring | |
375 ): PXftFont {.cdecl, dynlib: xftLib, importc.} | |
376 | |
377 proc XftFontOpenXlfd*( | |
378 display: PDisplay, | |
379 screen: cint, | |
380 xlfd: cstring | |
381 ): PXftFont {.cdecl, dynlib: xftLib, importc.} | |
382 | |
383 # xftfreetype.c | |
384 proc XftLockFace*( | |
385 pub: PXftFont | |
386 ): FT_Face {.cdecl, dynlib: xftLib, importc.} | |
387 | |
388 proc XftUnlockFace*( | |
389 pub: PXftFont | |
390 ) {.cdecl, dynlib: xftLib, importc.} | |
391 | |
392 proc XftFontInfoCreate*( | |
393 display: PDisplay, | |
394 pattern: PFcPattern | |
395 ): PXftFontInfo {.cdecl, dynlib: xftLib, importc.} | |
396 | |
397 proc XftFontInfoDestroy*( | |
398 display: PDisplay, | |
399 fi: PXftFontInfo | |
400 ) {.cdecl, dynlib: xftLib, importc.} | |
401 | |
402 proc XftFontInfoHash*( | |
403 fi: PXftFontInfo | |
404 ): PFcChar32 {.cdecl, dynlib: xftLib, importc.} | |
405 | |
406 proc XftFontInfoEqual*( | |
407 a: PXftFontInfo, | |
408 b: PXftFontInfo | |
409 ): FcBool {.cdecl, dynlib: xftLib, importc.} | |
410 | |
411 proc XftFontOpenInfo*( | |
412 display: PDisplay, | |
413 pattern: PFcPattern, | |
414 fi: PXftFontInfo | |
415 ): PXftFont {.cdecl, dynlib: xftLib, importc.} | |
416 | |
417 proc XftFontOpenPattern*( | |
418 display: PDisplay, | |
419 pattern: PFcPattern | |
420 ): PXftFont {.cdecl, dynlib: xftLib, importc.} | |
421 | |
422 proc XftFontCopy*( | |
423 display: PDisplay, | |
424 pub: PXftFont | |
425 ): PXftFont {.cdecl, dynlib: xftLib, importc.} | |
426 | |
427 proc XftFontClose*( | |
428 display: PDisplay, | |
429 pub: PXftFont | |
430 ) {.cdecl, dynlib: xftLib, importc.} | |
431 | |
432 proc XftInitFtLibrary*(): FcBool {.cdecl, dynlib: xftLib, importc.} | |
433 | |
434 # xftglyphs.c | |
435 proc XftFontLoadGlyphs*( | |
436 display: PDisplay, | |
437 pub: PXftFont, | |
438 need_bitmaps: FcBool, | |
439 glyphs: PFT_UInt, | |
440 nglyph: cint | |
441 ) {.cdecl, dynlib: xftLib, importc.} | |
442 | |
443 proc XftFontUnloadGlyphs*( | |
444 display: PDisplay, | |
445 pub: PXftFont, | |
446 glyphs: PFT_UInt, | |
447 nglyph: cint | |
448 ) {.cdecl, dynlib: xftLib, importc.} | |
449 | |
450 const XFT_NMISSING* = 256 | |
451 | |
452 proc XftFontCheckGlyph*( | |
453 display: PDisplay, | |
454 pub: PXftFont, | |
455 need_bitmaps: FcBool, | |
456 glyph: FT_UInt, | |
457 missing: PFT_UInt, | |
458 nmissing: cint | |
459 ): FcBool {.cdecl, dynlib: xftLib, importc.} | |
460 | |
461 proc XftCharExists*( | |
462 display: PDisplay, | |
463 pub: PXftFont, | |
464 ucs4: FcChar32 | |
465 ): FcBool {.cdecl, dynlib: xftLib, importc.} | |
466 | |
467 proc XftCharIndex*( | |
468 display: PDisplay, | |
469 pub: PXftFont, | |
470 ucs4: FcChar32 | |
471 ): FT_UInt {.cdecl, dynlib: xftLib, importc.} | |
472 | |
473 # xftinit.c | |
474 proc XftInit*( | |
475 config: cstring | |
476 ): FcBool {.cdecl, dynlib: xftLib, importc.} | |
477 | |
478 proc XftGetVersion*(): cint {.cdecl, dynlib: xftLib, importc.} | |
479 | |
480 # xftlist.c | |
481 # Expects display to be nil as an argument | |
482 proc XftListFonts*( | |
483 display: PDisplay, | |
484 screen: cint | |
485 ): PFcFontSet {.cdecl, dynlib: xftLib, importc, varargs.} | |
486 | |
487 # xftname.c | |
488 proc XftNameParse*( | |
489 name: cstring | |
490 ): PFcPattern {.cdecl, dynlib: xftLib, importc.} | |
491 | |
492 # xftrender.c | |
493 proc XftGlyphRender*(display: PDisplay, | |
494 op: cint, | |
495 src: Picture, | |
496 pub: PXftFont, | |
497 dst: Picture, | |
498 srcx: cint, | |
499 srcy: cint, | |
500 x: cint, | |
501 y: cint, | |
502 glyphs: PFT_UInt, | |
503 nglyphs: cint | |
504 ) {.cdecl, dynlib: xftLib, importc.} | |
505 | |
506 proc XftGlyphSpecRender*(display: PDisplay, | |
507 op: cint, | |
508 src: Picture, | |
509 pub: PXftFont, | |
510 dst: Picture, | |
511 srcx: cint, | |
512 srcy: cint, | |
513 glyphs: PXftGlyphSpec, | |
514 nglyphs: cint | |
515 ) {.cdecl, dynlib: xftLib, importc.} | |
516 | |
517 proc XftCharSpecRender*(display: PDisplay, | |
518 op: cint, | |
519 src: Picture, | |
520 pub: PXftFont, | |
521 dst: Picture, | |
522 srcx: cint, | |
523 srcy: cint, | |
524 chars: PXftCharSpec, | |
525 len: cint | |
526 ) {.cdecl, dynlib: xftLib, importc.} | |
527 | |
528 proc XftGlyphFontSpecRender*(display: PDisplay, | |
529 op: cint, | |
530 src: Picture, | |
531 dst: Picture, | |
532 srcx: cint, | |
533 srcy: cint, | |
534 glyphs: PXftGlyphFontSpec, | |
535 nglyphs: cint | |
536 ) {.cdecl, dynlib: xftLib, importc.} | |
537 | |
538 proc XftCharFontSpecRender*(display: PDisplay, | |
539 op: cint, | |
540 src: Picture, | |
541 dst: Picture, | |
542 srcx: cint, | |
543 srcy: cint, | |
544 chars: PXftCharFontSpec, | |
545 len: cint | |
546 ) {.cdecl, dynlib: xftLib, importc.} | |
547 | |
548 proc XftTextRender8*(display: PDisplay, | |
549 op: cint, | |
550 src: Picture, | |
551 pub: PXftFont, | |
552 dst: Picture, | |
553 srcx: cint, | |
554 srcy: cint, | |
555 x: cint, | |
556 y: cint, | |
557 str: PFcChar8, | |
558 len: cint | |
559 ) {.cdecl, dynlib: xftLib, importc.} | |
560 | |
561 proc XftTextRender16*( | |
562 display: PDisplay, | |
563 op: cint, | |
564 src: Picture, | |
565 pub: PXftFont, | |
566 dst: Picture, | |
567 srcx: cint, | |
568 srcy: cint, | |
569 x: cint, | |
570 y: cint, | |
571 str: PFcChar16, | |
572 len: cint | |
573 ) {.cdecl, dynlib: xftLib, importc.} | |
574 | |
575 proc XftTextRender16BE*( | |
576 display: PDisplay, | |
577 op: cint, | |
578 src: Picture, | |
579 pub: PXftFont, | |
580 dst: Picture, | |
581 srcx: cint, | |
582 srcy: cint, | |
583 x: cint, | |
584 y: cint, | |
585 str: PFcChar8, | |
586 len: cint | |
587 ) {.cdecl, dynlib: xftLib, importc.} | |
588 | |
589 proc XftTextRender16LE*( | |
590 display: PDisplay, | |
591 op: cint, | |
592 src: Picture, | |
593 pub: PXftFont, | |
594 dst: Picture, | |
595 srcx: cint, | |
596 srcy: cint, | |
597 x: cint, | |
598 y: cint, | |
599 str: PFcChar8, | |
600 len: cint | |
601 ) {.cdecl, dynlib: xftLib, importc.} | |
602 | |
603 proc XftTextRender32*( | |
604 display: PDisplay, | |
605 op: cint, | |
606 src: Picture, | |
607 pub: PXftFont, | |
608 dst: Picture, | |
609 srcx: cint, | |
610 srcy: cint, | |
611 x: cint, | |
612 y: cint, | |
613 str: PFcChar32, | |
614 len: cint | |
615 ) {.cdecl, dynlib: xftLib, importc.} | |
616 | |
617 proc XftTextRender32BE*( | |
618 display: PDisplay, | |
619 op: cint, | |
620 src: Picture, | |
621 pub: PXftFont, | |
622 dst: Picture, | |
623 srcx: cint, | |
624 srcy: cint, | |
625 x: cint, | |
626 y: cint, | |
627 str: PFcChar8, | |
628 len: cint | |
629 ) {.cdecl, dynlib: xftLib, importc.} | |
630 | |
631 proc XftTextRender32LE*( | |
632 display: PDisplay, | |
633 op: cint, | |
634 src: Picture, | |
635 pub: PXftFont, | |
636 dst: Picture, | |
637 srcx: cint, | |
638 srcy: cint, | |
639 x: cint, | |
640 y: cint, | |
641 str: PFcChar8, | |
642 len: cint | |
643 ) {.cdecl, dynlib: xftLib, importc.} | |
644 | |
645 proc XftTextRenderUtf8*( | |
646 display: PDisplay, | |
647 op: cint, | |
648 src: Picture, | |
649 pub: PXftFont, | |
650 dst: Picture, | |
651 srcx: cint, | |
652 srcy: cint, | |
653 x: cint, | |
654 y: cint, | |
655 str: PFcChar8, | |
656 len: cint | |
657 ) {.cdecl, dynlib: xftLib, importc.} | |
658 | |
659 proc XftTextRenderUtf16*( | |
660 display: PDisplay, | |
661 op: cint, | |
662 src: Picture, | |
663 pub: PXftFont, | |
664 dst: Picture, | |
665 srcx: cint, | |
666 srcy: cint, | |
667 x: cint, | |
668 y: cint, | |
669 str: PFcChar8, | |
670 endian: FcEndian, | |
671 len: cint | |
672 ) {.cdecl, dynlib: xftLib, importc.} | |
673 | |
674 # xftxlfd.c | |
675 proc XftXlfdParse8*( | |
676 xlfd_orig: cstring, | |
677 ignore_scalable: XBool, | |
678 complete: XBool | |
679 ): PFcPattern {.cdecl, dynlib: xftLib, importc.} | |
680 |