blob: c901af3c39f4d58779858cd82d0a283ec96521cd [file] [log] [blame]
reed@android.com8a1c16f2008-12-17 15:59:43 +00001#ifndef SampleCode_DEFINED
2#define SampleCode_DEFINED
3
4#include "SkEvent.h"
5
6class SampleCode {
7public:
8 static bool TitleQ(const SkEvent&);
9 static void TitleR(SkEvent*, const char title[]);
10
11 static bool PrefSizeQ(const SkEvent&);
12 static void PrefSizeR(SkEvent*, SkScalar width, SkScalar height);
reed@android.com44177402009-11-23 21:07:51 +000013
14 static SkMSec GetAnimTime();
15 static SkScalar GetAnimScalar(SkScalar speedPerSec, SkScalar period = 0);
reed@android.com8a1c16f2008-12-17 15:59:43 +000016};
17
18//////////////////////////////////////////////////////////////////////////////
19
20class SkView;
21
22typedef SkView* (*SkViewFactory)();
23
24class SkViewRegister : SkNoncopyable {
25public:
deanm@chromium.org1220e1c2009-06-11 12:26:47 +000026 explicit SkViewRegister(SkViewFactory);
reed@android.com8a1c16f2008-12-17 15:59:43 +000027
28 static const SkViewRegister* Head() { return gHead; }
29
30 SkViewRegister* next() const { return fChain; }
31 SkViewFactory factory() const { return fFact; }
32
33private:
34 SkViewFactory fFact;
35 SkViewRegister* fChain;
36
37 static SkViewRegister* gHead;
38};
39
40#endif
41