diff options
Diffstat (limited to 'libjava/jni')
-rw-r--r-- | libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c | 29 |
1 files changed, 28 insertions, 1 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 c0f528a..8c6fc1f 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 @@ -1,5 +1,5 @@ /* gtkwindowpeer.c -- Native implementation of GtkWindowPeer - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2002, 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -400,6 +400,33 @@ Java_gnu_java_awt_peer_gtk_GtkFramePeer_getMenuBarHeight return height; } +JNIEXPORT void JNICALL +Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_gtkWidgetGetDimensions + (JNIEnv *env, jobject obj, jintArray jdims) +{ + void *ptr; + jint *dims; + int top, left, bottom, right; + GtkRequisition req; + + ptr = NSA_GET_PTR (env, obj); + dims = (*env)->GetIntArrayElements (env, jdims, 0); + dims[0] = dims[1] = 0; + + gdk_threads_enter (); + + gtk_widget_size_request (GTK_WIDGET (ptr), &req); + + window_get_frame_extents (GTK_WIDGET (ptr), &top, &left, &bottom, &right); + + dims[0] = req.width + left + right; + dims[1] = req.height + top + bottom; + + gdk_threads_leave (); + + (*env)->ReleaseIntArrayElements (env, jdims, dims, 0); +} + static void window_get_frame_extents (GtkWidget *window, int *top, int *left, int *bottom, int *right) |