Make SpaceCadet public mode functions inline

Moving these one-liners to the header file lets them be inlined by client code.

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1037/head
Michael Richters 4 years ago
parent b0ea789f28
commit 768c95ae46
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -78,23 +78,6 @@ SpaceCadet::SpaceCadet() {
map = initialmap;
}
// -----------------------------------------------------------------------------
// Function to determine whether SpaceCadet is active (useful for Macros and
// other plugins).
bool SpaceCadet::active() {
return mode_ == Mode::ON;
}
// Function to enable SpaceCadet behavior
void SpaceCadet::enable() {
mode_ = Mode::ON;
}
// Function to disable SpaceCadet behavior
void SpaceCadet::disable() {
mode_ = Mode::OFF;
}
// =============================================================================
// Event handler hook functions

@ -60,9 +60,15 @@ class SpaceCadet : public kaleidoscope::Plugin {
SpaceCadet(void);
// Methods
static void enable(void);
static void disable(void);
static bool active(void);
static void enable() {
mode_ = Mode::ON;
}
static void disable() {
mode_ = Mode::OFF;
}
static bool active() {
return (mode_ == Mode::ON);
}
// Publically accessible variables
static uint16_t time_out; // The global timeout in milliseconds

Loading…
Cancel
Save