rive_rs/animation/
state_machine_component.rs

1// Copyright 2021 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use crate::core::{Core, ObjectRef, OnAdded, Property};
6
7#[derive(Debug, Default)]
8pub struct StateMachineComponent {
9    name: Property<String>,
10}
11
12impl ObjectRef<'_, StateMachineComponent> {
13    pub fn name(&self) -> String {
14        self.name.get()
15    }
16
17    pub fn set_name(&self, name: String) {
18        self.name.set(name);
19    }
20}
21
22impl Core for StateMachineComponent {
23    properties![(138, name, set_name)];
24}
25
26impl OnAdded for ObjectRef<'_, StateMachineComponent> {
27    on_added!();
28}