gwenhywfar 4.0.3

htmlctx_be.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  begin       : Mon Feb 22 2010
00003  copyright   : (C) 2010 by Martin Preuss
00004  email       : martin@libchipcard.de
00005 
00006  ***************************************************************************
00007  *          Please see toplevel file COPYING for license details           *
00008  ***************************************************************************/
00009 
00010 
00011 #ifndef HTMLXMLCTX_BE_H
00012 #define HTMLXMLCTX_BE_H
00013 
00014 #include <gwenhywfar/htmlfont_be.h>
00015 #include <gwenhywfar/htmlobject_be.h>
00016 #include <gwenhywfar/htmlimage_be.h>
00017 
00018 #include <gwenhywfar/xmlctx.h>
00019 #include <gwenhywfar/stringlist.h>
00020 
00021 
00022 #ifdef __cplusplus
00023 extern "C" {
00024 #endif
00025 
00026 
00027 typedef int (*HTMLCTX_GET_TEXT_WIDTH_FN)(GWEN_XML_CONTEXT *ctx,
00028                                          HTML_FONT *fnt,
00029                                          const char *s);
00030 
00031 typedef int (*HTMLCTX_GET_TEXT_HEIGHT_FN)(GWEN_XML_CONTEXT *ctx,
00032                                           HTML_FONT *fnt,
00033                                           const char *s);
00034 
00035 
00036 typedef uint32_t (*HTMLCTX_GET_COLOR_FROM_NAME_FN)(const GWEN_XML_CONTEXT *ctx, const char *s);
00037 
00038 
00039 typedef HTML_FONT* (*HTMLCTX_GET_FONT_FN)(GWEN_XML_CONTEXT *ctx,
00040                                           const char *fontName,
00041                                           int fontSize,
00042                                           uint32_t fontFlags);
00043 
00044 typedef HTML_IMAGE* (*HTMLCTX_GET_IMAGE_FN)(GWEN_XML_CONTEXT *ctx, const char *imageName);
00045 
00046 
00047 
00048 GWENHYWFAR_API
00049 GWEN_XML_CONTEXT *HtmlCtx_new(uint32_t flags);
00050 
00051 GWENHYWFAR_API 
00052 void HtmlCtx_SetText(GWEN_XML_CONTEXT *ctx, const char *s);
00053 
00054 GWENHYWFAR_API 
00055 int HtmlCtx_Layout(GWEN_XML_CONTEXT *ctx, int width, int height);
00056 
00057 GWENHYWFAR_API 
00058 HTML_OBJECT *HtmlCtx_GetRootObject(const GWEN_XML_CONTEXT *ctx);
00059 
00060 
00061 GWENHYWFAR_API 
00062 HTML_FONT *HtmlCtx_GetFont(GWEN_XML_CONTEXT *ctx,
00063                            const char *fontName,
00064                            int fontSize,
00065                            uint32_t fontFlags);
00066 
00070 GWENHYWFAR_API 
00071 HTML_IMAGE *HtmlCtx_GetImage(GWEN_XML_CONTEXT *ctx, const char *imageName);
00072 
00073 GWENHYWFAR_API 
00074 HTML_PROPS *HtmlCtx_GetStandardProps(const GWEN_XML_CONTEXT *ctx);
00075 
00076 GWENHYWFAR_API 
00077 void HtmlCtx_SetStandardProps(GWEN_XML_CONTEXT *ctx, HTML_PROPS *pr);
00078 
00079 
00080 GWENHYWFAR_API 
00081 int HtmlCtx_GetWidth(const GWEN_XML_CONTEXT *ctx);
00082 
00083 GWENHYWFAR_API 
00084 int HtmlCtx_GetHeight(const GWEN_XML_CONTEXT *ctx);
00085 
00086 
00087 GWENHYWFAR_API 
00088 int HtmlCtx_GetResolutionX(const GWEN_XML_CONTEXT *ctx);
00089 
00090 GWENHYWFAR_API 
00091 void HtmlCtx_SetResolutionX(GWEN_XML_CONTEXT *ctx, int i);
00092 
00093 GWENHYWFAR_API 
00094 int HtmlCtx_GetResolutionY(const GWEN_XML_CONTEXT *ctx);
00095 
00096 GWENHYWFAR_API 
00097 void HtmlCtx_SetResolutionY(GWEN_XML_CONTEXT *ctx, int i);
00098 
00099 
00100 GWENHYWFAR_API 
00101 GWEN_STRINGLIST *HtmlCtx_GetMediaPaths(const GWEN_XML_CONTEXT *ctx);
00102 
00103 GWENHYWFAR_API 
00104 void HtmlCtx_AddMediaPath(GWEN_XML_CONTEXT *ctx, const char *s);
00105 
00106 
00107 GWENHYWFAR_API 
00108 HTMLCTX_GET_TEXT_WIDTH_FN HtmlCtx_SetGetTextWidthFn(GWEN_XML_CONTEXT *ctx,
00109                                                     HTMLCTX_GET_TEXT_WIDTH_FN fn);
00110 
00111 GWENHYWFAR_API 
00112 HTMLCTX_GET_TEXT_HEIGHT_FN HtmlCtx_SetGetTextHeightFn(GWEN_XML_CONTEXT *ctx,
00113                                                       HTMLCTX_GET_TEXT_HEIGHT_FN fn);
00114 
00115 
00116 GWENHYWFAR_API 
00117 HTMLCTX_GET_COLOR_FROM_NAME_FN HtmlCtx_SetGetColorFromNameFn(GWEN_XML_CONTEXT *ctx,
00118                                                              HTMLCTX_GET_COLOR_FROM_NAME_FN fn);
00119 
00120 GWENHYWFAR_API 
00121 HTMLCTX_GET_FONT_FN HtmlCtx_SetGetFontFn(GWEN_XML_CONTEXT *ctx,
00122                                          HTMLCTX_GET_FONT_FN fn);
00123 
00124 GWENHYWFAR_API 
00125 HTMLCTX_GET_IMAGE_FN HtmlCtx_SetGetImageFn(GWEN_XML_CONTEXT *ctx, HTMLCTX_GET_IMAGE_FN fn);
00126 
00127 #ifdef __cplusplus
00128 }
00129 #endif
00130 
00131 #endif
00132