aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleCode.h
blob: ff660f220c2942025c95fd5c599f67e71da35809 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef SampleCode_DEFINED
#define SampleCode_DEFINED

#include "SkEvent.h"

class SampleCode {
public:
    static bool TitleQ(const SkEvent&);
    static void TitleR(SkEvent*, const char title[]);
    
    static bool PrefSizeQ(const SkEvent&);
    static void PrefSizeR(SkEvent*, SkScalar width, SkScalar height);
};

//////////////////////////////////////////////////////////////////////////////

class SkView;

typedef SkView* (*SkViewFactory)();

class SkViewRegister : SkNoncopyable {
public:
    SkViewRegister(SkViewFactory);
    
    static const SkViewRegister* Head() { return gHead; }
    
    SkViewRegister* next() const { return fChain; }
    SkViewFactory   factory() const { return fFact; }
    
private:
    SkViewFactory   fFact;
    SkViewRegister* fChain;
    
    static SkViewRegister* gHead;
};

#endif