From 9182537fcfe3a78bd223e0510928bc863898e550 Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 5 Oct 2017 12:37:36 +0200 Subject: [PATCH] Make KaleidoscopePlugin.begin protected by default Make `Kaleidoscope_` a friend class, so that it can access `.begin`. The reason behind this is that `.begin` is an interface towards `Kaleidoscope.use()`, and that function should be the only user. To discourage its use, make it protected. This does not break any existing - and valid - code, but allows us to slowly migrate the plugins to a protected `begin()` method. Fixes #177. Signed-off-by: Gergely Nagy --- src/Kaleidoscope.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Kaleidoscope.h b/src/Kaleidoscope.h index 85ae047c..09fdbe3f 100644 --- a/src/Kaleidoscope.h +++ b/src/Kaleidoscope.h @@ -37,8 +37,11 @@ extern HARDWARE_IMPLEMENTATION KeyboardHardware; #define USE_PLUGINS(plugins...) Kaleidoscope.use(plugins) +class Kaleidoscope_; + class KaleidoscopePlugin { - public: + friend Kaleidoscope_; + protected: virtual void begin(void) = 0; };