1 module bindbc.cimgui.overloads;
2 
3 import bindbc.cimgui.funcs;
4 import bindbc.cimgui.types;
5 
6 import core.stdc.stdarg;
7 static template overload(Funcs...)
8 {
9     import std.traits : Parameters;
10     static foreach(f; Funcs)
11         auto overload(Parameters!f params){
12             return f(params);}
13 }
14 ImColor* newImColor(){return ImColor_ImColor_Nil();}
15 ImColor* newImColor(int r,int g,int b,int a){return ImColor_ImColor_Int(r,g,b,a);}
16 ImColor* newImColor(ImU32 rgba){return ImColor_ImColor_U32(rgba);}
17 ImColor* newImColor(float r,float g,float b,float a){return ImColor_ImColor_Float(r,g,b,a);}
18 ImColor* newImColor(const ImVec4 col){return ImColor_ImColor_Vec4(col);}
19 void ImDrawList_AddText(ImDrawList* self,const ImVec2 pos,ImU32 col,const (char)* text_begin,const (char)* text_end){ImDrawList_AddText_Vec2(self,pos,col,text_begin,text_end);}
20 void ImDrawList_AddText(ImDrawList* self,const ImFont* font,float font_size,const ImVec2 pos,ImU32 col,const (char)* text_begin,const (char)* text_end,float wrap_width,const ImVec4* cpu_fine_clip_rect){ImDrawList_AddText_FontPtr(self,font,font_size,pos,col,text_begin,text_end,wrap_width,cpu_fine_clip_rect);}
21 ImGuiPtrOrIndex* newImGuiPtrOrIndex(void* ptr){return ImGuiPtrOrIndex_ImGuiPtrOrIndex_Ptr(ptr);}
22 ImGuiPtrOrIndex* newImGuiPtrOrIndex(int index){return ImGuiPtrOrIndex_ImGuiPtrOrIndex_Int(index);}
23 ImGuiStoragePair* newImGuiStoragePair(ImGuiID _key,int _val_i){return ImGuiStoragePair_ImGuiStoragePair_Int(_key,_val_i);}
24 ImGuiStoragePair* newImGuiStoragePair(ImGuiID _key,float _val_f){return ImGuiStoragePair_ImGuiStoragePair_Float(_key,_val_f);}
25 ImGuiStoragePair* newImGuiStoragePair(ImGuiID _key,void* _val_p){return ImGuiStoragePair_ImGuiStoragePair_Ptr(_key,_val_p);}
26 ImGuiStyleMod* newImGuiStyleMod(ImGuiStyleVar idx,int v){return ImGuiStyleMod_ImGuiStyleMod_Int(idx,v);}
27 ImGuiStyleMod* newImGuiStyleMod(ImGuiStyleVar idx,float v){return ImGuiStyleMod_ImGuiStyleMod_Float(idx,v);}
28 ImGuiStyleMod* newImGuiStyleMod(ImGuiStyleVar idx,ImVec2 v){return ImGuiStyleMod_ImGuiStyleMod_Vec2(idx,v);}
29 ImGuiTextRange* newImGuiTextRange(){return ImGuiTextRange_ImGuiTextRange_Nil();}
30 ImGuiTextRange* newImGuiTextRange(const (char)* _b,const (char)* _e){return ImGuiTextRange_ImGuiTextRange_Str(_b,_e);}
31 ImGuiID ImGuiWindow_GetID(ImGuiWindow* self,const (char)* str,const (char)* str_end){return ImGuiWindow_GetID_Str(self,str,str_end);}
32 ImGuiID ImGuiWindow_GetID(ImGuiWindow* self,const void* ptr){return ImGuiWindow_GetID_Ptr(self,ptr);}
33 ImGuiID ImGuiWindow_GetID(ImGuiWindow* self,int n){return ImGuiWindow_GetID_Int(self,n);}
34 ImGuiID ImGuiWindow_GetIDNoKeepAlive(ImGuiWindow* self,const (char)* str,const (char)* str_end){return ImGuiWindow_GetIDNoKeepAlive_Str(self,str,str_end);}
35 ImGuiID ImGuiWindow_GetIDNoKeepAlive(ImGuiWindow* self,const void* ptr){return ImGuiWindow_GetIDNoKeepAlive_Ptr(self,ptr);}
36 ImGuiID ImGuiWindow_GetIDNoKeepAlive(ImGuiWindow* self,int n){return ImGuiWindow_GetIDNoKeepAlive_Int(self,n);}
37 void ImRect_Add(ImRect* self,const ImVec2 p){ImRect_Add_Vec2(self,p);}
38 void ImRect_Add(ImRect* self,const ImRect r){ImRect_Add_Rect(self,r);}
39 bool ImRect_Contains(ImRect* self,const ImVec2 p){return ImRect_Contains_Vec2(self,p);}
40 bool ImRect_Contains(ImRect* self,const ImRect r){return ImRect_Contains_Rect(self,r);}
41 void ImRect_Expand(ImRect* self,const float amount){ImRect_Expand_Float(self,amount);}
42 void ImRect_Expand(ImRect* self,const ImVec2 amount){ImRect_Expand_Vec2(self,amount);}
43 ImRect* newImRect(){return ImRect_ImRect_Nil();}
44 ImRect* newImRect(const ImVec2 min,const ImVec2 max){return ImRect_ImRect_Vec2(min,max);}
45 ImRect* newImRect(const ImVec4 v){return ImRect_ImRect_Vec4(v);}
46 ImRect* newImRect(float x1,float y1,float x2,float y2){return ImRect_ImRect_Float(x1,y1,x2,y2);}
47 ImVec1* newImVec1(){return ImVec1_ImVec1_Nil();}
48 ImVec1* newImVec1(float _x){return ImVec1_ImVec1_Float(_x);}
49 ImVec2* newImVec2(){return ImVec2_ImVec2_Nil();}
50 ImVec2* newImVec2(float _x,float _y){return ImVec2_ImVec2_Float(_x,_y);}
51 ImVec2ih* newImVec2ih(){return ImVec2ih_ImVec2ih_Nil();}
52 ImVec2ih* newImVec2ih(short _x,short _y){return ImVec2ih_ImVec2ih_short(_x,_y);}
53 ImVec2ih* newImVec2ih(const ImVec2 rhs){return ImVec2ih_ImVec2ih_Vec2(rhs);}
54 ImVec4* newImVec4(){return ImVec4_ImVec4_Nil();}
55 ImVec4* newImVec4(float _x,float _y,float _z,float _w){return ImVec4_ImVec4_Float(_x,_y,_z,_w);}
56 bool igBeginChild(const (char)* str_id,const ImVec2 size,bool border,ImGuiWindowFlags flags){return igBeginChild_Str(str_id,size,border,flags);}
57 bool igBeginChild(ImGuiID id,const ImVec2 size,bool border,ImGuiWindowFlags flags){return igBeginChild_ID(id,size,border,flags);}
58 bool igCheckboxFlags(const (char)* label,int* flags,int flags_value){return igCheckboxFlags_IntPtr(label,flags,flags_value);}
59 bool igCheckboxFlags(const (char)* label,uint* flags,uint flags_value){return igCheckboxFlags_UintPtr(label,flags,flags_value);}
60 bool igCheckboxFlags(const (char)* label,ImS64* flags,ImS64 flags_value){return igCheckboxFlags_S64Ptr(label,flags,flags_value);}
61 bool igCheckboxFlags(const (char)* label,ImU64* flags,ImU64 flags_value){return igCheckboxFlags_U64Ptr(label,flags,flags_value);}
62 bool igCollapsingHeader(const (char)* label,ImGuiTreeNodeFlags flags){return igCollapsingHeader_TreeNodeFlags(label,flags);}
63 bool igCollapsingHeader(const (char)* label,bool* p_visible,ImGuiTreeNodeFlags flags){return igCollapsingHeader_BoolPtr(label,p_visible,flags);}
64 bool igCombo(const (char)* label,int* current_item,const (char)* * items,int items_count,int popup_max_height_in_items){return igCombo_Str_arr(label,current_item,items,items_count,popup_max_height_in_items);}
65 bool igCombo(const (char)* label,int* current_item,const (char)* items_separated_by_zeros,int popup_max_height_in_items){return igCombo_Str(label,current_item,items_separated_by_zeros,popup_max_height_in_items);}
66 
67 alias igCombo_items_getter = extern(C) bool function (void* data,int idx,const (char)** out_text);
68 bool igCombo(const (char)* label,int* current_item,igCombo_items_getter items_getter, void* data,int items_count,int popup_max_height_in_items){return igCombo_FnBoolPtr(label,current_item,items_getter,data,items_count,popup_max_height_in_items);}
69 ImDrawList* igGetBackgroundDrawList(){return igGetBackgroundDrawList_Nil();}
70 ImDrawList* igGetBackgroundDrawList(ImGuiViewport* viewport){return igGetBackgroundDrawList_ViewportPtr(viewport);}
71 ImU32 igGetColorU32(ImGuiCol idx,float alpha_mul){return igGetColorU32_Col(idx,alpha_mul);}
72 ImU32 igGetColorU32(const ImVec4 col){return igGetColorU32_Vec4(col);}
73 ImU32 igGetColorU32(ImU32 col){return igGetColorU32_U32(col);}
74 ImDrawList* igGetForegroundDrawList(){return igGetForegroundDrawList_Nil();}
75 ImDrawList* igGetForegroundDrawList(ImGuiViewport* viewport){return igGetForegroundDrawList_ViewportPtr(viewport);}
76 ImDrawList* igGetForegroundDrawList(ImGuiWindow* window){return igGetForegroundDrawList_WindowPtr(window);}
77 ImGuiID igGetID(const (char)* str_id){return igGetID_Str(str_id);}
78 ImGuiID igGetID(const (char)* str_id_begin,const (char)* str_id_end){return igGetID_StrStr(str_id_begin,str_id_end);}
79 ImGuiID igGetID(const void* ptr_id){return igGetID_Ptr(ptr_id);}
80 int igImAbs(int x){return igImAbs_Int(x);}
81 float igImAbs(float x){return igImAbs_Float(x);}
82 double igImAbs(double x){return igImAbs_double(x);}
83 float igImFloor(float f){return igImFloor_Float(f);}
84 ImVec2 igImFloor(const ImVec2 v){ImVec2 pOut;	igImFloor_Vec2(&pOut,v);	 return pOut;}
85 bool igImIsPowerOfTwo(int v){return igImIsPowerOfTwo_Int(v);}
86 bool igImIsPowerOfTwo(ImU64 v){return igImIsPowerOfTwo_U64(v);}
87 float igImLengthSqr(const ImVec2 lhs){return igImLengthSqr_Vec2(lhs);}
88 float igImLengthSqr(const ImVec4 lhs){return igImLengthSqr_Vec4(lhs);}
89 ImVec2 igImLerp(const ImVec2 a,const ImVec2 b,float t){ImVec2 pOut;	igImLerp_Vec2Float(&pOut,a,b,t);	 return pOut;}
90 ImVec2 igImLerp(const ImVec2 a,const ImVec2 b,const ImVec2 t){ImVec2 pOut;	igImLerp_Vec2Vec2(&pOut,a,b,t);	 return pOut;}
91 ImVec4 igImLerp(const ImVec4 a,const ImVec4 b,float t){ImVec4 pOut;	igImLerp_Vec4(&pOut,a,b,t);	 return pOut;}
92 float igImLog(float x){return igImLog_Float(x);}
93 double igImLog(double x){return igImLog_double(x);}
94 float igImPow(float x,float y){return igImPow_Float(x,y);}
95 double igImPow(double x,double y){return igImPow_double(x,y);}
96 float igImRsqrt(float x){return igImRsqrt_Float(x);}
97 double igImRsqrt(double x){return igImRsqrt_double(x);}
98 float igImSign(float x){return igImSign_Float(x);}
99 double igImSign(double x){return igImSign_double(x);}
100 bool igIsPopupOpen(const (char)* str_id,ImGuiPopupFlags flags){return igIsPopupOpen_Str(str_id,flags);}
101 bool igIsPopupOpen(ImGuiID id,ImGuiPopupFlags popup_flags){return igIsPopupOpen_ID(id,popup_flags);}
102 bool igIsRectVisible(const ImVec2 size){return igIsRectVisible_Nil(size);}
103 bool igIsRectVisible(const ImVec2 rect_min,const ImVec2 rect_max){return igIsRectVisible_Vec2(rect_min,rect_max);}
104 void igItemSize(const ImVec2 size,float text_baseline_y){igItemSize_Vec2(size,text_baseline_y);}
105 void igItemSize(const ImRect bb,float text_baseline_y){igItemSize_Rect(bb,text_baseline_y);}
106 bool igListBox(const (char)* label,int* current_item,const (char)* * items,int items_count,int height_in_items){return igListBox_Str_arr(label,current_item,items,items_count,height_in_items);}
107 
108 alias igListBox_items_getter = extern(C) bool function (void* data,int idx,const (char)** out_text);
109 bool igListBox(const (char)* label,int* current_item,igListBox_items_getter items_getter, void* data,int items_count,int height_in_items){return igListBox_FnBoolPtr(label,current_item,items_getter,data,items_count,height_in_items);}
110 void igMarkIniSettingsDirty(){igMarkIniSettingsDirty_Nil();}
111 void igMarkIniSettingsDirty(ImGuiWindow* window){igMarkIniSettingsDirty_WindowPtr(window);}
112 bool igMenuItem(const (char)* label,const (char)* shortcut,bool selected,bool enabled){return igMenuItem_Bool(label,shortcut,selected,enabled);}
113 bool igMenuItem(const (char)* label,const (char)* shortcut,bool* p_selected,bool enabled){return igMenuItem_BoolPtr(label,shortcut,p_selected,enabled);}
114 void igOpenPopup(const (char)* str_id,ImGuiPopupFlags popup_flags){igOpenPopup_Str(str_id,popup_flags);}
115 void igOpenPopup(ImGuiID id,ImGuiPopupFlags popup_flags){igOpenPopup_ID(id,popup_flags);}
116 void igPlotHistogram(const (char)* label,const float* values,int values_count,int values_offset,const (char)* overlay_text,float scale_min,float scale_max,ImVec2 graph_size,int stride){igPlotHistogram_FloatPtr(label,values,values_count,values_offset,overlay_text,scale_min,scale_max,graph_size,stride);}
117 
118 alias igPlotHistogram_values_getter = extern(C) float function (void* data,int idx);
119 void igPlotHistogram(const (char)* label,igPlotHistogram_values_getter values_getter, void* data,int values_count,int values_offset,const (char)* overlay_text,float scale_min,float scale_max,ImVec2 graph_size){igPlotHistogram_FnFloatPtr(label,values_getter,data,values_count,values_offset,overlay_text,scale_min,scale_max,graph_size);}
120 void igPlotLines(const (char)* label,const float* values,int values_count,int values_offset,const (char)* overlay_text,float scale_min,float scale_max,ImVec2 graph_size,int stride){igPlotLines_FloatPtr(label,values,values_count,values_offset,overlay_text,scale_min,scale_max,graph_size,stride);}
121 
122 alias igPlotLines_values_getter = extern(C) float function (void* data,int idx);
123 void igPlotLines(const (char)* label,igPlotLines_values_getter values_getter, void* data,int values_count,int values_offset,const (char)* overlay_text,float scale_min,float scale_max,ImVec2 graph_size){igPlotLines_FnFloatPtr(label,values_getter,data,values_count,values_offset,overlay_text,scale_min,scale_max,graph_size);}
124 void igPushID(const (char)* str_id){igPushID_Str(str_id);}
125 void igPushID(const (char)* str_id_begin,const (char)* str_id_end){igPushID_StrStr(str_id_begin,str_id_end);}
126 void igPushID(const void* ptr_id){igPushID_Ptr(ptr_id);}
127 void igPushID(int int_id){igPushID_Int(int_id);}
128 void igPushStyleColor(ImGuiCol idx,ImU32 col){igPushStyleColor_U32(idx,col);}
129 void igPushStyleColor(ImGuiCol idx,const ImVec4 col){igPushStyleColor_Vec4(idx,col);}
130 void igPushStyleVar(ImGuiStyleVar idx,float val){igPushStyleVar_Float(idx,val);}
131 void igPushStyleVar(ImGuiStyleVar idx,const ImVec2 val){igPushStyleVar_Vec2(idx,val);}
132 bool igRadioButton(const (char)* label,bool active){return igRadioButton_Bool(label,active);}
133 bool igRadioButton(const (char)* label,int* v,int v_button){return igRadioButton_IntPtr(label,v,v_button);}
134 bool igSelectable(const (char)* label,bool selected,ImGuiSelectableFlags flags,const ImVec2 size){return igSelectable_Bool(label,selected,flags,size);}
135 bool igSelectable(const (char)* label,bool* p_selected,ImGuiSelectableFlags flags,const ImVec2 size){return igSelectable_BoolPtr(label,p_selected,flags,size);}
136 void igSetScrollFromPosX(float local_x,float center_x_ratio){igSetScrollFromPosX_Float(local_x,center_x_ratio);}
137 void igSetScrollFromPosX(ImGuiWindow* window,float local_x,float center_x_ratio){igSetScrollFromPosX_WindowPtr(window,local_x,center_x_ratio);}
138 void igSetScrollFromPosY(float local_y,float center_y_ratio){igSetScrollFromPosY_Float(local_y,center_y_ratio);}
139 void igSetScrollFromPosY(ImGuiWindow* window,float local_y,float center_y_ratio){igSetScrollFromPosY_WindowPtr(window,local_y,center_y_ratio);}
140 void igSetScrollX(float scroll_x){igSetScrollX_Float(scroll_x);}
141 void igSetScrollX(ImGuiWindow* window,float scroll_x){igSetScrollX_WindowPtr(window,scroll_x);}
142 void igSetScrollY(float scroll_y){igSetScrollY_Float(scroll_y);}
143 void igSetScrollY(ImGuiWindow* window,float scroll_y){igSetScrollY_WindowPtr(window,scroll_y);}
144 void igSetWindowCollapsed(bool collapsed,ImGuiCond cond){igSetWindowCollapsed_Bool(collapsed,cond);}
145 void igSetWindowCollapsed(const (char)* name,bool collapsed,ImGuiCond cond){igSetWindowCollapsed_Str(name,collapsed,cond);}
146 void igSetWindowCollapsed(ImGuiWindow* window,bool collapsed,ImGuiCond cond){igSetWindowCollapsed_WindowPtr(window,collapsed,cond);}
147 void igSetWindowFocus(){igSetWindowFocus_Nil();}
148 void igSetWindowFocus(const (char)* name){igSetWindowFocus_Str(name);}
149 void igSetWindowPos(const ImVec2 pos,ImGuiCond cond){igSetWindowPos_Vec2(pos,cond);}
150 void igSetWindowPos(const (char)* name,const ImVec2 pos,ImGuiCond cond){igSetWindowPos_Str(name,pos,cond);}
151 void igSetWindowPos(ImGuiWindow* window,const ImVec2 pos,ImGuiCond cond){igSetWindowPos_WindowPtr(window,pos,cond);}
152 void igSetWindowSize(const ImVec2 size,ImGuiCond cond){igSetWindowSize_Vec2(size,cond);}
153 void igSetWindowSize(const (char)* name,const ImVec2 size,ImGuiCond cond){igSetWindowSize_Str(name,size,cond);}
154 void igSetWindowSize(ImGuiWindow* window,const ImVec2 size,ImGuiCond cond){igSetWindowSize_WindowPtr(window,size,cond);}
155 void igTableGcCompactTransientBuffers(ImGuiTable* table){igTableGcCompactTransientBuffers_TablePtr(table);}
156 void igTableGcCompactTransientBuffers(ImGuiTableTempData* table){igTableGcCompactTransientBuffers_TableTempDataPtr(table);}
157 const (char*) igTableGetColumnName(int column_n){return igTableGetColumnName_Int(column_n);}
158 const (char*) igTableGetColumnName(const ImGuiTable* table,int column_n){return igTableGetColumnName_TablePtr(table,column_n);}
159 /**
160 *	bool igTreeNode(const (char)* label)
161 *	bool igTreeNode(const (char)* str_id,const (char)* fmt,...)
162 *	bool igTreeNode(const void* ptr_id,const (char)* fmt,...)
163 */
164 alias igTreeNode= overload!(igTreeNode_Str,igTreeNode_StrStr,igTreeNode_Ptr);
165 /**
166 *	bool igTreeNodeEx(const (char)* label,ImGuiTreeNodeFlags flags)
167 *	bool igTreeNodeEx(const (char)* str_id,ImGuiTreeNodeFlags flags,const (char)* fmt,...)
168 *	bool igTreeNodeEx(const void* ptr_id,ImGuiTreeNodeFlags flags,const (char)* fmt,...)
169 */
170 alias igTreeNodeEx= overload!(igTreeNodeEx_Str,igTreeNodeEx_StrStr,igTreeNodeEx_Ptr);
171 bool igTreeNodeExV(const (char)* str_id,ImGuiTreeNodeFlags flags,const (char)* fmt,va_list args){return igTreeNodeExV_Str(str_id,flags,fmt,args);}
172 bool igTreeNodeExV(const void* ptr_id,ImGuiTreeNodeFlags flags,const (char)* fmt,va_list args){return igTreeNodeExV_Ptr(ptr_id,flags,fmt,args);}
173 bool igTreeNodeV(const (char)* str_id,const (char)* fmt,va_list args){return igTreeNodeV_Str(str_id,fmt,args);}
174 bool igTreeNodeV(const void* ptr_id,const (char)* fmt,va_list args){return igTreeNodeV_Ptr(ptr_id,fmt,args);}
175 void igTreePush(const (char)* str_id){igTreePush_Str(str_id);}
176 void igTreePush(const void* ptr_id){igTreePush_Ptr(ptr_id);}
177 void igValue(const (char)* prefix,bool b){igValue_Bool(prefix,b);}
178 void igValue(const (char)* prefix,int v){igValue_Int(prefix,v);}
179 void igValue(const (char)* prefix,uint v){igValue_Uint(prefix,v);}
180 void igValue(const (char)* prefix,float v,const (char)* float_format){igValue_Float(prefix,v,float_format);}