gwenhywfar  5.10.1
o_word.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 "o_word_l.h"
18 #include "htmlctx_l.h"
19 
20 #include <gwenhywfar/debug.h>
21 
22 
23 
25 {
26  const char *s;
27  int w=0;
28  int h=0;
29 
30  s=HtmlObject_GetText(o);
31  if (s) {
32  HTML_PROPS *pr;
33  HTML_FONT *fnt;
34 
36  assert(pr);
37  fnt=HtmlProps_GetFont(pr);
40  }
41 
42  HtmlObject_SetWidth(o, w);
44  return 0;
45 }
46 
47 
48 
50 {
51  HTML_OBJECT *o;
52 
54  HtmlObject_SetText(o, s);
56 
57  return o;
58 }
59 
60 
int HtmlFont_GetFontSize(const HTML_FONT *fnt)
Definition: htmlfont.c:89
const char * HtmlObject_GetText(const HTML_OBJECT *o)
Definition: htmlobject.c:233
HTML_PROPS * HtmlObject_GetProperties(const HTML_OBJECT *o)
Definition: htmlobject.c:104
void HtmlObject_SetHeight(HTML_OBJECT *o, int i)
Definition: htmlobject.c:188
struct HTML_FONT HTML_FONT
Definition: htmlfont_be.h:23
HTML_OBJECT * HtmlObject_new(GWEN_XML_CONTEXT *ctx, HTML_OBJECT_TYPE t)
Definition: htmlobject.c:31
struct HTML_PROPS HTML_PROPS
Definition: htmlprops_be.h:15
HTML_FONT * HtmlProps_GetFont(const HTML_PROPS *pr)
Definition: htmlprops.c:82
HTML_OBJECT * HtmlObject_Word_new(GWEN_XML_CONTEXT *ctx, const char *s)
Definition: o_word.c:49
static int HtmlObject_Word_Layout(HTML_OBJECT *o)
Definition: o_word.c:24
int HtmlCtx_GetTextHeight(GWEN_XML_CONTEXT *ctx, HTML_FONT *fnt, const char *s)
Definition: htmlctx.c:603
HTML_OBJECT_LAYOUT_FN HtmlObject_SetLayoutFn(HTML_OBJECT *o, HTML_OBJECT_LAYOUT_FN fn)
Definition: htmlobject.c:310
void HtmlObject_SetText(HTML_OBJECT *o, const char *s)
Definition: htmlobject.c:242
int HtmlCtx_GetTextWidth(GWEN_XML_CONTEXT *ctx, HTML_FONT *fnt, const char *s)
Definition: htmlctx.c:585
GWEN_XML_CONTEXT * HtmlObject_GetXmlCtx(const HTML_OBJECT *o)
Definition: htmlobject.c:77
void HtmlObject_SetWidth(HTML_OBJECT *o, int i)
Definition: htmlobject.c:170
struct GWEN_XML_CONTEXT GWEN_XML_CONTEXT
Definition: xmlctx.h:39
struct HTML_OBJECT HTML_OBJECT
Definition: htmlobject_be.h:25