Skip to content

Commit

Permalink
Regenerate hello_imgui bindings (just comments)
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Jan 30, 2024
1 parent 72b8992 commit 2e37e66
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 10 deletions.
42 changes: 34 additions & 8 deletions bindings/imgui_bundle/hello_imgui.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,8 @@ def log_gui(size: ImVec2 = ImVec2(0.0, 0.0)) -> None:
pass

# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# hello_imgui/icons_font_awesome.h included by hello_imgui.h //
# hello_imgui.h continued //
# //////////////////////////////////////////////////////////////////////////////////////////////////////////////
# Generated by https://github.com/juliettef/IconFontCppHeaders script
# GenerateIconFontCppHeaders.py for language C89 from
# https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/metadata/icons.yml
# for use with
# https://github.com/FortAwesome/Font-Awesome/blob/master/webfonts/fa-solid-900.ttf,
# https://github.com/FortAwesome/Font-Awesome/blob/master/webfonts/fa-regular-400.ttf,

# ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
# hello_imgui/image_from_asset.h included by hello_imgui.h //
Expand Down Expand Up @@ -591,6 +585,7 @@ class FontLoadingParams:

# if True, the font will be loaded and then FontAwesome icons will be merged to it
# (deprecated, use mergeToLastFont instead, and load in two steps)
# This will use an old version of FontAwesome (FontAwesome 4)
# bool mergeFontAwesome = false; /* original C++ signature */
merge_font_awesome: bool = False
# ImFontConfig fontConfigFontAwesome = ImFontConfig(); /* original C++ signature */
Expand Down Expand Up @@ -621,6 +616,36 @@ def load_font(
) -> ImFont:
pass

# Note: if you want to use a more recent version of Font Awesome,
# ===============================================================
# see example at src/hello_imgui_demos/hello_imgui_demo_fontawesome6
#
# The principle is summarized below:
# - Download Font_Awesome_6_Free-Solid-900.otf from https://fontawesome.com/download
# - Download IconsFontAwesome6.h from https://raw.githubusercontent.com/juliettef/IconFontCppHeaders/main/IconsFontAwesome6.h
#
# Code:
#
# // Prevent HelloImGui from loading Font Awesome 4 definitions, since we will load FontAwesome 6
# #define HELLOIMGUI_NO_FONT_AWESOME4
# #include "hello_imgui/hello_imgui.h"
# #include "IconsFontAwesome6.h"
#
# ...
#
# // Load the default font + merge it with Font Awesome 6
# HelloImGui::RunnerParams runnerParams;
# runnerParams.callbacks.LoadAdditionalFonts = []
# {
# // Load the default font
# HelloImGui::LoadFont("fonts/DroidSans.ttf", 15.0);
#
# // Merge FontAwesome6 with the default font
# HelloImGui::FontLoadingParams fontParams;
# fontParams.mergeToLastFont = True;
# fontParams.useFullGlyphRange = True;
# HelloImGui::LoadFont("fonts/Font_Awesome_6_Free-Solid-900.otf", 15.0, fontParams);
# };
# @@md

#
Expand Down Expand Up @@ -1145,7 +1170,8 @@ class ImGuiWindowParams:

# ImVec4 backgroundColor = ImVec4(0.f, 0.f, 0.f, 0.f); /* original C++ signature */
# backgroundColor:
# This is the "clearColor", visible if defaultImGuiWindowType!=ProvideFullScreenWindow.
# This is the "clearColor", i.e. the app window background color, is visible *only if*
# runnerParams.imGuiWindowParams.defaultImGuiWindowType = NoDefaultWindow
# Alternatively, you can set your own RunnerCallbacks.CustomBackground to have full
# control over what is drawn behind the Gui.
background_color: ImVec4 = ImVec4(0.0, 0.0, 0.0, 0.0)
Expand Down
46 changes: 45 additions & 1 deletion external/hello_imgui/bindings/hello_imgui_amalgamation.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,12 @@ namespace HelloImGui
void LogGui(ImVec2 size=ImVec2(0.f, 0.f));
}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// hello_imgui.h continued //
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef HELLOIMGUI_NO_FONT_AWESOME4

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// hello_imgui/icons_font_awesome.h included by hello_imgui.h //
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1192,6 +1198,12 @@ namespace HelloImGui
#define ICON_FA_CHEVRON_UP "\xEF\x81\xB7"
#define ICON_FA_HAND_SPOCK "\xEF\x89\x99"
#define ICON_FA_HAND_POINT_UP "\xEF\x82\xA6"
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// hello_imgui.h continued //
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#endif

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// hello_imgui/image_from_asset.h included by hello_imgui.h //
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1405,6 +1417,7 @@ namespace HelloImGui

// if true, the font will be loaded and then FontAwesome icons will be merged to it
// (deprecated, use mergeToLastFont instead, and load in two steps)
// This will use an old version of FontAwesome (FontAwesome 4)
bool mergeFontAwesome = false;
ImFontConfig fontConfigFontAwesome = ImFontConfig();
};
Expand All @@ -1419,6 +1432,36 @@ namespace HelloImGui
const FontLoadingParams & params = {});


// Note: if you want to use a more recent version of Font Awesome,
// ===============================================================
// see example at src/hello_imgui_demos/hello_imgui_demo_fontawesome6
//
// The principle is summarized below:
// - Download Font_Awesome_6_Free-Solid-900.otf from https://fontawesome.com/download
// - Download IconsFontAwesome6.h from https://raw.githubusercontent.com/juliettef/IconFontCppHeaders/main/IconsFontAwesome6.h
//
// Code:
//
// // Prevent HelloImGui from loading Font Awesome 4 definitions, since we will load FontAwesome 6
// #define HELLOIMGUI_NO_FONT_AWESOME4
// #include "hello_imgui/hello_imgui.h"
// #include "IconsFontAwesome6.h"
//
// ...
//
// // Load the default font + merge it with Font Awesome 6
// HelloImGui::RunnerParams runnerParams;
// runnerParams.callbacks.LoadAdditionalFonts = []
// {
// // Load the default font
// HelloImGui::LoadFont("fonts/DroidSans.ttf", 15.0f);
//
// // Merge FontAwesome6 with the default font
// HelloImGui::FontLoadingParams fontParams;
// fontParams.mergeToLastFont = true;
// fontParams.useFullGlyphRange = true;
// HelloImGui::LoadFont("fonts/Font_Awesome_6_Free-Solid-900.otf", 15.0f, fontParams);
// };
// @@md


Expand Down Expand Up @@ -1835,7 +1878,8 @@ struct ImGuiWindowParams
ImGuiTheme::ImGuiTweakedTheme tweakedTheme;

// backgroundColor:
// This is the "clearColor", visible if defaultImGuiWindowType!=ProvideFullScreenWindow.
// This is the "clearColor", i.e. the app window background color, is visible *only if*
// runnerParams.imGuiWindowParams.defaultImGuiWindowType = NoDefaultWindow
// Alternatively, you can set your own RunnerCallbacks.CustomBackground to have full
// control over what is drawn behind the Gui.
ImVec4 backgroundColor = ImVec4(0.f, 0.f, 0.f, 0.f);
Expand Down
2 changes: 1 addition & 1 deletion external/hello_imgui/bindings/pybind_hello_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ void py_init_module_hello_imgui(py::module& m)
.def_readwrite("full_screen_window_margin_top_left", &HelloImGui::ImGuiWindowParams::fullScreenWindow_MarginTopLeft, "")
.def_readwrite("full_screen_window_margin_bottom_right", &HelloImGui::ImGuiWindowParams::fullScreenWindow_MarginBottomRight, "")
.def_readwrite("tweaked_theme", &HelloImGui::ImGuiWindowParams::tweakedTheme, " tweakedTheme: (enum ImGuiTheme::ImGuiTweakedTheme)\n Changes the ImGui theme. Several themes are available, you can query the list\n by calling HelloImGui::AvailableThemes()")
.def_readwrite("background_color", &HelloImGui::ImGuiWindowParams::backgroundColor, " backgroundColor:\n This is the \"clearColor\", visible if defaultImGuiWindowType!=ProvideFullScreenWindow.\n Alternatively, you can set your own RunnerCallbacks.CustomBackground to have full\n control over what is drawn behind the Gui.")
.def_readwrite("background_color", &HelloImGui::ImGuiWindowParams::backgroundColor, " backgroundColor:\n This is the \"clearColor\", i.e. the app window background color, is visible *only if*\n runnerParams.imGuiWindowParams.defaultImGuiWindowType = NoDefaultWindow\n Alternatively, you can set your own RunnerCallbacks.CustomBackground to have full\n control over what is drawn behind the Gui.")
;


Expand Down

0 comments on commit 2e37e66

Please sign in to comment.