misc/libfreetype/src/pshinter/pshpic.c
author sheepluva
Wed, 05 Jun 2013 16:28:30 +0200
changeset 9137 d987230b85ed
parent 5172 88f2e05288ba
permissions -rw-r--r--
fixed all engine compilation hints and notes (that I could see)
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
/*  pshpic.c                                                               */
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 position independent code services for pshinter module. */
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 2009, 2010 by                                                */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
/*  Oran Agra and Mickey Gabel.                                            */
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
#include <ft2build.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
#include FT_FREETYPE_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
#include FT_INTERNAL_OBJECTS_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
#include "pshpic.h"
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
#ifdef FT_CONFIG_OPTION_PIC
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
  /* forward declaration of PIC init functions from pshmod.c */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
  void FT_Init_Class_pshinter_interface( FT_Library, PSHinter_Interface*);
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
  void
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    30
  pshinter_module_class_pic_free( FT_Library library )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    31
  {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
    FT_PIC_Container* pic_container = &library->pic_container;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
    FT_Memory memory = library->memory;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
    if ( pic_container->pshinter )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
    {
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
      FT_FREE( pic_container->pshinter );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
      pic_container->pshinter = NULL;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    38
    }
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
  FT_Error
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
  pshinter_module_class_pic_init( FT_Library  library )
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_PIC_Container*  pic_container = &library->pic_container;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
    FT_Error           error         = PSH_Err_Ok;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
    PSHinterPIC*       container;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
    FT_Memory          memory        = library->memory;
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
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
    /* allocate pointer, clear and set global container pointer */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
    if ( FT_ALLOC ( container, sizeof ( *container ) ) )
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
      return error;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
    FT_MEM_SET( container, 0, sizeof ( *container ) );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
    pic_container->pshinter = container;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
    
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    57
    /* add call to initialization function when you add new scripts */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    58
    FT_Init_Class_pshinter_interface(library, &container->pshinter_interface);
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
/*Exit:*/
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
    if(error)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
      pshinter_module_class_pic_free(library);
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
    return error;
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
#endif /* FT_CONFIG_OPTION_PIC */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
/* END */