diff --git a/main.cpp b/main.cpp index cce3abe..d5869f6 100644 --- a/main.cpp +++ b/main.cpp @@ -96,7 +96,7 @@ int main(int argc, const char * argv[]) { } if (optind == argc) { // here when no file args - saver = sc::plugin::get("rects")(); + saver = sc::plugin::get("Default")(); } for (int i = optind; i < argc; ++i) { try { @@ -134,8 +134,8 @@ int main(int argc, const char * argv[]) { // setup screen saver module if (!saver) { - saver = sc::plugin::get("rects")(); - std::cerr << "screensaver: using standard 'rects' module\n"; + saver = sc::plugin::get("Default")(); + std::cerr << "screensaver: using standard 'Default' module\n"; } main_saver = saver.get(); main_saver->setup(cr, {0, 0, WIDTH, HEIGHT}); diff --git a/modules/Default/Default.cpp b/modules/Default/Default.cpp index ac2e6a0..432a93c 100644 --- a/modules/Default/Default.cpp +++ b/modules/Default/Default.cpp @@ -1,18 +1,18 @@ // -// RectSaver.cpp +// Default.cpp // screensaver // // Created by Bob Polis at 2020-10-26 // Copyright (c) 2020 SwiftCoder. All rights reserved. // -#include "RectSaver.hpp" +#include "Default.hpp" #include -class RectSaver : public ScreensaverPlugin { +class Default : public ScreensaverPlugin { public: - RectSaver() = default; - ~RectSaver() = default; + Default() = default; + ~Default() = default; int fps() const override; void update() override; @@ -20,18 +20,18 @@ class RectSaver : public ScreensaverPlugin { }; ScreensaverPlugin* create_instance() { - return new RectSaver; + return new Default; } -int RectSaver::fps() const { +int Default::fps() const { return 2; } -void RectSaver::update() { +void Default::update() { } -void RectSaver::render() { +void Default::render() { cairo_set_source_rgba(_c, random01(), random01(), random01(), random01()); cairo_rectangle_t rect {random_rect()}; cairo_rectangle(_c, rect.x, rect.y, rect.width, rect.height); diff --git a/modules/Default/Default.hpp b/modules/Default/Default.hpp index 6012739..9e28aa2 100644 --- a/modules/Default/Default.hpp +++ b/modules/Default/Default.hpp @@ -1,13 +1,13 @@ // -// RectSaver.hpp +// Default.hpp // screensaver // // Created by Bob Polis at 2020-10-26 // Copyright (c) 2020 SwiftCoder. All rights reserved. // -#ifndef _RectSaver_H_ -#define _RectSaver_H_ +#ifndef _Default_H_ +#define _Default_H_ class ScreensaverPlugin; @@ -15,4 +15,4 @@ extern "C" { ScreensaverPlugin* create_instance(); } -#endif // _RectSaver_H_ +#endif // _Default_H_