main.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. // THIS FILE SHOULD FUCKING DISAPPEAR DAMMIT
  2. //NONPORTABLE -- HWND and HINSTANCE references
  3. #ifndef _MAIN_H
  4. #define _MAIN_H
  5. #warning don't include me
  6. #include <bfc/std.h>
  7. #include <bfc/string/string.h>
  8. #include <bfc/ptrlist.h>
  9. #define WM_SYSTRAY WM_USER+1102 //FG> Arbitrary value. Would probably be better with a registered message
  10. #define WM_SETSKIN WM_USER+0x1000
  11. class Systray;
  12. class MetricsCallback;
  13. class ScriptObjectManager;
  14. class CfgItem;
  15. class api_window;
  16. class GenWnd;
  17. class WasabiKernelController;
  18. class CoreHandle;
  19. class CompCommandEntry;
  20. class Layout;
  21. class Main {
  22. public:
  23. friend class WasabiKernel;
  24. static HINSTANCE gethInstance();
  25. static HWND gethWnd();
  26. static DWORD getThreadId();
  27. static WasabiKernelController *getKernelController();
  28. static int isMaximized();
  29. static int isMinimized();
  30. static int minimizeWnd();
  31. static int restoreWnd();
  32. static int invalidate();
  33. static void outputDebugString(int severity, const char *string);
  34. static void outputDebugString(const char *string) {
  35. outputDebugString(0, string);
  36. }
  37. // sets the ownerwnd title
  38. static void setWindowTitle(const wchar_t *text);
  39. // status
  40. static void setOverlayText(const wchar_t *text, int interval);//displays then reverts
  41. static void setTrayTipText(const wchar_t *text); // set systrem tray icon tooltip text
  42. // ontop status
  43. static void setOnTop(BOOL set);
  44. static BOOL getOnTop();
  45. // systray
  46. // 0 = nothing
  47. // 1 = taskbar
  48. // 2 = systray
  49. // 3 = both :)
  50. static void setIconMode(int mode);
  51. // skin
  52. static void setSkinDelayed(const wchar_t *skinName);
  53. // path to wasabi.dll
  54. static const wchar_t *getWasabiPath();
  55. // path to main EXE
  56. static const wchar_t *getMainAppPath();
  57. static GUID getGuid();
  58. static void shutdown();
  59. static void cancelShutdown();
  60. static void savePosition();
  61. static void navigateUrl(const wchar_t *url); // displays in minibrowser if present, otherwise launch external
  62. static int appContextMenu(api_window *parent, BOOL canScale, BOOL canAlpha);
  63. static int thingerContextMenu(api_window *parent);
  64. static void doAction(int action, int param=0);
  65. static void doMenu(const wchar_t *which);
  66. static void processCommandLine(const wchar_t *cmdLine);
  67. static void setSkinsPath(const wchar_t *path);
  68. static const wchar_t *getSkinsPath();
  69. static GenWnd *getGenericWnd();
  70. static int isShutingDown();
  71. static HICON smallicon;
  72. static HICON bigicon;
  73. static bool ontop;
  74. static Systray *systray;
  75. static GenWnd *genericwnd;
  76. static int shuting_down;
  77. // maintains a stack of modal windows so basewnds can discard messages in WM_MOUSEACTIVATE, should only be used by MsgboxWnd & ModalWnd when we write it ;)
  78. static api_window *getModalWnd();
  79. static void pushModalWnd(api_window *wnd);
  80. static int popModalWnd(api_window *wnd);
  81. static void metrics_addCallback(MetricsCallback *);
  82. static void metrics_delCallback(MetricsCallback *);
  83. static int metrics_getDelta();
  84. static int metrics_setDelta(int newdelta);
  85. static int isInetAvailable(); //return 1 if connected, 0 if not available
  86. static String lastwindowtitle;
  87. static int taskbaractive;
  88. static CoreHandle *getMainCoreHandle();
  89. static CoreHandle *mainCoreHandle;
  90. static const wchar_t *getCommandLine();
  91. static String commandLine;
  92. static String skinspath;
  93. static int revert_on_error;
  94. static int cancel_shutdown;
  95. static PtrList<api_window> ontoplist;
  96. static void saveTopMosts();
  97. static void restoreTopMosts();
  98. static int onMouseWheel(int l, int a);
  99. private:
  100. static int isRASActive();
  101. };
  102. #endif