Ejemplo n.º 1
0
        internal override bool GetText(IntPtr handle, out string text)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            text = "";
            return(hwnd != null && hwnd.GetText(out text));
        }
Ejemplo n.º 2
0
        internal override void GrabWindow(IntPtr handle, IntPtr confine_to_handle)
        {
            X11Hwnd hwnd            = (X11Hwnd)Hwnd.ObjectFromHandle(handle);
            X11Hwnd confine_to_hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(confine_to_handle);

            display.GrabWindow(hwnd, confine_to_hwnd);
        }
Ejemplo n.º 3
0
        internal override IntPtr CreateWindow(CreateParams cp)
        {
            X11Hwnd hwnd = new X11Hwnd(display);

            hwnd.CreateWindow(cp);

            return(hwnd.zombie ? IntPtr.Zero : hwnd.Handle);
        }
Ejemplo n.º 4
0
        internal override void Activate(IntPtr handle)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                hwnd.Activate();
            }
        }
Ejemplo n.º 5
0
        internal override void UpdateWindow(IntPtr handle)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                hwnd.Update();
            }
        }
Ejemplo n.º 6
0
        internal override void SetWindowTransparency(IntPtr handle, double transparency, Color key)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                hwnd.SetWindowTransparency(transparency, key);
            }
        }
Ejemplo n.º 7
0
        internal override void ClientToScreen(IntPtr handle, ref int x, ref int y)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                hwnd.ClientToScreen(ref x, ref y);
            }
        }
Ejemplo n.º 8
0
        internal override void RequestAdditionalWM_NCMessages(IntPtr handle, bool hover, bool leave)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                hwnd.RequestAdditionalWM_NCMessages(hover, leave);
            }
        }
Ejemplo n.º 9
0
        internal override void SetWindowPos(IntPtr handle, int x, int y, int width, int height)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                hwnd.SetPosition(x, y, width, height);
            }
        }
Ejemplo n.º 10
0
        internal override void SetBorderStyle(IntPtr handle, FormBorderStyle border_style)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                hwnd.SetBorderStyle(border_style);
            }
        }
Ejemplo n.º 11
0
        internal override void ScrollWindow(IntPtr handle, Rectangle area, int XAmount, int YAmount, bool with_children)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                hwnd.ScrollWindow(area, XAmount, YAmount, with_children);
            }
        }
Ejemplo n.º 12
0
        internal override void RequestNCRecalc(IntPtr handle)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                hwnd.RequestNCRecalc();
            }
        }
Ejemplo n.º 13
0
        internal override void ScreenToMenu(IntPtr handle, ref int x, ref int y)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                hwnd.ScreenToMenu(ref x, ref y);
            }
        }
Ejemplo n.º 14
0
        internal override void SetIcon(IntPtr handle, Icon icon)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);;

            if (hwnd != null)
            {
                hwnd.SetIcon(icon);
            }
        }
Ejemplo n.º 15
0
        internal override void SetModal(IntPtr handle, bool Modal)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                display.SetModal(hwnd, Modal);
            }
        }
Ejemplo n.º 16
0
        internal override void DrawReversibleRectangle(IntPtr handle, Rectangle rect, int line_width)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                hwnd.DrawReversibleRectangle(rect, line_width);
            }
        }
Ejemplo n.º 17
0
        internal override void SetClipRegion(IntPtr handle, Region region)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                hwnd.SetClipRegion(region);
            }
        }
Ejemplo n.º 18
0
        internal override void SetWindowState(IntPtr handle, FormWindowState state)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                hwnd.SetWindowState(state);
            }
        }
Ejemplo n.º 19
0
        internal override void SetWindowStyle(IntPtr handle, CreateParams cp)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                hwnd.SetHwndStyles(cp);
                hwnd.SetWMStyles(cp);
            }
        }
Ejemplo n.º 20
0
        internal override FormWindowState GetWindowState(IntPtr handle)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd == null)
            {
                return(FormWindowState.Normal);                // XXX should we throw an exception here?  probably
            }
            return(hwnd.GetWindowState());
        }
Ejemplo n.º 21
0
        internal override IntPtr DefWndProc(ref Message msg)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.GetObjectFromWindow(msg.HWnd);

            if (hwnd == null)
            {
                return(IntPtr.Zero);
            }

            return(hwnd.DefWndProc(ref msg));
        }
Ejemplo n.º 22
0
        internal override bool Text(IntPtr handle, string text)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                hwnd.Text = text;
            }

            return(true);
        }
Ejemplo n.º 23
0
        internal override bool SetTopmost(IntPtr handle, bool enabled)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd == null)
            {
                return(false);
            }

            return(hwnd.SetTopmost(enabled));
        }
Ejemplo n.º 24
0
        internal override void SetWindowMinMax(IntPtr handle, Rectangle maximized, Size min, Size max)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd == null)
            {
                return;
            }

            hwnd.SetMinMax(maximized, min, max);
        }
Ejemplo n.º 25
0
        internal override IntPtr SetParent(IntPtr handle, IntPtr parent)
        {
            X11Hwnd hwnd        = (X11Hwnd)Hwnd.ObjectFromHandle(handle);
            X11Hwnd parent_hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(parent);

            if (hwnd != null)
            {
                hwnd.SetParent(parent_hwnd);
            }

            return(IntPtr.Zero);
        }
Ejemplo n.º 26
0
        internal override bool SetZOrder(IntPtr handle, IntPtr after_handle, bool top, bool bottom)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd == null || !hwnd.mapped)
            {
                return(false);
            }

            X11Hwnd after_hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(after_handle);

            return(hwnd.SetZOrder(after_hwnd, top, bottom));
        }
Ejemplo n.º 27
0
        internal override double GetWindowTransparency(IntPtr handle)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd != null)
            {
                return(hwnd.GetWindowTransparency());
            }
            else
            {
                return(0.0);
            }
        }
Ejemplo n.º 28
0
        internal override void SetCursorPos(IntPtr handle, int x, int y)
        {
            if (handle == IntPtr.Zero)
            {
                display.SetCursorPos(x, y);
            }
            else
            {
                X11Hwnd hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

                hwnd.SetCursorPos(x, y);
            }
        }
Ejemplo n.º 29
0
        internal override void ScrollWindow(IntPtr handle, int XAmount, int YAmount, bool with_children)
        {
            X11Hwnd hwnd = (X11Hwnd)Hwnd.GetObjectFromWindow(handle);

            if (hwnd != null)
            {
                Rectangle rect;

                rect   = hwnd.ClientRect;
                rect.X = 0;
                rect.Y = 0;
                hwnd.ScrollWindow(rect, XAmount, YAmount, with_children);
            }
        }
Ejemplo n.º 30
0
        internal override bool SetOwner(IntPtr handle, IntPtr handle_owner)
        {
            X11Hwnd hwnd;

            hwnd = (X11Hwnd)Hwnd.ObjectFromHandle(handle);

            if (hwnd == null)
            {
                return(false);
            }

            X11Hwnd hwnd_owner = (X11Hwnd)Hwnd.ObjectFromHandle(handle_owner);

            return(hwnd.SetOwner(hwnd_owner));
        }