Skip to main content

WindowClass

Struct WindowClass 

Source
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

Source

pub fn new(class_id: Id) -> Self

Creates a new window class with the specified class ID

Source

pub fn class_id(&self) -> Option<Id>

Returns the user class ID, or None for the default unclassed class.

Source

pub fn parent_viewport_policy(&self) -> WindowClassParentViewport

Returns the platform parent viewport policy.

Source

pub fn focus_route_parent_window_id_raw(&self) -> Option<Id>

Returns the raw focus-route parent window ID, when configured.

Source

pub fn viewport_flags_to_set(&self) -> WindowClassViewportFlags

Returns the viewport flags this class sets.

Source

pub fn viewport_flags_to_clear(&self) -> WindowClassViewportFlags

Returns the viewport flags this class clears.

Source

pub fn tab_item_options(&self) -> TabItemOptions

Returns the tab item options this class applies.

Source

pub fn dock_node_flags_to_set(&self) -> WindowClassDockNodeFlags

Returns the dock node flags this class applies.

Source

pub fn always_tab_bar(&self) -> bool

Returns whether single floating windows always receive a tab bar.

Source

pub fn allows_unclassed(&self) -> bool

Returns whether this class may dock with unclassed windows.

Source

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.

Source

pub fn no_parent_viewport(self) -> Self

Requests the platform backend to avoid parenting this class’s platform windows.

Source

pub unsafe fn parent_viewport_id(self, id: Id) -> Self

Requests a specific raw parent viewport ID.

§Safety

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.

let class = WindowClass::default().parent_viewport_id(Id::from(1u32));
Source

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));
Source

pub fn viewport_flags_override_set( self, flags: WindowClassViewportFlags, ) -> Self

Sets viewport flags when a window of this class owns a viewport.

Source

pub fn viewport_flags_override_clear( self, flags: WindowClassViewportFlags, ) -> Self

Clears viewport flags when a window of this class owns a viewport.

Source

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.

Source

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.

Source

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.

Source

pub fn docking_always_tab_bar(self, enabled: bool) -> Self

Enables always showing tab bar for single floating windows

Source

pub fn docking_allow_unclassed(self, enabled: bool) -> Self

Allows docking with unclassed windows

Source

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.

Source

pub fn validate(&self) -> Result<(), WindowClassError>

Validate every typed override without touching Dear ImGui state.

Trait Implementations§

Source§

impl Clone for WindowClass

Source§

fn clone(&self) -> WindowClass

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WindowClass

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for WindowClass

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.