reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame^] | 1 | #ifndef SampleCode_DEFINED |
| 2 | #define SampleCode_DEFINED |
| 3 | |
| 4 | #include "SkEvent.h" |
| 5 | |
| 6 | class SampleCode { |
| 7 | public: |
| 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); |
| 13 | }; |
| 14 | |
| 15 | ////////////////////////////////////////////////////////////////////////////// |
| 16 | |
| 17 | class SkView; |
| 18 | |
| 19 | typedef SkView* (*SkViewFactory)(); |
| 20 | |
| 21 | class SkViewRegister : SkNoncopyable { |
| 22 | public: |
| 23 | SkViewRegister(SkViewFactory); |
| 24 | |
| 25 | static const SkViewRegister* Head() { return gHead; } |
| 26 | |
| 27 | SkViewRegister* next() const { return fChain; } |
| 28 | SkViewFactory factory() const { return fFact; } |
| 29 | |
| 30 | private: |
| 31 | SkViewFactory fFact; |
| 32 | SkViewRegister* fChain; |
| 33 | |
| 34 | static SkViewRegister* gHead; |
| 35 | }; |
| 36 | |
| 37 | #endif |
| 38 | |