dedicatedWindowStub.h
Engine/source/windowManager/dedicated/dedicatedWindowStub.h
Detailed Description
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#ifdef TORQUE_DEDICATED 25 26#ifndef _DEDICATED_WINDOW_STUB_H_ 27#define _DEDICATED_WINDOW_STUB_H_ 28 29#include "windowManager/platformWindowMgr.h" 30 31/// The DedicatedWindowMgr is for Dedicated servers, which may not 32/// even have graphics hardware. However, the WindowManager is referenced 33/// (indirectly) by scripts, and therefore must exist. 34class DedicatedWindowMgr : public PlatformWindowManager 35{ 36public: 37 38 DedicatedWindowMgr() {}; 39 40 virtual ~DedicatedWindowMgr() 41 { 42 } 43 44 static void processCmdLineArgs(const S32 argc, const char **argv) {} 45 46 /// Return the extents in window coordinates of the primary desktop 47 /// area. On dedicated systems, this returns a token value of 0. 48 virtual RectI getPrimaryDesktopArea() { return RectI(0, 0, 0, 0); } 49 50 /// Retrieve the currently set desktop bit depth. 51 /// @return -1 since there is no desktop 52 virtual S32 getDesktopBitDepth() { return -1; } 53 54 /// Retrieve the currently set desktop resolution 55 /// @return Point2I(-1,-1) since there is no desktop 56 virtual Point2I getDesktopResolution() { return Point2I(-1, -1); } 57 58 /// Populate a vector with the token primary desktop area value 59 virtual void getMonitorRegions(Vector<RectI> ®ions) { regions.push_back(getPrimaryDesktopArea()); } 60 61 /// Create a new window, appropriate for the specified device and mode. 62 /// 63 /// @return NULL - there is no graphics hardware available in dedicated mode 64 virtual PlatformWindow *createWindow(GFXDevice *device, const GFXVideoMode &mode) { return NULL; } 65 66 /// Produces an empty list since there are no windows in dedicated mode 67 virtual void getWindows(VectorPtr<PlatformWindow*> &windows) { windows.clear(); } 68 69 /// Get the window that currently has the input focus or NULL. 70 virtual PlatformWindow* getFocusedWindow() { return NULL; } 71 72 /// Get a window from a device ID. 73 /// 74 /// @return NULL. 75 virtual PlatformWindow *getWindowById(WindowId id) { return NULL; } 76 77 /// Get the first window in the window list 78 /// 79 /// @return The first window in the list, or NULL if no windows found 80 virtual PlatformWindow *getFirstWindow() { return NULL; } 81 82 83 /// Set the parent window 84 /// 85 /// This does nothing in dedicated builds 86 virtual void setParentWindow(void* newParent) {} 87 88 /// Get the parent window - returns NULL for dedicated servers 89 virtual void* getParentWindow() { return NULL; } 90 91 92 /// This method cues the appearance of that window ("lowering the curtain"). 93 virtual void lowerCurtain() {} 94 95 /// @see lowerCurtain 96 /// 97 /// This method removes the curtain window. 98 virtual void raiseCurtain() {} 99 100private: 101 /// Process command line arguments from StandardMainLoop. This is done to 102 /// allow web plugin functionality, where we are passed platform-specific 103 /// information allowing us to set ourselves up in the web browser, 104 /// to occur in a platform-neutral way. 105 virtual void _processCmdLineArgs(const S32 argc, const char **argv) {} 106}; 107 108#endif // _DEDICATED_WINDOW_STUB_H_ 109 110#endif // TORQUE_DEDICATED 111