1 /* 2 * Copyright 2001-2009, Haiku. 3 * Copyright 2002, Thomas Kurschel. 4 * Distributed under the terms of the MIT License. 5 * 6 * Authors: 7 * Rafael Romo 8 * Thomas Kurschel 9 * Axel Dörfler, axeld@pinc-software.de 10 */ 11 #ifndef MONITOR_VIEW_H 12 #define MONITOR_VIEW_H 13 14 15 #include <View.h> 16 17 18 class MonitorView : public BView { 19 public: 20 MonitorView(BRect frame, char* name, 21 int32 screenWidth, int32 screenHeight); 22 virtual ~MonitorView(); 23 24 virtual void AttachedToWindow(); 25 virtual void Draw(BRect updateRect); 26 virtual void MessageReceived(BMessage *message); 27 virtual void MouseDown(BPoint point); 28 29 void SetResolution(int32 width, int32 height); 30 void SetMaxResolution(int32 width, int32 height); 31 32 private: 33 BRect _MonitorBounds(); 34 void _UpdateDPI(); 35 36 rgb_color fBackgroundColor; 37 rgb_color fDesktopColor; 38 int32 fMaxWidth; 39 int32 fMaxHeight; 40 int32 fWidth; 41 int32 fHeight; 42 int32 fDPI; 43 }; 44 45 #endif /* MONITOR_VIEW_H */ 46