Slide.h 1.1 KB

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