]> gitweb.michael.orlitzky.com - libsvgtiny.git/blobdiff - src/svgtiny_internal.h
src/svgtiny{.c,_internal.h}: intern SVG's XML namespace URI
[libsvgtiny.git] / src / svgtiny_internal.h
index 158d23059c60c5ea69b01e71ad2fe58832cacbfb..ba0db7029b30d719dc74d2dd401fdce9d1de0ac7 100644 (file)
@@ -11,6 +11,7 @@
 #include <stdbool.h>
 
 #include <dom/dom.h>
+#include <libcss/libcss.h>
 
 #ifndef UNUSED
 #define UNUSED(x) ((void) (x))
@@ -46,7 +47,12 @@ struct svgtiny_parse_state {
                float a, b, c, d, e, f;
        } ctm;
 
-       /*struct css_style style;*/
+       /* A libcss context to hold any stylesheets that are present
+        * in the SVG document. This should be pre-populated rather
+        * than on-the-fly, because, for example, a <style> sheet at
+        * the end of the document should affect the SVG elements that
+        * precede it. */
+       css_select_ctx *select_ctx;
 
        /* paint attributes */
        svgtiny_colour fill;
@@ -62,6 +68,14 @@ struct svgtiny_parse_state {
 #include "svgtiny_strings.h"
 #undef SVGTINY_STRING_ACTION2
 
+       /* Where we store the interned copy of the SVG XML namespace,
+        *
+        *   http://www.w3.org/2000/svg
+        *
+        * We handle it separately it has a different type
+        * (lwc_string) than those above (dom_string).
+        */
+       lwc_string *interned_svg_xmlns;
 };
 
 struct svgtiny_list;
@@ -85,6 +99,10 @@ char *svgtiny_strndup(const char *s, size_t n);
 #define strndup svgtiny_strndup
 #endif
 
+/* svgtiny_css.c */
+css_error svgtiny_create_stylesheet(css_stylesheet **sheet,
+               bool inline_style);
+
 /* svgtiny_gradient.c */
 void svgtiny_find_gradient(const char *id,
                struct svgtiny_parse_state_gradient *grad,
@@ -102,9 +120,4 @@ void *svgtiny_list_get(struct svgtiny_list *list,
 void *svgtiny_list_push(struct svgtiny_list *list);
 void svgtiny_list_free(struct svgtiny_list *list);
 
-/* colors.gperf */
-const struct svgtiny_named_color *
-               svgtiny_color_lookup(register const char *str,
-                               register unsigned int len);
-
 #endif