Kmxsip_adapter.h
4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
#ifndef KMXSIP_ADPTER_H
#define KMXSIP_ADPTER_H
#ifndef KMXSIP_CONFIG_H
#include "Kmxsip_config.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define KMX_MAX_COMMIT 64
#define KMX_MAX_COMPOSITION 64
#define KMX_FLAG_COMP_TEXT 0x0001
#define WCHAR_BACKSPACE 0x08
#define WCHAR_TAB 0x09
#define WCHAR_RETURN 0x0D
#define WCHAR_SPACE 0x20
typedef struct tag_KEYPAD KEYPAD;
typedef enum
{
KMX_NOTIFY_MSG_NONE,
KMX_NOTIFY_MSG_CLEAR_IME_COMP,
KMX_NOTIFY_MSG_SET_IME_COMP,
KMX_NOTIFY_MSG_END_IME_COMP,
KMX_NOTIFY_MSG_END
}KMX_NOTIFY_MSG_CODE;
typedef struct
{
int sequencial_number;
int flags;
int commit_length;
KMX_WCHAR commit_text[KMX_MAX_COMMIT];
int composition_length;
KMX_WCHAR composition_text[KMX_MAX_COMPOSITION];
} KMX_SIP_OUTPUT;
struct tag_KEYPAD
{
KMX_KEYPAD api;
int metric;
int x;
int y;
int width;
int height;
int bottom_line;
int support_composition;
KMX_IMM imm;
int is_aux_window_visible;
KMX_BUTTON echo_button;
int is_timer1_actived : 1;
int is_timer2_actived : 1;
int is_timer3_actived : 1;
int is_pen_down_on_keypad : 1;
int is_keypad_input_mode_changed : 1;
int is_handwriting_panel_on : 1;
int is_cancel_insertion : 1;
int skip_editor_cursor_movement : 1;
int last_pen_down_x;
int last_pen_down_y;
int language;
int user_data_size;
char* user_data_buffer;
int comp_text_length;
int output_sequencial_number;
KMX_SIP_OUTPUT output;
mmi_imm_input_mode_enum curr_input_mode;
mmi_imm_input_mode_enum last_input_mode;
int prev_x;
int prev_y;
int prev_width;
int prev_height;
};
/* Draw Button */
void mtk_keypad_draw_button(
KEYPAD* keypad,
const KMX_BUTTON* buttons,
int num_buttons);
/* Hide and Show Echo Button */
void mtk_create_echo_layer(void);
void mtk_destory_echo_layer(void);
void mtk_keypad_echo_button(
KEYPAD* keypad,
const KMX_BUTTON* button);
/* Get Context in Editor */
void mtk_keypad_get_context(
KEYPAD* keypad,
KMX_CONTEXT* context);
/* Draw Rect */
void mtk_keypad_draw_rect(
KEYPAD* keypad,
int left,
int top,
int right,
int bottom,
KMX_COLOR c);
/* Draw Background */
void mtk_keypad_draw_background(
KEYPAD* keypad,
int left,
int top,
int right,
int bottom);
/* Draw Text */
void mtk_keypad_draw_text(
KEYPAD* keypad,
int x,
int y,
const KMX_WCHAR* text,
int length,
int font_size,
KMX_COLOR c);
/* Get Text Size */
void mtk_keypad_get_text_size(
KEYPAD* keypad,
const KMX_WCHAR* text,
int length,
int font_size,
int* width,
int* height);
/* Timer */
void mtk_keypad_stop_all_timer(void);
void mtk_keypad_set_timer(
KEYPAD* keypad,
int timer_id,
int time);
/* Notification Handler */
void mtk_keypad_on_notify_input_mode_changed(void);
int mtk_keypad_notify_editor(KEYPAD* keypad, KMX_NOTIFY_MSG_CODE code, int param1, int param2);
#ifdef __cplusplus
}
#endif
#endif /* #ifdef KMXSIP_ADPTER_H */