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 "include/core/SkRefCnt.h" 12 #include "include/core/SkSize.h" 13 #include "include/core/SkString.h" 14 #include "tools/sk_app/Window.h" 15 16 class SkCanvas; 17 class SkMetaData; 18 19 class Slide : public SkRefCnt { 20 public: 21 virtual SkISize getDimensions() const = 0; 22 gpuTeardown()23 virtual void gpuTeardown() { } 24 virtual void draw(SkCanvas* canvas) = 0; animate(double nanos)25 virtual bool animate(double nanos) { return false; } load(SkScalar winWidth,SkScalar winHeight)26 virtual void load(SkScalar winWidth, SkScalar winHeight) {} resize(SkScalar winWidth,SkScalar winHeight)27 virtual void resize(SkScalar winWidth, SkScalar winHeight) {} unload()28 virtual void unload() {} 29 onChar(SkUnichar c)30 virtual bool onChar(SkUnichar c) { return false; } onMouse(SkScalar x,SkScalar y,skui::InputState state,skui::ModifierKey modifiers)31 virtual bool onMouse(SkScalar x, SkScalar y, skui::InputState state, 32 skui::ModifierKey modifiers) { return false; } 33 onGetControls(SkMetaData *)34 virtual bool onGetControls(SkMetaData*) { return false; } onSetControls(const SkMetaData &)35 virtual void onSetControls(const SkMetaData&) {} 36 getName()37 const SkString& getName() { return fName; } 38 39 protected: 40 SkString fName; 41 }; 42 43 44 #endif 45