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>
89 return xctx->
getFont(fontName, fontSize, fontFlags);
95 const char *imageName) {
108 void FOX16_HtmlCtxLinker::freeData(
void *bp,
void *p) {
119 void FOX16_HtmlCtxLinker::freeFontData(
void *bp,
void *p) {
129 void FOX16_HtmlCtxLinker::freeImageData(
void *bp,
void *p) {
152 FOX16_HtmlCtxLinker::freeData);
153 _font=FXApp::instance()->getNormalFont();
197 face=
_font->getName();
199 weight=FXFont::Normal;
200 slant=
_font->getSlant();
201 encoding=
_font->getEncoding();
207 slant=FXFont::Italic;
210 "Creating font [%s], size=%d, weight=%d, slant=%d, encoding=%d",
211 face.text(), size, weight, slant, encoding);
213 xfnt=
new FXFont(FXApp::instance(), face, size, weight, slant, encoding);
216 "Could not create font [%s], size=%d, weight=%d, slant=%d, encoding=%d",
217 face.text(), size, weight, slant, encoding);
222 FOX16_HtmlCtxLinker::freeFontData);
241 return _font->getTextWidth(str);
243 return xfnt->getTextWidth(str);
261 return _font->getTextHeight(str);
263 return xfnt->getTextHeight(str);
270 return fxcolorfromname(name);
306 for (i=0; i<indent; i++) fprintf(f,
" ");
307 fprintf(stderr,
"Object type: %d [%s] flags: %08x, x=%d, y=%d, w=%d, h=%d\n",
319 for (i=0; i<indent+2; i++) fprintf(f,
" ");
320 fprintf(stderr,
"fgcol=%06x, bgcol=%06x, fontsize=%d, fontflags=%08x, fontname=[%s]\n",
327 c=HtmlObject_Tree_GetFirstChild(o);
330 c=HtmlObject_Tree_GetNext(c);
367 ascent=xfnt->getFontAscent();
375 dc->setForeground(col);
382 dc->setBackground(col);
409 dc->setBackground(col);
410 dc->setForeground(col);
413 dc->fillRectangle(xOffset, yOffset, ximg->getWidth(), ximg->getHeight());
415 dc->drawImage(ximg, xOffset, yOffset);
424 c=HtmlObject_Tree_GetFirstChild(o);
426 _paint(dc, c, xOffset, yOffset);
427 c=HtmlObject_Tree_GetNext(c);
434 int xOffset,
int yOffset,
435 int xText,
int yText,
453 if (printX<w && printX+objectW>=0 &&
454 printY<h && printY+objectH>=0) {
458 dc->setForeground(FXRGB(255,0,0));
459 dc->fillRectangle(printX, printY,
477 ascent=xfnt->getFontAscent();
485 dc->setForeground(col);
492 dc->setBackground(col);
519 dc->setBackground(col);
520 dc->setForeground(col);
522 dc->fillRectangle(printX, printY, ximg->getWidth(), ximg->getHeight());
524 dc->drawImage(ximg, printX, printY);
534 c=HtmlObject_Tree_GetFirstChild(o);
536 _paintAt(dc, c, xOffset, yOffset, x, y, w, h);
537 c=HtmlObject_Tree_GetNext(c);
549 _paint(dc, o, xOffset, yOffset);
555 int xOffset,
int yOffset,
556 int xText,
int yText,
562 _paintAt(dc, o, xOffset, yOffset, xText, yText, w, h);
593 uint32_t fontFlags) {
599 return gui->
getFont(fontName, fontSize, fontFlags);
639 FOX16_HtmlCtxLinker::freeImageData);