element_altglyph.erl 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. -module(element_altglyph).
  2. -author('Konstantin Zakablukovsky').
  3. -include("nitro.hrl").
  4. -compile(export_all).
  5. render_element(Record) ->
  6. wf_tags:emit_tag(<<"altGlyph">>, nitro:render(Record#altGlyph.body),
  7. lists:append([
  8. [
  9. {<<"id">>, Record#altGlyph.id},
  10. {<<"class">>, Record#altGlyph.class},
  11. {<<"style">>, Record#altGlyph.style},
  12. {<<"x">>, Record#altGlyph.x},
  13. {<<"y">>, Record#altGlyph.y},
  14. {<<"dx">>, Record#altGlyph.dx},
  15. {<<"dy">>, Record#altGlyph.dy},
  16. {<<"rotate">>, Record#altGlyph.rotate},
  17. {<<"glyphRef">>, Record#altGlyph.glyphRef},
  18. {<<"format">>, Record#altGlyph.format},
  19. {<<"externalResourcesRequired">>, Record#altGlyph.externalResourcesRequired}
  20. ],
  21. svg_conditional_processing(Record),
  22. svg_core(Record),
  23. svg_graphical_event(Record),
  24. svg_presentation(Record),
  25. svg_xlink(Record),
  26. Record#altGlyph.data_fields,
  27. Record#altGlyph.aria_states
  28. ])).
  29. %% Common SVG attributes
  30. svg_conditional_processing(Record)-> [
  31. {<<"requiredExtensions">>, Record#altGlyph.requiredExtensions},
  32. {<<"requiredFeatures">>, Record#altGlyph.requiredFeatures},
  33. {<<"systemLanguage">>, Record#altGlyph.systemLanguage}
  34. ].
  35. svg_core(Record)-> [
  36. {<<"xml:base">>, Record#altGlyph.xmlbase},
  37. {<<"xml:lang">>, Record#altGlyph.xmllang},
  38. {<<"xml:space">>, Record#altGlyph.xmlspace}
  39. ].
  40. svg_graphical_event(Record)-> [
  41. {<<"onactivate">>, Record#altGlyph.onactivate},
  42. {<<"onclick">>, Record#altGlyph.onclick},
  43. {<<"onfocusin">>, Record#altGlyph.onfocusin},
  44. {<<"onfocusout">>, Record#altGlyph.onfocusout},
  45. {<<"onload">>, Record#altGlyph.onload_graphical},
  46. {<<"onmousedown">>, Record#altGlyph.onmousedown},
  47. {<<"onmousemove">>, Record#altGlyph.onmousemove},
  48. {<<"onmouseout">>, Record#altGlyph.onmouseout},
  49. {<<"onmouseover">>, Record#altGlyph.onmouseover},
  50. {<<"onmouseup">>, Record#altGlyph.onmouseup}
  51. ].
  52. svg_presentation(Record)-> [
  53. {<<"alignment-baseline">>, Record#altGlyph.alignment_baseline},
  54. {<<"baseline-shift">>, Record#altGlyph.baseline_shift},
  55. {<<"clip">>, Record#altGlyph.clip},
  56. {<<"clip-path">>, Record#altGlyph.clip_path},
  57. {<<"clip-rule">>, Record#altGlyph.clip_rule},
  58. {<<"color">>, Record#altGlyph.color},
  59. {<<"color-interpolation">>, Record#altGlyph.color_interpolation},
  60. {<<"color-interpolation-filters">>, Record#altGlyph.color_interpolation_filters},
  61. {<<"color-profile">>, Record#altGlyph.color_profile},
  62. {<<"color-rendering">>, Record#altGlyph.color_rendering},
  63. {<<"cursor">>, Record#altGlyph.cursor},
  64. {<<"direction">>, Record#altGlyph.direction},
  65. {<<"display">>, Record#altGlyph.display},
  66. {<<"dominant-baseline">>, Record#altGlyph.dominant_baseline},
  67. {<<"enable-background">>, Record#altGlyph.enable_background},
  68. {<<"fill">>, Record#altGlyph.fill},
  69. {<<"fill-opacity">>, Record#altGlyph.fill_opacity},
  70. {<<"fill-rule">>, Record#altGlyph.fill_rule},
  71. {<<"filter">>, Record#altGlyph.filter},
  72. {<<"flood-color">>, Record#altGlyph.flood_color},
  73. {<<"flood-opacity">>, Record#altGlyph.flood_opacity},
  74. {<<"font-family">>, Record#altGlyph.font_family},
  75. {<<"font-size">>, Record#altGlyph.font_size},
  76. {<<"font-size-adjust">>, Record#altGlyph.font_size_adjust},
  77. {<<"font-stretch">>, Record#altGlyph.font_stretch},
  78. {<<"font-style">>, Record#altGlyph.font_style},
  79. {<<"font-variant">>, Record#altGlyph.font_variant},
  80. {<<"font-weight">>, Record#altGlyph.font_weight},
  81. {<<"glyph-orientation-horizontal">>, Record#altGlyph.glyph_orientation_horizontal},
  82. {<<"glyph-orientation-vertical">>, Record#altGlyph.glyph_orientation_vertical},
  83. {<<"image-rendering">>, Record#altGlyph.image_rendering},
  84. {<<"kerning">>, Record#altGlyph.kerning},
  85. {<<"letter-spacing">>, Record#altGlyph.letter_spacing},
  86. {<<"lighting-color">>, Record#altGlyph.lighting_color},
  87. {<<"marker-end">>, Record#altGlyph.marker_end},
  88. {<<"marker-mid">>, Record#altGlyph.marker_mid},
  89. {<<"marker-start">>, Record#altGlyph.marker_start},
  90. {<<"mask">>, Record#altGlyph.mask},
  91. {<<"opacity">>, Record#altGlyph.opacity},
  92. {<<"overflow">>, Record#altGlyph.overflow},
  93. {<<"pointer-events">>, Record#altGlyph.pointer_events},
  94. {<<"shape-rendering">>, Record#altGlyph.shape_rendering},
  95. {<<"stop-color">>, Record#altGlyph.stop_color},
  96. {<<"stop-opacity">>, Record#altGlyph.stop_opacity},
  97. {<<"stroke">>, Record#altGlyph.stroke},
  98. {<<"stroke-dasharray">>, Record#altGlyph.stroke_dasharray},
  99. {<<"stroke-dashoffset">>, Record#altGlyph.stroke_dashoffset},
  100. {<<"stroke-linecap">>, Record#altGlyph.stroke_linecap},
  101. {<<"stroke-linejoin">>, Record#altGlyph.stroke_linejoin},
  102. {<<"stroke-miterlimit">>, Record#altGlyph.stroke_miterlimit},
  103. {<<"stroke-opacity">>, Record#altGlyph.stroke_opacity},
  104. {<<"stroke-width">>, Record#altGlyph.stroke_width},
  105. {<<"text-anchor">>, Record#altGlyph.text_anchor},
  106. {<<"text-decoration">>, Record#altGlyph.text_decoration},
  107. {<<"text-rendering">>, Record#altGlyph.text_rendering},
  108. {<<"unicode-bidi">>, Record#altGlyph.unicode_bidi},
  109. {<<"visibility">>, Record#altGlyph.visibility},
  110. {<<"word-spacing">>, Record#altGlyph.word_spacing},
  111. {<<"writing-mode">>, Record#altGlyph.writing_mode}
  112. ].
  113. svg_xlink(Record)-> [
  114. {<<"xlink:href">>, Record#altGlyph.xlinkhref},
  115. {<<"xlink:type">>, Record#altGlyph.xlinktype},
  116. {<<"xlink:role">>, Record#altGlyph.xlinkrole},
  117. {<<"xlink:arcrole">>, Record#altGlyph.xlinkarcrole},
  118. {<<"xlink:title">>, Record#altGlyph.xlinktitle},
  119. {<<"xlink:show">>, Record#altGlyph.xlinkshow},
  120. {<<"xlink:actuate">>, Record#altGlyph.xlinkactuate}
  121. ].