Unicode, Unicodemap and UCIS refactor (#21659)
This commit is contained in:
parent
95681b8ff4
commit
70e34e491c
34 changed files with 1196 additions and 386 deletions
|
@ -18,48 +18,6 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "action.h"
|
||||
|
||||
#ifndef UCIS_MAX_SYMBOL_LENGTH
|
||||
# define UCIS_MAX_SYMBOL_LENGTH 32
|
||||
#endif
|
||||
#ifndef UCIS_MAX_CODE_POINTS
|
||||
# define UCIS_MAX_CODE_POINTS 3
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
char * symbol;
|
||||
uint32_t code_points[UCIS_MAX_CODE_POINTS];
|
||||
} ucis_symbol_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t count;
|
||||
uint16_t codes[UCIS_MAX_SYMBOL_LENGTH];
|
||||
bool in_progress : 1;
|
||||
} ucis_state_t;
|
||||
|
||||
extern ucis_state_t ucis_state;
|
||||
|
||||
// clang-format off
|
||||
|
||||
#define UCIS_TABLE(...) \
|
||||
{ \
|
||||
__VA_ARGS__, \
|
||||
{ NULL, {} } \
|
||||
}
|
||||
#define UCIS_SYM(name, ...) \
|
||||
{ name, {__VA_ARGS__} }
|
||||
|
||||
// clang-format on
|
||||
|
||||
extern const ucis_symbol_t ucis_symbol_table[];
|
||||
|
||||
void ucis_start(void);
|
||||
void ucis_start_user(void);
|
||||
void ucis_symbol_fallback(void);
|
||||
void ucis_success(uint8_t symbol_index);
|
||||
|
||||
void register_ucis(const uint32_t *code_points);
|
||||
|
||||
bool process_ucis(uint16_t keycode, keyrecord_t *record);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue