aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleCode.h
diff options
context:
space:
mode:
authorGravatar yangsu@google.com <yangsu@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-08-08 15:37:23 +0000
committerGravatar yangsu@google.com <yangsu@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-08-08 15:37:23 +0000
commitdb03eaa37111a63835ab7f61cb550971e609a621 (patch)
tree2f6e9f9509123d7a0f40eca9e447c7377cb39382 /samplecode/SampleCode.h
parentf3493f0e1f92a8a284adb93ecbf350401e1c7423 (diff)
Added transitions and net pipe to SampleApp, updated gyp files
Diffstat (limited to 'samplecode/SampleCode.h')
-rw-r--r--samplecode/SampleCode.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/samplecode/SampleCode.h b/samplecode/SampleCode.h
index c22533aa28..2db1955b64 100644
--- a/samplecode/SampleCode.h
+++ b/samplecode/SampleCode.h
@@ -22,6 +22,7 @@ public:
static bool TitleQ(const SkEvent&);
static void TitleR(SkEvent*, const char title[]);
+ static bool RequestTitle(SkView* view, SkString* title);
static bool PrefSizeQ(const SkEvent&);
static void PrefSizeR(SkEvent*, SkScalar width, SkScalar height);
@@ -70,11 +71,14 @@ public:
static bool SetRepeatDraw(SkView*, int count);
static bool SetUsePipe(SkView*, bool);
- //call this to request menu items from a SampleView. A SampleView can
- //overwrite this method to add new items of various types to the menu and
- //change its title. The events attached to any new menu items must be
- //handled in the onEvent method. See SkOSMenu.h for helper functions.
- virtual void requestMenus(SkOSMenu* menu) {}
+ /**
+ * Call this to request menu items from a SampleView.
+ * Subclassing notes: A subclass of SampleView can overwrite this method
+ * to add new items of various types to the menu and change its title.
+ * The events attached to any new menu items must be handled in its onEvent
+ * method. See SkOSMenu.h for helper functions.
+ */
+ virtual void requestMenu(SkOSMenu* menu) {}
protected:
virtual void onDrawBackground(SkCanvas*);
@@ -83,13 +87,14 @@ protected:
// overrides
virtual bool onEvent(const SkEvent& evt);
virtual bool onQuery(SkEvent* evt);
+ virtual void draw(SkCanvas*);
virtual void onDraw(SkCanvas*);
+ bool fUsePipe;
+ SkColor fBGColor;
+
private:
int fRepeatCount;
- SkColor fBGColor;
-
- bool fUsePipe;
typedef SkView INHERITED;
};