예제 #1
0
 bool FadeToTarget()
 {
     //Log.Debug ("op {0}\ttarget{1}", opacity, target);
     Visible = (opacity > 0.05);
     if (Math.Abs(target - opacity) < .05)
     {
         return(false);
     }
     if (target > opacity)
     {
         opacity += .04;
     }
     else
     {
         opacity -= .04;
     }
     if (Visible)
     {
         CompositeUtils.SetWinOpacity(this, opacity);
     }
     else
     {
         Hide();
     }
     return(true);
 }
예제 #2
0
        protected override void OnRealized()
        {
            use_shape_ext = !(CompositeUtils.IsComposited(Screen) && CompositeUtils.SetRgbaColormap(this));

            base.OnRealized();
            ShapeWindow();
        }
        protected override void OnRealized()
        {
#if FALSE
            if (CompositeUtils.IsComposited(Screen) && CompositeUtils.SetRgbaColormap(this))
            {
                Console.WriteLine("Set Rba");
            }
#endif

            if (glx != null)
            {
                glx.Destroy();
            }

            int [] attr = new int [] {
                (int)GdkGlx.GlxAttribute.Rgba,
                (int)GdkGlx.GlxAttribute.DepthSize, 16,
                (int)GdkGlx.GlxAttribute.DoubleBuffer,
                (int)GdkGlx.GlxAttribute.None
            };

            glx      = new GdkGlx.Context(Screen, attr);
            Colormap = glx.GetColormap();

            base.OnRealized();
        }
        protected override void OnRealized()
        {
            bool composited = CompositeUtils.IsComposited(Screen) && CompositeUtils.SetRgbaColormap(this);

            AppPaintable = composited;
            base.OnRealized();
        }
예제 #5
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();
        }
예제 #6
0
        protected override void OnRealized()
        {
            composited   = CompositeUtils.IsComposited(Screen) && CompositeUtils.SetRgbaColormap(this);
            AppPaintable = composited;

            base.OnRealized();

            ShapeWindow();
            Relocate();
        }
예제 #7
0
        public void HandleMapped(object sender, EventArgs args)
        {
            composited = CompositeUtils.SupportsHint(win.Screen, "_NET_WM_WINDOW_OPACITY");
            if (!composited)
            {
                return;
            }

            CompositeUtils.SetWinOpacity(win, 0.0);
        }
예제 #8
0
        protected override void OnRealized()
        {
            composited   = Screen.IsComposited && CompositeUtils.SetRgbaVisual(this);
            AppPaintable = composited;

            base.OnRealized();

            Window.OverrideRedirect = true;

            ShapeWindow();
            Relocate();
        }
        bool FadeToTarget(double target)
        {
            Realize();
            CompositeUtils.SetWinOpacity(this, target);
            Visible = target > 0.0;

            if (Visible)
            {
                hide.Stop();
                hide.Start();
            }

            return(false);
        }
예제 #10
0
        public bool Update()
        {
            double percent = Math.Min((DateTime.Now - start).Ticks / (double)duration.Ticks, 1.0);
            double opacity = Math.Sin(percent * Math.PI * 0.5) * target_opacity;

            CompositeUtils.SetWinOpacity(win, opacity);

            bool stop = opacity >= target_opacity;

            if (stop)
            {
                fade_delay.Stop();
            }

            return(!stop);
        }
예제 #11
0
        private void SetView(FSpot.PhotoImageView view)
        {
            this.view.PhotoChanged -= HandlePhotoChanged;
            this.view = view;
            this.view.PhotoChanged += HandlePhotoChanged;


            if (view.Toplevel is FullScreenView && Dialog.IsRealized)
            {
                CompositeUtils.SetWinOpacity(Dialog, 0.5);
            }
            else
            {
                CompositeUtils.SetWinOpacity(Dialog, 1.0);
            }
        }