pub struct WindowClass { /* private fields */ }Expand description
Window class for docking configuration.
Native pointer fields are intentionally private so safe code cannot bypass their lifetime contracts.
let mut class = WindowClass::default();
class.platform_icon_data = None;Implementations§
Source§impl WindowClass
impl WindowClass
Sourcepub fn class_id(&self) -> Option<Id>
pub fn class_id(&self) -> Option<Id>
Returns the user class ID, or None for the default unclassed class.
Sourcepub fn parent_viewport_policy(&self) -> WindowClassParentViewport
pub fn parent_viewport_policy(&self) -> WindowClassParentViewport
Returns the platform parent viewport policy.
Sourcepub fn focus_route_parent_window_id_raw(&self) -> Option<Id>
pub fn focus_route_parent_window_id_raw(&self) -> Option<Id>
Returns the raw focus-route parent window ID, when configured.
Sourcepub fn viewport_flags_to_set(&self) -> WindowClassViewportFlags
pub fn viewport_flags_to_set(&self) -> WindowClassViewportFlags
Returns the viewport flags this class sets.
Sourcepub fn viewport_flags_to_clear(&self) -> WindowClassViewportFlags
pub fn viewport_flags_to_clear(&self) -> WindowClassViewportFlags
Returns the viewport flags this class clears.
Sourcepub fn tab_item_options(&self) -> TabItemOptions
pub fn tab_item_options(&self) -> TabItemOptions
Returns the tab item options this class applies.
Sourcepub fn dock_node_flags_to_set(&self) -> WindowClassDockNodeFlags
pub fn dock_node_flags_to_set(&self) -> WindowClassDockNodeFlags
Returns the dock node flags this class applies.
Sourcepub fn always_tab_bar(&self) -> bool
pub fn always_tab_bar(&self) -> bool
Returns whether single floating windows always receive a tab bar.
Sourcepub fn allows_unclassed(&self) -> bool
pub fn allows_unclassed(&self) -> bool
Returns whether this class may dock with unclassed windows.
Sourcepub unsafe fn parent_viewport(self, parent: WindowClassParentViewport) -> Self
pub unsafe fn parent_viewport(self, parent: WindowClassParentViewport) -> Self
Sets the raw parent viewport policy.
§Safety
For WindowClassParentViewport::Parent, the target viewport must be live when the
window begins, belong to the same Context, and the resulting parent graph must contain no
self-edge or cycle. Dear ImGui stores a raw parent pointer and traverses it without cycle
detection. The Default and NoParent policies satisfy these requirements inherently.
Sourcepub fn no_parent_viewport(self) -> Self
pub fn no_parent_viewport(self) -> Self
Requests the platform backend to avoid parenting this class’s platform windows.
Sourcepub unsafe fn parent_viewport_id(self, id: Id) -> Self
pub unsafe fn parent_viewport_id(self, id: Id) -> Self
Sourcepub unsafe fn focus_route_parent_window_id(self, id: Id) -> Self
pub unsafe fn focus_route_parent_window_id(self, id: Id) -> Self
Sets the raw focus-route parent window ID.
§Safety
A window with id must already exist when a window using this class begins. The resulting
focus route must not contain a cycle and the class must not be applied to the parent window
itself. Dear ImGui assumes these conditions and may dereference the resolved parent without
checking it in non-assert builds.
let class = WindowClass::default().focus_route_parent_window_id(Id::from(1u32));Sourcepub fn viewport_flags_override_set(
self,
flags: WindowClassViewportFlags,
) -> Self
pub fn viewport_flags_override_set( self, flags: WindowClassViewportFlags, ) -> Self
Sets viewport flags when a window of this class owns a viewport.
Sourcepub fn viewport_flags_override_clear(
self,
flags: WindowClassViewportFlags,
) -> Self
pub fn viewport_flags_override_clear( self, flags: WindowClassViewportFlags, ) -> Self
Clears viewport flags when a window of this class owns a viewport.
Sourcepub fn viewport_flags_overrides(
self,
set: WindowClassViewportFlags,
clear: WindowClassViewportFlags,
) -> Self
pub fn viewport_flags_overrides( self, set: WindowClassViewportFlags, clear: WindowClassViewportFlags, ) -> Self
Sets and clears viewport flags when a window of this class owns a viewport.
Sourcepub fn tab_item_flags_override_set(
self,
options: impl Into<TabItemOptions>,
) -> Self
pub fn tab_item_flags_override_set( self, options: impl Into<TabItemOptions>, ) -> Self
Sets tab item flags when a window of this class is submitted into a dock node tab bar.
Sourcepub fn dock_node_flags_override_set(
self,
flags: WindowClassDockNodeFlags,
) -> Self
pub fn dock_node_flags_override_set( self, flags: WindowClassDockNodeFlags, ) -> Self
Sets dock node flags when a window of this class is hosted by a dock node.
Sourcepub fn docking_always_tab_bar(self, enabled: bool) -> Self
pub fn docking_always_tab_bar(self, enabled: bool) -> Self
Enables always showing tab bar for single floating windows
Sourcepub fn docking_allow_unclassed(self, enabled: bool) -> Self
pub fn docking_allow_unclassed(self, enabled: bool) -> Self
Allows docking with unclassed windows
Sourcepub unsafe fn platform_icon_data_raw(self, data: *mut c_void) -> Self
pub unsafe fn platform_icon_data_raw(self, data: *mut c_void) -> Self
Sets opaque icon data consumed by the platform backend.
§Safety
data must remain valid for as long as the platform backend may read it, and it must point
to the representation expected by that backend.
Sourcepub fn validate(&self) -> Result<(), WindowClassError>
pub fn validate(&self) -> Result<(), WindowClassError>
Validate every typed override without touching Dear ImGui state.
Trait Implementations§
Source§impl Clone for WindowClass
impl Clone for WindowClass
Source§fn clone(&self) -> WindowClass
fn clone(&self) -> WindowClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more