/[classpath]/classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java
ViewVC logotype

Diff of /classpath/gnu/java/awt/peer/gtk/GtkWindowPeer.java

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

revision 1.23 by fitzsim, Thu Oct 9 00:34:16 2003 UTC revision 1.24 by fitzsim, Fri Oct 24 19:54:22 2003 UTC
# Line 42  import java.awt.Component; Line 42  import java.awt.Component;
42  import java.awt.Dimension;  import java.awt.Dimension;
43  import java.awt.Insets;  import java.awt.Insets;
44  import java.awt.Window;  import java.awt.Window;
45    import java.awt.Frame;
46    import java.awt.event.WindowEvent;
47  import java.awt.peer.WindowPeer;  import java.awt.peer.WindowPeer;
48    
49  public class GtkWindowPeer extends GtkContainerPeer  public class GtkWindowPeer extends GtkContainerPeer
# Line 56  public class GtkWindowPeer extends GtkCo Line 58  public class GtkWindowPeer extends GtkCo
58    static protected final int GDK_WINDOW_TYPE_HINT_DOCK = 6;    static protected final int GDK_WINDOW_TYPE_HINT_DOCK = 6;
59    static protected final int GDK_WINDOW_TYPE_HINT_DESKTOP = 7;    static protected final int GDK_WINDOW_TYPE_HINT_DESKTOP = 7;
60    
61      private boolean hasBeenShown = false;
62      private int oldState = Frame.NORMAL;
63    
64    // Unfortunately, X does not provide a clean way to calculate the    // Unfortunately, X does not provide a clean way to calculate the
65    // dimensions of a window's borders before it has been displayed.    // dimensions of a window's borders before it has been displayed.
66    // So when creating the application's first window we guess the    // So when creating the application's first window we guess the
# Line 211  public class GtkWindowPeer extends GtkCo Line 216  public class GtkWindowPeer extends GtkCo
216                   awtComponent.getHeight());                   awtComponent.getHeight());
217      nativeSetVisible (b);      nativeSetVisible (b);
218    }    }
219    
220      void postWindowEvent (int id, Window opposite, int newState)
221      {
222        if (id == WindowEvent.WINDOW_OPENED)
223          {
224            // Post a WINDOW_OPENED event the first time this window is shown.
225            if (!hasBeenShown)
226              {
227                q.postEvent (new WindowEvent ((Window) awtComponent, id,
228                                              opposite));
229                hasBeenShown = true;
230              }
231          }
232        else if (id == WindowEvent.WINDOW_STATE_CHANGED)
233          {
234            if (oldState != newState)
235              {
236                q.postEvent (new WindowEvent ((Window) awtComponent, id, opposite,
237                                              oldState, newState));
238                oldState = newState;
239              }
240          }
241        else
242          q.postEvent (new WindowEvent ((Window) awtComponent, id, opposite));
243      }
244  }  }

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

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