process_keycode: remove direct quantum.h includes (#21486)

This commit is contained in:
Ryan 2023-07-11 17:07:24 +10:00 committed by GitHub
parent 39a97d2ee4
commit eee0384167
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
46 changed files with 257 additions and 155 deletions

View File

@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdint.h> #include <stdint.h>
#include "keyboard.h" #include "keyboard.h"
#include "action.h" #include "action.h"
#include "bitwise.h"
#ifdef DYNAMIC_KEYMAP_ENABLE #ifdef DYNAMIC_KEYMAP_ENABLE
# ifndef DYNAMIC_KEYMAP_LAYER_COUNT # ifndef DYNAMIC_KEYMAP_LAYER_COUNT

View File

@ -5,6 +5,10 @@
#include "usb_descriptor.h" #include "usb_descriptor.h"
#include "process_midi.h" #include "process_midi.h"
#ifdef AUDIO_ENABLE
# include "audio.h"
#endif
/******************************************************************************* /*******************************************************************************
* MIDI * MIDI
******************************************************************************/ ******************************************************************************/

View File

@ -1,5 +1,9 @@
#pragma once #pragma once
#include <stdint.h>
#include <stdbool.h>
#include "action.h"
float compute_freq_for_midi_note(uint8_t note); float compute_freq_for_midi_note(uint8_t note);
bool process_audio(uint16_t keycode, keyrecord_t *record); bool process_audio(uint16_t keycode, keyrecord_t *record);

View File

@ -14,10 +14,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifdef AUTO_SHIFT_ENABLE
# include <stdbool.h>
#include "process_auto_shift.h" #include "process_auto_shift.h"
#include "quantum.h"
#include "action_util.h"
#include "timer.h"
#include "keycodes.h"
#ifndef AUTO_SHIFT_DISABLED_AT_STARTUP #ifndef AUTO_SHIFT_DISABLED_AT_STARTUP
# define AUTO_SHIFT_STARTUP_STATE true /* enabled */ # define AUTO_SHIFT_STARTUP_STATE true /* enabled */
@ -494,5 +495,3 @@ void retroshift_swap_times(void) {
} }
} }
#endif #endif
#endif

View File

@ -16,7 +16,11 @@
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include <stdbool.h>
#include "action.h"
#include "keyboard.h"
#include "keycodes.h"
#ifndef AUTO_SHIFT_TIMEOUT #ifndef AUTO_SHIFT_TIMEOUT
# define AUTO_SHIFT_TIMEOUT 175 # define AUTO_SHIFT_TIMEOUT 175

View File

@ -6,7 +6,11 @@
#include "process_autocorrect.h" #include "process_autocorrect.h"
#include <string.h> #include <string.h>
#include "keycodes.h"
#include "quantum_keycodes.h"
#include "keycode_config.h" #include "keycode_config.h"
#include "send_string.h"
#include "action_util.h"
#if __has_include("autocorrect_data.h") #if __has_include("autocorrect_data.h")
# include "autocorrect_data.h" # include "autocorrect_data.h"

View File

@ -6,7 +6,9 @@
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include <stdbool.h>
#include "action.h"
bool process_autocorrect(uint16_t keycode, keyrecord_t *record); bool process_autocorrect(uint16_t keycode, keyrecord_t *record);
bool process_autocorrect_user(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods); bool process_autocorrect_user(uint16_t *keycode, keyrecord_t *record, uint8_t *typo_buffer_size, uint8_t *mods);

View File

@ -16,6 +16,8 @@
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include <stdbool.h>
#include "action.h"
bool process_backlight(uint16_t keycode, keyrecord_t *record); bool process_backlight(uint16_t keycode, keyrecord_t *record);

View File

@ -13,6 +13,14 @@
// limitations under the License. // limitations under the License.
#include "process_caps_word.h" #include "process_caps_word.h"
#include "process_auto_shift.h"
#include "caps_word.h"
#include "keycodes.h"
#include "quantum_keycodes.h"
#include "modifiers.h"
#include "timer.h"
#include "action_tapping.h"
#include "action_util.h"
#ifdef CAPS_WORD_INVERT_ON_SHIFT #ifdef CAPS_WORD_INVERT_ON_SHIFT
static uint8_t held_mods = 0; static uint8_t held_mods = 0;

View File

@ -14,8 +14,9 @@
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include "caps_word.h" #include <stdbool.h>
#include "action.h"
/** /**
* @brief Process handler for Caps Word feature. * @brief Process handler for Caps Word feature.

View File

@ -1,5 +1,9 @@
#pragma once #pragma once
#include <stdint.h>
#include <stdbool.h>
#include "action.h"
void clicky_play(void); void clicky_play(void);
bool process_clicky(uint16_t keycode, keyrecord_t *record); bool process_clicky(uint16_t keycode, keyrecord_t *record);

View File

@ -14,11 +14,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "keymap_common.h"
#include "print.h"
#include "process_combo.h" #include "process_combo.h"
#include <stddef.h>
#include "process_auto_shift.h"
#include "caps_word.h"
#include "timer.h"
#include "keyboard.h"
#include "keymap_common.h"
#include "action_layer.h"
#include "action_tapping.h" #include "action_tapping.h"
#include "action.h" #include "action_util.h"
#include "keymap_introspection.h" #include "keymap_introspection.h"
__attribute__((weak)) void process_combo_event(uint16_t combo_index, bool pressed) {} __attribute__((weak)) void process_combo_event(uint16_t combo_index, bool pressed) {}

View File

@ -16,9 +16,11 @@
#pragma once #pragma once
#include "progmem.h"
#include "quantum.h"
#include <stdint.h> #include <stdint.h>
#include <stdbool.h>
#include "action.h"
#include "keycodes.h"
#include "quantum_keycodes.h"
#ifdef EXTRA_SHORT_COMBOS #ifdef EXTRA_SHORT_COMBOS
# define MAX_COMBO_LENGTH 6 # define MAX_COMBO_LENGTH 6

View File

@ -17,6 +17,15 @@
/* Author: Wojciech Siewierski < wojciech dot siewierski at onet dot pl > */ /* Author: Wojciech Siewierski < wojciech dot siewierski at onet dot pl > */
#include "process_dynamic_macro.h" #include "process_dynamic_macro.h"
#include <stddef.h>
#include "action_layer.h"
#include "keycodes.h"
#include "debug.h"
#include "wait.h"
#ifdef BACKLIGHT_ENABLE
# include "backlight.h"
#endif
// default feedback method // default feedback method
void dynamic_macro_led_blink(void) { void dynamic_macro_led_blink(void) {

View File

@ -18,7 +18,9 @@
/* Author: Wojciech Siewierski < wojciech dot siewierski at onet dot pl > */ /* Author: Wojciech Siewierski < wojciech dot siewierski at onet dot pl > */
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include <stdbool.h>
#include "action.h"
/* May be overridden with a custom value. Be aware that the effective /* May be overridden with a custom value. Be aware that the effective
* macro length is half of this value: each keypress is recorded twice * macro length is half of this value: each keypress is recorded twice

View File

@ -14,8 +14,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "quantum.h"
#include "process_dynamic_tapping_term.h" #include "process_dynamic_tapping_term.h"
#include "quantum.h"
#include "keycodes.h"
#include "send_string.h"
#ifndef DYNAMIC_TAPPING_TERM_INCREMENT #ifndef DYNAMIC_TAPPING_TERM_INCREMENT
# define DYNAMIC_TAPPING_TERM_INCREMENT 5 # define DYNAMIC_TAPPING_TERM_INCREMENT 5

View File

@ -16,6 +16,7 @@
#pragma once #pragma once
#include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "action.h" #include "action.h"

View File

@ -14,6 +14,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "process_grave_esc.h" #include "process_grave_esc.h"
#include "keycodes.h"
#include "modifiers.h"
#include "action_util.h"
/* true if the last press of QK_GRAVE_ESCAPE was shifted (i.e. GUI or SHIFT were pressed), false otherwise. /* true if the last press of QK_GRAVE_ESCAPE was shifted (i.e. GUI or SHIFT were pressed), false otherwise.
* Used to ensure that the correct keycode is released if the key is released. * Used to ensure that the correct keycode is released if the key is released.

View File

@ -15,6 +15,8 @@
*/ */
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include <stdbool.h>
#include "action.h"
bool process_grave_esc(uint16_t keycode, keyrecord_t *record); bool process_grave_esc(uint16_t keycode, keyrecord_t *record);

View File

@ -15,6 +15,7 @@
*/ */
#pragma once #pragma once
#include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "action.h" #include "action.h"

View File

@ -17,6 +17,7 @@
#pragma once #pragma once
#include <stdint.h> #include <stdint.h>
#include "quantum.h" #include <stdbool.h>
#include "action.h"
bool process_joystick(uint16_t keycode, keyrecord_t *record); bool process_joystick(uint16_t keycode, keyrecord_t *record);

View File

@ -16,7 +16,9 @@
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include <stdbool.h>
#include "action.h"
void cancel_key_lock(void); void cancel_key_lock(void);
bool process_key_lock(uint16_t *keycode, keyrecord_t *record); bool process_key_lock(uint16_t *keycode, keyrecord_t *record);

View File

@ -15,12 +15,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "quantum.h" #include "process_key_override.h"
#include "report.h" #include "report.h"
#include "timer.h" #include "timer.h"
#include "process_key_override.h" #include "debug.h"
#include <debug.h>
#ifndef KEY_OVERRIDE_REPEAT_DELAY #ifndef KEY_OVERRIDE_REPEAT_DELAY
# define KEY_OVERRIDE_REPEAT_DELAY 500 # define KEY_OVERRIDE_REPEAT_DELAY 500

View File

@ -18,9 +18,8 @@
#pragma once #pragma once
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include "action.h"
#include "action_layer.h" #include "action_layer.h"
/** /**

View File

@ -16,6 +16,7 @@
#include "process_leader.h" #include "process_leader.h"
#include "leader.h" #include "leader.h"
#include "quantum_keycodes.h"
bool process_leader(uint16_t keycode, keyrecord_t *record) { bool process_leader(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) { if (record->event.pressed) {

View File

@ -16,6 +16,8 @@
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include <stdbool.h>
#include "action.h"
bool process_leader(uint16_t keycode, keyrecord_t *record); bool process_leader(uint16_t keycode, keyrecord_t *record);

View File

@ -14,8 +14,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "process_magic.h" #include "process_magic.h"
#include "keycode_config.h"
#include "keycodes.h"
#include "eeconfig.h"
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
# include "audio.h"
# ifndef AG_NORM_SONG # ifndef AG_NORM_SONG
# define AG_NORM_SONG SONG(AG_NORM_SOUND) # define AG_NORM_SONG SONG(AG_NORM_SOUND)
# endif # endif

View File

@ -15,6 +15,8 @@
*/ */
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include <stdbool.h>
#include "action.h"
bool process_magic(uint16_t keycode, keyrecord_t *record); bool process_magic(uint16_t keycode, keyrecord_t *record);

View File

@ -15,10 +15,11 @@
*/ */
#include "process_midi.h" #include "process_midi.h"
#ifdef MIDI_ENABLE
#include <LUFA/Drivers/USB/USB.h> #include <LUFA/Drivers/USB/USB.h>
#include "midi.h" #include "midi.h"
#include "qmk_midi.h" #include "qmk_midi.h"
#include "timer.h"
#include "debug.h"
#ifdef MIDI_BASIC #ifdef MIDI_BASIC
@ -37,9 +38,6 @@ void process_midi_all_notes_off(void) {
#endif // MIDI_BASIC #endif // MIDI_BASIC
#ifdef MIDI_ADVANCED #ifdef MIDI_ADVANCED
# include "timer.h"
static uint8_t tone_status[2][MIDI_TONE_COUNT]; static uint8_t tone_status[2][MIDI_TONE_COUNT];
static uint8_t midi_modulation; static uint8_t midi_modulation;
@ -272,5 +270,3 @@ void midi_task(void) {
} }
#endif #endif
} }
#endif // MIDI_ENABLE

View File

@ -16,7 +16,10 @@
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include <stdbool.h>
#include "action.h"
#include "quantum_keycodes.h"
#ifdef MIDI_ENABLE #ifdef MIDI_ENABLE

View File

@ -14,8 +14,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "process_music.h" #include "process_music.h"
#include "timer.h"
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
# include "audio.h"
# include "process_audio.h" # include "process_audio.h"
#endif #endif
#if defined(MIDI_ENABLE) && defined(MIDI_BASIC) #if defined(MIDI_ENABLE) && defined(MIDI_BASIC)

View File

@ -16,7 +16,9 @@
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include <stdbool.h>
#include "action.h"
#if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC)) #if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))

View File

@ -18,6 +18,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#pragma once #pragma once
#include <stdint.h> #include <stdint.h>
#include "quantum.h" #include <stdbool.h>
#include "action.h"
bool process_programmable_button(uint16_t keycode, keyrecord_t *record); bool process_programmable_button(uint16_t keycode, keyrecord_t *record);

View File

@ -13,6 +13,10 @@
// limitations under the License. // limitations under the License.
#include "process_repeat_key.h" #include "process_repeat_key.h"
#include "repeat_key.h"
#include "keycodes.h"
#include "quantum_keycodes.h"
#include "action_util.h"
// Default implementation of remember_last_key_user(). // Default implementation of remember_last_key_user().
__attribute__((weak)) bool remember_last_key_user(uint16_t keycode, keyrecord_t* record, uint8_t* remembered_mods) { __attribute__((weak)) bool remember_last_key_user(uint16_t keycode, keyrecord_t* record, uint8_t* remembered_mods) {

View File

@ -14,7 +14,9 @@
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include <stdbool.h>
#include "action.h"
/** /**
* @brief Process handler for remembering the last key. * @brief Process handler for remembering the last key.

View File

@ -14,6 +14,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "process_rgb.h" #include "process_rgb.h"
#include "action_util.h"
#ifdef RGB_MATRIX_ENABLE
# include "rgb_matrix.h"
#endif
#ifdef RGBLIGHT_ENABLE
# include "rgblight.h"
#endif
typedef void (*rgb_func_pointer)(void); typedef void (*rgb_func_pointer)(void);

View File

@ -15,6 +15,8 @@
*/ */
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include <stdbool.h>
#include "action.h"
bool process_rgb(const uint16_t keycode, const keyrecord_t *record); bool process_rgb(const uint16_t keycode, const keyrecord_t *record);

View File

@ -3,6 +3,7 @@
#pragma once #pragma once
#include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include "action.h" #include "action.h"

View File

@ -16,6 +16,8 @@
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include <stdbool.h>
#include "action.h"
bool process_sequencer(uint16_t keycode, keyrecord_t *record); bool process_sequencer(uint16_t keycode, keyrecord_t *record);

View File

@ -14,6 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "process_space_cadet.h" #include "process_space_cadet.h"
#include "keycodes.h"
#include "timer.h"
#include "action_tapping.h" #include "action_tapping.h"
// ********** OBSOLETE DEFINES, STOP USING! (pls?) ********** // ********** OBSOLETE DEFINES, STOP USING! (pls?) **********

View File

@ -15,7 +15,9 @@
*/ */
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include <stdbool.h>
#include "action.h"
void perform_space_cadet(keyrecord_t *record, uint16_t sc_keycode, uint8_t holdMod, uint8_t tapMod, uint8_t keycode); void perform_space_cadet(keyrecord_t *record, uint16_t sc_keycode, uint8_t holdMod, uint8_t tapMod, uint8_t keycode);
bool process_space_cadet(uint16_t keycode, keyrecord_t *record); bool process_space_cadet(uint16_t keycode, keyrecord_t *record);

View File

@ -15,6 +15,7 @@
*/ */
#include "process_steno.h" #include "process_steno.h"
#include "quantum_keycodes.h" #include "quantum_keycodes.h"
#include "eeconfig.h"
#include "keymap_steno.h" #include "keymap_steno.h"
#include <string.h> #include <string.h>
#ifdef VIRTSER_ENABLE #ifdef VIRTSER_ENABLE

View File

@ -16,7 +16,9 @@
#pragma once #pragma once
#include "quantum.h" #include <stdint.h>
#include <stdbool.h>
#include "action.h"
#define BOLT_STROKE_SIZE 4 #define BOLT_STROKE_SIZE 4
#define GEMINI_STROKE_SIZE 6 #define GEMINI_STROKE_SIZE 6

View File

@ -13,7 +13,14 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "process_tap_dance.h"
#include "quantum.h" #include "quantum.h"
#include "action_layer.h"
#include "action_tapping.h"
#include "action_util.h"
#include "timer.h"
#include "wait.h"
static uint16_t active_td; static uint16_t active_td;
static uint16_t last_tap_time; static uint16_t last_tap_time;

View File

@ -16,10 +16,9 @@
#pragma once #pragma once
#ifdef TAP_DANCE_ENABLE #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
# include <inttypes.h> #include "action.h"
typedef struct { typedef struct {
uint16_t interrupting_keycode; uint16_t interrupting_keycode;
@ -92,9 +91,3 @@ void tap_dance_pair_reset(tap_dance_state_t *state, void *user_data);
void tap_dance_dual_role_on_each_tap(tap_dance_state_t *state, void *user_data); void tap_dance_dual_role_on_each_tap(tap_dance_state_t *state, void *user_data);
void tap_dance_dual_role_finished(tap_dance_state_t *state, void *user_data); void tap_dance_dual_role_finished(tap_dance_state_t *state, void *user_data);
void tap_dance_dual_role_reset(tap_dance_state_t *state, void *user_data); void tap_dance_dual_role_reset(tap_dance_state_t *state, void *user_data);
#else
# define TD(n) KC_NO
#endif

View File

@ -3,6 +3,8 @@
#pragma once #pragma once
#include <stdint.h>
#include <stdbool.h>
#include "action.h" #include "action.h"
/** /**