gwenhywfar
4.6.0beta
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
src
html
htmlfont.c
Go to the documentation of this file.
1
/***************************************************************************
2
begin : Sat Feb 20 2010
3
copyright : (C) 2010 by Martin Preuss
4
email : martin@libchipcard.de
5
6
***************************************************************************
7
* Please see toplevel file COPYING for license details *
8
***************************************************************************/
9
10
#ifdef HAVE_CONFIG_H
11
# include <config.h>
12
#endif
13
14
#define DISABLE_DEBUGLOG
15
16
17
#include "htmlfont_p.h"
18
19
20
21
GWEN_INHERIT_FUNCTIONS
(
HTML_FONT
)
22
GWEN_LIST_FUNCTIONS
(
HTML_FONT
, HtmlFont)
23
24
25
HTML_FONT *
HtmlFont_new
(
void
) {
26
HTML_FONT *fnt;
27
28
GWEN_NEW_OBJECT
(HTML_FONT, fnt);
29
fnt->refCount=1;
30
GWEN_INHERIT_INIT
(HTML_FONT, fnt);
31
GWEN_LIST_INIT
(HTML_FONT, fnt);
32
33
return
fnt;
34
}
35
36
37
38
void
HtmlFont_free
(
HTML_FONT
*fnt) {
39
if
(fnt) {
40
assert(fnt->refCount);
41
if
(fnt->refCount>1)
42
fnt->refCount--;
43
else
{
44
GWEN_LIST_FINI
(
HTML_FONT
, fnt);
45
GWEN_INHERIT_FINI
(
HTML_FONT
, fnt);
46
free(fnt->fontName);
47
48
fnt->refCount=0;
49
GWEN_FREE_OBJECT
(fnt);
50
}
51
}
52
}
53
54
55
56
void
HtmlFont_Attach
(
HTML_FONT
*fnt) {
57
assert(fnt);
58
assert(fnt->refCount);
59
fnt->refCount++;
60
}
61
62
63
64
const
char
*
HtmlFont_GetFontName
(
const
HTML_FONT
*fnt) {
65
assert(fnt);
66
assert(fnt->refCount);
67
return
fnt->fontName;
68
}
69
70
71
72
void
HtmlFont_SetFontName
(
HTML_FONT
*fnt,
const
char
*s) {
73
assert(fnt);
74
assert(fnt->refCount);
75
free(fnt->fontName);
76
if
(s) fnt->fontName=strdup(s);
77
else
fnt->fontName=
NULL
;
78
}
79
80
81
82
int
HtmlFont_GetFontSize
(
const
HTML_FONT
*fnt) {
83
assert(fnt);
84
assert(fnt->refCount);
85
return
fnt->fontSize;
86
}
87
88
89
90
void
HtmlFont_SetFontSize
(
HTML_FONT
*fnt,
int
i) {
91
assert(fnt);
92
assert(fnt->refCount);
93
fnt->fontSize=i;
94
}
95
96
97
98
uint32_t
HtmlFont_GetFontFlags
(
const
HTML_FONT
*fnt) {
99
assert(fnt);
100
assert(fnt->refCount);
101
return
fnt->fontFlags;
102
}
103
104
105
106
void
HtmlFont_SetFontFlags
(
HTML_FONT
*fnt, uint32_t i) {
107
assert(fnt);
108
assert(fnt->refCount);
109
fnt->fontFlags=i;
110
}
111
112
113
114
void
HtmlFont_AddFontFlags
(
HTML_FONT
*fnt, uint32_t i) {
115
assert(fnt);
116
assert(fnt->refCount);
117
fnt->fontFlags|=i;
118
}
119
120
121
122
void
HtmlFont_SubFontFlags
(
HTML_FONT
*fnt, uint32_t i) {
123
assert(fnt);
124
assert(fnt->refCount);
125
fnt->fontFlags&=~i;
126
}
127
128
129
130
Generated on Sun May 26 2013 16:42:54 for gwenhywfar by
1.8.1.2