mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-22 00:18:30 +01:00
Compare commits
13 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3efb1001aa | ||
![]() |
a91c611bca | ||
![]() |
5b7abe8b4d | ||
![]() |
812af400f1 | ||
![]() |
2d3cf59b21 | ||
![]() |
e7eb9c511b | ||
![]() |
2759a8ed4d | ||
![]() |
073f438467 | ||
![]() |
f7856b27b0 | ||
![]() |
99c7d7cfdf | ||
![]() |
31871f9975 | ||
![]() |
c487b0266e | ||
![]() |
3b386799e4 |
@@ -20,6 +20,7 @@ endif(WIN32)
|
|||||||
#add library and link
|
#add library and link
|
||||||
add_library(cimgui SHARED ${IMGUI_SOURCES})
|
add_library(cimgui SHARED ${IMGUI_SOURCES})
|
||||||
target_link_libraries(cimgui ${IMGUI_LIBRARIES})
|
target_link_libraries(cimgui ${IMGUI_LIBRARIES})
|
||||||
|
set_target_properties(cimgui PROPERTIES PREFIX "")
|
||||||
|
|
||||||
#install
|
#install
|
||||||
install(TARGETS cimgui
|
install(TARGETS cimgui
|
||||||
|
17
README.md
17
README.md
@@ -20,17 +20,22 @@ Notes:
|
|||||||
* clone
|
* clone
|
||||||
* git clone --recursive https://github.com/cimgui/cimgui.git
|
* git clone --recursive https://github.com/cimgui/cimgui.git
|
||||||
* git submodule update
|
* git submodule update
|
||||||
* make using makefile on linux/macOS/mingw (Or use CMake to generate project)
|
* compile
|
||||||
|
* using makefile on linux/macOS/mingw (Or use CMake to generate project)
|
||||||
|
* or as in https://github.com/sonoro1234/LuaJIT-ImGui/tree/master_auto_implementations/build
|
||||||
|
|
||||||
# auto binding generation
|
# using generator
|
||||||
|
|
||||||
* 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
|
||||||
* need also gcc compiler for doing preprocessing (In windows MinGW-W64-builds for example)
|
* you can use also a C++ compiler for doing preprocessing: gcc (In windows MinGW-W64-builds for example), clang or cl (MSVC) or not use a compiler (experimental nocompiler option) at all. (this repo was done with gcc)
|
||||||
* update `imgui` folder to the version you desire.
|
* update `imgui` folder to the version you desire.
|
||||||
* run `generator/generator.bat` (or make a .sh version and please PR) with gcc and LuaJIT on your PATH.
|
* edit `generator/generator.bat` (or make a .sh version and please PR) to choose between gcc, clang, cl or nocompiler. Run it with gcc, clang or cl and LuaJIT on your PATH.
|
||||||
* as a result some files are generated: `cimgui.cpp` and `cimgui.h` for compiling and some lua/json files with information about the binding: `definitions.json` with function info, `structs_and_enums.json` with struct and enum info, `impl_definitions.json` with functions from the implementations info.
|
* as a result some files are generated: `cimgui.cpp` and `cimgui.h` for compiling and some lua/json files with information about the binding: `definitions.json` with function info, `structs_and_enums.json` with struct and enum info, `impl_definitions.json` with functions from the implementations info.
|
||||||
* build as shown in https://github.com/sonoro1234/LuaJIT-ImGui/tree/master_auto_implementations/build
|
|
||||||
* generate binding as done in https://github.com/sonoro1234/LuaJIT-ImGui/blob/master_auto_implementations/lua/build.bat
|
# generate binding
|
||||||
|
* with your prefered languaje from lua or json files as in:
|
||||||
|
* https://github.com/sonoro1234/LuaJIT-ImGui/blob/master_auto_implementations/lua/build.bat (with lua code generation in https://github.com/sonoro1234/LuaJIT-ImGui/blob/master_auto_implementations/lua/class_gen.lua)
|
||||||
|
* https://github.com/mellinoe/ImGui.NET/tree/autogen/src/CodeGenerator
|
||||||
|
|
||||||
# usage
|
# usage
|
||||||
|
|
||||||
|
3
cimgui.h
3
cimgui.h
@@ -40,7 +40,7 @@ typedef struct ImColor_Simple { ImVec4_Simple Value;} ImColor_Simple;
|
|||||||
|
|
||||||
|
|
||||||
#ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
|
#ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
|
||||||
|
struct ImDrawChannel;
|
||||||
typedef struct CustomRect CustomRect;
|
typedef struct CustomRect CustomRect;
|
||||||
typedef struct GlyphRangesBuilder GlyphRangesBuilder;
|
typedef struct GlyphRangesBuilder GlyphRangesBuilder;
|
||||||
typedef struct ImFontGlyph ImFontGlyph;
|
typedef struct ImFontGlyph ImFontGlyph;
|
||||||
@@ -69,7 +69,6 @@ typedef struct ImDrawList ImDrawList;
|
|||||||
typedef struct ImDrawData ImDrawData;
|
typedef struct ImDrawData ImDrawData;
|
||||||
typedef struct ImDrawCmd ImDrawCmd;
|
typedef struct ImDrawCmd ImDrawCmd;
|
||||||
typedef struct ImDrawChannel ImDrawChannel;
|
typedef struct ImDrawChannel ImDrawChannel;
|
||||||
struct ImDrawChannel;
|
|
||||||
struct ImDrawCmd;
|
struct ImDrawCmd;
|
||||||
struct ImDrawData;
|
struct ImDrawData;
|
||||||
struct ImDrawList;
|
struct ImDrawList;
|
||||||
|
@@ -14,8 +14,9 @@
|
|||||||
:: set PATH=%PATH%;C:\luaGL;C:\i686-7.2.0-release-posix-dwarf-rt_v5-rev1\mingw32\bin;
|
:: set PATH=%PATH%;C:\luaGL;C:\i686-7.2.0-release-posix-dwarf-rt_v5-rev1\mingw32\bin;
|
||||||
:: set PATH=%PATH%;C:\luaGL\sources\luajit-master\luajit-master\bin\mingw32;C:\mingw32\bin;
|
:: set PATH=%PATH%;C:\luaGL\sources\luajit-master\luajit-master\bin\mingw32;C:\mingw32\bin;
|
||||||
::process files
|
::process files
|
||||||
:: arg[1..n] name of implementations to generate
|
:: arg[1] compiler name gcc, clang, cl or nocompiler
|
||||||
luajit ./generator.lua glfw opengl3 opengl2 sdl
|
:: arg[2..n] name of implementations to generate
|
||||||
|
luajit ./generator.lua gcc glfw opengl3 opengl2 sdl
|
||||||
|
|
||||||
::leave console open
|
::leave console open
|
||||||
cmd /k
|
cmd /k
|
||||||
|
@@ -5,27 +5,41 @@
|
|||||||
assert(_VERSION=='Lua 5.1',"Must use LuaJIT")
|
assert(_VERSION=='Lua 5.1',"Must use LuaJIT")
|
||||||
assert(bit,"Must use LuaJIT")
|
assert(bit,"Must use LuaJIT")
|
||||||
local script_args = {...}
|
local script_args = {...}
|
||||||
|
local COMPILER = script_args[1]
|
||||||
--test gcc present
|
local CPRE,CTEST
|
||||||
local HAVE_GCC
|
if COMPILER == "gcc" or COMPILER == "clang" then
|
||||||
local pipe,err = io.popen("gcc --version","r")
|
CPRE = COMPILER..[[ -E -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ]]
|
||||||
if pipe then
|
CTEST = COMPILER.." --version"
|
||||||
local str = pipe:read"*a"
|
elseif COMPILER == "cl" then
|
||||||
print(str)
|
CPRE = COMPILER..[[ /E /DIMGUI_DISABLE_OBSOLETE_FUNCTIONS /DIMGUI_API="" /DIMGUI_IMPL_API="" ]]
|
||||||
pipe:close()
|
CTEST = COMPILER
|
||||||
if str=="" then
|
|
||||||
HAVE_GCC = false
|
|
||||||
else
|
|
||||||
HAVE_GCC = true
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
HAVE_GCC = false
|
print("Working without compiler ")
|
||||||
print(err)
|
|
||||||
end
|
end
|
||||||
print("HAVE_GCC",HAVE_GCC)
|
--test compiler present
|
||||||
|
local HAVE_COMPILER = false
|
||||||
|
if CTEST then
|
||||||
|
local pipe,err = io.popen(CTEST,"r")
|
||||||
|
if pipe then
|
||||||
|
local str = pipe:read"*a"
|
||||||
|
print(str)
|
||||||
|
pipe:close()
|
||||||
|
if str=="" then
|
||||||
|
HAVE_COMPILER = false
|
||||||
|
else
|
||||||
|
HAVE_COMPILER = true
|
||||||
|
end
|
||||||
|
else
|
||||||
|
HAVE_COMPILER = false
|
||||||
|
print(err)
|
||||||
|
end
|
||||||
|
assert(HAVE_COMPILER,"gcc, clang or cl needed to run script")
|
||||||
|
end --CTEST
|
||||||
|
|
||||||
|
print("HAVE_COMPILER",HAVE_COMPILER)
|
||||||
--get implementations
|
--get implementations
|
||||||
local implementations = {}
|
local implementations = {}
|
||||||
for i=1,#script_args do table.insert(implementations,script_args[i]) end
|
for i=2,#script_args do table.insert(implementations,script_args[i]) end
|
||||||
|
|
||||||
--------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
||||||
--this table has the functions to be skipped in generation
|
--this table has the functions to be skipped in generation
|
||||||
@@ -82,34 +96,48 @@ local gdefines = {} --for FLT_MAX and others
|
|||||||
--------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
||||||
--helper functions
|
--helper functions
|
||||||
--------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
||||||
--iterates lines from a .h file and discards between #if.. and #endif
|
--minimal preprocessor
|
||||||
local function filelines(file)
|
local function filelines(file,locats)
|
||||||
local iflevels = {}
|
local iflevels = {}
|
||||||
|
--only one case is true
|
||||||
|
local function prepro_boolif(line)
|
||||||
|
local ma = line:match("#ifndef%s+IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT") or line:match("#ifndef%s+ImTextureID")
|
||||||
|
return not (ma==nil)
|
||||||
|
end
|
||||||
local function location_it()
|
local function location_it()
|
||||||
repeat
|
repeat
|
||||||
local line = file:read"*l"
|
local line = file:read"*l"
|
||||||
if not line then return nil end
|
if not line then return nil end
|
||||||
if line:sub(1,1) == "#" then
|
if line:sub(1,1) == "#" then
|
||||||
if line:match("#if") then
|
if line:match("#if") then
|
||||||
iflevels[#iflevels +1 ] = true
|
iflevels[#iflevels +1 ] = prepro_boolif(line)
|
||||||
elseif line:match("#endif") then
|
elseif line:match("#endif") then
|
||||||
iflevels[#iflevels] = nil
|
iflevels[#iflevels] = nil
|
||||||
|
elseif line:match("#elseif") then
|
||||||
|
iflevels[#iflevels] = false -- all false now
|
||||||
|
elseif line:match("#else") then
|
||||||
|
iflevels[#iflevels] = not iflevels[#iflevels]
|
||||||
end
|
end
|
||||||
-- skip
|
-- skip
|
||||||
elseif #iflevels == 0 then
|
elseif #iflevels == 0 or iflevels[#iflevels] then
|
||||||
-- drop IMGUI_APIX
|
-- drop IMGUI_APIX
|
||||||
line = line:gsub("IMGUI_IMPL_API","")
|
line = line:gsub("IMGUI_IMPL_API","")
|
||||||
-- drop IMGUI_API
|
-- drop IMGUI_API
|
||||||
line = line:gsub("IMGUI_API","")
|
line = line:gsub("IMGUI_API","")
|
||||||
return line
|
return line,locats[1]
|
||||||
end
|
end
|
||||||
until false
|
until false
|
||||||
end
|
end
|
||||||
return location_it
|
return location_it
|
||||||
end
|
end
|
||||||
--iterates lines from a gcc -E in a specific location
|
--iterates lines from a gcc/clang -E in a specific location
|
||||||
local function location(file,locpathT)
|
local function location(file,locpathT)
|
||||||
local location_re = '^# (%d+) "([^"]*)"'
|
local location_re
|
||||||
|
if COMPILER == "cl" then
|
||||||
|
location_re = '^#line (%d+) "([^"]*)"'
|
||||||
|
else --gcc, clang
|
||||||
|
location_re = '^# (%d+) "([^"]*)"'
|
||||||
|
end
|
||||||
local path_reT = {}
|
local path_reT = {}
|
||||||
for i,locpath in ipairs(locpathT) do
|
for i,locpath in ipairs(locpathT) do
|
||||||
table.insert(path_reT,'^(.*[\\/])('..locpath..')%.h$')
|
table.insert(path_reT,'^(.*[\\/])('..locpath..')%.h$')
|
||||||
@@ -132,7 +160,9 @@ local function location(file,locpathT)
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if line:sub(1,1) == "#" then
|
if #line==0 then --nothing on emptyline
|
||||||
|
elseif not line:match("%S") then --nothing if only spaces
|
||||||
|
elseif line:sub(1,1) == "#" then
|
||||||
-- Is this a location pragma?
|
-- Is this a location pragma?
|
||||||
local loc_num_t,location_match = line:match(location_re)
|
local loc_num_t,location_match = line:match(location_re)
|
||||||
if location_match then
|
if location_match then
|
||||||
@@ -161,7 +191,7 @@ local function location(file,locpathT)
|
|||||||
--return line,loc_num_real, which_location
|
--return line,loc_num_real, which_location
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
until false
|
until false --forever
|
||||||
end
|
end
|
||||||
return location_it
|
return location_it
|
||||||
end
|
end
|
||||||
@@ -266,7 +296,9 @@ local function clean_spaces(cad)
|
|||||||
end
|
end
|
||||||
local function split_comment(line)
|
local function split_comment(line)
|
||||||
local comment = line:match("(%s*//.*)") or ""
|
local comment = line:match("(%s*//.*)") or ""
|
||||||
return line:gsub("%s*//.*",""),comment
|
line = line:gsub("%s*//.*","")
|
||||||
|
line = line:gsub("%s*$","")
|
||||||
|
return line,comment
|
||||||
end
|
end
|
||||||
local function get_manuals(def)
|
local function get_manuals(def)
|
||||||
return cimgui_manuals[def.ov_cimguiname] or cimgui_manuals[def.cimguiname]
|
return cimgui_manuals[def.ov_cimguiname] or cimgui_manuals[def.cimguiname]
|
||||||
@@ -288,7 +320,7 @@ end
|
|||||||
local function struct_parser()
|
local function struct_parser()
|
||||||
local function_re = "(%a*%w+%s*%b())" --"(%a*%w+%b())" --"(%a*%w+%s+%w+%b())"
|
local function_re = "(%a*%w+%s*%b())" --"(%a*%w+%b())" --"(%a*%w+%s+%w+%b())"
|
||||||
local function_closing_re = "}"
|
local function_closing_re = "}"
|
||||||
local function_closed_re = "[;}]$"
|
local function_closed_re = "[;}]%s*$"
|
||||||
local operator_re = "operator.-%b()"
|
local operator_re = "operator.-%b()"
|
||||||
local functype_re = "(%(%*)[%w_]+(%)%([^%(%)]*%))"
|
local functype_re = "(%(%*)[%w_]+(%)%([^%(%)]*%))"
|
||||||
local initial_comment_re = [[^%s*//.*]]
|
local initial_comment_re = [[^%s*//.*]]
|
||||||
@@ -307,6 +339,7 @@ local function struct_parser()
|
|||||||
|
|
||||||
--if in_function discard
|
--if in_function discard
|
||||||
if in_functionst then
|
if in_functionst then
|
||||||
|
--table.insert(structcdefs,"en function:"..line) --debug
|
||||||
if line:match(function_closing_re) then
|
if line:match(function_closing_re) then
|
||||||
in_functionst = false
|
in_functionst = false
|
||||||
--print("in function:",line)
|
--print("in function:",line)
|
||||||
@@ -314,16 +347,13 @@ local function struct_parser()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (line:match(function_re) or line:match(operator_re)) and not line:match("typedef.*%b().*%b().*")
|
if (line:match(function_re) or line:match(operator_re)) and not line:match("typedef.*%b().*%b().*")
|
||||||
and not line:match(functype_re) then
|
and not line:match(functype_re) then
|
||||||
|
--table.insert(structcdefs,"function test2:"..line) --debug
|
||||||
if not line:match(function_closed_re) then
|
if not line:match(function_closed_re) then
|
||||||
--print("match:",line)
|
--print("match:",line)
|
||||||
in_functionst = true
|
in_functionst = true
|
||||||
end
|
end
|
||||||
--else
|
|
||||||
--table.insert(structcdefs,linecommented)
|
|
||||||
elseif line:match("template") then
|
elseif line:match("template") then
|
||||||
--nothing
|
--nothing
|
||||||
elseif line:match("public:") then
|
elseif line:match("public:") then
|
||||||
@@ -332,7 +362,6 @@ local function struct_parser()
|
|||||||
local linea = line:gsub("%S+",{class="struct",mutable=""})
|
local linea = line:gsub("%S+",{class="struct",mutable=""})
|
||||||
linea = linea:gsub("(%b<>)","/*%1*/") --comment template parameters
|
linea = linea:gsub("(%b<>)","/*%1*/") --comment template parameters
|
||||||
table.insert(structcdefs,linea..comment)
|
table.insert(structcdefs,linea..comment)
|
||||||
|
|
||||||
end
|
end
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -563,7 +592,11 @@ local function func_parser()
|
|||||||
end
|
end
|
||||||
table.insert(argsArr,{type=type,name=name,ret=retf,signature=sigf})
|
table.insert(argsArr,{type=type,name=name,ret=retf,signature=sigf})
|
||||||
if arg:match("&") and not arg:match("const") then
|
if arg:match("&") and not arg:match("const") then
|
||||||
print("reference to no const arg in",funcname,argscsinpars)
|
--only post error if not manual
|
||||||
|
local cname = getcimguiname(stname,funcname)
|
||||||
|
if not cimgui_manuals[cname] then
|
||||||
|
print("reference to no const arg in",funcname,argscsinpars)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
argscsinpars = argscsinpars:gsub("&","")
|
argscsinpars = argscsinpars:gsub("&","")
|
||||||
@@ -792,6 +825,11 @@ local function gen_structs_and_enums_table(cdefs)
|
|||||||
|
|
||||||
if (#enumnames > 0) then
|
if (#enumnames > 0) then
|
||||||
assert(#structnames==0,"enum in struct")
|
assert(#structnames==0,"enum in struct")
|
||||||
|
-- if #structnames~=0 then
|
||||||
|
-- print(line,#line)
|
||||||
|
-- print(linecom,#linecom)
|
||||||
|
-- error"enuminstruct"
|
||||||
|
-- end
|
||||||
if line:match(struct_closing_re) and not line:match(struct_op_close_re) then
|
if line:match(struct_closing_re) and not line:match(struct_op_close_re) then
|
||||||
enumnames[#enumnames] = nil
|
enumnames[#enumnames] = nil
|
||||||
break
|
break
|
||||||
@@ -925,13 +963,15 @@ local function gen_structs_and_enums(cdefs)
|
|||||||
-- ImVector special treatment
|
-- ImVector special treatment
|
||||||
if structnames[#structnames] == "ImVector" then
|
if structnames[#structnames] == "ImVector" then
|
||||||
if line:match(struct_closing_re) then
|
if line:match(struct_closing_re) then
|
||||||
table.insert(outtab,[[struct ImVector
|
table.insert(outtab,[[
|
||||||
|
struct ImVector
|
||||||
{
|
{
|
||||||
int Size;
|
int Size;
|
||||||
int Capacity;
|
int Capacity;
|
||||||
void* Data;
|
void* Data;
|
||||||
};
|
};
|
||||||
typedef struct ImVector ImVector;]])
|
typedef struct ImVector ImVector;
|
||||||
|
]])
|
||||||
structnames[#structnames] = nil
|
structnames[#structnames] = nil
|
||||||
end
|
end
|
||||||
break -- dont write
|
break -- dont write
|
||||||
@@ -1205,7 +1245,8 @@ local function check_arg_detection(fdefs,typedefs)
|
|||||||
print"-----------------end check arg detection-----------------------"
|
print"-----------------end check arg detection-----------------------"
|
||||||
end
|
end
|
||||||
local function get_defines(t)
|
local function get_defines(t)
|
||||||
local pipe,err = io.popen([[gcc -E -dM -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ../imgui/imgui.h]],"r")
|
if COMPILER == "cl" then print"can't get defines with cl compiler"; return {} end
|
||||||
|
local pipe,err = io.popen(COMPILER..[[ -E -dM -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ../imgui/imgui.h]],"r")
|
||||||
local defines = {}
|
local defines = {}
|
||||||
while true do
|
while true do
|
||||||
local line = pipe:read"*l"
|
local line = pipe:read"*l"
|
||||||
@@ -1294,35 +1335,20 @@ pipe:close()
|
|||||||
cimgui_header = cimgui_header:gsub("XXX",imgui_version)
|
cimgui_header = cimgui_header:gsub("XXX",imgui_version)
|
||||||
print("IMGUI_VERSION",imgui_version)
|
print("IMGUI_VERSION",imgui_version)
|
||||||
--get some defines----------------------------
|
--get some defines----------------------------
|
||||||
if HAVE_GCC then
|
if HAVE_COMPILER then
|
||||||
gdefines = get_defines{"IMGUI_VERSION","FLT_MAX"}
|
gdefines = get_defines{"IMGUI_VERSION","FLT_MAX"}
|
||||||
end
|
end
|
||||||
--first without gcc
|
|
||||||
---[[
|
|
||||||
print"------------------generation without precompiler------------------------"
|
|
||||||
local pipe,err = io.open("../imgui/imgui.h","r")
|
|
||||||
if not pipe then
|
|
||||||
error("could not open file:"..err)
|
|
||||||
end
|
|
||||||
|
|
||||||
local STP = struct_parser()
|
--generation
|
||||||
local FP = func_parser()
|
print("------------------generation with "..COMPILER.."------------------------")
|
||||||
|
|
||||||
for line in filelines(pipe) do
|
|
||||||
local line, comment = split_comment(line)
|
|
||||||
STP.insert(line,comment)
|
|
||||||
FP.insert(line,comment)
|
|
||||||
end
|
|
||||||
pipe:close()
|
|
||||||
FP:compute_overloads()
|
|
||||||
cimgui_generation("_nopreprocess",STP,FP)
|
|
||||||
--]]
|
|
||||||
--then gcc
|
|
||||||
print"------------------generation with precompiler------------------------"
|
|
||||||
local pFP,pSTP,typedefs_dict2
|
local pFP,pSTP,typedefs_dict2
|
||||||
|
|
||||||
if HAVE_GCC then
|
local pipe,err
|
||||||
local pipe,err = io.popen([[gcc -E -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ../imgui/imgui.h]],"r")
|
if HAVE_COMPILER then
|
||||||
|
pipe,err = io.popen(CPRE..[[../imgui/imgui.h]],"r")
|
||||||
|
else
|
||||||
|
pipe,err = io.open([[../imgui/imgui.h]],"r")
|
||||||
|
end
|
||||||
|
|
||||||
if not pipe then
|
if not pipe then
|
||||||
error("could not execute gcc "..err)
|
error("could not execute gcc "..err)
|
||||||
@@ -1331,19 +1357,23 @@ end
|
|||||||
pSTP = struct_parser() --overwrite
|
pSTP = struct_parser() --overwrite
|
||||||
pFP = func_parser() --overwrite
|
pFP = func_parser() --overwrite
|
||||||
|
|
||||||
for line in location(pipe,{"imgui"}) do
|
local iterator = (HAVE_COMPILER and location) or filelines
|
||||||
|
|
||||||
|
for line in iterator(pipe,{"imgui"}) do
|
||||||
local line, comment = split_comment(line)
|
local line, comment = split_comment(line)
|
||||||
|
--line = clean_spaces(line)
|
||||||
pSTP.insert(line,comment)
|
pSTP.insert(line,comment)
|
||||||
pFP.insert(line,comment)
|
pFP.insert(line,comment)
|
||||||
end
|
end
|
||||||
pipe:close()
|
pipe:close()
|
||||||
|
|
||||||
local ovstr = pFP:compute_overloads()
|
local ovstr = pFP:compute_overloads()
|
||||||
ADDnonUDT(pFP)
|
ADDnonUDT(pFP)
|
||||||
save_data("./output/overloads.txt",ovstr)
|
save_data("./output/overloads.txt",ovstr)
|
||||||
typedefs_dict2 = cimgui_generation("",pSTP,pFP)
|
typedefs_dict2 = cimgui_generation("",pSTP,pFP)
|
||||||
--check arg detection failure if no name in function declaration
|
--check arg detection failure if no name in function declaration
|
||||||
check_arg_detection(pFP.defsT,typedefs_dict2)
|
check_arg_detection(pFP.defsT,typedefs_dict2)
|
||||||
end
|
|
||||||
|
|
||||||
----------save fundefs in definitions.lua for using in bindings
|
----------save fundefs in definitions.lua for using in bindings
|
||||||
set_defines(pFP.defsT)
|
set_defines(pFP.defsT)
|
||||||
@@ -1367,8 +1397,8 @@ if #implementations > 0 then
|
|||||||
local source = [[../imgui/examples/imgui_impl_]].. impl .. ".h "
|
local source = [[../imgui/examples/imgui_impl_]].. impl .. ".h "
|
||||||
local locati = [[imgui_impl_]].. impl
|
local locati = [[imgui_impl_]].. impl
|
||||||
local pipe,err
|
local pipe,err
|
||||||
if HAVE_GCC then
|
if HAVE_COMPILER then
|
||||||
pipe,err = io.popen([[gcc -E -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ]] ..source,"r")
|
pipe,err = io.popen(CPRE..source,"r")
|
||||||
else
|
else
|
||||||
pipe,err = io.open(source,"r")
|
pipe,err = io.open(source,"r")
|
||||||
end
|
end
|
||||||
@@ -1376,7 +1406,7 @@ if #implementations > 0 then
|
|||||||
error("could not get file: "..err)
|
error("could not get file: "..err)
|
||||||
end
|
end
|
||||||
|
|
||||||
local iterator = (HAVE_GCC and location) or filelines
|
local iterator = (HAVE_COMPILER and location) or filelines
|
||||||
|
|
||||||
for line,locat in iterator(pipe,{locati}) do
|
for line,locat in iterator(pipe,{locati}) do
|
||||||
local line, comment = split_comment(line)
|
local line, comment = split_comment(line)
|
||||||
|
@@ -40,7 +40,7 @@ typedef struct ImColor_Simple { ImVec4_Simple Value;} ImColor_Simple;
|
|||||||
|
|
||||||
|
|
||||||
#ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
|
#ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
|
||||||
|
struct ImDrawChannel;
|
||||||
typedef struct CustomRect CustomRect;
|
typedef struct CustomRect CustomRect;
|
||||||
typedef struct GlyphRangesBuilder GlyphRangesBuilder;
|
typedef struct GlyphRangesBuilder GlyphRangesBuilder;
|
||||||
typedef struct ImFontGlyph ImFontGlyph;
|
typedef struct ImFontGlyph ImFontGlyph;
|
||||||
@@ -69,7 +69,6 @@ typedef struct ImDrawList ImDrawList;
|
|||||||
typedef struct ImDrawData ImDrawData;
|
typedef struct ImDrawData ImDrawData;
|
||||||
typedef struct ImDrawCmd ImDrawCmd;
|
typedef struct ImDrawCmd ImDrawCmd;
|
||||||
typedef struct ImDrawChannel ImDrawChannel;
|
typedef struct ImDrawChannel ImDrawChannel;
|
||||||
struct ImDrawChannel;
|
|
||||||
struct ImDrawCmd;
|
struct ImDrawCmd;
|
||||||
struct ImDrawData;
|
struct ImDrawData;
|
||||||
struct ImDrawList;
|
struct ImDrawList;
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user