Code

Extensions. XAML export improvements (flowRoot, text decoration, baseline alignement...
[inkscape.git] / src / dom / prop-svg.cpp
1 /**
2  * Phoebe DOM Implementation.
3  *
4  * This is a C++ approximation of the W3C DOM model, which follows
5  * fairly closely the specifications in the various .idl files, copies of
6  * which are provided for reference.  Most important is this one:
7  *
8  * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html
9  *
10  * Authors:
11  *   Bob Jamison
12  *
13  * Copyright (C) 2005 Bob Jamison
14  *
15  *  This library is free software; you can redistribute it and/or
16  *  modify it under the terms of the GNU Lesser General Public
17  *  License as published by the Free Software Foundation; either
18  *  version 2.1 of the License, or (at your option) any later version.
19  *
20  *  This library is distributed in the hope that it will be useful,
21  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
22  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
23  *  Lesser General Public License for more details.
24  *
25  *  You should have received a copy of the GNU Lesser General Public
26  *  License along with this library; if not, write to the Free Software
27  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
28  */
29 #include <stdio.h>
30 #include <stdlib.h>
33 struct SvgProp_def
34 {
35     char const *name;
36     char const *values;
37     char const *defaultValue;
38     char const *appliesTo;
39     bool inherited;
40     char const *percentages;
41     char const *mediaGroups;
42     bool animatable;
43 };
45 typedef struct SvgProp_def SvgProp;
47 static SvgProp svgProps[] =
48 {
50 {
51 "alignment-baseline",
52 "auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical | inherit",
53 "see property description",
54 "'tspan', 'tref', 'altGlyph', 'textPath' elements",
55 false,
56 "",
57 "visual",
58 true
59 },
61 {
62 "baseline-shift",
63 "baseline | sub | super | <percentage> | <length> | inherit",
64 "baseline",
65 "tspan', 'tref', 'altGlyph', 'textPath' elements",
66 false,
67 "refers to the 'line-height' of the 'text' element, which in the case of SVG is defined to be equal to the 'font-size",
68 "visual",
69 "yes (non-additive, 'set' and 'animate' elements only)"
70 },
72 {
73 "clip",
74 "<shape> | auto | inherit",
75 "auto",
76 "elements which establish a new viewport, 'pattern' elements and 'marker' elements",
77 false,
78 "",
79 "visual",
80 true
81 },
83 {
84 "clip-path",
85 "<uri> | none | inherit",
86 "none",
87 "container elements and graphics elements",
88 false,
89 "",
90 "visual",
91 true
92 },
94 {
95 "clip-rule",
96 "nonzero | evenodd | inherit",
97 "nonzero",
98 "graphics elements within a 'clipPath' element",
99 true,
100 "",
101 "visual",
102 true
103 },
106 "color",
107 "<color> | inherit",
108 "depends on user agent",
109 "elements to which properties 'fill', 'stroke', 'stop-color', 'flood-color', 'lighting-color' apply",
110 true,
111 "",
112 "visual",
113 true
114 },
117 "color-interpolation",
118 "auto | sRGB | linearRGB | inherit",
119 "sRGB",
120 "container elements, graphics elements and 'animateColor",
121 true,
122 "",
123 "visual",
124 true
125 },
128 "color-interpolation-filters",
129 "auto | sRGB | linearRGB | inherit",
130 "linearRGB",
131 "filter primitives",
132 true,
133 "",
134 "visual",
135 true
136 },
139 "color-profile",
140 "auto | sRGB | <name> | <uri> | inherit",
141 "auto",
142 "'image' elements that refer to raster images",
143 true,
144 "",
145 "visual",
146 true
147 },
150 "color-rendering",
151 "auto | optimizeSpeed | optimizeQuality | inherit",
152 "auto",
153 "container elements, graphics elements and 'animateColor",
154 true,
155 "",
156 "visual",
157 true
158 },
161 "cursor",
162 "[ [<uri> ,]* [ auto | crosshair | default | pointer | move | e-resize | ne-resize | nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize| text | wait | help ] ] | inherit",
163 "auto",
164 "container elements and graphics elements",
165 true,
166 "",
167 "visual, interactive",
168 true
169 },
172 "direction",
173 "ltr | rtl | inherit",
174 "ltr",
175 "text content elements",
176 true,
177 "",
178 "visual",
179 false
180 },
183 "display",
184 "inline | block | list-item | run-in | compact | marker | table | inline-table | table-row-group | table-header-group | table-footer-group | table-row | table-column-group | table-column | table-cell | table-caption | none | inherit",
185 "inline",
186 "'svg', 'g', 'switch', 'a', 'foreignObject', graphics elements (including the 'text' element) and text sub-elements (i.e., 'tspan', 'tref', 'altGlyph', 'textPath')",
187 false,
188 "",
189 "all",
190 true
191 },
194 "dominant-baseline",
195 "auto | use-script | no-change | reset-size | ideographic | alphabetic | hanging | mathematical | central | middle | text-after-edge | text-before-edge | inherit",
196 "auto",
197 "text content elements",
198 false,
199 "",
200 "visual",
201 true
202 },
205 "enable-background",
206 "accumulate | new [ <x> <y> <width> <height> ] | inherit",
207 "accumulate",
208 "container elements",
209 false,
210 "",
211 "visual",
212 false
213 },
216 "fill",
217 "<paint> (See Specifying paint)",
218 "black",
219 "shapes and text content elements",
220 true,
221 "",
222 "visual",
223 true
224 },
227 "fill-opacity",
228 "<opacity-value> | inherit",
229 "1",
230 "shapes and text content elements",
231 true,
232 "",
233 "visual",
234 true
235 },
238 "fill-rule",
239 "nonzero | evenodd | inherit",
240 "nonzero",
241 "shapes and text content elements",
242 true,
243 "",
244 "visual",
245 true
246 },
249 "filter",
250 "<uri> | none | inherit",
251 "none",
252 "container elements and graphics elements",
253 false,
254 "",
255 "visual",
256 true
257 },
260 "flood-color",
261 "currentColor | <color> [icc-color(<name>[,<icccolorvalue>]*)] | inherit",
262 "black",
263 "'feFlood' elements",
264 false,
265 "",
266 "visual",
267 true
268 },
271 "flood-opacity",
272 "<opacity-value> | inherit",
273 "1",
274 "'feFlood' elements",
275 false,
276 "",
277 "visual",
278 true
279 },
282 "font",
283 "[ [ 'font-style' || 'font-variant' || 'font-weight' ]? 'font-size' [ / 'line-height' ]? 'font-family' ] | caption | icon | menu | message-box | small-caption | status-bar | inherit",
284 "see individual properties",
285 "text content elements",
286 true,
287 "allowed on 'font-size' and 'line-height' ('line-height' same as 'font-size' in SVG)",
288 "visual",
289 "yes (non-additive, 'set' and 'animate' elements only)"
290 },
293 "font-family",
294 "[[ <family-name> | <generic-family> ],]* [ <family-name> | <generic-family>] | inherit",
295 "depends on user agent",
296 "text content elements",
297 true,
298 "",
299 "visual",
300 true
301 },
304 "font-size",
305 "<absolute-size> | <relative-size> | <length> | <percentage> | inherit",
306 "medium",
307 "text content elements",
308 "yes, the computed value is inherited",
309 "refer to parent element's font size",
310 "visual",
311 true
312 },
315 "font-size-adjust",
316 "<number> | none | inherit",
317 "none",
318 "text content elements",
319 true,
320 "",
321 "visual",
322 true
323 },
326 "font-stretch",
327 "normal | wider | narrower | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | inherit",
328 "normal",
329 "text content elements",
330 true,
331 "",
332 "visual",
333 true
334 },
337 "font-style",
338 "normal | italic | oblique | inherit",
339 "normal",
340 "text content elements",
341 true,
342 "",
343 "visual",
344 true
345 },
348 "font-variant",
349 "normal | small-caps | inherit",
350 "normal",
351 "text content elements",
352 true,
353 "",
354 "visual",
355 true
356 },
359 "font-weight",
360 "normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit",
361 "normal",
362 "text content elements",
363 true,
364 "",
365 "visual",
366 true
367 },
370 "glyph-orientation-horizontal",
371 "<angle> | inherit",
372 "0deg",
373 "text content elements",
374 true,
375 "",
376 "visual",
377 false
378 },
381 "glyph-orientation-vertical",
382 "auto | <angle> | inherit",
383 "auto",
384 "text content elements",
385 true,
386 "",
387 "visual",
388 false
389 },
392 "image-rendering",
393 "auto | optimizeSpeed | optimizeQuality | inherit",
394 "auto",
395 "images",
396 true,
397 "",
398 "visual",
399 true
400 },
403 "kerning",
404 "auto | <length> | inherit",
405 "auto",
406 "text content elements",
407 true,
408 "",
409 "visual",
410 true
411 },
414 "letter-spacing",
415 "normal | <length> | inherit",
416 "normal",
417 "text content elements",
418 true,
419 "",
420 "visual",
421 true
422 },
425 "lighting-color",
426 "currentColor | <color> [icc-color(<name>[,<icccolorvalue>]*)] | inherit",
427 "white",
428 "feDiffuseLighting' and 'feSpecularLighting' elements",
429 false,
430 "",
431 "visual",
432 true
433 },
436 "marker",
437 "see individual properties",
438 "see individual properties",
439 "path', 'line', 'polyline' and 'polygon' elements",
440 true,
441 "",
442 "visual",
443 true
444 },
447 "marker-end' 'marker-mid' 'marker-start",
448 "none | inherit | <uri>",
449 "none",
450 "path', 'line', 'polyline' and 'polygon' elements",
451 true,
452 "",
453 "visual",
454 true
455 },
458 "mask",
459 "<uri> | none | inherit",
460 "none",
461 "container elements and graphics elements",
462 false,
463 "",
464 "visual",
465 true
466 },
469 "opacity",
470 "<opacity-value> | inherit",
471 "1",
472 "container elements and graphics elements",
473 false,
474 "",
475 "visual",
476 true
477 },
480 "overflow",
481 "visible | hidden | scroll | auto | inherit",
482 "see prose",
483 "elements which establish a new viewport, 'pattern' elements and 'marker' elements",
484 false,
485 "",
486 "visual",
487 true
488 },
491 "pointer-events",
492 "visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | none | inherit",
493 "visiblePainted",
494 "graphics elements",
495 true,
496 "",
497 "visual",
498 true
499 },
502 "shape-rendering",
503 "auto | optimizeSpeed | crispEdges | geometricPrecision | inherit",
504 "auto",
505 "shapes",
506 true,
507 "",
508 "visual",
509 true
510 },
513 "stop-color",
514 "currentColor | <color> [icc-color(<name>[,<icccolorvalue>]*)] | inherit",
515 "black",
516 "stop' elements",
517 false,
518 "",
519 "visual",
520 true
521 },
524 "stop-opacity",
525 "<opacity-value> | inherit",
526 "1",
527 "stop' elements",
528 false,
529 "",
530 "visual",
531 true
532 },
535 "stroke",
536 "<paint> (See Specifying paint)",
537 "none",
538 "shapes and text content elements",
539 true,
540 "",
541 "visual",
542 true
543 },
546 "stroke-dasharray",
547 "none | <dasharray> | inherit",
548 "none",
549 "shapes and text content elements",
550 true,
551 "",
552 "visual",
553 ""
554 },
557 "stroke-dashoffset",
558 "<length> | inherit",
559 "0",
560 "shapes and text content elements",
561 true,
562 "see prose",
563 "visual",
564 true
565 },
568 "stroke-linecap",
569 "butt | round | square | inherit",
570 "butt",
571 "shapes and text content elements",
572 true,
573 "",
574 "visual",
575 true
576 },
579 "stroke-linejoin",
580 "miter | round | bevel | inherit",
581 "miter",
582 "shapes and text content elements",
583 true,
584 "",
585 "visual",
586 true
587 },
590 "stroke-miterlimit",
591 "<miterlimit> | inherit",
592 "4",
593 "shapes and text content elements",
594 true,
595 "",
596 "visual",
597 true
598 },
601 "stroke-opacity",
602 "<opacity-value> | inherit",
603 "1",
604 "shapes and text content elements",
605 true,
606 "",
607 "visual",
608 true
609 },
612 "stroke-width",
613 "<length> | inherit",
614 "1",
615 "shapes and text content elements",
616 true,
617 "",
618 "visual",
619 true
620 },
623 "text-anchor",
624 "start | middle | end | inherit",
625 "start",
626 "text content elements",
627 true,
628 "",
629 "visual",
630 true
631 },
634 "text-decoration",
635 "none | [ underline || overline || line-through || blink ] | inherit",
636 "none",
637 "text content elements",
638 "no (see prose)",
639 "",
640 "visual",
641 true
642 },
645 "text-rendering",
646 "auto | optimizeSpeed | optimizeLegibility | geometricPrecision | inherit",
647 "auto",
648 "'text' elements",
649 true,
650 "",
651 "visual",
652 true
653 },
656 "unicode-bidi",
657 "normal | embed | bidi-override | inherit",
658 "normal",
659 "text content elements",
660 false,
661 "",
662 "visual",
663 false
664 },
667 "visibility",
668 "visible | hidden | collapse | inherit",
669 "visible",
670 "graphics elements (including the 'text' element) and text sub-elements (i.e., 'tspan', 'tref', 'altGlyph', 'textPath' and 'a')",
671 true,
672 "",
673 "visual",
674 true
675 },
678 "word-spacing",
679 "normal | <length> | inherit",
680 "normal",
681 "text content elements",
682 true,
683 "",
684 "visual",
685 true
686 },
689 "writing-mode",
690 "lr-tb | rl-tb | tb-rl | lr | rl | tb | inherit",
691 "lr-tb",
692 "'text' elements",
693 true,
694 "",
695 "visual",
696 false
697 },
700 NULL,
701 NULL,
702 NULL,
703 NULL,
704 false,
705 NULL,
706 NULL,
707 false
710 };
713 static void
714 printTable()
716     for (SvgProp const *prop = svgProps; prop->name; prop++) {
717         printf("#### Prop: %s ####\n", prop->name);
718         printf("values      : %s\n", prop->values);
719         printf("defaultValue: %s\n", prop->defaultValue);
720         printf("appliesTo   : %s\n", prop->appliesTo);
721         printf("inherited   : %s\n", ( prop->inherited ? "true" : "false" ));
722         printf("percentages : %s\n", prop->percentages);
723         printf("groups      : %s\n", prop->mediaGroups);
724         printf("animatable  : %s\n", ( prop->animatable ? "true" : "false" ));
725         printf("\n");
726     }
730 int main(int /*argc*/, char **/*argv*/)
732     printTable();
733     return ( ferror(stdout) ? EXIT_FAILURE : EXIT_SUCCESS );
737 /*
738   Local Variables:
739   mode:c++
740   c-file-style:"stroustrup"
741   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
742   indent-tabs-mode:nil
743   fill-column:99
744   End:
745 */
746 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :