1 /* 2 * Copyright 2003-2013 Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Michael Phipps 7 * Axel Dörfler, axeld@pinc-software.de 8 */ 9 #ifndef SCREEN_CORNER_SELECTOR_H 10 #define SCREEN_CORNER_SELECTOR_H 11 12 13 #include <Control.h> 14 15 16 #include "ScreenSaverSettings.h" 17 18 19 class ScreenCornerSelector : public BControl { 20 public: 21 ScreenCornerSelector(BRect frame, 22 const char *name, BMessage* message, 23 uint32 resizingMode); 24 25 virtual void Draw(BRect updateRect); 26 virtual void MouseDown(BPoint point); 27 virtual void MouseUp(BPoint point); 28 virtual void MouseMoved(BPoint where, uint32 transit, 29 const BMessage* dragMessage); 30 virtual void KeyDown(const char* bytes, int32 numBytes); 31 32 virtual void SetValue(int32 value); 33 virtual int32 Value(); 34 35 void SetCorner(screen_corner corner); 36 screen_corner Corner() const; 37 38 private: 39 BRect _MonitorFrame() const; 40 BRect _InnerFrame(BRect monitorFrame) const; 41 BRect _CenterFrame(BRect innerFrame) const; 42 void _DrawStop(BRect innerFrame); 43 void _DrawArrow(BRect innerFrame); 44 screen_corner _ScreenCorner(BPoint point, 45 screen_corner previous) const; 46 47 screen_corner fCurrentCorner; 48 int32 fPreviousCorner; 49 }; 50 51 52 #endif // SCREEN_CORNER_SELECTOR_H 53