diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/ecore/src/modules/immodules/scim/scim_module.cpp | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/libraries/ecore/src/modules/immodules/scim/scim_module.cpp b/libraries/ecore/src/modules/immodules/scim/scim_module.cpp new file mode 100644 index 0000000..eff6381 --- /dev/null +++ b/libraries/ecore/src/modules/immodules/scim/scim_module.cpp | |||
@@ -0,0 +1,93 @@ | |||
1 | #include <stdio.h> | ||
2 | #include "scim_imcontext.h" | ||
3 | |||
4 | #ifdef __cplusplus | ||
5 | extern "C" | ||
6 | { | ||
7 | #endif /* __cplusplus */ | ||
8 | |||
9 | static const Ecore_IMF_Context_Info isf_imf_info = { | ||
10 | "scim", /* ID */ | ||
11 | "SCIM immodule for Ecore", /* Description */ | ||
12 | "*", /* Default locales */ | ||
13 | NULL, /* Canvas type */ | ||
14 | 0 /* Canvas required */ | ||
15 | }; | ||
16 | |||
17 | static Ecore_IMF_Context_Class isf_imf_class = { | ||
18 | isf_imf_context_add, /* add */ | ||
19 | isf_imf_context_del, /* del */ | ||
20 | isf_imf_context_client_window_set, /* client_window_set */ | ||
21 | isf_imf_context_client_canvas_set, /* client_canvas_set */ | ||
22 | NULL, /* isf_imf_context_input_panel_show, - show */ | ||
23 | NULL, /* isf_imf_context_input_panel_hide, - hide */ | ||
24 | isf_imf_context_preedit_string_get, /* get_preedit_string */ | ||
25 | isf_imf_context_focus_in, /* focus_in */ | ||
26 | isf_imf_context_focus_out, /* focus_out */ | ||
27 | isf_imf_context_reset, /* reset */ | ||
28 | isf_imf_context_cursor_position_set, /* cursor_position_set */ | ||
29 | isf_imf_context_use_preedit_set, /* use_preedit_set */ | ||
30 | isf_imf_context_input_mode_set, /* input_mode_set */ | ||
31 | isf_imf_context_filter_event, /* filter_event */ | ||
32 | isf_imf_context_preedit_string_with_attributes_get, /* preedit_string_with_attribute_get */ | ||
33 | isf_imf_context_prediction_allow_set, /* prediction_allow_set */ | ||
34 | isf_imf_context_autocapital_type_set, /* autocapital_type_set */ | ||
35 | NULL, /* control panel show */ | ||
36 | NULL, /* control panel hide */ | ||
37 | NULL, /* input_panel_layout_set */ | ||
38 | NULL, /* isf_imf_context_input_panel_layout_get, */ | ||
39 | NULL, /* isf_imf_context_input_panel_language_set, */ | ||
40 | NULL, /* isf_imf_context_input_panel_language_get, */ | ||
41 | isf_imf_context_cursor_location_set /* cursor_location_set */ | ||
42 | }; | ||
43 | |||
44 | static Ecore_IMF_Context *imf_module_create (void); | ||
45 | static Ecore_IMF_Context *imf_module_exit (void); | ||
46 | |||
47 | static Eina_Bool imf_module_init (void) | ||
48 | { | ||
49 | ecore_imf_module_register (&isf_imf_info, imf_module_create, imf_module_exit); | ||
50 | return EINA_TRUE; | ||
51 | } | ||
52 | |||
53 | static void imf_module_shutdown (void) | ||
54 | { | ||
55 | isf_imf_context_shutdown (); | ||
56 | } | ||
57 | |||
58 | static Ecore_IMF_Context *imf_module_create (void) | ||
59 | { | ||
60 | Ecore_IMF_Context *ctx = NULL; | ||
61 | EcoreIMFContextISF *ctxd = NULL; | ||
62 | |||
63 | ctxd = isf_imf_context_new (); | ||
64 | if (!ctxd) | ||
65 | { | ||
66 | printf ("isf_imf_context_new () failed!!!\n"); | ||
67 | return NULL; | ||
68 | } | ||
69 | |||
70 | ctx = ecore_imf_context_new (&isf_imf_class); | ||
71 | if (!ctx) | ||
72 | { | ||
73 | delete ctxd; | ||
74 | return NULL; | ||
75 | } | ||
76 | |||
77 | ecore_imf_context_data_set (ctx, ctxd); | ||
78 | |||
79 | return ctx; | ||
80 | } | ||
81 | |||
82 | static Ecore_IMF_Context *imf_module_exit (void) | ||
83 | { | ||
84 | return NULL; | ||
85 | } | ||
86 | |||
87 | EINA_MODULE_INIT(imf_module_init); | ||
88 | EINA_MODULE_SHUTDOWN(imf_module_shutdown); | ||
89 | |||
90 | #ifdef __cplusplus | ||
91 | } | ||
92 | #endif /* __cplusplus */ | ||
93 | |||