Including our OWN SDL_Pango.h, since the shipped on (in Ubuntu) includes

some const SDLPango_Matrixes that are not declared static, so when
linking Tux Paint, since SDL_Pango.h is #included by both fonts.h and
tuxpaint.c, the linker complained about multiple declarations. *sigh*
This commit is contained in:
William Kendrick 2007-07-12 19:06:44 +00:00
parent 095ba8efb3
commit 3d1718a2b7

168
src/SDL_Pango.h Normal file
View file

@ -0,0 +1,168 @@
/* SDL_Pango.h -- A companion library to SDL for working with Pango.
Copyright (C) 2004 NAKAMURA Ken'ichi
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
/*! @file
@brief Header file of SDL_Pango
@author NAKAMURA Ken'ichi
@date 2004/08/26
$Revision$
*/
#ifndef SDL_PANGO_H
#define SDL_PANGO_H
#include "SDL.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _contextImpl SDLPango_Context;
/*!
General 4 X 4 matrix struct.
*/
typedef struct _SDLPango_Matrix {
Uint8 m[4][4]; /*! Matrix variables */
} SDLPango_Matrix;
/*!
Specifies direction of text. See Pango reference for detail
*/
typedef enum {
SDLPANGO_DIRECTION_LTR, /*! Left to right */
SDLPANGO_DIRECTION_RTL, /*! Right to left */
SDLPANGO_DIRECTION_WEAK_LTR, /*! Left to right (weak) */
SDLPANGO_DIRECTION_WEAK_RTL, /*! Right to left (weak) */
SDLPANGO_DIRECTION_NEUTRAL /*! Neutral */
} SDLPango_Direction;
/*!
Specifies alignment of text. See Pango reference for detail
*/
typedef enum {
SDLPANGO_ALIGN_LEFT,
SDLPANGO_ALIGN_CENTER,
SDLPANGO_ALIGN_RIGHT
} SDLPango_Alignment;
extern DECLSPEC int SDLCALL SDLPango_Init();
extern DECLSPEC int SDLCALL SDLPango_WasInit();
extern DECLSPEC SDLPango_Context* SDLCALL SDLPango_CreateContext_GivenFontDesc(const char* font_desc);
extern DECLSPEC SDLPango_Context* SDLCALL SDLPango_CreateContext();
extern DECLSPEC void SDLCALL SDLPango_FreeContext(
SDLPango_Context *context);
extern DECLSPEC void SDLCALL SDLPango_SetSurfaceCreateArgs(
SDLPango_Context *context,
Uint32 flags,
int depth,
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
extern DECLSPEC SDL_Surface * SDLCALL SDLPango_CreateSurfaceDraw(
SDLPango_Context *context);
extern DECLSPEC void SDLCALL SDLPango_Draw(
SDLPango_Context *context,
SDL_Surface *surface,
int x, int y);
extern DECLSPEC void SDLCALL SDLPango_SetDpi(
SDLPango_Context *context,
double dpi_x, double dpi_y);
extern DECLSPEC void SDLCALL SDLPango_SetMinimumSize(
SDLPango_Context *context,
int width, int height);
extern DECLSPEC void SDLCALL SDLPango_SetDefaultColor(
SDLPango_Context *context,
const SDLPango_Matrix *color_matrix);
extern DECLSPEC int SDLCALL SDLPango_GetLayoutWidth(
SDLPango_Context *context);
extern DECLSPEC int SDLCALL SDLPango_GetLayoutHeight(
SDLPango_Context *context);
extern DECLSPEC void SDLCALL SDLPango_SetMarkup(
SDLPango_Context *context,
const char *markup,
int length);
extern DECLSPEC void SDLCALL SDLPango_SetText_GivenAlignment(
SDLPango_Context *context,
const char *text,
int length,
SDLPango_Alignment alignment);
extern DECLSPEC void SDLCALL SDLPango_SetText(
SDLPango_Context *context,
const char *markup,
int length);
extern DECLSPEC void SDLCALL SDLPango_SetLanguage(
SDLPango_Context *context,
const char *language_tag);
extern DECLSPEC void SDLCALL SDLPango_SetBaseDirection(
SDLPango_Context *context,
SDLPango_Direction direction);
#ifdef __FT2_BUILD_UNIX_H__
extern DECLSPEC void SDLCALL SDLPango_CopyFTBitmapToSurface(
const FT_Bitmap *bitmap,
SDL_Surface *surface,
const SDLPango_Matrix *matrix,
SDL_Rect *rect);
#endif /* __FT2_BUILD_UNIX_H__ */
#ifdef __PANGO_H__
extern DECLSPEC PangoFontMap* SDLCALL SDLPango_GetPangoFontMap(
SDLPango_Context *context);
extern DECLSPEC PangoFontDescription* SDLCALL SDLPango_GetPangoFontDescription(
SDLPango_Context *context);
extern DECLSPEC PangoLayout* SDLCALL SDLPango_GetPangoLayout(
SDLPango_Context *context);
#endif /* __PANGO_H__ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* SDL_PANGO_H */