summaryrefslogtreecommitdiffstats
path: root/src/libcroco
diff options
context:
space:
mode:
authorMichael Soegtrop <MSoegtrop@yahoo.de>2017-06-05 13:01:17 +0000
committerMichael Soegtrop <MSoegtrop@yahoo.de>2017-06-05 13:01:17 +0000
commite7248b2fa042f42a5c4dd14cd86ab6a5b4524059 (patch)
tree9097520c54e355ded9bd0b4d6618af4e8dacdd91 /src/libcroco
parentupdated to latest trunk (diff)
parent[Bug #1695016] Xaml export misses some radialGradients. (diff)
downloadinkscape-e7248b2fa042f42a5c4dd14cd86ab6a5b4524059.tar.gz
inkscape-e7248b2fa042f42a5c4dd14cd86ab6a5b4524059.zip
updated to latest trunk
(bzr r14876.2.4)
Diffstat (limited to 'src/libcroco')
-rw-r--r--src/libcroco/Makefile_insert64
-rw-r--r--src/libcroco/cr-parser.c2
-rw-r--r--src/libcroco/cr-parser.h2
-rw-r--r--src/libcroco/cr-selector.c25
4 files changed, 27 insertions, 66 deletions
diff --git a/src/libcroco/Makefile_insert b/src/libcroco/Makefile_insert
deleted file mode 100644
index 97ed49ee8..000000000
--- a/src/libcroco/Makefile_insert
+++ /dev/null
@@ -1,64 +0,0 @@
-## Makefile.am fragment sourced by src/Makefile.am.
-
-libcroco/all: libcroco/libcroco.a
-
-libcroco/clean:
- rm -f libcroco/libcroco.a $(libcroco_libcroco_a_OBJECTS)
-
-libcroco_libcroco_a_SOURCES = \
- libcroco/cr-utils.c \
- libcroco/cr-utils.h \
- libcroco/cr-input.c \
- libcroco/cr-input.h \
- libcroco/cr-enc-handler.c \
- libcroco/cr-enc-handler.h \
- libcroco/cr-num.c \
- libcroco/cr-num.h \
- libcroco/cr-rgb.c \
- libcroco/cr-rgb.h \
- libcroco/cr-token.c \
- libcroco/cr-token.h \
- libcroco/cr-tknzr.c \
- libcroco/cr-tknzr.h \
- libcroco/cr-term.c \
- libcroco/cr-term.h \
- libcroco/cr-attr-sel.c \
- libcroco/cr-attr-sel.h \
- libcroco/cr-pseudo.c \
- libcroco/cr-pseudo.h \
- libcroco/cr-additional-sel.c \
- libcroco/cr-additional-sel.h \
- libcroco/cr-simple-sel.c \
- libcroco/cr-simple-sel.h \
- libcroco/cr-selector.c \
- libcroco/cr-selector.h \
- libcroco/cr-doc-handler.c \
- libcroco/cr-doc-handler.h \
- libcroco/cr-parser.c \
- libcroco/cr-parser.h \
- libcroco/cr-declaration.c \
- libcroco/cr-declaration.h \
- libcroco/cr-statement.c \
- libcroco/cr-statement.h \
- libcroco/cr-stylesheet.c \
- libcroco/cr-stylesheet.h \
- libcroco/cr-cascade.c \
- libcroco/cr-cascade.h \
- libcroco/cr-om-parser.c \
- libcroco/cr-om-parser.h \
- libcroco/cr-style.c \
- libcroco/cr-style.h \
- libcroco/cr-libxml-node-iface.c \
- libcroco/cr-libxml-node-iface.h \
- libcroco/cr-node-iface.h \
- libcroco/cr-sel-eng.c \
- libcroco/cr-sel-eng.h \
- libcroco/cr-fonts.c \
- libcroco/cr-fonts.h \
- libcroco/cr-prop-list.c \
- libcroco/cr-prop-list.h \
- libcroco/cr-parsing-location.c \
- libcroco/cr-parsing-location.h \
- libcroco/cr-string.c \
- libcroco/cr-string.h \
- libcroco/libcroco.h
diff --git a/src/libcroco/cr-parser.c b/src/libcroco/cr-parser.c
index 544b35ab0..4e50b5402 100644
--- a/src/libcroco/cr-parser.c
+++ b/src/libcroco/cr-parser.c
@@ -2002,7 +2002,7 @@ cr_parser_parse_simple_sels (CRParser * a_this,
*Returns CR_OK upon successful completion, an error
*code otherwise.
*/
-static enum CRStatus
+enum CRStatus
cr_parser_parse_selector (CRParser * a_this,
CRSelector ** a_selector)
{
diff --git a/src/libcroco/cr-parser.h b/src/libcroco/cr-parser.h
index 6dce9439e..24cf5dfe8 100644
--- a/src/libcroco/cr-parser.h
+++ b/src/libcroco/cr-parser.h
@@ -97,6 +97,8 @@ enum CRStatus cr_parser_set_default_sac_handler (CRParser *a_this) ;
enum CRStatus cr_parser_parse_term (CRParser *a_this, CRTerm **a_term) ;
+enum CRStatus cr_parser_parse_selector (CRParser * a_this, CRSelector ** a_selector) ;
+
enum CRStatus cr_parser_parse_expr (CRParser *a_this, CRTerm **a_expr) ;
enum CRStatus cr_parser_parse_prio (CRParser *a_this, CRString **a_prio) ;
diff --git a/src/libcroco/cr-selector.c b/src/libcroco/cr-selector.c
index c56c43fda..f9193feda 100644
--- a/src/libcroco/cr-selector.c
+++ b/src/libcroco/cr-selector.c
@@ -51,6 +51,19 @@ cr_selector_new (CRSimpleSel * a_simple_sel)
return result;
}
+/**
+ * cr_selector_parse_from_buf:
+ *
+ *@a_char_buf: the buffer to parse.
+ *@a_enc: the encoding of the input buffer a_char_buf.
+ *
+ *Parses a buf for selectors.
+ *
+ *Fix Me: parsing will fail for some cases if buf does not end with '{'.
+ *
+ *Returns the newly built instance of #CRSelector, or
+ *NULL in case of failure.
+ */
CRSelector *
cr_selector_parse_from_buf (const guchar * a_char_buf, enum CREncoding a_enc)
{
@@ -62,7 +75,17 @@ cr_selector_parse_from_buf (const guchar * a_char_buf, enum CREncoding a_enc)
a_enc, FALSE);
g_return_val_if_fail (parser, NULL);
- return NULL;
+ CRSelector *selector = NULL;
+ enum CRStatus status = CR_OK;
+ status = cr_parser_parse_selector (parser, &selector);
+
+ if (status != CR_OK) {
+ if (selector) {
+ cr_selector_unref (selector);
+ selector = NULL;
+ }
+ }
+ return selector;
}
/**