mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-10 11:58:30 +01:00
prepare 1.62.0-beta
This commit is contained in:
@@ -8,8 +8,8 @@ Generated files are: cimgui.cpp, cimgui.h for C compilation. Also for helping in
|
||||
This library is intended as a intermediate layer to be able to use imgui from other languages that can interface with C (like D - see [D-binding](https://github.com/Extrawurst/DerelictImgui))
|
||||
|
||||
Notes:
|
||||
* currently this wrapper is based on version [1.62WIP of imgui](https://github.com/ocornut/imgui/)
|
||||
* does not compile with pure C compiler yet (for writing bindings in languages that are able to use C-ABI it is enough though, see D-bindings)
|
||||
* currently this wrapper is based on version [1.62 of imgui](https://github.com/ocornut/imgui/tree/v1.62)
|
||||
* overloaded function names try to be the most compatible with traditional cimgui names. So all naming is algorithmic except for those names that were in conflict with widely used cimgui names and were thus coded in a table (https://github.com/sonoro1234/cimgui/blob/cimgui_auto_implementations/generator/generator.lua#L40). Until the comunity finish with defining this table tag will be 1.62beta. Current overloaded function names can be found in (https://github.com/sonoro1234/cimgui/tree/cimgui_auto_implementations/generator/generated/overloads.txt)
|
||||
|
||||
# auto binding generation
|
||||
|
||||
|
1774
cimgui_auto.h
1774
cimgui_auto.h
File diff suppressed because it is too large
Load Diff
@@ -82,7 +82,7 @@ typedef struct ImDrawList ImDrawList;
|
||||
typedef struct ImDrawData ImDrawData;
|
||||
typedef struct ImDrawCmd ImDrawCmd;
|
||||
typedef struct ImDrawChannel ImDrawChannel;
|
||||
typedef void* ImTextureID;// dear imgui, v1.63 WIP
|
||||
typedef void* ImTextureID;// dear imgui, v1.62
|
||||
// (headers)
|
||||
// See imgui.cpp file for documentation.
|
||||
// Call and read ImGui::ShowDemoWindow() in imgui_demo.cpp for demo code.
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -103,12 +103,11 @@ defs["ImGui_ImplOpenGL3_Init"][1]["funcname"] = "ImGui_ImplOpenGL3_Init"
|
||||
defs["ImGui_ImplOpenGL3_Init"][1]["args"] = "(const char* glsl_version)"
|
||||
defs["ImGui_ImplOpenGL3_Init"][1]["ret"] = "bool"
|
||||
defs["ImGui_ImplOpenGL3_Init"][1]["call_args"] = "(glsl_version)"
|
||||
defs["ImGui_ImplOpenGL3_Init"][1]["argsoriginal"] = "(const char* glsl_version=NULL)"
|
||||
defs["ImGui_ImplOpenGL3_Init"][1]["argsoriginal"] = "(const char* glsl_version=\"#version 150\")"
|
||||
defs["ImGui_ImplOpenGL3_Init"][1]["stname"] = ""
|
||||
defs["ImGui_ImplOpenGL3_Init"][1]["comment"] = ""
|
||||
defs["ImGui_ImplOpenGL3_Init"][1]["location"] = "imgui_impl_opengl3"
|
||||
defs["ImGui_ImplOpenGL3_Init"][1]["defaults"] = {}
|
||||
defs["ImGui_ImplOpenGL3_Init"][1]["defaults"]["glsl_version"] = "NULL"
|
||||
defs["ImGui_ImplOpenGL3_Init"][1]["signature"] = "(const char*)"
|
||||
defs["ImGui_ImplOpenGL3_Init"][1]["cimguiname"] = "ImGui_ImplOpenGL3_Init"
|
||||
defs["ImGui_ImplOpenGL3_Init"]["(const char*)"] = defs["ImGui_ImplOpenGL3_Init"][1]
|
||||
|
111
generator/generated/overloads.txt
Normal file
111
generator/generated/overloads.txt
Normal file
@@ -0,0 +1,111 @@
|
||||
----------------overloadings---------------------------
|
||||
igCombo 3
|
||||
1 bool igCombo (const char*,int*,const char* const[],int,int)
|
||||
2 bool igComboStr (const char*,int*,const char*,int)
|
||||
3 bool igComboFnPtr (const char*,int*,bool(*)(void*,int,const char**),void*,int,int)
|
||||
ImVec4_ImVec4 2
|
||||
1 nil ImVec4_ImVec4 ()
|
||||
2 nil ImVec4_ImVec4Float (float,float,float,float)
|
||||
igValue 4
|
||||
1 void igValueBool (const char*,bool)
|
||||
2 void igValueInt (const char*,int)
|
||||
3 void igValueUint (const char*,unsigned int)
|
||||
4 void igValueFloat (const char*,float,const char*)
|
||||
igPushStyleVar 2
|
||||
1 void igPushStyleVarFloat (ImGuiStyleVar,float)
|
||||
2 void igPushStyleVarVec2 (ImGuiStyleVar,const ImVec2)
|
||||
igIsRectVisible 2
|
||||
1 bool igIsRectVisible (const ImVec2)
|
||||
2 bool igIsRectVisibleVec2 (const ImVec2,const ImVec2)
|
||||
igRadioButton 2
|
||||
1 bool igRadioButtonBool (const char*,bool)
|
||||
2 bool igRadioButtonIntPtr (const char*,int*,int)
|
||||
igSetWindowSize 2
|
||||
1 void igSetWindowSizeVec2 (const ImVec2,ImGuiCond)
|
||||
2 void igSetWindowSizeStr (const char*,const ImVec2,ImGuiCond)
|
||||
igSetWindowCollapsed 2
|
||||
1 void igSetWindowCollapsedBool (bool,ImGuiCond)
|
||||
2 void igSetWindowCollapsedStr (const char*,bool,ImGuiCond)
|
||||
igPlotLines 2
|
||||
1 void igPlotLines (const char*,const float*,int,int,const char*,float,float,ImVec2,int)
|
||||
2 void igPlotLinesFnPtr (const char*,float(*)(void*,int),void*,int,int,const char*,float,float,ImVec2)
|
||||
ImVec2_ImVec2 2
|
||||
1 nil ImVec2_ImVec2 ()
|
||||
2 nil ImVec2_ImVec2Float (float,float)
|
||||
igPlotHistogram 2
|
||||
1 void igPlotHistogramFloatPtr (const char*,const float*,int,int,const char*,float,float,ImVec2,int)
|
||||
2 void igPlotHistogramFnPtr (const char*,float(*)(void*,int),void*,int,int,const char*,float,float,ImVec2)
|
||||
igTreeNodeExV 2
|
||||
1 bool igTreeNodeExVStr (const char*,ImGuiTreeNodeFlags,const char*,va_list)
|
||||
2 bool igTreeNodeExVPtr (const void*,ImGuiTreeNodeFlags,const char*,va_list)
|
||||
igGetID 3
|
||||
1 ImGuiID igGetIDStr (const char*)
|
||||
2 ImGuiID igGetIDStrStr (const char*,const char*)
|
||||
3 ImGuiID igGetIDPtr (const void*)
|
||||
igBeginChild 2
|
||||
1 bool igBeginChild (const char*,const ImVec2,bool,ImGuiWindowFlags)
|
||||
2 bool igBeginChildID (ImGuiID,const ImVec2,bool,ImGuiWindowFlags)
|
||||
igSetWindowFocus 2
|
||||
1 void igSetWindowFocus ()
|
||||
2 void igSetWindowFocusStr (const char*)
|
||||
ImDrawList_AddText 2
|
||||
1 void ImDrawList_AddText (const ImVec2,ImU32,const char*,const char*)
|
||||
2 void ImDrawList_AddTextFontPtr (const ImFont*,float,const ImVec2,ImU32,const char*,const char*,float,const ImVec4*)
|
||||
igSelectable 2
|
||||
1 bool igSelectable (const char*,bool,ImGuiSelectableFlags,const ImVec2)
|
||||
2 bool igSelectableBoolPtr (const char*,bool*,ImGuiSelectableFlags,const ImVec2)
|
||||
igListBox 2
|
||||
1 bool igListBoxStr_arr (const char*,int*,const char* const[],int,int)
|
||||
2 bool igListBoxFnPtr (const char*,int*,bool(*)(void*,int,const char**),void*,int,int)
|
||||
igPushID 4
|
||||
1 void igPushIDStr (const char*)
|
||||
2 void igPushIDRange (const char*,const char*)
|
||||
3 void igPushIDPtr (const void*)
|
||||
4 void igPushIDInt (int)
|
||||
Pair_Pair 3
|
||||
1 nil Pair_PairInt (ImGuiID,int)
|
||||
2 nil Pair_PairFloat (ImGuiID,float)
|
||||
3 nil Pair_PairPtr (ImGuiID,void*)
|
||||
igTreePush 2
|
||||
1 void igTreePushStr (const char*)
|
||||
2 void igTreePushPtr (const void*)
|
||||
TextRange_TextRange 2
|
||||
1 nil TextRange_TextRange ()
|
||||
2 nil TextRange_TextRangeStr (const char*,const char*)
|
||||
igGetColorU32 3
|
||||
1 ImU32 igGetColorU32 (ImGuiCol,float)
|
||||
2 ImU32 igGetColorU32Vec4 (const ImVec4)
|
||||
3 ImU32 igGetColorU32U32 (ImU32)
|
||||
ImColor_ImColor 5
|
||||
1 nil ImColor_ImColor ()
|
||||
2 nil ImColor_ImColorInt (int,int,int,int)
|
||||
3 nil ImColor_ImColorU32 (ImU32)
|
||||
4 nil ImColor_ImColorFloat (float,float,float,float)
|
||||
5 nil ImColor_ImColorVec4 (const ImVec4)
|
||||
igPushStyleColor 2
|
||||
1 void igPushStyleColorU32 (ImGuiCol,ImU32)
|
||||
2 void igPushStyleColor (ImGuiCol,const ImVec4)
|
||||
igCollapsingHeader 2
|
||||
1 bool igCollapsingHeader (const char*,ImGuiTreeNodeFlags)
|
||||
2 bool igCollapsingHeaderBoolPtr (const char*,bool*,ImGuiTreeNodeFlags)
|
||||
igListBoxHeader 2
|
||||
1 bool igListBoxHeaderVec2 (const char*,const ImVec2)
|
||||
2 bool igListBoxHeaderInt (const char*,int,int)
|
||||
igMenuItem 2
|
||||
1 bool igMenuItemBool (const char*,const char*,bool,bool)
|
||||
2 bool igMenuItemBoolPtr (const char*,const char*,bool*,bool)
|
||||
igSetWindowPos 2
|
||||
1 void igSetWindowPosVec2 (const ImVec2,ImGuiCond)
|
||||
2 void igSetWindowPosStr (const char*,const ImVec2,ImGuiCond)
|
||||
igTreeNodeEx 3
|
||||
1 bool igTreeNodeExStr (const char*,ImGuiTreeNodeFlags)
|
||||
2 bool igTreeNodeExStrStr (const char*,ImGuiTreeNodeFlags,const char*,...)
|
||||
3 bool igTreeNodeExPtr (const void*,ImGuiTreeNodeFlags,const char*,...)
|
||||
igTreeNode 3
|
||||
1 bool igTreeNodeStr (const char*)
|
||||
2 bool igTreeNodeStrStr (const char*,const char*,...)
|
||||
3 bool igTreeNodePtr (const void*,const char*,...)
|
||||
igTreeNodeV 2
|
||||
1 bool igTreeNodeVStr (const char*,const char*,va_list)
|
||||
2 bool igTreeNodeVPtr (const void*,const char*,va_list)
|
||||
77 overloaded
|
@@ -8,17 +8,17 @@ local script_args = {...}
|
||||
local HAVE_GCC
|
||||
local pipe,err = io.popen("gcc --version","r")
|
||||
if pipe then
|
||||
local str = pipe:read"*a"
|
||||
print(str)
|
||||
pipe:close()
|
||||
if str=="" then
|
||||
HAVE_GCC = false
|
||||
else
|
||||
HAVE_GCC = true
|
||||
end
|
||||
local str = pipe:read"*a"
|
||||
print(str)
|
||||
pipe:close()
|
||||
if str=="" then
|
||||
HAVE_GCC = false
|
||||
else
|
||||
HAVE_GCC = true
|
||||
end
|
||||
else
|
||||
HAVE_GCC = false
|
||||
print(err)
|
||||
HAVE_GCC = false
|
||||
print(err)
|
||||
end
|
||||
print("HAVE_GCC",HAVE_GCC)
|
||||
--get implementations
|
||||
@@ -174,10 +174,10 @@ end
|
||||
|
||||
local function save_data(filename,...)
|
||||
local file = io.open(filename,"w")
|
||||
for i=1, select('#', ...) do
|
||||
local data = select(i, ...)
|
||||
file:write(data)
|
||||
end
|
||||
for i=1, select('#', ...) do
|
||||
local data = select(i, ...)
|
||||
file:write(data)
|
||||
end
|
||||
file:close()
|
||||
end
|
||||
|
||||
@@ -497,23 +497,30 @@ local function func_parser()
|
||||
for k,v in pairs(self.alltypes) do print(k, typetoStr(k) ) end
|
||||
end
|
||||
function FP:compute_overloads()
|
||||
local strt = {}
|
||||
local numoverloaded = 0
|
||||
FP.alltypes = {}
|
||||
print"----------------overloadings---------------------------"
|
||||
table.insert(strt,"----------------overloadings---------------------------")
|
||||
--require"anima.utils"
|
||||
for k,v in pairs(FP.defsT) do
|
||||
get_types(v)
|
||||
if #v > 1 then
|
||||
numoverloaded = numoverloaded + #v
|
||||
print(k,#v)
|
||||
--print(k,#v)
|
||||
table.insert(strt,string.format("%s\t%d",k,#v))
|
||||
local typesc,post = name_overloadsAlgo(v)
|
||||
for i,t in ipairs(v) do
|
||||
--take overloaded name from manual table or algorythm
|
||||
t.ov_cimguiname = getcimguiname_overload(t.stname,t.funcname,t.signature) or k..typetoStr(post[i])
|
||||
print(i,t.signature,t.ret,t.ov_cimguiname,post[i])--,typetoStr(post[i]))
|
||||
--print(i,t.signature,t.ret,t.ov_cimguiname)--,post[i])--,typetoStr(post[i]))
|
||||
table.insert(strt,string.format("%d\t%s\t%s %s",i,t.ret,t.ov_cimguiname,t.signature))
|
||||
--prtable(typesc[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
print(numoverloaded, "overloaded")
|
||||
--print(numoverloaded, "overloaded")
|
||||
table.insert(strt,string.format("%d overloaded",numoverloaded))
|
||||
return table.concat(strt,"\n")
|
||||
end
|
||||
return FP
|
||||
end
|
||||
@@ -723,8 +730,8 @@ typedef struct ImVector ImVector;]])
|
||||
for i,l in ipairs(typedefs_table) do
|
||||
table.insert(outtab,2,l)
|
||||
end
|
||||
local cstructsstr = table.concat(outtab)
|
||||
cstructsstr = cstructsstr:gsub("\n+","\n") --several empty lines to one empty line
|
||||
local cstructsstr = table.concat(outtab)
|
||||
cstructsstr = cstructsstr:gsub("\n+","\n") --several empty lines to one empty line
|
||||
return cstructsstr
|
||||
end
|
||||
|
||||
@@ -748,7 +755,7 @@ local function func_header_impl_generate(FP)
|
||||
table.insert(outtab,t.comment:gsub("%%","%%%%").."\n")-- %% substitution for gsub
|
||||
end
|
||||
end
|
||||
local cfuncsstr = table.concat(outtab)
|
||||
local cfuncsstr = table.concat(outtab)
|
||||
cfuncsstr = cfuncsstr:gsub("\n+","\n") --several empty lines to one empty line
|
||||
return cfuncsstr
|
||||
end
|
||||
@@ -790,9 +797,9 @@ local function func_header_generate(FP)
|
||||
end
|
||||
end
|
||||
|
||||
local cfuncsstr = table.concat(outtab)
|
||||
cfuncsstr = cfuncsstr:gsub("\n+","\n") --several empty lines to one empty line
|
||||
return cfuncsstr
|
||||
local cfuncsstr = table.concat(outtab)
|
||||
cfuncsstr = cfuncsstr:gsub("\n+","\n") --several empty lines to one empty line
|
||||
return cfuncsstr
|
||||
end
|
||||
local function func_implementation(FP)
|
||||
|
||||
@@ -858,25 +865,25 @@ local function func_implementation(FP)
|
||||
end
|
||||
--generate cimgui.cpp cimgui.h and auto versions depending on postfix
|
||||
local function cimgui_generation(postfix,STP,FP)
|
||||
--merge it in cimgui_template.h to cimgui.h
|
||||
local hfile = io.open("./cimgui_template.h","r")
|
||||
local hstrfile = hfile:read"*a"
|
||||
hfile:close()
|
||||
local cstructsstr = gen_structs_and_enums(STP.lines,postfix=="")
|
||||
hstrfile = hstrfile:gsub([[#include "imgui_structs%.h"]],cstructsstr)
|
||||
local cfuncsstr = func_header_generate(FP)
|
||||
hstrfile = hstrfile:gsub([[#include "auto_funcs%.h"]],cfuncsstr)
|
||||
save_data("./generated/cimgui"..postfix..".h",hstrfile)
|
||||
|
||||
|
||||
--merge it in cimgui_template.cpp to cimgui.cpp
|
||||
local cimplem = func_implementation(FP)
|
||||
local hfile = io.open("./cimgui_template.cpp","r")
|
||||
local hstrfile = hfile:read"*a"
|
||||
hfile:close()
|
||||
hstrfile = hstrfile:gsub([[#include "auto_funcs%.cpp"]],cimplem)
|
||||
hstrfile = hstrfile:gsub([[#include "cimgui%.h"]],[[#include "cimgui]]..postfix..[[.h"]])
|
||||
save_data("./generated/cimgui"..postfix..".cpp",hstrfile)
|
||||
--merge it in cimgui_template.h to cimgui.h
|
||||
local hfile = io.open("./cimgui_template.h","r")
|
||||
local hstrfile = hfile:read"*a"
|
||||
hfile:close()
|
||||
local cstructsstr = gen_structs_and_enums(STP.lines,postfix=="")
|
||||
hstrfile = hstrfile:gsub([[#include "imgui_structs%.h"]],cstructsstr)
|
||||
local cfuncsstr = func_header_generate(FP)
|
||||
hstrfile = hstrfile:gsub([[#include "auto_funcs%.h"]],cfuncsstr)
|
||||
save_data("./generated/cimgui"..postfix..".h",hstrfile)
|
||||
|
||||
|
||||
--merge it in cimgui_template.cpp to cimgui.cpp
|
||||
local cimplem = func_implementation(FP)
|
||||
local hfile = io.open("./cimgui_template.cpp","r")
|
||||
local hstrfile = hfile:read"*a"
|
||||
hfile:close()
|
||||
hstrfile = hstrfile:gsub([[#include "auto_funcs%.cpp"]],cimplem)
|
||||
hstrfile = hstrfile:gsub([[#include "cimgui%.h"]],[[#include "cimgui]]..postfix..[[.h"]])
|
||||
save_data("./generated/cimgui"..postfix..".cpp",hstrfile)
|
||||
end
|
||||
--------------------------------------------------------
|
||||
-----------------------------do it----------------------
|
||||
@@ -901,7 +908,7 @@ cimgui_generation("",STP,FP)
|
||||
|
||||
--then gcc
|
||||
if HAVE_GCC then
|
||||
local pipe,err = io.popen([[gcc -E -C -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ../imgui/imgui.h]],"r")
|
||||
local pipe,err = io.popen([[gcc -E -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ../imgui/imgui.h]],"r")
|
||||
|
||||
if not pipe then
|
||||
error("could not execute gcc "..err)
|
||||
@@ -916,7 +923,8 @@ for line in location(pipe,{"imgui"}) do
|
||||
FP.insert(line,comment)
|
||||
end
|
||||
pipe:close()
|
||||
FP:compute_overloads()
|
||||
local ovstr = FP:compute_overloads()
|
||||
save_data("./generated/overloads.txt",ovstr)
|
||||
cimgui_generation("_auto",STP,FP)
|
||||
|
||||
end
|
||||
@@ -934,39 +942,39 @@ local iFP,iSTP
|
||||
|
||||
if #implementations > 0 then
|
||||
|
||||
iFP = func_parser()
|
||||
iSTP = struct_parser()
|
||||
|
||||
for i,impl in ipairs(implementations) do
|
||||
local source = [[../imgui/examples/imgui_impl_]].. impl .. ".h "
|
||||
local locati = [[imgui_impl_]].. impl
|
||||
local pipe,err
|
||||
if HAVE_GCC then
|
||||
pipe,err = io.popen([[gcc -E -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ]] ..source,"r")
|
||||
else
|
||||
pipe,err = io.open(source,"r")
|
||||
end
|
||||
if not pipe then
|
||||
error("could not get file: "..err)
|
||||
end
|
||||
|
||||
local iterator = (HAVE_GCC and location) or filelines
|
||||
|
||||
for line,locat in iterator(pipe,{locati}) do
|
||||
local line, comment = split_comment(line)
|
||||
iSTP.insert(line,comment)
|
||||
iFP.insert(line,comment,locat)
|
||||
end
|
||||
pipe:close()
|
||||
end
|
||||
iFP = func_parser()
|
||||
iSTP = struct_parser()
|
||||
|
||||
for i,impl in ipairs(implementations) do
|
||||
local source = [[../imgui/examples/imgui_impl_]].. impl .. ".h "
|
||||
local locati = [[imgui_impl_]].. impl
|
||||
local pipe,err
|
||||
if HAVE_GCC then
|
||||
pipe,err = io.popen([[gcc -E -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ]] ..source,"r")
|
||||
else
|
||||
pipe,err = io.open(source,"r")
|
||||
end
|
||||
if not pipe then
|
||||
error("could not get file: "..err)
|
||||
end
|
||||
|
||||
local iterator = (HAVE_GCC and location) or filelines
|
||||
|
||||
for line,locat in iterator(pipe,{locati}) do
|
||||
local line, comment = split_comment(line)
|
||||
iSTP.insert(line,comment)
|
||||
iFP.insert(line,comment,locat)
|
||||
end
|
||||
pipe:close()
|
||||
end
|
||||
|
||||
-- save ./cimgui_impl.h
|
||||
local cfuncsstr = func_header_impl_generate(iFP)
|
||||
local cstructstr = gen_structs_and_enums(iSTP.lines)
|
||||
save_data("./generated/cimgui_impl.h",cstructstr,cfuncsstr)
|
||||
-- save ./cimgui_impl.h
|
||||
local cfuncsstr = func_header_impl_generate(iFP)
|
||||
local cstructstr = gen_structs_and_enums(iSTP.lines)
|
||||
save_data("./generated/cimgui_impl.h",cstructstr,cfuncsstr)
|
||||
|
||||
----------save fundefs in impl_definitions.lua for using in bindings
|
||||
save_data("./generated/impl_definitions.lua",serializeTable("defs",iFP.defsT),"\nreturn defs")
|
||||
----------save fundefs in impl_definitions.lua for using in bindings
|
||||
save_data("./generated/impl_definitions.lua",serializeTable("defs",iFP.defsT),"\nreturn defs")
|
||||
|
||||
end -- #implementations > 0 then
|
||||
|
||||
|
2
imgui
2
imgui
Submodule imgui updated: 79153cf19f...00418d13e3
Reference in New Issue
Block a user