Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-19 09:40:49

0001 /* include/X11/Xft/Xft.h.  Generated from Xft.h.in by configure.  */
0002 /*
0003  * Copyright © 2022 Thomas E. Dickey
0004  * Copyright © 2000 Keith Packard
0005  *
0006  * Permission to use, copy, modify, distribute, and sell this software and its
0007  * documentation for any purpose is hereby granted without fee, provided that
0008  * the above copyright notice appear in all copies and that both that copyright
0009  * notice and this permission notice appear in supporting documentation, and
0010  * that the name of the above copyright holders not be used in advertising or
0011  * publicity pertaining to distribution of the software without specific,
0012  * written prior permission.  The above copyright holders make no
0013  * representations about the suitability of this software for any purpose.  It
0014  * is provided "as is" without express or implied warranty.
0015  *
0016  * THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO
0017  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
0018  * FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE
0019  * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
0020  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
0021  * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
0022  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
0023  */
0024 
0025 #ifndef _XFT_H_
0026 #define _XFT_H_
0027 
0028 /*
0029  * Current Xft version number, set from version in the Xft configure.ac file.
0030  */
0031 /* #undef will be substituted by configure */
0032 #define XFT_MAJOR 2
0033 #define XFT_MINOR 3
0034 #define XFT_REVISION 9
0035 
0036 #define XFT_VERSION ((XFT_MAJOR * 10000) + (XFT_MINOR * 100) + (XFT_REVISION))
0037 #define XftVersion  XFT_VERSION
0038 
0039 #include <stdarg.h>
0040 #include <ft2build.h>
0041 #include FT_FREETYPE_H
0042 #include <fontconfig/fontconfig.h>
0043 #include <X11/extensions/Xrender.h>
0044 
0045 #include <X11/Xfuncproto.h>
0046 
0047 #ifndef _XFT_NO_COMPAT_
0048 #include <X11/Xft/XftCompat.h>
0049 #endif
0050 
0051 #define XFT_CORE        "core"
0052 #define XFT_RENDER      "render"
0053 #define XFT_XLFD        "xlfd"
0054 #define XFT_MAX_GLYPH_MEMORY    "maxglyphmemory"
0055 #define XFT_MAX_UNREF_FONTS "maxunreffonts"
0056 #define XFT_TRACK_MEM_USAGE "trackmemusage"
0057 
0058 extern FT_Library   _XftFTlibrary;
0059 
0060 typedef struct _XftFontInfo XftFontInfo;
0061 
0062 typedef struct _XftFont {
0063     int     ascent;
0064     int     descent;
0065     int     height;
0066     int     max_advance_width;
0067     FcCharSet   *charset;
0068     FcPattern   *pattern;
0069 } XftFont;
0070 
0071 typedef struct _XftDraw XftDraw;
0072 
0073 typedef struct _XftColor {
0074     unsigned long   pixel;
0075     XRenderColor    color;
0076 } XftColor;
0077 
0078 typedef struct _XftCharSpec {
0079     FcChar32        ucs4;
0080     short       x;
0081     short       y;
0082 } XftCharSpec;
0083 
0084 typedef struct _XftCharFontSpec {
0085     XftFont     *font;
0086     FcChar32        ucs4;
0087     short       x;
0088     short       y;
0089 } XftCharFontSpec;
0090 
0091 typedef struct _XftGlyphSpec {
0092     FT_UInt     glyph;
0093     short       x;
0094     short       y;
0095 } XftGlyphSpec;
0096 
0097 typedef struct _XftGlyphFontSpec {
0098     XftFont     *font;
0099     FT_UInt     glyph;
0100     short       x;
0101     short       y;
0102 } XftGlyphFontSpec;
0103 
0104 _XFUNCPROTOBEGIN
0105 
0106 
0107 /* xftcolor.c */
0108 Bool
0109 XftColorAllocName (Display  *dpy,
0110            _Xconst Visual   *visual,
0111            Colormap cmap,
0112            _Xconst char     *name,
0113            XftColor *result);
0114 
0115 Bool
0116 XftColorAllocValue (Display     *dpy,
0117             Visual      *visual,
0118             Colormap        cmap,
0119             _Xconst XRenderColor    *color,
0120             XftColor        *result);
0121 
0122 void
0123 XftColorFree (Display   *dpy,
0124           Visual    *visual,
0125           Colormap  cmap,
0126           XftColor  *color);
0127 
0128 /* xftdpy.c */
0129 Bool
0130 XftDefaultHasRender (Display *dpy);
0131 
0132 Bool
0133 XftDefaultSet (Display *dpy, FcPattern *defaults);
0134 
0135 void
0136 XftDefaultSubstitute (Display *dpy, int screen, FcPattern *pattern);
0137 
0138 /* xftdraw.c */
0139 
0140 XftDraw *
0141 XftDrawCreate (Display   *dpy,
0142            Drawable  drawable,
0143            Visual    *visual,
0144            Colormap  colormap);
0145 
0146 XftDraw *
0147 XftDrawCreateBitmap (Display  *dpy,
0148              Pixmap   bitmap);
0149 
0150 XftDraw *
0151 XftDrawCreateAlpha (Display *dpy,
0152             Pixmap  pixmap,
0153             int     depth);
0154 
0155 void
0156 XftDrawChange (XftDraw  *draw,
0157            Drawable drawable);
0158 
0159 Display *
0160 XftDrawDisplay (XftDraw *draw);
0161 
0162 Drawable
0163 XftDrawDrawable (XftDraw *draw);
0164 
0165 Colormap
0166 XftDrawColormap (XftDraw *draw);
0167 
0168 Visual *
0169 XftDrawVisual (XftDraw *draw);
0170 
0171 void
0172 XftDrawDestroy (XftDraw *draw);
0173 
0174 Picture
0175 XftDrawPicture (XftDraw *draw);
0176 
0177 Picture
0178 XftDrawSrcPicture (XftDraw *draw, _Xconst XftColor *color);
0179 
0180 void
0181 XftDrawGlyphs (XftDraw      *draw,
0182            _Xconst XftColor *color,
0183            XftFont      *pub,
0184            int      x,
0185            int      y,
0186            _Xconst FT_UInt  *glyphs,
0187            int      nglyphs);
0188 
0189 void
0190 XftDrawString8 (XftDraw         *draw,
0191         _Xconst XftColor    *color,
0192         XftFont         *pub,
0193         int         x,
0194         int         y,
0195         _Xconst FcChar8     *string,
0196         int         len);
0197 
0198 void
0199 XftDrawString16 (XftDraw        *draw,
0200          _Xconst XftColor   *color,
0201          XftFont        *pub,
0202          int            x,
0203          int            y,
0204          _Xconst FcChar16   *string,
0205          int            len);
0206 
0207 void
0208 XftDrawString32 (XftDraw        *draw,
0209          _Xconst XftColor   *color,
0210          XftFont        *pub,
0211          int            x,
0212          int            y,
0213          _Xconst FcChar32   *string,
0214          int            len);
0215 
0216 void
0217 XftDrawStringUtf8 (XftDraw      *draw,
0218            _Xconst XftColor *color,
0219            XftFont      *pub,
0220            int          x,
0221            int          y,
0222            _Xconst FcChar8  *string,
0223            int          len);
0224 
0225 void
0226 XftDrawStringUtf16 (XftDraw     *draw,
0227             _Xconst XftColor    *color,
0228             XftFont     *pub,
0229             int         x,
0230             int         y,
0231             _Xconst FcChar8 *string,
0232             FcEndian        endian,
0233             int         len);
0234 
0235 void
0236 XftDrawCharSpec (XftDraw        *draw,
0237          _Xconst XftColor   *color,
0238          XftFont        *pub,
0239          _Xconst XftCharSpec    *chars,
0240          int            len);
0241 
0242 void
0243 XftDrawCharFontSpec (XftDraw            *draw,
0244              _Xconst XftColor       *color,
0245              _Xconst XftCharFontSpec    *chars,
0246              int            len);
0247 
0248 void
0249 XftDrawGlyphSpec (XftDraw       *draw,
0250           _Xconst XftColor  *color,
0251           XftFont       *pub,
0252           _Xconst XftGlyphSpec  *glyphs,
0253           int           len);
0254 
0255 void
0256 XftDrawGlyphFontSpec (XftDraw           *draw,
0257               _Xconst XftColor      *color,
0258               _Xconst XftGlyphFontSpec  *glyphs,
0259               int           len);
0260 
0261 void
0262 XftDrawRect (XftDraw        *draw,
0263          _Xconst XftColor   *color,
0264          int        x,
0265          int        y,
0266          unsigned int   width,
0267          unsigned int   height);
0268 
0269 
0270 Bool
0271 XftDrawSetClip (XftDraw     *draw,
0272         Region      r);
0273 
0274 
0275 Bool
0276 XftDrawSetClipRectangles (XftDraw       *draw,
0277               int           xOrigin,
0278               int           yOrigin,
0279               _Xconst XRectangle    *rects,
0280               int           n);
0281 
0282 void
0283 XftDrawSetSubwindowMode (XftDraw    *draw,
0284              int        mode);
0285 
0286 /* xftextent.c */
0287 
0288 void
0289 XftGlyphExtents (Display        *dpy,
0290          XftFont        *pub,
0291          _Xconst FT_UInt    *glyphs,
0292          int            nglyphs,
0293          XGlyphInfo     *extents);
0294 
0295 void
0296 XftTextExtents8 (Display        *dpy,
0297          XftFont        *pub,
0298          _Xconst FcChar8    *string,
0299          int            len,
0300          XGlyphInfo     *extents);
0301 
0302 void
0303 XftTextExtents16 (Display       *dpy,
0304           XftFont       *pub,
0305           _Xconst FcChar16  *string,
0306           int           len,
0307           XGlyphInfo        *extents);
0308 
0309 void
0310 XftTextExtents32 (Display       *dpy,
0311           XftFont       *pub,
0312           _Xconst FcChar32  *string,
0313           int           len,
0314           XGlyphInfo        *extents);
0315 
0316 void
0317 XftTextExtentsUtf8 (Display     *dpy,
0318             XftFont     *pub,
0319             _Xconst FcChar8 *string,
0320             int         len,
0321             XGlyphInfo      *extents);
0322 
0323 void
0324 XftTextExtentsUtf16 (Display        *dpy,
0325              XftFont        *pub,
0326              _Xconst FcChar8    *string,
0327              FcEndian       endian,
0328              int        len,
0329              XGlyphInfo     *extents);
0330 
0331 /* xftfont.c */
0332 FcPattern *
0333 XftFontMatch (Display       *dpy,
0334           int       screen,
0335           _Xconst FcPattern *pattern,
0336           FcResult      *result);
0337 
0338 XftFont *
0339 XftFontOpen (Display *dpy, int screen, ...) _X_SENTINEL(0);
0340 
0341 XftFont *
0342 XftFontOpenName (Display *dpy, int screen, _Xconst char *name);
0343 
0344 XftFont *
0345 XftFontOpenXlfd (Display *dpy, int screen, _Xconst char *xlfd);
0346 
0347 /* xftfreetype.c */
0348 
0349 FT_Face
0350 XftLockFace (XftFont *pub);
0351 
0352 void
0353 XftUnlockFace (XftFont *pub);
0354 
0355 XftFontInfo *
0356 XftFontInfoCreate (Display *dpy, _Xconst FcPattern *pattern);
0357 
0358 void
0359 XftFontInfoDestroy (Display *dpy, XftFontInfo *fi);
0360 
0361 FcChar32
0362 XftFontInfoHash (_Xconst XftFontInfo *fi);
0363 
0364 FcBool
0365 XftFontInfoEqual (_Xconst XftFontInfo *a, _Xconst XftFontInfo *b);
0366 
0367 XftFont *
0368 XftFontOpenInfo (Display    *dpy,
0369          FcPattern  *pattern,
0370          XftFontInfo    *fi);
0371 
0372 XftFont *
0373 XftFontOpenPattern (Display *dpy, FcPattern *pattern);
0374 
0375 XftFont *
0376 XftFontCopy (Display *dpy, XftFont *pub);
0377 
0378 void
0379 XftFontClose (Display *dpy, XftFont *pub);
0380 
0381 FcBool
0382 XftInitFtLibrary(void);
0383 
0384 /* xftglyphs.c */
0385 void
0386 XftFontLoadGlyphs (Display      *dpy,
0387            XftFont      *pub,
0388            FcBool       need_bitmaps,
0389            _Xconst FT_UInt  *glyphs,
0390            int          nglyph);
0391 
0392 void
0393 XftFontUnloadGlyphs (Display        *dpy,
0394              XftFont        *pub,
0395              _Xconst FT_UInt    *glyphs,
0396              int        nglyph);
0397 
0398 #define XFT_NMISSING        256
0399 
0400 FcBool
0401 XftFontCheckGlyph (Display  *dpy,
0402            XftFont  *pub,
0403            FcBool   need_bitmaps,
0404            FT_UInt  glyph,
0405            FT_UInt  *missing,
0406            int      *nmissing);
0407 
0408 FcBool
0409 XftCharExists (Display      *dpy,
0410            XftFont      *pub,
0411            FcChar32    ucs4);
0412 
0413 FT_UInt
0414 XftCharIndex (Display       *dpy,
0415           XftFont       *pub,
0416           FcChar32      ucs4);
0417 
0418 /* xftinit.c */
0419 FcBool
0420 XftInit (_Xconst char *config);
0421 
0422 int
0423 XftGetVersion (void);
0424 
0425 /* xftlist.c */
0426 
0427 FcFontSet *
0428 XftListFonts (Display   *dpy,
0429           int   screen,
0430           ...) _X_SENTINEL(0);
0431 
0432 /* xftname.c */
0433 FcPattern
0434 *XftNameParse (_Xconst char *name);
0435 
0436 FcBool
0437 XftNameUnparse (FcPattern *pat, char *dest, int len);
0438 
0439 /* xftrender.c */
0440 void
0441 XftGlyphRender (Display     *dpy,
0442         int     op,
0443         Picture     src,
0444         XftFont     *pub,
0445         Picture     dst,
0446         int     srcx,
0447         int     srcy,
0448         int     x,
0449         int     y,
0450         _Xconst FT_UInt *glyphs,
0451         int     nglyphs);
0452 
0453 void
0454 XftGlyphSpecRender (Display         *dpy,
0455             int             op,
0456             Picture         src,
0457             XftFont         *pub,
0458             Picture         dst,
0459             int             srcx,
0460             int             srcy,
0461             _Xconst XftGlyphSpec    *glyphs,
0462             int             nglyphs);
0463 
0464 void
0465 XftCharSpecRender (Display      *dpy,
0466            int          op,
0467            Picture      src,
0468            XftFont      *pub,
0469            Picture      dst,
0470            int          srcx,
0471            int          srcy,
0472            _Xconst XftCharSpec  *chars,
0473            int          len);
0474 
0475 void
0476 XftGlyphFontSpecRender (Display             *dpy,
0477             int             op,
0478             Picture             src,
0479             Picture             dst,
0480             int             srcx,
0481             int             srcy,
0482             _Xconst XftGlyphFontSpec    *glyphs,
0483             int             nglyphs);
0484 
0485 void
0486 XftCharFontSpecRender (Display          *dpy,
0487                int          op,
0488                Picture          src,
0489                Picture          dst,
0490                int          srcx,
0491                int          srcy,
0492                _Xconst XftCharFontSpec  *chars,
0493                int          len);
0494 
0495 void
0496 XftTextRender8 (Display     *dpy,
0497         int     op,
0498         Picture     src,
0499         XftFont     *pub,
0500         Picture     dst,
0501         int     srcx,
0502         int     srcy,
0503         int     x,
0504         int     y,
0505         _Xconst FcChar8 *string,
0506         int     len);
0507 
0508 void
0509 XftTextRender16 (Display        *dpy,
0510          int            op,
0511          Picture        src,
0512          XftFont        *pub,
0513          Picture        dst,
0514          int            srcx,
0515          int            srcy,
0516          int            x,
0517          int            y,
0518          _Xconst FcChar16   *string,
0519          int            len);
0520 
0521 void
0522 XftTextRender16BE (Display      *dpy,
0523            int          op,
0524            Picture      src,
0525            XftFont      *pub,
0526            Picture      dst,
0527            int          srcx,
0528            int          srcy,
0529            int          x,
0530            int          y,
0531            _Xconst FcChar8  *string,
0532            int          len);
0533 
0534 void
0535 XftTextRender16LE (Display      *dpy,
0536            int          op,
0537            Picture      src,
0538            XftFont      *pub,
0539            Picture      dst,
0540            int          srcx,
0541            int          srcy,
0542            int          x,
0543            int          y,
0544            _Xconst FcChar8  *string,
0545            int          len);
0546 
0547 void
0548 XftTextRender32 (Display        *dpy,
0549          int            op,
0550          Picture        src,
0551          XftFont        *pub,
0552          Picture        dst,
0553          int            srcx,
0554          int            srcy,
0555          int            x,
0556          int            y,
0557          _Xconst FcChar32   *string,
0558          int            len);
0559 
0560 void
0561 XftTextRender32BE (Display      *dpy,
0562            int          op,
0563            Picture      src,
0564            XftFont      *pub,
0565            Picture      dst,
0566            int          srcx,
0567            int          srcy,
0568            int          x,
0569            int          y,
0570            _Xconst FcChar8  *string,
0571            int          len);
0572 
0573 void
0574 XftTextRender32LE (Display      *dpy,
0575            int          op,
0576            Picture      src,
0577            XftFont      *pub,
0578            Picture      dst,
0579            int          srcx,
0580            int          srcy,
0581            int          x,
0582            int          y,
0583            _Xconst FcChar8  *string,
0584            int          len);
0585 
0586 void
0587 XftTextRenderUtf8 (Display      *dpy,
0588            int          op,
0589            Picture      src,
0590            XftFont      *pub,
0591            Picture      dst,
0592            int          srcx,
0593            int          srcy,
0594            int          x,
0595            int          y,
0596            _Xconst FcChar8  *string,
0597            int          len);
0598 
0599 void
0600 XftTextRenderUtf16 (Display     *dpy,
0601             int         op,
0602             Picture     src,
0603             XftFont     *pub,
0604             Picture     dst,
0605             int         srcx,
0606             int         srcy,
0607             int         x,
0608             int         y,
0609             _Xconst FcChar8 *string,
0610             FcEndian        endian,
0611             int         len);
0612 
0613 /* xftxlfd.c */
0614 FcPattern *
0615 XftXlfdParse (_Xconst char *xlfd_orig, Bool ignore_scalable, Bool complete);
0616 
0617 _XFUNCPROTOEND
0618 
0619 #endif /* _XFT_H_ */