gwenhywfar 5.10.1
Macros | Functions
htmlctx.c File Reference
#include "htmlctx_p.h"
#include "o_box_l.h"
#include "g_box_l.h"
#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/text.h>
Include dependency graph for htmlctx.c:

Go to the source code of this file.

Macros

#define DISABLE_DEBUGLOG
 

Functions

int HtmlCtx_AddAttr (GWEN_XML_CONTEXT *ctx, const char *attrName, const char *attrData)
 
int HtmlCtx_AddComment (GWEN_XML_CONTEXT *ctx, GWEN_UNUSED const char *data)
 
int HtmlCtx_AddData (GWEN_XML_CONTEXT *ctx, const char *data)
 
void HtmlCtx_AddMediaPath (GWEN_XML_CONTEXT *ctx, const char *s)
 
int HtmlCtx_EndTag (GWEN_XML_CONTEXT *ctx, int closing)
 
GWENHYWFAR_CB void HtmlCtx_FreeData (GWEN_UNUSED void *bp, void *p)
 
uint32_t HtmlCtx_GetColorFromName (const GWEN_XML_CONTEXT *ctx, const char *name)
 
GWEN_DB_NODEHtmlCtx_GetCurrentAttributes (const GWEN_XML_CONTEXT *ctx)
 
HTML_GROUPHtmlCtx_GetCurrentGroup (const GWEN_XML_CONTEXT *ctx)
 
const char * HtmlCtx_GetCurrentTagName (const GWEN_XML_CONTEXT *ctx)
 
HTML_FONTHtmlCtx_GetFont (GWEN_XML_CONTEXT *ctx, const char *fontName, int fontSize, uint32_t fontFlags)
 
int HtmlCtx_GetHeight (const GWEN_XML_CONTEXT *ctx)
 
HTML_IMAGEHtmlCtx_GetImage (GWEN_XML_CONTEXT *ctx, const char *imageName)
 
GWEN_STRINGLISTHtmlCtx_GetMediaPaths (const GWEN_XML_CONTEXT *ctx)
 
HTML_OBJECT_TREE * HtmlCtx_GetObjects (const GWEN_XML_CONTEXT *ctx)
 
int HtmlCtx_GetResolutionX (const GWEN_XML_CONTEXT *ctx)
 
int HtmlCtx_GetResolutionY (const GWEN_XML_CONTEXT *ctx)
 
HTML_OBJECTHtmlCtx_GetRootObject (const GWEN_XML_CONTEXT *ctx)
 
HTML_PROPSHtmlCtx_GetStandardProps (const GWEN_XML_CONTEXT *ctx)
 
int HtmlCtx_GetTextHeight (GWEN_XML_CONTEXT *ctx, HTML_FONT *fnt, const char *s)
 
int HtmlCtx_GetTextWidth (GWEN_XML_CONTEXT *ctx, HTML_FONT *fnt, const char *s)
 
int HtmlCtx_GetWidth (const GWEN_XML_CONTEXT *ctx)
 
int HtmlCtx_Layout (GWEN_XML_CONTEXT *ctx, int width, int height)
 
GWEN_XML_CONTEXTHtmlCtx_new (uint32_t flags)
 
int HtmlCtx_SanitizeData (GWEN_UNUSED GWEN_XML_CONTEXT *ctx, const char *data, GWEN_BUFFER *buf)
 
void HtmlCtx_SetCurrentGroup (GWEN_XML_CONTEXT *ctx, HTML_GROUP *g)
 
void HtmlCtx_SetCurrentTagName (GWEN_XML_CONTEXT *ctx, const char *s)
 
HTMLCTX_GET_COLOR_FROM_NAME_FN HtmlCtx_SetGetColorFromNameFn (GWEN_XML_CONTEXT *ctx, HTMLCTX_GET_COLOR_FROM_NAME_FN fn)
 
HTMLCTX_GET_FONT_FN HtmlCtx_SetGetFontFn (GWEN_XML_CONTEXT *ctx, HTMLCTX_GET_FONT_FN fn)
 
HTMLCTX_GET_IMAGE_FN HtmlCtx_SetGetImageFn (GWEN_XML_CONTEXT *ctx, HTMLCTX_GET_IMAGE_FN fn)
 
HTMLCTX_GET_TEXT_HEIGHT_FN HtmlCtx_SetGetTextHeightFn (GWEN_XML_CONTEXT *ctx, HTMLCTX_GET_TEXT_HEIGHT_FN fn)
 
HTMLCTX_GET_TEXT_WIDTH_FN HtmlCtx_SetGetTextWidthFn (GWEN_XML_CONTEXT *ctx, HTMLCTX_GET_TEXT_WIDTH_FN fn)
 
void HtmlCtx_SetResolutionX (GWEN_XML_CONTEXT *ctx, int i)
 
void HtmlCtx_SetResolutionY (GWEN_XML_CONTEXT *ctx, int i)
 
void HtmlCtx_SetStandardProps (GWEN_XML_CONTEXT *ctx, HTML_PROPS *pr)
 
void HtmlCtx_SetText (GWEN_XML_CONTEXT *ctx, const char *s)
 
int HtmlCtx_StartTag (GWEN_XML_CONTEXT *ctx, const char *tagName)
 
HTML_OBJECT_TREE * HtmlCtx_TakeObjects (const GWEN_XML_CONTEXT *ctx)
 

Macro Definition Documentation

◆ DISABLE_DEBUGLOG

#define DISABLE_DEBUGLOG

Definition at line 16 of file htmlctx.c.

Function Documentation

◆ HtmlCtx_AddAttr()

int HtmlCtx_AddAttr ( GWEN_XML_CONTEXT ctx,
const char *  attrName,
const char *  attrData 
)

Definition at line 563 of file htmlctx.c.

References GWEN_DB_FLAGS_DEFAULT, GWEN_DB_SetCharValue(), and GWEN_INHERIT_GETDATA.

Referenced by HtmlCtx_new().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HtmlCtx_AddComment()

int HtmlCtx_AddComment ( GWEN_XML_CONTEXT ctx,
GWEN_UNUSED const char *  data 
)

Definition at line 549 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

Referenced by HtmlCtx_new().

Here is the caller graph for this function:

◆ HtmlCtx_AddData()

int HtmlCtx_AddData ( GWEN_XML_CONTEXT ctx,
const char *  data 
)

Definition at line 519 of file htmlctx.c.

References DBG_DEBUG, DBG_INFO, GWEN_ERROR_NOT_IMPLEMENTED, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, HtmlGroup_AddData(), and HtmlGroup_GetGroupName().

Referenced by HtmlCtx_new().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HtmlCtx_AddMediaPath()

void HtmlCtx_AddMediaPath ( GWEN_XML_CONTEXT ctx,
const char *  s 
)

Definition at line 173 of file htmlctx.c.

References GWEN_INHERIT_GETDATA, and GWEN_StringList_AppendString().

Referenced by FOX16_HtmlCtx::addMediaPath().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HtmlCtx_EndTag()

int HtmlCtx_EndTag ( GWEN_XML_CONTEXT ctx,
int  closing 
)

◆ HtmlCtx_FreeData()

GWENHYWFAR_CB void HtmlCtx_FreeData ( GWEN_UNUSED void *  bp,
void *  p 
)

Definition at line 79 of file htmlctx.c.

References GWEN_DB_Group_free(), GWEN_FREE_OBJECT, GWEN_StringList_free(), HtmlGroup_free(), HtmlGroup_GetParent(), and HtmlProps_free().

Referenced by HtmlCtx_new().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HtmlCtx_GetColorFromName()

uint32_t HtmlCtx_GetColorFromName ( const GWEN_XML_CONTEXT ctx,
const char *  name 
)

Definition at line 621 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

Referenced by HtmlGroup_Box_StartTag().

Here is the caller graph for this function:

◆ HtmlCtx_GetCurrentAttributes()

GWEN_DB_NODE * HtmlCtx_GetCurrentAttributes ( const GWEN_XML_CONTEXT ctx)

Definition at line 244 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

Referenced by HtmlGroup_Box_StartTag(), and HtmlGroup_TableRow_StartTag().

Here is the caller graph for this function:

◆ HtmlCtx_GetCurrentGroup()

HTML_GROUP * HtmlCtx_GetCurrentGroup ( const GWEN_XML_CONTEXT ctx)

Definition at line 188 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

◆ HtmlCtx_GetCurrentTagName()

const char * HtmlCtx_GetCurrentTagName ( const GWEN_XML_CONTEXT ctx)

Definition at line 214 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

◆ HtmlCtx_GetFont()

HTML_FONT * HtmlCtx_GetFont ( GWEN_XML_CONTEXT ctx,
const char *  fontName,
int  fontSize,
uint32_t  fontFlags 
)

Definition at line 638 of file htmlctx.c.

References GWEN_INHERIT_GETDATA, and NULL.

Referenced by FOX16_HtmlCtx::FOX16_HtmlCtx(), HtmlGroup_Box_StartTag(), and HtmlGroup_TableRow_StartTag().

Here is the caller graph for this function:

◆ HtmlCtx_GetHeight()

int HtmlCtx_GetHeight ( const GWEN_XML_CONTEXT ctx)

Definition at line 853 of file htmlctx.c.

References HtmlCtx_GetRootObject(), and HtmlObject_GetHeight().

Here is the call graph for this function:

◆ HtmlCtx_GetImage()

HTML_IMAGE * HtmlCtx_GetImage ( GWEN_XML_CONTEXT ctx,
const char *  imageName 
)

The implementation must set width and height in the image returned.

Definition at line 657 of file htmlctx.c.

References GWEN_INHERIT_GETDATA, and NULL.

Referenced by HtmlGroup_Box_StartTag().

Here is the caller graph for this function:

◆ HtmlCtx_GetMediaPaths()

GWEN_STRINGLIST * HtmlCtx_GetMediaPaths ( const GWEN_XML_CONTEXT ctx)

Definition at line 160 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

Referenced by FOX16_HtmlCtx::getImage().

Here is the caller graph for this function:

◆ HtmlCtx_GetObjects()

HTML_OBJECT_TREE * HtmlCtx_GetObjects ( const GWEN_XML_CONTEXT ctx)

Definition at line 257 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

◆ HtmlCtx_GetResolutionX()

int HtmlCtx_GetResolutionX ( const GWEN_XML_CONTEXT ctx)

Definition at line 108 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

◆ HtmlCtx_GetResolutionY()

int HtmlCtx_GetResolutionY ( const GWEN_XML_CONTEXT ctx)

Definition at line 134 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

Referenced by HtmlObject_Box_Layout().

Here is the caller graph for this function:

◆ HtmlCtx_GetRootObject()

HTML_OBJECT * HtmlCtx_GetRootObject ( const GWEN_XML_CONTEXT ctx)

◆ HtmlCtx_GetStandardProps()

HTML_PROPS * HtmlCtx_GetStandardProps ( const GWEN_XML_CONTEXT ctx)

Definition at line 373 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

◆ HtmlCtx_GetTextHeight()

int HtmlCtx_GetTextHeight ( GWEN_XML_CONTEXT ctx,
HTML_FONT fnt,
const char *  s 
)

Definition at line 603 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

Referenced by HtmlObject_Box_Layout(), and HtmlObject_Word_Layout().

Here is the caller graph for this function:

◆ HtmlCtx_GetTextWidth()

int HtmlCtx_GetTextWidth ( GWEN_XML_CONTEXT ctx,
HTML_FONT fnt,
const char *  s 
)

Definition at line 585 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

Referenced by HtmlObject_Word_Layout().

Here is the caller graph for this function:

◆ HtmlCtx_GetWidth()

int HtmlCtx_GetWidth ( const GWEN_XML_CONTEXT ctx)

Definition at line 840 of file htmlctx.c.

References HtmlCtx_GetRootObject(), and HtmlObject_GetWidth().

Here is the call graph for this function:

◆ HtmlCtx_Layout()

int HtmlCtx_Layout ( GWEN_XML_CONTEXT ctx,
int  width,
int  height 
)

Definition at line 761 of file htmlctx.c.

References DBG_ERROR, DBG_INFO, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, HtmlObject_Layout(), HtmlObject_SetHeight(), HtmlObject_SetWidth(), and NULL.

Referenced by FOX16_HtmlCtx::layout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HtmlCtx_new()

GWEN_XML_CONTEXT * HtmlCtx_new ( uint32_t  flags)

◆ HtmlCtx_SanitizeData()

int HtmlCtx_SanitizeData ( GWEN_UNUSED GWEN_XML_CONTEXT ctx,
const char *  data,
GWEN_BUFFER buf 
)

Definition at line 300 of file htmlctx.c.

References DBG_INFO, GWEN_Buffer_Crop(), GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_ERROR_BAD_DATA, GWEN_LOGDOMAIN, and GWEN_Text_UnescapeXmlToBuffer().

Referenced by HtmlGroup_Box_AddData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HtmlCtx_SetCurrentGroup()

void HtmlCtx_SetCurrentGroup ( GWEN_XML_CONTEXT ctx,
HTML_GROUP g 
)

Definition at line 201 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

Referenced by HtmlCtx_new(), HtmlCtx_SetText(), HtmlGroup_Box_StartTag(), HtmlGroup_Table_StartTag(), HtmlGroup_TableRow_StartTag(), and HtmlGroup_UnorderedList_StartTag().

Here is the caller graph for this function:

◆ HtmlCtx_SetCurrentTagName()

void HtmlCtx_SetCurrentTagName ( GWEN_XML_CONTEXT ctx,
const char *  s 
)

Definition at line 227 of file htmlctx.c.

References GWEN_INHERIT_GETDATA, and NULL.

Referenced by HtmlCtx_StartTag().

Here is the caller graph for this function:

◆ HtmlCtx_SetGetColorFromNameFn()

HTMLCTX_GET_COLOR_FROM_NAME_FN HtmlCtx_SetGetColorFromNameFn ( GWEN_XML_CONTEXT ctx,
HTMLCTX_GET_COLOR_FROM_NAME_FN  fn 
)

Definition at line 709 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

Referenced by FOX16_HtmlCtx::FOX16_HtmlCtx().

Here is the caller graph for this function:

◆ HtmlCtx_SetGetFontFn()

HTMLCTX_GET_FONT_FN HtmlCtx_SetGetFontFn ( GWEN_XML_CONTEXT ctx,
HTMLCTX_GET_FONT_FN  fn 
)

Definition at line 727 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

Referenced by FOX16_HtmlCtx::FOX16_HtmlCtx().

Here is the caller graph for this function:

◆ HtmlCtx_SetGetImageFn()

HTMLCTX_GET_IMAGE_FN HtmlCtx_SetGetImageFn ( GWEN_XML_CONTEXT ctx,
HTMLCTX_GET_IMAGE_FN  fn 
)

Definition at line 744 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

Referenced by FOX16_HtmlCtx::FOX16_HtmlCtx().

Here is the caller graph for this function:

◆ HtmlCtx_SetGetTextHeightFn()

HTMLCTX_GET_TEXT_HEIGHT_FN HtmlCtx_SetGetTextHeightFn ( GWEN_XML_CONTEXT ctx,
HTMLCTX_GET_TEXT_HEIGHT_FN  fn 
)

Definition at line 691 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

Referenced by FOX16_HtmlCtx::FOX16_HtmlCtx().

Here is the caller graph for this function:

◆ HtmlCtx_SetGetTextWidthFn()

HTMLCTX_GET_TEXT_WIDTH_FN HtmlCtx_SetGetTextWidthFn ( GWEN_XML_CONTEXT ctx,
HTMLCTX_GET_TEXT_WIDTH_FN  fn 
)

Definition at line 673 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

Referenced by FOX16_HtmlCtx::FOX16_HtmlCtx().

Here is the caller graph for this function:

◆ HtmlCtx_SetResolutionX()

void HtmlCtx_SetResolutionX ( GWEN_XML_CONTEXT ctx,
int  i 
)

Definition at line 121 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

◆ HtmlCtx_SetResolutionY()

void HtmlCtx_SetResolutionY ( GWEN_XML_CONTEXT ctx,
int  i 
)

Definition at line 147 of file htmlctx.c.

References GWEN_INHERIT_GETDATA.

◆ HtmlCtx_SetStandardProps()

void HtmlCtx_SetStandardProps ( GWEN_XML_CONTEXT ctx,
HTML_PROPS pr 
)

Definition at line 386 of file htmlctx.c.

References GWEN_INHERIT_GETDATA, HtmlGroup_GetParent(), HtmlGroup_SetProperties(), HtmlObject_GetProperties(), HtmlObject_SetProperties(), HtmlProps_Attach(), HtmlProps_free(), and NULL.

Referenced by FOX16_HtmlCtx::FOX16_HtmlCtx().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HtmlCtx_SetText()

void HtmlCtx_SetText ( GWEN_XML_CONTEXT ctx,
const char *  s 
)

◆ HtmlCtx_StartTag()

int HtmlCtx_StartTag ( GWEN_XML_CONTEXT ctx,
const char *  tagName 
)

Definition at line 410 of file htmlctx.c.

References DBG_DEBUG, GWEN_DB_Group_free(), GWEN_DB_Group_new(), GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and HtmlCtx_SetCurrentTagName().

Referenced by HtmlCtx_new().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HtmlCtx_TakeObjects()

HTML_OBJECT_TREE * HtmlCtx_TakeObjects ( const GWEN_XML_CONTEXT ctx)

Definition at line 270 of file htmlctx.c.

References GWEN_INHERIT_GETDATA, and NULL.