From f760431b2b01c3fc34e50b912783dd3929ceb844 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 16 Jun 2020 11:51:17 +0200 Subject: [PATCH] Remove the deprecated row/col-based indexing APIs They were originally scheduled for removal in March, lets drop them now. Signed-off-by: Gergely Nagy --- docs/UPGRADING.md | 16 ++-- src/kaleidoscope/MatrixAddr.h | 7 -- src/kaleidoscope/device/Base.h | 82 ------------------- src/kaleidoscope/event_handlers.h | 32 +------- src/kaleidoscope/hooks.h | 1 - src/kaleidoscope/key_events.cpp | 13 --- src/kaleidoscope/key_events.h | 12 --- src/kaleidoscope/layers.h | 23 ------ src/kaleidoscope/plugin/Colormap.h | 3 - src/kaleidoscope/plugin/EEPROM-Keymap.cpp | 10 --- src/kaleidoscope/plugin/EEPROM-Keymap.h | 7 -- src/kaleidoscope/plugin/FingerPainter.h | 3 - .../plugin/LED-ActiveLayerColor.h | 3 - src/kaleidoscope/plugin/LED-AlphaSquare.h | 28 ------- .../plugin/LED-AlphaSquare/Effect.h | 3 - src/kaleidoscope/plugin/LED-Palette-Theme.h | 3 - src/kaleidoscope/plugin/LEDControl.h | 9 -- src/kaleidoscope/plugin/LEDControl/LED-Off.h | 3 - .../plugin/LEDEffect-BootGreeting.h | 2 - .../plugin/LEDEffect-SolidColor.h | 3 - src/kaleidoscope/plugin/LEDMode.h | 14 ---- src/kaleidoscope/plugin/TapDance.cpp | 6 -- src/kaleidoscope/plugin/TapDance.h | 8 -- 23 files changed, 11 insertions(+), 280 deletions(-) diff --git a/docs/UPGRADING.md b/docs/UPGRADING.md index 2d7575d5..d69566b7 100644 --- a/docs/UPGRADING.md +++ b/docs/UPGRADING.md @@ -19,7 +19,6 @@ If any of this does not make sense to you, or you have trouble updating your .in - [TypingBreaks](#typingbreaks) - [Redial](#redial) + [Deprecated APIs and their replacements](#deprecated-apis-and-their-replacements) - - [Transition to linear indexing](#transition-to-linear-indexing) - [Source code and namespace rearrangement](#source-code-and-namespace-rearrangement) * [Removed APIs](#removed-apis) @@ -487,13 +486,6 @@ Older versions of the plugin required one to set up `Key_Redial` manually, and l ## Deprecated APIs and their replacements -### Transition to linear indexing - -Row/col based indexing was replaced by linear indexing throughout the whole firmware. A compatibility layer of functions was introduced that allows -the firmware to remain backwards compatible, however, these functions are deprecated and will be removed in future versions of the firmware. - -Also a new version of the onKeyswitchEvent-handler has been introduced. The old version is deprecated, and will be removed after **2020-03-15**. - ### Source code and namespace rearrangement With the move towards a monorepo-based source, some headers have moved to a new location, and plenty of plugins moved to a new namespace (`kaleidoscope::plugin`). This means that the old headers, and some old names are deprecated. The old names no longer work. @@ -572,6 +564,14 @@ only to not diverge too much from the Arduino naming style. The deprecated `Kaleidoscope_` class has been removed on **2020-06-16**. +#### Transition to linear indexing + +Row/col based indexing was replaced by linear indexing throughout the whole firmware. A compatibility layer of functions was introduced that allows the firmware to remain backwards compatible, however, these functions are deprecated and will be removed in future versions of the firmware. + +Also a new version of the onKeyswitchEvent-handler has been introduced. + +The deprecated row/col based indexing APIs have been removed on **2020-06-16**. + ### Removed on 2020-01-06 #### EEPROMKeymap mode diff --git a/src/kaleidoscope/MatrixAddr.h b/src/kaleidoscope/MatrixAddr.h index f8012c35..350190fd 100644 --- a/src/kaleidoscope/MatrixAddr.h +++ b/src/kaleidoscope/MatrixAddr.h @@ -252,10 +252,3 @@ bool operator<=(const MatrixAddr1__ & a1, const MatrixAddr2__ & a2) { #endif } // end namespace kaleidoscope - -// Row/col based access functions have been superseded by matrix address -// base access. -// -#define _DEPRECATED_MESSAGE_ROW_COL_FUNC \ - "Row/col based access functions have been deprecated. Please use " \ - "the KeyAddr/KeyAddr based versions instead." diff --git a/src/kaleidoscope/device/Base.h b/src/kaleidoscope/device/Base.h index fb1eb868..295d4631 100644 --- a/src/kaleidoscope/device/Base.h +++ b/src/kaleidoscope/device/Base.h @@ -173,19 +173,6 @@ class Base { void setCrgbAt(KeyAddr key_addr, cRGB color) { setCrgbAt(getLedIndex(key_addr), color); } - /** - * Set the color of a per-key LED at a given row and column. - * - * Setting the color does not need to take effect immediately, it can be - * delayed until @ref syncLeds is called. - * - * @param row is the logical row position of the key. - * @param col is the logical column position of the key. - * @param color is the color to set the LED to. - */ - DEPRECATED(ROW_COL_FUNC) void setCrgbAt(byte row, byte col, cRGB color) { - setCrgbAt(KeyAddr(row, col), color); - } /** * Set the color of a per-key LED at a given LED index. * @@ -229,18 +216,6 @@ class Base { int8_t getLedIndex(KeyAddr key_addr) { return led_driver_.getLedIndex(key_addr.toInt()); } - /** - * Returns the index of the LED at a given row & column. - * - * @param row is the logical row position of the key. - * @param col is the logical column position of the key. - * - * @returns The index of the LED at the given position, or -1 if there are no - * LEDs there. - */ - DEPRECATED(ROW_COL_FUNC) int8_t getLedIndex(uint8_t row, byte col) { - return led_driver_.getLedIndex(KeyAddr(row, col)); - } /** @} */ /** @defgroup kaleidoscope_hardware_matrix Kaleidoscope::Hardware/Matrix @@ -295,18 +270,6 @@ class Base { void maskKey(KeyAddr key_addr) { key_scanner_.maskKey(key_addr); } - /** - * Mask out a key. - * - * Masking a key out means that any other event than a release will be - * ignored until said release. - * - * @param row is the row the key is located at in the matrix. - * @param col is the column the key is located at in the matrix. - */ - DEPRECATED(ROW_COL_FUNC) void maskKey(byte row, byte col) { - key_scanner_.maskKey(KeyAddr(row, col)); - } /** * Unmask a key. * @@ -318,18 +281,6 @@ class Base { void unMaskKey(KeyAddr key_addr) { key_scanner_.unMaskKey(key_addr); } - /** - * Unmask a key. - * - * Remove the mask - if any - for a given key. To be used when the mask - * needs to be removed without the key being released. - * - * @param row is the row the key is located at in the matrix. - * @param col is the column the key is located at in the matrix. - */ - DEPRECATED(ROW_COL_FUNC) void unMaskKey(byte row, byte col) { - key_scanner_.unMaskKey(KeyAddr(row, col)); - } /** * Check whether a key is masked or not. * @@ -340,17 +291,6 @@ class Base { bool isKeyMasked(KeyAddr key_addr) { return key_scanner_.isKeyMasked(key_addr); } - /** - * Check whether a key is masked or not. - * - * @param row is the row the key is located at in the matrix. - * @param col is the column the key is located at in the matrix. - * - * @returns true if the key is masked, false otherwise. - */ - DEPRECATED(ROW_COL_FUNC) bool isKeyMasked(byte row, byte col) { - return key_scanner_.isKeyMasked(KeyAddr(row, col)); - } /** @} */ /** @defgroup kaleidoscope_hardware_reattach Kaleidoscope::Hardware/Attach & Detach @@ -404,17 +344,6 @@ class Base { bool isKeyswitchPressed(KeyAddr key_addr) { return key_scanner_.isKeyswitchPressed(key_addr); } - /** - * Check if a key is pressed at a given position. - * - * @param row is the row the key is located at in the matrix. - * @param col is the column the key is located at in the matrix. - * - * @returns true if the key is pressed, false otherwise. - */ - DEPRECATED(ROW_COL_FUNC) bool isKeyswitchPressed(byte row, byte col) { - return key_scanner_.isKeyswitchPressed(KeyAddr(row, col)); - } /** * Check if a key is pressed at a given position. * @@ -446,17 +375,6 @@ class Base { bool wasKeyswitchPressed(KeyAddr key_addr) { return key_scanner_.wasKeyswitchPressed(key_addr); } - /** - * Check if a key was pressed at a given position on the previous scan - * - * @param row is the row the key is located at in the matrix. - * @param col is the column the key is located at in the matrix. - * - * @returns true if the key was pressed, false otherwise. - */ - DEPRECATED(ROW_COL_FUNC) bool wasKeyswitchPressed(byte row, byte col) { - return key_scanner_.wasKeyswitchPressed(KeyAddr(row, col)); - } /** * Check if a key was pressed at a given position on the previous scan. * diff --git a/src/kaleidoscope/event_handlers.h b/src/kaleidoscope/event_handlers.h index 6b13f4de..911b0727 100644 --- a/src/kaleidoscope/event_handlers.h +++ b/src/kaleidoscope/event_handlers.h @@ -103,15 +103,6 @@ // The list of parameters as they would be passed to a call to the handler. // Parameter names must match the names assigned to the call arguments. -#define _DEPRECATED_MESSAGE_ON_KEYSWITCH_EVENT_HANDLER_V1 \ -"The event handler signature\n" __NL__ \ -"EventHandlerResult onKeyswitchEvent(Key &mappedKey, byte row, byte col, \n" __NL__ \ -" uint8_t keyState)\n" __NL__ \ -"has been deprecated. Please use the new signature\n" __NL__ \ -"EventHandlerResult onKeyswitchEvent(Key &mappedKey, KeyAddr key_addr, \n" __NL__ \ -" uint8_t keyState)\n" __NL__ \ -"instead." - namespace kaleidoscope { // This dummy class can be used as dummy template argument to @@ -138,22 +129,6 @@ class SignatureCheckDummy {}; (),(),(), /* non template */ __NL__ \ (), (), ##__VA_ARGS__) __NL__ \ __NL__ \ - /* DEPRECATED */ __NL__ \ - /* Function called for every non-idle key, every cycle, so it */ __NL__ \ - /* can decide what to do with it. It can modify the key (which is */ __NL__ \ - /* passed by reference for this reason), and decide whether */ __NL__ \ - /* further handles should be tried. If it returns */ __NL__ \ - /* EventHandlerResult::OK, other handlers will also get a chance */ __NL__ \ - /* to react to the event. If it returns anything else, Kaleidoscope */ __NL__ \ - /* will stop processing there. */ __NL__ \ - OPERATION(onKeyswitchEvent, __NL__ \ - 1, __NL__ \ - DEPRECATED(ON_KEYSWITCH_EVENT_HANDLER_V1), __NL__ \ - _ABORTABLE, __NL__ \ - (),(),(), /* non template */ __NL__ \ - (Key &mappedKey, byte row, byte col, uint8_t keyState), __NL__ \ - (mappedKey, row, col, keyState), ##__VA_ARGS__) __NL__ \ - __NL__ \ /* Function called for every non-idle key, every cycle, so it */ __NL__ \ /* can decide what to do with it. It can modify the key (which is */ __NL__ \ /* passed by reference for this reason), and decide whether */ __NL__ \ @@ -162,7 +137,7 @@ class SignatureCheckDummy {}; /* to react to the event. If it returns anything else, Kaleidoscope */ __NL__ \ /* will stop processing there. */ __NL__ \ OPERATION(onKeyswitchEvent, __NL__ \ - 2, __NL__ \ + 1, __NL__ \ _CURRENT_IMPLEMENTATION, __NL__ \ _ABORTABLE, __NL__ \ (),(),(), /* non template */ __NL__ \ @@ -262,10 +237,9 @@ class SignatureCheckDummy {}; OP(beforeEachCycle, 1) __NL__ \ END(beforeEachCycle, 1) __NL__ \ __NL__ \ - START(onKeyswitchEvent, 1, 2) __NL__ \ + START(onKeyswitchEvent, 1) __NL__ \ OP(onKeyswitchEvent, 1) __NL__ \ - OP(onKeyswitchEvent, 2) __NL__ \ - END(onKeyswitchEvent, 1, 2) __NL__ \ + END(onKeyswitchEvent, 1) __NL__ \ __NL__ \ START(onFocusEvent, 1) __NL__ \ OP(onFocusEvent, 1) __NL__ \ diff --git a/src/kaleidoscope/hooks.h b/src/kaleidoscope/hooks.h index 04de8eaa..5d63cddc 100644 --- a/src/kaleidoscope/hooks.h +++ b/src/kaleidoscope/hooks.h @@ -30,7 +30,6 @@ class Key; // in class Hooks. class kaleidoscope_; extern void handleKeyswitchEvent(kaleidoscope::Key mappedKey, KeyAddr key_addr, uint8_t keyState); -DEPRECATED(ROW_COL_FUNC) extern void handleKeyswitchEvent(kaleidoscope::Key mappedKey, byte row, byte col, uint8_t keyState); namespace kaleidoscope { namespace plugin { diff --git a/src/kaleidoscope/key_events.cpp b/src/kaleidoscope/key_events.cpp index 3302f6e9..b9344573 100644 --- a/src/kaleidoscope/key_events.cpp +++ b/src/kaleidoscope/key_events.cpp @@ -123,22 +123,9 @@ void handleKeyswitchEvent(Key mappedKey, KeyAddr key_addr, uint8_t keyState) { // Keypresses with out-of-bounds key_addr start here in the processing chain - // We call both versions of onKeyswitchEvent. This assumes that a plugin - // implements either the old or the new version of the hook. - // The call to that version that is not implemented is optimized out - // by the caller. This is possible as the call would fall back to - // the version of the hook that is implemented in the base class of the - // plugin. This fallback version is an empty inline noop method that - // is simple for the compiler to optimize out. - - // New event handler interface version 2 (key address version) if (kaleidoscope::Hooks::onKeyswitchEvent(mappedKey, key_addr, keyState) != kaleidoscope::EventHandlerResult::OK) return; - // New event handler interface (deprecated version) - if (kaleidoscope::Hooks::onKeyswitchEvent(mappedKey, key_addr.row(), key_addr.col(), keyState) != kaleidoscope::EventHandlerResult::OK) - return; - mappedKey = Layer.eventHandler(mappedKey, key_addr, keyState); if (mappedKey == Key_NoKey) return; diff --git a/src/kaleidoscope/key_events.h b/src/kaleidoscope/key_events.h index d1acdc40..45d7ca8e 100644 --- a/src/kaleidoscope/key_events.h +++ b/src/kaleidoscope/key_events.h @@ -23,15 +23,6 @@ #include "kaleidoscope/keyswitch_state.h" #include "kaleidoscope/KeyAddr.h" - -// Code can use this macro on injected key events to signal that -// the event isn't tied to a specific physical keyswitch -// -// TODO DEPRECATED(ROW_COL_FUNC): Once row/col based key/LED access -// is deprecated, deprecate UNKNOWN_KEYSWITCH_LOCATION as well. -// -#define UNKNOWN_KEYSWITCH_LOCATION 255,255 - // UnknownKeyswitchLocation represents an invalid (as default constructed) // key address. Note: This is not a constexpr as it turned out // that the compiler would instanciate it and store it in RAM if @@ -75,6 +66,3 @@ * injected, and is not a direct result of a keypress, coming from the scanner. */ void handleKeyswitchEvent(Key mappedKey, kaleidoscope::Device::Props::KeyScannerProps::KeyAddr key_addr, uint8_t keyState); -DEPRECATED(ROW_COL_FUNC) inline void handleKeyswitchEvent(Key mappedKey, byte row, byte col, uint8_t keyState) { - handleKeyswitchEvent(mappedKey, KeyAddr(row, col), keyState); -} diff --git a/src/kaleidoscope/layers.h b/src/kaleidoscope/layers.h index 3236cff8..a9047127 100644 --- a/src/kaleidoscope/layers.h +++ b/src/kaleidoscope/layers.h @@ -74,24 +74,13 @@ class Layer_ { static Key lookup(KeyAddr key_addr) { return live_composite_keymap_[key_addr.toInt()]; } - DEPRECATED(ROW_COL_FUNC) static Key lookup(byte row, byte col) { - return live_composite_keymap_[KeyAddr(row, col).toInt()]; - } static Key lookupOnActiveLayer(KeyAddr key_addr) { uint8_t layer = active_layers_[key_addr.toInt()]; return (*getKey)(layer, key_addr); } - DEPRECATED(ROW_COL_FUNC) static Key lookupOnActiveLayer(byte row, byte col) { - KeyAddr key_addr(row, col); - uint8_t layer = active_layers_[key_addr.toInt()]; - return (*getKey)(layer, key_addr); - } static uint8_t lookupActiveLayer(KeyAddr key_addr) { return active_layers_[key_addr.toInt()]; } - DEPRECATED(ROW_COL_FUNC) static uint8_t lookupActiveLayer(byte row, byte col) { - return active_layers_[KeyAddr(row, col).toInt()]; - } static void activate(uint8_t layer); static void deactivate(uint8_t layer); @@ -109,28 +98,16 @@ class Layer_ { } static Key eventHandler(Key mappedKey, KeyAddr key_addr, uint8_t keyState); - DEPRECATED(ROW_COL_FUNC) static Key eventHandler(Key mappedKey, byte row, byte col, uint8_t keyState) { - return eventHandler(mappedKey, KeyAddr(row, col), keyState); - } typedef Key(*GetKeyFunction)(uint8_t layer, KeyAddr key_addr); static GetKeyFunction getKey; static Key getKeyFromPROGMEM(uint8_t layer, KeyAddr key_addr); - DEPRECATED(ROW_COL_FUNC) static Key getKeyFromPROGMEM(uint8_t layer, byte row, byte col) { - return getKeyFromPROGMEM(layer, KeyAddr(row, col)); - } static void updateLiveCompositeKeymap(KeyAddr key_addr, Key mappedKey) { live_composite_keymap_[key_addr.toInt()] = mappedKey; } - DEPRECATED(ROW_COL_FUNC) static void updateLiveCompositeKeymap(byte row, byte col, Key mappedKey) { - updateLiveCompositeKeymap(KeyAddr(row, col), mappedKey); - } static void updateLiveCompositeKeymap(KeyAddr key_addr); - DEPRECATED(ROW_COL_FUNC) static void updateLiveCompositeKeymap(byte row, byte col) { - updateLiveCompositeKeymap(KeyAddr(row, col)); - } static void updateActiveLayers(void); private: diff --git a/src/kaleidoscope/plugin/Colormap.h b/src/kaleidoscope/plugin/Colormap.h index 4259c31d..0ee38399 100644 --- a/src/kaleidoscope/plugin/Colormap.h +++ b/src/kaleidoscope/plugin/Colormap.h @@ -50,9 +50,6 @@ class ColormapEffect : public Plugin, virtual void onActivate(void) final; virtual void refreshAt(KeyAddr key_addr) final; - DEPRECATED(ROW_COL_FUNC) void refreshAt(byte row, byte col) final { - refreshAt(KeyAddr(row, col)); - } private: const ColormapEffect *parent_; diff --git a/src/kaleidoscope/plugin/EEPROM-Keymap.cpp b/src/kaleidoscope/plugin/EEPROM-Keymap.cpp index e55a3f33..5241db53 100644 --- a/src/kaleidoscope/plugin/EEPROM-Keymap.cpp +++ b/src/kaleidoscope/plugin/EEPROM-Keymap.cpp @@ -88,16 +88,6 @@ void EEPROMKeymap::dumpKeymap(uint8_t layers, Key(*getkey)(uint8_t, KeyAddr)) { } } -void EEPROMKeymap::dumpKeymap(uint8_t layers, Key(*getkey)(uint8_t, byte, byte)) { - for (uint8_t layer = 0; layer < layers; layer++) { - for (auto key_addr : KeyAddr::all()) { - Key k = (*getkey)(layer, key_addr.row(), key_addr.col()); - - ::Focus.send(k); - } - } -} - EventHandlerResult EEPROMKeymap::onFocusEvent(const char *command) { if (::Focus.handleHelp(command, PSTR("keymap.custom\nkeymap.default\nkeymap.onlyCustom"))) return EventHandlerResult::OK; diff --git a/src/kaleidoscope/plugin/EEPROM-Keymap.h b/src/kaleidoscope/plugin/EEPROM-Keymap.h index 838c07a6..7447865e 100644 --- a/src/kaleidoscope/plugin/EEPROM-Keymap.h +++ b/src/kaleidoscope/plugin/EEPROM-Keymap.h @@ -41,13 +41,7 @@ class EEPROMKeymap : public kaleidoscope::Plugin { static uint16_t keymap_base(void); static Key getKey(uint8_t layer, KeyAddr key_addr); - DEPRECATED(ROW_COL_FUNC) static Key getKey(uint8_t layer, byte row, byte col) { - return getKey(layer, KeyAddr(row, col)); - } static Key getKeyExtended(uint8_t layer, KeyAddr key_addr); - DEPRECATED(ROW_COL_FUNC) static Key getKeyExtended(uint8_t layer, byte row, byte col) { - return getKeyExtended(layer, KeyAddr(row, col)); - } static void updateKey(uint16_t base_pos, Key key); @@ -59,7 +53,6 @@ class EEPROMKeymap : public kaleidoscope::Plugin { static Key parseKey(void); static void printKey(Key key); static void dumpKeymap(uint8_t layers, Key(*getkey)(uint8_t, KeyAddr)); - DEPRECATED(ROW_COL_FUNC) static void dumpKeymap(uint8_t layers, Key(*getkey)(uint8_t, byte, byte)); }; } } diff --git a/src/kaleidoscope/plugin/FingerPainter.h b/src/kaleidoscope/plugin/FingerPainter.h index 1caf4d03..e8c90bad 100644 --- a/src/kaleidoscope/plugin/FingerPainter.h +++ b/src/kaleidoscope/plugin/FingerPainter.h @@ -39,9 +39,6 @@ class FingerPainter : public LEDMode { protected: void update(void) final; void refreshAt(KeyAddr key_addr) final; - DEPRECATED(ROW_COL_FUNC) void refreshAt(byte row, byte col) final { - refreshAt(KeyAddr(row, col)); - } private: static uint16_t color_base_; diff --git a/src/kaleidoscope/plugin/LED-ActiveLayerColor.h b/src/kaleidoscope/plugin/LED-ActiveLayerColor.h index 0ee80de9..b5363131 100644 --- a/src/kaleidoscope/plugin/LED-ActiveLayerColor.h +++ b/src/kaleidoscope/plugin/LED-ActiveLayerColor.h @@ -45,9 +45,6 @@ class LEDActiveLayerColorEffect : public Plugin, virtual void onActivate(void) final; virtual void refreshAt(KeyAddr key_addr) final; - DEPRECATED(ROW_COL_FUNC) void refreshAt(byte row, byte col) final { - refreshAt(KeyAddr(row, col)); - } private: diff --git a/src/kaleidoscope/plugin/LED-AlphaSquare.h b/src/kaleidoscope/plugin/LED-AlphaSquare.h index 6852b7e1..fbcdedc7 100644 --- a/src/kaleidoscope/plugin/LED-AlphaSquare.h +++ b/src/kaleidoscope/plugin/LED-AlphaSquare.h @@ -39,13 +39,7 @@ class AlphaSquare : public kaleidoscope::Plugin { AlphaSquare(void) {} static void display(Key key, KeyAddr key_addr, cRGB key_color); - DEPRECATED(ROW_COL_FUNC) static void display(Key key, uint8_t row, uint8_t col, cRGB key_color) { - display(key, KeyAddr(row, col), key_color); - } static void display(Key key, KeyAddr key_addr); - DEPRECATED(ROW_COL_FUNC) static void display(Key key, uint8_t row, uint8_t col) { - display(key, KeyAddr(row, col)); - } static void display(Key key) { display(key, KeyAddr(0, 2)); } @@ -54,13 +48,7 @@ class AlphaSquare : public kaleidoscope::Plugin { } static void display(uint16_t symbol, KeyAddr key_addr, cRGB key_color); - DEPRECATED(ROW_COL_FUNC) static void display(uint16_t symbol, uint8_t row, uint8_t col, cRGB key_color) { - display(symbol, KeyAddr(row, col), key_color); - } static void display(uint16_t symbol, KeyAddr key_addr); - DEPRECATED(ROW_COL_FUNC) static void display(uint16_t symbol, uint8_t row, uint8_t col) { - display(symbol, KeyAddr(row, col)); - } static void display(uint16_t symbol) { display(symbol, KeyAddr(0, 2)); } @@ -71,9 +59,6 @@ class AlphaSquare : public kaleidoscope::Plugin { static void clear(Key key, KeyAddr key_addr) { display(key, key_addr, {0, 0, 0}); } - DEPRECATED(ROW_COL_FUNC) static void clear(Key key, uint8_t row, uint8_t col) { - clear(key, KeyAddr(row, col)); - } static void clear(Key key, uint8_t col) { clear(key, KeyAddr(0, col)); } @@ -84,9 +69,6 @@ class AlphaSquare : public kaleidoscope::Plugin { static void clear(uint16_t symbol, KeyAddr key_addr) { display(symbol, key_addr, {0, 0, 0}); } - DEPRECATED(ROW_COL_FUNC) static void clear(uint16_t symbol, uint8_t row, uint8_t col) { - clear(symbol, KeyAddr(row, col)); - } static void clear(uint16_t symbol, uint8_t col) { clear(symbol, KeyAddr(0, col)); } @@ -97,19 +79,9 @@ class AlphaSquare : public kaleidoscope::Plugin { static bool isSymbolPart(Key key, KeyAddr displayLedAddr, KeyAddr key_addr); - DEPRECATED(ROW_COL_FUNC) static bool isSymbolPart(Key key, - uint8_t display_row, uint8_t display_col, - uint8_t row, uint8_t col) { - return isSymbolPart(key, KeyAddr(display_row, display_col), KeyAddr(row, col)); - } static bool isSymbolPart(uint16_t symbol, KeyAddr displayLedAddr, KeyAddr key_addr); - DEPRECATED(ROW_COL_FUNC) static bool isSymbolPart(uint16_t symbol, - uint8_t display_row, uint8_t display_col, - uint8_t row, uint8_t col) { - return isSymbolPart(symbol, KeyAddr(display_row, display_col), KeyAddr(row, col)); - } static cRGB color; }; diff --git a/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.h b/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.h index 2a60507d..73eeae77 100644 --- a/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.h +++ b/src/kaleidoscope/plugin/LED-AlphaSquare/Effect.h @@ -41,9 +41,6 @@ class AlphaSquareEffect : public Plugin, protected: void update(void) final; void refreshAt(KeyAddr key_addr) final; - DEPRECATED(ROW_COL_FUNC) void refreshAt(byte row, byte col) final { - refreshAt(KeyAddr(row, col)); - } private: uint16_t start_time_left_, start_time_right_; diff --git a/src/kaleidoscope/plugin/LED-Palette-Theme.h b/src/kaleidoscope/plugin/LED-Palette-Theme.h index 54f45c45..1d10c993 100644 --- a/src/kaleidoscope/plugin/LED-Palette-Theme.h +++ b/src/kaleidoscope/plugin/LED-Palette-Theme.h @@ -30,9 +30,6 @@ class LEDPaletteTheme : public kaleidoscope::Plugin { static uint16_t reserveThemes(uint8_t max_themes); static void updateHandler(uint16_t theme_base, uint8_t theme); static void refreshAt(uint16_t theme_base, uint8_t theme, KeyAddr key_addr); - DEPRECATED(ROW_COL_FUNC) static void refreshAt(uint16_t theme_base, uint8_t theme, byte row, byte col) { - refreshAt(theme_base, theme, KeyAddr(row, col)); - } static const uint8_t lookupColorIndexAtPosition(uint16_t theme_base, uint16_t position); static const cRGB lookupColorAtPosition(uint16_t theme_base, uint16_t position); diff --git a/src/kaleidoscope/plugin/LEDControl.h b/src/kaleidoscope/plugin/LEDControl.h index 3cf87682..8b59833b 100644 --- a/src/kaleidoscope/plugin/LEDControl.h +++ b/src/kaleidoscope/plugin/LEDControl.h @@ -61,9 +61,6 @@ class LEDControl : public kaleidoscope::Plugin { return static_cast(cur_led_mode_); } - DEPRECATED(ROW_COL_FUNC) static void refreshAt(byte row, byte col) { - refreshAt(KeyAddr(row, col)); - } static void refreshAll() { if (!Runtime.has_leds) @@ -79,14 +76,8 @@ class LEDControl : public kaleidoscope::Plugin { static void setCrgbAt(uint8_t led_index, cRGB crgb); static void setCrgbAt(KeyAddr key_addr, cRGB color); - DEPRECATED(ROW_COL_FUNC) static void setCrgbAt(byte row, byte col, cRGB color) { - setCrgbAt(KeyAddr(row, col), color); - } static cRGB getCrgbAt(uint8_t led_index); static cRGB getCrgbAt(KeyAddr key_addr); - DEPRECATED(ROW_COL_FUNC) static cRGB getCrgbAt(byte row, byte col) { - return getCrgbAt(KeyAddr(row, col)); - } static void syncLeds(void); static void set_all_leds_to(uint8_t r, uint8_t g, uint8_t b); diff --git a/src/kaleidoscope/plugin/LEDControl/LED-Off.h b/src/kaleidoscope/plugin/LEDControl/LED-Off.h index fae240bd..3acfffad 100644 --- a/src/kaleidoscope/plugin/LEDControl/LED-Off.h +++ b/src/kaleidoscope/plugin/LEDControl/LED-Off.h @@ -31,9 +31,6 @@ class LEDOff : public LEDMode { protected: void onActivate(void) final; void refreshAt(KeyAddr key_addr) final; - DEPRECATED(ROW_COL_FUNC) void refreshAt(byte row, byte col) final { - refreshAt(KeyAddr(row, col)); - } }; } } diff --git a/src/kaleidoscope/plugin/LEDEffect-BootGreeting.h b/src/kaleidoscope/plugin/LEDEffect-BootGreeting.h index 562a941c..180d244c 100644 --- a/src/kaleidoscope/plugin/LEDEffect-BootGreeting.h +++ b/src/kaleidoscope/plugin/LEDEffect-BootGreeting.h @@ -25,8 +25,6 @@ class BootGreetingEffect : public kaleidoscope::Plugin { public: BootGreetingEffect(void) {} BootGreetingEffect(KeyAddr key_addr); - DEPRECATED(ROW_COL_FUNC) BootGreetingEffect(byte row, byte col) - : BootGreetingEffect(KeyAddr(row, col)) {} static KeyAddr user_key_addr; static Key search_key; diff --git a/src/kaleidoscope/plugin/LEDEffect-SolidColor.h b/src/kaleidoscope/plugin/LEDEffect-SolidColor.h index 0cfaf374..2678b2fb 100644 --- a/src/kaleidoscope/plugin/LEDEffect-SolidColor.h +++ b/src/kaleidoscope/plugin/LEDEffect-SolidColor.h @@ -43,9 +43,6 @@ class LEDSolidColor : public Plugin, protected: virtual void onActivate(void) final; virtual void refreshAt(KeyAddr key_addr) final; - DEPRECATED(ROW_COL_FUNC) virtual void refreshAt(byte row, byte col) final { - refreshAt(KeyAddr(row, col)); - } private: diff --git a/src/kaleidoscope/plugin/LEDMode.h b/src/kaleidoscope/plugin/LEDMode.h index 1a67e8cb..e8678018 100644 --- a/src/kaleidoscope/plugin/LEDMode.h +++ b/src/kaleidoscope/plugin/LEDMode.h @@ -92,20 +92,6 @@ class LEDMode : public kaleidoscope::Plugin, */ virtual void refreshAt(KeyAddr key_addr) {} - /** Refresh the color of a given key. - * - * If we have another plugin that overrides colors set by the active LED mode - * (either at @onActivate time, or via @ref update), if that plugin wants to - * restore whatever color the mode would set the key color to, this is the - * method it will call. - * - * @param row is the row coordinate of the key to refresh the color of. - * @param col is the column coordinate of the key to refresh the color of. - */ - DEPRECATED(ROW_COL_FUNC) virtual void refreshAt(byte row, byte col) { - refreshAt(KeyAddr(row, col)); - } - public: /** Plugin initialization. diff --git a/src/kaleidoscope/plugin/TapDance.cpp b/src/kaleidoscope/plugin/TapDance.cpp index 5d9ad72c..f844859c 100644 --- a/src/kaleidoscope/plugin/TapDance.cpp +++ b/src/kaleidoscope/plugin/TapDance.cpp @@ -202,14 +202,8 @@ EventHandlerResult TapDance::afterEachCycle() { } } -__attribute__((weak)) void tapDanceAction(uint8_t tap_dance_index, byte row, byte col, uint8_t tap_count, - kaleidoscope::plugin::TapDance::ActionType tap_dance_action) { -} - -// Let the future version be the wrapper to enable backward compatibility. __attribute__((weak)) void tapDanceAction(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count, kaleidoscope::plugin::TapDance::ActionType tap_dance_action) { - tapDanceAction(tap_dance_index, key_addr.row(), key_addr.col(), tap_count, tap_dance_action); } kaleidoscope::plugin::TapDance TapDance; diff --git a/src/kaleidoscope/plugin/TapDance.h b/src/kaleidoscope/plugin/TapDance.h index 3e4592f2..d0e6cb5e 100644 --- a/src/kaleidoscope/plugin/TapDance.h +++ b/src/kaleidoscope/plugin/TapDance.h @@ -75,12 +75,4 @@ class TapDance : public kaleidoscope::Plugin { void tapDanceAction(uint8_t tap_dance_index, KeyAddr key_addr, uint8_t tap_count, kaleidoscope::plugin::TapDance::ActionType tap_dance_action); -// The old version of te tapdance action is DEPRECATED(ROW_COL_FUNC) although this -// cannot be flagged to the user. The weak function is called by the tap dance -// plugin's implementation. That's why the deprecation warning would always -// fire. -// -void tapDanceAction(uint8_t tap_dance_index, byte row, byte col, uint8_t tap_count, - kaleidoscope::plugin::TapDance::ActionType tap_dance_action); - extern kaleidoscope::plugin::TapDance TapDance;