Back to index

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

#include <IMProtocol.hh>

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

List of all members.

Public Types

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

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
 IMProtocol (IMAccept *pima)
virtual ~IMProtocol ()
virtual int set_values (IMArg *, int)
int get_values (IMArg *, int)
virtual int run ()=0
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  MODE { OPEN, SET, GET }
typedef map< CARD16BIT, IMState * > IMStateMap

Protected Member Functions

void add_imstate (IMState *pims)
void remove_imstate (IMState *pims)
IMStateget_imstate (CARD16BIT im_id)
ICStateget_icstate (CARD16BIT im_id, CARD16BIT ic_id)
 IMProtocol (IMArg *, int)
virtual ~IMProtocol ()

Protected Attributes

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 Member Functions

int parseArgs (int mode, IMArg *args, int n)

Friends

class IMState

Detailed Description

Definition at line 12 of file IMProtocol.hh.


Member Typedef Documentation

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

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
    };
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]
Enumerator:
OPEN 
SET 
GET 

Definition at line 122 of file IMProtocol.hh.

            {
    OPEN, SET, GET
  };

Constructor & Destructor Documentation

Definition at line 46 of file IMProtocol.cpp.

{
    pimaccept = pima;
}
IMProtocol::~IMProtocol ( ) [virtual]

Definition at line 53 of file IMProtocol.cpp.

Here is the call graph for this function:

IMProtocol::IMProtocol ( IMArg args,
int  n 
) [protected]

Definition at line 183 of file IMProtocol.cpp.

Here is the call graph for this function:

virtual IMProtocol::~IMProtocol ( ) [protected, virtual]

Member Function Documentation

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

Implemented in IIIMProtocol.

Here is the caller graph for this function:

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

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:

int IMProtocol::countIME ( ) const

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:

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:

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

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

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:

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

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:

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

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:

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

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:

int IMProtocol::get_values ( IMArg args,
int  n 
)

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:

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:

IMEditorStruct & IMProtocol::getIME ( unsigned int  index) const

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:

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:

CompoundString & IMProtocol::getLang ( unsigned int  index) const

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:

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

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

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:

Definition at line 117 of file IMProtocol.cpp.

                                   {
  return input_locale;
}

Here is the caller graph for this function:

int IMProtocol::parseArgs ( int  mode,
IMArg args,
int  n 
) [private]

Definition at line 122 of file IMProtocol.cpp.

                                                  {
  if (n == 0) return 0;
  if (mode == IMProtocol::OPEN || mode == IMProtocol::SET) {
    for (IMArg *argp = args; argp < &args[n]; argp++) {
      switch (argp->id) {
      case ServerName:
       im_name = argp->value;
       break;
      case TransportAddress:
       im_address = argp->value;
       break;
      case VendorName:
       vendor_name = argp->value;
       break;
      case PrimaryInputLocale:
       input_locale = argp->value;
       break;
      case LanguageList:
       lang_list = *(IMLanguageList*)argp->value;
       break;
      case ConversionOnKeys:
       on_keys = *(IMTriggerKeyList*)argp->value;
       break;
      case ConversionOffKeys:
       off_keys = *(IMTriggerKeyList*)argp->value;
       break;
      case ProtocolHandler:
       proto_handler = (IMProtoHandler*)argp->value;
       break;
      case ObjectDescriptors:
       od_list = *(IMObjectDescriptorList*)argp->value;
       break;
      case IMEDescriptors:
       ime_list = *(IMEditorDescriptorList*)argp->value;
       break;
      default:
       break;
      }
    }
  } else if (mode == IMProtocol::GET) {
    for (IMArg *argp = args; argp < &args[n]; argp++) {
      switch (argp->id) {
      case ServerName:
       {
         char **pp = (char**)argp->value;
         *pp = im_name;
         break;
       }
      case TransportAddress:
       {
         char **pp = (char**)argp->value;
         *pp = im_address;
         break;
       }
      }
    }
    return 0;
  }
  return 0;
}

Here is the caller graph for this function:

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

Implemented in IIIMProtocol.

Here is the caller graph for this function:

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

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:

virtual int IMProtocol::run ( ) [pure virtual]

Implemented in XIMProtocol, IIIMProtocol, and R6IMProtocol.

Here is the caller graph for this function:

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

Reimplemented in IIIMProtocol, and XIMPublic.

Definition at line 191 of file IMProtocol.cpp.

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

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]

Definition at line 60 of file IMProtocol.hh.


Member Data Documentation

Definition at line 111 of file IMProtocol.hh.

Definition at line 110 of file IMProtocol.hh.

Definition at line 120 of file IMProtocol.hh.

Definition at line 18 of file IMProtocol.hh.

Definition at line 112 of file IMProtocol.hh.

Definition at line 114 of file IMProtocol.hh.

Definition at line 118 of file IMProtocol.hh.

Definition at line 116 of file IMProtocol.hh.

Definition at line 115 of file IMProtocol.hh.

Definition at line 15 of file IMProtocol.hh.

Definition at line 103 of file IMProtocol.hh.

Definition at line 109 of file IMProtocol.hh.

Definition at line 113 of file IMProtocol.hh.


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