Back to index

im-sdk  12.3.91
Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
ICState Class Reference

#include <ICState.hh>

Inheritance diagram for ICState:
Inheritance graph
[legend]
Collaboration diagram for ICState:
Collaboration graph
[legend]

List of all members.

Classes

struct  ICShared

Public Member Functions

bool send_avail_p ()
IMStateget_imstate ()
CARD16BIT get_im_id ()
IIIMP_hotkey_profileget_hotkey_profile ()
CARD16BIT get_ic_id () const
bool substatep () const
bool deliver (void *message)
virtual void destroy ()
 ICState (CARD16BIT x_ic_id, IMState *x_pims, ICHandler *x_pich, IMLExec_ICState *x_pimlex)
virtual int toggle_client_convmode (bool flag)
virtual int forward_keyevent (IMKeyEventStruct *pkeyevent)
virtual int commit_string (IMText *pimtext)
virtual int preedit_start ()
virtual int draw_preedit (IMPreeditDrawCallbackStruct *pimpdraw)
virtual int preedit_done ()
virtual int status_start ()
virtual int draw_status (IMStatusDrawCallbackStruct *pimsdraw)
virtual int status_done ()
virtual int lookup_start (IMLookupStartCallbackStruct *pimls)
virtual int draw_lookup (IMLookupDrawCallbackStruct *pimld)
virtual int lookup_process (IMLookupProcessCallbackStruct *pimlp)
virtual int lookup_done ()
virtual int aux_start (IMAuxStartCallbackStruct *pimauxstart)
virtual int draw_aux (IMAuxDrawCallbackStruct *pimauxstart)
virtual int aux_done (IMAuxDoneCallbackStruct *pimauxstart)
virtual int ns_listener (IMNSListenerStruct *pons)

Protected Member Functions

IMLExec_ICStateget_imlexec ()
bool mark_terminal ()
virtual bool state_send_available_p ()=0
void reset_state ()
void change_state (ICState &newstate, bool destroyp=true)
IMProtocolget_improtocol ()
ICHandlerget_ichandler ()
void invalidate_ichandler ()
bool check_protocol_version (int version)
int invalid_operation (const char *opstr)
virtual bool message_proc (void *message)=0
 ICState (ICState &x)
virtual ~ICState ()

Private Member Functions

bool terminatingp ()

Private Attributes

ICStatepproc_state
ICStatepbase_state
ICSharedpshared

Detailed Description

Definition at line 121 of file ICState.hh.


Class Documentation

struct ICState::ICShared

Definition at line 123 of file ICState.hh.

Collaboration diagram for ICState::ICShared:
Class Members
CARD16BIT ic_id
ICHandler * pich
IMLExec_ICState * pimlex
IMState * pims
bool terminating

Constructor & Destructor Documentation

ICState::ICState ( ICState x) [inline, protected]

Definition at line 187 of file ICState.hh.

virtual ICState::~ICState ( ) [inline, protected, virtual]

Definition at line 195 of file ICState.hh.

    {
       if (!substatep()) {
           delete pshared;
           if (pproc_state) delete pproc_state;
       }
    }

Here is the call graph for this function:

ICState::ICState ( CARD16BIT  x_ic_id,
IMState x_pims,
ICHandler x_pich,
IMLExec_ICState x_pimlex 
) [inline]

Definition at line 234 of file ICState.hh.

    {
       pshared = new ICShared();
       pshared->ic_id = x_ic_id;
       pshared->pims = x_pims;
       pshared->pich = x_pich;
       pshared->pimlex = x_pimlex;
       pshared->terminating = false;
       x_pimlex->set_icstate(this);
       pproc_state = NULL;
       pbase_state = this;
    }

Here is the call graph for this function:


Member Function Documentation

int ICState::aux_done ( IMAuxDoneCallbackStruct pimauxstart) [virtual]

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 164 of file ICState.cpp.

{
    return invalid_operation("aux_done");
}

Here is the call graph for this function:

Here is the caller graph for this function:

int ICState::aux_start ( IMAuxStartCallbackStruct pimauxstart) [virtual]

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 148 of file ICState.cpp.

{
    return invalid_operation("aux_start");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void ICState::change_state ( ICState newstate,
bool  destroyp = true 
) [inline, protected]

Definition at line 154 of file ICState.hh.

    {
       ICState *p = pbase_state;
       if (destroyp && p->pproc_state) delete p->pproc_state;
       if (p == &newstate) {
           p->pproc_state = NULL;
       } else {
           p->pproc_state = &newstate;
       }
       p->pshared->pimlex->set_icstate(&newstate);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

bool ICState::check_protocol_version ( int  version) [inline, protected]

Definition at line 175 of file ICState.hh.

    { return get_imstate()->check_protocol_version(version); }

Here is the call graph for this function:

int ICState::commit_string ( IMText pimtext) [virtual]

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 70 of file ICState.cpp.

{
    return invalid_operation("commit_string");
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool ICState::deliver ( void *  message)

Definition at line 7 of file ICState.cpp.

{
    ICState *p;
    bool result = true;

    if (pproc_state) p = pproc_state;
    else p = this;

    if (!p->message_proc(message)) return false;

    if (send_avail_p() && get_imlexec()) {
       result = get_imlexec()->execute();
    }

    if (terminatingp()) {
       LOG_DEBUG("Try to terminate IC(%d).", get_ic_id());
       if (pproc_state) {
           LOG_DEBUG("Right now, the current state in IC(%d) may be "
                    "waiting for client responce.",
                    get_ic_id());
       } else if (!(get_imlexec()->empty())){
           LOG_DEBUG("Pending IML instruction(s) still remain in IC(%d), "
                    "wait for the next chance.",
                    get_ic_id());
       } else {
           int id = get_ic_id();
           destroy();
           LOG_DEBUG("Successfully IC(%d) is terminated.", id);
       }
    }

    return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void ICState::destroy ( ) [inline, virtual]

Reimplemented in IIIMP_ICState.

Definition at line 226 of file ICState.hh.

    {
       if (!substatep()) {
           pshared->pims->remove_icstate(this);
       }
       delete this;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

int ICState::draw_aux ( IMAuxDrawCallbackStruct pimauxstart) [virtual]

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 156 of file ICState.cpp.

{
    return invalid_operation("draw_aux");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 126 of file ICState.cpp.

{
    return invalid_operation("draw_lookup");
}

Here is the call graph for this function:

Here is the caller graph for this function:

int ICState::draw_preedit ( IMPreeditDrawCallbackStruct pimpdraw) [virtual]

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 84 of file ICState.cpp.

{
    return invalid_operation("draw_preedit");
}

Here is the call graph for this function:

Here is the caller graph for this function:

int ICState::draw_status ( IMStatusDrawCallbackStruct pimsdraw) [virtual]

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 104 of file ICState.cpp.

{
    return invalid_operation("draw_status");
}

Here is the call graph for this function:

Here is the caller graph for this function:

int ICState::forward_keyevent ( IMKeyEventStruct pkeyevent) [virtual]

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 62 of file ICState.cpp.

{
    return invalid_operation("forward_keyevent");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 215 of file ICState.hh.

    { return get_imstate()->get_hotkey_profile(); }

Here is the call graph for this function:

Here is the caller graph for this function:

CARD16BIT ICState::get_ic_id ( ) const [inline]

Definition at line 217 of file ICState.hh.

    { return pshared->ic_id; }

Here is the caller graph for this function:

ICHandler* ICState::get_ichandler ( ) [inline, protected]

Definition at line 171 of file ICState.hh.

    { return pshared->pich; }

Here is the caller graph for this function:

CARD16BIT ICState::get_im_id ( ) [inline]

Definition at line 213 of file ICState.hh.

    { return get_imstate()->get_im_id(); }

Here is the call graph for this function:

Here is the caller graph for this function:

IMLExec_ICState* ICState::get_imlexec ( ) [inline, protected]

Definition at line 138 of file ICState.hh.

    { return pshared->pimlex; }

Here is the caller graph for this function:

IMProtocol* ICState::get_improtocol ( ) [inline, protected]

Definition at line 169 of file ICState.hh.

    { return pshared->pims->get_improtocol(); }

Here is the call graph for this function:

Definition at line 211 of file ICState.hh.

    { return pshared->pims; }

Here is the caller graph for this function:

int ICState::invalid_operation ( const char *  opstr) [protected]

Definition at line 44 of file ICState.cpp.

{
    LOG_ERROR("Current IC state cannot deal with %s.", opstr);
    abort();
    return 0;
}

Here is the caller graph for this function:

void ICState::invalidate_ichandler ( ) [inline, protected]

Definition at line 173 of file ICState.hh.

    { pshared->pich = NULL; }

Here is the caller graph for this function:

int ICState::lookup_done ( ) [virtual]

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 142 of file ICState.cpp.

{
    return invalid_operation("lookup_done");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 134 of file ICState.cpp.

{
    return invalid_operation("lookup_process");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 118 of file ICState.cpp.

{
    return invalid_operation("lookup_start");
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool ICState::mark_terminal ( ) [inline, protected]

Definition at line 140 of file ICState.hh.

    { 
       pshared->terminating = true;
       return true;
    }

Here is the caller graph for this function:

virtual bool ICState::message_proc ( void *  message) [protected, pure virtual]

Implemented in IIIMP_ICState_WAITING, IIIMP_ICState_REQUESTED, and IIIMP_ICState.

Here is the caller graph for this function:

int ICState::ns_listener ( IMNSListenerStruct pons) [virtual]

Definition at line 172 of file ICState.cpp.

{
    return invalid_operation("ns_listener");
}

Here is the call graph for this function:

Here is the caller graph for this function:

int ICState::preedit_done ( ) [virtual]

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 92 of file ICState.cpp.

{
    return invalid_operation("preedit_done");
}

Here is the call graph for this function:

Here is the caller graph for this function:

int ICState::preedit_start ( ) [virtual]

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 78 of file ICState.cpp.

{
    return invalid_operation("preedit_start");
}

Here is the call graph for this function:

Here is the caller graph for this function:

void ICState::reset_state ( ) [inline, protected]

Definition at line 147 of file ICState.hh.

    { 
       ICState *p = pbase_state;
       if (p->pproc_state) delete p->pproc_state;
       p->pproc_state = NULL;
       p->pshared->pimlex->set_icstate(p);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

bool ICState::send_avail_p ( ) [inline]

Definition at line 204 of file ICState.hh.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool ICState::state_send_available_p ( ) [protected, pure virtual]

Implemented in IIIMP_ICState_WAITING, IIIMP_ICState_REQUESTED, and IIIMP_ICState.

Here is the caller graph for this function:

int ICState::status_done ( ) [virtual]

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 112 of file ICState.cpp.

{
    return invalid_operation("status_done");
}

Here is the call graph for this function:

Here is the caller graph for this function:

int ICState::status_start ( ) [virtual]

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 98 of file ICState.cpp.

{
    return invalid_operation("status_start");
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool ICState::substatep ( ) const [inline]

Definition at line 219 of file ICState.hh.

    { return (pbase_state != this); }

Here is the caller graph for this function:

bool ICState::terminatingp ( ) [inline, private]

Definition at line 134 of file ICState.hh.

    { return pshared->terminating; }

Here is the caller graph for this function:

int ICState::toggle_client_convmode ( bool  flag) [virtual]

Reimplemented in IIIMP_ICState_REQUESTED.

Definition at line 54 of file ICState.cpp.

{
    return invalid_operation("toggle_client_convmode");
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 131 of file ICState.hh.

Definition at line 130 of file ICState.hh.

Reimplemented in IIIMP_ICState.

Definition at line 132 of file ICState.hh.


The documentation for this class was generated from the following files: