diff --git a/cimgui.h b/cimgui.h index c329487..71c6d28 100644 --- a/cimgui.h +++ b/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; diff --git a/generator/generator.lua b/generator/generator.lua index edd7fa7..a036cc6 100644 --- a/generator/generator.lua +++ b/generator/generator.lua @@ -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) diff --git a/generator/output/constants.json b/generator/output/constants.json index 25902ae..c5610d6 100644 --- a/generator/output/constants.json +++ b/generator/output/constants.json @@ -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", diff --git a/generator/output/constants.lua b/generator/output/constants.lua index 4d1fbf0..373ba97 100644 --- a/generator/output/constants.lua +++ b/generator/output/constants.lua @@ -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", diff --git a/generator/output/structs_and_enums.json b/generator/output/structs_and_enums.json index 38bc22d..cc21bd1 100644 --- a/generator/output/structs_and_enums.json +++ b/generator/output/structs_and_enums.json @@ -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]", diff --git a/generator/output/structs_and_enums.lua b/generator/output/structs_and_enums.lua index ac8680a..ccfb914 100644 --- a/generator/output/structs_and_enums.lua +++ b/generator/output/structs_and_enums.lua @@ -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]", diff --git a/generator/output/typedefs_dict.json b/generator/output/typedefs_dict.json index 4ac9a5a..ccd1329 100644 --- a/generator/output/typedefs_dict.json +++ b/generator/output/typedefs_dict.json @@ -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" diff --git a/generator/output/typedefs_dict.lua b/generator/output/typedefs_dict.lua index 5f291de..1ad77eb 100644 --- a/generator/output/typedefs_dict.lua +++ b/generator/output/typedefs_dict.lua @@ -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"}