home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / thx / include / kdfold.h < prev    next >
C/C++ Source or Header  |  1995-05-08  |  869b  |  43 lines

  1. // ----------- kdfold.h
  2.  
  3. #ifndef  KDFOLD_H
  4. #define  KDFOLD_H
  5.  
  6. #include "handler.h"
  7. #include "folder.h"
  8. #include "debug.h"
  9.  
  10. const int MAXDOWNENTRY = 20;
  11.  
  12. class Hand;
  13.  
  14. struct HotkeyEntry  {
  15.   int code;
  16.   EventHandler list; 
  17. };
  18.  
  19. class HotkeyFolder : public Folder  {
  20.   void reset_slot(int);
  21.   void thxregister_key(Hand*,int key,callback);
  22.   int numentries;
  23.   HotkeyEntry entry[MAXDOWNENTRY]; 
  24.   friend class HotkeyServer;
  25. public:
  26.   HotkeyFolder() { numentries=0; }
  27.   void register_key(Hand*,int key,callback);
  28.   void unregister_key(Hand*,int key,callback);
  29.   void delHand(Hand*);
  30.   void reset();
  31.   void dispatch(int, int, int);
  32. };
  33.  
  34. inline void HotkeyFolder::register_key(Hand* hand,
  35.                                          int code,callback cb)
  36. {
  37.   thxregister_key(hand,code,cb);
  38.   Assert(numentries <= MAXDOWNENTRY);
  39. }
  40.  
  41. #endif
  42.  
  43.