{ import } { import } XDisplay : Object ( _display ) XDisplay _open: _displayName { struct t_XDisplay *this= (struct t_XDisplay *)self; this->_display= (oop)XOpenDisplay((char *)v__displayName); } XDisplay _defaultRootWindow { return (oop)DefaultRootWindow((Display *)((struct t_XDisplay *)self)->_display); } XDisplay _defaultGraphicsContext { return (oop)DefaultGC((Display *)((struct t_XDisplay *)self)->_display, DefaultScreen((Display *)((struct t_XDisplay *)self)->_display)); } XDisplay _createSimpleWindowParent: _parent x: _x y: _y width: _w height: _h borderWidth: _borderWidth border: _borderPixel background: _backgroundPixel { return (oop)XCreateSimpleWindow((Display *)(((struct t_XDisplay *)self)->_display), (Window)v__parent, (int)v__x, (int)v__y, (int)v__w, (int)v__h, (int)v__borderWidth, (int)v__borderPixel, (int)v__backgroundPixel); } XDisplay _changeWindow: _window attributes: attributes _mask: _valueMask { XChangeWindowAttributes((Display *)((struct t_XDisplay *)self)->_display, (Window)v__window, (unsigned long)v__valueMask, (XSetWindowAttributes *)v_attributes); } XDisplay _map: _window { XMapWindow((Display *)((struct t_XDisplay *)self)->_display, (Window)v__window); } XDisplay synchronise { XSync((Display *)((struct t_XDisplay *)self)->_display, False); } XDisplay _pending { return (oop)XPending((Display *)((struct t_XDisplay *)self)->_display); } XDisplay _nextEvent: _eventReturn { XNextEvent((Display *)((struct t_XDisplay *)self)->_display, (XEvent *)v__eventReturn); } XDisplay _windowEvent: _window mask: _eventMask into: _anEvent { XWindowEvent((Display *)((struct t_XDisplay *)self)->_display, (Window)v__window, (long)v__eventMask, (XEvent *)v__anEvent); } XDisplay _checkWindowEvent: _window mask: _eventMask into: _anEvent { return (XCheckWindowEvent((Display *)((struct t_XDisplay *)self)->_display, (Window)v__window, (long)v__eventMask, (XEvent *)v__anEvent) == True) ? v_true : v_false; } XDisplay _drawPoint: _window gc: _gc x: _x y: _y { XDrawPoint((Display *)((struct t_XDisplay *)self)->_display, (Window)v__window, (GC)v__gc, (int)v__x, (int)v__y); } XDisplay _drawString: _window gc: _gc x: _x y: _y string: _string size: _size { XDrawString((Display *)((struct t_XDisplay *)self)->_display, (Window)v__window, (GC)v__gc, (int)v__x, (int)v__y, (char *)v__string, (int)v__size); } XDisplay _drawBitmap: _window gc: _gc x: _x y: _y bits: _bits width: _w height: _h clipX: _clipX clipY: _clipY clipW: _clipW clipH: _clipH { struct t_XDisplay *this= (struct t_XDisplay *)self; Display *dpy= (Display *)this->_display; XImage *image= XCreateImage(dpy, DefaultVisual(dpy, DefaultScreen(dpy)), 24, ZPixmap, 0, (char *)v__bits, (int)v__w, (int)v__h, 32, 0); XPutImage((Display *)this->_display, (Window)v__window, (GC)v__gc, image, (int)v__clipX, (int)v__clipY, (int)v__clipX, (int)v__clipY, (int)v__clipW, (int)v__clipH); image->data= 0; XDestroyImage(image); } XDisplay _getGeometryWidth: _window { Window root; int x, y, w, h, bw, d; XGetGeometry((Display *)((struct t_XDisplay *)self)->_display, (Window)((struct t_XWindow *)self)->_window, &root, &x, &y, &w, &h, &bw, &d); return _integerObject(w); } XDisplay _getGeometryHeight: _window { Window root; int x, y, w, h, bw, d; XGetGeometry((Display *)((struct t_XDisplay *)self)->_display, (Window)((struct t_XWindow *)self)->_window, &root, &x, &y, &w, &h, &bw, &d); return _integerObject(h); } " ---------------------------------------------------------------- " XWindow : Object ( display _window ) XWindow _width: _display { Window root; int x, y, w, h, bw, d; XGetGeometry((Display *)v__display, (Window)((struct t_XWindow *)self)->_window, &root, &x, &y, &w, &h, &bw, &d); return _integerObject(w); } XWindow _height: _display { Window root; int x, y, w, h, bw, d; XGetGeometry((Display *)v__display, (Window)((struct t_XWindow *)self)->_window, &root, &x, &y, &w, &h, &bw, &d); return _integerObject(h); } " ---------------------------------------------------------------- " XGraphicsContext : Object ( _gc ) " ---------------------------------------------------------------- " XEvent : Object () XEvent _sizeof { return (oop)sizeof(XEvent) } XEvent type { return _integerObject(((XEvent *)self)->type); } XEvent motionX { return _integerObject(((XMotionEvent *)self)->x); } XEvent motionY { return _integerObject(((XMotionEvent *)self)->y); } XEvent motionState { return _integerObject(((XMotionEvent *)self)->state); } XEvent keyX { return _integerObject(((XKeyEvent *)self)->x); } XEvent keyY { return _integerObject(((XKeyEvent *)self)->y); } XEvent keyKeycode { char buf[32]; XLookupString((XKeyEvent *)self, buf, sizeof(buf), 0, 0); return _integerObject(buf[0]); } XEvent keyState { return _integerObject(((XKeyEvent *)self)->state); } XEvent buttonX { return _integerObject(((XButtonEvent *)self)->x); } XEvent buttonY { return _integerObject(((XButtonEvent *)self)->y); } XEvent buttonButton { return _integerObject(((XButtonEvent *)self)->button); } XEvent buttonState { return _integerObject(((XButtonEvent *)self)->state); } " ---------------------------------------------------------------- " XSetWindowAttributes : Object () XSetWindowAttributes _sizeof { return (oop)sizeof(XSetWindowAttributes); } XSetWindowAttributes eventMaskMask [ ^0x0800 ]