Back to index

im-sdk  12.3.91
composer.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2003   Choe Hwanjin <krisna@kldp.org>
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Library General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Library General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public
00015  * License along with this library; if not, write to the
00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017  * Boston, MA 02111-1307, USA.
00018  */
00019 
00020 #ifdef HAVE_STDINT_H
00021 #include <stdint.h>
00022 #endif
00023 
00024 /*
00025  * hangul le specific data
00026  */
00027 typedef struct _Desktop               Desktop;
00028 typedef struct _Session               Session;
00029 typedef struct _HangulCombination     HangulCombination;
00030 
00031 typedef enum {
00032     HANGUL_STATE_NONE,
00033     HANGUL_STATE_ENGLISH,
00034     HANGUL_STATE_HANGUL,
00035     HANGUL_STATE_HANJA,
00036 } HangulState;
00037 
00038 struct _Desktop {
00039     HangulState      state;
00040 };
00041 
00042 struct _HangulCombination {
00043     uint32_t key;
00044     UTFCHAR code;
00045 };
00046 
00047 struct _Session {
00048     const UTFCHAR *keyboard;
00049     Bool (*composer)(iml_session_t *s, IMKeyEventStruct *key);
00050     int compose_table_size;
00051     const HangulCombination *compose_table;
00052 
00053     HangulState       state;
00054 
00055     int                stack_index;
00056     UTFCHAR      stack[12];
00057 
00058     int                lindex;                   /* leading consonant */
00059     UTFCHAR      choseong[4];
00060 
00061     int          vindex;                  /* vowel */
00062     UTFCHAR      jungseong[4];
00063 
00064     int          tindex;                  /* trailing consonant */
00065     UTFCHAR      jongseong[4];
00066 
00067     /* candidate */
00068     int                  candidate;
00069     UTFCHAR        candidate_char;
00070     int            candidate_index;
00071     int            candidate_length;
00072 
00073     iml_inst *rrv;
00074 };
00075 
00076 void hangul_le_init(void);
00077 void hangul_desktop_init(iml_desktop_t *desktop);
00078 void hangul_desktop_finalize(iml_desktop_t *desktop);
00079 void hangul_session_init(iml_session_t *s);
00080 void hangul_session_finalize(iml_session_t *s);
00081 IMText* hangul_session_reset(iml_session_t *s);
00082 
00083 void hangul_prep(iml_session_t *s);
00084 void hangul_exec(iml_session_t *s);
00085 void hangul_foward_keyevent(iml_session_t *s, IMKeyEventStruct *key);
00086 
00087 void hangul_focus(iml_session_t *s);
00088 void hangul_unfocus(iml_session_t *s);
00089 void hangul_conversion_on(iml_session_t *s);
00090 void hangul_conversion_off(iml_session_t *s);
00091 Bool hangul_composer(iml_session_t *s, IMKeyEventStruct *key);
00092 
00093 /* vim: set ts=8 sw=4 : */