wok diff libsdl-pango/stuff/SDL_Pango-0.1.2-API-adds.patch @ rev 17945

squashfs: typo
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Apr 15 17:06:17 2015 +0200 (2015-04-15)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libsdl-pango/stuff/SDL_Pango-0.1.2-API-adds.patch	Wed Apr 15 17:06:17 2015 +0200
     1.3 @@ -0,0 +1,116 @@
     1.4 +--- src/SDL_Pango.c	2004-12-10 10:06:33.000000000 +0100
     1.5 ++++ src/SDL_Pango.c	2006-09-24 22:46:24.000000000 +0200
     1.6 +@@ -723,13 +723,8 @@
     1.7 +     SDL_UnlockSurface(surface);
     1.8 + }
     1.9 + 
    1.10 +-/*!
    1.11 +-    Create a context which contains Pango objects.
    1.12 +-
    1.13 +-    @return A pointer to the context as a SDLPango_Context*.
    1.14 +-*/
    1.15 + SDLPango_Context*
    1.16 +-SDLPango_CreateContext()
    1.17 ++SDLPango_CreateContext_GivenFontDesc(const char* font_desc)
    1.18 + {
    1.19 +     SDLPango_Context *context = g_malloc(sizeof(SDLPango_Context));
    1.20 +     G_CONST_RETURN char *charset;
    1.21 +@@ -743,8 +738,7 @@
    1.22 +     pango_context_set_language (context->context, pango_language_from_string (charset));
    1.23 +     pango_context_set_base_dir (context->context, PANGO_DIRECTION_LTR);
    1.24 + 
    1.25 +-    context->font_desc = pango_font_description_from_string(
    1.26 +-	MAKE_FONT_NAME (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE));
    1.27 ++    context->font_desc = pango_font_description_from_string(font_desc);
    1.28 + 
    1.29 +     context->layout = pango_layout_new (context->context);
    1.30 + 
    1.31 +@@ -762,6 +756,17 @@
    1.32 + }
    1.33 + 
    1.34 + /*!
    1.35 ++    Create a context which contains Pango objects.
    1.36 ++
    1.37 ++    @return A pointer to the context as a SDLPango_Context*.
    1.38 ++*/
    1.39 ++SDLPango_Context*
    1.40 ++SDLPango_CreateContext()
    1.41 ++{
    1.42 ++     SDLPango_CreateContext_GivenFontDesc(MAKE_FONT_NAME(DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE));
    1.43 ++}
    1.44 ++
    1.45 ++/*!
    1.46 +     Free a context.
    1.47 + 
    1.48 +     @param *context [i/o] Context to be free
    1.49 +@@ -1053,6 +1058,20 @@
    1.50 +     pango_layout_set_font_description (context->layout, context->font_desc);
    1.51 + }
    1.52 + 
    1.53 ++void
    1.54 ++SDLPango_SetText_GivenAlignment(
    1.55 ++    SDLPango_Context *context,
    1.56 ++    const char *text,
    1.57 ++    int length,
    1.58 ++    SDLPango_Alignment alignment)
    1.59 ++{
    1.60 ++    pango_layout_set_attributes(context->layout, NULL);
    1.61 ++    pango_layout_set_text (context->layout, text, length);
    1.62 ++    pango_layout_set_auto_dir (context->layout, TRUE);
    1.63 ++    pango_layout_set_alignment (context->layout, alignment);
    1.64 ++    pango_layout_set_font_description (context->layout, context->font_desc);
    1.65 ++}
    1.66 ++
    1.67 + /*!
    1.68 +     Set plain text to context.
    1.69 +     Text must be utf-8.
    1.70 +@@ -1067,11 +1086,7 @@
    1.71 +     const char *text,
    1.72 +     int length)
    1.73 + {
    1.74 +-    pango_layout_set_attributes(context->layout, NULL);
    1.75 +-    pango_layout_set_text (context->layout, text, length);
    1.76 +-    pango_layout_set_auto_dir (context->layout, TRUE);
    1.77 +-    pango_layout_set_alignment (context->layout, PANGO_ALIGN_LEFT);
    1.78 +-    pango_layout_set_font_description (context->layout, context->font_desc);
    1.79 ++     SDLPango_SetText_GivenAlignment(context, text, length, SDLPANGO_ALIGN_LEFT);
    1.80 + }
    1.81 + 
    1.82 + /*!
    1.83 +--- src/SDL_Pango.h	2004-12-10 10:06:33.000000000 +0100
    1.84 ++++ src/SDL_Pango.h	2006-09-24 22:46:01.000000000 +0200
    1.85 +@@ -109,12 +109,20 @@
    1.86 +     SDLPANGO_DIRECTION_NEUTRAL	/*! Neutral */
    1.87 + } SDLPango_Direction;
    1.88 + 
    1.89 +-
    1.90 ++/*!
    1.91 ++    Specifies alignment of text. See Pango reference for detail
    1.92 ++*/
    1.93 ++typedef enum {
    1.94 ++    SDLPANGO_ALIGN_LEFT,
    1.95 ++    SDLPANGO_ALIGN_CENTER,
    1.96 ++    SDLPANGO_ALIGN_RIGHT
    1.97 ++} SDLPango_Alignment;
    1.98 + 
    1.99 + extern DECLSPEC int SDLCALL SDLPango_Init();
   1.100 + 
   1.101 + extern DECLSPEC int SDLCALL SDLPango_WasInit();
   1.102 + 
   1.103 ++extern DECLSPEC SDLPango_Context* SDLCALL SDLPango_CreateContext_GivenFontDesc(const char* font_desc);
   1.104 + extern DECLSPEC SDLPango_Context* SDLCALL SDLPango_CreateContext();
   1.105 + 
   1.106 + extern DECLSPEC void SDLCALL SDLPango_FreeContext(
   1.107 +@@ -157,6 +165,12 @@
   1.108 +     const char *markup,
   1.109 +     int length);
   1.110 + 
   1.111 ++extern DECLSPEC void SDLCALL SDLPango_SetText_GivenAlignment(
   1.112 ++    SDLPango_Context *context,
   1.113 ++    const char *text,
   1.114 ++    int length,
   1.115 ++    SDLPango_Alignment alignment);
   1.116 ++
   1.117 + extern DECLSPEC void SDLCALL SDLPango_SetText(
   1.118 +     SDLPango_Context *context,
   1.119 +     const char *markup,