element_fediffuselighting.erl 4.9 KB

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