diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-06-29 10:31:45 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-08-01 09:54:30 -0400 |
commit | 916bed68a7f416f534701e25d01d07957e5d4d12 (patch) | |
tree | cb416e6780d110a824255c00ea3837f8f17d8df7 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt | |
parent | b53743a0bde0bb268ed9de951eee883e9f924c4c (diff) | |
download | eclipse.platform.swt-916bed68a7f416f534701e25d01d07957e5d4d12.tar.gz eclipse.platform.swt-916bed68a7f416f534701e25d01d07957e5d4d12.tar.xz eclipse.platform.swt-916bed68a7f416f534701e25d01d07957e5d4d12.zip |
Omit use of gdk_drawable_get_size deprecated function in GC
Conflicts:
bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os.c
bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.h
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/GC.java | 30 |
1 files changed, 24 insertions, 6 deletions
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 74b744ca15..dc53b1a538 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 @@ -849,7 +849,11 @@ void drawImage(Image srcImage, int srcX, int srcY, int srcWidth, int srcHeight, } else { int[] width = new int[1]; int[] height = new int[1]; - OS.gdk_drawable_get_size(srcImage.pixmap, width, height); + if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) { + OS.gdk_pixmap_get_size(srcImage.pixmap, width, height); + } else { + OS.gdk_drawable_get_size(srcImage.pixmap, width, height); + } imgWidth = width[0]; imgHeight = height[0]; } @@ -2744,8 +2748,14 @@ void getSize(int[] width, int[] height) { return; } if (data.drawable != 0) { - OS.gdk_drawable_get_size(data.drawable, width, height); - return; + 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; + } } if (OS.USE_CAIRO) { int /*long*/ surface = Cairo.cairo_get_target(handle); @@ -2942,9 +2952,17 @@ void initCairo() { translateY = -y[0]; } } - int[] w = new int[1], h = new int[1]; - OS.gdk_drawable_get_size(drawable, w, h); - int width = w[0], height = h[0]; + int width = 0; + int height = 0; + if (OS.GTK_VERSION >= OS.VERSION(2, 24, 0)) { + width = OS.gdk_window_get_width(data.drawable); + height = OS.gdk_window_get_height(data.drawable); + } else { + int[] w = new int[1], h = new int[1]; + OS.gdk_drawable_get_size(drawable, w, h); + width = w[0]; + height = h[0]; + } int /*long*/ surface = Cairo.cairo_xlib_surface_create(xDisplay, xDrawable, xVisual, width, height); if (surface == 0) SWT.error(SWT.ERROR_NO_HANDLES); Cairo.cairo_surface_set_device_offset(surface, translateX, translateY); |