Exemplo n.º 1
0
        //throws gnu.x11.extension.NotFoundException {
        public Shape(String [] args)
            : 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);
        }
Exemplo n.º 2
0
        //throws FileNotFoundException, IOException {
        public Image(String [] args)
            : base(args, 200, 80)
        {
            about ("0.1", "test image output of XBM, XPM, and PPM format",
              "Stephen Tse <*****@*****.**>",
              "http://escher.sourceforge.net/");

            if (help_option) return;

            Console.Write ("Loading images....");
            xbm = new XBM (display, 32, 32, xbm_data);
            xpm = new XPM (display, xpm_data);
            StreamReader ppm_file = new StreamReader ("etc/image.pnm");
            ppm = new PPM (display, ppm_file);
            Console.WriteLine ("done.");
        }