Suppressed documentation warnings and ensured public structures follow the class library design guidelines.

This commit is contained in:
the_fiddler 2009-08-11 21:11:39 +00:00
parent 4b9e25af03
commit 6e7c2a2e3e
6 changed files with 31 additions and 21 deletions

View file

@ -586,27 +586,31 @@ XF86VidModeGetGammaRampSize(
#region internal class XVisualInfo #region internal class XVisualInfo
#pragma warning disable 1591
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct XVisualInfo public struct XVisualInfo
{ {
public IntPtr visual; public IntPtr Visual;
public VisualID visualid; public VisualID VisualID;
public int screen; public int Screen;
public int depth; public int Depth;
public XVisualClass @class; public XVisualClass Class;
public long redMask; public long RedMask;
public long greenMask; public long GreenMask;
public long blueMask; public long blueMask;
public int colormap_size; public int ColormapSize;
public int bits_per_rgb; public int BitsPerRgb;
public override string ToString() public override string ToString()
{ {
return String.Format("id ({0}), screen ({1}), depth ({2}), class ({3})", return String.Format("id ({0}), screen ({1}), depth ({2}), class ({3})",
visualid, screen, depth, @class); VisualID, Screen, Depth, Class);
} }
} }
#pragma warning restore 1591
#endregion #endregion
#region internal class SetWindowAttributes #region internal class SetWindowAttributes
@ -1254,6 +1258,8 @@ XF86VidModeGetGammaRampSize(
#endregion #endregion
#pragma warning disable 1591
public enum XVisualClass : int public enum XVisualClass : int
{ {
StaticGray = 0, StaticGray = 0,
@ -1264,6 +1270,8 @@ XF86VidModeGetGammaRampSize(
DirectColor = 5, DirectColor = 5,
} }
#pragma warning restore 1591
[Flags] [Flags]
internal enum XVisualInfoMask internal enum XVisualInfoMask
{ {

View file

@ -834,7 +834,7 @@ namespace OpenTK.Platform.X11
XK_Hyper_R = 0xFFEE, XK_Hyper_R = 0xFFEE,
} }
#pragma warning disable 1591
[Flags] [Flags]
public enum EventMask public enum EventMask
@ -867,6 +867,8 @@ namespace OpenTK.Platform.X11
OwnerGrabButtonMask = 1 << 24 OwnerGrabButtonMask = 1 << 24
} }
#pragma warning restore 1591
internal enum GrabMode internal enum GrabMode
{ {
GrabModeSync = 0, GrabModeSync = 0,

View file

@ -154,8 +154,8 @@ namespace OpenTK.Platform.X11
XVisualInfo SelectVisual(GraphicsMode mode, X11WindowInfo currentWindow) XVisualInfo SelectVisual(GraphicsMode mode, X11WindowInfo currentWindow)
{ {
XVisualInfo info = new XVisualInfo(); XVisualInfo info = new XVisualInfo();
info.visualid = (IntPtr)mode.Index; info.VisualID = (IntPtr)mode.Index;
info.screen = currentWindow.Screen; info.Screen = currentWindow.Screen;
int items; int items;
lock (API.Lock) lock (API.Lock)

View file

@ -30,16 +30,16 @@ namespace OpenTK.Platform.X11
X11WindowInfo window = (X11WindowInfo)this.WindowInfo; X11WindowInfo window = (X11WindowInfo)this.WindowInfo;
XVisualInfo info = new XVisualInfo(); XVisualInfo info = new XVisualInfo();
info.visualid = mode.Index; info.VisualID = mode.Index;
int dummy; int dummy;
window.VisualInfo = (XVisualInfo)Marshal.PtrToStructure( window.VisualInfo = (XVisualInfo)Marshal.PtrToStructure(
Functions.XGetVisualInfo(window.Display, XVisualInfoMask.ID, ref info, out dummy), typeof(XVisualInfo)); Functions.XGetVisualInfo(window.Display, XVisualInfoMask.ID, ref info, out dummy), typeof(XVisualInfo));
Type xplatui = Type.GetType("System.Windows.Forms.XplatUIX11, System.Windows.Forms"); Type xplatui = Type.GetType("System.Windows.Forms.XplatUIX11, System.Windows.Forms");
xplatui.GetField("CustomVisual", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic) xplatui.GetField("CustomVisual", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)
.SetValue(null, window.VisualInfo.visual); .SetValue(null, window.VisualInfo.Visual);
xplatui.GetField("CustomColormap", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic) xplatui.GetField("CustomColormap", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)
.SetValue(null, Functions.XCreateColormap(window.Display, window.RootWindow, window.VisualInfo.visual, 0)); .SetValue(null, Functions.XCreateColormap(window.Display, window.RootWindow, window.VisualInfo.Visual, 0));
} }
#region --- IGLControl Members --- #region --- IGLControl Members ---

View file

@ -124,7 +124,7 @@ namespace OpenTK.Platform.X11
lock (API.Lock) lock (API.Lock)
{ {
info.visualid = mode.Index; info.VisualID = mode.Index;
int dummy; int dummy;
window.VisualInfo = (XVisualInfo)Marshal.PtrToStructure( window.VisualInfo = (XVisualInfo)Marshal.PtrToStructure(
Functions.XGetVisualInfo(window.Display, XVisualInfoMask.ID, ref info, out dummy), typeof(XVisualInfo)); Functions.XGetVisualInfo(window.Display, XVisualInfoMask.ID, ref info, out dummy), typeof(XVisualInfo));
@ -135,7 +135,7 @@ namespace OpenTK.Platform.X11
XSetWindowAttributes attributes = new XSetWindowAttributes(); XSetWindowAttributes attributes = new XSetWindowAttributes();
attributes.background_pixel = IntPtr.Zero; attributes.background_pixel = IntPtr.Zero;
attributes.border_pixel = IntPtr.Zero; attributes.border_pixel = IntPtr.Zero;
attributes.colormap = Functions.XCreateColormap(window.Display, window.RootWindow, window.VisualInfo.visual, 0/*AllocNone*/); attributes.colormap = Functions.XCreateColormap(window.Display, window.RootWindow, window.VisualInfo.Visual, 0/*AllocNone*/);
window.EventMask = EventMask.StructureNotifyMask | EventMask.SubstructureNotifyMask | EventMask.ExposureMask | window.EventMask = EventMask.StructureNotifyMask | EventMask.SubstructureNotifyMask | EventMask.ExposureMask |
EventMask.KeyReleaseMask | EventMask.KeyPressMask | EventMask.KeyReleaseMask | EventMask.KeyPressMask |
EventMask.PointerMotionMask | EventMask.FocusChangeMask | EventMask.PointerMotionMask | EventMask.FocusChangeMask |
@ -146,8 +146,8 @@ namespace OpenTK.Platform.X11
(uint)SetWindowValuemask.BackPixel | (uint)SetWindowValuemask.BorderPixel; (uint)SetWindowValuemask.BackPixel | (uint)SetWindowValuemask.BorderPixel;
window.WindowHandle = Functions.XCreateWindow(window.Display, window.RootWindow, window.WindowHandle = Functions.XCreateWindow(window.Display, window.RootWindow,
x, y, width, height, 0, window.VisualInfo.depth/*(int)CreateWindowArgs.CopyFromParent*/, x, y, width, height, 0, window.VisualInfo.Depth/*(int)CreateWindowArgs.CopyFromParent*/,
(int)CreateWindowArgs.InputOutput, window.VisualInfo.visual, (UIntPtr)mask, ref attributes); (int)CreateWindowArgs.InputOutput, window.VisualInfo.Visual, (UIntPtr)mask, ref attributes);
if (window.WindowHandle == IntPtr.Zero) if (window.WindowHandle == IntPtr.Zero)
throw new ApplicationException("XCreateWindow call failed (returned 0)."); throw new ApplicationException("XCreateWindow call failed (returned 0).");

View file

@ -70,7 +70,7 @@ namespace OpenTK.Platform.X11
Glx.GetConfig(display, ref info, GLXAttribute.STEREO, out st); Glx.GetConfig(display, ref info, GLXAttribute.STEREO, out st);
stereo = st != 0; stereo = st != 0;
gfx = new GraphicsMode(info.visualid, new ColorFormat(r, g, b, a), depth, stencil, samples, gfx = new GraphicsMode(info.VisualID, new ColorFormat(r, g, b, a), depth, stencil, samples,
new ColorFormat(ar, ag, ab, aa), buffers, stereo); new ColorFormat(ar, ag, ab, aa), buffers, stereo);
Functions.XFree(visual); Functions.XFree(visual);