Пример #1
0
        public void XorRect(Gdk.Rectangle rect)
        {
            if (xorGC == null)
            {
                if (IsRealized)
                {
                    Gdk.GCValues values = new Gdk.GCValues();
                    values.Function      = Gdk.Function.Invert;
                    values.SubwindowMode = Gdk.SubwindowMode.IncludeInferiors;
                    xorGC = new Gdk.GC(GdkWindow);
                    xorGC.SetValues(values, Gdk.GCValuesMask.Function |
                                    Gdk.GCValuesMask.Subwindow);
                }
                else
                {
                    return;
                }
            }

            xorGC.SetLineAttributes(1, Gdk.LineStyle.OnOffDash,
                                    Gdk.CapStyle.NotLast,
                                    Gdk.JoinStyle.Bevel);
            xorGC.SetDashes(1, new sbyte[] { 1, 1 }, 2);

            GdkWindow.DrawRectangle(xorGC, false, rect.X, rect.Y,
                                    rect.Width, rect.Height);

            xorGC.SetDashes(0, new sbyte[] { 1, 1 }, 2);

            GdkWindow.DrawRectangle(xorGC, false, rect.X + 1,
                                    rect.Y + 1, rect.Width - 2,
                                    rect.Height - 2);
        }
Пример #2
0
        private void XorRect()
        {
            rectDrawn = !rectDrawn;

            if (rectOwner != null)
            {
                Gdk.Rectangle rect = new Gdk.Rectangle(request.X,
                                                       request.Y,
                                                       request.Width,
                                                       request.Height);
                rectOwner.XorRect(rect);
                return;
            }

            Gdk.Window window = Gdk.Global.DefaultRootWindow;

            if (rootXorGC == null)
            {
                Gdk.GCValues values = new Gdk.GCValues();
                values.Function      = Gdk.Function.Invert;
                values.SubwindowMode = Gdk.SubwindowMode.IncludeInferiors;

                rootXorGC = new Gdk.GC(window);
                rootXorGC.SetValues(values, Gdk.GCValuesMask.Function |
                                    Gdk.GCValuesMask.Subwindow);
            }

            rootXorGC.SetLineAttributes(1, Gdk.LineStyle.OnOffDash,
                                        Gdk.CapStyle.NotLast,
                                        Gdk.JoinStyle.Bevel);

            rootXorGC.SetDashes(1, new sbyte[] { 1, 1 }, 2);

            window.DrawRectangle(rootXorGC, false, request.X, request.Y,
                                 request.Width, request.Height);

            rootXorGC.SetDashes(0, new sbyte[] { 1, 1 }, 2);

            window.DrawRectangle(rootXorGC, false, request.X + 1,
                                 request.Y + 1, request.Width - 2,
                                 request.Height - 2);
        }
Пример #3
0
        private void XorRect()
        {
            rectDrawn = !rectDrawn;

            if (rectOwner != null) {
                Gdk.Rectangle rect = new Gdk.Rectangle (request.X,
                                        request.Y,
                                        request.Width,
                                        request.Height);
                rectOwner.XorRect (rect);
                return;
            }

            Gdk.Window window = Gdk.Global.DefaultRootWindow;

            if (rootXorGC == null) {
                Gdk.GCValues values = new Gdk.GCValues ();
                values.Function = Gdk.Function.Invert;
                values.SubwindowMode = Gdk.SubwindowMode.IncludeInferiors;

                rootXorGC = new Gdk.GC (window);
                rootXorGC.SetValues (values, Gdk.GCValuesMask.Function |
                             Gdk.GCValuesMask.Subwindow);
            }

            rootXorGC.SetLineAttributes (1, Gdk.LineStyle.OnOffDash,
                             Gdk.CapStyle.NotLast,
                             Gdk.JoinStyle.Bevel);

            rootXorGC.SetDashes (1, new sbyte[] {1, 1}, 2);

            window.DrawRectangle (rootXorGC, false, request.X, request.Y,
                          request.Width, request.Height);

            rootXorGC.SetDashes (0, new sbyte[] {1, 1}, 2);

            window.DrawRectangle (rootXorGC, false, request.X + 1,
                          request.Y + 1, request.Width - 2,
                          request.Height - 2);
        }
Пример #4
0
        public void XorRect(Gdk.Rectangle rect)
        {
            if (xorGC == null) {
                if (IsRealized) {
                    Gdk.GCValues values = new Gdk.GCValues ();
                    values.Function = Gdk.Function.Invert;
                    values.SubwindowMode = Gdk.SubwindowMode.IncludeInferiors;
                    xorGC = new Gdk.GC (GdkWindow);
                    xorGC.SetValues (values, Gdk.GCValuesMask.Function |
                             Gdk.GCValuesMask.Subwindow);
                } else {
                    return;
                }
            }

            xorGC.SetLineAttributes (1, Gdk.LineStyle.OnOffDash,
                         Gdk.CapStyle.NotLast,
                         Gdk.JoinStyle.Bevel);
            xorGC.SetDashes (1, new sbyte[] { 1, 1}, 2);

            GdkWindow.DrawRectangle (xorGC, false, rect.X, rect.Y,
                         rect.Width, rect.Height);

            xorGC.SetDashes (0, new sbyte[] { 1, 1}, 2);

            GdkWindow.DrawRectangle (xorGC, false, rect.X + 1,
                         rect.Y + 1, rect.Width - 2,
                         rect.Height - 2);
        }