Gateware Libraries  R6.5A
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 
65  static const GUUIID GWindowUUIID =
66  {
67  0x769bc008, 0x3860, 0x4e00, { 0xa5, 0x5c, 0x5d, 0x63, 0x16, 0xdc, 0xb9, 0xf3 }
68  };
69 
71 
77  class GWindow : public CORE::GBroadcasting
78  {
79 
80  public:
81 
83 
93  virtual GReturn OpenWindow() = 0;
94 
96 
104  virtual GReturn ProcessWindowEvents() = 0;
105 
107 
123  virtual GReturn ReconfigureWindow(int _x, int _y, int _width, int _height, GWindowStyle _style) = 0;
124 
126 
133  virtual GReturn SetWindowName(const char* _newName) = 0;
134 
136 
147  virtual GReturn MoveWindow(int _x, int _y) = 0;
148 
150 
163  virtual GReturn ResizeWindow(int _width, int _height) = 0;
164 
166 
173  virtual GReturn Maximize() = 0;
174 
176 
184  virtual GReturn Minimize() = 0;
185 
187 
196  virtual GReturn ChangeWindowStyle(GWindowStyle _style) = 0;
197 
199 
204  virtual GReturn GetWidth(unsigned int& _outWidth) = 0;
205 
207 
214  virtual GReturn GetHeight(unsigned int& _outHeight) = 0;
215 
217 
224  virtual GReturn GetClientWidth(unsigned int& _outClientWidth) = 0;
225 
227 
232  virtual GReturn GetClientHeight(unsigned int& _outClientHeight) = 0;
233 
235 
239  virtual GReturn GetX(unsigned int& _outX) = 0;
240 
242 
246  virtual GReturn GetY(unsigned int& _outY) = 0;
247 
249 
256  virtual GReturn GetClientTopLeft(unsigned int &_outX, unsigned int &_outY) = 0;
257 
259 
265  virtual GReturn GetWindowHandle(unsigned int _handleSize, void** _outWindowHandle) = 0;
266 
268 
272  virtual GReturn IsFullscreen(bool& _outIsFullscreen) = 0;
273 
275 
282  virtual GReturn GetLastEvent(GWindowInputEvents& _LastEvent) = 0;
283 
284  }; // end GWindow class
285 
287 
302  GATEWARE_EXPORT_IMPLICIT GReturn CreateGWindow(int _x, int _y, int _width, int _height, GWindowStyle _style, GWindow** _outWindow);
303  } // end SYSTEM namespace
304 } // end GW namespace
305 
306 #endif
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 GetY(unsigned int &_outY)=0
Returns the Y position in pixels of the currently opened window.
The GBroadcasting Interface is capable of registering & deregistering GListener interfaces.
Definition: GBroadcasting.h:36
virtual GReturn GetHeight(unsigned int &_outHeight)=0
Returns the height in pixels of the currently opened window.
virtual GReturn ResizeWindow(int _width, int _height)=0
Resizes the currently opened window to the specified width and height.
Ensure identical binary padding for structures on all platforms.
Definition: GWindow.h:30
virtual GReturn ChangeWindowStyle(GWindowStyle _style)=0
Sets the currently opened window's style to the specified style.
virtual GReturn OpenWindow()=0
Initializes a window handle and displays a window.
virtual GReturn IsFullscreen(bool &_outIsFullscreen)=0
Returns a bool specifying whether or not the currently opened window is fullscreen.
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.
virtual GReturn GetWindowHandle(unsigned int _handleSize, void **_outWindowHandle)=0
Returns the platform specific window handle to the currently opened window.
virtual GReturn GetClientHeight(unsigned int &_outClientHeight)=0
Returns the client height in pixels of the currently opened window.
GWindowInputEvents
GWindowInputEvents holds the possible events a GWindow window can broadcast.
Definition: GWindow.h:53
A thread-safe window creation and management library.
Definition: GWindow.h:77
virtual GReturn SetWindowName(const char *_newName)=0
Changes de text displayed at the top bar of the window.
virtual GReturn GetWidth(unsigned int &_outWidth)=0
Returns the width in pixels of the currently opened window.
virtual GReturn MoveWindow(int _x, int _y)=0
Repositions the currently opened window to the specified x and y pixels on screen.
virtual GReturn Maximize()=0
Resizes the currently opened window to the native maximum resolution.
Gateware Universally Unique Interface IDentifier.
Definition: GDefines.h:25
virtual GReturn GetLastEvent(GWindowInputEvents &_LastEvent)=0
Returns the last input event that has happened to the window.
virtual GReturn GetX(unsigned int &_outX)=0
Returns the X position in pixels of the currently opened window.
virtual GReturn ProcessWindowEvents()=0
Flushes and processes all messages from the window's event queue.
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.
GWindowStyle
GWindowStyle holds the possible types of window GWindow can create.
Definition: GWindow.h:43
virtual GReturn Minimize()=0
Minimizes the currently opened window.
virtual GReturn GetClientWidth(unsigned int &_outClientWidth)=0
Returns the client width in pixels of the currently opened window.
The core namespace to which all Gateware interfaces/structures/defines must belong.
Definition: GAudio.h:20
GReturn
Listing of common error codes returned by Gateware functions.
Definition: GDefines.h:53