1
0
Fork 0

Unicode, Unicodemap and UCIS refactor (#21659)

This commit is contained in:
Ryan 2023-08-27 13:30:19 +10:00 committed by GitHub
parent 95681b8ff4
commit 70e34e491c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 1196 additions and 386 deletions

View file

@ -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);