From 849c72c5c34d53fb67147c8dc8e8568d6273e907 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 8 Mar 2015 11:32:39 +0000 Subject: [PATCH] Forward declare struct in imgui.cpp. Removed two forward declarations leaking in imgui.h --- imgui.cpp | 11 +++++++++-- imgui.h | 21 ++++++++++----------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 63882a24..5dec5d56 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -392,8 +392,8 @@ namespace IMGUI_STB_NAMESPACE #endif #include "stb_truetype.h" -#define STB_TEXTEDIT_STRING ImGuiTextEditState -#define STB_TEXTEDIT_CHARTYPE ImWchar +#define STB_TEXTEDIT_STRING ImGuiTextEditState +#define STB_TEXTEDIT_CHARTYPE ImWchar #include "stb_textedit.h" #ifdef __clang__ @@ -409,7 +409,14 @@ using namespace IMGUI_STB_NAMESPACE; // Forward Declarations //------------------------------------------------------------------------- +struct ImGuiColMod; +struct ImGuiStyleMod; struct ImGuiAabb; +struct ImGuiDrawContext; +struct ImGuiTextEditState; +struct ImGuiIniData; +struct ImGuiState; +struct ImGuiWindow; static bool ButtonBehaviour(const ImGuiAabb& bb, const ImGuiID& id, bool* out_hovered, bool* out_held, bool allow_key_modifiers, bool repeat = false, bool pressed_on_click = false); static void LogText(const ImVec2& ref_pos, const char* text, const char* text_end = NULL); diff --git a/imgui.h b/imgui.h index 5cac69e1..3ba53dd2 100644 --- a/imgui.h +++ b/imgui.h @@ -6,17 +6,7 @@ #pragma once -struct ImDrawCmd; -struct ImDrawList; -struct ImFont; -struct ImFontAtlas; -struct ImGuiAabb; -struct ImGuiIO; -struct ImGuiStorage; -struct ImGuiStyle; -struct ImGuiWindow; - -#include "imconfig.h" +#include "imconfig.h" // User-editable configuration file #include // FLT_MAX #include // va_list #include // ptrdiff_t @@ -34,6 +24,15 @@ struct ImGuiWindow; #define IMGUI_API #endif +// Forward declarations +struct ImDrawCmd; +struct ImDrawList; +struct ImFont; +struct ImFontAtlas; +struct ImGuiIO; +struct ImGuiStorage; +struct ImGuiStyle; + typedef unsigned int ImU32; typedef unsigned short ImWchar; // character for display typedef void* ImTextureID; // user data to refer to a texture (e.g. store your texture handle/id)