1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 2015 Takao Fujiwara <takao.fujiwara1@gmail.com>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library 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 GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __GTK_COMPOSETABLE_H__
19 #define __GTK_COMPOSETABLE_H__
20 
21 #include <glib.h>
22 
23 
24 G_BEGIN_DECLS
25 
26 typedef struct _GtkComposeTable GtkComposeTable;
27 typedef struct _GtkComposeTableCompact GtkComposeTableCompact;
28 
29 struct _GtkComposeTable
30 {
31   guint16 *data;
32   char *char_data;
33   int max_seq_len;
34   int n_seqs;
35   int n_chars;
36   guint32 id;
37 };
38 
39 struct _GtkComposeTableCompact
40 {
41   const guint16 *data;
42   int max_seq_len;
43   int n_index_size;
44   int n_index_stride;
45 };
46 
47 GtkComposeTable * gtk_compose_table_new_with_file  (const char      *compose_file);
48 GSList          * gtk_compose_table_list_add_array (GSList          *compose_tables,
49                                                     const guint16   *data,
50                                                     int              max_seq_len,
51                                                     int              n_seqs);
52 GSList          * gtk_compose_table_list_add_file  (GSList          *compose_tables,
53                                                     const char      *compose_file);
54 
55 gboolean          gtk_compose_table_check          (const GtkComposeTable *table,
56                                                     const guint16         *compose_buffer,
57                                                     int                    n_compose,
58                                                     gboolean              *compose_finish,
59                                                     gboolean              *compose_match,
60                                                     GString               *output);
61 
62 gboolean          gtk_compose_table_compact_check  (const GtkComposeTableCompact  *table,
63                                                     const guint16                 *compose_buffer,
64                                                     int                            n_compose,
65                                                     gboolean                      *compose_finish,
66                                                     gboolean                      *compose_match,
67                                                     gunichar                      *output_char);
68 
69 gboolean          gtk_check_algorithmically        (const guint16                 *compose_buffer,
70                                                     int                            n_compose,
71                                                     gunichar                      *output);
72 
73 
74 G_END_DECLS
75 
76 #endif /* __GTK_COMPOSETABLE_H__ */
77