diff --git a/cimgui/cimgui.h b/cimgui/cimgui.h index adddd31..2179ec1 100644 --- a/cimgui/cimgui.h +++ b/cimgui/cimgui.h @@ -45,8 +45,8 @@ struct ImGuiPayload; #if defined __cplusplus #define IMFONTGLYPH ImFontGlyph #else -struct Glyph; -#define IMFONTGLYPH Glyph +//struct Glyph; +#define IMFONTGLYPH ImFontGlyph #endif typedef unsigned short ImDrawIdx; @@ -62,6 +62,8 @@ typedef int ImGuiMouseCursor; typedef int ImGuiWindowFlags; typedef int ImGuiCond; typedef int ImGuiColumnsFlags; +typedef int ImGuiConfigFlags; +typedef int ImGuiBackendFlags; typedef int ImGuiInputTextFlags; typedef int ImGuiSelectableFlags; typedef int ImGuiTreeNodeFlags; @@ -82,517 +84,7 @@ typedef unsigned long long ImU64; #endif #ifdef CIMGUI_DEFINE_ENUMS_AND_STRUCTS -struct ImVec2 -{ - float x, y; -}; - -struct ImVec4 -{ - float x, y, z, w; -}; - -enum -{ - ImGuiWindowFlags_NoTitleBar = 1 << 0, - ImGuiWindowFlags_NoResize = 1 << 1, - ImGuiWindowFlags_NoMove = 1 << 2, - ImGuiWindowFlags_NoScrollbar = 1 << 3, - ImGuiWindowFlags_NoScrollWithMouse = 1 << 4, - ImGuiWindowFlags_NoCollapse = 1 << 5, - ImGuiWindowFlags_AlwaysAutoResize = 1 << 6, - //ImGuiWindowFlags_ShowBorders = 1 << 7, - ImGuiWindowFlags_NoSavedSettings = 1 << 8, - ImGuiWindowFlags_NoInputs = 1 << 9, - ImGuiWindowFlags_MenuBar = 1 << 10, - ImGuiWindowFlags_HorizontalScrollbar = 1 << 11, - ImGuiWindowFlags_NoFocusOnAppearing = 1 << 12, - ImGuiWindowFlags_NoBringToFrontOnFocus = 1 << 13, - ImGuiWindowFlags_AlwaysVerticalScrollbar = 1 << 14, - ImGuiWindowFlags_AlwaysHorizontalScrollbar = 1 << 15, - ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 16, - ImGuiWindowFlags_ResizeFromAnySide = 1 << 17, -}; - -enum -{ - ImGuiInputTextFlags_CharsDecimal = 1 << 0, - ImGuiInputTextFlags_CharsHexadecimal = 1 << 1, - ImGuiInputTextFlags_CharsUppercase = 1 << 2, - ImGuiInputTextFlags_CharsNoBlank = 1 << 3, - ImGuiInputTextFlags_AutoSelectAll = 1 << 4, - ImGuiInputTextFlags_EnterReturnsTrue = 1 << 5, - ImGuiInputTextFlags_CallbackCompletion = 1 << 6, - ImGuiInputTextFlags_CallbackHistory = 1 << 7, - ImGuiInputTextFlags_CallbackAlways = 1 << 8, - ImGuiInputTextFlags_CallbackCharFilter = 1 << 9, - ImGuiInputTextFlags_AllowTabInput = 1 << 10, - ImGuiInputTextFlags_CtrlEnterForNewLine = 1 << 11, - ImGuiInputTextFlags_NoHorizontalScroll = 1 << 12, - ImGuiInputTextFlags_AlwaysInsertMode = 1 << 13, - ImGuiInputTextFlags_ReadOnly = 1 << 14, - ImGuiInputTextFlags_Password = 1 << 15, - ImGuiInputTextFlags_NoUndoRedo = 1 << 16, -}; - -enum -{ - ImGuiTreeNodeFlags_Selected = 1 << 0, - ImGuiTreeNodeFlags_Framed = 1 << 1, - ImGuiTreeNodeFlags_AllowItemOverlap = 1 << 2, - ImGuiTreeNodeFlags_NoTreePushOnOpen = 1 << 3, - ImGuiTreeNodeFlags_NoAutoOpenOnLog = 1 << 4, - ImGuiTreeNodeFlags_DefaultOpen = 1 << 5, - ImGuiTreeNodeFlags_OpenOnDoubleClick = 1 << 6, - ImGuiTreeNodeFlags_OpenOnArrow = 1 << 7, - ImGuiTreeNodeFlags_Leaf = 1 << 8, - ImGuiTreeNodeFlags_Bullet = 1 << 9, - ImGuiTreeNodeFlags_FramePadding = 1 << 10, - ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoAutoOpenOnLog -}; - -enum -{ - ImGuiSelectableFlags_DontClosePopups = 1 << 0, - ImGuiSelectableFlags_SpanAllColumns = 1 << 1, - ImGuiSelectableFlags_AllowDoubleClick = 1 << 2 -}; - -enum ImGuiComboFlags_ -{ - ImGuiComboFlags_PopupAlignLeft = 1 << 0, - ImGuiComboFlags_HeightSmall = 1 << 1, - ImGuiComboFlags_HeightRegular = 1 << 2, - ImGuiComboFlags_HeightLarge = 1 << 3, - ImGuiComboFlags_HeightLargest = 1 << 4, - ImGuiComboFlags_HeightMask_ = ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest -}; - -enum ImGuiFocusedFlags_ -{ - ImGuiFocusedFlags_ChildWindows = 1 << 0, - ImGuiFocusedFlags_RootWindow = 1 << 1, - ImGuiFocusedFlags_AnyWindow = 1 << 2, - ImGuiFocusedFlags_RootAndChildWindows = ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows -}; - -enum ImGuiHoveredFlags_ -{ - ImGuiHoveredFlags_Default = 0, - ImGuiHoveredFlags_ChildWindows = 1 << 0, - ImGuiHoveredFlags_RootWindow = 1 << 1, - ImGuiHoveredFlags_AnyWindow = 1 << 2, - ImGuiHoveredFlags_AllowWhenBlockedByPopup = 1 << 3, - //ImGuiHoveredFlags_AllowWhenBlockedByModal = 1 << 4, - ImGuiHoveredFlags_AllowWhenBlockedByActiveItem = 1 << 5, - ImGuiHoveredFlags_AllowWhenOverlapped = 1 << 6, - ImGuiHoveredFlags_RectOnly = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped, - ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows -}; - -enum ImGuiDragDropFlags_ -{ - ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0, - ImGuiDragDropFlags_SourceNoDisableHover = 1 << 1, - ImGuiDragDropFlags_SourceNoHoldToOpenOthers = 1 << 2, - ImGuiDragDropFlags_SourceAllowNullID = 1 << 3, - ImGuiDragDropFlags_SourceExtern = 1 << 4, - ImGuiDragDropFlags_AcceptBeforeDelivery = 1 << 10, - ImGuiDragDropFlags_AcceptNoDrawDefaultRect = 1 << 11, - ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect -}; - -enum -{ - ImGuiKey_Tab, - ImGuiKey_LeftArrow, - ImGuiKey_RightArrow, - ImGuiKey_UpArrow, - ImGuiKey_DownArrow, - ImGuiKey_PageUp, - ImGuiKey_PageDown, - ImGuiKey_Home, - ImGuiKey_End, - ImGuiKey_Insert, - ImGuiKey_Delete, - ImGuiKey_Backspace, - ImGuiKey_Space, - ImGuiKey_Enter, - ImGuiKey_Escape, - ImGuiKey_A, // for text edit CTRL+A: select all - ImGuiKey_C, // for text edit CTRL+C: copy - ImGuiKey_V, // for text edit CTRL+V: paste - ImGuiKey_X, // for text edit CTRL+X: cut - ImGuiKey_Y, // for text edit CTRL+Y: redo - ImGuiKey_Z, // for text edit CTRL+Z: undo - ImGuiKey_COUNT -}; - -enum -{ - ImGuiCol_Text, - ImGuiCol_TextDisabled, - ImGuiCol_WindowBg, - ImGuiCol_ChildBg, - ImGuiCol_PopupBg, - ImGuiCol_Border, - ImGuiCol_BorderShadow, - ImGuiCol_FrameBg, - ImGuiCol_FrameBgHovered, - ImGuiCol_FrameBgActive, - ImGuiCol_TitleBg, - ImGuiCol_TitleBgActive, - ImGuiCol_TitleBgCollapsed, - ImGuiCol_MenuBarBg, - ImGuiCol_ScrollbarBg, - ImGuiCol_ScrollbarGrab, - ImGuiCol_ScrollbarGrabHovered, - ImGuiCol_ScrollbarGrabActive, - ImGuiCol_CheckMark, - ImGuiCol_SliderGrab, - ImGuiCol_SliderGrabActive, - ImGuiCol_Button, - ImGuiCol_ButtonHovered, - ImGuiCol_ButtonActive, - ImGuiCol_Header, - ImGuiCol_HeaderHovered, - ImGuiCol_HeaderActive, - ImGuiCol_Separator, - ImGuiCol_SeparatorHovered, - ImGuiCol_SeparatorActive, - ImGuiCol_ResizeGrip, - ImGuiCol_ResizeGripHovered, - ImGuiCol_ResizeGripActive, - ImGuiCol_CloseButton, - ImGuiCol_CloseButtonHovered, - ImGuiCol_CloseButtonActive, - ImGuiCol_PlotLines, - ImGuiCol_PlotLinesHovered, - ImGuiCol_PlotHistogram, - ImGuiCol_PlotHistogramHovered, - ImGuiCol_TextSelectedBg, - ImGuiCol_ModalWindowDarkening, - ImGuiCol_DragDropTarget, - ImGuiCol_COUNT -}; - -enum -{ - ImGuiStyleVar_Alpha, - ImGuiStyleVar_WindowPadding, - ImGuiStyleVar_WindowRounding, - ImGuiStyleVar_WindowBorderSize, - ImGuiStyleVar_WindowMinSize, - ImGuiStyleVar_ChildRounding, - ImGuiStyleVar_ChildBorderSize, - ImGuiStyleVar_PopupRounding, - ImGuiStyleVar_PopupBorderSize, - ImGuiStyleVar_FramePadding, - ImGuiStyleVar_FrameRounding, - ImGuiStyleVar_FrameBorderSize, - ImGuiStyleVar_ItemSpacing, - ImGuiStyleVar_ItemInnerSpacing, - ImGuiStyleVar_IndentSpacing, - ImGuiStyleVar_GrabMinSize, - ImGuiStyleVar_ButtonTextAlign, - ImGuiStyleVar_Count_ -}; - -enum -{ - ImGuiColorEditFlags_NoAlpha = 1 << 1, - ImGuiColorEditFlags_NoPicker = 1 << 2, - ImGuiColorEditFlags_NoOptions = 1 << 3, - ImGuiColorEditFlags_NoSmallPreview = 1 << 4, - ImGuiColorEditFlags_NoInputs = 1 << 5, - ImGuiColorEditFlags_NoTooltip = 1 << 6, - ImGuiColorEditFlags_NoLabel = 1 << 7, - ImGuiColorEditFlags_NoSidePreview = 1 << 8, - ImGuiColorEditFlags_AlphaBar = 1 << 9, - ImGuiColorEditFlags_AlphaPreview = 1 << 10, - ImGuiColorEditFlags_AlphaPreviewHalf = 1 << 11, - ImGuiColorEditFlags_HDR = 1 << 12, - ImGuiColorEditFlags_RGB = 1 << 13, - ImGuiColorEditFlags_HSV = 1 << 14, - ImGuiColorEditFlags_HEX = 1 << 15, - ImGuiColorEditFlags_Uint8 = 1 << 16, - ImGuiColorEditFlags_Float = 1 << 17, - ImGuiColorEditFlags_PickerHueBar = 1 << 18, - ImGuiColorEditFlags_PickerHueWheel = 1 << 19 -}; - -enum -{ - ImGuiMouseCursor_None = -1, - ImGuiMouseCursor_Arrow = 0, - ImGuiMouseCursor_TextInput, - ImGuiMouseCursor_Move, - ImGuiMouseCursor_ResizeNS, - ImGuiMouseCursor_ResizeEW, - ImGuiMouseCursor_ResizeNESW, - ImGuiMouseCursor_ResizeNWSE, - ImGuiMouseCursor_Count_ -}; - -enum -{ - ImGuiCond_Always = 1 << 0, - ImGuiCond_Once = 1 << 1, - ImGuiCond_FirstUseEver = 1 << 2, - ImGuiCond_Appearing = 1 << 3 -}; - -enum ImDrawCornerFlags_ -{ - ImDrawCornerFlags_TopLeft = 1 << 0, - ImDrawCornerFlags_TopRight = 1 << 1, - ImDrawCornerFlags_BotLeft = 1 << 2, - ImDrawCornerFlags_BotRight = 1 << 3, - ImDrawCornerFlags_Top = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_TopRight, - ImDrawCornerFlags_Bot = ImDrawCornerFlags_BotLeft | ImDrawCornerFlags_BotRight, - ImDrawCornerFlags_Left = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_BotLeft, - ImDrawCornerFlags_Right = ImDrawCornerFlags_TopRight | ImDrawCornerFlags_BotRight, - ImDrawCornerFlags_All = 0xF -}; - -enum ImDrawListFlags_ -{ - ImDrawListFlags_AntiAliasedLines = 1 << 0, - ImDrawListFlags_AntiAliasedFill = 1 << 1 -}; - -enum ImGuiNavInput_ -{ - // Gamepad Mapping - ImGuiNavInput_Activate, // activate / open / toggle / tweak value // e.g. Circle (PS4), A (Xbox), B (Switch), Space (Keyboard) - ImGuiNavInput_Cancel, // cancel / close / exit // e.g. Cross (PS4), B (Xbox), A (Switch), Escape (Keyboard) - ImGuiNavInput_Input, // text input / on-screen keyboard // e.g. Triang.(PS4), Y (Xbox), X (Switch), Return (Keyboard) - ImGuiNavInput_Menu, // tap: toggle menu / hold: focus, move, resize // e.g. Square (PS4), X (Xbox), Y (Switch), Alt (Keyboard) - ImGuiNavInput_DpadLeft, // move / tweak / resize window (w/ PadMenu) // e.g. D-pad Left/Right/Up/Down (Gamepads), Arrow keys (Keyboard) - ImGuiNavInput_DpadRight, // - ImGuiNavInput_DpadUp, // - ImGuiNavInput_DpadDown, // - ImGuiNavInput_LStickLeft, // scroll / move window (w/ PadMenu) // e.g. Left Analog Stick Left/Right/Up/Down - ImGuiNavInput_LStickRight, // - ImGuiNavInput_LStickUp, // - ImGuiNavInput_LStickDown, // - ImGuiNavInput_FocusPrev, // next window (w/ PadMenu) // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch) - ImGuiNavInput_FocusNext, // prev window (w/ PadMenu) // e.g. R1 or R2 (PS4), RB or RT (Xbox), R or ZL (Switch) - ImGuiNavInput_TweakSlow, // slower tweaks // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch) - ImGuiNavInput_TweakFast, // faster tweaks // e.g. R1 or R2 (PS4), RB or RT (Xbox), R or ZL (Switch) - - // [Internal] Don't use directly! This is used internally to differentiate keyboard from gamepad inputs for behaviors that require to differentiate them. - // Keyboard behavior that have no corresponding gamepad mapping (e.g. CTRL+TAB) may be directly reading from io.KeyDown[] instead of io.NavInputs[]. - ImGuiNavInput_KeyMenu_, // toggle menu // = io.KeyAlt - ImGuiNavInput_KeyLeft_, // move left // = Arrow keys - ImGuiNavInput_KeyRight_, // move right - ImGuiNavInput_KeyUp_, // move up - ImGuiNavInput_KeyDown_, // move down - ImGuiNavInput_COUNT, - ImGuiNavInput_InternalStart_ = ImGuiNavInput_KeyMenu_ -}; - -enum ImGuiNavFlags_ -{ - ImGuiNavFlags_EnableKeyboard = 1 << 0, // Master keyboard navigation enable flag. NewFrame() will automatically fill io.NavInputs[] based on io.KeyDown[]. - ImGuiNavFlags_EnableGamepad = 1 << 1, // Master gamepad navigation enable flag. This is mostly to instruct your imgui back-end to fill io.NavInputs[]. - ImGuiNavFlags_MoveMouse = 1 << 2, // Request navigation to allow moving the mouse cursor. May be useful on TV/console systems where moving a virtual mouse is awkward. Will update io.MousePos and set io.WantMoveMouse=true. If enabled you MUST honor io.WantMoveMouse requests in your binding, otherwise ImGui will react as if the mouse is jumping around back and forth. - ImGuiNavFlags_NoCaptureKeyboard = 1 << 3 // Do not set the io.WantCaptureKeyboard flag with io.NavActive is set. -}; - -struct ImGuiStyle -{ - float Alpha; - struct ImVec2 WindowPadding; - float WindowRounding; - float WindowBorderSize; - struct ImVec2 WindowMinSize; - struct ImVec2 WindowTitleAlign; - float ChildRounding; - float ChildBorderSize; - float PopupRounding; - float PopupBorderSize; - struct ImVec2 FramePadding; - float FrameRounding; - float FrameBorderSize; - struct ImVec2 ItemSpacing; - struct ImVec2 ItemInnerSpacing; - struct ImVec2 TouchExtraPadding; - float IndentSpacing; - float ColumnsMinSpacing; - float ScrollbarSize; - float ScrollbarRounding; - float GrabMinSize; - float GrabRounding; - struct ImVec2 ButtonTextAlign; - struct ImVec2 DisplayWindowPadding; - struct ImVec2 DisplaySafeAreaPadding; - bool AntiAliasedLines; - bool AntiAliasedFill; - float CurveTessellationTol; - struct ImVec4 Colors[ImGuiCol_COUNT]; -}; - -struct ImGuiIO -{ - struct ImVec2 DisplaySize; - float DeltaTime; - ImGuiNavFlags NavFlags; - float IniSavingRate; - CONST char *IniFilename; - CONST char *LogFilename; - float MouseDoubleClickTime; - float MouseDoubleClickMaxDist; - float MouseDragThreshold; - int KeyMap[ImGuiKey_COUNT]; - float KeyRepeatDelay; - float KeyRepeatRate; - void *UserData; - struct ImFontAtlas *Fonts; - float FontGlobalScale; - bool FontAllowUserScaling; - struct ImFont *FontDefault; - struct ImVec2 DisplayFramebufferScale; - struct ImVec2 DisplayVisibleMin; - struct ImVec2 DisplayVisibleMax; - bool OptMacOSXBehaviors; - bool OptCursorBlink; - //void (*RenderDrawListsFn)(struct ImDrawData *data); obsolete - CONST char *(*GetClipboardTextFn)(void *user_data); - void (*SetClipboardTextFn)(void *user_data, CONST char *text); - void *ClipboardUserData; - void (*ImeSetInputScreenPosFn)(int x, int y); - void *ImeWindowHandle; - void (*RenderDrawListsFn)(struct ImDrawData* data); - struct ImVec2 MousePos; - bool MouseDown[5]; - float MouseWheel; - float MouseWheelH; - bool MouseDrawCursor; - bool KeyCtrl; - bool KeyShift; - bool KeyAlt; - bool KeySuper; - bool KeysDown[512]; - ImWchar InputCharacters[16 + 1]; - float NavInputs[ImGuiNavInput_COUNT]; - bool WantCaptureMouse; - bool WantCaptureKeyboard; - bool WantTextInput; - bool WantMoveMouse; - bool NavActive; // Directional navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn't use the ImGuiWindowFlags_NoNavInputs flag. - bool NavVisible; // Directional navigation is visible and allowed (will handle ImGuiKey_NavXXX events). - float Framerate; - //int MetricsAllocs; - int MetricsRenderVertices; - int MetricsRenderIndices; - int MetricsActiveWindows; - struct ImVec2 MouseDelta; - struct ImVec2 MousePosPrev; - struct ImVec2 MouseClickedPos[5]; - float MouseClickedTime[5]; - bool MouseClicked[5]; - bool MouseDoubleClicked[5]; - bool MouseReleased[5]; - bool MouseDownOwned[5]; - float MouseDownDuration[5]; - float MouseDownDurationPrev[5]; - struct ImVec2 MouseDragMaxDistanceAbs[5]; - float MouseDragMaxDistanceSqr[5]; - float KeysDownDuration[512]; - float KeysDownDurationPrev[512]; - float NavInputsDownDuration[ImGuiNavInput_COUNT]; - float NavInputsDownDurationPrev[ImGuiNavInput_COUNT]; -}; - -struct ImGuiTextEditCallbackData -{ - ImGuiInputTextFlags EventFlag; - ImGuiInputTextFlags Flags; - void *UserData; - bool ReadOnly; - ImWchar EventChar; - ImGuiKey EventKey; - char *Buf; - int BufTextLen; - int BufSize; - bool BufDirty; - int CursorPos; - int SelectionStart; - int SelectionEnd; -}; - -struct ImGuiSizeCallbackData -{ - void *UserData; - struct ImVec2 Pos; - struct ImVec2 CurrentSize; - struct ImVec2 DesiredSize; -}; - -struct ImDrawCmd -{ - unsigned int ElemCount; - struct ImVec4 ClipRect; - ImTextureID TextureId; - ImDrawCallback UserCallback; - void *UserCallbackData; -}; - -struct ImDrawData -{ - bool Valid; - struct ImDrawList **CmdLists; - int CmdListsCount; - int TotalVtxCount; - int TotalIdxCount; -}; - -struct ImDrawVert -{ - struct ImVec2 pos; - struct ImVec2 uv; - ImU32 col; -}; - -struct ImFontConfig -{ - void *FontData; - int FontDataSize; - bool FontDataOwnedByAtlas; - int FontNo; - float SizePixels; - int OversampleH, OversampleV; - bool PixelSnapH; - struct ImVec2 GlyphExtraSpacing; - struct ImVec2 GlyphOffset; - CONST ImWchar *GlyphRanges; - bool MergeMode; - unsigned int RasterizerFlags; - float RasterizerMultiply; - char Name[32]; - struct ImFont *DstFont; -}; - -struct ImGuiListClipper -{ - float StartPosY; - float ItemsHeight; - int ItemsCount, StepNo, DisplayStart, DisplayEnd; -}; - -struct ImGuiPayload -{ - CONST void *Data; - int DataSize; - - ImGuiID SourceId; - ImGuiID SourceParentId; - int DataFrameCount; - char DataType[8 + 1]; - bool Preview; - bool Delivery; -}; +#include "imgui_structs.h" #endif // CIMGUI_DEFINE_ENUMS_AND_STRUCTS // Main diff --git a/cimgui/gen_imgui_structs.bat b/cimgui/gen_imgui_structs.bat new file mode 100644 index 0000000..595bb6b --- /dev/null +++ b/cimgui/gen_imgui_structs.bat @@ -0,0 +1,8 @@ +rem this is used to rebuild imgui_structs.h +rem set your PATH if necessary for gcc and lua with: +set PATH=%PATH%;C:\mingw32\bin;C:\luaGL; + +gcc -E ../imgui/imgui.h | luajit.exe ./gen_imgui_structs.lua > imgui_structs.h + +cmd /k + diff --git a/cimgui/gen_imgui_structs.lua b/cimgui/gen_imgui_structs.lua new file mode 100644 index 0000000..3a9c044 --- /dev/null +++ b/cimgui/gen_imgui_structs.lua @@ -0,0 +1,167 @@ +--script for imgui_structs.h generation + +function strip(cad) + return cad:gsub("^%s*(.-)%s*$","%1") +end + + +cdefs = {} + +location_re = '^# %d+ "([^"]*)"' +cimpath_re = '^(.*[\\/])(imgui)%.h$' +define_re = "^#define%s+([^%s]+)%s+([^%s]+)$" +function_re = "%b()" +function_closed_re = "[;}]$" +function_closing_re = "}" + +number_re = "^-?[0-9]+$" +hex_re = "0x[0-9a-fA-F]+$" + +local in_imgui = false +local in_function = false +for line in io.lines() do +repeat -- simulate continue with break + + --print(line) + line = strip(line) + if #line == 0 then break end + -- Is this a preprocessor statement? + if line:sub(1,1) == "#" then + -- Is this a location pragma? + local location_match = line:match(location_re) + if location_match then + --print("location_match",line) + -- If we are transitioning to a header we need to parse, set the flag + local cimpath_match,aaa = location_match:match(cimpath_re) + in_imgui = (cimpath_match ~= nil) + --if in_gl then print(aaa) end + break + end + + + elseif in_imgui then + --[[ + -- Windows likes to add __stdcall__ to everything, but it isn't needed and is actually harmful when using under linux. + -- However, it is needed for callbacks in windows. + --if line:find("typedef") >= 0 and line.find(" PFNGL") < 0: + if line:find("typedef") and not line:find(" PFNGL") then + --line = line:gsub("__attribute__%(%(__stdcall__%)%) ", 'WINDOWS_STDCALL ') + line = line:gsub('GL_APIENTRY ' , 'WINDOWS_STDCALL ') + else + --line = line:gsub("__attribute__%(%(__stdcall__%)%) ", '') + line = line:gsub('GL_APIENTRY ', '') + end + -- While linux likes to add __attribute__((visibility("default"))) + line = line:gsub('__attribute__%(%(visibility%("default"%)%)%) ', '') + line = line:gsub("__attribute__%(%(__stdcall__%)%) ", '') + --]] + if in_function then + if line:match(function_closing_re) then + in_function = false + end + break + end + if line:match(function_re) and not line:match("typedef.*%b().*%b().*") then + --if not line:match("typedef.*%b().*%b().*") then --functypedef + if not line:match(function_closed_re) then + in_function = true + end + --end + elseif line:match("template") then + --nothing + elseif line:match("public") then + --nothing + else + --line = line:gsub("class","struct") + --line = line:gsub("mutable","") + line = line:gsub("%S+",{class="struct",mutable=""}) + line = line:gsub("(%b<>)","/%*%1%*/") --comment template parameters + table.insert(cdefs,line) + end + end + +until true +end + +local namespace_re = "namespace" +local in_namespace = false +local struct_re = "^struct%s+([^%s;]+)$" +local struct_closed_re = "^struct%s+([^%s]+);$" +local struct_closing_re = "};" +local struct_op_close_re = "%b{}" +local structnames = {} +local innerstructs = {} +-- Output the file + print("#ifndef IMGUI_STRUCTS_INCLUDED") + print("#define IMGUI_STRUCTS_INCLUDED") + print("/////////////// BEGIN AUTOGENERATED SEGMENT") + for i,line in ipairs(cdefs) do + repeat -- simulating continue with break + + if line:match(namespace_re) then + in_namespace = true + end + structnames[#structnames + 1] = line:match(struct_re) + + if in_namespace then + if line:match(function_closing_re) then + --io.write( line,"\n") + in_namespace = false + end + break -- dont write anything inside + end + + if structnames[#structnames] == "ImVector" then + if line:match(struct_closing_re) then + io.write[[struct ImVector +{ +int Size; +int Capacity; +void* Data; +}; +typedef struct ImVector ImVector;]] + structnames[#structnames] = nil + end + break -- dont write + end + + if #structnames < 2 then -- not inner + if (#structnames > 0) and line:match("typedef") then --dont allow inner typedefs + break + end + io.write( line,"\n") + local struct_closed_name = line:match(struct_closed_re) + if struct_closed_name then + io.write("typedef struct ",struct_closed_name," ",struct_closed_name,";\n") + end + end + + --if structnames[#structnames] then + if #structnames > 0 then + if #structnames > 1 then --inner + innerstructs[structnames[#structnames]] = innerstructs[structnames[#structnames]] or {} + local st = innerstructs[structnames[#structnames]] + st[#st + 1] = line + if line:match(struct_closing_re) and not line:match(struct_op_close_re) then + local structname = structnames[#structnames] + st[#st + 1] = string.format("typedef struct %s %s;\n",structname,structname) + structnames[#structnames] = nil + end + elseif line:match(struct_closing_re) and not line:match(struct_op_close_re) then + local structname = structnames[#structnames] + io.write("typedef struct ",structname," ",structname,";\n") + structnames[#structnames] = nil + end + end + + + until true + end + for k,v in pairs(innerstructs) do + for i,line in ipairs(v) do + print(line) + end + end + + print("//////////////// END AUTOGENERATED SEGMENT ") + print("#endif //IMGUI_STRUCTS_INCLUDED") diff --git a/cimgui/imgui_structs.h b/cimgui/imgui_structs.h new file mode 100644 index 0000000..0191209 --- /dev/null +++ b/cimgui/imgui_structs.h @@ -0,0 +1,747 @@ +#ifndef IMGUI_STRUCTS_INCLUDED +#define IMGUI_STRUCTS_INCLUDED +/////////////// BEGIN AUTOGENERATED SEGMENT +struct ImDrawChannel; +typedef struct ImDrawChannel ImDrawChannel; +struct ImDrawCmd; +typedef struct ImDrawCmd ImDrawCmd; +struct ImDrawData; +typedef struct ImDrawData ImDrawData; +struct ImDrawList; +typedef struct ImDrawList ImDrawList; +struct ImDrawListSharedData; +typedef struct ImDrawListSharedData ImDrawListSharedData; +struct ImDrawVert; +typedef struct ImDrawVert ImDrawVert; +struct ImFont; +typedef struct ImFont ImFont; +struct ImFontAtlas; +typedef struct ImFontAtlas ImFontAtlas; +struct ImFontConfig; +typedef struct ImFontConfig ImFontConfig; +struct ImColor; +typedef struct ImColor ImColor; +struct ImGuiIO; +typedef struct ImGuiIO ImGuiIO; +struct ImGuiOnceUponAFrame; +typedef struct ImGuiOnceUponAFrame ImGuiOnceUponAFrame; +struct ImGuiStorage; +typedef struct ImGuiStorage ImGuiStorage; +struct ImGuiStyle; +typedef struct ImGuiStyle ImGuiStyle; +struct ImGuiTextFilter; +typedef struct ImGuiTextFilter ImGuiTextFilter; +struct ImGuiTextBuffer; +typedef struct ImGuiTextBuffer ImGuiTextBuffer; +struct ImGuiTextEditCallbackData; +typedef struct ImGuiTextEditCallbackData ImGuiTextEditCallbackData; +struct ImGuiSizeCallbackData; +typedef struct ImGuiSizeCallbackData ImGuiSizeCallbackData; +struct ImGuiListClipper; +typedef struct ImGuiListClipper ImGuiListClipper; +struct ImGuiPayload; +typedef struct ImGuiPayload ImGuiPayload; +struct ImGuiContext; +typedef struct ImGuiContext ImGuiContext; +typedef void* ImTextureID; +typedef unsigned int ImU32; +typedef unsigned int ImGuiID; +typedef unsigned short ImWchar; +typedef int ImGuiCol; +typedef int ImGuiDir; +typedef int ImGuiCond; +typedef int ImGuiKey; +typedef int ImGuiNavInput; +typedef int ImGuiMouseCursor; +typedef int ImGuiStyleVar; +typedef int ImDrawCornerFlags; +typedef int ImDrawListFlags; +typedef int ImFontAtlasFlags; +typedef int ImGuiBackendFlags; +typedef int ImGuiColorEditFlags; +typedef int ImGuiColumnsFlags; +typedef int ImGuiConfigFlags; +typedef int ImGuiDragDropFlags; +typedef int ImGuiComboFlags; +typedef int ImGuiFocusedFlags; +typedef int ImGuiHoveredFlags; +typedef int ImGuiInputTextFlags; +typedef int ImGuiSelectableFlags; +typedef int ImGuiTreeNodeFlags; +typedef int ImGuiWindowFlags; +typedef int (*ImGuiTextEditCallback)(ImGuiTextEditCallbackData *data); +typedef void (*ImGuiSizeCallback)(ImGuiSizeCallbackData* data); +typedef unsigned long long ImU64; +struct ImVec2 +{ +float x, y; +}; +typedef struct ImVec2 ImVec2; +struct ImVec4 +{ +float x, y, z, w; +}; +typedef struct ImVec4 ImVec4; +enum ImGuiWindowFlags_ +{ +ImGuiWindowFlags_NoTitleBar = 1 << 0, +ImGuiWindowFlags_NoResize = 1 << 1, +ImGuiWindowFlags_NoMove = 1 << 2, +ImGuiWindowFlags_NoScrollbar = 1 << 3, +ImGuiWindowFlags_NoScrollWithMouse = 1 << 4, +ImGuiWindowFlags_NoCollapse = 1 << 5, +ImGuiWindowFlags_AlwaysAutoResize = 1 << 6, +ImGuiWindowFlags_NoSavedSettings = 1 << 8, +ImGuiWindowFlags_NoInputs = 1 << 9, +ImGuiWindowFlags_MenuBar = 1 << 10, +ImGuiWindowFlags_HorizontalScrollbar = 1 << 11, +ImGuiWindowFlags_NoFocusOnAppearing = 1 << 12, +ImGuiWindowFlags_NoBringToFrontOnFocus = 1 << 13, +ImGuiWindowFlags_AlwaysVerticalScrollbar= 1 << 14, +ImGuiWindowFlags_AlwaysHorizontalScrollbar=1<< 15, +ImGuiWindowFlags_AlwaysUseWindowPadding = 1 << 16, +ImGuiWindowFlags_ResizeFromAnySide = 1 << 17, +ImGuiWindowFlags_NoNavInputs = 1 << 18, +ImGuiWindowFlags_NoNavFocus = 1 << 19, +ImGuiWindowFlags_NoNav = ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus, +ImGuiWindowFlags_NavFlattened = 1 << 23, +ImGuiWindowFlags_ChildWindow = 1 << 24, +ImGuiWindowFlags_Tooltip = 1 << 25, +ImGuiWindowFlags_Popup = 1 << 26, +ImGuiWindowFlags_Modal = 1 << 27, +ImGuiWindowFlags_ChildMenu = 1 << 28 +}; +enum ImGuiInputTextFlags_ +{ +ImGuiInputTextFlags_CharsDecimal = 1 << 0, +ImGuiInputTextFlags_CharsHexadecimal = 1 << 1, +ImGuiInputTextFlags_CharsUppercase = 1 << 2, +ImGuiInputTextFlags_CharsNoBlank = 1 << 3, +ImGuiInputTextFlags_AutoSelectAll = 1 << 4, +ImGuiInputTextFlags_EnterReturnsTrue = 1 << 5, +ImGuiInputTextFlags_CallbackCompletion = 1 << 6, +ImGuiInputTextFlags_CallbackHistory = 1 << 7, +ImGuiInputTextFlags_CallbackAlways = 1 << 8, +ImGuiInputTextFlags_CallbackCharFilter = 1 << 9, +ImGuiInputTextFlags_AllowTabInput = 1 << 10, +ImGuiInputTextFlags_CtrlEnterForNewLine = 1 << 11, +ImGuiInputTextFlags_NoHorizontalScroll = 1 << 12, +ImGuiInputTextFlags_AlwaysInsertMode = 1 << 13, +ImGuiInputTextFlags_ReadOnly = 1 << 14, +ImGuiInputTextFlags_Password = 1 << 15, +ImGuiInputTextFlags_NoUndoRedo = 1 << 16, +ImGuiInputTextFlags_CharsScientific = 1 << 17, +ImGuiInputTextFlags_Multiline = 1 << 20 +}; +enum ImGuiTreeNodeFlags_ +{ +ImGuiTreeNodeFlags_Selected = 1 << 0, +ImGuiTreeNodeFlags_Framed = 1 << 1, +ImGuiTreeNodeFlags_AllowItemOverlap = 1 << 2, +ImGuiTreeNodeFlags_NoTreePushOnOpen = 1 << 3, +ImGuiTreeNodeFlags_NoAutoOpenOnLog = 1 << 4, +ImGuiTreeNodeFlags_DefaultOpen = 1 << 5, +ImGuiTreeNodeFlags_OpenOnDoubleClick = 1 << 6, +ImGuiTreeNodeFlags_OpenOnArrow = 1 << 7, +ImGuiTreeNodeFlags_Leaf = 1 << 8, +ImGuiTreeNodeFlags_Bullet = 1 << 9, +ImGuiTreeNodeFlags_FramePadding = 1 << 10, +ImGuiTreeNodeFlags_NavLeftJumpsBackHere = 1 << 13, +ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoAutoOpenOnLog +, ImGuiTreeNodeFlags_AllowOverlapMode = ImGuiTreeNodeFlags_AllowItemOverlap +}; +enum ImGuiSelectableFlags_ +{ +ImGuiSelectableFlags_DontClosePopups = 1 << 0, +ImGuiSelectableFlags_SpanAllColumns = 1 << 1, +ImGuiSelectableFlags_AllowDoubleClick = 1 << 2 +}; +enum ImGuiComboFlags_ +{ +ImGuiComboFlags_PopupAlignLeft = 1 << 0, +ImGuiComboFlags_HeightSmall = 1 << 1, +ImGuiComboFlags_HeightRegular = 1 << 2, +ImGuiComboFlags_HeightLarge = 1 << 3, +ImGuiComboFlags_HeightLargest = 1 << 4, +ImGuiComboFlags_NoArrowButton = 1 << 5, +ImGuiComboFlags_NoPreview = 1 << 6, +ImGuiComboFlags_HeightMask_ = ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest +}; +enum ImGuiFocusedFlags_ +{ +ImGuiFocusedFlags_ChildWindows = 1 << 0, +ImGuiFocusedFlags_RootWindow = 1 << 1, +ImGuiFocusedFlags_AnyWindow = 1 << 2, +ImGuiFocusedFlags_RootAndChildWindows = ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows +}; +enum ImGuiHoveredFlags_ +{ +ImGuiHoveredFlags_Default = 0, +ImGuiHoveredFlags_ChildWindows = 1 << 0, +ImGuiHoveredFlags_RootWindow = 1 << 1, +ImGuiHoveredFlags_AnyWindow = 1 << 2, +ImGuiHoveredFlags_AllowWhenBlockedByPopup = 1 << 3, +ImGuiHoveredFlags_AllowWhenBlockedByActiveItem = 1 << 5, +ImGuiHoveredFlags_AllowWhenOverlapped = 1 << 6, +ImGuiHoveredFlags_RectOnly = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped, +ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows +}; +enum ImGuiDragDropFlags_ +{ +ImGuiDragDropFlags_SourceNoPreviewTooltip = 1 << 0, +ImGuiDragDropFlags_SourceNoDisableHover = 1 << 1, +ImGuiDragDropFlags_SourceNoHoldToOpenOthers = 1 << 2, +ImGuiDragDropFlags_SourceAllowNullID = 1 << 3, +ImGuiDragDropFlags_SourceExtern = 1 << 4, +ImGuiDragDropFlags_AcceptBeforeDelivery = 1 << 10, +ImGuiDragDropFlags_AcceptNoDrawDefaultRect = 1 << 11, +ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect +}; +enum ImGuiDir_ +{ +ImGuiDir_None = -1, +ImGuiDir_Left = 0, +ImGuiDir_Right = 1, +ImGuiDir_Up = 2, +ImGuiDir_Down = 3, +ImGuiDir_COUNT +}; +enum ImGuiKey_ +{ +ImGuiKey_Tab, +ImGuiKey_LeftArrow, +ImGuiKey_RightArrow, +ImGuiKey_UpArrow, +ImGuiKey_DownArrow, +ImGuiKey_PageUp, +ImGuiKey_PageDown, +ImGuiKey_Home, +ImGuiKey_End, +ImGuiKey_Insert, +ImGuiKey_Delete, +ImGuiKey_Backspace, +ImGuiKey_Space, +ImGuiKey_Enter, +ImGuiKey_Escape, +ImGuiKey_A, +ImGuiKey_C, +ImGuiKey_V, +ImGuiKey_X, +ImGuiKey_Y, +ImGuiKey_Z, +ImGuiKey_COUNT +}; +enum ImGuiNavInput_ +{ +ImGuiNavInput_Activate, +ImGuiNavInput_Cancel, +ImGuiNavInput_Input, +ImGuiNavInput_Menu, +ImGuiNavInput_DpadLeft, +ImGuiNavInput_DpadRight, +ImGuiNavInput_DpadUp, +ImGuiNavInput_DpadDown, +ImGuiNavInput_LStickLeft, +ImGuiNavInput_LStickRight, +ImGuiNavInput_LStickUp, +ImGuiNavInput_LStickDown, +ImGuiNavInput_FocusPrev, +ImGuiNavInput_FocusNext, +ImGuiNavInput_TweakSlow, +ImGuiNavInput_TweakFast, +ImGuiNavInput_KeyMenu_, +ImGuiNavInput_KeyLeft_, +ImGuiNavInput_KeyRight_, +ImGuiNavInput_KeyUp_, +ImGuiNavInput_KeyDown_, +ImGuiNavInput_COUNT, +ImGuiNavInput_InternalStart_ = ImGuiNavInput_KeyMenu_ +}; +enum ImGuiConfigFlags_ +{ +ImGuiConfigFlags_NavEnableKeyboard = 1 << 0, +ImGuiConfigFlags_NavEnableGamepad = 1 << 1, +ImGuiConfigFlags_NavEnableSetMousePos = 1 << 2, +ImGuiConfigFlags_NavNoCaptureKeyboard = 1 << 3, +ImGuiConfigFlags_NoMouse = 1 << 4, +ImGuiConfigFlags_NoMouseCursorChange = 1 << 5, +ImGuiConfigFlags_IsSRGB = 1 << 20, +ImGuiConfigFlags_IsTouchScreen = 1 << 21 +}; +enum ImGuiBackendFlags_ +{ +ImGuiBackendFlags_HasGamepad = 1 << 0, +ImGuiBackendFlags_HasMouseCursors = 1 << 1, +ImGuiBackendFlags_HasSetMousePos = 1 << 2 +}; +enum ImGuiCol_ +{ +ImGuiCol_Text, +ImGuiCol_TextDisabled, +ImGuiCol_WindowBg, +ImGuiCol_ChildBg, +ImGuiCol_PopupBg, +ImGuiCol_Border, +ImGuiCol_BorderShadow, +ImGuiCol_FrameBg, +ImGuiCol_FrameBgHovered, +ImGuiCol_FrameBgActive, +ImGuiCol_TitleBg, +ImGuiCol_TitleBgActive, +ImGuiCol_TitleBgCollapsed, +ImGuiCol_MenuBarBg, +ImGuiCol_ScrollbarBg, +ImGuiCol_ScrollbarGrab, +ImGuiCol_ScrollbarGrabHovered, +ImGuiCol_ScrollbarGrabActive, +ImGuiCol_CheckMark, +ImGuiCol_SliderGrab, +ImGuiCol_SliderGrabActive, +ImGuiCol_Button, +ImGuiCol_ButtonHovered, +ImGuiCol_ButtonActive, +ImGuiCol_Header, +ImGuiCol_HeaderHovered, +ImGuiCol_HeaderActive, +ImGuiCol_Separator, +ImGuiCol_SeparatorHovered, +ImGuiCol_SeparatorActive, +ImGuiCol_ResizeGrip, +ImGuiCol_ResizeGripHovered, +ImGuiCol_ResizeGripActive, +ImGuiCol_PlotLines, +ImGuiCol_PlotLinesHovered, +ImGuiCol_PlotHistogram, +ImGuiCol_PlotHistogramHovered, +ImGuiCol_TextSelectedBg, +ImGuiCol_ModalWindowDarkening, +ImGuiCol_DragDropTarget, +ImGuiCol_NavHighlight, +ImGuiCol_NavWindowingHighlight, +ImGuiCol_COUNT +, ImGuiCol_ChildWindowBg = ImGuiCol_ChildBg, ImGuiCol_Column = ImGuiCol_Separator, ImGuiCol_ColumnHovered = ImGuiCol_SeparatorHovered, ImGuiCol_ColumnActive = ImGuiCol_SeparatorActive +}; +enum ImGuiStyleVar_ +{ +ImGuiStyleVar_Alpha, +ImGuiStyleVar_WindowPadding, +ImGuiStyleVar_WindowRounding, +ImGuiStyleVar_WindowBorderSize, +ImGuiStyleVar_WindowMinSize, +ImGuiStyleVar_WindowTitleAlign, +ImGuiStyleVar_ChildRounding, +ImGuiStyleVar_ChildBorderSize, +ImGuiStyleVar_PopupRounding, +ImGuiStyleVar_PopupBorderSize, +ImGuiStyleVar_FramePadding, +ImGuiStyleVar_FrameRounding, +ImGuiStyleVar_FrameBorderSize, +ImGuiStyleVar_ItemSpacing, +ImGuiStyleVar_ItemInnerSpacing, +ImGuiStyleVar_IndentSpacing, +ImGuiStyleVar_ScrollbarSize, +ImGuiStyleVar_ScrollbarRounding, +ImGuiStyleVar_GrabMinSize, +ImGuiStyleVar_GrabRounding, +ImGuiStyleVar_ButtonTextAlign, +ImGuiStyleVar_COUNT +, ImGuiStyleVar_Count_ = ImGuiStyleVar_COUNT, ImGuiStyleVar_ChildWindowRounding = ImGuiStyleVar_ChildRounding +}; +enum ImGuiColorEditFlags_ +{ +ImGuiColorEditFlags_NoAlpha = 1 << 1, +ImGuiColorEditFlags_NoPicker = 1 << 2, +ImGuiColorEditFlags_NoOptions = 1 << 3, +ImGuiColorEditFlags_NoSmallPreview = 1 << 4, +ImGuiColorEditFlags_NoInputs = 1 << 5, +ImGuiColorEditFlags_NoTooltip = 1 << 6, +ImGuiColorEditFlags_NoLabel = 1 << 7, +ImGuiColorEditFlags_NoSidePreview = 1 << 8, +ImGuiColorEditFlags_AlphaBar = 1 << 9, +ImGuiColorEditFlags_AlphaPreview = 1 << 10, +ImGuiColorEditFlags_AlphaPreviewHalf= 1 << 11, +ImGuiColorEditFlags_HDR = 1 << 12, +ImGuiColorEditFlags_RGB = 1 << 13, +ImGuiColorEditFlags_HSV = 1 << 14, +ImGuiColorEditFlags_HEX = 1 << 15, +ImGuiColorEditFlags_Uint8 = 1 << 16, +ImGuiColorEditFlags_Float = 1 << 17, +ImGuiColorEditFlags_PickerHueBar = 1 << 18, +ImGuiColorEditFlags_PickerHueWheel = 1 << 19, +ImGuiColorEditFlags__InputsMask = ImGuiColorEditFlags_RGB|ImGuiColorEditFlags_HSV|ImGuiColorEditFlags_HEX, +ImGuiColorEditFlags__DataTypeMask = ImGuiColorEditFlags_Uint8|ImGuiColorEditFlags_Float, +ImGuiColorEditFlags__PickerMask = ImGuiColorEditFlags_PickerHueWheel|ImGuiColorEditFlags_PickerHueBar, +ImGuiColorEditFlags__OptionsDefault = ImGuiColorEditFlags_Uint8|ImGuiColorEditFlags_RGB|ImGuiColorEditFlags_PickerHueBar +}; +enum ImGuiMouseCursor_ +{ +ImGuiMouseCursor_None = -1, +ImGuiMouseCursor_Arrow = 0, +ImGuiMouseCursor_TextInput, +ImGuiMouseCursor_ResizeAll, +ImGuiMouseCursor_ResizeNS, +ImGuiMouseCursor_ResizeEW, +ImGuiMouseCursor_ResizeNESW, +ImGuiMouseCursor_ResizeNWSE, +ImGuiMouseCursor_COUNT +, ImGuiMouseCursor_Count_ = ImGuiMouseCursor_COUNT +}; +enum ImGuiCond_ +{ +ImGuiCond_Always = 1 << 0, +ImGuiCond_Once = 1 << 1, +ImGuiCond_FirstUseEver = 1 << 2, +ImGuiCond_Appearing = 1 << 3 +, ImGuiSetCond_Always = ImGuiCond_Always, ImGuiSetCond_Once = ImGuiCond_Once, ImGuiSetCond_FirstUseEver = ImGuiCond_FirstUseEver, ImGuiSetCond_Appearing = ImGuiCond_Appearing +}; +struct ImGuiStyle +{ +float Alpha; +ImVec2 WindowPadding; +float WindowRounding; +float WindowBorderSize; +ImVec2 WindowMinSize; +ImVec2 WindowTitleAlign; +float ChildRounding; +float ChildBorderSize; +float PopupRounding; +float PopupBorderSize; +ImVec2 FramePadding; +float FrameRounding; +float FrameBorderSize; +ImVec2 ItemSpacing; +ImVec2 ItemInnerSpacing; +ImVec2 TouchExtraPadding; +float IndentSpacing; +float ColumnsMinSpacing; +float ScrollbarSize; +float ScrollbarRounding; +float GrabMinSize; +float GrabRounding; +ImVec2 ButtonTextAlign; +ImVec2 DisplayWindowPadding; +ImVec2 DisplaySafeAreaPadding; +float MouseCursorScale; +bool AntiAliasedLines; +bool AntiAliasedFill; +float CurveTessellationTol; +ImVec4 Colors[ImGuiCol_COUNT]; +}; +typedef struct ImGuiStyle ImGuiStyle; +struct ImGuiIO +{ +ImGuiConfigFlags ConfigFlags; +ImGuiBackendFlags BackendFlags; +ImVec2 DisplaySize; +float DeltaTime; +float IniSavingRate; +const char* IniFilename; +const char* LogFilename; +float MouseDoubleClickTime; +float MouseDoubleClickMaxDist; +float MouseDragThreshold; +int KeyMap[ImGuiKey_COUNT]; +float KeyRepeatDelay; +float KeyRepeatRate; +void* UserData; +ImFontAtlas* Fonts; +float FontGlobalScale; +bool FontAllowUserScaling; +ImFont* FontDefault; +ImVec2 DisplayFramebufferScale; +ImVec2 DisplayVisibleMin; +ImVec2 DisplayVisibleMax; +bool OptMacOSXBehaviors; +bool OptCursorBlink; +void* ClipboardUserData; +void* ImeWindowHandle; +ImVec2 MousePos; +bool MouseDown[5]; +float MouseWheel; +float MouseWheelH; +bool MouseDrawCursor; +bool KeyCtrl; +bool KeyShift; +bool KeyAlt; +bool KeySuper; +bool KeysDown[512]; +ImWchar InputCharacters[16+1]; +float NavInputs[ImGuiNavInput_COUNT]; +bool WantCaptureMouse; +bool WantCaptureKeyboard; +bool WantTextInput; +bool WantSetMousePos; +bool NavActive; +bool NavVisible; +float Framerate; +int MetricsRenderVertices; +int MetricsRenderIndices; +int MetricsActiveWindows; +ImVec2 MouseDelta; +ImVec2 MousePosPrev; +ImVec2 MouseClickedPos[5]; +float MouseClickedTime[5]; +bool MouseClicked[5]; +bool MouseDoubleClicked[5]; +bool MouseReleased[5]; +bool MouseDownOwned[5]; +float MouseDownDuration[5]; +float MouseDownDurationPrev[5]; +ImVec2 MouseDragMaxDistanceAbs[5]; +float MouseDragMaxDistanceSqr[5]; +float KeysDownDuration[512]; +float KeysDownDurationPrev[512]; +float NavInputsDownDuration[ImGuiNavInput_COUNT]; +float NavInputsDownDurationPrev[ImGuiNavInput_COUNT]; +}; +typedef struct ImGuiIO ImGuiIO; +struct ImVector +{ +int Size; +int Capacity; +void* Data; +}; +typedef struct ImVector ImVector;struct ImNewDummy {}; +struct ImGuiOnceUponAFrame +{ + int RefFrame; +}; +typedef struct ImGuiOnceUponAFrame ImGuiOnceUponAFrame; +struct ImGuiTextFilter +{ +char InputBuf[256]; +ImVector/**/ Filters; +int CountGrep; +}; +typedef struct ImGuiTextFilter ImGuiTextFilter; +struct ImGuiTextBuffer +{ +ImVector/**/ Buf; +}; +typedef struct ImGuiTextBuffer ImGuiTextBuffer; +struct ImGuiStorage +{ +ImVector/**/ Data; +}; +typedef struct ImGuiStorage ImGuiStorage; +struct ImGuiTextEditCallbackData +{ +ImGuiInputTextFlags EventFlag; +ImGuiInputTextFlags Flags; +void* UserData; +bool ReadOnly; +ImWchar EventChar; +ImGuiKey EventKey; +char* Buf; +int BufTextLen; +int BufSize; +bool BufDirty; +int CursorPos; +int SelectionStart; +int SelectionEnd; +}; +typedef struct ImGuiTextEditCallbackData ImGuiTextEditCallbackData; +struct ImGuiSizeCallbackData +{ +void* UserData; +ImVec2 Pos; +ImVec2 CurrentSize; +ImVec2 DesiredSize; +}; +typedef struct ImGuiSizeCallbackData ImGuiSizeCallbackData; +struct ImGuiPayload +{ +const void* Data; +int DataSize; +ImGuiID SourceId; +ImGuiID SourceParentId; +int DataFrameCount; +char DataType[32+1]; +bool Preview; +bool Delivery; +}; +typedef struct ImGuiPayload ImGuiPayload; +struct ImColor +{ +ImVec4 Value; +}; +typedef struct ImColor ImColor; +struct ImGuiListClipper +{ +float StartPosY; +float ItemsHeight; +int ItemsCount, StepNo, DisplayStart, DisplayEnd; +}; +typedef struct ImGuiListClipper ImGuiListClipper; +typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* cmd); +struct ImDrawCmd +{ +unsigned int ElemCount; +ImVec4 ClipRect; +ImTextureID TextureId; +ImDrawCallback UserCallback; +void* UserCallbackData; +}; +typedef struct ImDrawCmd ImDrawCmd; +typedef unsigned short ImDrawIdx; +struct ImDrawVert +{ +ImVec2 pos; +ImVec2 uv; +ImU32 col; +}; +typedef struct ImDrawVert ImDrawVert; +struct ImDrawChannel +{ +ImVector/**/ CmdBuffer; +ImVector/**/ IdxBuffer; +}; +typedef struct ImDrawChannel ImDrawChannel; +enum ImDrawCornerFlags_ +{ +ImDrawCornerFlags_TopLeft = 1 << 0, +ImDrawCornerFlags_TopRight = 1 << 1, +ImDrawCornerFlags_BotLeft = 1 << 2, +ImDrawCornerFlags_BotRight = 1 << 3, +ImDrawCornerFlags_Top = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_TopRight, +ImDrawCornerFlags_Bot = ImDrawCornerFlags_BotLeft | ImDrawCornerFlags_BotRight, +ImDrawCornerFlags_Left = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_BotLeft, +ImDrawCornerFlags_Right = ImDrawCornerFlags_TopRight | ImDrawCornerFlags_BotRight, +ImDrawCornerFlags_All = 0xF +}; +enum ImDrawListFlags_ +{ +ImDrawListFlags_AntiAliasedLines = 1 << 0, +ImDrawListFlags_AntiAliasedFill = 1 << 1 +}; +struct ImDrawList +{ +ImVector/**/ CmdBuffer; +ImVector/**/ IdxBuffer; +ImVector/**/ VtxBuffer; +ImDrawListFlags Flags; +const ImDrawListSharedData* _Data; +const char* _OwnerName; +unsigned int _VtxCurrentIdx; +ImDrawVert* _VtxWritePtr; +ImDrawIdx* _IdxWritePtr; +ImVector/**/ _ClipRectStack; +ImVector/**/ _TextureIdStack; +ImVector/**/ _Path; +int _ChannelsCurrent; +int _ChannelsCount; +ImVector/**/ _Channels; +}; +typedef struct ImDrawList ImDrawList; +struct ImDrawData +{ +bool Valid; +ImDrawList** CmdLists; +int CmdListsCount; +int TotalIdxCount; +int TotalVtxCount; +}; +typedef struct ImDrawData ImDrawData; +struct ImFontConfig +{ +void* FontData; +int FontDataSize; +bool FontDataOwnedByAtlas; +int FontNo; +float SizePixels; +int OversampleH; +int OversampleV; +bool PixelSnapH; +ImVec2 GlyphExtraSpacing; +ImVec2 GlyphOffset; +const ImWchar* GlyphRanges; +bool MergeMode; +unsigned int RasterizerFlags; +float RasterizerMultiply; +char Name[40]; +ImFont* DstFont; +}; +typedef struct ImFontConfig ImFontConfig; +struct ImFontGlyph +{ +ImWchar Codepoint; +float AdvanceX; +float X0, Y0, X1, Y1; +float U0, V0, U1, V1; +}; +typedef struct ImFontGlyph ImFontGlyph; +enum ImFontAtlasFlags_ +{ +ImFontAtlasFlags_NoPowerOfTwoHeight = 1 << 0, +ImFontAtlasFlags_NoMouseCursors = 1 << 1 +}; +struct ImFontAtlas +{ +ImFontAtlasFlags Flags; +ImTextureID TexID; +int TexDesiredWidth; +int TexGlyphPadding; +unsigned char* TexPixelsAlpha8; +unsigned int* TexPixelsRGBA32; +int TexWidth; +int TexHeight; +ImVec2 TexUvScale; +ImVec2 TexUvWhitePixel; +ImVector/**/ Fonts; +ImVector/**/ CustomRects; +ImVector/**/ ConfigData; +int CustomRectIds[1]; +}; +typedef struct ImFontAtlas ImFontAtlas; +struct ImFont +{ +float FontSize; +float Scale; +ImVec2 DisplayOffset; +ImVector/**/ Glyphs; +ImVector/**/ IndexAdvanceX; +ImVector/**/ IndexLookup; +const ImFontGlyph* FallbackGlyph; +float FallbackAdvanceX; +ImWchar FallbackChar; +short ConfigDataCount; +ImFontConfig* ConfigData; +ImFontAtlas* ContainerAtlas; +float Ascent, Descent; +bool DirtyLookupTables; +int MetricsTotalSurface; +}; +typedef struct ImFont ImFont; +struct GlyphRangesBuilder +{ +ImVector/**/ UsedChars; +}; +typedef struct GlyphRangesBuilder GlyphRangesBuilder; + +struct CustomRect +{ +unsigned int ID; +unsigned short Width, Height; +unsigned short X, Y; +float GlyphAdvanceX; +ImVec2 GlyphOffset; +ImFont* Font; +}; +typedef struct CustomRect CustomRect; + +struct TextRange +{ +const char* b; +const char* e; +}; +typedef struct TextRange TextRange; + +struct Pair +{ +ImGuiID key; +union { int val_i; float val_f; void* val_p; }; +}; +typedef struct Pair Pair; + +//////////////// END AUTOGENERATED SEGMENT +#endif //IMGUI_STRUCTS_INCLUDED