aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2014-04-01 10:56:17 -0400
committerAlexander Kurtakov2014-04-01 12:15:22 -0400
commit51ec21c2cd3bd59c43f56d6719c402e5ed9e7106 (patch)
tree10aaeeface430a087bfee5aff5d1dc88362a2066
parent127e3ad68e6e8abc21bd53ab9aa77b9f98cd2659 (diff)
downloadeclipse.platform.swt-51ec21c2cd3bd59c43f56d6719c402e5ed9e7106.zip
eclipse.platform.swt-51ec21c2cd3bd59c43f56d6719c402e5ed9e7106.tar.gz
eclipse.platform.swt-51ec21c2cd3bd59c43f56d6719c402e5ed9e7106.tar.xz
Bug 431717 - Creating new FontDialog crashes with GTK 3.10
Init PANGO_TYPE_FONT_FAMILY and PANGO_TYPE_FONT_FACE and their callback functions. Change-Id: Ie40e59eb8adf43f73360dffd102a5b63b340b1a7 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c35
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java24
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java24
6 files changed, 115 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
index d63668c..dfebd0f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
@@ -1661,6 +1661,30 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(_1PANGO_1TYPE_1FONT_1DESCRIPTION)
}
#endif
+#ifndef NO__1PANGO_1TYPE_1FONT_1FACE
+JNIEXPORT jintLong JNICALL OS_NATIVE(_1PANGO_1TYPE_1FONT_1FACE)
+ (JNIEnv *env, jclass that)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, _1PANGO_1TYPE_1FONT_1FACE_FUNC);
+ rc = (jintLong)PANGO_TYPE_FONT_FACE;
+ OS_NATIVE_EXIT(env, that, _1PANGO_1TYPE_1FONT_1FACE_FUNC);
+ return rc;
+}
+#endif
+
+#ifndef NO__1PANGO_1TYPE_1FONT_1FAMILY
+JNIEXPORT jintLong JNICALL OS_NATIVE(_1PANGO_1TYPE_1FONT_1FAMILY)
+ (JNIEnv *env, jclass that)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, _1PANGO_1TYPE_1FONT_1FAMILY_FUNC);
+ rc = (jintLong)PANGO_TYPE_FONT_FAMILY;
+ OS_NATIVE_EXIT(env, that, _1PANGO_1TYPE_1FONT_1FAMILY_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO__1PANGO_1TYPE_1LAYOUT
JNIEXPORT jintLong JNICALL OS_NATIVE(_1PANGO_1TYPE_1LAYOUT)
(JNIEnv *env, jclass that)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c
index cb6c662..5b49b4c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c
@@ -118,6 +118,41 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(pangoLayoutNewProc_1CALLBACK)
return rc;
}
#endif
+#ifndef NO_pangoFontFamilyNewProc_1CALLBACK
+static jintLong superPangoFontFamilyNewProc;
+static PangoFontFamily * pangoFontFamilyNewProc (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
+ PangoFontFamily* fontFamily = ((PangoFontFamily * (*)(GType, guint, GObjectConstructParam *))superPangoFontFamilyNewProc)(type, n_construct_properties, construct_properties);
+ return fontFamily;
+}
+JNIEXPORT jintLong JNICALL OS_NATIVE(pangoFontFamilyNewProc_1CALLBACK)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, pangoFontFamilyNewProc_1CALLBACK_FUNC);
+ superPangoFontFamilyNewProc = arg0;
+ rc = (jintLong)pangoFontFamilyNewProc;
+ OS_NATIVE_EXIT(env, that, pangoFontFamilyNewProc_1CALLBACK_FUNC);
+ return rc;
+}
+#endif
+#ifndef NO_pangoFontFaceNewProc_1CALLBACK
+static jintLong superPangoFontFaceNewProc;
+static PangoFontFace * pangoFontFaceNewProc (GType type, guint n_construct_properties, GObjectConstructParam * construct_properties) {
+ PangoFontFace* fontFace = ((PangoFontFace * (*)(GType, guint, GObjectConstructParam *))superPangoFontFaceNewProc)(type, n_construct_properties, construct_properties);
+ return fontFace;
+}
+JNIEXPORT jintLong JNICALL OS_NATIVE(pangoFontFaceNewProc_1CALLBACK)
+ (JNIEnv *env, jclass that, jintLong arg0)
+{
+ jintLong rc = 0;
+ OS_NATIVE_ENTER(env, that, pangoFontFaceNewProc_1CALLBACK_FUNC);
+ superPangoFontFaceNewProc = arg0;
+ rc = (jintLong)pangoFontFaceNewProc;
+ OS_NATIVE_EXIT(env, that, pangoFontFaceNewProc_1CALLBACK_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO__1gtk_1file_1chooser_1dialog_1new
JNIEXPORT jintLong JNICALL OS_NATIVE(_1gtk_1file_1chooser_1dialog_1new)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
index cc04542..a63de53 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
@@ -163,6 +163,8 @@ char * OS_nativeFunctionNames[] = {
"_1G_1TYPE_1STRING",
"_1PANGO_1PIXELS",
"_1PANGO_1TYPE_1FONT_1DESCRIPTION",
+ "_1PANGO_1TYPE_1FONT_1FACE",
+ "_1PANGO_1TYPE_1FONT_1FAMILY",
"_1PANGO_1TYPE_1LAYOUT",
"_1XCheckIfEvent",
"_1XDefaultRootWindow",
@@ -1816,6 +1818,8 @@ char * OS_nativeFunctionNames[] = {
#else
"memmove__Lorg_eclipse_swt_internal_gtk_XVisibilityEvent_2JJ",
#endif
+ "pangoFontFaceNewProc_1CALLBACK",
+ "pangoFontFamilyNewProc_1CALLBACK",
"pangoLayoutNewProc_1CALLBACK",
"realpath",
"strcmp",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
index 575f510..75b74fa 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
@@ -173,6 +173,8 @@ typedef enum {
_1G_1TYPE_1STRING_FUNC,
_1PANGO_1PIXELS_FUNC,
_1PANGO_1TYPE_1FONT_1DESCRIPTION_FUNC,
+ _1PANGO_1TYPE_1FONT_1FACE_FUNC,
+ _1PANGO_1TYPE_1FONT_1FAMILY_FUNC,
_1PANGO_1TYPE_1LAYOUT_FUNC,
_1XCheckIfEvent_FUNC,
_1XDefaultRootWindow_FUNC,
@@ -1826,6 +1828,8 @@ typedef enum {
#else
memmove__Lorg_eclipse_swt_internal_gtk_XVisibilityEvent_2JJ_FUNC,
#endif
+ pangoFontFaceNewProc_1CALLBACK_FUNC,
+ pangoFontFamilyNewProc_1CALLBACK_FUNC,
pangoLayoutNewProc_1CALLBACK_FUNC,
realpath_FUNC,
strcmp_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index a06d04e..2005a4c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -1462,6 +1462,10 @@ public static final long /*int*/ XRenderFindVisualFormat(long /*int*/ display, l
/** @method flags=no_gen */
public static final native long /*int*/ pangoLayoutNewProc_CALLBACK(long /*int*/ func);
/** @method flags=no_gen */
+public static final native long /*int*/ pangoFontFamilyNewProc_CALLBACK(long /*int*/ func);
+/** @method flags=no_gen */
+public static final native long /*int*/ pangoFontFaceNewProc_CALLBACK(long /*int*/ func);
+/** @method flags=no_gen */
public static final native long /*int*/ imContextNewProc_CALLBACK(long /*int*/ func);
/** @method flags=no_gen */
public static final native long /*int*/ imContextLast();
@@ -1878,6 +1882,26 @@ public static final long /*int*/ PANGO_TYPE_FONT_DESCRIPTION() {
}
}
/** @method flags=const */
+public static final native long /*int*/ _PANGO_TYPE_FONT_FAMILY();
+public static final long /*int*/ PANGO_TYPE_FONT_FAMILY() {
+ lock.lock();
+ try {
+ return _PANGO_TYPE_FONT_FAMILY();
+ } finally {
+ lock.unlock();
+ }
+}
+/** @method flags=const */
+public static final native long /*int*/ _PANGO_TYPE_FONT_FACE();
+public static final long /*int*/ PANGO_TYPE_FONT_FACE() {
+ lock.lock();
+ try {
+ return _PANGO_TYPE_FONT_FACE();
+ } finally {
+ lock.unlock();
+ }
+}
+/** @method flags=const */
public static final native long /*int*/ _PANGO_TYPE_LAYOUT();
public static final long /*int*/ PANGO_TYPE_LAYOUT() {
lock.lock();
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index 0f93f53..5b0660a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -290,6 +290,8 @@ public class Display extends Device {
/* Pango layout constructor */
long /*int*/ pangoLayoutNewProc;
+ long /*int*/ pangoFontFamilyNewProc;
+ long /*int*/ pangoFontFaceNewProc;
/* IM Context constructor */
long /*int*/ imContextNewProc;
@@ -2810,6 +2812,18 @@ void initializeSubclasses () {
imContextNewProc = OS.G_OBJECT_CLASS_CONSTRUCTOR (imContextClass);
OS.G_OBJECT_CLASS_SET_CONSTRUCTOR (imContextClass, OS.imContextNewProc_CALLBACK(imContextNewProc));
OS.g_type_class_unref (imContextClass);
+
+ long /*int*/ pangoFontFamilyType = OS.PANGO_TYPE_FONT_FAMILY ();
+ long /*int*/ pangoFontFamilyClass = OS.g_type_class_ref (pangoFontFamilyType);
+ pangoFontFamilyNewProc = OS.G_OBJECT_CLASS_CONSTRUCTOR (pangoFontFamilyClass);
+ OS.G_OBJECT_CLASS_SET_CONSTRUCTOR (pangoFontFamilyClass, OS.pangoFontFamilyNewProc_CALLBACK(pangoFontFamilyNewProc));
+ OS.g_type_class_unref (pangoFontFamilyClass);
+
+ long /*int*/ pangoFontFaceType = OS.PANGO_TYPE_FONT_FACE ();
+ long /*int*/ pangoFontFaceClass = OS.g_type_class_ref (pangoFontFaceType);
+ pangoFontFaceNewProc = OS.G_OBJECT_CLASS_CONSTRUCTOR (pangoFontFaceClass);
+ OS.G_OBJECT_CLASS_SET_CONSTRUCTOR (pangoFontFaceClass, OS.pangoFontFaceNewProc_CALLBACK(pangoFontFaceNewProc));
+ OS.g_type_class_unref (pangoFontFaceClass);
}
}
@@ -3605,6 +3619,16 @@ void releaseDisplay () {
OS.G_OBJECT_CLASS_SET_CONSTRUCTOR (imContextClass, imContextNewProc);
OS.g_type_class_unref (imContextClass);
imContextNewProc = 0;
+ long /*int*/ pangoFontFamilyType = OS.PANGO_TYPE_FONT_FAMILY ();
+ long /*int*/ pangoFontFamilyClass = OS.g_type_class_ref (pangoFontFamilyType);
+ OS.G_OBJECT_CLASS_SET_CONSTRUCTOR (pangoFontFamilyClass, pangoFontFamilyNewProc);
+ OS.g_type_class_unref (pangoFontFamilyClass);
+ pangoFontFamilyNewProc = 0;
+ long /*int*/ pangoFontFaceType = OS.PANGO_TYPE_FONT_FACE ();
+ long /*int*/ pangoFontFaceClass = OS.g_type_class_ref (pangoFontFaceType);
+ OS.G_OBJECT_CLASS_SET_CONSTRUCTOR (pangoFontFaceClass, pangoFontFaceNewProc);
+ OS.g_type_class_unref (pangoFontFaceClass);
+ pangoFontFaceNewProc = 0;
}
/* Release the sleep resources */