fixed interface, reorganized to put all of class declaration and implementation in cpp file

This commit is contained in:
Bob Polis 2020-10-27 17:20:23 +01:00
parent c5da8561fe
commit 395b10f31b
2 changed files with 19 additions and 10 deletions

View File

@ -7,6 +7,21 @@
//
#include "RectSaver.hpp"
#include <libscscreensaver.hpp>
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);

View File

@ -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_