Exemplo n.º 1
0
        public LinuxX11WindowImpl(LinuxX11Platform platform,
                                  int width,
                                  int height)
        {
            _platform = platform;
            X11.XSetWindowAttributes attributes = new X11.XSetWindowAttributes();
            var screen = Xlib.XDefaultScreen(_platform.Display);

            _visual = Xlib.XDefaultVisual(_platform.Display, screen);
            var depth = Xlib.XDefaultDepth(_platform.Display, screen);

            attributes.background_pixel = 0;
            attributes.bit_gravity      = 10;

            _window = Xlib.XCreateWindow(platform.Display,
                                         Xlib.XDefaultRootWindow(platform.Display),
                                         300,
                                         300,
                                         (uint)width,
                                         (uint)height,
                                         1,
                                         depth,
                                         1,
                                         _visual,
                                         1 << 1 | 1 << 4,
                                         ref attributes);

            Xlib.XSelectInput(platform.Display, _window, X11.EventMask.ExposureMask |
                              X11.EventMask.StructureNotifyMask |
                              X11.EventMask.EnterWindowMask |
                              X11.EventMask.LeaveWindowMask |
                              X11.EventMask.PointerMotionMask);
        }
Exemplo n.º 2
0
        private void DestroyWindow(X11.Window xWindow)
        {
            Services.Logger.LogWindowingSystemEvent("Destroying window {0}.", xWindow);

            var window = _windows.First(w => w.XWindow == xWindow);

            window.Close();

            WindowClosed?.Invoke(new WindowEventArgs(window));
        }
Exemplo n.º 3
0
 public static extern void imlib_context_set_drawable(X11.Window drawable);