Commit graph

72 commits

Author SHA1 Message Date
thefiddler
d68c31a561 [Bind] Move documentation generation to DocProcessor class
This de-duplicates a large amount of code that is shared between the
various ISpecWriter implementations.
2014-03-31 17:09:30 +02:00
thefiddler
67b0ead68b [Bind] Process documentation from subdirectories
Instead of using xslt, we now process the documentation in code. This
allows us to fix mismatches from e.g. invalid parameter names that
sometimes creep in the specs.
2014-03-28 20:08:38 +01:00
Stefanos A
b29a4aacb3 Respect apiversion in overrides
We should not use overrides from foreign apiversions.
2013-11-04 19:32:52 +01:00
Stefanos A
e8f46c87f6 Do not override user defined output files
The generator will now change the default output files to match its
bindings (e.g. GL vs ES), but the user is now able to override this
option.
2013-11-03 01:27:10 +01:00
Stefanos A.
e1f064b634 Updated IBind implementations to avoid singletons
IBind implementations must now store explicit references to Settings,
GLTypes and CSTypes instances. This allows us to use multiple
configurations in the same process.
2013-11-01 09:25:31 +01:00
Stefanos A.
a3bd227e20 Cleaned up Generator class tree
This significantly reduces the amount of duplicated code between
Generator implementations.
2013-10-31 00:18:07 +01:00
Stefanos A
7f9041417e Add apiname parameter to ISpecReader
This allows us to reuse the same ISpecReader implementation to parse
different APIs (GL and GLES).
2013-10-28 14:13:39 +01:00
Stefanos A.
51f52d7fc4 Moved more transformations into the *Processor classes.
An EnumProcessor or FuncProcessor instance is now required in order to
call their Translate*() methods. A number of transformations that
relied on calling the static methods have now been moved inside the
processor classes.
2013-10-27 01:30:45 +02:00
the_fiddler
85a774c902 Simplified the ISpecReader interface. Ensure 'delete' directives are followed in the xml specs. 2011-12-05 14:30:40 +00:00
the_fiddler
5f4487e87b Added support for different per-language typemaps. 2011-12-02 13:12:53 +00:00
the_fiddler
1db9c38ed8 Do not reuse a single StreamReader for reading signatures. Avoids issues with XPathDocument closing the stream behind our backs. 2010-12-06 14:34:16 +00:00
the_fiddler
5b40433350 * XmlSpecReader.cs:
* EnumProcessor.cs:
* GL2/Generator.cs:
* FuncProcessor.cs: Fixed handling of overrides file: we now add
  signatures as requested and reset the stream after we are done
  reading the file.
2010-12-06 12:29:18 +00:00
the_fiddler
3021f668ad Re-added missing gl.tm file.
Added initial C++ spec writer.
Refactored IBind and ISpecWriter interfaces.
2010-12-03 10:21:50 +00:00
the_fiddler
2dd61c6afd Moved overrides file to Settings class. 2010-12-03 09:02:55 +00:00
the_fiddler
c3bfa7dc9a Moved output filenames to Settings class. 2010-12-02 21:58:49 +00:00
the_fiddler
0ce332b318 Refactored spec reading / writing functionality into its own classes.
Removed legacy spec reader.
2010-12-02 21:36:05 +00:00
the_fiddler
965191a043 List required extension for core functions. 2010-11-21 15:10:12 +00:00
the_fiddler
dddae1ac27 Print diagnostic message when docfile translation fails. 2010-11-21 14:24:34 +00:00
the_fiddler
6f4aef89bf Added translation from "const GLubyte*" to string and added support for struct keyword. 2010-11-19 09:14:20 +00:00
the_fiddler
c112bcce0e Add required version/category and deprecation status to function summaries. 2010-10-13 23:10:32 +00:00
the_fiddler
b4c8b64db8 Removed misleading comment. 2010-10-13 22:27:35 +00:00
the_fiddler
137818d10c Moved enum, constant, delegate and function transformations to EnumProcessor and FuncProcessor respectively.
Removed global enum, delegate and function collections.
Simplified loading process and removed global Initialize() methods.
Read "count" attributes for function parameters in overrides.xml.
Disabled wgl/glx/glu generators.
Removed large amounts of stale code.
2010-10-13 21:41:06 +00:00
the_fiddler
357be0e67a Speed up documentation generation by reducing amount of disk IO (cache directory contents in memory). 2010-10-12 11:01:25 +00:00
the_fiddler
93743f913d Add support for function deprecation. 2010-10-10 12:28:27 +00:00
the_fiddler
97e07a6e24 * GL2/Generator.cs: Refactored WriteWrappers() into smaller methods. Added "using System.Text;" to all generated files that may contain StringBuilder parameters.
* Main.cs: Removed unused comments. Improved parameter handling. Added -o:keep_untyped_parameters option.
* Settings.cs: Added KeepUntypedEnums compatibility setting.
* Structures/Delegate.cs: Removed stale comments. Refactored CreateWrappers() method to support untyped enum overload generation and simplified method implementation. Replaced CurrentType translations with QualifiedType.
* Structures/Function.cs: Removed stale code. Fixed copy constructors to copy all necessary fields. Use QualifiedType instead of CurrentType in WrapReturnType and CreateBody methods. Made Body statement lists static to improve performance. Added hack to modify callstring casts in keep_untyped_enums wrappers. Generate call string from the Function CreateBody was called on, rather than the current Function (solves issues with invalid casts in specific cases).
* Structures/Parameter.cs: Use fully qualified type instead of current type in several caeses.
* Structures/Type.cs: Added explicit support for fully qualified types.
2009-10-27 22:37:05 +00:00
the_fiddler
b234593f14 * Generator.cs: Use Settings.FunctionPrefix when searching for
documentation (instead of hardcoded "gl" prefix).
2009-10-09 05:34:10 +00:00
the_fiddler
a930251995 Report an error if a constant does not contain either '=' or 'use' in its definition. 2009-09-07 17:49:06 +00:00
the_fiddler
52744c1661 Applied Barlog's "arrange this qualifier" patch. 2009-08-25 15:59:57 +00:00
the_fiddler
43e0e2c5e5 Applied Barlog's 02_Bind_2172_ShortenQualifierReferences patch. 2009-08-21 20:28:14 +00:00
the_fiddler
c487a382e1 Applied Barlog's refactoring patch for using directives. 2009-08-17 12:28:22 +00:00
the_fiddler
4021e67dc1 Removed "static" identifier from main wrappers class (add, if necessary, through the Helper.cs). 2009-08-15 17:35:20 +00:00
the_fiddler
4b05db2631 * Generator.cs: Use correct function prefix in AutoGenerated
attribute.
2009-08-12 10:12:16 +00:00
the_fiddler
be52c2776b Added support for empty or null typemaps. 2009-08-11 15:33:17 +00:00
the_fiddler
cdde2893f6 Added support for enum overrides.
Enabled enum overrides in the CL and ES generators.
Function parameters now follow enum overrides (for example, if function Foo takes enum Bar and enum Bar is overriden to Baz, this change will be reflected on function Foo).
Changed default CLGenerator settings to not generate debug helpers.
2009-08-11 14:12:20 +00:00
the_fiddler
5a0357ee06 * GL2/Generator.cs: Improved handling for 'u' and 'ull' suffixes in
OpenGL constants.
2009-08-03 23:06:05 +00:00
the_fiddler
ab26b80e2d Modified Type.Pointer property to be an integer instead of a boolean.
Improved handling of string arrays.
Added handling of flow direction to ESGenerator and Delegate.TranslateParameters().
Moved FlowDirection enum outside of Parameter class.
2009-07-15 22:33:26 +00:00
the_fiddler
0ead2d300e Worked around File.Replace issue on Linux by deleting the existing file first. Not perfectly safe, but acceptable for our use. 2009-07-15 15:01:55 +00:00
the_fiddler
13b87c1b0a Added OpenGL ES generator. 2009-06-30 08:39:35 +00:00
the_fiddler
a2f0f70377 Fixed handling of pointer-to-string parameters. These are now wrapped as string[] arrays. 2009-06-29 18:32:51 +00:00
the_fiddler
4773f4470f Actually sort wrapper methods in GL.cs. 2009-05-30 15:28:52 +00:00
the_fiddler
cf4a243c99 Merged the latest specs from opengl.org.
Replaced all instances of Version14, Version15, Version20, Version30 and Version31 enums by type-safe equivalents.
Added gloverrides.xml to support overrides to function parameters / return types. This will make future spec updates easier to merge.
Improved handling of invalid tokens in the specs.
Bindings are now written in alphabetical order. This will reduce patch size for future updates and make side-by-side comparisons easier to perform.
2009-05-29 15:57:01 +00:00
the_fiddler
370396ab7f The generator now detects and adds the FlagsAttribute to bitwise collections. Fixes bug [#792] "Resharper - Bitwise operation on enum which is not marked by [Flags] attribute" (http://www.opentk.com/node/792). 2009-05-05 21:00:48 +00:00
the_fiddler
0ecdd1c9e3 Fixed issue http://www.opentk.com/node/794 (suppress array overloads for functions that receive/return pointers to single elements). 2009-04-15 13:14:41 +00:00
the_fiddler
a128220c27 Generator now trims 'v' suffixes from all functions and marks resulting non cls-compliant overloads as such.
Bumped version number.
2009-04-12 18:23:01 +00:00
the_fiddler
24f4c3189b * Resources.Designer.cs: Deleted unused file.
* Settings.cs: Changed default output directory to fit with the current OpenTK project structure.
* GL2/Generator.cs: Suppressed documentation warnings in the generated bindings.
2009-03-25 21:48:14 +00:00
the_fiddler
2062d231d0 Bind now maps 'void*' to generics ('ref T', 'T[]', 'T[,]' and 'T[,,]') instead of 'object'.
The doc processor can now document more OpenGL functions (e.g. GL.Color3).
Cleaned up several pieces of code in Bind (but I'm afraid it's hopeless - spaghetti code at its greatest).
2009-03-21 21:44:07 +00:00
the_fiddler
a7849e8dd9 Fixed the path separators so that they work on Unix.
Improved the output for the doc processor: MathML equations are replaced by their textual representation and whitespace better matches function declarations.
Added new configuration settings for the doc processor and the license.
Removed stale debugging code.
License.txt is now a file, not a resource.
2009-03-08 18:08:35 +00:00
the_fiddler
875263e46a Added support for inline OpenGL documentation. 2009-03-08 00:46:58 +00:00
the_fiddler
01f618c00b Now prints the OpenTK license and adds the [AutoGenerated] attribute to the generated bindings. 2009-02-28 19:29:34 +00:00
the_fiddler
8ba07860e5 Merged changes from gl3 branch. 2009-02-28 18:50:16 +00:00