make lines reformattable

- completely removed the old textbuffer representation (
  https://github.com/shabble/irssi-docs/wiki/Notes-256-Colour#textbuffer-encoding
  )

- textbuffer-formats is an extra module, so if we unhook the signals it
  should go back to the "old way" of storing pre-rendered tex

- design uses cache, original formats and list of arguments
This commit is contained in:
ailin-nemui 2019-08-13 14:59:30 +02:00
commit f95fc81130
21 changed files with 789 additions and 587 deletions

View file

@ -35,6 +35,7 @@ struct _FORMAT_REC {
int paramtypes[MAX_FORMAT_PARAMS];
};
/* clang-format off */
#define PRINT_FLAG_SET_LINE_START 0x0001
#define PRINT_FLAG_SET_LINE_START_IRSSI 0x0002
#define PRINT_FLAG_UNSET_LINE_START 0x0040
@ -45,6 +46,9 @@ struct _FORMAT_REC {
#define PRINT_FLAG_SET_SERVERTAG 0x0010
#define PRINT_FLAG_UNSET_SERVERTAG 0x0020
#define PRINT_FLAG_FORMAT 0x0080
/* clang-format on */
typedef struct _HILIGHT_REC HILIGHT_REC;
typedef struct _TEXT_DEST_REC {
@ -113,7 +117,7 @@ void format_create_dest_tag(TEXT_DEST_REC *dest, void *server,
const char *server_tag, const char *target,
int level, WINDOW_REC *window);
void format_newline(WINDOW_REC *window);
void format_newline(TEXT_DEST_REC *dest);
/* Return how many characters in `str' must be skipped before `len'
characters of text is skipped. */
@ -151,6 +155,8 @@ void format_send_to_gui(TEXT_DEST_REC *dest, const char *text);
int format_expand_styles(GString *out, const char **format, int *flags);
void format_ext_color(GString *out, int bg, int color);
void format_24bit_color(GString *out, int bg, unsigned int color);
void format_gui_flags(GString *out, int *last_fg, int *last_bg, int *last_flags, int fg, int bg,
int flags);
void formats_init(void);
void formats_deinit(void);