|
|
@ -1,6 +1,6 @@
|
|
|
|
/* -*- mode: c++ -*-
|
|
|
|
/* -*- mode: c++ -*-
|
|
|
|
* Kaleidoscope-LED-Palette-Theme -- Palette-based LED theme foundation
|
|
|
|
* Kaleidoscope-LED-Palette-Theme -- Palette-based LED theme foundation
|
|
|
|
* Copyright (C) 2017 Gergely Nagy
|
|
|
|
* Copyright (C) 2017, 2018 Gergely Nagy
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
@ -23,12 +23,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
namespace kaleidoscope {
|
|
|
|
namespace kaleidoscope {
|
|
|
|
|
|
|
|
|
|
|
|
class LEDPaletteTheme : public KaleidoscopePlugin {
|
|
|
|
class LEDPaletteTheme : public kaleidoscope::Plugin {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
LEDPaletteTheme(void) {}
|
|
|
|
LEDPaletteTheme(void) {}
|
|
|
|
|
|
|
|
|
|
|
|
void begin(void) final;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static uint16_t reserveThemes(uint8_t max_themes);
|
|
|
|
static uint16_t reserveThemes(uint8_t max_themes);
|
|
|
|
static void updateHandler(uint16_t theme_base, uint8_t theme);
|
|
|
|
static void updateHandler(uint16_t theme_base, uint8_t theme);
|
|
|
|
static void refreshAt(uint16_t theme_base, uint8_t theme, byte row, byte col);
|
|
|
|
static void refreshAt(uint16_t theme_base, uint8_t theme, byte row, byte col);
|
|
|
@ -47,6 +45,16 @@ class LEDPaletteTheme : public KaleidoscopePlugin {
|
|
|
|
const char *expected_command,
|
|
|
|
const char *expected_command,
|
|
|
|
uint16_t theme_base,
|
|
|
|
uint16_t theme_base,
|
|
|
|
uint8_t max_themes);
|
|
|
|
uint8_t max_themes);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EventHandlerResult onSetup();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if KALEIDOSCOPE_ENABLE_V1_PLUGIN_API
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
void begin() {
|
|
|
|
|
|
|
|
onSetup();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
static uint16_t palette_base_;
|
|
|
|
static uint16_t palette_base_;
|
|
|
|
};
|
|
|
|
};
|
|
|
|