Back to index

im-sdk  12.3.91
Classes | Defines | Typedefs | Functions
XSunIMCm.h File Reference
#include "XSunIMCore.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  IMStatusString
struct  IMCurrentStatusString
struct  _iml_session
struct  _cmif_spec_t

Defines

#define xim_iml_inheritance_DEFIND
#define xim_imlogic_session_DEFIND
#define DEFAULTPreEditTextBufferSize   512
#define DEFAULTPreEditAttrBufferSize   512
#define DEFAULTStatusStringRemainBufferSize   512
#define PREEDIT_IS_ACTIVE   0x00000001
#define STATUS_IS_ACTIVE   0x00000002
#define LOOKUP_IS_ACTIVE   0x00000004
#define AUX_IS_ACTIVE   0x00000008
#define PRE_EDIT_DONE_REQUIRED   0x00000001
#define STATUS_DONE_REQUIRED   0x00000002
#define STATUS_DRAW_REQUIRED   0x00000004
#define IMM_COMMIT_REQUIRED   0x00000008
#define DEFAULT_OPENWINHOME   "/usr/openwin"
#define OW_LOCALE_PATH   "lib/locale"
#define MODE_DAT_PATH   "htt/mode.dat"
#define XXXCOMPAT_MODE_DAT_PATH   "se/sunview/mode.dat"
#define DEFAULT_MLEPATH   "/usr/lib/mle"
#define MAX_ENV_OPCODE   153

Typedefs

typedef struct _iml_session iml_session_t
typedef struct _cmif_spec_t cmif_spec_t

Functions

Private void cm_destruct_session (iml_session_t *)
Private int destruct_session (iml_session_t *)
Private void cm_reset (iml_session_t *, iml_inst **)
Private void cm_conversion_on (iml_session_t *)
Private void cm_send_commit (iml_session_t *)
Private void cm_make_conversion_on (iml_session_t *)
Private void cm_make_conversion_off (iml_session_t *)
Private int cm_make_status_string (iml_session_t *, wchar_t *, unsigned char *, int)
Private void cm_set_choice (iml_session_t *, int)
Private void cm_attr2feedback (XIMFeedback *, unsigned char *, int, char *)
Private int cm_create_session (int, iml_session_t *, Bool)
Private void cm_select_unknown_control (iml_session_t *)
Private void cm_opsw_init (void)
Private int construct_cm_initial_data (struct cm_initstruct *)
Private iml_inst ** eval_it (iml_session_t *, struct cm_to_env *, iml_inst **)
Private void init_status_string (iml_session_t *)
Private void eval_cm_to_env_packet (iml_session_t *, struct cm_to_env *)
Private struct cm_to_env * get_cte (struct cm_to_env **)
Private env_commit (iml_session_t *, iml_inst **, struct cm_to_env **)
Private void cm_eval_results (iml_session_t *, iml_inst *)
Private Bool ims_cm_negotiation_pool (int, iml_session_t *, char *, void *)
Private ReadOneLine (char *, int, int)
struct cm_to_env * cm_put (int, int, struct env_to_cm *)
int cm_open (int, struct cm_initstruct *, struct cm_to_env **)
struct cm_to_env * cm_close (int, int)

Class Documentation

struct IMStatusString

Definition at line 81 of file XSunIMCm.h.

Class Members
wchar_t name
int order
wchar_t string
wchar_t value
struct IMCurrentStatusString

Definition at line 88 of file XSunIMCm.h.

Class Members
wchar_t * name
int order
wchar_t * string
wchar_t * value
struct _iml_session

Definition at line 56 of file SunIMCore.h.

Collaboration diagram for _iml_session:
Class Members
wchar_t conversion_on_key
int current_active_region
iml_desktop_t * desktop
iml_if_t * If
iml_inst_mem_block_list_t * mem_block_short_term_small
iml_inst_mem_elem_list_t * mem_elem_long_term
iml_inst_mem_elem_list_t * mem_elem_short_term
Bool nego
struct _iml_session * next
int PreEditAttrBufferSize
int PreEditTextBufferSize
IMPreeditDrawCallbackStruct PreEditTextInfo
int public_status
void * SessionContext
void * specific_data
status_cache_t status_cache
struct _cmif_spec_t

Definition at line 111 of file XSunIMCm.h.

Collaboration diagram for _cmif_spec_t:
Class Members
IMCurrentStatusString CurrentStatusString
int NStatus
int NStatusInFile
IMStatusString StatusString

Define Documentation

#define AUX_IS_ACTIVE   0x00000008

Definition at line 130 of file XSunIMCm.h.

#define DEFAULT_MLEPATH   "/usr/lib/mle"

Definition at line 145 of file XSunIMCm.h.

#define DEFAULT_OPENWINHOME   "/usr/openwin"

Definition at line 141 of file XSunIMCm.h.

#define DEFAULTPreEditAttrBufferSize   512

Definition at line 122 of file XSunIMCm.h.

#define DEFAULTPreEditTextBufferSize   512

Definition at line 121 of file XSunIMCm.h.

Definition at line 123 of file XSunIMCm.h.

#define IMM_COMMIT_REQUIRED   0x00000008

Definition at line 139 of file XSunIMCm.h.

#define LOOKUP_IS_ACTIVE   0x00000004

Definition at line 129 of file XSunIMCm.h.

#define MAX_ENV_OPCODE   153

Definition at line 147 of file XSunIMCm.h.

#define MODE_DAT_PATH   "htt/mode.dat"

Definition at line 143 of file XSunIMCm.h.

#define OW_LOCALE_PATH   "lib/locale"

Definition at line 142 of file XSunIMCm.h.

#define PRE_EDIT_DONE_REQUIRED   0x00000001

Definition at line 136 of file XSunIMCm.h.

#define PREEDIT_IS_ACTIVE   0x00000001

Definition at line 127 of file XSunIMCm.h.

#define STATUS_DONE_REQUIRED   0x00000002

Definition at line 137 of file XSunIMCm.h.

#define STATUS_DRAW_REQUIRED   0x00000004

Definition at line 138 of file XSunIMCm.h.

#define STATUS_IS_ACTIVE   0x00000002

Definition at line 128 of file XSunIMCm.h.

Definition at line 98 of file XSunIMCm.h.

Definition at line 109 of file XSunIMCm.h.

#define XXXCOMPAT_MODE_DAT_PATH   "se/sunview/mode.dat"

Definition at line 144 of file XSunIMCm.h.


Typedef Documentation

typedef struct _cmif_spec_t cmif_spec_t
typedef struct _iml_session iml_session_t

Function Documentation

Private void cm_attr2feedback ( XIMFeedback *  ,
unsigned char *  ,
int  ,
char *   
)
struct cm_to_env* cm_close ( int  ,
int   
) [read]

Here is the caller graph for this function:

Definition at line 413 of file XSunIMCm.c.

{
    iml_inst *rv ;

    if(s->remainder){
       rv = s->remainder ;
       s->remainder = NULL ;
       return;
    }
    cm_make_conversion_on(s);
}

Here is the call graph for this function:

Private int cm_create_session ( int  ,
iml_session_t ,
Bool   
)
Private int cm_make_status_string ( iml_session_t ,
wchar_t *  ,
unsigned char *  ,
int   
)
int cm_open ( int  ,
struct cm_initstruct *  ,
struct cm_to_env **   
)

Here is the caller graph for this function:

Private void cm_opsw_init ( void  )

Definition at line 1702 of file XSunIMCm.c.

{
    register i ;
    
    if(opsw[ENV_NOP]) return;

    for(i = 0 ; i < MAX_ENV_OPCODE ; i++){
       opsw[i] = env_nop ;
    }
    opsw[ENV_NOP] = env_nop ;
    opsw[ENV_COMMIT] = env_commit ;
    opsw[ENV_SET_CURRENT_REGION] = env_set_current_region ;
    opsw[ENV_CM_OFF] = env_cm_off ;
    opsw[ENV_SETKEY_CM_ON] = env_setkey_cm_on ;
    opsw[ENV_INTERM_RESET] = env_interm_reset ;
    opsw[ENV_INTERM] = env_interm ;
    opsw[ENV_M_INTERACTIVE] = env_m_interactive ;
    opsw[ENV_SELECT_RESET] = env_select_reset ;
    opsw[ENV_SELECT] = env_select ;
    opsw[ENV_SELECT_END] = env_select_end ;
    opsw[ENV_SELECT_NEXT] = env_select_next ;
    opsw[ENV_SELECT_PREV] = env_select_prev ;
    opsw[ENV_SELECT_COMMIT] = env_select_commit ;
    opsw[ENV_SELECT_TEST] = env_nop ;
    opsw[ENV_SET_SIMPLE_MODE] =  env_set_smode ;
    opsw[ENV_SET_MODE] = env_set_mode ;
    opsw[ENV_MISC_RESET] = env_misc_reset ;
    opsw[ENV_M_LABEL] = env_m_label ;
    opsw[ENV_M_MESS] = env_nop ;

}

Here is the call graph for this function:

Here is the caller graph for this function:

struct cm_to_env* cm_put ( int  ,
int  ,
struct env_to_cm *   
) [read]

Here is the caller graph for this function:

Private void cm_reset ( iml_session_t ,
iml_inst **   
)

Definition at line 1612 of file XSunIMCm.c.

{
    struct cm_to_env *ctep;
    static struct env_to_cm etc;

    if(s->remainder){
       if(s->remainder = s->If->m->iml_execute(s, &s->remainder)){
           cm_eval_results(s, s->remainder);
       }
        s->remainder = NULL;
        return;
    }
    etc.ec_operation = CM_RESET;
    etc.ec_next = NULL ;
    s->public_status &= ~IMLSTATUS_Henkan_Mode ;
    ctep = cm_put(s->language_engine, s->session_id, &etc);
    eval_cm_to_env_packet(s, ctep);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Private void cm_set_choice ( iml_session_t ,
int   
)
Private int construct_cm_initial_data ( struct cm_initstruct *  )

Definition at line 558 of file XSunIMCm.c.

{
    struct group   *gp;
    struct passwd  *pp;
    Private char     host_name[64];
#ifdef SVR4
    static char     id_string[64];
#endif /* SVR4 */    

#define       ENV_VERSION   2
    cm_initp->env_value = (e_char *) ENV_VERSION;

    cm_initp->usr_auth_info.uid = getuid();
    cm_initp->usr_auth_info.gid = getgid();
#ifdef SVR4
    sysinfo(SI_HW_SERIAL, id_string, sizeof(id_string));
    cm_initp->usr_auth_info.hid = atoi(id_string);
#else
    cm_initp->usr_auth_info.hid = gethostid();
#endif /* SVR4 */    
    pp = getpwuid(getuid());
    if (pp != (struct passwd *)NULL)
      cm_initp->usr_auth_info.user_name = pp->pw_name;
    else
      cm_initp->usr_auth_info.user_name = (char *)NULL;
    gp = getgrgid(getgid());
    if (gp != (struct group *)NULL)
      cm_initp->usr_auth_info.grp_name = gp->gr_name;
    else
      cm_initp->usr_auth_info.grp_name = (char *)NULL;
#ifdef SVR4
    sysinfo(SI_HOSTNAME, host_name, sizeof(host_name));
#else  
    gethostname(host_name, sizeof(host_name));
#endif /* SVR4 */
    cm_initp->usr_auth_info.host_name = host_name;

}

Here is the caller graph for this function:

Private env_commit ( iml_session_t ,
iml_inst **  ,
struct cm_to_env **   
)

Definition at line 794 of file XSunIMCm.c.

{
    iml_inst *lp ;
    struct cm_to_env *rp = get_cte(ctep);
    int len;
    if(i18nXView2_COMPAT){
       lp = s->If->m->iml_make_preedit_erase_inst(s);
       s->If->m->iml_link_inst_tail(rrv, lp);
       lp = s->If->m->iml_make_preedit_done_inst(s);
       s->If->m->iml_link_inst_tail(rrv, lp);
    }    
    /*
     * Only multi byte format can be used for commit string.
     */
    if (rp->ce_string) {
       len = strlen((const char*)rp->ce_string);
    } else {
       len = 0;
    }
    lp = s->If->m->iml_make_commit_inst(s, len, rp->ce_string);
    s->If->m->iml_link_inst_tail(rrv, lp);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Private void eval_cm_to_env_packet ( iml_session_t ,
struct cm_to_env *   
)
Private iml_inst** eval_it ( iml_session_t ,
struct cm_to_env *  ,
iml_inst **   
)
Private struct cm_to_env* get_cte ( struct cm_to_env **  ) [read]

Definition at line 1226 of file XSunIMCm.c.

{
    struct cm_to_env *rp = NULL ;
    if(ctep){
       rp = *ctep ;
       if (rp != NULL){
           *ctep = rp->ce_next ;
       } else {
           *ctep = NULL ;
       }
       return rp ;
    } 
    return NULL;
}

Here is the caller graph for this function:

Private Bool ims_cm_negotiation_pool ( int  ,
iml_session_t ,
char *  ,
void *   
)
Private ReadOneLine ( char *  ,
int  ,
int   
)

Definition at line 1521 of file XSunIMCm.c.

{
    int                read_bytes;
    char        *readpointer, *endofline;
    static char        ibuf[BUFSIZE];
    static int         index = 0;
    int                prevbytes = 0;
    int                returnbytes;

    if(nb == 0){
       index = 0;
       return 0;
    }
       
    readpointer = ibuf + index;
    if(index == 0) {
       read_bytes = read(fd, ibuf, nb-1);
       if(read_bytes <= 0)
              return NULL;
       ibuf[read_bytes] = 0;
    }

    if(!(endofline = (char *) strchr(readpointer, (int)'\n'))) {
       prevbytes = BUFSIZE-index-1;
       bcopy(readpointer, buf, prevbytes);
       read_bytes = read(fd, ibuf, nb-1);
       if(read_bytes <= 0)
              return NULL;
       ibuf[read_bytes] = 0;
       if(!(endofline = (char *) strchr(ibuf , (int)'\n')))
              return NULL;
       readpointer = ibuf;
    }

    returnbytes = endofline - readpointer + 1;
    bcopy(readpointer, buf + prevbytes, returnbytes);
    buf[prevbytes + returnbytes] = 0;
    index = endofline - ibuf + 1;
     
    return (returnbytes);
}

Here is the call graph for this function:

Here is the caller graph for this function: