diff options
author | yangsu@google.com <yangsu@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-02 13:39:12 +0000 |
---|---|---|
committer | yangsu@google.com <yangsu@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-08-02 13:39:12 +0000 |
commit | 921091f29e2ecfec55f4d1ac5611b4aa4731e7d6 (patch) | |
tree | b69f4dd41cb0f5db5be7fac4a26fdd9ddbbc5444 /samplecode/SampleCode.h | |
parent | e938b19445155f71197aac003ea914f59645c471 (diff) |
Set up global options for SampleApp and now allows SampleApp to request menu items from the slides
http://codereview.appspot.com/4807056/
git-svn-id: http://skia.googlecode.com/svn/trunk@2024 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleCode.h')
-rw-r--r-- | samplecode/SampleCode.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/samplecode/SampleCode.h b/samplecode/SampleCode.h index 7bc1c516f1..c22533aa28 100644 --- a/samplecode/SampleCode.h +++ b/samplecode/SampleCode.h @@ -12,7 +12,7 @@ #include "SkEvent.h" #include "SkKey.h" #include "SkView.h" - +class SkOSMenu; class GrContext; class SampleCode { @@ -69,11 +69,17 @@ public: static bool IsSampleView(SkView*); 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) {} protected: virtual void onDrawBackground(SkCanvas*); virtual void onDrawContent(SkCanvas*) = 0; - + // overrides virtual bool onEvent(const SkEvent& evt); virtual bool onQuery(SkEvent* evt); |