summaryrefslogtreecommitdiff
path: root/source/Asura.Editor/system/window.h
blob: c9837e3adcd3b4b887b1dfc3d865ed3499a52b1e (plain)
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef __ASURA_EDITOR_WINDOW_H__
#define __ASURA_EDITOR_WINDOW_H__

#include <windows.h>
#include <string.h>

#include <asura-utils/scripting/portable.hpp>

#include "../type.h"

namespace AsuraEditor
{

	///
	/// ڷָֻ˿ܵķ񣬾ĿؼӦóơ
	///
	enum WindowStyle
	{
		WINDOW_STYLE_BASIC,   ///< 
		WINDOW_STYLE_TOOL,    ///< 
		WINDOW_STYLE_CONFIRM, ///< ȷϴ
	};

	///
	/// ʱҪ
	///
	struct WindowConfig
	{
		std::string title;  ///< 
		uint x, y;          ///< 
		uint width, height; ///< С
		WindowStyle style;  ///< 
	};

	///
	/// ༭win32ڣÿһڰһHWNDһHDC
	///
	class Window 
		: public AEScripting::Portable<Window>
	{
	public:

		Window();
		~Window();

		bool Init(WindowConfig& config);

	private: 

		//------------------------------------------------------------------------------//

		LUAX_DECL_FACTORY(Window);

		LUAX_DECL_ENUM(WindowStyle);

		LUAX_DECL_METHOD(_New);
		LUAX_DECL_METHOD(_Init);
		LUAX_DECL_METHOD(_SetPosition);

		//------------------------------------------------------------------------------//

		///
		/// ڡ
		///
		Window* mParent;

		///
		/// ھ豸ġ
		///
		HWND mHWND; 
		HDC  mHDC; 

		///
		/// ڷ
		///
		WindowStyle mStyle;

	};

}

#endif