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 BSlider; 15 class BTextView; 16 17 18 class AntialiasingSettingsView : public BView { 19 public: 20 AntialiasingSettingsView(const char* name); 21 virtual ~AntialiasingSettingsView(); 22 23 virtual void AttachedToWindow(); 24 virtual void MessageReceived(BMessage* message); 25 26 void SetDefaults(); 27 void Revert(); 28 bool IsDefaultable(); 29 bool IsRevertable(); 30 31 private: 32 void _BuildAntialiasingMenu(); 33 void _SetCurrentAntialiasing(); 34 void _BuildHintingMenu(); 35 void _SetCurrentHinting(); 36 void _SetCurrentAverageWeight(); 37 void _UpdateColors(); 38 39 protected: 40 float fDivider; 41 42 BMenuField* fAntialiasingMenuField; 43 BPopUpMenu* fAntialiasingMenu; 44 BMenuField* fHintingMenuField; 45 BPopUpMenu* fHintingMenu; 46 BSlider* fAverageWeightControl; 47 BTextView* fSubpixelAntialiasingDisabledLabel; 48 49 bool fSavedSubpixelAntialiasing; 50 bool fCurrentSubpixelAntialiasing; 51 uint8 fSavedHinting; 52 uint8 fCurrentHinting; 53 unsigned char fSavedAverageWeight; 54 unsigned char fCurrentAverageWeight; 55 }; 56 57 #endif // ANTIALIASING_SETTINGS_VIEW_H 58