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 682d371cbe
commit d3fadd0be1
6 changed files with 31 additions and 21 deletions

View file

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

View file

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

View file

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

View file

@ -30,16 +30,16 @@ namespace OpenTK.Platform.X11
X11WindowInfo window = (X11WindowInfo)this.WindowInfo;
XVisualInfo info = new XVisualInfo();
info.visualid = mode.Index;
info.VisualID = mode.Index;
int dummy;
window.VisualInfo = (XVisualInfo)Marshal.PtrToStructure(
Functions.XGetVisualInfo(window.Display, XVisualInfoMask.ID, ref info, out dummy), typeof(XVisualInfo));
Type xplatui = Type.GetType("System.Windows.Forms.XplatUIX11, System.Windows.Forms");
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)
.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 ---

View file

@ -124,7 +124,7 @@ namespace OpenTK.Platform.X11
lock (API.Lock)
{
info.visualid = mode.Index;
info.VisualID = mode.Index;
int dummy;
window.VisualInfo = (XVisualInfo)Marshal.PtrToStructure(
Functions.XGetVisualInfo(window.Display, XVisualInfoMask.ID, ref info, out dummy), typeof(XVisualInfo));
@ -135,7 +135,7 @@ namespace OpenTK.Platform.X11
XSetWindowAttributes attributes = new XSetWindowAttributes();
attributes.background_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 |
EventMask.KeyReleaseMask | EventMask.KeyPressMask |
EventMask.PointerMotionMask | EventMask.FocusChangeMask |
@ -146,8 +146,8 @@ namespace OpenTK.Platform.X11
(uint)SetWindowValuemask.BackPixel | (uint)SetWindowValuemask.BorderPixel;
window.WindowHandle = 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);
x, y, width, height, 0, window.VisualInfo.Depth/*(int)CreateWindowArgs.CopyFromParent*/,
(int)CreateWindowArgs.InputOutput, window.VisualInfo.Visual, (UIntPtr)mask, ref attributes);
if (window.WindowHandle == IntPtr.Zero)
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);
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);
Functions.XFree(visual);