예제 #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);
        }
예제 #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;
                }
            }
        }
예제 #3
0
파일: Window.cs 프로젝트: jbnivoit/projects
 /** 
  * @param c possible: {@link Colormap#COPY_FROM_PARENT} (default)
  */
 public void set_colormap (Colormap c) { set (13, c.id); }
예제 #4
0
파일: Window.cs 프로젝트: jbnivoit/projects
 public override Object next () {
   return Colormap.intern (owner.display, next4 ());
 }
예제 #5
0
파일: Window.cs 프로젝트: jbnivoit/projects
 /**
  * @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);
 }
예제 #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;
              }
        }
예제 #7
0
파일: Window.cs 프로젝트: jbnivoit/projects
 /**
    * @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);
 }
예제 #8
0
파일: Window.cs 프로젝트: jbnivoit/projects
 /**
  * @param c possible: {@link Colormap#COPY_FROM_PARENT} (default)
  */
 public void set_colormap(Colormap c)
 {
     set (13, c.id);
 }
예제 #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;
        }
예제 #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);
        }