Made X11 structs, enums and functions internal. OpenTK should not expose platform-specific APIs.

This commit is contained in:
the_fiddler 2009-06-04 10:57:26 +00:00
parent b4d35e7d03
commit 4a8d9c582c
3 changed files with 74 additions and 74 deletions

View file

@ -311,10 +311,10 @@ namespace OpenTK.Platform.X11
#endregion
#region Xf86VidMode public structures
#region Xf86VidMode internal structures
[StructLayout(LayoutKind.Sequential)]
public struct XF86VidModeModeLine
internal struct XF86VidModeModeLine
{
short hdisplay; /* Number of display pixels horizontally */
short hsyncstart; /* Horizontal sync start */
@ -333,7 +333,7 @@ namespace OpenTK.Platform.X11
/// Specifies an XF86 display mode.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct XF86VidModeModeInfo
internal struct XF86VidModeModeInfo
{
/// <summary>
/// Pixel clock.
@ -401,7 +401,7 @@ namespace OpenTK.Platform.X11
//Monitor information:
[StructLayout(LayoutKind.Sequential)]
public struct XF86VidModeMonitor
internal struct XF86VidModeMonitor
{
[MarshalAs(UnmanagedType.LPStr)]
string vendor; /* Name of manufacturer */
@ -417,14 +417,14 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XF86VidModeSyncRange
internal struct XF86VidModeSyncRange
{
float hi; /* Top of range */
float lo; /* Bottom of range */
}
[StructLayout(LayoutKind.Sequential)]
public struct XF86VidModeNotifyEvent
internal struct XF86VidModeNotifyEvent
{
int type; /* of event */
ulong serial; /* # of last request processed by server */
@ -439,7 +439,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XF86VidModeGamma
internal struct XF86VidModeGamma
{
float red; /* Red Gamma value */
float green; /* Green Gamma value */
@ -587,7 +587,7 @@ XF86VidModeGetGammaRampSize(
#region internal class XVisualInfo
[StructLayout(LayoutKind.Sequential)]
public struct XVisualInfo
internal struct XVisualInfo
{
public IntPtr visual;
public VisualID visualid;
@ -692,7 +692,7 @@ XF86VidModeGetGammaRampSize(
public Rectangle min_aspect, max_aspect;
public int base_width, base_height;
public int win_gravity;
public struct Rectangle
internal struct Rectangle
{
public int x; /* numerator */
public int y; /* denominator */
@ -816,7 +816,7 @@ XF86VidModeGetGammaRampSize(
#region X11 Constants and Enums
public struct Constants
internal struct Constants
{
public const int QueuedAlready = 0;
public const int QueuedAfterReading = 1;
@ -844,7 +844,7 @@ XF86VidModeGetGammaRampSize(
public const string XA_WIN_SUPPORTING_WM_CHECK = "_WIN_SUPPORTING_WM_CHECK";
}
public enum WindowLayer
internal enum WindowLayer
{
Desktop = 0,
Below = 2,
@ -855,7 +855,7 @@ XF86VidModeGetGammaRampSize(
Menu = 12,
}
public enum WindowState
internal enum WindowState
{
Sticky = (1<<0), /* everyone knows sticky */
Minimized = (1<<1), /* ??? */
@ -869,7 +869,7 @@ XF86VidModeGetGammaRampSize(
ArrangeIgnore = (1<<9), /* ignore for auto arranging */
}
public enum WindowHints
internal enum WindowHints
{
SkipFocus = (1<<0), /* "alt-tab" skips this win */
SkipWinlist = (1<<1), /* not in win list */
@ -879,7 +879,7 @@ XF86VidModeGetGammaRampSize(
DoNotCover = (1<<5), /* attempt to not cover this window */
}
public enum ErrorCodes : int
internal enum ErrorCodes : int
{
Success = 0,
BadRequest = 1,
@ -902,7 +902,7 @@ XF86VidModeGetGammaRampSize(
}
[Flags]
public enum CreateWindowMask : long//: ulong
internal enum CreateWindowMask : long//: ulong
{
CWBackPixmap = (1L<<0),
CWBackPixel = (1L<<1),
@ -934,7 +934,7 @@ XF86VidModeGetGammaRampSize(
/// Defines LATIN-1 and miscellaneous keys.
/// </summary>
[CLSCompliant(false)]
public enum XKey
internal enum XKey
{
/*
* TTY function keys, cleverly chosen to map to ASCII, for convenience of
@ -1254,7 +1254,7 @@ XF86VidModeGetGammaRampSize(
#endregion
public enum XVisualClass : int
internal enum XVisualClass : int
{
StaticGray = 0,
GrayScale = 1,
@ -1265,7 +1265,7 @@ XF86VidModeGetGammaRampSize(
}
[Flags]
public enum XVisualInfoMask
internal enum XVisualInfoMask
{
No = 0x0,
ID = 0x1,
@ -1280,9 +1280,9 @@ XF86VidModeGetGammaRampSize(
All = 0x1FF,
}
#region public enum MouseMask
#region internal enum MouseMask
public enum MouseMask
internal enum MouseMask
{
Button1MotionMask = (1 << 8),
Button2MotionMask = (1 << 9),
@ -1566,7 +1566,7 @@ XF86VidModeGetGammaRampSize(
}
/*
[StructLayout(LayoutKind.Sequential)]
public struct Keymap
internal struct Keymap
{
unsafe fixed byte bits[32];

View file

@ -43,7 +43,7 @@ namespace OpenTK.Platform.X11
//
[StructLayout(LayoutKind.Sequential)]
public struct XAnyEvent
internal struct XAnyEvent
{
public XEventName type;
public IntPtr serial;
@ -53,7 +53,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XKeyEvent
internal struct XKeyEvent
{
public XEventName type;
public IntPtr serial;
@ -73,7 +73,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XButtonEvent
internal struct XButtonEvent
{
public XEventName type;
public IntPtr serial;
@ -93,7 +93,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XMotionEvent
internal struct XMotionEvent
{
public XEventName type;
public IntPtr serial;
@ -113,7 +113,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XCrossingEvent
internal struct XCrossingEvent
{
public XEventName type;
public IntPtr serial;
@ -135,7 +135,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XFocusChangeEvent
internal struct XFocusChangeEvent
{
public XEventName type;
public IntPtr serial;
@ -147,7 +147,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XKeymapEvent
internal struct XKeymapEvent
{
public XEventName type;
public IntPtr serial;
@ -189,7 +189,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XExposeEvent
internal struct XExposeEvent
{
public XEventName type;
public IntPtr serial;
@ -204,7 +204,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XGraphicsExposeEvent
internal struct XGraphicsExposeEvent
{
public XEventName type;
public IntPtr serial;
@ -221,7 +221,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XNoExposeEvent
internal struct XNoExposeEvent
{
public XEventName type;
public IntPtr serial;
@ -233,7 +233,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XVisibilityEvent
internal struct XVisibilityEvent
{
public XEventName type;
public IntPtr serial;
@ -244,7 +244,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XCreateWindowEvent
internal struct XCreateWindowEvent
{
public XEventName type;
public IntPtr serial;
@ -261,7 +261,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XDestroyWindowEvent
internal struct XDestroyWindowEvent
{
public XEventName type;
public IntPtr serial;
@ -272,7 +272,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XUnmapEvent
internal struct XUnmapEvent
{
public XEventName type;
public IntPtr serial;
@ -284,7 +284,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XMapEvent
internal struct XMapEvent
{
public XEventName type;
public IntPtr serial;
@ -296,7 +296,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XMapRequestEvent
internal struct XMapRequestEvent
{
public XEventName type;
public IntPtr serial;
@ -307,7 +307,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XReparentEvent
internal struct XReparentEvent
{
public XEventName type;
public IntPtr serial;
@ -322,7 +322,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XConfigureEvent
internal struct XConfigureEvent
{
public XEventName type;
public IntPtr serial;
@ -340,7 +340,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XGravityEvent
internal struct XGravityEvent
{
public XEventName type;
public IntPtr serial;
@ -353,7 +353,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XResizeRequestEvent
internal struct XResizeRequestEvent
{
public XEventName type;
public IntPtr serial;
@ -365,7 +365,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XConfigureRequestEvent
internal struct XConfigureRequestEvent
{
public XEventName type;
public IntPtr serial;
@ -384,7 +384,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XCirculateEvent
internal struct XCirculateEvent
{
public XEventName type;
public IntPtr serial;
@ -396,7 +396,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XCirculateRequestEvent
internal struct XCirculateRequestEvent
{
public XEventName type;
public IntPtr serial;
@ -408,7 +408,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XPropertyEvent
internal struct XPropertyEvent
{
public XEventName type;
public IntPtr serial;
@ -421,7 +421,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XSelectionClearEvent
internal struct XSelectionClearEvent
{
public XEventName type;
public IntPtr serial;
@ -433,7 +433,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XSelectionRequestEvent
internal struct XSelectionRequestEvent
{
public XEventName type;
public IntPtr serial;
@ -448,7 +448,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XSelectionEvent
internal struct XSelectionEvent
{
public XEventName type;
public IntPtr serial;
@ -462,7 +462,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XColormapEvent
internal struct XColormapEvent
{
public XEventName type;
public IntPtr serial;
@ -475,7 +475,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XClientMessageEvent
internal struct XClientMessageEvent
{
public XEventName type;
public IntPtr serial;
@ -492,7 +492,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XMappingEvent
internal struct XMappingEvent
{
public XEventName type;
public IntPtr serial;
@ -505,7 +505,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XErrorEvent
internal struct XErrorEvent
{
public XEventName type;
public IntPtr display;
@ -517,7 +517,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XEventPad
internal struct XEventPad
{
public IntPtr pad0;
public IntPtr pad1;
@ -546,7 +546,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Explicit)]
public struct XEvent
internal struct XEvent
{
[FieldOffset(0)]
public XEventName type;
@ -651,7 +651,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XSetWindowAttributes
internal struct XSetWindowAttributes
{
public IntPtr background_pixmap;
public IntPtr background_pixel;
@ -671,7 +671,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XWindowAttributes
internal struct XWindowAttributes
{
public int x;
public int y;
@ -704,7 +704,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XTextProperty
internal struct XTextProperty
{
public string value;
public IntPtr encoding;
@ -872,7 +872,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XStandardColormap
internal struct XStandardColormap
{
public IntPtr colormap;
public IntPtr red_max;
@ -887,7 +887,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential, Pack = 2), CLSCompliant(false)]
public struct XColor
internal struct XColor
{
public IntPtr pixel;
public ushort red;
@ -973,7 +973,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XScreen
internal struct XScreen
{
public IntPtr ext_data;
public IntPtr display;
@ -1035,7 +1035,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XWindowChanges
internal struct XWindowChanges
{
public int x;
public int y;
@ -1089,7 +1089,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XModifierKeymap
internal struct XModifierKeymap
{
public int max_keypermod;
public IntPtr modifiermap;
@ -1103,7 +1103,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential), CLSCompliant(false)]
public struct XKeyBoardState
internal struct XKeyBoardState
{
public int key_click_percent;
public int bell_percent;
@ -1113,7 +1113,7 @@ namespace OpenTK.Platform.X11
public AutoRepeats auto_repeats;
[StructLayout(LayoutKind.Explicit)]
public struct AutoRepeats
internal struct AutoRepeats
{
[FieldOffset(0)]
public byte first;
@ -1200,7 +1200,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XGCValues
internal struct XGCValues
{
public GXFunction function;
public IntPtr plane_mask;
@ -1380,7 +1380,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XSizeHints
internal struct XSizeHints
{
public IntPtr flags;
public int x;
@ -1425,7 +1425,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XWMHints
internal struct XWMHints
{
public IntPtr flags;
public bool input;
@ -1439,7 +1439,7 @@ namespace OpenTK.Platform.X11
}
[StructLayout(LayoutKind.Sequential)]
public struct XIconSize
internal struct XIconSize
{
public int min_width;
public int min_height;
@ -1449,9 +1449,9 @@ namespace OpenTK.Platform.X11
public int height_inc;
}
public delegate int XErrorHandler(IntPtr DisplayHandle, ref XErrorEvent error_event);
internal delegate int XErrorHandler(IntPtr DisplayHandle, ref XErrorEvent error_event);
public enum XRequest : byte
internal enum XRequest : byte
{
X_CreateWindow = 1,
X_ChangeWindowAttributes = 2,
@ -1576,7 +1576,7 @@ namespace OpenTK.Platform.X11
}
[Flags]
public enum XIMProperties
internal enum XIMProperties
{
XIMPreeditArea = 0x0001,
XIMPreeditCallbacks = 0x0002,
@ -1590,14 +1590,14 @@ namespace OpenTK.Platform.X11
}
[Flags]
public enum WindowType
internal enum WindowType
{
Client = 1,
Whole = 2,
Both = 3
}
public enum XEmbedMessage
internal enum XEmbedMessage
{
EmbeddedNotify = 0,
WindowActivate = 1,

View file

@ -5,7 +5,7 @@ using System.Text;
namespace OpenTK.Platform.X11
{
/// <summary>Describes an X11 window.</summary>
public sealed class X11WindowInfo : IWindowInfo
internal sealed class X11WindowInfo : IWindowInfo
{
IntPtr handle, rootWindow, display;
X11WindowInfo parent;