Team Fortress 2 Source Code as on 22/4/2020
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.

84 lines
2.2 KiB

  1. //
  2. // mxToolKit (c) 1999 by Mete Ciragan
  3. //
  4. // file: mxInit.h
  5. // implementation: all
  6. // last modified: Apr 28 1999, Mete Ciragan
  7. // copyright: The programs and associated files contained in this
  8. // distribution were developed by Mete Ciragan. The programs
  9. // are not in the public domain, but they are freely
  10. // distributable without licensing fees. These programs are
  11. // provided without guarantee or warrantee expressed or
  12. // implied.
  13. //
  14. #ifndef INCLUDED_MXINIT
  15. #define INCLUDED_MXINIT
  16. #ifdef WIN32
  17. #include <windows.h>
  18. #endif
  19. class mxWindow;
  20. class mx
  21. {
  22. public:
  23. // NO CREATORS
  24. mx() {}
  25. virtual ~mx () {}
  26. // MANIPULATORS
  27. static int init (int argc, char *argv[]);
  28. static int run ();
  29. static int check ();
  30. static void quit ();
  31. static int setDisplayMode (int w, int h, int bpp);
  32. static void setIdleWindow (mxWindow *window);
  33. // ACCESSORS
  34. static int getDisplayWidth ();
  35. static int getDisplayHeight ();
  36. static mxWindow *getMainWindow ();
  37. static const char *getApplicationPath ();
  38. static int getTickCount ();
  39. enum
  40. {
  41. ACCEL_ALT = (1<<0), // The ALT key must be held down when the accelerator key is pressed.
  42. ACCEL_CONTROL = (1<<1), // The CTRL key must be held down when the accelerator key is pressed.
  43. ACCEL_SHIFT = (1<<2), // The SHIFT key must be held down when the accelerator key is pressed.
  44. ACCEL_VIRTKEY = (1<<3), // The key member specifies a virtual-key code. If this flag is not specified, key is assumed to specify a character code.
  45. };
  46. // Based on windows.h ACCEL structure!!!
  47. struct Accel_t
  48. {
  49. Accel_t() :
  50. flags( 0 ),
  51. key( 0 ),
  52. command( 0 )
  53. {
  54. }
  55. unsigned char flags; // one or more of above ACCEL_ flags
  56. unsigned short key; // Specifies the accelerator key. This member can be either a virtual-key code or a character code.
  57. unsigned short command; // Specifies the accelerator identifier. This value is placed in the low-order word of the wParam parameter of the WM_COMMAND or WM_SYSCOMMAND message when the accelerator is pressed.
  58. };
  59. static void createAccleratorTable( int numentries, Accel_t *entries );
  60. private:
  61. // NOT IMPLEMENTED
  62. mx (const mx&);
  63. mx& operator= (const mx&);
  64. };
  65. #endif // INCLUDED_MXINIT