protected override void OnRealized()
 {
     WidgetFlags |= WidgetFlags.Realized;
     CreateVideoWindow();
     GdkWindow = Parent.GdkWindow;
     video_window.Reparent(GdkWindow, 0, 0);
     video_window.MoveResize(Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
     video_window.ShowUnraised();
 }
コード例 #2
0
 protected override void OnRealized()
 {
     IsRealized = true;
     CreateVideoWindow();
     Window = Parent.Window;
     video_window.Reparent(Window, 0, 0);
     video_window.MoveResize(Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
     video_window.ShowUnraised();
 }
コード例 #3
0
        protected override void OnRealized()
        {
            WidgetFlags |= WidgetFlags.Realized;

            GdkWindow = Parent.GdkWindow;

            if (video_window != null)
            {
                video_window.Reparent(GdkWindow, 0, 0);
                video_window.MoveResize(Allocation.X, Allocation.Y, Allocation.Width, Allocation.Height);
                video_window.ShowUnraised();
                return;
            }

            Gdk.WindowAttr attributes = new Gdk.WindowAttr();
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.X          = 0;
            attributes.Y          = 0;
            attributes.Width      = Allocation.Width;
            attributes.Height     = Allocation.Height;
            attributes.Visual     = Visual;
            attributes.Wclass     = Gdk.WindowClass.InputOutput;
            attributes.Colormap   = Colormap;
            attributes.EventMask  = (int)(Gdk.EventMask.ExposureMask | Gdk.EventMask.VisibilityNotifyMask);

            Gdk.WindowAttributesType attributes_mask =
                Gdk.WindowAttributesType.X |
                Gdk.WindowAttributesType.Y |
                Gdk.WindowAttributesType.Visual |
                Gdk.WindowAttributesType.Colormap;

            video_window          = new Gdk.Window(GdkWindow, attributes, attributes_mask);
            video_window.UserData = Handle;

            video_window.SetBackPixmap(null, false);

            if (ServiceManager.PlayerEngine.VideoDisplayContextType == VideoDisplayContextType.GdkWindow)
            {
                ServiceManager.PlayerEngine.VideoDisplayContext = video_window.Handle;
            }
            else
            {
                ServiceManager.PlayerEngine.VideoDisplayContext = IntPtr.Zero;
            }
        }
コード例 #4
0
        static void FaultDragMotion(object obj, Gtk.DragMotionArgs args)
        {
            int wx, wy, width, height, depth;

            Gtk.Widget widget = (Gtk.Widget)obj;
            int        px     = args.X + widget.Allocation.X;
            int        py     = args.Y + widget.Allocation.Y;

            Fault fault = FindFault(px, py, widget);

            // If there's a splitter visible, and we're not currently dragging
            // in the fault that owns that splitter, hide it
            if (splitter != null && dragFault != fault)
            {
                DestroySplitter();
            }

            if (dragFault != fault)
            {
                dragFault = fault;
                if (dragFault == null)
                {
                    return;
                }

                splitter = NewWindow(fault.Owner.Wrapped, Gdk.WindowClass.InputOutput);
                fault.Window.GetGeometry(out wx, out wy, out width, out height, out depth);
                if (fault.Orientation == Gtk.Orientation.Horizontal)
                {
                    splitter.MoveResize(wx, wy + height / 2 - FaultOverlap,
                                        width, 2 * FaultOverlap);
                }
                else
                {
                    splitter.MoveResize(wx + width / 2 - FaultOverlap, wy,
                                        2 * FaultOverlap, height);
                }
                splitter.ShowUnraised();
                fault.Window.Lower();
            }
            else if (dragFault == null)
            {
                return;
            }

            Gdk.Drag.Status(args.Context, Gdk.DragAction.Move, args.Time);
            args.RetVal = true;
        }
コード例 #5
0
ファイル: DND.cs プロジェクト: mono/stetic
        static void FaultDragMotion(object obj, Gtk.DragMotionArgs args)
        {
            int wx, wy, width, height, depth;

            Gtk.Widget widget = (Gtk.Widget) obj;
            int px = args.X + widget.Allocation.X;
            int py = args.Y + widget.Allocation.Y;

            Fault fault = FindFault (px, py, widget);

            // If there's a splitter visible, and we're not currently dragging
            // in the fault that owns that splitter, hide it
            if (splitter != null && dragFault != fault)
                DestroySplitter ();

            if (dragFault != fault) {
                dragFault = fault;
                if (dragFault == null)
                    return;

                splitter = NewWindow (fault.Owner.Wrapped, Gdk.WindowClass.InputOutput);
                fault.Window.GetGeometry (out wx, out wy, out width, out height, out depth);
                if (fault.Orientation == Gtk.Orientation.Horizontal) {
                    splitter.MoveResize (wx, wy + height / 2 - FaultOverlap,
                                 width, 2 * FaultOverlap);
                } else {
                    splitter.MoveResize (wx + width / 2 - FaultOverlap, wy,
                                 2 * FaultOverlap, height);
                }
                splitter.ShowUnraised ();
                fault.Window.Lower ();
            } else if (dragFault == null)
                return;

            Gdk.Drag.Status (args.Context, Gdk.DragAction.Move, args.Time);
            args.RetVal = true;
        }
コード例 #6
0
 protected override void OnMapped()
 {
     base.OnMapped();
     video_window.ShowUnraised();
 }