/[classpath]/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
ViewVC logotype

Diff of /classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by mark, Tue Jan 22 22:27:02 2002 UTC revision 1.4 by tromey, Sun Nov 10 01:32:32 2002 UTC
# Line 1  Line 1 
1  /* gtkwindowpeer.c -- Native implementation of GtkWindowPeer  /* gtkwindowpeer.c -- Native implementation of GtkWindowPeer
2     Copyright (C) 1998, 1999 Free Software Foundation, Inc.     Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 41  exception statement from your version. * Line 41  exception statement from your version. *
41  #include "gnu_java_awt_peer_gtk_GtkFramePeer.h"  #include "gnu_java_awt_peer_gtk_GtkFramePeer.h"
42  #include <gdk/gdkprivate.h>  #include <gdk/gdkprivate.h>
43  #include <gdk/gdkx.h>  #include <gdk/gdkx.h>
44  void  
45  setBounds (GtkWidget *, jint, jint, jint, jint);  static void setBounds (GtkWidget *, jint, jint, jint, jint);
46    
47  /*  /*
48   * Make a new window (any type)   * Make a new window (any type)
# Line 133  setup_window (JNIEnv *env, jobject obj, Line 133  setup_window (JNIEnv *env, jobject obj,
133    set_visible (window, visible);    set_visible (window, visible);
134  }  }
135    
 JNIEXPORT void JNICALL  
 Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setMenuBarPeer  
   (JNIEnv *env, jobject obj, jobject menubar)  
 {  
   void *wptr, *mptr;  
   GtkBox *box;  
   
   if (!menubar) return;  
   
   wptr = NSA_GET_PTR (env, obj);  
   mptr = NSA_GET_PTR (env, menubar);  
   
   if (!mptr) return; /* this case should remove a menu */  
   
   gdk_threads_enter ();  
   box = GTK_BOX (GTK_BIN (wptr)->child);  
   gtk_box_pack_start (box, GTK_WIDGET (mptr), 0, 0, 0);  
   gdk_threads_leave ();  
 }  
   
   
136  /*  /*
137   * Set a frame's title   * Set a frame's title
138   */   */
# Line 230  Java_gnu_java_awt_peer_gtk_GtkWindowPeer Line 209  Java_gnu_java_awt_peer_gtk_GtkWindowPeer
209    gdk_threads_leave ();    gdk_threads_leave ();
210  }  }
211    
212  void  static void
213  setBounds (GtkWidget *widget, jint x, jint y, jint width, jint height)  setBounds (GtkWidget *widget, jint x, jint y, jint width, jint height)
214  {  {
215    gint current_x, current_y;    gint current_x, current_y;
# Line 250  setBounds (GtkWidget *widget, jint x, ji Line 229  setBounds (GtkWidget *widget, jint x, ji
229  JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setBounds  JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setBounds
230    (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)    (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height)
231  {  {
   GtkWidget *widget;  
   GList *children;  
232    void *ptr;    void *ptr;
233    
234    ptr = NSA_GET_PTR (env, obj);    ptr = NSA_GET_PTR (env, obj);
235    
236    gdk_threads_enter ();    gdk_threads_enter ();
237    
238    widget = GTK_WIDGET (ptr);    if (ptr)
239    setBounds (widget, x, y, width, height);      {
240          GtkWidget *widget = GTK_WIDGET (ptr);
241          setBounds (widget, x, y, width, height);
242        }
243    
244      gdk_threads_leave ();
245    }
246    
247    JNIEXPORT void JNICALL
248    Java_gnu_java_awt_peer_gtk_GtkFramePeer_setMenuBarPeer
249      (JNIEnv *env, jobject obj, jobject menubar)
250    {
251      void *wptr, *mptr;
252      GtkBox *box;
253    
254      if (!menubar) return;
255    
256      wptr = NSA_GET_PTR (env, obj);
257      mptr = NSA_GET_PTR (env, menubar);
258    
259      if (!mptr) return; /* this case should remove a menu */
260    
261      gdk_threads_enter ();
262      box = GTK_BOX (GTK_BIN (wptr)->child);
263      gtk_box_pack_start (box, GTK_WIDGET (mptr), 0, 0, 0);
264    gdk_threads_leave ();    gdk_threads_leave ();
265  }  }
266    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26