Merge branch 'master' into navigation

This commit is contained in:
omar
2017-11-28 17:28:08 +01:00
6 changed files with 238 additions and 98 deletions

View File

@ -39,7 +39,7 @@ struct ImGuiGroupData;
struct ImGuiSimpleColumns;
struct ImGuiDrawContext;
struct ImGuiTextEditState;
struct ImGuiIniData;
struct ImGuiSettingsWindow;
struct ImGuiMouseCursorData;
struct ImGuiPopupRef;
struct ImGuiWindow;
@ -108,6 +108,7 @@ IMGUI_API int ImStricmp(const char* str1, const char* str2);
IMGUI_API int ImStrnicmp(const char* str1, const char* str2, int count);
IMGUI_API void ImStrncpy(char* dst, const char* src, int count);
IMGUI_API char* ImStrdup(const char* str);
IMGUI_API char* ImStrchrRange(const char* str_begin, const char* str_end, char c);
IMGUI_API int ImStrlenW(const ImWchar* str);
IMGUI_API const ImWchar*ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* buf_begin); // Find beginning-of-line
IMGUI_API const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end);
@ -389,13 +390,24 @@ struct IMGUI_API ImGuiTextEditState
};
// Data saved in imgui.ini file
struct ImGuiIniData
struct ImGuiSettingsWindow
{
char* Name;
ImGuiID Id;
ImVec2 Pos;
ImVec2 Size;
bool Collapsed;
ImGuiSettingsWindow() { Name = NULL; Id = 0; Pos = Size = ImVec2(0,0); Collapsed = false; }
};
struct ImGuiSettingsHandler
{
const char* TypeName; // Short description stored in .ini file. Disallowed characters: '[' ']'
ImGuiID TypeHash; // == ImHash(TypeName, 0, 0)
void* (*ReadOpenEntryFn)(ImGuiContext& ctx, const char* name);
void (*ReadLineFn)(ImGuiContext& ctx, void* entry, const char* line);
void (*WriteAllFn)(ImGuiContext& ctx, ImGuiTextBuffer* out_buf);
};
// Mouse cursor data (used when io.MouseDrawCursor is set)
@ -459,8 +471,6 @@ struct ImGuiContext
ImGuiInputSource ActiveIdSource; // Activating with mouse or nav (gamepad/keyboard)
ImGuiWindow* MovingWindow; // Track the child window we clicked on to move a window.
ImGuiID MovingWindowMoveId; // == MovingWindow->MoveId
ImVector<ImGuiIniData> Settings; // .ini Settings
float SettingsDirtyTimer; // Save .ini Settings on disk when time reaches zero
ImVector<ImGuiColMod> ColorModifiers; // Stack for PushStyleColor()/PopStyleColor()
ImVector<ImGuiStyleMod> StyleModifiers; // Stack for PushStyleVar()/PopStyleVar()
ImVector<ImFont*> FontStack; // Stack for PushFont()/PopFont()
@ -545,6 +555,11 @@ struct ImGuiContext
ImVector<char> PrivateClipboard; // If no custom clipboard handler is defined
ImVec2 OsImePosRequest, OsImePosSet; // Cursor position request & last passed to the OS Input Method Editor
// Settings
float SettingsDirtyTimer; // Save .ini Settings on disk when time reaches zero
ImVector<ImGuiSettingsWindow> SettingsWindows; // .ini settings for ImGuiWindow
ImVector<ImGuiSettingsHandler> SettingsHandlers; // List of .ini settings handlers
// Logging
bool LogEnabled;
FILE* LogFile; // If != NULL log to stdout/ file
@ -590,7 +605,6 @@ struct ImGuiContext
ActiveIdSource = ImGuiInputSource_None;
MovingWindow = NULL;
MovingWindowMoveId = 0;
SettingsDirtyTimer = 0.0f;
NavWindow = NULL;
NavId = NavActivateId = NavActivateDownId = NavInputId = 0;
@ -648,6 +662,8 @@ struct ImGuiContext
MouseCursor = ImGuiMouseCursor_Arrow;
memset(MouseCursorData, 0, sizeof(MouseCursorData));
SettingsDirtyTimer = 0.0f;
LogEnabled = false;
LogFile = NULL;
LogClipboard = NULL;
@ -887,6 +903,8 @@ namespace ImGui
IMGUI_API void Initialize();
IMGUI_API void MarkIniSettingsDirty();
IMGUI_API void SetActiveID(ImGuiID id, ImGuiWindow* window);
IMGUI_API ImGuiID GetActiveID();
IMGUI_API void SetFocusID(ImGuiID id, ImGuiWindow* window);