Back to index

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

Go to the source code of this file.

Classes

struct  _Jamo
struct  _HANGUL
struct  _HANGULBuffer
struct  _MapInfo
struct  _KeymapData

Typedefs

typedef enum _JAMO_T JAMO_T
typedef enum _CHOJUNGJONG_T CHOJUNGJONG_T
typedef struct _HANGUL
typedef struct * HANGULList
typedef struct _Jamo
typedef struct _HANGULBuffer
typedef struct _MapInfo
typedef struct _KeymapData
typedef enum _ComposerRetVal AutomataRetVal

Enumerations

enum  _JAMO_T { JM_NONE, JAEUM, MOEUM }
enum  _CHOJUNGJONG_T { CJJ_NONE = -1, CJJ_CHOSUNG, CJJ_JUNGSUNG, CJJ_JONGSUNG }
enum  _ComposerRetVal { ComposerRetErr = -1, ComposerRetKeep, ComposerRetBreak }

Functions

void composer_hangul_initialize (HANGUL *a_hangul)
void composer_hangul_free (HANGUL *a_hangul)
void composer_hangul_copy (HANGUL *dst, HANGUL *src)
HANGULBuffer * composer_hangul_buffer_new (void)
void composer_hangul_buffer_initialize (HANGULBuffer *hangul_buffer)
HANGUL * composer_hangul_buffer_get_next_hangul (HANGULBuffer *hangul_buffer, HANGUL *current_hangul)
int composer_hangul_buffer_get_hangul_length (HANGULBuffer *hangul_buffer)
void composer_hangul_buffer_print (HANGULBuffer *hangul_buffer)
Boolean composer_hangul_buffer_delete_hangul_character (HANGULBuffer *hangul_buffer, Boolean delete_whole_character, HANGUL *deleted_hangul_return)
HANGUL * composer_hangul_buffer_add_hangul (HANGULBuffer *hangul_buffer, HANGUL *a_hangul)
HANGUL * composer_hangul_buffer_get_last_hangul (HANGULBuffer *hangul_buffer)
HANGUL * composer_hangul_buffer_pop_hangul (HANGULBuffer *hangul_buffer)
UTFCHAR composer_hangul_combine_cho_jung_jong (HANGUL *a_hangul)
int composer_hangul_automata_2pair (int keyCode, int keyChar, int state, HANGULBuffer *hangul_buffer, Config *pconfig)
Boolean composer_hangul_hanja_lookup_start (HANGULBuffer *hangul_buffer, int *number_of_candidates, UTFCHAR ***hanja_list_return)
Bool composer_hangul_buffer_get_content_in_u16 (HANGULBuffer *hbuf, UTFCHAR **u16hangul_return)
Bool _jamo_is_clean (Jamo *jamo)
UTFCHAR _jamo_get_value (Jamo *jamo)
void composer_config_switch_codeset (Config *pconfig, int *newcodeset)
void composer_config_switch_keyboard (Config *pconfig)
void composer_config_switch_commit_method (Config *pconfig)
UTFCHAR get_utf_input_by_keyboard (IMEKeyEventStruct *, KEYBOARD_LAYOUT_T)

Class Documentation

struct _Jamo

Definition at line 40 of file composer.h.

Class Members
UTFCHAR coupled
UTFCHAR first
UTFCHAR second
struct _HANGUL

Definition at line 46 of file composer.h.

Class Members
Bool completed
Jamo L
Jamo T
Jamo V
struct _HANGULBuffer

Definition at line 55 of file composer.h.

Class Members
HANGULList * buffer
int count
struct _MapInfo

Definition at line 61 of file composer.h.

Class Members
CHOJUNGJONG_T type
unsigned short val
struct _KeymapData

Definition at line 68 of file composer.h.

Class Members
MapInfo layout

Typedef Documentation

typedef struct _HANGUL

Definition at line 37 of file composer.h.

typedef struct _HANGULBuffer

Definition at line 54 of file composer.h.

typedef struct _Jamo

Definition at line 39 of file composer.h.

typedef struct _KeymapData

Definition at line 67 of file composer.h.

typedef struct _MapInfo

Definition at line 60 of file composer.h.

typedef struct * HANGULList

Definition at line 37 of file composer.h.

typedef enum _JAMO_T JAMO_T

Enumeration Type Documentation

Enumerator:
CJJ_NONE 
CJJ_CHOSUNG 
CJJ_JUNGSUNG 
CJJ_JONGSUNG 

Definition at line 32 of file composer.h.

Enumerator:
ComposerRetErr 
ComposerRetKeep 
ComposerRetBreak 

Definition at line 72 of file composer.h.

enum _JAMO_T
Enumerator:
JM_NONE 
JAEUM 
MOEUM 

Definition at line 30 of file composer.h.


Function Documentation

UTFCHAR _jamo_get_value ( Jamo *  jamo)

Definition at line 150 of file composer.c.

{
  assert (jamo != NULL);
  return jamo->coupled;
}

Here is the caller graph for this function:

Bool _jamo_is_clean ( Jamo *  jamo)

Definition at line 127 of file composer.c.

{
  assert (jamo != NULL);

  return jamo->first ? False : True;
}

Here is the caller graph for this function:

void composer_config_switch_codeset ( Config *  pconfig,
int *  newcodeset 
)

Definition at line 1648 of file composer.c.

{
  assert (pconfig != NULL);
  if (!pconfig){
    KOLE_LOG (LOGDEST_STDERR,
            "composer_config_switch_codeset error: pconfig is null\n");
    return;
  }
  if (!next){
    if (pconfig->charset == IN_EUC)
      pconfig->charset = IN_UNICODE;
    else
      pconfig->charset = IN_EUC;
  } else if ((*next >= IN_EUC) && (*next <= IN_UNICODE)) {
    pconfig->charset = *next;
  } else
    return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void composer_config_switch_commit_method ( Config *  pconfig)

Definition at line 1686 of file composer.c.

{
  assert (pconfig != NULL);
  if (!pconfig){
    KOLE_LOG (LOGDEST_STDERR,
            "composer_config_switch_codeset error: pconfig is null\n");
    return;
  }
  if (pconfig->commit_mode == COMMIT_BY_HOTKEY){
    pconfig->commit_mode = COMMIT_BY_CHAR;
  } else {
    pconfig->commit_mode++;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void composer_config_switch_keyboard ( Config *  pconfig)

Definition at line 1669 of file composer.c.

{
  assert (pconfig != NULL);
  if (!pconfig){
    KOLE_LOG (LOGDEST_STDERR,
            "composer_config_switch_codeset error: pconfig is null\n");
    return;
  }
  if (pconfig->keyboard == (LAYOUT_NUM - 1)){
    pconfig->keyboard = LAYOUT_2PART;
  } else {
    pconfig->keyboard++;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

int composer_hangul_automata_2pair ( int  keyCode,
int  keyChar,
int  state,
HANGULBuffer *  hangul_buffer,
Config *  pconfig 
)

Definition at line 858 of file composer.c.

{
  UTFCHAR utf_input;
  HANGUL *last_hangul;
  HANGUL a_hangul;
  HANGUL *new_hangul;
  
  JAMO_T input_type_is;
  
  KEYBOARD_LAYOUT_T i_keyboard = LAYOUT_2PART;
  
  UTFCHAR jongseong_from_choseong, choseong_from_jongseong;
  UTFCHAR decomposed_jongseong, decomposed_choseong;

  UTFCHAR coupled_jaeum, coupled_moeum;
  Bool last_hangul_was_newly_created = False;
  Bool keymap_return;
  MapInfo map_info;

  assert (hangul_buffer != NULL);

  keymap_return = composer_hangul_convert_input_to_unicode (keyChar,
                                                     state,
                                                     i_keyboard,
                                                     &map_info);
  if (keymap_return)
    utf_input = map_info.val;
  else
    return ComposerRetErr;
  
  input_type_is = composer_jamo_type_of_input (utf_input);
  if (input_type_is == JM_NONE){     /* not a hangul character */
    if ((utf_input >= 0x0020 && utf_input <= 0x007f)){
      /* printable commit characters */
      KOLE_LOG(LOGDEST_STDOUT, "composer_hangul_automata_2pair(),utf_input is %d\n", utf_input);
      return ComposerRetBreak;
    } else
      return ComposerRetErr;
  }


  last_hangul = composer_hangul_buffer_get_last_hangul (hangul_buffer);

  composer_hangul_initialize (&a_hangul);

  if (last_hangul == NULL){
    /* there was no HANGUL, so create the first one */
    last_hangul = composer_hangul_new ();
    last_hangul_was_newly_created = True;

    if (input_type_is == JAEUM){
      _jamo_set_values (&last_hangul->L, utf_input, 0x0);
    } else {
      _jamo_set_values (&last_hangul->L, 0x0, 0x0);
      _jamo_set_values (&last_hangul->V, utf_input, 0);
      _jamo_set_values (&last_hangul->T, 0x0, 0x0);
      
      last_hangul->completed = True;
    }

    composer_hangul_buffer_add_hangul (hangul_buffer, last_hangul); 
    composer_hangul_free (last_hangul);
       
    return ComposerRetKeep;
  }

  if (input_type_is == JAEUM) {
    if (last_hangul->completed == True){
      new_hangul = composer_hangul_new ();
      _jamo_set_values (&new_hangul->L, utf_input, 0x0);
      composer_hangul_buffer_add_hangul (hangul_buffer, new_hangul);
      /* free new_hangul */
      composer_hangul_free (new_hangul);
      return ComposerRetKeep;
      
    } else if (!_jamo_is_clean (&last_hangul->T)) {
      /* last_hangul had T */
      jongseong_from_choseong =
       hangul_combining_chosung_to_combining_jongsung (utf_input);
      if ((!_jamo_is_done (&last_hangul->T)) &&
         (IS_VALID_JONGSEONG (jongseong_from_choseong))){

       coupled_jaeum =
         composer_hangul_coupled_jamo (last_hangul->T.first,
                                   jongseong_from_choseong);
       if (!coupled_jaeum){
         /* invalid coupling */
         _jamo_set_values (&a_hangul.L , utf_input, 0x0);
         /* finished the previous character,
            and starting new character */
         last_hangul->completed = True;
         composer_hangul_buffer_add_hangul (hangul_buffer, &a_hangul);
       } else {
         /* valid coupling */
         if (pconfig->charset == IN_EUC &&
             is_not_euc_with_trailing_consonant (last_hangul, jongseong_from_choseong)){

           last_hangul->completed = True;
           
           new_hangul = composer_hangul_new ();
           _jamo_set_values (&new_hangul->L, utf_input, 0x0);
           composer_hangul_buffer_add_hangul (hangul_buffer, new_hangul);
           composer_hangul_free (new_hangul);
           
         } else {
           _jamo_set_values (&last_hangul->T,
                           last_hangul->T.first, jongseong_from_choseong);
         }
       }
       
      } else {
       _jamo_set_values (&a_hangul.L , utf_input, 0x0);
       composer_hangul_buffer_add_hangul (hangul_buffer, &a_hangul);
      }
      return ComposerRetKeep;

    } else if (!_jamo_is_clean (&last_hangul->V)) {
      jongseong_from_choseong =
       hangul_combining_chosung_to_combining_jongsung (utf_input);
      if (IS_VALID_JONGSEONG(jongseong_from_choseong) ){
       if (pconfig->charset == IN_EUC &&
           is_not_euc_with_trailing_consonant (last_hangul, jongseong_from_choseong)){
         last_hangul->completed = True;
         new_hangul = composer_hangul_new ();
         _jamo_set_values (&new_hangul->L, utf_input, 0x0);
         composer_hangul_buffer_add_hangul (hangul_buffer, new_hangul);
         composer_hangul_free (new_hangul);
       } else {
         _jamo_set_values (&last_hangul->T, jongseong_from_choseong, 0x0);
       }
      }
      else {
       last_hangul->completed = True;
       _jamo_set_values (&a_hangul.L, utf_input, 0x0);
       composer_hangul_buffer_add_hangul (hangul_buffer, &a_hangul);
      }
      return ComposerRetKeep;
    }
    else if (!_jamo_is_clean (&last_hangul->L)) {
      coupled_jaeum =
       composer_hangul_coupled_jamo (last_hangul->L.first, utf_input);
      if (!_jamo_is_done (&last_hangul->L) && coupled_jaeum){
       _jamo_set_values (&last_hangul->L,
                       last_hangul->L.first, utf_input);
      } else {
       _jamo_set_values (&last_hangul->V, 0x0, 0x0);
       _jamo_set_values (&last_hangul->T, 0x0, 0x0);
       last_hangul->completed = True;
       _jamo_set_values (&a_hangul.L, utf_input, 0);
       composer_hangul_buffer_add_hangul (hangul_buffer, &a_hangul);  
      }
      return ComposerRetKeep;
    }
                     
  } else if (input_type_is == MOEUM) {
    if (last_hangul->completed == True){

      new_hangul = composer_hangul_new ();
      _jamo_set_values (&new_hangul->L, 0x0, 0x0);
      _jamo_set_values (&new_hangul->V, utf_input, 0x0);
      _jamo_set_values (&new_hangul->T, 0x0, 0x0);
      new_hangul->completed = True;
      
      composer_hangul_buffer_add_hangul (hangul_buffer, new_hangul);
      /* free new_hangul */
      composer_hangul_free (new_hangul);
      return ComposerRetKeep;
      
    } else if (!_jamo_is_clean (&last_hangul->T)){
      UTFCHAR tmp;
      if (!_jamo_is_done (&last_hangul->T)){
       /* last_hangul->T.first needs to be taken forward
          to current new character */
       tmp =
         hangul_combining_jongsung_to_combining_chosung
         (_jamo_get_first (&last_hangul->T));
       _jamo_set_values (&last_hangul->T, 0x0, 0x0);
      } else {
       tmp =
         hangul_combining_jongsung_to_combining_chosung (
                                                   _jamo_get_second (&last_hangul->T));
       _jamo_set_values (&last_hangul->T, last_hangul->T.first, 0x0);
      }
      last_hangul->completed = True;
      
      _jamo_set_values (&a_hangul.L, tmp, 0x0);
      _jamo_set_values (&a_hangul.V, utf_input, 0x0);
      composer_hangul_buffer_add_hangul (hangul_buffer, &a_hangul);
      return ComposerRetKeep;
    }
    else if(!_jamo_is_clean (&last_hangul->V)) {
      coupled_moeum =
       composer_hangul_coupled_jamo (
                                  _jamo_get_first (&last_hangul->V),
                                  utf_input);
      if (!_jamo_is_done (&last_hangul->V) && coupled_moeum){
       if (pconfig->charset == IN_EUC &&
           is_not_euc_with_vowel (last_hangul, utf_input)){
         
         last_hangul->completed = True;
         new_hangul = composer_hangul_new ();
         _jamo_set_values (&new_hangul->L, 0x0, 0x0);
         _jamo_set_values (&new_hangul->V, utf_input, 0x0);
         new_hangul->completed = True;
         composer_hangul_buffer_add_hangul (hangul_buffer, new_hangul);
         composer_hangul_free (new_hangul);

       } else {
         _jamo_set_values (&last_hangul->V,
                         last_hangul->V.first, utf_input);
       }
      } else {
       last_hangul->completed = True;
       
       _jamo_set_values (&a_hangul.L, 0x0, 0x0);
       _jamo_set_values (&a_hangul.V, utf_input, 0x0);
       a_hangul.completed = True;
       
       composer_hangul_buffer_add_hangul (hangul_buffer, &a_hangul);
      }
      return ComposerRetKeep;
    } else if(!_jamo_is_clean(&last_hangul->L)){
      _jamo_set_values (&last_hangul->V, utf_input, 0x0);
      return ComposerRetKeep;
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

HANGUL* composer_hangul_buffer_add_hangul ( HANGULBuffer *  hangul_buffer,
HANGUL *  a_hangul 
)

Definition at line 518 of file composer.c.

{
  HANGULList *tmp;
  HANGUL *hangul = composer_hangul_new ();
       
  assert (hangul != NULL);

  if (hangul == NULL){
    KOLE_LOG (LOGDEST_STDOUT, "Error creating new hangul");
    return NULL;
  } else {
    tmp = (HANGULList *) calloc(hangul_buffer->count+ 1,sizeof(HANGULList));
    assert(tmp != NULL);
    if(tmp == NULL){
      KOLE_LOG (LOGDEST_STDERR, "Fatal error in composer_hangul_buffer_add_hangul\n");
      exit(-1);
    }
    if (hangul_buffer->count == 0){
      hangul_buffer->count++;
      hangul_buffer->buffer = (HANGULList *)calloc(1, sizeof(HANGULList));
      hangul_buffer->buffer[0] = hangul;
      composer_hangul_copy(hangul_buffer->buffer[0], a_hangul);
      return hangul_buffer->buffer[0];
    }
    else {
      memset(tmp, 0, (hangul_buffer->count + 1) * sizeof(HANGULList));
      memcpy(tmp, hangul_buffer->buffer, (hangul_buffer->count) * sizeof(HANGULList));
      tmp[hangul_buffer->count] = hangul;
      composer_hangul_copy(tmp[hangul_buffer->count], a_hangul);
      /* FIX ME */
      free (hangul_buffer->buffer);
      /* END OF FIX ME */
      hangul_buffer->buffer = tmp;
      hangul_buffer->count += 1;   
      return tmp[hangul_buffer->count - 1];
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Boolean composer_hangul_buffer_delete_hangul_character ( HANGULBuffer *  hangul_buffer,
Boolean  delete_whole_character,
HANGUL *  deleted_hangul_return 
)
Bool composer_hangul_buffer_get_content_in_u16 ( HANGULBuffer *  hbuf,
UTFCHAR **  u16hangul_return 
)

Definition at line 1575 of file composer.c.

{
  int i, utfchar_len;
  UTFCHAR *han_char;
  HANGUL *current_hangul;

  assert (hbuf != NULL);
  if (hbuf == NULL){
    KOLE_LOG (LOGDEST_STDOUT, "composer_hangul_buffer_get_content_in_u16 error :"
            "hbuf is null\n");
    *u16hangul_return = NULL;
    return False;
  }
  
  utfchar_len =
    composer_hangul_buffer_get_hangul_length (hbuf);
  
  assert (utfchar_len >= 0);

  if (utfchar_len <= -1) {
    KOLE_LOG (LOGDEST_STDERR, "hangul_imebuffer_get_preedit error: number of hangul "
           "can't be negative\n");
    return False;
  }
  else if (utfchar_len == 0) {
    *u16hangul_return = NULL;
    return True;
  }
  else {
  
    if (hbuf == NULL){
      KOLE_LOG (LOGDEST_STDERR, 
             "hangul_imebuffer_get_preedit error: composer_buffer can't be null\n");
      return False;
    }
              
    *u16hangul_return = (UTFCHAR *) calloc( utfchar_len + 1 , sizeof (UTFCHAR) );

    for (i = 0 ; i < utfchar_len; i++) {
      UTFCHAR combined_character;
      UTFCHAR tmp;
      
      combined_character =
       composer_hangul_combine_cho_jung_jong( (hbuf->buffer[i]) );
      if (combined_character){
       (*u16hangul_return)[i] = combined_character;
      } else {
       current_hangul = hbuf->buffer[i];
       
       if (!_jamo_is_clean (&current_hangul->L)){
         tmp = _jamo_get_value (&current_hangul->L);
         (*u16hangul_return)[i] =
           hangul_combining_chosung_to_compatibility_jamo (tmp);
       } else if (!_jamo_is_clean (&current_hangul->V)){
         tmp = _jamo_get_value (&current_hangul->V);
         (*u16hangul_return)[i] =
           hangul_combining_jungsung_to_compatibility_moeum (tmp);
       } else if (!_jamo_is_clean (&current_hangul->T)){
         tmp = _jamo_get_value (&current_hangul->V);
         (*u16hangul_return)[i] =
           hangul_combining_jongsung_to_compatibility_jaeum (tmp);     
       }
      }
    }
    (*u16hangul_return)[i] = 0x0000;
  }

  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int composer_hangul_buffer_get_hangul_length ( HANGULBuffer *  hangul_buffer)

Definition at line 299 of file composer.c.

{
  assert (hangul_buffer != NULL);
  if (hangul_buffer == NULL) {
    KOLE_LOG (LOGDEST_STDERR, "hangul_buffer_get_hangul_length: hangul_buffer is null\n");
    return -1;
  }
  if (hangul_buffer->count < 0) {
    KOLE_LOG (LOGDEST_STDERR, "hangul_buffer_get_hangul_length: count is < 0\n");
    hangul_buffer->count = 0;
    return 0;
  } else 
    return hangul_buffer->count;
}

Here is the call graph for this function:

Here is the caller graph for this function:

HANGUL* composer_hangul_buffer_get_last_hangul ( HANGULBuffer *  hangul_buffer)

Definition at line 701 of file composer.c.

{
  HANGUL *last_hangul;
  assert(hangul_buffer != NULL);

  if ( hangul_buffer->count == 0 )
    return NULL;

  last_hangul = hangul_buffer->buffer[hangul_buffer->count - 1];
  return last_hangul;
}

Here is the caller graph for this function:

HANGUL* composer_hangul_buffer_get_next_hangul ( HANGULBuffer *  hangul_buffer,
HANGUL *  current_hangul 
)

Definition at line 286 of file composer.c.

{
  HANGUL *next_hangul;

  assert (hangul_buffer != NULL);
  if (hangul_buffer == NULL) {
    KOLE_LOG (LOGDEST_STDERR, "hangul_buffer_get_next_hangul error: hangul_buffer can't be NULL\n");
    return NULL;
  } 
  next_hangul = current_hangul + 1;
}

Here is the call graph for this function:

void composer_hangul_buffer_initialize ( HANGULBuffer *  hangul_buffer)

Definition at line 242 of file composer.c.

{
  assert (hangul_buffer != NULL);

  composer_hangul_buffer_free (hangul_buffer);

  hangul_buffer->count = 0; 
  hangul_buffer->buffer = NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

HANGULBuffer* composer_hangul_buffer_new ( void  )

Definition at line 230 of file composer.c.

{
  HANGULBuffer *_hangul_buffer;
  _hangul_buffer = (HANGULBuffer *) calloc(1, sizeof(HANGULBuffer));
       
  if(!_hangul_buffer)
    return NULL;
  else
    return _hangul_buffer;
}
HANGUL* composer_hangul_buffer_pop_hangul ( HANGULBuffer *  hangul_buffer)

Definition at line 558 of file composer.c.

{
  HANGUL *phangul;
  HANGULBuffer *tmp;
  int i;
  assert (hangul_buffer != NULL);

  if (hangul_buffer == NULL){
    KOLE_LOG (LOGDEST_STDERR, "%s",
             "composer_hangul_buffer_pop_hangul error");
    return NULL;
  }
  if (hangul_buffer->count == 0){
    KOLE_LOG (LOGDEST_STDERR, "%s",
             "composer_hangul_buffer_pop_hangul error: no hangul in buffer");
    return NULL;
  }

  tmp = (HANGULBuffer *) calloc (hangul_buffer->count - 1,
                             sizeof (HANGUL *));

  phangul = hangul_buffer->buffer[0];
  
  memcpy (tmp, hangul_buffer->buffer + 1,
         sizeof (HANGUL *) * hangul_buffer->count - 1);
  free (hangul_buffer->buffer);
  hangul_buffer->buffer = tmp;
  hangul_buffer->count--;

  return phangul;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void composer_hangul_buffer_print ( HANGULBuffer *  hangul_buffer)

Definition at line 315 of file composer.c.

{
  int i;
  HANGUL *han;
  UTFCHAR hangul_character;
  KOLE_LOG (LOGDEST_STDOUT, "===this values are pseudo===\n");
  for(i = 0 ; i < hangul_buffer->count; i++){
    han = hangul_buffer->buffer[i];
#if 0
    KOLE_LOG (LOGDEST_STDOUT, "(0x%04X+0x%04X+0x%04X=>0x%04X):", 
           han->L, han->V, han->T,
           hangul_character = composer_hangul_combine_cho_jung_jong (han));
#endif

    KOLE_LOG (LOGDEST_STDOUT, "(0x%04X+0x%04X+0x%04X=>0x%04X):", 
            han->L.coupled, han->V.coupled, han->T.coupled,
            hangul_character = composer_hangul_combine_cho_jung_jong (han));
            
  }
  KOLE_LOG (LOGDEST_STDOUT, "===this values are pseudo===\n");
  KOLE_LOG (LOGDEST_STDOUT, "\n");
}

Here is the call graph for this function:

Definition at line 724 of file composer.c.

{
  static UTFCHAR hangul_base    = 0xac00;
  static UTFCHAR choseong_base  = 0x1100;
  static UTFCHAR jungseong_base = 0x1161;
  static UTFCHAR jongseong_base = 0x11a7;

  static int number_of_jungseong = 21;
  static int number_of_jongseong = 28;

  UTFCHAR l_consonant,vowel,t_consonant;
  UTFCHAR ch;

  assert (a_hangul != NULL);
  if (a_hangul == NULL)
    return 0;

  l_consonant = _jamo_get_value (&a_hangul->L);
  vowel = _jamo_get_value (&a_hangul->V);
  t_consonant = _jamo_get_value (&a_hangul->T);
       
  if (t_consonant == 0)
    t_consonant = JONGSEONG_FILLER; /* 0x11A7 */
       
  if (l_consonant  < 0x1100 || l_consonant  > 0x1112)
    return 0;
  if (vowel < 0x1161 || vowel > 0x1175)
    return 0;
  if (t_consonant < 0x11a7 || t_consonant > 0x11c2)
    return 0;
       
  l_consonant  -= choseong_base;
  vowel -= jungseong_base;
  t_consonant -= jongseong_base;
       
  ch = ((l_consonant * number_of_jungseong) + vowel) * number_of_jongseong + 
    t_consonant + hangul_base;
  return ch;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void composer_hangul_copy ( HANGUL *  dst,
HANGUL *  src 
)

Definition at line 212 of file composer.c.

{
  assert (dst != NULL);
  assert (src != NULL);
  
  if (!dst || !src) {
    KOLE_LOG (LOGDEST_STDOUT, "error in composer_hangul_copy\n");
    return;
  }
  _jamo_copy (&dst->L, &src->L);
  _jamo_copy (&dst->V, &src->V);
  _jamo_copy (&dst->T, &src->T);
  
  dst->completed = src->completed;
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void composer_hangul_free ( HANGUL *  a_hangul)

Definition at line 111 of file composer.c.

{
  if(a_hangul)
    free(a_hangul);
}

Here is the caller graph for this function:

Boolean composer_hangul_hanja_lookup_start ( HANGULBuffer *  hangul_buffer,
int *  number_of_candidates,
UTFCHAR ***  hanja_list_return 
)

Definition at line 1520 of file composer.c.

{
  HANGUL *first_hangul;
  UTFCHAR hangul_key;
  int table_index;
  int i;
  Bool mthd_return;
  UTFCHAR *u16hangul = NULL;
  int n_hangul_chars;

  assert (hangul_buffer != NULL);
#if 0
  first_hangul = composer_hangul_buffer_get_first_hangul (hangul_buffer);
  if (first_hangul == NULL)
    return False;

  hangul_key = composer_hangul_combine_cho_jung_jong (first_hangul);
  if (hangul_key == 0x0000)
    return False;
#endif
  n_hangul_chars = 
    composer_hangul_buffer_get_hangul_length (hangul_buffer);
  if (n_hangul_chars < 1)
    return False;
  
  mthd_return =
    composer_hangul_buffer_get_content_in_u16 (hangul_buffer, &u16hangul);
  if (!mthd_return){
    KOLE_LOG (LOGDEST_STDOUT, "composer_hangul_hanja_lookup_start error :"
            "composer_hangul_buffer_get_content_in_u16 failed\n");
    *number_of_candidates = 0;
    *hanja_list_return = NULL;
    return False;
  }
  
  mthd_return = dictionary_search_hanja_candidates_in_utf16
    (u16hangul, number_of_candidates, hanja_list_return );

  if (!mthd_return){
    return False;
  } else
    return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void composer_hangul_initialize ( HANGUL *  a_hangul)

Definition at line 98 of file composer.c.

{
  assert (a_hangul != NULL);
#if 0
  a_hangul->L = 0x0000;
  a_hangul->V = 0x0000;
  a_hangul->T = 0x0000;
#endif
  memset (a_hangul, 0, sizeof (HANGUL));
  a_hangul->completed = False;
}

Here is the caller graph for this function:

UTFCHAR get_utf_input_by_keyboard ( IMEKeyEventStruct *  ,
KEYBOARD_LAYOUT_T   
)

Definition at line 771 of file composer.c.

{
  UTFCHAR utf_input  = 0x0000;
  Bool keymap_return;
  int keychar;
  int keycode;
  int state;
  MapInfo map_info;

  assert (iiim_key_ev != NULL);

  keycode = iiim_key_ev->key_code;
  keychar = iiim_key_ev->key_char;
  state = iiim_key_ev->key_modifier;
  KOLE_LOG(LOGDEST_STDOUT, "get_utf_input_by_keyboard():keyboard id is %d,  keycode is %d, keychar is %c, state is %d\n", i_keyboard,  keycode, keychar, state);

  /* Below case is cheked, before keyboard mapping lookup is done.
     This is becuase thos mapping table doesn't consider
     mapping entry for below values, and actually this is not
     keyboard mapping dependent input
  */
  switch (keycode){
  case IM_VK_ENTER:
  case IM_VK_TAB:
  case IM_VK_SPACE:
    return (UTFCHAR )keycode;
    break;

  case IM_VK_LEFT:
  case IM_VK_UP:
  case IM_VK_RIGHT:
  case IM_VK_DOWN:
  case IM_VK_PAGE_DOWN:
  case IM_VK_PAGE_UP:
  case IM_VK_HOME:
  case IM_VK_END:
    return 0x0000;
    break;
  case IM_VK_BACK_SLASH:
    if((state & IM_SHIFT_MASK) && (i_keyboard == LAYOUT_2PART || i_keyboard == LAYOUT_3PART390)) 
       break;
    if((state == 0) && (i_keyboard == LAYOUT_3PART_FINAL))
        break;
    if((state == 0) && (i_keyboard == LAYOUT_2PART || i_keyboard == LAYOUT_3PART390))
       return 0x20a9;
    if((state & IM_SHIFT_MASK) &&  (i_keyboard == LAYOUT_3PART_FINAL))
       return 0x20a9;

  default:
    break;
  }

  if (keycode < 0x41){
    keymap_return = composer_hangul_convert_input_to_unicode (keychar,
                                                       state,
                                                       i_keyboard,
                                                       &map_info);
  } else {
    keymap_return = composer_hangul_convert_input_to_unicode (keychar,
                                                       state,
                                                       i_keyboard,
                                                       &map_info);
  }
  if (keymap_return)
    utf_input = map_info.val;
  else {
    utf_input = 0x0000;
  }
  
  return utf_input;
}

Here is the call graph for this function:

Here is the caller graph for this function: