Back to index

im-sdk  12.3.91
Defines | Functions | Variables
leif.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <sys/types.h>
#include <X11/Xmd.h>
#include "SunIM.h"
#include "SunIMMMan.h"
#include "SunIMProt.h"
#include "SunIMMthd.h"
#include "SunIMPriv.h"
#include "SunIMCore.h"
#include "SunIMPub.h"
#include "composer.h"

Go to the source code of this file.

Defines

#define CARD32BIT   CARD32

Functions

Bool if_hangul_OpenIF (iml_if_t *)
Bool if_hangul_CloseIF (iml_if_t *)
Bool if_hangul_GetIFValues (iml_if_t *, IMArgList, int)
Bool if_hangul_SetIFValues (iml_if_t *, IMArgList, int)
Bool if_hangul_OpenDesktop (iml_desktop_t *, IMArgList, int)
Bool if_hangul_CloseDesktop (iml_desktop_t *)
Bool if_hangul_CreateSC (iml_session_t *, IMArgList, int)
Bool if_hangul_DestroySC (iml_session_t *)
Bool if_hangul_GetSCValues (iml_session_t *, IMArgList, int)
Bool if_hangul_SetSCValues (iml_session_t *, IMArgList, int)
IMTextif_hangul_ResetSC (iml_session_t *)
void if_hangul_SetSCFocus (iml_session_t *)
void if_hangul_UnsetSCFocus (iml_session_t *)
void if_hangul_SendEvent (iml_session_t *, IMInputEvent *ev)
void if_GetIfInfo (IMArgList args, int num_args)

Variables

static if_methods_t if_methods
UTFCHAR lename_string []
UTFCHAR ko_hrn_string []
static IMLEName lename
static IMLocale locales []

Define Documentation

#define CARD32BIT   CARD32

Definition at line 59 of file leif.c.


Function Documentation

void if_GetIfInfo ( IMArgList  args,
int  num_args 
)

Definition at line 149 of file leif.c.

{
    int i;

    printf("if_GetIfInfo()\n");
    printf("  This method is invoked when htt_server retrieves\n");
    printf("  if_method_t method table.\n\n");

    for (i = 0; i < num_args; i++, args++) {
        switch (args->id) {
            case IF_VERSION:
                args->value = (IMArgVal) VERSION;
                break;
            case IF_METHOD_TABLE:
                args->value = (IMArgVal) & if_methods;
                break;
            case IF_LE_NAME:
                args->value = (IMArgVal) & lename;
                break;
            case IF_SUPPORTED_LOCALES:
                args->value = (IMArgVal) & locales;
                break;
            case IF_SUPPORTED_OBJECTS:
                break;
            case IF_NEED_THREAD_LOCK:
                args->value = (IMArgVal) False;
                break;
            default:
                printf("\tUnknown id: %d\n", args->id);
                break;
       }
    }
}

Definition at line 320 of file leif.c.

{
    Desktop *desktop_data;

    printf("if_hangul_CloseDesktop()\n");
    printf("  This method is invoked when the user exits from\n");
    printf("  the desktop, which means there is no IM client\n");
    printf("  for the user.\n");
    
    printf("\n");
    printf("  user [%s@%s] exited\n",
        desktop->user_name,
        desktop->host_name);
    printf("\n");

    desktop_data = (Desktop*)desktop->specific_data;

    free(desktop_data);

    return True;
}

Definition at line 201 of file leif.c.

{
    printf("if_hangul_CloseIF()\n");
    printf("  This method is invoked when htt_server stops to\n");
    printf("  to use the Language Engine, which means there is\n");
    printf("  no client of the Language Engine is used.\n\n");

    return True;
}
Bool if_hangul_CreateSC ( iml_session_t s,
IMArgList  args,
int  num_args 
)

Definition at line 345 of file leif.c.

{
    int i;
    iml_desktop_t *desktop = s->desktop;

    printf("if_hangul_CreateSC()\n");
    printf("  This method is invoked when a session is created\n");
    
    printf("\n");
    printf("  Creating a session for user [%s@%s]\n",
        desktop->user_name,
        desktop->host_name);
    printf("\n");

    printf("  The additional info of IM client are\n");

    for (i = 0; i < num_args; i++, args++) {
        switch (args->id) {
            case UI_USER_NAME:
                if (args->value) {
                    printf("       UI_USER_NAME=%s\n", args->value);
                }
                break;
            case UI_HOST_NAME:
                if (args->value) {
                    printf("       UI_HOST_NAME=%s\n", args->value);
                }
                break;
            case UI_DISPLAY_ID:
                if (args->value) {
                    printf("       UI_DISPLAY_ID=%s\n", args->value);
                }
                break;
            case UI_PROTOCOL_TYPE:
                if (args->value) {
                    printf("       UI_PROTOCOL_TYPE=%s\n", args->value);
                }
                break;
            case UI_CLIENT_TYPE:
                if (args->value) {
                    printf("       UI_CLIENT_TYPE=%s\n", args->value);
                }
                break;
            case UI_XSERVER_VENDOR:
                if (args->value) {
                    printf("       UI_XSERVER_VENDOR=%s\n", args->value);
                }
                break;
            case UI_OS_NAME:
                if (args->value) {
                    printf("       UI_OS_NAME=%s\n", args->value);
                }
                break;
            case UI_OS_ARCH:
                if (args->value) {
                    printf("       UI_OS_ARCH=%s\n", args->value);
                }
                break;
            case UI_OS_VERSION:
                if (args->value) {
                    printf("       UI_OS_VERSION=%s\n", args->value);
                }
                break;
            default:
                if (args->value) {
                    printf("       %d=%s\n", args->id, args->value);
                }
                break;
            }
    }

    hangul_session_init(s);
    
    return True;
}

Here is the call graph for this function:

Definition at line 426 of file leif.c.

{
    printf("if_hangul_DestroySC(s=0x%x)\n", (unsigned int)s);
    printf("  This method is invoked when the session is\n");
    printf("  being destroyed.\n");
    
    printf("\n");
    printf("  Destroying the session %x of user [%s@%s]\n",
        (unsigned int)s,
        s->desktop->user_name,
        s->desktop->host_name);
    printf("\n");

    hangul_session_finalize(s);

    return True;
}

Here is the call graph for this function:

Bool if_hangul_GetIFValues ( iml_if_t If,
IMArgList  args,
int  num_args 
)

Definition at line 214 of file leif.c.

{
    printf("if_hangul_GetIFValues()\n");
    printf("  This method is invoked when the Language Engine\n");
    printf("  wants to set IF attributes of IM Client.\n\n");
    return True;
}
Bool if_hangul_GetSCValues ( iml_session_t s,
IMArgList  args,
int  num_args 
)

Definition at line 447 of file leif.c.

{
    int i;
    IMArg *p = args;

    printf("if_hangul_GetSCValues(s=0x%x)\n", (unsigned int)s);
    printf("  This method is invoked when the Language Engine\n");
    printf("  wants to set SC attributes of IM Client.\n\n");
    
    for (i = 0; i < num_args; i++, p++) {
        switch (p->id) {
            default:
                printf("args: %d: %p\n", p->id, p->value);
                break;
            }
    }
    return True;
}
Bool if_hangul_OpenDesktop ( iml_desktop_t desktop,
IMArgList  args,
int  num_args 
)

Definition at line 241 of file leif.c.

{
    int i;

    printf("if_hangul_OpenDesktop()\n");
    printf("  This method is invoked when the user start to use\n");
    printf("  the desktop, which means the first connection.\n");
    
    printf("\n");
    printf("  user [%s@%s] is entered\n",
        desktop->user_name,
        desktop->host_name);
    printf("\n");

    printf("  The additional info of IM client are\n");

    for (i = 0; i < num_args; i++, args++) {
        switch (args->id) {
            case UI_USER_NAME:
                if (args->value) {
                    printf("       UI_USER_NAME=%s\n", args->value);
                }
                break;
            case UI_HOST_NAME:
                if (args->value) {
                    printf("       UI_HOST_NAME=%s\n", args->value);
                }
                break;
            case UI_DISPLAY_ID:
                if (args->value) {
                    printf("       UI_DISPLAY_ID=%s\n", args->value);
                }
                break;
            case UI_PROTOCOL_TYPE:
                if (args->value) {
                    printf("       UI_PROTOCOL_TYPE=%s\n", args->value);
                }
                break;
            case UI_CLIENT_TYPE:
                if (args->value) {
                    printf("       UI_CLIENT_TYPE=%s\n", args->value);
                }
                break;
            case UI_XSERVER_VENDOR:
                if (args->value) {
                    printf("       UI_XSERVER_VENDOR=%s\n", args->value);
                }
                break;
            case UI_OS_NAME:
                if (args->value) {
                    printf("       UI_OS_NAME=%s\n", args->value);
                }
                break;
            case UI_OS_ARCH:
                if (args->value) {
                    printf("       UI_OS_ARCH=%s\n", args->value);
                }
                break;
            case UI_OS_VERSION:
                if (args->value) {
                    printf("       UI_OS_VERSION=%s\n", args->value);
                }
                break;
            default:
                printf("\tUnknown id=%d\n", args->id);
                break;
            }
    }

    hangul_desktop_init(desktop);
    
    return True;
}

Here is the call graph for this function:

Definition at line 187 of file leif.c.

{
    printf("if_hangul_OpenIF()\n");
    printf("\tThis method is invoked when the Language Engine\n");
    printf("\tis started to use by htt_server\n\n");

    hangul_le_init();

    return True;
}

Here is the call graph for this function:

Definition at line 516 of file leif.c.

{
    IMText *text;
    printf("if_hangul_ResetSC(s=0x%x)\n", (unsigned int)s);
    printf("  This method is invoked when the IM client\n");
    printf("  wants to reset the IC.\n\n");

    hangul_prep(s);
    text = hangul_session_reset(s);
    hangul_exec(s);
    
    return text;
}

Here is the call graph for this function:

Definition at line 561 of file leif.c.

{
    hangul_prep(s);
    if (ev->type == IM_EventKeyList) {
        IMKeyListEvent *keylistevent = (IMKeyListEvent *) ev;
        IMKeyEventStruct *key = (IMKeyEventStruct *) keylistevent->keylist;

        printf("Event: [%c](0x%x)\n", key->keyChar, key->keyCode);
        if (!hangul_composer(s, key))
            hangul_foward_keyevent(s, key);
    } else {
        printf("Event: %d\n", ev->type);
    }
    hangul_exec(s);
}

Here is the call graph for this function:

Bool if_hangul_SetIFValues ( iml_if_t If,
IMArgList  args,
int  num_args 
)

Definition at line 227 of file leif.c.

{
    printf("if_hangul_SetIFValues()\n");
    printf("  This method is invoked when the IM client\n");
    printf("  wants to set IF attributes.\n\n");
    
    return True;
}

Definition at line 533 of file leif.c.

{
    printf("if_hangul_SetSCFocus(s=0x%x)\n", (unsigned int)s);
    printf("  This method is invoked when the IM client\n");
    printf("  gets the input focus.\n\n");

    hangul_prep(s);
    hangul_focus(s);
    hangul_exec(s);
}

Here is the call graph for this function:

Bool if_hangul_SetSCValues ( iml_session_t s,
IMArgList  args,
int  num_args 
)

Definition at line 471 of file leif.c.

{
    int i;
    IMArg *p = args;
    
    printf("if_hangul_SetSCValues(s=0x%x)\n", (unsigned int)s);
    printf("  This method is invoked when the IM client\n");
    printf("  wants to set SC attributes.\n\n");
    
    hangul_prep(s);
    for (i = 0; i < num_args; i++, p++) {
        switch (p->id) {
        case SC_TRIGGER_ON_NOTIFY:
            printf(" SC_TRIGGER_ON_NOTIFY: received\n");
            hangul_conversion_on(s);

            break;
        case SC_TRIGGER_OFF_NOTIFY:
            printf(" SC_TRIGGER_OFF_NOTIFY: received\n");
            hangul_conversion_off(s);

            break;
        case SC_REALIZE:
            if(s->desktop->session_count == 1){
                    printf("       SC_REALIZE: just after OpenDesktop\n");
            } else {
                    printf("       SC_REALIZE: received\n");
            }
            break;
        default:
            printf("\tUnknown id=%d\n", args->id);
            break;
        }
    }
    printf("\n");

    hangul_exec(s);
    return True;
}

Here is the call graph for this function:

Definition at line 547 of file leif.c.

{
    printf("if_hangul_UnsetSCFocus(s=0x%x)\n", (unsigned int)s);
    printf("  This method is invoked when the IM client\n");
    printf("  loses the input focus.\n\n");

    hangul_prep(s);
    hangul_unfocus(s);
    hangul_exec(s);
}

Here is the call graph for this function:


Variable Documentation

Initial value:
 {
    0xd55c,                 
    0xad6d,                 
    0xc5b4,                 
    0
}

Definition at line 124 of file leif.c.

IMLEName lename [static]
Initial value:
 {
    "hangul",               
    lename_string           
}

Definition at line 131 of file leif.c.

Initial value:
 {
    0xd55c,                 
    0xae00,                 
    0
}

Definition at line 115 of file leif.c.

IMLocale locales[] [static]
Initial value:
 {
    { "ko",          ko_hrn_string },
    { NULL,          NULL          }
}

Definition at line 136 of file leif.c.