Back to index

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

#include <XIMProtocol.hh>

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

List of all members.

Public Types

enum  XIMP_FE_BE_TYPE {
  XIMP_FRONTEND4 = (1L << 0), XIMP_BACKEND4 = (1L << 1), XIMP_TYPE1 = (1L << 2), XIMP_TYPE2 = (1L << 3),
  XIMP_TYPE3 = (1L << 4), XIMP_SYNC = (1L << 5), XIMP_FE_TYPE1 = (XIMP_FRONTEND4 | XIMP_TYPE1), XIMP_FE_TYPE2 = (XIMP_FRONTEND4 | XIMP_TYPE2),
  XIMP_FE_TYPE3 = (XIMP_FRONTEND4 | XIMP_TYPE3), XIMP_BE_TYPE1 = (XIMP_BACKEND4 | XIMP_TYPE1), XIMP_BE_TYPE2 = (XIMP_BACKEND4 | XIMP_TYPE2), XIMP_SYNC_BE_TYPE1 = (XIMP_SYNC | XIMP_BE_TYPE1),
  XIMP_SYNC_BE_TYPE2 = (XIMP_SYNC | XIMP_BE_TYPE2)
}
enum  XIMP_OLD_FE_BE_TYPE { XIMP_FRONTEND = 0, XIMP_BACKEND = 1 }
enum  XIM_PROTOCOL {
  XIMP_KEYRELEASE4 = 100, XIMP_KEYPRESS4 = 101, XIMP_CREATE4 = 102, XIMP_DESTROY4 = 103,
  XIMP_REG_KEY_PRESSED4 = 104, XIMP_SETFOCUS4 = 105, XIMP_UNSETFOCUS4 = 106, XIMP_CLIENT_WINDOW4 = 107,
  XIMP_FOCUS_WINDOW4 = 108, XIMP_MOVE4 = 109, XIMP_RESET4 = 110, XIMP_SETVALUE4 = 111,
  XIMP_GETVALUE4 = 112, XIMP_PREEDITSTART_RETURN4 = 120, XIMP_PREEDITCARET_RETURN4 = 121, XIMP_SPROC_STARTED4 = 130,
  XIMP_SPROC_STOPPED4 = 131, XIMP_READPROP4 = 132, XIMP_CLIENT_WINDOW_RETURN4 = 133, XIMP_FOCUS_WINDOW_RETURN4 = 134,
  XIMP_GETVALUE_RETURN4 = 135, XIMP_RESET_RETURN4 = 136, XIMP_CREATE_RETURN4 = 137, XIMP_KEYPRESS_RETURN4 = 138,
  XIMP_KEYRELEASE_RETURN4 = 139, XIMP_GEOMETRY4 = 140, XIMP_PREEDITSTART4 = 150, XIMP_PREEDITDONE4 = 151,
  XIMP_PREEDITDRAW4 = 152, XIMP_PREEDITDRAW_CM4 = 153, XIMP_PREEDITDRAW_CM_TINY4 = 154, XIMP_PREEDITDRAW_CM_FEEDBACK4 = 155,
  XIMP_PREEDITCARET4 = 156, XIMP_STATUSSTART4 = 160, XIMP_STATUSDONE4 = 161, XIMP_STATUSDRAW4 = 162,
  XIMP_STATUSDRAW_CM4 = 163, XIMP_EVENTMASK_NOTIFY4 = 200, XIMP_EVENTMASK_NOTIFY_RETURN4 = 201, XIMP_EXTENSION4 = 500,
  XIMP_ERROR4 = 999, XIMP_KEYPRESS3 = 1, XIMP_CREATE3 = 2, XIMP_DESTROY3 = 3,
  XIMP_BEGIN3 = 4, XIMP_END3 = 5, XIMP_SETFOCUS3 = 6, XIMP_UNSETFOCUS3 = 7,
  XIMP_CHANGE3 = 8, XIMP_MOVE3 = 9, XIMP_RESET3 = 10, XIMP_SETVALUE3 = 11,
  XIMP_GETVALUE3 = 12, XIMP_PREEDITSTART_RETURN3 = 20, XIMP_PREEDITCARET_RETURN3 = 21, XIMP_CREATE_RETURN3 = 2,
  XIMP_CONVERSION_BEGIN3 = 30, XIMP_PROCESS_BEGIN3 = 30, XIMP_CONVERSION_END3 = 31, XIMP_PROCESS_END3 = 31,
  XIMP_READPROP3 = 32, XIMP_GETVALUE_RETURN3 = 33, XIMP_RESET_RETURN3 = 34, XIMP_GEOMETRY3 = 40,
  XIMP_PREEDITSTART3 = 41, XIMP_PREEDITDONE3 = 42, XIMP_PREEDITDRAW3 = 43, XIMP_PREEDITDRAW_CM3 = 44,
  XIMP_PREEDITCARET3 = 45, XIMP_STATUSSTART3 = 46, XIMP_STATUSDONE3 = 47, XIMP_STATUSDRAW3 = 48,
  XIMP_STATUSDRAW_CM3 = 49, XIMP_PREEDITDRAW_TINY3 = 50, XIMP_EXTENSION3 = 90, XIMP_ERROR3 = 99
}
enum  CONTEXT_ID_SPECIAL { INVALID_CONTEXT_ID = 0xFFFF }
enum  CONCURRENCY_FLAGS { SYNC, ASYNC }
enum  IM_Attribute {
  ServerName = 1, TransportAddress = 2, VendorName = 3, PrimaryInputLocale = 4,
  LanguageList = 5, ConversionOnKeys = 6, ConversionOffKeys = 7, ProtocolHandler = 8,
  ObjectDescriptors = 9, IMEDescriptors = 10, DisplayConnection = 11, IFName = 12,
  AppName = 13, DisableStatusArea = 14, DefaultFontName = 15
}

Public Member Functions

 XIMProtocol (IMArg *, int)
 ~XIMProtocol ()
int run ()
Bool get_protocol_version (Window, char *&)
Bool get_focus_window (Window, Window &)
Bool get_preedit_font (Window, char **)
Bool get_status_font (Window, char **)
Bool get_preedit4 (Window, Ximp_PreeditPropRec4 &)
Bool get_status4 (Window, Ximp_StatusPropRec4 &)
Bool get_preedit3 (Window, Ximp_PreeditPropRec3 &)
Bool get_status3 (Window, Ximp_StatusPropRec3 &)
Bool get_server_type4 (Window, unsigned long &)
Bool set_focus_window (Window, Window)
Bool set_preedit_font (Window, char *)
Bool set_status_font (Window, char *)
Bool set_preedit4 (Window, Ximp_PreeditPropRec4)
Bool set_status4 (Window, Ximp_StatusPropRec4)
Bool set_preedit3 (Window, Ximp_PreeditPropRec3)
Bool set_status3 (Window, Ximp_StatusPropRec3)
Bool set_server_type4 (Window, unsigned long)
Bool read_property (Window, Atom, Atom, int, unsigned char **, unsigned long *)
Bool write_property (Window, Atom, Atom, int, const unsigned char *, const unsigned long)
int getICID (InputContext *ic)
void send_client_message (Window, int, unsigned long, unsigned long, unsigned long, unsigned long)
void commit_by_client_message (Window, int, const char *, int)
Atom replace_prop_pool (const unsigned char *data, int len)
Atom set_preedit_draw_data_property (const unsigned char *data, int len)
Atom set_ctext_property (const unsigned char *data, int len, int is_commit)
Atom set_ctext_property (const unsigned char *data, int len)
Atom set_feedback_property (const unsigned char *data, int len)
int set_values (IMArg *, int)
void select_destroy_emask (Window)
void select_keypress_emask (Window)
void select_keyrelease_emask (Window)
void unselect_destroy_emask (Window)
void unselect_keypress_emask (Window)
void unselect_keyrelease_emask (Window)
XIM getXIM ()
const CompoundStringgetIfName () const
void OpenIM ()
void CloseIM ()
Bool isConversionKey (unsigned int kcode, unsigned int kstate, int convOn)
Display * getDisplay () const
bool dispatch (CARD16BIT im_id, CARD16BIT ic_id, void *message)
virtual bool receive_and_dispatch (IMState *pims, int flags=SYNC)=0
virtual IMStateaccept (int flags=SYNC)=0
int get_values (IMArg *, int)
int countOnKeys () const
int countOffKeys () const
IMTriggerKeygetOnKey (unsigned int index) const
IMTriggerKeygetOffKey (unsigned int index) const
int countLanguages () const
CompoundStringgetLang (unsigned int index) const
int countObjectDescriptors () const
IMObjectDescriptorStructgetObjectDescriptor (unsigned int index) const
IMObjectDescriptorStructgetFirstObjectDescriptor ()
IMObjectDescriptorStructgetNextObjectDescriptor ()
int countIME () const
IMEditorStructgetIME (unsigned int index) const
IMEditorStructgetFirstIME ()
IMEditorStructgetNextIME ()
const CompoundStringgetPrimaryLocale () const
IMTransAcceptgetIMTransAccept (IMTransListen *trans_listen) const

Public Attributes

IMProtoHandlerproto_handler

Protected Types

enum  XIC_RESET_FLAG { RESET_NOTHING = 0, RESET_BY_CMSG, RESET_BY_PROP }
enum  MODE { OPEN, SET, GET }
typedef map< CARD16BIT, IMState * > IMStateMap

Protected Member Functions

int setSelectionOwner (Window, char *, Atom *)
void add_imstate (IMState *pims)
void remove_imstate (IMState *pims)
IMStateget_imstate (CARD16BIT im_id)
ICStateget_icstate (CARD16BIT im_id, CARD16BIT ic_id)

Protected Attributes

IMList< InputContextinput_context_list
Display * display
XIMTriggerKeys start_keys
XIMTriggerKeys stop_keys
Bool disable_status_area
IMAcceptpimaccept
IMStateMap immap
CompoundString protocol_name
CompoundString im_name
CompoundString im_address
CompoundString input_locale
CompoundString vendor_name
IMLanguageList lang_list
IMTriggerKeyList on_keys
IMTriggerKeyList off_keys
IMObjectDescriptorList od_list
IMEditorDescriptorList ime_list

Private Types

enum  XIMP_EXT { EXT_STATUS = (1L<<0), EXT_BACKFRONT = (1L<<1), EXT_CONV = (1L<<2) }
enum  XIMP_PROP_LEN { XIMP_PREEDIT_MAX_LONG3 = 14, XIMP_PREEDIT_MAX_LONG4 = 15, XIMP_STATUS_MAX_LONG3 = 13, XIMP_STATUS_MAX_LONG4 = 14 }
enum  XIMP_CM_LEN { CM_DATA_ROOM = 15 }

Private Member Functions

char * MakeNewAtom (char *, int is_commit=0)
void setProps ()
InputContextgetInputContextByFocusWindow (Window)
Bool key_press (XClientMessageEvent *)
Bool key_release (XClientMessageEvent *)
void create_ic (XClientMessageEvent *)
void destroy_ic (XClientMessageEvent *)
void destroy_window (XIMProtocol *, Window)
void start (XClientMessageEvent *)
void end (XClientMessageEvent *)
void set_focus (XClientMessageEvent *)
void unset_focus (XClientMessageEvent *)
void set_clientwin (XClientMessageEvent *)
void set_focuswin (XClientMessageEvent *)
void move (XClientMessageEvent *)
void set_icvalues (XClientMessageEvent *)
void get_icvalues (XClientMessageEvent *)
void reset (XClientMessageEvent *)
void event_mask (XClientMessageEvent *)
void extension (XClientMessageEvent *)
void preedit_start_ret (XClientMessageEvent *)
void preedit_caret_ret (XClientMessageEvent *)

Static Private Member Functions

static void * xevent_loop (void *)

Private Attributes

int screen
Atom ximp_request
Window im_window
XIMStyles styles
const char * ximp_version
XIMPTypeRec ximp_type
const char * im_version
IMThreadthread
XIMPAtoms atoms
unsigned int ext_flag
long ext_backfront
int atom_sequence

Friends

class IMState

Detailed Description

Definition at line 89 of file XIMProtocol.hh.


Member Typedef Documentation

typedef map<CARD16BIT, IMState*> IMProtocol::IMStateMap [protected, inherited]

Definition at line 17 of file IMProtocol.hh.


Member Enumeration Documentation

Enumerator:
SYNC 
ASYNC 

Definition at line 50 of file IMProtocol.hh.

                           {
           SYNC,
           ASYNC
    };
Enumerator:
INVALID_CONTEXT_ID 

Definition at line 40 of file IMProtocol.hh.

                            {
           INVALID_CONTEXT_ID = 0xFFFF
    };
enum IMProtocol::IM_Attribute [inherited]
Enumerator:
ServerName 
TransportAddress 
VendorName 
PrimaryInputLocale 
LanguageList 
ConversionOnKeys 
ConversionOffKeys 
ProtocolHandler 
ObjectDescriptors 
IMEDescriptors 
DisplayConnection 
IFName 
AppName 
DisableStatusArea 
DefaultFontName 

Definition at line 56 of file IMProtocol.hh.

                    {
    ServerName = 1,         // "iiimd"
    TransportAddress = 2,   // "tcp/<hostname>:9010" for iiim,
                            // not used for ximp40
    VendorName = 3,         // "SunMicroSystems", optional
    PrimaryInputLocale = 4,
    LanguageList = 5,
    ConversionOnKeys = 6,
    ConversionOffKeys = 7,
    ProtocolHandler = 8,
    ObjectDescriptors = 9,
    IMEDescriptors = 10,
    DisplayConnection = 11,
    IFName = 12,
    AppName = 13,
    DisableStatusArea = 14,
    DefaultFontName = 15
  };
enum IMProtocol::MODE [protected, inherited]
Enumerator:
OPEN 
SET 
GET 

Definition at line 122 of file IMProtocol.hh.

            {
    OPEN, SET, GET
  };
enum XIMPublic::XIC_RESET_FLAG [protected, inherited]
Enumerator:
RESET_NOTHING 
RESET_BY_CMSG 
RESET_BY_PROP 

Definition at line 87 of file XIMPublic.hh.

Enumerator:
XIMP_KEYRELEASE4 
XIMP_KEYPRESS4 
XIMP_CREATE4 
XIMP_DESTROY4 
XIMP_REG_KEY_PRESSED4 
XIMP_SETFOCUS4 
XIMP_UNSETFOCUS4 
XIMP_CLIENT_WINDOW4 
XIMP_FOCUS_WINDOW4 
XIMP_MOVE4 
XIMP_RESET4 
XIMP_SETVALUE4 
XIMP_GETVALUE4 
XIMP_PREEDITSTART_RETURN4 
XIMP_PREEDITCARET_RETURN4 
XIMP_SPROC_STARTED4 
XIMP_SPROC_STOPPED4 
XIMP_READPROP4 
XIMP_CLIENT_WINDOW_RETURN4 
XIMP_FOCUS_WINDOW_RETURN4 
XIMP_GETVALUE_RETURN4 
XIMP_RESET_RETURN4 
XIMP_CREATE_RETURN4 
XIMP_KEYPRESS_RETURN4 
XIMP_KEYRELEASE_RETURN4 
XIMP_GEOMETRY4 
XIMP_PREEDITSTART4 
XIMP_PREEDITDONE4 
XIMP_PREEDITDRAW4 
XIMP_PREEDITDRAW_CM4 
XIMP_PREEDITDRAW_CM_TINY4 
XIMP_PREEDITDRAW_CM_FEEDBACK4 
XIMP_PREEDITCARET4 
XIMP_STATUSSTART4 
XIMP_STATUSDONE4 
XIMP_STATUSDRAW4 
XIMP_STATUSDRAW_CM4 
XIMP_EVENTMASK_NOTIFY4 
XIMP_EVENTMASK_NOTIFY_RETURN4 
XIMP_EXTENSION4 
XIMP_ERROR4 
XIMP_KEYPRESS3 
XIMP_CREATE3 
XIMP_DESTROY3 
XIMP_BEGIN3 
XIMP_END3 
XIMP_SETFOCUS3 
XIMP_UNSETFOCUS3 
XIMP_CHANGE3 
XIMP_MOVE3 
XIMP_RESET3 
XIMP_SETVALUE3 
XIMP_GETVALUE3 
XIMP_PREEDITSTART_RETURN3 
XIMP_PREEDITCARET_RETURN3 
XIMP_CREATE_RETURN3 
XIMP_CONVERSION_BEGIN3 
XIMP_PROCESS_BEGIN3 
XIMP_CONVERSION_END3 
XIMP_PROCESS_END3 
XIMP_READPROP3 
XIMP_GETVALUE_RETURN3 
XIMP_RESET_RETURN3 
XIMP_GEOMETRY3 
XIMP_PREEDITSTART3 
XIMP_PREEDITDONE3 
XIMP_PREEDITDRAW3 
XIMP_PREEDITDRAW_CM3 
XIMP_PREEDITCARET3 
XIMP_STATUSSTART3 
XIMP_STATUSDONE3 
XIMP_STATUSDRAW3 
XIMP_STATUSDRAW_CM3 
XIMP_PREEDITDRAW_TINY3 
XIMP_EXTENSION3 
XIMP_ERROR3 

Definition at line 157 of file XIMProtocol.hh.

                    {
    /* client <=> frontend  */
    XIMP_KEYRELEASE4 = 100,
    XIMP_KEYPRESS4 = 101,
    /* client ==> frontend  * Base Protocol */
    XIMP_CREATE4 = 102,
    XIMP_DESTROY4 = 103,
    XIMP_REG_KEY_PRESSED4 = 104,
    XIMP_SETFOCUS4 = 105,
    XIMP_UNSETFOCUS4 = 106,
    XIMP_CLIENT_WINDOW4 = 107,
    XIMP_FOCUS_WINDOW4 = 108,
    XIMP_MOVE4 = 109,
    XIMP_RESET4 = 110,
    XIMP_SETVALUE4 = 111,
    XIMP_GETVALUE4 = 112,
    /* * Callback  Protocol */
    XIMP_PREEDITSTART_RETURN4 = 120,
    XIMP_PREEDITCARET_RETURN4 = 121,
    /* client <== frontend  * Base Protocol  */
    XIMP_SPROC_STARTED4 = 130,
    XIMP_SPROC_STOPPED4 = 131,
    XIMP_READPROP4 = 132,
    XIMP_CLIENT_WINDOW_RETURN4 = 133,
    XIMP_FOCUS_WINDOW_RETURN4 = 134,
    XIMP_GETVALUE_RETURN4 = 135,
    XIMP_RESET_RETURN4 = 136,
    XIMP_CREATE_RETURN4 = 137,
    XIMP_KEYPRESS_RETURN4 = 138,
    XIMP_KEYRELEASE_RETURN4 = 139,
    /* Callback  Protocol */
    XIMP_GEOMETRY4 = 140,
    XIMP_PREEDITSTART4 = 150,
    XIMP_PREEDITDONE4 = 151,
    XIMP_PREEDITDRAW4 = 152,
    XIMP_PREEDITDRAW_CM4 = 153,
    XIMP_PREEDITDRAW_CM_TINY4 = 154,
    XIMP_PREEDITDRAW_CM_FEEDBACK4 = 155,
    XIMP_PREEDITCARET4 = 156,
    XIMP_STATUSSTART4 = 160,
    XIMP_STATUSDONE4 = 161,
    XIMP_STATUSDRAW4 = 162,
    XIMP_STATUSDRAW_CM4 = 163,
    /* client => IM Server for frontend method */
    XIMP_EVENTMASK_NOTIFY4 = 200,
    /* client <= IM Server for frontend method */
    XIMP_EVENTMASK_NOTIFY_RETURN4 = 201,
    /* Extension Protocol */
    XIMP_EXTENSION4 = 500,
    /* client <== frontend  * Error Protocol */
    XIMP_ERROR4 = 999,

    /* ClientMessage No.  Ximp 3.5 */
    /* client <=> frontend  */
    XIMP_KEYPRESS3 = 1,
    /* client ==> frontend  * Base Protocol */
    XIMP_CREATE3 = 2,
    XIMP_DESTROY3 = 3,
    XIMP_BEGIN3 = 4,
    XIMP_END3 = 5,
    XIMP_SETFOCUS3 = 6,
    XIMP_UNSETFOCUS3 = 7,
    XIMP_CHANGE3 = 8,
    XIMP_MOVE3 = 9,
    XIMP_RESET3 = 10,
    XIMP_SETVALUE3 = 11,
    XIMP_GETVALUE3 = 12,
    /* Callback  Protocol */
    XIMP_PREEDITSTART_RETURN3 = 20,
    XIMP_PREEDITCARET_RETURN3 = 21,
    /* client <== frontend  * Base Protocol  */
    XIMP_CREATE_RETURN3 = 2,
    XIMP_CONVERSION_BEGIN3 = 30,
    XIMP_PROCESS_BEGIN3 = 30,
    XIMP_CONVERSION_END3 = 31,
    XIMP_PROCESS_END3 = 31, 
    XIMP_READPROP3 = 32,
    XIMP_GETVALUE_RETURN3 = 33,
    XIMP_RESET_RETURN3 = 34,
    /* Callback  Protocol */
    XIMP_GEOMETRY3 = 40,
    XIMP_PREEDITSTART3 = 41,
    XIMP_PREEDITDONE3 = 42,
    XIMP_PREEDITDRAW3 = 43,
    XIMP_PREEDITDRAW_CM3 = 44,
    XIMP_PREEDITCARET3 = 45,
    XIMP_STATUSSTART3 = 46,
    XIMP_STATUSDONE3 = 47,
    XIMP_STATUSDRAW3 = 48,
    XIMP_STATUSDRAW_CM3 = 49,
    XIMP_PREEDITDRAW_TINY3 = 50,
    /* Extension Protocol */
    XIMP_EXTENSION3 = 90,
    /* client <== frontend  * Error Protocol */
    XIMP_ERROR3 = 99
  };
enum XIMProtocol::XIMP_CM_LEN [private]
Enumerator:
CM_DATA_ROOM 

Definition at line 283 of file XIMProtocol.hh.

                   {
    CM_DATA_ROOM = 15
  };
enum XIMProtocol::XIMP_EXT [private]
Enumerator:
EXT_STATUS 
EXT_BACKFRONT 
EXT_CONV 

Definition at line 271 of file XIMProtocol.hh.

                {
    EXT_STATUS = (1L<<0), EXT_BACKFRONT = (1L<<1),
    EXT_CONV = (1L<<2)
  };
Enumerator:
XIMP_FRONTEND4 
XIMP_BACKEND4 
XIMP_TYPE1 
XIMP_TYPE2 
XIMP_TYPE3 
XIMP_SYNC 
XIMP_FE_TYPE1 
XIMP_FE_TYPE2 
XIMP_FE_TYPE3 
XIMP_BE_TYPE1 
XIMP_BE_TYPE2 
XIMP_SYNC_BE_TYPE1 
XIMP_SYNC_BE_TYPE2 

Definition at line 121 of file XIMProtocol.hh.

Enumerator:
XIMP_FRONTEND 
XIMP_BACKEND 

Definition at line 134 of file XIMProtocol.hh.

                           {
    XIMP_FRONTEND = 0, XIMP_BACKEND = 1
  };
Enumerator:
XIMP_PREEDIT_MAX_LONG3 
XIMP_PREEDIT_MAX_LONG4 
XIMP_STATUS_MAX_LONG3 
XIMP_STATUS_MAX_LONG4 

Definition at line 276 of file XIMProtocol.hh.


Constructor & Destructor Documentation

XIMProtocol::XIMProtocol ( IMArg args,
int  n 
)

Definition at line 86 of file XIMProtocol.cpp.

                                : XIMPublic(args, n) {

  input_context_list.disable_reordering();

  protocol_name = "XIMP4.0";

  ximp_version = "4.0";
  im_version = "4.0";

  ximp_type.num_of_types = 2;
  ximp_type.types = new unsigned long[2];

  ximp_type.types[0] = XIMP_FE_TYPE1;
  ximp_type.types[1] = XIMP_SYNC_BE_TYPE2;

  styles.count_styles = sizeof(ximp_styles)/sizeof(ximp_styles[0]);
  styles.supported_styles = &ximp_styles[0];

  atom_sequence = 0;

  thread = NULL;

}

Here is the call graph for this function:

Definition at line 111 of file XIMProtocol.cpp.

               {
  delete [] ximp_type.types;

  if (im_window)
    XDestroyWindow(display, im_window);

  delete start_keys.keylist;
  delete stop_keys.keylist;
  delete thread;

  return;
}

Member Function Documentation

virtual IMState* IMProtocol::accept ( int  flags = SYNC) [pure virtual, inherited]

Implemented in IIIMProtocol.

Here is the caller graph for this function:

void IMProtocol::add_imstate ( IMState pims) [protected, inherited]

Definition at line 8 of file IMProtocol.cpp.

{
    immap[pims->get_im_id()] = pims;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMPublic::CloseIM ( ) [inherited]

Definition at line 144 of file XIMPublic.cpp.

                   {
  if (root_xic) XDestroyIC(root_xic);
  if (xim) XCloseIM(xim);

  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMProtocol::commit_by_client_message ( Window  focus_window,
int  input_context_id,
const char *  ctext,
int  length 
)

Definition at line 1095 of file XIMProtocol.cpp.

                                                                 {
  XClientMessageEvent event;
  int msglen = CM_DATA_ROOM;       /* default */
  char *ctptr = (char*)ctext;
  Ximp_CommitPropRec *msg = (Ximp_CommitPropRec*)&(event.data.l[0]);

  event.type = ClientMessage;
  event.display = display;
  event.message_type = ximp_request;
  event.window = focus_window;
  event.format = 8;

  while (length > 0) {
    memset(msg, 0, sizeof(Ximp_CommitPropRec));
    msg->icid = htonl((long)input_context_id);
    msg->size = length;
    if (length < CM_DATA_ROOM) msglen = length;

    memmove(msg->ctext, ctptr, msglen);
    XSendEvent(display,
              focus_window,
              False,
              NoEventMask,
              (XEvent*)&event);
    length -= CM_DATA_ROOM;
    ctptr += CM_DATA_ROOM;
  }
  XFlush(display);
  return;
}

Here is the caller graph for this function:

int IMProtocol::countIME ( ) const [inherited]

Definition at line 97 of file IMProtocol.cpp.

                           {
  return ime_list.count();
}

Here is the call graph for this function:

Here is the caller graph for this function:

int IMProtocol::countLanguages ( ) const [inherited]

Definition at line 67 of file IMProtocol.cpp.

                                 {
  return lang_list.count();
}

Here is the call graph for this function:

Here is the caller graph for this function:

int IMProtocol::countObjectDescriptors ( ) const [inherited]

Definition at line 77 of file IMProtocol.cpp.

                                         {
  return od_list.count();
}

Here is the call graph for this function:

Here is the caller graph for this function:

int IMProtocol::countOffKeys ( ) const [inherited]

Definition at line 52 of file IMProtocol.cpp.

                               {
  return off_keys.count();
}

Here is the call graph for this function:

Here is the caller graph for this function:

int IMProtocol::countOnKeys ( ) const [inherited]

Definition at line 47 of file IMProtocol.cpp.

                              {
  return on_keys.count();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMProtocol::create_ic ( XClientMessageEvent *  ev) [private]

Definition at line 784 of file XIMProtocol.cpp.

                                              {
  XIMPInputContext *ic = new XIMPInputContext(this, ev);
  input_context_list.addItem(ic);
  int input_context_id = input_context_list.getIndex(ic);

  send_client_message(ic->focus_window(),
                    (ic->is_version_40() ?
                     XIMP_CREATE_RETURN4:
                     XIMP_CREATE_RETURN3),
                    input_context_id,
                    0, 0, 0);
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMProtocol::destroy_ic ( XClientMessageEvent *  ev) [private]

Definition at line 798 of file XIMProtocol.cpp.

                                               {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItem(input_context_id));
  if (!ic) return;

  ic->destroy_xic();

  input_context_list.remove(ic);

  delete ic;

  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMProtocol::destroy_window ( XIMProtocol ximp_protocol,
Window  destroy_win 
) [private]

Definition at line 813 of file XIMProtocol.cpp.

                                             {
  XIMPInputContext *ic;
  XClientMessageEvent xcme;

  ic = (XIMPInputContext *)&(ximp_protocol->input_context_list.getFirstItem());
  while (NULL != ic) {
    if (ic->client_window() == destroy_win) {
      /* in destroy_ic(), only data.i[1] is referred. */
      xcme.data.l[1] = ximp_protocol->input_context_list.getIndex(ic);
      ximp_protocol->destroy_ic(&xcme);
    }
    ic = (XIMPInputContext *)&(ximp_protocol->input_context_list.getNextItem());
  }

  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool IMProtocol::dispatch ( CARD16BIT  im_id,
CARD16BIT  ic_id,
void *  message 
) [inherited]

Definition at line 25 of file IMProtocol.cpp.

{
    if (ic_id == INVALID_CONTEXT_ID) {
       IMState *pims = get_imstate(im_id);
       return pims->deliver(message);
    }
    ICState *pics = get_icstate(im_id, ic_id);

    if (!pics) {
       LOG_ERROR("Invalid im_id and ic_id (%d, %d)",
                (int) im_id, (int) ic_id);
       return false;
    }

    return pics->deliver(message);
}

Here is the call graph for this function:

void XIMProtocol::end ( XClientMessageEvent *  ev) [private]

Definition at line 844 of file XIMProtocol.cpp.

                                        {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItem(input_context_id));
  if (!ic) return;

  if (!ic->is_conv_state()) return;

  ic->conversion_end();
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMProtocol::event_mask ( XClientMessageEvent *  ev) [private]

Definition at line 1023 of file XIMProtocol.cpp.

                                               {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItem(input_context_id));
  if (!ic) return;

  ic->set_fwin_select_mask(ev->data.l[2]);

  send_client_message(ic->focus_window(),
                    XIMP_EVENTMASK_NOTIFY_RETURN4,
                    input_context_id,
                    0, 0, 0);
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMProtocol::extension ( XClientMessageEvent *  ev) [private]

Definition at line 1038 of file XIMProtocol.cpp.

                                              {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItem(input_context_id));
  if (!ic) return;
  unsigned int extension_type = ev->data.l[2];

  if (extension_type == atoms.ext_statuswin) {
    ;
  }
  if (extension_type == atoms.ext_backfront) {
    ;
  }
  if (extension_type == atoms.ext_conversion) {
    if (ev->data.l[3]) {
      // set conv_state
      if (ev->data.l[4])    // conv state
       ic->conversion_start();
      else
       ic->conversion_end();
    } else {
      // get conv_state
      int conv_state = ic->is_conv_state();
      send_client_message(ic->focus_window(),
                       (ic->is_version_40() ?
                        XIMP_EXTENSION4 : XIMP_EXTENSION3),
                       input_context_id,
                       atoms.ext_conversion,
                       conv_state,
                       0);
    }
  }
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::get_focus_window ( Window  win,
Window &  focus_win 
)

Definition at line 372 of file XIMProtocol.cpp.

                                                           {
  unsigned char *data;
  unsigned long len;

  if (!read_property(win, atoms.focus, XA_WINDOW, 32, &data, &len)) {
    return False;
  } else if (len != 1 && len != 2) {
    /* if len == 2, data[4-7] contains a event mask
       of the data[0-3] window. */
    XFree((char *)data);
    return False;
  }
  focus_win = *(Window *)data;
  XFree((char *)data);
  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

ICState* IMProtocol::get_icstate ( CARD16BIT  im_id,
CARD16BIT  ic_id 
) [inline, protected, inherited]

Definition at line 31 of file IMProtocol.hh.

    {
       IMState *pims;
       pims = get_imstate(im_id);
       if (!pims) return NULL;
       return pims->get_icstate(ic_id);
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMProtocol::get_icvalues ( XClientMessageEvent *  ev) [private]

Definition at line 940 of file XIMProtocol.cpp.

                                                 {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItem(input_context_id));

  if (!ic) return;

  ic->get_values(ev);

  send_client_message(ic->focus_window(),
                    (ic->is_version_40() ?
                     XIMP_GETVALUE_RETURN4 :
                     XIMP_GETVALUE_RETURN3),
                    input_context_id,
                    0, 0, 0);
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

IMState* IMProtocol::get_imstate ( CARD16BIT  im_id) [inline, protected, inherited]

Definition at line 24 of file IMProtocol.hh.

    {
       IMStateMap::iterator it;
       it = immap.find(im_id);
       if (it == immap.end()) return NULL;
       return it->second;
    }

Here is the caller graph for this function:

Bool XIMProtocol::get_preedit3 ( Window  win,
Ximp_PreeditPropRec3 preedit_attr 
)

Definition at line 441 of file XIMProtocol.cpp.

                                                           {
  unsigned char *data;
  unsigned long len;

  if (!read_property(win, atoms.preedit, atoms.preedit, 32,
                   (unsigned char **)&data, &len)) {
    return False;
  }
  preedit_attr = *(Ximp_PreeditPropRec3*)data;
  XFree((char *)data);
  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::get_preedit4 ( Window  win,
Ximp_PreeditPropRec4 preedit_attr 
)

Definition at line 426 of file XIMProtocol.cpp.

                                                           {
  unsigned char *data;
  unsigned long len;

  if (!read_property(win, atoms.preedit, atoms.preedit, 32,
                   (unsigned char **)&data, &len)) {
    return False;
  }
  preedit_attr = *(Ximp_PreeditPropRec4*)data;
  XFree((char *)data);
  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::get_preedit_font ( Window  win,
char **  name 
)

Definition at line 390 of file XIMProtocol.cpp.

                                                     {
  unsigned char *data;
  unsigned long len;

  if (!read_property(win, atoms.preedit_font, XA_STRING, 8,
                   (unsigned char **)&data, &len)) {
    return False;
  }
  if (*name)
     delete []*name;
  char *t_name = new char[strlen((const char *)data)+1];
  *name = t_name;
  strcpy(t_name, (const char *)data);
  XFree(data);
  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::get_protocol_version ( Window  win,
char *&  prop_ret 
)

Definition at line 355 of file XIMProtocol.cpp.

                                                             {
  Atom atom_ret = (Atom)0;
  int format_ret = 0;
  unsigned long nitems_ret = (unsigned long)0;
  unsigned long bytes_ret = (unsigned long)0;

  if (XGetWindowProperty(display, win, atoms.version, 0, 10000L, True,
                      XA_STRING, &atom_ret, &format_ret, &nitems_ret,
                      &bytes_ret, (unsigned char**)&prop_ret)
      != Success) return False;
  if (atom_ret == None || atom_ret != XA_STRING) {
    return False;
  }
  return True;
}

Here is the caller graph for this function:

Bool XIMProtocol::get_server_type4 ( Window  win,
unsigned long &  type 
)

Definition at line 486 of file XIMProtocol.cpp.

                                                             {
  unsigned char *data;
  unsigned long len;

  if (!read_property(win, atoms.supported_types, atoms.supported_types,
                   32, &data, &len)) {
    return False;
  }
  type = *(unsigned long*)data;
  XFree((char*)data);
  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::get_status3 ( Window  win,
Ximp_StatusPropRec3 status_attr 
)

Definition at line 471 of file XIMProtocol.cpp.

                                                        {
  unsigned char *data;
  unsigned long len;

  if (!read_property(win, atoms.status, atoms.status, 32,
                   (unsigned char **)&data, &len)) {
    return False;
  }
  status_attr = *(Ximp_StatusPropRec3*)data;
  XFree((char *)data);
  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::get_status4 ( Window  win,
Ximp_StatusPropRec4 status_attr 
)

Definition at line 456 of file XIMProtocol.cpp.

                                                        {
  unsigned char *data;
  unsigned long len;

  if (!read_property(win, atoms.status, atoms.status, 32,
                   (unsigned char **)&data, &len)) {
    return False;
  }
  status_attr = *(Ximp_StatusPropRec4*)data;
  XFree((char *)data);
  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::get_status_font ( Window  win,
char **  name 
)

Definition at line 408 of file XIMProtocol.cpp.

                                                    {
  unsigned char *data;
  unsigned long len;

  if (!read_property(win, atoms.status_font, XA_STRING, 8,
                   (unsigned char **)&data, &len)) {
    return False;
  }
  if (*name)
     delete []*name;
  char *t_name = new char[strlen((const char *)data)+1];
  *name = t_name;
  strcpy(t_name, (const char *)data);
  XFree(data);
  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int IMProtocol::get_values ( IMArg args,
int  n 
) [inherited]

Reimplemented in IIIMProtocol.

Definition at line 196 of file IMProtocol.cpp.

                                         {
  return parseArgs(IMProtocol::GET, args, n);
}

Here is the call graph for this function:

Display* XIMPublic::getDisplay ( ) const [inline, inherited]

Definition at line 75 of file XIMPublic.hh.

{return display;}

Here is the caller graph for this function:

Definition at line 107 of file IMProtocol.cpp.

                        {
  return ime_list.getFirstIME();
}

Here is the call graph for this function:

Definition at line 87 of file IMProtocol.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

int XIMProtocol::getICID ( InputContext ic) [inline]

Definition at line 138 of file XIMProtocol.hh.

                                {
    return input_context_list.getIndex(ic);
  }

Here is the call graph for this function:

Here is the caller graph for this function:

const CompoundString & XIMPublic::getIfName ( ) const [inherited]

Definition at line 152 of file XIMPublic.cpp.

                           {
  return ifname;
}

Here is the caller graph for this function:

IMEditorStruct & IMProtocol::getIME ( unsigned int  index) const [inherited]

Definition at line 102 of file IMProtocol.cpp.

                                           {
  return ime_list.getIME(index);
}

Here is the call graph for this function:

Here is the caller graph for this function:

IMTransAccept * IMProtocol::getIMTransAccept ( IMTransListen trans_listen) const [inherited]

Definition at line 201 of file IMProtocol.cpp.

{
  return proto_handler->getIMTransAccept(trans_listen);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 703 of file XIMProtocol.cpp.

                                                  {
   XIMPInputContext *tmp_ic;
   tmp_ic = (XIMPInputContext *)&(input_context_list.getFirstItem());
   while (NULL != tmp_ic) {
     if ((NULL != tmp_ic) && (tmp_ic->focus_window() == w)) {
       return (InputContext *)tmp_ic;
     }
     tmp_ic = (XIMPInputContext *)&(input_context_list.getNextItem());
   }
   return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

CompoundString & IMProtocol::getLang ( unsigned int  index) const [inherited]

Definition at line 72 of file IMProtocol.cpp.

                                            {
  return lang_list.getLang(index);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 112 of file IMProtocol.cpp.

                       {
  return ime_list.getNextIME();
}

Here is the call graph for this function:

Definition at line 92 of file IMProtocol.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

IMObjectDescriptorStruct & IMProtocol::getObjectDescriptor ( unsigned int  index) const [inherited]

Definition at line 82 of file IMProtocol.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

IMTriggerKey & IMProtocol::getOffKey ( unsigned int  index) const [inherited]

Definition at line 62 of file IMProtocol.cpp.

                                              {
  return off_keys.getKey(index);
}

Here is the call graph for this function:

Here is the caller graph for this function:

IMTriggerKey & IMProtocol::getOnKey ( unsigned int  index) const [inherited]

Definition at line 57 of file IMProtocol.cpp.

                                             {
  return on_keys.getKey(index);
}

Here is the call graph for this function:

Here is the caller graph for this function:

const CompoundString & IMProtocol::getPrimaryLocale ( ) const [inherited]

Definition at line 117 of file IMProtocol.cpp.

                                   {
  return input_locale;
}

Here is the caller graph for this function:

XIM XIMPublic::getXIM ( ) [inherited]

Definition at line 138 of file XIMPublic.cpp.

                  {
  if (!xim) OpenIM();
  return xim;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMPublic::isConversionKey ( unsigned int  kcode,
unsigned int  kstate,
int  convOn 
) [inherited]

Definition at line 219 of file XIMPublic.cpp.

                                      {
  int i;
  KeySym ksym = XKeycodeToKeysym(display, kcode, 0);
  XIMTriggerKey *ximp_keyp;

  if (convOn)
    ximp_keyp = stop_keys.keylist;
  else
    ximp_keyp = start_keys.keylist;

  for (i = 0; i < start_keys.count_keys; i++, ximp_keyp++) {
    if ((ximp_keyp->keysym == ksym) &&
       ((kstate & ximp_keyp->modifier_mask) == ximp_keyp->modifier)) {
      return True;
    }
  }
  return False;
}

Here is the caller graph for this function:

Bool XIMProtocol::key_press ( XClientMessageEvent *  ev) [private]

Definition at line 716 of file XIMProtocol.cpp.

                                              {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItem(input_context_id));
  XEvent kev;
  if (!ic) return True;

  if (ic->checkAltKey(ev)) {
    if (ic->is_conv_state()) {
      ev->data.l[0] = XIMP_END3; // dummy
      end((XClientMessageEvent*)ev);
    } else {
      ev->data.l[0] = ic->is_version_40()?
       XIMP_REG_KEY_PRESSED4: XIMP_BEGIN3; // dummy
      start((XClientMessageEvent*)ev);
    }
    goto skip;
  }

  kev.xkey.type = KeyPress;
  kev.xkey.window = ic->focus_window();
  kev.xkey.display = display;
  kev.xkey.root = DefaultRootWindow(display);
  kev.xkey.x = 0;
  kev.xkey.y = 0;
  kev.xkey.x_root = 0;
  kev.xkey.y_root = 0;
  kev.xkey.keycode = ev->data.l[2];
  kev.xkey.state = ev->data.l[3];
  kev.xkey.time = (ic->is_version_40() ? ev->data.l[4] : 0);
  kev.xkey.same_screen = 1;

  if (!XFilterEvent((XEvent*)&kev, 0)) {
    // send back to client
    ic->forward_xevent((XEvent*)&kev);
  }

skip:
  if (ic->is_version_40() && ic->is_sync()) {
    ic->set_match(ev->data.l[2], ev->data.l[3]);
    send_client_message(ic->focus_window(),
                     XIMP_KEYPRESS_RETURN4,
                     input_context_id,
                     0, 0, 0);
  }
  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::key_release ( XClientMessageEvent *  ev) [private]

Definition at line 764 of file XIMProtocol.cpp.

                                                {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItem(input_context_id));
  if (!ic) return True;

  if (ic->is_version_40() && ic->is_sync()) {
    ic->process_match(ev->data.l[2], ev->data.l[3]);
    send_client_message(ic->focus_window(),
                     XIMP_KEYRELEASE_RETURN4,
                     input_context_id,
                     0, 0, 0);
    send_client_message(ic->focus_window(),
                     XIMP_KEYRELEASE4,
                     input_context_id,
                     ev->data.l[2], ev->data.l[3], 0);
  }
  return True;
}

Here is the call graph for this function:

Here is the caller graph for this function:

char * XIMProtocol::MakeNewAtom ( char *  atomName,
int  is_commit = 0 
) [private]

Definition at line 1202 of file XIMProtocol.cpp.

                                                      {
  sprintf(atomName,
         (is_commit ?
          "_XIMP_NORMALPROP_%X" :
          "_XIMP_CALLBACKS_%d"),
         (atom_sequence > 40 ? (atom_sequence = 0) : atom_sequence));
  atom_sequence++;
  return atomName;
}

Here is the caller graph for this function:

void XIMProtocol::move ( XClientMessageEvent *  ev) [private]

Definition at line 910 of file XIMProtocol.cpp.

                                         {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItem(input_context_id));
  if (!ic) return;

  ic->set_preedit_spot_location(ev->data.l[2], ev->data.l[3]);

  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMPublic::OpenIM ( ) [inherited]

Definition at line 77 of file XIMPublic.cpp.

                  {
  char *tmpmodifiers = NULL;

  if (!dl_module) {
    dl_module = dlopen(XIIIMP_PATH, RTLD_LAZY);
    if (!dl_module) return; // fatal error
    im_openIM =
      (XIM(*)(XLCd, Display*, XrmDatabase, char*, char*))dlsym(dl_module,
                                                        "_IIIMP_OpenIM");
    if (!im_openIM) return; // fatal error
  }
  /* 
     Untidy hack.  When users set XMODIFIERS environment variable beforehand,
     XLC regard it as the modifier specification.   Therefore, if it specifies
     XIM-based IM, _IIIMP_OpenIM would fail to open IM because it could deal with
     only IIIMP-based IM.
  */

  tmpmodifiers = getenv("XMODIFIERS");
  if (tmpmodifiers) {
    unsetenv("XMODIFIERS");
    XSetLocaleModifiers("");
  }
  XLCd lcd = _XlcCurrentLC();
  if (tmpmodifiers) {
    setenv("XMODIFIERS", tmpmodifiers, 1);
    XSetLocaleModifiers("");
  }

  xim = (*im_openIM)(lcd, display, (XrmDatabase) NULL,
                   (char*)0, (char *)0);

  if (xim) {
    char *ret;

    if (ifname.length())
      ret = XSetIMValues(xim,
                      "engineInterfaceName", (char*)ifname,
                      "applicationType", (char*)application_name,
                      0);
    else
      ret = XSetIMValues(xim,
                      "applicationType", (char*)application_name,
                      0);
    if (default_font_name.length())
      ret = XSetIMValues(xim,
                      "defaultFontName", (char*)default_font_name,
                      0);

    // create a root IC for X-AUX initialization
    root_xic =
      XCreateIC(xim,
              XNInputStyle, XIMPreeditCallbacks|XIMStatusCallbacks,
              0);
    if (root_xic)
      XSetICFocus(root_xic);
  }
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMProtocol::preedit_caret_ret ( XClientMessageEvent *  ev) [private]

Definition at line 1084 of file XIMProtocol.cpp.

                                                      {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItem(input_context_id));
  if (!ic) return;

  ic->set_preedit_caret_position(ev->data.l[2]);

  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMProtocol::preedit_start_ret ( XClientMessageEvent *  ev) [private]

Definition at line 1073 of file XIMProtocol.cpp.

                                                      {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItem(input_context_id));
  if (!ic) return;

  ic->set_preedit_maxlen(ev->data.l[2]);

  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::read_property ( Window  win,
Atom  prop,
Atom  type,
int  format,
unsigned char **  datapp,
unsigned long *  lenp 
)

Definition at line 562 of file XIMProtocol.cpp.

                                                                     {
  Atom realtype;
  int realformat;
  unsigned long bytesafter;

  *datapp = NULL;
  if (XGetWindowProperty(display, win, prop, 0L, 1000000L, True, type,
                      &realtype, &realformat, lenp,
                      &bytesafter, datapp) != Success)
    return False;
  if (realtype == None) {
    return False;
  } else if (realtype != type) {
    return False;
  } else if (realformat != format) {
    if (*datapp != NULL) XFree((char *)*datapp);
    *datapp = NULL;
    return False;
  }
  return True;
}

Here is the caller graph for this function:

virtual bool IMProtocol::receive_and_dispatch ( IMState pims,
int  flags = SYNC 
) [pure virtual, inherited]

Implemented in IIIMProtocol.

Here is the caller graph for this function:

void IMProtocol::remove_imstate ( IMState pims) [protected, inherited]

Definition at line 16 of file IMProtocol.cpp.

{
    immap.erase(pims->get_im_id());
}

Here is the call graph for this function:

Here is the caller graph for this function:

Atom XIMProtocol::replace_prop_pool ( const unsigned char *  data,
int  len 
)

Definition at line 1129 of file XIMProtocol.cpp.

                                                                 {
  char name[20];
  Atom type = atoms.feedbacks;
  Atom atom = XInternAtom(display, MakeNewAtom(name), False);

  XChangeProperty(display, im_window, atom, type, 32,
                PropModeReplace, data, len);
  XFlush(display);
  return (atom);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMProtocol::reset ( XClientMessageEvent *  ev) [private]

Definition at line 964 of file XIMProtocol.cpp.

                                          {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItem(input_context_id));
  if (!ic) return;

#if 0
  XIMProtocol *ximp_protocol = ic->ximp_protocol;
  // IMText *text = ximp_protocol->proto_handler->ResetIC((InputContext*)ic);
#endif

  // 
  // Only XIMP4.0 supports sending reset string by cmsg.
  //
  Atom atom_ret = (Atom)0;
  XIC_RESET_FLAG flag = RESET_NOTHING;

  char *ctext = ic->reset_xic(); // ctext needs to be free
  Bool need_ctext_free = True;

  ic->conversion_end();            // must be called after reset_xic()

  if (ctext == 0 || *ctext == 0) {
    ctext = ic->get_commit_string();
    need_ctext_free = False;
  } else {
    (void)ic->get_commit_string(); // to clear xic's being_reset flag to 0
  }
  if (ic->is_version_40()) {
    if (ctext == 0 || *ctext == 0) {
      atom_ret = 0;
    } else {
      size_t length = strlen(ctext);
      if (length <= 250) {
       commit_by_client_message(ic->focus_window(),
                             input_context_id,
                             ctext,
                             length);
       flag = RESET_BY_CMSG;
      } else {
       atom_ret = replace_prop_pool((unsigned char*)ctext, length);
       flag = RESET_BY_PROP;
      }
    }
  } else {
    atom_ret = 0;
  }
  if (need_ctext_free && ctext) XFree(ctext);

  send_client_message(ic->focus_window(),
                    (ic->is_version_40() ?
                     XIMP_RESET_RETURN4 :
                     XIMP_RESET_RETURN3),
                    input_context_id,
                    (CARD32)flag, (CARD32)atom_ret, 0);

  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int XIMProtocol::run ( ) [virtual]

Implements IMProtocol.

Definition at line 283 of file XIMProtocol.cpp.

                 {
  CompoundString locale_list = input_locale;
  char *locale_p;
  Bool found;
  char *p, *pp, im_shortname[64], im_longname[64];
  Atom selection;

  if (display == 0) {
    // nothing to do
    fprintf(stderr, "   Error - No XDisplay connection\n");
    fprintf(stderr, "       XIMP40 cannot be used\n");
    return -1;
  }

  (void)XSetErrorHandler(XFactory::xerror_handler);
#ifdef DEBUG
  (void)XSynchronize(display, True);
#endif
  if (display) {
    screen = DefaultScreen(display);
    im_window = XCreateSimpleWindow(display,
                                DefaultRootWindow(display),
                                0, 0, 1, 1, 1, 0, 0);
  }

  (void)setProps();

  found = False;
  locale_p = locale_list;
  for (p = NextLocaleName((char **)&locale_p); p != NULL;
       p = NextLocaleName((char **)&locale_p)) {
    /* short selection name */
    if (pp = strchr(p, '.')) *pp = (char)0;
    sprintf(im_shortname, "_XIMP_%s", p);
    if (setSelectionOwner(im_window, im_shortname, &selection) == True) {
      found = True;
    }
    /* long selection name */
    const char *xim_name = im_name;
    sprintf(im_longname, "%s@%s.%d", im_shortname, xim_name, screen);
    if (setSelectionOwner(im_window, im_longname, &selection) == True) {
      found = True;
    }
    // fix for 4134207&4260189
    for (int i = 0; i < ScreenCount(display); i++) {
      if (screen != i) {
       /* long selection name */
       sprintf(im_longname, "%s@%s.%d", im_shortname, xim_name, i);
       if (setSelectionOwner(im_window, im_longname, &selection) == True) {
         found = True;
       }
      }
    }
  }
  if (!found) return -1;

  /* Property Name */
  const char *XIMP_PROTOCOL = "_XIMP_PROTOCOL";

  ximp_request = XInternAtom(display, XIMP_PROTOCOL, False);

  OpenIM();

  if (thread == NULL) {
    // start creating a thread
    thread = new IMThread(xevent_loop, this);
  }
  
  return 0;
}

Here is the call graph for this function:

void XIMPublic::select_destroy_emask ( Window  win) [inherited]

Definition at line 240 of file XIMPublic.cpp.

                                          {
  XWindowAttributes win_attr;
  XGetWindowAttributes(display, win, &win_attr);
  XSelectInput(display, win,
              (win_attr.your_event_mask | StructureNotifyMask));
  return;
}

Here is the caller graph for this function:

void XIMPublic::select_keypress_emask ( Window  win) [inherited]

Definition at line 248 of file XIMPublic.cpp.

                                           {
  XWindowAttributes win_attr;
  XGetWindowAttributes(display, win, &win_attr);
  XSelectInput(display, win, (win_attr.your_event_mask | KeyPressMask));
  return;
}

Here is the caller graph for this function:

void XIMPublic::select_keyrelease_emask ( Window  win) [inherited]

Definition at line 255 of file XIMPublic.cpp.

                                             {
  XWindowAttributes win_attr;
  XGetWindowAttributes(display, win, &win_attr);
  XSelectInput(display, win, (win_attr.your_event_mask | KeyReleaseMask));
  return;
}

Here is the caller graph for this function:

void XIMProtocol::send_client_message ( Window  focus_window,
int  type,
unsigned long  l1,
unsigned long  l2,
unsigned long  l3,
unsigned long  l4 
)

Definition at line 1178 of file XIMProtocol.cpp.

                                                                 {
  XEvent event;

  memset(&event, 0, sizeof(event));
  event.xclient.type = ClientMessage;
  event.xclient.display = display;
  event.xclient.window = focus_window;
  event.xclient.message_type = ximp_request;
  event.xclient.format = 32;
  event.xclient.data.l[0] = type;
  event.xclient.data.l[1] = l1;
  event.xclient.data.l[2] = l2;
  event.xclient.data.l[3] = l3;
  event.xclient.data.l[4] = l4;

  XSendEvent(display, event.xclient.window,
            False, NoEventMask, &event);
  XFlush(display);

}

Here is the caller graph for this function:

void XIMProtocol::set_clientwin ( XClientMessageEvent *  ev) [private]

Definition at line 878 of file XIMProtocol.cpp.

                                                  {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItem(input_context_id));
  if (!ic) return;

  ic->set_client_window(ev->data.l[2]);
  ic->set_fwin_select_mask(ev->data.l[3]);

  send_client_message(ic->focus_window(),
                    XIMP_CLIENT_WINDOW_RETURN4,
                    input_context_id,
                    0, 0, 0);
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Atom XIMProtocol::set_ctext_property ( const unsigned char *  data,
int  len,
int  is_commit 
)

Definition at line 1152 of file XIMProtocol.cpp.

                                           {
  char name[20];
  Atom atom = XInternAtom(display, MakeNewAtom(name, is_commit), False);
  XChangeProperty(display, im_window, atom, atoms.ctext_type,
                8, PropModeReplace,
                data, len);
  return atom;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Atom XIMProtocol::set_ctext_property ( const unsigned char *  data,
int  len 
)

Definition at line 1163 of file XIMProtocol.cpp.

                                                                  {
  return set_ctext_property(data, len, 0);
}

Here is the call graph for this function:

Atom XIMProtocol::set_feedback_property ( const unsigned char *  data,
int  len 
)

Definition at line 1168 of file XIMProtocol.cpp.

                                                                     {
  char name[20];
  Atom atom = XInternAtom(display, MakeNewAtom(name), False);
  XChangeProperty(display, im_window, atom, atoms.feedbacks,
                32, PropModeReplace,
                data, len);
  return atom;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMProtocol::set_focus ( XClientMessageEvent *  ev) [private]

Definition at line 856 of file XIMProtocol.cpp.

                                              {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItemMakeTop(input_context_id));
  if (!ic) return;

  ic->set_xicfocus();

  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::set_focus_window ( Window  win,
Window  focus_win 
)

Definition at line 500 of file XIMProtocol.cpp.

                                                          {
  return write_property(win, atoms.focus,
                     XA_WINDOW, 32,
                     (unsigned char*)&focus_win, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMProtocol::set_focuswin ( XClientMessageEvent *  ev) [private]

Definition at line 894 of file XIMProtocol.cpp.

                                                 {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItemMakeTop(input_context_id));
  if (!ic) return;

  ic->set_focus_window(ev->data.l[2]);
  ic->set_fwin_select_mask(ev->data.l[3]);

  send_client_message(ic->focus_window(),
                    XIMP_FOCUS_WINDOW_RETURN4,
                    input_context_id,
                    0, 0, 0);
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMProtocol::set_icvalues ( XClientMessageEvent *  ev) [private]

Definition at line 921 of file XIMProtocol.cpp.

                                                 {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItem(input_context_id));

  if (!ic) return;

#if 0
  XIMProtocol *ximp_protocol = ic->ximp_protocol;
  IMArg args[1];
  int n = 0;
  // ximp_protocol->proto_handler->SetICValues((InputContext*)ic, args, n);
#endif

  ic->set_values(ev);

  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::set_preedit3 ( Window  win,
Ximp_PreeditPropRec3  preedit_attr 
)

Definition at line 539 of file XIMProtocol.cpp.

                                                                       {
  return write_property(win, atoms.preedit,
                     atoms.preedit, 32,
                     (unsigned char *)&preedit_attr,
                     XIMP_PREEDIT_MAX_LONG3);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::set_preedit4 ( Window  win,
Ximp_PreeditPropRec4  preedit_attr 
)

Definition at line 523 of file XIMProtocol.cpp.

                                                                       {
  return write_property(win, atoms.preedit,
                     atoms.preedit, 32,
                     (unsigned char *)&preedit_attr,
                     XIMP_PREEDIT_MAX_LONG4);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Atom XIMProtocol::set_preedit_draw_data_property ( const unsigned char *  data,
int  len 
)

Definition at line 1141 of file XIMProtocol.cpp.

                                                {
  char name[20];
  Atom atom = XInternAtom(display, MakeNewAtom(name), False);
  XChangeProperty(display, im_window, atom, atoms.preedit_draw_data,
                32, PropModeReplace,
                data, len);
  return atom;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::set_preedit_font ( Window  win,
char *  pre_font 
)

Definition at line 507 of file XIMProtocol.cpp.

                                                        {
  return write_property(win, atoms.preedit_font,
                     XA_STRING, 8,
                     (unsigned char *)pre_font,
                     (CARD32)strlen(pre_font));
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::set_server_type4 ( Window  win,
unsigned long  type 
)

Definition at line 555 of file XIMProtocol.cpp.

                                                            {
  return write_property(win, atoms.supported_types,
                     atoms.supported_types, 32,
                     (unsigned char *)&type, 1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::set_status3 ( Window  win,
Ximp_StatusPropRec3  status_attr 
)

Definition at line 547 of file XIMProtocol.cpp.

                                                                    {
  return write_property(win, atoms.status,
                     atoms.status, 32,
                     (unsigned char *)&status_attr,
                     XIMP_STATUS_MAX_LONG3);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::set_status4 ( Window  win,
Ximp_StatusPropRec4  status_attr 
)

Definition at line 531 of file XIMProtocol.cpp.

                                                                    {
  return write_property(win, atoms.status,
                     atoms.status, 32,
                     (unsigned char *)&status_attr,
                     XIMP_STATUS_MAX_LONG4);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::set_status_font ( Window  win,
char *  sts_font 
)

Definition at line 515 of file XIMProtocol.cpp.

                                                       {
  return write_property(win, atoms.status_font,
                     XA_STRING, 8,
                     (unsigned char *)sts_font,
                     (CARD32)strlen(sts_font));
}

Here is the call graph for this function:

Here is the caller graph for this function:

int XIMPublic::set_values ( IMArg args,
int  n 
) [virtual, inherited]

Reimplemented from IMProtocol.

Definition at line 191 of file XIMPublic.cpp.

                                        {
  if (n == 0) return 0;
  for (IMArg *argp = args; argp < &args[n]; argp++) {
    switch (argp->id) {
    case DisplayConnection:
      display = (Display*)argp->value; // extension 
      break;
    case IFName:
      ifname = (char*)argp->value; // extension 
      break;
    case AppName:
      application_name = (char*)argp->value; // extension 
      break;
    case DisableStatusArea:
      disable_status_area = (Bool)(long)argp->value; // extension
      break;
    case DefaultFontName:
      default_font_name = (char*)argp->value; // extension
      break;
    default:
      (void)IMProtocol::set_values(argp, 1);
      break;
    }
  }
  return 0;
}

Here is the call graph for this function:

void XIMProtocol::setProps ( ) [private]

Definition at line 125 of file XIMProtocol.cpp.

                      {
  Atom extensions[10];
  int ext_number;
  int i;

  /* IMS Window Property Name */
  const char *COMPOUND_TEXT = "COMPOUND_TEXT";
  const char *XIMP_VERSION = "_XIMP_VERSION";
  const char *XIMP_STYLE = "_XIMP_STYLE";
  const char *XIMP_TYPE = "_XIMP_TYPE";
  const char *XIMP_SERVERNAME = "_XIMP_SERVERNAME";
  const char *XIMP_SERVERVERSION = "_XIMP_SERVERVERSION";
  const char *XIMP_VENDORNAME = "_XIMP_VENDORNAME";
  const char *XIMP_KEYS = "_XIMP_KEYS";
  const char *XIMP_SPROC_STARTED_KEYS = "_XIMP_SPROC_STARTED_KEYS";
  const char *XIMP_SPROC_STOPPED_KEYS = "_XIMP_SPROC_STOPPED_KEYS";
  const char *XIMP_EXTENSIONS = "_XIMP_EXTENSIONS";
  const char *XIMP_PREEDITFONT = "_XIMP_PREEDITFONT";
  const char *XIMP_STATUSFONT = "_XIMP_STATUSFONT";

  /* Client Window Property Name */
  const char *XIMP_FOCUS = "_XIMP_FOCUS";
  const char *XIMP_PREEDIT = "_XIMP_PREEDIT";
  const char *XIMP_STATUS = "_XIMP_STATUS";

  const char *XIMP_EXT_XIMP_STATUSWINDOW = "_XIMP_EXT_XIMP_STATUSWINDOW";
  const char *XIMP_EXT_XIMP_BACK_FRONT = "_XIMP_EXT_XIMP_BACK_FRONT";
  const char *XIMP_EXT_XIMP_CONVERSION = "_XIMP_EXT_XIMP_CONVERSION";

  const char *XIMP_PREEDIT_DRAW_DATA = "_XIMP_PREEDIT_DRAW_DATA";
  const char *XIMP_FEEDBACKS = "_XIMP_FEEDBACKS";

#define INTERN(s) XInternAtom(display, s, False)
  atoms.ctext_type = INTERN(COMPOUND_TEXT);
  atoms.version = INTERN(XIMP_VERSION);
  atoms.supported_styles = INTERN(XIMP_STYLE);
  atoms.supported_types = INTERN(XIMP_TYPE);
  atoms.server_name = INTERN(XIMP_SERVERNAME);
  atoms.server_version = INTERN(XIMP_SERVERVERSION);
  atoms.vendor_name = INTERN(XIMP_VENDORNAME);
  atoms.keys = INTERN(XIMP_KEYS);
  atoms.sproc_started_keys = INTERN(XIMP_SPROC_STARTED_KEYS);
  atoms.sproc_stopped_keys = INTERN(XIMP_SPROC_STOPPED_KEYS);
  atoms.extensions = INTERN(XIMP_EXTENSIONS);

  atoms.focus = INTERN(XIMP_FOCUS);
  atoms.preedit = INTERN(XIMP_PREEDIT);
  atoms.status = INTERN(XIMP_STATUS);
  atoms.preedit_font = INTERN(XIMP_PREEDITFONT);
  atoms.status_font = INTERN(XIMP_STATUSFONT);

  atoms.ext_statuswin = INTERN(XIMP_EXT_XIMP_STATUSWINDOW);
  atoms.ext_backfront = INTERN(XIMP_EXT_XIMP_BACK_FRONT);
  atoms.ext_conversion = INTERN(XIMP_EXT_XIMP_CONVERSION);

  atoms.preedit_draw_data = INTERN(XIMP_PREEDIT_DRAW_DATA);
  atoms.feedbacks = INTERN(XIMP_FEEDBACKS);
#undef INTERN
  /* count supported extensions */
  ext_number = 0;

  ext_flag = 0;
  ext_flag |= EXT_CONV;            // default
  if (ext_flag & EXT_STATUS)
    extensions[ext_number++] = atoms.ext_statuswin;
  if (ext_flag & EXT_BACKFRONT)
    extensions[ext_number++] = atoms.ext_backfront;
  if (ext_flag & EXT_CONV)
    extensions[ext_number++] = atoms.ext_conversion;

  IMTriggerKey keyp;
  XIMTriggerKey *ximp_keyp;

  /* start keys */
  start_keys.count_keys = on_keys.count();
  start_keys.keylist = new XIMTriggerKey[start_keys.count_keys];
  ximp_keyp = start_keys.keylist;

  for (i = 0; i < start_keys.count_keys; i++, ximp_keyp++) {
    keyp = on_keys.getKey(i+1);
    ximp_keyp->modifier = keyp.get_modifier();
    ximp_keyp->modifier_mask = keyp.get_modifier_mask();
    ximp_keyp->keysym = keyp.get_keyCode();
  }

  /* stop keys */
  stop_keys.count_keys = off_keys.count();
  stop_keys.keylist = new XIMTriggerKey[stop_keys.count_keys];
  ximp_keyp = stop_keys.keylist;

  for (i = 0; i < stop_keys.count_keys; i++, ximp_keyp++) {
    keyp = off_keys.getKey(i+1);
    ximp_keyp->modifier = keyp.get_modifier();
    ximp_keyp->modifier_mask = keyp.get_modifier_mask();
    ximp_keyp->keysym = keyp.get_keyCode();
  }

  const char *xim_name = im_name; // evil, need to be fixed in CompoundString
  const char *xvendor_name = vendor_name;
  const char *xim_version = im_version;

  if (disable_status_area == True){
    styles.count_styles = sizeof(ximp_styles2)/sizeof(ximp_styles2[0]);
    styles.supported_styles = &ximp_styles2[0];
  }
    
#define SETPROPERTY(p, t, f, d, n) XChangeProperty(display, im_window, p, \
                                             t, f, PropModeReplace, \
                                             (unsigned char *)d, n)
  SETPROPERTY(atoms.version, XA_STRING, 8,
             ximp_version, strlen(ximp_version));
  SETPROPERTY(atoms.supported_styles, atoms.supported_styles, 32,
             styles.supported_styles, styles.count_styles);
  SETPROPERTY(atoms.supported_types, atoms.supported_types, 32,
             ximp_type.types, ximp_type.num_of_types);
  SETPROPERTY(atoms.server_name, XA_STRING, 8, xim_name, strlen(xim_name));
  SETPROPERTY(atoms.server_version, XA_STRING, 8,
             xim_version, strlen(xim_version));
  SETPROPERTY(atoms.vendor_name, XA_STRING, 8,
             xvendor_name, strlen(xvendor_name));
  SETPROPERTY(atoms.keys, atoms.keys, 32,
             start_keys.keylist, start_keys.count_keys * 3);
  SETPROPERTY(atoms.sproc_started_keys, atoms.sproc_started_keys, 32,
             start_keys.keylist, start_keys.count_keys * 3);
  SETPROPERTY(atoms.sproc_stopped_keys, atoms.sproc_stopped_keys, 32,
             stop_keys.keylist, stop_keys.count_keys * 3);
  SETPROPERTY(atoms.extensions, atoms.extensions, 32,
             extensions, ext_number);
#undef SETPROPERTY
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int XIMPublic::setSelectionOwner ( Window  im_window,
char *  name,
Atom *  selection 
) [protected, inherited]

Definition at line 174 of file XIMPublic.cpp.

                                                       {
  Window owner;
  *selection = XInternAtom(display, name, False);

  if ((owner = XGetSelectionOwner(display, *selection)) != im_window) {
    if (owner == None) {
      XSetSelectionOwner(display, *selection, im_window, CurrentTime);
      return True;
    } else {
      return False;
    }
  }
  return True;
}

Here is the caller graph for this function:

void XIMProtocol::start ( XClientMessageEvent *  ev) [private]

Definition at line 832 of file XIMProtocol.cpp.

                                          {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItem(input_context_id));
  if (!ic) return;

  if (ic->is_conv_state()) return;

  ic->conversion_start();
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void XIMPublic::unselect_destroy_emask ( Window  win) [inherited]

Definition at line 262 of file XIMPublic.cpp.

                                            {
  XWindowAttributes win_attr;
  XGetWindowAttributes(display, win, &win_attr);
  XSelectInput(display, win,
              (win_attr.your_event_mask & ~StructureNotifyMask));
  return;
}

Here is the caller graph for this function:

void XIMPublic::unselect_keypress_emask ( Window  win) [inherited]

Definition at line 270 of file XIMPublic.cpp.

                                             {
  XWindowAttributes win_attr;
  XGetWindowAttributes(display, win, &win_attr);
  XSelectInput(display, win,
              (win_attr.your_event_mask & ~KeyPressMask));
  return;
}

Here is the caller graph for this function:

void XIMPublic::unselect_keyrelease_emask ( Window  win) [inherited]

Definition at line 278 of file XIMPublic.cpp.

                                               {
  XWindowAttributes win_attr;
  XGetWindowAttributes(display, win, &win_attr);
  XSelectInput(display, win,
              (win_attr.your_event_mask & ~KeyReleaseMask));
  return;
}

Here is the caller graph for this function:

void XIMProtocol::unset_focus ( XClientMessageEvent *  ev) [private]

Definition at line 867 of file XIMProtocol.cpp.

                                                {
  int input_context_id = ev->data.l[1];
  XIMPInputContext *ic = (XIMPInputContext*)&(input_context_list.getItem(input_context_id));

  if (!ic) return;
  ic->unset_xicfocus();

  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Bool XIMProtocol::write_property ( Window  win,
Atom  prop,
Atom  type,
int  format,
const unsigned char *  datap,
const unsigned long  len 
)

Definition at line 587 of file XIMProtocol.cpp.

                                                  {
  (void)XChangeProperty(display, win, prop, type, format,
                     PropModeReplace, datap, len);
  /* always return True */
  return True;
}

Here is the caller graph for this function:

void * XIMProtocol::xevent_loop ( void *  client_data) [static, private]

Definition at line 598 of file XIMProtocol.cpp.

                                          {
  XIMProtocol *ximp_protocol = (XIMProtocol*)client_data;

  for (;;) {
    XEvent event;
    XNextEvent(ximp_protocol->display, &event);
    if (DestroyNotify == event.type) {
      ximp_protocol->destroy_window(ximp_protocol,
                                event.xdestroywindow.window);
    }
    if (XFilterEvent(&event, 0) == True)
      continue;
    switch (event.type) {
    case KeyPress:
    case KeyRelease:
         {
           XIMPInputContext *ic =(XIMPInputContext *) ximp_protocol->getInputContextByFocusWindow(event.xkey.window);
           if (ic)
              ic->forward_xevent((XEvent*)&event);
         }
         break;
    case ClientMessage:
      if (event.xclient.message_type == ximp_protocol->ximp_request &&
         event.xclient.window == ximp_protocol->im_window &&
         event.xclient.format == 32) {
       switch ((int)event.xclient.data.l[0]) {
       case XIMP_KEYPRESS4:
       case XIMP_KEYPRESS3:
         ximp_protocol->key_press((XClientMessageEvent*)&event);
         break;
       case XIMP_KEYRELEASE4:
         ximp_protocol->key_release((XClientMessageEvent*)&event);
         break;
       case XIMP_CREATE4:
       case XIMP_CREATE3:
         ximp_protocol->create_ic((XClientMessageEvent*)&event);
         break;
       case XIMP_DESTROY4:
       case XIMP_DESTROY3:
         ximp_protocol->destroy_ic((XClientMessageEvent*)&event);
         break;
       case XIMP_REG_KEY_PRESSED4:
       case XIMP_BEGIN3:
         ximp_protocol->start((XClientMessageEvent*)&event);
         break;
       case XIMP_END3:
         ximp_protocol->end((XClientMessageEvent*)&event);
         break;
       case XIMP_SETFOCUS4:
       case XIMP_SETFOCUS3:
         ximp_protocol->set_focus((XClientMessageEvent*)&event);
         break;
       case XIMP_UNSETFOCUS4:
       case XIMP_UNSETFOCUS3:
         ximp_protocol->unset_focus((XClientMessageEvent*)&event);
         break;
       case XIMP_CLIENT_WINDOW4:
         ximp_protocol->set_clientwin((XClientMessageEvent*)&event);
         break;
       case XIMP_FOCUS_WINDOW4:
         ximp_protocol->set_focuswin((XClientMessageEvent*)&event);
         break;
       case XIMP_MOVE4:
       case XIMP_MOVE3:
         ximp_protocol->move((XClientMessageEvent*)&event);
         break;
       case XIMP_SETVALUE4:
       case XIMP_SETVALUE3:
         ximp_protocol->set_icvalues((XClientMessageEvent*)&event);
         break;
       case XIMP_GETVALUE4:
       case XIMP_GETVALUE3:
         ximp_protocol->get_icvalues((XClientMessageEvent*)&event);
         break;
       case XIMP_RESET4:
       case XIMP_RESET3:
         ximp_protocol->reset((XClientMessageEvent*)&event);
         break;
       case XIMP_EVENTMASK_NOTIFY4:
         ximp_protocol->event_mask((XClientMessageEvent*)&event);
         break;
       case XIMP_EXTENSION4:
       case XIMP_EXTENSION3:
         ximp_protocol->extension((XClientMessageEvent*)&event);
         break;
       case XIMP_PREEDITSTART_RETURN4:
       case XIMP_PREEDITSTART_RETURN3:
         ximp_protocol->preedit_start_ret((XClientMessageEvent*)&event);
         break;
       case XIMP_PREEDITCARET_RETURN4:
       case XIMP_PREEDITCARET_RETURN3:
         ximp_protocol->preedit_caret_ret((XClientMessageEvent*)&event);
         break;
       default:
         break;      /* unknown ximp protocol */
       }
      }
    default:
      break;
    }
  }
  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class IMState [friend, inherited]

Definition at line 60 of file IMProtocol.hh.


Member Data Documentation

Definition at line 287 of file XIMProtocol.hh.

Definition at line 266 of file XIMProtocol.hh.

Bool XIMPublic::disable_status_area [protected, inherited]

Definition at line 93 of file XIMPublic.hh.

Display* XIMPublic::display [protected, inherited]

Definition at line 80 of file XIMPublic.hh.

Definition at line 269 of file XIMProtocol.hh.

unsigned int XIMProtocol::ext_flag [private]

Definition at line 268 of file XIMProtocol.hh.

CompoundString IMProtocol::im_address [protected, inherited]

Definition at line 111 of file IMProtocol.hh.

CompoundString IMProtocol::im_name [protected, inherited]

Definition at line 110 of file IMProtocol.hh.

const char* XIMProtocol::im_version [private]

Definition at line 262 of file XIMProtocol.hh.

Window XIMProtocol::im_window [private]

Definition at line 258 of file XIMProtocol.hh.

Definition at line 120 of file IMProtocol.hh.

IMStateMap IMProtocol::immap [protected, inherited]

Definition at line 18 of file IMProtocol.hh.

Definition at line 78 of file XIMPublic.hh.

CompoundString IMProtocol::input_locale [protected, inherited]

Definition at line 112 of file IMProtocol.hh.

IMLanguageList IMProtocol::lang_list [protected, inherited]

Definition at line 114 of file IMProtocol.hh.

Definition at line 118 of file IMProtocol.hh.

IMTriggerKeyList IMProtocol::off_keys [protected, inherited]

Definition at line 116 of file IMProtocol.hh.

IMTriggerKeyList IMProtocol::on_keys [protected, inherited]

Definition at line 115 of file IMProtocol.hh.

IMAccept* IMProtocol::pimaccept [protected, inherited]

Definition at line 15 of file IMProtocol.hh.

Definition at line 103 of file IMProtocol.hh.

CompoundString IMProtocol::protocol_name [protected, inherited]

Definition at line 109 of file IMProtocol.hh.

int XIMProtocol::screen [private]

Definition at line 256 of file XIMProtocol.hh.

XIMTriggerKeys XIMPublic::start_keys [protected, inherited]

Definition at line 82 of file XIMPublic.hh.

XIMTriggerKeys XIMPublic::stop_keys [protected, inherited]

Definition at line 83 of file XIMPublic.hh.

XIMStyles XIMProtocol::styles [private]

Definition at line 259 of file XIMProtocol.hh.

Definition at line 263 of file XIMProtocol.hh.

CompoundString IMProtocol::vendor_name [protected, inherited]

Definition at line 113 of file IMProtocol.hh.

Atom XIMProtocol::ximp_request [private]

Definition at line 257 of file XIMProtocol.hh.

Definition at line 261 of file XIMProtocol.hh.

const char* XIMProtocol::ximp_version [private]

Definition at line 260 of file XIMProtocol.hh.


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