protected override bool OnExposeEvent(Gdk.EventExpose args)
        {
            int     round = 12;
            Context g     = CairoUtils.CreateContext(GdkWindow);

            g.Operator = Operator.Source;
            g.Source   = new SolidPattern(new Cairo.Color(0, 0, 0, 0));
            g.Paint();
            g.Operator = Operator.Over;
#if true
            g.Source = new SolidPattern(new Cairo.Color(0, 0, 0, .7));
            g.MoveTo(round, 0);
            //g.LineTo (Allocation.Width - round, 0);
            g.Arc(Allocation.Width - round, round, round, -Math.PI * 0.5, 0);
            //g.LineTo (Allocation.Width, Allocation.Height - round);
            g.Arc(Allocation.Width - round, Allocation.Height - round, round, 0, Math.PI * 0.5);
            //g.LineTo (round, Allocation.Height);
            g.Arc(round, Allocation.Height - round, round, Math.PI * 0.5, Math.PI);
            g.Arc(round, round, round, Math.PI, Math.PI * 1.5);
            g.ClosePath();
            g.Fill();
#endif
            ((IDisposable)g).Dispose();
            return(base.OnExposeEvent(args));
        }
예제 #2
0
        private void ShapeWindow()
        {
            Layout();
            Gdk.Pixmap bitmap = new Gdk.Pixmap(GdkWindow,
                                               Allocation.Width,
                                               Allocation.Height, 1);

            Context g = CairoUtils.CreateContext(bitmap);

            DrawShape(g, Allocation.Width, Allocation.Height);
            ((IDisposable)g).Dispose();

            if (use_shape_ext)
            {
                ShapeCombineMask(bitmap, 0, 0);
            }
            else
            {
                Context rgba = CairoUtils.CreateContext(GdkWindow);
                DrawShape(rgba, Allocation.Width, Allocation.Height);
                ((IDisposable)rgba).Dispose();
                try {
                    CompositeUtils.InputShapeCombineMask(this, bitmap, 0, 0);
                } catch (EntryPointNotFoundException) {
                    System.Console.WriteLine("Warning: gtk+ version doesn't support input shapping");
                }
            }
            bitmap.Dispose();
        }
예제 #3
0
        protected override bool OnExposeEvent(Gdk.EventExpose args)
        {
            Context g = CairoUtils.CreateContext(GdkWindow);

            DrawShape(g, Allocation.Width, Allocation.Height);
            //base.OnExposeEvent (args);
            ((IDisposable)g).Dispose();
            return(false);
        }
        protected override bool OnExposeEvent(Gdk.EventExpose args)
        {
            Gdk.Color c  = Style.Background(State);
            Context   cr = CairoUtils.CreateContext(GdkWindow);

            ShapeSurface(cr, new Cairo.Color(c.Red / (double)ushort.MaxValue,
                                             c.Blue / (double)ushort.MaxValue,
                                             c.Green / (double)ushort.MaxValue,
                                             0.8));

            ((IDisposable)cr).Dispose();
            return(base.OnExposeEvent(args));
        }
        private void ShapeWindow()
        {
            if (composited)
            {
                return;
            }

            Gdk.Pixmap bitmap = new Gdk.Pixmap(GdkWindow,
                                               Allocation.Width,
                                               Allocation.Height, 1);

            Context cr = CairoUtils.CreateContext(bitmap);

            ShapeCombineMask(bitmap, 0, 0);
            ShapeSurface(cr, new Cairo.Color(1, 1, 1));
            ShapeCombineMask(bitmap, 0, 0);
            ((IDisposable)cr).Dispose();
            bitmap.Dispose();
        }