Angband
z-textblock.h
Go to the documentation of this file.
1 
19 #ifndef INCLUDED_Z_TEXTBLOCK_H
20 #define INCLUDED_Z_TEXTBLOCK_H
21 
22 #include "z-file.h"
23 
25 typedef struct textblock textblock;
26 
27 
29 void textblock_free(textblock *tb);
30 
31 
32 void textblock_append(textblock *tb, const char *fmt, ...);
33 void textblock_append_c(textblock *tb, byte attr, const char *fmt, ...);
34 void textblock_append_pict(textblock *tb, byte attr, int c);
35 void textblock_append_utf8(textblock *tb, const char *utf8_string);
36 
37 const wchar_t *textblock_text(textblock *tb);
38 const byte *textblock_attrs(textblock *tb);
39 
40 size_t textblock_calculate_lines(textblock *tb, size_t **line_starts,
41  size_t **line_lengths, size_t width);
42 
43 void textblock_to_file(textblock *tb, ang_file *f, int indent, int wrap_at);
44 
45 extern ang_file *text_out_file;
46 extern void (*text_out_hook)(byte a, const char *str);
47 extern int text_out_wrap;
48 extern int text_out_indent;
49 extern int text_out_pad;
50 
51 extern void text_out_to_file(byte attr, const char *str);
52 extern void text_out(const char *fmt, ...);
53 extern void text_out_c(byte a, const char *fmt, ...);
54 extern void text_out_e(const char *fmt, ...);
55 
56 typedef void (*text_writer)(ang_file *f);
57 errr text_lines_to_file(const char *path, text_writer writer);
58 
59 #endif /* INCLUDED_Z_TEXTBLOCK_H */
char ** path
Definition: main.c:147
typedef void(PNGAPI *png_error_ptr) PNGARG((png_structp
void text_out(const char *fmt,...)
Output text to the screen or to a file depending on the selected text_out hook.
Definition: z-textblock.c:508
textblock * textblock_new(void)
Create a new textblock object and return it.
Definition: z-textblock.c:46
Low-level file (and directory) handling.
Definition: z-file.c:261
int text_out_wrap
Hack – Where to wrap the text when using text_out().
Definition: z-textblock.c:367
int errr
ANSI C headers.
Definition: h-basic.h:164
uint8_t byte
Definition: h-basic.h:167
errr text_lines_to_file(const char *path, text_writer writer)
Write a text file from given input.
Definition: z-textblock.c:693
void(* text_writer)(ang_file *f)
Definition: z-textblock.h:56
void(* text_out_hook)(byte a, const char *str)
text_out()
Definition: z-textblock.c:361
void textblock_append_pict(textblock *tb, byte attr, int c)
Add a graphics tile to a text block.
Definition: z-textblock.c:128
int text_out_pad
Hack – Padding after wrapping.
Definition: z-textblock.c:377
void text_out_e(const char *fmt,...)
Output text to the screen or to a file depending on the selected hook.
Definition: z-textblock.c:639
void textblock_free(textblock *tb)
Free a textblock object.
Definition: z-textblock.c:60
const byte * textblock_attrs(textblock *tb)
Return a pointer to the text attrs.
Definition: z-textblock.c:203
void textblock_to_file(textblock *tb, ang_file *f, int indent, int wrap_at)
Output a textblock to file.
Definition: z-textblock.c:323
void text_out_c(byte a, const char *fmt,...)
Output text to the screen (in color) or to a file depending on the selected hook. ...
Definition: z-textblock.c:531
size_t textblock_calculate_lines(textblock *tb, size_t **line_starts, size_t **line_lengths, size_t width)
Given a certain width, split a textblock into wrapped lines of text.
Definition: z-textblock.c:240
void textblock_append_utf8(textblock *tb, const char *utf8_string)
Append a UTF-8 string to the textblock.
Definition: z-textblock.c:148
void textblock_append(textblock *tb, const char *fmt,...)
Add text to a text block, formatted.
Definition: z-textblock.c:168
int text_out_indent
Hack – Indentation for the text when using text_out().
Definition: z-textblock.c:372
const wchar_t * textblock_text(textblock *tb)
Return a pointer to the text inputted thus far.
Definition: z-textblock.c:195
png_infop png_uint_32 * width
Definition: libpng12/png.h:2341
void text_out_to_file(byte attr, const char *str)
Write text to the given file and apply line-wrapping.
Definition: z-textblock.c:399
void textblock_append_c(textblock *tb, byte attr, const char *fmt,...)
Add coloured text to a text block, formatted.
Definition: z-textblock.c:181
Definition: z-textblock.c:33
ang_file * text_out_file
Hack - the destination file for text_out_to_file.
Definition: z-textblock.c:383