Text printing changes. Formats are now optionally saved to each line so

later if you used /format it would change the old lines too. However
the actual line changing doesn't work yet :)


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@836 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-11-12 20:20:05 +00:00 committed by cras
commit d1330fff6d
14 changed files with 515 additions and 391 deletions

View file

@ -4,6 +4,18 @@
#include "themes.h"
#include "windows.h"
#define PRINTFLAG_BOLD 0x01
#define PRINTFLAG_REVERSE 0x02
#define PRINTFLAG_UNDERLINE 0x04
#define PRINTFLAG_BEEP 0x08
#define PRINTFLAG_BLINK 0x10
#define PRINTFLAG_MIRC_COLOR 0x20
#define PRINTFLAG_INDENT 0x40
#define PRINTFLAG_NEWLINE 0x80
#define MAX_FORMAT_PARAMS 10
#define DEFAULT_FORMAT_ARGLIST_SIZE 200
enum {
FORMAT_STRING,
FORMAT_INT,
@ -16,7 +28,7 @@ struct _FORMAT_REC {
char *def;
int params;
int paramtypes[10];
int paramtypes[MAX_FORMAT_PARAMS];
};
typedef struct {
@ -30,11 +42,18 @@ char *format_get_text(const char *module, WINDOW_REC *window,
void *server, const char *target,
int formatnum, ...);
/* good size for buffer is DEFAULT_FORMAT_ARGLIST_SIZE */
void format_read_arglist(va_list va, FORMAT_REC *format,
char **arglist, int arglist_size,
char *buffer, int buffer_size);
char *format_get_text_theme(THEME_REC *theme, const char *module,
TEXT_DEST_REC *dest, int formatnum, ...);
char *format_get_text_theme_args(THEME_REC *theme, const char *module,
TEXT_DEST_REC *dest, int formatnum,
va_list va);
char *format_get_text_theme_charargs(THEME_REC *theme, const char *module,
TEXT_DEST_REC *dest, int formatnum,
char **args);
/* add `linestart' to start of each line in `text'. `text' may contain
multiple lines separated with \n. */
@ -49,6 +68,14 @@ void format_create_dest(TEXT_DEST_REC *dest,
void *server, const char *target,
int level, WINDOW_REC *window);
void format_newline(WINDOW_REC *window);
/* strip all color (etc.) codes from `input'. returns newly allocated string. */
char *strip_codes(const char *input);
/* send a fully parsed text string for GUI to print */
void format_send_to_gui(TEXT_DEST_REC *dest, const char *text);
#define FORMAT_COLOR_NOCHANGE ('0'-1)
#define FORMAT_STYLE_SPECIAL 0x60