mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 03:01:57 +02:00
...
This commit is contained in:
@@ -9,6 +9,30 @@
|
||||
|
||||
#include "data-types.h"
|
||||
|
||||
// CharPropsDeclaration
|
||||
// Uses 23 bits
|
||||
typedef union CharProps {
|
||||
struct {
|
||||
uint8_t shifted_width : 3;
|
||||
uint8_t is_extended_pictographic : 1;
|
||||
uint8_t grapheme_break : 4;
|
||||
uint8_t indic_conjunct_break : 2;
|
||||
uint8_t category : 5;
|
||||
uint8_t is_emoji : 1;
|
||||
uint8_t is_emoji_presentation_base : 1;
|
||||
uint8_t is_invalid : 1;
|
||||
uint8_t is_non_rendered : 1;
|
||||
uint8_t is_symbol : 1;
|
||||
uint8_t is_combining_char : 1;
|
||||
uint8_t is_word_char : 1;
|
||||
uint8_t is_punctuation : 1;
|
||||
};
|
||||
uint32_t val;
|
||||
} CharProps;
|
||||
static_assert(sizeof(CharProps) == sizeof(uint32_t), "Fix the ordering of CharProps");
|
||||
// EndCharPropsDeclaration
|
||||
|
||||
|
||||
// UCBDeclaration
|
||||
typedef enum UnicodeCategory {
|
||||
UC_Cn,
|
||||
@@ -46,29 +70,6 @@ typedef enum UnicodeCategory {
|
||||
// EndUCBDeclaration
|
||||
|
||||
|
||||
// CharPropsDeclaration
|
||||
// Uses 23 bits
|
||||
typedef union CharProps {
|
||||
struct {
|
||||
uint8_t shifted_width : 3;
|
||||
uint8_t is_extended_pictographic : 1;
|
||||
uint8_t grapheme_break : 4;
|
||||
uint8_t indic_conjunct_break : 2;
|
||||
uint8_t category : 5;
|
||||
uint8_t is_emoji : 1;
|
||||
uint8_t is_emoji_presentation_base : 1;
|
||||
uint8_t is_invalid : 1;
|
||||
uint8_t is_non_rendered : 1;
|
||||
uint8_t is_symbol : 1;
|
||||
uint8_t is_combining_char : 1;
|
||||
uint8_t is_word_char : 1;
|
||||
uint8_t is_punctuation : 1;
|
||||
};
|
||||
uint32_t val;
|
||||
} CharProps;
|
||||
static_assert(sizeof(CharProps) == sizeof(uint32_t), "Fix the ordering of CharProps");
|
||||
// EndCharPropsDeclaration
|
||||
|
||||
typedef struct GraphemeSegmentationState {
|
||||
int last_char_prop;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user