misc/libfreetype/include/freetype/internal/ftobjs.h
author koda
Mon, 25 Apr 2011 01:46:54 +0200
changeset 5172 88f2e05288ba
permissions -rw-r--r--
aaand let's add freetype as well while we are at it other smaller changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5172
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     1
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     2
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     3
/*  ftobjs.h                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     4
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     5
/*    The FreeType private base classes (specification).                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     6
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     7
/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2008, 2010 by       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     9
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    10
/*  This file is part of the FreeType project, and may only be used,       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    11
/*  modified, and distributed under the terms of the FreeType project      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    12
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    13
/*  this file you indicate that you have read the license and              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    14
/*  understand and accept it fully.                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    15
/*                                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    16
/***************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    17
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    18
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    19
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
  /*  This file contains the definition of all internal FreeType classes.  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
#ifndef __FTOBJS_H__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
#define __FTOBJS_H__
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    28
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    29
#include <ft2build.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    30
#include FT_RENDER_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    31
#include FT_SIZES_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
#include FT_LCD_FILTER_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
#include FT_INTERNAL_MEMORY_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
#include FT_INTERNAL_GLYPH_LOADER_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
#include FT_INTERNAL_DRIVER_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
#include FT_INTERNAL_AUTOHINT_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
#include FT_INTERNAL_SERVICE_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    38
#include FT_INTERNAL_PIC_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    39
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
#ifdef FT_CONFIG_OPTION_INCREMENTAL
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
#include FT_INCREMENTAL_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    44
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
FT_BEGIN_HEADER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
  /* Some generic definitions.                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
#ifndef TRUE
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
#define TRUE  1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
#ifndef FALSE
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    57
#define FALSE  0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    58
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
#ifndef NULL
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
#define NULL  (void*)0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
  /* The min and max functions missing in C.  As usual, be careful not to  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
  /* write things like FT_MIN( a++, b++ ) to avoid side effects.           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
#define FT_MIN( a, b )  ( (a) < (b) ? (a) : (b) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
#define FT_MAX( a, b )  ( (a) > (b) ? (a) : (b) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
#define FT_ABS( a )     ( (a) < 0 ? -(a) : (a) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
#define FT_PAD_FLOOR( x, n )  ( (x) & ~((n)-1) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
#define FT_PAD_ROUND( x, n )  FT_PAD_FLOOR( (x) + ((n)/2), n )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
#define FT_PAD_CEIL( x, n )   FT_PAD_FLOOR( (x) + ((n)-1), n )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
#define FT_PIX_FLOOR( x )     ( (x) & ~63 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
#define FT_PIX_ROUND( x )     FT_PIX_FLOOR( (x) + 32 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
#define FT_PIX_CEIL( x )      FT_PIX_FLOOR( (x) + 63 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
  /*
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
   *  Return the highest power of 2 that is <= value; this correspond to
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
   *  the highest bit in a given 32-bit value.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    89
  FT_BASE( FT_UInt32 )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
  ft_highpow2( FT_UInt32  value );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
  /*
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
   *  character classification functions -- since these are used to parse
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
   *  font files, we must not use those in <ctypes.h> which are
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
   *  locale-dependent
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    98
#define  ft_isdigit( x )   ( ( (unsigned)(x) - '0' ) < 10U )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
#define  ft_isxdigit( x )  ( ( (unsigned)(x) - '0' ) < 10U || \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
                             ( (unsigned)(x) - 'a' ) < 6U  || \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
                             ( (unsigned)(x) - 'A' ) < 6U  )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
  /* the next two macros assume ASCII representation */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
#define  ft_isupper( x )  ( ( (unsigned)(x) - 'A' ) < 26U )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
#define  ft_islower( x )  ( ( (unsigned)(x) - 'a' ) < 26U )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   107
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   108
#define  ft_isalpha( x )  ( ft_isupper( x ) || ft_islower( x ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
#define  ft_isalnum( x )  ( ft_isdigit( x ) || ft_isalpha( x ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
  /****                       C H A R M A P S                           ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   121
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   122
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   123
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   124
  /* handle to internal charmap object */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
  typedef struct FT_CMapRec_*              FT_CMap;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   126
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   127
  /* handle to charmap class structure */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   128
  typedef const struct FT_CMap_ClassRec_*  FT_CMap_Class;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   129
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   130
  /* internal charmap object structure */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   131
  typedef struct  FT_CMapRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   132
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   133
    FT_CharMapRec  charmap;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   134
    FT_CMap_Class  clazz;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   135
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   136
  } FT_CMapRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   137
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   138
  /* typecase any pointer to a charmap handle */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   139
#define FT_CMAP( x )              ((FT_CMap)( x ))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   140
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   141
  /* obvious macros */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   142
#define FT_CMAP_PLATFORM_ID( x )  FT_CMAP( x )->charmap.platform_id
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   143
#define FT_CMAP_ENCODING_ID( x )  FT_CMAP( x )->charmap.encoding_id
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   144
#define FT_CMAP_ENCODING( x )     FT_CMAP( x )->charmap.encoding
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   145
#define FT_CMAP_FACE( x )         FT_CMAP( x )->charmap.face
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   146
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   147
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   148
  /* class method definitions */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   149
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   150
  (*FT_CMap_InitFunc)( FT_CMap     cmap,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   151
                       FT_Pointer  init_data );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   152
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   153
  typedef void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   154
  (*FT_CMap_DoneFunc)( FT_CMap  cmap );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   155
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
  typedef FT_UInt
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   157
  (*FT_CMap_CharIndexFunc)( FT_CMap    cmap,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   158
                            FT_UInt32  char_code );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   159
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   160
  typedef FT_UInt
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   161
  (*FT_CMap_CharNextFunc)( FT_CMap     cmap,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   162
                           FT_UInt32  *achar_code );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   163
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   164
  typedef FT_UInt
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   165
  (*FT_CMap_CharVarIndexFunc)( FT_CMap    cmap,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   166
                               FT_CMap    unicode_cmap,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   167
                               FT_UInt32  char_code,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   168
                               FT_UInt32  variant_selector );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   169
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   170
  typedef FT_Bool
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   171
  (*FT_CMap_CharVarIsDefaultFunc)( FT_CMap    cmap,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   172
                                   FT_UInt32  char_code,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   173
                                   FT_UInt32  variant_selector );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   174
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   175
  typedef FT_UInt32 *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   176
  (*FT_CMap_VariantListFunc)( FT_CMap    cmap,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   177
                              FT_Memory  mem );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   178
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   179
  typedef FT_UInt32 *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   180
  (*FT_CMap_CharVariantListFunc)( FT_CMap    cmap,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   181
                                  FT_Memory  mem,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   182
                                  FT_UInt32  char_code );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   183
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   184
  typedef FT_UInt32 *
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   185
  (*FT_CMap_VariantCharListFunc)( FT_CMap    cmap,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   186
                                  FT_Memory  mem,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   187
                                  FT_UInt32  variant_selector );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   188
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   189
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   190
  typedef struct  FT_CMap_ClassRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   191
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   192
    FT_ULong               size;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   193
    FT_CMap_InitFunc       init;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   194
    FT_CMap_DoneFunc       done;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   195
    FT_CMap_CharIndexFunc  char_index;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   196
    FT_CMap_CharNextFunc   char_next;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   197
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   198
    /* Subsequent entries are special ones for format 14 -- the variant */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   199
    /* selector subtable which behaves like no other                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   200
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   201
    FT_CMap_CharVarIndexFunc      char_var_index;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   202
    FT_CMap_CharVarIsDefaultFunc  char_var_default;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   203
    FT_CMap_VariantListFunc       variant_list;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   204
    FT_CMap_CharVariantListFunc   charvariant_list;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   205
    FT_CMap_VariantCharListFunc   variantchar_list;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   206
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   207
  } FT_CMap_ClassRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   208
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   209
#ifndef FT_CONFIG_OPTION_PIC
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   210
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   211
#define FT_DECLARE_CMAP_CLASS(class_) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   212
    FT_CALLBACK_TABLE const FT_CMap_ClassRec class_;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   213
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   214
#define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_,       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   215
        char_next_, char_var_index_, char_var_default_, variant_list_,       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   216
        charvariant_list_, variantchar_list_)                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   217
  FT_CALLBACK_TABLE_DEF                                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   218
  const FT_CMap_ClassRec class_ =                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   219
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   220
    size_, init_, done_, char_index_, char_next_, char_var_index_,           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   221
    char_var_default_, variant_list_, charvariant_list_, variantchar_list_   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   222
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   223
#else /* FT_CONFIG_OPTION_PIC */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   224
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   225
#define FT_DECLARE_CMAP_CLASS(class_) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   226
    void FT_Init_Class_##class_( FT_Library library, FT_CMap_ClassRec*  clazz);
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   227
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   228
#define FT_DEFINE_CMAP_CLASS(class_, size_, init_, done_, char_index_,       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   229
        char_next_, char_var_index_, char_var_default_, variant_list_,       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   230
        charvariant_list_, variantchar_list_)                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   231
  void                                                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   232
  FT_Init_Class_##class_( FT_Library library,                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   233
                          FT_CMap_ClassRec*  clazz)                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   234
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   235
    FT_UNUSED(library);                                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   236
    clazz->size = size_;                                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   237
    clazz->init = init_;                                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   238
    clazz->done = done_;                                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   239
    clazz->char_index = char_index_;                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   240
    clazz->char_next = char_next_;                                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   241
    clazz->char_var_index = char_var_index_;                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   242
    clazz->char_var_default = char_var_default_;                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   243
    clazz->variant_list = variant_list_;                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   244
    clazz->charvariant_list = charvariant_list_;                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   245
    clazz->variantchar_list = variantchar_list_;                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   246
  } 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   247
#endif /* FT_CONFIG_OPTION_PIC */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   248
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   249
  /* create a new charmap and add it to charmap->face */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   250
  FT_BASE( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   251
  FT_CMap_New( FT_CMap_Class  clazz,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   252
               FT_Pointer     init_data,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   253
               FT_CharMap     charmap,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   254
               FT_CMap       *acmap );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   255
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   256
  /* destroy a charmap and remove it from face's list */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   257
  FT_BASE( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   258
  FT_CMap_Done( FT_CMap  cmap );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   259
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   260
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   261
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   262
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   263
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   264
  /*    FT_Face_InternalRec                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   265
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   266
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   267
  /*    This structure contains the internal fields of each FT_Face        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   268
  /*    object.  These fields may change between different releases of     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   269
  /*    FreeType.                                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   270
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   271
  /* <Fields>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   272
  /*    max_points ::                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   273
  /*      The maximal number of points used to store the vectorial outline */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   274
  /*      of any glyph in this face.  If this value cannot be known in     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   275
  /*      advance, or if the face isn't scalable, this should be set to 0. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   276
  /*      Only relevant for scalable formats.                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   277
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   278
  /*    max_contours ::                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   279
  /*      The maximal number of contours used to store the vectorial       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   280
  /*      outline of any glyph in this face.  If this value cannot be      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   281
  /*      known in advance, or if the face isn't scalable, this should be  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   282
  /*      set to 0.  Only relevant for scalable formats.                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   283
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   284
  /*    transform_matrix ::                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   285
  /*      A 2x2 matrix of 16.16 coefficients used to transform glyph       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   286
  /*      outlines after they are loaded from the font.  Only used by the  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   287
  /*      convenience functions.                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   288
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   289
  /*    transform_delta ::                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   290
  /*      A translation vector used to transform glyph outlines after they */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   291
  /*      are loaded from the font.  Only used by the convenience          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   292
  /*      functions.                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   293
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   294
  /*    transform_flags ::                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   295
  /*      Some flags used to classify the transform.  Only used by the     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   296
  /*      convenience functions.                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   297
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   298
  /*    services ::                                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   299
  /*      A cache for frequently used services.  It should be only         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   300
  /*      accessed with the macro `FT_FACE_LOOKUP_SERVICE'.                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   301
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   302
  /*    incremental_interface ::                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   303
  /*      If non-null, the interface through which glyph data and metrics  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   304
  /*      are loaded incrementally for faces that do not provide all of    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   305
  /*      this data when first opened.  This field exists only if          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   306
  /*      @FT_CONFIG_OPTION_INCREMENTAL is defined.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   307
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   308
  /*    ignore_unpatented_hinter ::                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   309
  /*      This boolean flag instructs the glyph loader to ignore the       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   310
  /*      native font hinter, if one is found.  This is exclusively used   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   311
  /*      in the case when the unpatented hinter is compiled within the    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   312
  /*      library.                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   313
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   314
  /*    refcount ::                                                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   315
  /*      A counter initialized to~1 at the time an @FT_Face structure is  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   316
  /*      created.  @FT_Reference_Face increments this counter, and        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   317
  /*      @FT_Done_Face only destroys a face if the counter is~1,          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   318
  /*      otherwise it simply decrements it.                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   319
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   320
  typedef struct  FT_Face_InternalRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   321
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   322
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   323
    FT_UShort           reserved1;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   324
    FT_Short            reserved2;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   325
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   326
    FT_Matrix           transform_matrix;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   327
    FT_Vector           transform_delta;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   328
    FT_Int              transform_flags;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   329
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   330
    FT_ServiceCacheRec  services;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   331
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   332
#ifdef FT_CONFIG_OPTION_INCREMENTAL
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   333
    FT_Incremental_InterfaceRec*  incremental_interface;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   334
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   335
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   336
    FT_Bool             ignore_unpatented_hinter;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   337
    FT_UInt             refcount;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   338
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   339
  } FT_Face_InternalRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   340
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   341
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   342
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   343
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   344
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   345
  /*    FT_Slot_InternalRec                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   346
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   347
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   348
  /*    This structure contains the internal fields of each FT_GlyphSlot   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   349
  /*    object.  These fields may change between different releases of     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   350
  /*    FreeType.                                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   351
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   352
  /* <Fields>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   353
  /*    loader            :: The glyph loader object used to load outlines */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   354
  /*                         into the glyph slot.                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   355
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   356
  /*    flags             :: Possible values are zero or                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   357
  /*                         FT_GLYPH_OWN_BITMAP.  The latter indicates    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   358
  /*                         that the FT_GlyphSlot structure owns the      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   359
  /*                         bitmap buffer.                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   360
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   361
  /*    glyph_transformed :: Boolean.  Set to TRUE when the loaded glyph   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   362
  /*                         must be transformed through a specific        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   363
  /*                         font transformation.  This is _not_ the same  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   364
  /*                         as the face transform set through             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   365
  /*                         FT_Set_Transform().                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   366
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   367
  /*    glyph_matrix      :: The 2x2 matrix corresponding to the glyph     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   368
  /*                         transformation, if necessary.                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   369
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   370
  /*    glyph_delta       :: The 2d translation vector corresponding to    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   371
  /*                         the glyph transformation, if necessary.       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   372
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   373
  /*    glyph_hints       :: Format-specific glyph hints management.       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   374
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   375
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   376
#define FT_GLYPH_OWN_BITMAP  0x1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   377
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   378
  typedef struct  FT_Slot_InternalRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   379
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   380
    FT_GlyphLoader  loader;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   381
    FT_UInt         flags;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   382
    FT_Bool         glyph_transformed;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   383
    FT_Matrix       glyph_matrix;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   384
    FT_Vector       glyph_delta;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   385
    void*           glyph_hints;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   386
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   387
  } FT_GlyphSlot_InternalRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   388
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   389
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   390
#if 0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   391
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   392
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   393
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   394
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   395
  /*    FT_Size_InternalRec                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   396
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   397
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   398
  /*    This structure contains the internal fields of each FT_Size        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   399
  /*    object.  Currently, it's empty.                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   400
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   401
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   402
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   403
  typedef struct  FT_Size_InternalRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   404
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   405
    /* empty */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   406
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   407
  } FT_Size_InternalRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   408
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   409
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   410
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   411
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   412
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   413
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   414
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   415
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   416
  /****                         M O D U L E S                           ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   417
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   418
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   419
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   420
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   421
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   422
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   423
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   424
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   425
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   426
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   427
  /*    FT_ModuleRec                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   428
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   429
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   430
  /*    A module object instance.                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   431
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   432
  /* <Fields>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   433
  /*    clazz   :: A pointer to the module's class.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   434
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   435
  /*    library :: A handle to the parent library object.                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   436
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   437
  /*    memory  :: A handle to the memory manager.                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   438
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   439
  /*    generic :: A generic structure for user-level extensibility (?).   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   440
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   441
  typedef struct  FT_ModuleRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   442
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   443
    FT_Module_Class*  clazz;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   444
    FT_Library        library;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   445
    FT_Memory         memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   446
    FT_Generic        generic;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   447
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   448
  } FT_ModuleRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   449
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   450
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   451
  /* typecast an object to a FT_Module */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   452
#define FT_MODULE( x )          ((FT_Module)( x ))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   453
#define FT_MODULE_CLASS( x )    FT_MODULE( x )->clazz
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   454
#define FT_MODULE_LIBRARY( x )  FT_MODULE( x )->library
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   455
#define FT_MODULE_MEMORY( x )   FT_MODULE( x )->memory
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   456
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   457
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   458
#define FT_MODULE_IS_DRIVER( x )  ( FT_MODULE_CLASS( x )->module_flags & \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   459
                                    FT_MODULE_FONT_DRIVER )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   460
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   461
#define FT_MODULE_IS_RENDERER( x )  ( FT_MODULE_CLASS( x )->module_flags & \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   462
                                      FT_MODULE_RENDERER )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   463
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   464
#define FT_MODULE_IS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   465
                                    FT_MODULE_HINTER )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   466
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   467
#define FT_MODULE_IS_STYLER( x )  ( FT_MODULE_CLASS( x )->module_flags & \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   468
                                    FT_MODULE_STYLER )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   469
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   470
#define FT_DRIVER_IS_SCALABLE( x )  ( FT_MODULE_CLASS( x )->module_flags & \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   471
                                      FT_MODULE_DRIVER_SCALABLE )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   472
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   473
#define FT_DRIVER_USES_OUTLINES( x )  !( FT_MODULE_CLASS( x )->module_flags & \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   474
                                         FT_MODULE_DRIVER_NO_OUTLINES )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   475
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   476
#define FT_DRIVER_HAS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   477
                                     FT_MODULE_DRIVER_HAS_HINTER )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   478
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   479
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   480
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   481
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   482
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   483
  /*    FT_Get_Module_Interface                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   484
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   485
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   486
  /*    Finds a module and returns its specific interface as a typeless    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   487
  /*    pointer.                                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   488
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   489
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   490
  /*    library     :: A handle to the library object.                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   491
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   492
  /*    module_name :: The module's name (as an ASCII string).             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   493
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   494
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   495
  /*    A module-specific interface if available, 0 otherwise.             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   496
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   497
  /* <Note>                                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   498
  /*    You should better be familiar with FreeType internals to know      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   499
  /*    which module to look for, and what its interface is :-)            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   500
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   501
  FT_BASE( const void* )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   502
  FT_Get_Module_Interface( FT_Library   library,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   503
                           const char*  mod_name );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   504
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   505
  FT_BASE( FT_Pointer )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   506
  ft_module_get_service( FT_Module    module,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   507
                         const char*  service_id );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   508
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   509
 /* */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   510
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   511
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   512
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   513
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   514
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   515
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   516
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   517
  /****               FACE, SIZE & GLYPH SLOT OBJECTS                   ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   518
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   519
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   520
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   521
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   522
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   523
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   524
  /* a few macros used to perform easy typecasts with minimal brain damage */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   525
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   526
#define FT_FACE( x )          ((FT_Face)(x))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   527
#define FT_SIZE( x )          ((FT_Size)(x))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   528
#define FT_SLOT( x )          ((FT_GlyphSlot)(x))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   529
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   530
#define FT_FACE_DRIVER( x )   FT_FACE( x )->driver
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   531
#define FT_FACE_LIBRARY( x )  FT_FACE_DRIVER( x )->root.library
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   532
#define FT_FACE_MEMORY( x )   FT_FACE( x )->memory
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   533
#define FT_FACE_STREAM( x )   FT_FACE( x )->stream
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   534
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   535
#define FT_SIZE_FACE( x )     FT_SIZE( x )->face
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   536
#define FT_SLOT_FACE( x )     FT_SLOT( x )->face
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   537
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   538
#define FT_FACE_SLOT( x )     FT_FACE( x )->glyph
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   539
#define FT_FACE_SIZE( x )     FT_FACE( x )->size
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   540
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   541
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   542
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   543
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   544
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   545
  /*    FT_New_GlyphSlot                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   546
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   547
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   548
  /*    It is sometimes useful to have more than one glyph slot for a      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   549
  /*    given face object.  This function is used to create additional     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   550
  /*    slots.  All of them are automatically discarded when the face is   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   551
  /*    destroyed.                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   552
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   553
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   554
  /*    face  :: A handle to a parent face object.                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   555
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   556
  /* <Output>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   557
  /*    aslot :: A handle to a new glyph slot object.                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   558
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   559
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   560
  /*    FreeType error code.  0 means success.                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   561
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   562
  FT_BASE( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   563
  FT_New_GlyphSlot( FT_Face        face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   564
                    FT_GlyphSlot  *aslot );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   565
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   566
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   567
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   568
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   569
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   570
  /*    FT_Done_GlyphSlot                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   571
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   572
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   573
  /*    Destroys a given glyph slot.  Remember however that all slots are  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   574
  /*    automatically destroyed with its parent.  Using this function is   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   575
  /*    not always mandatory.                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   576
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   577
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   578
  /*    slot :: A handle to a target glyph slot.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   579
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   580
  FT_BASE( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   581
  FT_Done_GlyphSlot( FT_GlyphSlot  slot );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   582
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   583
 /* */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   584
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   585
#define FT_REQUEST_WIDTH( req )                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   586
          ( (req)->horiResolution                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   587
              ? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   588
              : (req)->width )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   589
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   590
#define FT_REQUEST_HEIGHT( req )                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   591
          ( (req)->vertResolution                                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   592
              ? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   593
              : (req)->height )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   594
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   595
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   596
  /* Set the metrics according to a bitmap strike. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   597
  FT_BASE( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   598
  FT_Select_Metrics( FT_Face   face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   599
                     FT_ULong  strike_index );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   600
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   601
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   602
  /* Set the metrics according to a size request. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   603
  FT_BASE( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   604
  FT_Request_Metrics( FT_Face          face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   605
                      FT_Size_Request  req );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   606
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   607
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   608
  /* Match a size request against `available_sizes'. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   609
  FT_BASE( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   610
  FT_Match_Size( FT_Face          face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   611
                 FT_Size_Request  req,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   612
                 FT_Bool          ignore_width,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   613
                 FT_ULong*        size_index );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   614
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   615
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   616
  /* Use the horizontal metrics to synthesize the vertical metrics. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   617
  /* If `advance' is zero, it is also synthesized.                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   618
  FT_BASE( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   619
  ft_synthesize_vertical_metrics( FT_Glyph_Metrics*  metrics,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   620
                                  FT_Pos             advance );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   621
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   622
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   623
  /* Free the bitmap of a given glyphslot when needed (i.e., only when it */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   624
  /* was allocated with ft_glyphslot_alloc_bitmap).                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   625
  FT_BASE( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   626
  ft_glyphslot_free_bitmap( FT_GlyphSlot  slot );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   627
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   628
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   629
  /* Allocate a new bitmap buffer in a glyph slot. */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   630
  FT_BASE( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   631
  ft_glyphslot_alloc_bitmap( FT_GlyphSlot  slot,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   632
                             FT_ULong      size );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   633
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   634
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   635
  /* Set the bitmap buffer in a glyph slot to a given pointer.  The buffer */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   636
  /* will not be freed by a later call to ft_glyphslot_free_bitmap.        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   637
  FT_BASE( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   638
  ft_glyphslot_set_bitmap( FT_GlyphSlot  slot,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   639
                           FT_Byte*      buffer );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   640
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   641
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   642
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   643
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   644
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   645
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   646
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   647
  /****                        R E N D E R E R S                        ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   648
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   649
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   650
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   651
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   652
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   653
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   654
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   655
#define FT_RENDERER( x )      ((FT_Renderer)( x ))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   656
#define FT_GLYPH( x )         ((FT_Glyph)( x ))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   657
#define FT_BITMAP_GLYPH( x )  ((FT_BitmapGlyph)( x ))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   658
#define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   659
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   660
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   661
  typedef struct  FT_RendererRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   662
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   663
    FT_ModuleRec            root;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   664
    FT_Renderer_Class*      clazz;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   665
    FT_Glyph_Format         glyph_format;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   666
    FT_Glyph_Class          glyph_class;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   667
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   668
    FT_Raster               raster;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   669
    FT_Raster_Render_Func   raster_render;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   670
    FT_Renderer_RenderFunc  render;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   671
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   672
  } FT_RendererRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   673
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   674
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   675
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   676
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   677
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   678
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   679
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   680
  /****                    F O N T   D R I V E R S                      ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   681
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   682
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   683
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   684
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   685
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   686
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   687
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   688
  /* typecast a module into a driver easily */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   689
#define FT_DRIVER( x )        ((FT_Driver)(x))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   690
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   691
  /* typecast a module as a driver, and get its driver class */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   692
#define FT_DRIVER_CLASS( x )  FT_DRIVER( x )->clazz
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   693
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   694
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   695
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   696
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   697
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   698
  /*    FT_DriverRec                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   699
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   700
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   701
  /*    The root font driver class.  A font driver is responsible for      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   702
  /*    managing and loading font files of a given format.                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   703
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   704
  /*  <Fields>                                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   705
  /*     root         :: Contains the fields of the root module class.     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   706
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   707
  /*     clazz        :: A pointer to the font driver's class.  Note that  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   708
  /*                     this is NOT root.clazz.  `class' wasn't used      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   709
  /*                     as it is a reserved word in C++.                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   710
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   711
  /*     faces_list   :: The list of faces currently opened by this        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   712
  /*                     driver.                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   713
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   714
  /*     extensions   :: A typeless pointer to the driver's extensions     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   715
  /*                     registry, if they are supported through the       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   716
  /*                     configuration macro FT_CONFIG_OPTION_EXTENSIONS.  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   717
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   718
  /*     glyph_loader :: The glyph loader for all faces managed by this    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   719
  /*                     driver.  This object isn't defined for unscalable */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   720
  /*                     formats.                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   721
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   722
  typedef struct  FT_DriverRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   723
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   724
    FT_ModuleRec     root;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   725
    FT_Driver_Class  clazz;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   726
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   727
    FT_ListRec       faces_list;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   728
    void*            extensions;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   729
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   730
    FT_GlyphLoader   glyph_loader;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   731
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   732
  } FT_DriverRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   733
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   734
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   735
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   736
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   737
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   738
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   739
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   740
  /****                       L I B R A R I E S                         ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   741
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   742
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   743
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   744
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   745
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   746
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   747
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   748
  /* This hook is used by the TrueType debugger.  It must be set to an */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   749
  /* alternate truetype bytecode interpreter function.                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   750
#define FT_DEBUG_HOOK_TRUETYPE            0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   751
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   752
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   753
  /* Set this debug hook to a non-null pointer to force unpatented hinting */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   754
  /* for all faces when both TT_USE_BYTECODE_INTERPRETER and               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   755
  /* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined.  This is only used   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   756
  /* during debugging.                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   757
#define FT_DEBUG_HOOK_UNPATENTED_HINTING  1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   758
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   759
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   760
  typedef void  (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap*      bitmap,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   761
                                            FT_Render_Mode  render_mode,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   762
                                            FT_Library      library );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   763
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   764
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   765
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   766
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   767
  /* <Struct>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   768
  /*    FT_LibraryRec                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   769
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   770
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   771
  /*    The FreeType library class.  This is the root of all FreeType      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   772
  /*    data.  Use FT_New_Library() to create a library object, and        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   773
  /*    FT_Done_Library() to discard it and all child objects.             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   774
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   775
  /* <Fields>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   776
  /*    memory           :: The library's memory object.  Manages memory   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   777
  /*                        allocation.                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   778
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   779
  /*    generic          :: Client data variable.  Used to extend the      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   780
  /*                        Library class by higher levels and clients.    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   781
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   782
  /*    version_major    :: The major version number of the library.       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   783
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   784
  /*    version_minor    :: The minor version number of the library.       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   785
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   786
  /*    version_patch    :: The current patch level of the library.        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   787
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   788
  /*    num_modules      :: The number of modules currently registered     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   789
  /*                        within this library.  This is set to 0 for new */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   790
  /*                        libraries.  New modules are added through the  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   791
  /*                        FT_Add_Module() API function.                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   792
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   793
  /*    modules          :: A table used to store handles to the currently */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   794
  /*                        registered modules. Note that each font driver */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   795
  /*                        contains a list of its opened faces.           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   796
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   797
  /*    renderers        :: The list of renderers currently registered     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   798
  /*                        within the library.                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   799
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   800
  /*    cur_renderer     :: The current outline renderer.  This is a       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   801
  /*                        shortcut used to avoid parsing the list on     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   802
  /*                        each call to FT_Outline_Render().  It is a     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   803
  /*                        handle to the current renderer for the         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   804
  /*                        FT_GLYPH_FORMAT_OUTLINE format.                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   805
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   806
  /*    auto_hinter      :: XXX                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   807
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   808
  /*    raster_pool      :: The raster object's render pool.  This can     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   809
  /*                        ideally be changed dynamically at run-time.    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   810
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   811
  /*    raster_pool_size :: The size of the render pool in bytes.          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   812
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   813
  /*    debug_hooks      :: XXX                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   814
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   815
  /*    lcd_filter       :: If subpixel rendering is activated, the        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   816
  /*                        selected LCD filter mode.                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   817
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   818
  /*    lcd_extra        :: If subpixel rendering is activated, the number */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   819
  /*                        of extra pixels needed for the LCD filter.     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   820
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   821
  /*    lcd_weights      :: If subpixel rendering is activated, the LCD    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   822
  /*                        filter weights, if any.                        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   823
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   824
  /*    lcd_filter_func  :: If subpixel rendering is activated, the LCD    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   825
  /*                        filtering callback function.                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   826
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   827
  /*    pic_container    :: Contains global structs and tables, instead    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   828
  /*                        of defining them globallly.                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   829
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   830
  /*    refcount         :: A counter initialized to~1 at the time an      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   831
  /*                        @FT_Library structure is created.              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   832
  /*                        @FT_Reference_Library increments this counter, */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   833
  /*                        and @FT_Done_Library only destroys a library   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   834
  /*                        if the counter is~1, otherwise it simply       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   835
  /*                        decrements it.                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   836
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   837
  typedef struct  FT_LibraryRec_
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   838
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   839
    FT_Memory          memory;           /* library's memory manager */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   840
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   841
    FT_Generic         generic;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   842
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   843
    FT_Int             version_major;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   844
    FT_Int             version_minor;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   845
    FT_Int             version_patch;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   846
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   847
    FT_UInt            num_modules;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   848
    FT_Module          modules[FT_MAX_MODULES];  /* module objects  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   849
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   850
    FT_ListRec         renderers;        /* list of renderers        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   851
    FT_Renderer        cur_renderer;     /* current outline renderer */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   852
    FT_Module          auto_hinter;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   853
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   854
    FT_Byte*           raster_pool;      /* scan-line conversion */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   855
                                         /* render pool          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   856
    FT_ULong           raster_pool_size; /* size of render pool in bytes */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   857
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   858
    FT_DebugHook_Func  debug_hooks[4];
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   859
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   860
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   861
    FT_LcdFilter             lcd_filter;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   862
    FT_Int                   lcd_extra;        /* number of extra pixels */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   863
    FT_Byte                  lcd_weights[7];   /* filter weights, if any */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   864
    FT_Bitmap_LcdFilterFunc  lcd_filter_func;  /* filtering callback     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   865
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   866
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   867
#ifdef FT_CONFIG_OPTION_PIC
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   868
    FT_PIC_Container   pic_container;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   869
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   870
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   871
    FT_UInt            refcount;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   872
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   873
  } FT_LibraryRec;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   874
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   875
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   876
  FT_BASE( FT_Renderer )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   877
  FT_Lookup_Renderer( FT_Library       library,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   878
                      FT_Glyph_Format  format,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   879
                      FT_ListNode*     node );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   880
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   881
  FT_BASE( FT_Error )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   882
  FT_Render_Glyph_Internal( FT_Library      library,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   883
                            FT_GlyphSlot    slot,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   884
                            FT_Render_Mode  render_mode );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   885
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   886
  typedef const char*
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   887
  (*FT_Face_GetPostscriptNameFunc)( FT_Face  face );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   888
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   889
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   890
  (*FT_Face_GetGlyphNameFunc)( FT_Face     face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   891
                               FT_UInt     glyph_index,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   892
                               FT_Pointer  buffer,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   893
                               FT_UInt     buffer_max );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   894
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   895
  typedef FT_UInt
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   896
  (*FT_Face_GetGlyphNameIndexFunc)( FT_Face     face,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   897
                                    FT_String*  glyph_name );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   898
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   899
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   900
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   901
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   902
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   903
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   904
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   905
  /*    FT_New_Memory                                                      */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   906
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   907
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   908
  /*    Creates a new memory object.                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   909
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   910
  /* <Return>                                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   911
  /*    A pointer to the new memory object.  0 in case of error.           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   912
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   913
  FT_BASE( FT_Memory )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   914
  FT_New_Memory( void );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   915
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   916
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   917
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   918
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   919
  /* <Function>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   920
  /*    FT_Done_Memory                                                     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   921
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   922
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   923
  /*    Discards memory manager.                                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   924
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   925
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   926
  /*    memory :: A handle to the memory manager.                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   927
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   928
  FT_BASE( void )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   929
  FT_Done_Memory( FT_Memory  memory );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   930
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   931
#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   932
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   933
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   934
  /* Define default raster's interface.  The default raster is located in  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   935
  /* `src/base/ftraster.c'.                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   936
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   937
  /* Client applications can register new rasters through the              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   938
  /* FT_Set_Raster() API.                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   939
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   940
#ifndef FT_NO_DEFAULT_RASTER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   941
  FT_EXPORT_VAR( FT_Raster_Funcs )  ft_default_raster;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   942
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   943
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   944
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   945
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   946
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   947
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   948
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   949
  /****              PIC-Support Macros for ftimage.h                   ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   950
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   951
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   952
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   953
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   954
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   955
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   956
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   957
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   958
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   959
  /* <Macro>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   960
  /*    FT_DEFINE_OUTLINE_FUNCS                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   961
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   962
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   963
  /*    Used to initialize an instance of FT_Outline_Funcs struct.         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   964
  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   965
  /*    called with a pre-allocated stracture to be filled.                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   966
  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   967
  /*    allocated in the global scope (or the scope where the macro        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   968
  /*    is used).                                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   969
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   970
#ifndef FT_CONFIG_OPTION_PIC
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   971
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   972
#define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_,       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   973
                                cubic_to_, shift_, delta_)                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   974
  static const FT_Outline_Funcs class_ =                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   975
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   976
    move_to_, line_to_, conic_to_, cubic_to_, shift_, delta_                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   977
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   978
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   979
#else /* FT_CONFIG_OPTION_PIC */ 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   980
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   981
#define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_,       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   982
                                cubic_to_, shift_, delta_)                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   983
  static FT_Error                                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   984
  Init_Class_##class_( FT_Outline_Funcs*  clazz )                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   985
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   986
    clazz->move_to = move_to_;                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   987
    clazz->line_to = line_to_;                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   988
    clazz->conic_to = conic_to_;                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   989
    clazz->cubic_to = cubic_to_;                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   990
    clazz->shift = shift_;                                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   991
    clazz->delta = delta_;                                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   992
    return FT_Err_Ok;                                                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   993
  } 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   994
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   995
#endif /* FT_CONFIG_OPTION_PIC */ 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   996
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   997
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   998
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   999
  /* <Macro>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1000
  /*    FT_DEFINE_RASTER_FUNCS                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1001
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1002
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1003
  /*    Used to initialize an instance of FT_Raster_Funcs struct.          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1004
  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1005
  /*    called with a pre-allocated stracture to be filled.                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1006
  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1007
  /*    allocated in the global scope (or the scope where the macro        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1008
  /*    is used).                                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1009
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1010
#ifndef FT_CONFIG_OPTION_PIC
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1011
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1012
#define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_,           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1013
                               raster_reset_, raster_set_mode_,              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1014
                               raster_render_, raster_done_)                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1015
  const FT_Raster_Funcs class_ =                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1016
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1017
    glyph_format_, raster_new_, raster_reset_,                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1018
    raster_set_mode_, raster_render_, raster_done_                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1019
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1020
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1021
#else /* FT_CONFIG_OPTION_PIC */ 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1022
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1023
#define FT_DEFINE_RASTER_FUNCS(class_, glyph_format_, raster_new_,           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1024
    raster_reset_, raster_set_mode_, raster_render_, raster_done_)           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1025
  void                                                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1026
  FT_Init_Class_##class_( FT_Raster_Funcs*  clazz )                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1027
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1028
    clazz->glyph_format = glyph_format_;                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1029
    clazz->raster_new = raster_new_;                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1030
    clazz->raster_reset = raster_reset_;                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1031
    clazz->raster_set_mode = raster_set_mode_;                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1032
    clazz->raster_render = raster_render_;                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1033
    clazz->raster_done = raster_done_;                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1034
  } 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1035
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1036
#endif /* FT_CONFIG_OPTION_PIC */ 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1037
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1038
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1039
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1040
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1041
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1042
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1043
  /****              PIC-Support Macros for ftrender.h                  ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1044
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1045
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1046
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1047
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1048
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1049
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1050
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1051
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1052
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1053
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1054
  /* <Macro>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1055
  /*    FT_DEFINE_GLYPH                                                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1056
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1057
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1058
  /*    Used to initialize an instance of FT_Glyph_Class struct.           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1059
  /*    When FT_CONFIG_OPTION_PIC is defined an init funtion will need to  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1060
  /*    called with a pre-allocated stracture to be filled.                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1061
  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1062
  /*    allocated in the global scope (or the scope where the macro        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1063
  /*    is used).                                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1064
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1065
#ifndef FT_CONFIG_OPTION_PIC
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1066
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1067
#define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_,         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1068
                        transform_, bbox_, prepare_)                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1069
  FT_CALLBACK_TABLE_DEF                                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1070
  const FT_Glyph_Class class_ =                                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1071
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1072
    size_, format_, init_, done_, copy_, transform_, bbox_, prepare_         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1073
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1074
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1075
#else /* FT_CONFIG_OPTION_PIC */ 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1076
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1077
#define FT_DEFINE_GLYPH(class_, size_, format_, init_, done_, copy_,         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1078
                        transform_, bbox_, prepare_)                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1079
  void                                                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1080
  FT_Init_Class_##class_( FT_Glyph_Class*  clazz )                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1081
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1082
    clazz->glyph_size = size_;                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1083
    clazz->glyph_format = format_;                                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1084
    clazz->glyph_init = init_;                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1085
    clazz->glyph_done = done_;                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1086
    clazz->glyph_copy = copy_;                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1087
    clazz->glyph_transform = transform_;                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1088
    clazz->glyph_bbox = bbox_;                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1089
    clazz->glyph_prepare = prepare_;                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1090
  } 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1091
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1092
#endif /* FT_CONFIG_OPTION_PIC */ 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1093
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1094
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1095
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1096
  /* <Macro>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1097
  /*    FT_DECLARE_RENDERER                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1098
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1099
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1100
  /*    Used to create a forward declaration of a                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1101
  /*    FT_Renderer_Class stract instance.                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1102
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1103
  /* <Macro>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1104
  /*    FT_DEFINE_RENDERER                                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1105
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1106
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1107
  /*    Used to initialize an instance of FT_Renderer_Class struct.        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1108
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1109
  /*    When FT_CONFIG_OPTION_PIC is defined a Create funtion will need    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1110
  /*    to called with a pointer where the allocated stracture is returned.*/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1111
  /*    And when it is no longer needed a Destroy function needs           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1112
  /*    to be called to release that allocation.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1113
  /*    fcinit.c (ft_create_default_module_classes) already contains       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1114
  /*    a mechanism to call these functions for the default modules        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1115
  /*    described in ftmodule.h                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1116
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1117
  /*    Notice that the created Create and Destroy functions call          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1118
  /*    pic_init and pic_free function to allow you to manually allocate   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1119
  /*    and initialize any additional global data, like module specific    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1120
  /*    interface, and put them in the global pic container defined in     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1121
  /*    ftpic.h. if you don't need them just implement the functions as    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1122
  /*    empty to resolve the link error.                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1123
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1124
  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1125
  /*    allocated in the global scope (or the scope where the macro        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1126
  /*    is used).                                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1127
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1128
#ifndef FT_CONFIG_OPTION_PIC
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1129
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1130
#define FT_DECLARE_RENDERER(class_)                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1131
    FT_EXPORT_VAR( const FT_Renderer_Class ) class_;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1132
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1133
#define FT_DEFINE_RENDERER(class_,                                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1134
                           flags_, size_, name_, version_, requires_,        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1135
                           interface_, init_, done_, get_interface_,         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1136
                           glyph_format_, render_glyph_, transform_glyph_,   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1137
                           get_glyph_cbox_, set_mode_, raster_class_ )       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1138
  FT_CALLBACK_TABLE_DEF                                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1139
  const FT_Renderer_Class  class_ =                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1140
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1141
    FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1142
                          interface_,init_,done_,get_interface_)             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1143
    glyph_format_,                                                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1144
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1145
    render_glyph_,                                                           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1146
    transform_glyph_,                                                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1147
    get_glyph_cbox_,                                                         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1148
    set_mode_,                                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1149
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1150
    raster_class_                                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1151
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1152
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1153
#else /* FT_CONFIG_OPTION_PIC */ 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1154
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1155
#define FT_DECLARE_RENDERER(class_)  FT_DECLARE_MODULE(class_)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1156
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1157
#define FT_DEFINE_RENDERER(class_, \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1158
                           flags_, size_, name_, version_, requires_,        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1159
                           interface_, init_, done_, get_interface_,         \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1160
                           glyph_format_, render_glyph_, transform_glyph_,   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1161
                           get_glyph_cbox_, set_mode_, raster_class_ )       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1162
  void class_##_pic_free( FT_Library library );                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1163
  FT_Error class_##_pic_init( FT_Library library );                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1164
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1165
  void                                                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1166
  FT_Destroy_Class_##class_( FT_Library        library,                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1167
                        FT_Module_Class*  clazz )                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1168
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1169
    FT_Renderer_Class* rclazz = (FT_Renderer_Class*)clazz;                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1170
    FT_Memory         memory = library->memory;                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1171
    class_##_pic_free( library );                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1172
    if ( rclazz )                                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1173
      FT_FREE( rclazz );                                                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1174
  }                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1175
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1176
  FT_Error                                                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1177
  FT_Create_Class_##class_( FT_Library         library,                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1178
                            FT_Module_Class**  output_class )                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1179
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1180
    FT_Renderer_Class*  clazz;                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1181
    FT_Error            error;                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1182
    FT_Memory           memory = library->memory;                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1183
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1184
    if ( FT_ALLOC( clazz, sizeof(*clazz) ) )                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1185
      return error;                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1186
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1187
    error = class_##_pic_init( library );                                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1188
    if(error)                                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1189
    {                                                                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1190
      FT_FREE( clazz );                                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1191
      return error;                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1192
    }                                                                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1193
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1194
    FT_DEFINE_ROOT_MODULE(flags_,size_,name_,version_,requires_,             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1195
                          interface_,init_,done_,get_interface_)             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1196
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1197
    clazz->glyph_format       = glyph_format_;                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1198
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1199
    clazz->render_glyph       = render_glyph_;                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1200
    clazz->transform_glyph    = transform_glyph_;                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1201
    clazz->get_glyph_cbox     = get_glyph_cbox_;                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1202
    clazz->set_mode           = set_mode_;                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1203
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1204
    clazz->raster_class       = raster_class_;                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1205
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1206
    *output_class = (FT_Module_Class*)clazz;                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1207
    return FT_Err_Ok;                                                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1208
  } 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1209
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1210
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1211
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1212
#endif /* FT_CONFIG_OPTION_PIC */ 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1213
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1214
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1215
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1216
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1217
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1218
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1219
  /****              PIC-Support Macros for ftmodapi.h                  ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1220
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1221
  /****                                                                 ****/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1222
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1223
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1224
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1225
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1226
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1227
#ifdef FT_CONFIG_OPTION_PIC
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1228
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1229
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1230
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1231
  /* <FuncType>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1232
  /*    FT_Module_Creator                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1233
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1234
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1235
  /*    A function used to create (allocate) a new module class object.    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1236
  /*    The object's members are initialized, but the module itself is     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1237
  /*    not.                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1238
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1239
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1240
  /*    memory       :: A handle to the memory manager.                    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1241
  /*    output_class :: Initialized with the newly allocated class.        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1242
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1243
  typedef FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1244
  (*FT_Module_Creator)( FT_Memory          memory,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1245
                        FT_Module_Class**  output_class );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1246
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1247
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1248
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1249
  /* <FuncType>                                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1250
  /*    FT_Module_Destroyer                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1251
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1252
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1253
  /*    A function used to destroy (deallocate) a module class object.     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1254
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1255
  /* <Input>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1256
  /*    memory :: A handle to the memory manager.                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1257
  /*    clazz  :: Module class to destroy.                                 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1258
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1259
  typedef void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1260
  (*FT_Module_Destroyer)( FT_Memory         memory,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1261
                          FT_Module_Class*  clazz );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1262
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1263
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1264
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1265
  /*************************************************************************/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1266
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1267
  /* <Macro>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1268
  /*    FT_DECLARE_MODULE                                                  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1269
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1270
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1271
  /*    Used to create a forward declaration of a                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1272
  /*    FT_Module_Class stract instance.                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1273
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1274
  /* <Macro>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1275
  /*    FT_DEFINE_MODULE                                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1276
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1277
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1278
  /*    Used to initialize an instance of FT_Module_Class struct.          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1279
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1280
  /*    When FT_CONFIG_OPTION_PIC is defined a Create funtion will need    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1281
  /*    to called with a pointer where the allocated stracture is returned.*/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1282
  /*    And when it is no longer needed a Destroy function needs           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1283
  /*    to be called to release that allocation.                           */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1284
  /*    fcinit.c (ft_create_default_module_classes) already contains       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1285
  /*    a mechanism to call these functions for the default modules        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1286
  /*    described in ftmodule.h                                            */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1287
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1288
  /*    Notice that the created Create and Destroy functions call          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1289
  /*    pic_init and pic_free function to allow you to manually allocate   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1290
  /*    and initialize any additional global data, like module specific    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1291
  /*    interface, and put them in the global pic container defined in     */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1292
  /*    ftpic.h. if you don't need them just implement the functions as    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1293
  /*    empty to resolve the link error.                                   */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1294
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1295
  /*    When FT_CONFIG_OPTION_PIC is not defined the struct will be        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1296
  /*    allocated in the global scope (or the scope where the macro        */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1297
  /*    is used).                                                          */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1298
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1299
  /* <Macro>                                                               */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1300
  /*    FT_DEFINE_ROOT_MODULE                                              */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1301
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1302
  /* <Description>                                                         */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1303
  /*    Used to initialize an instance of FT_Module_Class struct inside    */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1304
  /*    another stract that contains it or in a function that initializes  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1305
  /*    that containing stract                                             */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1306
  /*                                                                       */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1307
#ifndef FT_CONFIG_OPTION_PIC
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1308
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1309
#define FT_DECLARE_MODULE(class_)                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1310
  FT_CALLBACK_TABLE                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1311
  const FT_Module_Class  class_;                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1312
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1313
#define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_,     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1314
                              interface_, init_, done_, get_interface_)      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1315
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1316
    flags_,                                                                  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1317
    size_,                                                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1318
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1319
    name_,                                                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1320
    version_,                                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1321
    requires_,                                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1322
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1323
    interface_,                                                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1324
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1325
    init_,                                                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1326
    done_,                                                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1327
    get_interface_,                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1328
  },
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1329
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1330
#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_,  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1331
                         interface_, init_, done_, get_interface_)           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1332
  FT_CALLBACK_TABLE_DEF                                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1333
  const FT_Module_Class class_ =                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1334
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1335
    flags_,                                                                  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1336
    size_,                                                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1337
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1338
    name_,                                                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1339
    version_,                                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1340
    requires_,                                                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1341
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1342
    interface_,                                                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1343
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1344
    init_,                                                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1345
    done_,                                                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1346
    get_interface_,                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1347
  };
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1348
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1349
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1350
#else /* FT_CONFIG_OPTION_PIC */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1351
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1352
#define FT_DECLARE_MODULE(class_)                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1353
  FT_Error FT_Create_Class_##class_( FT_Library library,                     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1354
                                     FT_Module_Class** output_class );       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1355
  void     FT_Destroy_Class_##class_( FT_Library library,                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1356
                                      FT_Module_Class*  clazz );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1357
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1358
#define FT_DEFINE_ROOT_MODULE(flags_, size_, name_, version_, requires_,     \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1359
                              interface_, init_, done_, get_interface_)      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1360
    clazz->root.module_flags       = flags_;                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1361
    clazz->root.module_size        = size_;                                  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1362
    clazz->root.module_name        = name_;                                  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1363
    clazz->root.module_version     = version_;                               \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1364
    clazz->root.module_requires    = requires_;                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1365
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1366
    clazz->root.module_interface   = interface_;                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1367
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1368
    clazz->root.module_init        = init_;                                  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1369
    clazz->root.module_done        = done_;                                  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1370
    clazz->root.get_interface      = get_interface_;               
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1371
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1372
#define FT_DEFINE_MODULE(class_, flags_, size_, name_, version_, requires_,  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1373
                         interface_, init_, done_, get_interface_)           \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1374
  void class_##_pic_free( FT_Library library );                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1375
  FT_Error class_##_pic_init( FT_Library library );                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1376
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1377
  void                                                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1378
  FT_Destroy_Class_##class_( FT_Library library,                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1379
                             FT_Module_Class*  clazz )                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1380
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1381
    FT_Memory memory = library->memory;                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1382
    class_##_pic_free( library );                                            \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1383
    if ( clazz )                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1384
      FT_FREE( clazz );                                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1385
  }                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1386
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1387
  FT_Error                                                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1388
  FT_Create_Class_##class_( FT_Library library,                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1389
                            FT_Module_Class**  output_class )                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1390
  {                                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1391
    FT_Memory memory = library->memory;                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1392
    FT_Module_Class*  clazz;                                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1393
    FT_Error          error;                                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1394
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1395
    if ( FT_ALLOC( clazz, sizeof(*clazz) ) )                                 \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1396
      return error;                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1397
    error = class_##_pic_init( library );                                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1398
    if(error)                                                                \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1399
    {                                                                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1400
      FT_FREE( clazz );                                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1401
      return error;                                                          \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1402
    }                                                                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1403
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1404
    clazz->module_flags       = flags_;                                      \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1405
    clazz->module_size        = size_;                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1406
    clazz->module_name        = name_;                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1407
    clazz->module_version     = version_;                                    \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1408
    clazz->module_requires    = requires_;                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1409
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1410
    clazz->module_interface   = interface_;                                  \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1411
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1412
    clazz->module_init        = init_;                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1413
    clazz->module_done        = done_;                                       \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1414
    clazz->get_interface      = get_interface_;                              \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1415
                                                                             \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1416
    *output_class = clazz;                                                   \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1417
    return FT_Err_Ok;                                                        \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1418
  } 
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1419
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1420
#endif /* FT_CONFIG_OPTION_PIC */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1421
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1422
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1423
FT_END_HEADER
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1424
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1425
#endif /* __FTOBJS_H__ */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1426
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1427
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
  1428
/* END */