SDL_Pango: SDL_Pango.h Source File

Main Page | Class List | File List | File Members

# SDL_Pango.h

Go to the documentation of this file.

    00001 /*  SDL_Pango.h -- A companion library to SDL for working with Pango.
    00002     Copyright (C) 2004 NAKAMURA Ken'ichi
    00003
    00004     This library is free software; you can redistribute it and/or
    00005     modify it under the terms of the GNU Lesser General Public
    00006     License as published by the Free Software Foundation; either
    00007     version 2.1 of the License, or (at your option) any later version.
    00008
    00009     This library is distributed in the hope that it will be useful,
    00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00012     Lesser General Public License for more details.
    00013
    00014     You should have received a copy of the GNU Lesser General Public
    00015     License along with this library; if not, write to the Free Software
    00016     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
    00017 */
    00018
    00027 #ifndef SDL_PANGO_H
    00028 #define SDL_PANGO_H
    00029
    00030 #include "SDL.h"
    00031
    00032 #include "begin_code.h"
    00033
    00034 #ifdef __cplusplus
    00035 extern "C" {
    00036 #endif
    00037
    00038
    00039
    00040 typedef struct _contextImpl SDLPango_Context;
    00041
    00045 typedef struct _SDLPango_Matrix {
    00046     Uint8 m[4][4];
    00047 } SDLPango_Matrix;
    00048
    00049 const SDLPango_Matrix _MATRIX_WHITE_BACK
    00050     = {255, 0, 0, 0,
    00051        255, 0, 0, 0,
    00052        255, 0, 0, 0,
    00053        255, 255, 0, 0,};
    00054
    00058 const SDLPango_Matrix *MATRIX_WHITE_BACK = &_MATRIX_WHITE_BACK;
    00059
    00060 const SDLPango_Matrix _MATRIX_BLACK_BACK
    00061     = {0, 255, 0, 0,
    00062        0, 255, 0, 0,
    00063        0, 255, 0, 0,
    00064        255, 255, 0, 0,};
    00068 const SDLPango_Matrix *MATRIX_BLACK_BACK = &_MATRIX_BLACK_BACK;
    00069
    00070 const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_BLACK_LETTER
    00071     = {0, 0, 0, 0,
    00072        0, 0, 0, 0,
    00073        0, 0, 0, 0,
    00074        0, 255, 0, 0,};
    00078 const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_BLACK_LETTER = &_MATRIX_TRANSPARENT_BACK_BLACK_LETTER;
    00079
    00080 const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_WHITE_LETTER
    00081     = {255, 255, 0, 0,
    00082        255, 255, 0, 0,
    00083        255, 255, 0, 0,
    00084        0, 255, 0, 0,};
    00088 const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_WHITE_LETTER = &_MATRIX_TRANSPARENT_BACK_WHITE_LETTER;
    00089
    00090 const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER
    00091     = {255, 255, 0, 0,
    00092        255, 255, 0, 0,
    00093        255, 255, 0, 0,
    00094        0, 0, 0, 0,};
    00099 const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER = &_MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER;
    00100
    00104 typedef enum {
    00105     SDLPANGO_DIRECTION_LTR,
    00106     SDLPANGO_DIRECTION_RTL,
    00107     SDLPANGO_DIRECTION_WEAK_LTR,
    00108     SDLPANGO_DIRECTION_WEAK_RTL,
    00109     SDLPANGO_DIRECTION_NEUTRAL
    00110 } SDLPango_Direction;
    00111
    00112
    00113
    00114 extern DECLSPEC int SDLCALL SDLPango_Init();
    00115
    00116 extern DECLSPEC int SDLCALL SDLPango_WasInit();
    00117
    00118 extern DECLSPEC SDLPango_Context* SDLCALL SDLPango_CreateContext();
    00119
    00120 extern DECLSPEC void SDLCALL SDLPango_FreeContext(
    00121     SDLPango_Context *context);
    00122
    00123 extern DECLSPEC void SDLCALL SDLPango_SetSurfaceCreateArgs(
    00124     SDLPango_Context *context,
    00125     Uint32 flags,
    00126     int depth,
    00127     Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
    00128
    00129 extern DECLSPEC SDL_Surface * SDLCALL SDLPango_CreateSurfaceDraw(
    00130     SDLPango_Context *context);
    00131
    00132 extern DECLSPEC void SDLCALL SDLPango_Draw(
    00133     SDLPango_Context *context,
    00134     SDL_Surface *surface,
    00135     int x, int y);
    00136
    00137 extern DECLSPEC void SDLCALL SDLPango_SetDpi(
    00138     SDLPango_Context *context,
    00139     double dpi_x, double dpi_y);
    00140
    00141 extern DECLSPEC void SDLCALL SDLPango_SetMinimumSize(
    00142     SDLPango_Context *context,
    00143     int width, int height);
    00144
    00145 extern DECLSPEC void SDLCALL SDLPango_SetDefaultColor(
    00146     SDLPango_Context *context,
    00147     const SDLPango_Matrix *color_matrix);
    00148
    00149 extern DECLSPEC int SDLCALL SDLPango_GetLayoutWidth(
    00150     SDLPango_Context *context);
    00151
    00152 extern DECLSPEC int SDLCALL SDLPango_GetLayoutHeight(
    00153     SDLPango_Context *context);
    00154
    00155 extern DECLSPEC void SDLCALL SDLPango_SetMarkup(
    00156     SDLPango_Context *context,
    00157     const char *markup,
    00158     int length);
    00159
    00160 extern DECLSPEC void SDLCALL SDLPango_SetText(
    00161     SDLPango_Context *context,
    00162     const char *markup,
    00163     int length);
    00164
    00165 extern DECLSPEC void SDLCALL SDLPango_SetLanguage(
    00166     SDLPango_Context *context,
    00167     const char *language_tag);
    00168
    00169 extern DECLSPEC void SDLCALL SDLPango_SetBaseDirection(
    00170     SDLPango_Context *context,
    00171     SDLPango_Direction direction);
    00172
    00173
    00174 #ifdef __FT2_BUILD_UNIX_H__
    00175
    00176 extern DECLSPEC void SDLCALL SDLPango_CopyFTBitmapToSurface(
    00177     const FT_Bitmap *bitmap,
    00178     SDL_Surface *surface,
    00179     const SDLPango_Matrix *matrix,
    00180     SDL_Rect *rect);
    00181
    00182 #endif  /* __FT2_BUILD_UNIX_H__ */
    00183
    00184
    00185 #ifdef __PANGO_H__
    00186
    00187 extern DECLSPEC PangoFontMap* SDLCALL SDLPango_GetPangoFontMap(
    00188     SDLPango_Context *context);
    00189
    00190 extern DECLSPEC PangoFontDescription* SDLCALL SDLPango_GetPangoFontDescription(
    00191     SDLPango_Context *context);
    00192
    00193 extern DECLSPEC PangoLayout* SDLCALL SDLPango_GetPangoLayout(
    00194     SDLPango_Context *context);
    00195
    00196 #endif /* __PANGO_H__ */
    00197
    00198
    00199 #ifdef __cplusplus
    00200 }
    00201 #endif
    00202
    00203 #include "close_code.h"
    00204
    00205 #endif  /* SDL_PANGO_H */