1 /*
2   Copyright (c) 2006-2013 uim Project https://github.com/uim/uim
3 
4   All rights reserved.
5 
6   Redistribution and use in source and binary forms, with or
7   without modification, are permitted provided that the
8   following conditions are met:
9 
10   1. Redistributions of source code must retain the above
11      copyright notice, this list of conditions and the
12      following disclaimer.
13   2. Redistributions in binary form must reproduce the above
14      copyright notice, this list of conditions and the
15      following disclaimer in the documentation and/or other
16      materials provided with the distribution.
17   3. Neither the name of authors nor the names of its
18      contributors may be used to endorse or promote products
19      derived from this software without specific prior written
20      permission.
21 
22   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
23   CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25   MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26   DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
27   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
29   NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30   LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
33   OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 */
36 
37 #ifndef UIM_EMACS_UIM_EL_TYPES_H
38 #define UIM_EMACS_UIM_EL_TYPES_H
39 
40 #include <config.h>
41 #define UIM_EL_USE_NEW_PAGE_HANDLING	1
42 
43 typedef struct candidate {
44   char *str;
45   char *label;
46 } candidate;
47 
48 
49 typedef struct candidate_info {
50   int valid;
51   int num;
52   int disp_limit;
53   int index;
54 #if UIM_EL_USE_NEW_PAGE_HANDLING
55   int page_index;
56 #endif
57   candidate *cand_array;
58 } candidate_info;
59 
60 
61 typedef struct im_encoding {
62   char *im;                  /* IM name */
63   char *encoding;            /* Encoding name (in uim-encoding.h) */
64   struct im_encoding *next;
65 } im_encoding;
66 
67 
68 typedef struct uim_key{
69   int mod;
70   int key;
71 } uim_key;
72 
73 
74 typedef struct preedit_buffer {
75   char *str;
76   int attr;
77   unsigned cursor;
78   struct preedit_buffer *next;
79 } preedit_buffer;
80 
81 
82 typedef struct preedit {
83   int valid;
84   int length;
85   preedit_buffer *head;
86   preedit_buffer *tail;
87   /*  candidate_info *cand;*/
88 } preedit;
89 
90 
91 typedef struct property {
92   int valid;
93   int list_update;
94   char *list;
95 } property;
96 
97 
98 typedef struct uim_agent_context {
99   uim_context context;
100   int context_id;
101   char *encoding;
102   char *im;
103   preedit *pe;
104   candidate_info *cand;
105   property *prop;
106   char *comstr;
107 } uim_agent_context;
108 
109 
110 typedef struct uim_agent_context_list {
111   uim_agent_context *agent_context;
112   struct uim_agent_context_list *next;
113   struct uim_agent_context_list *prev;
114 } uim_agent_context_list;
115 
116 
117 #endif
118