Esempio n. 1
0
        private void ShapeWindow()
        {
            Layout();
            Gdk.Pixmap bitmap = new Gdk.Pixmap(GdkWindow,
                                               Allocation.Width,
                                               Allocation.Height, 1);

            Context g = CairoHelper.Create(bitmap);

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

            ((IDisposable)g).Dispose();

            if (use_shape_ext)
            {
                ShapeCombineMask(bitmap, 0, 0);
            }
            else
            {
                Cairo.Context rgba = CairoHelper.Create(GdkWindow);
                DrawShape(rgba, Allocation.Width, Allocation.Height);
                ((IDisposable)rgba).Dispose();
                try {
                    CompositeUtils.InputShapeCombineMask(this, bitmap, 0, 0);
                } catch (EntryPointNotFoundException) {
                    Log.Warning("gtk+ version doesn't support input shapping");
                }
            }
            bitmap.Dispose();
        }
Esempio n. 2
0
 void DisposeBgBuffer()
 {
     if (buffer != null)
     {
         buffer.Dispose();
         buffer = null;
     }
     if (flipBuffer != null)
     {
         flipBuffer.Dispose();
         flipBuffer = null;
     }
 }
Esempio n. 3
0
        private void ShapeWindow()
        {
            Layout ();
            Gdk.Pixmap bitmap = new Gdk.Pixmap (GdkWindow,
                                Allocation.Width,
                                Allocation.Height, 1);

            #if CAIRO_1_2_5
            Context g = CairoHelper.Create (bitmap);
            #else
            Context g = CairoUtils.CreateContext (bitmap);
            #endif
            DrawShape (g, Allocation.Width, Allocation.Height);

            ((IDisposable)g).Dispose ();

            if (use_shape_ext)
                ShapeCombineMask (bitmap, 0, 0);
            else {
            #if CAIRO_1_2_5
                Cairo.Context rgba = CairoHelper.Create (GdkWindow);
            #else
                Context rgba = CairoUtils.CreateContext (GdkWindow);
            #endif
                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 ();
        }