Skip to content

Commit

Permalink
update hello_imgui
Browse files Browse the repository at this point in the history
  • Loading branch information
pthom committed Jan 15, 2024
1 parent 3e6ff2a commit 86e845b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 33 deletions.
38 changes: 18 additions & 20 deletions bindings/imgui_bundle/hello_imgui.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1011,9 +1011,10 @@ class AppWindowParams:

# @@md

# @@md#DefaultImGuiWindowType

class DefaultImGuiWindowType(enum.Enum):
"""@@md#DefaultImGuiWindowType
`DefaultImGuiWindowType` is an enum class that defines whether a full screen background
"""`DefaultImGuiWindowType` is an enum class that defines whether a full screen background
window is provided or not
"""

Expand Down Expand Up @@ -1206,10 +1207,10 @@ def empty_event_callback() -> AnyEventCallback:

# @@md

class MobileCallbacks:
"""@@md#MobileCallbacks
# @@md#MobileCallbacks

MobileCallbacks is a struct that contains callbacks that are called by the application
class MobileCallbacks:
"""MobileCallbacks is a struct that contains callbacks that are called by the application
when running under "Android, iOS and WinRT".
These events are specific to mobile and embedded devices that have different
requirements from your usual desktop application.
Expand Down Expand Up @@ -1317,10 +1318,10 @@ def edge_toolbar_type_name(e: EdgeToolbarType) -> str:

# @@md

class RunnerCallbacks:
"""@@md#RunnerCallbacks
# @@md#RunnerCallbacks

RunnerCallbacks is a struct that contains the callbacks
class RunnerCallbacks:
"""RunnerCallbacks is a struct that contains the callbacks
that are called by the application
"""
Expand Down Expand Up @@ -2106,11 +2107,10 @@ def ini_folder_location(ini_folder_type: IniFolderType) -> str:

# @@md

class FpsIdling:
"""@@md#FpsIdling
# @@md#FpsIdling

FpsIdling is a struct that contains Fps Idling parameters
"""
class FpsIdling:
"""FpsIdling is a struct that contains Fps Idling parameters"""

# float fpsIdle = 9.f; /* original C++ signature */
# `fpsIdle`: _float, default=9_.
Expand Down Expand Up @@ -2153,12 +2153,10 @@ class FpsIdling:

# @@md

class RunnerParams:
"""@@md#RunnerParams
RunnerParams contains the settings and callbacks needed to run an application.
# @@md#RunnerParams

"""
class RunnerParams:
"""RunnerParams contains the settings and callbacks needed to run an application."""

# --------------- Callbacks and Window params -------------------

Expand Down Expand Up @@ -2322,10 +2320,10 @@ def delete_ini_settings(runner_params: RunnerParams) -> None:

# @@md

class SimpleRunnerParams:
"""@@md#SimpleRunnerParams
# @@md#SimpleRunnerParams

SimpleRunnerParams is a struct that contains simpler params adapted for simple use cases.
class SimpleRunnerParams:
"""SimpleRunnerParams is a struct that contains simpler params adapted for simple use cases.
For example, this is sufficient to run an application:
```cpp
None MyGui() {
Expand Down
11 changes: 6 additions & 5 deletions external/hello_imgui/bindings/hello_imgui_amalgamation.h
Original file line number Diff line number Diff line change
Expand Up @@ -1723,6 +1723,7 @@ struct AppWindowParams
namespace HelloImGui
{
// @@md#DefaultImGuiWindowType

// `DefaultImGuiWindowType` is an enum class that defines whether a full screen background
// window is provided or not
enum class DefaultImGuiWindowType
Expand Down Expand Up @@ -1895,7 +1896,7 @@ inline AnyEventCallback EmptyEventCallback() {return {}; }


// @@md#MobileCallbacks
//

// MobileCallbacks is a struct that contains callbacks that are called by the application
// when running under "Android, iOS and WinRT".
// These events are specific to mobile and embedded devices that have different
Expand Down Expand Up @@ -1964,7 +1965,7 @@ std::string EdgeToolbarTypeName(EdgeToolbarType e);


// @@md#RunnerCallbacks
//

// RunnerCallbacks is a struct that contains the callbacks
// that are called by the application
//
Expand Down Expand Up @@ -2646,7 +2647,7 @@ std::string IniFolderLocation(IniFolderType iniFolderType);


// @@md#FpsIdling
//

// FpsIdling is a struct that contains Fps Idling parameters
struct FpsIdling
{
Expand Down Expand Up @@ -2679,7 +2680,7 @@ struct FpsIdling


// @@md#RunnerParams
//

// RunnerParams contains the settings and callbacks needed to run an application.
//
struct RunnerParams
Expand Down Expand Up @@ -2810,7 +2811,7 @@ void DeleteIniSettings(const RunnerParams& runnerParams);


// @@md#SimpleRunnerParams
//

// SimpleRunnerParams is a struct that contains simpler params adapted for simple use cases.
//For example, this is sufficient to run an application:
// ```cpp
Expand Down
12 changes: 6 additions & 6 deletions external/hello_imgui/bindings/pybind_hello_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ void py_init_module_hello_imgui(py::module& m)
;


py::enum_<HelloImGui::DefaultImGuiWindowType>(m, "DefaultImGuiWindowType", py::arithmetic(), " @@md#DefaultImGuiWindowType\n `DefaultImGuiWindowType` is an enum class that defines whether a full screen background\n window is provided or not")
py::enum_<HelloImGui::DefaultImGuiWindowType>(m, "DefaultImGuiWindowType", py::arithmetic(), " `DefaultImGuiWindowType` is an enum class that defines whether a full screen background\n window is provided or not")
.value("provide_full_screen_window", HelloImGui::DefaultImGuiWindowType::ProvideFullScreenWindow, "`ProvideFullScreenWindow`: a full window is provided in the background")
.value("provide_full_screen_dock_space", HelloImGui::DefaultImGuiWindowType::ProvideFullScreenDockSpace, "`ProvideFullScreenDockSpace`: a full screen dockspace is provided in the background")
.value("no_default_window", HelloImGui::DefaultImGuiWindowType::NoDefaultWindow, " `NoDefaultWindow`: No default window is provided\n (except for ImGui's default \"debug\" window)");
Expand Down Expand Up @@ -563,7 +563,7 @@ void py_init_module_hello_imgui(py::module& m)

auto pyClassMobileCallbacks =
py::class_<HelloImGui::MobileCallbacks>
(m, "MobileCallbacks", " @@md#MobileCallbacks\n\n MobileCallbacks is a struct that contains callbacks that are called by the application\n when running under \"Android, iOS and WinRT\".\n These events are specific to mobile and embedded devices that have different\n requirements from your usual desktop application.\n These events must be handled quickly, since often the OS needs an immediate response\n and will terminate your process shortly after sending the event\n if you do not handle them appropriately.\n On mobile devices, it is not possible to \"Quit\" an application,\n it can only be put on Pause.")
(m, "MobileCallbacks", " MobileCallbacks is a struct that contains callbacks that are called by the application\n when running under \"Android, iOS and WinRT\".\n These events are specific to mobile and embedded devices that have different\n requirements from your usual desktop application.\n These events must be handled quickly, since often the OS needs an immediate response\n and will terminate your process shortly after sending the event\n if you do not handle them appropriately.\n On mobile devices, it is not possible to \"Quit\" an application,\n it can only be put on Pause.")
.def(py::init<>([](
VoidFunction OnDestroy = HelloImGui::EmptyVoidFunction(), VoidFunction OnLowMemory = HelloImGui::EmptyVoidFunction(), VoidFunction OnPause = HelloImGui::EmptyVoidFunction(), VoidFunction OnResume = HelloImGui::EmptyVoidFunction())
{
Expand Down Expand Up @@ -637,7 +637,7 @@ void py_init_module_hello_imgui(py::module& m)

auto pyClassRunnerCallbacks =
py::class_<HelloImGui::RunnerCallbacks>
(m, "RunnerCallbacks", " @@md#RunnerCallbacks\n\n RunnerCallbacks is a struct that contains the callbacks\n that are called by the application\n")
(m, "RunnerCallbacks", " RunnerCallbacks is a struct that contains the callbacks\n that are called by the application\n")
.def(py::init<>([](
VoidFunction ShowGui = HelloImGui::EmptyVoidFunction(), VoidFunction ShowMenus = HelloImGui::EmptyVoidFunction(), VoidFunction ShowAppMenuItems = HelloImGui::EmptyVoidFunction(), VoidFunction ShowStatus = HelloImGui::EmptyVoidFunction(), VoidFunction PostInit_AddPlatformBackendCallbacks = HelloImGui::EmptyVoidFunction(), VoidFunction PostInit = HelloImGui::EmptyVoidFunction(), VoidFunction LoadAdditionalFonts = (VoidFunction)(ImGuiDefaultSettings::LoadDefaultFont_WithFontAwesomeIcons), VoidFunction SetupImGuiConfig = (VoidFunction)(ImGuiDefaultSettings::SetupDefaultImGuiConfig), VoidFunction SetupImGuiStyle = (VoidFunction)(ImGuiDefaultSettings::SetupDefaultImGuiStyle), VoidFunction RegisterTests = HelloImGui::EmptyVoidFunction(), VoidFunction BeforeExit = HelloImGui::EmptyVoidFunction(), VoidFunction BeforeExit_PostCleanup = HelloImGui::EmptyVoidFunction(), VoidFunction PreNewFrame = HelloImGui::EmptyVoidFunction(), VoidFunction BeforeImGuiRender = HelloImGui::EmptyVoidFunction(), VoidFunction AfterSwap = HelloImGui::EmptyVoidFunction(), VoidFunction CustomBackground = HelloImGui::EmptyVoidFunction(), AnyEventCallback AnyBackendEventCallback = HelloImGui::EmptyEventCallback())
{
Expand Down Expand Up @@ -837,7 +837,7 @@ void py_init_module_hello_imgui(py::module& m)

auto pyClassFpsIdling =
py::class_<HelloImGui::FpsIdling>
(m, "FpsIdling", " @@md#FpsIdling\n\n FpsIdling is a struct that contains Fps Idling parameters")
(m, "FpsIdling", "FpsIdling is a struct that contains Fps Idling parameters")
.def(py::init<>([](
float fpsIdle = 9.f, bool enableIdling = true, bool isIdling = false, bool rememberEnableIdling = false)
{
Expand All @@ -859,7 +859,7 @@ void py_init_module_hello_imgui(py::module& m)

auto pyClassRunnerParams =
py::class_<HelloImGui::RunnerParams>
(m, "RunnerParams", " @@md#RunnerParams\n\n RunnerParams contains the settings and callbacks needed to run an application.\n")
(m, "RunnerParams", " RunnerParams contains the settings and callbacks needed to run an application.\n")
.def(py::init<>([](
RunnerCallbacks callbacks = RunnerCallbacks(), AppWindowParams appWindowParams = AppWindowParams(), ImGuiWindowParams imGuiWindowParams = ImGuiWindowParams(), DockingParams dockingParams = DockingParams(), std::vector<DockingParams> alternativeDockingLayouts = std::vector<DockingParams>(), bool rememberSelectedAlternativeLayout = true, BackendPointers backendPointers = BackendPointers(), HelloImGui::BackendType backendType = HelloImGui::BackendType::FirstAvailable, RendererBackendOptions rendererBackendOptions = RendererBackendOptions(), HelloImGui::IniFolderType iniFolderType = HelloImGui::IniFolderType::CurrentFolder, std::string iniFilename = "", bool iniFilename_useAppWindowTitle = true, bool appShallExit = false, FpsIdling fpsIdling = FpsIdling(), bool useImGuiTestEngine = false, int emscripten_fps = 0)
{
Expand Down Expand Up @@ -921,7 +921,7 @@ void py_init_module_hello_imgui(py::module& m)

auto pyClassSimpleRunnerParams =
py::class_<HelloImGui::SimpleRunnerParams>
(m, "SimpleRunnerParams", " @@md#SimpleRunnerParams\n\n SimpleRunnerParams is a struct that contains simpler params adapted for simple use cases.\nFor example, this is sufficient to run an application:\n ```cpp\n None MyGui() {\n ImGui::Text(\"Hello, world\");\n if (ImGui::Button(\"Exit\"))\n HelloImGui::GetRunnerParams()->appShallExit = True;\n }\n\n int main(){\n auto params = HelloImGui::SimpleRunnerParams {\n .guiFunction = MyGui, .windowSizeAuto = True, .windowTitle = \"Example\"\n };\n HelloImGui::Run(params);\n }\n ```")
(m, "SimpleRunnerParams", " SimpleRunnerParams is a struct that contains simpler params adapted for simple use cases.\nFor example, this is sufficient to run an application:\n ```cpp\n None MyGui() {\n ImGui::Text(\"Hello, world\");\n if (ImGui::Button(\"Exit\"))\n HelloImGui::GetRunnerParams()->appShallExit = True;\n }\n\n int main(){\n auto params = HelloImGui::SimpleRunnerParams {\n .guiFunction = MyGui, .windowSizeAuto = True, .windowTitle = \"Example\"\n };\n HelloImGui::Run(params);\n }\n ```")
.def(py::init<>([](
VoidFunction guiFunction = HelloImGui::EmptyVoidFunction(), std::string windowTitle = "", bool windowSizeAuto = false, bool windowRestorePreviousGeometry = false, ScreenSize windowSize = HelloImGui::DefaultWindowSize, float fpsIdle = 9.f, bool enableIdling = true)
{
Expand Down
2 changes: 1 addition & 1 deletion external/imgui_md/imgui_md_wrapper/imgui_md_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#endif

#include "hello_imgui/hello_imgui.h"
#include "hello_imgui/image_gl_deprecated.h"
#include "hello_imgui/internal/image_gl_deprecated.h"
#include "immapp/snippets.h"

#include "imgui.h"
Expand Down

0 comments on commit 86e845b

Please sign in to comment.