element_clippath.erl 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. -module(element_clippath).
  2. -author('Konstantin Zakablukovsky').
  3. -include("svg.hrl").
  4. -compile(export_all).
  5. render_element(Record) ->
  6. wf_tags:emit_tag(<<"clipPath">>, nitro:render(Record#clipPath.body),
  7. lists:append([
  8. [
  9. {<<"id">>, Record#clipPath.id},
  10. {<<"class">>, Record#clipPath.class},
  11. {<<"style">>, Record#clipPath.style},
  12. {<<"clipPathUnits">>, Record#clipPath.clipPathUnits},
  13. {<<"transform">>, Record#clipPath.transform},
  14. {<<"externalResourcesRequired">>, Record#clipPath.externalResourcesRequired}
  15. ],
  16. svg_conditional_processing(Record),
  17. svg_core(Record),
  18. svg_presentation(Record),
  19. Record#clipPath.data_fields,
  20. Record#clipPath.aria_states
  21. ])).
  22. %% Common SVG attributes
  23. svg_conditional_processing(Record)-> [
  24. {<<"requiredExtensions">>, Record#clipPath.requiredExtensions},
  25. {<<"requiredFeatures">>, Record#clipPath.requiredFeatures},
  26. {<<"systemLanguage">>, Record#clipPath.systemLanguage}
  27. ].
  28. svg_core(Record)-> [
  29. {<<"xml:base">>, Record#clipPath.xmlbase},
  30. {<<"xml:lang">>, Record#clipPath.xmllang},
  31. {<<"xml:space">>, Record#clipPath.xmlspace}
  32. ].
  33. svg_presentation(Record)-> [
  34. {<<"alignment-baseline">>, Record#clipPath.alignment_baseline},
  35. {<<"baseline-shift">>, Record#clipPath.baseline_shift},
  36. {<<"clip">>, Record#clipPath.clip},
  37. {<<"clip-path">>, Record#clipPath.clip_path},
  38. {<<"clip-rule">>, Record#clipPath.clip_rule},
  39. {<<"color">>, Record#clipPath.color},
  40. {<<"color-interpolation">>, Record#clipPath.color_interpolation},
  41. {<<"color-interpolation-filters">>, Record#clipPath.color_interpolation_filters},
  42. {<<"color-profile">>, Record#clipPath.color_profile},
  43. {<<"color-rendering">>, Record#clipPath.color_rendering},
  44. {<<"cursor">>, Record#clipPath.cursor},
  45. {<<"direction">>, Record#clipPath.direction},
  46. {<<"display">>, Record#clipPath.display},
  47. {<<"dominant-baseline">>, Record#clipPath.dominant_baseline},
  48. {<<"enable-background">>, Record#clipPath.enable_background},
  49. {<<"fill">>, Record#clipPath.fill},
  50. {<<"fill-opacity">>, Record#clipPath.fill_opacity},
  51. {<<"fill-rule">>, Record#clipPath.fill_rule},
  52. {<<"filter">>, Record#clipPath.filter},
  53. {<<"flood-color">>, Record#clipPath.flood_color},
  54. {<<"flood-opacity">>, Record#clipPath.flood_opacity},
  55. {<<"font-family">>, Record#clipPath.font_family},
  56. {<<"font-size">>, Record#clipPath.font_size},
  57. {<<"font-size-adjust">>, Record#clipPath.font_size_adjust},
  58. {<<"font-stretch">>, Record#clipPath.font_stretch},
  59. {<<"font-style">>, Record#clipPath.font_style},
  60. {<<"font-variant">>, Record#clipPath.font_variant},
  61. {<<"font-weight">>, Record#clipPath.font_weight},
  62. {<<"glyph-orientation-horizontal">>, Record#clipPath.glyph_orientation_horizontal},
  63. {<<"glyph-orientation-vertical">>, Record#clipPath.glyph_orientation_vertical},
  64. {<<"image-rendering">>, Record#clipPath.image_rendering},
  65. {<<"kerning">>, Record#clipPath.kerning},
  66. {<<"letter-spacing">>, Record#clipPath.letter_spacing},
  67. {<<"lighting-color">>, Record#clipPath.lighting_color},
  68. {<<"marker-end">>, Record#clipPath.marker_end},
  69. {<<"marker-mid">>, Record#clipPath.marker_mid},
  70. {<<"marker-start">>, Record#clipPath.marker_start},
  71. {<<"mask">>, Record#clipPath.mask},
  72. {<<"opacity">>, Record#clipPath.opacity},
  73. {<<"overflow">>, Record#clipPath.overflow},
  74. {<<"pointer-events">>, Record#clipPath.pointer_events},
  75. {<<"shape-rendering">>, Record#clipPath.shape_rendering},
  76. {<<"stop-color">>, Record#clipPath.stop_color},
  77. {<<"stop-opacity">>, Record#clipPath.stop_opacity},
  78. {<<"stroke">>, Record#clipPath.stroke},
  79. {<<"stroke-dasharray">>, Record#clipPath.stroke_dasharray},
  80. {<<"stroke-dashoffset">>, Record#clipPath.stroke_dashoffset},
  81. {<<"stroke-linecap">>, Record#clipPath.stroke_linecap},
  82. {<<"stroke-linejoin">>, Record#clipPath.stroke_linejoin},
  83. {<<"stroke-miterlimit">>, Record#clipPath.stroke_miterlimit},
  84. {<<"stroke-opacity">>, Record#clipPath.stroke_opacity},
  85. {<<"stroke-width">>, Record#clipPath.stroke_width},
  86. {<<"text-anchor">>, Record#clipPath.text_anchor},
  87. {<<"text-decoration">>, Record#clipPath.text_decoration},
  88. {<<"text-rendering">>, Record#clipPath.text_rendering},
  89. {<<"unicode-bidi">>, Record#clipPath.unicode_bidi},
  90. {<<"visibility">>, Record#clipPath.visibility},
  91. {<<"word-spacing">>, Record#clipPath.word_spacing},
  92. {<<"writing-mode">>, Record#clipPath.writing_mode}
  93. ].