diff --git a/cimgui.cpp b/cimgui.cpp index 36cad03..2c0927f 100644 --- a/cimgui.cpp +++ b/cimgui.cpp @@ -1427,126 +1427,10 @@ CIMGUI_API void igMemFree(void* ptr) { return ImGui::MemFree(ptr); } -CIMGUI_API ImVector* ImVector_ImVector(void) -{ - return IM_NEW(ImVector)(); -} CIMGUI_API void ImVector_destroy(ImVector* self) { IM_DELETE(self); } -CIMGUI_API ImVector* ImVector_ImVectorVector_(const ImVector_ src) -{ - return IM_NEW(ImVector)(src); -} -CIMGUI_API bool ImVector_empty(ImVector* self) -{ - return self->empty(); -} -CIMGUI_API int ImVector_size(ImVector* self) -{ - return self->size(); -} -CIMGUI_API int ImVector_size_in_bytes(ImVector* self) -{ - return self->size_in_bytes(); -} -CIMGUI_API int ImVector_capacity(ImVector* self) -{ - return self->capacity(); -} -CIMGUI_API void ImVector_clear(ImVector* self) -{ - return self->clear(); -} -CIMGUI_API const T* ImVector_begin(ImVector* self) -{ - return self->begin(); -} -CIMGUI_API const T* ImVector_begin(ImVector* self) -{ - return self->begin(); -} -CIMGUI_API const T* ImVector_end(ImVector* self) -{ - return self->end(); -} -CIMGUI_API const T* ImVector_end(ImVector* self) -{ - return self->end(); -} -CIMGUI_API const T* ImVector_front(ImVector* self) -{ - return &self->front(); -} -CIMGUI_API const T* ImVector_front(ImVector* self) -{ - return &self->front(); -} -CIMGUI_API const T* ImVector_back(ImVector* self) -{ - return &self->back(); -} -CIMGUI_API const T* ImVector_back(ImVector* self) -{ - return &self->back(); -} -CIMGUI_API void ImVector_swap(ImVector* self,ImVector_ rhs) -{ - return self->swap(rhs); -} -CIMGUI_API int ImVector__grow_capacity(ImVector* self,int sz) -{ - return self->_grow_capacity(sz); -} -CIMGUI_API void ImVector_resize(ImVector* self,int new_size) -{ - return self->resize(new_size); -} -CIMGUI_API void ImVector_resizeT(ImVector* self,int new_size,const T v) -{ - return self->resize(new_size,v); -} -CIMGUI_API void ImVector_reserve(ImVector* self,int new_capacity) -{ - return self->reserve(new_capacity); -} -CIMGUI_API void ImVector_push_back(ImVector* self,const T v) -{ - return self->push_back(v); -} -CIMGUI_API void ImVector_pop_back(ImVector* self) -{ - return self->pop_back(); -} -CIMGUI_API void ImVector_push_front(ImVector* self,const T v) -{ - return self->push_front(v); -} -CIMGUI_API T* ImVector_erase(ImVector* self,const T* it) -{ - return self->erase(it); -} -CIMGUI_API T* ImVector_eraseTPtr(ImVector* self,const T* it,const T* it_last) -{ - return self->erase(it,it_last); -} -CIMGUI_API T* ImVector_erase_unsorted(ImVector* self,const T* it) -{ - return self->erase_unsorted(it); -} -CIMGUI_API T* ImVector_insert(ImVector* self,const T* it,const T v) -{ - return self->insert(it,v); -} -CIMGUI_API bool ImVector_contains(ImVector* self,const T v) -{ - return self->contains(v); -} -CIMGUI_API int ImVector_index_from_ptr(ImVector* self,const T* it) -{ - return self->index_from_ptr(it); -} CIMGUI_API ImGuiStyle* ImGuiStyle_ImGuiStyle(void) { return IM_NEW(ImGuiStyle)(); diff --git a/cimgui.h b/cimgui.h index 98a8fdf..1bd09fc 100644 --- a/cimgui.h +++ b/cimgui.h @@ -45,7 +45,6 @@ typedef struct ImColor_Simple { ImVec4_Simple Value;} ImColor_Simple; typedef struct CustomRect CustomRect; typedef struct Pair Pair; typedef struct TextRange TextRange; -typedef struct ImVector ImVector; typedef struct ImVec4 ImVec4; typedef struct ImVec2 ImVec2; typedef struct ImGuiTextFilter ImGuiTextFilter; @@ -523,16 +522,6 @@ enum ImGuiCond_ ImGuiCond_FirstUseEver = 1 << 2, ImGuiCond_Appearing = 1 << 3 }; -template -struct ImVector -{ - int Size; - int Capacity; - T* Data; - typedef T value_type; - typedef value_type* iterator; - typedef const value_type* const_iterator; -}; struct ImGuiStyle { float Alpha; @@ -1263,36 +1252,7 @@ CIMGUI_API const char* igSaveIniSettingsToMemory(size_t* out_ini_size); CIMGUI_API void igSetAllocatorFunctions(void*(*alloc_func)(size_t sz,void* user_data),void(*free_func)(void* ptr,void* user_data),void* user_data); CIMGUI_API void* igMemAlloc(size_t size); CIMGUI_API void igMemFree(void* ptr); -CIMGUI_API ImVector* ImVector_ImVector(void); CIMGUI_API void ImVector_destroy(ImVector* self); -CIMGUI_API ImVector* ImVector_ImVectorVector_(const ImVector_ src); -CIMGUI_API bool ImVector_empty(ImVector* self); -CIMGUI_API int ImVector_size(ImVector* self); -CIMGUI_API int ImVector_size_in_bytes(ImVector* self); -CIMGUI_API int ImVector_capacity(ImVector* self); -CIMGUI_API void ImVector_clear(ImVector* self); -CIMGUI_API const T* ImVector_begin(ImVector* self); -CIMGUI_API const T* ImVector_begin(ImVector* self); -CIMGUI_API const T* ImVector_end(ImVector* self); -CIMGUI_API const T* ImVector_end(ImVector* self); -CIMGUI_API const T* ImVector_front(ImVector* self); -CIMGUI_API const T* ImVector_front(ImVector* self); -CIMGUI_API const T* ImVector_back(ImVector* self); -CIMGUI_API const T* ImVector_back(ImVector* self); -CIMGUI_API void ImVector_swap(ImVector* self,ImVector_ rhs); -CIMGUI_API int ImVector__grow_capacity(ImVector* self,int sz); -CIMGUI_API void ImVector_resize(ImVector* self,int new_size); -CIMGUI_API void ImVector_resizeT(ImVector* self,int new_size,const T v); -CIMGUI_API void ImVector_reserve(ImVector* self,int new_capacity); -CIMGUI_API void ImVector_push_back(ImVector* self,const T v); -CIMGUI_API void ImVector_pop_back(ImVector* self); -CIMGUI_API void ImVector_push_front(ImVector* self,const T v); -CIMGUI_API T* ImVector_erase(ImVector* self,const T* it); -CIMGUI_API T* ImVector_eraseTPtr(ImVector* self,const T* it,const T* it_last); -CIMGUI_API T* ImVector_erase_unsorted(ImVector* self,const T* it); -CIMGUI_API T* ImVector_insert(ImVector* self,const T* it,const T v); -CIMGUI_API bool ImVector_contains(ImVector* self,const T v); -CIMGUI_API int ImVector_index_from_ptr(ImVector* self,const T* it); CIMGUI_API ImGuiStyle* ImGuiStyle_ImGuiStyle(void); CIMGUI_API void ImGuiStyle_destroy(ImGuiStyle* self); CIMGUI_API void ImGuiStyle_ScaleAllSizes(ImGuiStyle* self,float scale_factor); diff --git a/generator/cpp2ffi.lua b/generator/cpp2ffi.lua index 00d8557..ad427bc 100644 --- a/generator/cpp2ffi.lua +++ b/generator/cpp2ffi.lua @@ -831,7 +831,8 @@ function M.Parser() table.insert(outtab,it.item) elseif it.re_name == "struct_re" then local cleanst,structname = self:clean_struct(it.item) - if structname then + --if not void stname or templated + if structname and not self.typenames[structname] then table.insert(outtab,cleanst) table.insert(typedefs_table,"typedef struct "..structname.." "..structname..";\n") self.typedefs_dict[structname]="struct "..structname @@ -914,7 +915,8 @@ function M.Parser() end elseif it.re_name == "struct_re" then local cleanst,structname,strtab = self:clean_struct(it.item) - if structname then --not empty struc + --if not void stname or templated + if structname and not self.typenames[structname] then outtab.structs[structname] = {} for j=3,#strtab-1 do self:parse_struct_line(strtab[j],outtab.structs[structname]) diff --git a/generator/generator2.lua b/generator/generator2.lua index a2b9fd4..673a04c 100644 --- a/generator/generator2.lua +++ b/generator/generator2.lua @@ -236,7 +236,7 @@ local function func_header_generate(FP) local def = cimf[t.signature] assert(def,t.signature..t.cimguiname) local manual = FP.get_manuals(def) - if not manual then + if not manual and not def.templated then --if FP.templates[t.stname] then print(t.cimguiname) end local addcoment = def.comment or "" local empty = def.args:match("^%(%)") --no args @@ -338,7 +338,7 @@ local function func_implementation(FP) local def = cimf[t.signature] assert(def) local manual = FP.get_manuals(def) - if not manual then + if not manual and not def.templated then if def.constructor then assert(def.stname ~= "","constructor without struct") local empty = def.args:match("^%(%)") --no args diff --git a/generator/output/cimgui.cpp b/generator/output/cimgui.cpp index 36cad03..2c0927f 100644 --- a/generator/output/cimgui.cpp +++ b/generator/output/cimgui.cpp @@ -1427,126 +1427,10 @@ CIMGUI_API void igMemFree(void* ptr) { return ImGui::MemFree(ptr); } -CIMGUI_API ImVector* ImVector_ImVector(void) -{ - return IM_NEW(ImVector)(); -} CIMGUI_API void ImVector_destroy(ImVector* self) { IM_DELETE(self); } -CIMGUI_API ImVector* ImVector_ImVectorVector_(const ImVector_ src) -{ - return IM_NEW(ImVector)(src); -} -CIMGUI_API bool ImVector_empty(ImVector* self) -{ - return self->empty(); -} -CIMGUI_API int ImVector_size(ImVector* self) -{ - return self->size(); -} -CIMGUI_API int ImVector_size_in_bytes(ImVector* self) -{ - return self->size_in_bytes(); -} -CIMGUI_API int ImVector_capacity(ImVector* self) -{ - return self->capacity(); -} -CIMGUI_API void ImVector_clear(ImVector* self) -{ - return self->clear(); -} -CIMGUI_API const T* ImVector_begin(ImVector* self) -{ - return self->begin(); -} -CIMGUI_API const T* ImVector_begin(ImVector* self) -{ - return self->begin(); -} -CIMGUI_API const T* ImVector_end(ImVector* self) -{ - return self->end(); -} -CIMGUI_API const T* ImVector_end(ImVector* self) -{ - return self->end(); -} -CIMGUI_API const T* ImVector_front(ImVector* self) -{ - return &self->front(); -} -CIMGUI_API const T* ImVector_front(ImVector* self) -{ - return &self->front(); -} -CIMGUI_API const T* ImVector_back(ImVector* self) -{ - return &self->back(); -} -CIMGUI_API const T* ImVector_back(ImVector* self) -{ - return &self->back(); -} -CIMGUI_API void ImVector_swap(ImVector* self,ImVector_ rhs) -{ - return self->swap(rhs); -} -CIMGUI_API int ImVector__grow_capacity(ImVector* self,int sz) -{ - return self->_grow_capacity(sz); -} -CIMGUI_API void ImVector_resize(ImVector* self,int new_size) -{ - return self->resize(new_size); -} -CIMGUI_API void ImVector_resizeT(ImVector* self,int new_size,const T v) -{ - return self->resize(new_size,v); -} -CIMGUI_API void ImVector_reserve(ImVector* self,int new_capacity) -{ - return self->reserve(new_capacity); -} -CIMGUI_API void ImVector_push_back(ImVector* self,const T v) -{ - return self->push_back(v); -} -CIMGUI_API void ImVector_pop_back(ImVector* self) -{ - return self->pop_back(); -} -CIMGUI_API void ImVector_push_front(ImVector* self,const T v) -{ - return self->push_front(v); -} -CIMGUI_API T* ImVector_erase(ImVector* self,const T* it) -{ - return self->erase(it); -} -CIMGUI_API T* ImVector_eraseTPtr(ImVector* self,const T* it,const T* it_last) -{ - return self->erase(it,it_last); -} -CIMGUI_API T* ImVector_erase_unsorted(ImVector* self,const T* it) -{ - return self->erase_unsorted(it); -} -CIMGUI_API T* ImVector_insert(ImVector* self,const T* it,const T v) -{ - return self->insert(it,v); -} -CIMGUI_API bool ImVector_contains(ImVector* self,const T v) -{ - return self->contains(v); -} -CIMGUI_API int ImVector_index_from_ptr(ImVector* self,const T* it) -{ - return self->index_from_ptr(it); -} CIMGUI_API ImGuiStyle* ImGuiStyle_ImGuiStyle(void) { return IM_NEW(ImGuiStyle)(); diff --git a/generator/output/cimgui.h b/generator/output/cimgui.h index 98a8fdf..1bd09fc 100644 --- a/generator/output/cimgui.h +++ b/generator/output/cimgui.h @@ -45,7 +45,6 @@ typedef struct ImColor_Simple { ImVec4_Simple Value;} ImColor_Simple; typedef struct CustomRect CustomRect; typedef struct Pair Pair; typedef struct TextRange TextRange; -typedef struct ImVector ImVector; typedef struct ImVec4 ImVec4; typedef struct ImVec2 ImVec2; typedef struct ImGuiTextFilter ImGuiTextFilter; @@ -523,16 +522,6 @@ enum ImGuiCond_ ImGuiCond_FirstUseEver = 1 << 2, ImGuiCond_Appearing = 1 << 3 }; -template -struct ImVector -{ - int Size; - int Capacity; - T* Data; - typedef T value_type; - typedef value_type* iterator; - typedef const value_type* const_iterator; -}; struct ImGuiStyle { float Alpha; @@ -1263,36 +1252,7 @@ CIMGUI_API const char* igSaveIniSettingsToMemory(size_t* out_ini_size); CIMGUI_API void igSetAllocatorFunctions(void*(*alloc_func)(size_t sz,void* user_data),void(*free_func)(void* ptr,void* user_data),void* user_data); CIMGUI_API void* igMemAlloc(size_t size); CIMGUI_API void igMemFree(void* ptr); -CIMGUI_API ImVector* ImVector_ImVector(void); CIMGUI_API void ImVector_destroy(ImVector* self); -CIMGUI_API ImVector* ImVector_ImVectorVector_(const ImVector_ src); -CIMGUI_API bool ImVector_empty(ImVector* self); -CIMGUI_API int ImVector_size(ImVector* self); -CIMGUI_API int ImVector_size_in_bytes(ImVector* self); -CIMGUI_API int ImVector_capacity(ImVector* self); -CIMGUI_API void ImVector_clear(ImVector* self); -CIMGUI_API const T* ImVector_begin(ImVector* self); -CIMGUI_API const T* ImVector_begin(ImVector* self); -CIMGUI_API const T* ImVector_end(ImVector* self); -CIMGUI_API const T* ImVector_end(ImVector* self); -CIMGUI_API const T* ImVector_front(ImVector* self); -CIMGUI_API const T* ImVector_front(ImVector* self); -CIMGUI_API const T* ImVector_back(ImVector* self); -CIMGUI_API const T* ImVector_back(ImVector* self); -CIMGUI_API void ImVector_swap(ImVector* self,ImVector_ rhs); -CIMGUI_API int ImVector__grow_capacity(ImVector* self,int sz); -CIMGUI_API void ImVector_resize(ImVector* self,int new_size); -CIMGUI_API void ImVector_resizeT(ImVector* self,int new_size,const T v); -CIMGUI_API void ImVector_reserve(ImVector* self,int new_capacity); -CIMGUI_API void ImVector_push_back(ImVector* self,const T v); -CIMGUI_API void ImVector_pop_back(ImVector* self); -CIMGUI_API void ImVector_push_front(ImVector* self,const T v); -CIMGUI_API T* ImVector_erase(ImVector* self,const T* it); -CIMGUI_API T* ImVector_eraseTPtr(ImVector* self,const T* it,const T* it_last); -CIMGUI_API T* ImVector_erase_unsorted(ImVector* self,const T* it); -CIMGUI_API T* ImVector_insert(ImVector* self,const T* it,const T v); -CIMGUI_API bool ImVector_contains(ImVector* self,const T v); -CIMGUI_API int ImVector_index_from_ptr(ImVector* self,const T* it); CIMGUI_API ImGuiStyle* ImGuiStyle_ImGuiStyle(void); CIMGUI_API void ImGuiStyle_destroy(ImGuiStyle* self); CIMGUI_API void ImGuiStyle_ScaleAllSizes(ImGuiStyle* self,float scale_factor); diff --git a/generator/output/structs_and_enums.json b/generator/output/structs_and_enums.json index 6b34237..a843bd1 100644 --- a/generator/output/structs_and_enums.json +++ b/generator/output/structs_and_enums.json @@ -2739,32 +2739,6 @@ "type": "float" } ], - "ImVector": [ - { - "name": "Size", - "type": "int" - }, - { - "name": "Capacity", - "type": "int" - }, - { - "name": "Data", - "type": "T*" - }, - { - "name": "value_type", - "type": "typedef T" - }, - { - "name": "iterator", - "type": "typedef value_type*" - }, - { - "name": "const_iterator", - "type": "typedef const value_type*" - } - ], "Pair": [ { "name": "key", diff --git a/generator/output/structs_and_enums.lua b/generator/output/structs_and_enums.lua index f042c8c..1add2b6 100644 --- a/generator/output/structs_and_enums.lua +++ b/generator/output/structs_and_enums.lua @@ -2120,25 +2120,6 @@ defs["structs"]["ImVec4"][3]["type"] = "float" defs["structs"]["ImVec4"][4] = {} defs["structs"]["ImVec4"][4]["name"] = "w" defs["structs"]["ImVec4"][4]["type"] = "float" -defs["structs"]["ImVector"] = {} -defs["structs"]["ImVector"][1] = {} -defs["structs"]["ImVector"][1]["name"] = "Size" -defs["structs"]["ImVector"][1]["type"] = "int" -defs["structs"]["ImVector"][2] = {} -defs["structs"]["ImVector"][2]["name"] = "Capacity" -defs["structs"]["ImVector"][2]["type"] = "int" -defs["structs"]["ImVector"][3] = {} -defs["structs"]["ImVector"][3]["name"] = "Data" -defs["structs"]["ImVector"][3]["type"] = "T*" -defs["structs"]["ImVector"][4] = {} -defs["structs"]["ImVector"][4]["name"] = "value_type" -defs["structs"]["ImVector"][4]["type"] = "typedef T" -defs["structs"]["ImVector"][5] = {} -defs["structs"]["ImVector"][5]["name"] = "iterator" -defs["structs"]["ImVector"][5]["type"] = "typedef value_type*" -defs["structs"]["ImVector"][6] = {} -defs["structs"]["ImVector"][6]["name"] = "const_iterator" -defs["structs"]["ImVector"][6]["type"] = "typedef const value_type*" defs["structs"]["Pair"] = {} defs["structs"]["Pair"][1] = {} defs["structs"]["Pair"][1]["name"] = "key" diff --git a/generator/output/typedefs_dict.json b/generator/output/typedefs_dict.json index 59f5988..766c132 100644 --- a/generator/output/typedefs_dict.json +++ b/generator/output/typedefs_dict.json @@ -60,7 +60,6 @@ "ImU64": "uint64_t", "ImVec2": "struct ImVec2", "ImVec4": "struct ImVec4", - "ImVector": "struct ImVector", "ImWchar": "unsigned short", "Pair": "struct Pair", "TextRange": "struct TextRange", diff --git a/generator/output/typedefs_dict.lua b/generator/output/typedefs_dict.lua index 29a7528..19a2e8a 100644 --- a/generator/output/typedefs_dict.lua +++ b/generator/output/typedefs_dict.lua @@ -60,7 +60,6 @@ defs["ImU32"] = "unsigned int" defs["ImU64"] = "uint64_t" defs["ImVec2"] = "struct ImVec2" defs["ImVec4"] = "struct ImVec4" -defs["ImVector"] = "struct ImVector" defs["ImWchar"] = "unsigned short" defs["Pair"] = "struct Pair" defs["TextRange"] = "struct TextRange"