Exemple #1
0
 static extern xcb_void_cookie_t xcb_change_property(
     IntPtr c,//xcb_connection_t*
     xcb_prop_mode_t mode,
     xcb_window_t window,
     UInt32 property, //xcb_atom_t;
     UInt32 type,     //xcb_atom_t;
     byte format,
     byte data_len,
     string string_data//const void*
     );
Exemple #2
0
        public void Init(Point position, Size size, WindowTypes windowType)
        {
            unsafe
            {
                xcb_screen_t *screen;

                //connect to X server
                c = xcb_connect(IntPtr.Zero, IntPtr.Zero);
                var error = (XCB_CONN)xcb_connection_has_error(c);
                if (error != XCB_CONN.XCB_CONN_NO_ERROR)
                {
                    Console.WriteLine("xcb_connect error: {0}", XCB_CONN_Text[(int)error]);
                }

                //get first screen
                screen = (xcb_screen_t *)xcb_setup_roots_iterator(xcb_get_setup(c)).data.ToPointer();
                if (new IntPtr(screen) == IntPtr.Zero)
                {
                    Console.WriteLine("xcb_setup_roots_iterator failed.");
                }

                //generate window id
                window = xcb_generate_id(c);

                var      mask       = xcb_cw_t.XCB_CW_BACK_PIXEL | xcb_cw_t.XCB_CW_EVENT_MASK; //background and event mask
                UInt32[] maskValues = new UInt32[2];
                maskValues[0] = screen->white_pixel;                                           //white back ground
                maskValues[1] = (UInt32)(xcb_event_mask_t.XCB_EVENT_MASK_EXPOSURE | xcb_event_mask_t.XCB_EVENT_MASK_BUTTON_PRESS |
                                         xcb_event_mask_t.XCB_EVENT_MASK_BUTTON_RELEASE | xcb_event_mask_t.XCB_EVENT_MASK_POINTER_MOTION |
                                         xcb_event_mask_t.XCB_EVENT_MASK_ENTER_WINDOW | xcb_event_mask_t.XCB_EVENT_MASK_LEAVE_WINDOW |
                                         xcb_event_mask_t.XCB_EVENT_MASK_KEY_PRESS | xcb_event_mask_t.XCB_EVENT_MASK_KEY_RELEASE); //events that will be received
                xcb_create_window(c,
                                  XCB_COPY_FROM_PARENT,                                                                            //depth: same as parent
                                  window,                                                                                          //window id
                                  screen->root,                                                                                    //parent window
                                  (short)position.X, (short)position.Y,                                                            //x,y
                                  (ushort)size.Width, (ushort)size.Height,                                                         //width, height
                                  10,                                                                                              //border width
                                  (UInt16)xcb_window_class_t.XCB_WINDOW_CLASS_INPUT_OUTPUT,                                        //windos class
                                  screen->root_visual,                                                                             //visual
                                  (UInt32)mask, maskValues);                                                                       //masks and their values

                // show it
                xcb_map_window(c, window);

                // flush pending requests
                xcb_flush(c);
                Console.WriteLine("xcb_flush..");

                Console.WriteLine("Press key to continue. (just a temp hack for remote debugging)");
                Console.ReadKey();
            }

            this.size = size;
        }
Exemple #3
0
 static extern xcb_void_cookie_t xcb_create_window(IntPtr c,
                                                   byte depth,
                                                   xcb_window_t wid,
                                                   xcb_window_t parent,
                                                   Int16 x,
                                                   Int16 y,
                                                   UInt16 width,
                                                   UInt16 height,
                                                   UInt16 border_width,
                                                   UInt16 _class,
                                                   xcb_visualid_t visual,
                                                   UInt32 value_mask,
                                                   UInt32[] value_list);
Exemple #4
0
 static unsafe extern xcb_void_cookie_t xcb_configure_window(IntPtr c,
                                                             xcb_window_t window,
                                                             xcb_config_window_t value_mask,
                                                             UInt32 *value_list);
Exemple #5
0
 static extern xcb_void_cookie_t xcb_unmap_window(IntPtr connection, xcb_window_t window);