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(); }
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(); }
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; }
public static void AddFault(Stetic.Wrapper.Widget owner, object faultId, Gtk.Orientation orientation, int x, int y, int width, int height) { Gtk.Widget widget = owner.Wrapped; if (!widget.IsRealized) { return; } Gdk.Window win = NewWindow(widget, Gdk.WindowClass.InputOnly); win.MoveResize(x, y, width, height); Hashtable widgetFaults = faultGroups[widget] as Hashtable; if (widgetFaults == null) { faultGroups[widget] = widgetFaults = new Hashtable(); widget.Destroyed += FaultWidgetDestroyed; widget.DragMotion += FaultDragMotion; widget.DragLeave += FaultDragLeave; widget.DragDrop += FaultDragDrop; widget.DragDataReceived += FaultDragDataReceived; DND.DestSet(widget, false); } widgetFaults[win] = new Fault(owner, faultId, orientation, win); }
static void Insensitive_SizeAllocate(object obj, Gtk.SizeAllocatedArgs args) { Gdk.Window win = (Gdk.Window)map[obj]; if (win != null) { win.MoveResize(args.Allocation); } }
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; } }
protected override void OnSizeAllocated(Gdk.Rectangle allocation) { base.OnSizeAllocated(allocation); event_alloc = new Gdk.Rectangle(0, 0, allocation.Width, allocation.Height); if (IsRealized) { event_window.MoveResize(allocation); } }
protected override void OnSizeAllocated(Gdk.Rectangle allocation) { base.OnSizeAllocated(allocation); if (IsRealized) { d_window.MoveResize(allocation); } Reallocate(); }
protected override void OnSizeAllocated(Gdk.Rectangle allocation) { if (!IsRealized) { return; } video_window.MoveResize(allocation); base.OnSizeAllocated(allocation); }
static void Insensitive_Realized(object obj, EventArgs args) { Gtk.Widget widget = (Gtk.Widget)obj; Gdk.WindowAttr attributes = new Gdk.WindowAttr(); attributes.WindowType = Gdk.WindowType.Child; attributes.Wclass = Gdk.WindowClass.InputOnly; attributes.Mask = Gdk.EventMask.ButtonPressMask; Gdk.Window win = new Gdk.Window(widget.GdkWindow, attributes, 0); win.UserData = invis.Handle; win.MoveResize(widget.Allocation); map[widget] = win; map[win] = widget; }
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; }
static void Insensitive_Realized (object obj, EventArgs args) { Gtk.Widget widget = (Gtk.Widget)obj; Gdk.WindowAttr attributes = new Gdk.WindowAttr (); attributes.WindowType = Gdk.WindowType.Child; attributes.Wclass = Gdk.WindowClass.InputOnly; attributes.Mask = Gdk.EventMask.ButtonPressMask; Gdk.Window win = new Gdk.Window (widget.GdkWindow, attributes, 0); win.UserData = invis.Handle; win.MoveResize (widget.Allocation); map[widget] = win; map[win] = widget; }
protected override void OnSizeAllocated(Gdk.Rectangle allocation) { base.OnSizeAllocated(allocation); Gdk.Rectangle childAlloc; int bw = (int)BorderWidth; if (Direction == TextDirection.Rtl) { childAlloc.X = allocation.X + bw; } else { childAlloc.X = allocation.X + allocation.Width - bw; } childAlloc.Y = allocation.Y + bw; Requisition buttonReq = closeButton.SizeRequest(); if (Direction != TextDirection.Rtl) { childAlloc.X -= buttonReq.Width; } childAlloc.Width = buttonReq.Width; childAlloc.Height = buttonReq.Height; closeButton.SizeAllocate(childAlloc); if (Direction == TextDirection.Rtl) { childAlloc.X += buttonReq.Width; } buttonReq = iconifyButton.SizeRequest(); if (Direction != TextDirection.Rtl) { childAlloc.X -= buttonReq.Width; } childAlloc.Width = buttonReq.Width; childAlloc.Height = buttonReq.Height; iconifyButton.SizeAllocate(childAlloc); if (Direction == TextDirection.Rtl) { childAlloc.X += buttonReq.Width; } if (TitleWindow != null) { layout.SetMarkup(title); Gdk.Rectangle area = TitleArea; titleWindow.MoveResize(area.X, area.Y, area.Width, area.Height); if (Icon != null) { area.Width -= icon.Width + 1; } EllipsizeLayout(area.Width); } }