10
#include "engine_const.h"
12
#define _(string) gettext(string)
14
#define IU_DESC _("Vietnamese Input Method Engine for IBus using Unikey Engine\n\
16
- Choose input method, output charset, options in language bar.\n\
17
- There are 4 input methods: Telex, Vni, STelex (simple telex) \
18
and STelex2 (which same as STelex, the difference is it use w as ư).\n\
19
- And 7 output charsets: Unicode (UTF-8), TCVN3, VNI Win, VIQR, CString, NCR Decimal and NCR Hex.\n\
20
- Use <Shift>+<Space> or <Shift>+<Shift> to restore keystrokes.\n\
21
- Use <Control> to commit a word.\
24
IBusComponent* ibus_unikey_get_component()
26
IBusComponent* component;
27
IBusEngineDesc* engine;
29
component = ibus_component_new("org.freedesktop.IBus.Unikey",
33
"Lê Quốc Tuấn <mr.lequoctuan@gmail.com>",
38
engine = ibus_engine_desc_new
45
"Lê Quốc Tuấn <mr.lequoctuan@gmail.com>",
46
PKGDATADIR"/icons/ibus-unikey.png",
52
ibus_component_add_engine(component, engine);
57
// code from x-unikey, for convert charset that not is XUtf-8
58
int latinToUtf(unsigned char* dst, unsigned char* src, int inSize, int* pOutSize)
66
for (i=0; i<inSize; i++)
80
*dst++ = (0xC0 | ch >> 6);
81
*dst++ = (0x80 | (ch & 0x3F));
87
return (outLeft >= 0);