rsvg2 2.2.4-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +7 -0
  2. data/README +35 -0
  3. data/Rakefile +69 -0
  4. data/ext/rsvg2/depend +6 -0
  5. data/ext/rsvg2/extconf.rb +89 -0
  6. data/ext/rsvg2/rbrsvg.c +206 -0
  7. data/ext/rsvg2/rbrsvgdimensiondata.c +194 -0
  8. data/ext/rsvg2/rbrsvghandle.c +496 -0
  9. data/ext/rsvg2/rsvg2.def +2 -0
  10. data/ext/rsvg2/rsvg2.h +70 -0
  11. data/extconf.rb +49 -0
  12. data/lib/2.0/rsvg2.so +0 -0
  13. data/lib/2.1/rsvg2.so +0 -0
  14. data/lib/2.2/rsvg2.so +0 -0
  15. data/lib/rsvg2.rb +33 -0
  16. data/sample/svg-viewer.rb +44 -0
  17. data/sample/svg2.rb +60 -0
  18. data/test/rsvg2-test-utils.rb +23 -0
  19. data/test/run-test.rb +49 -0
  20. data/test/test-handle.rb +91 -0
  21. data/vendor/local/bin/croco-0.6-config +87 -0
  22. data/vendor/local/bin/csslint-0.6.exe +0 -0
  23. data/vendor/local/bin/libcroco-0.6-3.dll +0 -0
  24. data/vendor/local/bin/librsvg-2-2.dll +0 -0
  25. data/vendor/local/bin/rsvg-convert.exe +0 -0
  26. data/vendor/local/include/libcroco-0.6/libcroco/cr-additional-sel.h +98 -0
  27. data/vendor/local/include/libcroco-0.6/libcroco/cr-attr-sel.h +74 -0
  28. data/vendor/local/include/libcroco-0.6/libcroco/cr-cascade.h +74 -0
  29. data/vendor/local/include/libcroco-0.6/libcroco/cr-declaration.h +136 -0
  30. data/vendor/local/include/libcroco-0.6/libcroco/cr-doc-handler.h +298 -0
  31. data/vendor/local/include/libcroco-0.6/libcroco/cr-enc-handler.h +94 -0
  32. data/vendor/local/include/libcroco-0.6/libcroco/cr-fonts.h +315 -0
  33. data/vendor/local/include/libcroco-0.6/libcroco/cr-input.h +174 -0
  34. data/vendor/local/include/libcroco-0.6/libcroco/cr-num.h +127 -0
  35. data/vendor/local/include/libcroco-0.6/libcroco/cr-om-parser.h +98 -0
  36. data/vendor/local/include/libcroco-0.6/libcroco/cr-parser.h +128 -0
  37. data/vendor/local/include/libcroco-0.6/libcroco/cr-parsing-location.h +70 -0
  38. data/vendor/local/include/libcroco-0.6/libcroco/cr-prop-list.h +80 -0
  39. data/vendor/local/include/libcroco-0.6/libcroco/cr-pseudo.h +64 -0
  40. data/vendor/local/include/libcroco-0.6/libcroco/cr-rgb.h +94 -0
  41. data/vendor/local/include/libcroco-0.6/libcroco/cr-sel-eng.h +110 -0
  42. data/vendor/local/include/libcroco-0.6/libcroco/cr-selector.h +95 -0
  43. data/vendor/local/include/libcroco-0.6/libcroco/cr-simple-sel.h +130 -0
  44. data/vendor/local/include/libcroco-0.6/libcroco/cr-statement.h +440 -0
  45. data/vendor/local/include/libcroco-0.6/libcroco/cr-string.h +76 -0
  46. data/vendor/local/include/libcroco-0.6/libcroco/cr-style.h +339 -0
  47. data/vendor/local/include/libcroco-0.6/libcroco/cr-stylesheet.h +102 -0
  48. data/vendor/local/include/libcroco-0.6/libcroco/cr-term.h +190 -0
  49. data/vendor/local/include/libcroco-0.6/libcroco/cr-tknzr.h +115 -0
  50. data/vendor/local/include/libcroco-0.6/libcroco/cr-token.h +212 -0
  51. data/vendor/local/include/libcroco-0.6/libcroco/cr-utils.h +246 -0
  52. data/vendor/local/include/libcroco-0.6/libcroco/libcroco-config.h +17 -0
  53. data/vendor/local/include/libcroco-0.6/libcroco/libcroco.h +44 -0
  54. data/vendor/local/include/librsvg-2.0/librsvg/librsvg-enum-types.h +24 -0
  55. data/vendor/local/include/librsvg-2.0/librsvg/librsvg-features.h +28 -0
  56. data/vendor/local/include/librsvg-2.0/librsvg/rsvg-cairo.h +42 -0
  57. data/vendor/local/include/librsvg-2.0/librsvg/rsvg.h +264 -0
  58. data/vendor/local/lib/girepository-1.0/Rsvg-2.0.typelib +0 -0
  59. data/vendor/local/lib/libcroco-0.6.a +0 -0
  60. data/vendor/local/lib/libcroco-0.6.dll.a +0 -0
  61. data/vendor/local/lib/libcroco-0.6.la +41 -0
  62. data/vendor/local/lib/librsvg-2.a +0 -0
  63. data/vendor/local/lib/librsvg-2.dll.a +0 -0
  64. data/vendor/local/lib/librsvg-2.la +41 -0
  65. data/vendor/local/lib/pkgconfig/libcroco-0.6.pc +11 -0
  66. data/vendor/local/lib/pkgconfig/librsvg-2.0.pc +15 -0
  67. data/vendor/local/share/gir-1.0/Rsvg-2.0.gir +754 -0
  68. data/vendor/local/share/gtk-doc/html/libcroco/ch01.html +113 -0
  69. data/vendor/local/share/gtk-doc/html/libcroco/home.png +0 -0
  70. data/vendor/local/share/gtk-doc/html/libcroco/index.html +109 -0
  71. data/vendor/local/share/gtk-doc/html/libcroco/index.sgml +582 -0
  72. data/vendor/local/share/gtk-doc/html/libcroco/left.png +0 -0
  73. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-additional-sel.html +337 -0
  74. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-attr-sel.html +203 -0
  75. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-cascade.html +240 -0
  76. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-declaration.html +642 -0
  77. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-doc-handler.html +517 -0
  78. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-enc-handler.html +164 -0
  79. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-fonts.html +670 -0
  80. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-input.html +1102 -0
  81. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-num.html +265 -0
  82. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-om-parser.html +380 -0
  83. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-parser.html +913 -0
  84. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-parsing-location.html +205 -0
  85. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-prop-list.html +421 -0
  86. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-pseudo.html +141 -0
  87. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-rgb.html +503 -0
  88. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-sel-eng.html +346 -0
  89. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-selector.html +246 -0
  90. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-simple-sel.html +240 -0
  91. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-statement.html +1408 -0
  92. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-string.html +137 -0
  93. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-style.html +384 -0
  94. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-stylesheet.html +158 -0
  95. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-term.html +304 -0
  96. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-tknzr.html +312 -0
  97. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-token.html +428 -0
  98. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-utils.html +334 -0
  99. data/vendor/local/share/gtk-doc/html/libcroco/libcroco-libcroco-config.html +80 -0
  100. data/vendor/local/share/gtk-doc/html/libcroco/libcroco.devhelp2 +511 -0
  101. data/vendor/local/share/gtk-doc/html/libcroco/right.png +0 -0
  102. data/vendor/local/share/gtk-doc/html/libcroco/style.css +266 -0
  103. data/vendor/local/share/gtk-doc/html/libcroco/up.png +0 -0
  104. data/vendor/local/share/gtk-doc/html/rsvg-2.0/RsvgHandle.html +1420 -0
  105. data/vendor/local/share/gtk-doc/html/rsvg-2.0/annotation-glossary.html +55 -0
  106. data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-14.html +55 -0
  107. data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-22.html +43 -0
  108. data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-32.html +47 -0
  109. data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-36.html +46 -0
  110. data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-4.html +39 -0
  111. data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-8.html +54 -0
  112. data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-9.html +53 -0
  113. data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-deprecated.html +100 -0
  114. data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-full.html +323 -0
  115. data/vendor/local/share/gtk-doc/html/rsvg-2.0/home.png +0 -0
  116. data/vendor/local/share/gtk-doc/html/rsvg-2.0/index.html +88 -0
  117. data/vendor/local/share/gtk-doc/html/rsvg-2.0/index.sgml +106 -0
  118. data/vendor/local/share/gtk-doc/html/rsvg-2.0/left-insensitive.png +0 -0
  119. data/vendor/local/share/gtk-doc/html/rsvg-2.0/left.png +0 -0
  120. data/vendor/local/share/gtk-doc/html/rsvg-2.0/licence.html +57 -0
  121. data/vendor/local/share/gtk-doc/html/rsvg-2.0/object-tree.html +38 -0
  122. data/vendor/local/share/gtk-doc/html/rsvg-2.0/right-insensitive.png +0 -0
  123. data/vendor/local/share/gtk-doc/html/rsvg-2.0/right.png +0 -0
  124. data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg-2.0.devhelp2 +94 -0
  125. data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg-Using-RSVG-with-GIO.html +360 -0
  126. data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg-Using-RSVG-with-GdkPixbuf.html +484 -0
  127. data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg-Using-RSVG-with-cairo.html +154 -0
  128. data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg-Version-check-and-feature-tests.html +142 -0
  129. data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg.html +57 -0
  130. data/vendor/local/share/gtk-doc/html/rsvg-2.0/style.css +476 -0
  131. data/vendor/local/share/gtk-doc/html/rsvg-2.0/up-insensitive.png +0 -0
  132. data/vendor/local/share/gtk-doc/html/rsvg-2.0/up.png +0 -0
  133. data/vendor/local/share/license/libcroco/AUTHORS +13 -0
  134. data/vendor/local/share/license/libcroco/COPYING +481 -0
  135. data/vendor/local/share/license/libcroco/COPYING.LIB +481 -0
  136. data/vendor/local/share/license/librsvg/AUTHORS +1 -0
  137. data/vendor/local/share/license/librsvg/COPYING +340 -0
  138. data/vendor/local/share/license/librsvg/COPYING.LIB +482 -0
  139. data/vendor/local/share/man/man1/rsvg-convert.1 +55 -0
  140. metadata +209 -0
@@ -0,0 +1,64 @@
1
+ /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
2
+
3
+ /*
4
+ * This file is part of The Croco Library
5
+ *
6
+ * This program is free software; you can redistribute it and/or
7
+ * modify it under the terms of version 2.1 of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18
+ * USA
19
+ *
20
+ * See COPYRIGHTS file for copyright information
21
+ */
22
+
23
+ #ifndef __CR_PSEUDO_H__
24
+ #define __CR_PSEUDO_H__
25
+
26
+ #include <stdio.h>
27
+ #include <glib.h>
28
+ #include "cr-attr-sel.h"
29
+ #include "cr-parsing-location.h"
30
+
31
+ G_BEGIN_DECLS
32
+
33
+ enum CRPseudoType
34
+ {
35
+ IDENT_PSEUDO = 0,
36
+ FUNCTION_PSEUDO
37
+ } ;
38
+
39
+ typedef struct _CRPseudo CRPseudo ;
40
+
41
+ /**
42
+ *The CRPseudo Class.
43
+ *Abstract a "pseudo" as defined by the css2 spec
44
+ *in appendix D.1 .
45
+ */
46
+ struct _CRPseudo
47
+ {
48
+ enum CRPseudoType type ;
49
+ CRString *name ;
50
+ CRString *extra ;
51
+ CRParsingLocation location ;
52
+ } ;
53
+
54
+ CRPseudo * cr_pseudo_new (void) ;
55
+
56
+ guchar * cr_pseudo_to_string (CRPseudo const *a_this) ;
57
+
58
+ void cr_pseudo_dump (CRPseudo const *a_this, FILE *a_fp) ;
59
+
60
+ void cr_pseudo_destroy (CRPseudo *a_this) ;
61
+
62
+ G_END_DECLS
63
+
64
+ #endif /*__CR_PSEUDO_H__*/
@@ -0,0 +1,94 @@
1
+ /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
2
+
3
+ /*
4
+ * This file is part of The Croco Library
5
+ *
6
+ * This program is free software; you can redistribute it and/or
7
+ * modify it under the terms of version 2.1 of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18
+ * USA
19
+ *
20
+ * see COPYRIGHTS file for copyright information.
21
+ */
22
+
23
+ #ifndef __CR_RGB_H__
24
+ #define __CR_RGB_H__
25
+
26
+ #include <stdio.h>
27
+ #include <glib.h>
28
+ #include "cr-utils.h"
29
+ #include "cr-parsing-location.h"
30
+
31
+ G_BEGIN_DECLS
32
+
33
+
34
+ typedef struct _CRRgb CRRgb ;
35
+ struct _CRRgb
36
+ {
37
+ /*
38
+ *the unit of the rgb.
39
+ *Either NO_UNIT (integer) or
40
+ *UNIT_PERCENTAGE (percentage).
41
+ */
42
+ const guchar *name ;
43
+ glong red ;
44
+ glong green ;
45
+ glong blue ;
46
+ gboolean is_percentage ;
47
+ gboolean inherit ;
48
+ gboolean is_transparent ;
49
+ CRParsingLocation location ;
50
+ } ;
51
+
52
+ CRRgb * cr_rgb_new (void) ;
53
+
54
+ CRRgb * cr_rgb_new_with_vals (gulong a_red, gulong a_green,
55
+ gulong a_blue, gboolean a_is_percentage) ;
56
+
57
+ CRRgb *cr_rgb_parse_from_buf(const guchar *a_str,
58
+ enum CREncoding a_enc);
59
+
60
+ enum CRStatus cr_rgb_compute_from_percentage (CRRgb *a_this) ;
61
+
62
+ enum CRStatus cr_rgb_set (CRRgb *a_this, gulong a_red,
63
+ gulong a_green, gulong a_blue,
64
+ gboolean a_is_percentage) ;
65
+
66
+ enum CRStatus cr_rgb_copy (CRRgb *a_dest, CRRgb const *a_src) ;
67
+
68
+ enum CRStatus cr_rgb_set_to_inherit (CRRgb *a_this, gboolean a_inherit) ;
69
+
70
+ gboolean cr_rgb_is_set_to_inherit (CRRgb const *a_this) ;
71
+
72
+ gboolean cr_rgb_is_set_to_transparent (CRRgb const *a_this) ;
73
+
74
+ enum CRStatus cr_rgb_set_to_transparent (CRRgb *a_this,
75
+ gboolean a_is_transparent) ;
76
+ enum CRStatus cr_rgb_set_from_rgb (CRRgb *a_this, CRRgb const *a_rgb) ;
77
+
78
+ enum CRStatus cr_rgb_set_from_name (CRRgb *a_this, const guchar *a_color_name) ;
79
+
80
+ enum CRStatus cr_rgb_set_from_hex_str (CRRgb *a_this, const guchar * a_hex_value) ;
81
+
82
+ struct _CRTerm;
83
+
84
+ enum CRStatus cr_rgb_set_from_term (CRRgb *a_this, const struct _CRTerm *a_value);
85
+
86
+ guchar * cr_rgb_to_string (CRRgb const *a_this) ;
87
+
88
+ void cr_rgb_dump (CRRgb const *a_this, FILE *a_fp) ;
89
+
90
+ void cr_rgb_destroy (CRRgb *a_this) ;
91
+
92
+ G_END_DECLS
93
+
94
+ #endif /*__CR_RGB_H__*/
@@ -0,0 +1,110 @@
1
+ /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
2
+
3
+ /*
4
+ * This file is part of The Croco Library
5
+ *
6
+ * This program is free software; you can redistribute it and/or
7
+ * modify it under the terms of version 2.1 of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18
+ * USA
19
+ *
20
+ * Author: Dodji Seketeli
21
+ * See COPYRIGHTS file for copyrights information.
22
+ */
23
+
24
+ #ifndef __CR_SEL_ENG_H__
25
+ #define __CR_SEL_ENG_H__
26
+
27
+ #include "cr-utils.h"
28
+ #include "cr-stylesheet.h"
29
+ #include "cr-cascade.h"
30
+ #include "cr-style.h"
31
+ #include "cr-prop-list.h"
32
+
33
+ #include <libxml/tree.h>
34
+
35
+ /**
36
+ *@file:
37
+ *The declaration of the #CRSelEng class.
38
+ *The #CRSelEng is actually the "Selection Engine"
39
+ *class.
40
+ */
41
+
42
+ G_BEGIN_DECLS
43
+
44
+ typedef struct _CRSelEng CRSelEng ;
45
+ typedef struct _CRSelEngPriv CRSelEngPriv ;
46
+
47
+ /**
48
+ *The Selection engine class.
49
+ *The main service provided by this class, is
50
+ *the ability to interpret a libcroco implementation
51
+ *of css2 selectors, and given an xml node, say if
52
+ *the selector matches the node or not.
53
+ */
54
+ struct _CRSelEng
55
+ {
56
+ CRSelEngPriv *priv ;
57
+ } ;
58
+
59
+
60
+ typedef gboolean (*CRPseudoClassSelectorHandler) (CRSelEng* a_this,
61
+ CRAdditionalSel *a_add_sel,
62
+ xmlNode *a_node) ;
63
+ CRSelEng * cr_sel_eng_new (void) ;
64
+
65
+ enum CRStatus cr_sel_eng_register_pseudo_class_sel_handler (CRSelEng *a_this,
66
+ guchar *a_pseudo_class_sel_name,
67
+ enum CRPseudoType a_pseudo_class_type,
68
+ CRPseudoClassSelectorHandler a_handler) ;
69
+
70
+ enum CRStatus cr_sel_eng_unregister_pseudo_class_sel_handler (CRSelEng *a_this,
71
+ guchar *a_pseudo_class_sel_name,
72
+ enum CRPseudoType a_pseudo_class_type) ;
73
+
74
+ enum CRStatus cr_sel_eng_unregister_all_pseudo_class_sel_handlers (CRSelEng *a_this) ;
75
+
76
+ enum CRStatus cr_sel_eng_get_pseudo_class_selector_handler (CRSelEng *a_this,
77
+ guchar *a_pseudo_class_sel_name,
78
+ enum CRPseudoType a_pseudo_class_type,
79
+ CRPseudoClassSelectorHandler *a_handler) ;
80
+
81
+ enum CRStatus cr_sel_eng_matches_node (CRSelEng *a_this,
82
+ CRSimpleSel *a_sel,
83
+ xmlNode *a_node,
84
+ gboolean *a_result) ;
85
+
86
+ enum CRStatus cr_sel_eng_get_matched_rulesets (CRSelEng *a_this,
87
+ CRStyleSheet *a_sheet,
88
+ xmlNode *a_node,
89
+ CRStatement ***a_rulesets,
90
+ gulong *a_len) ;
91
+
92
+ enum CRStatus
93
+ cr_sel_eng_get_matched_properties_from_cascade (CRSelEng *a_this,
94
+ CRCascade *a_cascade,
95
+ xmlNode *a_node,
96
+ CRPropList **a_props) ;
97
+
98
+ enum CRStatus cr_sel_eng_get_matched_style (CRSelEng *a_this,
99
+ CRCascade *a_cascade,
100
+ xmlNode *a_node,
101
+ CRStyle *a_parent_style,
102
+ CRStyle **a_style,
103
+ gboolean a_set_props_to_initial_values) ;
104
+
105
+ void cr_sel_eng_destroy (CRSelEng *a_this) ;
106
+
107
+ G_END_DECLS
108
+
109
+
110
+ #endif/*__CR_SEL_ENG_H__*/
@@ -0,0 +1,95 @@
1
+ /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
2
+
3
+ /*
4
+ * This file is part of The Croco Library
5
+ *
6
+ * This program is free software; you can redistribute it and/or
7
+ * modify it under the terms of version 2.1 of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18
+ * USA
19
+ *
20
+ *
21
+ * Author: Dodji Seketeli
22
+ * See COPYRIGHTS file for copyright information.
23
+ */
24
+
25
+ #ifndef __CR_SELECTOR_H__
26
+ #define __CR_SELECTOR_H__
27
+
28
+ #include <stdio.h>
29
+ #include "cr-utils.h"
30
+ #include "cr-simple-sel.h"
31
+ #include "cr-parsing-location.h"
32
+
33
+ /**
34
+ *@file
35
+ *The declaration file of the #CRSelector file.
36
+ */
37
+
38
+ G_BEGIN_DECLS
39
+
40
+ typedef struct _CRSelector CRSelector ;
41
+
42
+ /**
43
+ *Abstracts a CSS2 selector as defined in the right part
44
+ *of the 'ruleset" production in the appendix D.1 of the
45
+ *css2 spec.
46
+ *It is actually the abstraction of a comma separated list
47
+ *of simple selectors list.
48
+ *In a css2 file, a selector is a list of simple selectors
49
+ *separated by a comma.
50
+ *e.g: sel0, sel1, sel2 ...
51
+ *Each seln is a simple selector
52
+ */
53
+ struct _CRSelector
54
+ {
55
+ /**
56
+ *A Selection expression.
57
+ *It is a list of basic selectors.
58
+ *Each basic selector can be either an element
59
+ *selector, an id selector, a class selector, an
60
+ *attribute selector, an universal selector etc ...
61
+ */
62
+ CRSimpleSel *simple_sel ;
63
+
64
+ /**The next selector list element*/
65
+ CRSelector *next ;
66
+ CRSelector *prev ;
67
+ CRParsingLocation location ;
68
+ glong ref_count ;
69
+ };
70
+
71
+ CRSelector* cr_selector_new (CRSimpleSel *a_sel_expr) ;
72
+
73
+ CRSelector * cr_selector_parse_from_buf (const guchar * a_char_buf,
74
+ enum CREncoding a_enc) ;
75
+
76
+ CRSelector* cr_selector_append (CRSelector *a_this, CRSelector *a_new) ;
77
+
78
+ CRSelector* cr_selector_append_simple_sel (CRSelector *a_this,
79
+ CRSimpleSel *a_simple_sel) ;
80
+
81
+ CRSelector* cr_selector_prepend (CRSelector *a_this, CRSelector *a_new) ;
82
+
83
+ guchar * cr_selector_to_string (CRSelector const *a_this) ;
84
+
85
+ void cr_selector_dump (CRSelector const *a_this, FILE *a_fp) ;
86
+
87
+ void cr_selector_ref (CRSelector *a_this) ;
88
+
89
+ gboolean cr_selector_unref (CRSelector *a_this) ;
90
+
91
+ void cr_selector_destroy (CRSelector *a_this) ;
92
+
93
+ G_END_DECLS
94
+
95
+ #endif /*__CR_SELECTOR_H__*/
@@ -0,0 +1,130 @@
1
+ /* -*- Mode: C; indent-tabs-mode:nil; c-basic-offset: 8-*- */
2
+
3
+ /*
4
+ * This file is part of The Croco Library
5
+ *
6
+ * This program is free software; you can redistribute it and/or
7
+ * modify it under the terms of version 2.1 of the GNU Lesser General Public
8
+ * License as published by the Free Software Foundation.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18
+ * USA
19
+ *
20
+ * Author: Dodji Seketeli
21
+ * See COPYRIGHTS file for copyright information.
22
+ */
23
+
24
+
25
+ #ifndef __CR_SEL_H__
26
+ #define __CR_SEL_H__
27
+
28
+ #include <stdio.h>
29
+ #include <glib.h>
30
+ #include "cr-additional-sel.h"
31
+ #include "cr-parsing-location.h"
32
+
33
+ G_BEGIN_DECLS
34
+
35
+ /**
36
+ *@file
37
+ *the declaration of the #CRSimpleSel class.
38
+ *
39
+ */
40
+ enum Combinator
41
+ {
42
+ NO_COMBINATOR,
43
+ COMB_WS,/*whitespace: descendent*/
44
+ COMB_PLUS,/*'+': preceded by*/
45
+ COMB_GT/*greater than ('>'): child*/
46
+ } ;
47
+
48
+ enum SimpleSelectorType
49
+ {
50
+ NO_SELECTOR_TYPE = 0,
51
+ UNIVERSAL_SELECTOR = 1,
52
+ TYPE_SELECTOR = 1 << 1
53
+ } ;
54
+
55
+ typedef struct _CRSimpleSel CRSimpleSel ;
56
+
57
+ /**
58
+ *The abstraction of a css2 simple selection list
59
+ *as defined by the right part of the "selector" production in the
60
+ *appendix D.1 of the css2 spec.
61
+ *It is basically a list of simple selector, each
62
+ *simple selector being separated by a combinator.
63
+ *
64
+ *In the libcroco's implementation, each simple selector
65
+ *is made of at most two parts:
66
+ *
67
+ *1/An element name or 'type selector' (which can hold a '*' and
68
+ *then been called 'universal selector')
69
+ *
70
+ *2/An additional selector that "specializes" the preceding type or
71
+ *universal selector. The additionnal selector can be either
72
+ *an id selector, or a class selector, or an attribute selector.
73
+ */
74
+ struct _CRSimpleSel
75
+ {
76
+ enum SimpleSelectorType type_mask ;
77
+ gboolean is_case_sentive ;
78
+ CRString * name ;
79
+ /**
80
+ *The combinator that separates
81
+ *this simple selector from the previous
82
+ *one.
83
+ */
84
+ enum Combinator combinator ;
85
+
86
+ /**
87
+ *The additional selector list of the
88
+ *current simple selector.
89
+ *An additional selector may
90
+ *be a class selector, an id selector,
91
+ *or an attribute selector.
92
+ *Note that this field is a linked list.
93
+ */
94
+ CRAdditionalSel *add_sel ;
95
+
96
+ /*
97
+ *the specificity as specified by
98
+ *chapter 6.4.3 of the spec.
99
+ */
100
+ gulong specificity ;
101
+
102
+ CRSimpleSel *next ;
103
+ CRSimpleSel *prev ;
104
+ CRParsingLocation location ;
105
+ } ;
106
+
107
+ CRSimpleSel * cr_simple_sel_new (void) ;
108
+
109
+ CRSimpleSel * cr_simple_sel_append_simple_sel (CRSimpleSel *a_this,
110
+ CRSimpleSel *a_sel) ;
111
+
112
+ CRSimpleSel * cr_simple_sel_prepend_simple_sel (CRSimpleSel *a_this,
113
+ CRSimpleSel *a_sel) ;
114
+
115
+ guchar * cr_simple_sel_to_string (CRSimpleSel const *a_this) ;
116
+
117
+ guchar * cr_simple_sel_one_to_string (CRSimpleSel const * a_this) ;
118
+
119
+ enum CRStatus cr_simple_sel_dump (CRSimpleSel const *a_this, FILE *a_fp) ;
120
+
121
+ enum CRStatus cr_simple_sel_dump_attr_sel_list (CRSimpleSel const *a_this) ;
122
+
123
+ enum CRStatus cr_simple_sel_compute_specificity (CRSimpleSel *a_this) ;
124
+
125
+ void cr_simple_sel_destroy (CRSimpleSel *a_this) ;
126
+
127
+ G_END_DECLS
128
+
129
+
130
+ #endif /*__CR_SIMPLE_SEL_H__*/