1 /* QuesoGLC
2  * A free implementation of the OpenGL Character Renderer (GLC)
3  * Copyright (c) 2002, 2004-2007, Bertrand Coconnier
4  *
5  *  This library is free software; you can redistribute it and/or
6  *  modify it under the terms of the GNU Lesser General Public
7  *  License as published by the Free Software Foundation; either
8  *  version 2.1 of the License, or (at your option) any later version.
9  *
10  *  This library is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  *  Lesser General Public License for more details.
14  *
15  *  You should have received a copy of the GNU Lesser General Public
16  *  License along with this library; if not, write to the Free Software
17  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18  */
19 
20 #if !defined(__glc_h_)
21 #define __glc_h_
22 
23 /************************************************************************
24  * Begin system-specific stuff
25  * from Mesa 3-D graphics library
26  * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
27  *
28  * Permission is hereby granted, free of charge, to any person obtaining a
29  * copy of this software and associated documentation files (the "Software"),
30  * to deal in the Software without restriction, including without limitation
31  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
32  * and/or sell copies of the Software, and to permit persons to whom the
33  * Software is furnished to do so, subject to the following conditions:
34  *
35  * The above copyright notice and this permission notice shall be included
36  * in all copies or substantial portions of the Software.
37  *
38  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
39  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
41  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
42  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
43  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
44  */
45 /* __WIN32__ */
46 #if !defined(__WIN32__) && (defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__))
47 #  define __WIN32__
48 #endif
49 
50 #ifdef __WIN32__
51 #  include <windows.h>
52 #endif
53 
54 /* GLCAPI, part 1 (use WINGDIAPI, if defined) */
55 #if defined(__WIN32__) && defined(WINGDIAPI) && !defined(GLCAPI)
56 #  define GLCAPI WINGDIAPI
57 #endif
58 
59 /* GLCAPI, part 2 */
60 #if !defined(GLCAPI)
61 #  if defined(_MSC_VER)                        /* Microsoft Visual C++ */
62 #    define GLCAPI __declspec(dllimport)
63 #  elif defined(__LCC__) && defined(__WIN32__) /* LCC-Win32 */
64 #    define GLCAPI __stdcall
65 #  else                                        /* Others (e.g. MinGW, Cygwin, non-win32) */
66 #    define GLCAPI extern
67 #  endif
68 #endif
69 
70 /* APIENTRY */
71 #if !defined(APIENTRY)
72 #  if defined(__WIN32__)
73 #    define APIENTRY __stdcall
74 #  else
75 #    define APIENTRY
76 #  endif
77 #endif
78 
79 /* CALLBACK */
80 #if !defined(CALLBACK)
81 #  if defined(__WIN32__)
82 #    define CALLBACK __stdcall
83 #  else
84 #    define CALLBACK
85 #  endif
86 #endif
87 /*
88  * End system-specific stuff.
89  ************************************************************************/
90 
91 
92 
93 #if defined __APPLE__ && defined __MACH__
94 #include <OpenGL/gl.h>
95 #else
96 #include <GL/gl.h>
97 #endif
98 
99 #if defined(__cplusplus)
100     extern "C" {
101 #endif
102 
103 typedef void GLCchar;
104 typedef GLint GLCenum;
105 
106 #if defined(__cplusplus)
107 typedef GLboolean (CALLBACK *GLCfunc)(GLint);
108 #else
109 typedef GLboolean (CALLBACK *GLCfunc)(GLint);
110 #endif
111 
112 /*************************************************************/
113 
114 #define GLC_NONE                                  0x0000
115 
116 #define GLC_AUTO_FONT                             0x0010
117 #define GLC_GL_OBJECTS                            0x0011
118 #define GLC_MIPMAP                                0x0012
119 
120 #define GLC_OP_glcUnmappedCode                    0x0020
121 
122 #define GLC_BASELINE                              0x0030
123 #define GLC_BOUNDS                                0x0031
124 
125 #define GLC_PARAMETER_ERROR                       0x0040
126 #define GLC_RESOURCE_ERROR                        0x0041
127 #define GLC_STATE_ERROR                           0x0042
128 
129 #define GLC_CHAR_LIST                             0x0050
130 #define GLC_FACE_LIST                             0x0051
131 
132 #define GLC_FAMILY                                0x0060
133 #define GLC_MASTER_FORMAT                         0x0061
134 #define GLC_VENDOR                                0x0062
135 #define GLC_VERSION                               0x0063
136 
137 #define GLC_CHAR_COUNT                            0x0070
138 #define GLC_FACE_COUNT                            0x0071
139 #define GLC_IS_FIXED_PITCH                        0x0072
140 #define GLC_MAX_MAPPED_CODE                       0x0073
141 #define GLC_MIN_MAPPED_CODE                       0x0074
142 #define GLC_IS_OUTLINE                            0x0075
143 
144 #define GLC_CATALOG_LIST                          0x0080
145 
146 #define GLC_CURRENT_FONT_LIST                     0x0090
147 #define GLC_FONT_LIST                             0x0091
148 #define GLC_LIST_OBJECT_LIST                      0x0092
149 #define GLC_TEXTURE_OBJECT_LIST                   0x0093
150 
151 #define GLC_DATA_POINTER                          0x00A0
152 
153 #define GLC_EXTENSIONS                            0x00B0
154 #define GLC_RELEASE                               0x00B1
155 
156 #define GLC_RESOLUTION                            0x00C0
157 
158 #define GLC_BITMAP_MATRIX                         0x00D0
159 
160 #define GLC_CATALOG_COUNT                         0x00E0
161 #define GLC_CURRENT_FONT_COUNT                    0x00E1
162 #define GLC_FONT_COUNT                            0x00E2
163 #define GLC_LIST_OBJECT_COUNT                     0x00E3
164 #define GLC_MASTER_COUNT                          0x00E4
165 #define GLC_MEASURED_CHAR_COUNT                   0x00E5
166 #define GLC_RENDER_STYLE                          0x00E6
167 #define GLC_REPLACEMENT_CODE                      0x00E7
168 #define GLC_STRING_TYPE                           0x00E8
169 #define GLC_TEXTURE_OBJECT_COUNT                  0x00E9
170 #define GLC_VERSION_MAJOR                         0x00EA
171 #define GLC_VERSION_MINOR                         0x00EB
172 
173 #define GLC_BITMAP                                0x0100
174 #define GLC_LINE                                  0x0101
175 #define GLC_TEXTURE                               0x0102
176 #define GLC_TRIANGLE                              0x0103
177 
178 #define GLC_UCS1                                  0x0110
179 #define GLC_UCS2                                  0x0111
180 #define GLC_UCS4                                  0x0112
181 
182 /*************************************************************/
183 
184 GLCAPI void APIENTRY glcContext (GLint inContext);
185 GLCAPI void APIENTRY glcDeleteContext (GLint inContext);
186 GLCAPI GLint APIENTRY glcGenContext (void);
187 GLCAPI GLint* APIENTRY glcGetAllContexts (void);
188 GLCAPI GLint APIENTRY glcGetCurrentContext (void);
189 GLCAPI GLCenum APIENTRY glcGetError (void);
190 GLCAPI GLboolean APIENTRY glcIsContext (GLint inContext);
191 
192 GLCAPI void APIENTRY glcCallbackFunc (GLCenum inOpcode, GLCfunc inFunc);
193 GLCAPI void APIENTRY glcDataPointer (GLvoid *inPointer);
194 GLCAPI void APIENTRY glcDeleteGLObjects (void);
195 GLCAPI void APIENTRY glcDisable (GLCenum inAttrib);
196 GLCAPI void APIENTRY glcEnable (GLCenum inAttrib);
197 GLCAPI GLCfunc APIENTRY glcGetCallbackFunc (GLCenum inOpcode);
198 GLCAPI const GLCchar* APIENTRY glcGetListc (GLCenum inAttrib, GLint inIndex);
199 GLCAPI GLint APIENTRY glcGetListi (GLCenum inAttrib, GLint inIndex);
200 GLCAPI GLvoid* APIENTRY glcGetPointer (GLCenum inAttrib);
201 GLCAPI const GLCchar* APIENTRY glcGetc (GLCenum inAttrib);
202 GLCAPI GLfloat APIENTRY glcGetf (GLCenum inAttrib);
203 GLCAPI GLfloat* APIENTRY glcGetfv (GLCenum inAttrib, GLfloat *outVec);
204 GLCAPI GLint APIENTRY glcGeti (GLCenum inAttrib);
205 GLCAPI GLboolean APIENTRY glcIsEnabled (GLCenum inAttrib);
206 GLCAPI void APIENTRY glcStringType (GLCenum inStringType);
207 
208 GLCAPI void APIENTRY glcAppendCatalog (const GLCchar *inCatalog);
209 GLCAPI const GLCchar* APIENTRY glcGetMasterListc (GLint inMaster,
210 						  GLCenum inAttrib,
211 						  GLint inIndex);
212 GLCAPI const GLCchar* APIENTRY glcGetMasterMap (GLint inMaster, GLint inCode);
213 GLCAPI const GLCchar* APIENTRY glcGetMasterc (GLint inMaster, GLCenum inAttrib);
214 GLCAPI GLint APIENTRY glcGetMasteri (GLint inMaster, GLCenum inAttrib);
215 GLCAPI void APIENTRY glcPrependCatalog (const GLCchar *inCatalog);
216 GLCAPI void APIENTRY glcRemoveCatalog (GLint inIndex);
217 
218 GLCAPI void APIENTRY glcAppendFont (GLint inFont);
219 GLCAPI void APIENTRY glcDeleteFont (GLint inFont);
220 GLCAPI void APIENTRY glcFont (GLint inFont);
221 GLCAPI GLboolean APIENTRY glcFontFace (GLint inFont, const GLCchar *inFace);
222 GLCAPI void APIENTRY glcFontMap (GLint inFont, GLint inCode,
223 				 const GLCchar *inCharName);
224 GLCAPI GLint APIENTRY glcGenFontID (void);
225 GLCAPI const GLCchar* APIENTRY glcGetFontFace (GLint inFont);
226 GLCAPI const GLCchar* APIENTRY glcGetFontListc (GLint inFont,
227 						GLCenum inAttrib,
228 						GLint inIndex);
229 GLCAPI const GLCchar* APIENTRY glcGetFontMap (GLint inFont, GLint inCode);
230 GLCAPI const GLbyte* APIENTRY glcGetFontMasterArray (GLint inFont,
231 						     GLboolean inFull,
232 						     GLint *outCount);
233 GLCAPI const GLCchar* APIENTRY glcGetFontc (GLint inFont, GLCenum inAttrib);
234 GLCAPI GLint APIENTRY glcGetFonti (GLint inFont, GLCenum inAttrib);
235 GLCAPI GLboolean APIENTRY glcIsFont (GLint inFont);
236 GLCAPI GLint APIENTRY glcNewFontFromFamily (GLint inFont,
237 					    const GLCchar *inFamily);
238 GLCAPI GLint APIENTRY glcNewFontFromMaster (GLint inFont, GLint inMaster);
239 
240 GLCAPI void APIENTRY glcLoadIdentity (void);
241 GLCAPI void APIENTRY glcLoadMatrix (const GLfloat *inMatrix);
242 GLCAPI void APIENTRY glcMultMatrix (const GLfloat *inMatrix);
243 GLCAPI void APIENTRY glcRotate (GLfloat inAngle);
244 GLCAPI void APIENTRY glcScale (GLfloat inX, GLfloat inY);
245 
246 GLCAPI void APIENTRY glcRenderChar (GLint inCode);
247 GLCAPI void APIENTRY glcRenderCountedString (GLint inCount,
248 					     const GLCchar *inString);
249 GLCAPI void APIENTRY glcRenderString (const GLCchar *inString);
250 GLCAPI void APIENTRY glcRenderStyle (GLCenum inStyle);
251 GLCAPI void APIENTRY glcReplacementCode (GLint inCode);
252 GLCAPI void APIENTRY glcResolution (GLfloat inVal);
253 
254 GLCAPI GLfloat* APIENTRY glcGetCharMetric (GLint inCode, GLCenum inMetric,
255 					   GLfloat *outVec);
256 GLCAPI GLfloat* APIENTRY glcGetMaxCharMetric (GLCenum inMetric,
257 					      GLfloat *outVec);
258 GLCAPI GLfloat* APIENTRY glcGetStringCharMetric (GLint inIndex,
259 						 GLCenum inMetric,
260 						 GLfloat *outVec);
261 GLCAPI GLfloat* APIENTRY glcGetStringMetric (GLCenum inMetric, GLfloat *outVec);
262 GLCAPI GLint APIENTRY glcMeasureCountedString (GLboolean inMeasureChars,
263 					       GLint inCount,
264 					       const GLCchar *inString);
265 GLCAPI GLint APIENTRY glcMeasureString (GLboolean inMeasureChars,
266 					const GLCchar *inString);
267 
268 /*************************************************************/
269 
270 #define GLC_SGI_ufm_typeface_handle               1
271 #define GLC_UFM_TYPEFACE_HANDLE_SGI               0x8001
272 #define GLC_UFM_TYPEFACE_HANDLE_COUNT_SGI         0x8003
273 GLCAPI GLint APIENTRY glcGetMasterListiSGI(GLint inMaster, GLCenum inAttrib,
274 					   GLint inIndex);
275 GLCAPI GLint APIENTRY glcGetFontListiSGI(GLint inFont, GLCenum inAttrib,
276 					 GLint inIndex);
277 
278 #define GLC_SGI_full_name                         1
279 #define GLC_FULL_NAME_SGI                         0x8002
280 
281 #define GLC_QSO_utf8                              1
282 #define GLC_UTF8_QSO                              0x8004
283 
284 #define GLC_QSO_hinting                           1
285 #define GLC_HINTING_QSO                           0x8005
286 
287 #define GLC_QSO_extrude                           1
288 #define GLC_EXTRUDE_QSO                           0x8006
289 
290 #define GLC_QSO_kerning                           1
291 #define GLC_KERNING_QSO                           0x8007
292 
293 #define GLC_QSO_matrix_stack                      1
294 #define GLC_MATRIX_STACK_DEPTH_QSO                0x8008
295 #define GLC_MAX_MATRIX_STACK_DEPTH_QSO            0x8009
296 #define GLC_STACK_OVERFLOW_QSO                    0x800A
297 #define GLC_STACK_UNDERFLOW_QSO                   0x800B
298 GLCAPI void APIENTRY glcPushMatrixQSO(void);
299 GLCAPI void APIENTRY glcPopMatrixQSO(void);
300 
301 #define GLC_QSO_attrib_stack                      1
302 #define GLC_ENABLE_BIT_QSO                        0x00000001
303 #define GLC_RENDER_BIT_QSO                        0x00000002
304 #define GLC_STRING_BIT_QSO                        0x00000004
305 #define GLC_GL_ATTRIB_BIT_QSO                     0x00000008
306 #define GLC_ALL_ATTRIB_BITS_QSO                   0x0000FFFF
307 #define GLC_ATTRIB_STACK_DEPTH_QSO                0x800C
308 #define GLC_MAX_ATTRIB_STACK_DEPTH_QSO            0x800D
309 GLCAPI void APIENTRY glcPushAttribQSO(GLbitfield inMask);
310 GLCAPI void APIENTRY glcPopAttribQSO(void);
311 
312 #define GLC_QSO_buffer_object                     1
313 #define GLC_BUFFER_OBJECT_COUNT_QSO               0x800E
314 #define GLC_BUFFER_OBJECT_LIST_QSO                0x800F
315 
316 #if defined (__cplusplus)
317 }
318 #endif
319 
320 #endif /* defined (__glc_h_) */
321