Marked platform-specific APIs as internal.

Added ObsoleteAttribute to obsolete functionality.
This commit is contained in:
the_fiddler 2009-06-04 11:21:33 +00:00
parent fc5db8a9a6
commit 783c38446b
12 changed files with 62 additions and 49 deletions

View file

@ -56,14 +56,18 @@ namespace OpenTK.Platform.Dummy
public void MakeCurrent(IWindowInfo info) { } public void MakeCurrent(IWindowInfo info) { }
public bool IsCurrent { get { return true; } set { } } public bool IsCurrent { get { return true; } set { } }
[Obsolete]
public event DestroyEvent<IGraphicsContext> Destroy; public event DestroyEvent<IGraphicsContext> Destroy;
[Obsolete]
void OnDestroy() { if (Destroy != null) Destroy(this, EventArgs.Empty); } void OnDestroy() { if (Destroy != null) Destroy(this, EventArgs.Empty); }
[Obsolete]
public void RegisterForDisposal(IDisposable resource) public void RegisterForDisposal(IDisposable resource)
{ {
throw new NotImplementedException("Use the general GraphicsContext class instead."); throw new NotImplementedException("Use the general GraphicsContext class instead.");
} }
[Obsolete]
public void DisposeResources() public void DisposeResources()
{ {
throw new NotImplementedException("Use the general GraphicsContext class instead."); throw new NotImplementedException("Use the general GraphicsContext class instead.");

View file

@ -16,9 +16,9 @@ using System.Drawing;
namespace OpenTK.Platform namespace OpenTK.Platform
{ {
[Obsolete]
internal interface INativeGLWindow : IDisposable internal interface INativeGLWindow : IDisposable
{ {
[Obsolete]
void CreateWindow(int width, int height, GraphicsMode mode, int major, int minor, GraphicsContextFlags flags, out IGraphicsContext context); void CreateWindow(int width, int height, GraphicsMode mode, int major, int minor, GraphicsContextFlags flags, out IGraphicsContext context);
void DestroyWindow(); void DestroyWindow();
void ProcessEvents(); void ProcessEvents();
@ -39,6 +39,8 @@ namespace OpenTK.Platform
event DestroyEvent Destroy; event DestroyEvent Destroy;
} }
public delegate void CreateEvent(object sender, EventArgs e); [Obsolete]
public delegate void DestroyEvent(object sender, EventArgs e); internal delegate void CreateEvent(object sender, EventArgs e);
[Obsolete]
internal delegate void DestroyEvent(object sender, EventArgs e);
} }

View file

@ -301,7 +301,10 @@ namespace OpenTK.Platform.MacOS
} }
} }
[Obsolete]
public event DestroyEvent<IGraphicsContext> Destroy; public event DestroyEvent<IGraphicsContext> Destroy;
[Obsolete]
void OnDestroy() void OnDestroy()
{ {

View file

@ -153,7 +153,7 @@ namespace OpenTK.Platform.MacOS.Carbon
internal uint EventKind; internal uint EventKind;
} }
public enum EventClass : int internal enum EventClass : int
{ {
/* /*
kEventClassMouse = FOUR_CHAR_CODE('mous'), kEventClassMouse = FOUR_CHAR_CODE('mous'),
@ -173,7 +173,7 @@ namespace OpenTK.Platform.MacOS.Carbon
Menu = 0x6d656e75, Menu = 0x6d656e75,
Window = 0x77696e64, Window = 0x77696e64,
} }
public enum WindowEventKind : int internal enum WindowEventKind : int
{ {
// window events // window events
WindowUpdate = 1, WindowUpdate = 1,
@ -195,7 +195,7 @@ namespace OpenTK.Platform.MacOS.Carbon
WindowClose = 72, WindowClose = 72,
WindowClosed = 73, WindowClosed = 73,
} }
public enum MouseEventKind : int internal enum MouseEventKind : int
{ {
MouseDown = 1, MouseDown = 1,
MouseUp = 2, MouseUp = 2,
@ -205,14 +205,14 @@ namespace OpenTK.Platform.MacOS.Carbon
MouseExited = 9, MouseExited = 9,
WheelMoved = 10, WheelMoved = 10,
} }
public enum MouseButton : short internal enum MouseButton : short
{ {
Primary = 1, Primary = 1,
Secondary = 2, Secondary = 2,
Tertiary = 3, Tertiary = 3,
} }
public enum KeyboardEventKind : int internal enum KeyboardEventKind : int
{ {
// raw keyboard events // raw keyboard events
RawKeyDown = 1, RawKeyDown = 1,
@ -221,7 +221,7 @@ namespace OpenTK.Platform.MacOS.Carbon
RawKeyModifiersChanged = 4, RawKeyModifiersChanged = 4,
} }
public enum AppEventKind : int internal enum AppEventKind : int
{ {
// application events // application events
AppActivated = 1, AppActivated = 1,
@ -270,7 +270,7 @@ namespace OpenTK.Platform.MacOS.Carbon
typeIEEE64BitFloatingPoint = 0x646f7562, typeIEEE64BitFloatingPoint = 0x646f7562,
} }
public enum EventMouseButton : int internal enum EventMouseButton : int
{ {
Primary = 0, Primary = 0,
Secondary = 1, Secondary = 1,

View file

@ -12,7 +12,7 @@ namespace OpenTK.Platform.MacOS.Carbon
} }
public static class CG internal static class CG
{ {
const string appServices = "/System/Library/Frameworks/ApplicationServices.framework/Versions/Current/ApplicationServices"; const string appServices = "/System/Library/Frameworks/ApplicationServices.framework/Versions/Current/ApplicationServices";

View file

@ -7,7 +7,7 @@ using System.Text;
namespace OpenTK.Platform.MacOS.Carbon namespace OpenTK.Platform.MacOS.Carbon
{ {
public class SpeechChannel internal class SpeechChannel
{ {
private IntPtr _id; private IntPtr _id;

View file

@ -14,7 +14,7 @@ using System.Text;
namespace OpenTK.Platform.MacOS.Carbon namespace OpenTK.Platform.MacOS.Carbon
{ {
public struct EventInfo internal struct EventInfo
{ {
internal EventInfo(IntPtr eventRef) internal EventInfo(IntPtr eventRef)
{ {

View file

@ -3,7 +3,7 @@ using System;
namespace OpenTK.Platform.MacOS namespace OpenTK.Platform.MacOS
{ {
public class MacOSException : Exception internal class MacOSException : Exception
{ {
OSStatus errorCode; OSStatus errorCode;
@ -31,7 +31,7 @@ namespace OpenTK.Platform.MacOS
} }
} }
public enum OSStatus internal enum OSStatus
{ {
NoError = 0, NoError = 0,

View file

@ -233,6 +233,7 @@ namespace OpenTK.Platform.Windows
set { throw new NotImplementedException(); } set { throw new NotImplementedException(); }
} }
[Obsolete]
public event DestroyEvent<IGraphicsContext> Destroy; public event DestroyEvent<IGraphicsContext> Destroy;
#endregion #endregion

View file

@ -7,7 +7,7 @@ using System.Runtime.InteropServices;
namespace OpenTK.Platform.Windows namespace OpenTK.Platform.Windows
{ {
/// <summary>Describes a win32 window.</summary> /// <summary>Describes a win32 window.</summary>
public sealed class WinWindowInfo : IWindowInfo internal sealed class WinWindowInfo : IWindowInfo
{ {
IntPtr handle, dc; IntPtr handle, dc;
WinWindowInfo parent; WinWindowInfo parent;

View file

@ -712,13 +712,13 @@ namespace OpenTK.Platform.X11
public IntPtr nitems; public IntPtr nitems;
} }
public enum XWindowClass internal enum XWindowClass
{ {
InputOutput = 1, InputOutput = 1,
InputOnly = 2 InputOnly = 2
} }
public enum XEventName internal enum XEventName
{ {
KeyPress = 2, KeyPress = 2,
KeyRelease = 3, KeyRelease = 3,
@ -758,7 +758,7 @@ namespace OpenTK.Platform.X11
} }
[Flags] [Flags]
public enum SetWindowValuemask internal enum SetWindowValuemask
{ {
Nothing = 0, Nothing = 0,
BackPixmap = 1, BackPixmap = 1,
@ -778,7 +778,7 @@ namespace OpenTK.Platform.X11
Cursor = 16384 Cursor = 16384
} }
public enum CreateWindowArgs internal enum CreateWindowArgs
{ {
CopyFromParent = 0, CopyFromParent = 0,
ParentRelative = 1, ParentRelative = 1,
@ -786,7 +786,7 @@ namespace OpenTK.Platform.X11
InputOnly = 2 InputOnly = 2
} }
public enum Gravity internal enum Gravity
{ {
ForgetGravity = 0, ForgetGravity = 0,
NorthWestGravity = 1, NorthWestGravity = 1,
@ -802,7 +802,7 @@ namespace OpenTK.Platform.X11
} }
[CLSCompliant(false)] [CLSCompliant(false)]
public enum XKeySym : uint internal enum XKeySym : uint
{ {
XK_BackSpace = 0xFF08, XK_BackSpace = 0xFF08,
XK_Tab = 0xFF09, XK_Tab = 0xFF09,
@ -835,7 +835,7 @@ namespace OpenTK.Platform.X11
} }
[Flags] [Flags]
public enum EventMask internal enum EventMask
{ {
NoEventMask = 0, NoEventMask = 0,
KeyPressMask = 1 << 0, KeyPressMask = 1 << 0,
@ -865,7 +865,7 @@ namespace OpenTK.Platform.X11
OwnerGrabButtonMask = 1 << 24 OwnerGrabButtonMask = 1 << 24
} }
public enum GrabMode internal enum GrabMode
{ {
GrabModeSync = 0, GrabModeSync = 0,
GrabModeAsync = 1 GrabModeAsync = 1
@ -897,7 +897,7 @@ namespace OpenTK.Platform.X11
public byte pad; public byte pad;
} }
public enum Atom internal enum Atom
{ {
AnyPropertyType = 0, AnyPropertyType = 0,
XA_PRIMARY = 1, XA_PRIMARY = 1,
@ -998,7 +998,7 @@ namespace OpenTK.Platform.X11
} }
[Flags] [Flags]
public enum ChangeWindowAttributes internal enum ChangeWindowAttributes
{ {
X = 1 << 0, X = 1 << 0,
Y = 1 << 1, Y = 1 << 1,
@ -1025,7 +1025,7 @@ namespace OpenTK.Platform.X11
OverrideRedirect = 1<<9, OverrideRedirect = 1<<9,
} }
public enum StackMode internal enum StackMode
{ {
Above = 0, Above = 0,
Below = 1, Below = 1,
@ -1047,21 +1047,21 @@ namespace OpenTK.Platform.X11
} }
[Flags] [Flags]
public enum ColorFlags internal enum ColorFlags
{ {
DoRed = 1 << 0, DoRed = 1 << 0,
DoGreen = 1 << 1, DoGreen = 1 << 1,
DoBlue = 1 << 2 DoBlue = 1 << 2
} }
public enum NotifyMode internal enum NotifyMode
{ {
NotifyNormal = 0, NotifyNormal = 0,
NotifyGrab = 1, NotifyGrab = 1,
NotifyUngrab = 2 NotifyUngrab = 2
} }
public enum NotifyDetail internal enum NotifyDetail
{ {
NotifyAncestor = 0, NotifyAncestor = 0,
NotifyVirtual = 1, NotifyVirtual = 1,
@ -1074,7 +1074,7 @@ namespace OpenTK.Platform.X11
} }
[Flags] [Flags]
public enum KeyMasks internal enum KeyMasks
{ {
ShiftMask = (1 << 0), ShiftMask = (1 << 0),
LockMask = (1 << 1), LockMask = (1 << 1),
@ -1095,7 +1095,7 @@ namespace OpenTK.Platform.X11
public IntPtr modifiermap; public IntPtr modifiermap;
} }
public enum PropertyMode internal enum PropertyMode
{ {
Replace = 0, Replace = 0,
Prepend = 1, Prepend = 1,
@ -1124,7 +1124,7 @@ namespace OpenTK.Platform.X11
} }
[Flags] [Flags]
public enum GCFunction internal enum GCFunction
{ {
GCFunction = 1 << 0, GCFunction = 1 << 0,
GCPlaneMask = 1 << 1, GCPlaneMask = 1 << 1,
@ -1151,21 +1151,21 @@ namespace OpenTK.Platform.X11
GCArcMode = 1 << 22 GCArcMode = 1 << 22
} }
public enum GCJoinStyle internal enum GCJoinStyle
{ {
JoinMiter = 0, JoinMiter = 0,
JoinRound = 1, JoinRound = 1,
JoinBevel = 2 JoinBevel = 2
} }
public enum GCLineStyle internal enum GCLineStyle
{ {
LineSolid = 0, LineSolid = 0,
LineOnOffDash = 1, LineOnOffDash = 1,
LineDoubleDash = 2 LineDoubleDash = 2
} }
public enum GCCapStyle internal enum GCCapStyle
{ {
CapNotLast = 0, CapNotLast = 0,
CapButt = 1, CapButt = 1,
@ -1173,7 +1173,7 @@ namespace OpenTK.Platform.X11
CapProjecting = 3 CapProjecting = 3
} }
public enum GCFillStyle internal enum GCFillStyle
{ {
FillSolid = 0, FillSolid = 0,
FillTiled = 1, FillTiled = 1,
@ -1181,19 +1181,19 @@ namespace OpenTK.Platform.X11
FillOpaqueStppled = 3 FillOpaqueStppled = 3
} }
public enum GCFillRule internal enum GCFillRule
{ {
EvenOddRule = 0, EvenOddRule = 0,
WindingRule = 1 WindingRule = 1
} }
public enum GCArcMode internal enum GCArcMode
{ {
ArcChord = 0, ArcChord = 0,
ArcPieSlice = 1 ArcPieSlice = 1
} }
public enum GCSubwindowMode internal enum GCSubwindowMode
{ {
ClipByChildren = 0, ClipByChildren = 0,
IncludeInferiors = 1 IncludeInferiors = 1
@ -1227,7 +1227,7 @@ namespace OpenTK.Platform.X11
public byte dashes; public byte dashes;
} }
public enum GXFunction internal enum GXFunction
{ {
GXclear = 0x0, /* 0 */ GXclear = 0x0, /* 0 */
GXand = 0x1, /* src AND dst */ GXand = 0x1, /* src AND dst */
@ -1247,28 +1247,28 @@ namespace OpenTK.Platform.X11
GXset = 0xf /* 1 */ GXset = 0xf /* 1 */
} }
public enum NetWindowManagerState internal enum NetWindowManagerState
{ {
Remove = 0, Remove = 0,
Add = 1, Add = 1,
Toggle = 2 Toggle = 2
} }
public enum RevertTo internal enum RevertTo
{ {
None = 0, None = 0,
PointerRoot = 1, PointerRoot = 1,
Parent = 2 Parent = 2
} }
public enum MapState internal enum MapState
{ {
IsUnmapped = 0, IsUnmapped = 0,
IsUnviewable = 1, IsUnviewable = 1,
IsViewable = 2 IsViewable = 2
} }
public enum CursorFontShape internal enum CursorFontShape
{ {
XC_X_cursor = 0, XC_X_cursor = 0,
XC_arrow = 2, XC_arrow = 2,
@ -1356,7 +1356,7 @@ namespace OpenTK.Platform.X11
XC_num_glyphs = 154 XC_num_glyphs = 154
} }
public enum SystrayRequest internal enum SystrayRequest
{ {
SYSTEM_TRAY_REQUEST_DOCK = 0, SYSTEM_TRAY_REQUEST_DOCK = 0,
SYSTEM_TRAY_BEGIN_MESSAGE = 1, SYSTEM_TRAY_BEGIN_MESSAGE = 1,
@ -1364,7 +1364,7 @@ namespace OpenTK.Platform.X11
} }
[Flags] [Flags]
public enum XSizeHintsFlags internal enum XSizeHintsFlags
{ {
USPosition = (1 << 0), USPosition = (1 << 0),
USSize = (1 << 1), USSize = (1 << 1),
@ -1403,7 +1403,7 @@ namespace OpenTK.Platform.X11
} }
[Flags] [Flags]
public enum XWMHintsFlags internal enum XWMHintsFlags
{ {
InputHint = (1 << 0), InputHint = (1 << 0),
StateHint = (1 << 1), StateHint = (1 << 1),
@ -1415,7 +1415,7 @@ namespace OpenTK.Platform.X11
AllHints = (InputHint | StateHint | IconPixmapHint | IconWindowHint | IconPositionHint | IconMaskHint | WindowGroupHint) AllHints = (InputHint | StateHint | IconPixmapHint | IconWindowHint | IconPositionHint | IconMaskHint | WindowGroupHint)
} }
public enum XInitialState internal enum XInitialState
{ {
DontCareState = 0, DontCareState = 0,
NormalState = 1, NormalState = 1,

View file

@ -265,6 +265,7 @@ namespace OpenTK.Platform.X11
#endregion #endregion
[Obsolete]
public event DestroyEvent<IGraphicsContext> Destroy; public event DestroyEvent<IGraphicsContext> Destroy;
#region public IntPtr GetAddress(string function) #region public IntPtr GetAddress(string function)
@ -291,11 +292,13 @@ namespace OpenTK.Platform.X11
#endregion #endregion
[Obsolete]
public void RegisterForDisposal(IDisposable resource) public void RegisterForDisposal(IDisposable resource)
{ {
throw new NotSupportedException("Use OpenTK.GraphicsContext instead."); throw new NotSupportedException("Use OpenTK.GraphicsContext instead.");
} }
[Obsolete]
public void DisposeResources() public void DisposeResources()
{ {
throw new NotSupportedException("Use OpenTK.GraphicsContext instead."); throw new NotSupportedException("Use OpenTK.GraphicsContext instead.");