Back to index

im-sdk  12.3.91
Classes | Typedefs | Enumerations | Functions
composer.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _Desktop
struct  _HangulCombination
struct  _Session

Typedefs

typedef struct _Desktop
typedef struct _Session
typedef struct _HangulCombination

Enumerations

enum  HangulState { HANGUL_STATE_NONE, HANGUL_STATE_ENGLISH, HANGUL_STATE_HANGUL, HANGUL_STATE_HANJA }

Functions

void hangul_le_init (void)
void hangul_desktop_init (iml_desktop_t *desktop)
void hangul_desktop_finalize (iml_desktop_t *desktop)
void hangul_session_init (iml_session_t *s)
void hangul_session_finalize (iml_session_t *s)
IMTexthangul_session_reset (iml_session_t *s)
void hangul_prep (iml_session_t *s)
void hangul_exec (iml_session_t *s)
void hangul_foward_keyevent (iml_session_t *s, IMKeyEventStruct *key)
void hangul_focus (iml_session_t *s)
void hangul_unfocus (iml_session_t *s)
void hangul_conversion_on (iml_session_t *s)
void hangul_conversion_off (iml_session_t *s)
Bool hangul_composer (iml_session_t *s, IMKeyEventStruct *key)

Class Documentation

struct _Desktop

Definition at line 38 of file composer.h.

Class Members
HangulState state
struct _HangulCombination

Definition at line 42 of file composer.h.

Class Members
UTFCHAR code
uint32_t key

Typedef Documentation

typedef struct _Desktop

Definition at line 27 of file composer.h.

typedef struct _HangulCombination

Definition at line 29 of file composer.h.

typedef struct _Session

Definition at line 28 of file composer.h.


Enumeration Type Documentation

Enumerator:
HANGUL_STATE_NONE 
HANGUL_STATE_ENGLISH 
HANGUL_STATE_HANGUL 
HANGUL_STATE_HANJA 

Definition at line 31 of file composer.h.


Function Documentation

Definition at line 1778 of file composer.c.

{
    Session *hsession = (Session*) s->specific_data;

    if (hsession->state == HANGUL_STATE_HANJA) {
       switch (key->keyCode) {
       case IM_VK_0:
           hangul_lookup_commit_nth(s, 9);
           break;
       case IM_VK_1:
       case IM_VK_2:
       case IM_VK_3:
       case IM_VK_4:
       case IM_VK_5:
       case IM_VK_6:
       case IM_VK_7:
       case IM_VK_8:
       case IM_VK_9:
           hangul_lookup_commit_nth(s, key->keyCode - IM_VK_1);
           break;
       case IM_VK_ENTER:
           hangul_lookup_commit(s);
           break;
       case IM_VK_ESCAPE:
           hangul_lookup_done(s);
           break;
       case IM_VK_UP:
       case IM_VK_K:
           hangul_lookup_prev(s);
           break;
       case IM_VK_DOWN:
       case IM_VK_J:
           hangul_lookup_next(s);
           break;
       case IM_VK_LEFT:
       case IM_VK_H:
           hangul_lookup_prev_page(s);
           break;
       case IM_VK_RIGHT:
       case IM_VK_L:
       case IM_VK_SPACE:
           hangul_lookup_next_page(s);
           break;
       default:
           break;
       }
       return True;
    }
    
    if (hangul_is_candidate_key(key)) {
       hangul_lookup_start(s, key);
       return True;
    }

    /* on shift key we silently ignore it */
    if (key->keyCode == IM_VK_SHIFT)
       return False;

    /* ignore modifier on keys */
    if (key->modifier & (IM_CTRL_MASK | IM_ALT_MASK | IM_META_MASK))
       return False;

    if (hsession->composer != NULL)
       return hsession->composer(s, key);

    return False;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1751 of file composer.c.

{
    iml_inst *lp;
    int len;
    IMText *text;
    UTFCHAR *status_str;
    Session *hsession = (Session*) s->specific_data;

    hangul_commit (s);

    hsession->state = HANGUL_STATE_ENGLISH;
    if (s->desktop && s->desktop->specific_data)
       ((Desktop*)s->desktop->specific_data)->state = HANGUL_STATE_ENGLISH;

    status_str = get_status_string(s);
    len = utfchar_strlen(status_str);
    text = imtext_new(s, status_str, len, feedbacklist_new(s, len));
    lp = s->If->m->iml_make_status_draw_inst(s, text);
    s->If->m->iml_link_inst_tail(&hsession->rrv, lp);

    lp = s->If->m->iml_make_preedit_done_inst(s);
    s->If->m->iml_link_inst_tail(&hsession->rrv, lp);
    lp = s->If->m->iml_make_end_conversion_inst(s);
    s->If->m->iml_link_inst_tail(&hsession->rrv, lp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1726 of file composer.c.

{
    iml_inst *lp;
    int len;
    IMText *text;
    UTFCHAR *status_str;
    Session *hsession = (Session*) s->specific_data;

    hsession->state = HANGUL_STATE_HANGUL;
    if (s->desktop && s->desktop->specific_data)
       ((Desktop*)s->desktop->specific_data)->state = HANGUL_STATE_HANGUL;

    lp = s->If->m->iml_make_start_conversion_inst(s);
    s->If->m->iml_link_inst_tail(&hsession->rrv, lp);
    lp = s->If->m->iml_make_preedit_start_inst(s);
    s->If->m->iml_link_inst_tail(&hsession->rrv, lp);

    status_str = get_status_string(s);
    len = utfchar_strlen(status_str);
    text = imtext_new(s, status_str, len, feedbacklist_new(s, len));
    lp = s->If->m->iml_make_status_draw_inst(s, text);
    s->If->m->iml_link_inst_tail(&hsession->rrv, lp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1592 of file composer.c.

{
    if (desktop->specific_data != NULL) {
       free(desktop->specific_data);
       desktop->specific_data = NULL;
    }
}
void hangul_desktop_init ( iml_desktop_t desktop)

Definition at line 1579 of file composer.c.

{
    Desktop *desktop_data;

    if (desktop->specific_data != NULL)
       free(desktop->specific_data);

    desktop_data = (Desktop *) calloc(1, sizeof(Desktop));
    desktop_data->state = HANGUL_STATE_ENGLISH;
    desktop->specific_data = desktop_data;
}

Here is the caller graph for this function:

void hangul_exec ( iml_session_t s)

Definition at line 1680 of file composer.c.

{
    Session *hsession = (Session*) s->specific_data;
    if (hsession->rrv != NULL)
       s->If->m->iml_execute(s, &hsession->rrv);
}

Here is the caller graph for this function:

void hangul_focus ( iml_session_t s)

Definition at line 1698 of file composer.c.

{
    iml_inst *lp;
    int len;
    IMText *text;
    UTFCHAR *status_str;
    Session *hsession = (Session*) s->specific_data;

    lp = s->If->m->iml_make_status_start_inst(s);
    s->If->m->iml_link_inst_tail(&hsession->rrv, lp);
    status_str = get_status_string(s);
    len = utfchar_strlen(status_str);
    text = imtext_new(s, status_str, len, feedbacklist_new(s, len));
    lp = s->If->m->iml_make_status_draw_inst(s, text);
    s->If->m->iml_link_inst_tail(&hsession->rrv, lp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1688 of file composer.c.

{
    iml_inst *lp;
    Session *hsession = (Session*) s->specific_data;

    lp = s->If->m->iml_make_keypress_inst(s, key);
    s->If->m->iml_link_inst_tail(&hsession->rrv, lp);
}

Here is the caller graph for this function:

void hangul_le_init ( void  )

Definition at line 1572 of file composer.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void hangul_prep ( iml_session_t s)

Definition at line 1673 of file composer.c.

{
    Session *hsession = (Session*) s->specific_data;
    hsession->rrv = NULL;
}

Here is the caller graph for this function:

Definition at line 1630 of file composer.c.

{
    if (s->specific_data != NULL) {
       free(s->specific_data);
       s->specific_data = NULL;
    }
}

Here is the caller graph for this function:

Definition at line 1601 of file composer.c.

{
    Session *hsession;

    if (s->specific_data != NULL)
       free(s->specific_data);

    hsession = (Session *)calloc(1, sizeof(Session));
    hsession->state = HANGUL_STATE_ENGLISH;

    hsession->keyboard = config.keyboard;
    hsession->composer = config.composer;
    hsession->compose_table_size = sizeof(compose_table_default) 
                            / sizeof(compose_table_default[0]);
    hsession->compose_table = compose_table_default;

    hsession->stack_index = -1;

    hsession->candidate_char = 0;
    hsession->candidate_index = 0;
    hsession->candidate_length = 0;
    hsession->candidate = 0;

    hsession->rrv = NULL;

    s->specific_data = hsession;
}

Here is the caller graph for this function:

Definition at line 1639 of file composer.c.

{
    int len = 0;
    UTFCHAR buf[12];
    Session *hsession = (Session*) s->specific_data;

    if (hangul_is_empty(hsession))
       return NULL;

    len = hangul_get_commit_string(s, buf, sizeof(buf));
    hangul_hsession_clear(hsession);
    hangul_preedit_update(s);
    return imtext_new(s, buf, len, feedbacklist_new(s, len));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1716 of file composer.c.

{
    iml_inst *lp;
    Session *hsession = (Session*) s->specific_data;

    lp = s->If->m->iml_make_status_done_inst(s);
    s->If->m->iml_link_inst_tail(&hsession->rrv, lp);
}

Here is the caller graph for this function: