Back to index

im-sdk  12.3.91
Defines | Functions | Variables
sampleja2.cpp File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "SunIM.h"

Go to the source code of this file.

Defines

#define DEBUG

Functions

Bool if_sampleja2_OpenIF (iml_if_t *)
Bool if_sampleja2_CloseIF (iml_if_t *)
Bool if_sampleja2_GetIFValue (iml_if_t *, IMArgList, int)
Bool if_sampleja2_SetIFValue (iml_if_t *, IMArgList, int)
Bool if_sampleja2_OpenDesktop (iml_desktop_t *, IMArgList, int)
Bool if_sampleja2_CloseDesktop (iml_desktop_t *)
Bool if_sampleja2_CreateSC (iml_session_t *, IMArgList, int)
Bool if_sampleja2_DestroySC (iml_session_t *)
Bool if_sampleja2_GetSCValue (iml_session_t *, IMArgList, int)
Bool if_sampleja2_SetSCValue (iml_session_t *, IMArgList, int)
IMTextif_sampleja2_ResetSC (iml_session_t *)
void if_sampleja2_SetSCFocus (iml_session_t *)
void if_sampleja2_UnsetSCFocus (iml_session_t *)
void if_sampleja2_SendEvent (iml_session_t *, IMInputEvent *ev)
void if_GetIfInfo (IMArgList args, int num_args)
static int UTFCHARCpy (UTFCHAR *, UTFCHAR *)
static int UTFCHARLen (UTFCHAR *)
static IMFeedbackListcreate_feedback (iml_session_t *s, int size)
static void my_conversion_on (iml_session_t *)
static void my_conversion_off (iml_session_t *)

Variables

if_methods_t sampleja_methods
UTFCHAR lename_string [] = {0x30b5, 0x30f3, 0x30d7, 0x30eb, 0x65e5, 0x672c, 0x8a9e, 0x30a8, 0x30f3, 0x30b8, 0x30f3, 0x0}
UTFCHAR jahrn_string [] = {0x65e5, 0x672c, 0x8a9e, 0x0}
static IMLEName lename
static IMLocale locales []
UTFCHAR on_string [] = {0x65e5, 0x672c, 0x8a9e, 0x30aa, 0x30f3, 0}
UTFCHAR off_string [] = {0x65e5, 0x672c, 0x8a9e, 0x30aa, 0x30d5, 0}

Define Documentation

#define DEBUG

Definition at line 145 of file sampleja2.cpp.


Function Documentation

static IMFeedbackList* create_feedback ( iml_session_t s,
int  size 
) [static]
void if_GetIfInfo ( IMArgList  args,
int  num_args 
)

Definition at line 108 of file sampleja2.cpp.

{
    int i;
    for (i = 0; i < num_args; i++, args++) {
        switch (args->id) {
            case IF_VERSION:
                args->value = (IMArgVal) "1.2";
                break;
            case IF_METHOD_TABLE:
                args->value = (IMArgVal) & sampleja_methods;
                break;
            case IF_LE_NAME:
                args->value = (IMArgVal) & lename;
                break;
            case IF_SUPPORTED_LOCALES:
                args->value = (IMArgVal) & locales;
                break;
            case IF_NEED_THREAD_LOCK:
                args->value = (IMArgVal) False;
                break;
            default:
                break;
            }
    }
}

Definition at line 229 of file sampleja2.cpp.

{
#ifdef DEBUG
    printf("if_sampleja2_CloseDesktop()\n");
    printf("  If=[%x]\n", desktop->If);
    printf("  desktop=[%x]\n", desktop);
    printf("  locale=[%s]\n", desktop->If->locale);
    printf("  if_name=[%s]\n", desktop->If->if_name);
    printf("  USER:%s\n", desktop->user_name);
    printf("  HOST:%s\n", desktop->host_name);
    printf("  DISPLAY:%s\n", desktop->display_id);
#endif
    return True;
}

Definition at line 162 of file sampleja2.cpp.

{
#ifdef DEBUG
    printf("if_sampleja2_CloseIF()\n");
    printf("  If=[%x]\n", If);
    printf("  locale=[%s]\n", If->locale);
    printf("  if_name=[%s]\n", If->if_name);
#endif
    return True;
}
Bool if_sampleja2_CreateSC ( iml_session_t s,
IMArgList  args,
int  num_args 
)

Definition at line 247 of file sampleja2.cpp.

{
    iml_desktop_t *desktop = s->desktop;
#ifdef DEBUG
    printf("if_sampleja2_CreateSC()\n");
    printf("  If=[%x]\n", desktop->If);
    printf("  desktop=[%x]\n", desktop);
    printf("  locale=[%s]\n", desktop->If->locale);
    printf("  if_name=[%s]\n", desktop->If->if_name);
    printf("  USER:%s\n", desktop->user_name);
    printf("  HOST:%s\n", desktop->host_name);
    printf("  DISPLAY:%s\n", desktop->display_id);
#endif
    return True;
}

Definition at line 268 of file sampleja2.cpp.

{
#ifdef DEBUG
    printf("if_sampleja2_DestroySC(s=%x)\n", s);
    printf("  s=[%x]\n", s);
    printf("  If=[%x]\n", s->desktop->If);
    printf("  desktop=[%x]\n", s->desktop);
    printf("  locale=[%s]\n", s->desktop->If->locale);
    printf("  if_name=[%s]\n", s->desktop->If->if_name);
    printf("  USER:%s\n", s->desktop->user_name);
    printf("  HOST:%s\n", s->desktop->host_name);
#endif
    return True;
}
Bool if_sampleja2_GetIFValue ( iml_if_t If,
IMArgList  args,
int  num_args 
)

Definition at line 176 of file sampleja2.cpp.

{
#ifdef DEBUG
    printf("if_sampleja2_GetIFValue()\n");
    printf("  If=[%x]\n", If);
    printf("  locale=[%s]\n", If->locale);
    printf("  if_name=[%s]\n", If->if_name);
#endif
    return True;
}
Bool if_sampleja2_GetSCValue ( iml_session_t s,
IMArgList  args,
int  num_args 
)

Definition at line 286 of file sampleja2.cpp.

{
    int i;
    IMArg *p = args;
    
    static int charsubset[] = {
        67,                 /* LATIN */
        47,                 /* HIRAGANA */
        48,                 /* KATAKANA */
        71,                 /* KANJI */
        0
    };
    
#ifdef DEBUG
    printf("if_sampleja2_GetSCValue(s=%x)\n", s);
    printf("  s=[%x]\n", s);
    printf("  If=[%x]\n", s->desktop->If);
    printf("  desktop=[%x]\n", s->desktop);
    printf("  locale=[%s]\n", s->desktop->If->locale);
    printf("  if_name=[%s]\n", s->desktop->If->if_name);
    printf("  USER:%s\n", s->desktop->user_name);
    printf("  HOST:%s\n", s->desktop->host_name);
#endif
    for (i = 0; i < num_args; i++, p++) {
        switch (p->id) {
            case SC_SUPPORTED_CHARACTER_SUBSETS:
                /* specify CHARACTER_SUBSETS */
                p->value = (IMArgVal) charsubset;
                break;
            default:
                break;
            }
    }
    return True;
}
Bool if_sampleja2_OpenDesktop ( iml_desktop_t desktop,
IMArgList  args,
int  num_args 
)

Definition at line 209 of file sampleja2.cpp.

{
#ifdef DEBUG
    printf("if_sampleja2_OpenDesktop()\n");
    printf("  If=[%x]\n", desktop->If);
    printf("  desktop=[%x]\n", desktop);
    printf("  locale=[%s]\n", desktop->If->locale);
    printf("  if_name=[%s]\n", desktop->If->if_name);
    printf("  USER:%s\n", desktop->user_name);
    printf("  HOST:%s\n", desktop->host_name);
    printf("  DISPLAY:%s\n", desktop->display_id);
#endif
    return True;
}

Definition at line 148 of file sampleja2.cpp.

{
#ifdef DEBUG
    printf("if_sampleja2_OpenIF()\n");
    printf("  If=[%x]\n", If);
    printf("  locale=[%s]\n", If->locale);
    printf("  if_name=[%s]\n", If->if_name);
#endif
    return True;
}

Definition at line 419 of file sampleja2.cpp.

{
#ifdef DEBUG
    printf("if_sampleja2_ResetSC(s=%x)\n", s);
    printf("  s=[%x]\n", s);
    printf("  If=[%x]\n", s->desktop->If);
    printf("  desktop=[%x]\n", s->desktop);
    printf("  locale=[%s]\n", s->desktop->If->locale);
    printf("  if_name=[%s]\n", s->desktop->If->if_name);
    printf("  USER:%s\n", s->desktop->user_name);
    printf("  HOST:%s\n", s->desktop->host_name);
    printf("  DISPLAY:%s\n", s->desktop->display_id);
#endif
    return (IMText *) NULL;
}

Definition at line 474 of file sampleja2.cpp.

{
#ifdef DEBUG
    printf("if_sampleja2_SendEvent s=%x ev=%x\n", s, ev);
#endif
    if (ev) {
        if (ev->type == IM_EventKeyList) {
        } else if (ev->type == IM_EventString) {
              /* receive operation list */
              IMStringEvent *stringev=(IMStringEvent*)ev;
        } else if (ev->type == IM_EventAux) {
        } else if (ev->type == IM_EventString) {
        } else if (ev->type == IM_EventText) {
        }
    }
}
Bool if_sampleja2_SetIFValue ( iml_if_t If,
IMArgList  args,
int  num_args 
)

Definition at line 192 of file sampleja2.cpp.

{
    int i;
#ifdef DEBUG
    printf("if_sampleja2_SetIFValue()\n");
    printf("  If=[%x]\n", If);
    printf("  locale=[%s]\n", If->locale);
    printf("  if_name=[%s]\n", If->if_name);
#endif
    return True;
}

Definition at line 438 of file sampleja2.cpp.

{
#ifdef DEBUG
    printf("if_sampleja2_SetSCFocus()\n");
    printf("  s=[%x]\n", s);
    printf("  If=[%x]\n", s->desktop->If);
    printf("  desktop=[%x]\n", s->desktop);
    printf("  locale=[%s]\n", s->desktop->If->locale);
    printf("  if_name=[%s]\n", s->desktop->If->if_name);
    printf("  USER:%s\n", s->desktop->user_name);
    printf("  HOST:%s\n", s->desktop->host_name);
    printf("  DISPLAY:%s\n", s->desktop->display_id);
#endif
}
Bool if_sampleja2_SetSCValue ( iml_session_t s,
IMArgList  args,
int  num_args 
)

Definition at line 379 of file sampleja2.cpp.

{
    int i;
    IMArg *p = args;
#ifdef DEBUG
    printf("if_sampleja2_SetSCValue()\n");
    printf("  s=[%x]\n", s);
    printf("  If=[%x]\n", s->desktop->If);
    printf("  desktop=[%x]\n", s->desktop);
    printf("  locale=[%s]\n", s->desktop->If->locale);
    printf("  if_name=[%s]\n", s->desktop->If->if_name);
    printf("  USER:%s\n", s->desktop->user_name);
    printf("  HOST:%s\n", s->desktop->host_name);
#endif
    for (i = 0; i < num_args; i++, p++) {
        switch (p->id) {
            case SC_TRIGGER_ON_NOTIFY:
                printf("conversion on\n");
                my_conversion_on(s);
                break;
                
            case SC_TRIGGER_OFF_NOTIFY:
                printf("conversion off\n");
                my_conversion_off(s);
                break;
                
            case SC_REALIZE:
                break;
            default:
                break;
            }
    }
    return True;
}

Here is the call graph for this function:

Definition at line 456 of file sampleja2.cpp.

{
#ifdef DEBUG
    printf("if_sampleja2_UnsetSCFocus()\n");
    printf("  s=[%x]\n", s);
    printf("  If=[%x]\n", s->desktop->If);
    printf("  desktop=[%x]\n", s->desktop);
    printf("  locale=[%s]\n", s->desktop->If->locale);
    printf("  if_name=[%s]\n", s->desktop->If->if_name);
    printf("  USER:%s\n", s->desktop->user_name);
    printf("  HOST:%s\n", s->desktop->host_name);
    printf("  DISPLAY:%s\n", s->desktop->display_id);
#endif
}
static void my_conversion_off ( iml_session_t s) [static]
static void my_conversion_on ( iml_session_t s) [static]
static int UTFCHARCpy ( UTFCHAR dest,
UTFCHAR original 
) [static]
static int UTFCHARLen ( UTFCHAR p) [static]

Variable Documentation

UTFCHAR jahrn_string[] = {0x65e5, 0x672c, 0x8a9e, 0x0}

Definition at line 87 of file sampleja2.cpp.

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

Definition at line 89 of file sampleja2.cpp.

UTFCHAR lename_string[] = {0x30b5, 0x30f3, 0x30d7, 0x30eb, 0x65e5, 0x672c, 0x8a9e, 0x30a8, 0x30f3, 0x30b8, 0x30f3, 0x0}

Definition at line 86 of file sampleja2.cpp.

IMLocale locales[] [static]
Initial value:
 {
    {"ja", jahrn_string},   
    NULL
}

Definition at line 93 of file sampleja2.cpp.

UTFCHAR off_string[] = {0x65e5, 0x672c, 0x8a9e, 0x30aa, 0x30d5, 0}

Definition at line 327 of file sampleja2.cpp.

UTFCHAR on_string[] = {0x65e5, 0x672c, 0x8a9e, 0x30aa, 0x30f3, 0}

Definition at line 326 of file sampleja2.cpp.