Viewport

Struct Viewport 

Source
pub struct Viewport { /* private fields */ }
Expand description

Viewport structure for multi-viewport support

This is a transparent wrapper around ImGuiViewport that provides safe access to viewport functionality.

Implementations§

Source§

impl Viewport

Source

pub fn main() -> &'static Self

Returns a reference to the main Dear ImGui viewport (safe wrapper)

This is the same viewport used by Ui::dockspace_over_main_viewport(). Requires an active ImGui context.

Source

pub unsafe fn from_raw_mut(raw: *mut ImGuiViewport) -> &'static mut Self

Get a mutable reference to the viewport from a raw pointer

§Safety

The caller must ensure that the pointer is valid and points to a valid ImGuiViewport structure, and that no other references exist.

Source

pub fn as_raw(&self) -> *const ImGuiViewport

Get the raw pointer to the underlying ImGuiViewport

Source

pub fn as_raw_mut(&mut self) -> *mut ImGuiViewport

Get the raw mutable pointer to the underlying ImGuiViewport

Source

pub fn id(&self) -> ImGuiID

Get the viewport ID

Source

pub fn set_pos(&mut self, pos: [f32; 2])

Set the viewport position

Source

pub fn pos(&self) -> [f32; 2]

Get the viewport position

Source

pub fn set_size(&mut self, size: [f32; 2])

Set the viewport size

Source

pub fn size(&self) -> [f32; 2]

Get the viewport size

Source

pub fn work_pos(&self) -> [f32; 2]

Get the viewport work position (excluding menu bars, task bars, etc.)

Source

pub fn work_size(&self) -> [f32; 2]

Get the viewport work size (excluding menu bars, task bars, etc.)

Source

pub fn is_main(&self) -> bool

Source

pub fn is_platform_window(&self) -> bool

Source

pub fn is_platform_monitor(&self) -> bool

Source

pub fn is_owned_by_app(&self) -> bool

Source

pub fn platform_user_data(&self) -> *mut c_void

Get the platform user data

Source

pub fn set_platform_user_data(&mut self, data: *mut c_void)

Set the platform user data

Source

pub fn renderer_user_data(&self) -> *mut c_void

Get the renderer user data

Source

pub fn set_renderer_user_data(&mut self, data: *mut c_void)

Set the renderer user data

Source

pub fn platform_handle(&self) -> *mut c_void

Get the platform handle

Source

pub fn set_platform_handle(&mut self, handle: *mut c_void)

Set the platform handle

Source

pub fn platform_window_created(&self) -> bool

Check if the platform window was created

Source

pub fn set_platform_window_created(&mut self, created: bool)

Set whether the platform window was created

Source

pub fn platform_request_move(&self) -> bool

Check if the platform requested move

Source

pub fn set_platform_request_move(&mut self, request: bool)

Set whether the platform requested move

Source

pub fn platform_request_resize(&self) -> bool

Check if the platform requested resize

Source

pub fn set_platform_request_resize(&mut self, request: bool)

Set whether the platform requested resize

Source

pub fn platform_request_close(&self) -> bool

Check if the platform requested close

Source

pub fn set_platform_request_close(&mut self, request: bool)

Set whether the platform requested close

Source

pub fn flags(&self) -> ImGuiViewportFlags

Get the viewport flags

Source

pub fn set_flags(&mut self, flags: ImGuiViewportFlags)

Set the viewport flags

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more