-// Copyright 2002 Adam Megacz, see the COPYING file for licensing [GPL]
+// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
package org.xwt;
import org.bouncycastle.util.encoders.Base64;
/** Sets the surface's x and y position. */
public abstract void setLocation(int x, int y);
+ public void setLocation() { setLocation(root.x, root.y); }
/** Sets the surface's title bar text, if applicable */
public abstract void setTitleBarText(String s);
public abstract void setIcon(Picture i);
/** copies a region from the doublebuffer to this surface */
- public abstract void blit(DoubleBuffer source, int sx, int sy, int dx, int dy, int dx2, int dy2);
+ public abstract void blit(PixelBuffer source, int sx, int sy, int dx, int dy, int dx2, int dy2);
/** Destroy the surface */
public abstract void _dispose();
outer: for(int i=0; i<keywatchers.size(); i++) {
Box b = (Box)keywatchers.elementAt(i);
for(Box cur = b; cur != null; cur = cur.getParent())
- if (cur.invisible) continue outer;
+ if ((cur.flags & cur.INVISIBLE_FLAG) != 0) continue outer;
b.put("KeyPressed", key);
}
Platform.clipboardReadEnabled = false;
outer: for(int i=0; i<keywatchers.size(); i++) {
Box b = (Box)keywatchers.elementAt(i);
for(Box cur = b; cur != null; cur = cur.getParent())
- if (cur.invisible) continue outer;
+ if ((cur.flags & cur.INVISIBLE_FLAG) != 0) continue outer;
b.put("KeyReleased", key);
}
}});
// Private Instance Data /////////////////////////////////////////////////////////////////////////////////////////////
/** The automatic double buffer for the root box */
- DoubleBuffer backbuffer = null;
+ PixelBuffer backbuffer = null;
/** Dirty regions on the backbuffer which need to be rebuilt using Box.render() */
private DirtyList backbufferDirtyRegions = new DirtyList();
static volatile boolean abort = false;
/** a solid red 10x10 double buffer */
- private DoubleBuffer showRenderBuf = null;
+ private PixelBuffer showRenderBuf = null;
/** a striped 100x100 double buffer */
- private DoubleBuffer showRenderBuf2 = null;
+ private PixelBuffer showRenderBuf2 = null;
/** true iff this window should be scarred */
private boolean scarred = true;
} while(abort);
// this is a bit dangerous since we're passing ourselves to another method before subclasses' ctors have run...
- backbuffer = Platform.createDoubleBuffer(Platform.getScreenWidth(), Platform.getScreenHeight(), this);
+ backbuffer = Platform.createPixelBuffer(Platform.getScreenWidth(), Platform.getScreenHeight(), this);
root.dirty();
Refresh();
if (Main.showRenders) {
if (showRenderBuf == null) {
- showRenderBuf = Platform.createDoubleBuffer(10, 10, this);
+ showRenderBuf = Platform.createPixelBuffer(10, 10, this);
showRenderBuf.fillRect(0, 0, 10, 10, 0x00FF0000);
- showRenderBuf2 = Platform.createDoubleBuffer(100, 100, this);
+ showRenderBuf2 = Platform.createPixelBuffer(100, 100, this);
for(int y1 = 0; y1<100; y1++)
for(int x1 = 0; x1<100; x1++)
if ((x1 + y1) % 5 == 0)