vfs: check userland buffers before reading them.
[haiku.git] / src / apps / clock / cl_view.h
blob9dac1c7d22c0d76a041d5d9945530cd3ccd9d7bb
1 /*
2 * Copyright 1999, Be Incorporated. All Rights Reserved.
3 * This file may be used under the terms of the Be Sample Code License.
5 */
6 #ifndef _CL_VIEW_H_
7 #define _CL_VIEW_H_
10 #include <View.h>
13 class BBitmap;
14 class BMessage;
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();
23 void DrawX();
24 void NextFace();
26 short fHours;
27 short fMinutes;
28 short fSeconds;
30 short fOffset;
31 short fHoursRadius;
32 short fMinutesRadius;
34 short fFace;
35 bool fShowSeconds;
37 private:
38 BBitmap *fInner;
39 BBitmap *fCenter;
40 BBitmap *fClockFace[9];
42 BPoint fHourPoints[60];
43 BPoint fMinutePoints[60];
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();
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);
59 virtual void Pulse();
60 virtual void Draw(BRect updateRect);
61 virtual void MouseDown(BPoint point);
62 virtual void MessageReceived(BMessage *msg);
64 short ReturnFace();
65 void UseFace(short face);
67 short ReturnSeconds();
68 void ShowSecs(bool secs);
70 private:
71 BBitmap *fOffscreen;
72 TOffscreenView *fOffscreenView;
75 #endif