mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-08 21:00:05 +02:00
sdl_pango, use Debian patches, fixes frozen-bubble (#9402)
This commit is contained in:
128
media-libs/sdl_pango/patches/api_additions.patch
Normal file
128
media-libs/sdl_pango/patches/api_additions.patch
Normal file
@@ -0,0 +1,128 @@
|
||||
Index: SDL_Pango-0.1.2/src/SDL_Pango.c
|
||||
===================================================================
|
||||
--- SDL_Pango-0.1.2.orig/src/SDL_Pango.c 2004-12-10 10:06:33.000000000 +0100
|
||||
+++ SDL_Pango-0.1.2/src/SDL_Pango.c 2007-09-18 14:56:35.362379428 +0200
|
||||
@@ -723,13 +723,9 @@
|
||||
SDL_UnlockSurface(surface);
|
||||
}
|
||||
|
||||
-/*!
|
||||
- Create a context which contains Pango objects.
|
||||
|
||||
- @return A pointer to the context as a SDLPango_Context*.
|
||||
-*/
|
||||
SDLPango_Context*
|
||||
-SDLPango_CreateContext()
|
||||
+SDLPango_CreateContext_GivenFontDesc(const char* font_desc)
|
||||
{
|
||||
SDLPango_Context *context = g_malloc(sizeof(SDLPango_Context));
|
||||
G_CONST_RETURN char *charset;
|
||||
@@ -743,8 +739,7 @@
|
||||
pango_context_set_language (context->context, pango_language_from_string (charset));
|
||||
pango_context_set_base_dir (context->context, PANGO_DIRECTION_LTR);
|
||||
|
||||
- context->font_desc = pango_font_description_from_string(
|
||||
- MAKE_FONT_NAME (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE));
|
||||
+ context->font_desc = pango_font_description_from_string(font_desc);
|
||||
|
||||
context->layout = pango_layout_new (context->context);
|
||||
|
||||
@@ -762,6 +757,17 @@
|
||||
}
|
||||
|
||||
/*!
|
||||
+ Create a context which contains Pango objects.
|
||||
+
|
||||
+ @return A pointer to the context as a SDLPango_Context*.
|
||||
+*/
|
||||
+SDLPango_Context*
|
||||
+SDLPango_CreateContext()
|
||||
+{
|
||||
+ SDLPango_CreateContext_GivenFontDesc(MAKE_FONT_NAME(DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE));
|
||||
+}
|
||||
+
|
||||
+/*!
|
||||
Free a context.
|
||||
|
||||
@param *context [i/o] Context to be free
|
||||
@@ -1053,6 +1059,20 @@
|
||||
pango_layout_set_font_description (context->layout, context->font_desc);
|
||||
}
|
||||
|
||||
+void
|
||||
+SDLPango_SetText_GivenAlignment(
|
||||
+ SDLPango_Context *context,
|
||||
+ const char *text,
|
||||
+ int length,
|
||||
+ SDLPango_Alignment alignment)
|
||||
+{
|
||||
+ pango_layout_set_attributes(context->layout, NULL);
|
||||
+ pango_layout_set_text (context->layout, text, length);
|
||||
+ pango_layout_set_auto_dir (context->layout, TRUE);
|
||||
+ pango_layout_set_alignment (context->layout, alignment);
|
||||
+ pango_layout_set_font_description (context->layout, context->font_desc);
|
||||
+}
|
||||
+
|
||||
/*!
|
||||
Set plain text to context.
|
||||
Text must be utf-8.
|
||||
@@ -1067,11 +1087,7 @@
|
||||
const char *text,
|
||||
int length)
|
||||
{
|
||||
- pango_layout_set_attributes(context->layout, NULL);
|
||||
- pango_layout_set_text (context->layout, text, length);
|
||||
- pango_layout_set_auto_dir (context->layout, TRUE);
|
||||
- pango_layout_set_alignment (context->layout, PANGO_ALIGN_LEFT);
|
||||
- pango_layout_set_font_description (context->layout, context->font_desc);
|
||||
+ SDLPango_SetText_GivenAlignment(context, text, length, SDLPANGO_ALIGN_LEFT);
|
||||
}
|
||||
|
||||
/*!
|
||||
Index: SDL_Pango-0.1.2/src/SDL_Pango.h
|
||||
===================================================================
|
||||
--- SDL_Pango-0.1.2.orig/src/SDL_Pango.h 2004-12-10 10:06:33.000000000 +0100
|
||||
+++ SDL_Pango-0.1.2/src/SDL_Pango.h 2007-09-18 15:00:41.736419485 +0200
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#ifndef SDL_PANGO_H
|
||||
#define SDL_PANGO_H
|
||||
+#define SDL_PANGO_HAS_GC_EXTENSIONS
|
||||
|
||||
#include "SDL.h"
|
||||
|
||||
@@ -109,12 +110,20 @@
|
||||
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(
|
||||
@@ -157,6 +166,12 @@
|
||||
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,
|
||||
131
media-libs/sdl_pango/patches/matrix_declarations.patch
Normal file
131
media-libs/sdl_pango/patches/matrix_declarations.patch
Normal file
@@ -0,0 +1,131 @@
|
||||
Index: SDL_Pango-0.1.2/src/SDL_Pango.c
|
||||
===================================================================
|
||||
--- SDL_Pango-0.1.2.orig/src/SDL_Pango.c 2007-09-18 15:03:10.732910311 +0200
|
||||
+++ SDL_Pango-0.1.2/src/SDL_Pango.c 2007-09-18 15:04:41.970109622 +0200
|
||||
@@ -286,6 +286,59 @@
|
||||
} contextImpl;
|
||||
|
||||
|
||||
+const SDLPango_Matrix _MATRIX_WHITE_BACK
|
||||
+ = {255, 0, 0, 0,
|
||||
+ 255, 0, 0, 0,
|
||||
+ 255, 0, 0, 0,
|
||||
+ 255, 255, 0, 0,};
|
||||
+
|
||||
+/*!
|
||||
+ Specifies white back and black letter.
|
||||
+*/
|
||||
+const SDLPango_Matrix *MATRIX_WHITE_BACK = &_MATRIX_WHITE_BACK;
|
||||
+
|
||||
+const SDLPango_Matrix _MATRIX_BLACK_BACK
|
||||
+ = {0, 255, 0, 0,
|
||||
+ 0, 255, 0, 0,
|
||||
+ 0, 255, 0, 0,
|
||||
+ 255, 255, 0, 0,};
|
||||
+/*!
|
||||
+ Specifies black back and white letter.
|
||||
+*/
|
||||
+const SDLPango_Matrix *MATRIX_BLACK_BACK = &_MATRIX_BLACK_BACK;
|
||||
+
|
||||
+const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_BLACK_LETTER
|
||||
+ = {0, 0, 0, 0,
|
||||
+ 0, 0, 0, 0,
|
||||
+ 0, 0, 0, 0,
|
||||
+ 0, 255, 0, 0,};
|
||||
+/*!
|
||||
+ Specifies transparent back and black letter.
|
||||
+*/
|
||||
+const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_BLACK_LETTER = &_MATRIX_TRANSPARENT_BACK_BLACK_LETTER;
|
||||
+
|
||||
+const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_WHITE_LETTER
|
||||
+ = {255, 255, 0, 0,
|
||||
+ 255, 255, 0, 0,
|
||||
+ 255, 255, 0, 0,
|
||||
+ 0, 255, 0, 0,};
|
||||
+/*!
|
||||
+ Specifies transparent back and white letter.
|
||||
+*/
|
||||
+const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_WHITE_LETTER = &_MATRIX_TRANSPARENT_BACK_WHITE_LETTER;
|
||||
+
|
||||
+const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER
|
||||
+ = {255, 255, 0, 0,
|
||||
+ 255, 255, 0, 0,
|
||||
+ 255, 255, 0, 0,
|
||||
+ 0, 0, 0, 0,};
|
||||
+/*!
|
||||
+ Specifies transparent back and transparent letter.
|
||||
+ This is useful for KARAOKE like rendering.
|
||||
+*/
|
||||
+const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER = &_MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER;
|
||||
+
|
||||
+
|
||||
/*!
|
||||
Initialize the Glib and Pango API.
|
||||
This must be called before using other functions in this library,
|
||||
Index: SDL_Pango-0.1.2/src/SDL_Pango.h
|
||||
===================================================================
|
||||
--- SDL_Pango-0.1.2.orig/src/SDL_Pango.h 2007-09-18 15:03:10.732910311 +0200
|
||||
+++ SDL_Pango-0.1.2/src/SDL_Pango.h 2007-09-18 15:06:24.919976401 +0200
|
||||
@@ -47,57 +47,27 @@
|
||||
Uint8 m[4][4]; /*! Matrix variables */
|
||||
} SDLPango_Matrix;
|
||||
|
||||
-const SDLPango_Matrix _MATRIX_WHITE_BACK
|
||||
- = {255, 0, 0, 0,
|
||||
- 255, 0, 0, 0,
|
||||
- 255, 0, 0, 0,
|
||||
- 255, 255, 0, 0,};
|
||||
-
|
||||
/*!
|
||||
Specifies white back and black letter.
|
||||
*/
|
||||
-const SDLPango_Matrix *MATRIX_WHITE_BACK = &_MATRIX_WHITE_BACK;
|
||||
-
|
||||
-const SDLPango_Matrix _MATRIX_BLACK_BACK
|
||||
- = {0, 255, 0, 0,
|
||||
- 0, 255, 0, 0,
|
||||
- 0, 255, 0, 0,
|
||||
- 255, 255, 0, 0,};
|
||||
+extern const SDLPango_Matrix *MATRIX_WHITE_BACK;
|
||||
/*!
|
||||
Specifies black back and white letter.
|
||||
*/
|
||||
-const SDLPango_Matrix *MATRIX_BLACK_BACK = &_MATRIX_BLACK_BACK;
|
||||
-
|
||||
-const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_BLACK_LETTER
|
||||
- = {0, 0, 0, 0,
|
||||
- 0, 0, 0, 0,
|
||||
- 0, 0, 0, 0,
|
||||
- 0, 255, 0, 0,};
|
||||
+extern const SDLPango_Matrix *MATRIX_BLACK_BACK;
|
||||
/*!
|
||||
Specifies transparent back and black letter.
|
||||
*/
|
||||
-const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_BLACK_LETTER = &_MATRIX_TRANSPARENT_BACK_BLACK_LETTER;
|
||||
-
|
||||
-const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_WHITE_LETTER
|
||||
- = {255, 255, 0, 0,
|
||||
- 255, 255, 0, 0,
|
||||
- 255, 255, 0, 0,
|
||||
- 0, 255, 0, 0,};
|
||||
+extern const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_BLACK_LETTER;
|
||||
/*!
|
||||
Specifies transparent back and white letter.
|
||||
*/
|
||||
-const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_WHITE_LETTER = &_MATRIX_TRANSPARENT_BACK_WHITE_LETTER;
|
||||
-
|
||||
-const SDLPango_Matrix _MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER
|
||||
- = {255, 255, 0, 0,
|
||||
- 255, 255, 0, 0,
|
||||
- 255, 255, 0, 0,
|
||||
- 0, 0, 0, 0,};
|
||||
+extern const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_WHITE_LETTER;
|
||||
/*!
|
||||
Specifies transparent back and transparent letter.
|
||||
This is useful for KARAOKE like rendering.
|
||||
*/
|
||||
-const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER = &_MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER;
|
||||
+extern const SDLPango_Matrix *MATRIX_TRANSPARENT_BACK_TRANSPARENT_LETTER;
|
||||
|
||||
/*!
|
||||
Specifies direction of text. See Pango reference for detail
|
||||
@@ -1,105 +0,0 @@
|
||||
From 5296b04fac8a8a447685d9c7a2287b38045e6811 Mon Sep 17 00:00:00 2001
|
||||
From: begasus <begasus@gmail.com>
|
||||
Date: Sun, 1 Jan 2017 00:36:49 +0100
|
||||
Subject: Patch taken from http://zarb.org/~gc/t/SDL_Pango-0.1.2-API-adds.patch
|
||||
|
||||
|
||||
diff --git a/src/SDL_Pango.c b/src/SDL_Pango.c
|
||||
index 2118cd2..97d0347 100644
|
||||
--- a/src/SDL_Pango.c
|
||||
+++ b/src/SDL_Pango.c
|
||||
@@ -729,7 +729,7 @@ SDLPango_CopyFTBitmapToSurface(
|
||||
@return A pointer to the context as a SDLPango_Context*.
|
||||
*/
|
||||
SDLPango_Context*
|
||||
-SDLPango_CreateContext()
|
||||
+SDLPango_CreateContext_GivenFontDesc(const char* font_desc)
|
||||
{
|
||||
SDLPango_Context *context = g_malloc(sizeof(SDLPango_Context));
|
||||
G_CONST_RETURN char *charset;
|
||||
@@ -744,7 +744,7 @@ SDLPango_CreateContext()
|
||||
pango_context_set_base_dir (context->context, PANGO_DIRECTION_LTR);
|
||||
|
||||
context->font_desc = pango_font_description_from_string(
|
||||
- MAKE_FONT_NAME (DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE));
|
||||
+ context->font_desc = pango_font_description_from_string(font_desc));
|
||||
|
||||
context->layout = pango_layout_new (context->context);
|
||||
|
||||
@@ -762,6 +762,17 @@ SDLPango_CreateContext()
|
||||
}
|
||||
|
||||
/*!
|
||||
+ Create a context which contains Pango objects.
|
||||
+
|
||||
+ @return A pointer to the context as a SDLPango_Context*.
|
||||
+*/
|
||||
+SDLPango_Context*
|
||||
+SDLPango_CreateContext()
|
||||
+{
|
||||
+ SDLPango_CreateContext_GivenFontDesc(MAKE_FONT_NAME(DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE));
|
||||
+}
|
||||
+
|
||||
+/*!
|
||||
Free a context.
|
||||
|
||||
@param *context [i/o] Context to be free
|
||||
@@ -1053,6 +1064,16 @@ SDLPango_SetMarkup(
|
||||
pango_layout_set_font_description (context->layout, context->font_desc);
|
||||
}
|
||||
|
||||
+void
|
||||
+SDLPango_SetText_GivenAlignment(
|
||||
+ SDLPango_Context *context,
|
||||
+ const char *text,
|
||||
+ int length,
|
||||
+ SDLPango_Alignment alignment)
|
||||
+{
|
||||
+ SDLPango_SetText_GivenAlignment(context, text, length, SDLPANGO_ALIGN_LEFT);
|
||||
+}
|
||||
+
|
||||
/*!
|
||||
Set plain text to context.
|
||||
Text must be utf-8.
|
||||
diff --git a/src/SDL_Pango.h b/src/SDL_Pango.h
|
||||
index 2433661..1acd96f 100644
|
||||
--- a/src/SDL_Pango.h
|
||||
+++ b/src/SDL_Pango.h
|
||||
@@ -109,12 +109,20 @@ typedef enum {
|
||||
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(
|
||||
@@ -157,6 +165,12 @@ extern DECLSPEC void SDLCALL SDLPango_SetMarkup(
|
||||
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,
|
||||
--
|
||||
2.7.0
|
||||
|
||||
@@ -4,12 +4,12 @@ render internationalized and tagged text in SDL applications."
|
||||
HOMEPAGE="http://www.libsdl.org/projects/SDL_pango/"
|
||||
COPYRIGHT="2004 NAKAMURA Ken'ichi'"
|
||||
LICENSE="GNU GPL v2"
|
||||
REVISION="5"
|
||||
REVISION="6"
|
||||
SOURCE_URI="https://downloads.sf.net/sdlpango/SDL_Pango-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="7f75d3b97acf707c696ea126424906204ebfa07660162de925173cdd0257eba4"
|
||||
SOURCE_DIR="SDL_Pango-$portVersion"
|
||||
#Patch for Frozen-Bubble, originates from here https://sourceforge.net/p/sdlpango/patches/1/
|
||||
PATCHES="sdl_pango-$portVersion.patchset"
|
||||
PATCHES="api_additions.patch
|
||||
matrix_declarations.patch"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
|
||||
|
||||
Reference in New Issue
Block a user