| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SampleCode_DEFINED | 10 #ifndef SampleCode_DEFINED |
| 11 #define SampleCode_DEFINED | 11 #define SampleCode_DEFINED |
| 12 | 12 |
| 13 #include "SkColor.h" | 13 #include "SkColor.h" |
| 14 #include "SkEvent.h" | 14 #include "SkEvent.h" |
| 15 #include "SkKey.h" | 15 #include "SkKey.h" |
| 16 #include "SkView.h" | 16 #include "SkView.h" |
| 17 #include "SkOSMenu.h" | 17 #include "SkOSMenu.h" |
| 18 class GrContext; | 18 class GrContext; |
| 19 | 19 |
| 20 #define DEF_SAMPLE(code) \ |
| 21 static SkView* SK_MACRO_APPEND_LINE(F_)() { code } \ |
| 22 static SkViewRegister SK_MACRO_APPEND_LINE(R_)(SK_MACRO_APPEND_LINE(F_)); |
| 23 |
| 24 |
| 20 class SampleCode { | 25 class SampleCode { |
| 21 public: | 26 public: |
| 22 static bool KeyQ(const SkEvent&, SkKey* outKey); | 27 static bool KeyQ(const SkEvent&, SkKey* outKey); |
| 23 static bool CharQ(const SkEvent&, SkUnichar* outUni); | 28 static bool CharQ(const SkEvent&, SkUnichar* outUni); |
| 24 | 29 |
| 25 static bool TitleQ(const SkEvent&); | 30 static bool TitleQ(const SkEvent&); |
| 26 static void TitleR(SkEvent*, const char title[]); | 31 static void TitleR(SkEvent*, const char title[]); |
| 27 static bool RequestTitle(SkView* view, SkString* title); | 32 static bool RequestTitle(SkView* view, SkString* title); |
| 28 | 33 |
| 29 static bool PrefSizeQ(const SkEvent&); | 34 static bool PrefSizeQ(const SkEvent&); |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 SkOSMenu::TriState fPipeState; | 146 SkOSMenu::TriState fPipeState; |
| 142 SkColor fBGColor; | 147 SkColor fBGColor; |
| 143 | 148 |
| 144 private: | 149 private: |
| 145 int fRepeatCount; | 150 int fRepeatCount; |
| 146 | 151 |
| 147 typedef SkView INHERITED; | 152 typedef SkView INHERITED; |
| 148 }; | 153 }; |
| 149 | 154 |
| 150 #endif | 155 #endif |
| OLD | NEW |