Skip to main content

gtk/
pad_action_entry.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use crate::PadActionType;
4
5/// Struct defining a pad action entry.
6#[derive(Debug, Clone)]
7pub struct PadActionEntry {
8    type_: PadActionType,
9    index: i32,
10    mode: i32,
11    label: String,
12    action_name: String,
13}
14
15impl PadActionEntry {
16    pub fn new(
17        type_: PadActionType,
18        index: i32,
19        mode: i32,
20        label: &str,
21        action_name: &str,
22    ) -> PadActionEntry {
23        assert_initialized_main_thread!();
24        PadActionEntry {
25            type_,
26            index,
27            mode,
28            label: label.to_owned(),
29            action_name: action_name.to_owned(),
30        }
31    }
32
33    #[doc(alias = "get_type")]
34    pub fn type_(&self) -> PadActionType {
35        self.type_
36    }
37
38    #[doc(alias = "get_index")]
39    pub fn index(&self) -> i32 {
40        self.index
41    }
42
43    #[doc(alias = "get_mode")]
44    pub fn mode(&self) -> i32 {
45        self.mode
46    }
47
48    #[doc(alias = "get_label")]
49    pub fn label(&self) -> &str {
50        &self.label
51    }
52
53    #[doc(alias = "get_action_name")]
54    pub fn action_name(&self) -> &str {
55        &self.action_name
56    }
57}