diff options
Diffstat (limited to 'bundles')
18 files changed, 78 insertions, 25 deletions
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 fdb6313674..0eb7b5caee 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 @@ -111,7 +111,11 @@ public class TableDragSourceEffect extends DragSourceEffect { int /*long*/ path = OS.g_list_nth_data (list, i); OS.gtk_tree_view_get_cell_area (handle, path, 0, rect); pixmaps[i] = OS.gtk_tree_view_create_row_drag_icon(handle, path); - OS.gdk_drawable_get_size(pixmaps[i], w, h); + if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) { + OS.gdk_pixmap_get_size(pixmaps[i], w, h); + } else { + OS.gdk_drawable_get_size(pixmaps[i], w, h); + } width = Math.max(width, w[0]); height = rect.y + h[0] - yy[0]; yy[i] = rect.y; 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 78e4cd1b58..5be5ddad9a 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 @@ -110,7 +110,11 @@ public class TreeDragSourceEffect extends DragSourceEffect { int /*long*/ path = OS.g_list_nth_data (list, i); OS.gtk_tree_view_get_cell_area (handle, path, 0, rect); pixmaps[i] = OS.gtk_tree_view_create_row_drag_icon(handle, path); - OS.gdk_drawable_get_size(pixmaps[i], w, h); + if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) { + OS.gdk_pixmap_get_size(pixmaps[i], w, h); + } else { + OS.gdk_drawable_get_size(pixmaps[i], w, h); + } width = Math.max(width, w[0]); height = rect.y + h[0] - yy[0]; yy[i] = rect.y; 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 b71852b2c0..9054f1788a 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 @@ -5238,7 +5238,15 @@ JNIEXPORT void JNICALL OS_NATIVE(_1gdk_1drawable_1get_1size) if (arg1) if ((lparg1 = (*env)->GetIntArrayElements(env, arg1, NULL)) == NULL) goto fail; if (arg2) if ((lparg2 = (*env)->GetIntArrayElements(env, arg2, NULL)) == NULL) goto fail; } - gdk_drawable_get_size((GdkDrawable *)arg0, (gint *)lparg1, (gint *)lparg2); +/* + gdk_drawable_get_size(arg0, (gint *)lparg1, (gint *)lparg2); +*/ + { + OS_LOAD_FUNCTION(fp, gdk_drawable_get_size) + if (fp) { + ((void (CALLING_CONVENTION*)(jintLong, gint *, gint *))fp)(arg0, (gint *)lparg1, (gint *)lparg2); + } + } fail: #ifdef JNI_VERSION_1_2 if (IS_JNI_1_2) { 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 2671afd6da..4e52acf40d 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 @@ -166,6 +166,7 @@ #define gdk_draw_point_LIB LIB_GDK #define gdk_draw_polygon_LIB LIB_GDK #define gdk_draw_image_LIB LIB_GDK +#define gdk_drawable_get_size_LIB LIB_GDK #define gdk_gc_set_background_LIB LIB_GDK #define gdk_gc_set_clip_mask_LIB LIB_GDK #define gdk_gc_set_clip_origin_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 d221129a8e..880963e323 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 @@ -3905,7 +3905,7 @@ public static final int /*long*/ gdk_drawable_get_image(int /*long*/ drawable, i } } /** - * @param drawable cast=(GdkDrawable *) + * @method flags=dynamic * @param width cast=(gint *),flags=no_in critical * @param height cast=(gint *),flags=no_in critical */ 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 a5dc056ffc..61021eb94a 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 @@ -2751,11 +2751,10 @@ void getSize(int[] width, int[] height) { if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) { width[0] = OS.gdk_window_get_width(data.drawable); height[0] = OS.gdk_window_get_height(data.drawable); - return; } else { OS.gdk_drawable_get_size(data.drawable, width, height); - return; } + return; } if (OS.USE_CAIRO) { int /*long*/ surface = Cairo.cairo_get_target(handle); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java index 9f7fda7368..ddc093187a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java @@ -363,7 +363,11 @@ public Image(Device device, Image srcImage, int flag) { /* Get source image size */ int[] w = new int[1], h = new int[1]; - OS.gdk_drawable_get_size(srcImage.pixmap, w, h); + if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) { + OS.gdk_pixmap_get_size(pixmap, w, h); + } else { + OS.gdk_drawable_get_size(srcImage.pixmap, w, h); + } int width = w[0]; int height = h[0]; @@ -869,7 +873,11 @@ void createSurface() { /* Generate the mask if necessary. */ if (transparentPixel != -1) createMask(); int[] w = new int[1], h = new int[1]; - OS.gdk_drawable_get_size(pixmap, w, h); + if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) { + OS.gdk_pixmap_get_size(pixmap, w, h); + } else { + OS.gdk_drawable_get_size(pixmap, w, h); + } int width = w[0], height = h[0]; if (mask != 0 || alpha != -1 || alphaData != null) { int /*long*/ pixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, true, 8, width, height); @@ -1069,7 +1077,11 @@ public Rectangle getBounds() { return new Rectangle(0, 0, width, height); } int[] w = new int[1]; int[] h = new int[1]; - OS.gdk_drawable_get_size(pixmap, w, h); + if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) { + OS.gdk_pixmap_get_size(pixmap, w, h); + } else { + OS.gdk_drawable_get_size(pixmap, w, h); + } return new Rectangle(0, 0, width = w[0], height = h[0]); } @@ -1142,7 +1154,11 @@ public ImageData getImageData() { return data; } int[] w = new int[1], h = new int[1]; - OS.gdk_drawable_get_size(pixmap, w, h); + if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) { + OS.gdk_pixmap_get_size(pixmap, w, h); + } else { + OS.gdk_drawable_get_size(pixmap, w, h); + } int width = w[0], height = h[0]; int /*long*/ pixbuf = OS.gdk_pixbuf_new(OS.GDK_COLORSPACE_RGB, false, 8, width, height); if (pixbuf == 0) SWT.error(SWT.ERROR_NO_HANDLES); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java index 0bb0f4d85e..0a57b144e1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/internal/ImageList.java @@ -102,7 +102,11 @@ public static int /*long*/ createPixbuf(Image image) { Cairo.cairo_surface_destroy(surface); } else { int [] w = new int [1], h = new int [1]; - OS.gdk_drawable_get_size (image.pixmap, w, h); + if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) { + OS.gdk_pixmap_get_size(image.pixmap, w, h); + } else { + OS.gdk_drawable_get_size (image.pixmap, w, h); + } int /*long*/ colormap = OS.gdk_colormap_get_system (); boolean hasMask = image.mask != 0 && OS.gdk_drawable_get_depth (image.mask) == 1; if (hasMask) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java index 800ef4425e..8292ab796d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Caret.java @@ -141,7 +141,7 @@ boolean drawCaret () { OS.gdk_gc_set_function (gc, OS.GDK_XOR); if (image != null && !image.isDisposed() && image.mask == 0) { int[] width = new int[1]; int[] height = new int[1]; - OS.gdk_drawable_get_size(image.pixmap, width, height); + gdk_pixmap_get_size (image.pixmap, width, height); int nX = x; if ((parent.style & SWT.MIRRORED) != 0) nX = parent.getClientWidth () - width[0] - nX; OS.gdk_draw_drawable(window, gc, image.pixmap, 0, 0, nX, y, width[0], height[0]); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java index 8d68182c7d..09e5150b5b 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java @@ -382,7 +382,7 @@ public void drawBackground (GC gc, int x, int y, int width, int height, int offs int /*long*/ drawable = control.backgroundImage.pixmap; int /*long*/ xDrawable = OS.GDK_PIXMAP_XID (drawable); int [] w = new int [1], h = new int [1]; - OS.gdk_drawable_get_size (drawable, w, h); + gdk_pixmap_get_size (drawable, w, h); surface = Cairo.cairo_xlib_surface_create (xDisplay, xDrawable, xVisual, w [0], h [0]); if (surface == 0) error (SWT.ERROR_NO_HANDLES); } else { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java index 209fadab90..ec35babb3f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java @@ -408,7 +408,7 @@ void printWindow (boolean first, Control control, GC gc, int /*long*/ drawable, if (OS.gdk_drawable_get_depth (window) != depth) return; GdkRectangle rect = new GdkRectangle (); int [] width = new int [1], height = new int [1]; - OS.gdk_drawable_get_size (window, width, height); + gdk_window_get_size (window, width, height); rect.width = width [0]; rect.height = height [0]; OS.gdk_window_begin_paint_rect (window, rect); @@ -436,7 +436,7 @@ void printWindow (boolean first, Control control, GC gc, int /*long*/ drawable, OS.gdk_window_get_position (window, cX, cY); int /*long*/ parentWindow = OS.gdk_window_get_parent (window); int [] pW = new int [1], pH = new int [1]; - OS.gdk_drawable_get_size (parentWindow, pW, pH); + gdk_window_get_size (parentWindow, pW, pH); srcX = x_offset [0] - cX [0]; srcY = y_offset [0] - cY [0]; destX = x - cX [0]; @@ -3259,7 +3259,7 @@ int /*long*/ gtk_visibility_notify_event (int /*long*/ widget, int /*long*/ even } else { if ((state & OBSCURED) != 0) { int [] width = new int [1], height = new int [1]; - OS.gdk_drawable_get_size (window, width, height); + gdk_window_get_size (window, width, height); GdkRectangle rect = new GdkRectangle (); rect.width = width [0]; rect.height = height [0]; @@ -3573,7 +3573,7 @@ void redrawWidget (int x, int y, int width, int height, boolean redrawAll, boole GdkRectangle rect = new GdkRectangle (); if (redrawAll) { int [] w = new int [1], h = new int [1]; - OS.gdk_drawable_get_size (window, w, h); + gdk_window_get_size (window, w, h); rect.width = w [0]; rect.height = h [0]; } else { diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java index 2f5964ebe6..b48eeea42e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java @@ -1255,7 +1255,7 @@ int /*long*/ gtk_expose_event (int /*long*/ widget, int /*long*/ event) { int /*long*/ window = gtk_widget_get_window (widget); int [] width = new int [1]; int [] height = new int [1]; - OS.gdk_drawable_get_size (window, width, height); + gdk_window_get_size (window, width, height); GdkRectangle area = new GdkRectangle (); area.x = gdkEventExpose.area_x; area.y = gdkEventExpose.area_y; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java index 240749f2ea..1b38aa9357 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java @@ -1143,7 +1143,7 @@ public Rectangle getClientArea () { int getClientWidth () { int [] w = new int [1], h = new int [1]; OS.gtk_widget_realize (handle); - OS.gdk_drawable_get_size(OS.gtk_tree_view_get_bin_window(handle), w, h); + gdk_window_get_size(OS.gtk_tree_view_get_bin_window(handle), w, h); return w[0]; } @@ -1918,7 +1918,7 @@ int /*long*/ gtk_expose_event (int /*long*/ widget, int /*long*/ eventPtr) { int /*long*/ window = OS.gtk_tree_view_get_bin_window (handle); if (window == gdkEvent.window) { int [] width = new int [1], height = new int [1]; - OS.gdk_drawable_get_size (window, width, height); + gdk_window_get_size (window, width, height); int bottom = 0; if (itemCount != 0) { int /*long*/ iter = OS.g_malloc (OS.GtkTreeIter_sizeof ()); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java index a7fba59163..1a2a5e48b9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java @@ -706,7 +706,7 @@ void redraw () { int /*long*/ window = OS.gtk_tree_view_get_bin_window (parentHandle); rect.x = 0; int [] w = new int [1], h = new int [1]; - OS.gdk_drawable_get_size (window, w, h); + gdk_window_get_size (window, w, h); rect.width = w [0]; OS.gdk_window_invalidate_rect (window, rect, false); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java index 55f335308c..fdcb01cd48 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java @@ -1551,7 +1551,7 @@ int /*long*/ gtk_expose_event (int /*long*/ widget, int /*long*/ event) { OS.memmove (gdkEvent, event, GdkEventExpose.sizeof); int /*long*/ window = paintWindow (); int [] w = new int [1], h = new int [1]; - OS.gdk_drawable_get_size (window, w, h); + gdk_window_get_size (window, w, h); GtkBorder innerBorder = Display.getEntryInnerBorder (handle); int width = w [0] - innerBorder.left - innerBorder.right; int height = h [0] - innerBorder.top - innerBorder.bottom; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java index 94065d380d..5f2cb67736 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java @@ -1144,7 +1144,7 @@ public Rectangle getClientArea () { int getClientWidth () { int [] w = new int [1], h = new int [1]; OS.gtk_widget_realize (handle); - OS.gdk_drawable_get_size(OS.gtk_tree_view_get_bin_window(handle), w, h); + gdk_window_get_size(OS.gtk_tree_view_get_bin_window(handle), w, h); return w[0]; } @@ -1927,7 +1927,7 @@ int /*long*/ gtk_expose_event (int /*long*/ widget, int /*long*/ eventPtr) { int /*long*/ window = OS.gtk_tree_view_get_bin_window (handle); if (window == gdkEvent.window) { int [] width = new int [1], height = new int [1]; - OS.gdk_drawable_get_size (window, width, height); + gdk_window_get_size (window, width, height); int /*long*/ parent = 0; int itemCount = OS.gtk_tree_model_iter_n_children (modelHandle, parent); GdkRectangle rect = new GdkRectangle (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java index 608876b4e9..b42956aa90 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java @@ -1060,7 +1060,7 @@ void redraw () { int /*long*/ window = OS.gtk_tree_view_get_bin_window (parentHandle); rect.x = 0; int [] w = new int [1], h = new int [1]; - OS.gdk_drawable_get_size (window, w, h); + gdk_window_get_size (window, w, h); rect.width = w [0]; OS.gdk_window_invalidate_rect (window, rect, false); } 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 bf9d1c108a..57ab0fc48e 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 @@ -1806,6 +1806,23 @@ void gtk_widget_set_receives_default (int /*long*/ widget, boolean receives_defa } } +void gdk_pixmap_get_size (int /*long*/ pixmap, int[] width, int[] height) { + if (OS.GTK_VERSION >= OS.VERSION (2, 24, 0)) { + OS.gdk_pixmap_get_size (pixmap, width, height); + } else { + OS.gdk_drawable_get_size (pixmap, width, height); + } +} + +void gdk_window_get_size (int /*long*/ drawable, int[] width, int[] height) { + if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) { + width[0] = OS.gdk_window_get_width (drawable); + height[0] = OS.gdk_window_get_height (drawable); + } else { + OS.gdk_drawable_get_size (drawable, width, height); + } +} + /** * Returns a string containing a concise, human-readable * description of the receiver. |