Back to index

im-sdk  12.3.91
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
IIIMP_ICState_WAITING Class Reference

#include <IIIMP_ICState.hh>

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

List of all members.

Public Member Functions

virtual bool message_proc (void *message)
 IIIMP_ICState_WAITING (IIIMP_ICState_REQUESTED *pbase, int opcode)
 IIIMP_ICState_WAITING (IIIMP_ICState_REQUESTED *pbase, int opcode, int index, const u16string &imname)
virtual ~IIIMP_ICState_WAITING ()
iml_session_tget_iml_session ()
iml_methods_tget_iml_methods ()
IIIMPTransget_iiimptrans ()
bool conversion_enable_p ()
IMLangListget_langlist (iml_desktop_t *)
bool create_langimlist ()
LangIMListget_langimlist ()
IMInputContextget_iminputcontext ()
IMSvrget_imsvr ()
LEMgrget_lemgr ()
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 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)

Static Public Member Functions

static IIIMP_ICStatecreate (CARD16BIT ic_id, IIIMP_IMState *piiims, ICHandler *pich)

Protected Member Functions

IIIMP_IMStateget_iiimp_imstate ()
bool send (IIIMP_message *pmes, bool deletep)
IIIMP_ICState_REQUESTEDstart_request ()
IMLExec_ICStateget_imlexec ()
bool mark_terminal ()
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)

Protected Attributes

SharedStatepshared
IIIMP_hotkeyihk

Private Member Functions

void initialize ()
bool waiting_aux_message_p ()
void restore_state ()
bool match_waiting_message (IIIMP_message *pmes)
virtual bool state_send_available_p ()

Private Attributes

IIIMP_ICState_REQUESTEDpstreq
int opcode
int index
u16string imname
u16string filename
bool wait_aux_message
bool wait_ns_message

Friends

class IIIMP_hotkey

Detailed Description

Definition at line 197 of file IIIMP_ICState.hh.


Constructor & Destructor Documentation

Definition at line 1208 of file IIIMP_ICState.cpp.

  : IIIMP_ICState(*pbase)
{
    pstreq = pbase;
    opcode = x_opcode;
    wait_aux_message = false;
    wait_ns_message = false;
}
IIIMP_ICState_WAITING::IIIMP_ICState_WAITING ( IIIMP_ICState_REQUESTED pbase,
int  opcode,
int  index,
const u16string imname 
)

Definition at line 1219 of file IIIMP_ICState.cpp.

  : IIIMP_ICState(*pbase), imname(x_imname)
{
    pstreq = pbase;
    opcode = x_opcode;
    index = x_index;
    wait_aux_message = true;
    wait_ns_message = false;
}
virtual IIIMP_ICState_WAITING::~IIIMP_ICState_WAITING ( ) [inline, virtual]

Definition at line 232 of file IIIMP_ICState.hh.

    {
       //TODO:we have to remove picsr if suddenly deleted...
    }

Member Function Documentation

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

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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 IIIMP_ICState::conversion_enable_p ( ) [inline, inherited]

Definition at line 64 of file IIIMP_ICState.hh.

    { return pshared->conversion_mode; }

Here is the caller graph for this function:

IIIMP_ICState * IIIMP_ICState::create ( CARD16BIT  ic_id,
IIIMP_IMState piiims,
ICHandler pich 
) [static, inherited]

Definition at line 112 of file IIIMP_ICState.cpp.

{
    // The current implementation use the same IMLExec.
    // Note that it will be changed later.
    IMLExec_ICState *pimlex = new IMLExec_ICState();
    // memory error;
    if (!pimlex) return NULL;
    IIIMP_ICState *pics = new IIIMP_ICState(ic_id, piiims, pich, pimlex);
    // memory error;
    if (!pics) {
       delete pimlex;
       return NULL;
    }
    return pics;
}

Here is the call graph for this function:

bool IIIMP_ICState::create_langimlist ( ) [inherited]

Definition at line 183 of file IIIMP_ICState.cpp.

{
    LEMgr *plemgr = get_lemgr ();
    IMDescriptorList::iterator it;
    IMLangList::iterator itt;

    IMDescriptorList *pimdlist = const_cast<IMDescriptorList *>(plemgr->get_all_imdesclist(get_ichandler()->get_current_desktop()));

    langimlist.clear();
    for (it = pimdlist->begin (); it != pimdlist->end (); it++){
        u16string imname;
        u16string hrn;
        imname = it->get_imname();
        hrn = it->get_hrn();
        IMLangList *llist = const_cast<IMLangList *>(it->get_languages());
        for (itt = llist->begin (); itt != llist->end (); itt++) { 
           langimlist.push_back(LangIM(langimlist.size() + 1,
              // this '+ 1' is a crack - index in lang choice starts from 1...
              itt->get_id(),
              u16string(imname),
              u16string(hrn),
              it->get_hotkey_profile()
              )
           );
        }
    }
    return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool ICState::deliver ( void *  message) [inherited]

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:

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

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:

int ICState::draw_lookup ( IMLookupDrawCallbackStruct pimld) [virtual, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

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, inherited]

Definition at line 171 of file ICState.hh.

    { return pshared->pich; }

Here is the caller graph for this function:

IIIMP_IMState* IIIMP_ICState::get_iiimp_imstate ( ) [inline, protected, inherited]

Definition at line 36 of file IIIMP_ICState.hh.

    { return (IIIMP_IMState*) get_imstate(); }

Here is the call graph for this function:

Here is the caller graph for this function:

IIIMPTrans* IIIMP_ICState::get_iiimptrans ( ) [inline, inherited]

Definition at line 58 of file IIIMP_ICState.hh.

Here is the call graph for this function:

Here is the caller graph for this function:

CARD16BIT ICState::get_im_id ( ) [inline, inherited]

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:

Definition at line 81 of file IIIMP_ICState.hh.

    {
       IMInputContext *pimic;
       pimic = dynamic_cast<IMInputContext *>(get_ichandler());
       return pimic;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

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

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, inherited]

Definition at line 169 of file ICState.hh.

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

Here is the call graph for this function:

IMState* ICState::get_imstate ( ) [inline, inherited]

Definition at line 211 of file ICState.hh.

    { return pshared->pims; }

Here is the caller graph for this function:

IMSvr * IIIMP_ICState::get_imsvr ( ) [inherited]

Definition at line 146 of file IIIMP_ICState.cpp.

{
    IMSvr *imsvr;
    IMInputContext *pimic;

    pimic = get_iminputcontext ();
    imsvr = pimic->get_imconnection()->get_imsvr();

    if (imsvr) return imsvr;
    else return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 213 of file IIIMP_ICState.cpp.

{
    return &langimlist;
}

Here is the caller graph for this function:

IMLangList * IIIMP_ICState::get_langlist ( iml_desktop_t curr_desktop) [inherited]

Definition at line 167 of file IIIMP_ICState.cpp.

{
    LEMgr *plemgr = get_lemgr ();

    IMLangList *planglist =
        const_cast<IMLangList *>(plemgr->get_all_langlist(curr_desktop));
    IMLangList::iterator it;
    for (it = planglist->begin (); it != planglist->end (); it++){
       // LOG_DEBUG("LangID [%s]", it->get_id ());
    }
    return planglist;
}

Here is the call graph for this function:

Here is the caller graph for this function:

LEMgr * IIIMP_ICState::get_lemgr ( ) [inherited]

Definition at line 159 of file IIIMP_ICState.cpp.

{
    IMSvr *pimsvr = get_imsvr ();
    return pimsvr->get_lemgr();

}

Here is the call graph for this function:

Here is the caller graph for this function:

void IIIMP_ICState_WAITING::initialize ( ) [inline, private]

Definition at line 207 of file IIIMP_ICState.hh.

    { index = -1; }
int ICState::invalid_operation ( const char *  opstr) [protected, inherited]

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, inherited]

Definition at line 173 of file ICState.hh.

    { pshared->pich = NULL; }

Here is the caller graph for this function:

int ICState::lookup_done ( ) [virtual, inherited]

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:

int ICState::lookup_process ( IMLookupProcessCallbackStruct pimlp) [virtual, inherited]

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:

int ICState::lookup_start ( IMLookupStartCallbackStruct pimls) [virtual, inherited]

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, inherited]

Definition at line 140 of file ICState.hh.

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

Here is the caller graph for this function:

Definition at line 1162 of file IIIMP_ICState.cpp.

{
    bool flag = (opcode == pmes->opcode);
    if (flag && wait_aux_message) {
       int midx = pmes->v.aux_simple.class_index;
       u16string mimname = CONV_IIIMP_STR(pmes->v.aux_simple.input_method_name);
       flag = ((index == midx) && (imname.compare(mimname) == 0));
    } 
    return flag;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool IIIMP_ICState_WAITING::message_proc ( void *  message) [virtual]

Reimplemented from IIIMP_ICState.

Definition at line 1185 of file IIIMP_ICState.cpp.

{
    IIIMP_message *pmes = (IIIMP_message*) x_pmes;

    if (!match_waiting_message(pmes)) {
#if 0
       LOG_ERROR("Client sends an invalid message. (%d,%d,%d)\n"
                "Now ICState is waiting for (%d,%d,%d).",
                pmes->opcode, pmes->im_id, pmes->ic_id,
                opcode, get_im_id(), get_ic_id());
       return false;
#else
       // It may cause W->R transition.
       return IIIMP_ICState::message_proc(pmes);
#endif
    }
    restore_state();
    
    return true;
}

Here is the call graph for this function:

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

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, inherited]

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, inherited]

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, inherited]

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:

Definition at line 1176 of file IIIMP_ICState.cpp.

{
    // change_state() will delete `this'.
    IIIMP_ICState_REQUESTED *preq = pstreq;
    change_state(*pstreq);
    preq->dealing();
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool IIIMP_ICState::send ( IIIMP_message pmes,
bool  deletep 
) [inline, protected, inherited]

Definition at line 39 of file IIIMP_ICState.hh.

    { return get_iiimp_imstate()->send(pmes, deletep); }

Here is the call graph for this function:

Here is the caller graph for this function:

bool ICState::send_avail_p ( ) [inline, inherited]

Definition at line 204 of file ICState.hh.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 13 of file IIIMP_ICState.cpp.

{
    IIIMP_ICState_REQUESTED *picsr = new IIIMP_ICState_REQUESTED(this);
    // TODO: throw memory error.
    change_state(*picsr, false);
    return picsr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

virtual bool IIIMP_ICState_WAITING::state_send_available_p ( ) [inline, private, virtual]

Reimplemented from IIIMP_ICState.

Definition at line 213 of file IIIMP_ICState.hh.

    { return false; }
int ICState::status_done ( ) [virtual, inherited]

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, inherited]

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, inherited]

Definition at line 219 of file ICState.hh.

    { return (pbase_state != this); }

Here is the caller graph for this function:

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

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:

Definition at line 209 of file IIIMP_ICState.hh.

    { return (index >= 0); }

Friends And Related Function Documentation

friend class IIIMP_hotkey [friend, inherited]

Definition at line 92 of file IIIMP_ICState.hh.


Member Data Documentation

Definition at line 203 of file IIIMP_ICState.hh.

IIIMP_hotkey* IIIMP_ICState::ihk [protected, inherited]

Definition at line 35 of file IIIMP_ICState.hh.

Definition at line 202 of file IIIMP_ICState.hh.

Definition at line 201 of file IIIMP_ICState.hh.

Definition at line 200 of file IIIMP_ICState.hh.

SharedState* IIIMP_ICState::pshared [protected, inherited]

Reimplemented from ICState.

Definition at line 34 of file IIIMP_ICState.hh.

Definition at line 199 of file IIIMP_ICState.hh.

Definition at line 204 of file IIIMP_ICState.hh.

Definition at line 205 of file IIIMP_ICState.hh.


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