skia2/samplecode/SampleCode.h
reed@android.com f2b98d67dc merge with changes for GPU backend
git-svn-id: http://skia.googlecode.com/svn/trunk@637 2bbb7eff-a529-9590-31e7-b0007b416f81
2010-12-20 18:26:13 +00:00

50 lines
1.2 KiB
C++

#ifndef SampleCode_DEFINED
#define SampleCode_DEFINED
#include "SkEvent.h"
#include "SkKey.h"
class SampleCode {
public:
static bool KeyQ(const SkEvent&, SkKey* outKey);
static bool CharQ(const SkEvent&, SkUnichar* outUni);
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);
static bool FastTextQ(const SkEvent&);
static SkMSec GetAnimTime();
static SkMSec GetAnimTimeDelta();
static SkScalar GetAnimSecondsDelta();
static SkScalar GetAnimScalar(SkScalar speedPerSec, SkScalar period = 0);
};
//////////////////////////////////////////////////////////////////////////////
class SkView;
typedef SkView* (*SkViewFactory)();
class SkViewRegister : SkNoncopyable {
public:
explicit 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