1 #ifndef __SP_ATTRIBUTES_H__
2 #define __SP_ATTRIBUTES_H__
4 /** \file
5 * Lookup dictionary for attributes/properties.
6 */
7 /*
8 * Author:
9 * Lauris Kaplinski <lauris@kaplinski.com>
10 *
11 * Copyright (C) 2006 Johan Engelen <johan@shouraizou.nl>
12 * Copyright (C) 2002 Lauris Kaplinski
13 *
14 * Released under GNU GPL, read the file 'COPYING' for more information
15 */
16 #include <glib/gtypes.h>
17 #include <glib/gmessages.h>
19 unsigned int sp_attribute_lookup(gchar const *key);
20 unsigned char const *sp_attribute_name(unsigned int id);
22 /**
23 * True iff k is a property in SVG, i.e. something that can be written either in a style attribute
24 * or as its own XML attribute.
25 */
26 #define SP_ATTRIBUTE_IS_CSS(k) (((k) >= SP_PROP_INKSCAPE_FONT_SPEC) && ((k) <= SP_PROP_TEXT_RENDERING))
28 enum SPAttributeEnum {
29 SP_ATTR_INVALID, ///< Must have value 0.
30 /* SPObject */
31 SP_ATTR_ID,
32 SP_ATTR_INKSCAPE_COLLECT,
33 SP_ATTR_INKSCAPE_LABEL,
34 /* SPItem */
35 SP_ATTR_TRANSFORM,
36 SP_ATTR_SODIPODI_INSENSITIVE,
37 SP_ATTR_SODIPODI_NONPRINTABLE,
38 SP_ATTR_CONNECTOR_AVOID,
39 SP_ATTR_STYLE,
40 SP_ATTR_TRANSFORM_CENTER_X,
41 SP_ATTR_TRANSFORM_CENTER_Y,
42 SP_ATTR_INKSCAPE_PATH_EFFECT,
43 /* SPAnchor */
44 SP_ATTR_XLINK_HREF,
45 SP_ATTR_XLINK_TYPE,
46 SP_ATTR_XLINK_ROLE,
47 SP_ATTR_XLINK_ARCROLE,
48 SP_ATTR_XLINK_TITLE,
49 SP_ATTR_XLINK_SHOW,
50 SP_ATTR_XLINK_ACTUATE,
51 SP_ATTR_TARGET,
52 /* SPGroup */
53 SP_ATTR_INKSCAPE_GROUPMODE,
54 /* SPRoot */
55 SP_ATTR_VERSION,
56 SP_ATTR_WIDTH,
57 SP_ATTR_HEIGHT,
58 SP_ATTR_VIEWBOX,
59 SP_ATTR_PRESERVEASPECTRATIO,
60 SP_ATTR_SODIPODI_VERSION,
61 SP_ATTR_INKSCAPE_VERSION,
62 SP_ATTR_ONLOAD,
63 /* SPNamedView */
64 SP_ATTR_VIEWONLY,
65 SP_ATTR_SHOWGUIDES,
66 SP_ATTR_SHOWGRIDS,
67 SP_ATTR_GRIDTOLERANCE,
68 SP_ATTR_GUIDETOLERANCE,
69 SP_ATTR_OBJECTTOLERANCE,
70 SP_ATTR_GUIDECOLOR,
71 SP_ATTR_GUIDEOPACITY,
72 SP_ATTR_GUIDEHICOLOR,
73 SP_ATTR_GUIDEHIOPACITY,
74 SP_ATTR_SHOWBORDER,
75 SP_ATTR_SHOWPAGESHADOW,
76 SP_ATTR_BORDERLAYER,
77 SP_ATTR_BORDERCOLOR,
78 SP_ATTR_BORDEROPACITY,
79 SP_ATTR_PAGECOLOR,
80 SP_ATTR_INKSCAPE_PAGEOPACITY,
81 SP_ATTR_INKSCAPE_PAGESHADOW,
82 SP_ATTR_INKSCAPE_ZOOM,
83 SP_ATTR_INKSCAPE_CX,
84 SP_ATTR_INKSCAPE_CY,
85 SP_ATTR_INKSCAPE_WINDOW_WIDTH,
86 SP_ATTR_INKSCAPE_WINDOW_HEIGHT,
87 SP_ATTR_INKSCAPE_WINDOW_X,
88 SP_ATTR_INKSCAPE_WINDOW_Y,
89 SP_ATTR_INKSCAPE_SNAP_GLOBAL,
90 SP_ATTR_INKSCAPE_SNAP_BBOX,
91 SP_ATTR_INKSCAPE_SNAP_NODES,
92 SP_ATTR_INKSCAPE_SNAP_GUIDE,
93 SP_ATTR_INKSCAPE_SNAP_CENTER,
94 SP_ATTR_INKSCAPE_SNAP_SMOOTH_NODES,
95 SP_ATTR_INKSCAPE_SNAP_MIDPOINTS,
96 SP_ATTR_INKSCAPE_SNAP_INTERS_GRIDGUIDE,
97 SP_ATTR_INKSCAPE_SNAP_INTERS_PATHS,
98 SP_ATTR_INKSCAPE_OBJECT_PATHS,
99 SP_ATTR_INKSCAPE_OBJECT_NODES,
100 SP_ATTR_INKSCAPE_BBOX_PATHS,
101 SP_ATTR_INKSCAPE_BBOX_NODES,
102 SP_ATTR_INKSCAPE_SNAP_PAGE,
103 SP_ATTR_INKSCAPE_CURRENT_LAYER,
104 SP_ATTR_INKSCAPE_DOCUMENT_UNITS,
105 SP_ATTR_INKSCAPE_CONNECTOR_SPACING,
106 /* SPColorProfile */
107 SP_ATTR_LOCAL,
108 SP_ATTR_NAME,
109 SP_ATTR_RENDERING_INTENT,
110 /* SPGuide */
111 SP_ATTR_ORIENTATION,
112 SP_ATTR_POSITION,
113 /* SPImage */
114 SP_ATTR_X,
115 SP_ATTR_Y,
116 /* SPPath */
117 SP_ATTR_D,
118 SP_ATTR_INKSCAPE_ORIGINAL_D,
119 SP_ATTR_CONNECTOR_TYPE,
120 SP_ATTR_CONNECTION_START,
121 SP_ATTR_CONNECTION_END,
122 /* SPRect */
123 SP_ATTR_RX,
124 SP_ATTR_RY,
125 /* Box3D */
126 SP_ATTR_INKSCAPE_BOX3D_PERSPECTIVE_ID,
127 SP_ATTR_INKSCAPE_BOX3D_CORNER0, // "upper left front" corner (as a point in 3-space)
128 SP_ATTR_INKSCAPE_BOX3D_CORNER7, // "lower right rear" corner (as a point in 3-space)
129 /* Box3DSide */
130 SP_ATTR_INKSCAPE_BOX3D_SIDE_TYPE,
131 /* Persp3D */
132 SP_ATTR_INKSCAPE_PERSP3D,
133 SP_ATTR_INKSCAPE_PERSP3D_VP_X,
134 SP_ATTR_INKSCAPE_PERSP3D_VP_Y,
135 SP_ATTR_INKSCAPE_PERSP3D_VP_Z,
136 SP_ATTR_INKSCAPE_PERSP3D_ORIGIN,
137 /* SPEllipse */
138 SP_ATTR_R,
139 SP_ATTR_CX,
140 SP_ATTR_CY,
141 SP_ATTR_SODIPODI_CX,
142 SP_ATTR_SODIPODI_CY,
143 SP_ATTR_SODIPODI_RX,
144 SP_ATTR_SODIPODI_RY,
145 SP_ATTR_SODIPODI_START,
146 SP_ATTR_SODIPODI_END,
147 SP_ATTR_SODIPODI_OPEN,
148 /* SPStar */
149 SP_ATTR_SODIPODI_SIDES,
150 SP_ATTR_SODIPODI_R1,
151 SP_ATTR_SODIPODI_R2,
152 SP_ATTR_SODIPODI_ARG1,
153 SP_ATTR_SODIPODI_ARG2,
154 SP_ATTR_INKSCAPE_FLATSIDED,
155 SP_ATTR_INKSCAPE_ROUNDED,
156 SP_ATTR_INKSCAPE_RANDOMIZED,
157 /* SPSpiral */
158 SP_ATTR_SODIPODI_EXPANSION,
159 SP_ATTR_SODIPODI_REVOLUTION,
160 SP_ATTR_SODIPODI_RADIUS,
161 SP_ATTR_SODIPODI_ARGUMENT,
162 SP_ATTR_SODIPODI_T0,
163 /* SPOffset */
164 SP_ATTR_SODIPODI_ORIGINAL,
165 SP_ATTR_INKSCAPE_ORIGINAL,
166 SP_ATTR_INKSCAPE_HREF,
167 SP_ATTR_INKSCAPE_RADIUS,
168 /* SPLine */
169 SP_ATTR_X1,
170 SP_ATTR_Y1,
171 SP_ATTR_X2,
172 SP_ATTR_Y2,
173 /* SPPolyline */
174 SP_ATTR_POINTS,
175 /* SPTSpan */
176 SP_ATTR_DX,
177 SP_ATTR_DY,
178 SP_ATTR_ROTATE,
179 SP_ATTR_SODIPODI_ROLE,
180 /* SPText */
181 SP_ATTR_SODIPODI_LINESPACING,
182 /* SPTextPath */
183 SP_ATTR_STARTOFFSET,
184 /* SPStop */
185 SP_ATTR_OFFSET,
186 /* SPFilter */
187 SP_ATTR_FILTERUNITS,
188 SP_ATTR_PRIMITIVEUNITS,
189 SP_ATTR_FILTERRES,
190 /* Filter primitives common */
191 SP_ATTR_IN,
192 SP_ATTR_RESULT,
193 /*feBlend*/
194 SP_ATTR_MODE,
195 SP_ATTR_IN2,
196 /*feColorMatrix*/
197 SP_ATTR_TYPE,
198 SP_ATTR_VALUES,
199 /*feComponentTransfer*/
200 //SP_ATTR_TYPE,
201 SP_ATTR_TABLEVALUES,
202 SP_ATTR_SLOPE,
203 SP_ATTR_INTERCEPT,
204 SP_ATTR_AMPLITUDE,
205 SP_ATTR_EXPONENT,
206 //SP_ATTR_OFFSET,
207 /*feComposite*/
208 SP_ATTR_OPERATOR,
209 SP_ATTR_K1,
210 SP_ATTR_K2,
211 SP_ATTR_K3,
212 SP_ATTR_K4,
213 //SP_ATTR_IN2,
214 /*feConvolveMatrix*/
215 SP_ATTR_ORDER,
216 SP_ATTR_KERNELMATRIX,
217 SP_ATTR_DIVISOR,
218 SP_ATTR_BIAS,
219 SP_ATTR_TARGETX,
220 SP_ATTR_TARGETY,
221 SP_ATTR_EDGEMODE,
222 SP_ATTR_KERNELUNITLENGTH,
223 SP_ATTR_PRESERVEALPHA,
224 /*feDiffuseLighting*/
225 SP_ATTR_SURFACESCALE,
226 SP_ATTR_DIFFUSECONSTANT,
227 //SP_ATTR_KERNELUNITLENGTH,
228 /*feDisplacementMap*/
229 SP_ATTR_SCALE,
230 SP_ATTR_XCHANNELSELECTOR,
231 SP_ATTR_YCHANNELSELECTOR,
232 //SP_ATTR_IN2,
233 /*feDistantLight*/
234 SP_ATTR_AZIMUTH,
235 SP_ATTR_ELEVATION,
236 /*fePointLight*/
237 SP_ATTR_Z,
238 /*feSpotLight*/
239 SP_ATTR_POINTSATX,
240 SP_ATTR_POINTSATY,
241 SP_ATTR_POINTSATZ,
242 SP_ATTR_LIMITINGCONEANGLE,
243 /*feFlood*/
244 SP_ATTR_FLOODCOLOR,
245 SP_ATTR_FLOODOPACITY,
246 /* SPGaussianBlur */
247 SP_ATTR_STDDEVIATION,
248 /*feImage*/
249 /*feMerge*/
250 /*feMorphology*/
251 //SP_ATTR_OPERATOR,
252 SP_ATTR_RADIUS,
253 /*feOffset*/
254 //SP_ATTR_DX,
255 //SP_ATTR_DY,
256 /*feSpecularLighting*/
257 //SP_ATTR_SURFACESCALE,
258 SP_ATTR_SPECULARCONSTANT,
259 SP_ATTR_SPECULAREXPONENT,
260 /*feTile*/
261 /*feTurbulence*/
262 SP_ATTR_BASEFREQUENCY,
263 SP_ATTR_NUMOCTAVES,
264 SP_ATTR_SEED,
265 SP_ATTR_STITCHTILES,
266 //SP_ATTR_TYPE,
267 /* SPGradient */
268 SP_ATTR_GRADIENTUNITS,
269 SP_ATTR_GRADIENTTRANSFORM,
270 SP_ATTR_SPREADMETHOD,
271 /* SPRadialGradient */
272 SP_ATTR_FX,
273 SP_ATTR_FY,
274 /* SPPattern */
275 SP_ATTR_PATTERNUNITS,
276 SP_ATTR_PATTERNCONTENTUNITS,
277 SP_ATTR_PATTERNTRANSFORM,
278 /* SPClipPath */
279 SP_ATTR_CLIPPATHUNITS,
280 /* SPMask */
281 SP_ATTR_MASKUNITS,
282 SP_ATTR_MASKCONTENTUNITS,
283 /* SPMarker */
284 SP_ATTR_MARKERUNITS,
285 SP_ATTR_REFX,
286 SP_ATTR_REFY,
287 SP_ATTR_MARKERWIDTH,
288 SP_ATTR_MARKERHEIGHT,
289 SP_ATTR_ORIENT,
290 /* SPStyleElem */
291 //SP_ATTR_TYPE,
292 /* Animations */
293 SP_ATTR_ATTRIBUTENAME,
294 SP_ATTR_ATTRIBUTETYPE,
295 SP_ATTR_BEGIN,
296 SP_ATTR_DUR,
297 SP_ATTR_END,
298 SP_ATTR_MIN,
299 SP_ATTR_MAX,
300 SP_ATTR_RESTART,
301 SP_ATTR_REPEATCOUNT,
302 SP_ATTR_REPEATDUR,
303 /* Interpolating animations */
304 SP_ATTR_CALCMODE,
305 //SP_ATTR_VALUES,
306 SP_ATTR_KEYTIMES,
307 SP_ATTR_KEYSPLINES,
308 SP_ATTR_FROM,
309 SP_ATTR_TO,
310 SP_ATTR_BY,
311 SP_ATTR_ADDITIVE,
312 SP_ATTR_ACCUMULATE,
314 /* SVGFonts */
315 /* SPFont */
316 SP_ATTR_HORIZ_ORIGIN_X,
317 SP_ATTR_HORIZ_ORIGIN_Y,
318 SP_ATTR_HORIZ_ADV_X,
319 SP_ATTR_VERT_ORIGIN_X,
320 SP_ATTR_VERT_ORIGIN_Y,
321 SP_ATTR_VERT_ADV_Y,
323 SP_ATTR_UNICODE,
324 SP_ATTR_GLYPH_NAME,
325 //SP_ATTR_ORIENTATION,
326 SP_ATTR_ARABIC_FORM,
327 SP_ATTR_LANG,
329 /*<hkern> and <vkern>*/
330 SP_ATTR_U1,
331 SP_ATTR_G1,
332 SP_ATTR_U2,
333 SP_ATTR_G2,
334 SP_ATTR_K,
336 /*<font-face>*/
337 // SP_ATTR_FONT_FAMILY,
338 // SP_ATTR_FONT_STYLE,
339 // SP_ATTR_FONT_VARIANT,
340 // SP_ATTR_FONT_WEIGHT,
341 // SP_ATTR_FONT_STRETCH,
342 // SP_ATTR_FONT_SIZE,
343 SP_ATTR_UNICODE_RANGE,
344 SP_ATTR_UNITS_PER_EM,
345 SP_ATTR_PANOSE_1,
346 SP_ATTR_STEMV,
347 SP_ATTR_STEMH,
348 //SP_ATTR_SLOPE,
349 SP_ATTR_CAP_HEIGHT,
350 SP_ATTR_X_HEIGHT,
351 SP_ATTR_ACCENT_HEIGHT,
352 SP_ATTR_ASCENT,
353 SP_ATTR_DESCENT,
354 SP_ATTR_WIDTHS,
355 SP_ATTR_BBOX,
356 SP_ATTR_IDEOGRAPHIC,
357 SP_ATTR_ALPHABETIC,
358 SP_ATTR_MATHEMATICAL,
359 SP_ATTR_HANGING,
360 SP_ATTR_V_IDEOGRAPHIC,
361 SP_ATTR_V_ALPHABETIC,
362 SP_ATTR_V_MATHEMATICAL,
363 SP_ATTR_V_HANGING,
364 SP_ATTR_UNDERLINE_POSITION,
365 SP_ATTR_UNDERLINE_THICKNESS,
366 SP_ATTR_STRIKETHROUGH_POSITION,
367 SP_ATTR_STRIKETHROUGH_THICKNESS,
368 SP_ATTR_OVERLINE_POSITION,
369 SP_ATTR_OVERLINE_THICKNESS,
371 /* XML */
372 SP_ATTR_XML_SPACE,
374 /* typeset */
375 SP_ATTR_TEXT_NOMARKUP,
376 SP_ATTR_TEXT_PANGOMARKUP,
377 SP_ATTR_TEXT_INSHAPE,
378 SP_ATTR_TEXT_ONPATH,
379 SP_ATTR_TEXT_INBOX,
380 SP_ATTR_TEXT_INCOLUMN,
381 SP_ATTR_TEXT_EXCLUDE,
382 SP_ATTR_LAYOUT_OPTIONS,
384 /* CSS2 */
385 /* Custom full font name because Font stuff below is inadequate */
386 SP_PROP_INKSCAPE_FONT_SPEC,
387 /* Font */
388 SP_PROP_FONT,
389 SP_PROP_FONT_FAMILY,
390 SP_PROP_FONT_SIZE,
391 SP_PROP_FONT_SIZE_ADJUST,
392 SP_PROP_FONT_STRETCH,
393 SP_PROP_FONT_STYLE,
394 SP_PROP_FONT_VARIANT,
395 SP_PROP_FONT_WEIGHT,
396 /* Text */
397 SP_PROP_TEXT_INDENT,
398 SP_PROP_TEXT_ALIGN,
399 SP_PROP_TEXT_DECORATION,
400 SP_PROP_LINE_HEIGHT,
401 SP_PROP_LETTER_SPACING,
402 SP_PROP_WORD_SPACING,
403 SP_PROP_TEXT_TRANSFORM,
404 /* text (css3) */
405 SP_PROP_DIRECTION,
406 SP_PROP_BLOCK_PROGRESSION,
407 SP_PROP_WRITING_MODE,
408 SP_PROP_UNICODE_BIDI,
409 SP_PROP_ALIGNMENT_BASELINE,
410 SP_PROP_BASELINE_SHIFT,
411 SP_PROP_DOMINANT_BASELINE,
412 SP_PROP_GLYPH_ORIENTATION_HORIZONTAL,
413 SP_PROP_GLYPH_ORIENTATION_VERTICAL,
414 SP_PROP_KERNING,
415 SP_PROP_TEXT_ANCHOR,
416 /* Misc */
417 SP_PROP_CLIP,
418 SP_PROP_COLOR,
419 SP_PROP_CURSOR,
420 SP_PROP_DISPLAY,
421 SP_PROP_OVERFLOW,
422 SP_PROP_VISIBILITY,
423 /* SVG */
424 /* Clip/Mask */
425 SP_PROP_CLIP_PATH,
426 SP_PROP_CLIP_RULE,
427 SP_PROP_MASK,
428 SP_PROP_OPACITY,
429 /* Filter */
430 SP_PROP_ENABLE_BACKGROUND,
431 SP_PROP_FILTER,
432 SP_PROP_FLOOD_COLOR,
433 SP_PROP_FLOOD_OPACITY,
434 SP_PROP_LIGHTING_COLOR,
435 /* Gradient */
436 SP_PROP_STOP_COLOR,
437 SP_PROP_STOP_OPACITY,
438 /* Interactivity */
439 SP_PROP_POINTER_EVENTS,
440 /* Paint */
441 SP_PROP_COLOR_INTERPOLATION,
442 SP_PROP_COLOR_INTERPOLATION_FILTERS,
443 SP_PROP_COLOR_PROFILE,
444 SP_PROP_COLOR_RENDERING,
445 SP_PROP_FILL,
446 SP_PROP_FILL_OPACITY,
447 SP_PROP_FILL_RULE,
448 SP_PROP_IMAGE_RENDERING,
449 SP_PROP_MARKER,
450 SP_PROP_MARKER_END,
451 SP_PROP_MARKER_MID,
452 SP_PROP_MARKER_START,
453 SP_PROP_SHAPE_RENDERING,
454 SP_PROP_STROKE,
455 SP_PROP_STROKE_DASHARRAY,
456 SP_PROP_STROKE_DASHOFFSET,
457 SP_PROP_STROKE_LINECAP,
458 SP_PROP_STROKE_LINEJOIN,
459 SP_PROP_STROKE_MITERLIMIT,
460 SP_PROP_STROKE_OPACITY,
461 SP_PROP_STROKE_WIDTH,
462 SP_PROP_TEXT_RENDERING,
463 /* Conditional */
464 SP_PROP_SYSTEM_LANGUAGE,
465 SP_PROP_REQUIRED_FEATURES,
466 SP_PROP_REQUIRED_EXTENSIONS,
467 /* LivePathEffect */
468 SP_PROP_PATH_EFFECT,
469 };
471 #endif
474 /*
475 Local Variables:
476 mode:c++
477 c-file-style:"stroustrup"
478 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
479 indent-tabs-mode:nil
480 fill-column:99
481 End:
482 */
483 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :