X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fplat%2FX11.java;h=113512bbbc51847a270b44a2af7bb324a13cbb13;hb=14be229c827cd4034184ea29d6653f6cbd969507;hp=b8652cb0b19f5165697415e93b4feb498473eb60;hpb=ef1df7045e76b9734691473fe31fba274a550903;p=org.ibex.core.git diff --git a/src/org/xwt/plat/X11.java b/src/org/xwt/plat/X11.java index b8652cb..113512b 100644 --- a/src/org/xwt/plat/X11.java +++ b/src/org/xwt/plat/X11.java @@ -33,7 +33,7 @@ public class X11 extends POSIX { protected String _getAltKeyName() { return System.getProperty("os.name", "").indexOf("SunOS") != -1 ? "Meta" : "Alt"; } - protected Picture _createPicture(int[] data, int w, int h) { return new X11Picture(data, w, h); } + protected Picture _createPicture() { return new X11Picture(); } protected PixelBuffer _createPixelBuffer(int w, int h, Surface owner) { return new X11PixelBuffer(w, h); } protected Surface _createSurface(Box b, boolean framed) { return new X11Surface(b, framed); } protected boolean _needsAutoClick() { return true; } @@ -62,7 +62,7 @@ public class X11 extends POSIX { Semaphore waitForCreation = new Semaphore(); public native void setInvisible(boolean i); - public void _setMaximized(boolean m) { if (Log.on) Log.log(this, "X11 can't maximize windows"); } + public void _setMaximized(boolean m) { if (Log.on) Log.warn(this, "X11 can't maximize windows"); } public native void setIcon(Picture p); public native void _setMinimized(boolean b); public native void setTitleBarText(String s); @@ -105,14 +105,14 @@ public class X11 extends POSIX { public int getWidth() { return width; } public int getHeight() { return height; } - public X11Picture(int[] data, int w, int h) { - this.data = data; - this.width = w; - this.height = h; + boolean initialized = false; + public void init() { + if (initialized) return; + initialized = true; boolean needsStipple = false; // if we have any non-0x00, non-0xFF alphas, we can't double buffer ourselves - for(int i=0; i= cx2 || cy1 >= cy2) return; - slowDrawPicture(source, dx, dy, cx1, cy1, cx2, cy2, rgb, true); + slowDrawPicture(((DefaultGlyph)source).getPicture(), dx, dy, cx1, cy1, cx2, cy2, rgb, true); } public void drawPicture(Picture source, int dx, int dy, int cx1, int cy1, int cx2, int cy2) { cx1 = Math.max(dx, cx1); cy1 = Math.max(dy, cy1); - cx2 = Math.min(dx + width, cx2); - cy2 = Math.min(dy + height, cy2); + cx2 = Math.min(dx + source.width, cx2); + cy2 = Math.min(dy + source.height, cy2); if (cx1 >= cx2 || cy1 >= cy2) return; + ((X11Picture)source).init(); if (((X11Picture)source).doublebuf != null) fastDrawPicture(source, dx, dy, cx1, cy1, cx2, cy2); else