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
impl Viewport
Sourcepub fn main() -> &'static Self
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.
Sourcepub unsafe fn from_raw_mut(raw: *mut ImGuiViewport) -> &'static mut Self
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.
Sourcepub fn as_raw(&self) -> *const ImGuiViewport
pub fn as_raw(&self) -> *const ImGuiViewport
Get the raw pointer to the underlying ImGuiViewport
Sourcepub fn as_raw_mut(&mut self) -> *mut ImGuiViewport
pub fn as_raw_mut(&mut self) -> *mut ImGuiViewport
Get the raw mutable pointer to the underlying ImGuiViewport
Sourcepub fn work_pos(&self) -> [f32; 2]
pub fn work_pos(&self) -> [f32; 2]
Get the viewport work position (excluding menu bars, task bars, etc.)
Sourcepub fn work_size(&self) -> [f32; 2]
pub fn work_size(&self) -> [f32; 2]
Get the viewport work size (excluding menu bars, task bars, etc.)
pub fn is_main(&self) -> bool
pub fn is_platform_window(&self) -> bool
pub fn is_platform_monitor(&self) -> bool
pub fn is_owned_by_app(&self) -> bool
Sourcepub fn platform_user_data(&self) -> *mut c_void
pub fn platform_user_data(&self) -> *mut c_void
Get the platform user data
Sourcepub fn set_platform_user_data(&mut self, data: *mut c_void)
pub fn set_platform_user_data(&mut self, data: *mut c_void)
Set the platform user data
Sourcepub fn renderer_user_data(&self) -> *mut c_void
pub fn renderer_user_data(&self) -> *mut c_void
Get the renderer user data
Sourcepub fn set_renderer_user_data(&mut self, data: *mut c_void)
pub fn set_renderer_user_data(&mut self, data: *mut c_void)
Set the renderer user data
Sourcepub fn platform_handle(&self) -> *mut c_void
pub fn platform_handle(&self) -> *mut c_void
Get the platform handle
Sourcepub fn set_platform_handle(&mut self, handle: *mut c_void)
pub fn set_platform_handle(&mut self, handle: *mut c_void)
Set the platform handle
Sourcepub fn platform_window_created(&self) -> bool
pub fn platform_window_created(&self) -> bool
Check if the platform window was created
Sourcepub fn set_platform_window_created(&mut self, created: bool)
pub fn set_platform_window_created(&mut self, created: bool)
Set whether the platform window was created
Sourcepub fn platform_request_move(&self) -> bool
pub fn platform_request_move(&self) -> bool
Check if the platform requested move
Sourcepub fn set_platform_request_move(&mut self, request: bool)
pub fn set_platform_request_move(&mut self, request: bool)
Set whether the platform requested move
Sourcepub fn platform_request_resize(&self) -> bool
pub fn platform_request_resize(&self) -> bool
Check if the platform requested resize
Sourcepub fn set_platform_request_resize(&mut self, request: bool)
pub fn set_platform_request_resize(&mut self, request: bool)
Set whether the platform requested resize
Sourcepub fn platform_request_close(&self) -> bool
pub fn platform_request_close(&self) -> bool
Check if the platform requested close
Sourcepub fn set_platform_request_close(&mut self, request: bool)
pub fn set_platform_request_close(&mut self, request: bool)
Set whether the platform requested close
Sourcepub fn flags(&self) -> ImGuiViewportFlags
pub fn flags(&self) -> ImGuiViewportFlags
Get the viewport flags
Sourcepub fn set_flags(&mut self, flags: ImGuiViewportFlags)
pub fn set_flags(&mut self, flags: ImGuiViewportFlags)
Set the viewport flags