Skip to content

Commit

Permalink
Merge pull request #223 from gucio321/cimmarkdown
Browse files Browse the repository at this point in the history
add imgui_markdown integration
  • Loading branch information
gucio321 authored Sep 25, 2023
2 parents 675654f + de818c5 commit e415b69
Show file tree
Hide file tree
Showing 116 changed files with 9,069 additions and 2,963 deletions.
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ endef
cimnodes: setup
$(call cimnodes)

define cimmarkdown
$(call generate,cimmarkdown,cimgui/cimmarkdown.h,cimgui/cimmarkdown_templates/definitions.json,cimgui/cimmarkdown_templates/structs_and_enums.json,-r cimgui/cimgui_templates/structs_and_enums.json)
endef

## cimmarkdown: generate immarkdown binding
.PHONY: cimmarkdown
cimmarkdown: setup
$(call cimmarkdown)

compile_cimgui_macos:
rm -rf ./lib/build
cd ./lib; cmake -Bbuild -DCMAKE_BUILD_TYPE=Release -DIMGUI_STATIC=On -DCMAKE_OSX_ARCHITECTURES=arm64
Expand All @@ -62,7 +71,7 @@ compile_cimgui_macos:

## generate: generates both bindings (equal to `all`)
.PHONY: generate
generate: cimgui cimplot cimnodes
generate: cimgui cimplot cimnodes cimmarkdown

# update updates sub-repos (like cimplot or cimgui)
# $1 - subrepo directory
Expand All @@ -87,7 +96,6 @@ define update
mkdir cimgui/$1_templates
cp -f tmp/$1/generator/output/*json cimgui/$1_templates
mkdir -p cimgui/$3
cp -f tmp/$1/$3/*cpp cimgui/$3
cp -rf tmp/$1/$3/* cimgui/$3
cd tmp/$1; \
echo "$1 ($2) HEAD is on: `git rev-parse HEAD`" >> ../../cimgui/VERSION.txt
Expand All @@ -105,6 +113,8 @@ update: setup
$(call cimplot)
$(call update,cimnodes,https://github.com/cimgui/cimnodes,imnodes,master)
$(call cimnodes)
$(call update,cimmarkdown,https://github.com/gucio321/cimmarkdown,imgui_markdown,main)
$(call cimmarkdown)
for i in `find cimgui -type f \( -name "*.h" -o -name "*.cpp" \) -exec dirname {} \; | sort -u`; do \
cp templates/dummy.go.template $$i/dummy.go; \
done
8 changes: 5 additions & 3 deletions cimgui/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cimgui (https://github.com/cimgui/cimgui) HEAD is on: a21e28e74027796d983f8c8d4a639a4e304251f2
cimgui/imgui HEAD is on: 300464a4878c8ba659807c4d78d95e1357af87b1
cimplot (https://github.com/cimgui/cimplot) HEAD is on: 43025ba64dcccd20df60557931448ee05d2736a6
cimgui (https://github.com/cimgui/cimgui) HEAD is on: 4ca6b29166fae53f0f7dd5c89f1c673aa085ff89
cimgui/imgui HEAD is on: c418685315d0951c26e5dbcefcabe18be9b7f0d1
cimplot (https://github.com/cimgui/cimplot) HEAD is on: 82d498a5bf0d945b1db21c80ba3ce69350930022
cimplot/implot HEAD is on: 7b9171569bfe846aa1049a70bc599ad44ef0e5c1
cimnodes (https://github.com/cimgui/cimnodes) HEAD is on: 987e75fef847e53ffdd627c4a0dcdcdaa1d3760d
cimnodes/imnodes HEAD is on: 4f6ddd604558288bcc435398a177015dae923600
cimmarkdown (https://github.com/gucio321/cimmarkdown) HEAD is on: c418b67e4893b690816c2d7b6ad05f104beb14e8
cimmarkdown/imgui_markdown HEAD is on: 49bb387f99bd9df295e97be9aff9048de3bfc226
110 changes: 89 additions & 21 deletions cimgui/cimgui.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//This file is automatically generated by generator.lua from https://github.com/cimgui/cimgui
//based on imgui.h file version "1.89.9 WIP" 18983 from Dear ImGui https://github.com/ocornut/imgui
//based on imgui.h file version "1.90 WIP" 18992 from Dear ImGui https://github.com/ocornut/imgui
//with imgui_internal.h api
//docking branch
#ifdef IMGUI_ENABLE_FREETYPE
Expand Down Expand Up @@ -694,9 +694,9 @@ CIMGUI_API bool igCombo_Str(const char* label,int* current_item,const char* item
{
return ImGui::Combo(label,current_item,items_separated_by_zeros,popup_max_height_in_items);
}
CIMGUI_API bool igCombo_FnBoolPtr(const char* label,int* current_item,bool(*items_getter)(void* data,int idx,const char** out_text),void* data,int items_count,int popup_max_height_in_items)
CIMGUI_API bool igCombo_FnStrPtr(const char* label,int* current_item,const char*(*getter)(void* user_data,int idx),void* user_data,int items_count,int popup_max_height_in_items)
{
return ImGui::Combo(label,current_item,items_getter,data,items_count,popup_max_height_in_items);
return ImGui::Combo(label,current_item,getter,user_data,items_count,popup_max_height_in_items);
}
CIMGUI_API bool igDragFloat(const char* label,float* v,float v_speed,float v_min,float v_max,const char* format,ImGuiSliderFlags flags)
{
Expand Down Expand Up @@ -986,9 +986,9 @@ CIMGUI_API bool igListBox_Str_arr(const char* label,int* current_item,const char
{
return ImGui::ListBox(label,current_item,items,items_count,height_in_items);
}
CIMGUI_API bool igListBox_FnBoolPtr(const char* label,int* current_item,bool(*items_getter)(void* data,int idx,const char** out_text),void* data,int items_count,int height_in_items)
CIMGUI_API bool igListBox_FnStrPtr(const char* label,int* current_item,const char*(*getter)(void* user_data,int idx),void* user_data,int items_count,int height_in_items)
{
return ImGui::ListBox(label,current_item,items_getter,data,items_count,height_in_items);
return ImGui::ListBox(label,current_item,getter,user_data,items_count,height_in_items);
}
CIMGUI_API void igPlotLines_FloatPtr(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)
{
Expand Down Expand Up @@ -2020,9 +2020,13 @@ CIMGUI_API bool ImGuiListClipper_Step(ImGuiListClipper* self)
{
return self->Step();
}
CIMGUI_API void ImGuiListClipper_IncludeRangeByIndices(ImGuiListClipper* self,int item_begin,int item_end)
CIMGUI_API void ImGuiListClipper_IncludeItemByIndex(ImGuiListClipper* self,int item_index)
{
return self->IncludeRangeByIndices(item_begin,item_end);
return self->IncludeItemByIndex(item_index);
}
CIMGUI_API void ImGuiListClipper_IncludeItemsByIndex(ImGuiListClipper* self,int item_begin,int item_end)
{
return self->IncludeItemsByIndex(item_begin,item_end);
}
CIMGUI_API ImColor* ImColor_ImColor_Nil(void)
{
Expand Down Expand Up @@ -2180,6 +2184,14 @@ CIMGUI_API void ImDrawList_AddNgonFilled(ImDrawList* self,const ImVec2 center,fl
{
return self->AddNgonFilled(center,radius,col,num_segments);
}
CIMGUI_API void ImDrawList_AddEllipse(ImDrawList* self,const ImVec2 center,float radius_x,float radius_y,ImU32 col,float rot,int num_segments,float thickness)
{
return self->AddEllipse(center,radius_x,radius_y,col,rot,num_segments,thickness);
}
CIMGUI_API void ImDrawList_AddEllipseFilled(ImDrawList* self,const ImVec2 center,float radius_x,float radius_y,ImU32 col,float rot,int num_segments)
{
return self->AddEllipseFilled(center,radius_x,radius_y,col,rot,num_segments);
}
CIMGUI_API void ImDrawList_AddText_Vec2(ImDrawList* self,const ImVec2 pos,ImU32 col,const char* text_begin,const char* text_end)
{
return self->AddText(pos,col,text_begin,text_end);
Expand Down Expand Up @@ -2244,6 +2256,10 @@ CIMGUI_API void ImDrawList_PathArcToFast(ImDrawList* self,const ImVec2 center,fl
{
return self->PathArcToFast(center,radius,a_min_of_12,a_max_of_12);
}
CIMGUI_API void ImDrawList_PathEllipticalArcTo(ImDrawList* self,const ImVec2 center,float radius_x,float radius_y,float rot,float a_min,float a_max,int num_segments)
{
return self->PathEllipticalArcTo(center,radius_x,radius_y,rot,a_min,a_max,num_segments);
}
CIMGUI_API void ImDrawList_PathBezierCubicCurveTo(ImDrawList* self,const ImVec2 p2,const ImVec2 p3,const ImVec2 p4,int num_segments)
{
return self->PathBezierCubicCurveTo(p2,p3,p4,num_segments);
Expand Down Expand Up @@ -2452,13 +2468,13 @@ CIMGUI_API ImFont* ImFontAtlas_AddFontFromFileTTF(ImFontAtlas* self,const char*
{
return self->AddFontFromFileTTF(filename,size_pixels,font_cfg,glyph_ranges);
}
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryTTF(ImFontAtlas* self,void* font_data,int font_size,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges)
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryTTF(ImFontAtlas* self,void* font_data,int font_data_size,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges)
{
return self->AddFontFromMemoryTTF(font_data,font_size,size_pixels,font_cfg,glyph_ranges);
return self->AddFontFromMemoryTTF(font_data,font_data_size,size_pixels,font_cfg,glyph_ranges);
}
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedTTF(ImFontAtlas* self,const void* compressed_font_data,int compressed_font_size,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges)
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedTTF(ImFontAtlas* self,const void* compressed_font_data,int compressed_font_data_size,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges)
{
return self->AddFontFromMemoryCompressedTTF(compressed_font_data,compressed_font_size,size_pixels,font_cfg,glyph_ranges);
return self->AddFontFromMemoryCompressedTTF(compressed_font_data,compressed_font_data_size,size_pixels,font_cfg,glyph_ranges);
}
CIMGUI_API ImFont* ImFontAtlas_AddFontFromMemoryCompressedBase85TTF(ImFontAtlas* self,const char* compressed_font_data_base85,float size_pixels,const ImFontConfig* font_cfg,const ImWchar* glyph_ranges)
{
Expand Down Expand Up @@ -2724,18 +2740,10 @@ CIMGUI_API const char* igImStrchrRange(const char* str_begin,const char* str_end
{
return ImStrchrRange(str_begin,str_end,c);
}
CIMGUI_API int igImStrlenW(const ImWchar* str)
{
return ImStrlenW(str);
}
CIMGUI_API const char* igImStreolRange(const char* str,const char* str_end)
{
return ImStreolRange(str,str_end);
}
CIMGUI_API const ImWchar* igImStrbolW(const ImWchar* buf_mid_line,const ImWchar* buf_begin)
{
return ImStrbolW(buf_mid_line,buf_begin);
}
CIMGUI_API const char* igImStristr(const char* haystack,const char* haystack_end,const char* needle,const char* needle_end)
{
return ImStristr(haystack,haystack_end,needle,needle_end);
Expand All @@ -2748,6 +2756,14 @@ CIMGUI_API const char* igImStrSkipBlank(const char* str)
{
return ImStrSkipBlank(str);
}
CIMGUI_API int igImStrlenW(const ImWchar* str)
{
return ImStrlenW(str);
}
CIMGUI_API const ImWchar* igImStrbolW(const ImWchar* buf_mid_line,const ImWchar* buf_begin)
{
return ImStrbolW(buf_mid_line,buf_begin);
}
CIMGUI_API char igImToUpper(char c)
{
return ImToUpper(c);
Expand Down Expand Up @@ -2835,6 +2851,10 @@ CIMGUI_API int igImTextCountUtf8BytesFromStr(const ImWchar* in_text,const ImWcha
{
return ImTextCountUtf8BytesFromStr(in_text,in_text_end);
}
CIMGUI_API const char* igImTextFindPreviousUtf8Codepoint(const char* in_text_start,const char* in_text_curr)
{
return ImTextFindPreviousUtf8Codepoint(in_text_start,in_text_curr);
}
CIMGUI_API ImFileHandle igImFileOpen(const char* filename,const char* mode)
{
return ImFileOpen(filename,mode);
Expand Down Expand Up @@ -3507,6 +3527,18 @@ CIMGUI_API void ImGuiNavItemData_Clear(ImGuiNavItemData* self)
{
return self->Clear();
}
CIMGUI_API ImGuiTypingSelectState* ImGuiTypingSelectState_ImGuiTypingSelectState(void)
{
return IM_NEW(ImGuiTypingSelectState)();
}
CIMGUI_API void ImGuiTypingSelectState_destroy(ImGuiTypingSelectState* self)
{
IM_DELETE(self);
}
CIMGUI_API void ImGuiTypingSelectState_Clear(ImGuiTypingSelectState* self)
{
return self->Clear();
}
CIMGUI_API ImGuiOldColumnData* ImGuiOldColumnData_ImGuiOldColumnData(void)
{
return IM_NEW(ImGuiOldColumnData)();
Expand Down Expand Up @@ -4323,6 +4355,10 @@ CIMGUI_API void igNavClearPreferredPosForAxis(ImGuiAxis axis)
{
return ImGui::NavClearPreferredPosForAxis(axis);
}
CIMGUI_API void igNavRestoreHighlightAfterMove()
{
return ImGui::NavRestoreHighlightAfterMove();
}
CIMGUI_API void igNavUpdateCurrentWindowIsScrollPushableX()
{
return ImGui::NavUpdateCurrentWindowIsScrollPushableX();
Expand Down Expand Up @@ -4415,6 +4451,10 @@ CIMGUI_API void igGetTypematicRepeatRate(ImGuiInputFlags flags,float* repeat_del
{
return ImGui::GetTypematicRepeatRate(flags,repeat_delay,repeat_rate);
}
CIMGUI_API void igTeleportMousePos(const ImVec2 pos)
{
return ImGui::TeleportMousePos(pos);
}
CIMGUI_API void igSetActiveIdUsingAllKeyboardKeys()
{
return ImGui::SetActiveIdUsingAllKeyboardKeys();
Expand Down Expand Up @@ -4687,6 +4727,22 @@ CIMGUI_API void igRenderDragDropTargetRect(const ImRect bb)
{
return ImGui::RenderDragDropTargetRect(bb);
}
CIMGUI_API ImGuiTypingSelectRequest* igGetTypingSelectRequest(ImGuiTypingSelectFlags flags)
{
return ImGui::GetTypingSelectRequest(flags);
}
CIMGUI_API int igTypingSelectFindMatch(ImGuiTypingSelectRequest* req,int items_count,const char*(*get_item_name_func)(void*,int),void* user_data,int nav_item_idx)
{
return ImGui::TypingSelectFindMatch(req,items_count,get_item_name_func,user_data,nav_item_idx);
}
CIMGUI_API int igTypingSelectFindNextSingleCharMatch(ImGuiTypingSelectRequest* req,int items_count,const char*(*get_item_name_func)(void*,int),void* user_data,int nav_item_idx)
{
return ImGui::TypingSelectFindNextSingleCharMatch(req,items_count,get_item_name_func,user_data,nav_item_idx);
}
CIMGUI_API int igTypingSelectFindBestLeadingMatch(ImGuiTypingSelectRequest* req,int items_count,const char*(*get_item_name_func)(void*,int),void* user_data)
{
return ImGui::TypingSelectFindBestLeadingMatch(req,items_count,get_item_name_func,user_data);
}
CIMGUI_API void igSetWindowClipRectBeforeSetChannel(ImGuiWindow* window,const ImRect clip_rect)
{
return ImGui::SetWindowClipRectBeforeSetChannel(window,clip_rect);
Expand Down Expand Up @@ -4927,9 +4983,9 @@ CIMGUI_API ImGuiTabBar* igGetCurrentTabBar()
{
return ImGui::GetCurrentTabBar();
}
CIMGUI_API bool igBeginTabBarEx(ImGuiTabBar* tab_bar,const ImRect bb,ImGuiTabBarFlags flags,ImGuiDockNode* dock_node)
CIMGUI_API bool igBeginTabBarEx(ImGuiTabBar* tab_bar,const ImRect bb,ImGuiTabBarFlags flags)
{
return ImGui::BeginTabBarEx(tab_bar,bb,flags,dock_node);
return ImGui::BeginTabBarEx(tab_bar,bb,flags);
}
CIMGUI_API ImGuiTabItem* igTabBarFindTabByID(ImGuiTabBar* tab_bar,ImGuiID tab_id)
{
Expand Down Expand Up @@ -5175,6 +5231,10 @@ CIMGUI_API bool igTreeNodeUpdateNextOpen(ImGuiID id,ImGuiTreeNodeFlags flags)
{
return ImGui::TreeNodeUpdateNextOpen(id,flags);
}
CIMGUI_API void igSetNextItemSelectionUserData(ImGuiSelectionUserData selection_user_data)
{
return ImGui::SetNextItemSelectionUserData(selection_user_data);
}
CIMGUI_API const ImGuiDataTypeInfo* igDataTypeGetInfo(ImGuiDataType data_type)
{
return ImGui::DataTypeGetInfo(data_type);
Expand Down Expand Up @@ -5362,6 +5422,10 @@ CIMGUI_API void igDebugNodeInputTextState(ImGuiInputTextState* state)
{
return ImGui::DebugNodeInputTextState(state);
}
CIMGUI_API void igDebugNodeTypingSelectState(ImGuiTypingSelectState* state)
{
return ImGui::DebugNodeTypingSelectState(state);
}
CIMGUI_API void igDebugNodeWindow(ImGuiWindow* window,const char* label)
{
return ImGui::DebugNodeWindow(window,label);
Expand Down Expand Up @@ -5398,6 +5462,10 @@ CIMGUI_API const ImFontBuilderIO* igImFontAtlasGetBuilderForStbTruetype()
{
return ImFontAtlasGetBuilderForStbTruetype();
}
CIMGUI_API void igImFontAtlasUpdateConfigDataPointers(ImFontAtlas* atlas)
{
return ImFontAtlasUpdateConfigDataPointers(atlas);
}
CIMGUI_API void igImFontAtlasBuildInit(ImFontAtlas* atlas)
{
return ImFontAtlasBuildInit(atlas);
Expand Down
Loading

0 comments on commit e415b69

Please sign in to comment.