diff options
author | Thomas Fitzsimmons <fitzsim@redhat.com> | 2004-01-05 21:41:21 +0000 |
---|---|---|
committer | Thomas Fitzsimmons <fitzsim@gcc.gnu.org> | 2004-01-05 21:41:21 +0000 |
commit | a8c2775c37f9e66e189d1040ae04b40d38e9eec9 (patch) | |
tree | fcd9290db182f1d323529db8273839e1b6589878 /libjava/jni | |
parent | 6037221c71ac41ed1971a58f1cb00e71da657665 (diff) | |
download | gcc-a8c2775c37f9e66e189d1040ae04b40d38e9eec9.zip gcc-a8c2775c37f9e66e189d1040ae04b40d38e9eec9.tar.gz gcc-a8c2775c37f9e66e189d1040ae04b40d38e9eec9.tar.bz2 |
2004-01-05 Thomas Fitzsimmons <fitzsim@redhat.com>
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
(pre_event_handler): Set all insets to 0 when a Configure event
is received for a GtkPlug.
* gnu/java/awt/EmbeddedWindow.java (window_id): Rename handle.
Make handle long, not int.
(EmbeddedWindow()): New constructor.
(EmbeddedWindow(int)): Rename window_id to handle. Make handle
long, not int.
(setHandle): New method.
(getHandle): Return long, not int.
* gnu/java/awt/peer/EmbeddedWindowPeer.java (embed): New method
declaration.
* gnu/java/awt/peer/gtk/GtkEmbeddedWindowPeer.java,
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c:
(create(long)): Take long parameter, not int. Cast gtk_plug_new
argument to GdkNativeWindow.
(construct): New method.
(embed): New method.
From-SVN: r75447
Diffstat (limited to 'libjava/jni')
-rw-r--r-- | libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c | 24 | ||||
-rw-r--r-- | libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c | 18 |
2 files changed, 35 insertions, 7 deletions
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c index bf4035d..c98473f 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c @@ -42,7 +42,7 @@ exception statement from your version. */ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create - (JNIEnv *env, jobject obj, jint window_id) + (JNIEnv *env, jobject obj, jlong socket_id) { GtkWidget *window; GtkWidget *vbox, *layout; @@ -51,8 +51,8 @@ Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create NSA_SET_GLOBAL_REF (env, obj); gdk_threads_enter (); - - window = gtk_plug_new (window_id); + + window = gtk_plug_new ((GdkNativeWindow) socket_id); vbox = gtk_vbox_new (0, 0); layout = gtk_layout_new (NULL, NULL); @@ -66,3 +66,21 @@ Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create NSA_SET_PTR (env, obj, window); } + +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_construct + (JNIEnv *env, jobject obj, jlong socket_id) +{ + void *ptr; + + ptr = NSA_GET_PTR (env, obj); + + gdk_threads_enter (); + + if (GTK_WIDGET_REALIZED (GTK_WIDGET (ptr))) + g_printerr ("ERROR: GtkPlug is already realized\n"); + + gtk_plug_construct (GTK_PLUG (ptr), (GdkNativeWindow) socket_id); + + gdk_threads_leave (); +} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c index aa9fd17b..e8b8702 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c @@ -998,10 +998,20 @@ pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer) gdk_threads_leave (); /* FIXME: hard-code these values for now. */ - top = 20; - left = 6; - bottom = 6; - right = 6; + if (GTK_IS_PLUG (widget)) + { + top = 0; + left = 0; + bottom = 0; + right = 0; + } + else + { + top = 20; + left = 6; + bottom = 6; + right = 6; + } (*gdk_env)->CallVoidMethod (gdk_env, peer, postConfigureEventID, |