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
54
55
56
57
58
59
60
use gdk_sys;
use glib::translate::*;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[repr(C)]
pub struct KeymapKey {
group: i32,
keycode: u32,
level: i32,
}
#[doc(hidden)]
impl<'a> ToGlibPtr<'a, *const gdk_sys::GdkKeymapKey> for KeymapKey {
type Storage = &'a Self;
#[inline]
fn to_glib_none(&'a self) -> Stash<'a, *const gdk_sys::GdkKeymapKey, Self> {
let ptr: *const KeymapKey = &*self;
Stash(ptr as *const gdk_sys::GdkKeymapKey, self)
}
}
#[doc(hidden)]
impl<'a> ToGlibPtrMut<'a, *mut gdk_sys::GdkKeymapKey> for KeymapKey {
type Storage = &'a mut Self;
#[inline]
fn to_glib_none_mut(&'a mut self) -> StashMut<'a, *mut gdk_sys::GdkKeymapKey, Self> {
let ptr: *mut KeymapKey = &mut *self;
StashMut(ptr as *mut gdk_sys::GdkKeymapKey, self)
}
}
#[doc(hidden)]
impl FromGlibPtrNone<*const gdk_sys::GdkKeymapKey> for KeymapKey {
unsafe fn from_glib_none(ptr: *const gdk_sys::GdkKeymapKey) -> Self {
*(ptr as *const KeymapKey)
}
}
#[doc(hidden)]
impl FromGlibPtrNone<*mut gdk_sys::GdkKeymapKey> for KeymapKey {
unsafe fn from_glib_none(ptr: *mut gdk_sys::GdkKeymapKey) -> Self {
*(ptr as *mut KeymapKey)
}
}
#[doc(hidden)]
impl FromGlibPtrFull<*mut gdk_sys::GdkKeymapKey> for KeymapKey {
#[inline]
unsafe fn from_glib_full(ptr: *mut gdk_sys::GdkKeymapKey) -> Self {
let geom = *(ptr as *mut KeymapKey);
glib_sys::g_free(ptr as *mut _);
geom
}
}