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); |
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 |
|
|
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 |
|
|
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 |
|
|
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 |
|
|
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; |