xref: /haiku/src/apps/clock/cl_view.h (revision 494aa1ee39dcf6d2880cce684983e71fa2ab5c25)
1 /*
2  * Copyright 1999, Be Incorporated. All Rights Reserved.
3  * This file may be used under the terms of the Be Sample Code License.
4  *
5  */
6 #ifndef	_CL_VIEW_H_
7 #define _CL_VIEW_H_
8 
9 
10 #include <View.h>
11 
12 
13 class BBitmap;
14 class BMessage;
15 
16 
17 class TOffscreenView : public BView {
18 	public:
19 					TOffscreenView(BRect frame, const char *name, short mRadius,
20 						short hRadius, short offset, long face, bool show);
21 		virtual		~TOffscreenView();
22 
23 		void		DrawX();
24 		void		NextFace();
25 
26 		short		fHours;
27 		short		fMinutes;
28 		short		fSeconds;
29 
30 		short		fOffset;
31 		short		fHoursRadius;
32 		short		fMinutesRadius;
33 
34 		short		fFace;
35 		bool		fShowSeconds;
36 
37 	private:
38 		BBitmap		*fInner;
39 		BBitmap		*fCenter;
40 		BBitmap		*fClockFace[9];
41 
42 		BPoint		fHourPoints[60];
43 		BPoint		fMinutePoints[60];
44 };
45 
46 
47 class TOnscreenView : public BView {
48 	public:
49 							TOnscreenView(BRect frame, const char *name,
50 								short mRadius, short hRadius, short offset);
51 							TOnscreenView(BMessage *data);
52 		virtual				~TOnscreenView();
53 
54 		static BArchivable	*Instantiate(BMessage *data);
55 		virtual	status_t	Archive(BMessage *data, bool deep = true) const;
56 		void				InitObject(BRect frame, short mRadius, short hRadius,
57 								short offset, long face, bool show);
58 
59 		virtual void		Pulse();
60 		virtual	void		Draw(BRect updateRect);
61 		virtual void		MouseDown(BPoint point);
62 		virtual	void		MessageReceived(BMessage *msg);
63 
64 		short				ReturnFace();
65 		void				UseFace(short face);
66 
67 		short				ReturnSeconds();
68 		void				ShowSecs(bool secs);
69 
70 	private:
71 		BBitmap				*fOffscreen;
72 		TOffscreenView		*fOffscreenView;
73 };
74 
75 #endif
76 
77