1 /* 2 * Copyright 2016 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef Slide_DEFINED 9 #define Slide_DEFINED 10 11 #include "SkRefCnt.h" 12 #include "SkSize.h" 13 #include "SkString.h" 14 #include "sk_app/Window.h" 15 16 class SkCanvas; 17 class SkAnimTimer; 18 19 class Slide : public SkRefCnt { 20 public: ~Slide()21 virtual ~Slide() {} 22 getDimensions()23 virtual SkISize getDimensions() const { 24 return SkISize::Make(0, 0); 25 } 26 27 virtual void draw(SkCanvas* canvas) = 0; animate(const SkAnimTimer &)28 virtual bool animate(const SkAnimTimer&) { return false; } load(SkScalar winWidth,SkScalar winHeight)29 virtual void load(SkScalar winWidth, SkScalar winHeight) {} unload()30 virtual void unload() {} 31 onChar(SkUnichar c)32 virtual bool onChar(SkUnichar c) { return false; } onMouse(SkScalar x,SkScalar y,sk_app::Window::InputState state,uint32_t modifiers)33 virtual bool onMouse(SkScalar x, SkScalar y, sk_app::Window::InputState state, 34 uint32_t modifiers) { return false; } 35 getName()36 SkString getName() { return fName; } 37 38 39 protected: 40 SkString fName; 41 }; 42 43 44 #endif 45