diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2011-02-02 00:15:46 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2011-02-02 00:15:46 +0000 |
commit | c3d7df723ce46d280f3e0edf558aed333a94d81f (patch) | |
tree | 783f7d1944ab4e80cfc1ed7964fe84333b38e206 /include | |
parent | f47faa2c143853fd7e4c2804527ddc810fe2dada (diff) | |
download | libcss-c3d7df723ce46d280f3e0edf558aed333a94d81f.tar.gz libcss-c3d7df723ce46d280f3e0edf558aed333a94d81f.tar.bz2 |
add system font hook
svn path=/trunk/libcss/; revision=11599
Diffstat (limited to 'include')
-rw-r--r-- | include/libcss/stylesheet.h | 34 | ||||
-rw-r--r-- | include/libcss/types.h | 2 |
2 files changed, 36 insertions, 0 deletions
diff --git a/include/libcss/stylesheet.h b/include/libcss/stylesheet.h index 3c5b92e..9284658 100644 --- a/include/libcss/stylesheet.h +++ b/include/libcss/stylesheet.h @@ -15,6 +15,7 @@ extern "C" #include <libcss/errors.h> #include <libcss/types.h> +#include <libcss/properties.h> /** * Callback to resolve an URL @@ -59,6 +60,34 @@ typedef css_error (*css_import_notification_fn)(void *pw, typedef css_error (*css_color_resolution_fn)(void *pw, lwc_string *name, css_color *color); +/** System font callback result data. */ +struct css_system_font { + enum css_font_style_e style; + enum css_font_variant_e variant; + enum css_font_weight_e weight; + struct { + css_fixed size; + css_unit unit; + } size; + struct { + css_fixed size; + css_unit unit; + } line_height; + lwc_string *family; +}; + +/** + * Callback use to resolve system font names to font values + * + * \param pw Client data + * \param name System colour name + * \param color Pointer to system font to be filled + * \return CSS_OK on success, + * CSS_INVALID if the name is unknown. + */ +typedef css_error (*css_font_resolution_fn)(void *pw, + lwc_string *name, css_system_font *system_font); + /** * Parameter block for css_stylesheet_create() */ @@ -92,6 +121,11 @@ typedef struct css_stylesheet_params { css_color_resolution_fn color; /** Client private data for color */ void *color_pw; + + /** Font resolution function */ + css_font_resolution_fn font; + /** Client private data for color */ + void *font_pw; } css_stylesheet_params; css_error css_stylesheet_create(css_stylesheet_params *params, diff --git a/include/libcss/types.h b/include/libcss/types.h index 8bc65a9..d1f0d51 100644 --- a/include/libcss/types.h +++ b/include/libcss/types.h @@ -106,6 +106,8 @@ typedef struct css_select_ctx css_select_ctx; typedef struct css_computed_style css_computed_style; +typedef struct css_system_font css_system_font; + #ifdef __cplusplus } #endif |