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

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

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

revision 1.27.2.3 by gnu_andrew, Sat Jan 15 17:01:40 2005 UTC revision 1.27.2.4 by gnu_andrew, Sun Jan 16 15:15:01 2005 UTC
# Line 127  public class GdkGraphics extends Graphic Line 127  public class GdkGraphics extends Graphic
127      return new GdkGraphics (this);      return new GdkGraphics (this);
128    }    }
129    
 //    public Graphics create (int x, int y, int width, int height)  
 //    {  
 //      GdkGraphics g = new GdkGraphics (this);  
 //      g.translate (x, y);  
 //      g.clipRect (0, 0, width, height);  
   
 //      return g;  
 //    }  
     
130    native public void dispose ();    native public void dispose ();
131    
132    native void copyPixmap (Graphics g, int x, int y, int width, int height);    native void copyPixmap (Graphics g, int x, int y, int width, int height);
# Line 152  public class GdkGraphics extends Graphic Line 143  public class GdkGraphics extends Graphic
143    
144      if (img instanceof GtkOffScreenImage)      if (img instanceof GtkOffScreenImage)
145        {        {
146            int width = img.getWidth (null);
147            int height = img.getHeight (null);
148          copyPixmap (img.getGraphics (),          copyPixmap (img.getGraphics (),
149                      x, y, img.getWidth (null), img.getHeight (null));                      x, y, width, height);
150            // FIXME: need to differentiate between SOMEBITS and FRAMEBITS.
151            if (observer != null)
152              observer.imageUpdate (img,
153                                    ImageObserver.FRAMEBITS,
154                                    x, y, width, height);
155          return true;          return true;
156        }        }
157    
158      GtkImage image = (GtkImage) img;      GtkImage image = (GtkImage) img;
159      new GtkImagePainter (image, this, x, y, -1, -1, bgcolor);      new GtkImagePainter (image, this, x, y, -1, -1, bgcolor, observer);
160      return image.isLoaded ();      return image.isLoaded ();
161    }    }
162    
# Line 169  public class GdkGraphics extends Graphic Line 167  public class GdkGraphics extends Graphic
167    
168      if (img instanceof GtkOffScreenImage)      if (img instanceof GtkOffScreenImage)
169        {        {
170            int width = img.getWidth (null);
171            int height = img.getHeight (null);
172          copyPixmap (img.getGraphics (),          copyPixmap (img.getGraphics (),
173                      x, y, img.getWidth (null), img.getHeight (null));                      x, y, width, height);
174    
175            // FIXME: need to differentiate between SOMEBITS and FRAMEBITS.
176            if (observer != null)
177              observer.imageUpdate (img,
178                                    ImageObserver.FRAMEBITS,
179                                    x, y, width, height);
180          return true;          return true;
181        }        }
182    
# Line 191  public class GdkGraphics extends Graphic Line 197  public class GdkGraphics extends Graphic
197          copyAndScalePixmap (img.getGraphics (), false, false,          copyAndScalePixmap (img.getGraphics (), false, false,
198                              0, 0, img.getWidth (null), img.getHeight (null),                              0, 0, img.getWidth (null), img.getHeight (null),
199                              x, y, width, height);                              x, y, width, height);
200            // FIXME: need to differentiate between SOMEBITS and FRAMEBITS.
201            if (observer != null)
202              observer.imageUpdate (img,
203                                    ImageObserver.FRAMEBITS,
204                                    x, y, width, height);
205          return true;          return true;
206        }        }
207    
208      GtkImage image = (GtkImage) img;      GtkImage image = (GtkImage) img;
209      new GtkImagePainter (image, this, x, y, width, height, bgcolor);      new GtkImagePainter (image, this, x, y, width, height, bgcolor, observer);
210      return image.isLoaded ();      return image.isLoaded ();
211    }    }
212    
# Line 275  public class GdkGraphics extends Graphic Line 286  public class GdkGraphics extends Graphic
286          copyAndScalePixmap (img.getGraphics (), x_flip, y_flip,          copyAndScalePixmap (img.getGraphics (), x_flip, y_flip,
287                              sx_start, sy_start, s_width, s_height,                              sx_start, sy_start, s_width, s_height,
288                              dx_start, dy_start, d_width, d_height);                              dx_start, dy_start, d_width, d_height);
289    
290            // FIXME: need to differentiate between SOMEBITS and FRAMEBITS.
291            if (observer != null)
292              observer.imageUpdate (img,
293                                    ImageObserver.FRAMEBITS,
294                                    dx_start, dy_start, d_width, d_height);
295          return true;          return true;
296        }        }
297    
298      GtkImage image = (GtkImage) img;      GtkImage image = (GtkImage) img;
299      new GtkImagePainter (image, this, dx1, dy1, dx2, dy2,      new GtkImagePainter (image, this, dx1, dy1, dx2, dy2,
300                           sx1, sy1, sx2, sy2, bgcolor);                           sx1, sy1, sx2, sy2, bgcolor, observer);
301      return image.isLoaded ();      return image.isLoaded ();
302    }    }
303    
# Line 409  public class GdkGraphics extends Graphic Line 426  public class GdkGraphics extends Graphic
426    
427    public void setClip (int x, int y, int width, int height)    public void setClip (int x, int y, int width, int height)
428    {    {
429      if (component != null && ! component.isRealized ())      if ((component != null && ! component.isRealized ())
430            || clip == null)
431        return;        return;
432    
433      clip.x = x;      clip.x = x;

Legend:
Removed from v.1.27.2.3  
changed lines
  Added in v.1.27.2.4

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