xref: /haiku/src/preferences/appearance/AntialiasingSettingsView.h (revision 746cac055adc6ac3308c7bc2d29040fb95689cc9)
1 /*
2  * Copyright 2008, Andrej Spielmann, <andrej.spielmann@seh.ox.ac.uk>
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 #ifndef ANTIALIASING_SETTINGS_VIEW_H
6 #define ANTIALIASING_SETTINGS_VIEW_H
7 
8 
9 #include <View.h>
10 
11 class BBox;
12 class BMenuField;
13 class BPopUpMenu;
14 class BTextControl;
15 
16 
17 class AntialiasingSettingsView : public BView {
18 public:
19 							AntialiasingSettingsView(BRect rect,
20 								const char* name);
21 	virtual					~AntialiasingSettingsView();
22 
23 	virtual	void			GetPreferredSize(float *_width, float *_height);
24 	virtual	void			RelayoutIfNeeded();
25 	virtual	void			AttachedToWindow();
26 	virtual	void			MessageReceived(BMessage *msg);
27 
28 			void			SetDivider(float divider);
29 
30 			void			SetDefaults();
31 			void			Revert();
32 			bool			IsDefaultable();
33 			bool			IsRevertable();
34 
35 private:
36 			void			_BuildAntialiasingMenu();
37 			void			_SetCurrentAntialiasing();
38 			void			_BuildHintingMenu();
39 			void			_SetCurrentHinting();
40 			void			_SetCurrentAverageWeight();
41 
42 protected:
43 			float			fDivider;
44 
45 			BMenuField*		fAntialiasingMenuField;
46 			BPopUpMenu*		fAntialiasingMenu;
47 			BMenuField*		fHintingMenuField;
48 			BPopUpMenu*		fHintingMenu;
49 			BTextControl*	fAverageWeightControl;
50 
51 			bool			fSavedSubpixelAntialiasing;
52 			bool			fCurrentSubpixelAntialiasing;
53 			bool			fSavedHinting;
54 			bool			fCurrentHinting;
55 			unsigned char	fSavedAverageWeight;
56 			unsigned char	fCurrentAverageWeight;
57 };
58 
59 #endif // ANTIALIASING_SETTINGS_VIEW_H
60