Project

General

Profile

Revision 314

some changes in fonts and ent.c

View differences:

font.h
1 1
#ifndef FONT_H_INCLUDED
2 2
#define FONT_H_INCLUDED
3 3

  
4
enum text_valign{
4
struct font;
5
typedef struct font font_t;
6
font_t* (font_ctor)(const char *s);
7
int     (font_dtor)(font_t *p);
8

  
9
int (font_init)(void);
10
const font_t* font_get_default(void);
11
const font_t* font_get_consolas(void);
12
int (font_free)(void);
13

  
14
typedef enum{
5 15
    text_valign_top    = -1,
6 16
    text_valign_center =  0,
7 17
    text_valign_bottom =  1
8
};
18
} text_valign;
9 19

  
10
enum text_halign{
20
typedef enum{
11 21
    text_halign_left   = -1,
12 22
    text_halign_center =  0,
13 23
    text_halign_right  =  1
14
};
24
} text_halign;
15 25

  
16
struct font;
17
typedef struct font font_t;
18
font_t* (font_ctor)(const char *s);
19
int     (font_dtor)(font_t *p);
20

  
21
font_t *consolas;
22
font_t *default_font;
23

  
24
int (font_init)(void);
25
int (font_free)(void);
26

  
27 26
struct text;
28 27
typedef struct text text_t;
29 28
text_t* (text_ctor)(const font_t *fnt, const char *txt);
30 29
void    (text_dtor)(text_t *p);
31 30
char* (text_get_string)(const text_t *p);
32
void (text_set_text)  (text_t *p, const char *txt);
31
void (text_set_string)(text_t *p, const char *txt);
33 32
void (text_set_pos)   (text_t *p, int16_t x, int16_t y);
34 33
void (text_set_size)  (text_t *p, unsigned size);
35 34
void (text_set_color) (text_t *p, uint32_t color);
36
void (text_set_valign)(text_t *p, enum text_valign valign);
37
void (text_set_halign)(text_t *p, enum text_halign halign);
35
void (text_set_valign)(text_t *p, text_valign valign);
36
void (text_set_halign)(text_t *p, text_halign halign);
38 37
int16_t (text_get_x)  (const text_t *p);
39 38
int16_t (text_get_y)  (const text_t *p);
40
int (text_draw)     (const text_t *p);
39
int     (text_draw)   (const text_t *p);
41 40

  
42 41
#endif //FONT_H_INCLUDED

Also available in: Unified diff