summaryrefslogtreecommitdiff
path: root/libjava/jni
diff options
context:
space:
mode:
authorkho <kho@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-27 16:39:45 +0000
committerkho <kho@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-27 16:39:45 +0000
commit0d7d03f41c7895683193fa37085924caa0c2b3cc (patch)
tree8358b9387d9ebe009bb199121c0fadbd4d87e791 /libjava/jni
parentd12ce1bf2ef1882df9d8a7f221619e6df027b977 (diff)
downloadgcc-0d7d03f41c7895683193fa37085924caa0c2b3cc.tar.gz
2004-01-26 Kim Ho <kho@redhat.com>
* gnu/java/awt/peer/gtk/GtkFramePeer.java (moveLayout): New method. (setMenuBar): Shift the Gtk layout up/down by the MenuBar height and let the Layout Managers readjust anything that needs to move. * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (moveLayout): New method. Shift everything in the Gtk layout in the Y direction by an offset. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76729 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/jni')
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
index 610fc142f85..970380683ba 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
@@ -433,6 +433,46 @@ Java_gnu_java_awt_peer_gtk_GtkFramePeer_getMenuBarHeight
return height;
}
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkFramePeer_moveLayout
+ (JNIEnv *env, jobject obj, jint offset)
+{
+ void* ptr;
+ GList* children;
+ GtkBox* vbox;
+ GtkLayout* layout;
+ GtkWidget* widget;
+
+ ptr = NSA_GET_PTR (env, obj);
+
+ gdk_threads_enter ();
+
+ children = gtk_container_get_children (GTK_CONTAINER (ptr));
+ vbox = children->data;
+ g_assert (GTK_IS_VBOX (vbox));
+
+ children = gtk_container_get_children (GTK_CONTAINER (vbox));
+ do
+ {
+ layout = children->data;
+ children = children->next;
+ }
+ while (!GTK_IS_LAYOUT (layout) && children != NULL);
+ g_assert (GTK_IS_LAYOUT (layout));
+ children = gtk_container_get_children (GTK_CONTAINER (layout));
+
+ while (children != NULL)
+ {
+ widget = children->data;
+ gtk_layout_move (layout, widget, widget->allocation.x,
+ widget->allocation.y+offset);
+ children = children->next;
+ }
+
+ gdk_threads_leave ();
+}
+
+
static void
window_get_frame_extents (GtkWidget *window,
int *top, int *left, int *bottom, int *right)