Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
imguistyleserializer.h
Go to the documentation of this file.
1#ifndef IMGUISTYLESERIALIZER_H_
2#define IMGUISTYLESERIALIZER_H_
3
4#ifndef IMGUI_API
5#include <imgui.h>
6#endif //IMGUI_API
7
12
13 ImGuiStyle_Gray, // (mine) This is the default theme of my main.cpp demo.
15 ImGuiStyle_BlackCodz01, // Posted by @codz01 here: https://github.com/ocornut/imgui/issues/707 (hope I can use it)
16 ImGuiStyle_DarkCodz01, // Posted by @codz01 here: https://github.com/ocornut/imgui/issues/707 (hope I can use it)
17 ImGuiStyle_GrayCodz01, // Posted by @codz01 here: https://github.com/ocornut/imgui/issues/1607 (hope I can use it)
18 ImGuiStyle_Purple, // Posted by @fallrisk here: https://github.com/ocornut/imgui/issues/1607 (hope I can use it)
19 ImGuiStyle_Cherry, // Posted by @r-lyeh here: https://github.com/ocornut/imgui/issues/707 (hope I can use it)
21 ImGuiStyle_Soft, // Posted by @olekristensen here: https://github.com/ocornut/imgui/issues/539 (hope I can use it)
22 ImGuiStyle_EdinBlack, // Posted (via image) by edin_p in the screenshot section of Dear ImGui
23 ImGuiStyle_EdinWhite, // Posted (via image) by edin_p in the screenshot section of Dear ImGui
24 ImGuiStyle_Maya, // Posted by @ongamex here https://gist.github.com/ongamex/4ee36fb23d6c527939d0f4ba72144d29
25 ImGuiStyle_LightGreen, // Posted by @ebachard here: https://github.com/ocornut/imgui/pull/1776 (hope I can use it)
26 ImGuiStyle_Design, // Posted by @usernameiwantedwasalreadytaken here: https://github.com/ocornut/imgui/issues/707 (hope I can use it)
27 ImGuiStyle_Dracula, // Posted by @ice1000 here: https://github.com/ocornut/imgui/issues/707 (hope I can use it)
28 ImGuiStyle_Greenish, // Posted by @dertseha here: https://github.com/ocornut/imgui/issues/1902 (hope I can use it)
29 ImGuiStyle_C64, // Posted by @Nullious here: https://gist.github.com/Nullious/2d598963b346c49fa4500ca16b8e5c67 (hope I can use it)
30 ImGuiStyle_PhotoStore, // Posted by @Derydoca here: https://github.com/ocornut/imgui/issues/707 (hope I can use it)
31 ImGuiStyle_CorporateGreyFlat, // Posted by @malamanteau here: https://github.com/ocornut/imgui/issues/707 (hope I can use it)
32 ImGuiStyle_CorporateGreyFramed, // Posted by @malamanteau here: https://github.com/ocornut/imgui/issues/707 (hope I can use it)
33 ImGuiStyle_VisualDark, // Posted by @mnurzia here: https://github.com/ocornut/imgui/issues/2529 (hope I can use it)
34 ImGuiStyle_SteamingLife, // Posted by @metasprite here: https://github.com/ocornut/imgui/issues/707 (hope I can use it)
35 ImGuiStyle_SoftLife, // Just a quick variation of the ImGuiStyle_SteamingLife style
36 ImGuiStyle_GoldenBlack, // Posted by @CookiePLMonster here: https://github.com/ocornut/imgui/issues/707 (hope I can use it)
37 ImGuiStyle_Windowed, // Badly adapted from the Win98-DearImgui customization made by @JakeCoxon in his fork here https://github.com/JakeCoxon/imgui-win98 (hope I can use it)
38 ImGuiStyle_OverShiftedBlack, // Posted by @OverShifted here: https://github.com/ocornut/imgui/issues/707 (hope I can use it)
39
45
47};
48
49namespace ImGui {
50// Warning: this file does not depend on imguihelper (so it's easier to reuse it in stand alone projects).
51// The drawback is that it's not possible to serialize/deserialize a style together with other stuff (for example 2 styles together) into/from a single file.
52// And it's not possible to serialize/deserialize a style into/from a memory buffer too.
53#ifndef NO_IMGUISTYLESERIALIZER_SAVESTYLE
54IMGUI_API bool SaveStyle(const char* filename,const ImGuiStyle& style=ImGui::GetStyle());
55#endif //NO_IMGUISTYLESERIALIZER_SAVESTYLE
56#ifndef NO_IMGUISTYLESERIALIZER_LOADSTYLE
57IMGUI_API bool LoadStyle(const char* filename,ImGuiStyle& style=ImGui::GetStyle());
58#endif //NO_IMGUISTYLESERIALIZER_LOADSTYLE
59IMGUI_API bool ResetStyle(int styleEnum, ImGuiStyle& style=ImGui::GetStyle());
60IMGUI_API const char** GetDefaultStyleNames(); // ImGuiStyle_Count names re returned
61
62// satThresholdForInvertingLuminance: in [0,1] if == 0.f luminance is not inverted at all
63// shiftHue: in [0,1] if == 0.f hue is not changed at all
64IMGUI_API void ChangeStyleColors(ImGuiStyle& style,float satThresholdForInvertingLuminance=.1f,float shiftHue=0.f);
65
66// Handy wrapper to a combo to select the style:
67IMGUI_API bool SelectStyleCombo(const char* label,int* selectedIndex,int maxNumItemsToDisplay=ImGuiStyle_Count,ImGuiStyle* styleToChange=NULL);
68
69} // namespace ImGui
70
71#endif //IMGUISTYLESERIALIZER_H_
72
ImGuiStyleEnum
@ ImGuiStyle_EdinBlack
@ ImGuiStyle_DarkOpaque
@ ImGuiStyle_Greenish
@ ImGuiStyle_C64
@ ImGuiStyle_DesignInverse
@ ImGuiStyle_DefaultLight
@ ImGuiStyle_GrayCodz01
@ ImGuiStyle_Light
@ ImGuiStyle_Purple
@ ImGuiStyle_SoftLife
@ ImGuiStyle_Design
@ ImGuiStyle_PhotoStore
@ ImGuiStyle_Maya
@ ImGuiStyle_OverShiftedBlack
@ ImGuiStyle_DefaultClassic
@ ImGuiStyle_PurpleInverse
@ ImGuiStyle_Cherry
@ ImGuiStyle_LightGreen
@ ImGuiStyle_Gray
@ ImGuiStyle_BlackCodz01
@ ImGuiStyle_Soft
@ ImGuiStyle_CorporateGreyFlat
@ ImGuiStyle_EdinWhite
@ ImGuiStyle_Count
@ ImGuiStyle_GoldenBlack
@ ImGuiStyle_DarkOpaqueInverse
@ ImGuiStyle_DarkCodz01
@ ImGuiStyle_Windowed
@ ImGuiStyle_LightGreenInverse
@ ImGuiStyle_VisualDark
@ ImGuiStyle_Dracula
@ ImGuiStyle_GrayCodz01Inverse
@ ImGuiStyle_SteamingLife
@ ImGuiStyle_DefaultDark
@ ImGuiStyle_CorporateGreyFramed
void ChangeStyleColors(ImGuiStyle &style, float satThresholdForInvertingLuminance, float shiftHue)
bool SelectStyleCombo(const char *label, int *selectedIndex, int maxNumItemsToDisplay, ImGuiStyle *styleToChange)
bool ResetStyle(int styleEnum, ImGuiStyle &style)
const char ** GetDefaultStyleNames()
bool SaveStyle(const char *filename, const ImGuiStyle &style)
bool LoadStyle(const char *filename, ImGuiStyle &style)