Back to index

im-sdk  12.3.91
Public Member Functions | Private Member Functions | Private Attributes
IMTriggerKeyList Class Reference

#include <IMTriggerKeyList.hh>

Collaboration diagram for IMTriggerKeyList:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 IMTriggerKeyList ()
 IMTriggerKeyList (const char *)
 ~IMTriggerKeyList ()
IMTriggerKeyListoperator= (const IMTriggerKeyList &)
int count () const
IMTriggerKeygetKey (unsigned int index) const
native void add (const char *)

Private Member Functions

 IMTriggerKeyList (unsigned int keysym, unsigned int modifier, unsigned int modifier_mask)
void add (unsigned int keysym, unsigned int modifier, unsigned int modifier_mask)

Private Attributes

IMList< IMTriggerKeykeylist

Detailed Description

Definition at line 71 of file IMTriggerKeyList.hh.


Constructor & Destructor Documentation

Definition at line 73 of file IMTriggerKeyList.hh.

{}
IMTriggerKeyList::IMTriggerKeyList ( const char *  keystring)

Definition at line 53 of file IMTriggerKeyList.cpp.

                                                        {
  add(keystring);
}

Here is the call graph for this function:

Definition at line 44 of file IMTriggerKeyList.cpp.

                                    {
  int n = count();
  for (int i = 1; i <= n; i++) {
    IMTriggerKey *keyp =&(getKey(i));
    delete keyp;
  }
  keylist.destroy();
}

Here is the call graph for this function:

IMTriggerKeyList::IMTriggerKeyList ( unsigned int  keysym,
unsigned int  modifier,
unsigned int  modifier_mask 
) [private]

Definition at line 57 of file IMTriggerKeyList.cpp.

                                                           {
  add(keysym, modifier, modifier_mask);
}

Here is the call graph for this function:


Member Function Documentation

void IMTriggerKeyList::add ( const char *  str)

Definition at line 60 of file IMTriggerKeyListP.cpp.

                                     {
  if (!str) return;

  CompoundString buf;
  Bool is_modmask;
  unsigned int mod, mod_mask, tmp_mask;
  unsigned int keysym, modifier, modifier_mask;

  CompoundString names(str);

  buf = names;
  is_modmask = False;
  mod = mod_mask = 0;

  char *bufp = buf;
  CompoundString temp;
  int pos, pos2;

  // skip leading whitespaces
  while (*bufp == ' ' || *bufp == '\t') bufp++;

  while (*bufp) {
    switch(*bufp) {
    case '~':
      if (is_modmask)
       goto done;
      is_modmask = True;
      bufp += 1;
      while (*bufp == ' ' || *bufp == '\t') bufp++;
      break;
    case '<':
      bufp++;
      while (*bufp == ' ' || *bufp == '\t') bufp++;
      temp = bufp;
      pos = temp.search(">");
      if (pos == -1 || pos == 0) goto done;
      pos2 = temp.search(" ");
      if (pos2 != -1 && pos2 < pos)
       *(bufp + pos2) = 0;
      else
       *(bufp + pos) = 0;
      if ((tmp_mask = to_modifier(bufp)) == 0)
       goto done;
      if (is_modmask) {
       mod_mask |= tmp_mask;
       is_modmask = False;
      } else {
       mod |= tmp_mask;
      }
      bufp += 1 + pos;
      while (*bufp == ' ' || *bufp == '\t') bufp++;
      if (!*bufp)
       goto done;
      break;
    default:
      if (is_modmask) goto done;
      while (*bufp == ' ' || *bufp == '\t') bufp++;
      temp = bufp;
      pos = temp.search(" ");
      if (pos != -1) *(bufp + pos) = 0;
      keysym = XStringToKeysym(bufp);
      modifier = mod;
      modifier_mask = mod_mask;
      /* FIX ME */
      modifier_mask = modifier;

      add(keysym, modifier, modifier_mask);
      mod = 0;
      if (pos != -1) {
       bufp += 1 + pos;
       break;
      } else {
       goto done;
      }
    }
  }
 done:
  return;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void IMTriggerKeyList::add ( unsigned int  keysym,
unsigned int  modifier,
unsigned int  modifier_mask 
) [private]

Definition at line 83 of file IMTriggerKeyList.cpp.

                                                {
  IMTriggerKey *key = new IMTriggerKey(keysym, modifier,
                                   modifier_mask);
  keylist.addItem(key);
}

Here is the call graph for this function:

int IMTriggerKeyList::count ( ) const

Definition at line 64 of file IMTriggerKeyList.cpp.

                              {
  return keylist.getSize();
}

Here is the call graph for this function:

Here is the caller graph for this function:

IMTriggerKey & IMTriggerKeyList::getKey ( unsigned int  index) const

Definition at line 91 of file IMTriggerKeyList.cpp.

                                                 {
  return keylist.getItem(index);
}

Here is the call graph for this function:

Here is the caller graph for this function:

IMTriggerKeyList & IMTriggerKeyList::operator= ( const IMTriggerKeyList a)

Definition at line 69 of file IMTriggerKeyList.cpp.

                                                     {
  keylist.destroy();
  int n = a.count();
  for (int i = 1; i <= n; i++) {
    IMTriggerKey keyp = a.getKey(i);
    IMTriggerKey *key = new IMTriggerKey(keyp.get_keyCode(),
                                    keyp.get_modifier(),
                                    keyp.get_modifier_mask());
    keylist.addItem(key);
  }
  return *this;
}

Here is the call graph for this function:


Member Data Documentation

Definition at line 86 of file IMTriggerKeyList.hh.


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