wok-current annotate libsdl-pango/stuff/SDL_Pango-0.1.2-API-adds.patch @ rev 21582

Use python-setuptools as bdeps (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun May 19 19:45:04 2019 +0200 (2019-05-19)
parents
children
rev   line source
slaxemulator@7409 1 --- src/SDL_Pango.c 2004-12-10 10:06:33.000000000 +0100
slaxemulator@7409 2 +++ src/SDL_Pango.c 2006-09-24 22:46:24.000000000 +0200
slaxemulator@7409 3 @@ -723,13 +723,8 @@
slaxemulator@7409 4 SDL_UnlockSurface(surface);
slaxemulator@7409 5 }
slaxemulator@7409 6
slaxemulator@7409 7 -/*!
slaxemulator@7409 8 - Create a context which contains Pango objects.
slaxemulator@7409 9 -
slaxemulator@7409 10 - @return A pointer to the context as a SDLPango_Context*.
slaxemulator@7409 11 -*/
slaxemulator@7409 12 SDLPango_Context*
slaxemulator@7409 13 -SDLPango_CreateContext()
slaxemulator@7409 14 +SDLPango_CreateContext_GivenFontDesc(const char* font_desc)
slaxemulator@7409 15 {
slaxemulator@7409 16 SDLPango_Context *context = g_malloc(sizeof(SDLPango_Context));
slaxemulator@7409 17 G_CONST_RETURN char *charset;
slaxemulator@7409 18 @@ -743,8 +738,7 @@
slaxemulator@7409 19 pango_context_set_language (context->context, pango_language_from_string (charset));
slaxemulator@7409 20 pango_context_set_base_dir (context->context, PANGO_DIRECTION_LTR);
slaxemulator@7409 21
slaxemulator@7409 22 - context->font_desc = pango_font_description_from_string(
slaxemulator@7409 23 - MAKE_FONT_NAME (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE));
slaxemulator@7409 24 + context->font_desc = pango_font_description_from_string(font_desc);
slaxemulator@7409 25
slaxemulator@7409 26 context->layout = pango_layout_new (context->context);
slaxemulator@7409 27
slaxemulator@7409 28 @@ -762,6 +756,17 @@
slaxemulator@7409 29 }
slaxemulator@7409 30
slaxemulator@7409 31 /*!
slaxemulator@7409 32 + Create a context which contains Pango objects.
slaxemulator@7409 33 +
slaxemulator@7409 34 + @return A pointer to the context as a SDLPango_Context*.
slaxemulator@7409 35 +*/
slaxemulator@7409 36 +SDLPango_Context*
slaxemulator@7409 37 +SDLPango_CreateContext()
slaxemulator@7409 38 +{
slaxemulator@7409 39 + SDLPango_CreateContext_GivenFontDesc(MAKE_FONT_NAME(DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE));
slaxemulator@7409 40 +}
slaxemulator@7409 41 +
slaxemulator@7409 42 +/*!
slaxemulator@7409 43 Free a context.
slaxemulator@7409 44
slaxemulator@7409 45 @param *context [i/o] Context to be free
slaxemulator@7409 46 @@ -1053,6 +1058,20 @@
slaxemulator@7409 47 pango_layout_set_font_description (context->layout, context->font_desc);
slaxemulator@7409 48 }
slaxemulator@7409 49
slaxemulator@7409 50 +void
slaxemulator@7409 51 +SDLPango_SetText_GivenAlignment(
slaxemulator@7409 52 + SDLPango_Context *context,
slaxemulator@7409 53 + const char *text,
slaxemulator@7409 54 + int length,
slaxemulator@7409 55 + SDLPango_Alignment alignment)
slaxemulator@7409 56 +{
slaxemulator@7409 57 + pango_layout_set_attributes(context->layout, NULL);
slaxemulator@7409 58 + pango_layout_set_text (context->layout, text, length);
slaxemulator@7409 59 + pango_layout_set_auto_dir (context->layout, TRUE);
slaxemulator@7409 60 + pango_layout_set_alignment (context->layout, alignment);
slaxemulator@7409 61 + pango_layout_set_font_description (context->layout, context->font_desc);
slaxemulator@7409 62 +}
slaxemulator@7409 63 +
slaxemulator@7409 64 /*!
slaxemulator@7409 65 Set plain text to context.
slaxemulator@7409 66 Text must be utf-8.
slaxemulator@7409 67 @@ -1067,11 +1086,7 @@
slaxemulator@7409 68 const char *text,
slaxemulator@7409 69 int length)
slaxemulator@7409 70 {
slaxemulator@7409 71 - pango_layout_set_attributes(context->layout, NULL);
slaxemulator@7409 72 - pango_layout_set_text (context->layout, text, length);
slaxemulator@7409 73 - pango_layout_set_auto_dir (context->layout, TRUE);
slaxemulator@7409 74 - pango_layout_set_alignment (context->layout, PANGO_ALIGN_LEFT);
slaxemulator@7409 75 - pango_layout_set_font_description (context->layout, context->font_desc);
slaxemulator@7409 76 + SDLPango_SetText_GivenAlignment(context, text, length, SDLPANGO_ALIGN_LEFT);
slaxemulator@7409 77 }
slaxemulator@7409 78
slaxemulator@7409 79 /*!
slaxemulator@7409 80 --- src/SDL_Pango.h 2004-12-10 10:06:33.000000000 +0100
slaxemulator@7409 81 +++ src/SDL_Pango.h 2006-09-24 22:46:01.000000000 +0200
slaxemulator@7409 82 @@ -109,12 +109,20 @@
slaxemulator@7409 83 SDLPANGO_DIRECTION_NEUTRAL /*! Neutral */
slaxemulator@7409 84 } SDLPango_Direction;
slaxemulator@7409 85
slaxemulator@7409 86 -
slaxemulator@7409 87 +/*!
slaxemulator@7409 88 + Specifies alignment of text. See Pango reference for detail
slaxemulator@7409 89 +*/
slaxemulator@7409 90 +typedef enum {
slaxemulator@7409 91 + SDLPANGO_ALIGN_LEFT,
slaxemulator@7409 92 + SDLPANGO_ALIGN_CENTER,
slaxemulator@7409 93 + SDLPANGO_ALIGN_RIGHT
slaxemulator@7409 94 +} SDLPango_Alignment;
slaxemulator@7409 95
slaxemulator@7409 96 extern DECLSPEC int SDLCALL SDLPango_Init();
slaxemulator@7409 97
slaxemulator@7409 98 extern DECLSPEC int SDLCALL SDLPango_WasInit();
slaxemulator@7409 99
slaxemulator@7409 100 +extern DECLSPEC SDLPango_Context* SDLCALL SDLPango_CreateContext_GivenFontDesc(const char* font_desc);
slaxemulator@7409 101 extern DECLSPEC SDLPango_Context* SDLCALL SDLPango_CreateContext();
slaxemulator@7409 102
slaxemulator@7409 103 extern DECLSPEC void SDLCALL SDLPango_FreeContext(
slaxemulator@7409 104 @@ -157,6 +165,12 @@
slaxemulator@7409 105 const char *markup,
slaxemulator@7409 106 int length);
slaxemulator@7409 107
slaxemulator@7409 108 +extern DECLSPEC void SDLCALL SDLPango_SetText_GivenAlignment(
slaxemulator@7409 109 + SDLPango_Context *context,
slaxemulator@7409 110 + const char *text,
slaxemulator@7409 111 + int length,
slaxemulator@7409 112 + SDLPango_Alignment alignment);
slaxemulator@7409 113 +
slaxemulator@7409 114 extern DECLSPEC void SDLCALL SDLPango_SetText(
slaxemulator@7409 115 SDLPango_Context *context,
slaxemulator@7409 116 const char *markup,