diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-08-08 11:36:27 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2012-08-08 14:24:20 -0400 |
commit | a61caa1cfed4d2ec7b9bccff2e9d74f32593118d (patch) | |
tree | b01ab0f39e417c1e95a303ef4adb2005801c093d /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt | |
parent | e5048f56d6534a718cd3f93bfd8fdd52aca34dcd (diff) | |
download | eclipse.platform.swt-a61caa1cfed4d2ec7b9bccff2e9d74f32593118d.tar.gz eclipse.platform.swt-a61caa1cfed4d2ec7b9bccff2e9d74f32593118d.tar.xz eclipse.platform.swt-a61caa1cfed4d2ec7b9bccff2e9d74f32593118d.zip |
Omit use of deprecated GTK_RANGE_SLIDER_END and GTK_RANGE_SLIDER_START
Conflicts:
bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.h
bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_stats.c
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/widgets/ScrollBar.java | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java index 2cf5fbeaea..fecf64eba9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ScrollBar.java @@ -339,8 +339,8 @@ public int getThumb () { */ public Rectangle getThumbBounds () { checkWidget(); - int slider_start = OS.GTK_RANGE_SLIDER_START (handle); - int slider_end = OS.GTK_RANGE_SLIDER_END (handle); + int [] slider_start = new int [1], slider_end = new int [1]; + gtk_range_get_slider_range (handle, slider_start, slider_end); int x, y, width, height; GtkAllocation allocation = new GtkAllocation (); if ((style & SWT.VERTICAL) != 0) { @@ -352,10 +352,10 @@ public Rectangle getThumbBounds () { x = OS.GTK_WIDGET_X (handle); width = OS.GTK_WIDGET_WIDTH (handle); } - y = slider_start; - height = slider_end - slider_start; + y = slider_start [0]; + height = slider_end [0] - slider_start [0]; } else { - x = slider_start; + x = slider_start [0]; if (OS.GTK_VERSION >= OS.VERSION (2, 18, 0)) { OS.gtk_widget_get_allocation(handle, allocation); y = allocation.y; @@ -364,7 +364,7 @@ public Rectangle getThumbBounds () { y = OS.GTK_WIDGET_Y (handle); height = OS.GTK_WIDGET_HEIGHT (handle); } - width = slider_end - slider_start; + width = slider_end [0] - slider_start [0]; } Rectangle rect = new Rectangle(x, y, width, height); int [] origin_x = new int [1], origin_y = new int [1]; @@ -423,7 +423,9 @@ public Rectangle getThumbTrackBounds () { if (hasC) height -= stepperSize; if (hasD) height -= stepperSize; if (height < 0) { - y = OS.GTK_RANGE_SLIDER_START (handle); + int [] slider_start = new int [1], slider_end = new int [1]; + gtk_range_get_slider_range (handle, slider_start, slider_end); + y = slider_start [0]; height = 0; } } else { @@ -450,7 +452,9 @@ public Rectangle getThumbTrackBounds () { height = OS.GTK_WIDGET_HEIGHT (handle); } if (width < 0) { - x = OS.GTK_RANGE_SLIDER_START (handle); + int [] slider_start = new int [1], slider_end = new int [1]; + gtk_range_get_slider_range (handle, slider_start, slider_end); + x = slider_start [0]; width = 0; } } @@ -509,6 +513,15 @@ int /*long*/ gtk_change_value (int /*long*/ widget, int /*long*/ scroll, int /*l return 0; } +void gtk_range_get_slider_range (int /*long*/ widget, int [] slider_start, int [] slider_end) { + if (OS.GTK_VERSION >= OS.VERSION (2, 20, 0)) { + OS.gtk_range_get_slider_range (widget, slider_start, slider_end); + } else { + slider_start [0] = OS.GTK_RANGE_SLIDER_START (widget); + slider_end [0] = OS.GTK_RANGE_SLIDER_END (widget); + } +} + int /*long*/ gtk_value_changed (int /*long*/ adjustment) { Event event = new Event (); dragSent = detail == OS.GTK_SCROLL_JUMP; |