From e6541b353e7a0ecfd2e514e5c9c6f6c9c1ba96b1 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bruyère Date: Tue, 13 Nov 2018 14:48:41 +0100 Subject: first try with xlib --- src/XLib/NativeMethods.cs | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/XLib/NativeMethods.cs (limited to 'src/XLib/NativeMethods.cs') diff --git a/src/XLib/NativeMethods.cs b/src/XLib/NativeMethods.cs new file mode 100644 index 00000000..ed6fa7d5 --- /dev/null +++ b/src/XLib/NativeMethods.cs @@ -0,0 +1,48 @@ +using System; +using System.Runtime.InteropServices; + +namespace XLib +{ + public static class NativeMethods + { + #region pinvoke + [DllImportAttribute("X11")] + public static extern int XInitThreads(); + [DllImportAttribute("X11")] + public static extern IntPtr XOpenDisplay(IntPtr displayName); + [DllImportAttribute("X11")] + public static extern IntPtr XCloseDisplay(IntPtr disp); + [DllImportAttribute("X11")] + public static extern Int32 XDefaultScreen(IntPtr disp); + [DllImportAttribute("X11")] + public static extern IntPtr XDefaultRootWindow(IntPtr disp); + [DllImportAttribute("X11")] + public static extern UInt32 XDefaultDepth (IntPtr disp, Int32 screen); + [DllImportAttribute("X11")] + public static extern IntPtr XDefaultVisual(IntPtr disp, Int32 screen); + [DllImportAttribute("X11")] + public static extern IntPtr XCreateSimpleWindow(IntPtr disp, IntPtr rootWindow, Int32 x, Int32 y, UInt32 width, UInt32 height, + UInt32 borderWidth, IntPtr border, IntPtr background); + [DllImportAttribute("X11")] + public static extern IntPtr XCreatePixmap(IntPtr disp, IntPtr rootWindow, UInt32 width, UInt32 height, UInt32 depth); + [DllImportAttribute("X11")] + public static extern IntPtr XFreePixmap(IntPtr disp, IntPtr pixmap); + [DllImportAttribute("X11")] + public static extern Int32 XSelectInput(IntPtr disp, IntPtr win, EventMask eventMask); + [DllImportAttribute("X11")] + public static extern Int32 XMapWindow(IntPtr disp, IntPtr win); + [DllImportAttribute("X11")] + public static extern int XPending (IntPtr disp); + [DllImportAttribute("X11")] + public static extern IntPtr XNextEvent(IntPtr disp, ref XEvent xevent); + [DllImportAttribute("X11")] + public static extern Int32 XSync(IntPtr disp, int discard); + [DllImportAttribute("X11")] + public static extern int XConnectionNumber(IntPtr disp); + [DllImportAttribute("X11")] + public static extern IntPtr XSetErrorHandler(XErrorHandler error_handler); + #endregion + + + } +} -- cgit v1.3.1-4-g156e