1 /*
2   Copyright (c) 2005-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_CONTEXT_H
38 #define UIM_EMACS_CONTEXT_H
39 
40 #include <config.h>
41 
42 #include <string.h>
43 #include <stdlib.h>
44 #include <locale.h>
45 
46 #include <uim/uim.h>
47 #include <uim/uim-im-switcher.h>
48 
49 #include "debug.h"
50 #include "uim-el-types.h"
51 
52 #include "prop.h"
53 #include "preedit.h"
54 #include "commit.h"
55 #include "im.h"
56 #include "callback.h"
57 #include "encoding.h"
58 
59 uim_context create_context(const char *encoding, uim_agent_context *ptr);
60 
61 uim_agent_context *create_uim_agent_context(const char *encoding);
62 uim_agent_context *new_uim_agent_context(int id, const char *encoding);
63 int release_uim_agent_context(int id);
64 
65 uim_agent_context *get_uim_agent_context(int id);
66 
67 uim_agent_context *switch_context_im(uim_agent_context *ua, const char *im);
68 void switch_context_im_all(const char *im);
69 
70 int set_current_uim_agent_context(uim_agent_context *ua);
71 int clear_current_uim_agent_context(void);
72 
73 void update_context_configuration(uim_agent_context *ua);
74 
75 int show_commit_string_uim_agent_context(uim_agent_context *ua);
76 int show_preedit_uim_agent_context(uim_agent_context *ua);
77 int show_candidate_uim_agent_context(uim_agent_context *ua);
78 int show_prop_uim_agent_context(uim_agent_context *ua);
79 int show_im_uim_agent_context(uim_agent_context *ua);
80 
81 /* current focused context */
82 extern uim_agent_context *current;
83 extern int focused;
84 
85 extern uim_agent_context_list *agent_context_list_head;
86 extern uim_agent_context_list *agent_context_list_tail;
87 
88 
89 #endif
90