| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
#include <stdio.h> |
| 24 |
#include <stdlib.h> |
| 25 |
#include <string.h> |
| 26 |
|
| 27 |
#include <gtk/gtk.h> |
| 28 |
#include <gtk/gtkimmodule.h> |
| 29 |
|
| 30 |
#include "client-imcontext-gtk.h" |
| 31 |
#include "debug.h" |
| 32 |
|
| 33 |
static const GtkIMContextInfo maliit_im_info = { |
| 34 |
"Maliit", |
| 35 |
"Maliit Input Method", |
| 36 |
"maliit", |
| 37 |
"", |
| 38 |
"en:ja:ko:zh:*" |
| 39 |
}; |
| 40 |
|
| 41 |
|
| 42 |
static const GtkIMContextInfo *info_list[] = { |
| 43 |
&maliit_im_info |
| 44 |
}; |
| 45 |
|
| 46 |
|
| 47 |
void im_module_init(GTypeModule *type_module); |
| 48 |
void im_module_exit(void); |
| 49 |
void im_module_list(const GtkIMContextInfo ***contexts, int *context_number); |
| 50 |
GtkIMContext *im_module_create(const gchar *context_id); |
| 51 |
|
| 52 |
|
| 53 |
void |
| 54 |
im_module_init(GTypeModule *type_module) |
| 55 |
{ |
| 56 |
STEP(); |
| 57 |
g_type_module_use(type_module); |
| 58 |
maliit_im_context_register_type(type_module); |
| 59 |
STEP(); |
| 60 |
} |
| 61 |
|
| 62 |
|
| 63 |
void |
| 64 |
im_module_exit() |
| 65 |
{ |
| 66 |
STEP(); |
| 67 |
} |
| 68 |
|
| 69 |
|
| 70 |
void |
| 71 |
im_module_list(const GtkIMContextInfo ***contexts, int *context_number) |
| 72 |
{ |
| 73 |
*contexts = info_list; |
| 74 |
*context_number = G_N_ELEMENTS(info_list); |
| 75 |
} |
| 76 |
|
| 77 |
|
| 78 |
GtkIMContext * |
| 79 |
im_module_create(const gchar *context_id) |
| 80 |
{ |
| 81 |
if (g_strcmp0(context_id, "Maliit") == 0) { |
| 82 |
return maliit_im_context_new(); |
| 83 |
} else { |
| 84 |
return NULL; |
| 85 |
} |
| 86 |
} |
| 87 |
|