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

  1. /*******************************************************************
  2.  *
  3.  *  ttextend.h                                                   1.0
  4.  *
  5.  *    Extensions Interface    
  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.  *  It is now possible to 'extend' the FreeType engine, in order
  17.  *  to be able to access additionnal tables, without having to
  18.  *  to change the core library's code.
  19.  *
  20.  *  Only extensions of the face object class are supported.
  21.  *  Each face object has now a typeless pointer called 'extension'
  22.  *  that can be used as an anchor to the data specific to a given
  23.  *  library extension.
  24.  *
  25.  *  The extension component can also allocate memory on engine
  26.  *  initialisation, which calls the TTExtension_Init function.
  27.  *
  28.  *  NOTE :
  29.  *
  30.  *  The ttextend.h and ttextend.c are used to extend the core           
  31.  *  library. They do not affect the high-level API.  
  32.  *
  33.  *  It is possible to extend the high-level API by modifying the
  34.  *  file 'extend/api.h' found in this same directory
  35.  *  read its source for more information on how to do that.
  36.  *
  37.  ******************************************************************/
  38.  
  39. #ifndef TTEXTEND_H
  40. #define TTEXTEND_H
  41.  
  42. #include "ttcommon.h"
  43. #include "tttypes.h"
  44. #include "ttobjs.h"
  45.  
  46.   #ifdef __cplusplus
  47.   extern "C" {
  48.   #endif
  49.  
  50.   /* You must list there the header files off all the extension */
  51.   /* components you want to add to the core engine.             */
  52.  
  53.   /* ------ kerning support in 'ttkern.h/c' ---- */
  54.  
  55.   #include "ttkern.h"
  56.  
  57.   /* ------- other optional extensions ------------------ */
  58.  
  59.   /* ---------------------------------------------------- */
  60.  
  61.   /* THE extensions structure, root of all extensions        */
  62.   /* You must place a root field for each of your extensions */
  63.  
  64.   struct _TExtension
  65.   {
  66.      TT_Kerning  kerning;    /* optional kerning support */
  67.   };
  68.   
  69.   typedef struct _TExtension  TExtension;
  70.   typedef TExtension*         PExtension;
  71.  
  72.   /* Here comes the minimal API that must be provided by this */
  73.   /* component.                                               */
  74.  
  75.   /* Init the extension component */
  76.   TT_Error  TTExtension_Init();
  77.  
  78.   /* Finalize the extension component */
  79.   TT_Error  TTExtension_Done();
  80.  
  81.   /* Create a new extension for a newly created face.         */
  82.   /* This is called by the face constructor/loader            */
  83.  
  84.   /* Note that you should _never_ change anything in the      */
  85.   /* face object, with the exception of the 'face->extension'.*/
  86.   /* It will be used as an anchor to all the supplemental     */
  87.   /* data that you want to allocate with a face object.       */
  88.   TT_Error  Extension_Create( PFace  face );
  89.  
  90.   /* Destroy an extension. This is called by the face       */
  91.   /* destructor                                             */
  92.   /*                                                        */
  93.   /* Note that this is the last function to be called by    */
  94.   /* the destructor, so all values in the 'face' object     */
  95.   /* should be considered as invalid !                      */
  96.   /*                                                        */
  97.   /* You should only destroy the data that you created      */
  98.   /* from the 'face->extension' anchor.                     */
  99.   /*                                                        */
  100.   TT_Error  Extension_Destroy( PFace  face );
  101.  
  102.   #ifdef __cplusplus
  103.   }
  104.   #endif
  105.  
  106.  
  107. #endif /* TTEXTEND_H */
  108.  
  109.