Exemple #1
0
        // opcode 80 - copy colormap and free
        public Colormap copy_and_free(int new_id)
        {
            Colormap new_map = new Colormap(display, new_id);

            Request request = new Request(display, 80, 3);

            request.write4(new_id);
            request.write4(id);
            display.send_request(request);
            return(new_map);
        }
Exemple #2
0
        public void init_defaults()
        {
            default_screen   = screens [default_screen_no];
            default_root     = default_screen.root(); // before init default_gc
            default_depth    = default_screen.root_depth();
            default_colormap = default_screen.default_colormap();
            default_gc       = default_screen.default_gc();
            default_black    = new Color(default_screen.black_pixel());
            default_white    = new Color(default_screen.white_pixel());

            for (int i = pixmap_formats.Length - 1; i >= 0; i--)
            {
                if (pixmap_formats [i].depth() == default_depth)
                {
                    default_pixmap_format = pixmap_formats [i];
                    break;
                }
            }
        }
Exemple #3
0
 /** 
  * @param c possible: {@link Colormap#COPY_FROM_PARENT} (default)
  */
 public void set_colormap (Colormap c) { set (13, c.id); }
Exemple #4
0
 public override Object next () {
   return Colormap.intern (owner.display, next4 ());
 }
Exemple #5
0
 /**
  * @see #change_attributes(Window.Attributes)
  * @see Attributes#set_colormap(Colormap)
  */
 public void set_colormap (Colormap cmap) {
   Attributes attr = new Attributes ();
   attr.set_colormap (cmap);
   change_attributes (attr);
 }
Exemple #6
0
        public void init_defaults()
        {
            default_screen = screens [default_screen_no];
            default_root = default_screen.root (); // before init default_gc
            default_depth = default_screen.root_depth ();
            default_colormap = default_screen.default_colormap ();
            default_gc = default_screen.default_gc ();
            default_black = new Color (default_screen.black_pixel ());
            default_white = new Color (default_screen.white_pixel ());

            for (int i=pixmap_formats.Length-1; i>=0; i--)
              if (pixmap_formats [i].depth () == default_depth) {
            default_pixmap_format = pixmap_formats [i];
            break;
              }
        }
Exemple #7
0
 /**
    * @see #change_attributes(Window.Attributes)
    * @see Attributes#set_colormap(Colormap)
    */
 public void set_colormap(Colormap cmap)
 {
     Attributes attr = new Attributes ();
     attr.set_colormap (cmap);
     change_attributes (attr);
 }
Exemple #8
0
 /**
  * @param c possible: {@link Colormap#COPY_FROM_PARENT} (default)
  */
 public void set_colormap(Colormap c)
 {
     set (13, c.id);
 }
Exemple #9
0
        // opcode 80 - copy colormap and free
        public Colormap copy_and_free(int new_id)
        {
            Colormap new_map = new Colormap (display, new_id);

            Request request = new Request (display, 80, 3);
            request.write4 (new_id);
            request.write4 (id);
            display.send_request (request);
            return new_map;
        }
Exemple #10
0
        protected void init_window(int width, int height)
        {
            visual_config = glx.visual_config (visual_config);
            int vid = visual_config.visual_id ();
            gl = glx.create_context (vid, display.default_screen_no, GL.NONE0);

            // FIXME share colormap
            Colormap colormap = new Colormap (display.default_root, vid, false);

            Window.Attributes attr = new Window.Attributes ();
            attr.set_colormap (colormap);

            // TODO use depth of x visual config instead of
            // `visual_config.buffer_size'?
            int depth = visual_config.buffer_size ();

            int more = Event.EXPOSURE_MASK | Event.KEY_PRESS_MASK; // compulsory

            /* Bugs? Whenever button motion events are selected, it is required to
             * select button press event as well.
             */
             if ((event_mask & ANY_BUTTON_MOTION_BITS) != 0)
               more |= Event.BUTTON_PRESS_MASK;
             attr.set_event_mask (event_mask | more);

            window = new Window (display.default_root, 10, 10, width, height);
            window.create (5, depth, Window.INPUT_OUTPUT, vid, attr);

            window.set_wm (this, "main");
            window.set_wm_delete_window ();

            gl.make_current (window);
            glu = new GLU (gl);
            glut = new GLUT (glu);
        }