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

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

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

revision 1.25.2.5 by gnu_andrew, Wed Feb 16 01:11:40 2005 UTC revision 1.25.2.6 by gnu_andrew, Sun Jun 5 19:36:36 2005 UTC
# Line 166  public class GtkFramePeer extends GtkWin Line 166  public class GtkFramePeer extends GtkWin
166      setIconImage(frame.getIconImage());      setIconImage(frame.getIconImage());
167    }    }
168    
169    native void nativeSetIconImageFromDecoder (GdkPixbufDecoder decoder);    native void nativeSetIconImage (GtkImage image);
170    native void nativeSetIconImageFromData (int[] pixels, int width, int height);  
171    public void setIconImage (Image image)    public void setIconImage (Image image)
172    {    {
173        if (image != null && image instanceof GtkImage)        if (image != null)
174          {          {
175            GtkImage img = (GtkImage) image;            if (image instanceof GtkImage)
176            // FIXME: Image should be loaded, but if not, do image loading here.              nativeSetIconImage((GtkImage) image);
177            if (img.isLoaded())            else
178              {              nativeSetIconImage(new GtkImage(image.getSource()));
179                if (img.getSource() instanceof GdkPixbufDecoder)          }
                 {  
                   nativeSetIconImageFromDecoder((GdkPixbufDecoder) img.getSource());  
                 }  
               else  
                 {  
                   int[] pixels = img.getPixelCache();  
                   ColorModel model = img.getColorModel();  
                   int[] data = new int[pixels.length * 4];  
                   for (int i = 0; i < pixels.length; i++)  
                     {  
                       data[i * 4] = model.getRed(pixels[i]);  
                       data[i * 4 + 1] = model.getGreen(pixels[i]);  
                       data[i * 4 + 2] = model.getBlue(pixels[i]);  
                       data[i * 4 + 3] = model.getAlpha(pixels[i]);  
                     }  
                   nativeSetIconImageFromData(data, img.getWidth(null), img.getHeight(null));  
                 }  
             }  
         }  
180    }    }
181    
182    public Graphics getGraphics ()    public Graphics getGraphics ()

Legend:
Removed from v.1.25.2.5  
changed lines
  Added in v.1.25.2.6

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