47 lines
1.3 KiB
C
47 lines
1.3 KiB
C
#ifndef __VHEX_DISPLAY_TEXT__
|
|
# define __VHEX_DISPLAY_TEXT__
|
|
|
|
#include <vhex/defs/types.h>
|
|
#include <vhex/display/types.h>
|
|
|
|
/* Alignment settings for dtext_opt() and dprint_opt(). Combining a vertical
|
|
and a horizontal alignment option specifies where a given point (x,y) should
|
|
be relative to the rendered string. */
|
|
enum {
|
|
/* Horizontal settings: default in dtext() is DTEXT_LEFT */
|
|
DTEXT_LEFT = 0,
|
|
DTEXT_CENTER = 1,
|
|
DTEXT_RIGHT = 2,
|
|
/* Vertical settings: default in dtext() is DTEXT_TOP */
|
|
DTEXT_TOP = 0,
|
|
DTEXT_MIDDLE = 1,
|
|
DTEXT_BOTTOM = 2,
|
|
};
|
|
|
|
/* dtext_opt(): Display a string of text */
|
|
extern did_t dtext_opt(
|
|
int x, int y,
|
|
int fg, int bg,
|
|
int halign, int valign,
|
|
char const * const str, int size
|
|
);
|
|
|
|
/* dtext() : display raw text */
|
|
extern did_t dtext(int x, int y, int fg, char const * const text);
|
|
|
|
/* dprint_opt(): Display a formated string */
|
|
extern did_t dprint_opt(
|
|
int x, int y,
|
|
int fg, int bg,
|
|
int halign, int valign,
|
|
char const * const str, ...
|
|
);
|
|
|
|
/* dprint() : display formated text */
|
|
extern did_t dprint(int x, int y, int fg, char const * const text, ...);
|
|
|
|
/* dnsize(): Get the width and height of rendered text for the n first char */
|
|
extern int dtext_geometry(char const * const str, int *n, size_t *w, size_t *h);
|
|
|
|
#endif /* __VHEX_DISPLAY_TEXT__ */
|