renovate/configure
main
master
f/handleHelp-varargs
wip/refactor-focus
f/clang-format-14
hardware/ploopy
examples/factory-firmware
f/driver/keyboardiohid
tmp/zagdul
jesse/space-cadet
jesse/wip/gd32-win
macros/rearchitecture
wip/rcm-stm32
f/keyboardio-model-100
charshift/configuration
pointing-device
f/samd-testbed
f/automatic-build-nightly
f/driver/keyboardiohid-orig
f/keymap-cache-redesign
tmp/parallel-cli
tmp/arduino-cli-pre-rebase
pr_host_keymap
f/testing-event-queue
testing
epan/testing/main
epan/testing/issue-840
epan/testing/readable
epan/build/justlib
epan/build/cmake
epan/testing/hello-simulator
device/normcore
atreus2/example-layout
v1.99.6
keyboardio-m100-MP-1
keyboardio-m100-DVT-3
keyboardio-m100-DVT-2
v1.99.5
v1.99.4
v1.99.3
v1.99.2
v1.99.1
v1.99.0
v1.98.0
v1.97.0
v1.94.0
v1.93.0
v1.92.0
v1.91.0
driver/bootloader-pre-rebase
shipped-model00-xmas
work-tip
${ noResults }
1 Commits (568355b8a56f9b43abf266f9b9b3d69f7f99411a)
Author | SHA1 | Message | Date |
---|---|---|---|
noseglasses | 8130dfdf1d |
Major redesign of the plugin and hooking interface
With this redesign, we introduce a new way to create plugins, which is easier to extend with new hook points, provides a better interface, uses less memory, less program space, and is a tiny bit faster too. It all begins with `kaleidoscope::Plugin` being the base class, which provides the hook methods plugins can implement. Plugins should be declared with `KALEIDOSCOPE_INIT_PLUGINS` instead of `Kaleidoscope.use()`. Behind this macro is a bit of magic (see the in-code documentation) that allows us to unroll the hook method calls, avoid vtables, and so on. It creates an override for `kaleidoscope::Hooks::*` methods, each of which will call the respective methods of each initialized plugin. With the new API come new names: all of the methods plugins can implement received new, more descriptive names that all follow a similar pattern. The old (dubbed V1) API still remains in place, although deprecated. One can turn it off by setting the `KALEIDOSCOPE_ENABLE_V1_PLUGIN_API` define to zero, while compiling the firmware. This work is based on #276, written by @noseglasses. @obra and @algernon did some cleaning up and applied a little naming treatment. Signed-off-by: noseglasses <shinynoseglasses@gmail.com> Signed-off-by: Jesse Vincent <jesse@keyboard.io> Signed-off-by: Gergely Nagy <algernon@keyboard.io> |
7 years ago |