Ejemplo n.º 1
0
        public Image(int width, int height, int format, Pixmap.Format pixmap_format)
        {
            this.width = width;
            this.height = height;
            this.format = format;
            this.pixmap_format = pixmap_format;

            init ();
        }
Ejemplo n.º 2
0
        public ZPixmap(Display display, int width, int height, Pixmap.Format format)
            : base(width, height, FORMAT, format)
        {
            image_byte_order = display.image_byte_order;
            pixel_byte_count = pixmap_format.bits_per_pixel () / 8;

            if (display.default_depth < 24)
              throw new Error ("Unsupported root depth < 24: " +
            display.default_depth);
        }
Ejemplo n.º 3
0
        //throws gnu.x11.extension.NotFoundException {
        public Blend(String [] args)
            : base(args, 255, 255)
        {
            about ("0.1", "test blending in RENDER",
              "Stephen Tse <*****@*****.**>",
              "http://escher.sourceforge.net/");

            if (help_option) return;

            render = new Render (display);
            Picture.Format pf0 = new Picture.Format (), pf1;
            Picture.Format.Direct df = pf0.direct_format ();

            alpha_pixmap = new Pixmap (window, window.width, window.height, 8);
            color_pixmap = new Pixmap (window, 1, 1, 24);
            alpha_gc = new GC (alpha_pixmap);
            color_gc = new GC (color_pixmap);

            // window picture (TODO: find visual)
            pf0.clear ();
            pf0.set_depth (display.default_screen.root_depth ());
            pf1 = render.picture_format (pf0, true);

            window_picture = render.create_picture (window, pf1,
              Picture.Attributes.EMPTY);

            // alpha picture
            pf0.clear ();
            pf0.set_depth (8);
            pf0.set_type (Picture.Format.Direct.TYPE);
            df.set_alpha (0);
            df.set_alpha_mask (0xff);
            pf1 = render.picture_format (pf0, true);

            alpha_picture = render.create_picture (alpha_pixmap, pf1,
              Picture.Attributes.EMPTY);

            // color picture
            pf0.clear ();
            pf0.set_depth (24);
            pf0.set_type (Picture.Format.Direct.TYPE);
            df.set_alpha (0);
            df.set_alpha_mask (0);
            df.set_red (16);
            df.set_red_mask (0xff);
            df.set_green (8);
            df.set_green_mask (0xff);
            df.set_blue (0);
            df.set_blue_mask (0xff);
            pf1 = render.picture_format (pf0, true);

            Picture.Attributes attr = new Picture.Attributes ();
            attr.set_repeat (true);
            color_picture = render.create_picture (color_pixmap, pf1, attr);
        }
Ejemplo n.º 4
0
        // 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);
        }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
 /**
  * @param p default: pixmap of unspecified size filled with ones
  */
 public void set_stipple(Pixmap p)
 {
     set(11, p.id);
 }
Ejemplo n.º 7
0
 /**
  * @param p default: pixmap of unspecified size filled with foreground
  * pixel
  */
 public void set_tile(Pixmap p)
 {
     set(10, p.id);
 }
Ejemplo n.º 8
0
 /**
  * @param p possible:
  * {@link Pixmap#NONE} (default)
  */
 public void set_clip_mask(Pixmap p)
 {
     set (6, p.id);
 }
Ejemplo n.º 9
0
 /**
  * @param p default: pixmap of unspecified size filled with foreground
  * pixel
  */
 public void set_tile(Pixmap p)
 {
     set (10, p.id);
 }
Ejemplo n.º 10
0
 /**
  * @param p default: pixmap of unspecified size filled with ones
  */
 public void set_stipple(Pixmap p)
 {
     set (11, p.id);
 }
Ejemplo n.º 11
0
 /**
    * @see #change(GC.Values)
    * @see Values#set_clip_mask(Pixmap)
    */
 public void set_clip_mask(Pixmap pixmap)
 {
     Values gc_values = new Values ();
     gc_values.set_clip_mask (pixmap);
     change (gc_values);
 }
Ejemplo n.º 12
0
 /**
    * @see #change_attributes(Window.Attributes)
    * @see Attributes#set_border(Pixmap)
    */
 public void set_border(Pixmap p)
 {
     Attributes attr = new Attributes ();
     attr.set_border (p);
     change_attributes (attr);
 }
Ejemplo n.º 13
0
 /**
    * @see #change_attributes(Window.Attributes)
    * @see Attributes#set_background(Pixmap)
    */
 public void set_background(Pixmap p)
 {
     Attributes attr = new Attributes ();
     attr.set_background (p);
     change_attributes (attr);
 }
Ejemplo n.º 14
0
 /**
  * @param p possible: {@link Pixmap#COPY_FROM_PARENT} (default)
  */
 public void set_border(Pixmap p)
 {
     set (2, p.id);
 }
Ejemplo n.º 15
0
 /**
  * @param p possible:
  * {@link Pixmap#NONE} (default),
  * {@link Pixmap#PARENT_RELATIVE}
  */
 public void set_background(Pixmap p)
 {
     set (0, p.id);
 }
Ejemplo n.º 16
0
 /**
  * @param p possible: {@link Pixmap#NONE} (default)
  */
 public void set_clip_mask(Pixmap p)
 {
     set(19, p.id);
 }
Ejemplo n.º 17
0
 /**
    * @see #change(GC.Values)
    * @see Values#set_tile(Pixmap)
    */
 public void set_tile(Pixmap pixmap)
 {
     Values gc_values = new Values ();
     gc_values.set_tile (pixmap);
     change (gc_values);
 }
Ejemplo n.º 18
0
     // shape opcode 2 - mask
     /**
        * @param dest_kind valid:
        * {@link #BOUNDING},
        * {@link #CLIP}
        *
        * @param operation valid:
        * {@link #SET},
        * {@link #UNION},
        * {@link #INTERSECT},
        * {@link #SUBTRACT},
        * {@link #INVERT}
        *
        * @param src possible: {@link gnu.x11.Pixmap#NONE}
        * @see <a href="XShapeCombineMask.html">XShapeCombineMask</a>
        */
     public void combine_mask(Window dest, int dest_kind, int x_offset, 
 int y_offset, Pixmap src, int operation)
     {
         Request request = new Request (display, major_opcode, 2, 5);
         request.write1 (operation);
         request.write1 (dest_kind);
         request.write2_unused ();
         request.write4 (dest.id);
         request.write2 (x_offset);
         request.write2 (y_offset);
         request.write4 (src.id);
         display.send_request (request);
     }