gwenhywfar  5.10.1
fox16_htmlctx.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  begin : Mon Feb 22 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 #include "fox16_htmlctx_p.hpp"
15 #include "fox16_gui.hpp"
16 
17 #include <assert.h>
18 
19 #include <gwenhywfar/inherit.h>
20 #include <gwenhywfar/debug.h>
21 #include <gwenhywfar/gui_be.h>
22 #include <gwenhywfar/i18n.h>
23 #include <gwenhywfar/htmlctx_be.h>
24 #include <gwenhywfar/o_image_be.h>
25 #include <gwenhywfar/text.h>
26 #include <gwenhywfar/debug.h>
27 #include <gwenhywfar/syncio_memory.h>
28 #include <gwenhywfar/directory.h>
29 
30 
31 
33 GWEN_INHERIT(HTML_FONT, FXFont)
34 GWEN_INHERIT(HTML_IMAGE, FXImage)
35 
36 
37 
38 int FOX16_HtmlCtxLinker::GetTextWidth(GWEN_XML_CONTEXT *ctx,
39  HTML_FONT *fnt,
40  const char *s) {
41  FOX16_HtmlCtx *xctx;
42 
43  assert(ctx);
45  assert(xctx);
46 
47  return xctx->getTextWidth(fnt, s);
48 }
49 
50 
51 
52 int FOX16_HtmlCtxLinker::GetTextHeight(GWEN_XML_CONTEXT *ctx,
53  HTML_FONT *fnt,
54  const char *s) {
55  FOX16_HtmlCtx *xctx;
56 
57  assert(ctx);
59  assert(xctx);
60 
61  return xctx->getTextHeight(fnt, s);
62 }
63 
64 
65 
66 uint32_t FOX16_HtmlCtxLinker::GetColorFromName(const GWEN_XML_CONTEXT *ctx,
67  const char *name) {
68  FOX16_HtmlCtx *xctx;
69 
70  assert(ctx);
72  assert(xctx);
73 
74  return xctx->getColorFromName(name);
75 }
76 
77 
78 
79 HTML_FONT *FOX16_HtmlCtxLinker::GetFont(GWEN_XML_CONTEXT *ctx,
80  const char *fontName,
81  int fontSize,
82  uint32_t fontFlags) {
83  FOX16_HtmlCtx *xctx;
84 
85  assert(ctx);
87  assert(xctx);
88 
89  return xctx->getFont(fontName, fontSize, fontFlags);
90 }
91 
92 
93 
94 HTML_IMAGE *FOX16_HtmlCtxLinker::GetImage(GWEN_XML_CONTEXT *ctx,
95  const char *imageName) {
96  FOX16_HtmlCtx *xctx;
97 
98  assert(ctx);
100  assert(xctx);
101 
102  return xctx->getImage(imageName);
103 
104 }
105 
106 
107 
108 void FOX16_HtmlCtxLinker::freeData(void *bp, void *p) {
109  FOX16_HtmlCtx *xctx;
110 
111  xctx=(FOX16_HtmlCtx*) p;
112  if (xctx->_context)
113  xctx->_context=NULL;
114  delete xctx;
115 }
116 
117 
118 
119 void FOX16_HtmlCtxLinker::freeFontData(void *bp, void *p) {
120  FXFont *xfnt;
121 
122  xfnt=(FXFont*) p;
123  delete xfnt;
124 }
125 
126 
127 
128 
129 void FOX16_HtmlCtxLinker::freeImageData(void *bp, void *p) {
130  FXImage *ximg;
131 
132  ximg=(FXImage*) p;
133  delete ximg;
134 }
135 
136 
137 
138 
139 
141  :_context(NULL)
142  ,_font(NULL)
143  ,_fgColor(0)
144  ,_bgColor(0)
145  ,m_iconSource(NULL) {
146  HTML_PROPS *pr;
147  HTML_FONT *fnt;
148 
149  _context=HtmlCtx_new(flags);
151  FOX16_HtmlCtxLinker::freeData);
152  _font=FXApp::instance()->getNormalFont();
153  HtmlCtx_SetGetTextWidthFn(_context, FOX16_HtmlCtxLinker::GetTextWidth);
154  HtmlCtx_SetGetTextHeightFn(_context, FOX16_HtmlCtxLinker::GetTextHeight);
155  HtmlCtx_SetGetColorFromNameFn(_context, FOX16_HtmlCtxLinker::GetColorFromName);
156  HtmlCtx_SetGetFontFn(_context, FOX16_HtmlCtxLinker::GetFont);
157  HtmlCtx_SetGetImageFn(_context, FOX16_HtmlCtxLinker::GetImage);
158 
159  pr=HtmlProps_new();
160  fnt=HtmlCtx_GetFont(_context, _font->getName().text(), _font->getSize()/10, 0);
161  HtmlProps_SetFont(pr, fnt);
163  HtmlProps_free(pr);
164 
165 }
166 
167 
168 
170  if (_context) {
173  }
174 }
175 
176 
177 
179  FXFont *xfnt;
180 
181  if (GWEN_INHERIT_ISOFTYPE(HTML_FONT, FXFont, fnt)) {
182  xfnt=GWEN_INHERIT_GETDATA(HTML_FONT, FXFont, fnt);
183  return xfnt;
184  }
185  else {
186  FXuint size;
187  FXuint weight;
188  FXuint slant;
189  FXuint encoding;
190  FXString face;
191  uint32_t flags;
192 
193  if (HtmlFont_GetFontName(fnt))
194  face=HtmlFont_GetFontName(fnt);
195  else
196  face=_font->getName();
197  size=HtmlFont_GetFontSize(fnt);
198  weight=FXFont::Normal;
199  slant=_font->getSlant();
200  encoding=_font->getEncoding();
201 
202  flags=HtmlFont_GetFontFlags(fnt);
203  if (flags & HTML_FONT_FLAGS_STRONG)
204  weight=FXFont::Bold;
205  if (flags & HTML_FONT_FLAGS_ITALIC)
206  slant=FXFont::Italic;
207 
209  "Creating font [%s], size=%d, weight=%d, slant=%d, encoding=%d",
210  face.text(), size, weight, slant, encoding);
211 
212  xfnt=new FXFont(FXApp::instance(), face, size, weight, slant, encoding);
213  if (xfnt==NULL) {
215  "Could not create font [%s], size=%d, weight=%d, slant=%d, encoding=%d",
216  face.text(), size, weight, slant, encoding);
217  return NULL;
218  }
219  xfnt->create();
220  GWEN_INHERIT_SETDATA(HTML_FONT, FXFont, fnt, xfnt,
221  FOX16_HtmlCtxLinker::freeFontData);
222  return xfnt;
223  }
224 }
225 
226 
227 
228 int FOX16_HtmlCtx::getTextWidth(HTML_FONT *fnt, const char *s) {
229  if (s==NULL) {
230  DBG_ERROR(GWEN_LOGDOMAIN, "NULLPOINTER, returning size 0");
231  return 0;
232  }
233  else {
234  FXFont *xfnt;
235  FXString str;
236 
237  str=FXString(s);
238  xfnt=_getFoxFont(fnt);
239  if (xfnt==NULL)
240  return _font->getTextWidth(str);
241  else
242  return xfnt->getTextWidth(str);
243  }
244 }
245 
246 
247 
248 int FOX16_HtmlCtx::getTextHeight(HTML_FONT *fnt, const char *s) {
249  if (s==NULL) {
250  DBG_ERROR(GWEN_LOGDOMAIN, "NULLPOINTER, returning size 0");
251  return 0;
252  }
253  else {
254  FXFont *xfnt;
255  FXString str;
256 
257  str=FXString(s);
258  xfnt=_getFoxFont(fnt);
259  if (xfnt==NULL)
260  return _font->getTextHeight(str);
261  else
262  return xfnt->getTextHeight(str);
263  }
264 }
265 
266 
267 
268 uint32_t FOX16_HtmlCtx::getColorFromName(const char *name) {
269  return fxcolorfromname(name);
270 }
271 
272 
273 
274 int FOX16_HtmlCtx::layout(int width, int height) {
275  return HtmlCtx_Layout(_context, width, height);
276 }
277 
278 
279 
280 void FOX16_HtmlCtx::setText(const char *s) {
281  int rv;
282 
284  if (rv<0) {
285  DBG_INFO(GWEN_LOGDOMAIN, "here (%d)", rv);
286  }
287 }
288 
289 
290 
291 void FOX16_HtmlCtx::addMediaPath(const char *s) {
293 }
294 
295 
296 
297 static void dumpObject(HTML_OBJECT *o, FILE *f, int indent) {
298  HTML_OBJECT *c;
299  int i;
300  const char *s;
301  HTML_PROPS *pr;
302  HTML_FONT *fnt;
303 
304  s=HtmlObject_GetText(o);
305  for (i=0; i<indent; i++) fprintf(f, " ");
306  fprintf(stderr, "Object type: %d [%s] flags: %08x, x=%d, y=%d, w=%d, h=%d\n",
308  s?s:"(empty)",
310  HtmlObject_GetX(o),
311  HtmlObject_GetY(o),
314 
316  fnt=HtmlProps_GetFont(pr);
317 
318  for (i=0; i<indent+2; i++) fprintf(f, " ");
319  fprintf(stderr, "fgcol=%06x, bgcol=%06x, fontsize=%d, fontflags=%08x, fontname=[%s]\n",
324  HtmlFont_GetFontName(fnt));
325 
326  c=HtmlObject_Tree_GetFirstChild(o);
327  while(c) {
328  dumpObject(c, f, indent+2);
329  c=HtmlObject_Tree_GetNext(c);
330  }
331 }
332 
333 
334 
336  HTML_OBJECT *o;
337 
339  if (o)
340  dumpObject(o, stderr, 2);
341 }
342 
343 
344 
345 void FOX16_HtmlCtx::_paint(FXDC *dc, HTML_OBJECT *o, int xOffset, int yOffset) {
346  HTML_OBJECT *c;
347 
348  xOffset+=HtmlObject_GetX(o);
349  yOffset+=HtmlObject_GetY(o);
350 
351  switch(HtmlObject_GetObjectType(o)) {
352  case HtmlObjectType_Word: {
353  HTML_PROPS *pr;
354  HTML_FONT *fnt;
355  FXFont *xfnt;
356  int ascent=0;
357  uint32_t col;
358 
360 
361  /* select font */
362  fnt=HtmlProps_GetFont(pr);
363  xfnt=_getFoxFont(fnt);
364  if (xfnt) {
365  dc->setFont(xfnt);
366  ascent=xfnt->getFontAscent();
367  }
368 
369  /* select foreground color */
371  if (col==HTML_PROPS_NOCOLOR)
372  dc->setForeground(_fgColor);
373  else
374  dc->setForeground(col);
375 
376  /* select background color */
378  if (col==HTML_PROPS_NOCOLOR)
379  dc->setBackground(_bgColor);
380  else
381  dc->setBackground(col);
382 
383  dc->drawText(xOffset, yOffset+ascent, HtmlObject_GetText(o));
384  break;
385  }
386 
387  case HtmlObjectType_Image: {
388  HTML_IMAGE *img;
389 
391  if (img) {
392  FXImage *ximg;
393 
394  ximg=GWEN_INHERIT_GETDATA(HTML_IMAGE, FXImage, img);
395  if (ximg) {
396  HTML_PROPS *pr;
397  uint32_t col;
398 
400 
401  /* select background color */
403  if (col==HTML_PROPS_NOCOLOR) {
404  dc->setBackground(_bgColor);
405  dc->setForeground(_bgColor);
406  }
407  else {
408  dc->setBackground(col);
409  dc->setForeground(col);
410  }
411 
412  dc->fillRectangle(xOffset, yOffset, ximg->getWidth(), ximg->getHeight());
413 
414  dc->drawImage(ximg, xOffset, yOffset);
415  }
416  }
417  break;
418  }
419  default:
420  break;
421  }
422 
423  c=HtmlObject_Tree_GetFirstChild(o);
424  while(c) {
425  _paint(dc, c, xOffset, yOffset);
426  c=HtmlObject_Tree_GetNext(c);
427  }
428 }
429 
430 
431 
433  int xOffset, int yOffset,
434  int xText, int yText,
435  int w, int h) {
436  HTML_OBJECT *c;
437  int x;
438  int y;
439  int printX;
440  int printY;
441  int objectW;
442  int objectH;
443 
444  x=xText+HtmlObject_GetX(o);
445  y=yText+HtmlObject_GetY(o);
446  objectW=HtmlObject_GetWidth(o);
447  objectH=HtmlObject_GetHeight(o);
448 
449  printX=x-xOffset;
450  printY=y-yOffset;
451 
452  if (printX<w && printX+objectW>=0 &&
453  printY<h && printY+objectH>=0) {
454  switch(HtmlObject_GetObjectType(o)) {
455 #if 0
456  case HtmlObjectType_Grid:
457  dc->setForeground(FXRGB(255,0,0));
458  dc->fillRectangle(printX, printY,
461 #endif
462  case HtmlObjectType_Word: {
463  HTML_PROPS *pr;
464  HTML_FONT *fnt;
465  FXFont *xfnt;
466  int ascent=0;
467  uint32_t col;
468 
470 
471  /* select font */
472  fnt=HtmlProps_GetFont(pr);
473  xfnt=_getFoxFont(fnt);
474  if (xfnt) {
475  dc->setFont(xfnt);
476  ascent=xfnt->getFontAscent();
477  }
478 
479  /* select foreground color */
481  if (col==HTML_PROPS_NOCOLOR)
482  dc->setForeground(_fgColor);
483  else
484  dc->setForeground(col);
485 
486  /* select background color */
488  if (col==HTML_PROPS_NOCOLOR)
489  dc->setBackground(_bgColor);
490  else
491  dc->setBackground(col);
492 
493  dc->drawText(printX, printY+ascent, HtmlObject_GetText(o));
494  break;
495  }
496 
497  case HtmlObjectType_Image: {
498  HTML_IMAGE *img;
499 
501  if (img) {
502  FXImage *ximg;
503 
504  ximg=GWEN_INHERIT_GETDATA(HTML_IMAGE, FXImage, img);
505  if (ximg) {
506  HTML_PROPS *pr;
507  uint32_t col;
508 
510 
511  /* select background color */
513  if (col==HTML_PROPS_NOCOLOR) {
514  dc->setBackground(_bgColor);
515  dc->setForeground(_bgColor);
516  }
517  else {
518  dc->setBackground(col);
519  dc->setForeground(col);
520  }
521  dc->fillRectangle(printX, printY, ximg->getWidth(), ximg->getHeight());
522 
523  dc->drawImage(ximg, printX, printY);
524  }
525  }
526  break;
527  }
528  default:
529  break;
530  }
531 
532 
533  c=HtmlObject_Tree_GetFirstChild(o);
534  while(c) {
535  _paintAt(dc, c, xOffset, yOffset, x, y, w, h);
536  c=HtmlObject_Tree_GetNext(c);
537  }
538  }
539 }
540 
541 
542 
543 void FOX16_HtmlCtx::paint(FXDC *dc, int xOffset, int yOffset) {
544  HTML_OBJECT *o;
545 
547  if (o)
548  _paint(dc, o, xOffset, yOffset);
549 }
550 
551 
552 
554  int xOffset, int yOffset,
555  int xText, int yText,
556  int w, int h) {
557  HTML_OBJECT *o;
558 
560  if (o)
561  _paintAt(dc, o, xOffset, yOffset, xText, yText, w, h);
562 }
563 
564 
565 
567  HTML_OBJECT *o;
568 
570  if (o)
571  return HtmlObject_GetWidth(o);
572  else
573  return -1;
574 }
575 
576 
577 
579  HTML_OBJECT *o;
580 
582  if (o)
583  return HtmlObject_GetHeight(o);
584  else
585  return -1;
586 }
587 
588 
589 
590 HTML_FONT *FOX16_HtmlCtx::getFont(const char *fontName,
591  int fontSize,
592  uint32_t fontFlags) {
593  FOX16_Gui *gui;
594 
595  gui=FOX16_Gui::getFgGui();
596  assert(gui);
597 
598  return gui->getFont(fontName, fontSize, fontFlags);
599 }
600 
601 
602 
603 HTML_IMAGE *FOX16_HtmlCtx::getImage(const char *fileName) {
604  GWEN_STRINGLIST *sl;
605 
607  if (sl) {
608  GWEN_BUFFER *tbuf;
609  int rv;
610  FXImage *ximg;
611  HTML_IMAGE *img;
612 
613  tbuf=GWEN_Buffer_new(0, 256, 0, 1);
614  rv=GWEN_Directory_FindFileInPaths(sl, fileName, tbuf);
615  if (rv<0) {
616  DBG_ERROR(GWEN_LOGDOMAIN, "here (%d)", rv);
617  GWEN_Buffer_free(tbuf);
618  return NULL;
619  }
620 
621  if (m_iconSource==NULL)
622  m_iconSource=new FXIconSource(FXApp::instance());
623 
624  ximg=m_iconSource->loadIconFile(GWEN_Buffer_GetStart(tbuf));
625  if (ximg==NULL) {
626  DBG_ERROR(GWEN_LOGDOMAIN, "Could not load icon [%s]", GWEN_Buffer_GetStart(tbuf));
627  GWEN_Buffer_free(tbuf);
628  return NULL;
629  }
630 
631  ximg->create();
632  img=HtmlImage_new();
634  HtmlImage_SetWidth(img, ximg->getWidth());
635  HtmlImage_SetHeight(img, ximg->getHeight());
636 
637  GWEN_INHERIT_SETDATA(HTML_IMAGE, FXImage, img, ximg,
638  FOX16_HtmlCtxLinker::freeImageData);
639  GWEN_Buffer_free(tbuf);
640  return img;
641  }
642  else {
643  DBG_ERROR(GWEN_LOGDOMAIN, "No media paths in dialog");
644  return NULL;
645  }
646 }
647 
648 
649 
650 
652  _bgColor=c;
653 }
654 
655 
656 
658  _fgColor=c;
659 }
660 
661 
662 
663 
664 
665 
666 
667 
const char * HtmlFont_GetFontName(const HTML_FONT *fnt)
Definition: htmlfont.c:67
HTMLCTX_GET_TEXT_WIDTH_FN HtmlCtx_SetGetTextWidthFn(GWEN_XML_CONTEXT *ctx, HTMLCTX_GET_TEXT_WIDTH_FN fn)
Definition: htmlctx.c:673
int layout(int width, int height)
void HtmlImage_SetImageName(HTML_IMAGE *img, const char *s)
Definition: htmlimage.c:76
int HtmlFont_GetFontSize(const HTML_FONT *fnt)
Definition: htmlfont.c:89
char * GWEN_Buffer_GetStart(const GWEN_BUFFER *bf)
Definition: buffer.c:235
void HtmlCtx_SetStandardProps(GWEN_XML_CONTEXT *ctx, HTML_PROPS *pr)
Definition: htmlctx.c:386
HTMLCTX_GET_COLOR_FROM_NAME_FN HtmlCtx_SetGetColorFromNameFn(GWEN_XML_CONTEXT *ctx, HTMLCTX_GET_COLOR_FROM_NAME_FN fn)
Definition: htmlctx.c:709
uint32_t HtmlProps_GetBackgroundColor(const HTML_PROPS *pr)
Definition: htmlprops.c:120
HTML_OBJECT_TYPE HtmlObject_GetObjectType(const HTML_OBJECT *o)
Definition: htmlobject.c:86
void HtmlProps_free(HTML_PROPS *pr)
Definition: htmlprops.c:40
int getTextHeight(HTML_FONT *fnt, const char *s)
uint32_t getColorFromName(const char *name)
GWEN_STRINGLIST * HtmlCtx_GetMediaPaths(const GWEN_XML_CONTEXT *ctx)
Definition: htmlctx.c:160
HTML_PROPS * HtmlProps_new(void)
Definition: htmlprops.c:26
#define HTML_FONT_FLAGS_ITALIC
Definition: htmlfont_be.h:30
int HtmlObject_GetX(const HTML_OBJECT *o)
Definition: htmlobject.c:125
void HtmlProps_SetFont(HTML_PROPS *pr, HTML_FONT *fnt)
Definition: htmlprops.c:91
uint32_t HtmlProps_GetForegroundColor(const HTML_PROPS *pr)
Definition: htmlprops.c:102
#define NULL
Definition: binreloc.c:300
int HtmlObject_GetWidth(const HTML_OBJECT *o)
Definition: htmlobject.c:161
#define HTML_PROPS_NOCOLOR
Definition: htmlprops_be.h:17
void HtmlImage_SetHeight(HTML_IMAGE *img, int i)
Definition: htmlimage.c:116
#define GWEN_INHERIT_ISOFTYPE(bt, t, element)
Definition: inherit.h:305
#define GWEN_LOGDOMAIN
Definition: logger.h:35
GWEN_BUFFER * GWEN_Buffer_new(char *buffer, uint32_t size, uint32_t used, int take)
Definition: buffer.c:42
FXIconSource * m_iconSource
void _paint(FXDC *dc, HTML_OBJECT *o, int xOffset, int yOffset)
void _paintAt(FXDC *dc, HTML_OBJECT *o, int xOffset, int yOffset, int xText, int yText, int w, int h)
const char * HtmlObject_GetText(const HTML_OBJECT *o)
Definition: htmlobject.c:233
void setText(const char *s)
HTML_PROPS * HtmlObject_GetProperties(const HTML_OBJECT *o)
Definition: htmlobject.c:104
void setForegroundColor(FXColor c)
void GWEN_XmlCtx_free(GWEN_XML_CONTEXT *ctx)
Definition: xmlctx.c:81
struct HTML_IMAGE HTML_IMAGE
Definition: htmlimage_be.h:23
static FOX16GUI_API FOX16_Gui * getFgGui()
Definition: fox16_gui.cpp:155
#define DBG_DEBUG(dbg_logger, format, args...)
Definition: debug.h:214
HTML_FONT * getFont(const char *fontName, int fontSize, uint32_t fontFlags)
#define GWEN_INHERIT_UNLINK(bt, t, element)
Definition: inherit.h:318
struct HTML_FONT HTML_FONT
Definition: htmlfont_be.h:23
GWENHYWFAR_API int GWEN_Directory_FindFileInPaths(const GWEN_STRINGLIST *paths, const char *filePath, GWEN_BUFFER *fbuf)
static void dumpObject(HTML_OBJECT *o, FILE *f, int indent)
struct GWEN_STRINGLISTSTRUCT GWEN_STRINGLIST
Definition: stringlist.h:56
struct HTML_PROPS HTML_PROPS
Definition: htmlprops_be.h:15
int HtmlCtx_Layout(GWEN_XML_CONTEXT *ctx, int width, int height)
Definition: htmlctx.c:761
void setBackgroundColor(FXColor c)
void GWEN_Buffer_free(GWEN_BUFFER *bf)
Definition: buffer.c:89
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
Definition: buffer.h:38
void HtmlImage_SetWidth(HTML_IMAGE *img, int i)
Definition: htmlimage.c:98
HTMLCTX_GET_IMAGE_FN HtmlCtx_SetGetImageFn(GWEN_XML_CONTEXT *ctx, HTMLCTX_GET_IMAGE_FN fn)
Definition: htmlctx.c:744
#define DBG_ERROR(dbg_logger, format, args...)
Definition: debug.h:97
GWENHYWFAR_API int GWEN_XMLContext_ReadFromString(GWEN_XML_CONTEXT *ctx, const char *text)
Definition: xmlrw.c:1265
GWEN_XML_CONTEXT * HtmlCtx_new(uint32_t flags)
Definition: htmlctx.c:34
void paint(FXDC *dc, int xOffset, int yOffset)
void paintAt(FXDC *dc, int xOffset, int yOffset, int xText, int yText, int w, int h)
HTML_FONT * HtmlProps_GetFont(const HTML_PROPS *pr)
Definition: htmlprops.c:82
#define HTML_FONT_FLAGS_STRONG
Definition: htmlfont_be.h:29
HTMLCTX_GET_FONT_FN HtmlCtx_SetGetFontFn(GWEN_XML_CONTEXT *ctx, HTMLCTX_GET_FONT_FN fn)
Definition: htmlctx.c:727
#define DBG_INFO(dbg_logger, format, args...)
Definition: debug.h:181
HTML_FONT * HtmlCtx_GetFont(GWEN_XML_CONTEXT *ctx, const char *fontName, int fontSize, uint32_t fontFlags)
Definition: htmlctx.c:638
int HtmlObject_GetY(const HTML_OBJECT *o)
Definition: htmlobject.c:143
int getTextWidth(HTML_FONT *fnt, const char *s)
uint32_t HtmlObject_GetFlags(const HTML_OBJECT *o)
Definition: htmlobject.c:255
HTML_FONT * getFont(const char *fontName, int fontSize, uint32_t fontFlags)
Definition: fox16_gui.cpp:542
HTML_IMAGE * HtmlImage_new(void)
Definition: htmlimage.c:25
HTML_IMAGE * getImage(const char *imageName)
#define GWEN_INHERIT(bt, t)
Definition: inherit.h:264
FOX16_HtmlCtx(uint32_t flags)
int HtmlObject_GetHeight(const HTML_OBJECT *o)
Definition: htmlobject.c:179
HTML_IMAGE * HtmlObject_Image_GetImage(const HTML_OBJECT *o)
Definition: o_image.c:119
#define GWEN_INHERIT_SETDATA(bt, t, element, data, fn)
Definition: inherit.h:292
uint32_t HtmlFont_GetFontFlags(const HTML_FONT *fnt)
Definition: htmlfont.c:107
HTMLCTX_GET_TEXT_HEIGHT_FN HtmlCtx_SetGetTextHeightFn(GWEN_XML_CONTEXT *ctx, HTMLCTX_GET_TEXT_HEIGHT_FN fn)
Definition: htmlctx.c:691
void HtmlCtx_AddMediaPath(GWEN_XML_CONTEXT *ctx, const char *s)
Definition: htmlctx.c:173
struct GWEN_XML_CONTEXT GWEN_XML_CONTEXT
Definition: xmlctx.h:39
FXFont * _getFoxFont(HTML_FONT *fnt)
#define GWEN_INHERIT_GETDATA(bt, t, element)
Definition: inherit.h:271
void addMediaPath(const char *s)
GWEN_XML_CONTEXT * _context
struct HTML_OBJECT HTML_OBJECT
Definition: htmlobject_be.h:25
HTML_OBJECT * HtmlCtx_GetRootObject(const GWEN_XML_CONTEXT *ctx)
Definition: htmlctx.c:287