From 9804b09fb1c258598085dc808ead1c3358f59d1d Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Wed, 28 Oct 2020 17:59:18 +0100 Subject: [PATCH] new interface with less pure virtual methods --- ScreensaverPlugin.cpp | 5 +++++ ScreensaverPlugin.hpp | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ScreensaverPlugin.cpp b/ScreensaverPlugin.cpp index 73afeb6..3b6ad4b 100644 --- a/ScreensaverPlugin.cpp +++ b/ScreensaverPlugin.cpp @@ -11,6 +11,11 @@ void ScreensaverPlugin::setup(cairo_t* context, const cairo_rectangle_t& rect) { _c = context; _r = rect; + make_black(); +} + +int ScreensaverPlugin::fps() const { + return 30; } void ScreensaverPlugin::make_black() { diff --git a/ScreensaverPlugin.hpp b/ScreensaverPlugin.hpp index d7e61ab..e1a0099 100644 --- a/ScreensaverPlugin.hpp +++ b/ScreensaverPlugin.hpp @@ -17,9 +17,10 @@ class ScreensaverPlugin { 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 int fps() const = 0; protected: cairo_t* _c {nullptr};