rsvg2 2.2.4-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README +35 -0
- data/Rakefile +69 -0
- data/ext/rsvg2/depend +6 -0
- data/ext/rsvg2/extconf.rb +89 -0
- data/ext/rsvg2/rbrsvg.c +206 -0
- data/ext/rsvg2/rbrsvgdimensiondata.c +194 -0
- data/ext/rsvg2/rbrsvghandle.c +496 -0
- data/ext/rsvg2/rsvg2.def +2 -0
- data/ext/rsvg2/rsvg2.h +70 -0
- data/extconf.rb +49 -0
- data/lib/2.0/rsvg2.so +0 -0
- data/lib/2.1/rsvg2.so +0 -0
- data/lib/2.2/rsvg2.so +0 -0
- data/lib/rsvg2.rb +33 -0
- data/sample/svg-viewer.rb +44 -0
- data/sample/svg2.rb +60 -0
- data/test/rsvg2-test-utils.rb +23 -0
- data/test/run-test.rb +49 -0
- data/test/test-handle.rb +91 -0
- data/vendor/local/bin/croco-0.6-config +87 -0
- data/vendor/local/bin/csslint-0.6.exe +0 -0
- data/vendor/local/bin/libcroco-0.6-3.dll +0 -0
- data/vendor/local/bin/librsvg-2-2.dll +0 -0
- data/vendor/local/bin/rsvg-convert.exe +0 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-additional-sel.h +98 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-attr-sel.h +74 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-cascade.h +74 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-declaration.h +136 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-doc-handler.h +298 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-enc-handler.h +94 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-fonts.h +315 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-input.h +174 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-num.h +127 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-om-parser.h +98 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-parser.h +128 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-parsing-location.h +70 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-prop-list.h +80 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-pseudo.h +64 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-rgb.h +94 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-sel-eng.h +110 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-selector.h +95 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-simple-sel.h +130 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-statement.h +440 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-string.h +76 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-style.h +339 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-stylesheet.h +102 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-term.h +190 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-tknzr.h +115 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-token.h +212 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-utils.h +246 -0
- data/vendor/local/include/libcroco-0.6/libcroco/libcroco-config.h +17 -0
- data/vendor/local/include/libcroco-0.6/libcroco/libcroco.h +44 -0
- data/vendor/local/include/librsvg-2.0/librsvg/librsvg-enum-types.h +24 -0
- data/vendor/local/include/librsvg-2.0/librsvg/librsvg-features.h +28 -0
- data/vendor/local/include/librsvg-2.0/librsvg/rsvg-cairo.h +42 -0
- data/vendor/local/include/librsvg-2.0/librsvg/rsvg.h +264 -0
- data/vendor/local/lib/girepository-1.0/Rsvg-2.0.typelib +0 -0
- data/vendor/local/lib/libcroco-0.6.a +0 -0
- data/vendor/local/lib/libcroco-0.6.dll.a +0 -0
- data/vendor/local/lib/libcroco-0.6.la +41 -0
- data/vendor/local/lib/librsvg-2.a +0 -0
- data/vendor/local/lib/librsvg-2.dll.a +0 -0
- data/vendor/local/lib/librsvg-2.la +41 -0
- data/vendor/local/lib/pkgconfig/libcroco-0.6.pc +11 -0
- data/vendor/local/lib/pkgconfig/librsvg-2.0.pc +15 -0
- data/vendor/local/share/gir-1.0/Rsvg-2.0.gir +754 -0
- data/vendor/local/share/gtk-doc/html/libcroco/ch01.html +113 -0
- data/vendor/local/share/gtk-doc/html/libcroco/home.png +0 -0
- data/vendor/local/share/gtk-doc/html/libcroco/index.html +109 -0
- data/vendor/local/share/gtk-doc/html/libcroco/index.sgml +582 -0
- data/vendor/local/share/gtk-doc/html/libcroco/left.png +0 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-additional-sel.html +337 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-attr-sel.html +203 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-cascade.html +240 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-declaration.html +642 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-doc-handler.html +517 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-enc-handler.html +164 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-fonts.html +670 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-input.html +1102 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-num.html +265 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-om-parser.html +380 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-parser.html +913 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-parsing-location.html +205 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-prop-list.html +421 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-pseudo.html +141 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-rgb.html +503 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-sel-eng.html +346 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-selector.html +246 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-simple-sel.html +240 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-statement.html +1408 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-string.html +137 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-style.html +384 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-stylesheet.html +158 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-term.html +304 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-tknzr.html +312 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-token.html +428 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-utils.html +334 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-libcroco-config.html +80 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco.devhelp2 +511 -0
- data/vendor/local/share/gtk-doc/html/libcroco/right.png +0 -0
- data/vendor/local/share/gtk-doc/html/libcroco/style.css +266 -0
- data/vendor/local/share/gtk-doc/html/libcroco/up.png +0 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/RsvgHandle.html +1420 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/annotation-glossary.html +55 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-14.html +55 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-22.html +43 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-32.html +47 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-36.html +46 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-4.html +39 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-8.html +54 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-9.html +53 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-deprecated.html +100 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-full.html +323 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/home.png +0 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/index.html +88 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/index.sgml +106 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/left-insensitive.png +0 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/left.png +0 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/licence.html +57 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/object-tree.html +38 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/right-insensitive.png +0 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/right.png +0 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg-2.0.devhelp2 +94 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg-Using-RSVG-with-GIO.html +360 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg-Using-RSVG-with-GdkPixbuf.html +484 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg-Using-RSVG-with-cairo.html +154 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg-Version-check-and-feature-tests.html +142 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg.html +57 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/style.css +476 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/up-insensitive.png +0 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/up.png +0 -0
- data/vendor/local/share/license/libcroco/AUTHORS +13 -0
- data/vendor/local/share/license/libcroco/COPYING +481 -0
- data/vendor/local/share/license/libcroco/COPYING.LIB +481 -0
- data/vendor/local/share/license/librsvg/AUTHORS +1 -0
- data/vendor/local/share/license/librsvg/COPYING +340 -0
- data/vendor/local/share/license/librsvg/COPYING.LIB +482 -0
- data/vendor/local/share/man/man1/rsvg-convert.1 +55 -0
- metadata +209 -0
@@ -0,0 +1,115 @@
|
|
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 coypyright information.
|
22
|
+
*/
|
23
|
+
|
24
|
+
/**
|
25
|
+
*@file
|
26
|
+
*The declaration of the #CRTknzr (tokenizer)
|
27
|
+
*class.
|
28
|
+
*/
|
29
|
+
|
30
|
+
#ifndef __CR_TKNZR_H__
|
31
|
+
#define __CR_TKNZR_H__
|
32
|
+
|
33
|
+
#include "cr-utils.h"
|
34
|
+
#include "cr-input.h"
|
35
|
+
#include "cr-token.h"
|
36
|
+
|
37
|
+
G_BEGIN_DECLS
|
38
|
+
|
39
|
+
|
40
|
+
typedef struct _CRTknzr CRTknzr ;
|
41
|
+
typedef struct _CRTknzrPriv CRTknzrPriv ;
|
42
|
+
|
43
|
+
/**
|
44
|
+
*The tokenizer is the class that knows
|
45
|
+
*about all the css token. Its main job is
|
46
|
+
*to return the next token found in the character
|
47
|
+
*input stream.
|
48
|
+
*/
|
49
|
+
struct _CRTknzr
|
50
|
+
{
|
51
|
+
/*the private data of the tokenizer.*/
|
52
|
+
CRTknzrPriv *priv ;
|
53
|
+
} ;
|
54
|
+
|
55
|
+
CRTknzr * cr_tknzr_new (CRInput *a_input) ;
|
56
|
+
|
57
|
+
CRTknzr * cr_tknzr_new_from_uri (const guchar *a_file_uri,
|
58
|
+
enum CREncoding a_enc) ;
|
59
|
+
|
60
|
+
CRTknzr * cr_tknzr_new_from_buf (guchar *a_buf, gulong a_len,
|
61
|
+
enum CREncoding a_enc,
|
62
|
+
gboolean a_free_at_destroy) ;
|
63
|
+
|
64
|
+
gboolean cr_tknzr_unref (CRTknzr *a_this) ;
|
65
|
+
|
66
|
+
void cr_tknzr_ref (CRTknzr *a_this) ;
|
67
|
+
|
68
|
+
enum CRStatus cr_tknzr_read_byte (CRTknzr *a_this, guchar *a_byte) ;
|
69
|
+
|
70
|
+
enum CRStatus cr_tknzr_read_char (CRTknzr *a_this, guint32 *a_char);
|
71
|
+
|
72
|
+
enum CRStatus cr_tknzr_peek_char (CRTknzr *a_this, guint32 *a_char) ;
|
73
|
+
|
74
|
+
enum CRStatus cr_tknzr_peek_byte (CRTknzr *a_this, gulong a_offset,
|
75
|
+
guchar *a_byte) ;
|
76
|
+
|
77
|
+
guchar cr_tknzr_peek_byte2 (CRTknzr *a_this, gulong a_offset,
|
78
|
+
gboolean *a_eof) ;
|
79
|
+
|
80
|
+
enum CRStatus cr_tknzr_set_cur_pos (CRTknzr *a_this, CRInputPos *a_pos) ;
|
81
|
+
|
82
|
+
glong cr_tknzr_get_nb_bytes_left (CRTknzr *a_this) ;
|
83
|
+
|
84
|
+
enum CRStatus cr_tknzr_get_cur_pos (CRTknzr *a_this, CRInputPos *a_pos) ;
|
85
|
+
|
86
|
+
enum CRStatus cr_tknzr_get_parsing_location (CRTknzr *a_this,
|
87
|
+
CRParsingLocation *a_loc) ;
|
88
|
+
|
89
|
+
enum CRStatus cr_tknzr_seek_index (CRTknzr *a_this,
|
90
|
+
enum CRSeekPos a_origin,
|
91
|
+
gint a_pos) ;
|
92
|
+
|
93
|
+
enum CRStatus cr_tknzr_get_cur_byte_addr (CRTknzr *a_this, guchar **a_addr) ;
|
94
|
+
|
95
|
+
|
96
|
+
enum CRStatus cr_tknzr_consume_chars (CRTknzr *a_this, guint32 a_char,
|
97
|
+
glong *a_nb_char) ;
|
98
|
+
|
99
|
+
enum CRStatus cr_tknzr_get_next_token (CRTknzr *a_this, CRToken ** a_tk) ;
|
100
|
+
|
101
|
+
enum CRStatus cr_tknzr_unget_token (CRTknzr *a_this, CRToken *a_token) ;
|
102
|
+
|
103
|
+
|
104
|
+
enum CRStatus cr_tknzr_parse_token (CRTknzr *a_this, enum CRTokenType a_type,
|
105
|
+
enum CRTokenExtraType a_et, gpointer a_res,
|
106
|
+
gpointer a_extra_res) ;
|
107
|
+
enum CRStatus cr_tknzr_set_input (CRTknzr *a_this, CRInput *a_input) ;
|
108
|
+
|
109
|
+
enum CRStatus cr_tknzr_get_input (CRTknzr *a_this, CRInput **a_input) ;
|
110
|
+
|
111
|
+
void cr_tknzr_destroy (CRTknzr *a_this) ;
|
112
|
+
|
113
|
+
G_END_DECLS
|
114
|
+
|
115
|
+
#endif /*__CR_TKZNR_H__*/
|
@@ -0,0 +1,212 @@
|
|
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_TOKEN_H__
|
25
|
+
#define __CR_TOKEN_H__
|
26
|
+
|
27
|
+
#include "cr-utils.h"
|
28
|
+
#include "cr-input.h"
|
29
|
+
#include "cr-num.h"
|
30
|
+
#include "cr-rgb.h"
|
31
|
+
#include "cr-string.h"
|
32
|
+
#include "cr-parsing-location.h"
|
33
|
+
|
34
|
+
G_BEGIN_DECLS
|
35
|
+
|
36
|
+
enum CRTokenType
|
37
|
+
{
|
38
|
+
NO_TK,
|
39
|
+
S_TK,
|
40
|
+
CDO_TK,
|
41
|
+
CDC_TK,
|
42
|
+
INCLUDES_TK,
|
43
|
+
DASHMATCH_TK,
|
44
|
+
COMMENT_TK,
|
45
|
+
STRING_TK,
|
46
|
+
IDENT_TK,
|
47
|
+
HASH_TK,
|
48
|
+
IMPORT_SYM_TK,
|
49
|
+
PAGE_SYM_TK,
|
50
|
+
MEDIA_SYM_TK,
|
51
|
+
FONT_FACE_SYM_TK,
|
52
|
+
CHARSET_SYM_TK,
|
53
|
+
ATKEYWORD_TK,
|
54
|
+
IMPORTANT_SYM_TK,
|
55
|
+
EMS_TK,
|
56
|
+
EXS_TK,
|
57
|
+
LENGTH_TK,
|
58
|
+
ANGLE_TK,
|
59
|
+
TIME_TK,
|
60
|
+
FREQ_TK,
|
61
|
+
DIMEN_TK,
|
62
|
+
PERCENTAGE_TK,
|
63
|
+
NUMBER_TK,
|
64
|
+
RGB_TK,
|
65
|
+
URI_TK,
|
66
|
+
FUNCTION_TK,
|
67
|
+
UNICODERANGE_TK,
|
68
|
+
SEMICOLON_TK,
|
69
|
+
CBO_TK, /*opening curly bracket*/
|
70
|
+
CBC_TK, /*closing curly bracket*/
|
71
|
+
PO_TK, /*opening parenthesis*/
|
72
|
+
PC_TK, /*closing parenthesis*/
|
73
|
+
BO_TK, /*opening bracket*/
|
74
|
+
BC_TK, /*closing bracket*/
|
75
|
+
DELIM_TK
|
76
|
+
} ;
|
77
|
+
|
78
|
+
enum CRTokenExtraType
|
79
|
+
{
|
80
|
+
NO_ET = 0,
|
81
|
+
LENGTH_PX_ET,
|
82
|
+
LENGTH_CM_ET,
|
83
|
+
LENGTH_MM_ET,
|
84
|
+
LENGTH_IN_ET,
|
85
|
+
LENGTH_PT_ET,
|
86
|
+
LENGTH_PC_ET,
|
87
|
+
ANGLE_DEG_ET,
|
88
|
+
ANGLE_RAD_ET,
|
89
|
+
ANGLE_GRAD_ET,
|
90
|
+
TIME_MS_ET,
|
91
|
+
TIME_S_ET,
|
92
|
+
FREQ_HZ_ET,
|
93
|
+
FREQ_KHZ_ET
|
94
|
+
} ;
|
95
|
+
|
96
|
+
typedef struct _CRToken CRToken ;
|
97
|
+
|
98
|
+
/**
|
99
|
+
*This class abstracts a css2 token.
|
100
|
+
*/
|
101
|
+
struct _CRToken
|
102
|
+
{
|
103
|
+
enum CRTokenType type ;
|
104
|
+
enum CRTokenExtraType extra_type ;
|
105
|
+
CRInputPos pos ;
|
106
|
+
|
107
|
+
union
|
108
|
+
{
|
109
|
+
CRString *str ;
|
110
|
+
CRRgb *rgb ;
|
111
|
+
CRNum *num ;
|
112
|
+
guint32 unichar ;
|
113
|
+
} u ;
|
114
|
+
|
115
|
+
CRString * dimen ;
|
116
|
+
CRParsingLocation location ;
|
117
|
+
} ;
|
118
|
+
|
119
|
+
CRToken* cr_token_new (void) ;
|
120
|
+
|
121
|
+
enum CRStatus cr_token_set_s (CRToken *a_this) ;
|
122
|
+
|
123
|
+
enum CRStatus cr_token_set_cdo (CRToken *a_this) ;
|
124
|
+
|
125
|
+
enum CRStatus cr_token_set_cdc (CRToken *a_this) ;
|
126
|
+
|
127
|
+
enum CRStatus cr_token_set_includes (CRToken *a_this) ;
|
128
|
+
|
129
|
+
enum CRStatus cr_token_set_dashmatch (CRToken *a_this) ;
|
130
|
+
|
131
|
+
enum CRStatus cr_token_set_comment (CRToken *a_this, CRString *a_str) ;
|
132
|
+
|
133
|
+
enum CRStatus cr_token_set_string (CRToken *a_this, CRString *a_str) ;
|
134
|
+
|
135
|
+
enum CRStatus cr_token_set_ident (CRToken *a_this, CRString * a_ident) ;
|
136
|
+
|
137
|
+
enum CRStatus cr_token_set_hash (CRToken *a_this, CRString *a_hash) ;
|
138
|
+
|
139
|
+
enum CRStatus cr_token_set_rgb (CRToken *a_this, CRRgb *a_rgb) ;
|
140
|
+
|
141
|
+
enum CRStatus cr_token_set_import_sym (CRToken *a_this) ;
|
142
|
+
|
143
|
+
enum CRStatus cr_token_set_page_sym (CRToken *a_this) ;
|
144
|
+
|
145
|
+
enum CRStatus cr_token_set_media_sym (CRToken *a_this) ;
|
146
|
+
|
147
|
+
enum CRStatus cr_token_set_font_face_sym (CRToken *a_this) ;
|
148
|
+
|
149
|
+
enum CRStatus cr_token_set_charset_sym (CRToken *a_this) ;
|
150
|
+
|
151
|
+
enum CRStatus cr_token_set_atkeyword (CRToken *a_this, CRString *a_atname) ;
|
152
|
+
|
153
|
+
enum CRStatus cr_token_set_important_sym (CRToken *a_this) ;
|
154
|
+
|
155
|
+
enum CRStatus cr_token_set_ems (CRToken *a_this, CRNum *a_num) ;
|
156
|
+
|
157
|
+
enum CRStatus cr_token_set_exs (CRToken *a_this, CRNum *a_num) ;
|
158
|
+
|
159
|
+
enum CRStatus cr_token_set_length (CRToken *a_this, CRNum *a_num,
|
160
|
+
enum CRTokenExtraType a_et) ;
|
161
|
+
|
162
|
+
enum CRStatus cr_token_set_angle (CRToken *a_this, CRNum *a_num,
|
163
|
+
enum CRTokenExtraType a_et) ;
|
164
|
+
|
165
|
+
enum CRStatus cr_token_set_time (CRToken *a_this, CRNum *a_num,
|
166
|
+
enum CRTokenExtraType a_et) ;
|
167
|
+
|
168
|
+
enum CRStatus cr_token_set_freq (CRToken *a_this, CRNum *a_num,
|
169
|
+
enum CRTokenExtraType a_et) ;
|
170
|
+
|
171
|
+
enum CRStatus cr_token_set_dimen (CRToken *a_this, CRNum *a_num,
|
172
|
+
CRString *a_dim) ;
|
173
|
+
|
174
|
+
enum CRStatus cr_token_set_percentage (CRToken *a_this, CRNum *a_num) ;
|
175
|
+
|
176
|
+
enum CRStatus cr_token_set_number (CRToken *a_this, CRNum *a_num) ;
|
177
|
+
|
178
|
+
enum CRStatus cr_token_set_uri (CRToken *a_this, CRString *a_uri) ;
|
179
|
+
|
180
|
+
enum CRStatus cr_token_set_function (CRToken *a_this,
|
181
|
+
CRString *a_fun_name) ;
|
182
|
+
|
183
|
+
enum CRStatus cr_token_set_bc (CRToken *a_this) ;
|
184
|
+
|
185
|
+
enum CRStatus cr_token_set_bo (CRToken *a_this) ;
|
186
|
+
|
187
|
+
enum CRStatus cr_token_set_po (CRToken *a_this) ;
|
188
|
+
|
189
|
+
enum CRStatus cr_token_set_pc (CRToken *a_this) ;
|
190
|
+
|
191
|
+
enum CRStatus cr_token_set_cbc (CRToken *a_this) ;
|
192
|
+
|
193
|
+
enum CRStatus cr_token_set_cbo (CRToken *a_this) ;
|
194
|
+
|
195
|
+
enum CRStatus cr_token_set_semicolon (CRToken *a_this) ;
|
196
|
+
|
197
|
+
enum CRStatus cr_token_set_delim (CRToken *a_this, guint32 a_char) ;
|
198
|
+
|
199
|
+
|
200
|
+
/*
|
201
|
+
enum CRStatus
|
202
|
+
cr_token_set_unicoderange (CRToken *a_this,
|
203
|
+
CRUnicodeRange *a_range) ;
|
204
|
+
*/
|
205
|
+
|
206
|
+
void
|
207
|
+
cr_token_destroy (CRToken *a_this) ;
|
208
|
+
|
209
|
+
|
210
|
+
G_END_DECLS
|
211
|
+
|
212
|
+
#endif /*__CR_TOKEN_H__*/
|
@@ -0,0 +1,246 @@
|
|
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
|
+
* Look at file COPYRIGHTS for copyright information
|
22
|
+
*/
|
23
|
+
|
24
|
+
#ifndef __CR_DEFS_H__
|
25
|
+
#define __CR_DEFS_H__
|
26
|
+
|
27
|
+
#include <stdio.h>
|
28
|
+
#include <glib.h>
|
29
|
+
#include "libcroco-config.h"
|
30
|
+
|
31
|
+
G_BEGIN_DECLS
|
32
|
+
|
33
|
+
/**
|
34
|
+
*@file
|
35
|
+
*The Croco library basic types definitions
|
36
|
+
*And global definitions.
|
37
|
+
*/
|
38
|
+
|
39
|
+
/**
|
40
|
+
*The status type returned
|
41
|
+
*by the methods of the croco library.
|
42
|
+
*/
|
43
|
+
enum CRStatus {
|
44
|
+
CR_OK,
|
45
|
+
CR_BAD_PARAM_ERROR,
|
46
|
+
CR_INSTANCIATION_FAILED_ERROR,
|
47
|
+
CR_UNKNOWN_TYPE_ERROR,
|
48
|
+
CR_UNKNOWN_PROP_ERROR,
|
49
|
+
CR_UNKNOWN_PROP_VAL_ERROR,
|
50
|
+
CR_UNEXPECTED_POSITION_SCHEME,
|
51
|
+
CR_START_OF_INPUT_ERROR,
|
52
|
+
CR_END_OF_INPUT_ERROR,
|
53
|
+
CR_OUTPUT_TOO_SHORT_ERROR,
|
54
|
+
CR_INPUT_TOO_SHORT_ERROR,
|
55
|
+
CR_OUT_OF_BOUNDS_ERROR,
|
56
|
+
CR_EMPTY_PARSER_INPUT_ERROR,
|
57
|
+
CR_ENCODING_ERROR,
|
58
|
+
CR_ENCODING_NOT_FOUND_ERROR,
|
59
|
+
CR_PARSING_ERROR,
|
60
|
+
CR_SYNTAX_ERROR,
|
61
|
+
CR_NO_ROOT_NODE_ERROR,
|
62
|
+
CR_NO_TOKEN,
|
63
|
+
CR_OUT_OF_MEMORY_ERROR,
|
64
|
+
CR_PSEUDO_CLASS_SEL_HANDLER_NOT_FOUND_ERROR,
|
65
|
+
CR_BAD_PSEUDO_CLASS_SEL_HANDLER_ERROR,
|
66
|
+
CR_ERROR,
|
67
|
+
CR_FILE_NOT_FOUND_ERROR,
|
68
|
+
CR_VALUE_NOT_FOUND_ERROR
|
69
|
+
} ;
|
70
|
+
|
71
|
+
/**
|
72
|
+
*Values used by
|
73
|
+
*cr_input_seek_position() ;
|
74
|
+
*/
|
75
|
+
enum CRSeekPos {
|
76
|
+
CR_SEEK_CUR,
|
77
|
+
CR_SEEK_BEGIN,
|
78
|
+
CR_SEEK_END
|
79
|
+
} ;
|
80
|
+
|
81
|
+
/**
|
82
|
+
*Encoding values.
|
83
|
+
*/
|
84
|
+
enum CREncoding
|
85
|
+
{
|
86
|
+
CR_UCS_4 = 1/*Must be not NULL*/,
|
87
|
+
CR_UCS_1,
|
88
|
+
CR_ISO_8859_1,
|
89
|
+
CR_ASCII,
|
90
|
+
CR_UTF_8,
|
91
|
+
CR_UTF_16,
|
92
|
+
CR_AUTO/*should be the last one*/
|
93
|
+
} ;
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
#define CROCO_LOG_DOMAIN "LIBCROCO"
|
99
|
+
|
100
|
+
#ifdef __GNUC__
|
101
|
+
#define cr_utils_trace(a_log_level, a_msg) \
|
102
|
+
g_log (CROCO_LOG_DOMAIN, \
|
103
|
+
G_LOG_LEVEL_CRITICAL, \
|
104
|
+
"file %s: line %d (%s): %s\n", \
|
105
|
+
__FILE__, \
|
106
|
+
__LINE__, \
|
107
|
+
__PRETTY_FUNCTION__, \
|
108
|
+
a_msg)
|
109
|
+
#else /*__GNUC__*/
|
110
|
+
|
111
|
+
#define cr_utils_trace(a_log_level, a_msg) \
|
112
|
+
g_log (CROCO_LOG_DOMAIN, \
|
113
|
+
G_LOG_LEVEL_CRITICAL, \
|
114
|
+
"file %s: line %d: %s\n", \
|
115
|
+
__FILE__, \
|
116
|
+
__LINE__, \
|
117
|
+
a_msg)
|
118
|
+
#endif
|
119
|
+
|
120
|
+
/**
|
121
|
+
*Traces an info message.
|
122
|
+
*The file, line and enclosing function
|
123
|
+
*of the message will be automatically
|
124
|
+
*added to the message.
|
125
|
+
*@param a_msg the msg to trace.
|
126
|
+
*/
|
127
|
+
#define cr_utils_trace_info(a_msg) \
|
128
|
+
cr_utils_trace (G_LOG_LEVEL_INFO, a_msg)
|
129
|
+
|
130
|
+
/**
|
131
|
+
*Trace a debug message.
|
132
|
+
*The file, line and enclosing function
|
133
|
+
*of the message will be automatically
|
134
|
+
*added to the message.
|
135
|
+
*@param a_msg the msg to trace.
|
136
|
+
*/
|
137
|
+
#define cr_utils_trace_debug(a_msg) \
|
138
|
+
cr_utils_trace (G_LOG_LEVEL_DEBUG, a_msg) ;
|
139
|
+
|
140
|
+
|
141
|
+
/****************************
|
142
|
+
*Encoding transformations and
|
143
|
+
*encoding helpers
|
144
|
+
****************************/
|
145
|
+
|
146
|
+
enum CRStatus
|
147
|
+
cr_utils_read_char_from_utf8_buf (const guchar * a_in, gulong a_in_len,
|
148
|
+
guint32 *a_out, gulong *a_consumed) ;
|
149
|
+
|
150
|
+
enum CRStatus
|
151
|
+
cr_utils_ucs1_to_utf8 (const guchar *a_in, gulong *a_in_len,
|
152
|
+
guchar *a_out, gulong *a_out_len) ;
|
153
|
+
|
154
|
+
enum CRStatus
|
155
|
+
cr_utils_utf8_to_ucs1 (const guchar * a_in, gulong * a_in_len,
|
156
|
+
guchar *a_out, gulong *a_out_len) ;
|
157
|
+
|
158
|
+
enum CRStatus
|
159
|
+
cr_utils_ucs4_to_utf8 (const guint32 *a_in, gulong *a_in_len,
|
160
|
+
guchar *a_out, gulong *a_out_len) ;
|
161
|
+
|
162
|
+
enum CRStatus
|
163
|
+
cr_utils_utf8_str_len_as_ucs4 (const guchar *a_in_start,
|
164
|
+
const guchar *a_in_end,
|
165
|
+
gulong *a_len) ;
|
166
|
+
enum CRStatus
|
167
|
+
cr_utils_ucs1_str_len_as_utf8 (const guchar *a_in_start,
|
168
|
+
const guchar *a_in_end,
|
169
|
+
gulong *a_len) ;
|
170
|
+
enum CRStatus
|
171
|
+
cr_utils_utf8_str_len_as_ucs1 (const guchar *a_in_start,
|
172
|
+
const guchar *a_in_end,
|
173
|
+
gulong *a_len) ;
|
174
|
+
enum CRStatus
|
175
|
+
cr_utils_ucs4_str_len_as_utf8 (const guint32 *a_in_start,
|
176
|
+
const guint32 *a_in_end,
|
177
|
+
gulong *a_len) ;
|
178
|
+
|
179
|
+
enum CRStatus
|
180
|
+
cr_utils_ucs1_str_to_utf8 (const guchar *a_in_start,
|
181
|
+
gulong *a_in_len,
|
182
|
+
guchar **a_out,
|
183
|
+
gulong *a_len) ;
|
184
|
+
|
185
|
+
enum CRStatus
|
186
|
+
cr_utils_utf8_str_to_ucs1 (const guchar * a_in_start,
|
187
|
+
gulong * a_in_len,
|
188
|
+
guchar **a_out,
|
189
|
+
gulong *a_out_len) ;
|
190
|
+
|
191
|
+
enum CRStatus
|
192
|
+
cr_utils_utf8_to_ucs4 (const guchar * a_in,
|
193
|
+
gulong * a_in_len,
|
194
|
+
guint32 *a_out, gulong *a_out_len) ;
|
195
|
+
|
196
|
+
enum CRStatus
|
197
|
+
cr_utils_ucs4_str_to_utf8 (const guint32 *a_in,
|
198
|
+
gulong *a_in_len,
|
199
|
+
guchar **a_out, gulong *a_out_len) ;
|
200
|
+
|
201
|
+
enum CRStatus
|
202
|
+
cr_utils_utf8_str_to_ucs4 (const guchar * a_in,
|
203
|
+
gulong *a_in_len,
|
204
|
+
guint32 **a_out,
|
205
|
+
gulong *a_out_len) ;
|
206
|
+
|
207
|
+
|
208
|
+
/*****************************************
|
209
|
+
*CSS basic types identification utilities
|
210
|
+
*****************************************/
|
211
|
+
|
212
|
+
gboolean
|
213
|
+
cr_utils_is_newline (guint32 a_char) ;
|
214
|
+
|
215
|
+
gboolean
|
216
|
+
cr_utils_is_white_space (guint32 a_char) ;
|
217
|
+
|
218
|
+
gboolean
|
219
|
+
cr_utils_is_nonascii (guint32 a_char) ;
|
220
|
+
|
221
|
+
gboolean
|
222
|
+
cr_utils_is_hexa_char (guint32 a_char) ;
|
223
|
+
|
224
|
+
|
225
|
+
/**********************************
|
226
|
+
*Miscellaneous utility functions
|
227
|
+
***********************************/
|
228
|
+
|
229
|
+
void
|
230
|
+
cr_utils_dump_n_chars (guchar a_char,
|
231
|
+
FILE *a_fp,
|
232
|
+
glong a_nb) ;
|
233
|
+
|
234
|
+
void
|
235
|
+
cr_utils_dump_n_chars2 (guchar a_char,
|
236
|
+
GString *a_string,
|
237
|
+
glong a_nb) ;
|
238
|
+
GList *
|
239
|
+
cr_utils_dup_glist_of_string (GList const *a_list) ;
|
240
|
+
|
241
|
+
GList *
|
242
|
+
cr_utils_dup_glist_of_cr_string (GList const * a_list_of_strings) ;
|
243
|
+
|
244
|
+
G_END_DECLS
|
245
|
+
|
246
|
+
#endif /*__CR_DEFS_H__*/
|