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:
|
|
|
|
virtual ~Slide() {}
|
|
|
|
|
2018-09-04 22:35:20 +00:00
|
|
|
virtual SkISize getDimensions() const = 0;
|
2016-04-21 14:59:44 +00:00
|
|
|
|
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-07-16 13:58:43 +00:00
|
|
|
virtual bool onMouse(SkScalar x, SkScalar y, InputState state,
|
2019-07-08 20:07:57 +00:00
|
|
|
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&) {}
|
|
|
|
|
2016-04-08 14:24:09 +00:00
|
|
|
SkString getName() { return fName; }
|
|
|
|
|
2017-11-02 13:46:49 +00:00
|
|
|
|
2016-04-08 14:24:09 +00:00
|
|
|
protected:
|
|
|
|
SkString fName;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|