1 // Take a look at the license at the top of the repository in the LICENSE file.
2 
3 use crate::IMContextSimple;
4 use glib::translate::*;
5 use glib::IsA;
6 use std::path::Path;
7 
8 pub trait IMContextSimpleExtManual: 'static {
9     #[doc(alias = "gtk_im_context_simple_add_compose_file")]
add_compose_file<P: AsRef<Path>>(&self, compose_file: P)10     fn add_compose_file<P: AsRef<Path>>(&self, compose_file: P);
11 
12     //#[doc(alias="gtk_im_context_simple_add_table")]
13     //fn add_table(&self, data: &[u16], max_seq_len: u32, n_seqs: u32);
14 }
15 
16 impl<O: IsA<IMContextSimple>> IMContextSimpleExtManual for O {
add_compose_file<P: AsRef<Path>>(&self, compose_file: P)17     fn add_compose_file<P: AsRef<Path>>(&self, compose_file: P) {
18         unsafe {
19             let compose_file = compose_file.as_ref();
20             ffi::gtk_im_context_simple_add_compose_file(
21                 self.as_ref().to_glib_none().0,
22                 compose_file.to_glib_none().0,
23             );
24         }
25     }
26 
27     /*fn add_table(&self, data: &[u16], max_seq_len: u32, n_seqs: u32) {
28         assert!(max_seq_len * n_seqs < data.len() as u32);
29         unsafe {
30             ffi::gtk_im_context_simple_add_table(self.as_ref().to_glib_none().0,
31                                                  data.to_glib_none().0,
32                                                  max_seq_len as i32,
33                                                  n_seqs as i32);
34         }
35     }*/
36 }
37