2016-04-08 14:24:09 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef Slide_DEFINED
|
|
|
|
#define Slide_DEFINED
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkRefCnt.h"
|
|
|
|
#include "include/core/SkSize.h"
|
|
|
|
#include "include/core/SkString.h"
|
|
|
|
#include "tools/sk_app/Window.h"
|
2016-04-08 14:24:09 +00:00
|
|
|
|
|
|
|
class SkCanvas;
|
2018-05-15 14:09:52 +00:00
|
|
|
class SkMetaData;
|
2016-04-08 14:24:09 +00:00
|
|
|
|
|
|
|
class Slide : public SkRefCnt {
|
|
|
|
public:
|
2018-09-04 22:35:20 +00:00
|
|
|
virtual SkISize getDimensions() const = 0;
|
2016-04-21 14:59:44 +00:00
|
|
|
|
2020-06-26 14:10:49 +00:00
|
|
|
virtual void gpuTeardown() { }
|
2016-04-08 14:24:09 +00:00
|
|
|
virtual void draw(SkCanvas* canvas) = 0;
|
2019-07-11 20:32:53 +00:00
|
|
|
virtual bool animate(double nanos) { return false; }
|
2016-06-16 16:52:35 +00:00
|
|
|
virtual void load(SkScalar winWidth, SkScalar winHeight) {}
|
2018-08-09 19:06:19 +00:00
|
|
|
virtual void resize(SkScalar winWidth, SkScalar winHeight) {}
|
2016-04-08 19:51:45 +00:00
|
|
|
virtual void unload() {}
|
|
|
|
|
2017-02-14 20:16:46 +00:00
|
|
|
virtual bool onChar(SkUnichar c) { return false; }
|
2019-08-29 14:39:22 +00:00
|
|
|
virtual bool onMouse(SkScalar x, SkScalar y, skui::InputState state,
|
|
|
|
skui::ModifierKey modifiers) { return false; }
|
2017-02-14 20:16:46 +00:00
|
|
|
|
2018-05-15 14:09:52 +00:00
|
|
|
virtual bool onGetControls(SkMetaData*) { return false; }
|
|
|
|
virtual void onSetControls(const SkMetaData&) {}
|
|
|
|
|
2020-07-28 17:07:29 +00:00
|
|
|
const SkString& getName() { return fName; }
|
2016-04-08 14:24:09 +00:00
|
|
|
|
2017-11-02 13:46:49 +00:00
|
|
|
|
2016-04-08 14:24:09 +00:00
|
|
|
protected:
|
|
|
|
SkString fName;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|