Skip to content

Commit

Permalink
Merge pull request #261 from masc-it/docking
Browse files Browse the repository at this point in the history
Implement Docking features
  • Loading branch information
KinoxKlark committed Oct 27, 2022
2 parents 3c9079e + b5fedf9 commit fd64fd4
Show file tree
Hide file tree
Showing 4 changed files with 347 additions and 71 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![completion](https://img.shields.io/badge/completion-66%25%20%28518%20of%20782%29-blue.svg)](https://github.com/pyimgui/pyimgui)
[![completion](https://img.shields.io/badge/completion-71%25%20%28560%20of%20782%29-blue.svg)](https://github.com/pyimgui/pyimgui)
[![Coverage Status](https://coveralls.io/repos/github/pyimgui/pyimgui/badge.svg?branch=docking)](https://coveralls.io/github/swistakm/pyimgui?branch=docking)
[![Documentation Status](https://readthedocs.org/projects/pyimgui/badge/?version=latest)](https://pyimgui.readthedocs.io/en/latest/?badge=latest)
[![Build status](https://ci.appveyor.com/api/projects/status/mr97t941p6k4c261/branch/docking?svg=true)](https://ci.appveyor.com/project/KinoxKlark/pyimgui/branch/docking)
Expand Down
91 changes: 45 additions & 46 deletions imgui/cimgui.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,20 @@ cdef extern from "imgui.h":
bool FontAllowUserScaling #
ImFont* FontDefault #
ImVec2 DisplayFramebufferScale #
#ImVec2 DisplayVisibleMin # ✓ # DEPRECIATED
#ImVec2 DisplayVisibleMax # ✓ # DEPRECIATED
#ImVec2 DisplayVisibleMin # ✓ # DEPRECATED
#ImVec2 DisplayVisibleMax # ✓ # DEPRECATED

# Docking options (when ImGuiConfigFlags_DockingEnable is set)
bool ConfigDockingNoSplit # # = false # Simplified docking mode: disable window splitting, so docking is limited to merging multiple windows together into tab-bars.
bool ConfigDockingWithShift # # = false # Enable docking with holding Shift key (reduce visual noise, allows dropping in wider space)
bool ConfigDockingAlwaysTabBar # # = false # [BETA] [FIXME: This currently creates regression with auto-sizing and general overhead] Make every single floating window display within a docking node.
bool ConfigDockingTransparentPayload # # = false # [BETA] Make window or viewport transparent when docking and only display docking boxes on the target viewport. Useful if rendering of multiple viewport cannot be synced. Best used with ConfigViewportsNoAutoMerge.
bool ConfigDockingNoSplit # # = false # Simplified docking mode: disable window splitting, so docking is limited to merging multiple windows together into tab-bars.
bool ConfigDockingWithShift # # = false # Enable docking with holding Shift key (reduce visual noise, allows dropping in wider space)
bool ConfigDockingAlwaysTabBar # # = false # [BETA] [FIXME: This currently creates regression with auto-sizing and general overhead] Make every single floating window display within a docking node.
bool ConfigDockingTransparentPayload # # = false # [BETA] Make window or viewport transparent when docking and only display docking boxes on the target viewport. Useful if rendering of multiple viewport cannot be synced. Best used with ConfigViewportsNoAutoMerge.

# Viewport options (when ImGuiConfigFlags_ViewportsEnable is set)
bool ConfigViewportsNoAutoMerge # # = false; # Set to make all floating imgui windows always create their own viewport. Otherwise, they are merged into the main host viewports when overlapping it. May also set ImGuiViewportFlags_NoAutoMerge on individual viewport.
bool ConfigViewportsNoTaskBarIcon # # = false # Disable default OS task bar icon flag for secondary viewports. When a viewport doesn't want a task bar icon, ImGuiViewportFlags_NoTaskBarIcon will be set on it.
bool ConfigViewportsNoDecoration # # = true # Disable default OS window decoration flag for secondary viewports. When a viewport doesn't want window decorations, ImGuiViewportFlags_NoDecoration will be set on it. Enabling decoration can create subsequent issues at OS levels (e.g. minimum window size).
bool ConfigViewportsNoDefaultParent # # = false # Disable default OS parenting to main viewport for secondary viewports. By default, viewports are marked with ParentViewportId = <main_viewport>, expecting the platform backend to setup a parent/child relationship between the OS windows (some backend may ignore this). Set to true if you want the default to be 0, then all viewports will be top-level OS windows.
bool ConfigViewportsNoAutoMerge # # = false; # Set to make all floating imgui windows always create their own viewport. Otherwise, they are merged into the main host viewports when overlapping it. May also set ImGuiViewportFlags_NoAutoMerge on individual viewport.
bool ConfigViewportsNoTaskBarIcon # # = false # Disable default OS task bar icon flag for secondary viewports. When a viewport doesn't want a task bar icon, ImGuiViewportFlags_NoTaskBarIcon will be set on it.
bool ConfigViewportsNoDecoration # # = true # Disable default OS window decoration flag for secondary viewports. When a viewport doesn't want window decorations, ImGuiViewportFlags_NoDecoration will be set on it. Enabling decoration can create subsequent issues at OS levels (e.g. minimum window size).
bool ConfigViewportsNoDefaultParent # # = false # Disable default OS parenting to main viewport for secondary viewports. By default, viewports are marked with ParentViewportId = <main_viewport>, expecting the platform backend to setup a parent/child relationship between the OS windows (some backend may ignore this). Set to true if you want the default to be 0, then all viewports will be top-level OS windows.


# Miscellaneous options
Expand Down Expand Up @@ -213,7 +213,7 @@ cdef extern from "imgui.h":
bool MouseDown[5] #
float MouseWheel #
float MouseWheelH #
ImGuiID MouseHoveredViewport #
ImGuiID MouseHoveredViewport #
bool KeyCtrl #
bool KeyShift #
bool KeyAlt #
Expand Down Expand Up @@ -640,7 +640,7 @@ cdef extern from "imgui.h":
ImVec2 DisplayPos #
ImVec2 DisplaySize #
ImVec2 FramebufferScale #
ImGuiViewport* OwnerViewport #
ImGuiViewport* OwnerViewport #

void DeIndexAllBuffers() except + #
void ScaleClipRects(const ImVec2&) except + #
Expand Down Expand Up @@ -902,28 +902,28 @@ cdef extern from "imgui.h":
# todo: find a way to access enum var here
ImVec4* Colors

void ScaleAllSizes(float scale_factor) except + #

ctypedef struct ImGuiWindowClass: #
ImGuiID ClassId #
ImGuiID ParentViewportId #
ImGuiViewportFlags ViewportFlagsOverrideSet #
ImGuiViewportFlags ViewportFlagsOverrideClear #
ImGuiTabItemFlags TabItemFlagsOverrideSet #
ImGuiDockNodeFlags DockNodeFlagsOverrideSet #
ImGuiDockNodeFlags DockNodeFlagsOverrideClear #
bool DockingAlwaysTabBar #
bool DockingAllowUnclassed #
void ScaleAllSizes(float scale_factor) except + #

ctypedef struct ImGuiWindowClass: #
ImGuiID ClassId #
ImGuiID ParentViewportId #
ImGuiViewportFlags ViewportFlagsOverrideSet #
ImGuiViewportFlags ViewportFlagsOverrideClear #
ImGuiTabItemFlags TabItemFlagsOverrideSet #
ImGuiDockNodeFlags DockNodeFlagsOverrideSet #
ImGuiDockNodeFlags DockNodeFlagsOverrideClear #
bool DockingAlwaysTabBar #
bool DockingAllowUnclassed #
ImGuiWindowClass() except + #


ctypedef struct ImGuiPayload: #
ctypedef struct ImGuiPayload: #
void* Data #
int DataSize #

bool IsDataType(const char* type) except + #
bool IsPreview() except + #
bool IsDelivery() except + #
bool IsDataType(const char* type) except + #
bool IsPreview() except + #
bool IsDelivery() except + #

ctypedef struct ImGuiTableColumnSortSpecs: #
ImGuiID ColumnUserID #
Expand All @@ -944,23 +944,23 @@ cdef extern from "imgui.h":
pass

ctypedef struct ImGuiViewport: #
ImGuiID ID #
ImGuiID ID #
ImGuiViewportFlags Flags #
ImVec2 Pos #
ImVec2 Size #
ImVec2 WorkPos #
ImVec2 WorkSize #
float DpiScale #
ImGuiID ParentViewportId #
ImDrawData* DrawData #
float DpiScale #
ImGuiID ParentViewportId #
ImDrawData* DrawData #

void* RendererUserData #
void* PlatformUserData #
void* PlatformHandle #
void* PlatformHandleRaw #
bool PlatformRequestMove #
bool PlatformRequestResize #
bool PlatformRequestClose #
bool PlatformRequestMove #
bool PlatformRequestResize #
bool PlatformRequestClose #

ImVec2 GetCenter() except + #
ImVec2 GetWorkCenter() except + #
Expand Down Expand Up @@ -1068,12 +1068,12 @@ cdef extern from "imgui.h" namespace "ImGui":
ImGuiFocusedFlags flags # = 0
) except +
ImDrawList* GetWindowDrawList() except + #
float GetWindowDpiScale() except + #
float GetWindowDpiScale() except + #
ImVec2 GetWindowPos() except + #
ImVec2 GetWindowSize() except + #
float GetWindowWidth() except + #
float GetWindowHeight() except + #
ImGuiViewport* GetWindowViewport() except + #
ImGuiViewport* GetWindowViewport() except + #

void SetNextWindowPos( # ✓ note: overrides ommited
const ImVec2& pos,
Expand Down Expand Up @@ -1101,7 +1101,7 @@ cdef extern from "imgui.h" namespace "ImGui":
) except +
void SetNextWindowFocus() except + #
void SetNextWindowBgAlpha(float alpha) except + #
void SetNextWindowViewport(ImGuiID viewport_id) except + #
void SetNextWindowViewport(ImGuiID viewport_id) except + #
void SetWindowPos( #
const ImVec2& pos,
# note: optional
Expand Down Expand Up @@ -2099,8 +2099,8 @@ cdef extern from "imgui.h" namespace "ImGui":
) except + #
# set next window class (rare/advanced uses: provide hints to the platform backend via altered viewport flags and parent/child info)
void SetNextWindowClass(const ImGuiWindowClass* window_class) except + #
ImGuiID GetWindowDockID() except + #
bool IsWindowDocked() except + #
ImGuiID GetWindowDockID() except + #
bool IsWindowDocked() except + #

# ====
# Logging/Capture
Expand Down Expand Up @@ -2334,14 +2334,13 @@ cdef extern from "imgui.h" namespace "ImGui":
# Read comments around the ImGuiPlatformIO structure for more details.
# Note: You may use GetWindowViewport() to get the current viewport of the current window.
ImGuiPlatformIO& GetPlatformIO() except + #
void UpdatePlatformWindows() except + #
void UpdatePlatformWindows() except + #
void RenderPlatformWindowsDefault(
# note: optional
void* platform_render_arg, # = NULL
void* renderer_render_arg # = NULL
) except + #
void DestroyPlatformWindows() except + #
ImGuiViewport* FindViewportByID(ImGuiID id) except + #
ImGuiViewport* FindViewportByPlatformHandle(void* platform_handle) except + #
) except + #
void DestroyPlatformWindows() except + #
ImGuiViewport* FindViewportByID(ImGuiID id) except + #
ImGuiViewport* FindViewportByPlatformHandle(void* platform_handle) except + #


0 comments on commit fd64fd4

Please sign in to comment.