[X11] Remove unused XCreateWindow overloads

This commit is contained in:
thefiddler 2014-06-17 08:51:00 +02:00
parent e39e4fbb37
commit 7accefea3e
3 changed files with 26 additions and 28 deletions

View file

@ -117,24 +117,6 @@ namespace OpenTK.Platform.X11
#region Window handling
[Obsolete("Use XCreateWindow instead")]
[DllImport(_dll_name, EntryPoint = "XCreateWindow")]
public extern static Window CreateWindow(
Display display,
Window parent,
int x, int y,
//uint width, uint height,
int width, int height,
//uint border_width,
int border_width,
int depth,
//uint @class,
int @class,
IntPtr visual,
[MarshalAs(UnmanagedType.SysUInt)] CreateWindowMask valuemask,
SetWindowAttributes attributes
);
[DllImport(_dll_name, EntryPoint = "XCreateSimpleWindow")]
public extern static Window CreateSimpleWindow(
Display display,
@ -1462,10 +1444,26 @@ XF86VidModeGetGammaRampSize(
/// <para>The XCreateSimpleWindow function creates an unmapped InputOutput subwindow for a specified parent window, returns the window ID of the created window, and causes the X server to generate a CreateNotify event. The created window is placed on top in the stacking order with respect to siblings. Any part of the window that extends outside its parent window is clipped. The border_width for an InputOnly window must be zero, or a BadMatch error results. XCreateSimpleWindow inherits its depth, class, and visual from its parent. All other window attributes, except background and border, have their default values. </para>
/// <para>XCreateSimpleWindow can generate BadAlloc, BadMatch, BadValue, and BadWindow errors.</para>
/// </remarks>
[DllImport(X11Library, EntryPoint = "XCreateWindow")]//, CLSCompliant(false)]
public extern static Window XCreateWindow(Display display, Window parent,
public static Window XCreateWindow(Display display, Window parent,
int x, int y, int width, int height, int border_width, int depth,
int @class, IntPtr visual, UIntPtr valuemask, ref XSetWindowAttributes attributes);
CreateWindowArgs @class, IntPtr visual, SetWindowValuemask valuemask,
XSetWindowAttributes? attributes)
{
unsafe
{
if (attributes.HasValue)
{
XSetWindowAttributes attr = attributes.Value;
return XCreateWindow(display, parent, x, y, width, height, border_width, depth,
(int)@class, visual, (IntPtr)valuemask, &attr);
}
else
{
return XCreateWindow(display, parent, x, y, width, height, border_width, depth,
(int)@class, visual, (IntPtr)valuemask, null);
}
}
}
#endregion

View file

@ -71,10 +71,8 @@ namespace OpenTK.Platform.X11
[DllImport("libX11", EntryPoint = "XSynchronize")]
public extern static IntPtr XSynchronize(IntPtr display, bool onoff);
//[DllImport("libX11", EntryPoint = "XCreateWindow"), CLSCompliant(false)]
//public extern static IntPtr XCreateWindow(IntPtr display, IntPtr parent, int x, int y, int width, int height, int border_width, int depth, int xclass, IntPtr visual, UIntPtr valuemask, ref XSetWindowAttributes attributes);
[DllImport("libX11", EntryPoint = "XCreateWindow")]
public extern static IntPtr XCreateWindow(IntPtr display, IntPtr parent, int x, int y, int width, int height, int border_width, int depth, int xclass, IntPtr visual, IntPtr valuemask, ref XSetWindowAttributes attributes);
public unsafe extern static IntPtr XCreateWindow(IntPtr display, IntPtr parent, int x, int y, int width, int height, int border_width, int depth, int xclass, IntPtr visual, IntPtr valuemask, XSetWindowAttributes* attributes);
[DllImport("libX11", EntryPoint = "XCreateSimpleWindow")]//, CLSCompliant(false)]
public extern static IntPtr XCreateSimpleWindow(IntPtr display, IntPtr parent, int x, int y, int width, int height, int border_width, UIntPtr border, UIntPtr background);
@ -103,7 +101,8 @@ namespace OpenTK.Platform.X11
[DllImport("libX11")]
public extern static Bool XCheckTypedEvent(Display display, XEventName event_type, out XEvent event_return);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.Bool)]
public delegate Bool EventPredicate(IntPtr display, ref XEvent e, IntPtr arg);
[DllImport("libX11")]
public extern static Bool XIfEvent(Display display, ref XEvent e, IntPtr predicate, IntPtr arg );

View file

@ -181,12 +181,13 @@ namespace OpenTK.Platform.X11
EventMask.PropertyChangeMask;
attributes.event_mask = (IntPtr)window.EventMask;
uint mask = (uint)SetWindowValuemask.ColorMap | (uint)SetWindowValuemask.EventMask |
(uint)SetWindowValuemask.BackPixel | (uint)SetWindowValuemask.BorderPixel;
SetWindowValuemask mask =
SetWindowValuemask.ColorMap | SetWindowValuemask.EventMask |
SetWindowValuemask.BackPixel | SetWindowValuemask.BorderPixel;
window.Handle = Functions.XCreateWindow(window.Display, window.RootWindow,
x, y, width, height, 0, window.VisualInfo.Depth/*(int)CreateWindowArgs.CopyFromParent*/,
(int)CreateWindowArgs.InputOutput, window.VisualInfo.Visual, (UIntPtr)mask, ref attributes);
CreateWindowArgs.InputOutput, window.VisualInfo.Visual, mask, attributes);
if (window.Handle == IntPtr.Zero)
throw new ApplicationException("XCreateWindow call failed (returned 0).");