Back to index

im-sdk  12.3.91
Functions
input-context.c File Reference
#include <stdlib.h>
#include <iiimp.h>
#include "input-method.h"
#include "input-context.h"

Go to the source code of this file.

Functions

IIIMF_status iiimf_ic_new (IIIMF_im *im, void *client_data, IIIMF_ic **ic_ret)
void iiimf_ic_delete (IIIMF_ic *ic)
IIIMF_status iiimf_ic_id_set (IIIMF_ic *ic, int ic_id)
void * iiimf_ic_data_get (IIIMF_ic *ic)
void * iiimf_ic_data_set (IIIMF_ic *ic, void *client_data)
IIIMF_status iiimf_ic_langauage_set (IIIMF_ic *ic, const char *language)
IIIMF_status iiimf_ic_input_method_set (IIIMF_ic *ic, const char *input_method)
IIIMF_status iiimf_ic_preedit_maximum_length_set (IIIMF_ic *ic, int preedit_maximum_length)
int iiimf_ic_id (IIIMF_ic *ic)

Function Documentation

void* iiimf_ic_data_get ( IIIMF_ic *  ic)

Definition at line 70 of file input-context.c.

{
    return ic->client_data;
}
void* iiimf_ic_data_set ( IIIMF_ic *  ic,
void *  client_data 
)

Definition at line 77 of file input-context.c.

{
    void *    p;
    p = ic->client_data;
    ic->client_data = client_data;
    return p;
}
void iiimf_ic_delete ( IIIMF_ic *  ic)

Definition at line 38 of file input-context.c.

{
    IIIMF_im *       im;
    IIIMF_ic *       p;

    im = ic->im;

    if (ic == im->ic_list) {
       im->ic_list = ic->next;
    } else {
       for (p = im->ic_list; NULL != p; p = p->next) {
           if (p->next == ic) {
              p->next = ic->next;
           }
       }
    }

    iiimp_string_list_delete(im->data_s, ic->language_list);
    free(ic);
}

Here is the call graph for this function:

Here is the caller graph for this function:

int iiimf_ic_id ( IIIMF_ic *  ic)

Definition at line 143 of file input-context.c.

{
    return ic->ic_id;
}
IIIMF_status iiimf_ic_id_set ( IIIMF_ic *  ic,
int  ic_id 
)

Definition at line 61 of file input-context.c.

{
    ic->ic_id = ic_id;
    return IIIMF_STATUS_SUCCESS;
}
IIIMF_status iiimf_ic_input_method_set ( IIIMF_ic *  ic,
const char *  input_method 
)

Definition at line 112 of file input-context.c.

{
    IIIMF_status     status;
    IIIMP_string *   p;

    if (NULL == input_method) {
       iiimp_string_delete(ic->im->data_s, ic->input_method);
       ic->input_method = NULL;
       return IIIMF_STATUS_SUCCESS;
    }

    status = iiimf_data_string_ascii_new(ic->im->data_s, input_method, &p);
    if (IIIMF_STATUS_SUCCESS != status) {
       return status;
    }
    iiimp_string_delete(ic->im->data_s, ic->input_method);
    ic->input_method = p;

    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

IIIMF_status iiimf_ic_langauage_set ( IIIMF_ic *  ic,
const char *  language 
)

Definition at line 89 of file input-context.c.

{
    IIIMF_status     status;
    IIIMP_string *   p;

    if (NULL == language) {
       iiimp_string_delete(ic->im->data_s, ic->language);
       ic->language = NULL;
       return IIIMF_STATUS_SUCCESS;
    }

    status = iiimf_data_string_ascii_new(ic->im->data_s, language, &p);
    if (IIIMF_STATUS_SUCCESS != status) {
       return status;
    }
    iiimp_string_delete(ic->im->data_s, ic->language);
    ic->language = p;

    return IIIMF_STATUS_SUCCESS;
}

Here is the call graph for this function:

IIIMF_status iiimf_ic_new ( IIIMF_im *  im,
void *  client_data,
IIIMF_ic **  ic_ret 
)

Definition at line 10 of file input-context.c.

{
    IIIMF_ic *       ic;

    if (NULL == im) return IIIMF_STATUS_IM_INVALID;

    ic = (IIIMF_ic *)malloc(sizeof (IIIMF_ic));
    if (NULL == ic) return IIIMF_STATUS_MALLOC;

    ic->ic_id = 0;
    ic->state = 0;
    ic->im = im;
    ic->language = NULL;
    ic->input_method = NULL;
    ic->language_list = NULL;
    ic->preedit_maximum_length = -1;
    ic->client_data = client_data;
    ic->next = im->ic_list;
    im->ic_list = ic;

    *ic_ret = ic;
    return IIIMF_STATUS_SUCCESS;
}
IIIMF_status iiimf_ic_preedit_maximum_length_set ( IIIMF_ic *  ic,
int  preedit_maximum_length 
)

Definition at line 135 of file input-context.c.

{
    ic->preedit_maximum_length = preedit_maximum_length;
    return IIIMF_STATUS_SUCCESS;
}