master
ブランチ master
ShaderPlayground / deps / xlibre / include / X11 / Xft / Xft.h
12.4 KB、623行 生 Blame 履歴
1/* include/X11/Xft/Xft.h. Generated from Xft.h.in by configure. */
2/*
3 * Copyright © 2022 Thomas E. Dickey
4 * Copyright © 2000 Keith Packard
5 *
6 * Permission to use, copy, modify, distribute, and sell this software and its
7 * documentation for any purpose is hereby granted without fee, provided that
8 * the above copyright notice appear in all copies and that both that copyright
9 * notice and this permission notice appear in supporting documentation, and
10 * that the name of the above copyright holders not be used in advertising or
11 * publicity pertaining to distribution of the software without specific,
12 * written prior permission. The above copyright holders make no
13 * representations about the suitability of this software for any purpose. It
14 * is provided "as is" without express or implied warranty.
15 *
16 * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO
17 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
18 * FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE
19 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
20 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
21 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
22 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 */
24
25#ifndef _XFT_H_
26#define _XFT_H_
27
28/*
29 * Current Xft version number, set from version in the Xft configure.ac file.
30 */
31/* #undef will be substituted by configure */
32#define XFT_MAJOR 2
33#define XFT_MINOR 3
34#define XFT_REVISION 8
35
36#define XFT_VERSION ((XFT_MAJOR * 10000) + (XFT_MINOR * 100) + (XFT_REVISION))
37#define XftVersion XFT_VERSION
38
39#include <stdarg.h>
40#include <ft2build.h>
41#include FT_FREETYPE_H
42#include <fontconfig/fontconfig.h>
43#include <X11/extensions/Xrender.h>
44
45#include <X11/Xfuncproto.h>
46/* #include <X11/Xosdefs.h>*/
47#ifndef _X_SENTINEL
48# define _X_SENTINEL(x)
49#endif
50
51#ifndef _XFT_NO_COMPAT_
52#include <X11/Xft/XftCompat.h>
53#endif
54
55#define XFT_CORE "core"
56#define XFT_RENDER "render"
57#define XFT_XLFD "xlfd"
58#define XFT_MAX_GLYPH_MEMORY "maxglyphmemory"
59#define XFT_MAX_UNREF_FONTS "maxunreffonts"
60#define XFT_TRACK_MEM_USAGE "trackmemusage"
61
62extern FT_Library _XftFTlibrary;
63
64typedef struct _XftFontInfo XftFontInfo;
65
66typedef struct _XftFont {
67 int ascent;
68 int descent;
69 int height;
70 int max_advance_width;
71 FcCharSet *charset;
72 FcPattern *pattern;
73} XftFont;
74
75typedef struct _XftDraw XftDraw;
76
77typedef struct _XftColor {
78 unsigned long pixel;
79 XRenderColor color;
80} XftColor;
81
82typedef struct _XftCharSpec {
83 FcChar32 ucs4;
84 short x;
85 short y;
86} XftCharSpec;
87
88typedef struct _XftCharFontSpec {
89 XftFont *font;
90 FcChar32 ucs4;
91 short x;
92 short y;
93} XftCharFontSpec;
94
95typedef struct _XftGlyphSpec {
96 FT_UInt glyph;
97 short x;
98 short y;
99} XftGlyphSpec;
100
101typedef struct _XftGlyphFontSpec {
102 XftFont *font;
103 FT_UInt glyph;
104 short x;
105 short y;
106} XftGlyphFontSpec;
107
108_XFUNCPROTOBEGIN
109
110
111/* xftcolor.c */
112Bool
113XftColorAllocName (Display *dpy,
114 _Xconst Visual *visual,
115 Colormap cmap,
116 _Xconst char *name,
117 XftColor *result);
118
119Bool
120XftColorAllocValue (Display *dpy,
121 Visual *visual,
122 Colormap cmap,
123 _Xconst XRenderColor *color,
124 XftColor *result);
125
126void
127XftColorFree (Display *dpy,
128 Visual *visual,
129 Colormap cmap,
130 XftColor *color);
131
132/* xftdpy.c */
133Bool
134XftDefaultHasRender (Display *dpy);
135
136Bool
137XftDefaultSet (Display *dpy, FcPattern *defaults);
138
139void
140XftDefaultSubstitute (Display *dpy, int screen, FcPattern *pattern);
141
142/* xftdraw.c */
143
144XftDraw *
145XftDrawCreate (Display *dpy,
146 Drawable drawable,
147 Visual *visual,
148 Colormap colormap);
149
150XftDraw *
151XftDrawCreateBitmap (Display *dpy,
152 Pixmap bitmap);
153
154XftDraw *
155XftDrawCreateAlpha (Display *dpy,
156 Pixmap pixmap,
157 int depth);
158
159void
160XftDrawChange (XftDraw *draw,
161 Drawable drawable);
162
163Display *
164XftDrawDisplay (XftDraw *draw);
165
166Drawable
167XftDrawDrawable (XftDraw *draw);
168
169Colormap
170XftDrawColormap (XftDraw *draw);
171
172Visual *
173XftDrawVisual (XftDraw *draw);
174
175void
176XftDrawDestroy (XftDraw *draw);
177
178Picture
179XftDrawPicture (XftDraw *draw);
180
181Picture
182XftDrawSrcPicture (XftDraw *draw, _Xconst XftColor *color);
183
184void
185XftDrawGlyphs (XftDraw *draw,
186 _Xconst XftColor *color,
187 XftFont *pub,
188 int x,
189 int y,
190 _Xconst FT_UInt *glyphs,
191 int nglyphs);
192
193void
194XftDrawString8 (XftDraw *draw,
195 _Xconst XftColor *color,
196 XftFont *pub,
197 int x,
198 int y,
199 _Xconst FcChar8 *string,
200 int len);
201
202void
203XftDrawString16 (XftDraw *draw,
204 _Xconst XftColor *color,
205 XftFont *pub,
206 int x,
207 int y,
208 _Xconst FcChar16 *string,
209 int len);
210
211void
212XftDrawString32 (XftDraw *draw,
213 _Xconst XftColor *color,
214 XftFont *pub,
215 int x,
216 int y,
217 _Xconst FcChar32 *string,
218 int len);
219
220void
221XftDrawStringUtf8 (XftDraw *draw,
222 _Xconst XftColor *color,
223 XftFont *pub,
224 int x,
225 int y,
226 _Xconst FcChar8 *string,
227 int len);
228
229void
230XftDrawStringUtf16 (XftDraw *draw,
231 _Xconst XftColor *color,
232 XftFont *pub,
233 int x,
234 int y,
235 _Xconst FcChar8 *string,
236 FcEndian endian,
237 int len);
238
239void
240XftDrawCharSpec (XftDraw *draw,
241 _Xconst XftColor *color,
242 XftFont *pub,
243 _Xconst XftCharSpec *chars,
244 int len);
245
246void
247XftDrawCharFontSpec (XftDraw *draw,
248 _Xconst XftColor *color,
249 _Xconst XftCharFontSpec *chars,
250 int len);
251
252void
253XftDrawGlyphSpec (XftDraw *draw,
254 _Xconst XftColor *color,
255 XftFont *pub,
256 _Xconst XftGlyphSpec *glyphs,
257 int len);
258
259void
260XftDrawGlyphFontSpec (XftDraw *draw,
261 _Xconst XftColor *color,
262 _Xconst XftGlyphFontSpec *glyphs,
263 int len);
264
265void
266XftDrawRect (XftDraw *draw,
267 _Xconst XftColor *color,
268 int x,
269 int y,
270 unsigned int width,
271 unsigned int height);
272
273
274Bool
275XftDrawSetClip (XftDraw *draw,
276 Region r);
277
278
279Bool
280XftDrawSetClipRectangles (XftDraw *draw,
281 int xOrigin,
282 int yOrigin,
283 _Xconst XRectangle *rects,
284 int n);
285
286void
287XftDrawSetSubwindowMode (XftDraw *draw,
288 int mode);
289
290/* xftextent.c */
291
292void
293XftGlyphExtents (Display *dpy,
294 XftFont *pub,
295 _Xconst FT_UInt *glyphs,
296 int nglyphs,
297 XGlyphInfo *extents);
298
299void
300XftTextExtents8 (Display *dpy,
301 XftFont *pub,
302 _Xconst FcChar8 *string,
303 int len,
304 XGlyphInfo *extents);
305
306void
307XftTextExtents16 (Display *dpy,
308 XftFont *pub,
309 _Xconst FcChar16 *string,
310 int len,
311 XGlyphInfo *extents);
312
313void
314XftTextExtents32 (Display *dpy,
315 XftFont *pub,
316 _Xconst FcChar32 *string,
317 int len,
318 XGlyphInfo *extents);
319
320void
321XftTextExtentsUtf8 (Display *dpy,
322 XftFont *pub,
323 _Xconst FcChar8 *string,
324 int len,
325 XGlyphInfo *extents);
326
327void
328XftTextExtentsUtf16 (Display *dpy,
329 XftFont *pub,
330 _Xconst FcChar8 *string,
331 FcEndian endian,
332 int len,
333 XGlyphInfo *extents);
334
335/* xftfont.c */
336FcPattern *
337XftFontMatch (Display *dpy,
338 int screen,
339 _Xconst FcPattern *pattern,
340 FcResult *result);
341
342XftFont *
343XftFontOpen (Display *dpy, int screen, ...) _X_SENTINEL(0);
344
345XftFont *
346XftFontOpenName (Display *dpy, int screen, _Xconst char *name);
347
348XftFont *
349XftFontOpenXlfd (Display *dpy, int screen, _Xconst char *xlfd);
350
351/* xftfreetype.c */
352
353FT_Face
354XftLockFace (XftFont *pub);
355
356void
357XftUnlockFace (XftFont *pub);
358
359XftFontInfo *
360XftFontInfoCreate (Display *dpy, _Xconst FcPattern *pattern);
361
362void
363XftFontInfoDestroy (Display *dpy, XftFontInfo *fi);
364
365FcChar32
366XftFontInfoHash (_Xconst XftFontInfo *fi);
367
368FcBool
369XftFontInfoEqual (_Xconst XftFontInfo *a, _Xconst XftFontInfo *b);
370
371XftFont *
372XftFontOpenInfo (Display *dpy,
373 FcPattern *pattern,
374 XftFontInfo *fi);
375
376XftFont *
377XftFontOpenPattern (Display *dpy, FcPattern *pattern);
378
379XftFont *
380XftFontCopy (Display *dpy, XftFont *pub);
381
382void
383XftFontClose (Display *dpy, XftFont *pub);
384
385FcBool
386XftInitFtLibrary(void);
387
388/* xftglyphs.c */
389void
390XftFontLoadGlyphs (Display *dpy,
391 XftFont *pub,
392 FcBool need_bitmaps,
393 _Xconst FT_UInt *glyphs,
394 int nglyph);
395
396void
397XftFontUnloadGlyphs (Display *dpy,
398 XftFont *pub,
399 _Xconst FT_UInt *glyphs,
400 int nglyph);
401
402#define XFT_NMISSING 256
403
404FcBool
405XftFontCheckGlyph (Display *dpy,
406 XftFont *pub,
407 FcBool need_bitmaps,
408 FT_UInt glyph,
409 FT_UInt *missing,
410 int *nmissing);
411
412FcBool
413XftCharExists (Display *dpy,
414 XftFont *pub,
415 FcChar32 ucs4);
416
417FT_UInt
418XftCharIndex (Display *dpy,
419 XftFont *pub,
420 FcChar32 ucs4);
421
422/* xftinit.c */
423FcBool
424XftInit (_Xconst char *config);
425
426int
427XftGetVersion (void);
428
429/* xftlist.c */
430
431FcFontSet *
432XftListFonts (Display *dpy,
433 int screen,
434 ...) _X_SENTINEL(0);
435
436/* xftname.c */
437FcPattern
438*XftNameParse (_Xconst char *name);
439
440FcBool
441XftNameUnparse (FcPattern *pat, char *dest, int len);
442
443/* xftrender.c */
444void
445XftGlyphRender (Display *dpy,
446 int op,
447 Picture src,
448 XftFont *pub,
449 Picture dst,
450 int srcx,
451 int srcy,
452 int x,
453 int y,
454 _Xconst FT_UInt *glyphs,
455 int nglyphs);
456
457void
458XftGlyphSpecRender (Display *dpy,
459 int op,
460 Picture src,
461 XftFont *pub,
462 Picture dst,
463 int srcx,
464 int srcy,
465 _Xconst XftGlyphSpec *glyphs,
466 int nglyphs);
467
468void
469XftCharSpecRender (Display *dpy,
470 int op,
471 Picture src,
472 XftFont *pub,
473 Picture dst,
474 int srcx,
475 int srcy,
476 _Xconst XftCharSpec *chars,
477 int len);
478
479void
480XftGlyphFontSpecRender (Display *dpy,
481 int op,
482 Picture src,
483 Picture dst,
484 int srcx,
485 int srcy,
486 _Xconst XftGlyphFontSpec *glyphs,
487 int nglyphs);
488
489void
490XftCharFontSpecRender (Display *dpy,
491 int op,
492 Picture src,
493 Picture dst,
494 int srcx,
495 int srcy,
496 _Xconst XftCharFontSpec *chars,
497 int len);
498
499void
500XftTextRender8 (Display *dpy,
501 int op,
502 Picture src,
503 XftFont *pub,
504 Picture dst,
505 int srcx,
506 int srcy,
507 int x,
508 int y,
509 _Xconst FcChar8 *string,
510 int len);
511
512void
513XftTextRender16 (Display *dpy,
514 int op,
515 Picture src,
516 XftFont *pub,
517 Picture dst,
518 int srcx,
519 int srcy,
520 int x,
521 int y,
522 _Xconst FcChar16 *string,
523 int len);
524
525void
526XftTextRender16BE (Display *dpy,
527 int op,
528 Picture src,
529 XftFont *pub,
530 Picture dst,
531 int srcx,
532 int srcy,
533 int x,
534 int y,
535 _Xconst FcChar8 *string,
536 int len);
537
538void
539XftTextRender16LE (Display *dpy,
540 int op,
541 Picture src,
542 XftFont *pub,
543 Picture dst,
544 int srcx,
545 int srcy,
546 int x,
547 int y,
548 _Xconst FcChar8 *string,
549 int len);
550
551void
552XftTextRender32 (Display *dpy,
553 int op,
554 Picture src,
555 XftFont *pub,
556 Picture dst,
557 int srcx,
558 int srcy,
559 int x,
560 int y,
561 _Xconst FcChar32 *string,
562 int len);
563
564void
565XftTextRender32BE (Display *dpy,
566 int op,
567 Picture src,
568 XftFont *pub,
569 Picture dst,
570 int srcx,
571 int srcy,
572 int x,
573 int y,
574 _Xconst FcChar8 *string,
575 int len);
576
577void
578XftTextRender32LE (Display *dpy,
579 int op,
580 Picture src,
581 XftFont *pub,
582 Picture dst,
583 int srcx,
584 int srcy,
585 int x,
586 int y,
587 _Xconst FcChar8 *string,
588 int len);
589
590void
591XftTextRenderUtf8 (Display *dpy,
592 int op,
593 Picture src,
594 XftFont *pub,
595 Picture dst,
596 int srcx,
597 int srcy,
598 int x,
599 int y,
600 _Xconst FcChar8 *string,
601 int len);
602
603void
604XftTextRenderUtf16 (Display *dpy,
605 int op,
606 Picture src,
607 XftFont *pub,
608 Picture dst,
609 int srcx,
610 int srcy,
611 int x,
612 int y,
613 _Xconst FcChar8 *string,
614 FcEndian endian,
615 int len);
616
617/* xftxlfd.c */
618FcPattern *
619XftXlfdParse (_Xconst char *xlfd_orig, Bool ignore_scalable, Bool complete);
620
621_XFUNCPROTOEND
622
623#endif /* _XFT_H_ */