gwenhywfar  4.3.3
htmlprops.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 "htmlprops_p.h"
18 
19 #include <gwenhywfar/misc.h>
20 
21 #include <assert.h>
22 
23 
24 
25 
27  HTML_PROPS *pr;
28 
30  pr->refCount=1;
31  pr->foregroundColor=HTML_PROPS_NOCOLOR;
32  pr->backgroundColor=HTML_PROPS_NOCOLOR;
33 
34  return pr;
35 }
36 
37 
38 
40  if (pr) {
41  assert(pr->refCount);
42  if (pr->refCount>1) {
43  pr->refCount--;
44  }
45  else {
46  HtmlFont_free(pr->font);
47  pr->refCount=0;
48  GWEN_FREE_OBJECT(pr);
49  }
50  }
51 }
52 
53 
54 
56  HTML_PROPS *pr;
57 
58  pr=HtmlProps_new();
59  pr->font=pro->font;
60  if (pr->font)
61  HtmlFont_Attach(pr->font);
62  pr->foregroundColor=pro->foregroundColor;
63  pr->backgroundColor=pro->backgroundColor;
64 
65  return pr;
66 }
67 
68 
69 
71  assert(pr);
72  assert(pr->refCount);
73  pr->refCount++;
74 }
75 
76 
77 
79  assert(pr);
80  assert(pr->refCount);
81  return pr->font;
82 }
83 
84 
85 
87  assert(pr);
88  assert(pr->refCount);
89  HtmlFont_Attach(fnt);
90  HtmlFont_free(pr->font);
91  pr->font=fnt;
92 }
93 
94 
95 
97  assert(pr);
98  assert(pr->refCount);
99  return pr->foregroundColor;
100 }
101 
102 
103 
105  assert(pr);
106  assert(pr->refCount);
107  pr->foregroundColor=c;
108 }
109 
110 
111 
113  assert(pr);
114  assert(pr->refCount);
115  return pr->backgroundColor;
116 }
117 
118 
119 
121  assert(pr);
122  assert(pr->refCount);
123  pr->backgroundColor=c;
124 }
125 
126 
127 
128 
129 
130 
131