Changed the return value of GetKeyboardState and SetKeyboardState from
[wine] / include / x11font.h
1 /*
2  * X11 physical font definitions
3  *
4  * Copyright 1997 Alex Korobka
5  */
6
7 #ifndef __WINE_X11FONT_H
8 #define __WINE_X11FONT_H
9
10 #include "gdi.h"
11 #include "x11drv.h"
12 #include "pshpack1.h"
13
14 /* this is a part of the font resource header, should 
15  * make it easier to implement dynamic softfont loading */
16
17 typedef struct
18 {
19     INT16       dfType;
20     INT16       dfPoints;
21     INT16       dfVertRes;
22     INT16       dfHorizRes;
23     INT16       dfAscent;
24     INT16       dfInternalLeading;
25     INT16       dfExternalLeading;
26     CHAR        dfItalic;
27     CHAR        dfUnderline;
28     CHAR        dfStrikeOut;
29     INT16       dfWeight;
30     BYTE        dfCharSet;
31     INT16       dfPixWidth;
32     INT16       dfPixHeight;
33     CHAR        dfPitchAndFamily;
34     INT16       dfAvgWidth;
35     INT16       dfMaxWidth;
36     CHAR        dfFirstChar;
37     CHAR        dfLastChar;
38     CHAR        dfDefaultChar;
39     CHAR        dfBreakChar;
40     INT16       dfWidthBytes;
41     LPCSTR      dfDevice;
42     LPCSTR      dfFace;
43 } IFONTINFO16, *LPIFONTINFO16;
44
45 #include "poppack.h"
46
47 /* internal flags */
48
49 #define FI_POLYWEIGHT       0x0001
50 #define FI_POLYSLANT        0x0002
51 #define FI_OBLIQUE          0x0004
52 #define FI_SCALABLE         0x0008
53 #define FI_FW_BOOK          0x0010
54 #define FI_FW_DEMI          0x0020
55 #define FI_VARIABLEPITCH    0x0040
56 #define FI_FIXEDPITCH       0x0080
57
58 #define FI_FIXEDEX          0x1000
59 #define FI_NORMAL           0x2000
60 #define FI_SUBSET           0x4000
61 #define FI_TRUETYPE         0x8000
62
63 /* code pages */
64
65 #define FI_ENC_ANSI             0
66 #define FI_ENC_ISO8859          1
67 #define FI_ENC_ISO646           2
68 #define FI_ENC_MICROSOFT        3
69 #define FI_ENC_KOI8             4
70 #define FI_ENC_ASCII            5
71 #define FI_ENC_VISCII           6
72 #define FI_ENC_TCVN             7
73 #define FI_ENC_TIS620           8
74
75 typedef struct tagFontInfo
76 {
77     struct tagFontInfo*         next;
78     UINT16                      fi_flags;
79     UINT16                      fi_encoding;
80
81  /* LFD parameters can be quite different from the actual metrics */
82
83     UINT16                      lfd_height;
84     UINT16                      lfd_width;
85     UINT16                      lfd_decipoints;
86     UINT16                      lfd_resolution;
87     IFONTINFO16                 df;
88 } fontInfo;
89
90 /* Font resource list for EnumFont() purposes */
91
92 #define FR_SOFTFONT         0x1000              /* - .FON or .FOT file */
93 #define FR_SOFTRESOURCE     0x2000              /* - resource handle */
94 #define FR_REMOVED          0x4000              /* delayed remove */
95 #define FR_NAMESET          0x8000
96
97 typedef struct tagFontResource
98 {
99   struct tagFontResource*       next;
100   UINT16                        fr_flags;
101   UINT16                        fr_penalty;
102   UINT16                        fi_count;
103   UINT16                        fo_count;
104   fontInfo*                     fi;
105   char*                         resource;
106   HANDLE                        hOwner;         /*  For FR_SOFTFONT/FR_SOFTRESOURCE fonts */
107   CHAR                          lfFaceName[LF_FACESIZE];
108 } fontResource;
109
110 typedef struct {
111   float         a,b,c,d;        /* pixelsize matrix, FIXME: switch to MAT2 format */
112   unsigned long RAW_ASCENT;
113   unsigned long RAW_DESCENT;
114   float         pixelsize;
115   float         ascent;
116   float         descent;
117 } XFONTTRANS;
118
119 #define FO_RESOURCE_MASK        0x000F
120 #define FO_SYSTEM               0x0001          /* resident in cache */
121 #define FO_SOFTFONT             0x0002          /* installed at runtime */
122 #define FO_SHARED               0x0004          /* MITSHM */
123 #define FO_REMOVED              0x0008          /* remove when count falls to 0 */
124
125 #define FO_MATCH_MASK           0x00F0
126 #define FO_MATCH_NORASTER       0x0010
127 #define FO_MATCH_PAF            0x0020
128 #define FO_MATCH_XYINDEP        0x0040
129
130 #define FO_SYNTH_MASK           0xFF00
131 #define FO_SYNTH_HEIGHT         0x2000
132 #define FO_SYNTH_WIDTH          0x4000
133 #define FO_SYNTH_ROTATE         0x8000
134 #define FO_SYNTH_BOLD           0x0100
135 #define FO_SYNTH_ITALIC         0x0200
136 #define FO_SYNTH_UNDERLINE      0x0400
137 #define FO_SYNTH_STRIKEOUT      0x0800
138
139 /* Realized screen font */
140
141 typedef struct 
142 {
143   XFontStruct*          fs;                     /* text metrics */
144   fontResource*         fr;                     /* font family */
145   fontInfo*             fi;                     /* font instance info */
146   Pixmap*               lpPixmap;               /* optional character bitmasks for synth fonts */
147
148   XFONTTRANS            *lpX11Trans;            /* Info for X11R6 transform */
149   INT16                 foInternalLeading;
150   INT16                 foAvgCharWidth;
151   INT16                 foMaxCharWidth;
152   UINT16                fo_flags;
153
154   /* font cache housekeeping */
155
156   UINT16                count;
157   UINT16                lru;
158   UINT16                lfchecksum;
159   LOGFONT16             lf;
160 } fontObject;
161
162 typedef struct
163 {
164   fontResource*         pfr;
165   fontInfo*             pfi;
166   UINT16                height;
167   UINT16                flags;
168   LPLOGFONT16           plf;
169 } fontMatch;
170
171 typedef struct
172 {
173   LPLOGFONT16           lpLogFontParam;
174   FONTENUMPROC16        lpEnumFunc;
175   LPARAM                lpData;
176
177   LPNEWTEXTMETRICEX16   lpTextMetric;
178   LPENUMLOGFONTEX16     lpLogFont;
179   SEGPTR                segTextMetric;
180   SEGPTR                segLogFont;
181 } fontEnum16;
182
183 typedef struct
184 {
185   LPLOGFONTW            lpLogFontParam;
186   FONTENUMPROCW lpEnumFunc;
187   LPARAM                lpData;
188
189   LPNEWTEXTMETRICEXW  lpTextMetric;
190   LPENUMLOGFONTEXW    lpLogFont;
191   DWORD                 dwFlags;
192 } fontEnum32;
193
194 extern fontObject* XFONT_GetFontObject( X_PHYSFONT pFont );
195 extern XFontStruct* XFONT_GetFontStruct( X_PHYSFONT pFont );
196 extern LPIFONTINFO16 XFONT_GetFontInfo( X_PHYSFONT pFont );
197
198 #endif /* __WINE_X11FONT_H */