From 489f84752ebbab7ece54ea5256a84da5c4254143 Mon Sep 17 00:00:00 2001 From: Amer Koleci Date: Wed, 8 May 2019 08:27:48 +0200 Subject: [PATCH] Update to v1.70. --- src/CodeGenerator/Program.cs | 2 +- src/CodeGenerator/definitions.json | 71 ++++++++++++---------- src/CodeGenerator/structs_and_enums.json | 5 ++ src/ImGui.NET/Generated/ImGui.gen.cs | 29 +++++---- src/ImGui.NET/Generated/ImGuiIO.gen.cs | 2 + src/ImGui.NET/Generated/ImGuiNative.gen.cs | 8 +-- src/ImGui.NET/ImGui.NET.csproj | 2 +- 7 files changed, 67 insertions(+), 52 deletions(-) diff --git a/src/CodeGenerator/Program.cs b/src/CodeGenerator/Program.cs index 5eeaa0e..5705c26 100644 --- a/src/CodeGenerator/Program.cs +++ b/src/CodeGenerator/Program.cs @@ -10,7 +10,7 @@ using System.Text.RegularExpressions; namespace CodeGenerator { - class Program + internal static class Program { private static readonly Dictionary s_wellKnownTypes = new Dictionary() { diff --git a/src/CodeGenerator/definitions.json b/src/CodeGenerator/definitions.json index 7fc3ae5..b8e33a6 100644 --- a/src/CodeGenerator/definitions.json +++ b/src/CodeGenerator/definitions.json @@ -718,11 +718,11 @@ "type": "ImU32" } ], - "argsoriginal": "(ImTextureID user_texture_id,const ImVec2& a,const ImVec2& b,const ImVec2& uv_a=ImVec2(0,0),const ImVec2& uv_b=ImVec2(1,1),ImU32 col=0xFFFFFFFF)", + "argsoriginal": "(ImTextureID user_texture_id,const ImVec2& a,const ImVec2& b,const ImVec2& uv_a=ImVec2(0,0),const ImVec2& uv_b=ImVec2(1,1),ImU32 col=(((ImU32)(255)<<24)|((ImU32)(255)<<16)|((ImU32)(255)<<8)|((ImU32)(255)<<0)))", "call_args": "(user_texture_id,a,b,uv_a,uv_b,col)", "cimguiname": "ImDrawList_AddImage", "defaults": { - "col": "0xFFFFFFFF", + "col": "(((ImU32)(255)<<24)|((ImU32)(255)<<16)|((ImU32)(255)<<8)|((ImU32)(255)<<0))", "uv_a": "ImVec2(0,0)", "uv_b": "ImVec2(1,1)" }, @@ -782,11 +782,11 @@ "type": "ImU32" } ], - "argsoriginal": "(ImTextureID user_texture_id,const ImVec2& a,const ImVec2& b,const ImVec2& c,const ImVec2& d,const ImVec2& uv_a=ImVec2(0,0),const ImVec2& uv_b=ImVec2(1,0),const ImVec2& uv_c=ImVec2(1,1),const ImVec2& uv_d=ImVec2(0,1),ImU32 col=0xFFFFFFFF)", + "argsoriginal": "(ImTextureID user_texture_id,const ImVec2& a,const ImVec2& b,const ImVec2& c,const ImVec2& d,const ImVec2& uv_a=ImVec2(0,0),const ImVec2& uv_b=ImVec2(1,0),const ImVec2& uv_c=ImVec2(1,1),const ImVec2& uv_d=ImVec2(0,1),ImU32 col=(((ImU32)(255)<<24)|((ImU32)(255)<<16)|((ImU32)(255)<<8)|((ImU32)(255)<<0)))", "call_args": "(user_texture_id,a,b,c,d,uv_a,uv_b,uv_c,uv_d,col)", "cimguiname": "ImDrawList_AddImageQuad", "defaults": { - "col": "0xFFFFFFFF", + "col": "(((ImU32)(255)<<24)|((ImU32)(255)<<16)|((ImU32)(255)<<8)|((ImU32)(255)<<0))", "uv_a": "ImVec2(0,0)", "uv_b": "ImVec2(1,0)", "uv_c": "ImVec2(1,1)", @@ -18524,7 +18524,7 @@ ], "igDebugCheckVersionAndDataLayout": [ { - "args": "(const char* version_str,size_t sz_io,size_t sz_style,size_t sz_vec2,size_t sz_vec4,size_t sz_drawvert)", + "args": "(const char* version_str,size_t sz_io,size_t sz_style,size_t sz_vec2,size_t sz_vec4,size_t sz_drawvert,size_t sz_drawidx)", "argsT": [ { "name": "version_str", @@ -18549,17 +18549,21 @@ { "name": "sz_drawvert", "type": "size_t" + }, + { + "name": "sz_drawidx", + "type": "size_t" } ], - "argsoriginal": "(const char* version_str,size_t sz_io,size_t sz_style,size_t sz_vec2,size_t sz_vec4,size_t sz_drawvert)", - "call_args": "(version_str,sz_io,sz_style,sz_vec2,sz_vec4,sz_drawvert)", + "argsoriginal": "(const char* version_str,size_t sz_io,size_t sz_style,size_t sz_vec2,size_t sz_vec4,size_t sz_drawvert,size_t sz_drawidx)", + "call_args": "(version_str,sz_io,sz_style,sz_vec2,sz_vec4,sz_drawvert,sz_drawidx)", "cimguiname": "igDebugCheckVersionAndDataLayout", "defaults": [], "funcname": "DebugCheckVersionAndDataLayout", "namespace": "ImGui", "ov_cimguiname": "igDebugCheckVersionAndDataLayout", "ret": "bool", - "signature": "(const char*,size_t,size_t,size_t,size_t,size_t)", + "signature": "(const char*,size_t,size_t,size_t,size_t,size_t,size_t)", "stname": "" } ], @@ -19689,22 +19693,6 @@ "stname": "" } ], - "igGetContentRegionAvailWidth": [ - { - "args": "()", - "argsT": [], - "argsoriginal": "()", - "call_args": "()", - "cimguiname": "igGetContentRegionAvailWidth", - "defaults": [], - "funcname": "GetContentRegionAvailWidth", - "namespace": "ImGui", - "ov_cimguiname": "igGetContentRegionAvailWidth", - "ret": "float", - "signature": "()", - "stname": "" - } - ], "igGetContentRegionMax": [ { "args": "()", @@ -23913,23 +23901,23 @@ ], "igSameLine": [ { - "args": "(float local_pos_x,float spacing_w)", + "args": "(float offset_from_start_x,float spacing)", "argsT": [ { - "name": "local_pos_x", + "name": "offset_from_start_x", "type": "float" }, { - "name": "spacing_w", + "name": "spacing", "type": "float" } ], - "argsoriginal": "(float local_pos_x=0.0f,float spacing_w=-1.0f)", - "call_args": "(local_pos_x,spacing_w)", + "argsoriginal": "(float offset_from_start_x=0.0f,float spacing=-1.0f)", + "call_args": "(offset_from_start_x,spacing)", "cimguiname": "igSameLine", "defaults": { - "local_pos_x": "0.0f", - "spacing_w": "-1.0f" + "offset_from_start_x": "0.0f", + "spacing": "-1.0f" }, "funcname": "SameLine", "namespace": "ImGui", @@ -24413,6 +24401,27 @@ "stname": "" } ], + "igSetNextItemWidth": [ + { + "args": "(float item_width)", + "argsT": [ + { + "name": "item_width", + "type": "float" + } + ], + "argsoriginal": "(float item_width)", + "call_args": "(item_width)", + "cimguiname": "igSetNextItemWidth", + "defaults": [], + "funcname": "SetNextItemWidth", + "namespace": "ImGui", + "ov_cimguiname": "igSetNextItemWidth", + "ret": "void", + "signature": "(float)", + "stname": "" + } + ], "igSetNextTreeNodeOpen": [ { "args": "(bool is_open,ImGuiCond cond)", diff --git a/src/CodeGenerator/structs_and_enums.json b/src/CodeGenerator/structs_and_enums.json index 011c60e..6b19e72 100644 --- a/src/CodeGenerator/structs_and_enums.json +++ b/src/CodeGenerator/structs_and_enums.json @@ -2410,6 +2410,11 @@ "size": 5, "type": "bool" }, + { + "name": "MouseDownWasDoubleClick[5]", + "size": 5, + "type": "bool" + }, { "name": "MouseDownDuration[5]", "size": 5, diff --git a/src/ImGui.NET/Generated/ImGui.gen.cs b/src/ImGui.NET/Generated/ImGui.gen.cs index 43eaf8a..aa808fd 100644 --- a/src/ImGui.NET/Generated/ImGui.gen.cs +++ b/src/ImGui.NET/Generated/ImGui.gen.cs @@ -2052,7 +2052,7 @@ namespace ImGuiNET IntPtr ret = ImGuiNative.igCreateContext(native_shared_font_atlas); return ret; } - public static bool DebugCheckVersionAndDataLayout(string version_str, uint sz_io, uint sz_style, uint sz_vec2, uint sz_vec4, uint sz_drawvert) + public static bool DebugCheckVersionAndDataLayout(string version_str, uint sz_io, uint sz_style, uint sz_vec2, uint sz_vec4, uint sz_drawvert, uint sz_drawidx) { byte* native_version_str; int version_str_byteCount = 0; @@ -2072,7 +2072,7 @@ namespace ImGuiNET native_version_str[native_version_str_offset] = 0; } else { native_version_str = null; } - byte ret = ImGuiNative.igDebugCheckVersionAndDataLayout(native_version_str, sz_io, sz_style, sz_vec2, sz_vec4, sz_drawvert); + byte ret = ImGuiNative.igDebugCheckVersionAndDataLayout(native_version_str, sz_io, sz_style, sz_vec2, sz_vec4, sz_drawvert, sz_drawidx); if (version_str_byteCount > Util.StackAllocationSizeLimit) { Util.Free(native_version_str); @@ -5627,11 +5627,6 @@ namespace ImGuiNET Vector2 ret = ImGuiNative.igGetContentRegionAvail(); return ret; } - public static float GetContentRegionAvailWidth() - { - float ret = ImGuiNative.igGetContentRegionAvailWidth(); - return ret; - } public static Vector2 GetContentRegionMax() { Vector2 ret = ImGuiNative.igGetContentRegionMax(); @@ -9994,18 +9989,18 @@ namespace ImGuiNET } public static void SameLine() { - float local_pos_x = 0.0f; - float spacing_w = -1.0f; - ImGuiNative.igSameLine(local_pos_x, spacing_w); + float offset_from_start_x = 0.0f; + float spacing = -1.0f; + ImGuiNative.igSameLine(offset_from_start_x, spacing); } - public static void SameLine(float local_pos_x) + public static void SameLine(float offset_from_start_x) { - float spacing_w = -1.0f; - ImGuiNative.igSameLine(local_pos_x, spacing_w); + float spacing = -1.0f; + ImGuiNative.igSameLine(offset_from_start_x, spacing); } - public static void SameLine(float local_pos_x, float spacing_w) + public static void SameLine(float offset_from_start_x, float spacing) { - ImGuiNative.igSameLine(local_pos_x, spacing_w); + ImGuiNative.igSameLine(offset_from_start_x, spacing); } public static void SaveIniSettingsToDisk(string ini_filename) { @@ -10397,6 +10392,10 @@ namespace ImGuiNET { ImGuiNative.igSetMouseCursor(type); } + public static void SetNextItemWidth(float item_width) + { + ImGuiNative.igSetNextItemWidth(item_width); + } public static void SetNextTreeNodeOpen(bool is_open) { byte native_is_open = is_open ? (byte)1 : (byte)0; diff --git a/src/ImGui.NET/Generated/ImGuiIO.gen.cs b/src/ImGui.NET/Generated/ImGuiIO.gen.cs index c7fcb9e..8300315 100644 --- a/src/ImGui.NET/Generated/ImGuiIO.gen.cs +++ b/src/ImGui.NET/Generated/ImGuiIO.gen.cs @@ -77,6 +77,7 @@ namespace ImGuiNET public fixed byte MouseDoubleClicked[5]; public fixed byte MouseReleased[5]; public fixed byte MouseDownOwned[5]; + public fixed byte MouseDownWasDoubleClick[5]; public fixed float MouseDownDuration[5]; public fixed float MouseDownDurationPrev[5]; public Vector2 MouseDragMaxDistanceAbs_0; @@ -165,6 +166,7 @@ namespace ImGuiNET public RangeAccessor MouseDoubleClicked => new RangeAccessor(NativePtr->MouseDoubleClicked, 5); public RangeAccessor MouseReleased => new RangeAccessor(NativePtr->MouseReleased, 5); public RangeAccessor MouseDownOwned => new RangeAccessor(NativePtr->MouseDownOwned, 5); + public RangeAccessor MouseDownWasDoubleClick => new RangeAccessor(NativePtr->MouseDownWasDoubleClick, 5); public RangeAccessor MouseDownDuration => new RangeAccessor(NativePtr->MouseDownDuration, 5); public RangeAccessor MouseDownDurationPrev => new RangeAccessor(NativePtr->MouseDownDurationPrev, 5); public RangeAccessor MouseDragMaxDistanceAbs => new RangeAccessor(&NativePtr->MouseDragMaxDistanceAbs_0, 5); diff --git a/src/ImGui.NET/Generated/ImGuiNative.gen.cs b/src/ImGui.NET/Generated/ImGuiNative.gen.cs index 4451b79..2ee31ac 100644 --- a/src/ImGui.NET/Generated/ImGuiNative.gen.cs +++ b/src/ImGui.NET/Generated/ImGuiNative.gen.cs @@ -109,7 +109,7 @@ namespace ImGuiNET [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr igCreateContext(ImFontAtlas* shared_font_atlas); [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] - public static extern byte igDebugCheckVersionAndDataLayout(byte* version_str, uint sz_io, uint sz_style, uint sz_vec2, uint sz_vec4, uint sz_drawvert); + public static extern byte igDebugCheckVersionAndDataLayout(byte* version_str, uint sz_io, uint sz_style, uint sz_vec2, uint sz_vec4, uint sz_drawvert, uint sz_drawidx); [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] public static extern void igDestroyContext(IntPtr ctx); [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] @@ -188,8 +188,6 @@ namespace ImGuiNET public static extern float igGetColumnWidth(int column_index); [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl, EntryPoint = "igGetContentRegionAvail_nonUDT2")] public static extern Vector2 igGetContentRegionAvail(); - [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] - public static extern float igGetContentRegionAvailWidth(); [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl, EntryPoint = "igGetContentRegionMax_nonUDT2")] public static extern Vector2 igGetContentRegionMax(); [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] @@ -493,7 +491,7 @@ namespace ImGuiNET [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] public static extern void igResetMouseDragDelta(int button); [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] - public static extern void igSameLine(float local_pos_x, float spacing_w); + public static extern void igSameLine(float offset_from_start_x, float spacing); [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] public static extern void igSaveIniSettingsToDisk(byte* ini_filename); [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] @@ -533,6 +531,8 @@ namespace ImGuiNET [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] public static extern void igSetMouseCursor(ImGuiMouseCursor type); [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] + public static extern void igSetNextItemWidth(float item_width); + [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] public static extern void igSetNextTreeNodeOpen(byte is_open, ImGuiCond cond); [DllImport("cimgui", CallingConvention = CallingConvention.Cdecl)] public static extern void igSetNextWindowBgAlpha(float alpha); diff --git a/src/ImGui.NET/ImGui.NET.csproj b/src/ImGui.NET/ImGui.NET.csproj index c79ef82..d39163c 100644 --- a/src/ImGui.NET/ImGui.NET.csproj +++ b/src/ImGui.NET/ImGui.NET.csproj @@ -1,7 +1,7 @@  A .NET wrapper for the Dear ImGui library. - 1.69.0 + 1.70.0 Eric Mellino netstandard2.0 true