Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1452 | chris | 1 | #region --- License --- |
| 2 | /* Copyright (c) 2006, 2007 Stefanos Apostolopoulos |
||
| 3 | * See license.txt for license info |
||
| 4 | */ |
||
| 5 | #endregion |
||
| 6 | |||
| 7 | using System; |
||
| 8 | |||
| 9 | namespace Bind |
||
| 10 | { |
||
| 11 | static class Settings |
||
| 12 | { |
||
| 13 | // Disable BeforeFieldInit. |
||
| 14 | static Settings() { } |
||
| 15 | |||
| 16 | public const string DefaultInputPath = "../../../Source/Bind/Specifications"; |
||
| 17 | public const string DefaultOutputPath = "../../../Source/OpenTK/Graphics/OpenGL"; |
||
| 18 | public const string DefaultOutputNamespace = "OpenTK.Graphics.OpenGL"; |
||
| 19 | public const string DefaultDocPath = "../../../Source/Bind/Specifications/Docs"; |
||
| 20 | public const string DefaultDocFile = "ToInlineDocs.xslt"; |
||
| 21 | public const string DefaultLicenseFile = "License.txt"; |
||
| 22 | |||
| 23 | public static string InputPath = DefaultInputPath; |
||
| 24 | public static string OutputPath = DefaultOutputPath; |
||
| 25 | public static string OutputNamespace = DefaultOutputNamespace; |
||
| 26 | public static string DocPath = DefaultDocPath; |
||
| 27 | public static string DocFile = DefaultDocFile; |
||
| 28 | public static string LicenseFile = DefaultLicenseFile; |
||
| 29 | |||
| 30 | public static string GLClass = "GL"; // Needed by Glu for the AuxEnumsClass. Can be set through -gl:"xxx". |
||
| 31 | public static string OutputClass = "GL"; // The real output class. Can be set through -class:"xxx". |
||
| 32 | public static string FunctionPrefix = "gl"; |
||
| 33 | public static string ConstantPrefix = "GL_"; |
||
| 34 | public static string EnumPrefix = ""; |
||
| 35 | |||
| 36 | // TODO: This code is too fragile. |
||
| 37 | // Old enums code: |
||
| 38 | public static string normalEnumsClassOverride = null; |
||
| 39 | public static string NestedEnumsClass = "Enums"; |
||
| 40 | public static string NormalEnumsClass |
||
| 41 | { |
||
| 42 | get |
||
| 43 | { |
||
| 44 | return |
||
| 45 | normalEnumsClassOverride == null ? |
||
| 46 | String.IsNullOrEmpty(NestedEnumsClass) ? OutputClass : OutputClass + "." + NestedEnumsClass : |
||
| 47 | normalEnumsClassOverride; |
||
| 48 | } |
||
| 49 | } |
||
| 50 | |||
| 51 | public static string AuxEnumsClass |
||
| 52 | { |
||
| 53 | get { return GLClass + "." + NestedEnumsClass; } |
||
| 54 | } |
||
| 55 | |||
| 56 | public static string EnumsOutput |
||
| 57 | { |
||
| 58 | get |
||
| 59 | { |
||
| 60 | if ((Compatibility & Legacy.NestedEnums) != Legacy.None) |
||
| 61 | return OutputNamespace + "." + OutputClass + "." + NestedEnumsClass; |
||
| 62 | else |
||
| 63 | return String.IsNullOrEmpty(EnumsNamespace) ? OutputNamespace : OutputNamespace + "." + EnumsNamespace; |
||
| 64 | } |
||
| 65 | } |
||
| 66 | |||
| 67 | public static string EnumsAuxOutput |
||
| 68 | { |
||
| 69 | get |
||
| 70 | { |
||
| 71 | if ((Compatibility & Legacy.NestedEnums) != Legacy.None) |
||
| 72 | return OutputNamespace + "." + GLClass + "." + NestedEnumsClass; |
||
| 73 | else |
||
| 74 | return OutputNamespace + "." + EnumsNamespace; |
||
| 75 | } |
||
| 76 | } |
||
| 77 | |||
| 78 | // New enums namespace (don't use a nested class). |
||
| 79 | public static string EnumsNamespace = null;// = "Enums"; |
||
| 80 | |||
| 81 | public static string DelegatesClass = "Delegates"; |
||
| 82 | public static string ImportsClass = "Core"; |
||
| 83 | |||
| 84 | public static Legacy Compatibility = Legacy.NoDropMultipleTokens; |
||
| 85 | |||
| 86 | /// <summary> |
||
| 87 | /// The name of the C# enum which holds every single OpenGL enum (for compatibility purposes). |
||
| 88 | /// </summary> |
||
| 89 | public static string CompleteEnumName = "All"; |
||
| 90 | [Flags] |
||
| 91 | public enum Legacy |
||
| 92 | { |
||
| 93 | /// <summary>Default value.</summary> |
||
| 94 | None = 0x00, |
||
| 95 | /// <summary>Leave enums as plain const ints.</summary> |
||
| 96 | ConstIntEnums = 0x01, |
||
| 97 | /// <summary>Leave enums in the default STRANGE_capitalization.ALL_CAPS form.</summary> |
||
| 98 | NoAdvancedEnumProcessing = 0x02, |
||
| 99 | /// <summary>Don't allow unsafe wrappers in the interface.</summary> |
||
| 100 | NoPublicUnsafeFunctions = 0x04, |
||
| 101 | /// <summary>Don't trim the [fdisub]v? endings from functions.</summary> |
||
| 102 | NoTrimFunctionEnding = NoPublicUnsafeFunctions, |
||
| 103 | /// <summary>Don't trim the [gl|wgl|glx|glu] prefixes from functions.</summary> |
||
| 104 | NoTrimFunctionPrefix = 0x08, |
||
| 105 | /// <summary> |
||
| 106 | /// Don't spearate functions in different namespaces, according to their extension category |
||
| 107 | /// (e.g. GL.Arb, GL.Ext etc). |
||
| 108 | /// </summary> |
||
| 109 | NoSeparateFunctionNamespaces = 0x10, |
||
| 110 | /// <summary> |
||
| 111 | /// No public void* parameters (should always be enabled. Disable at your own risk. Disabling |
||
| 112 | /// means that BitmapData.Scan0 and other .Net properties/functions must be cast to (void*) |
||
| 113 | /// explicitly, to avoid the 'object' overload from being called.) |
||
| 114 | /// </summary> |
||
| 115 | TurnVoidPointersToIntPtr = 0x20, |
||
| 116 | /// <summary>Generate all possible permutations for ref/array/pointer parameters.</summary> |
||
| 117 | GenerateAllPermutations = 0x40, |
||
| 118 | /// <summary>Nest enums inside the GL class.</summary> |
||
| 119 | NestedEnums = 0x80, |
||
| 120 | /// <summary>Turn GLboolean to int (Boolean enum), not bool.</summary> |
||
| 121 | NoBoolParameters = 0x100, |
||
| 122 | /// <summary>Keep all enum tokens, even if same value (e.g. FooARB, FooEXT and FooSGI).</summary> |
||
| 123 | NoDropMultipleTokens = 0x200, |
||
| 124 | /// <summary>Do not emit inline documentation.</summary> |
||
| 125 | NoDocumentation = 0x400, |
||
| 126 | /// <summary>Disables ErrorHelper generation.</summary> |
||
| 127 | NoDebugHelpers = 0x800, |
||
| 128 | /// <summary>Generate both typed and untyped ("All") signatures for enum parameters.</summary> |
||
| 129 | KeepUntypedEnums = 0x1000, |
||
| 130 | Tao = ConstIntEnums | |
||
| 131 | NoAdvancedEnumProcessing | |
||
| 132 | NoPublicUnsafeFunctions | |
||
| 133 | NoTrimFunctionEnding | |
||
| 134 | NoTrimFunctionPrefix | |
||
| 135 | NoSeparateFunctionNamespaces | |
||
| 136 | TurnVoidPointersToIntPtr | |
||
| 137 | NestedEnums | |
||
| 138 | NoBoolParameters | |
||
| 139 | NoDropMultipleTokens | |
||
| 140 | NoDocumentation | |
||
| 141 | NoDebugHelpers |
||
| 142 | /*GenerateAllPermutations,*/ |
||
| 143 | } |
||
| 144 | |||
| 145 | /// <summary>True if multiple tokens should be dropped (e.g. FooARB, FooEXT and FooSGI).</summary> |
||
| 146 | public static bool DropMultipleTokens |
||
| 147 | { |
||
| 148 | get { return (Compatibility & Legacy.NoDropMultipleTokens) == Legacy.None; } |
||
| 149 | set { if (value) Compatibility |= Legacy.NoDropMultipleTokens; else Compatibility &= ~Legacy.NoDropMultipleTokens; } |
||
| 150 | } |
||
| 151 | |||
| 152 | public static string WindowsGDI = "OpenTK.Platform.Windows.API"; |
||
| 153 | } |
||
| 154 | } |