1 /*******************************************************************
5 * Engine instance structure definition.
7 * Copyright 1996-1999 by
8 * David Turner, Robert Wilhelm, and Werner Lemberg.
10 * This file is part of the FreeType project, and may only be used
11 * modified and distributed under the terms of the FreeType project
12 * license, LICENSE.TXT. By continuing to use, modify, or distribute
13 * this file you indicate that you have read the license and
14 * understand and accept it fully.
18 * - added the 'raster_lock' mutex field to synchronize
19 * scan-line conversion in thread-safe and re-entrant builds.
21 ******************************************************************/
35 /********************************************************************/
37 /* The freetype engine instance structure. */
39 /* This structure holds all the data that is necessary to run */
40 /* one instance of the freetype engine. It is needed to get a */
41 /* completely re-entrant version of the library. */
43 /* The goal is to move _all_ component-specific variables, either */
44 /* static or global in the structure; the component initializers */
45 /* and finalizers will all be called with the address of a valid */
46 /* TEngine_Instance. */
48 /********************************************************************/
50 struct TEngine_Instance_
52 TMutex lock
; /* engine lock */
54 void* list_free_elements
;
56 void* objs_face_class
; /* the face cache class */
57 void* objs_instance_class
; /* the instance cache class */
58 void* objs_execution_class
; /* the context cache class */
59 void* objs_glyph_class
; /* the glyph cache class */
61 void* objs_face_cache
; /* these caches are used to track */
62 void* objs_exec_cache
; /* the current face and execution */
65 void* file_component
; /* ttfile implementation dependent */
67 TMutex raster_lock
; /* mutex for this engine's render pool */
68 void* raster_component
; /* ttraster implementation depedent */
69 Byte raster_palette
[5]; /* gray-levels palette for anti-aliasing */
71 void* extension_component
; /* extensions dependent */
74 TT_Glyph_Loader_Callback glCallback
; /* glyph loader callback, if any */
78 /* NOTE : The raster's lock is only acquired by the Render_Glyph and */
79 /* Render_Gray_Glyph functions, which always release it on exit */
80 /* They do not lock the engine mutex. This means you shouldn't */
81 /* be concerned about deadlocks between the two mutexes, as these */
82 /* should never appear.. */
84 typedef struct TEngine_Instance_ TEngine_Instance
;
85 typedef TEngine_Instance
* PEngine_Instance
;
88 #ifdef TT_CONFIG_OPTION_THREAD_SAFE /* for re-entrant builds */
90 #define ENGINE_ARG TEngine_Instance* _engine
91 #define ENGINE_ARGS TEngine_Instance* _engine,
93 #define ENGINE_VAR _engine
94 #define ENGINE_VARS _engine,
96 #define ENGINE _engine
98 #else /* for thread-safe builds */
100 #define ENGINE_ARG /* void */
106 #endif /* TT_CONFIG_OPTION_THREAD_SAFE */
112 #endif /* TTENGINE_H */