public Chinese(String [] args) : base(args, 100, 50) { about("0.1", "test text output with chinese font", "Stephen Tse <*****@*****.**>", "http://escher.sourceforge.net/"); if (help_option) { return; } // check if any big5 font is present gnu.x11.Enum fonts = display.fonts("-*-*-*-*-*-*-*-*-*-*-*-*-big5-*", 1); if (fonts.count == 0) { throw new Exception( "No Chinese font defined on this X server"); } GC.Values gv = new GC.Values(); gv.set_background(display.default_white); gv.set_foreground(display.default_black); // just pick any of those matching fonts gv.set_font((gnu.x11.Font)fonts.next()); gc = new GC(window, gv); }
public Shape(String [] args) //throws gnu.x11.extension.NotFoundException { : base(args, 32, 32) { about("0.1", "test nonrectangular window extension", "Stephen Tse <*****@*****.**>", "http://escher.sourceforge.net/"); if (help_option) { return; } Pixmap mask = new Pixmap(window, 32, 32, 1); XBM xbm = new XBM(display, 32, 32, xbm_data); GC.Values gv = new GC.Values(); gv.set_background(display.default_white); gv.set_foreground(display.default_black); GC gc = new GC(mask, gv); mask.put_image(gc, xbm, 0, 0); gnu.x11.extension.Shape shape = new gnu.x11.extension.Shape(display); // test extension opcode string in error try { shape.combine_mask(window, -1, 0, 0, mask, -1); display.check_error(); } catch (Error e) { Console.WriteLine("Forced error for testing: " + e); } // force a round trip after an error is generated display.input.input_focus(); // test extension event mechanism shape.select_input(window, true); shape.combine_mask(window, gnu.x11.extension.Shape.BOUNDING, 0, 0, mask, gnu.x11.extension.Shape.SUBTRACT); }