pub struct GuiPanels<'session> { /* private fields */ }Expand description
GUI panel operations of a session (session.gui_panels()).
Implementations§
Source§impl<'session> GuiPanels<'session>
impl<'session> GuiPanels<'session>
Sourcepub fn get_or_create(&self, config: &GuiPanelConfig) -> Result<GuiPanelId>
pub fn get_or_create(&self, config: &GuiPanelConfig) -> Result<GuiPanelId>
Returns the panel named by config.common_name, creating it if
needed. Idempotent.
Sourcepub fn set_pose(&self, panel: GuiPanelId, pose: Pose) -> Result<()>
pub fn set_pose(&self, panel: GuiPanelId, pose: Pose) -> Result<()>
Moves the panel (top-edge midpoint, room space; see
GuiPanelConfig::pose).
Sourcepub fn set_size(&self, panel: GuiPanelId, size: GuiPanelSize) -> Result<()>
pub fn set_size(&self, panel: GuiPanelId, size: GuiPanelSize) -> Result<()>
Changes the panel’s size and content scale (qar_gui_panels_change_size).
Sourcepub fn set_state(&self, panel: GuiPanelId, state: GuiPanelState) -> Result<()>
pub fn set_state(&self, panel: GuiPanelId, state: GuiPanelState) -> Result<()>
Sets the panel’s state: visible, minimized or hidden (qar_gui_panels_set_state).
Points the panel at web content.
Sourcepub fn set_display_name(
&self,
panel: GuiPanelId,
display_name: &str,
) -> Result<()>
pub fn set_display_name( &self, panel: GuiPanelId, display_name: &str, ) -> Result<()>
Replaces the label shown above the panel, any content type
(qar_gui_panels_change_display_name). The rules of GuiPanelConfig::display_name
apply: a refused name is GUI_PANEL_DISPLAY_NAME_INVALID, never shortened, and the
panel keeps its previous name. An empty string shows no name.
Sourcepub fn set_served_content(
&self,
panel: GuiPanelId,
content: &GuiPanelServedContent,
) -> Result<()>
pub fn set_served_content( &self, panel: GuiPanelId, content: &GuiPanelServedContent, ) -> Result<()>
Shows another page, or another bundle of this session, on a served panel
(qar_gui_panels_set_served_content). A bundle another session published is
PANEL_CONTENT_NOT_PUBLISHER; a website or stream panel is
GUI_PANEL_CHANGE_NOT_PERMITTED, since the content type is fixed at creation.
Sourcepub fn close(&self, panel: GuiPanelId) -> Result<()>
pub fn close(&self, panel: GuiPanelId) -> Result<()>
Closes and removes the panel (qar_gui_panels_close_panel).
Sourcepub fn list(&self) -> Result<Vec<GuiPanelInfo>>
pub fn list(&self) -> Result<Vec<GuiPanelInfo>>
Snapshot of every panel in the session.
Sourcepub fn subscribe(
&self,
callback: impl Fn(GuiPanelInfo) + Send + Sync + 'static,
) -> Result<Subscription>
pub fn subscribe( &self, callback: impl Fn(GuiPanelInfo) + Send + Sync + 'static, ) -> Result<Subscription>
Calls callback with a snapshot whenever any panel changes. Runs on
library threads.
Sourcepub fn subscribe_panel(
&self,
panel: GuiPanelId,
callback: impl Fn(GuiPanelInfo) + Send + Sync + 'static,
) -> Result<Subscription>
pub fn subscribe_panel( &self, panel: GuiPanelId, callback: impl Fn(GuiPanelInfo) + Send + Sync + 'static, ) -> Result<Subscription>
Like GuiPanels::subscribe, for one panel.