commit-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Patch: FYI: GtkToolkit image loading fixes


From: Thomas Fitzsimmons
Subject: Patch: FYI: GtkToolkit image loading fixes
Date: Sun, 25 Jan 2004 13:52:23 -0500

Hi,

I merged this patch from libgcj.

Tom

2004-01-25  Thomas Fitzsimmons  <address@hidden>

        * gnu/java/awt/peer/gtk/GtkToolkit.java (checkImage): Inform
        image observer of image loading status.
        (getImage (String)): Start image production.
        (getImage (URL)): Likewise.


Index: gnu/java/awt/peer/gtk/GtkToolkit.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java,v
retrieving revision 1.7
diff -u -r1.7 GtkToolkit.java
--- gnu/java/awt/peer/gtk/GtkToolkit.java       10 Jan 2004 21:32:23 -0000      
1.7
+++ gnu/java/awt/peer/gtk/GtkToolkit.java       23 Jan 2004 18:28:34 -0000
@@ -115,7 +115,15 @@
   public int checkImage (Image image, int width, int height, 
                         ImageObserver observer) 
   {
-    return ((GtkImage) image).checkImage ();
+    int status = ((GtkImage) image).checkImage ();
+
+    if (observer != null)
+      observer.imageUpdate (image, status,
+                            -1, -1,
+                            image.getWidth (observer),
+                            image.getHeight (observer));
+
+    return status;
   }
 
   public Image createImage (String filename)
@@ -166,12 +174,18 @@
 
   public Image getImage (String filename) 
   {
-    return new GtkImage (new GdkPixbufDecoder (filename), null);
+    GdkPixbufDecoder d = new GdkPixbufDecoder (filename);
+    GtkImage image = new GtkImage (d, null);
+    d.startProduction (image);
+    return image;
   }
 
   public Image getImage (URL url) 
   {
-    return new GtkImage (new GdkPixbufDecoder (url), null);
+    GdkPixbufDecoder d = new GdkPixbufDecoder (url);
+    GtkImage image = new GtkImage (d, null);
+    d.startProduction (image);
+    return image;
   }
 
   public PrintJob getPrintJob (Frame frame, String jobtitle, Properties props) 






reply via email to

[Prev in Thread] Current Thread [Next in Thread]