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,98 @@
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 the COPYRIGHTS file for copyright information.
22
+ */
23
+
24
+
25
+ #ifndef __CR_ADD_SEL_H__
26
+ #define __CR_ADD_SEL_H__
27
+
28
+ #include <stdio.h>
29
+ #include <glib.h>
30
+ #include "cr-utils.h"
31
+ #include "cr-attr-sel.h"
32
+ #include "cr-pseudo.h"
33
+ #include "cr-additional-sel.h"
34
+
35
+ G_BEGIN_DECLS
36
+
37
+ enum AddSelectorType
38
+ {
39
+ NO_ADD_SELECTOR = 0 ,
40
+ CLASS_ADD_SELECTOR = 1 ,
41
+ PSEUDO_CLASS_ADD_SELECTOR = 1 << 1,
42
+ ID_ADD_SELECTOR = 1 << 3,
43
+ ATTRIBUTE_ADD_SELECTOR = 1 << 4
44
+ } ;
45
+
46
+ union CRAdditionalSelectorContent
47
+ {
48
+ CRString *class_name ;
49
+ CRString *id_name ;
50
+ CRPseudo *pseudo ;
51
+ CRAttrSel *attr_sel ;
52
+ } ;
53
+
54
+ typedef struct _CRAdditionalSel CRAdditionalSel ;
55
+
56
+ struct _CRAdditionalSel
57
+ {
58
+ enum AddSelectorType type ;
59
+ union CRAdditionalSelectorContent content ;
60
+
61
+ CRAdditionalSel * next ;
62
+ CRAdditionalSel * prev ;
63
+ CRParsingLocation location ;
64
+ } ;
65
+
66
+ CRAdditionalSel * cr_additional_sel_new (void) ;
67
+
68
+ CRAdditionalSel * cr_additional_sel_new_with_type (enum AddSelectorType a_sel_type) ;
69
+
70
+ CRAdditionalSel * cr_additional_sel_append (CRAdditionalSel *a_this,
71
+ CRAdditionalSel *a_sel) ;
72
+
73
+ void cr_additional_sel_set_class_name (CRAdditionalSel *a_this,
74
+ CRString *a_class_name) ;
75
+
76
+ void cr_additional_sel_set_id_name (CRAdditionalSel *a_this,
77
+ CRString *a_id) ;
78
+
79
+ void cr_additional_sel_set_pseudo (CRAdditionalSel *a_this,
80
+ CRPseudo *a_pseudo) ;
81
+
82
+ void cr_additional_sel_set_attr_sel (CRAdditionalSel *a_this,
83
+ CRAttrSel *a_sel) ;
84
+
85
+ CRAdditionalSel * cr_additional_sel_prepend (CRAdditionalSel *a_this,
86
+ CRAdditionalSel *a_sel) ;
87
+
88
+ guchar * cr_additional_sel_to_string (CRAdditionalSel const *a_this) ;
89
+
90
+ guchar * cr_additional_sel_one_to_string (CRAdditionalSel const *a_this) ;
91
+
92
+ void cr_additional_sel_dump (CRAdditionalSel const *a_this, FILE *a_fp) ;
93
+
94
+ void cr_additional_sel_destroy (CRAdditionalSel *a_this) ;
95
+
96
+ G_END_DECLS
97
+
98
+ #endif /*__CR_ADD_SEL_H*/
@@ -0,0 +1,74 @@
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
+ #ifndef __CR_ATTR_SEL_H__
25
+ #define __CR_ATTR_SEL_H__
26
+
27
+ #include <stdio.h>
28
+ #include <glib.h>
29
+ #include "cr-utils.h"
30
+ #include "cr-parsing-location.h"
31
+ #include "cr-string.h"
32
+
33
+ G_BEGIN_DECLS
34
+
35
+
36
+ struct _CRAttrSel ;
37
+ typedef struct _CRAttrSel CRAttrSel ;
38
+
39
+ enum AttrMatchWay
40
+ {
41
+ NO_MATCH = 0,
42
+ SET,
43
+ EQUALS,
44
+ INCLUDES,
45
+ DASHMATCH
46
+ } ;
47
+
48
+ struct _CRAttrSel
49
+ {
50
+ CRString *name ;
51
+ CRString *value ;
52
+ enum AttrMatchWay match_way ;
53
+ CRAttrSel *next ;
54
+ CRAttrSel *prev ;
55
+ CRParsingLocation location ;
56
+ } ;
57
+
58
+ CRAttrSel * cr_attr_sel_new (void) ;
59
+
60
+ enum CRStatus cr_attr_sel_append_attr_sel (CRAttrSel * a_this,
61
+ CRAttrSel *a_attr_sel) ;
62
+
63
+ enum CRStatus cr_attr_sel_prepend_attr_sel (CRAttrSel *a_this,
64
+ CRAttrSel *a_attr_sel) ;
65
+
66
+ guchar * cr_attr_sel_to_string (CRAttrSel const *a_this) ;
67
+
68
+ void cr_attr_sel_dump (CRAttrSel const *a_this, FILE *a_fp) ;
69
+
70
+ void cr_attr_sel_destroy (CRAttrSel *a_this) ;
71
+
72
+ G_END_DECLS
73
+
74
+ #endif /*__CR_ATTR_SEL_H__*/
@@ -0,0 +1,74 @@
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
8
+ * GNU Lesser General Public
9
+ * License as published by the Free Software Foundation.
10
+ *
11
+ * This program is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ * GNU General Public License for more details.
15
+ *
16
+ * You should have received a copy of the
17
+ * GNU Lesser General Public License
18
+ * along with this program; if not, write to the Free Software
19
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20
+ * USA
21
+ *
22
+ */
23
+
24
+ /*
25
+ *$Id$
26
+ */
27
+
28
+ #ifndef __CR_CASCADE_H__
29
+ #define __CR_CASCADE_H__
30
+
31
+ #include "cr-stylesheet.h"
32
+
33
+ /**
34
+ *@file
35
+ *the declaration of the #CRCascade class.
36
+ */
37
+
38
+ G_BEGIN_DECLS
39
+
40
+
41
+ typedef struct _CRCascadePriv CRCascadePriv ;
42
+
43
+ /**
44
+ *An abstraction of the "Cascade" defined
45
+ *in the css2 spec, chapter 6.4.
46
+ */
47
+ typedef struct _CRCascade CRCascade ;
48
+
49
+ struct _CRCascade
50
+ {
51
+ CRCascadePriv *priv ;
52
+ };
53
+
54
+
55
+ CRCascade * cr_cascade_new (CRStyleSheet *a_author_sheet,
56
+ CRStyleSheet *a_user_sheet,
57
+ CRStyleSheet *a_ua_sheet) ;
58
+
59
+ CRStyleSheet * cr_cascade_get_sheet (CRCascade *a_this,
60
+ enum CRStyleOrigin a_origin) ;
61
+
62
+ enum CRStatus cr_cascade_set_sheet (CRCascade *a_this,
63
+ CRStyleSheet *a_sheet,
64
+ enum CRStyleOrigin a_origin) ;
65
+
66
+ void cr_cascade_ref (CRCascade *a_this) ;
67
+
68
+ void cr_cascade_unref (CRCascade *a_this) ;
69
+
70
+ void cr_cascade_destroy (CRCascade *a_this) ;
71
+
72
+ G_END_DECLS
73
+
74
+ #endif /*__CR_CASCADE_H__*/
@@ -0,0 +1,136 @@
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 the COPYRIGHTS file for copyright information.
21
+ */
22
+
23
+ #ifndef __CR_DECLARATION_H__
24
+ #define __CR_DECLARATION_H__
25
+
26
+ #include <stdio.h>
27
+ #include "cr-utils.h"
28
+ #include "cr-term.h"
29
+ #include "cr-parsing-location.h"
30
+
31
+ G_BEGIN_DECLS
32
+
33
+ /**
34
+ *@file
35
+ *The declaration of the #CRDeclaration class.
36
+ */
37
+
38
+ /*forward declaration of what is defined in cr-statement.h*/
39
+ typedef struct _CRStatement CRStatement ;
40
+
41
+ /**
42
+ *The abstraction of a css declaration defined by the
43
+ *css2 spec in chapter 4.
44
+ *It is actually a chained list of property/value pairs.
45
+ */
46
+ typedef struct _CRDeclaration CRDeclaration ;
47
+ struct _CRDeclaration
48
+ {
49
+ /**The property.*/
50
+ CRString *property ;
51
+
52
+ /**The value of the property.*/
53
+ CRTerm *value ;
54
+
55
+ /*the ruleset that contains this declaration*/
56
+ CRStatement *parent_statement ;
57
+
58
+ /*the next declaration*/
59
+ CRDeclaration *next ;
60
+
61
+ /*the previous one declaration*/
62
+ CRDeclaration *prev ;
63
+
64
+ /*does the declaration have the important keyword ?*/
65
+ gboolean important ;
66
+
67
+ glong ref_count ;
68
+
69
+ CRParsingLocation location ;
70
+ /*reserved for future usage*/
71
+ gpointer rfu0 ;
72
+ gpointer rfu1 ;
73
+ gpointer rfu2 ;
74
+ gpointer rfu3 ;
75
+ } ;
76
+
77
+
78
+ CRDeclaration * cr_declaration_new (CRStatement *a_statement,
79
+ CRString *a_property,
80
+ CRTerm *a_value) ;
81
+
82
+
83
+ CRDeclaration * cr_declaration_parse_from_buf (CRStatement *a_statement,
84
+ const guchar *a_str,
85
+ enum CREncoding a_enc) ;
86
+
87
+ CRDeclaration * cr_declaration_parse_list_from_buf (const guchar *a_str,
88
+ enum CREncoding a_enc) ;
89
+
90
+ CRDeclaration * cr_declaration_append (CRDeclaration *a_this,
91
+ CRDeclaration *a_new) ;
92
+
93
+ CRDeclaration * cr_declaration_append2 (CRDeclaration *a_this,
94
+ CRString *a_prop,
95
+ CRTerm *a_value) ;
96
+
97
+ CRDeclaration * cr_declaration_prepend (CRDeclaration *a_this,
98
+ CRDeclaration *a_new) ;
99
+
100
+ CRDeclaration * cr_declaration_unlink (CRDeclaration * a_decl) ;
101
+
102
+ void
103
+ cr_declaration_dump (CRDeclaration const *a_this,
104
+ FILE *a_fp, glong a_indent,
105
+ gboolean a_one_per_line) ;
106
+
107
+ void cr_declaration_dump_one (CRDeclaration const *a_this,
108
+ FILE *a_fp, glong a_indent) ;
109
+
110
+ gint cr_declaration_nr_props (CRDeclaration const *a_this) ;
111
+
112
+ CRDeclaration * cr_declaration_get_from_list (CRDeclaration *a_this,
113
+ int itemnr) ;
114
+
115
+ CRDeclaration * cr_declaration_get_by_prop_name (CRDeclaration *a_this,
116
+ const guchar *a_str) ;
117
+
118
+ gchar * cr_declaration_to_string (CRDeclaration const *a_this,
119
+ gulong a_indent) ;
120
+
121
+ guchar * cr_declaration_list_to_string (CRDeclaration const *a_this,
122
+ gulong a_indent) ;
123
+
124
+ guchar * cr_declaration_list_to_string2 (CRDeclaration const *a_this,
125
+ gulong a_indent,
126
+ gboolean a_one_decl_per_line) ;
127
+
128
+ void cr_declaration_ref (CRDeclaration *a_this) ;
129
+
130
+ gboolean cr_declaration_unref (CRDeclaration *a_this) ;
131
+
132
+ void cr_declaration_destroy (CRDeclaration *a_this) ;
133
+
134
+ G_END_DECLS
135
+
136
+ #endif /*__CR_DECLARATION_H__*/
@@ -0,0 +1,298 @@
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 the COPYRIGHTS file for copyright information.
21
+ */
22
+
23
+ #ifndef __CR_DOC_HANDLER_H__
24
+ #define __CR_DOC_HANDLER_H__
25
+
26
+ /**
27
+ *@file
28
+ *The declaration of the #CRDocumentHandler class.
29
+ *This class is actually the parsing events handler.
30
+ */
31
+
32
+ #include <glib.h>
33
+ #include "cr-utils.h"
34
+ #include "cr-input.h"
35
+ #include "cr-stylesheet.h"
36
+
37
+ G_BEGIN_DECLS
38
+
39
+
40
+ typedef struct _CRDocHandler CRDocHandler ;
41
+
42
+ struct _CRDocHandlerPriv ;
43
+ typedef struct _CRDocHandlerPriv CRDocHandlerPriv ;
44
+
45
+
46
+ /**
47
+ *The SAC document handler.
48
+ *An instance of this class is to
49
+ *be passed to a parser. Then, during the parsing
50
+ *the parser calls the convenient function pointer
51
+ *whenever a particular event (a css construction) occurs.
52
+ */
53
+ struct _CRDocHandler
54
+ {
55
+ CRDocHandlerPriv *priv ;
56
+
57
+ /**
58
+ *This pointer is to be used by the application for
59
+ *it custom needs. It is there to extend the doc handler.
60
+ */
61
+ gpointer app_data ;
62
+
63
+ /**
64
+ *Is called at the beginning of the parsing of the document.
65
+ *@param a_this a pointer to the current instance of
66
+ *#CRDocHandler.
67
+ */
68
+ void (*start_document) (CRDocHandler *a_this) ;
69
+
70
+ /**
71
+ *Is called to notify the end of the parsing of the document.
72
+ *@param a_this a pointer to the current instance of
73
+ *#CRDocHandler.
74
+ */
75
+ void (*end_document) (CRDocHandler *a_this) ;
76
+
77
+ /**
78
+ *Is called to notify an at charset rule.
79
+ *@param a_this the document handler.
80
+ *@param a_charset the declared charset.
81
+ */
82
+ void (*charset) (CRDocHandler *a_this,
83
+ CRString *a_charset,
84
+ CRParsingLocation *a_charset_sym_location) ;
85
+
86
+ /**
87
+ *Is called to notify an import statement in
88
+ *the stylesheet.
89
+ *@param a_this the current instance of #CRDocHandler.
90
+ *@param a_media_list a doubly linked list of GString objects.
91
+ *Each GString object contains a string which is the
92
+ *destination media for style information.
93
+ *@param a_uri the uri of the imported style sheet.
94
+ *@param a_uri_default_ns the default namespace of URI
95
+ *@param a_location the parsing location of the '\@import'
96
+ *keyword.
97
+ *of the imported style sheet.
98
+ */
99
+ void (*import_style) (CRDocHandler *a_this,
100
+ GList *a_media_list,
101
+ CRString *a_uri,
102
+ CRString *a_uri_default_ns,
103
+ CRParsingLocation *a_location) ;
104
+
105
+ void (*import_style_result) (CRDocHandler *a_this,
106
+ GList *a_media_list,
107
+ CRString *a_uri,
108
+ CRString *a_uri_default_ns,
109
+ CRStyleSheet *a_sheet) ;
110
+
111
+ /**
112
+ *Is called to notify a namespace declaration.
113
+ *Not used yet.
114
+ *@param a_this the current instance of #CRDocHandler.
115
+ *@param a_prefix the prefix of the namespace.
116
+ *@param a_uri the uri of the namespace.
117
+ *@param a_location the location of the "@namespace" keyword.
118
+ */
119
+ void (*namespace_declaration) (CRDocHandler *a_this,
120
+ CRString *a_prefix,
121
+ CRString *a_uri,
122
+ CRParsingLocation *a_location) ;
123
+
124
+ /**
125
+ *Is called to notify a comment.
126
+ *@param a_this a pointer to the current instance
127
+ *of #CRDocHandler.
128
+ *@param a_comment the comment.
129
+ */
130
+ void (*comment) (CRDocHandler *a_this,
131
+ CRString *a_comment) ;
132
+
133
+ /**
134
+ *Is called to notify the beginning of a rule
135
+ *statement.
136
+ *@param a_this the current instance of #CRDocHandler.
137
+ *@param a_selector_list the list of selectors that precedes
138
+ *the rule declarations.
139
+ */
140
+ void (*start_selector) (CRDocHandler * a_this,
141
+ CRSelector *a_selector_list) ;
142
+
143
+ /**
144
+ *Is called to notify the end of a rule statement.
145
+ *@param a_this the current instance of #CRDocHandler.
146
+ *@param a_selector_list the list of selectors that precedes
147
+ *the rule declarations. This pointer is the same as
148
+ *the one passed to start_selector() ;
149
+ */
150
+ void (*end_selector) (CRDocHandler *a_this,
151
+ CRSelector *a_selector_list) ;
152
+
153
+
154
+ /**
155
+ *Is called to notify a declaration.
156
+ *@param a_this a pointer to the current instance
157
+ *of #CRDocHandler.
158
+ *@param a_name the name of the parsed property.
159
+ *@param a_expression a css expression that represents
160
+ *the value of the property. A css expression is
161
+ *actually a linked list of 'terms'. Each term can
162
+ *be linked to other using operators.
163
+ *
164
+ */
165
+ void (*property) (CRDocHandler *a_this,
166
+ CRString *a_name,
167
+ CRTerm *a_expression,
168
+ gboolean a_is_important) ;
169
+ /**
170
+ *Is called to notify the start of a font face statement.
171
+ *The parser invokes this method at the beginning of every
172
+ *font face statement in the style sheet. There will
173
+ *be a corresponding end_font_face () event for every
174
+ *start_font_face () event.
175
+ *
176
+ *@param a_this a pointer to the current instance of
177
+ *#CRDocHandler.
178
+ *@param a_location the parsing location of the "\@font-face"
179
+ *keyword.
180
+ */
181
+ void (*start_font_face) (CRDocHandler *a_this,
182
+ CRParsingLocation *a_location) ;
183
+
184
+ /**
185
+ *Is called to notify the end of a font face statement.
186
+ *@param a_this a pointer to the current instance of
187
+ *#CRDocHandler.
188
+ */
189
+ void (*end_font_face) (CRDocHandler *a_this) ;
190
+
191
+
192
+ /**
193
+ *Is called to notify the beginning of a media statement.
194
+ *The parser will invoke this method at the beginning of
195
+ *every media statement in the style sheet. There will be
196
+ *a corresponding end_media() event for every start_media()
197
+ *event.
198
+ *@param a_this a pointer to the current instance of
199
+ *#CRDocHandler.
200
+ *@param a_media_list a double linked list of
201
+ #CRString * objects.
202
+ *Each CRString objects is actually a destination media for
203
+ *the style information.
204
+ */
205
+ void (*start_media) (CRDocHandler *a_this,
206
+ GList *a_media_list,
207
+ CRParsingLocation *a_location) ;
208
+
209
+ /**
210
+ *Is called to notify the end of a media statement.
211
+ *@param a_this a pointer to the current instance
212
+ *of #CRDocHandler.
213
+ *@param a_media_list a double linked list of GString * objects.
214
+ *Each GString objects is actually a destination media for
215
+ *the style information.
216
+ */
217
+ void (*end_media) (CRDocHandler *a_this,
218
+ GList *a_media_list) ;
219
+
220
+ /**
221
+ *Is called to notify the beginning of a page statement.
222
+ *The parser invokes this function at the beginning of
223
+ *every page statement in the style sheet. There will be
224
+ *a corresponding end_page() event for every single
225
+ *start_page() event.
226
+ *@param a_this a pointer to the current instance of
227
+ *#CRDocHandler.
228
+ *@param a_name the name of the page (if any, null otherwise).
229
+ *@param a_pseudo_page the pseudo page (if any, null otherwise).
230
+ *@param a_location the parsing location of the "\@page" keyword.
231
+ */
232
+ void (*start_page) (CRDocHandler *a_this,
233
+ CRString *a_name,
234
+ CRString *a_pseudo_page,
235
+ CRParsingLocation *a_location) ;
236
+
237
+ /**
238
+ *Is called to notify the end of a page statement.
239
+ *@param a_this a pointer to the current instance of
240
+ *#CRDocHandler.
241
+ *@param a_name the name of the page (if any, null otherwise).
242
+ *@param a_pseudo_page the pseudo page (if any, null otherwise).
243
+ */
244
+ void (*end_page) (CRDocHandler *a_this,
245
+ CRString *a_name,
246
+ CRString *pseudo_page) ;
247
+
248
+ /**
249
+ *Is Called to notify an unknown at-rule not supported
250
+ *by this parser.
251
+ */
252
+ void (*ignorable_at_rule) (CRDocHandler *a_this,
253
+ CRString *a_name) ;
254
+
255
+ /**
256
+ *Is called to notify a parsing error. After this error
257
+ *the application must ignore the rule being parsed, if
258
+ *any. After completion of this callback,
259
+ *the parser will then try to resume the parsing,
260
+ *ignoring the current error.
261
+ */
262
+ void (*error) (CRDocHandler *a_this) ;
263
+
264
+ /**
265
+ *Is called to notify an unrecoverable parsing error.
266
+ *This is the place to put emergency routines that free allocated
267
+ *resources.
268
+ */
269
+ void (*unrecoverable_error) (CRDocHandler *a_this) ;
270
+
271
+ gboolean resolve_import ;
272
+ gulong ref_count ;
273
+ } ;
274
+
275
+ CRDocHandler * cr_doc_handler_new (void) ;
276
+
277
+ enum CRStatus cr_doc_handler_set_result (CRDocHandler *a_this, gpointer a_result) ;
278
+
279
+ enum CRStatus cr_doc_handler_get_result (CRDocHandler const *a_this, gpointer * a_result) ;
280
+
281
+ enum CRStatus cr_doc_handler_set_ctxt (CRDocHandler *a_this, gpointer a_ctxt) ;
282
+
283
+ enum CRStatus cr_doc_handler_get_ctxt (CRDocHandler const *a_this, gpointer * a_ctxt) ;
284
+
285
+ enum CRStatus cr_doc_handler_set_default_sac_handler (CRDocHandler *a_this) ;
286
+
287
+ void cr_doc_handler_associate_a_parser (CRDocHandler *a_this,
288
+ gpointer a_parser) ;
289
+
290
+ void cr_doc_handler_ref (CRDocHandler *a_this) ;
291
+
292
+ gboolean cr_doc_handler_unref (CRDocHandler *a_this) ;
293
+
294
+ void cr_doc_handler_destroy (CRDocHandler *a_this) ;
295
+
296
+ G_END_DECLS
297
+
298
+ #endif /*__CR_DOC_HANDLER_H__*/