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

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

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

revision 1.54.2.10 by gnu_andrew, Tue Aug 16 16:22:36 2005 UTC revision 1.54.2.11 by gnu_andrew, Sat Sep 10 15:31:38 2005 UTC
# Line 88  public class GtkToolkit extends gnu.java Line 88  public class GtkToolkit extends gnu.java
88  {  {
89    Hashtable containers = new Hashtable();    Hashtable containers = new Hashtable();
90    static EventQueue q;    static EventQueue q;
   static Clipboard systemClipboard;  
91    static boolean useGraphics2dSet;    static boolean useGraphics2dSet;
92    static boolean useGraphics2d;    static boolean useGraphics2d;
93      static Thread mainThread;
94    
95    public static boolean useGraphics2D()    public static boolean useGraphics2D()
96    {    {
# Line 122  public class GtkToolkit extends gnu.java Line 122  public class GtkToolkit extends gnu.java
122    
123      gtkInit(portableNativeSync);      gtkInit(portableNativeSync);
124    
125      // Register ImageIO SPIs      mainThread = new Thread ("GTK main thread")
126      GdkPixbufDecoder.registerSpis( IIORegistry.getDefaultInstance() );        {
127            public void run ()
128            {
129              gtkMain ();
130            }
131          };
132        mainThread.start ();
133    }    }
134    
135    public GtkToolkit ()    public GtkToolkit ()
136    {    {
     systemClipboard = new GtkClipboard ();  
137    }    }
138    
139    public native void beep();    public native void beep();
# Line 247  public class GtkToolkit extends gnu.java Line 252  public class GtkToolkit extends gnu.java
252    
253    public Image createImage (String filename)    public Image createImage (String filename)
254    {    {
255        if (filename.length() == 0)
256          return new GtkImage ();
257    
258      if (useGraphics2D())      if (useGraphics2D())
259        return bufferedImageOrError(GdkPixbufDecoder.createBufferedImage (filename));        return bufferedImageOrError(GdkPixbufDecoder.createBufferedImage (filename));
260      else      else
# Line 258  public class GtkToolkit extends gnu.java Line 266  public class GtkToolkit extends gnu.java
266      if (useGraphics2D())      if (useGraphics2D())
267        return bufferedImageOrError(GdkPixbufDecoder.createBufferedImage (url));        return bufferedImageOrError(GdkPixbufDecoder.createBufferedImage (url));
268      else      else
269        {        return new GtkImage (url);
         GdkPixbufDecoder d = new GdkPixbufDecoder (url);  
         GtkImage image = new GtkImage (d);  
         return image;          
       }  
270    }    }
271    
272    public Image createImage (ImageProducer producer)    public Image createImage (ImageProducer producer)
# Line 282  public class GtkToolkit extends gnu.java Line 286  public class GtkToolkit extends gnu.java
286                                                                          imagelength));                                                                          imagelength));
287      else      else
288        {        {
289          GdkPixbufDecoder d = new GdkPixbufDecoder (imagedata,          byte[] datacopy = new byte[imagelength];
290                                                     imageoffset,          System.arraycopy (imagedata, imageoffset, datacopy, 0, imagelength);
291                                                     imagelength);          return new GtkImage (datacopy);
         GtkImage image = new GtkImage (d);  
         return image;          
292        }        }
293    }    }
294        
# Line 398  public class GtkToolkit extends gnu.java Line 400  public class GtkToolkit extends gnu.java
400    
401    public Clipboard getSystemClipboard()    public Clipboard getSystemClipboard()
402    {    {
403      return systemClipboard;      SecurityManager secman = System.getSecurityManager();
404        if (secman != null)
405          secman.checkSystemClipboardAccess();
406    
407        return GtkClipboard.getInstance();
408    }    }
409    
410    /**    /**
# Line 631  public class GtkToolkit extends gnu.java Line 637  public class GtkToolkit extends gnu.java
637    
638    public GraphicsEnvironment getLocalGraphicsEnvironment()    public GraphicsEnvironment getLocalGraphicsEnvironment()
639    {    {
640      return new GdkGraphicsEnvironment(this);      return new GdkGraphicsEnvironment();
641    }    }
642    
643    public Font createFont(int format, InputStream stream)    public Font createFont(int format, InputStream stream)
# Line 644  public class GtkToolkit extends gnu.java Line 650  public class GtkToolkit extends gnu.java
650      return new GdkRobotPeer (screen);      return new GdkRobotPeer (screen);
651    }    }
652    
653    public native boolean nativeQueueEmpty();    public void registerImageIOSpis(IIORegistry reg)
654    public native void wakeNativeQueue();      {
655    public native void iterateNativeQueue(EventQueue locked, boolean block);      GdkPixbufDecoder.registerSpis(reg);
656      }
657    
658      public static native void gtkMain();
659  } // class GtkToolkit  } // class GtkToolkit

Legend:
Removed from v.1.54.2.10  
changed lines
  Added in v.1.54.2.11

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