diff options
author | Eric Williams | 2018-09-17 17:11:43 +0000 |
---|---|---|
committer | Eric Williams | 2018-09-17 17:51:18 +0000 |
commit | 356b3991023cabeea96504c9096ce9b92479eef6 (patch) | |
tree | 4cf43cc0af5c2e4ef794b5a5bbe95b4d67152eeb | |
parent | 64a2735027644bacb7cbea6b8508dde7064c86c5 (diff) | |
download | eclipse.platform.swt-356b3991023cabeea96504c9096ce9b92479eef6.tar.gz eclipse.platform.swt-356b3991023cabeea96504c9096ce9b92479eef6.tar.xz eclipse.platform.swt-356b3991023cabeea96504c9096ce9b92479eef6.zip |
Bug 530841: [GTK2] Remove GTK 2.x support
Remove GTK2 code from Widget. Some refactoring was done which changed
code in other widgets.
Change-Id: I511af6b253e1f0cca3f59b2eede3959a8bab9cae
Signed-off-by: Eric Williams <ericwill@redhat.com>
13 files changed, 42 insertions, 280 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 da259bfce9..8e3cbd6d2e 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 @@ -1591,44 +1591,6 @@ fail: } #endif -#ifndef NO__1gdk_1pointer_1grab -JNIEXPORT jint JNICALL GDK_NATIVE(_1gdk_1pointer_1grab) - (JNIEnv *env, jclass that, jintLong arg0, jboolean arg1, jint arg2, jintLong arg3, jintLong arg4, jint arg5) -{ - jint rc = 0; - GDK_NATIVE_ENTER(env, that, _1gdk_1pointer_1grab_FUNC); -/* - rc = (jint)gdk_pointer_grab((GdkWindow *)arg0, (gboolean)arg1, (GdkEventMask)arg2, (GdkWindow *)arg3, (GdkCursor *)arg4, (guint32)arg5); -*/ - { - GDK_LOAD_FUNCTION(fp, gdk_pointer_grab) - if (fp) { - rc = (jint)((jint (CALLING_CONVENTION*)(GdkWindow *, gboolean, GdkEventMask, GdkWindow *, GdkCursor *, guint32))fp)((GdkWindow *)arg0, (gboolean)arg1, (GdkEventMask)arg2, (GdkWindow *)arg3, (GdkCursor *)arg4, (guint32)arg5); - } - } - GDK_NATIVE_EXIT(env, that, _1gdk_1pointer_1grab_FUNC); - return rc; -} -#endif - -#ifndef NO__1gdk_1pointer_1ungrab -JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1pointer_1ungrab) - (JNIEnv *env, jclass that, jint arg0) -{ - GDK_NATIVE_ENTER(env, that, _1gdk_1pointer_1ungrab_FUNC); -/* - gdk_pointer_ungrab((guint32)arg0); -*/ - { - GDK_LOAD_FUNCTION(fp, gdk_pointer_ungrab) - if (fp) { - ((void (CALLING_CONVENTION*)(guint32))fp)((guint32)arg0); - } - } - GDK_NATIVE_EXIT(env, that, _1gdk_1pointer_1ungrab_FUNC); -} -#endif - #ifndef NO__1gdk_1property_1get JNIEXPORT jboolean JNICALL GDK_NATIVE(_1gdk_1property_1get) (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLong arg3, jintLong arg4, jint arg5, jintLongArray arg6, jintArray arg7, jintArray arg8, jintLongArray arg9) @@ -2555,36 +2517,6 @@ JNIEXPORT jintLong JNICALL GDK_NATIVE(_1gdk_1window_1get_1parent) } #endif -#ifndef NO__1gdk_1window_1get_1pointer -JNIEXPORT jintLong JNICALL GDK_NATIVE(_1gdk_1window_1get_1pointer) - (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1, jintArray arg2, jintArray arg3) -{ - jint *lparg1=NULL; - jint *lparg2=NULL; - jint *lparg3=NULL; - jintLong rc = 0; - GDK_NATIVE_ENTER(env, that, _1gdk_1window_1get_1pointer_FUNC); - if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; - if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail; - if (arg3) if ((lparg3 = (*env)->GetIntArrayElements(env, arg3, NULL)) == NULL) goto fail; -/* - rc = (jintLong)gdk_window_get_pointer((GdkWindow *)arg0, (gint *)lparg1, (gint *)lparg2, (GdkModifierType *)lparg3); -*/ - { - GDK_LOAD_FUNCTION(fp, gdk_window_get_pointer) - if (fp) { - rc = (jintLong)((jintLong (CALLING_CONVENTION*)(GdkWindow *, gint *, gint *, GdkModifierType *))fp)((GdkWindow *)arg0, (gint *)lparg1, (gint *)lparg2, (GdkModifierType *)lparg3); - } - } -fail: - if (arg3 && lparg3) (*env)->ReleaseIntArrayElements(env, arg3, lparg3, 0); - if (arg2 && lparg2) (*env)->ReleaseIntArrayElements(env, arg2, lparg2, 0); - if (arg1 && lparg1) (*env)->ReleaseIntArrayElements(env, arg1, lparg1, 0); - GDK_NATIVE_EXIT(env, that, _1gdk_1window_1get_1pointer_FUNC); - return rc; -} -#endif - #ifndef NO__1gdk_1window_1get_1position JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1window_1get_1position) (JNIEnv *env, jclass that, jintLong arg0, jintArray arg1, jintArray arg2) @@ -3647,26 +3579,6 @@ JNIEXPORT jintLong JNICALL GTK_NATIVE(_1GTK_1TYPE_1WINDOW) } #endif -#ifndef NO__1GTK_1WIDGET_1SET_1FLAGS -JNIEXPORT void JNICALL GTK_NATIVE(_1GTK_1WIDGET_1SET_1FLAGS) - (JNIEnv *env, jclass that, jintLong arg0, jint arg1) -{ - GTK_NATIVE_ENTER(env, that, _1GTK_1WIDGET_1SET_1FLAGS_FUNC); - GTK_WIDGET_SET_FLAGS(arg0, arg1); - GTK_NATIVE_EXIT(env, that, _1GTK_1WIDGET_1SET_1FLAGS_FUNC); -} -#endif - -#ifndef NO__1GTK_1WIDGET_1UNSET_1FLAGS -JNIEXPORT void JNICALL GTK_NATIVE(_1GTK_1WIDGET_1UNSET_1FLAGS) - (JNIEnv *env, jclass that, jintLong arg0, jint arg1) -{ - GTK_NATIVE_ENTER(env, that, _1GTK_1WIDGET_1UNSET_1FLAGS_FUNC); - GTK_WIDGET_UNSET_FLAGS(arg0, arg1); - GTK_NATIVE_EXIT(env, that, _1GTK_1WIDGET_1UNSET_1FLAGS_FUNC); -} -#endif - #ifndef NO__1gtk_1accel_1group_1new JNIEXPORT jintLong JNICALL GTK_NATIVE(_1gtk_1accel_1group_1new) (JNIEnv *env, jclass that) @@ -12417,24 +12329,6 @@ JNIEXPORT jboolean JNICALL GTK_NATIVE(_1gtk_1widget_1mnemonic_1activate) } #endif -#ifndef NO__1gtk_1widget_1modify_1font -JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1widget_1modify_1font) - (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) -{ - GTK_NATIVE_ENTER(env, that, _1gtk_1widget_1modify_1font_FUNC); -/* - gtk_widget_modify_font((GtkWidget *)arg0, (PangoFontDescription *)arg1); -*/ - { - GTK_LOAD_FUNCTION(fp, gtk_widget_modify_font) - if (fp) { - ((void (CALLING_CONVENTION*)(GtkWidget *, PangoFontDescription *))fp)((GtkWidget *)arg0, (PangoFontDescription *)arg1); - } - } - GTK_NATIVE_EXIT(env, that, _1gtk_1widget_1modify_1font_FUNC); -} -#endif - #ifndef NO__1gtk_1widget_1modify_1style JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1widget_1modify_1style) (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) 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 da77778f94..04ba830d12 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 @@ -121,8 +121,6 @@ char * GDK_nativeFunctionNames[] = { "_1gdk_1pixbuf_1save_1to_1bufferv", "_1gdk_1pixbuf_1scale_1simple", "_1gdk_1pixmap_1get_1size", - "_1gdk_1pointer_1grab", - "_1gdk_1pointer_1ungrab", "_1gdk_1property_1get", "_1gdk_1region_1destroy", "_1gdk_1region_1empty", @@ -182,7 +180,6 @@ char * GDK_nativeFunctionNames[] = { "_1gdk_1window_1get_1internal_1paint_1info", "_1gdk_1window_1get_1origin", "_1gdk_1window_1get_1parent", - "_1gdk_1window_1get_1pointer", "_1gdk_1window_1get_1position", "_1gdk_1window_1get_1root_1origin", "_1gdk_1window_1get_1user_1data", @@ -291,8 +288,6 @@ char * GTK_nativeFunctionNames[] = { "_1GTK_1TYPE_1MENU", "_1GTK_1TYPE_1WIDGET", "_1GTK_1TYPE_1WINDOW", - "_1GTK_1WIDGET_1SET_1FLAGS", - "_1GTK_1WIDGET_1UNSET_1FLAGS", "_1gtk_1accel_1group_1new", "_1gtk_1accel_1label_1new", "_1gtk_1accel_1label_1set_1accel", @@ -1015,7 +1010,6 @@ char * GTK_nativeFunctionNames[] = { "_1gtk_1widget_1is_1focus", "_1gtk_1widget_1map", "_1gtk_1widget_1mnemonic_1activate", - "_1gtk_1widget_1modify_1font", "_1gtk_1widget_1modify_1style", "_1gtk_1widget_1override_1background_1color", "_1gtk_1widget_1override_1color", 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 74c5a07a1e..f6bed5f855 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 @@ -131,8 +131,6 @@ typedef enum { _1gdk_1pixbuf_1save_1to_1bufferv_FUNC, _1gdk_1pixbuf_1scale_1simple_FUNC, _1gdk_1pixmap_1get_1size_FUNC, - _1gdk_1pointer_1grab_FUNC, - _1gdk_1pointer_1ungrab_FUNC, _1gdk_1property_1get_FUNC, _1gdk_1region_1destroy_FUNC, _1gdk_1region_1empty_FUNC, @@ -192,7 +190,6 @@ typedef enum { _1gdk_1window_1get_1internal_1paint_1info_FUNC, _1gdk_1window_1get_1origin_FUNC, _1gdk_1window_1get_1parent_FUNC, - _1gdk_1window_1get_1pointer_FUNC, _1gdk_1window_1get_1position_FUNC, _1gdk_1window_1get_1root_1origin_FUNC, _1gdk_1window_1get_1user_1data_FUNC, @@ -289,8 +286,6 @@ typedef enum { _1GTK_1TYPE_1MENU_FUNC, _1GTK_1TYPE_1WIDGET_FUNC, _1GTK_1TYPE_1WINDOW_FUNC, - _1GTK_1WIDGET_1SET_1FLAGS_FUNC, - _1GTK_1WIDGET_1UNSET_1FLAGS_FUNC, _1gtk_1accel_1group_1new_FUNC, _1gtk_1accel_1label_1new_FUNC, _1gtk_1accel_1label_1set_1accel_FUNC, @@ -1013,7 +1008,6 @@ typedef enum { _1gtk_1widget_1is_1focus_FUNC, _1gtk_1widget_1map_FUNC, _1gtk_1widget_1mnemonic_1activate_FUNC, - _1gtk_1widget_1modify_1font_FUNC, _1gtk_1widget_1modify_1style_FUNC, _1gtk_1widget_1override_1background_1color_FUNC, _1gtk_1widget_1override_1color_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java index 801d6e3391..0b7282aa25 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GDK.java @@ -1285,24 +1285,6 @@ public class GDK extends OS { } /** * @method flags=dynamic - * @param window cast=(GdkWindow *) - * @param owner_events cast=(gboolean) - * @param event_mask cast=(GdkEventMask) - * @param confine_to cast=(GdkWindow *) - * @param cursor cast=(GdkCursor *) - * @param time cast=(guint32) - */ - public static final native int _gdk_pointer_grab(long /*int*/ window, boolean owner_events, int event_mask, long /*int*/ confine_to, long /*int*/ cursor, int time); - public static final int gdk_pointer_grab(long /*int*/ window, boolean owner_events, int event_mask, long /*int*/ confine_to, long /*int*/ cursor, int time) { - lock.lock(); - try { - return _gdk_pointer_grab(window, owner_events, event_mask, confine_to, cursor, time); - } finally { - lock.unlock(); - } - } - /** - * @method flags=dynamic * @param device cast=(GdkDevice *) * @param window cast=(GdkWindow *) * @param owner_events cast=(gboolean) @@ -1321,19 +1303,6 @@ public class GDK extends OS { } /** * @method flags=dynamic - * @param time cast=(guint32) - */ - public static final native void _gdk_pointer_ungrab(int time); - public static final void gdk_pointer_ungrab(int time) { - lock.lock(); - try { - _gdk_pointer_ungrab(time); - } finally { - lock.unlock(); - } - } - /** - * @method flags=dynamic * @param device cast=(GdkDevice *) * @param time_ cast=(guint32) */ @@ -2139,22 +2108,6 @@ public class GDK extends OS { } } /** - * @method flags=dynamic - * @param window cast=(GdkWindow *) - * @param x cast=(gint *) - * @param y cast=(gint *) - * @param mask cast=(GdkModifierType *) - */ - public static final native long /*int*/ _gdk_window_get_pointer(long /*int*/ window, int[] x, int[] y, int[] mask); - public static final long /*int*/ gdk_window_get_pointer(long /*int*/ window, int[] x, int[] y, int[] mask) { - lock.lock(); - try { - return _gdk_window_get_pointer(window, x, y, mask); - } finally { - lock.unlock(); - } - } - /** * @param window cast=(GdkWindow *) * @param x cast=(gint *) * @param y cast=(gint *) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java index 64683262b3..604050779e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GTK.java @@ -171,7 +171,6 @@ public class GTK extends OS { public static final int GTK_UNIT_POINTS = 1; public static final int GTK_UNIT_INCH = 2; public static final int GTK_UNIT_MM = 3; - public static final int GTK_VISIBLE = 0x100; public static final int GTK_WINDOW_POPUP = 0x1; public static final int GTK_WINDOW_TOPLEVEL = 0x0; public static final int GTK_WRAP_NONE = 0; @@ -446,24 +445,6 @@ public class GTK extends OS { lock.unlock(); } } - public static final native void _GTK_WIDGET_SET_FLAGS(long /*int*/ wid, int flag); - public static final void GTK_WIDGET_SET_FLAGS(long /*int*/ wid, int flag) { - lock.lock(); - try { - _GTK_WIDGET_SET_FLAGS(wid, flag); - } finally { - lock.unlock(); - } - } - public static final native void _GTK_WIDGET_UNSET_FLAGS(long /*int*/ wid, int flag); - public static final void GTK_WIDGET_UNSET_FLAGS(long /*int*/ wid, int flag) { - lock.lock(); - try { - _GTK_WIDGET_UNSET_FLAGS(wid, flag); - } finally { - lock.unlock(); - } - } // See os_custom.h // Dynamically get's the function pointer to gtk_false(). Gtk2/Gtk3. @@ -8312,21 +8293,6 @@ public class GTK extends OS { /** * @method flags=dynamic * @param widget cast=(GtkWidget *) - * @param pango_font_descr cast=(PangoFontDescription *) - */ - public static final native void _gtk_widget_modify_font(long /*int*/ widget, long /*int*/ pango_font_descr); - /** [GTK2/GTK3; 3.0 deprecated] */ - public static final void gtk_widget_modify_font(long /*int*/ widget, long /*int*/ pango_font_descr) { - lock.lock(); - try { - _gtk_widget_modify_font(widget, pango_font_descr); - } finally { - lock.unlock(); - } - } - /** - * @method flags=dynamic - * @param widget cast=(GtkWidget *) * @param style cast=(GtkRcStyle *) */ public static final native void _gtk_widget_modify_style(long /*int*/ widget, long /*int*/ style); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java index 577ca95379..fddf28e744 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Button.java @@ -1001,9 +1001,9 @@ public void setImage (Image image) { imageList = new ImageList (); int imageIndex = imageList.add (image); long /*int*/ pixbuf = imageList.getPixbuf (imageIndex); - gtk_image_set_from_pixbuf(imageHandle, pixbuf); + gtk_image_set_from_gicon(imageHandle, pixbuf); } else { - gtk_image_set_from_pixbuf (imageHandle, 0); + gtk_image_set_from_gicon (imageHandle, 0); } this.image = image; updateWidgetsVisibility(); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java index bf96a0ba1f..30ec322b77 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java @@ -616,11 +616,11 @@ public void setImage (Image image) { imageList = new ImageList (); int imageIndex = imageList.add (image); long /*int*/ pixbuf = imageList.getPixbuf (imageIndex); - gtk_image_set_from_pixbuf (imageHandle, pixbuf); + gtk_image_set_from_gicon (imageHandle, pixbuf); if (text.length () == 0) GTK.gtk_widget_hide (labelHandle); GTK.gtk_widget_show (imageHandle); } else { - gtk_image_set_from_pixbuf (imageHandle, 0); + gtk_image_set_from_gicon (imageHandle, 0); GTK.gtk_widget_show (labelHandle); GTK.gtk_widget_hide (imageHandle); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java index 3aaf952a25..a65d5b1136 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Label.java @@ -629,11 +629,11 @@ public void setImage (Image image) { imageList = new ImageList (); int imageIndex = imageList.add (image); long /*int*/ pixbuf = imageList.getPixbuf (imageIndex); - gtk_image_set_from_pixbuf (imageHandle, pixbuf); + gtk_image_set_from_gicon (imageHandle, pixbuf); GTK.gtk_widget_hide (labelHandle); GTK.gtk_widget_show (imageHandle); } else { - gtk_image_set_from_pixbuf (imageHandle, 0); + gtk_image_set_from_gicon (imageHandle, 0); GTK.gtk_widget_show (labelHandle); GTK.gtk_widget_hide (imageHandle); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java index 73071be582..95d544ecc7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TabItem.java @@ -372,10 +372,10 @@ public void setImage (Image image) { imageList.put (imageIndex, image); } long /*int*/ pixbuf = imageList.getPixbuf (imageIndex); - gtk_image_set_from_pixbuf (imageHandle, pixbuf); + gtk_image_set_from_gicon (imageHandle, pixbuf); GTK.gtk_widget_show (imageHandle); } else { - gtk_image_set_from_pixbuf (imageHandle, 0); + gtk_image_set_from_gicon (imageHandle, 0); GTK.gtk_widget_hide (imageHandle); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java index 4c1c219a55..089e231984 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableColumn.java @@ -600,10 +600,10 @@ public void setImage (Image image) { int imageIndex = headerImageList.indexOf (image); if (imageIndex == -1) imageIndex = headerImageList.add (image); long /*int*/ pixbuf = headerImageList.getPixbuf (imageIndex); - gtk_image_set_from_pixbuf (imageHandle, pixbuf); + gtk_image_set_from_gicon (imageHandle, pixbuf); GTK.gtk_widget_show (imageHandle); } else { - gtk_image_set_from_pixbuf (imageHandle, 0); + gtk_image_set_from_gicon (imageHandle, 0); GTK.gtk_widget_hide (imageHandle); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java index 7c1c42df62..eea60be5a3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java @@ -653,7 +653,7 @@ long /*int*/ gtk_enter_notify_event (long /*int*/ widget, long /*int*/ event) { int index = imageList.indexOf (hotImage); if (index != -1 && imageHandle != 0) { long /*int*/ pixbuf = imageList.getPixbuf (index); - gtk_image_set_from_pixbuf(imageHandle, pixbuf); + gtk_image_set_from_gicon(imageHandle, pixbuf); } } } @@ -701,7 +701,7 @@ long /*int*/ gtk_leave_notify_event (long /*int*/ widget, long /*int*/ event) { int index = imageList.indexOf (image); if (index != -1 && imageHandle != 0) { long /*int*/ pixbuf = imageList.getPixbuf (index); - gtk_image_set_from_pixbuf(imageHandle, pixbuf); + gtk_image_set_from_gicon(imageHandle, pixbuf); } } } @@ -1074,9 +1074,9 @@ public void setImage (Image image) { imageList.put (imageIndex, image); } long /*int*/ pixbuf = imageList.getPixbuf (imageIndex); - gtk_image_set_from_pixbuf(imageHandle, pixbuf); + gtk_image_set_from_gicon(imageHandle, pixbuf); } else { - gtk_image_set_from_pixbuf(imageHandle, 0); + gtk_image_set_from_gicon(imageHandle, 0); } /* * If Text/Image of a tool-item changes, then it is diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java index 4f347f219f..22d4c5a6b8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeColumn.java @@ -576,10 +576,10 @@ public void setImage (Image image) { int imageIndex = headerImageList.indexOf (image); if (imageIndex == -1) imageIndex = headerImageList.add (image); long /*int*/ pixbuf = headerImageList.getPixbuf (imageIndex); - gtk_image_set_from_pixbuf (imageHandle, pixbuf); + gtk_image_set_from_gicon (imageHandle, pixbuf); GTK.gtk_widget_show (imageHandle); } else { - gtk_image_set_from_pixbuf (imageHandle, 0); + gtk_image_set_from_gicon (imageHandle, 0); GTK.gtk_widget_hide (imageHandle); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java index c50e1df371..5f355854ac 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java @@ -1637,13 +1637,9 @@ public void setData (String key, Object value) { } void setFontDescription (long /*int*/ widget, long /*int*/ font) { - if (GTK.GTK3) { - GTK.gtk_widget_override_font (widget, font); - long /*int*/ context = GTK.gtk_widget_get_style_context (widget); - GTK.gtk_style_context_invalidate (context); - } else { - GTK.gtk_widget_modify_font (widget, font); - } + GTK.gtk_widget_override_font (widget, font); + long /*int*/ context = GTK.gtk_widget_get_style_context (widget); + GTK.gtk_style_context_invalidate (context); } boolean setInputState (Event event, int state) { @@ -1765,22 +1761,12 @@ long /*int*/ sizeRequestProc (long /*int*/ handle, long /*int*/ arg0, long /*int } long /*int*/ gtk_widget_get_window (long /*int*/ widget){ - if (GTK.GTK3) { - GTK.gtk_widget_realize(widget); - } + GTK.gtk_widget_realize(widget); return GTK.gtk_widget_get_window (widget); } void gtk_widget_set_visible (long /*int*/ widget, boolean visible) { - if (GTK.GTK3) { - GTK.gtk_widget_set_visible (widget,visible); - } else { - if (visible) { - GTK.GTK_WIDGET_SET_FLAGS (widget, GTK.GTK_VISIBLE); - } else { - GTK.GTK_WIDGET_UNSET_FLAGS (widget, GTK.GTK_VISIBLE); - } - } + GTK.gtk_widget_set_visible (widget, visible); } void gdk_window_get_size (long /*int*/ drawable, int[] width, int[] height) { @@ -1808,29 +1794,21 @@ long /*int*/ gtk_box_new (int orientation, boolean homogeneous, int spacing) { } int gdk_pointer_grab (long /*int*/ window, int grab_ownership, boolean owner_events, int event_mask, long /*int*/ confine_to, long /*int*/ cursor, int time_) { - if (GTK.GTK3) { - long /*int*/ display = 0; - if( window != 0) { - display = GDK.gdk_window_get_display (window); - } else { - window = GDK.gdk_get_default_root_window (); - display = GDK.gdk_window_get_display (window); - } - long /*int*/ pointer = GDK.gdk_get_pointer(display); - return GDK.gdk_device_grab (pointer, window, grab_ownership, owner_events, event_mask, cursor, time_); + long /*int*/ display = 0; + if( window != 0) { + display = GDK.gdk_window_get_display (window); } else { - return GDK.gdk_pointer_grab (window, owner_events, event_mask, confine_to, cursor, time_); + window = GDK.gdk_get_default_root_window (); + display = GDK.gdk_window_get_display (window); } + long /*int*/ pointer = GDK.gdk_get_pointer(display); + return GDK.gdk_device_grab (pointer, window, grab_ownership, owner_events, event_mask, cursor, time_); } void gdk_pointer_ungrab (long /*int*/ window, int time_) { - if (GTK.GTK3) { - long /*int*/ display = GDK.gdk_window_get_display (window); - long /*int*/ pointer = GDK.gdk_get_pointer(display); - GDK.gdk_device_ungrab (pointer, time_); - } else { - GDK.gdk_pointer_ungrab (time_); - } + long /*int*/ display = GDK.gdk_window_get_display (window); + long /*int*/ pointer = GDK.gdk_get_pointer(display); + GDK.gdk_device_ungrab (pointer, time_); } /** @@ -1891,17 +1869,8 @@ long /*int*/ windowProc (long /*int*/ handle, long /*int*/ user_data) { long /*int*/ windowProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ user_data) { switch ((int)/*64*/user_data) { case EXPOSE_EVENT_INVERSE: { - if (GTK.GTK3) { - if (GTK.GTK_VERSION >= OS.VERSION (3, 9, 0) && GTK.GTK_IS_CONTAINER (handle)) { - return gtk_draw (handle, arg0); - } - } else { - GdkEventExpose gdkEvent = new GdkEventExpose (); - OS.memmove (gdkEvent, arg0, GdkEventExpose.sizeof); - long /*int*/ paintWindow = paintWindow (); - long /*int*/ window = gdkEvent.window; - if (window != paintWindow) return 0; - return (state & OBSCURED) != 0 ? 1 : 0; + if (GTK.GTK_VERSION >= OS.VERSION (3, 9, 0) && GTK.GTK_IS_CONTAINER (handle)) { + return gtk_draw (handle, arg0); } return 0; } @@ -1983,19 +1952,15 @@ long /*int*/ windowProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ ar } long /*int*/ gdk_window_get_device_position (long /*int*/ window, int[] x, int[] y, int[] mask) { - if (GTK.GTK3) { - long /*int*/ display = 0; - if( window != 0) { - display = GDK.gdk_window_get_display (window); - } else { - window = GDK.gdk_get_default_root_window (); - display = GDK.gdk_window_get_display (window); - } - long /*int*/ pointer = GDK.gdk_get_pointer(display); - return GDK.gdk_window_get_device_position(window, pointer, x, y, mask); + long /*int*/ display = 0; + if( window != 0) { + display = GDK.gdk_window_get_display (window); } else { - return GDK.gdk_window_get_pointer (window, x, y, mask); + window = GDK.gdk_get_default_root_window (); + display = GDK.gdk_window_get_display (window); } + long /*int*/ pointer = GDK.gdk_get_pointer(display); + return GDK.gdk_window_get_device_position(window, pointer, x, y, mask); } void gtk_cell_renderer_get_preferred_size (long /*int*/ cell, long /*int*/ widget, int[] width, int[] height) { @@ -2009,12 +1974,8 @@ void gtk_widget_get_preferred_size (long /*int*/ widget, GtkRequisition requisit GTK.gtk_widget_get_preferred_size (widget, requisition, null); } -void gtk_image_set_from_pixbuf (long /*int*/ imageHandle, long /*int*/ pixbuf){ - if (GTK.GTK3) { - GTK.gtk_image_set_from_gicon(imageHandle, pixbuf, GTK.GTK_ICON_SIZE_SMALL_TOOLBAR); - } else { - GTK.gtk_image_set_from_pixbuf(imageHandle, pixbuf); - } +void gtk_image_set_from_gicon (long /*int*/ imageHandle, long /*int*/ pixbuf){ + GTK.gtk_image_set_from_gicon(imageHandle, pixbuf, GTK.GTK_ICON_SIZE_SMALL_TOOLBAR); } } |