win32WindowMgr.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. #ifndef _WINDOWMANAGER_WIN32_WIN32WINDOWMANAGER_
  23. #define _WINDOWMANAGER_WIN32_WIN32WINDOWMANAGER_
  24. #include <windows.h>
  25. #include "math/mMath.h"
  26. #include "gfx/gfxStructs.h"
  27. #include "windowManager/win32/win32Window.h"
  28. #include "core/util/tVector.h"
  29. /// Win32 implementation of the window manager interface.
  30. class Win32WindowManager : public PlatformWindowManager
  31. {
  32. friend class Win32Window;
  33. virtual void _processCmdLineArgs(const S32 argc, const char **argv);
  34. /// Link the specified window into the window list.
  35. void linkWindow(Win32Window *w);
  36. /// Remove specified window from the window list.
  37. void unlinkWindow(Win32Window *w);
  38. /// Callback for the process list.
  39. void _process();
  40. /// List of allocated windows.
  41. Win32Window *mWindowListHead;
  42. /// Parent window, used in window setup in web plugin scenarios.
  43. HWND mParentWindow;
  44. /// set via command line -offscreen option, controls whether rendering/input
  45. // is intended for offscreen rendering
  46. bool mOffscreenRender;
  47. /// Callback to receive information about available monitors.
  48. static BOOL CALLBACK MonitorEnumProc(
  49. HMONITOR hMonitor, // handle to display monitor
  50. HDC hdcMonitor, // handle to monitor DC
  51. LPRECT lprcMonitor, // monitor intersection rectangle
  52. LPARAM dwData // data
  53. );
  54. /// If a curtain window is present, then its HWND will be stored here.
  55. HWND mCurtainWindow;
  56. public:
  57. Win32WindowManager();
  58. ~Win32WindowManager();
  59. virtual RectI getPrimaryDesktopArea();
  60. virtual S32 getDesktopBitDepth();
  61. virtual Point2I getDesktopResolution();
  62. virtual void getMonitorRegions(Vector<RectI> &regions);
  63. virtual PlatformWindow *createWindow(GFXDevice *device, const GFXVideoMode &mode);
  64. virtual void getWindows(VectorPtr<PlatformWindow*> &windows);
  65. virtual void setParentWindow(void* newParent);
  66. virtual void* getParentWindow();
  67. virtual PlatformWindow *getWindowById(WindowId id);
  68. virtual PlatformWindow *getFirstWindow();
  69. virtual PlatformWindow* getFocusedWindow();
  70. virtual void lowerCurtain();
  71. virtual void raiseCurtain();
  72. };
  73. #endif