• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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:
~Slide()21     virtual ~Slide() {}
22 
23     virtual SkISize getDimensions() const = 0;
24 
25     virtual void draw(SkCanvas* canvas) = 0;
animate(double nanos)26     virtual bool animate(double nanos) { return false; }
load(SkScalar winWidth,SkScalar winHeight)27     virtual void load(SkScalar winWidth, SkScalar winHeight) {}
resize(SkScalar winWidth,SkScalar winHeight)28     virtual void resize(SkScalar winWidth, SkScalar winHeight) {}
unload()29     virtual void unload() {}
30 
onChar(SkUnichar c)31     virtual bool onChar(SkUnichar c) { return false; }
onMouse(SkScalar x,SkScalar y,InputState state,ModifierKey modifiers)32     virtual bool onMouse(SkScalar x, SkScalar y, InputState state,
33                          ModifierKey modifiers) { return false; }
34 
onGetControls(SkMetaData *)35     virtual bool onGetControls(SkMetaData*) { return false; }
onSetControls(const SkMetaData &)36     virtual void onSetControls(const SkMetaData&) {}
37 
getName()38     SkString getName() { return fName; }
39 
40 
41 protected:
42     SkString    fName;
43 };
44 
45 
46 #endif
47