summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorAlexander Kurtakov2012-01-24 18:15:11 (EST)
committer Silenio Quarti2012-01-31 17:50:28 (EST)
commit6a6819c42d1e3be98b1484b2432fe381c3569546 (patch)
tree74282a9b7d55d08fbf747551cae3b31292f47a30
parent5db5c1dca04aab70c6da0d8e51099b4a60336357 (diff)
downloadeclipse.platform.swt-6a6819c42d1e3be98b1484b2432fe381c3569546.zip
eclipse.platform.swt-6a6819c42d1e3be98b1484b2432fe381c3569546.tar.gz
eclipse.platform.swt-6a6819c42d1e3be98b1484b2432fe381c3569546.tar.bz2
Make gdk_pango_context_set_colormap dynamic.
This function needs to be called only on GTK versions prior to 2.6. On newer versions the colormap is set automatically.
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java7
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java7
5 files changed, 22 insertions, 2 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 511f2aa..b40a20b 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
@@ -5966,7 +5966,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1pango_1context_1set_1colormap)
(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1)
{
OS_NATIVE_ENTER(env, that, _1gdk_1pango_1context_1set_1colormap_FUNC);
+/*
gdk_pango_context_set_colormap((PangoContext *)arg0, (GdkColormap *)arg1);
+*/
+ {
+ OS_LOAD_FUNCTION(fp, gdk_pango_context_set_colormap)
+ if (fp) {
+ ((void (CALLING_CONVENTION*)(PangoContext *, GdkColormap *))fp)((PangoContext *)arg0, (GdkColormap *)arg1);
+ }
+ }
OS_NATIVE_EXIT(env, that, _1gdk_1pango_1context_1set_1colormap_FUNC);
}
#endif
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
index f52d929..ca24b57 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
@@ -173,6 +173,7 @@
#define gtk_widget_is_composited_LIB LIB_GTK
#define gtk_widget_get_tooltip_text_LIB LIB_GTK
#define gtk_widget_set_tooltip_text_LIB LIB_GTK
+#define gdk_pango_context_set_colormap_LIB LIB_GDK
#define gdk_x11_screen_get_window_manager_name_LIB LIB_GDK
#define gdk_x11_screen_lookup_visual_LIB LIB_GDK
#define gdk_threads_set_lock_functions_LIB LIB_GDK
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 95aba41..bec390a 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
@@ -4538,6 +4538,7 @@ public static final int /*long*/ gdk_pango_context_get() {
}
}
/**
+ * @method flags=dynamic
* @param context cast=(PangoContext *)
* @param colormap cast=(GdkColormap *)
*/
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
index bf75352..23f6ec8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java
@@ -612,7 +612,12 @@ void createLayout() {
data.layout = layout;
OS.pango_context_set_language(context, OS.gtk_get_default_language());
OS.pango_context_set_base_dir(context, (data.style & SWT.MIRRORED) != 0 ? OS.PANGO_DIRECTION_RTL : OS.PANGO_DIRECTION_LTR);
- OS.gdk_pango_context_set_colormap(context, OS.gdk_colormap_get_system());
+ /*
+ * Colormap is automatically set for GTK 2.6.0 and newer.
+ */
+ if (OS.GTK_VERSION < OS.VERSION(2, 6, 0)) {
+ OS.gdk_pango_context_set_colormap(context, OS.gdk_colormap_get_system());
+ }
if (OS.GTK_VERSION >= OS.VERSION(2, 4, 0)) {
OS.pango_layout_set_auto_dir(layout, false);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
index 60fe060..7ce8f7f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/TextLayout.java
@@ -79,7 +79,12 @@ public TextLayout (Device device) {
if (context == 0) SWT.error(SWT.ERROR_NO_HANDLES);
OS.pango_context_set_language(context, OS.gtk_get_default_language());
OS.pango_context_set_base_dir(context, OS.PANGO_DIRECTION_LTR);
- OS.gdk_pango_context_set_colormap(context, OS.gdk_colormap_get_system());
+ /*
+ * Colormap is automatically set for GTK 2.6.0 and newer.
+ */
+ if (OS.GTK_VERSION < OS.VERSION(2, 6, 0)) {
+ OS.gdk_pango_context_set_colormap(context, OS.gdk_colormap_get_system());
+ }
layout = OS.pango_layout_new(context);
if (layout == 0) SWT.error(SWT.ERROR_NO_HANDLES);
OS.pango_layout_set_font_description(layout, device.systemFont.handle);