// xtest opcode 1 - compare cursor /** * @param cursor possible: * {@link Cursor#NONE}, * {@link Cursor#CURRENT} * * @see <a href="XTestCompareCursorWithWindow.html"> * XTestCompareCursorWithWindow</a> */ public bool compare_cursor(Window window, Cursor cursor) { Request request = new Request (display, major_opcode, 1, 3); request.write4 (window.id); request.write4 (cursor.id); return display.read_reply (request).read_bool (1); }
// opcode 47 - query font /** * @see <a href="XQueryFont.html">XQueryFont</a> */ public FontReply info() { Request request = new Request (display, 47, 2); request.write4 (id); return new FontReply (display.read_reply (request)); }
// xc-misc opcode 2 - get xid list public Enum xid_list(int count) { Request request = new Request (display, major_opcode, 2, 2); request.write4 (count); Data reply = display.read_reply (request); return new Enum (reply, 32, reply.read4 (8)); }
// opcode 48 - query text extents /** * @see <a href="XQueryTextExtents.html">XQueryTextExtents</a> */ public TextExtentReply text_extent(String s) { Request request = new Request (display, 48, s.Length % 2 == 1, 2+Data.unit (s)); request.write4 (id); request.write1 (s); return new TextExtentReply (display.read_reply (request)); }
//throws NotFoundException { // shape opcode 0 - query version /** * @see <a href="XShapeQueryExtension.html">XShapeQueryExtension</a> */ public Shape(Display display) : base(display, "SHAPE", MINOR_OPCODE_STRINGS, 0, 1) { // check version before any other operations Request request = new Request (display, major_opcode, 0, 1); Data reply = display.read_reply (request); server_major_version = reply.read2 (8); server_minor_version = reply.read2 (10); }
// render opcode 5 - change picture /** * @see <a href="XRenderChangePicture.html">XRenderChangePicture</a> */ public void change(Attributes attr) { Request request = new Request (display, render.major_opcode, 5, 5+attr.count ()); request.write4 (id); request.write4 (attr.bitmask); attr.write (request); display.send_request (request); }
//throws gnu.x11.extension.NotFoundException { // print opcode 0 - query version /** * @see <a href="XpQueryVersion.html">XpQueryVersion</a> */ public Print(Display display) : base(display, "XpExtension", MINOR_OPCODE_STRINGS, 2, 2) { // check version before any other operations Request request = new Request (display, major_opcode, 0, 1); Data reply = display.read_reply (request); server_major_version = reply.read2 (4); server_minor_version = reply.read2 (4); }
// opcode 78 - create colormap /** * @param alloc valid: * {@link #NONE}, * {@link #ALL} * * @see <a href="XCreateColormap.html">XCreateColormap</a> */ public Colormap(Window window, int visual_id, bool alloc_all) : base(window.display) { Request request = new Request (display, 78, alloc_all, 4); request.write4 (id); request.write4 (window.id); request.write4 (visual_id); display.send_request (request); }
// render opcode 17 - create glyph set /** * @see <a href="XRenderCreateGlyphSet.html">XRenderCreateGlyphSet</a> */ public GlyphSet(Render render, Picture.Format format) : base(render.display) { this.render = render; Request request = new Request (display, render.major_opcode, 17, 3); request.write4 (id); request.write4 (format.id ()); display.send_request (request); }
// render opcode 18 - reference glyph set /** * @see <a href="XRenderReferenceGlyphSet.html"> * XRenderReferenceGlyphSet</a> */ public GlyphSet(GlyphSet src) : base(src.display) { render = src.render; Request request = new Request (display, render.major_opcode, 18, 3); request.write4 (id); request.write4 (src.id); display.send_request (request); }
// evi opcode 1 - get visual info /** * @see <a href="XeviGetVisualInfo.html">XeviGetVisualInfo</a> */ public VisualInfoReply visual_info(Visual [] visuals) { Request request = new Request (display, major_opcode, 1, 1); request.write4 (visuals.Length); for (int i=0; i<visuals.Length; i++) request.write4 (visuals [i].id ()); return new VisualInfoReply (display, display.read_reply (request)); }
// opcode 97 - query best size /** * @param klass valid: * {@link #CURSOR}, * {@link #TILE}, * {@link #STIPPLE} * * @see <a href="XQueryBestSize.html">XQueryBestSize</a> */ public Size best_size(int klass, int width, int height) { Request request = new Request (display, 97, 3); request.write4 (id); request.write2 (width); request.write2 (height); Data reply = display.read_reply (request); return new Size (reply.read2 (8), reply.read2 (10)); }
// glx opcode 5 - create glx pixmap /** * @see <a href="glXCreateGLXPixmap.html">glXCreateGLXPixmap</a> */ public Pixmap(GLX glx, int screen_no, gnu.x11.Visual visual, gnu.x11.Pixmap pixmap) : base(glx.display) { Request request = new Request (display, glx.major_opcode, 5, 5); request.write4 (screen_no); request.write4 (visual.id ()); request.write4 (pixmap.id); request.write4 (id); display.send_request (request); }
//throws NotFoundException { // xc-misc opcode 0 - get version public XCMisc(gnu.x11.Display display) : base(display, "XC-MISC", MINOR_OPCODE_STRINGS) { // check version before any other operations Request request = new Request (display, major_opcode, 0, 2); request.write2 (CLIENT_MAJOR_VERSION); request.write2 (CLIENT_MINOR_VERSION); Data reply = display.read_reply (request); server_major_version = reply.read2 (8); server_minor_version = reply.read2 (10); }
// opcode 45 - open font /** * @see <a href="XLoadFont.html">XLoadFont</a> */ public Font(Display display, String name) : base(display) { this.name = name; Request request = new Request (display, 45, 3+Data.unit (name)); request.write4 (id); request.write2 (name.Length); request.write2_unused (); request.write1 (name); display.send_request (request); }
//throws NotFoundException { // dbe opcode 0 - get version public DBE(gnu.x11.Display display) : base(display, "DOUBLE-BUFFER", MINOR_OPCODE_STRINGS, 1, 0) { // check version before any other operations Request request = new Request (display, major_opcode, 0, 2); request.write1 (CLIENT_MAJOR_VERSION); request.write1 (CLIENT_MINOR_VERSION); Data reply = display.read_reply (request); server_major_version = reply.read1 (8); server_minor_version = reply.read1 (9); }
//throws NotFoundException { // evi opcode 0 - get version /** * @see <a href="XeviQueryVersion.html">XeviQueryVersion</a> */ public EVI(Display display) : base(display, "Extended-Visual-Information", MINOR_OPCODE_STRINGS) { // check version before any other operations /* Note that the specification says the request includes a major and a * minor version, but most implementation (xfree86 3.3/4.0) does not. * Which one is bugged? */ Request request = new Request (display, major_opcode, 0, 1); Data reply = display.read_reply (request); server_major_version = reply.read2 (8); server_minor_version = reply.read2 (10); }
// opcode 84 - alloc color /** * @see <a href="XAllocColor.html">XAllocColor</a> */ public Color alloc_color(int red, int green, int blue) { Request request = new Request (display, 84, 4); request.write4 (id); request.write2 (red); request.write2 (green); request.write2 (blue); Data reply = display.read_reply (request); Color color = new Color (reply.read4 (16)); color.exact = new RGB (reply.read2 (8), reply.read2 (10), reply.read2 (12)); return color; }
// opcode 53 - create pixmap /** * @see <a href="XCreatePixmap.html">XCreatePixmap</a> */ public Pixmap(Drawable drawable, int width, int height, int depth) : base(drawable.display) { this.width = width; this.height = height; Request request = new Request (display, 53, depth, 4); request.write4 (id); request.write4 (drawable.id); request.write2 (width); request.write2 (height); display.send_request (request); }
// render opcode 4 - create picture /** * @see <a href="XRenderCreatePicture.html">XRenderCreatePicture</a> * @see Render#create_picture(Drawable, Picture.Format, * Picture.Attributes) */ public Picture(Render render, Drawable drawable, Format format, Attributes attr) : base(render.display) { this.render = render; Request request = new Request (display, render.major_opcode, 4, 5+attr.count ()); request.write4 (id); request.write4 (drawable.id); request.write4 (format.id ()); request.write4 (attr.bitmask); attr.write (request); display.send_request (request); }
// render opcode 26 - fill rectangles /** * @see <a href="XRenderFillRectangle.html">XRenderFillRectangle</a> */ public void fill_rectangle(int op, Color color, int x, int y, int width, int height) { Request request = new Request (display, render.major_opcode, 26, 7); request.write1 (op); request.write3_unused (); request.write4 (id); request.write2 (x); request.write2 (y); request.write2 (width); request.write2 (height); request.write2 (color.red); request.write2 (color.green); request.write2 (color.blue); request.write2 (color.alpha); display.send_request (request); }
public override bool aggregate (Request request) { if (!(request is Poly)) return false; Poly pr = (Poly) request; if (pr.opcode != opcode || pr.drawable != drawable || pr.gc != gc) return false; if (!more_aggregatep (pr)) return false; pr.items_sets.Add (items_sets[0]); pr.items_sets_unit_count += items_sets_unit_count; return true; }
public override bool aggregate (Request request) { if (!(request is ValueList)) return false; ValueList vlr = (ValueList) request; if (vlr.opcode != opcode || vlr.id != id) return false; vlr.vl.aggregate (vl); return true; }
public abstract bool aggregate (Request request);
// opcode 17 - get atom name /** * @see <a href="XGetAtomName.html">XGetAtomName</a> */ public Atom(Display display, int id, bool only_if_exists) { this.display = display; this.id = id; Request request = new Request (display, 17, 2); request.write4 (id); Data reply = display.read_reply (request); int len = reply.read2 (8); Decoder dec = Encoding.ASCII.GetDecoder(); char [] d = new char[len]; len = dec.GetChars(reply.data,32,len,d,0); name = new String (d, 0, len); display.atom_ids.Add (id, this); display.atom_names.Add (name, this); }
// opcode 16 - intern atom /** * @see <a href="XInternAtom.html">XInternAtom</a> */ public Atom(Display display, String name, bool only_if_exists) { this.display = display; this.name = name; Request request = new Request (display, 16, only_if_exists, 2+Data.unit (name)); request.write2 (name.Length); request.write2_unused (); request.write1 (name); Data reply = display.read_reply (request); id = reply.read4 (8); display.atom_ids.Add (id, this); display.atom_names.Add (name, this); }
// opcode 35 - allow events /** * @param mode valid: * {@link #ASYNC_POINTER}, * {@link #SYNC_POINTER}, * {@link #REPLY_POINTER}, * {@link #ASYNC_KEYBOARD}, * {@link #SYNC_KEYBOARD}, * {@link #REPLY_KEYBOARD}, * {@link #ASYNC_BOTH}, * {@link #SYNC_BOTH} * * @param time possible: {@link Display#CURRENT_TIME} * @see <a href="XAllowEvents.html">XAllowEvents</a> */ public void allow_events(int mode, int time) { Request request = new Request (display, 35, mode, 2); request.write4 (time); display.send_request (request); }
// opcode 27 - ungrab pointer /** * @param time possible: {@link Display#CURRENT_TIME} * @see <a href="XUngrabPointer.html">XUngrabPointer</a> */ public void ungrab_pointer(int time) { Request request = new Request (display, 27, 2); request.write4 (time); display.send_request (request); }
// opcode 32 - ungrab keyboard /** * @param time possible: {@link Display#CURRENT_TIME} * @see <a href="XUngrabKeyboard.html">XUngrabKeyboard</a> */ public void ungrab_keyboard(int time) { Request request = new Request (display, 32, 2); request.write4 (time); display.send_request (request); }
// opcode 116 - set pointer mapping /** * @return valid: * {@link #SUCCESS}, * {@link #BUSY} * * @see <a href="XSetPointerMapping.html">XSetPointerMapping</a> */ public int set_pointer_mapping(byte [] map) { Request request = new Request (display, 116, map.Length, 2+Data.unit (map)); request.write1 (map); return display.read_reply (request).read1 (1); }