~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/dom/prop-svg.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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>
 
31
 
 
32
 
 
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
};
 
44
 
 
45
typedef struct SvgProp_def SvgProp;
 
46
 
 
47
static SvgProp svgProps[] =
 
48
{
 
49
 
 
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
},
 
60
 
 
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
},
 
71
 
 
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
},
 
82
 
 
83
{
 
84
"clip-path",
 
85
"<uri> | none | inherit",
 
86
"none",
 
87
"container elements and graphics elements",
 
88
false,
 
89
"",
 
90
"visual",
 
91
true
 
92
},
 
93
 
 
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
},
 
104
 
 
105
{
 
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
},
 
115
 
 
116
{
 
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
},
 
126
 
 
127
{
 
128
"color-interpolation-filters",
 
129
"auto | sRGB | linearRGB | inherit",
 
130
"linearRGB",
 
131
"filter primitives",
 
132
true,
 
133
"",
 
134
"visual",
 
135
true
 
136
},
 
137
 
 
138
{
 
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
},
 
148
 
 
149
{
 
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
},
 
159
 
 
160
{
 
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
},
 
170
 
 
171
{
 
172
"direction",
 
173
"ltr | rtl | inherit",
 
174
"ltr",
 
175
"text content elements",
 
176
true,
 
177
"",
 
178
"visual",
 
179
false
 
180
},
 
181
 
 
182
{
 
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
},
 
192
 
 
193
{
 
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
},
 
203
 
 
204
{
 
205
"enable-background",
 
206
"accumulate | new [ <x> <y> <width> <height> ] | inherit",
 
207
"accumulate",
 
208
"container elements",
 
209
false,
 
210
"",
 
211
"visual",
 
212
false
 
213
},
 
214
 
 
215
{
 
216
"fill",
 
217
"<paint> (See Specifying paint)",
 
218
"black",
 
219
"shapes and text content elements",
 
220
true,
 
221
"",
 
222
"visual",
 
223
true
 
224
},
 
225
 
 
226
{
 
227
"fill-opacity",
 
228
"<opacity-value> | inherit",
 
229
"1",
 
230
"shapes and text content elements",
 
231
true,
 
232
"",
 
233
"visual",
 
234
true
 
235
},
 
236
 
 
237
{
 
238
"fill-rule",
 
239
"nonzero | evenodd | inherit",
 
240
"nonzero",
 
241
"shapes and text content elements",
 
242
true,
 
243
"",
 
244
"visual",
 
245
true
 
246
},
 
247
 
 
248
{
 
249
"filter",
 
250
"<uri> | none | inherit",
 
251
"none",
 
252
"container elements and graphics elements",
 
253
false,
 
254
"",
 
255
"visual",
 
256
true
 
257
},
 
258
 
 
259
{
 
260
"flood-color",
 
261
"currentColor | <color> [icc-color(<name>[,<icccolorvalue>]*)] | inherit",
 
262
"black",
 
263
"'feFlood' elements",
 
264
false,
 
265
"",
 
266
"visual",
 
267
true
 
268
},
 
269
 
 
270
{
 
271
"flood-opacity",
 
272
"<opacity-value> | inherit",
 
273
"1",
 
274
"'feFlood' elements",
 
275
false,
 
276
"",
 
277
"visual",
 
278
true
 
279
},
 
280
 
 
281
{
 
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
},
 
291
 
 
292
{
 
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
},
 
302
 
 
303
{
 
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
},
 
313
 
 
314
{
 
315
"font-size-adjust",
 
316
"<number> | none | inherit",
 
317
"none",
 
318
"text content elements",
 
319
true,
 
320
"",
 
321
"visual",
 
322
true
 
323
},
 
324
 
 
325
{
 
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
},
 
335
 
 
336
{
 
337
"font-style",
 
338
"normal | italic | oblique | inherit",
 
339
"normal",
 
340
"text content elements",
 
341
true,
 
342
"",
 
343
"visual",
 
344
true
 
345
},
 
346
 
 
347
{
 
348
"font-variant",
 
349
"normal | small-caps | inherit",
 
350
"normal",
 
351
"text content elements",
 
352
true,
 
353
"",
 
354
"visual",
 
355
true
 
356
},
 
357
 
 
358
{
 
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
},
 
368
 
 
369
{
 
370
"glyph-orientation-horizontal",
 
371
"<angle> | inherit",
 
372
"0deg",
 
373
"text content elements",
 
374
true,
 
375
"",
 
376
"visual",
 
377
false
 
378
},
 
379
 
 
380
{
 
381
"glyph-orientation-vertical",
 
382
"auto | <angle> | inherit",
 
383
"auto",
 
384
"text content elements",
 
385
true,
 
386
"",
 
387
"visual",
 
388
false
 
389
},
 
390
 
 
391
{
 
392
"image-rendering",
 
393
"auto | optimizeSpeed | optimizeQuality | inherit",
 
394
"auto",
 
395
"images",
 
396
true,
 
397
"",
 
398
"visual",
 
399
true
 
400
},
 
401
 
 
402
{
 
403
"kerning",
 
404
"auto | <length> | inherit",
 
405
"auto",
 
406
"text content elements",
 
407
true,
 
408
"",
 
409
"visual",
 
410
true
 
411
},
 
412
 
 
413
{
 
414
"letter-spacing",
 
415
"normal | <length> | inherit",
 
416
"normal",
 
417
"text content elements",
 
418
true,
 
419
"",
 
420
"visual",
 
421
true
 
422
},
 
423
 
 
424
{
 
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
},
 
434
 
 
435
{
 
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
},
 
445
 
 
446
{
 
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
},
 
456
 
 
457
{
 
458
"mask",
 
459
"<uri> | none | inherit",
 
460
"none",
 
461
"container elements and graphics elements",
 
462
false,
 
463
"",
 
464
"visual",
 
465
true
 
466
},
 
467
 
 
468
{
 
469
"opacity",
 
470
"<opacity-value> | inherit",
 
471
"1",
 
472
"container elements and graphics elements",
 
473
false,
 
474
"",
 
475
"visual",
 
476
true
 
477
},
 
478
 
 
479
{
 
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
},
 
489
 
 
490
{
 
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
},
 
500
 
 
501
{
 
502
"shape-rendering",
 
503
"auto | optimizeSpeed | crispEdges | geometricPrecision | inherit",
 
504
"auto",
 
505
"shapes",
 
506
true,
 
507
"",
 
508
"visual",
 
509
true
 
510
},
 
511
 
 
512
{
 
513
"stop-color",
 
514
"currentColor | <color> [icc-color(<name>[,<icccolorvalue>]*)] | inherit",
 
515
"black",
 
516
"stop' elements",
 
517
false,
 
518
"",
 
519
"visual",
 
520
true
 
521
},
 
522
 
 
523
{
 
524
"stop-opacity",
 
525
"<opacity-value> | inherit",
 
526
"1",
 
527
"stop' elements",
 
528
false,
 
529
"",
 
530
"visual",
 
531
true
 
532
},
 
533
 
 
534
{
 
535
"stroke",
 
536
"<paint> (See Specifying paint)",
 
537
"none",
 
538
"shapes and text content elements",
 
539
true,
 
540
"",
 
541
"visual",
 
542
true
 
543
},
 
544
 
 
545
{
 
546
"stroke-dasharray",
 
547
"none | <dasharray> | inherit",
 
548
"none",
 
549
"shapes and text content elements",
 
550
true,
 
551
"",
 
552
"visual",
 
553
""
 
554
},
 
555
 
 
556
{
 
557
"stroke-dashoffset",
 
558
"<length> | inherit",
 
559
"0",
 
560
"shapes and text content elements",
 
561
true,
 
562
"see prose",
 
563
"visual",
 
564
true
 
565
},
 
566
 
 
567
{
 
568
"stroke-linecap",
 
569
"butt | round | square | inherit",
 
570
"butt",
 
571
"shapes and text content elements",
 
572
true,
 
573
"",
 
574
"visual",
 
575
true
 
576
},
 
577
 
 
578
{
 
579
"stroke-linejoin",
 
580
"miter | round | bevel | inherit",
 
581
"miter",
 
582
"shapes and text content elements",
 
583
true,
 
584
"",
 
585
"visual",
 
586
true
 
587
},
 
588
 
 
589
{
 
590
"stroke-miterlimit",
 
591
"<miterlimit> | inherit",
 
592
"4",
 
593
"shapes and text content elements",
 
594
true,
 
595
"",
 
596
"visual",
 
597
true
 
598
},
 
599
 
 
600
{
 
601
"stroke-opacity",
 
602
"<opacity-value> | inherit",
 
603
"1",
 
604
"shapes and text content elements",
 
605
true,
 
606
"",
 
607
"visual",
 
608
true
 
609
},
 
610
 
 
611
{
 
612
"stroke-width",
 
613
"<length> | inherit",
 
614
"1",
 
615
"shapes and text content elements",
 
616
true,
 
617
"",
 
618
"visual",
 
619
true
 
620
},
 
621
 
 
622
{
 
623
"text-anchor",
 
624
"start | middle | end | inherit",
 
625
"start",
 
626
"text content elements",
 
627
true,
 
628
"",
 
629
"visual",
 
630
true
 
631
},
 
632
 
 
633
{
 
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
},
 
643
 
 
644
{
 
645
"text-rendering",
 
646
"auto | optimizeSpeed | optimizeLegibility | geometricPrecision | inherit",
 
647
"auto",
 
648
"'text' elements",
 
649
true,
 
650
"",
 
651
"visual",
 
652
true
 
653
},
 
654
 
 
655
{
 
656
"unicode-bidi",
 
657
"normal | embed | bidi-override | inherit",
 
658
"normal",
 
659
"text content elements",
 
660
false,
 
661
"",
 
662
"visual",
 
663
false
 
664
},
 
665
 
 
666
{
 
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
},
 
676
 
 
677
{
 
678
"word-spacing",
 
679
"normal | <length> | inherit",
 
680
"normal",
 
681
"text content elements",
 
682
true,
 
683
"",
 
684
"visual",
 
685
true
 
686
},
 
687
 
 
688
{
 
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
},
 
698
 
 
699
{
 
700
NULL,
 
701
NULL,
 
702
NULL,
 
703
NULL,
 
704
false,
 
705
NULL,
 
706
NULL,
 
707
false
 
708
}
 
709
 
 
710
};
 
711
 
 
712
 
 
713
static void
 
714
printTable()
 
715
{
 
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
    }
 
727
}
 
728
 
 
729
 
 
730
int main(int /*argc*/, char **/*argv*/)
 
731
{
 
732
    printTable();
 
733
    return ( ferror(stdout) ? EXIT_FAILURE : EXIT_SUCCESS );
 
734
}
 
735
 
 
736
 
 
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:encoding=utf-8:textwidth=99 :