Skip to content

Commit

Permalink
Add return value documentation tag generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nihlus committed Jul 10, 2018
1 parent e6072b3 commit b0d5ea0
Show file tree
Hide file tree
Showing 39 changed files with 171 additions and 1 deletion.
29 changes: 28 additions & 1 deletion OpenTK.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,36 @@
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ACCUM/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Apostolopoulos/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ATTRIB/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ATTRIBS/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Clipmap/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=CMYK/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Coord/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=COORDS/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=DOUBLEBUFFER/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=FRAMEBUFFER/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Framezoom/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=LUID/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=MINMAX/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=MODELVIEW/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=MULTISAMPLE/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=NONINFRINGEMENT/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=PRECLIP/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=QCOM/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Renderbuffer/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=RESAMPLE/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=SGIS/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Sgix/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=SRGB/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Stefanos/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=SUBPIXEL/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=SUBSAMPLE/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=TEXEL/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Typemap/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=typeparam/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unindent/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unindented/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unindented/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=WRITEMASK/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

6 changes: 6 additions & 0 deletions src/Generator.Bind/BindingsWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,12 @@ private void WriteDocumentation(SourceWriter sw, FunctionDefinition f)
{
sw.WriteLine($"/// <typeparam name=\"{genericParameterName}\"></typeparam>");
}

if (!f.ReturnTypeDefinition.TypeName.Equals(typeof(void).Name, StringComparison.OrdinalIgnoreCase))
{
// TODO: Return value documentation
sw.WriteLine("/// <returns></returns>");
}
}

private void WriteConstants(SourceWriter sw, IEnumerable<ConstantDefinition> constants)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public static void EndPerfMonitor(uint monitor)
/// <summary>
/// [requires: AMD_performance_monitor]
/// </summary>
/// <returns></returns>
[AutoGenerated(Category = "AMD_performance_monitor", Version = "", EntryPoint = "glGenPerfMonitorsAMD")]
public static uint GenPerfMonitor()
{
Expand Down
5 changes: 5 additions & 0 deletions src/OpenTK/Graphics/OpenGL4/Wrappers/Arb/BindlessTexture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public static partial class Arb
/// </param>
/// <param name="format">
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "ARB_bindless_texture", Version = "", EntryPoint = "glGetImageHandleARB")]
public static ulong GetImageHandle(uint texture, int level, bool layered, int layer, OpenTK.Graphics.OpenGL4.PixelFormat format)
{
Expand All @@ -60,6 +61,7 @@ public static ulong GetImageHandle(uint texture, int level, bool layered, int la
/// </summary>
/// <param name="texture">
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "ARB_bindless_texture", Version = "", EntryPoint = "glGetTextureHandleARB")]
public static ulong GetTextureHandle(uint texture)
{
Expand All @@ -73,6 +75,7 @@ public static ulong GetTextureHandle(uint texture)
/// </param>
/// <param name="sampler">
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "ARB_bindless_texture", Version = "", EntryPoint = "glGetTextureSamplerHandleARB")]
public static ulong GetTextureSamplerHandle(uint texture, uint sampler)
{
Expand Down Expand Up @@ -129,6 +132,7 @@ public static unsafe void GetVertexAttribL(uint index, OpenTK.Graphics.OpenGL4.V
/// </summary>
/// <param name="handle">
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "ARB_bindless_texture", Version = "", EntryPoint = "glIsImageHandleResidentARB")]
public static bool IsImageHandleResident(ulong handle)
{
Expand All @@ -140,6 +144,7 @@ public static bool IsImageHandleResident(ulong handle)
/// </summary>
/// <param name="handle">
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "ARB_bindless_texture", Version = "", EntryPoint = "glIsTextureHandleResidentARB")]
public static bool IsTextureHandleResident(ulong handle)
{
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTK/Graphics/OpenGL4/Wrappers/Arb/ClEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public static partial class Arb
/// </param>
/// <param name="flags">
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "ARB_cl_event", Version = "", EntryPoint = "glCreateSyncFromCLeventARB")]
public static IntPtr CreateSyncFromCLevent([OutAttribute] IntPtr[] context, [OutAttribute] IntPtr[] @event, uint flags)
{
Expand All @@ -60,6 +61,7 @@ public static IntPtr CreateSyncFromCLevent([OutAttribute] IntPtr[] context, [Out
/// </param>
/// <param name="flags">
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "ARB_cl_event", Version = "", EntryPoint = "glCreateSyncFromCLeventARB")]
public static IntPtr CreateSyncFromCLevent([OutAttribute] out IntPtr context, [OutAttribute] out IntPtr @event, uint flags)
{
Expand All @@ -75,6 +77,7 @@ public static IntPtr CreateSyncFromCLevent([OutAttribute] out IntPtr context, [O
/// </param>
/// <param name="flags">
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "ARB_cl_event", Version = "", EntryPoint = "glCreateSyncFromCLeventARB")]
public static unsafe IntPtr CreateSyncFromCLevent([OutAttribute] IntPtr* context, [OutAttribute] IntPtr* @event, uint flags)
{
Expand Down
3 changes: 3 additions & 0 deletions src/OpenTK/Graphics/OpenGL4/Wrappers/Arb/DebugOutput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ public static void DebugMessageInsert(OpenTK.Graphics.OpenGL4.DebugSource source
/// [length: bufSize]
/// The address of an array of characters that will receive the messages.
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "ARB_debug_output", Version = "", EntryPoint = "glGetDebugMessageLogARB")]
public static uint GetDebugMessageLog(uint count, int bufSize, [OutAttribute, CountAttribute(Parameter = "count")] OpenTK.Graphics.OpenGL4.DebugSource[] sources, [OutAttribute, CountAttribute(Parameter = "count")] OpenTK.Graphics.OpenGL4.DebugType[] types, [OutAttribute, CountAttribute(Parameter = "count")] uint[] ids, [OutAttribute, CountAttribute(Parameter = "count")] OpenTK.Graphics.OpenGL4.DebugSeverity[] severities, [OutAttribute, CountAttribute(Parameter = "count")] int[] lengths, [OutAttribute, CountAttribute(Parameter = "bufSize")] out string messageLog)
{
Expand Down Expand Up @@ -319,6 +320,7 @@ public static uint GetDebugMessageLog(uint count, int bufSize, [OutAttribute, Co
/// [length: bufSize]
/// The address of an array of characters that will receive the messages.
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "ARB_debug_output", Version = "", EntryPoint = "glGetDebugMessageLogARB")]
public static uint GetDebugMessageLog(uint count, int bufSize, [OutAttribute, CountAttribute(Parameter = "count")] out OpenTK.Graphics.OpenGL4.DebugSource sources, [OutAttribute, CountAttribute(Parameter = "count")] out OpenTK.Graphics.OpenGL4.DebugType types, [OutAttribute, CountAttribute(Parameter = "count")] out uint ids, [OutAttribute, CountAttribute(Parameter = "count")] out OpenTK.Graphics.OpenGL4.DebugSeverity severities, [OutAttribute, CountAttribute(Parameter = "count")] out int lengths, [OutAttribute, CountAttribute(Parameter = "bufSize")] out string messageLog)
{
Expand Down Expand Up @@ -359,6 +361,7 @@ public static uint GetDebugMessageLog(uint count, int bufSize, [OutAttribute, Co
/// [length: bufSize]
/// The address of an array of characters that will receive the messages.
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "ARB_debug_output", Version = "", EntryPoint = "glGetDebugMessageLogARB")]
public static unsafe uint GetDebugMessageLog(uint count, int bufSize, [OutAttribute, CountAttribute(Parameter = "count")] OpenTK.Graphics.OpenGL4.DebugSource* sources, [OutAttribute, CountAttribute(Parameter = "count")] OpenTK.Graphics.OpenGL4.DebugType* types, [OutAttribute, CountAttribute(Parameter = "count")] uint* ids, [OutAttribute, CountAttribute(Parameter = "count")] OpenTK.Graphics.OpenGL4.DebugSeverity* severities, [OutAttribute, CountAttribute(Parameter = "count")] int* lengths, [OutAttribute, CountAttribute(Parameter = "bufSize")] out string messageLog)
{
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTK/Graphics/OpenGL4/Wrappers/Arb/Robustness.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public static partial class Arb
/// <summary>
/// [requires: ARB_robustness]
/// </summary>
/// <returns></returns>
[AutoGenerated(Category = "ARB_robustness", Version = "", EntryPoint = "glGetGraphicsResetStatusARB")]
public static OpenTK.Graphics.OpenGL4.GraphicsResetStatus GetGraphicsResetStatus()
{
Expand Down Expand Up @@ -904,6 +905,7 @@ public static unsafe void GetnPixelMap(OpenTK.Graphics.OpenGL4.PixelMap map, int
/// <summary>
/// [requires: ARB_robustness]
/// </summary>
/// <returns></returns>
[AutoGenerated(Category = "ARB_robustness", Version = "", EntryPoint = "glGetnPolygonStippleARB")]
public static byte GetnPolygonStipple()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ public static unsafe void GetNamedString(int namelen, [CountAttribute(Parameter
/// <param name="name">
/// [length: namelen]
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "ARB_shading_language_include", Version = "", EntryPoint = "glIsNamedStringARB")]
public static bool IsNamedString(int namelen, [CountAttribute(Parameter = "namelen")] string name)
{
Expand Down
7 changes: 7 additions & 0 deletions src/OpenTK/Graphics/OpenGL4/Wrappers/Core/10.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ public static void FrontFace(OpenTK.Graphics.OpenGL4.FrontFaceDirection mode)
/// </summary>
/// <param name="pname">
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "VERSION_1_0", Version = "1.0", EntryPoint = "glGetBooleanv")]
public static bool GetBoolean(OpenTK.Graphics.OpenGL4.GetPName pname)
{
Expand Down Expand Up @@ -313,6 +314,7 @@ public static unsafe void GetBoolean(OpenTK.Graphics.OpenGL4.GetPName pname, [Ou
/// </summary>
/// <param name="pname">
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "VERSION_1_0", Version = "1.0", EntryPoint = "glGetDoublev")]
public static double GetDouble(OpenTK.Graphics.OpenGL4.GetPName pname)
{
Expand Down Expand Up @@ -365,6 +367,7 @@ public static unsafe void GetDouble(OpenTK.Graphics.OpenGL4.GetPName pname, [Out
/// [requires: v1.0]
/// Return error information.
/// </summary>
/// <returns></returns>
[AutoGenerated(Category = "VERSION_1_0", Version = "1.0", EntryPoint = "glGetError")]
public static OpenTK.Graphics.OpenGL4.ErrorCode GetError()
{
Expand All @@ -376,6 +379,7 @@ public static OpenTK.Graphics.OpenGL4.ErrorCode GetError()
/// </summary>
/// <param name="pname">
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "VERSION_1_0", Version = "1.0", EntryPoint = "glGetFloatv")]
public static float GetFloat(OpenTK.Graphics.OpenGL4.GetPName pname)
{
Expand Down Expand Up @@ -429,6 +433,7 @@ public static unsafe void GetFloat(OpenTK.Graphics.OpenGL4.GetPName pname, [OutA
/// </summary>
/// <param name="pname">
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "VERSION_1_0", Version = "1.0", EntryPoint = "glGetIntegerv")]
public static int GetInteger(OpenTK.Graphics.OpenGL4.GetPName pname)
{
Expand Down Expand Up @@ -484,6 +489,7 @@ public static unsafe void GetInteger(OpenTK.Graphics.OpenGL4.GetPName pname, [Ou
/// <param name="name">
/// Specifies a symbolic constant, one of Vendor, Renderer, Version, or ShadingLanguageVersion. Additionally, glGetStringi accepts the Extensions token.
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "VERSION_1_0", Version = "1.0", EntryPoint = "glGetString")]
public static string GetString(OpenTK.Graphics.OpenGL4.StringName name)
{
Expand Down Expand Up @@ -909,6 +915,7 @@ public static void Hint(OpenTK.Graphics.OpenGL4.HintTarget target, OpenTK.Graphi
/// <param name="cap">
/// Specifies a symbolic constant indicating a GL capability.
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "VERSION_1_0", Version = "1.0", EntryPoint = "glIsEnabled")]
public static bool IsEnabled(OpenTK.Graphics.OpenGL4.EnableCap cap)
{
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTK/Graphics/OpenGL4/Wrappers/Core/11.cs
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ public static void DrawElements<T3>(OpenTK.Graphics.OpenGL4.PrimitiveType mode,
/// [requires: v1.1]
/// Generate texture names.
/// </summary>
/// <returns></returns>
[AutoGenerated(Category = "VERSION_1_1", Version = "1.1", EntryPoint = "glGenTextures")]
public static uint GenTexture()
{
Expand Down Expand Up @@ -472,6 +473,7 @@ public static unsafe void GenTextures(int n, [OutAttribute, CountAttribute(Param
/// <param name="texture">
/// Specifies a value that may be the name of a texture.
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "VERSION_1_1", Version = "1.1", EntryPoint = "glIsTexture")]
public static bool IsTexture(uint texture)
{
Expand Down
6 changes: 6 additions & 0 deletions src/OpenTK/Graphics/OpenGL4/Wrappers/Core/15.cs
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ public static void EndQuery(OpenTK.Graphics.OpenGL4.QueryTarget target)
/// [requires: v1.5]
/// Generate buffer object names.
/// </summary>
/// <returns></returns>
[AutoGenerated(Category = "VERSION_1_5", Version = "1.5", EntryPoint = "glGenBuffers")]
public static uint GenBuffer()
{
Expand Down Expand Up @@ -761,6 +762,7 @@ public static unsafe void GenBuffers(int n, [OutAttribute, CountAttribute(Parame
/// [requires: v1.5]
/// Generate query object names.
/// </summary>
/// <returns></returns>
[AutoGenerated(Category = "VERSION_1_5", Version = "1.5", EntryPoint = "glGenQueries")]
public static uint GenQuery()
{
Expand Down Expand Up @@ -1419,6 +1421,7 @@ public static unsafe void GetQuery(OpenTK.Graphics.OpenGL4.QueryTarget target, O
/// <param name="buffer">
/// Specifies a value that may be the name of a buffer object.
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "VERSION_1_5", Version = "1.5", EntryPoint = "glIsBuffer")]
public static bool IsBuffer(uint buffer)
{
Expand All @@ -1432,6 +1435,7 @@ public static bool IsBuffer(uint buffer)
/// <param name="id">
/// Specifies a value that may be the name of a query object.
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "VERSION_1_5", Version = "1.5", EntryPoint = "glIsQuery")]
public static bool IsQuery(uint id)
{
Expand All @@ -1448,6 +1452,7 @@ public static bool IsQuery(uint id)
/// <param name="access">
/// For glMapBuffer only, specifies the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. The symbolic constant must be ReadOnly, WriteOnly, or ReadWrite.
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "VERSION_1_5", Version = "1.5", EntryPoint = "glMapBuffer")]
public static IntPtr MapBuffer(OpenTK.Graphics.OpenGL4.BufferTarget target, OpenTK.Graphics.OpenGL4.BufferAccess access)
{
Expand All @@ -1459,6 +1464,7 @@ public static IntPtr MapBuffer(OpenTK.Graphics.OpenGL4.BufferTarget target, Open
/// </summary>
/// <param name="target">
/// </param>
/// <returns></returns>
[AutoGenerated(Category = "VERSION_1_5", Version = "1.5", EntryPoint = "glUnmapBuffer")]
public static bool UnmapBuffer(OpenTK.Graphics.OpenGL4.BufferTarget target)
{
Expand Down
Loading

0 comments on commit b0d5ea0

Please sign in to comment.