public override void erase(gnu.app.displayhack.DisplayHack hack) { gnu.x11.Window window = hack.window; /* Minimum radius = L/sqrt(2) ~= 0.707*L, * where L = max(width, heigth) * sqrt(2) = 1.414213562373095 * * Take radius = L for faster (easier) computation. */ int radius = Math.Max (window.width, window.height); int full = 360 * 64; int delta = (full/200) * hack.eraser_delta; int step_count = (int) Math.Ceiling ( (double)(1 + full/delta)); int start = DisplayHack.random.Next (full); // clockwise or counter-clockwise if (DisplayHack.random.Next()%2==0) delta = -delta; for (int i=0; i<step_count; i++) { window.arc (hack.display.default_gc, window.width/2 - radius, window.height/2 - radius, 2*radius, 2*radius, (start+i*delta) % full, delta, true); if (sleep (hack)) return; } hack.sleep (hack.delay/2); // before next screen }
public override void erase(gnu.app.displayhack.DisplayHack hack) { gnu.x11.Window window = hack.window; /* Minimum radius = L/sqrt(2) ~= 0.707*L, * where L = max(width, heigth) * sqrt(2) = 1.414213562373095 * * Take radius = L for faster (easier) computation. */ int radius = Math.Max (window.width, window.height); int full = 360 * 64; int third = full / 3; int start = DisplayHack.random.Next (full); /* 200 = speed in {@link CircleWipe} * 3 = three circles * 2 = converge from two sides */ int delta = (full/200/3/2) * hack.eraser_delta; /* 1 to offset rounding error * 3 = three circles * 2 = converge from two sides */ int step_count = 1 + full/delta/3/2; for (int i=0; i<step_count; i++) { // first circle window.arc (hack.display.default_gc, window.width/2 - radius, window.height/2 - radius, 2*radius, 2*radius, (start+i*delta) % full, delta, true); window.arc (hack.display.default_gc, window.width/2 - radius, window.height/2 - radius, 2*radius, 2*radius, (start-i*delta) % full, delta, true); // second circle window.arc (hack.display.default_gc, window.width/2 - radius, window.height/2 - radius, 2*radius, 2*radius, (start+third+i*delta) % full, delta, true); window.arc (hack.display.default_gc, window.width/2 - radius, window.height/2 - radius, 2*radius, 2*radius, (start+third-i*delta) % full, delta, true); // third circle window.arc (hack.display.default_gc, window.width/2 - radius, window.height/2 - radius, 2*radius, 2*radius, (start+2*third+i*delta) % full, delta, true); window.arc (hack.display.default_gc, window.width/2 - radius, window.height/2 - radius, 2*radius, 2*radius, (start+2*third-i*delta) % full, delta, true); if (sleep (hack)) return; } hack.sleep (hack.delay/2); // before next screen }
// 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); }
//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); }
public Segment (Drawable drawable, GC gc, gnu.x11.Segment [] segments) : base (66, drawable, gc, segments, 2) { }
public Rectangle (Drawable drawable, GC gc, gnu.x11.Rectangle [] rectangles, bool fill) :base (fill ? 70 : 67, drawable, gc, rectangles, 2){ }
public Dot (Drawable drawable, GC gc, gnu.x11.Point [] points, int coordinate_mode, bool join) :base (join ? 65 : 64, drawable, gc, points, 1){ this.coordinate_mode = coordinate_mode; }
public Arc (Drawable drawable, GC gc, gnu.x11.Arc [] arcs, bool fill) :base (fill ? 71 : 68, drawable, gc, arcs, 3){ }
public ValueList (Display display, int opcode, int unit, int id, gnu.x11.ValueList vl) { this.display = display; this.opcode = opcode; this.unit = unit; this.id = id; this.vl = vl; }
public Error(gnu.x11.Display display, gnu.x11.Data data, int code, int seq_no, int bad, int minor_opcode, int major_opcode) : base(display, ERROR_STRINGS [code], code, seq_no, bad, minor_opcode, major_opcode) { }
//throws gnu.x11.extension.NotFoundException { // glx opcode 7 - get version /** * @see <a href="glXQueryVersion.html">glXQueryVersion</a> */ public GLX(gnu.x11.Display display) : base(display, "GLX", MINOR_OPCODE_STRINGS, 13, 1) { // check version before any other operations Request request = new Request (display, major_opcode, 7, 3); request.write4 (CLIENT_MAJOR_VERSION); request.write4 (CLIENT_MINOR_VERSION); Data reply = display.read_reply (request); server_major_version = reply.read4 (8); server_minor_version = reply.read4 (12); send_client_info (); visual_configs_cache = new VisualConfig [display.screens.Length] []; }
public override void erase(gnu.app.displayhack.DisplayHack hack) { hack.window.clear (false); hack.sleep (hack.delay/2); // before next screen }
public gnu.x11.Error build(gnu.x11.Display display, Data data, int code, int seq_no, int bad, int minor_opcode, int major_opcode) { return new gnu.x11.Error (display, ERROR_STRING, code, seq_no, bad, minor_opcode, major_opcode); }
// glx opcode 12 - use x font /** * @see <a href="glXUseXFont.html">glXUseXFont</a> */ public void use_x_font(gnu.x11.Font font, int first, int count, int where) { Request request = begin_command_request (12, 6); request.write4 (tag); request.write4 (font.id); request.write4 (first); request.write4 (count); request.write4 (where); display.send_request (request); }
public BigRequests(gnu.x11.Display display) : base(display, "BIG-REQUESTS", null) { }