diff options
author | Graydon Hoare <graydon@redhat.com> | 2003-07-18 19:27:42 +0000 |
---|---|---|
committer | Graydon Hoare <graydon@gcc.gnu.org> | 2003-07-18 19:27:42 +0000 |
commit | cecc892aea3942bff3009a3573ca46d7862e116e (patch) | |
tree | a6c4bc57f13f95fac16facbecebe09ad564c8608 /libjava | |
parent | 9e508cc4703391622b221a3a7aed00938be9f2ba (diff) | |
download | gcc-cecc892aea3942bff3009a3573ca46d7862e116e.zip gcc-cecc892aea3942bff3009a3573ca46d7862e116e.tar.gz gcc-cecc892aea3942bff3009a3573ca46d7862e116e.tar.bz2 |
gnu_java_awt_peer_gtk_GtkScrollBarPeer.c: Handle missing event cases, connect to "value-changed" signal.
2003-07-18 Graydon Hoare <graydon@redhat.com>
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c:
Handle missing event cases, connect to "value-changed" signal.
From-SVN: r69568
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/ChangeLog | 5 | ||||
-rw-r--r-- | libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c | 26 |
2 files changed, 30 insertions, 1 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index e654650..94cb464 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,5 +1,10 @@ 2003-07-18 Graydon Hoare <graydon@redhat.com> + * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c: + Handle missing event cases, connect to "value-changed" signal. + +2003-07-18 Graydon Hoare <graydon@redhat.com> + * java/awt/geom/CubicCurve2D.java, java/awt/geom/Line2D.java, java/awt/geom/QuadCurve2D.java, diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c index a246b37..2bd3df8 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c @@ -46,6 +46,17 @@ struct range_scrollbar }; static void +post_change_event (GtkRange *range, + struct range_scrollbar *rs) +{ + GtkAdjustment *adj; + adj = gtk_range_get_adjustment (range); + (*gdk_env)->CallVoidMethod (gdk_env, *(rs->scrollbar), postAdjustmentEventID, + AWT_ADJUSTMENT_TRACK, (jint) adj->value); + +} + +static void post_adjustment_event (GtkRange *range, GtkScrollType scroll, struct range_scrollbar *rs) { @@ -56,15 +67,23 @@ post_adjustment_event (GtkRange *range, GtkScrollType scroll, switch (scroll) { + case GTK_SCROLL_STEP_UP: + case GTK_SCROLL_STEP_RIGHT: case GTK_SCROLL_STEP_FORWARD: type = AWT_ADJUSTMENT_UNIT_INCREMENT; break; + case GTK_SCROLL_STEP_DOWN: + case GTK_SCROLL_STEP_LEFT: case GTK_SCROLL_STEP_BACKWARD: type = AWT_ADJUSTMENT_UNIT_DECREMENT; break; + case GTK_SCROLL_PAGE_UP: + case GTK_SCROLL_PAGE_RIGHT: case GTK_SCROLL_PAGE_FORWARD: type = AWT_ADJUSTMENT_BLOCK_INCREMENT; break; + case GTK_SCROLL_PAGE_DOWN: + case GTK_SCROLL_PAGE_LEFT: case GTK_SCROLL_PAGE_BACKWARD: type = AWT_ADJUSTMENT_BLOCK_DECREMENT; break; @@ -118,9 +137,14 @@ Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectHooks rs->scrollbar = (jobject *) malloc (sizeof (jobject)); *(rs->scrollbar) = (*env)->NewGlobalRef (env, obj); gtk_signal_connect (GTK_OBJECT (GTK_RANGE (ptr)), - "move_slider", + "move-slider", GTK_SIGNAL_FUNC (post_adjustment_event), rs); + gtk_signal_connect (GTK_OBJECT (GTK_RANGE (ptr)), + "value-changed", + GTK_SIGNAL_FUNC (post_change_event), rs); + + connect_awt_hook (env, obj, 1, GTK_SCROLLBAR (ptr)->range); gdk_threads_leave (); } |