summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-08-13 12:49:56 -0400
committerArun Thondapu <arunkumar.thondapu@in.ibm.com>2012-08-14 14:45:36 +0530
commit73b8760cc71f23fc1adf4097ba30ab56c13451ed (patch)
treee33f8414ecff2894d424832622f04bf1db92da35 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java
parent31720edb505f97bebd7f644d62b276e4d39389cb (diff)
downloadeclipse.platform.swt-73b8760cc71f23fc1adf4097ba30ab56c13451ed.tar.gz
eclipse.platform.swt-73b8760cc71f23fc1adf4097ba30ab56c13451ed.tar.xz
eclipse.platform.swt-73b8760cc71f23fc1adf4097ba30ab56c13451ed.zip
Omit use of gdk_drawable_get_size for newer GTK+ and make it dynamic
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Widget.java17
1 files changed, 17 insertions, 0 deletions
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.