1 /*
2  * Copyright © 2012, 2013 Intel Corporation
3  *
4  * Permission to use, copy, modify, distribute, and sell this software and
5  * its documentation for any purpose is hereby granted without fee, provided
6  * that the above copyright notice appear in all copies and that both that
7  * copyright notice and this permission notice appear in supporting
8  * documentation, and that the name of the copyright holders not be used in
9  * advertising or publicity pertaining to distribution of the software
10  * without specific, written prior permission.  The copyright holders make
11  * no representations about the suitability of this software for any
12  * purpose.  It is provided "as is" without express or implied warranty.
13  *
14  * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
15  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
16  * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
17  * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
18  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
19  * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21  */
22 
23 #ifndef __WAYLAND_IM_CONTEXT_H_
24 #define __WAYLAND_IM_CONTEXT_H_
25 
26 #include <Ecore_IMF.h>
27 #include <Ecore_Wl2.h>
28 
29 #include "text-input-unstable-v1-client-protocol.h"
30 
31 extern Ecore_Wl2_Display *ewd;
32 
33 typedef struct _WaylandIMContext WaylandIMContext;
34 
35 void wayland_im_context_add                (Ecore_IMF_Context    *ctx);
36 void wayland_im_context_del                (Ecore_IMF_Context    *ctx);
37 void wayland_im_context_reset              (Ecore_IMF_Context    *ctx);
38 void wayland_im_context_focus_in           (Ecore_IMF_Context    *ctx);
39 void wayland_im_context_focus_out          (Ecore_IMF_Context    *ctx);
40 void wayland_im_context_preedit_string_get (Ecore_IMF_Context    *ctx,
41                                             char                **str,
42                                             int                  *cursor_pos);
43 void wayland_im_context_preedit_string_with_attributes_get(Ecore_IMF_Context  *ctx,
44                                                            char              **str,
45                                                            Eina_List         **attr,
46                                                            int                *cursor_pos);
47 
48 void wayland_im_context_cursor_position_set(Ecore_IMF_Context    *ctx,
49                                             int                   cursor_pos);
50 void wayland_im_context_use_preedit_set    (Ecore_IMF_Context    *ctx,
51                                             Eina_Bool             use_preedit);
52 void wayland_im_context_client_window_set  (Ecore_IMF_Context    *ctx,
53                                             void                 *window);
54 void wayland_im_context_client_canvas_set  (Ecore_IMF_Context    *ctx,
55                                             void                 *canvas);
56 void wayland_im_context_show               (Ecore_IMF_Context    *ctx);
57 void wayland_im_context_hide               (Ecore_IMF_Context    *ctx);
58 Eina_Bool wayland_im_context_filter_event  (Ecore_IMF_Context    *ctx,
59                                             Ecore_IMF_Event_Type  type,
60                                             Ecore_IMF_Event      *event);
61 void wayland_im_context_cursor_location_set(Ecore_IMF_Context    *ctx,
62                                             int                   x,
63                                             int                   y,
64                                             int                   width,
65                                             int                   height);
66 
67 void wayland_im_context_autocapital_type_set(Ecore_IMF_Context *ctx,
68                                              Ecore_IMF_Autocapital_Type autocapital_type);
69 
70 void wayland_im_context_input_panel_layout_set(Ecore_IMF_Context *ctx,
71                                                Ecore_IMF_Input_Panel_Layout layout);
72 
73 void wayland_im_context_input_mode_set(Ecore_IMF_Context *ctx,
74                                        Ecore_IMF_Input_Mode input_mode);
75 
76 void wayland_im_context_input_hint_set(Ecore_IMF_Context *ctx,
77                                        Ecore_IMF_Input_Hints input_hints);
78 
79 void wayland_im_context_input_panel_language_set(Ecore_IMF_Context *ctx,
80                                                  Ecore_IMF_Input_Panel_Lang lang);
81 
82 void
83 wayland_im_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx,
84                                                    char **locale);
85 
86 void
87 wayland_im_context_prediction_allow_set(Ecore_IMF_Context *ctx,
88                                         Eina_Bool prediction);
89 
90 WaylandIMContext *wayland_im_context_new        (struct zwp_text_input_manager_v1 *text_input_manager);
91 
92 extern int _ecore_imf_wayland_log_dom;
93 
94 #endif
95 
96 /* vim:ts=8 sw=3 sts=3 expandtab cino=>5n-3f0^-2{2(0W1st0
97  */
98