forked from fastbuild/fastbuild
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathOSWindow.h
59 lines (47 loc) · 1.65 KB
/
OSWindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// OSWindow.h
//------------------------------------------------------------------------------
#pragma once
// Includes
//------------------------------------------------------------------------------
#include "Core/Containers/Array.h"
#include "Core/Env/Types.h"
// Forward Declarations
//------------------------------------------------------------------------------
class AString;
class OSDropDown;
class OSWidget;
// Defines
//------------------------------------------------------------------------------
#if defined( __WINDOWS__ )
// Windows user messages
#define OSUI_WM_TRAYICON ( WM_USER + 1 )
#endif
// OSWindow
//------------------------------------------------------------------------------
class OSWindow
{
public:
explicit OSWindow( void * hInstance );
virtual ~OSWindow();
void Init( int32_t x, int32_t y, uint32_t w, uint32_t h );
void AddChild( OSWidget * childWidget );
#if defined( __WINDOWS__ )
inline void * GetHandle() const { return m_Handle; }
inline void * GetHInstance() const { return m_HInstance; }
OSWidget * GetChildFromHandle( void * handle );
#endif
void SetTitle( const char * title );
// Events for derived classes to respond to
virtual bool OnMinimize();
virtual bool OnClose();
virtual bool OnTrayIconLeftClick();
virtual bool OnTrayIconRightClick();
virtual void OnDropDownSelectionChanged( OSDropDown * dropDown );
protected:
#if defined( __WINDOWS__ )
void * m_Handle;
void * m_HInstance;
#endif
Array< OSWidget * > m_ChildWidgets;
};
//------------------------------------------------------------------------------