File: pad_controller.rs

package info (click to toggle)
rust-gtk 0.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,792 kB
  • sloc: makefile: 20; sh: 17
file content (28 lines) | stat: -rw-r--r-- 998 bytes parent folder | download
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
// Copyright 2013-2018, The Gtk-rs Project Developers.
// See the COPYRIGHT file at the top-level directory of this distribution.
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>

use ffi;
use glib::IsA;
use glib::translate::*;

use PadActionEntry;
use PadController;

pub trait PadControllerExtManual {
    #[cfg(any(feature = "v3_22", feature = "dox"))]
    fn set_action_entries(&self, entries: &[PadActionEntry]);
}

impl<O: IsA<PadController>> PadControllerExtManual for O {
    #[cfg(any(feature = "v3_22", feature = "dox"))]
    fn set_action_entries(&self, entries: &[PadActionEntry]) {
        let n_entries = entries.len() as i32;
        let entries = entries.as_ptr();
        unsafe {
            ffi::gtk_pad_controller_set_action_entries(self.to_glib_none().0,
                                                       mut_override(entries as *const _),
                                                       n_entries);
        }
    }
}