1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Take a look at the license at the top of the repository in the LICENSE file.

use crate::PadActionType;

/// Struct defining a pad action entry.
#[derive(Debug, Clone)]
#[doc(alias = "GtkPadActionEntry")]
pub struct PadActionEntry {
    type_: PadActionType,
    index: i32,
    mode: i32,
    label: String,
    action_name: String,
}

impl PadActionEntry {
    pub fn new(
        type_: PadActionType,
        index: i32,
        mode: i32,
        label: &str,
        action_name: &str,
    ) -> Self {
        assert_initialized_main_thread!();
        Self {
            type_,
            index,
            mode,
            label: label.to_owned(),
            action_name: action_name.to_owned(),
        }
    }

    pub fn type_(&self) -> PadActionType {
        self.type_
    }

    pub fn index(&self) -> i32 {
        self.index
    }

    pub fn mode(&self) -> i32 {
        self.mode
    }

    pub fn label(&self) -> &str {
        &self.label
    }

    pub fn action_name(&self) -> &str {
        &self.action_name
    }
}