gtk/
pad_action_entry.rs

1// Copyright 2013-2018, The Gtk-rs Project Developers.
2// See the COPYRIGHT file at the top-level directory of this distribution.
3// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
4
5use PadActionType;
6
7#[derive(Debug, Clone)]
8pub struct PadActionEntry {
9    type_: PadActionType,
10    index: i32,
11    mode: i32,
12    label: String,
13    action_name: String,
14}
15
16impl PadActionEntry {
17    pub fn new(
18        type_: PadActionType,
19        index: i32,
20        mode: i32,
21        label: &str,
22        action_name: &str,
23    ) -> PadActionEntry {
24        assert_initialized_main_thread!();
25        PadActionEntry {
26            type_,
27            index,
28            mode,
29            label: label.to_owned(),
30            action_name: action_name.to_owned(),
31        }
32    }
33
34    pub fn get_type(&self) -> PadActionType {
35        self.type_
36    }
37
38    pub fn get_index(&self) -> i32 {
39        self.index
40    }
41
42    pub fn get_mode(&self) -> i32 {
43        self.mode
44    }
45
46    pub fn get_label(&self) -> &str {
47        &self.label
48    }
49
50    pub fn get_action_name(&self) -> &str {
51        &self.action_name
52    }
53}