~danieljabailey/inkscape/arc_node_editor

« back to all changes in this revision

Viewing changes to src/attributes.cpp

  • Committer: Daniel Bailey
  • Date: 2016-07-09 13:51:59 UTC
  • mfrom: (14888.1.126 inkscape)
  • Revision ID: d@nielbailey.com-20160709135159-0wzbtr0mvmxnjtj0
MergeĀ upstreamĀ changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 
15
15
#include <glib.h> // g_assert()
16
16
#include "attributes.h"
 
17
#include <iostream>
17
18
 
18
19
typedef struct {
19
20
    gint code;
28
29
    {SP_ATTR_INVALID, NULL},
29
30
    /* SPObject */
30
31
    {SP_ATTR_ID, "id"},
 
32
    {SP_ATTR_STYLE, "style"},
31
33
    {SP_ATTR_INKSCAPE_COLLECT, "inkscape:collect"},
32
34
    {SP_ATTR_INKSCAPE_LABEL, "inkscape:label"},
 
35
    /* SPRoot */
 
36
    {SP_ATTR_VERSION, "version"},
 
37
    {SP_ATTR_INKSCAPE_VERSION, "inkscape:version"},
 
38
    {SP_ATTR_WIDTH, "width"},
 
39
    {SP_ATTR_HEIGHT, "height"},
 
40
    {SP_ATTR_VIEWBOX, "viewBox"},
 
41
    {SP_ATTR_PRESERVEASPECTRATIO, "preserveAspectRatio"},
 
42
    {SP_ATTR_ONLOAD, "onload"},
 
43
    {SP_ATTR_SODIPODI_DOCNAME, "sodipodi:docname"},
33
44
    /* SPItem */
34
45
    {SP_ATTR_TRANSFORM, "transform"},
 
46
    {SP_ATTR_SODIPODI_TYPE, "sodipodi:type"},
35
47
    {SP_ATTR_SODIPODI_INSENSITIVE, "sodipodi:insensitive"},
36
 
    {SP_ATTR_SODIPODI_NONPRINTABLE, "sodipodi:nonprintable"},
37
48
    {SP_ATTR_CONNECTOR_AVOID, "inkscape:connector-avoid"},
38
49
    {SP_ATTR_CONNECTION_POINTS, "inkscape:connection-points"},
39
 
    {SP_ATTR_STYLE, "style"},
40
50
    {SP_ATTR_TRANSFORM_CENTER_X, "inkscape:transform-center-x"},
41
51
    {SP_ATTR_TRANSFORM_CENTER_Y, "inkscape:transform-center-y"},
42
52
    {SP_ATTR_INKSCAPE_PATH_EFFECT, "inkscape:path-effect"},
53
63
    {SP_ATTR_TARGET, "target"},
54
64
    {SP_ATTR_INKSCAPE_GROUPMODE, "inkscape:groupmode"},
55
65
    {SP_ATTR_INKSCAPE_EXPANDED, "inkscape:expanded"},
56
 
    /* SPRoot */
57
 
    {SP_ATTR_VERSION, "version"},
58
 
    {SP_ATTR_WIDTH, "width"},
59
 
    {SP_ATTR_HEIGHT, "height"},
60
 
    {SP_ATTR_VIEWBOX, "viewBox"},
61
 
    {SP_ATTR_PRESERVEASPECTRATIO, "preserveAspectRatio"},
62
 
    {SP_ATTR_INKSCAPE_VERSION, "inkscape:version"},
63
 
    {SP_ATTR_ONLOAD, "onload"},
64
66
    /* SPNamedView */
65
67
    {SP_ATTR_VIEWONLY, "viewonly"},
66
68
    {SP_ATTR_SHOWGUIDES, "showguides"},
99
101
    {SP_ATTR_INKSCAPE_SNAP_BBOX, "inkscape:snap-bbox"},
100
102
    {SP_ATTR_INKSCAPE_SNAP_NODE, "inkscape:snap-nodes"},
101
103
    {SP_ATTR_INKSCAPE_SNAP_OTHERS, "inkscape:snap-others"},
 
104
    {SP_ATTR_INKSCAPE_SNAP_FROM_GUIDE, "inkscape:snap-from-guide"},
102
105
    {SP_ATTR_INKSCAPE_SNAP_ROTATION_CENTER, "inkscape:snap-center"},
103
106
    {SP_ATTR_INKSCAPE_SNAP_GRID, "inkscape:snap-grids"},
104
107
    {SP_ATTR_INKSCAPE_SNAP_GUIDE, "inkscape:snap-to-guides"},
120
123
    {SP_ATTR_INKSCAPE_DOCUMENT_UNITS, "inkscape:document-units"},  // This setting sets the Display units, *not* the units used in SVG
121
124
    {SP_ATTR_INKSCAPE_LOCKGUIDES, "inkscape:lockguides"},
122
125
    {SP_ATTR_UNITS, "units"},
123
 
    {SP_ATTR_INKSCAPE_CONNECTOR_SPACING, "inkscape:connector-spacing"},
124
126
    /* SPColorProfile */
125
127
    {SP_ATTR_LOCAL, "local"},
126
128
    {SP_ATTR_NAME, "name"},
130
132
    {SP_ATTR_POSITION, "position"},
131
133
    {SP_ATTR_INKSCAPE_COLOR, "inkscape:color"},
132
134
    {SP_ATTR_INKSCAPE_LOCKED, "inkscape:locked"},
 
135
    /* Measure tool */
 
136
    {SP_ATTR_INKSCAPE_MEASURE_START, "inkscape:measure-start"},
 
137
    {SP_ATTR_INKSCAPE_MEASURE_END,   "inkscape:measure-end"},
133
138
    /* SPImage */
134
139
    {SP_ATTR_X, "x"},
135
140
    {SP_ATTR_Y, "y"},
139
144
    /* (Note: XML representation of connectors may change in future.) */
140
145
    {SP_ATTR_CONNECTOR_TYPE, "inkscape:connector-type"},
141
146
    {SP_ATTR_CONNECTOR_CURVATURE, "inkscape:connector-curvature"},
 
147
    {SP_ATTR_INKSCAPE_CONNECTOR_SPACING, "inkscape:connector-spacing"},
142
148
    {SP_ATTR_CONNECTION_START, "inkscape:connection-start"},
143
149
    {SP_ATTR_CONNECTION_END, "inkscape:connection-end"},
144
150
    {SP_ATTR_CONNECTION_START_POINT, "inkscape:connection-start-point"},
414
420
    {SP_ATTR_TEXT_EXCLUDE,"inkscape:excludeShape"},
415
421
    {SP_ATTR_LAYOUT_OPTIONS,"inkscape:layoutOptions"},
416
422
 
417
 
    /* CSS2 */
418
 
    {SP_PROP_INKSCAPE_FONT_SPEC, "-inkscape-font-specification"},
 
423
    /* CSS & SVG Properites */
 
424
 
 
425
    /* Paint */
 
426
    {SP_PROP_COLOR, "color"},
 
427
    {SP_PROP_OPACITY, "opacity"},
 
428
    {SP_PROP_FILL, "fill"},
 
429
    {SP_PROP_FILL_OPACITY, "fill-opacity"},
 
430
    {SP_PROP_FILL_RULE, "fill-rule"},
 
431
    {SP_PROP_STROKE, "stroke"},
 
432
    {SP_PROP_STROKE_OPACITY, "stroke-opacity"},
 
433
    {SP_PROP_STROKE_WIDTH, "stroke-width"},
 
434
    {SP_PROP_STROKE_LINECAP, "stroke-linecap"},
 
435
    {SP_PROP_STROKE_LINEJOIN, "stroke-linejoin"},
 
436
    {SP_PROP_STROKE_MITERLIMIT, "stroke-miterlimit"},
 
437
    {SP_PROP_STROKE_DASHARRAY, "stroke-dasharray"},
 
438
    {SP_PROP_STROKE_DASHOFFSET, "stroke-dashoffset"},
 
439
    {SP_PROP_MARKER, "marker"},
 
440
    {SP_PROP_MARKER_END, "marker-end"},
 
441
    {SP_PROP_MARKER_MID, "marker-mid"},
 
442
    {SP_PROP_MARKER_START, "marker-start"},
 
443
    {SP_PROP_PAINT_ORDER, "paint-order" },
 
444
    {SP_PROP_SOLID_COLOR, "solid-color"},
 
445
    {SP_PROP_SOLID_OPACITY, "solid-opacity"},
 
446
 
 
447
    /* CSS Blending/Compositing */
 
448
    {SP_PROP_MIX_BLEND_MODE, "mix-blend-mode"},
 
449
    {SP_PROP_ISOLATION, "isolation"},
 
450
 
 
451
    /* Misc. Display */
 
452
    {SP_PROP_DISPLAY, "display"},
 
453
    {SP_PROP_OVERFLOW, "overflow"},
 
454
    {SP_PROP_VISIBILITY, "visibility"},
 
455
 
 
456
    /* Clip/Mask */
 
457
    {SP_PROP_CLIP, "clip"},
 
458
    {SP_PROP_CLIP_PATH, "clip-path"},
 
459
    {SP_PROP_CLIP_RULE, "clip-rule"},
 
460
    {SP_PROP_MASK, "mask"},
 
461
 
419
462
    /* Font */
420
463
    {SP_PROP_FONT, "font"},
421
464
    {SP_PROP_FONT_FAMILY, "font-family"},
 
465
    {SP_PROP_INKSCAPE_FONT_SPEC, "-inkscape-font-specification"},
422
466
    {SP_PROP_FONT_SIZE, "font-size"},
423
467
    {SP_PROP_FONT_SIZE_ADJUST, "font-size-adjust"},
424
468
    {SP_PROP_FONT_STRETCH, "font-stretch"},
443
487
    {SP_PROP_WORD_SPACING, "word-spacing"},
444
488
    {SP_PROP_TEXT_TRANSFORM, "text-transform"},
445
489
 
446
 
    /* Text (css3) */
 
490
    /* Text (CSS3) */
447
491
    {SP_PROP_DIRECTION, "direction"},
448
492
    {SP_PROP_WRITING_MODE, "writing-mode"},
449
493
    {SP_PROP_TEXT_ORIENTATION, "text-orientation"},
464
508
    {SP_PROP_SHAPE_MARGIN,  "shape-margin"},
465
509
 
466
510
    /* Text Decoration */
467
 
    {SP_PROP_TEXT_DECORATION,       "text-decoration"},
 
511
    {SP_PROP_TEXT_DECORATION,       "text-decoration"},  // CSS 2/CSS3-Shorthand
468
512
    {SP_PROP_TEXT_DECORATION_LINE,  "text-decoration-line"},
469
513
    {SP_PROP_TEXT_DECORATION_STYLE, "text-decoration-style"},
470
514
    {SP_PROP_TEXT_DECORATION_COLOR, "text-decoration-color"},
471
515
    {SP_PROP_TEXT_DECORATION_FILL,  "text-decoration-fill"},
472
516
    {SP_PROP_TEXT_DECORATION_STROKE,"text-decoration-stroke"},
473
517
 
474
 
    /* Misc */
475
 
    {SP_PROP_CLIP, "clip"},
476
 
    {SP_PROP_COLOR, "color"},
477
 
    {SP_PROP_CURSOR, "cursor"},
478
 
    {SP_PROP_DISPLAY, "display"},
479
 
    {SP_PROP_OVERFLOW, "overflow"},
480
 
    {SP_PROP_VISIBILITY, "visibility"},
481
 
    {SP_PROP_MIX_BLEND_MODE, "mix-blend-mode"}, // CSS Blending and Compositing
482
 
    {SP_PROP_ISOLATION, "isolation"},
483
 
    /* SVG */
484
 
    /* Clip/Mask */
485
 
    {SP_PROP_CLIP_PATH, "clip-path"},
486
 
    {SP_PROP_CLIP_RULE, "clip-rule"},
487
 
    {SP_PROP_MASK, "mask"},
488
 
    {SP_PROP_OPACITY, "opacity"},
489
518
    /* Filter */
490
519
    {SP_PROP_ENABLE_BACKGROUND, "enable-background"},
491
520
    {SP_PROP_FILTER, "filter"},
492
521
    {SP_PROP_FLOOD_COLOR, "flood-color"},
493
522
    {SP_PROP_FLOOD_OPACITY, "flood-opacity"},
494
523
    {SP_PROP_LIGHTING_COLOR, "lighting-color"},
 
524
 
495
525
    /* Gradient */
496
526
    {SP_PROP_STOP_COLOR, "stop-color"},
497
527
    {SP_PROP_STOP_OPACITY, "stop-opacity"},
498
528
    {SP_PROP_STOP_PATH, "path"},
499
 
    /* Interactivity */
500
 
    {SP_PROP_POINTER_EVENTS, "pointer-events"},
501
 
    /* Paint */
 
529
 
 
530
    /* Rendering */
502
531
    {SP_PROP_COLOR_INTERPOLATION, "color-interpolation"},
503
532
    {SP_PROP_COLOR_INTERPOLATION_FILTERS, "color-interpolation-filters"},
504
533
    {SP_PROP_COLOR_PROFILE, "color-profile"},
505
534
    {SP_PROP_COLOR_RENDERING, "color-rendering"},
506
 
    {SP_PROP_FILL, "fill"},
507
 
    {SP_PROP_FILL_OPACITY, "fill-opacity"},
508
 
    {SP_PROP_FILL_RULE, "fill-rule"},
509
535
    {SP_PROP_IMAGE_RENDERING, "image-rendering"},
510
 
    {SP_PROP_MARKER, "marker"},
511
 
    {SP_PROP_MARKER_END, "marker-end"},
512
 
    {SP_PROP_MARKER_MID, "marker-mid"},
513
 
    {SP_PROP_MARKER_START, "marker-start"},
514
 
    {SP_PROP_PAINT_ORDER, "paint-order" },
515
536
    {SP_PROP_SHAPE_RENDERING, "shape-rendering"},
516
 
    {SP_PROP_SOLID_COLOR, "solid-color"},
517
 
    {SP_PROP_SOLID_OPACITY, "solid-opacity"},
518
 
    {SP_PROP_STROKE, "stroke"},
519
 
    {SP_PROP_STROKE_DASHARRAY, "stroke-dasharray"},
520
 
    {SP_PROP_STROKE_DASHOFFSET, "stroke-dashoffset"},
521
 
    {SP_PROP_STROKE_LINECAP, "stroke-linecap"},
522
 
    {SP_PROP_STROKE_LINEJOIN, "stroke-linejoin"},
523
 
    {SP_PROP_STROKE_MITERLIMIT, "stroke-miterlimit"},
524
 
    {SP_PROP_STROKE_OPACITY, "stroke-opacity"},
525
 
    {SP_PROP_STROKE_WIDTH, "stroke-width"},
526
537
    {SP_PROP_TEXT_RENDERING, "text-rendering"},
 
538
 
 
539
    /* Interactivity */
 
540
    {SP_PROP_POINTER_EVENTS, "pointer-events"},
 
541
    {SP_PROP_CURSOR, "cursor"},
 
542
 
527
543
    /* Conditional */
528
544
    {SP_PROP_SYSTEM_LANGUAGE, "systemLanguage"},
529
545
    {SP_PROP_REQUIRED_FEATURES, "requiredFeatures"},
530
546
    {SP_PROP_REQUIRED_EXTENSIONS, "requiredExtensions"},
 
547
 
531
548
    /* LivePathEffect */
532
549
    {SP_PROP_PATH_EFFECT, "effect"},
533
550
};
544
561
        if(g_str_equal(const_cast<void *>(static_cast<void const *>(props[i].name)), key))
545
562
            return GPOINTER_TO_UINT(GINT_TO_POINTER(props[i].code));
546
563
    }
 
564
    // std::cerr << "sp_attribute_lookup: invalid attribute: "
 
565
    //           << (key?key:"Null") << std::endl;
547
566
    return SP_ATTR_INVALID;
548
567
}
549
568