fixed interface, reorganized to put all of class declaration and implementation in cpp file
This commit is contained in:
parent
c5da8561fe
commit
395b10f31b
@ -7,6 +7,21 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#include "RectSaver.hpp"
|
#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) {
|
void RectSaver::setup(cairo_t* context, const cairo_rectangle_t& rect) {
|
||||||
ScreensaverPlugin::setup(context, rect);
|
ScreensaverPlugin::setup(context, rect);
|
||||||
|
@ -9,16 +9,10 @@
|
|||||||
#ifndef _RectSaver_H_
|
#ifndef _RectSaver_H_
|
||||||
#define _RectSaver_H_
|
#define _RectSaver_H_
|
||||||
|
|
||||||
#include "ScreensaverPlugin.hpp"
|
class ScreensaverPlugin;
|
||||||
|
|
||||||
class RectSaver : public ScreensaverPlugin {
|
extern "C" {
|
||||||
public:
|
ScreensaverPlugin* create_instance();
|
||||||
RectSaver() = default;
|
}
|
||||||
~RectSaver() = default;
|
|
||||||
|
|
||||||
void setup(cairo_t* context, const cairo_rectangle_t& rect) override;
|
|
||||||
void draw_frame() override;
|
|
||||||
int fps() const override;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // _RectSaver_H_
|
#endif // _RectSaver_H_
|
||||||
|
Loading…
x
Reference in New Issue
Block a user