Debian Codegraph @

src/controls/mod.rs

raw symbols SCIP
1 /*
2 * Copyright 2024 Andrey Kutejko <[email protected]>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses/>.
16 *
17 * For more details see the file COPYING.
18 */
19
20 pub mod controls;
21 pub mod editor;
22
23 use gtk::gdk;
24
25 pub fn key_from_u32(keyval: u32) -> gdk::Key {
26 use gtk::glib::translate::FromGlib;
27 unsafe { gdk::Key::from_glib(keyval) }
28 }
29
30 pub fn key_from_i32(keyval: i32) -> gdk::Key {
31 key_from_u32(keyval as u32)
32 }
33
34 pub fn key_into_i32(keyval: gdk::Key) -> i32 {
35 use gtk::glib::translate::IntoGlib;
36 keyval.into_glib() as i32
37 }