#include <org/xwt/plat/X11.h>
#include <org/xwt/plat/X11$X11Surface.h>
#include <org/xwt/plat/X11$X11Picture.h>
-#include <org/xwt/plat/X11$X11DoubleBuffer.h>
+#include <org/xwt/plat/X11$X11PixelBuffer.h>
#include <org/xwt/util/Semaphore.h>
#include <org/xwt/Platform.h>
#include <java/lang/Long.h>
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) < (b) ? (b) : (a))
-// X11DoubleBuffer //////////////////////////////////////////////////////////////////////
+// X11PixelBuffer //////////////////////////////////////////////////////////////////////
// ensures that the shared memory is at least size bytes; if not, allocates 3/2 * size
static void ensureShmSize(int size) {
}
}
-void org::xwt::plat::X11$X11DoubleBuffer::fastDrawPicture(org::xwt::Picture* s,
+void org::xwt::plat::X11$X11PixelBuffer::fastDrawPicture(org::xwt::Picture* s,
jint dx1, jint dy1, jint dx2, jint dy2, jint sx1, jint sy1, jint sx2, jint sy2) {
org::xwt::plat::X11$X11Picture* source = (org::xwt::plat::X11$X11Picture*)s;
XCopyArea(display, *((Pixmap*)source->doublebuf->pm), (*((Pixmap*)pm)), (*((GC*)clipped_gc)), sx1, sy1, sx2 - sx1, sy2 - sy1, dx1, dy1);
}
-void org::xwt::plat::X11$X11DoubleBuffer::slowDrawPicture(org::xwt::Picture* s,
+void org::xwt::plat::X11$X11PixelBuffer::slowDrawPicture(org::xwt::Picture* s,
jint dx1, jint dy1, jint dx2, jint dy2, jint sx1, jint sy1, jint sx2, jint sy2) {
org::xwt::plat::X11$X11Picture* source = (org::xwt::plat::X11$X11Picture*)s;
}
}
-void org::xwt::plat::X11$X11DoubleBuffer::finalize() {
+void org::xwt::plat::X11$X11PixelBuffer::finalize() {
if (shared_pixmap) {
XShmSegmentInfo *sinfo = (XShmSegmentInfo*)shm_segment;
XShmDetach(display, sinfo);
XFreeGC(display, *((GC*)clipped_gc));
}
-void org::xwt::plat::X11$X11DoubleBuffer::natInit() {
+void org::xwt::plat::X11$X11PixelBuffer::natInit() {
if (width == 0 || height == 0) return;
shared_pixmap &= shm_supported & shm_pixmaps_supported; // refuse to use shared pixmaps if we don't have shm
XChangeGC(display, (*((GC*)clipped_gc)), GCGraphicsExposures, &vm);
}
-void org::xwt::plat::X11$X11DoubleBuffer::createStipple(org::xwt::plat::X11$X11Picture* xpi) {
+void org::xwt::plat::X11$X11PixelBuffer::createStipple(org::xwt::plat::X11$X11Picture* xpi) {
stipple = (gnu::gcj::RawData*)malloc(sizeof(Pixmap));
(*((Pixmap*)stipple)) = XCreatePixmap(display, RootWindow(display, screen_num), width, height, 1);
XPutImage(display, (*((Pixmap*)stipple)), stipple_gc, &xi, 0, 0, 0, 0, width, height);
}
-void org::xwt::plat::X11$X11Surface::blit(org::xwt::DoubleBuffer* db, jint sx, jint sy, jint dx, jint dy, jint dx2, jint dy2) {
- org::xwt::plat::X11$X11DoubleBuffer *xdb = (org::xwt::plat::X11$X11DoubleBuffer*)db;
+void org::xwt::plat::X11$X11Surface::blit(org::xwt::PixelBuffer* db, jint sx, jint sy, jint dx, jint dy, jint dx2, jint dy2) {
+ org::xwt::plat::X11$X11PixelBuffer *xdb = (org::xwt::plat::X11$X11DoubleBuffer*)db;
XCopyArea(display, *((Pixmap*)xdb->pm), *((Window*)window), *((GC*)gc), sx, sy, dx2 - dx, dy2 - dy, dx, dy);
XFlush(display);
}
-void org::xwt::plat::X11$X11DoubleBuffer::fillRect (jint x, jint y, jint x2, jint y2, jint argb) {
+void org::xwt::plat::X11$X11PixelBuffer::fillRect (jint x, jint y, jint x2, jint y2, jint argb) {
jint w = x2 - x;
jint h = y2 - y;
XFillRectangle(display, (*((Pixmap*)pm)), (*((GC*)gc)), x, y, w, h);
}
-void org::xwt::plat::X11$X11DoubleBuffer::drawString(::java::lang::String* font, ::java::lang::String* text, jint x, jint y, jint argb) {
+void org::xwt::plat::X11$X11PixelBuffer::drawString(::java::lang::String* font, ::java::lang::String* text, jint x, jint y, jint argb) {
XRectangle rect;
rect.x = clipx, rect.y = clipy; rect.width = clipw; rect.height = cliph;
void org::xwt::plat::X11$X11Surface::setIcon(org::xwt::Picture* pic) {
org::xwt::plat::X11$X11Picture* p = ((org::xwt::plat::X11$X11Picture*)pic);
- org::xwt::plat::X11$X11DoubleBuffer* old_dbuf = p->doublebuf;
- p->buildDoubleBuffer(1);
+ org::xwt::plat::X11$X11PixelBuffer* old_dbuf = p->doublebuf;
+ p->buildPixelBuffer(1);
XWMHints xwmh;
memset(&xwmh, 0, sizeof(XWMHints));
xwmh.flags |= IconPixmapHint | IconMaskHint;