protected override void OnRealized() { SetFlag(Gtk.WidgetFlags.Realized); var attributes = new Gdk.WindowAttr { WindowType = Gdk.WindowType.Child, X = Allocation.X, Y = Allocation.Y, Width = Allocation.Width, Height = Allocation.Height, Wclass = Gdk.WindowClass.InputOutput, Visual = this.Visual, Colormap = this.Colormap, Mask = Gdk.EventMask.VisibilityNotifyMask }; GdkWindow = new Gdk.Window(ParentWindow, attributes, Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap); GdkWindow.SetBackPixmap(null, false); GdkWindow.UserData = Handle; attributes = new Gdk.WindowAttr { WindowType = Gdk.WindowType.Child, X = (int)-Hadjustment.Value, Y = (int)-Vadjustment.Value, Width = (int)Math.Max(Width, Allocation.Width), Height = (int)Math.Max(Height, Allocation.Height), Wclass = Gdk.WindowClass.InputOutput, Visual = this.Visual, Colormap = this.Colormap, Mask = Gdk.EventMask.ExposureMask | Gdk.EventMask.ScrollMask | this.Events }; bin_window = new Gdk.Window(GdkWindow, attributes, Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap) { UserData = Handle }; Style.Attach(GdkWindow); Style.SetBackground(bin_window, Gtk.StateType.Normal); foreach (var child in children) { child.Widget.ParentWindow = bin_window; } }
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; } }
private void CreateVideoWindow() { if (video_window != null) { return; } var attributes = new Gdk.WindowAttr() { WindowType = Gdk.WindowType.Child, X = 0, Y = 0, Width = 0, Height = 0, Visual = Visual, Wclass = Gdk.WindowClass.InputOutput, Colormap = Colormap, 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(null, attributes, attributes_mask); video_window.UserData = Handle; video_window.SetBackPixmap(null, false); if (ServiceManager.PlayerEngine.VideoDisplayContextType == VideoDisplayContextType.GdkWindow) { ServiceManager.PlayerEngine.VideoDisplayContext = video_window.Handle; ServiceManager.PlayerEngine.VideoWindowRealize(video_window.Handle); } else { ServiceManager.PlayerEngine.VideoDisplayContext = IntPtr.Zero; } }
protected override void OnRealized() { WidgetFlags |= WidgetFlags.Realized; Gdk.WindowAttr attributes = new Gdk.WindowAttr(); attributes.X = Allocation.X; attributes.Y = Allocation.Y; attributes.Height = Allocation.Height; attributes.Width = Allocation.Width; attributes.WindowType = Gdk.WindowType.Child; attributes.Wclass = Gdk.WindowClass.InputOutput; attributes.Visual = Visual; attributes.Colormap = Colormap; attributes.EventMask = (int)(Events | Gdk.EventMask.ExposureMask | Gdk.EventMask.Button1MotionMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask); Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Colormap | Gdk.WindowAttributesType.Visual; GdkWindow = new Gdk.Window(ParentWindow, attributes, (int)attributes_mask); GdkWindow.UserData = Handle; Style = Style.Attach(GdkWindow); Style.SetBackground(GdkWindow, State); GdkWindow.SetBackPixmap(null, true); if (Child != null) { Child.ParentWindow = GdkWindow; } if (grip != null) { grip.ParentWindow = GdkWindow; } }
protected override void OnRealized() { WidgetFlags |= WidgetFlags.Realized; Gdk.WindowAttr attributes = new Gdk.WindowAttr (); attributes.X = Allocation.X; attributes.Y = Allocation.Y; attributes.Height = Allocation.Height; attributes.Width = Allocation.Width; attributes.WindowType = Gdk.WindowType.Child; attributes.Wclass = Gdk.WindowClass.InputOutput; attributes.Visual = Visual; attributes.Colormap = Colormap; attributes.EventMask = (int)(Events | Gdk.EventMask.ExposureMask | Gdk.EventMask.Button1MotionMask | Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask); Gdk.WindowAttributesType attributes_mask = Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Colormap | Gdk.WindowAttributesType.Visual; GdkWindow = new Gdk.Window (ParentWindow, attributes, (int)attributes_mask); GdkWindow.UserData = Handle; Style = Style.Attach (GdkWindow); Style.SetBackground (GdkWindow, State); GdkWindow.SetBackPixmap (null, true); if (Child != null) Child.ParentWindow = GdkWindow; if (grip != null) grip.ParentWindow = GdkWindow; }
protected override void OnRealized() { SetFlag (Gtk.WidgetFlags.Realized); Gdk.WindowAttr attributes = new Gdk.WindowAttr { WindowType = Gdk.WindowType.Child, X = Allocation.X, Y = Allocation.Y, Width = Allocation.Width, Height = Allocation.Height, Wclass = Gdk.WindowClass.InputOutput, Visual = this.Visual, Colormap = this.Colormap, Mask = Gdk.EventMask.VisibilityNotifyMask }; GdkWindow = new Gdk.Window (ParentWindow, attributes, Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap); GdkWindow.SetBackPixmap (null, false); GdkWindow.UserData = Handle; attributes = new Gdk.WindowAttr { WindowType = Gdk.WindowType.Child, X = (int)-Hadjustment.Value, Y = (int)-Vadjustment.Value, Width = (int)Math.Max (width, Allocation.Width), Height = (int)Math.Max (height, Allocation.Height), Wclass = Gdk.WindowClass.InputOutput, Visual = this.Visual, Colormap = this.Colormap, Mask = Gdk.EventMask.ExposureMask | Gdk.EventMask.ScrollMask | this.Events }; bin_window = new Gdk.Window (GdkWindow, attributes, Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.Y | Gdk.WindowAttributesType.Visual | Gdk.WindowAttributesType.Colormap); bin_window.UserData = Handle; Style.Attach (GdkWindow); Style.SetBackground (bin_window, Gtk.StateType.Normal); foreach (var child in children) { child.Widget.ParentWindow = bin_window; } }
private void CreateVideoWindow () { if (video_window != null) { return; } var attributes = new Gdk.WindowAttr () { WindowType = Gdk.WindowType.Child, X = 0, Y = 0, Width = 0, Height = 0, Visual = Visual, Wclass = Gdk.WindowClass.InputOutput, Colormap = Colormap, 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 (null, attributes, attributes_mask); video_window.UserData = Handle; video_window.SetBackPixmap (null, false); if (ServiceManager.PlayerEngine.VideoDisplayContextType == VideoDisplayContextType.GdkWindow) { ServiceManager.PlayerEngine.VideoDisplayContext = video_window.Handle; ServiceManager.PlayerEngine.VideoWindowRealize (video_window.Handle); } else { ServiceManager.PlayerEngine.VideoDisplayContext = IntPtr.Zero; } }