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

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

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

revision 1.10 by tromey, Sun Nov 10 07:59:05 2002 UTC revision 1.11 by tromey, Fri Nov 15 03:05:11 2002 UTC
# Line 40  package gnu.java.awt.peer.gtk; Line 40  package gnu.java.awt.peer.gtk;
40  import java.awt.*;  import java.awt.*;
41  import java.awt.event.*;  import java.awt.event.*;
42    
 /* This class will go away with Japhar integration.  For use with Sun's JDK  
    this may be required, unless another method of associating Java objects  
    with GTK objects is used. */  
   
43  public class GtkGenericPeer  public class GtkGenericPeer
44  {  {
45    // FIXME: this isn't guaranteed to give unique numbers.    final int native_state = getUniqueInteger ();
46    final int native_state = java.lang.System.identityHashCode(this);  
47      // Next native state value we will assign.
48      private static int next_native_state = 0;
49    
50      // The widget or other java-side object we wrap.
51    protected Object awtWidget;    protected Object awtWidget;
52    
53      // Global event queue.
54    protected static EventQueue q = null;    protected static EventQueue q = null;
55    
56      // Dispose of our native state.
57      public native void dispose ();
58    
59    protected GtkGenericPeer (Object awtWidget)    protected GtkGenericPeer (Object awtWidget)
60    {    {
61      this.awtWidget = awtWidget;      this.awtWidget = awtWidget;
# Line 67  public class GtkGenericPeer Line 72  public class GtkGenericPeer
72      q.postEvent (new ActionEvent (awtWidget, ActionEvent.ACTION_PERFORMED,      q.postEvent (new ActionEvent (awtWidget, ActionEvent.ACTION_PERFORMED,
73                                    command, mods));                                    command, mods));
74    }    }
75    
76      // Return a unique integer for use in the native state mapping
77      // code.  We can't use a hash code since that is not guaranteed to
78      // be unique.
79      private static synchronized int getUniqueInteger ()
80      {
81        // Let's assume this will never wrap.
82        return next_native_state++;
83      }
84  }  }

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

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