You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
1.8 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * Turbo Vision - Version 2.0
  3. *
  4. * Copyright (c) 1994 by Borland International
  5. * All Rights Reserved.
  6. *
  7. Modified by Robert H�hne to be used for RHIDE.
  8. *
  9. *
  10. */
  11. #if defined( Uses_TCommandSet ) && !defined( __TCommandSet )
  12. #define __TCommandSet
  13. class TCommandSet
  14. {
  15. public:
  16. TCommandSet();
  17. TCommandSet( const TCommandSet& );
  18. ~TCommandSet();
  19. Boolean has( int cmd );
  20. void disableCmd( int cmd );
  21. void disableCmd( int cmdStart, int cmdEnd ); // SET: Added
  22. void enableCmd( int cmd );
  23. void enableCmd( int cmdStart, int cmdEnd ); // SET: Added
  24. void enableAllCommands();
  25. void operator += ( int cmd );
  26. void operator -= ( int cmd );
  27. void disableCmd( const TCommandSet& );
  28. void enableCmd( const TCommandSet& );
  29. void operator += ( const TCommandSet& );
  30. void operator -= ( const TCommandSet& );
  31. Boolean isEmpty();
  32. TCommandSet& operator = (const TCommandSet& );
  33. TCommandSet& operator &= ( const TCommandSet& );
  34. TCommandSet& operator |= ( const TCommandSet& );
  35. friend TCommandSet operator & ( const TCommandSet&, const TCommandSet& );
  36. friend TCommandSet operator | ( const TCommandSet&, const TCommandSet& );
  37. friend int operator == ( const TCommandSet& tc1, const TCommandSet& tc2 );
  38. friend int operator != ( const TCommandSet& tc1, const TCommandSet& tc2 );
  39. private:
  40. uint32 *cmds;
  41. };
  42. inline void TCommandSet::operator += ( int cmd )
  43. {
  44. enableCmd( cmd );
  45. }
  46. inline void TCommandSet::operator -= ( int cmd )
  47. {
  48. disableCmd( cmd );
  49. }
  50. inline void TCommandSet::operator += ( const TCommandSet& tc )
  51. {
  52. enableCmd( tc );
  53. }
  54. inline void TCommandSet::operator -= ( const TCommandSet& tc )
  55. {
  56. disableCmd( tc );
  57. }
  58. inline int operator != ( const TCommandSet& tc1, const TCommandSet& tc2 )
  59. {
  60. return !operator == ( tc1, tc2 );
  61. }
  62. #endif // Uses_TCommandSet