File: im_context_simple.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 (35 lines) | stat: -rw-r--r-- 1,261 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
29
30
31
32
33
34
35
// Copyright 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 IMContextSimple;

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

use std::path::Path;

pub trait IMContextSimpleExtManual {
    fn add_compose_file<P: AsRef<Path>>(&self, compose_file: P);
    //fn add_table(&self, data: &[u16], max_seq_len: u32, n_seqs: u32);
}

impl<O: IsA<IMContextSimple>> IMContextSimpleExtManual for O {
    fn add_compose_file<P: AsRef<Path>>(&self, compose_file: P) {
        unsafe {
            let compose_file = compose_file.as_ref();
            ffi::gtk_im_context_simple_add_compose_file(self.to_glib_none().0, compose_file.to_glib_none().0);
        }
    }

    /*fn add_table(&self, data: &[u16], max_seq_len: u32, n_seqs: u32) {
        assert!(max_seq_len * n_seqs < data.len() as u32);
        unsafe {
            ffi::gtk_im_context_simple_add_table(self.to_glib_none().0,
                                                 data.to_glib_none().0,
                                                 max_seq_len as i32,
                                                 n_seqs as i32);
        }
    }*/
}