Skip to main content

SceneCollectionEditor

Struct SceneCollectionEditor 

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

Undo/redo editor for the persisted scene-collection model.

History stores complete versioned document snapshots rather than runtime/native object IDs. Item/source/group IDs therefore remain stable across undo/redo. Group/ungroup operations accept the post-operation replacement snapshots, matching libobs’s native semantics where ungrouping creates replacement parent-scene items instead of preserving the old native handles.

Implementations§

Source§

impl SceneCollectionEditor

Source

pub fn new( document: SceneCollectionDocument, ) -> Result<Self, SceneCollectionError>

Source

pub fn document(&self) -> &SceneCollectionDocument

Source

pub fn into_document(self) -> SceneCollectionDocument

Source

pub fn can_undo(&self) -> bool

Source

pub fn can_redo(&self) -> bool

Source

pub fn next_undo_label(&self) -> Option<&str>

Source

pub fn next_redo_label(&self) -> Option<&str>

Source

pub fn undo(&mut self) -> bool

Source

pub fn redo(&mut self) -> bool

Source

pub fn set_item_state( &mut self, scene_id: &str, item_id: &str, state: PersistedSceneItemState, ) -> Result<(), SceneCollectionError>

Replaces one item’s complete persisted transform/visibility/lock/order snapshot.

Source

pub fn move_top_level_item( &mut self, scene_id: &str, item_id: &str, new_index: usize, ) -> Result<(), SceneCollectionError>

Reorders one top-level source/group node in the persisted native bottom-to-top order.

Source

pub fn replace_items_with_group( &mut self, scene_id: &str, selected_item_ids: &[String], group: PersistedGroup, ) -> Result<(), SceneCollectionError>

Replaces selected top-level source items with the supplied post-grouping snapshot.

group.items must contain exactly the selected persistent item IDs. This lets a live editor capture libobs’s post-reparent child snapshots and record them without pretending native scene-item handles survived grouping unchanged.

Source

pub fn ungroup_with_replacements( &mut self, scene_id: &str, group_id: &str, replacements: Vec<PersistedSourceItem>, ) -> Result<(), SceneCollectionError>

Replaces a group with the post-ungroup replacement item snapshots returned/captured after libobs created new parent-scene items.

Trait Implementations§

Source§

impl Clone for SceneCollectionEditor

Source§

fn clone(&self) -> Self

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 SceneCollectionEditor

Source§

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

Formats the value using the given formatter. 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.