diff options
14 files changed, 64 insertions, 423 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java index 8995d65d31..54513a122c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java @@ -319,13 +319,7 @@ void drag(Event dragEvent) { context = GTK.gtk_drag_begin(control.handle, targetList, actions, 1, 0); } if (context != 0 && image != null) { - if (GTK.GTK3) { - GTK.gtk_drag_set_icon_surface(context, image.surface); - } else { - long /*int*/ pixbuf = ImageList.createPixbuf(image); - GTK.gtk_drag_set_icon_pixbuf(context, pixbuf, 0, 0); - OS.g_object_unref(pixbuf); - } + GTK.gtk_drag_set_icon_surface(context, image.surface); } } @@ -363,16 +357,11 @@ void dragEnd(long /*int*/ widget, long /*int*/ context){ * NOTE: We believe that it is never an error to ungrab when * a drag is finished. */ - if (GTK.GTK3) { - long /*int*/ display = GDK.gdk_window_get_display(GTK.gtk_widget_get_window(widget)); - long /*int*/ pointer = GDK.gdk_get_pointer(display); - long /*int*/ keyboard = GDK.gdk_device_get_associated_device(pointer); - GDK.gdk_device_ungrab(pointer, GDK.GDK_CURRENT_TIME); - GDK.gdk_device_ungrab(keyboard, GDK.GDK_CURRENT_TIME); - } else { - GDK.gdk_pointer_ungrab(GDK.GDK_CURRENT_TIME); - GDK.gdk_keyboard_ungrab(GDK.GDK_CURRENT_TIME); - } + long /*int*/ display = GDK.gdk_window_get_display(GTK.gtk_widget_get_window(widget)); + long /*int*/ pointer = GDK.gdk_get_pointer(display); + long /*int*/ keyboard = GDK.gdk_device_get_associated_device(pointer); + GDK.gdk_device_ungrab(pointer, GDK.GDK_CURRENT_TIME); + GDK.gdk_device_ungrab(keyboard, GDK.GDK_CURRENT_TIME); int operation = DND.DROP_NONE; if (context != 0) { @@ -384,16 +373,9 @@ void dragEnd(long /*int*/ widget, long /*int*/ context){ * GTKGestures will handle file operations correctly without the * gdk_drag_context_get_dest_window() call. See Bug 503431. */ - if (GTK.GTK3) { - action = GDK.gdk_drag_context_get_selected_action(context); - if (OS.isX11()) { // Wayland - dest_window = GDK.gdk_drag_context_get_dest_window(context); - } - } else { - GdkDragContext gdkDragContext = new GdkDragContext (); - OS.memmove(gdkDragContext, context, GdkDragContext.sizeof); - dest_window = gdkDragContext.dest_window; - action = gdkDragContext.action; + action = GDK.gdk_drag_context_get_selected_action(context); + if (OS.isX11()) { // Wayland + dest_window = GDK.gdk_drag_context_get_dest_window(context); } if (dest_window != 0 || !OS.isX11()) { // Wayland. NOTE: if dest_window is 0, drag was aborted if (moveData) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java index fdb5ebf5b2..816748b5ca 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java @@ -567,13 +567,9 @@ public DropTargetEffect getDropTargetEffect() { int getOperationFromKeyState() { int[] state = new int[1]; - if (GTK.GTK3) { - long /*int*/ root = GDK.gdk_get_default_root_window (); - long /*int*/ pointer = GDK.gdk_get_pointer (GDK.gdk_window_get_display (root)); - GDK.gdk_window_get_device_position(root, pointer, null, null, state); - } else { - GDK.gdk_window_get_pointer(0, null, null, state); - } + long /*int*/ root = GDK.gdk_get_default_root_window (); + long /*int*/ pointer = GDK.gdk_get_pointer (GDK.gdk_window_get_display (root)); + GDK.gdk_window_get_device_position(root, pointer, null, null, state); boolean ctrl = (state[0] & GDK.GDK_CONTROL_MASK) != 0; boolean shift = (state[0] & GDK.GDK_SHIFT_MASK) != 0; if (ctrl && shift) return DND.DROP_LINK; @@ -734,17 +730,8 @@ public void setDropTargetEffect(DropTargetEffect effect) { boolean setEventData(long /*int*/ context, int x, int y, int time, DNDEvent event) { if (context == 0) return false; - long /*int*/ targets = 0; - int actions = 0; - if (GTK.GTK3) { - targets = GDK.gdk_drag_context_list_targets(context); - actions = GDK.gdk_drag_context_get_actions(context); - } else { - GdkDragContext dragContext = new GdkDragContext(); - OS.memmove(dragContext, context, GdkDragContext.sizeof); - targets = dragContext.targets; - actions = dragContext.actions; - } + long /*int*/ targets = GDK.gdk_drag_context_list_targets(context); + int actions = GDK.gdk_drag_context_get_actions(context); if (targets == 0) return false; // get allowed operations diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java index a167fbe98b..5c919d329f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragSourceEffect.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -118,19 +118,15 @@ public class TableDragSourceEffect extends DragSourceEffect { long /*int*/ path = OS.g_list_data (list); GTK.gtk_tree_view_get_cell_area (handle, path, 0, rect); icons[i] = GTK.gtk_tree_view_create_row_drag_icon(handle, path); - if (GTK.GTK3) { - switch (Cairo.cairo_surface_get_type(icons[i])) { - case Cairo.CAIRO_SURFACE_TYPE_IMAGE: - w[0] = Cairo.cairo_image_surface_get_width(icons[i]); - h[0] = Cairo.cairo_image_surface_get_height(icons[i]); - break; - case Cairo.CAIRO_SURFACE_TYPE_XLIB: - w[0] = Cairo.cairo_xlib_surface_get_width(icons[i]); - h[0] = Cairo.cairo_xlib_surface_get_height(icons[i]); - break; - } - } else { - GDK.gdk_pixmap_get_size(icons[i], w, h); + switch (Cairo.cairo_surface_get_type(icons[i])) { + case Cairo.CAIRO_SURFACE_TYPE_IMAGE: + w[0] = Cairo.cairo_image_surface_get_width(icons[i]); + h[0] = Cairo.cairo_image_surface_get_height(icons[i]); + break; + case Cairo.CAIRO_SURFACE_TYPE_XLIB: + w[0] = Cairo.cairo_xlib_surface_get_width(icons[i]); + h[0] = Cairo.cairo_xlib_surface_get_height(icons[i]); + break; } width = Math.max(width, w[0]); height = rect.y + h[0] - yy[0]; @@ -139,30 +135,16 @@ public class TableDragSourceEffect extends DragSourceEffect { list = OS.g_list_next (list); GTK.gtk_tree_path_free (path); } - long /*int*/ surface; - long /*int*/ cairo ; - if (GTK.GTK3) { - surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, width, height); - if (surface == 0) SWT.error(SWT.ERROR_NO_HANDLES); - cairo = Cairo.cairo_create(surface); - } else { - surface = GDK.gdk_pixmap_new(GDK.gdk_get_default_root_window(), width, height, -1); - if (surface == 0) SWT.error(SWT.ERROR_NO_HANDLES); - cairo = GDK.gdk_cairo_create(surface); - } + long /*int*/ surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, width, height); + if (surface == 0) SWT.error(SWT.ERROR_NO_HANDLES); + long /*int*/ cairo = Cairo.cairo_create(surface); if (cairo == 0) SWT.error(SWT.ERROR_NO_HANDLES); Cairo.cairo_set_operator(cairo, Cairo.CAIRO_OPERATOR_SOURCE); for (int i=0; i<count; i++) { - if (GTK.GTK3) { - Cairo.cairo_set_source_surface (cairo, icons[i], 2, yy[i] - yy[0] + 2); - } else { - GDK.gdk_cairo_set_source_pixmap(cairo, icons[i], 0, yy[i] - yy[0]); - } + Cairo.cairo_set_source_surface (cairo, icons[i], 2, yy[i] - yy[0] + 2); Cairo.cairo_rectangle(cairo, 0, yy[i] - yy[0], width, hh[i]); Cairo.cairo_fill(cairo); - if (GTK.GTK3) { - Cairo.cairo_surface_destroy(icons[i]); - } + Cairo.cairo_surface_destroy(icons[i]); } Cairo.cairo_destroy(cairo); dragSourceImage = Image.gtk_new (display, SWT.ICON, surface, 0); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java index e23b1c4bb8..02be6a35a8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragSourceEffect.java @@ -117,19 +117,15 @@ public class TreeDragSourceEffect extends DragSourceEffect { long /*int*/ path = OS.g_list_data (list); GTK.gtk_tree_view_get_cell_area (handle, path, 0, rect); icons[i] = GTK.gtk_tree_view_create_row_drag_icon(handle, path); - if (GTK.GTK3) { - switch (Cairo.cairo_surface_get_type(icons[i])) { - case Cairo.CAIRO_SURFACE_TYPE_IMAGE: - w[0] = Cairo.cairo_image_surface_get_width(icons[i]); - h[0] = Cairo.cairo_image_surface_get_height(icons[i]); - break; - case Cairo.CAIRO_SURFACE_TYPE_XLIB: - w[0] = Cairo.cairo_xlib_surface_get_width(icons[i]); - h[0] = Cairo.cairo_xlib_surface_get_height(icons[i]); - break; - } - } else { - GDK.gdk_pixmap_get_size(icons[i], w, h); + switch (Cairo.cairo_surface_get_type(icons[i])) { + case Cairo.CAIRO_SURFACE_TYPE_IMAGE: + w[0] = Cairo.cairo_image_surface_get_width(icons[i]); + h[0] = Cairo.cairo_image_surface_get_height(icons[i]); + break; + case Cairo.CAIRO_SURFACE_TYPE_XLIB: + w[0] = Cairo.cairo_xlib_surface_get_width(icons[i]); + h[0] = Cairo.cairo_xlib_surface_get_height(icons[i]); + break; } width = Math.max(width, w[0]); height = rect.y + h[0] - yy[0]; @@ -138,30 +134,16 @@ public class TreeDragSourceEffect extends DragSourceEffect { list = OS.g_list_next (list); GTK.gtk_tree_path_free (path); } - long /*int*/ surface; - long /*int*/ cairo ; - if (GTK.GTK3) { - surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, width, height); - if (surface == 0) SWT.error(SWT.ERROR_NO_HANDLES); - cairo = Cairo.cairo_create(surface); - } else { - surface = GDK.gdk_pixmap_new(GDK.gdk_get_default_root_window(), width, height, -1); - if (surface == 0) SWT.error(SWT.ERROR_NO_HANDLES); - cairo = GDK.gdk_cairo_create(surface); - } + long /*int*/ surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, width, height); + if (surface == 0) SWT.error(SWT.ERROR_NO_HANDLES); + long /*int*/ cairo = Cairo.cairo_create(surface); if (cairo == 0) SWT.error(SWT.ERROR_NO_HANDLES); Cairo.cairo_set_operator(cairo, Cairo.CAIRO_OPERATOR_SOURCE); for (int i=0; i<count; i++) { - if (GTK.GTK3) { - Cairo.cairo_set_source_surface (cairo, icons[i], 2, yy[i] - yy[0] + 2); - } else { - GDK.gdk_cairo_set_source_pixmap(cairo, icons[i], 0, yy[i] - yy[0]); - } + Cairo.cairo_set_source_surface (cairo, icons[i], 2, yy[i] - yy[0] + 2); Cairo.cairo_rectangle(cairo, 0, yy[i] - yy[0], width, hh[i]); Cairo.cairo_fill(cairo); - if (GTK.GTK3) { - Cairo.cairo_surface_destroy(icons[i]); - } + Cairo.cairo_surface_destroy(icons[i]); } Cairo.cairo_destroy(cairo); dragSourceImage = Image.gtk_new (display, SWT.ICON, surface, 0); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/internal/dnd/gtk/ListDragSourceEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/internal/dnd/gtk/ListDragSourceEffect.java index 96e105ba37..928f15726d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/internal/dnd/gtk/ListDragSourceEffect.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/internal/dnd/gtk/ListDragSourceEffect.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2017 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -114,19 +114,15 @@ public class ListDragSourceEffect extends DragSourceEffect { long /*int*/ path = OS.g_list_data (list); GTK.gtk_tree_view_get_cell_area (handle, path, 0, rect); icons[i] = GTK.gtk_tree_view_create_row_drag_icon(handle, path); - if (GTK.GTK3) { - switch (Cairo.cairo_surface_get_type(icons[i])) { - case Cairo.CAIRO_SURFACE_TYPE_IMAGE: - w[0] = Cairo.cairo_image_surface_get_width(icons[i]); - h[0] = Cairo.cairo_image_surface_get_height(icons[i]); - break; - case Cairo.CAIRO_SURFACE_TYPE_XLIB: - w[0] = Cairo.cairo_xlib_surface_get_width(icons[i]); - h[0] = Cairo.cairo_xlib_surface_get_height(icons[i]); - break; - } - } else { - GDK.gdk_pixmap_get_size(icons[i], w, h); + switch (Cairo.cairo_surface_get_type(icons[i])) { + case Cairo.CAIRO_SURFACE_TYPE_IMAGE: + w[0] = Cairo.cairo_image_surface_get_width(icons[i]); + h[0] = Cairo.cairo_image_surface_get_height(icons[i]); + break; + case Cairo.CAIRO_SURFACE_TYPE_XLIB: + w[0] = Cairo.cairo_xlib_surface_get_width(icons[i]); + h[0] = Cairo.cairo_xlib_surface_get_height(icons[i]); + break; } width = Math.max(width, w[0]); height = rect.y + h[0] - yy[0]; @@ -135,30 +131,16 @@ public class ListDragSourceEffect extends DragSourceEffect { list = OS.g_list_next (list); GTK.gtk_tree_path_free (path); } - long /*int*/ surface; - long /*int*/ cairo ; - if (GTK.GTK3) { - surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, width, height); - if (surface == 0) SWT.error(SWT.ERROR_NO_HANDLES); - cairo = Cairo.cairo_create(surface); - } else { - surface = GDK.gdk_pixmap_new(GDK.gdk_get_default_root_window(), width, height, -1); - if (surface == 0) SWT.error(SWT.ERROR_NO_HANDLES); - cairo = GDK.gdk_cairo_create(surface); - } + long /*int*/ surface = Cairo.cairo_image_surface_create(Cairo.CAIRO_FORMAT_ARGB32, width, height); + if (surface == 0) SWT.error(SWT.ERROR_NO_HANDLES); + long /*int*/ cairo = Cairo.cairo_create(surface); if (cairo == 0) SWT.error(SWT.ERROR_NO_HANDLES); Cairo.cairo_set_operator(cairo, Cairo.CAIRO_OPERATOR_SOURCE); for (int i=0; i<count; i++) { - if (GTK.GTK3) { - Cairo.cairo_set_source_surface (cairo, icons[i], 2, yy[i] - yy[0] + 2); - } else { - GDK.gdk_cairo_set_source_pixmap(cairo, icons[i], 0, yy[i] - yy[0]); - } + Cairo.cairo_set_source_surface (cairo, icons[i], 2, yy[i] - yy[0] + 2); Cairo.cairo_rectangle(cairo, 0, yy[i] - yy[0], width, hh[i]); Cairo.cairo_fill(cairo); - if (GTK.GTK3) { - Cairo.cairo_surface_destroy(icons[i]); - } + Cairo.cairo_surface_destroy(icons[i]); } Cairo.cairo_destroy(cairo); dragSourceImage = Image.gtk_new (display, SWT.ICON, surface, 0); 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 b1de88cb71..f9af4c9bf5 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 @@ -458,24 +458,6 @@ JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1cairo_1set_1source_1pixbuf) } #endif -#ifndef NO__1gdk_1cairo_1set_1source_1pixmap -JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1cairo_1set_1source_1pixmap) - (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jdouble arg2, jdouble arg3) -{ - GDK_NATIVE_ENTER(env, that, _1gdk_1cairo_1set_1source_1pixmap_FUNC); -/* - gdk_cairo_set_source_pixmap(arg0, arg1, arg2, arg3); -*/ - { - GDK_LOAD_FUNCTION(fp, gdk_cairo_set_source_pixmap) - if (fp) { - ((void (CALLING_CONVENTION*)(jintLong, jintLong, jdouble, jdouble))fp)(arg0, arg1, arg2, arg3); - } - } - GDK_NATIVE_EXIT(env, that, _1gdk_1cairo_1set_1source_1pixmap_FUNC); -} -#endif - #ifndef NO__1gdk_1cairo_1set_1source_1rgba JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1cairo_1set_1source_1rgba) (JNIEnv *env, jclass that, jintLong arg0, jobject arg1) @@ -1431,24 +1413,6 @@ JNIEXPORT jintLong JNICALL GDK_NATIVE(_1gdk_1get_1default_1root_1window) } #endif -#ifndef NO__1gdk_1keyboard_1ungrab -JNIEXPORT void JNICALL GDK_NATIVE(_1gdk_1keyboard_1ungrab) - (JNIEnv *env, jclass that, jint arg0) -{ - GDK_NATIVE_ENTER(env, that, _1gdk_1keyboard_1ungrab_FUNC); -/* - gdk_keyboard_ungrab(arg0); -*/ - { - GDK_LOAD_FUNCTION(fp, gdk_keyboard_ungrab) - if (fp) { - ((void (CALLING_CONVENTION*)(jint))fp)(arg0); - } - } - GDK_NATIVE_EXIT(env, that, _1gdk_1keyboard_1ungrab_FUNC); -} -#endif - #ifndef NO__1gdk_1keymap_1get_1default JNIEXPORT jintLong JNICALL GDK_NATIVE(_1gdk_1keymap_1get_1default) (JNIEnv *env, jclass that) @@ -1867,26 +1831,6 @@ fail: } #endif -#ifndef NO__1gdk_1pixmap_1new -JNIEXPORT jintLong JNICALL GDK_NATIVE(_1gdk_1pixmap_1new) - (JNIEnv *env, jclass that, jintLong arg0, jint arg1, jint arg2, jint arg3) -{ - jintLong rc = 0; - GDK_NATIVE_ENTER(env, that, _1gdk_1pixmap_1new_FUNC); -/* - rc = (jintLong)gdk_pixmap_new((GdkWindow *)arg0, (gint)arg1, (gint)arg2, (gint)arg3); -*/ - { - GDK_LOAD_FUNCTION(fp, gdk_pixmap_new) - if (fp) { - rc = (jintLong)((jintLong (CALLING_CONVENTION*)(GdkWindow *, gint, gint, gint))fp)((GdkWindow *)arg0, (gint)arg1, (gint)arg2, (gint)arg3); - } - } - GDK_NATIVE_EXIT(env, that, _1gdk_1pixmap_1new_FUNC); - return rc; -} -#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) @@ -5666,16 +5610,6 @@ JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1drag_1get_1data) } #endif -#ifndef NO__1gtk_1drag_1set_1icon_1pixbuf -JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1drag_1set_1icon_1pixbuf) - (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jint arg2, jint arg3) -{ - GTK_NATIVE_ENTER(env, that, _1gtk_1drag_1set_1icon_1pixbuf_FUNC); - gtk_drag_set_icon_pixbuf((GdkDragContext *)arg0, (GdkPixbuf *)arg1, arg2, arg3); - GTK_NATIVE_EXIT(env, that, _1gtk_1drag_1set_1icon_1pixbuf_FUNC); -} -#endif - #ifndef NO__1gtk_1drag_1set_1icon_1surface JNIEXPORT void JNICALL GTK_NATIVE(_1gtk_1drag_1set_1icon_1surface) (JNIEnv *env, jclass that, jintLong arg0, jintLong arg1) @@ -19480,32 +19414,6 @@ fail: } #endif -#if (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2II) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2JJ) && defined(JNI64)) -#ifndef JNI64 -JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2II)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jintLong arg2) -#else -JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2JJ)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jintLong arg2) -#endif -{ - GdkDragContext _arg0, *lparg0=NULL; -#ifndef JNI64 - OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2II_FUNC); -#else - OS_NATIVE_ENTER(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2JJ_FUNC); -#endif - if (!arg0) goto fail; - if ((lparg0 = &_arg0) == NULL) goto fail; - memmove((void *)lparg0, (const void *)arg1, (size_t)arg2); -fail: - if (arg0 && lparg0) setGdkDragContextFields(env, arg0, lparg0); -#ifndef JNI64 - OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2II_FUNC); -#else - OS_NATIVE_EXIT(env, that, memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2JJ_FUNC); -#endif -} -#endif - #if (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkEventAny_2II) && !defined(JNI64)) || (!defined(NO_memmove__Lorg_eclipse_swt_internal_gtk_GdkEventAny_2JJ) && defined(JNI64)) #ifndef JNI64 JNIEXPORT void JNICALL OS_NATIVE(memmove__Lorg_eclipse_swt_internal_gtk_GdkEventAny_2II)(JNIEnv *env, jclass that, jobject arg0, jintLong arg1, jintLong arg2) 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 53966971d3..a8b48de653 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 @@ -53,7 +53,6 @@ char * GDK_nativeFunctionNames[] = { "_1gdk_1cairo_1region_1create_1from_1surface", "_1gdk_1cairo_1reset_1clip", "_1gdk_1cairo_1set_1source_1pixbuf", - "_1gdk_1cairo_1set_1source_1pixmap", "_1gdk_1cairo_1set_1source_1rgba", "_1gdk_1cairo_1set_1source_1window", "_1gdk_1cursor_1new_1for_1display", @@ -109,7 +108,6 @@ char * GDK_nativeFunctionNames[] = { "_1gdk_1gc_1set_1stipple", "_1gdk_1gc_1set_1subwindow", "_1gdk_1get_1default_1root_1window", - "_1gdk_1keyboard_1ungrab", "_1gdk_1keymap_1get_1default", "_1gdk_1keymap_1get_1entries_1for_1keyval", "_1gdk_1keyval_1to_1lower", @@ -136,7 +134,6 @@ char * GDK_nativeFunctionNames[] = { "_1gdk_1pixbuf_1save_1to_1bufferv", "_1gdk_1pixbuf_1scale_1simple", "_1gdk_1pixmap_1get_1size", - "_1gdk_1pixmap_1new", "_1gdk_1pointer_1grab", "_1gdk_1pointer_1ungrab", "_1gdk_1property_1get", @@ -427,7 +424,6 @@ char * GTK_nativeFunctionNames[] = { "_1gtk_1drag_1dest_1unset", "_1gtk_1drag_1finish", "_1gtk_1drag_1get_1data", - "_1gtk_1drag_1set_1icon_1pixbuf", "_1gtk_1drag_1set_1icon_1surface", "_1gtk_1editable_1copy_1clipboard", "_1gtk_1editable_1cut_1clipboard", @@ -1695,11 +1691,6 @@ char * OS_nativeFunctionNames[] = { "memmove__Lorg_eclipse_swt_internal_gtk_GTypeQuery_2JJ", #endif #ifndef JNI64 - "memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2II", -#else - "memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2JJ", -#endif -#ifndef JNI64 "memmove__Lorg_eclipse_swt_internal_gtk_GdkEventAny_2II", #else "memmove__Lorg_eclipse_swt_internal_gtk_GdkEventAny_2JJ", 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 ad1c1e902e..67343ee70b 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 @@ -63,7 +63,6 @@ typedef enum { _1gdk_1cairo_1region_1create_1from_1surface_FUNC, _1gdk_1cairo_1reset_1clip_FUNC, _1gdk_1cairo_1set_1source_1pixbuf_FUNC, - _1gdk_1cairo_1set_1source_1pixmap_FUNC, _1gdk_1cairo_1set_1source_1rgba_FUNC, _1gdk_1cairo_1set_1source_1window_FUNC, _1gdk_1cursor_1new_1for_1display_FUNC, @@ -119,7 +118,6 @@ typedef enum { _1gdk_1gc_1set_1stipple_FUNC, _1gdk_1gc_1set_1subwindow_FUNC, _1gdk_1get_1default_1root_1window_FUNC, - _1gdk_1keyboard_1ungrab_FUNC, _1gdk_1keymap_1get_1default_FUNC, _1gdk_1keymap_1get_1entries_1for_1keyval_FUNC, _1gdk_1keyval_1to_1lower_FUNC, @@ -146,7 +144,6 @@ typedef enum { _1gdk_1pixbuf_1save_1to_1bufferv_FUNC, _1gdk_1pixbuf_1scale_1simple_FUNC, _1gdk_1pixmap_1get_1size_FUNC, - _1gdk_1pixmap_1new_FUNC, _1gdk_1pointer_1grab_FUNC, _1gdk_1pointer_1ungrab_FUNC, _1gdk_1property_1get_FUNC, @@ -425,7 +422,6 @@ typedef enum { _1gtk_1drag_1dest_1unset_FUNC, _1gtk_1drag_1finish_FUNC, _1gtk_1drag_1get_1data_FUNC, - _1gtk_1drag_1set_1icon_1pixbuf_FUNC, _1gtk_1drag_1set_1icon_1surface_FUNC, _1gtk_1editable_1copy_1clipboard_FUNC, _1gtk_1editable_1cut_1clipboard_FUNC, @@ -1681,11 +1677,6 @@ typedef enum { memmove__Lorg_eclipse_swt_internal_gtk_GTypeQuery_2JJ_FUNC, #endif #ifndef JNI64 - memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2II_FUNC, -#else - memmove__Lorg_eclipse_swt_internal_gtk_GdkDragContext_2JJ_FUNC, -#endif -#ifndef JNI64 memmove__Lorg_eclipse_swt_internal_gtk_GdkEventAny_2II_FUNC, #else memmove__Lorg_eclipse_swt_internal_gtk_GdkEventAny_2JJ_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c index e8c7ffeaf0..2ef01e9e78 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.c @@ -203,61 +203,6 @@ void setGTypeQueryFields(JNIEnv *env, jobject lpObject, GTypeQuery *lpStruct) } #endif -#ifndef NO_GdkDragContext -typedef struct GdkDragContext_FID_CACHE { - int cached; - jclass clazz; - jfieldID protocol, is_source, source_window, dest_window, targets, actions, suggested_action, action, start_time; -} GdkDragContext_FID_CACHE; - -GdkDragContext_FID_CACHE GdkDragContextFc; - -void cacheGdkDragContextFields(JNIEnv *env, jobject lpObject) -{ - if (GdkDragContextFc.cached) return; - GdkDragContextFc.clazz = (*env)->GetObjectClass(env, lpObject); - GdkDragContextFc.protocol = (*env)->GetFieldID(env, GdkDragContextFc.clazz, "protocol", "I"); - GdkDragContextFc.is_source = (*env)->GetFieldID(env, GdkDragContextFc.clazz, "is_source", "Z"); - GdkDragContextFc.source_window = (*env)->GetFieldID(env, GdkDragContextFc.clazz, "source_window", I_J); - GdkDragContextFc.dest_window = (*env)->GetFieldID(env, GdkDragContextFc.clazz, "dest_window", I_J); - GdkDragContextFc.targets = (*env)->GetFieldID(env, GdkDragContextFc.clazz, "targets", I_J); - GdkDragContextFc.actions = (*env)->GetFieldID(env, GdkDragContextFc.clazz, "actions", "I"); - GdkDragContextFc.suggested_action = (*env)->GetFieldID(env, GdkDragContextFc.clazz, "suggested_action", "I"); - GdkDragContextFc.action = (*env)->GetFieldID(env, GdkDragContextFc.clazz, "action", "I"); - GdkDragContextFc.start_time = (*env)->GetFieldID(env, GdkDragContextFc.clazz, "start_time", "I"); - GdkDragContextFc.cached = 1; -} - -GdkDragContext *getGdkDragContextFields(JNIEnv *env, jobject lpObject, GdkDragContext *lpStruct) -{ - if (!GdkDragContextFc.cached) cacheGdkDragContextFields(env, lpObject); - lpStruct->protocol = (GdkDragProtocol)(*env)->GetIntField(env, lpObject, GdkDragContextFc.protocol); - lpStruct->is_source = (gboolean)(*env)->GetBooleanField(env, lpObject, GdkDragContextFc.is_source); - lpStruct->source_window = (GdkWindow *)(*env)->GetIntLongField(env, lpObject, GdkDragContextFc.source_window); - lpStruct->dest_window = (GdkWindow *)(*env)->GetIntLongField(env, lpObject, GdkDragContextFc.dest_window); - lpStruct->targets = (GList *)(*env)->GetIntLongField(env, lpObject, GdkDragContextFc.targets); - lpStruct->actions = (GdkDragAction)(*env)->GetIntField(env, lpObject, GdkDragContextFc.actions); - lpStruct->suggested_action = (GdkDragAction)(*env)->GetIntField(env, lpObject, GdkDragContextFc.suggested_action); - lpStruct->action = (GdkDragAction)(*env)->GetIntField(env, lpObject, GdkDragContextFc.action); - lpStruct->start_time = (guint32)(*env)->GetIntField(env, lpObject, GdkDragContextFc.start_time); - return lpStruct; -} - -void setGdkDragContextFields(JNIEnv *env, jobject lpObject, GdkDragContext *lpStruct) -{ - if (!GdkDragContextFc.cached) cacheGdkDragContextFields(env, lpObject); - (*env)->SetIntField(env, lpObject, GdkDragContextFc.protocol, (jint)lpStruct->protocol); - (*env)->SetBooleanField(env, lpObject, GdkDragContextFc.is_source, (jboolean)lpStruct->is_source); - (*env)->SetIntLongField(env, lpObject, GdkDragContextFc.source_window, (jintLong)lpStruct->source_window); - (*env)->SetIntLongField(env, lpObject, GdkDragContextFc.dest_window, (jintLong)lpStruct->dest_window); - (*env)->SetIntLongField(env, lpObject, GdkDragContextFc.targets, (jintLong)lpStruct->targets); - (*env)->SetIntField(env, lpObject, GdkDragContextFc.actions, (jint)lpStruct->actions); - (*env)->SetIntField(env, lpObject, GdkDragContextFc.suggested_action, (jint)lpStruct->suggested_action); - (*env)->SetIntField(env, lpObject, GdkDragContextFc.action, (jint)lpStruct->action); - (*env)->SetIntField(env, lpObject, GdkDragContextFc.start_time, (jint)lpStruct->start_time); -} -#endif - #ifndef NO_GdkEvent typedef struct GdkEvent_FID_CACHE { int cached; diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h index 9ce376899b..74d46d690e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_structs.h @@ -66,18 +66,6 @@ void setGTypeQueryFields(JNIEnv *env, jobject lpObject, GTypeQuery *lpStruct); #define GTypeQuery_sizeof() 0 #endif -#ifndef NO_GdkDragContext -void cacheGdkDragContextFields(JNIEnv *env, jobject lpObject); -GdkDragContext *getGdkDragContextFields(JNIEnv *env, jobject lpObject, GdkDragContext *lpStruct); -void setGdkDragContextFields(JNIEnv *env, jobject lpObject, GdkDragContext *lpStruct); -#define GdkDragContext_sizeof() sizeof(GdkDragContext) -#else -#define cacheGdkDragContextFields(a,b) -#define getGdkDragContextFields(a,b,c) NULL -#define setGdkDragContextFields(a,b,c) -#define GdkDragContext_sizeof() 0 -#endif - #ifndef NO_GdkEvent void cacheGdkEventFields(JNIEnv *env, jobject lpObject); GdkEvent *getGdkEventFields(JNIEnv *env, jobject lpObject, GdkEvent *lpStruct); 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 7d2ab70f73..cbfb0d22e6 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 @@ -588,19 +588,6 @@ public class GDK extends OS { } /** * @method flags=dynamic - */ - public static final native void _gdk_cairo_set_source_pixmap(long /*int*/ cairo, long /*int*/ pixmap, double pixbuf_x, double pixbuf_y); - public static final void gdk_cairo_set_source_pixmap(long /*int*/ cairo, long /*int*/ pixmap, double pixbuf_x, double pixbuf_y) { - lock.lock(); - try { - _gdk_cairo_set_source_pixmap(cairo,pixmap,pixbuf_x,pixbuf_y); - } - finally { - lock.unlock(); - } - } - /** - * @method flags=dynamic * @param window cast=(GdkWindow *) */ public static final native void _gdk_cairo_set_source_window(long /*int*/ cairo, long /*int*/ window, int x, int y); @@ -1225,16 +1212,6 @@ public class GDK extends OS { lock.unlock(); } } - /** @method flags=dynamic */ - public static final native void _gdk_keyboard_ungrab(int time); - public static final void gdk_keyboard_ungrab(int time) { - lock.lock(); - try { - _gdk_keyboard_ungrab(time); - } finally { - lock.unlock(); - } - } public static final native long /*int*/ _gdk_keymap_get_default(); public static final long /*int*/ gdk_keymap_get_default() { lock.lock(); @@ -1500,22 +1477,6 @@ public class GDK extends OS { /** * @method flags=dynamic * @param window cast=(GdkWindow *) - * @param width cast=(gint) - * @param height cast=(gint) - * @param depth cast=(gint) - */ - public static final native long /*int*/ _gdk_pixmap_new(long /*int*/ window, int width, int height, int depth); - public static final long /*int*/ gdk_pixmap_new(long /*int*/ window, int width, int height, int depth) { - lock.lock(); - try { - return _gdk_pixmap_new(window, width, height, depth); - } finally { - lock.unlock(); - } - } - /** - * @method flags=dynamic - * @param window cast=(GdkWindow *) * @param owner_events cast=(gboolean) * @param event_mask cast=(GdkEventMask) * @param confine_to cast=(GdkWindow *) 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 8c9633dfe4..c664e7e49c 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 @@ -1874,19 +1874,6 @@ public class GTK extends OS { lock.unlock(); } } - /** - * @param context cast=(GdkDragContext *) - * @param pixbuf cast=(GdkPixbuf *) - */ - public static final native void _gtk_drag_set_icon_pixbuf(long /*int*/ context, long /*int*/ pixbuf, int hot_x, int hot_y); - public static final void gtk_drag_set_icon_pixbuf(long /*int*/ context, long /*int*/ pixbuf, int hot_x, int hot_y) { - lock.lock(); - try { - _gtk_drag_set_icon_pixbuf(context, pixbuf, hot_x, hot_y); - } finally { - lock.unlock(); - } - } /** @method flags=dynamic */ public static final native void _gtk_drag_set_icon_surface(long /*int*/ context, long /*int*/ surface); public static final void gtk_drag_set_icon_surface(long /*int*/ context, long /*int*/ surface) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkDragContext.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkDragContext.java deleted file mode 100644 index ba7186985f..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/GdkDragContext.java +++ /dev/null @@ -1,38 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2012 IBM Corporation and others. All rights reserved. - * The contents of this file are made available under the terms - * of the GNU Lesser General Public License (LGPL) Version 2.1 that - * accompanies this distribution (lgpl-v21.txt). The LGPL is also - * available at http://www.gnu.org/licenses/lgpl.html. If the version - * of the LGPL at http://www.gnu.org is different to the version of - * the LGPL accompanying this distribution and there is any conflict - * between the two license versions, the terms of the LGPL accompanying - * this distribution shall govern. - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.internal.gtk; - - -public class GdkDragContext { - /** @field cast=(GdkDragProtocol) */ - public int protocol; - /** @field cast=(gboolean) */ - public boolean is_source; - /** @field cast=(GdkWindow *) */ - public long /*int*/ source_window; - /** @field cast=(GdkWindow *) */ - public long /*int*/ dest_window; - /** @field cast=(GList *) */ - public long /*int*/ targets; - /** @field cast=(GdkDragAction) */ - public int actions; - /** @field cast=(GdkDragAction) */ - public int suggested_action; - /** @field cast=(GdkDragAction) */ - public int action; - /** @field cast=(guint32) */ - public int start_time; - public static final int sizeof = GDK.GdkDragContext_sizeof(); -} 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 2431ddf048..891174f29f 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 @@ -2936,12 +2936,6 @@ public static final native void memmove(GObjectClass dest, long /*int*/ src); * @param size cast=(size_t) */ public static final native void memmove(GTypeQuery dest, long /*int*/ src, long /*int*/ size); -/** - * @param dest cast=(void *),flags=no_in - * @param src cast=(const void *) - * @param size cast=(size_t) - */ -public static final native void memmove(GdkDragContext dest, long /*int*/ src, long /*int*/ size); /** @param dest flags=no_in */ public static final native void memmove(GtkWidgetClass dest, long /*int*/ src); /** @@ -4209,13 +4203,12 @@ public static final byte [] getThemeNameBytes() { * * @since 3.104 */ -public static final void setDarkThemePreferred(boolean preferred){ - if (!GTK.GTK3) return; //only applicable to GTK3 - g_object_set(GTK.gtk_settings_get_default(), GTK.gtk_application_prefer_dark_theme, - preferred, 0); - g_object_notify(GTK.gtk_settings_get_default(), - GTK.gtk_application_prefer_dark_theme); -} + public static final void setDarkThemePreferred(boolean preferred) { + if (!GTK.GTK3) + return; // only applicable to GTK3 + g_object_set(GTK.gtk_settings_get_default(), GTK.gtk_application_prefer_dark_theme, preferred, 0); + g_object_notify(GTK.gtk_settings_get_default(), GTK.gtk_application_prefer_dark_theme); + } /** * @param info cast=(GDBusInterfaceInfo *) |