Gateware Libraries  6.3.A
Beta Build
GWindow.h
1 #ifndef GWINDOW_H
2 #define GWINDOW_H
3 
15 #include "../G_Core/GBroadcasting.h"
17 #include "../G_System/GKeyDefines.h"
18 
20 namespace GW
21 {
23  namespace SYSTEM
24  {
25 
27 #pragma pack(push, 1)
28 
29  // !GWINDOW_EVENT_DATA holds the properties of the window the event was sent from.
31  {
32  unsigned int eventFlags;
33  unsigned int height;
34  unsigned int width;
35  int windowX;
36  int windowY;
37  void* windowHandle;
38  };
39 
40 #pragma pack(pop)
41 
44  {
45  WINDOWEDBORDERED,
46  WINDOWEDBORDERLESS,
47  FULLSCREENBORDERED,
48  FULLSCREENBORDERLESS,
49  MINIMIZED,
50  };
51 
54  {
55  NOTIFY,
56  MINIMIZE,
57  MAXIMIZE,
58  RESIZE,
59  MOVE,
60  DESTROY,
61  };
62 
64  static const GUUIID GWindowUUIID =
65  {
66  0xe53c2594, 0xe47c, 0x49a5,{ 0xbd, 0x1b, 0x53, 0x41, 0xf2, 0x60, 0x3f, 0x95 }
67  };
68 
70 
76  class GWindow : public CORE::GBroadcasting
77  {
78 
79  public:
80 
82 
92  virtual GReturn OpenWindow() = 0;
93 
95 
103  virtual GReturn ProcessWindowEvents() = 0;
104 
106 
122  virtual GReturn ReconfigureWindow(int _x, int _y, int _width, int _height, GWindowStyle _style) = 0;
123 
125 
136  virtual GReturn MoveWindow(int _x, int _y) = 0;
137 
139 
152  virtual GReturn ResizeWindow(int _width, int _height) = 0;
153 
155 
162  virtual GReturn Maximize() = 0;
163 
165 
173  virtual GReturn Minimize() = 0;
174 
176 
185  virtual GReturn ChangeWindowStyle(GWindowStyle _style) = 0;
186 
188 
193  virtual GReturn GetWidth(unsigned int& _outWidth) = 0;
194 
196 
203  virtual GReturn GetHeight(unsigned int& _outHeight) = 0;
204 
206 
213  virtual GReturn GetClientWidth(unsigned int& _outClientWidth) = 0;
214 
216 
221  virtual GReturn GetClientHeight(unsigned int& _outClientHeight) = 0;
222 
224 
228  virtual GReturn GetX(unsigned int& _outX) = 0;
229 
231 
235  virtual GReturn GetY(unsigned int& _outY) = 0;
236 
238 
245  virtual GReturn GetClientTopLeft(unsigned int &_outX, unsigned int &_outY) = 0;
246 
248 
254  virtual GReturn GetWindowHandle(unsigned int _handleSize, void** _outWindowHandle) = 0;
255 
257 
261  virtual GReturn IsFullscreen(bool& _outIsFullscreen) = 0;
262 
264 
271  virtual GReturn GetLastEvent(GWindowInputEvents& _LastEvent) = 0;
272 
273  }; // end GWindow class
274 
276 
291  GATEWARE_EXPORT_IMPLICIT GReturn CreateGWindow(int _x, int _y, int _width, int _height, GWindowStyle _style, GWindow** _outWindow);
292  } // end SYSTEM namespace
293 } // end GW namespace
294 
295 #endif
virtual GReturn Maximize()=0
Resizes the currently opened window to the native maximum resolution.
virtual GReturn ChangeWindowStyle(GWindowStyle _style)=0
Sets the currently opened window's style to the specified style.
Gateware Universally Unique Interface IDentifier.
Definition: GDefines.h:25
GWindowStyle
GWindowStyle holds the possible types of window GWindow can create.
Definition: GWindow.h:43
virtual GReturn GetWindowHandle(unsigned int _handleSize, void **_outWindowHandle)=0
Returns the platform specific window handle to the currently opened window.
virtual GReturn GetY(unsigned int &_outY)=0
Returns the Y position in pixels of the currently opened window.
GWindowInputEvents
GWindowInputEvents holds the possible events a GWindow window can broadcast.
Definition: GWindow.h:53
The GBroadcasting Interface is capable of registering & deregistering GListener interfaces.
Definition: GBroadcasting.h:36
GReturn
Listing of common error codes returned by Gateware functions.
Definition: GDefines.h:53
virtual GReturn ReconfigureWindow(int _x, int _y, int _width, int _height, GWindowStyle _style)=0
Gives the currently opened window the specified size, position and style.
virtual GReturn GetLastEvent(GWindowInputEvents &_LastEvent)=0
Returns the last input event that has happened to the window.
virtual GReturn IsFullscreen(bool &_outIsFullscreen)=0
Returns a bool specifying whether or not the currently opened window is fullscreen.
virtual GReturn MoveWindow(int _x, int _y)=0
Repositions the currently opened window to the specified x and y pixels on screen.
virtual GReturn GetClientWidth(unsigned int &_outClientWidth)=0
Returns the client width in pixels of the currently opened window.
virtual GReturn ProcessWindowEvents()=0
Flushes and processes all messages from the window's event queue.
virtual GReturn GetWidth(unsigned int &_outWidth)=0
Returns the width in pixels of the currently opened window.
virtual GReturn GetX(unsigned int &_outX)=0
Returns the X position in pixels of the currently opened window.
virtual GReturn GetClientHeight(unsigned int &_outClientHeight)=0
Returns the client height in pixels of the currently opened window.
The core namespace to which all Gateware interfaces/structures/defines must belong.
Definition: GAudio.h:20
virtual GReturn GetHeight(unsigned int &_outHeight)=0
Returns the height in pixels of the currently opened window.
virtual GReturn OpenWindow()=0
Initializes a window handle and displays a window.
Ensure identical binary padding for structures on all platforms.
Definition: GWindow.h:30
A thread-safe window creation and management library.
Definition: GWindow.h:76
virtual GReturn GetClientTopLeft(unsigned int &_outX, unsigned int &_outY)=0
Gets the location of the top-left pixel of the opened window's client area.
GATEWARE_EXPORT_IMPLICIT GReturn CreateGWindow(int _x, int _y, int _width, int _height, GWindowStyle _style, GWindow **_outWindow)
Creates and outputs a new GWindow object.
virtual GReturn ResizeWindow(int _width, int _height)=0
Resizes the currently opened window to the specified width and height.
virtual GReturn Minimize()=0
Minimizes the currently opened window.