public static void RedirectDrawable(Drawable d) { uint xid = GdkUtils.GetXid(d); Log.Debug($"xid = {xid} d.handle = {d.Handle}, d.Display.Handle = {d.Display.Handle}"); XCompositeRedirectWindow(GdkUtils.GetXDisplay(d.Display), GdkUtils.GetXid(d), CompositeRedirect.Manual); }
public static void RedirectDrawable(Drawable d) { uint xid = GdkUtils.GetXid(d); Log.DebugFormat("xid = {0} d.handle = {1}, d.Display.Handle = {2}", xid, d.Handle, d.Display.Handle); XCompositeRedirectWindow(GdkUtils.GetXDisplay(d.Display), GdkUtils.GetXid(d), CompositeRedirect.Manual); }
private bool HideCursor() { if (empty_cursor == null) { empty_cursor = GdkUtils.CreateEmptyCursor(GdkWindow.Display); } this.GdkWindow.Cursor = empty_cursor; view.GdkWindow.Cursor = empty_cursor; return(false); }
bool HideCursor() { if (View.InPanMotion) { return(false); } if (empty_cursor == null) { empty_cursor = GdkUtils.CreateEmptyCursor(GdkWindow.Display); } this.GdkWindow.Cursor = empty_cursor; View.GdkWindow.Cursor = empty_cursor; return(false); }
public Context(Gdk.Screen screen, Context share_list, int [] attr) { IntPtr xdisplay = GdkUtils.GetXDisplay(screen.Display); IntPtr visual_info = IntPtr.Zero; // Be careful about the first glx call and handle the exception // with more grace. try { visual_info = glXChooseVisual(xdisplay, screen.Number, attr); } catch (DllNotFoundException e) { throw new GlxException("Unable to find OpenGL libarary", e); } catch (EntryPointNotFoundException enf) { throw new GlxException("Unable to find Glx entry point", enf); } if (visual_info == IntPtr.Zero) { throw new GlxException("Unable to find matching visual"); } XVisualInfo xinfo = (XVisualInfo)Marshal.PtrToStructure(visual_info, typeof(XVisualInfo)); HandleRef share = share_list != null ? share_list.Handle : new HandleRef(null, IntPtr.Zero); IntPtr tmp = glXCreateContext(xdisplay, visual_info, share, true); if (tmp == IntPtr.Zero) { throw new GlxException("Unable to create context"); } handle = new HandleRef(this, tmp); visual = GdkUtils.LookupVisual(screen, xinfo.visualid); if (visual_info != IntPtr.Zero) { XFree(visual_info); } }
private string GetIconString(Tag tag) { if (tag.ThemeIconName != null) { return(STOCK_ICON_DB_PREFIX + tag.ThemeIconName); } if (tag.Icon == null) { if (tag.IconWasCleared) { return(String.Empty); } return(null); } byte [] data = GdkUtils.Serialize(tag.Icon); return(Convert.ToBase64String(data)); }
public Gdk.Colormap GetColormap(Gdk.Screen screen, ) { DrawableFormat template = new DrawableFormat(); template.Color = new ColorFormat(); FormatMask mask = FormatMask.None; int num = screen.Number; IntPtr dformat = GlitzAPI.glitz_glx_find_window_format(GdkUtils.GetXDisplay(screen.Display), num, mask, ref template, 0); visual_info = GlitzAPI.glitz_glx_get_visual_info_from_format(dpy, scr, dformat); Gdk.Visual visual = new Gdk.Visual(gdkx_visual_get(XVisualIDFromVisual(vinfo))); new Gdk.Colormap(visual, true); * / }
static void SetIconFromString(Tag tag, string icon_string) { if (icon_string == null) { tag.Icon = null; // IconWasCleared automatically set already, override // it in this case since it was NULL in the db. tag.IconWasCleared = false; } else if (icon_string == String.Empty) { tag.Icon = null; } else if (icon_string.StartsWith(STOCK_ICON_DB_PREFIX)) { tag.ThemeIconName = icon_string.Substring(STOCK_ICON_DB_PREFIX.Length); } else { tag.Icon = GdkUtils.Deserialize(Convert.FromBase64String(icon_string)); } }
public FullSlide(Gtk.Window parent, IBrowsableItem [] items) : base("Slideshow") { screenshot = PixbufUtils.LoadFromScreen(parent.GdkWindow); this.Destroyed += HandleDestroyed; this.TransientFor = parent; this.ButtonPressEvent += HandleSlideViewButtonPressEvent; this.KeyPressEvent += HandleSlideViewKeyPressEvent; this.AddEvents((int)(EventMask.ButtonPressMask | EventMask.KeyPressMask | EventMask.PointerMotionMask)); slideview = new SlideView(screenshot, items); this.Add(slideview); this.Decorated = false; this.Fullscreen(); this.Realize(); busy = new Gdk.Cursor(Gdk.CursorType.Watch); this.GdkWindow.Cursor = busy; none = GdkUtils.CreateEmptyCursor(GdkWindow.Display); hide = new Delay(2000, new GLib.IdleHandler(HideCursor)); }
public void SwapBuffers(Gdk.Drawable drawable) { glXSwapBuffers(GdkUtils.GetXDisplay(drawable.Display), GdkUtils.GetXid(drawable)); }
public bool MakeCurrent(Gdk.Drawable drawable) { return(glXMakeCurrent(GdkUtils.GetXDisplay(drawable.Display), GdkUtils.GetXid(drawable), Handle)); }
public void Destroy() { glXDestroyContext(GdkUtils.GetXDisplay(visual.Screen.Display), Handle); }