new interface with less pure virtual methods

This commit is contained in:
Bob Polis 2020-10-28 17:59:18 +01:00
parent d0d8e28dd8
commit 9804b09fb1
2 changed files with 8 additions and 2 deletions

View File

@ -11,6 +11,11 @@
void ScreensaverPlugin::setup(cairo_t* context, const cairo_rectangle_t& rect) { void ScreensaverPlugin::setup(cairo_t* context, const cairo_rectangle_t& rect) {
_c = context; _c = context;
_r = rect; _r = rect;
make_black();
}
int ScreensaverPlugin::fps() const {
return 30;
} }
void ScreensaverPlugin::make_black() { void ScreensaverPlugin::make_black() {

View File

@ -17,9 +17,10 @@ class ScreensaverPlugin {
ScreensaverPlugin() = default; ScreensaverPlugin() = default;
virtual ~ScreensaverPlugin() = default; virtual ~ScreensaverPlugin() = default;
virtual void setup(cairo_t* context, const cairo_rectangle_t& rect) = 0; virtual void setup(cairo_t* context, const cairo_rectangle_t& rect);
virtual int fps() const;
virtual void draw_frame() = 0; virtual void draw_frame() = 0;
virtual int fps() const = 0;
protected: protected:
cairo_t* _c {nullptr}; cairo_t* _c {nullptr};