mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-10 11:58:30 +01:00
non const ref to pointer
This commit is contained in:
@@ -31,14 +31,7 @@ CIMGUI_API float igGET_FLT_MAX()
|
|||||||
{
|
{
|
||||||
return FLT_MAX;
|
return FLT_MAX;
|
||||||
}
|
}
|
||||||
CIMGUI_API void igColorConvertRGBtoHSV(float r,float g,float b,float *out_h,float *out_s,float *out_v)
|
|
||||||
{
|
|
||||||
ImGui::ColorConvertRGBtoHSV(r,g,b,*out_h,*out_s,*out_v);
|
|
||||||
}
|
|
||||||
CIMGUI_API void igColorConvertHSVtoRGB(float h,float s,float v,float *out_r,float *out_g,float *out_b)
|
|
||||||
{
|
|
||||||
ImGui::ColorConvertHSVtoRGB(h,s,v,*out_r,*out_g,*out_b);
|
|
||||||
}
|
|
||||||
|
|
||||||
CIMGUI_API ImVector_ImWchar* ImVector_ImWchar_create()
|
CIMGUI_API ImVector_ImWchar* ImVector_ImWchar_create()
|
||||||
{
|
{
|
||||||
|
@@ -55,9 +55,6 @@ CIMGUI_API void igLogText(CONST char *fmt, ...);
|
|||||||
CIMGUI_API void ImGuiTextBuffer_appendf(struct ImGuiTextBuffer *buffer, const char *fmt, ...);
|
CIMGUI_API void ImGuiTextBuffer_appendf(struct ImGuiTextBuffer *buffer, const char *fmt, ...);
|
||||||
//for getting FLT_MAX in bindings
|
//for getting FLT_MAX in bindings
|
||||||
CIMGUI_API float igGET_FLT_MAX();
|
CIMGUI_API float igGET_FLT_MAX();
|
||||||
//not const args from & to *
|
|
||||||
CIMGUI_API void igColorConvertRGBtoHSV(float r,float g,float b,float *out_h,float *out_s,float *out_v);
|
|
||||||
CIMGUI_API void igColorConvertHSVtoRGB(float h,float s,float v,float *out_r,float *out_g,float *out_b);
|
|
||||||
|
|
||||||
|
|
||||||
CIMGUI_API ImVector_ImWchar* ImVector_ImWchar_create();
|
CIMGUI_API ImVector_ImWchar* ImVector_ImWchar_create();
|
||||||
|
@@ -482,16 +482,18 @@ local function parseFunction(self,stname,lineorig,namespace,locat)
|
|||||||
local functype_arg_rest = "^(%s*[%w%s%*]+%(%*[%w_]+%)%([^%(%)]*%)),*(.*)"
|
local functype_arg_rest = "^(%s*[%w%s%*]+%(%*[%w_]+%)%([^%(%)]*%)),*(.*)"
|
||||||
local rest = argscsinpars:sub(2,-2) --strip ()
|
local rest = argscsinpars:sub(2,-2) --strip ()
|
||||||
|
|
||||||
|
|
||||||
while true do
|
while true do
|
||||||
--local tt = strsplit(rest,",")
|
--local tt = strsplit(rest,",")
|
||||||
--for ii,arg in ipairs(tt) do
|
--for ii,arg in ipairs(tt) do
|
||||||
--for arg in argscsinpars:gmatch("[%(,]*([^,%(%)]+)[%),]") do
|
--for arg in argscsinpars:gmatch("[%(,]*([^,%(%)]+)[%),]") do
|
||||||
|
local reftoptr
|
||||||
if rest == "void" then break end
|
if rest == "void" then break end
|
||||||
local type,name,retf,sigf
|
local type,name,retf,sigf
|
||||||
local arg,restt = rest:match(functype_arg_rest)
|
local arg,restt = rest:match(functype_arg_rest)
|
||||||
if arg then
|
if arg then -- if is function pointer
|
||||||
local t1,namef,t2 = arg:match(functype_reex)
|
local t1,namef,t2 = arg:match(functype_reex)
|
||||||
type=t1.."(*)"..t2;name=namef
|
type = t1.."(*)"..t2;name=namef
|
||||||
retf = t1
|
retf = t1
|
||||||
sigf = t2
|
sigf = t2
|
||||||
rest = restt
|
rest = restt
|
||||||
@@ -499,8 +501,13 @@ local function parseFunction(self,stname,lineorig,namespace,locat)
|
|||||||
arg,restt = rest:match(",*([^,%(%)]+),*(.*)")
|
arg,restt = rest:match(",*([^,%(%)]+),*(.*)")
|
||||||
if not arg then break end
|
if not arg then break end
|
||||||
rest = restt
|
rest = restt
|
||||||
if arg:match("&") and arg:match("const") then
|
if arg:match("&") then
|
||||||
arg = arg:gsub("&","")
|
if arg:match("const") then
|
||||||
|
arg = arg:gsub("&","")
|
||||||
|
else
|
||||||
|
arg = arg:gsub("&","*")
|
||||||
|
reftoptr = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
if arg:match("%.%.%.") then
|
if arg:match("%.%.%.") then
|
||||||
type="...";name="..."
|
type="...";name="..."
|
||||||
@@ -510,7 +517,6 @@ local function parseFunction(self,stname,lineorig,namespace,locat)
|
|||||||
|
|
||||||
if not type or not name then
|
if not type or not name then
|
||||||
print("failure arg detection",funcname,type,name,argscsinpars,arg)
|
print("failure arg detection",funcname,type,name,argscsinpars,arg)
|
||||||
|
|
||||||
else
|
else
|
||||||
if name:match"%*" then print("**",funcname) end
|
if name:match"%*" then print("**",funcname) end
|
||||||
--float name[2] to float[2] name
|
--float name[2] to float[2] name
|
||||||
@@ -521,7 +527,7 @@ local function parseFunction(self,stname,lineorig,namespace,locat)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.insert(argsArr,{type=type,name=name,ret=retf,signature=sigf})
|
table.insert(argsArr,{type=type,name=name,ret=retf,signature=sigf,reftoptr=reftoptr})
|
||||||
if arg:match("&") and not arg:match("const") then
|
if arg:match("&") and not arg:match("const") then
|
||||||
--only post error if not manual
|
--only post error if not manual
|
||||||
local cname = self.getCname(stname,funcname, namespace) --cimguiname
|
local cname = self.getCname(stname,funcname, namespace) --cimguiname
|
||||||
@@ -531,7 +537,7 @@ local function parseFunction(self,stname,lineorig,namespace,locat)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
argscsinpars = argscsinpars:gsub("&","")
|
argscsinpars = argscsinpars:gsub("&","")
|
||||||
|
|
||||||
local signature = argscsinpars:gsub("([%w%s%*_]+)%s[%w_]+%s*([,%)])","%1%2")
|
local signature = argscsinpars:gsub("([%w%s%*_]+)%s[%w_]+%s*([,%)])","%1%2")
|
||||||
signature = signature:gsub("%s*([,%)])","%1") --space before , and )
|
signature = signature:gsub("%s*([,%)])","%1") --space before , and )
|
||||||
signature = signature:gsub(",%s*",",")--space after ,
|
signature = signature:gsub(",%s*",",")--space after ,
|
||||||
@@ -542,6 +548,43 @@ local function parseFunction(self,stname,lineorig,namespace,locat)
|
|||||||
local call_args = argscsinpars:gsub("([%w_]+%s[%w_]+)%[%d*%]","%1") --float[2]
|
local call_args = argscsinpars:gsub("([%w_]+%s[%w_]+)%[%d*%]","%1") --float[2]
|
||||||
call_args = call_args:gsub("%(%*([%w_]+)%)%([^%(%)]*%)"," %1") --func type
|
call_args = call_args:gsub("%(%*([%w_]+)%)%([^%(%)]*%)"," %1") --func type
|
||||||
call_args = call_args:gsub("[^%(].-([%w_]+)%s*([,%)])","%1%2")
|
call_args = call_args:gsub("[^%(].-([%w_]+)%s*([,%)])","%1%2")
|
||||||
|
|
||||||
|
--recreate argscsinpars from argsArr
|
||||||
|
local asp, caar
|
||||||
|
if #argsArr > 0 then
|
||||||
|
asp = "("
|
||||||
|
caar = "("
|
||||||
|
for i,v in ipairs(argsArr) do
|
||||||
|
if v.ret then --function pointer
|
||||||
|
asp = asp .. v.ret .. "(*" .. v.name .. ")" .. v.signature .. ","
|
||||||
|
caar = caar .. v.name .. ","
|
||||||
|
else
|
||||||
|
local siz = v.type:match("(%[%d*%])") or ""
|
||||||
|
local type = v.type:gsub("(%[%d*%])","")
|
||||||
|
asp = asp .. type .. (v.name~="..." and " "..v.name or "") .. siz .. ","
|
||||||
|
local callname = v.reftoptr and "*"..v.name or v.name
|
||||||
|
caar = caar .. callname .. ","
|
||||||
|
end
|
||||||
|
end
|
||||||
|
asp = asp:sub(1,-2)..")"
|
||||||
|
caar = caar:sub(1,-2)..")"
|
||||||
|
else
|
||||||
|
asp = "()"
|
||||||
|
caar = "()"
|
||||||
|
end
|
||||||
|
--[[
|
||||||
|
if asp~=argscsinpars then
|
||||||
|
print("bad recontruction",funcname)
|
||||||
|
print(argscsinpars)
|
||||||
|
print(asp)
|
||||||
|
end
|
||||||
|
if caar~=call_args then
|
||||||
|
print("bad call_args",funcname)
|
||||||
|
print(call_args)
|
||||||
|
print(caar)
|
||||||
|
end
|
||||||
|
--]]
|
||||||
|
------------------------------
|
||||||
|
|
||||||
if not ret and stname then --must be constructors
|
if not ret and stname then --must be constructors
|
||||||
if not (stname == funcname or "~"..stname==funcname) then --break end
|
if not (stname == funcname or "~"..stname==funcname) then --break end
|
||||||
@@ -569,9 +612,9 @@ local function parseFunction(self,stname,lineorig,namespace,locat)
|
|||||||
defT.stname = stname
|
defT.stname = stname
|
||||||
defT.funcname = funcname
|
defT.funcname = funcname
|
||||||
defT.argsoriginal = args
|
defT.argsoriginal = args
|
||||||
defT.args=argscsinpars
|
defT.args= asp --argscsinpars
|
||||||
defT.signature = signature
|
defT.signature = signature
|
||||||
defT.call_args = call_args
|
defT.call_args = caar --call_args
|
||||||
defT.isvararg = signature:match("%.%.%.%)$")
|
defT.isvararg = signature:match("%.%.%.%)$")
|
||||||
defT.location = locat
|
defT.location = locat
|
||||||
--defT.comment = "" --comment
|
--defT.comment = "" --comment
|
||||||
|
@@ -50,8 +50,8 @@ for i=3,#script_args do table.insert(implementations,script_args[i]) end
|
|||||||
local cimgui_manuals = {
|
local cimgui_manuals = {
|
||||||
igLogText = true,
|
igLogText = true,
|
||||||
ImGuiTextBuffer_appendf = true,
|
ImGuiTextBuffer_appendf = true,
|
||||||
igColorConvertRGBtoHSV = true,
|
--igColorConvertRGBtoHSV = true,
|
||||||
igColorConvertHSVtoRGB = true
|
--igColorConvertHSVtoRGB = true
|
||||||
}
|
}
|
||||||
--------------------------------------------------------------------------
|
--------------------------------------------------------------------------
|
||||||
--this table is a dictionary to force a naming of function overloading (instead of algorythmic generated)
|
--this table is a dictionary to force a naming of function overloading (instead of algorythmic generated)
|
||||||
|
Reference in New Issue
Block a user