Beispiel #1
0
        public void GetExtents(out int x, out int y, out int w, out int h, Atk.CoordType coordType)
        {
            w = widget.Allocation.Width;
            h = widget.Allocation.Height;

            GetPosition(out x, out y, coordType);
        }
Beispiel #2
0
        bool SetSizeAndPosition(int x, int y, int w, int h, Atk.CoordType coordType, bool setSize)
        {
            if (!widget.IsTopLevel)
            {
                return(false);
            }

            if (coordType == CoordType.Window)
            {
                int x_off, y_off;
                widget.GdkWindow.GetOrigin(out x_off, out y_off);
                x += x_off;
                y += y_off;

                if (x < 0 || y < 0)
                {
                    return(false);
                }
            }

            #pragma warning disable 0612
            widget.SetUposition(x, y);
            #pragma warning restore 0612

            if (setSize)
            {
                widget.SetSizeRequest(w, h);
            }

            return(true);
        }
        public bool Contains(int x, int y, Atk.CoordType coordType)
        {
            int x_extents, y_extents, w, h;

            GetExtents(out x_extents, out y_extents, out w, out h, coordType);
            Gdk.Rectangle extents = new Gdk.Rectangle(x_extents, y_extents, w, h);
            return(extents.Contains(x, y));
        }
Beispiel #4
0
        public void GetPosition(out int x, out int y, Atk.CoordType coordType)
        {
            Gdk.Window window = null;

            if (!widget.IsDrawable)
            {
                x = y = int.MinValue;
                return;
            }

            if (widget.Parent != null)
            {
                x      = widget.Allocation.X;
                y      = widget.Allocation.Y;
                window = widget.ParentWindow;
            }
            else
            {
                x      = 0;
                y      = 0;
                window = widget.GdkWindow;
            }

            int x_window, y_window;

            window.GetOrigin(out x_window, out y_window);
            x += x_window;
            y += y_window;

            if (coordType == Atk.CoordType.Window)
            {
                window = widget.GdkWindow.Toplevel;
                int x_toplevel, y_toplevel;
                window.GetOrigin(out x_toplevel, out y_toplevel);

                x -= x_toplevel;
                y -= y_toplevel;
            }
        }
Beispiel #5
0
 public bool SetPosition(int x, int y, Atk.CoordType coordType)
 {
     return(SetSizeAndPosition(x, y, 0, 0, coordType, false));
 }
Beispiel #6
0
 public bool SetExtents(int x, int y, int w, int h, Atk.CoordType coordType)
 {
     return(SetSizeAndPosition(x, y, w, h, coordType, true));
 }
Beispiel #7
0
 public virtual Atk.Object RefAccessibleAtPoint(int x, int y, Atk.CoordType coordType)
 {
     return(new NoOpObject(widget));
 }