mirror of
https://github.com/cimgui/cimgui.git
synced 2026-08-01 00:58:54 +00:00
Compare commits
3 Commits
1.92.9dock
...
docking_in
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
944385687d | ||
|
|
b705b2465a | ||
|
|
1531eea44a |
39
cimgui.h
39
cimgui.h
@@ -3926,6 +3926,45 @@ struct ImFontAtlasBuilder
|
||||
ImFontAtlasRectId PackIdMouseCursors;
|
||||
ImFontAtlasRectId PackIdLinesTexData;
|
||||
};
|
||||
typedef struct StbUndoRecord StbUndoRecord;
|
||||
struct StbUndoRecord
|
||||
{
|
||||
int where;
|
||||
int insert_length;
|
||||
int delete_length;
|
||||
int char_storage;
|
||||
};
|
||||
typedef struct StbUndoState StbUndoState;
|
||||
struct StbUndoState
|
||||
{
|
||||
StbUndoRecord undo_rec [99];
|
||||
char undo_char[999];
|
||||
short undo_point, redo_point;
|
||||
int undo_char_point, redo_char_point;
|
||||
};
|
||||
struct STB_TexteditState
|
||||
{
|
||||
int cursor;
|
||||
int select_start;
|
||||
int select_end;
|
||||
unsigned char insert_mode;
|
||||
int row_count_per_page;
|
||||
unsigned char cursor_at_end_of_line;
|
||||
unsigned char initialized;
|
||||
unsigned char has_preferred_x;
|
||||
unsigned char single_line;
|
||||
unsigned char padding1, padding2, padding3;
|
||||
float preferred_x;
|
||||
StbUndoState undostate;
|
||||
};
|
||||
typedef struct StbTexteditRow StbTexteditRow;
|
||||
struct StbTexteditRow
|
||||
{
|
||||
float x0,x1;
|
||||
float baseline_y_delta;
|
||||
float ymin,ymax;
|
||||
int num_chars;
|
||||
};
|
||||
#ifdef IMGUI_ENABLE_FREETYPE
|
||||
struct ImFontAtlas;
|
||||
struct ImFontLoader;
|
||||
|
||||
@@ -1531,11 +1531,13 @@ local function ADDnonUDT(FP)
|
||||
end
|
||||
--args
|
||||
local caar,asp
|
||||
local argsTN = {}
|
||||
if #def.argsT > 0 then
|
||||
caar = "("
|
||||
asp = "("
|
||||
for i,v in ipairs(def.argsT) do
|
||||
local name = v.name
|
||||
argsTN[i] = deepcopy(v)
|
||||
if v.ret then --function pointer
|
||||
local f_ = v.has_cdecl and "(__cdecl*" or "(*"
|
||||
asp = asp .. v.ret .. f_ .. v.name .. ")" .. v.signature .. ","
|
||||
@@ -1545,23 +1547,29 @@ local function ADDnonUDT(FP)
|
||||
local typ2 = typ:gsub("*","")
|
||||
--nonPOD arg -> convert
|
||||
if FP.nP_args[v.type] then
|
||||
local typ3 = v.type:gsub(typ,typ.."_c")
|
||||
caar = caar .. "ConvertToCPP_"..typ.."("..name.."),"
|
||||
asp = asp .. v.type:gsub(typ,typ.."_c").." "..v.name..","
|
||||
asp = asp .. typ3 .." "..v.name..","
|
||||
--argsTN[i].type = typ3
|
||||
--nonPOD* arg -> reinterpret_cast
|
||||
elseif FP.nP_args[typ2] then
|
||||
local typ3 = v.type:gsub(typ2,typ2.."_c")
|
||||
caar = caar .. "reinterpret_cast<"..v.type..">("..name.."),"
|
||||
asp = asp .. typ3 .." "..v.name..","
|
||||
--argsTN[i].type = typ3
|
||||
elseif v.type:match("std::string_view") then
|
||||
argsTN[i].type = "const char*"
|
||||
caar = caar ..name..","
|
||||
asp = asp .. "const char* "..v.name..","
|
||||
elseif v.type:match("std::string") then
|
||||
argsTN[i].type = "const char*"
|
||||
caar = caar .. "std::string("..name.."),"
|
||||
asp = asp .. "const char* "..v.name..","
|
||||
elseif v.type:match"std::function" then
|
||||
local ca2,asp2,skip2 = get_std_function(v,def)
|
||||
caar = caar .. ca2..","
|
||||
asp = asp .. asp2..","
|
||||
argsTN[i].type = asp2
|
||||
if skip2 then skip = true end
|
||||
--skip = true
|
||||
elseif v.type:match("std::") then
|
||||
@@ -1575,11 +1583,13 @@ local function ADDnonUDT(FP)
|
||||
local callname = "*"..name
|
||||
caar = caar .. callname .. ","
|
||||
asp = asp .. newt.." "..name .. ","
|
||||
argsTN[i].type = newt
|
||||
else
|
||||
local newt = v.type --v.type:gsub(typ2.."%s*%*",typ2.."_opq")
|
||||
local callname = v.reftoptr and "*"..name or name
|
||||
caar = caar .. callname .. ","
|
||||
asp = asp .. newt.." "..name .. ","
|
||||
argsTN[i].type = newt
|
||||
end
|
||||
else
|
||||
local siz = v.type:match("(%[%d*%])") or ""
|
||||
@@ -1587,6 +1597,7 @@ local function ADDnonUDT(FP)
|
||||
asp = asp .. typ .. (v.name~="..." and " "..v.name or "") .. siz .. ","
|
||||
local callname = v.reftoptr and "*"..name or name
|
||||
caar = caar .. callname .. ","
|
||||
argsTN[i].type = typ .. siz
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1604,6 +1615,7 @@ local function ADDnonUDT(FP)
|
||||
def.call_args_old = def.call_args
|
||||
def.call_args = caar
|
||||
def.args = asp
|
||||
def.argsT = argsTN
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -407,19 +407,20 @@ end
|
||||
--generation
|
||||
print("------------------generation with "..COMPILER.."------------------------")
|
||||
local parser1
|
||||
local headers = [[#include "]]..IMGUI_PATH..[[/imgui.h"
|
||||
local headers = [[#include "]]..IMGUI_PATH..[[/imgui.h"
|
||||
]]
|
||||
local headersT = {[[imgui]]}
|
||||
if INTERNAL_GENERATION then
|
||||
headers = headers .. [[#include "]]..IMGUI_PATH..[[/imgui_internal.h"
|
||||
]]
|
||||
]]
|
||||
headers = headers .. [[#include "]]..IMGUI_PATH..[[/imstb_textedit.h"
|
||||
]]
|
||||
headersT[#headersT + 1] = [[imgui_internal]]
|
||||
headersT[#headersT + 1] = [[imstb_textedit]]
|
||||
end
|
||||
if FREETYPE_GENERATION then
|
||||
headers = headers .. [[
|
||||
#include "]]..IMGUI_PATH..[[/misc/freetype/imgui_freetype.h"
|
||||
]]
|
||||
headers = headers .. [[#include "]]..IMGUI_PATH..[[/misc/freetype/imgui_freetype.h"
|
||||
]]
|
||||
headersT[#headersT + 1] = [[imgui_freetype]]
|
||||
end
|
||||
save_data("headers.h",headers)
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
"IMGUI_WINDOW_HARD_MIN_SIZE": "4.0f",
|
||||
"IMSTB_TEXTEDIT_CHARTYPE": "char",
|
||||
"IMSTB_TEXTEDIT_GETWIDTH_NEWLINE": "(-1.0f)",
|
||||
"IMSTB_TEXTEDIT_POSITIONTYPE": "int",
|
||||
"IMSTB_TEXTEDIT_STRING": "ImGuiInputTextState",
|
||||
"IMSTB_TEXTEDIT_UNDOCHARCOUNT": "999",
|
||||
"IMSTB_TEXTEDIT_UNDOSTATECOUNT": "99",
|
||||
|
||||
@@ -30,6 +30,7 @@ local t={
|
||||
IMGUI_WINDOW_HARD_MIN_SIZE="4.0f",
|
||||
IMSTB_TEXTEDIT_CHARTYPE="char",
|
||||
IMSTB_TEXTEDIT_GETWIDTH_NEWLINE="(-1.0f)",
|
||||
IMSTB_TEXTEDIT_POSITIONTYPE="int",
|
||||
IMSTB_TEXTEDIT_STRING="ImGuiInputTextState",
|
||||
IMSTB_TEXTEDIT_UNDOCHARCOUNT="999",
|
||||
IMSTB_TEXTEDIT_UNDOSTATECOUNT="99",
|
||||
|
||||
@@ -5736,6 +5736,10 @@
|
||||
"ImVec2ih": "imgui_internal:592",
|
||||
"ImVec4": "imgui:313",
|
||||
"ImWcharClass": "imgui_internal:463",
|
||||
"STB_TexteditState": "imstb_textedit:342",
|
||||
"StbTexteditRow": "imstb_textedit:389",
|
||||
"StbUndoRecord": "imstb_textedit:324",
|
||||
"StbUndoState": "imstb_textedit:333",
|
||||
"stbrp_context_opaque": "imgui_internal:4281"
|
||||
},
|
||||
"nonPOD": {
|
||||
@@ -13540,6 +13544,136 @@
|
||||
"type": "float"
|
||||
}
|
||||
],
|
||||
"STB_TexteditState": [
|
||||
{
|
||||
"name": "cursor",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "select_start",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "select_end",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "insert_mode",
|
||||
"type": "unsigned char"
|
||||
},
|
||||
{
|
||||
"name": "row_count_per_page",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "cursor_at_end_of_line",
|
||||
"type": "unsigned char"
|
||||
},
|
||||
{
|
||||
"name": "initialized",
|
||||
"type": "unsigned char"
|
||||
},
|
||||
{
|
||||
"name": "has_preferred_x",
|
||||
"type": "unsigned char"
|
||||
},
|
||||
{
|
||||
"name": "single_line",
|
||||
"type": "unsigned char"
|
||||
},
|
||||
{
|
||||
"name": "padding1",
|
||||
"type": "unsigned char"
|
||||
},
|
||||
{
|
||||
"name": "padding2",
|
||||
"type": "unsigned char"
|
||||
},
|
||||
{
|
||||
"name": "padding3",
|
||||
"type": "unsigned char"
|
||||
},
|
||||
{
|
||||
"name": "preferred_x",
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "undostate",
|
||||
"type": "StbUndoState"
|
||||
}
|
||||
],
|
||||
"StbTexteditRow": [
|
||||
{
|
||||
"name": "x0",
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "x1",
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "baseline_y_delta",
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "ymin",
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "ymax",
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"name": "num_chars",
|
||||
"type": "int"
|
||||
}
|
||||
],
|
||||
"StbUndoRecord": [
|
||||
{
|
||||
"name": "where",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "insert_length",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "delete_length",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "char_storage",
|
||||
"type": "int"
|
||||
}
|
||||
],
|
||||
"StbUndoState": [
|
||||
{
|
||||
"name": "undo_rec[99]",
|
||||
"size": 99,
|
||||
"type": "StbUndoRecord"
|
||||
},
|
||||
{
|
||||
"name": "undo_char[999]",
|
||||
"size": 999,
|
||||
"type": "char"
|
||||
},
|
||||
{
|
||||
"name": "undo_point",
|
||||
"type": "short"
|
||||
},
|
||||
{
|
||||
"name": "redo_point",
|
||||
"type": "short"
|
||||
},
|
||||
{
|
||||
"name": "undo_char_point",
|
||||
"type": "int"
|
||||
},
|
||||
{
|
||||
"name": "redo_char_point",
|
||||
"type": "int"
|
||||
}
|
||||
],
|
||||
"stbrp_context_opaque": [
|
||||
{
|
||||
"name": "data[80]",
|
||||
|
||||
@@ -4579,6 +4579,10 @@ local t={
|
||||
ImVec2ih="imgui_internal:592",
|
||||
ImVec4="imgui:313",
|
||||
ImWcharClass="imgui_internal:463",
|
||||
STB_TexteditState="imstb_textedit:342",
|
||||
StbTexteditRow="imstb_textedit:389",
|
||||
StbUndoRecord="imstb_textedit:324",
|
||||
StbUndoState="imstb_textedit:333",
|
||||
stbrp_context_opaque="imgui_internal:4281"},
|
||||
nonPOD={
|
||||
ImBitArray=true,
|
||||
@@ -10444,6 +10448,102 @@ local t={
|
||||
[4]={
|
||||
name="w",
|
||||
type="float"}},
|
||||
STB_TexteditState={
|
||||
[1]={
|
||||
name="cursor",
|
||||
type="int"},
|
||||
[2]={
|
||||
name="select_start",
|
||||
type="int"},
|
||||
[3]={
|
||||
name="select_end",
|
||||
type="int"},
|
||||
[4]={
|
||||
name="insert_mode",
|
||||
type="unsigned char"},
|
||||
[5]={
|
||||
name="row_count_per_page",
|
||||
type="int"},
|
||||
[6]={
|
||||
name="cursor_at_end_of_line",
|
||||
type="unsigned char"},
|
||||
[7]={
|
||||
name="initialized",
|
||||
type="unsigned char"},
|
||||
[8]={
|
||||
name="has_preferred_x",
|
||||
type="unsigned char"},
|
||||
[9]={
|
||||
name="single_line",
|
||||
type="unsigned char"},
|
||||
[10]={
|
||||
name="padding1",
|
||||
type="unsigned char"},
|
||||
[11]={
|
||||
name="padding2",
|
||||
type="unsigned char"},
|
||||
[12]={
|
||||
name="padding3",
|
||||
type="unsigned char"},
|
||||
[13]={
|
||||
name="preferred_x",
|
||||
type="float"},
|
||||
[14]={
|
||||
name="undostate",
|
||||
type="StbUndoState"}},
|
||||
StbTexteditRow={
|
||||
[1]={
|
||||
name="x0",
|
||||
type="float"},
|
||||
[2]={
|
||||
name="x1",
|
||||
type="float"},
|
||||
[3]={
|
||||
name="baseline_y_delta",
|
||||
type="float"},
|
||||
[4]={
|
||||
name="ymin",
|
||||
type="float"},
|
||||
[5]={
|
||||
name="ymax",
|
||||
type="float"},
|
||||
[6]={
|
||||
name="num_chars",
|
||||
type="int"}},
|
||||
StbUndoRecord={
|
||||
[1]={
|
||||
name="where",
|
||||
type="int"},
|
||||
[2]={
|
||||
name="insert_length",
|
||||
type="int"},
|
||||
[3]={
|
||||
name="delete_length",
|
||||
type="int"},
|
||||
[4]={
|
||||
name="char_storage",
|
||||
type="int"}},
|
||||
StbUndoState={
|
||||
[1]={
|
||||
name="undo_rec[99]",
|
||||
size=99,
|
||||
type="StbUndoRecord"},
|
||||
[2]={
|
||||
name="undo_char[999]",
|
||||
size=999,
|
||||
type="char"},
|
||||
[3]={
|
||||
name="undo_point",
|
||||
type="short"},
|
||||
[4]={
|
||||
name="redo_point",
|
||||
type="short"},
|
||||
[5]={
|
||||
name="undo_char_point",
|
||||
type="int"},
|
||||
[6]={
|
||||
name="redo_char_point",
|
||||
type="int"}},
|
||||
stbrp_context_opaque={
|
||||
[1]={
|
||||
name="data[80]",
|
||||
|
||||
@@ -224,6 +224,9 @@
|
||||
"ImWchar16": "unsigned short",
|
||||
"ImWchar32": "unsigned int",
|
||||
"STB_TexteditState": "struct STB_TexteditState",
|
||||
"StbTexteditRow": "struct StbTexteditRow",
|
||||
"StbUndoRecord": "struct StbUndoRecord",
|
||||
"StbUndoState": "struct StbUndoState",
|
||||
"stbrp_context_opaque": "struct stbrp_context_opaque",
|
||||
"stbrp_node": "struct stbrp_node",
|
||||
"stbrp_node_im": "stbrp_node"
|
||||
|
||||
@@ -224,6 +224,9 @@ local t={
|
||||
ImWchar16="unsigned short",
|
||||
ImWchar32="unsigned int",
|
||||
STB_TexteditState="struct STB_TexteditState",
|
||||
StbTexteditRow="struct StbTexteditRow",
|
||||
StbUndoRecord="struct StbUndoRecord",
|
||||
StbUndoState="struct StbUndoState",
|
||||
stbrp_context_opaque="struct stbrp_context_opaque",
|
||||
stbrp_node="struct stbrp_node",
|
||||
stbrp_node_im="stbrp_node"}
|
||||
|
||||
Reference in New Issue
Block a user