X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2Fsvgtiny_css.c;h=9faf8180f7bbd3d3d646ba5639acb0cd6edb0410;hb=7631bb4f5133b45639b71280864c4099c50400db;hp=f112ca30ed5e637a14968d2260eefe738372177e;hpb=437bbf937bf78d100180407e1e92dd881f170f63;p=libsvgtiny.git diff --git a/src/svgtiny_css.c b/src/svgtiny_css.c index f112ca3..9faf818 100644 --- a/src/svgtiny_css.c +++ b/src/svgtiny_css.c @@ -19,3 +19,37 @@ css_error svgtiny_resolve_url(void *pw, *abs = lwc_string_ref(rel); return CSS_OK; } + +/** + * Create a stylesheet with the default set of params. + * + * \param sheet A stylesheet pointer, passed in by reference, that + * we use to store the newly-created stylesheet. + * \param inline_style True if this stylesheet represents an inline + * style, and false otherwise. + * + * \return The return value from css_stylesheet_create() is returned. + */ +css_error svgtiny_create_stylesheet(css_stylesheet **sheet, + bool inline_style) +{ + css_stylesheet_params params; + + params.params_version = CSS_STYLESHEET_PARAMS_VERSION_1; + params.level = CSS_LEVEL_DEFAULT; + params.charset = NULL; + params.url = ""; + params.title = NULL; + params.allow_quirks = false; + params.inline_style = inline_style; + params.resolve = svgtiny_resolve_url; + params.resolve_pw = NULL; + params.import = NULL; + params.import_pw = NULL; + params.color = NULL; + params.color_pw = NULL; + params.font = NULL; + params.font_pw = NULL; + + return css_stylesheet_create(¶ms, sheet); +}