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

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

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

revision 1.70.2.10 by gnu_andrew, Tue Aug 16 16:22:36 2005 UTC revision 1.70.2.11 by gnu_andrew, Sat Sep 10 15:31:37 2005 UTC
# Line 70  import java.awt.image.ImageObserver; Line 70  import java.awt.image.ImageObserver;
70  import java.awt.image.ImageProducer;  import java.awt.image.ImageProducer;
71  import java.awt.image.VolatileImage;  import java.awt.image.VolatileImage;
72  import java.awt.peer.ComponentPeer;  import java.awt.peer.ComponentPeer;
73    import java.awt.peer.ContainerPeer;
74  import java.util.Timer;  import java.util.Timer;
75  import java.util.TimerTask;  import java.util.TimerTask;
76    
# Line 99  public class GtkComponentPeer extends Gt Line 100  public class GtkComponentPeer extends Gt
100    native void gtkWidgetGetPreferredDimensions (int[] dim);    native void gtkWidgetGetPreferredDimensions (int[] dim);
101    native void gtkWidgetGetLocationOnScreen (int[] point);    native void gtkWidgetGetLocationOnScreen (int[] point);
102    native void gtkWidgetSetCursor (int type);    native void gtkWidgetSetCursor (int type);
103      native void gtkWidgetSetCursorUnlocked (int type);
104    native void gtkWidgetSetBackground (int red, int green, int blue);    native void gtkWidgetSetBackground (int red, int green, int blue);
105    native void gtkWidgetSetForeground (int red, int green, int blue);    native void gtkWidgetSetForeground (int red, int green, int blue);
106    native void gtkWidgetSetSensitive (boolean sensitive);    native void gtkWidgetSetSensitive (boolean sensitive);
# Line 422  public class GtkComponentPeer extends Gt Line 424  public class GtkComponentPeer extends Gt
424      int new_y = y;      int new_y = y;
425    
426      Component parent = awtComponent.getParent ();      Component parent = awtComponent.getParent ();
427        Component next_parent;
428    
429      // Heavyweight components that are children of one or more      // Heavyweight components that are children of one or more
430      // lightweight containers have to be handled specially.  Because      // lightweight containers have to be handled specially.  Because
# Line 439  public class GtkComponentPeer extends Gt Line 442  public class GtkComponentPeer extends Gt
442        {        {
443          lightweightChild = true;          lightweightChild = true;
444    
445            next_parent = parent.getParent ();
446    
447          i = ((Container) parent).getInsets ();          i = ((Container) parent).getInsets ();
448    
449          new_x += parent.getX () + i.left;          if (next_parent instanceof Window)
450          new_y += parent.getY () + i.top;            {
451                new_x += i.left;
452                new_y += i.top;
453              }
454            else
455              {
456                new_x += parent.getX () + i.left;
457                new_y += parent.getY () + i.top;
458              }
459    
460          parent = parent.getParent ();          parent = next_parent;
461        }        }
462    
463      // We only need to convert from Java to GTK coordinates if we're      // We only need to convert from Java to GTK coordinates if we're
# Line 476  public class GtkComponentPeer extends Gt Line 489  public class GtkComponentPeer extends Gt
489    
490    public void setCursor (Cursor cursor)    public void setCursor (Cursor cursor)
491    {    {
492      gtkWidgetSetCursor (cursor.getType ());      if (Thread.currentThread() == GtkToolkit.mainThread)
493          gtkWidgetSetCursorUnlocked (cursor.getType ());
494        else
495          gtkWidgetSetCursor (cursor.getType ());
496    }    }
497    
498    public void setEnabled (boolean b)    public void setEnabled (boolean b)
# Line 509  public class GtkComponentPeer extends Gt Line 525  public class GtkComponentPeer extends Gt
525      return new Color (rgb[0], rgb[1], rgb[2]);      return new Color (rgb[0], rgb[1], rgb[2]);
526    }    }
527    
528      public native void setVisibleNative (boolean b);
529      public native void setVisibleNativeUnlocked (boolean b);
530    
531    public void setVisible (boolean b)    public void setVisible (boolean b)
532    {    {
533      if (b)      if (Thread.currentThread() == GtkToolkit.mainThread)
534        show ();        setVisibleNativeUnlocked (b);
535      else      else
536        hide ();        setVisibleNative (b);
537    }    }
538    
539    public native void hide ();    public void hide ()
540    public native void show ();    {
541        setVisible (false);
542      }
543    
544      public void show ()
545      {
546        setVisible (true);
547      }
548    
549    protected void postMouseEvent(int id, long when, int mods, int x, int y,    protected void postMouseEvent(int id, long when, int mods, int x, int y,
550                                  int clickCount, boolean popupTrigger)                                  int clickCount, boolean popupTrigger)
# Line 683  public class GtkComponentPeer extends Gt Line 709  public class GtkComponentPeer extends Gt
709    {    {
710      return "peer of " + awtComponent.toString();      return "peer of " + awtComponent.toString();
711    }    }
712      public Rectangle getBounds()
713      {
714          // FIXME: implement
715        return null;
716      }
717      public void reparent(ContainerPeer parent)
718      {
719        // FIXME: implement
720      
721      }
722      public void setBounds(int x, int y, int width, int height, int z)
723      {
724        // FIXME: implement
725          setBounds (x, y, width, height);
726      
727      }
728      public boolean isReparentSupported()
729      {
730        // FIXME: implement
731    
732        return false;
733      }
734      public void layout()
735      {
736        // FIXME: implement
737    
738      }
739  }  }

Legend:
Removed from v.1.70.2.10  
changed lines
  Added in v.1.70.2.11

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