mirror of
https://github.com/cimgui/cimgui.git
synced 2026-03-22 22:11:16 +00:00
Compare commits
5 Commits
1.92.5
...
99f8065703
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99f8065703 | ||
|
|
b801b08eee | ||
|
|
a890b9f594 | ||
|
|
c56d1668b1 | ||
|
|
9dd992c22b |
@@ -41,7 +41,7 @@ Notes:
|
|||||||
* you will need LuaJIT (https://github.com/LuaJIT/LuaJIT.git better 2.1 branch) or precompiled for linux/macOS/windows in https://luapower.com/luajit/download
|
* you will need LuaJIT (https://github.com/LuaJIT/LuaJIT.git better 2.1 branch) or precompiled for linux/macOS/windows in https://luapower.com/luajit/download
|
||||||
* you need to use also a C++ compiler for doing preprocessing: gcc (In windows MinGW-W64-builds for example), clang or cl (MSVC). (this repo was done with gcc)
|
* you need to use also a C++ compiler for doing preprocessing: gcc (In windows MinGW-W64-builds for example), clang or cl (MSVC). (this repo was done with gcc)
|
||||||
* update `imgui` folder to the version you desire.
|
* update `imgui` folder to the version you desire.
|
||||||
* edit `generator/generator.bat` on windows, or `generator/generator.sh` on linux, to choose between gcc, clang, or cl and to choose desired backends and whether imgui_internal is generated or not, comments are generated or not and if constructors are generated also with versions performing just initialization of structs provided by yourself (_Construct is added to the constructor names)
|
* edit `generator/generator.bat` on windows, or `generator/generator.sh` on linux, to choose between gcc, clang, or cl and to choose desired backends and whether imgui_internal is generated or not, comments are generated or not and if constructors are generated also with versions performing just initialization of structs provided by yourself (uses IM_PLACEMENT_NEW and _Construct is added to the constructor names)
|
||||||
* the defaults of generator are gcc as compiler, imgui_internal included and sdl, glfw, vulkan, opengl2 and opengl3 as backends.
|
* the defaults of generator are gcc as compiler, imgui_internal included and sdl, glfw, vulkan, opengl2 and opengl3 as backends.
|
||||||
* edit config_generator.lua for adding includes needed by your chosen backends (vulkan needs that).
|
* edit config_generator.lua for adding includes needed by your chosen backends (vulkan needs that).
|
||||||
* Run generator.bat or generator.sh with gcc, clang or cl and LuaJIT on your PATH.
|
* Run generator.bat or generator.sh with gcc, clang or cl and LuaJIT on your PATH.
|
||||||
@@ -70,7 +70,7 @@ Notes:
|
|||||||
* manual : will be true if this function is hand-written (not generated)
|
* manual : will be true if this function is hand-written (not generated)
|
||||||
* skipped : will be true if this function is not generated (and not hand-written)
|
* skipped : will be true if this function is not generated (and not hand-written)
|
||||||
* isvararg : is set if some argument is a vararg
|
* isvararg : is set if some argument is a vararg
|
||||||
* constructor : is set if the function is a constructor for a class.
|
* constructor : is set if the function is a constructor for a class. (another destructor function with _destroy postfix will be created)
|
||||||
* destructor : is set if the function is a destructor for a class but not just a default destructor.
|
* destructor : is set if the function is a destructor for a class but not just a default destructor.
|
||||||
* realdestructor : is set if the function is a destructor for a class
|
* realdestructor : is set if the function is a destructor for a class
|
||||||
* templated : is set if the function belongs to a templated class (ImVector)
|
* templated : is set if the function belongs to a templated class (ImVector)
|
||||||
|
|||||||
@@ -76,6 +76,25 @@ function M.prtable(...)
|
|||||||
print("\n")
|
print("\n")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
local function deepcopy(object)
|
||||||
|
local lookup_table = {}
|
||||||
|
local function _copy(object)
|
||||||
|
--assert(object~=REST)
|
||||||
|
if type(object) ~= "table" then
|
||||||
|
return object
|
||||||
|
elseif lookup_table[object] then
|
||||||
|
return lookup_table[object]
|
||||||
|
end
|
||||||
|
local new_table = {}
|
||||||
|
lookup_table[object] = new_table
|
||||||
|
for index, value in pairs(object) do
|
||||||
|
new_table[_copy(index)] = _copy(value)
|
||||||
|
end
|
||||||
|
return setmetatable(new_table, getmetatable(object))
|
||||||
|
end
|
||||||
|
return _copy(object)
|
||||||
|
end
|
||||||
|
M.deepcopy = deepcopy
|
||||||
local function str_split(str, pat)
|
local function str_split(str, pat)
|
||||||
local t = {}
|
local t = {}
|
||||||
local fpat = "(.-)" .. pat
|
local fpat = "(.-)" .. pat
|
||||||
@@ -529,7 +548,7 @@ local function name_overloadsAlgo(v)
|
|||||||
for i=1,#v do
|
for i=1,#v do
|
||||||
if not done[i] then
|
if not done[i] then
|
||||||
bb[i] = bb[i]..(aa[i][l]=="nil" and "" or aa[i][l])
|
bb[i] = bb[i]..(aa[i][l]=="nil" and "" or aa[i][l])
|
||||||
cc[i][l] = aa[i][l]
|
table.insert(cc[i], (aa[i][l]=="nil" and "" or aa[i][l]))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -544,7 +563,7 @@ local function name_overloadsAlgo(v)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
--avoid empty postfix which will be reserved to generic
|
--avoid empty postfix which will be reserved to generic
|
||||||
for i,v in ipairs(bb) do if v=="" then bb[i]="Nil" end end
|
for i,v in ipairs(bb) do if v=="" then bb[i]="Nil"; table.insert(cc[i],"Nil") end end
|
||||||
return aa,bb,cc
|
return aa,bb,cc
|
||||||
end
|
end
|
||||||
M.name_overloadsAlgo = name_overloadsAlgo
|
M.name_overloadsAlgo = name_overloadsAlgo
|
||||||
@@ -560,15 +579,26 @@ local function typetoStr(typ)
|
|||||||
typ = typ:gsub("const%s","")--"c")
|
typ = typ:gsub("const%s","")--"c")
|
||||||
typ = typ:gsub("%s+","_")
|
typ = typ:gsub("%s+","_")
|
||||||
typ = typ:gsub("charPtr","Str")
|
typ = typ:gsub("charPtr","Str")
|
||||||
typ = typ:gsub("int","Int")
|
typ = typ:gsub("^int","Int")
|
||||||
|
typ = typ:gsub("^nil","Nil")
|
||||||
typ = typ:gsub("bool","Bool")
|
typ = typ:gsub("bool","Bool")
|
||||||
typ = typ:gsub("float","Float")
|
typ = typ:gsub("float","Float")
|
||||||
typ = typ:gsub("uInt","Uint")
|
typ = typ:gsub("u[Ii]nt","Uint")
|
||||||
typ = typ:gsub("ImGui","")
|
typ = typ:gsub("ImGui","")
|
||||||
--typ = typ:gsub("ImStr","STR")
|
--typ = typ:gsub("ImStr","STR")
|
||||||
typ = typ:gsub("Im","")
|
typ = typ:gsub("Im","")
|
||||||
typ = typ:gsub("[<>]","")
|
typ = typ:gsub("[<>]","")
|
||||||
return "_"..typ
|
return typ
|
||||||
|
-- return "_"..typ
|
||||||
|
end
|
||||||
|
local function typetoStrpat(pat,post,typsc)
|
||||||
|
local str = ""
|
||||||
|
for i,v in ipairs(pat) do
|
||||||
|
str = str..typetoStr(v)
|
||||||
|
end
|
||||||
|
--local str2 = typetoStr(post)
|
||||||
|
--if str~=str2 then print(1,str,2,str2);M.prtable(typesc,post,pat);error"DEBUG" end
|
||||||
|
return str
|
||||||
end
|
end
|
||||||
--used to clean signature in function ptr argument
|
--used to clean signature in function ptr argument
|
||||||
local function clean_names_from_signature(self,signat)
|
local function clean_names_from_signature(self,signat)
|
||||||
@@ -2035,6 +2065,13 @@ function M.Parser()
|
|||||||
print("--skip enum forward declaration:",it2)
|
print("--skip enum forward declaration:",it2)
|
||||||
it2 = ""
|
it2 = ""
|
||||||
end
|
end
|
||||||
|
--only vardef assign with number
|
||||||
|
local assig = it2:match("static const [^=]*=([^;]*);")
|
||||||
|
--print("it2",it2,"assig",assig,tonumber(assig))
|
||||||
|
if assig and not tonumber(assig) then
|
||||||
|
print("--skip = vardef declaration:",it2)
|
||||||
|
it2 = ""
|
||||||
|
end
|
||||||
end
|
end
|
||||||
--table.insert(outtabpre,it2)
|
--table.insert(outtabpre,it2)
|
||||||
--table.insert(outtab,it2)
|
--table.insert(outtab,it2)
|
||||||
@@ -2445,7 +2482,7 @@ function M.Parser()
|
|||||||
--print(k,#v)
|
--print(k,#v)
|
||||||
table.insert(strt,string.format("%s\t%d",k,#v))
|
table.insert(strt,string.format("%s\t%d",k,#v))
|
||||||
local typesc,post,pat = name_overloadsAlgo(v)
|
local typesc,post,pat = name_overloadsAlgo(v)
|
||||||
-- if k=="igImLerp" then
|
-- if k=="ImPlot_PlotLine" then
|
||||||
-- print"----------------------"
|
-- print"----------------------"
|
||||||
-- M.prtable(v)
|
-- M.prtable(v)
|
||||||
-- M.prtable(typesc)
|
-- M.prtable(typesc)
|
||||||
@@ -2455,7 +2492,7 @@ function M.Parser()
|
|||||||
-- end
|
-- end
|
||||||
for i,t in ipairs(v) do
|
for i,t in ipairs(v) do
|
||||||
--take overloaded name from manual table or algorythm
|
--take overloaded name from manual table or algorythm
|
||||||
t.ov_cimguiname = self.getCname_overload(t.stname,t.funcname,t.signature,t.namespace) or k..typetoStr(post[i])
|
t.ov_cimguiname = self.getCname_overload(t.stname,t.funcname,t.signature,t.namespace) or k.."_"..typetoStrpat(pat[i],post[i],typesc)
|
||||||
--check ...
|
--check ...
|
||||||
if( t.ov_cimguiname:match"%.%.%.") then
|
if( t.ov_cimguiname:match"%.%.%.") then
|
||||||
print("... in ov",t.ov_cimguiname)
|
print("... in ov",t.ov_cimguiname)
|
||||||
@@ -3010,7 +3047,7 @@ local function func_implementation(FP)
|
|||||||
assert(def)
|
assert(def)
|
||||||
local custom
|
local custom
|
||||||
if FP.custom_implementation then
|
if FP.custom_implementation then
|
||||||
custom = FP.custom_implementation(outtab, def)
|
custom = FP.custom_implementation(outtab, def, FP)
|
||||||
end
|
end
|
||||||
local manual = FP.get_manuals(def)
|
local manual = FP.get_manuals(def)
|
||||||
if not custom and not manual and not def.templated and not FP.get_skipped(def) then
|
if not custom and not manual and not def.templated and not FP.get_skipped(def) then
|
||||||
|
|||||||
Reference in New Issue
Block a user