Back to index

im-sdk  12.3.91
Functions | Variables
le_keyevent.c File Reference
#include <stdio.h>
#include "le_info.h"
#include "le_desktop.h"
#include "le_session.h"

Go to the source code of this file.

Functions

int le_session_get_imm_key_type (iml_session_t *s, IMKeyEventStruct *key_event)
int le_session_process_key_event_for_ime_module (iml_session_t *s, IMKeyEventStruct *key_event)
int le_session_process_key_event_for_ime_manager (iml_session_t *s, IMKeyEventStruct *key_event)
LeResult le_session_process_key_event (iml_session_t *s, IMKeyListEvent *keylistevent)
int le_iml_commit_encode_string (iml_session_t *s, int encoding, char *commit_str)
int le_session_proc_qjbj (iml_session_t *s, IMKeyEventStruct *key_event)
int le_session_proc_punct (iml_session_t *s, IMKeyEventStruct *key_event)

Variables

LeInfoRecle_info
ImmKeybindingRec imm_keybindings_default []

Function Documentation

int le_iml_commit_encode_string ( iml_session_t s,
int  encoding,
char *  commit_str 
)

Definition at line 86 of file le_keyevent.c.

{
    UTFCHAR tmp_buf[1024];
    UTFCHAR *tmp_ptr = tmp_buf;
    int from_len, to_left, ret;

    if (commit_str == NULL)
       return (IME_FAIL);

    if (encoding == ENCODE_INVALID)
       return (IME_FAIL);

    from_len = strlen(commit_str);
    to_left = 1024;
    memset(tmp_buf, 0, sizeof(UTFCHAR) * 1024);
    ret = Convert_Native_To_UTF16(encoding,
                              commit_str,
                              from_len,
                              (char **) &tmp_ptr,
                              (size_t *) & to_left);
    if (ret == -1)
       return (IME_FAIL);

    le_iml_commit(s, tmp_buf);
    return (IME_OK);
}

Here is the call graph for this function:

int le_session_proc_punct ( iml_session_t s,
IMKeyEventStruct key_event 
)

Definition at line 136 of file le_keyevent.c.

{
    char *commit_buf;
    int keycode, keystatus, keychar;

    keycode = key_event->keyCode;
    keychar = key_event->keyChar;
    keystatus = key_event->modifier;

    DEBUG_printf("QJBJ PROCESS\n");
    /* normal ASCII key */
    if ((keychar != 0) && (keystatus == IM_SHIFT_MASK || keystatus == 0)) {
       commit_buf = (char *) get_punct_str(keychar);
       if (commit_buf != NULL) {
           le_iml_commit_encode_string(s, ENCODE_UTF8, commit_buf);
           return (IME_OK);
       }
    }

    return (IME_UNUSED_KEY);
}

Here is the call graph for this function:

int le_session_proc_qjbj ( iml_session_t s,
IMKeyEventStruct key_event 
)

Definition at line 114 of file le_keyevent.c.

{
    char *commit_buf;
    int keycode, keystatus, keychar;

    keycode = key_event->keyCode;
    keychar = key_event->keyChar;
    keystatus = key_event->modifier;

    DEBUG_printf("QJBJ PROCESS\n");
    /* normal ASCII key */
    if ((keychar != 0) && (keystatus == IM_SHIFT_MASK || keystatus == 0)) {
       commit_buf = (char *) get_qj_str(keychar);
       if (commit_buf != NULL) {
           le_iml_commit_encode_string(s, ENCODE_UTF8, commit_buf);
           return (IME_OK);
       }
    }

    return (IME_UNUSED_KEY);
}

Here is the call graph for this function:

Definition at line 19 of file le_keyevent.c.

{
    LeSessionContextRec *le_session_context = NULL;
    LeDesktopContextRec *le_desktop_context = NULL;

    IMKeyEventStruct *key_event = (IMKeyEventStruct *) keylistevent->keylist;
    int key_ret;

    le_desktop_context =
       (LeDesktopContextRec *) le_session_get_desktop_context(s);

    DEBUG_printf
       (" le_session_proc_key_event: desktop: %p, current_session:%p\n",
        s->desktop, s);

    le_session_context =
       (LeSessionContextRec *) le_session_get_session_context(s);
    if (le_session_context == NULL) {
       le_iml_sendback_key(s, key_event);
    }

    key_ret = le_session_process_key_event_for_ime_manager(s, key_event);
    if (key_ret == IMM_KEY_USED)
       return (LE_OK);

    key_ret = le_session_process_key_event_for_ime_module(s, key_event);
    if (key_ret == IME_UNUSED_KEY)
       le_iml_sendback_key(s, key_event);

    return (LE_OK);
}

Here is the call graph for this function:


Variable Documentation

Definition at line 39 of file le_interface.c.