1 // Copyright 2002 Adam Megacz, see the COPYING file for licensing [GPL]
6 * A block of pixels which can be drawn on and rapidly copied to the
7 * screen. Drawing operations are performed on this class; it is
8 * then rendered to the screen with Surface.blit().
12 * Implementations of the Platform class should return objects
13 * supporting this interface from the _createDoubleBuffer()
14 * method. These implementations may choose to use off-screen video
15 * ram for this purpose (for example, a Pixmap on X11).
19 * A note on coordinates: all members on DoubleBuffer specify
20 * coordinates in terms of x1,y1,x2,y2 even though the Box class
21 * represents regions internally as x,y,w,h.
24 public interface DoubleBuffer {
26 /** Draw the region of source within (sx1, sy1, sx2, sy2) onto the region of this DoubleBuffer within (dx1, dy1, dx2, dy2), scaling as needed. */
27 public void drawPicture(Picture source, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2);
29 /** Draw source onto this DoubleBuffer at (x,y) */
30 public void drawPicture(Picture source, int x, int y);
32 /** Draw <tt>text</tt> in <tt>font</tt> and <tt>color</tt> on this DoubleBuffer, with the upper left corner of the text at (x, y) */
33 public void drawString(String font, String text, int x, int y, int color);
35 /** Fill the region (x1, y1, x2, y2) with <tt>color</tt> (AARRGGBB format); the alpha channel component is ignored */
36 public void fillRect(int x1, int y1, int x2, int y2, int color);
38 /** Sets the clip region for this DoubleBuffer to (x,y,x2,y2) */
39 public void setClip(int x, int y, int x2, int y2);
41 public int getHeight();
42 public int getWidth();