diff --git a/rects/RectSaver.cpp b/rects/RectSaver.cpp index 37ea057..caaabd8 100644 --- a/rects/RectSaver.cpp +++ b/rects/RectSaver.cpp @@ -7,6 +7,21 @@ // #include "RectSaver.hpp" +#include + +class RectSaver : public ScreensaverPlugin { + public: + RectSaver() = default; + ~RectSaver() = default; + + void setup(cairo_t* context, const cairo_rectangle_t& rect) override; + void draw_frame() override; + int fps() const override; +}; + +ScreensaverPlugin* create_instance() { + return new RectSaver; +} void RectSaver::setup(cairo_t* context, const cairo_rectangle_t& rect) { ScreensaverPlugin::setup(context, rect); diff --git a/rects/RectSaver.hpp b/rects/RectSaver.hpp index a3885a8..6012739 100644 --- a/rects/RectSaver.hpp +++ b/rects/RectSaver.hpp @@ -9,16 +9,10 @@ #ifndef _RectSaver_H_ #define _RectSaver_H_ -#include "ScreensaverPlugin.hpp" +class ScreensaverPlugin; -class RectSaver : public ScreensaverPlugin { - public: - RectSaver() = default; - ~RectSaver() = default; - - void setup(cairo_t* context, const cairo_rectangle_t& rect) override; - void draw_frame() override; - int fps() const override; -}; +extern "C" { + ScreensaverPlugin* create_instance(); +} #endif // _RectSaver_H_