home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / ft-beta.zip / freetype / lib / ttengine.h < prev    next >
C/C++ Source or Header  |  1997-10-06  |  4KB  |  104 lines

  1. /*******************************************************************
  2.  *
  3.  *  ttengine.h                                                   1.0
  4.  *
  5.  *    Engine instance structure definition
  6.  *
  7.  *  Copyright 1996, 1997 by
  8.  *  David Turner, Robert Wilhelm, and Werner Lemberg.
  9.  *
  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.
  15.  *
  16.  ******************************************************************/
  17.  
  18. #ifndef TTENGINE_H
  19. #define TTENGINE_H
  20.  
  21. #include "freetype.h"
  22. #include "ttmutex.h"
  23.  
  24.   #ifdef __cplusplus
  25.   extern "C" {
  26.   #endif
  27.  
  28.   /********************************************************************/
  29.   /*                                                                  */
  30.   /*  The freetype engine instance structure.                         */
  31.   /*                                                                  */
  32.   /*  This structure holds all the data that is necessary to run      */
  33.   /*  one instance of the freetype engine. It is needed to get a      */
  34.   /*  completely re-entrant version of the library.                   */
  35.   /*                                                                  */
  36.   /*  The goal is to move _all_ component-specific variables, either  */
  37.   /*  static or global in the structure; the component initializers   */
  38.   /*  and finalizers will all be called with the address of a valid   */
  39.   /*  TEngine_Instance.                                               */
  40.   /*                                                                  */
  41.   /********************************************************************/
  42.  
  43.   struct _TEngine_Instance 
  44.   {
  45.      TMutex  lock;               /* engine lock */
  46.  
  47.      void*   list_free_elements;
  48.  
  49.      void*   objs_face_class;       /* the face cache class     */
  50.      void*   objs_instance_class;   /* the instance cache class */
  51.      void*   objs_execution_class;  /* the context cache class  */
  52.      void*   objs_glyph_class;      /* the glyph cache class    */
  53.  
  54.      void*   objs_face_cache;  /* these caches are used to track */
  55.      void*   objs_glyph_cache; /* active face and glyph objects  */
  56.                                /* they do not perform recycling  */
  57.  
  58.      void*   file_component;    /* ttfile implementation dependent   */
  59.      void*   memory_component;  /* ttmemory implementation dependent */
  60.  
  61.      void*   raster_component;  /* ttraster implementation depedent  */
  62.      char    raster_palette[5]; /* gray-levels palette for anti-aliasing */
  63.  
  64.      void*   extension_component;  /* extensions dependent */
  65.   };
  66.  
  67.   typedef struct _TEngine_Instance  TEngine_Instance;
  68.   typedef TEngine_Instance         *PEngine_Instance;
  69.  
  70. #ifdef TT_CONFIG_REENTRANT  /* for re-entrant builds */
  71.  
  72.   #define ENGINE_ARG    TEngine_Instance*  _engine
  73.   #define ENGINE_ARGS   TEngine_Instance*  _engine,
  74.  
  75.   #define ENGINE_VAR   _engine
  76.   #define ENGINE_VARS  _engine,
  77.  
  78.   #define ENGINE  _engine
  79.  
  80. #else                       /* for thread-safe builds */
  81.  
  82.   #define ENGINE_ARG    /* void */
  83.   #define ENGINE_ARGS
  84.  
  85.   #define ENGINE_VAR
  86.   #define ENGINE_VARS
  87.  
  88. #endif
  89.  
  90.   extern TEngine_Instance  engine;
  91.   /* the library's single engine instance. This     */
  92.   /* variable must be defined by the high-level API */
  93.  
  94.   /* i.e. the variable is defined in the file 'ttapi.c' */
  95.  
  96.   /* Our goal is to make 'engine' FreeType's engine's _only_ */
  97.   /* global variable, even in re-entrant builds.             */
  98.  
  99.   #ifdef __cplusplus
  100.   }
  101.   #endif
  102.  
  103. #endif /* TTENGINE_H */
  104.