forked from gtk-rs/gtk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
i_m_multicontext.rs
64 lines (53 loc) · 1.54 KB
/
i_m_multicontext.rs
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
61
62
63
64
// This file was generated by gir (9bd51ed) from gir-files (db49619)
// DO NOT EDIT
use IMContext;
use MenuShell;
use ffi;
use glib::object::Downcast;
use glib::object::IsA;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::mem;
use std::ptr;
glib_wrapper! {
pub struct IMMulticontext(Object<ffi::GtkIMMulticontext>): IMContext;
match fn {
get_type => || ffi::gtk_im_multicontext_get_type(),
}
}
impl IMMulticontext {
pub fn new() -> IMMulticontext {
assert_initialized_main_thread!();
unsafe {
IMContext::from_glib_full(ffi::gtk_im_multicontext_new()).downcast_unchecked()
}
}
}
impl Default for IMMulticontext {
fn default() -> Self {
Self::new()
}
}
pub trait IMMulticontextExt {
fn append_menuitems<P: IsA<MenuShell>>(&self, menushell: &P);
fn get_context_id(&self) -> Option<String>;
fn set_context_id(&self, context_id: &str);
}
impl<O: IsA<IMMulticontext>> IMMulticontextExt for O {
fn append_menuitems<P: IsA<MenuShell>>(&self, menushell: &P) {
unsafe {
ffi::gtk_im_multicontext_append_menuitems(self.to_glib_none().0, menushell.to_glib_none().0);
}
}
fn get_context_id(&self) -> Option<String> {
unsafe {
from_glib_none(ffi::gtk_im_multicontext_get_context_id(self.to_glib_none().0))
}
}
fn set_context_id(&self, context_id: &str) {
unsafe {
ffi::gtk_im_multicontext_set_context_id(self.to_glib_none().0, context_id.to_glib_none().0);
}
}
}