xref: /haiku/src/tests/servers/app/benchmark/TestWindow.h (revision b55a57da7173b9af0432bd3e148d03f06161d036)
1 /*
2  * Copyright (C) 2008 Stephan Aßmus <superstippi@gmx.de>
3  * All rights reserved. Distributed under the terms of the MIT license.
4  */
5 #ifndef TEST_WINDOW_H
6 #define TEST_WINDOW_H
7 
8 #include <Messenger.h>
9 #include <View.h>
10 #include <Window.h>
11 
12 
13 enum {
14 	MSG_TEST_FINISHED	= 'tstf',
15 	MSG_TEST_CANCELED	= 'tstc'
16 };
17 
18 
19 class Test;
20 
21 // TestView
22 class TestView : public BView {
23 public:
24 								TestView(BRect frame, Test* test,
25 									drawing_mode mode, bool useClipping,
26 									const BMessenger& target);
27 
28 	virtual	void				AttachedToWindow();
29 	virtual	void				Draw(BRect updateRect);
30 
31 private:
32 			Test*				fTest;
33 			BMessenger			fTarget;
34 			bool				fUseClipping;
35 };
36 
37 // TestWindow
38 class TestWindow : public BWindow {
39 public:
40 								TestWindow(BRect fame, Test* test,
41 									drawing_mode mode, bool useClipping,
42 									const BMessenger& target);
43 
44 	virtual	bool				QuitRequested();
45 
46 			void				SetAllowedToQuit(bool allowed);
47 			BView*				View() const { return fTestView; }
48 private:
49 			BMessenger			fTarget;
50 			bool				fAllowedToQuit;
51 			TestView*			fTestView;
52 };
53 
54 #endif // TEST_WINDOW_H
55