#ifndef _XFTINT_H_
#define _XFTINT_H_
#include <X11/Xlib.h>
#include <fontconfig/fontconfig.h>
#ifdef FREETYPE2
#include "XftFreetype.h"
#else
#include "Xft.h"
#endif
typedef struct _XftMatcher {
char *object;
double (*compare) (char *object, XftValue value1, XftValue value2);
} XftMatcher;
typedef struct _XftSymbolic {
const char *name;
int value;
} XftSymbolic;
#define XFT_DRAW_N_SRC 2
#define XFT_DRAW_SRC_TEXT 0
#define XFT_DRAW_SRC_RECT 1
struct _XftDraw {
Display *dpy;
Drawable drawable;
Visual *visual;
Colormap colormap;
Region clip;
Bool core_set;
Bool render_set;
Bool render_able;
struct {
Picture pict;
struct {
Picture pict;
XRenderColor color;
} src[XFT_DRAW_N_SRC];
} render;
struct {
GC draw_gc;
unsigned long fg;
Font font;
} core;
};
typedef struct _XftDisplayInfo {
struct _XftDisplayInfo *next;
Display *display;
XExtCodes *codes;
XftPattern *defaults;
XftFontSet *coreFonts;
Bool hasRender;
struct _XftFtGlyphSet *glyphSets;
} XftDisplayInfo;
extern XftFontSet *_XftGlobalFontSet;
extern XftDisplayInfo *_XftDisplayInfo;
extern char **XftConfigDirs;
extern XftFontSet *_XftFontSet;
typedef struct _FcPatternElt FcPatternElt;
FcPatternElt *
FcPatternFindElt (const FcPattern *p, const char *object);
FcPatternElt *
FcPatternInsertElt (FcPattern *p, const char *object);
typedef FcPatternElt XftPatternElt;
#define XFT_NMISSING 256
#ifndef XFT_DEFAULT_PATH
#define XFT_DEFAULT_PATH "/usr/X11R6/lib/X11/XftConfig"
#endif
#define XFT_DBG_OPEN 1
#define XFT_DBG_OPENV 2
#define XFT_DBG_RENDER 4
#define XFT_DBG_DRAW 8
#define XFT_DBG_REF 16
#define XFT_DBG_GLYPH 32
#define XFT_DBG_GLYPHV 64
#define XFT_DBG_CACHE 128
#define XFT_DBG_CACHEV 256
#define XFT_DBG_MATCH 512
#define XFT_DBG_MATCHV 1024
#define XFT_DBG_EDIT 2048
typedef enum _XftOp {
XftOpInteger, XftOpDouble, XftOpString, XftOpMatrix, XftOpBool, XftOpNil,
XftOpField,
XftOpAssign, XftOpPrepend, XftOpAppend,
XftOpQuest,
XftOpOr, XftOpAnd, XftOpEqual, XftOpNotEqual,
XftOpLess, XftOpLessEqual, XftOpMore, XftOpMoreEqual,
XftOpPlus, XftOpMinus, XftOpTimes, XftOpDivide,
XftOpNot
} XftOp;
typedef struct _XftExpr {
XftOp op;
union {
int ival;
double dval;
char *sval;
XftMatrix *mval;
Bool bval;
char *field;
struct {
struct _XftExpr *left, *right;
} tree;
} u;
} XftExpr;
typedef enum _XftQual {
XftQualAny, XftQualAll
} XftQual;
typedef struct _XftTest {
struct _XftTest *next;
XftQual qual;
const char *field;
XftOp op;
XftValue value;
} XftTest;
typedef struct _XftEdit {
struct _XftEdit *next;
const char *field;
XftOp op;
XftExpr *expr;
} XftEdit;
typedef struct _XftSubst {
struct _XftSubst *next;
XftTest *test;
XftEdit *edit;
} XftSubst;
#define _XftPatternVapBuild(result, orig, va) \
{ \
XftPattern *__p__ = (orig); \
const char *__o__; \
XftValue __v__; \
\
if (!__p__) \
{ \
__p__ = XftPatternCreate (); \
if (!__p__) \
goto _XftPatternVapBuild_bail0; \
} \
for (;;) \
{ \
__o__ = va_arg (va, const char *); \
if (!__o__) \
break; \
__v__.type = va_arg (va, XftType); \
switch (__v__.type) { \
case XftTypeVoid: \
goto _XftPatternVapBuild_bail1; \
case XftTypeInteger: \
__v__.u.i = va_arg (va, int); \
break; \
case XftTypeDouble: \
__v__.u.d = va_arg (va, double); \
break; \
case XftTypeString: \
__v__.u.s = va_arg (va, char *); \
break; \
case XftTypeBool: \
__v__.u.b = va_arg (va, Bool); \
break; \
case XftTypeMatrix: \
__v__.u.m = va_arg (va, XftMatrix *); \
break; \
} \
if (!XftPatternAdd (__p__, __o__, __v__, True)) \
goto _XftPatternVapBuild_bail1; \
} \
result = __p__; \
goto _XftPatternVapBuild_return; \
\
_XftPatternVapBuild_bail1: \
if (!orig) \
XftPatternDestroy (__p__); \
_XftPatternVapBuild_bail0: \
result = 0; \
\
_XftPatternVapBuild_return: \
; \
}
char *
XftFileCacheFind (char *file, int id, int *count);
void
XftFileCacheDispose (void);
void
XftFileCacheLoad (char *cache);
Bool
XftFileCacheUpdate (char *file, int id, char *name);
Bool
XftFileCacheSave (char *cache);
Bool
XftFileCacheReadDir (XftFontSet *set, const char *cache_file);
Bool
XftFileCacheWriteDir (XftFontSet *set, const char *cache_file);
Bool
XftConfigAddDir (char *d);
Bool
XftConfigSetCache (char *c);
char *
XftConfigGetCache (void);
Bool
XftConfigAddEdit (XftTest *test, XftEdit *edit);
Bool
_XftConfigCompareValue (XftValue m,
XftOp op,
XftValue v);
#define XFT_CORE_N16LOCAL 256
XChar2b *
XftCoreConvert16 (XftChar16 *string,
int len,
XChar2b xcloc[XFT_CORE_N16LOCAL]);
XChar2b *
XftCoreConvert32 (XftChar32 *string,
int len,
XChar2b xcloc[XFT_CORE_N16LOCAL]);
XChar2b *
XftCoreConvertUtf8 (XftChar8 *string,
int len,
XChar2b xcloc[XFT_CORE_N16LOCAL],
int *nchar);
void
XftCoreExtents8 (Display *dpy,
XFontStruct *fs,
XftChar8 *string,
int len,
XGlyphInfo *extents);
void
XftCoreExtents16 (Display *dpy,
XFontStruct *fs,
XftChar16 *string,
int len,
XGlyphInfo *extents);
void
XftCoreExtents32 (Display *dpy,
XFontStruct *fs,
XftChar32 *string,
int len,
XGlyphInfo *extents);
void
XftCoreExtentsUtf8 (Display *dpy,
XFontStruct *fs,
XftChar8 *string,
int len,
XGlyphInfo *extents);
Bool
XftCoreGlyphExists (Display *dpy,
XFontStruct *fs,
XftChar32 glyph);
void
XftOpPrint (XftOp op);
void
XftTestPrint (XftTest *test);
void
XftExprPrint (XftExpr *expr);
void
XftEditPrint (XftEdit *edit);
void
XftSubstPrint (XftSubst *subst);
XftDisplayInfo *
_XftDisplayInfoGet (Display *dpy);
int
XftDefaultParseBool (char *v);
Bool
XftDefaultGetBool (Display *dpy, const char *object, int screen, Bool def);
int
XftDefaultGetInteger (Display *dpy, const char *object, int screen, int def);
double
XftDefaultGetDouble (Display *dpy, const char *object, int screen, double def);
XftFontSet *
XftDisplayGetFontSet (Display *dpy);
Bool
XftDrawRenderPrepare (XftDraw *draw,
XftColor *color,
XftFont *font,
int src);
Bool
XftDrawCorePrepare (XftDraw *draw,
XftColor *color,
XftFont *font);
int
_XftFontDebug (void);
int
XftConfigparse (void);
int
XftConfigwrap (void);
void
XftConfigerror (char *fmt, ...);
char *
XftConfigSaveField (const char *field);
XftTest *
XftTestCreate (XftQual qual, const char *field, XftOp compare, XftValue value);
XftExpr *
XftExprCreateInteger (int i);
XftExpr *
XftExprCreateDouble (double d);
XftExpr *
XftExprCreateString (const char *s);
XftExpr *
XftExprCreateMatrix (const XftMatrix *m);
XftExpr *
XftExprCreateBool (Bool b);
XftExpr *
XftExprCreateNil (void);
XftExpr *
XftExprCreateField (const char *field);
XftExpr *
XftExprCreateOp (XftExpr *left, XftOp op, XftExpr *right);
void
XftExprDestroy (XftExpr *e);
XftEdit *
XftEditCreate (const char *field, XftOp op, XftExpr *expr);
void
XftEditDestroy (XftEdit *e);
extern int XftConfigLineno;
extern char *XftConfigFile;
int
XftConfiglex (void);
Bool
XftConfigLexFile(char *s);
Bool
XftConfigPushInput (char *s, Bool complain);
Bool
XftListValueCompare (XftValue v1,
XftValue v2);
Bool
XftListMatch (XftPattern *p,
XftPattern *font,
XftQual qual);
Bool
XftListAppend (XftFontSet *s,
XftPattern *font,
XftObjectSet *os);
Bool
XftNameConstant (char *string, int *result);
extern FcPatternElt *
FcPatternFind (FcPattern *p, const char *object, FcBool insert);
XftPatternElt *
XftPatternFind (XftPattern *p, const char *object, FcBool insert);
XftMatrix *
_XftSaveMatrix (const XftMatrix *mat);
char *
_XftSaveString (const char *s);
const char *
_XftGetInt(const char *ptr, int *val);
char *
_XftSplitStr (const char *field, char *save);
char *
_XftDownStr (const char *field, char *save);
const char *
_XftSplitField (const char *field, char *save);
const char *
_XftSplitValue (const char *field, char *save);
int
_XftMatchSymbolic (XftSymbolic *s, int n, const char *name, int def);
int
_XftStrCmpIgnoreCase (const char *s1, const char *s2);
Bool
XftCoreAddFonts (XftFontSet *set, Display *dpy, Bool ignore_scalable);
#endif