GtkFramePeer.java (postConfigureEvent): Fix comments.

2004-01-21  Kim Ho  <kho@redhat.com>

        * gnu/java/awt/peer/gtk/GtkFramePeer.java (postConfigureEvent):
        Fix comments.
        (removeMenuBarPeer): Make package private.
        (setMenuBarPeer): Make package private.
        * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
        (menubar_resize_cb): Mark attributes unused.
        (getMenuBarHeight): ditto.

From-SVN: r76299
This commit is contained in:
Kim Ho 2004-01-21 20:11:08 +00:00 committed by Kim Ho
parent 4b60eb3b4a
commit 2bd408db4b
3 changed files with 20 additions and 8 deletions

View File

@ -1,3 +1,13 @@
2004-01-21 Kim Ho <kho@redhat.com>
* gnu/java/awt/peer/gtk/GtkFramePeer.java (postConfigureEvent):
Fix comments.
(removeMenuBarPeer): Make package private.
(setMenuBarPeer): Make package private.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(menubar_resize_cb): Mark attributes unused.
(getMenuBarHeight): ditto.
2004-01-21 David Jee <djee@redhat.com>
* java/awt/Container.java

View File

@ -57,8 +57,8 @@ public class GtkFramePeer extends GtkWindowPeer
private MenuBarPeer menuBar;
native int getMenuBarHeight (MenuBarPeer bar);
native public void setMenuBarPeer (MenuBarPeer bar);
native public void removeMenuBarPeer (MenuBarPeer bar);
native void setMenuBarPeer (MenuBarPeer bar);
native void removeMenuBarPeer (MenuBarPeer bar);
public void setMenuBar (MenuBar bar)
{
@ -145,12 +145,13 @@ public class GtkFramePeer extends GtkWindowPeer
protected void postConfigureEvent (int x, int y, int width, int height)
{
int frame_x = x - insets.left;
// Add the height of the menubar (if none, menuBarHeight is 0 and has no
// effect). To move the frame down a bit so as to still fit in the window.
// Since insets.top includes the MenuBar height, we need to add back
// the MenuBar height to the frame's y position.
// If no MenuBar exists in this frame, the MenuBar height will be 0.
int frame_y = y - insets.top + menuBarHeight;
int frame_width = width + insets.left + insets.right;
// Add the height of the menubar to adjust the height so it still fits in
// the window.
// Ditto as above. Since insets.top already includes the MenuBar's height,
// we need to subtract the MenuBar's height from the top inset.
int frame_height = height + insets.top + insets.bottom - menuBarHeight;
if (frame_x != awtComponent.getX()
|| frame_y != awtComponent.getY()

View File

@ -410,7 +410,7 @@ Java_gnu_java_awt_peer_gtk_GtkFramePeer_setMenuBarPeer
JNIEXPORT jint JNICALL
Java_gnu_java_awt_peer_gtk_GtkFramePeer_getMenuBarHeight
(JNIEnv *env, jobject obj, jobject menubar)
(JNIEnv *env, jobject obj __attribute__((unused)), jobject menubar)
{
GtkWidget *ptr;
jint height;
@ -722,7 +722,8 @@ window_property_changed_cb (GtkWidget *widget __attribute__((unused)),
return FALSE;
}
static void menubar_resize_cb (GtkWidget *widget, GtkAllocation *alloc,
static void menubar_resize_cb (GtkWidget *widget __attribute__((unused)),
GtkAllocation *alloc __attribute__((unused)),
jobject peer)
{
static int id_set = 0;