From 90412ee1d51e4930a772af9bcac404fc3437e1ce Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Sat, 13 Oct 2018 12:28:51 +0200 Subject: [PATCH] Rearrange the file layout in preparation of becoming a monorepo Move the documentation to `doc/plugin/FingerPainter.md`, sources under `src/kaleidoscope/plugin/` (appropriately namespaced). This is in preparation of merging plugins into a single monorepo. Signed-off-by: Gergely Nagy --- README.md | 61 +----------------- doc/plugin/FingerPainter.md | 62 +++++++++++++++++++ src/Kaleidoscope-FingerPainter.h | 2 +- .../plugin}/FingerPainter.cpp | 4 +- .../plugin}/FingerPainter.h | 6 +- 5 files changed, 71 insertions(+), 64 deletions(-) create mode 100644 doc/plugin/FingerPainter.md rename src/{Kaleidoscope => kaleidoscope/plugin}/FingerPainter.cpp (97%) rename src/{Kaleidoscope => kaleidoscope/plugin}/FingerPainter.h (93%) diff --git a/README.md b/README.md index 5e5a6e83..367c19d0 100644 --- a/README.md +++ b/README.md @@ -5,63 +5,4 @@ [travis:image]: https://travis-ci.org/keyboardio/Kaleidoscope-FingerPainter.svg?branch=master [travis:status]: https://travis-ci.org/keyboardio/Kaleidoscope-FingerPainter -The `FingerPainter` plugin provides an elaborate `LED` mode, in which one's able -to paint with their fingers: when edit mode is toggled on, keys will - instead -of performing their normal function - cycle through the global palette - as -provided by the [LED-Palette-Theme][plugin:l-p-t] plugin -, one by one for each tap. - -This allows us to edit the theme with the keyboard only, without any special -software (except to toggle edit mode on and off). - -## Using the plugin - -To use the plugin, just include the header, add it to the list of used plugins. - -```c++ -#include -#include -#include -#include -#include -#include - -KALEIDOSCOPE_INIT_PLUGINS(LEDControl, - EEPromSettings, - LEDPaletteTheme, - FingerPainter, - Focus); - -void setup() { - Kaleidoscope.setup(); -} -``` - -## Plugin methods - -The plugin provides the `FingerPainter` object, which provides no public methods. - -## Focus commands - -### `fingerpainter.clear` - -> Clears the canvas, so that one can start a new painting. - -### `fingerpainter.toggle` - -> Toggles the painting mode on and off. - -## Dependencies - -* [Kaleidoscope-EEPROM-Settings](https://github.com/keyboardio/Kaleidoscope-EEPROM-Settings) -* [Kaleidoscope-FocusSerial](https://github.com/keyboardio/Kaleidoscope-FocusSerial) -* [Kaleidoscope-LED-Palette-Theme][plugin:l-p-t] -* [Kaleidoscope-LEDControl](https://github.com/keyboardio/Kaleidoscope-LEDControl) - - [plugin:l-p-t]: https://github.com/keyboardio/Kaleidoscope-LED-Palette-Theme - -## Further reading - -Starting from the [example][plugin:example] is the recommended way of getting -started with the plugin. - - [plugin:example]: https://github.com/keyboardio/Kaleidoscope-FingerPainter/blob/master/examples/FingerPainter/FingerPainter.ino +See [doc/plugin/FingerPainter.md](doc/plugin/FingerPainter.md) for documentation. diff --git a/doc/plugin/FingerPainter.md b/doc/plugin/FingerPainter.md new file mode 100644 index 00000000..e21e2c13 --- /dev/null +++ b/doc/plugin/FingerPainter.md @@ -0,0 +1,62 @@ +# Kaleidoscope-FingerPainter + +The `FingerPainter` plugin provides an elaborate `LED` mode, in which one's able +to paint with their fingers: when edit mode is toggled on, keys will - instead +of performing their normal function - cycle through the global palette - as +provided by the [LED-Palette-Theme][plugin:l-p-t] plugin -, one by one for each tap. + +This allows us to edit the theme with the keyboard only, without any special +software (except to toggle edit mode on and off). + +## Using the plugin + +To use the plugin, just include the header, add it to the list of used plugins. + +```c++ +#include +#include +#include +#include +#include +#include + +KALEIDOSCOPE_INIT_PLUGINS(LEDControl, + EEPromSettings, + LEDPaletteTheme, + FingerPainter, + Focus); + +void setup() { + Kaleidoscope.setup(); +} +``` + +## Plugin methods + +The plugin provides the `FingerPainter` object, which provides no public methods. + +## Focus commands + +### `fingerpainter.clear` + +> Clears the canvas, so that one can start a new painting. + +### `fingerpainter.toggle` + +> Toggles the painting mode on and off. + +## Dependencies + +* [Kaleidoscope-EEPROM-Settings](https://github.com/keyboardio/Kaleidoscope-EEPROM-Settings) +* [Kaleidoscope-FocusSerial](https://github.com/keyboardio/Kaleidoscope-FocusSerial) +* [Kaleidoscope-LED-Palette-Theme][plugin:l-p-t] +* [Kaleidoscope-LEDControl](https://github.com/keyboardio/Kaleidoscope-LEDControl) + + [plugin:l-p-t]: https://github.com/keyboardio/Kaleidoscope-LED-Palette-Theme + +## Further reading + +Starting from the [example][plugin:example] is the recommended way of getting +started with the plugin. + + [plugin:example]: https://github.com/keyboardio/Kaleidoscope-FingerPainter/blob/master/examples/FingerPainter/FingerPainter.ino diff --git a/src/Kaleidoscope-FingerPainter.h b/src/Kaleidoscope-FingerPainter.h index 71ff173e..441fd275 100644 --- a/src/Kaleidoscope-FingerPainter.h +++ b/src/Kaleidoscope-FingerPainter.h @@ -17,4 +17,4 @@ #pragma once -#include +#include diff --git a/src/Kaleidoscope/FingerPainter.cpp b/src/kaleidoscope/plugin/FingerPainter.cpp similarity index 97% rename from src/Kaleidoscope/FingerPainter.cpp rename to src/kaleidoscope/plugin/FingerPainter.cpp index c9d72cea..40d0d27d 100644 --- a/src/Kaleidoscope/FingerPainter.cpp +++ b/src/kaleidoscope/plugin/FingerPainter.cpp @@ -23,6 +23,7 @@ #include namespace kaleidoscope { +namespace plugin { uint16_t FingerPainter::color_base_; bool FingerPainter::edit_mode_; @@ -110,6 +111,7 @@ EventHandlerResult FingerPainter::onFocusEvent(const char *command) { return EventHandlerResult::OK; } +} } -kaleidoscope::FingerPainter FingerPainter; +kaleidoscope::plugin::FingerPainter FingerPainter; diff --git a/src/Kaleidoscope/FingerPainter.h b/src/kaleidoscope/plugin/FingerPainter.h similarity index 93% rename from src/Kaleidoscope/FingerPainter.h rename to src/kaleidoscope/plugin/FingerPainter.h index 78e099ca..e13e58b3 100644 --- a/src/Kaleidoscope/FingerPainter.h +++ b/src/kaleidoscope/plugin/FingerPainter.h @@ -20,6 +20,7 @@ #include namespace kaleidoscope { +namespace plugin { class FingerPainter : public LEDMode { public: FingerPainter(void) {} @@ -38,6 +39,7 @@ class FingerPainter : public LEDMode { static uint16_t color_base_; static bool edit_mode_; }; -}; +} +} -extern kaleidoscope::FingerPainter FingerPainter; +extern kaleidoscope::plugin::FingerPainter FingerPainter;