-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibex_font.h
More file actions
executable file
·156 lines (112 loc) · 8.2 KB
/
libex_font.h
File metadata and controls
executable file
·156 lines (112 loc) · 8.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/* -------------------------------------------------------------------------- */
/* (c) ali@balarabe.com [libex_font.h] */
/* -------------------------------------------------------------------------- */
#if !defined INCLUDED_LIBEX_FONT_H
#define INCLUDED_LIBEX_FONT_H
#include "libex.h"
#if LX_PLATFORM_WIN32
#include "libex_win32.h"
#endif
/* -------------------------------------------------------------------------- */
LX_NAMESPACE(lx_c)
typedef struct lx_font_t {
uint8_t* ob; /* lx_font_t */
}
lx_font_t, lx_new_font_t;
/* -------------------------------------------------------------------------- */
/* Constructors: */
/* Default Constructor. */
LX_PUBLIC lx_new_font_t lx_Font_init( /*C*/
lx_chars_t font_name_, /*-*/
const int font_size_, /*-*/
const lx_bool bold_, /*-*/
const lx_bool italic_, /*-*/
const lx_bool underline_, /*-*/
const lx_bool strikeout_, /*-*/
const int font_angle_ ); /*-*/
/* Copy Constructor. */
LX_PUBLIC lx_new_font_t lx_Font_initCopy( const lx_font_t copy_from_ ); /*C*/
/* -------------------------------------------------------------------------- */
/* Destructor: */
LX_PUBLIC void lx_Font_free( lx_font_t* object_ ); /*D*/
/* -------------------------------------------------------------------------- */
/* Properties: Read-Write */
LX_PUBLIC lx_chars_t lx_Font_getName( const lx_font_t object_ ); /*P*/
LX_PUBLIC void lx_Font_setName( /*P*/
lx_font_t* object_, /*-*/
lx_chars_t value_ ); /*-*/
LX_PUBLIC int lx_Font_getSize( const lx_font_t object_ ); /*P*/
LX_PUBLIC void lx_Font_setSize( /*P*/
lx_font_t* object_, /*-*/
const int value_ ); /*-*/
LX_PUBLIC lx_bool lx_Font_getBold( const lx_font_t object_ ); /*P*/
LX_PUBLIC void lx_Font_setBold( /*P*/
lx_font_t* object_, /*-*/
const lx_bool value_ ); /*-*/
LX_PUBLIC lx_bool lx_Font_getItalic( const lx_font_t object_ ); /*P*/
LX_PUBLIC void lx_Font_setItalic( /*P*/
lx_font_t* object_, /*-*/
const lx_bool value_ ); /*-*/
LX_PUBLIC lx_bool lx_Font_getUnderline( const lx_font_t object_ ); /*P*/
LX_PUBLIC void lx_Font_setUnderline( /*P*/
lx_font_t* object_, /*-*/
const lx_bool value_ ); /*-*/
LX_PUBLIC lx_bool lx_Font_getStrikeout( const lx_font_t object_ ); /*P*/
LX_PUBLIC void lx_Font_setStrikeout( /*P*/
lx_font_t* object_, /*-*/
const lx_bool value_ ); /*-*/
LX_PUBLIC int lx_Font_getAngle( const lx_font_t object_ ); /*P*/
LX_PUBLIC void lx_Font_setAngle( /*P*/
lx_font_t* object_, /*-*/
const int value_ ); /*-*/
/* -------------------------------------------------------------------------- */
/* Properties: Read-Only */
LX_PUBLIC lx_bool lx_Font_isEqual( /*P*/
const lx_font_t* object_, /*-*/
const lx_font_t* compare_ ); /*-*/
/* -------------------------------------------------------------------------- */
/* Properties: Windows-Specific */
#if LX_PLATFORM_WIN32
LX_PUBLIC HDC_win lx_Font_getDc( const lx_font_t object_ ); /*P*/
LX_PUBLIC void lx_Font_setDc( /*P*/
lx_font_t* object_, /*-*/
const HDC_win value_ ); /*-*/
LX_PUBLIC HFONT_win lx_Font_getHandle( /*P*/
lx_font_t* object_, /*-*/
const HWND_win window_ ); /* screen device context == NULL */ /*-*/
#endif /* LX_PLATFORM_WIN32 */
/* -------------------------------------------------------------------------- */
/* Methods: */
/* Re-creates the internal font object, applying current properties. */
LX_PUBLIC void lx_Font_recreate( lx_font_t* object_ ); /*M*/
/* Destroys the internal font object. */
LX_PUBLIC void lx_Font_reset( lx_font_t* object_ ); /*M*/
LX_PUBLIC void lx_Font_setCopy( /*M*/
lx_font_t* object_, /*-*/
const lx_font_t* copy_from_ ); /*-*/
LX_PUBLIC void lx_Font_set( /*M*/
lx_font_t* object_, /*-*/
lx_chars_t font_name_, /*-*/
const int font_size_, /*-*/
const lx_bool bold_, /*-*/
const lx_bool italic_, /*-*/
const lx_bool underline_, /*-*/
const lx_bool strikeout_, /*-*/
const int font_angle_ ); /*-*/
/* -------------------------------------------------------------------------- */
/* Functions: Windows-Specific */
#if LX_PLATFORM_WIN32
/* Creates a font for the specified device context. */
LX_PUBLIC HFONT_win lx_font_create( /*F*/
const HDC_win hdc_, /*-*/
lx_chars_t font_name_, /*-*/
const int font_size_, /*-*/
const lx_bool bold_, /*-*/
const lx_bool italic_, /*-*/
const lx_bool underline_, /*-*/
const lx_bool strikeout_, /*-*/
const int font_angle_ ); /*-*/
LX_PUBLIC void lx_font_destroy( HFONT_win* font_ ); /*F*/
#endif /* LX_PLATFORM_WIN32 */
LX_END_NAMESPACE /*lx_c*/
#endif /*eof*/