Back to index

im-sdk  12.3.91
Functions
le_proc.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void le_switch_engine (unit_desktop_t *udp, iml_session_t *s, int engine_id, Bool flag)
void le_clear_ime_buffer (iml_session_t *s, IMEBuffer ime_buffer)
void le_status_draw (unit_desktop_t *udp, iml_session_t *s)
void le_commit_euro (iml_session_t *s, IMEBuffer ime_buffer)
void le_output_ime_buffer (iml_session_t *s, IMEBuffer ime_buffer)

Function Documentation

void le_clear_ime_buffer ( iml_session_t s,
IMEBuffer  ime_buffer 
)

Definition at line 136 of file le_proc.c.

{
    ime_buffer->lookup_num = 0;
    iml_lookup_enddraw(s);

    ime_buffer->inputkey_len = 0;
    ime_buffer->preedit_len = 0;
    ime_buffer->hotkey_flag = IME_HOTKEY_NOT_IN_USE;
    ime_buffer->conv_flag = -1;
    iml_preedit_enddraw(s);
}

Here is the call graph for this function:

void le_commit_euro ( iml_session_t s,
IMEBuffer  ime_buffer 
)

Definition at line 148 of file le_proc.c.

{
    int encode = ime_buffer->encode;
    int status = ime_buffer->return_status;
    int commit_len = ime_buffer->commit_len;
    unsigned char *commit_buf  = ime_buffer->commit_buf;

    if ((status & IME_COMMIT) && (commit_len>0)) {
       commit_buf[commit_len] = 0;
       log_f("commit_buf:%s\n", commit_buf);
       encode_commit(s, encode, commit_buf, commit_len);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void le_output_ime_buffer ( iml_session_t s,
IMEBuffer  ime_buffer 
)

Definition at line 163 of file le_proc.c.

{

    int encode = ime_buffer->encode;
    int status = ime_buffer->return_status;
    int preedit_len = ime_buffer->preedit_len;
    int commit_len = ime_buffer->commit_len;
    int lookup_num = ime_buffer->lookup_num;
    int lookup_label_type = ime_buffer->lookup_label_type;
    int preedit_caretpos = ime_buffer->preedit_caretpos;
    unsigned char *preedit_buf = ime_buffer->preedit_buf;
    unsigned char *commit_buf  = ime_buffer->commit_buf;
    unsigned char *status_buf  = ime_buffer->status_buf;
    unsigned char **lookup_buf = ime_buffer->lookup_buf;

    if (status & IME_STATUS_AREA)
       encode_draw_status(s, encode, status_buf);

    if (status & IME_PREEDIT_AREA) {
       preedit_buf[preedit_len] = 0;
       if (preedit_len <= 0)
           iml_preedit_enddraw(s);
       else
           encode_draw_preedit(s, encode, preedit_buf, preedit_caretpos);
    }


    if (status & IME_LOOKUP_AREA) {
       log_f("lookup_num:%d\n", lookup_num);
       if (lookup_num <= 0)
           iml_lookup_enddraw(s);
       else
           encode_draw_candidates(s, encode, lookup_buf, lookup_num, lookup_label_type);
    }

    if ((status & IME_COMMIT) && (commit_len>0)) {
       commit_buf[commit_len] = 0;
       log_f("commit_buf:%s\n", commit_buf);
       encode_commit(s, encode, commit_buf, commit_len);
    }
}

Here is the call graph for this function:

void le_status_draw ( unit_desktop_t udp,
iml_session_t s 
)

Definition at line 205 of file le_proc.c.

{
    unsigned char status_str[256];
    MyDataPerSession *session_data = (MyDataPerSession *) s->specific_data;
    int engine_id = session_data->paletteaux_status.engine_id;
    int on = session_data->paletteaux_status.on;

    memset((char *)&status_str, '\0', sizeof(status_str));

    if (!on || engine_id == 0xff){
       log_f("encode_draw_status: ENGLISH \n");
       encode_draw_status(s, ENCODE_UTF8, "");
    } else {
       if (!strcmp(udp->modeList[engine_id]->nlocale_name ,(char *)"ASCII"))
           sprintf((char *)status_str, "%s", udp->modeList[engine_id]->nlayout_name);
       else if (!strcmp(udp->modeList[engine_id]->nlayout_name, (char *)"ASCII"))
           sprintf((char *)status_str, "%s", udp->modeList[engine_id]->nlocale_name);
       else
           sprintf((char *)status_str, "%s", udp->modeList[engine_id]->nlayout_name);
       log_f("encode_draw_status: [%s] \n",status_str);
       encode_draw_status(s, udp->gEngine_Info[engine_id]->core.baseinfo.encode_id, status_str);
    }
}

Here is the call graph for this function:

void le_switch_engine ( unit_desktop_t udp,
iml_session_t s,
int  engine_id,
Bool  flag 
)

Definition at line 229 of file le_proc.c.

{
    int ret;
    MyDataPerSession *session_data = (MyDataPerSession *) s->specific_data;

    if (engine_id >= udp->gEngine_Num)  
       engine_id = 0xff;

    if (engine_id != 0xff && udp->gEngine_Info[engine_id]->core.baseinfo.status == ENGINE_NOT_INSTALLED)
       engine_id = 0xff;

    if (engine_id != 0xff) {
       ret = udp->gEngine_Info[engine_id]->so_methods->IME_Open(
           &udp->gEngine_Info[engine_id]->core,
           session_data->ime_buffer,
           udp->gEngine_Info[engine_id]->so_handler);
              
       log_f("IME_Open return :%d\n", ret);
       if (ret == -1)
           engine_id = 0xff;
    }

    session_data->paletteaux_status.engine_id = engine_id;
    if (flag)
      le_status_draw(udp, s);
}

Here is the call graph for this function: