Back to index

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

Go to the source code of this file.

Functions

Bool if_template_OpenIF (iml_if_t *)
Bool if_template_CloseIF (iml_if_t *)
Bool if_template_GetIFValues (iml_if_t *, IMArgList, int)
Bool if_template_SetIFValues (iml_if_t *, IMArgList, int)
Bool if_template_OpenDesktop (iml_desktop_t *, IMArgList, int)
Bool if_template_CloseDesktop (iml_desktop_t *)
Bool if_template_CreateSC (iml_session_t *, IMArgList, int)
Bool if_template_DestroySC (iml_session_t *)
Bool if_template_GetSCValues (iml_session_t *, IMArgList, int)
Bool if_template_SetSCValues (iml_session_t *, IMArgList, int)
IMTextif_template_ResetSC (iml_session_t *)
void if_template_SetSCFocus (iml_session_t *)
void if_template_UnsetSCFocus (iml_session_t *)
void if_template_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 jahrn_string []
static IMLEName lename
static IMLocale locales []

Function Documentation

void if_GetIfInfo ( IMArgList  args,
int  num_args 
)

Definition at line 143 of file template.c.

{
    int i;
#ifdef DEBUG
    printf("if_GetIfInfo()\n");
    printf("  This method is invoked when htt_server retrieves\n");
    printf("  if_method_t method table.\n\n");
#endif
    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) & 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:
                break;
            }
    }
}

Definition at line 308 of file template.c.

{
    printf("if_template_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");
    return True;
}

Definition at line 191 of file template.c.

{
    printf("if_template_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_template_CreateSC ( iml_session_t s,
IMArgList  args,
int  num_args 
)

Definition at line 326 of file template.c.

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

    printf("if_template_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;
            }
    }
    
    return True;
}

Definition at line 400 of file template.c.

{
    printf("if_template_DestroySC(s=0x%x)\n", 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",
        s,
        s->desktop->user_name,
        s->desktop->host_name);
    printf("\n");
    
    return True;
}
Bool if_template_GetIFValues ( iml_if_t If,
IMArgList  args,
int  num_args 
)

Definition at line 205 of file template.c.

{
    int i;
    
    printf("if_template_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_template_GetSCValues ( iml_session_t s,
IMArgList  args,
int  num_args 
)

Definition at line 419 of file template.c.

{
    int i;
    IMArg *p = args;

    printf("if_template_GetSCValues(s=0x%x)\n", 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:
                break;
            }
    }
    return True;
}
Bool if_template_OpenDesktop ( iml_desktop_t desktop,
IMArgList  args,
int  num_args 
)

Definition at line 234 of file template.c.

{
    int i;

    printf("if_template_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;
            }
    }
    
    return True;
}

Definition at line 180 of file template.c.

{
    printf("if_template_OpenIF()\n");
    printf("  This method is invoked when the Language Engine\n");
    printf("  is started to use by htt_server\n\n");
    return True;
}

Definition at line 479 of file template.c.

{
    printf("if_template_ResetSC(s=0x%x)\n", s);
    printf("  This method is invoked when the IM client\n");
    printf("  wants to reset the IC.\n\n");
    
    return (IMText *) NULL;
}

Definition at line 511 of file template.c.

{
    printf("if_template_SendEvent(s=0x%x,ev=%x)\n", s, ev);
    printf("  This method is invoked when any event occurs\n");
    printf("  on the IM client.\n\n");
    
    if (ev->type == IM_EventKeyList) {
        IMKeyListEvent *keylistevent = (IMKeyListEvent *) ev;
        IMKeyEventStruct *key = (IMKeyEventStruct *) keylistevent->keylist;
        printf("     received keyevent keycode=0x%x,keychar=0x%x,state=%x\n",
            key->keyCode,
            key->keyChar,
            key->modifier);
    }
}
Bool if_template_SetIFValues ( iml_if_t If,
IMArgList  args,
int  num_args 
)

Definition at line 220 of file template.c.

{
    printf("if_template_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 491 of file template.c.

{
    printf("if_template_SetSCFocus(s=0x%x)\n", s);
    printf("  This method is invoked when the IM client\n");
    printf("  gets the input focus.\n\n");
}
Bool if_template_SetSCValues ( iml_session_t s,
IMArgList  args,
int  num_args 
)

Definition at line 442 of file template.c.

{
    int i;
    IMArg *p = args;
    
    printf("if_template_SetSCValues(s=0x%x)\n", s);
    printf("  This method is invoked when the IM client\n");
    printf("  wants to set SC attributes.\n\n");
    
    for (i = 0; i < num_args; i++, p++) {
        switch (p->id) {
            case SC_TRIGGER_ON_NOTIFY:
                printf("    SC_TRIGGER_ON_NOTIFY: received\n");
                break;
            case SC_TRIGGER_OFF_NOTIFY:
                printf("    SC_TRIGGER_OFF_NOTIFY: received\n");
                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:
                break;
            }
    }
    printf("\n");
    return True;
}

Definition at line 501 of file template.c.

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

Variable Documentation

Initial value:
 {
    0x65e5,
    0x672c,
    0x8a9e,
0}

Definition at line 116 of file template.c.

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

Definition at line 122 of file template.c.

Initial value:
 {
    0x30c6,
    0x30f3,
    0x30d7,
    0x30ec,
    0x30fc,
    0x30c8,
    0x30a8,
    0x30f3,
    0x30b8,
    0x30f3,
0}

Definition at line 100 of file template.c.

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

Definition at line 127 of file template.c.