Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. /*******************************************************************
  2.  *
  3.  *  tttypes.h
  4.  *
  5.  *    Freetype engine's common types specification
  6.  *    (this spec has no associated body).
  7.  *
  8.  *  Copyright 1996-1999 by
  9.  *  David Turner, Robert Wilhelm, and Werner Lemberg.
  10.  *
  11.  *  This file is part of the FreeType project, and may only be used
  12.  *  modified and distributed under the terms of the FreeType project
  13.  *  license, LICENSE.TXT. By continuing to use, modify, or distribute
  14.  *  this file you indicate that you have read the license and
  15.  *  understand and accept it fully.
  16.  *
  17.  *  NOTE:
  18.  *
  19.  *   All these declarations are library internals, and *not* part
  20.  *   of the high-level interface.  See also 'freetype.h'.
  21.  *
  22.  ******************************************************************/
  23.  
  24. #ifndef TTTYPES_H
  25. #define TTTYPES_H
  26.  
  27. #include "ttconfig.h"
  28. #include "freetype.h"
  29.  
  30. #ifdef __MACTYPES__
  31. #error "<MacTypes.h> have been included, and this prevents the proper\
  32.  compilation of this library.  Please remove the precompiled headers."
  33. #endif
  34.  
  35.   typedef          char   String;
  36.   typedef signed   char   Char;
  37.   typedef unsigned char   Byte;
  38.  
  39.   typedef unsigned short  UShort;
  40.   typedef signed   short  Short;
  41.  
  42.   typedef unsigned long   ULong;
  43.   typedef signed   long   Long;
  44.  
  45.   typedef TT_Int32        Fixed;
  46.  
  47.   typedef int             Int;
  48.  
  49.   /* Simple access types: pointers and tables */
  50.  
  51.   typedef Byte*    PByte;
  52.   typedef UShort*  PUShort;
  53.   typedef Short*   PShort;
  54.   typedef ULong*   PULong;
  55.   typedef Long*    PLong;
  56.  
  57.   typedef Fixed*   PFixed;
  58.  
  59.   typedef Int*     PInt;
  60.  
  61.   typedef void*    Pointer;
  62.  
  63.   typedef TT_F26Dot6*     PCoordinates;
  64.   typedef unsigned char*  PTouchTable;
  65.  
  66.  
  67. #ifndef Bool
  68.   typedef int  Bool;        /* No boolean type in C */
  69. #endif
  70.  
  71. #ifndef TRUE
  72. #define TRUE  1
  73. #endif
  74.  
  75. #ifndef FALSE
  76. #define FALSE  0
  77. #endif
  78.  
  79. #ifndef NULL
  80. #define NULL  (void*)0
  81. #endif
  82.  
  83.   typedef Long      Storage;
  84.   typedef Storage*  PStorage;
  85.  
  86.  
  87. /* Rounding mode constants */
  88.  
  89. #define TT_Round_Off             5
  90. #define TT_Round_To_Half_Grid    0
  91. #define TT_Round_To_Grid         1
  92. #define TT_Round_To_Double_Grid  2
  93. #define TT_Round_Up_To_Grid      4
  94. #define TT_Round_Down_To_Grid    3
  95. #define TT_Round_Super           6
  96. #define TT_Round_Super_45        7
  97.  
  98.  
  99. /* Touch flag masks */
  100.  
  101. #define TT_Flag_On_Curve      1
  102. #define TT_Flag_Touched_X     2
  103. #define TT_Flag_Touched_Y     4
  104. #define TT_Flag_Touched_Both  6
  105.  
  106.  
  107. /* Error management constants :) */
  108.  
  109. #define SUCCESS  0
  110. #define FAILURE  -1
  111.  
  112.  
  113. /* The min and max functions missing in C.  As usual, be careful not to */
  114. /* write things like MIN( a++, b++ ) to avoid side effects.             */
  115.  
  116. #ifndef MIN
  117. #define MIN( a, b )  ( (a) < (b) ? (a) : (b) )
  118. #endif
  119.  
  120. #ifndef MAX
  121. #define MAX( a, b )  ( (a) > (b) ? (a) : (b) )
  122. #endif
  123.  
  124. #ifndef ABS
  125. #define ABS( a )     ( (a) < 0 ? -(a) : (a) )
  126. #endif
  127.  
  128. /* conversion macros for the handles defined in freetype.h */
  129.  
  130. #define HANDLE_Val( handle )       ((handle).z)
  131.  
  132. #define HANDLE_Engine( handle )    ((PEngine_Instance)HANDLE_Val( handle ))
  133.  
  134. #define HANDLE_Face( handle )      ((PFace)HANDLE_Val( handle ))
  135.  
  136. #define HANDLE_Instance( handle )  ((PInstance)HANDLE_Val( handle ))
  137.  
  138. /* HANDLE_Stream( handle ) must be defined in ttfile.c */
  139.  
  140. #define HANDLE_Glyph( handle )     ((PGlyph)HANDLE_Val( handle ))
  141.  
  142. #define HANDLE_CharMap( handle )   ((PCMapTable)HANDLE_Val( handle ))
  143.  
  144. #define HANDLE_Set( handle, val )  ((handle).z = (void*)(val))
  145.  
  146.  
  147. #endif /* TTTYPES_H */
  148.  
  149.  
  150. /* END */
  151.