Konstantin Zakablukovsky 9 years ago
parent
commit
2ec802e655

+ 13 - 3
include/nitro.hrl

@@ -194,23 +194,33 @@
 -record(u,       		?DEFAULT_BASE).
 -record(var,       		?DEFAULT_BASE).
 
+% Extras
+-record(upload,         {?CTRL_BASE(element_upload), name, value}).
+
 % HTML5 template
 -record(template,		?DEFAULT_BASE).
 
 % SVG
 -record(svg, {?ELEMENT_BASE(element_svg), version="1.1", baseProfile="full", xmlns="http://www.w3.org/2000/svg", xmlnsxlink="http://www.w3.org/1999/xlink", xmlnsev="http://www.w3.org/2001/xml-events", preserveAspectRatio, contentScriptType, contentStyleType, viewBox, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_DOCUMENT_EVENT, ?SVG_FILTER_PRIMITIVE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION, ?SVG_TRANSFERT_FUNCTION, ?SVG_XLINK}).
+-record(altGlyph, {?ELEMENT_BASE(element_altglyph), x, y, dx, dy, rotate, glyphRef, format, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION, ?SVG_XLINK}).
+-record(altGlyphDef, {?ELEMENT_BASE(element_altglyphdef), ?SVG_CORE}).
+-record(altGlyphItem, {?ELEMENT_BASE(element_altglyphitem), ?SVG_CORE}).
 -record(animate, {?ELEMENT_BASE(element_animate), externalResourcesRequired, ?SVG_ANIMATION_EVENT, ?SVG_ANIMATION_ATTRIBUT_TARGET, ?SVG_ANIMATION_TIMING, ?SVG_ANIMATION_VALUE, ?SVG_ANIMATION_ADDITION, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_XLINK}).
 -record(animateMotion, {?ELEMENT_BASE(element_animatemotion), path, keyPoints, rotate, origin, externalResourcesRequired, ?SVG_ANIMATION_EVENT, ?SVG_ANIMATION_TIMING, ?SVG_ANIMATION_VALUE, ?SVG_ANIMATION_ADDITION,  ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_XLINK}).
 -record(animateTransform, {?ELEMENT_BASE(element_animatetransform), type, externalResourcesRequired, ?SVG_ANIMATION_EVENT, ?SVG_ANIMATION_ATTRIBUT_TARGET, ?SVG_ANIMATION_TIMING, ?SVG_ANIMATION_VALUE, ?SVG_ANIMATION_ADDITION, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_XLINK}).
 -record(circle, {?ELEMENT_BASE(element_circle), cx, cy, r, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
+-record(clipPath, {?ELEMENT_BASE(element_clippath), clipPathUnits, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_PRESENTATION}).
+-record(color_profile, {?ELEMENT_BASE(element_colorprofile), local, name, rendering_intent, ?SVG_CORE, ?SVG_XLINK}).
+-record(cursor, {?ELEMENT_BASE(element_cursor), x, y, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_XLINK}).
+-record(defs, {?ELEMENT_BASE(element_defs), transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
+-record(desc, {?ELEMENT_BASE(element_desc), ?SVG_CORE}).
+-record(ellipse, {?ELEMENT_BASE(element_ellipse), cx, cy, rx, ry, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
 -record(g, {?ELEMENT_BASE(element_g), transform, externalResourcesRequired,  ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
 -record(path, {?ELEMENT_BASE(element_path), d, pathLength, transform, externalResourcesRequired,  ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
 -record(rect, {?ELEMENT_BASE(element_rect), x, y, width, height, rx, ry, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
 -record(text, {?ELEMENT_BASE(element_text), x, y, dx, dy, rotate, textLength, lengthAdjust, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
 -record(tspan, {?ELEMENT_BASE(element_tspan), x, y, dx, dy, rotate, textLength, lengthAdjust, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION}).
-
-% Extras
--record(upload,         {?CTRL_BASE(element_upload), name, value}).
+-record(xlink, {?ELEMENT_BASE(element_xlink), target, transform, externalResourcesRequired, ?SVG_CONDITIONAL_PROCESSING, ?SVG_CORE, ?SVG_FILTER_PRIMITIVE, ?SVG_GRAPHICAL_EVENT, ?SVG_PRESENTATION, ?SVG_TRANSFERT_FUNCTION, ?SVG_XLINK}).
 
 % Actions
 -record(action,  {?ACTION_BASE(undefined)}).

+ 128 - 0
src/elements/element_altglyph.erl

@@ -0,0 +1,128 @@
+-module(element_altglyph).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"altGlyph">>, nitro:render(Record#altGlyph.body),
+	lists:append([
+		[
+			{<<"id">>, Record#altGlyph.id},
+			{<<"class">>, Record#altGlyph.class},
+			{<<"style">>, Record#altGlyph.style},
+			{<<"x">>, Record#altGlyph.x},
+			{<<"y">>, Record#altGlyph.y},
+			{<<"dx">>, Record#altGlyph.dx},
+			{<<"dy">>, Record#altGlyph.dy},
+			{<<"rotate">>, Record#altGlyph.rotate},
+			{<<"glyphRef">>, Record#altGlyph.glyphRef},
+			{<<"format">>, Record#altGlyph.format},
+			{<<"externalResourcesRequired">>, Record#altGlyph.externalResourcesRequired}
+		],
+		svg_conditional_processing(Record),
+		svg_core(Record),
+		svg_graphical_event(Record),
+		svg_presentation(Record),
+		svg_xlink(Record),
+		Record#altGlyph.data_fields,
+		Record#altGlyph.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_conditional_processing(Record)-> [
+	{<<"requiredExtensions">>, Record#altGlyph.requiredExtensions},
+	{<<"requiredFeatures">>, Record#altGlyph.requiredFeatures},
+	{<<"systemLanguage">>, Record#altGlyph.systemLanguage}
+].
+
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#altGlyph.xmlbase},
+	{<<"xml:lang">>, Record#altGlyph.xmllang},
+	{<<"xml:space">>, Record#altGlyph.xmlspace}
+].
+
+svg_graphical_event(Record)-> [
+	{<<"onactivate">>, Record#altGlyph.onactivate},
+	{<<"onclick">>, Record#altGlyph.onclick},
+	{<<"onfocusin">>, Record#altGlyph.onfocusin},
+	{<<"onfocusout">>, Record#altGlyph.onfocusout},
+	{<<"onload">>, Record#altGlyph.onload_graphical},
+	{<<"onmousedown">>, Record#altGlyph.onmousedown},
+	{<<"onmousemove">>, Record#altGlyph.onmousemove},
+	{<<"onmouseout">>, Record#altGlyph.onmouseout},
+	{<<"onmouseover">>, Record#altGlyph.onmouseover},
+	{<<"onmouseup">>, Record#altGlyph.onmouseup}
+].
+
+svg_presentation(Record)-> [
+	{<<"alignment-baseline">>, Record#altGlyph.alignment_baseline},
+	{<<"baseline-shift">>, Record#altGlyph.baseline_shift},
+	{<<"clip">>, Record#altGlyph.clip},
+	{<<"clip-path">>, Record#altGlyph.clip_path},
+	{<<"clip-rule">>, Record#altGlyph.clip_rule},
+	{<<"color">>, Record#altGlyph.color},
+	{<<"color-interpolation">>, Record#altGlyph.color_interpolation},
+	{<<"color-interpolation-filters">>, Record#altGlyph.color_interpolation_filters},
+	{<<"color-profile">>, Record#altGlyph.color_profile},
+	{<<"color-rendering">>, Record#altGlyph.color_rendering},
+	{<<"cursor">>, Record#altGlyph.cursor},
+	{<<"direction">>, Record#altGlyph.direction},
+	{<<"display">>, Record#altGlyph.display},
+	{<<"dominant-baseline">>, Record#altGlyph.dominant_baseline},
+	{<<"enable-background">>, Record#altGlyph.enable_background},
+	{<<"fill">>, Record#altGlyph.fill},
+	{<<"fill-opacity">>, Record#altGlyph.fill_opacity},
+	{<<"fill-rule">>, Record#altGlyph.fill_rule},
+	{<<"filter">>, Record#altGlyph.filter},
+	{<<"flood-color">>, Record#altGlyph.flood_color},
+	{<<"flood-opacity">>, Record#altGlyph.flood_opacity},
+	{<<"font-family">>, Record#altGlyph.font_family},
+	{<<"font-size">>, Record#altGlyph.font_size},
+	{<<"font-size-adjust">>, Record#altGlyph.font_size_adjust},
+	{<<"font-stretch">>, Record#altGlyph.font_stretch},
+	{<<"font-style">>, Record#altGlyph.font_style},
+	{<<"font-variant">>, Record#altGlyph.font_variant},
+	{<<"font-weight">>, Record#altGlyph.font_weight},
+	{<<"glyph-orientation-horizontal">>, Record#altGlyph.glyph_orientation_horizontal},
+	{<<"glyph-orientation-vertical">>, Record#altGlyph.glyph_orientation_vertical},
+	{<<"image-rendering">>, Record#altGlyph.image_rendering},
+	{<<"kerning">>, Record#altGlyph.kerning},
+	{<<"letter-spacing">>, Record#altGlyph.letter_spacing},
+	{<<"lighting-color">>, Record#altGlyph.lighting_color},
+	{<<"marker-end">>, Record#altGlyph.marker_end},
+	{<<"marker-mid">>, Record#altGlyph.marker_mid},
+	{<<"marker-start">>, Record#altGlyph.marker_start},
+	{<<"mask">>, Record#altGlyph.mask},
+	{<<"opacity">>, Record#altGlyph.opacity},
+	{<<"overflow">>, Record#altGlyph.overflow},
+	{<<"pointer-events">>, Record#altGlyph.pointer_events},
+	{<<"shape-rendering">>, Record#altGlyph.shape_rendering},
+	{<<"stop-color">>, Record#altGlyph.stop_color},
+	{<<"stop-opacity">>, Record#altGlyph.stop_opacity},
+	{<<"stroke">>, Record#altGlyph.stroke},
+	{<<"stroke-dasharray">>, Record#altGlyph.stroke_dasharray},
+	{<<"stroke-dashoffset">>, Record#altGlyph.stroke_dashoffset},
+	{<<"stroke-linecap">>, Record#altGlyph.stroke_linecap},
+	{<<"stroke-linejoin">>, Record#altGlyph.stroke_linejoin},
+	{<<"stroke-miterlimit">>, Record#altGlyph.stroke_miterlimit},
+	{<<"stroke-opacity">>, Record#altGlyph.stroke_opacity},
+	{<<"stroke-width">>, Record#altGlyph.stroke_width},
+	{<<"text-anchor">>, Record#altGlyph.text_anchor},
+	{<<"text-decoration">>, Record#altGlyph.text_decoration},
+	{<<"text-rendering">>, Record#altGlyph.text_rendering},
+	{<<"unicode-bidi">>, Record#altGlyph.unicode_bidi},
+	{<<"visibility">>, Record#altGlyph.visibility},
+	{<<"word-spacing">>, Record#altGlyph.word_spacing},
+	{<<"writing-mode">>, Record#altGlyph.writing_mode}
+].
+
+svg_xlink(Record)-> [
+	{<<"xlink:href">>, Record#altGlyph.xlinkhref},
+	{<<"xlink:type">>, Record#altGlyph.xlinktype},
+	{<<"xlink:role">>, Record#altGlyph.xlinkrole},
+	{<<"xlink:arcrole">>, Record#altGlyph.xlinkarcrole},
+	{<<"xlink:title">>, Record#altGlyph.xlinktitle},
+	{<<"xlink:show">>, Record#altGlyph.xlinkshow},
+	{<<"xlink:actuate">>, Record#altGlyph.xlinkactuate}
+].

+ 18 - 0
src/elements/element_altglyphdef.erl

@@ -0,0 +1,18 @@
+-module(element_altglyphdef).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"altGlyphDef">>, nitro:render(Record#altGlyphDef.body),
+	lists:append([
+		[
+			{<<"id">>, Record#altGlyphDef.id},
+			{<<"class">>, Record#altGlyphDef.class},
+			{<<"xml:base">>, Record#altGlyphDef.xmlbase},
+			{<<"xml:lang">>, Record#altGlyphDef.xmllang},
+			{<<"xml:space">>, Record#altGlyphDef.xmlspace}
+		],
+		Record#altGlyphDef.data_fields,
+		Record#altGlyphDef.aria_states
+	])).

+ 18 - 0
src/elements/element_altglyphitem.erl

@@ -0,0 +1,18 @@
+-module(element_altglyphitem).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"altGlyphItem">>, nitro:render(Record#altGlyphItem.body),
+	lists:append([
+		[
+			{<<"id">>, Record#altGlyphItem.id},
+			{<<"class">>, Record#altGlyphItem.class},
+			{<<"xml:base">>, Record#altGlyphItem.xmlbase},
+			{<<"xml:lang">>, Record#altGlyphItem.xmllang},
+			{<<"xml:space">>, Record#altGlyphItem.xmlspace}
+		],
+		Record#altGlyphItem.data_fields,
+		Record#altGlyphItem.aria_states
+	])).

+ 98 - 0
src/elements/element_clippath.erl

@@ -0,0 +1,98 @@
+-module(element_clippath).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"clipPath">>, nitro:render(Record#clipPath.body),
+	lists:append([
+		[
+			{<<"id">>, Record#clipPath.id},
+			{<<"class">>, Record#clipPath.class},
+			{<<"style">>, Record#clipPath.style},
+			{<<"clipPathUnits">>, Record#clipPath.clipPathUnits},
+			{<<"transform">>, Record#clipPath.transform},
+			{<<"externalResourcesRequired">>, Record#clipPath.externalResourcesRequired}
+		],
+		svg_conditional_processing(Record),
+		svg_core(Record),
+		svg_presentation(Record),
+		Record#clipPath.data_fields,
+		Record#clipPath.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_conditional_processing(Record)-> [
+	{<<"requiredExtensions">>, Record#clipPath.requiredExtensions},
+	{<<"requiredFeatures">>, Record#clipPath.requiredFeatures},
+	{<<"systemLanguage">>, Record#clipPath.systemLanguage}
+].
+
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#clipPath.xmlbase},
+	{<<"xml:lang">>, Record#clipPath.xmllang},
+	{<<"xml:space">>, Record#clipPath.xmlspace}
+].
+
+svg_presentation(Record)-> [
+	{<<"alignment-baseline">>, Record#clipPath.alignment_baseline},
+	{<<"baseline-shift">>, Record#clipPath.baseline_shift},
+	{<<"clip">>, Record#clipPath.clip},
+	{<<"clip-path">>, Record#clipPath.clip_path},
+	{<<"clip-rule">>, Record#clipPath.clip_rule},
+	{<<"color">>, Record#clipPath.color},
+	{<<"color-interpolation">>, Record#clipPath.color_interpolation},
+	{<<"color-interpolation-filters">>, Record#clipPath.color_interpolation_filters},
+	{<<"color-profile">>, Record#clipPath.color_profile},
+	{<<"color-rendering">>, Record#clipPath.color_rendering},
+	{<<"cursor">>, Record#clipPath.cursor},
+	{<<"direction">>, Record#clipPath.direction},
+	{<<"display">>, Record#clipPath.display},
+	{<<"dominant-baseline">>, Record#clipPath.dominant_baseline},
+	{<<"enable-background">>, Record#clipPath.enable_background},
+	{<<"fill">>, Record#clipPath.fill},
+	{<<"fill-opacity">>, Record#clipPath.fill_opacity},
+	{<<"fill-rule">>, Record#clipPath.fill_rule},
+	{<<"filter">>, Record#clipPath.filter},
+	{<<"flood-color">>, Record#clipPath.flood_color},
+	{<<"flood-opacity">>, Record#clipPath.flood_opacity},
+	{<<"font-family">>, Record#clipPath.font_family},
+	{<<"font-size">>, Record#clipPath.font_size},
+	{<<"font-size-adjust">>, Record#clipPath.font_size_adjust},
+	{<<"font-stretch">>, Record#clipPath.font_stretch},
+	{<<"font-style">>, Record#clipPath.font_style},
+	{<<"font-variant">>, Record#clipPath.font_variant},
+	{<<"font-weight">>, Record#clipPath.font_weight},
+	{<<"glyph-orientation-horizontal">>, Record#clipPath.glyph_orientation_horizontal},
+	{<<"glyph-orientation-vertical">>, Record#clipPath.glyph_orientation_vertical},
+	{<<"image-rendering">>, Record#clipPath.image_rendering},
+	{<<"kerning">>, Record#clipPath.kerning},
+	{<<"letter-spacing">>, Record#clipPath.letter_spacing},
+	{<<"lighting-color">>, Record#clipPath.lighting_color},
+	{<<"marker-end">>, Record#clipPath.marker_end},
+	{<<"marker-mid">>, Record#clipPath.marker_mid},
+	{<<"marker-start">>, Record#clipPath.marker_start},
+	{<<"mask">>, Record#clipPath.mask},
+	{<<"opacity">>, Record#clipPath.opacity},
+	{<<"overflow">>, Record#clipPath.overflow},
+	{<<"pointer-events">>, Record#clipPath.pointer_events},
+	{<<"shape-rendering">>, Record#clipPath.shape_rendering},
+	{<<"stop-color">>, Record#clipPath.stop_color},
+	{<<"stop-opacity">>, Record#clipPath.stop_opacity},
+	{<<"stroke">>, Record#clipPath.stroke},
+	{<<"stroke-dasharray">>, Record#clipPath.stroke_dasharray},
+	{<<"stroke-dashoffset">>, Record#clipPath.stroke_dashoffset},
+	{<<"stroke-linecap">>, Record#clipPath.stroke_linecap},
+	{<<"stroke-linejoin">>, Record#clipPath.stroke_linejoin},
+	{<<"stroke-miterlimit">>, Record#clipPath.stroke_miterlimit},
+	{<<"stroke-opacity">>, Record#clipPath.stroke_opacity},
+	{<<"stroke-width">>, Record#clipPath.stroke_width},
+	{<<"text-anchor">>, Record#clipPath.text_anchor},
+	{<<"text-decoration">>, Record#clipPath.text_decoration},
+	{<<"text-rendering">>, Record#clipPath.text_rendering},
+	{<<"unicode-bidi">>, Record#clipPath.unicode_bidi},
+	{<<"visibility">>, Record#clipPath.visibility},
+	{<<"word-spacing">>, Record#clipPath.word_spacing},
+	{<<"writing-mode">>, Record#clipPath.writing_mode}
+].

+ 39 - 0
src/elements/element_colorprofile.erl

@@ -0,0 +1,39 @@
+-module(element_colorprofile).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"color-profile">>, nitro:render(Record#color_profile.body),
+	lists:append([
+		[
+			{<<"id">>, Record#color_profile.id},
+			{<<"class">>, Record#color_profile.class},
+			{<<"style">>, Record#color_profile.style},
+			{<<"local">>, Record#color_profile.local},
+			{<<"name">>, Record#color_profile.name},
+			{<<"rendering-intent">>, Record#color_profile.rendering_intent}
+		],
+		svg_core(Record),
+		svg_xlink(Record),
+		Record#color_profile.data_fields,
+		Record#color_profile.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#color_profile.xmlbase},
+	{<<"xml:lang">>, Record#color_profile.xmllang},
+	{<<"xml:space">>, Record#color_profile.xmlspace}
+].
+
+svg_xlink(Record)-> [
+	{<<"xlink:href">>, Record#color_profile.xlinkhref},
+	{<<"xlink:type">>, Record#color_profile.xlinktype},
+	{<<"xlink:role">>, Record#color_profile.xlinkrole},
+	{<<"xlink:arcrole">>, Record#color_profile.xlinkarcrole},
+	{<<"xlink:title">>, Record#color_profile.xlinktitle},
+	{<<"xlink:show">>, Record#color_profile.xlinkshow},
+	{<<"xlink:actuate">>, Record#color_profile.xlinkactuate}
+].

+ 46 - 0
src/elements/element_cursor.erl

@@ -0,0 +1,46 @@
+-module(element_cursor).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"cursor">>, nitro:render(Record#cursor.body),
+	lists:append([
+		[
+			{<<"id">>, Record#cursor.id},
+			{<<"class">>, Record#cursor.class},
+			{<<"style">>, Record#cursor.style},
+			{<<"x">>, Record#cursor.x},
+			{<<"y">>, Record#cursor.y},
+			{<<"externalResourcesRequired">>, Record#cursor.externalResourcesRequired}
+		],
+		svg_conditional_processing(Record),
+		svg_core(Record),
+		svg_xlink(Record),
+		Record#cursor.data_fields,
+		Record#cursor.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_conditional_processing(Record)-> [
+	{<<"requiredExtensions">>, Record#cursor.requiredExtensions},
+	{<<"requiredFeatures">>, Record#cursor.requiredFeatures},
+	{<<"systemLanguage">>, Record#cursor.systemLanguage}
+].
+
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#cursor.xmlbase},
+	{<<"xml:lang">>, Record#cursor.xmllang},
+	{<<"xml:space">>, Record#cursor.xmlspace}
+].
+
+svg_xlink(Record)-> [
+	{<<"xlink:href">>, Record#cursor.xlinkhref},
+	{<<"xlink:type">>, Record#cursor.xlinktype},
+	{<<"xlink:role">>, Record#cursor.xlinkrole},
+	{<<"xlink:arcrole">>, Record#cursor.xlinkarcrole},
+	{<<"xlink:title">>, Record#cursor.xlinktitle},
+	{<<"xlink:show">>, Record#cursor.xlinkshow},
+	{<<"xlink:actuate">>, Record#cursor.xlinkactuate}
+].

+ 111 - 0
src/elements/element_defs.erl

@@ -0,0 +1,111 @@
+-module(element_defs).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"defs">>, nitro:render(Record#defs.body),
+	lists:append([
+		[
+			{<<"id">>, Record#defs.id},
+			{<<"class">>, Record#defs.class},
+			{<<"style">>, Record#defs.style},
+			{<<"transform">>, Record#defs.transform},
+			{<<"externalResourcesRequired">>, Record#defs.externalResourcesRequired}
+		],
+		svg_conditional_processing(Record),
+		svg_core(Record),
+		svg_graphical_event(Record),
+		svg_presentation(Record),
+		Record#defs.data_fields,
+		Record#defs.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_conditional_processing(Record)-> [
+	{<<"requiredExtensions">>, Record#defs.requiredExtensions},
+	{<<"requiredFeatures">>, Record#defs.requiredFeatures},
+	{<<"systemLanguage">>, Record#defs.systemLanguage}
+].
+
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#defs.xmlbase},
+	{<<"xml:lang">>, Record#defs.xmllang},
+	{<<"xml:space">>, Record#defs.xmlspace}
+].
+
+svg_graphical_event(Record)-> [
+	{<<"onactivate">>, Record#defs.onactivate},
+	{<<"onclick">>, Record#defs.onclick},
+	{<<"onfocusin">>, Record#defs.onfocusin},
+	{<<"onfocusout">>, Record#defs.onfocusout},
+	{<<"onload">>, Record#defs.onload_graphical},
+	{<<"onmousedown">>, Record#defs.onmousedown},
+	{<<"onmousemove">>, Record#defs.onmousemove},
+	{<<"onmouseout">>, Record#defs.onmouseout},
+	{<<"onmouseover">>, Record#defs.onmouseover},
+	{<<"onmouseup">>, Record#defs.onmouseup}
+].
+
+svg_presentation(Record)-> [
+	{<<"alignment-baseline">>, Record#defs.alignment_baseline},
+	{<<"baseline-shift">>, Record#defs.baseline_shift},
+	{<<"clip">>, Record#defs.clip},
+	{<<"clip-path">>, Record#defs.clip_path},
+	{<<"clip-rule">>, Record#defs.clip_rule},
+	{<<"color">>, Record#defs.color},
+	{<<"color-interpolation">>, Record#defs.color_interpolation},
+	{<<"color-interpolation-filters">>, Record#defs.color_interpolation_filters},
+	{<<"color-profile">>, Record#defs.color_profile},
+	{<<"color-rendering">>, Record#defs.color_rendering},
+	{<<"cursor">>, Record#defs.cursor},
+	{<<"direction">>, Record#defs.direction},
+	{<<"display">>, Record#defs.display},
+	{<<"dominant-baseline">>, Record#defs.dominant_baseline},
+	{<<"enable-background">>, Record#defs.enable_background},
+	{<<"fill">>, Record#defs.fill},
+	{<<"fill-opacity">>, Record#defs.fill_opacity},
+	{<<"fill-rule">>, Record#defs.fill_rule},
+	{<<"filter">>, Record#defs.filter},
+	{<<"flood-color">>, Record#defs.flood_color},
+	{<<"flood-opacity">>, Record#defs.flood_opacity},
+	{<<"font-family">>, Record#defs.font_family},
+	{<<"font-size">>, Record#defs.font_size},
+	{<<"font-size-adjust">>, Record#defs.font_size_adjust},
+	{<<"font-stretch">>, Record#defs.font_stretch},
+	{<<"font-style">>, Record#defs.font_style},
+	{<<"font-variant">>, Record#defs.font_variant},
+	{<<"font-weight">>, Record#defs.font_weight},
+	{<<"glyph-orientation-horizontal">>, Record#defs.glyph_orientation_horizontal},
+	{<<"glyph-orientation-vertical">>, Record#defs.glyph_orientation_vertical},
+	{<<"image-rendering">>, Record#defs.image_rendering},
+	{<<"kerning">>, Record#defs.kerning},
+	{<<"letter-spacing">>, Record#defs.letter_spacing},
+	{<<"lighting-color">>, Record#defs.lighting_color},
+	{<<"marker-end">>, Record#defs.marker_end},
+	{<<"marker-mid">>, Record#defs.marker_mid},
+	{<<"marker-start">>, Record#defs.marker_start},
+	{<<"mask">>, Record#defs.mask},
+	{<<"opacity">>, Record#defs.opacity},
+	{<<"overflow">>, Record#defs.overflow},
+	{<<"pointer-events">>, Record#defs.pointer_events},
+	{<<"shape-rendering">>, Record#defs.shape_rendering},
+	{<<"stop-color">>, Record#defs.stop_color},
+	{<<"stop-opacity">>, Record#defs.stop_opacity},
+	{<<"stroke">>, Record#defs.stroke},
+	{<<"stroke-dasharray">>, Record#defs.stroke_dasharray},
+	{<<"stroke-dashoffset">>, Record#defs.stroke_dashoffset},
+	{<<"stroke-linecap">>, Record#defs.stroke_linecap},
+	{<<"stroke-linejoin">>, Record#defs.stroke_linejoin},
+	{<<"stroke-miterlimit">>, Record#defs.stroke_miterlimit},
+	{<<"stroke-opacity">>, Record#defs.stroke_opacity},
+	{<<"stroke-width">>, Record#defs.stroke_width},
+	{<<"text-anchor">>, Record#defs.text_anchor},
+	{<<"text-decoration">>, Record#defs.text_decoration},
+	{<<"text-rendering">>, Record#defs.text_rendering},
+	{<<"unicode-bidi">>, Record#defs.unicode_bidi},
+	{<<"visibility">>, Record#defs.visibility},
+	{<<"word-spacing">>, Record#defs.word_spacing},
+	{<<"writing-mode">>, Record#defs.writing_mode}
+].

+ 18 - 0
src/elements/element_desc.erl

@@ -0,0 +1,18 @@
+-module(element_desc).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"desc">>, nitro:render(Record#desc.body),
+	lists:append([
+		[
+			{<<"id">>, Record#desc.id},
+			{<<"class">>, Record#desc.class},
+			{<<"xml:base">>, Record#desc.xmlbase},
+			{<<"xml:lang">>, Record#desc.xmllang},
+			{<<"xml:space">>, Record#desc.xmlspace}
+		],
+		Record#desc.data_fields,
+		Record#desc.aria_states
+	])).

+ 115 - 0
src/elements/element_ellipse.erl

@@ -0,0 +1,115 @@
+-module(element_ellipse).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	wf_tags:emit_tag(<<"ellipse">>, nitro:render(Record#ellipse.body),
+	lists:append([
+		[
+			{<<"id">>, Record#ellipse.id},
+			{<<"class">>, Record#ellipse.class},
+			{<<"style">>, Record#ellipse.style},
+			{<<"cx">>, Record#ellipse.cx},
+			{<<"cy">>, Record#ellipse.cy},
+			{<<"rx">>, Record#ellipse.rx},
+			{<<"ry">>, Record#ellipse.ry},
+			{<<"transform">>, Record#ellipse.transform},
+			{<<"externalResourcesRequired">>, Record#ellipse.externalResourcesRequired}
+		],
+		svg_conditional_processing(Record),
+		svg_core(Record),
+		svg_graphical_event(Record),
+		svg_presentation(Record),
+		Record#ellipse.data_fields,
+		Record#ellipse.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_conditional_processing(Record)-> [
+	{<<"requiredExtensions">>, Record#ellipse.requiredExtensions},
+	{<<"requiredFeatures">>, Record#ellipse.requiredFeatures},
+	{<<"systemLanguage">>, Record#ellipse.systemLanguage}
+].
+
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#ellipse.xmlbase},
+	{<<"xml:lang">>, Record#ellipse.xmllang},
+	{<<"xml:space">>, Record#ellipse.xmlspace}
+].
+
+svg_graphical_event(Record)-> [
+	{<<"onactivate">>, Record#ellipse.onactivate},
+	{<<"onclick">>, Record#ellipse.onclick},
+	{<<"onfocusin">>, Record#ellipse.onfocusin},
+	{<<"onfocusout">>, Record#ellipse.onfocusout},
+	{<<"onload">>, Record#ellipse.onload_graphical},
+	{<<"onmousedown">>, Record#ellipse.onmousedown},
+	{<<"onmousemove">>, Record#ellipse.onmousemove},
+	{<<"onmouseout">>, Record#ellipse.onmouseout},
+	{<<"onmouseover">>, Record#ellipse.onmouseover},
+	{<<"onmouseup">>, Record#ellipse.onmouseup}
+].
+
+svg_presentation(Record)-> [
+	{<<"alignment-baseline">>, Record#ellipse.alignment_baseline},
+	{<<"baseline-shift">>, Record#ellipse.baseline_shift},
+	{<<"clip">>, Record#ellipse.clip},
+	{<<"clip-path">>, Record#ellipse.clip_path},
+	{<<"clip-rule">>, Record#ellipse.clip_rule},
+	{<<"color">>, Record#ellipse.color},
+	{<<"color-interpolation">>, Record#ellipse.color_interpolation},
+	{<<"color-interpolation-filters">>, Record#ellipse.color_interpolation_filters},
+	{<<"color-profile">>, Record#ellipse.color_profile},
+	{<<"color-rendering">>, Record#ellipse.color_rendering},
+	{<<"cursor">>, Record#ellipse.cursor},
+	{<<"direction">>, Record#ellipse.direction},
+	{<<"display">>, Record#ellipse.display},
+	{<<"dominant-baseline">>, Record#ellipse.dominant_baseline},
+	{<<"enable-background">>, Record#ellipse.enable_background},
+	{<<"fill">>, Record#ellipse.fill},
+	{<<"fill-opacity">>, Record#ellipse.fill_opacity},
+	{<<"fill-rule">>, Record#ellipse.fill_rule},
+	{<<"filter">>, Record#ellipse.filter},
+	{<<"flood-color">>, Record#ellipse.flood_color},
+	{<<"flood-opacity">>, Record#ellipse.flood_opacity},
+	{<<"font-family">>, Record#ellipse.font_family},
+	{<<"font-size">>, Record#ellipse.font_size},
+	{<<"font-size-adjust">>, Record#ellipse.font_size_adjust},
+	{<<"font-stretch">>, Record#ellipse.font_stretch},
+	{<<"font-style">>, Record#ellipse.font_style},
+	{<<"font-variant">>, Record#ellipse.font_variant},
+	{<<"font-weight">>, Record#ellipse.font_weight},
+	{<<"glyph-orientation-horizontal">>, Record#ellipse.glyph_orientation_horizontal},
+	{<<"glyph-orientation-vertical">>, Record#ellipse.glyph_orientation_vertical},
+	{<<"image-rendering">>, Record#ellipse.image_rendering},
+	{<<"kerning">>, Record#ellipse.kerning},
+	{<<"letter-spacing">>, Record#ellipse.letter_spacing},
+	{<<"lighting-color">>, Record#ellipse.lighting_color},
+	{<<"marker-end">>, Record#ellipse.marker_end},
+	{<<"marker-mid">>, Record#ellipse.marker_mid},
+	{<<"marker-start">>, Record#ellipse.marker_start},
+	{<<"mask">>, Record#ellipse.mask},
+	{<<"opacity">>, Record#ellipse.opacity},
+	{<<"overflow">>, Record#ellipse.overflow},
+	{<<"pointer-events">>, Record#ellipse.pointer_events},
+	{<<"shape-rendering">>, Record#ellipse.shape_rendering},
+	{<<"stop-color">>, Record#ellipse.stop_color},
+	{<<"stop-opacity">>, Record#ellipse.stop_opacity},
+	{<<"stroke">>, Record#ellipse.stroke},
+	{<<"stroke-dasharray">>, Record#ellipse.stroke_dasharray},
+	{<<"stroke-dashoffset">>, Record#ellipse.stroke_dashoffset},
+	{<<"stroke-linecap">>, Record#ellipse.stroke_linecap},
+	{<<"stroke-linejoin">>, Record#ellipse.stroke_linejoin},
+	{<<"stroke-miterlimit">>, Record#ellipse.stroke_miterlimit},
+	{<<"stroke-opacity">>, Record#ellipse.stroke_opacity},
+	{<<"stroke-width">>, Record#ellipse.stroke_width},
+	{<<"text-anchor">>, Record#ellipse.text_anchor},
+	{<<"text-decoration">>, Record#ellipse.text_decoration},
+	{<<"text-rendering">>, Record#ellipse.text_rendering},
+	{<<"unicode-bidi">>, Record#ellipse.unicode_bidi},
+	{<<"visibility">>, Record#ellipse.visibility},
+	{<<"word-spacing">>, Record#ellipse.word_spacing},
+	{<<"writing-mode">>, Record#ellipse.writing_mode}
+].

+ 153 - 0
src/elements/element_xlink.erl

@@ -0,0 +1,153 @@
+-module(element_xlink).
+-author('Konstantin Zakablukovsky').
+-include("nitro.hrl").
+-compile(export_all).
+
+render_element(Record) ->
+	Id = case Record#xlink.postback of
+		undefined -> Record#xlink.id;
+		Postback ->
+			ID = case Record#xlink.id of undefined ->
+				nitro:temp_id();
+				I -> I
+			end,
+			nitro:wire(#event{ type=click,postback=Postback,target=ID, source=Record#xlink.source,delegate=Record#xlink.delegate,validation=Record#xlink.validate}),
+			ID
+	end,
+	wf_tags:emit_tag(<<"a">>, nitro:render(Record#xlink.body),
+	lists:append([
+		[
+			{<<"id">>, Id},
+			{<<"class">>, Record#xlink.class},
+			{<<"style">>, Record#xlink.style},
+			{<<"transform">>, Record#xlink.transform},
+			{<<"target">>, Record#xlink.target},
+			{<<"externalResourcesRequired">>, Record#xlink.externalResourcesRequired}
+		],
+		svg_conditional_processing(Record),
+		svg_core(Record),
+		svg_filter_primitive(Record),
+		svg_graphical_event(Record),
+		svg_presentation(Record),
+		svg_transfert_function(Record),
+		svg_xlink(Record),
+		Record#xlink.data_fields,
+		Record#xlink.aria_states
+	])).
+
+
+%% Common SVG attributes
+svg_conditional_processing(Record)-> [
+	{<<"requiredExtensions">>, Record#xlink.requiredExtensions},
+	{<<"requiredFeatures">>, Record#xlink.requiredFeatures},
+	{<<"systemLanguage">>, Record#xlink.systemLanguage}
+].
+
+svg_core(Record)-> [
+	{<<"xml:base">>, Record#xlink.xmlbase},
+	{<<"xml:lang">>, Record#xlink.xmllang},
+	{<<"xml:space">>, Record#xlink.xmlspace}
+].
+
+svg_filter_primitive(Record)-> [
+	{<<"height">>, Record#xlink.height},
+	{<<"result">>, Record#xlink.result},
+	{<<"width">>, Record#xlink.width},
+	{<<"x">>, Record#xlink.x},
+	{<<"y">>, Record#xlink.y}
+].
+
+svg_graphical_event(Record)-> [
+	{<<"onactivate">>, Record#xlink.onactivate},
+	{<<"onclick">>, Record#xlink.onclick},
+	{<<"onfocusin">>, Record#xlink.onfocusin},
+	{<<"onfocusout">>, Record#xlink.onfocusout},
+	{<<"onload">>, Record#xlink.onload_graphical},
+	{<<"onmousedown">>, Record#xlink.onmousedown},
+	{<<"onmousemove">>, Record#xlink.onmousemove},
+	{<<"onmouseout">>, Record#xlink.onmouseout},
+	{<<"onmouseover">>, Record#xlink.onmouseover},
+	{<<"onmouseup">>, Record#xlink.onmouseup}
+].
+
+svg_presentation(Record)-> [
+	{<<"alignment-baseline">>, Record#xlink.alignment_baseline},
+	{<<"baseline-shift">>, Record#xlink.baseline_shift},
+	{<<"clip">>, Record#xlink.clip},
+	{<<"clip-path">>, Record#xlink.clip_path},
+	{<<"clip-rule">>, Record#xlink.clip_rule},
+	{<<"color">>, Record#xlink.color},
+	{<<"color-interpolation">>, Record#xlink.color_interpolation},
+	{<<"color-interpolation-filters">>, Record#xlink.color_interpolation_filters},
+	{<<"color-profile">>, Record#xlink.color_profile},
+	{<<"color-rendering">>, Record#xlink.color_rendering},
+	{<<"cursor">>, Record#xlink.cursor},
+	{<<"direction">>, Record#xlink.direction},
+	{<<"display">>, Record#xlink.display},
+	{<<"dominant-baseline">>, Record#xlink.dominant_baseline},
+	{<<"enable-background">>, Record#xlink.enable_background},
+	{<<"fill">>, Record#xlink.fill},
+	{<<"fill-opacity">>, Record#xlink.fill_opacity},
+	{<<"fill-rule">>, Record#xlink.fill_rule},
+	{<<"filter">>, Record#xlink.filter},
+	{<<"flood-color">>, Record#xlink.flood_color},
+	{<<"flood-opacity">>, Record#xlink.flood_opacity},
+	{<<"font-family">>, Record#xlink.font_family},
+	{<<"font-size">>, Record#xlink.font_size},
+	{<<"font-size-adjust">>, Record#xlink.font_size_adjust},
+	{<<"font-stretch">>, Record#xlink.font_stretch},
+	{<<"font-style">>, Record#xlink.font_style},
+	{<<"font-variant">>, Record#xlink.font_variant},
+	{<<"font-weight">>, Record#xlink.font_weight},
+	{<<"glyph-orientation-horizontal">>, Record#xlink.glyph_orientation_horizontal},
+	{<<"glyph-orientation-vertical">>, Record#xlink.glyph_orientation_vertical},
+	{<<"image-rendering">>, Record#xlink.image_rendering},
+	{<<"kerning">>, Record#xlink.kerning},
+	{<<"letter-spacing">>, Record#xlink.letter_spacing},
+	{<<"lighting-color">>, Record#xlink.lighting_color},
+	{<<"marker-end">>, Record#xlink.marker_end},
+	{<<"marker-mid">>, Record#xlink.marker_mid},
+	{<<"marker-start">>, Record#xlink.marker_start},
+	{<<"mask">>, Record#xlink.mask},
+	{<<"opacity">>, Record#xlink.opacity},
+	{<<"overflow">>, Record#xlink.overflow},
+	{<<"pointer-events">>, Record#xlink.pointer_events},
+	{<<"shape-rendering">>, Record#xlink.shape_rendering},
+	{<<"stop-color">>, Record#xlink.stop_color},
+	{<<"stop-opacity">>, Record#xlink.stop_opacity},
+	{<<"stroke">>, Record#xlink.stroke},
+	{<<"stroke-dasharray">>, Record#xlink.stroke_dasharray},
+	{<<"stroke-dashoffset">>, Record#xlink.stroke_dashoffset},
+	{<<"stroke-linecap">>, Record#xlink.stroke_linecap},
+	{<<"stroke-linejoin">>, Record#xlink.stroke_linejoin},
+	{<<"stroke-miterlimit">>, Record#xlink.stroke_miterlimit},
+	{<<"stroke-opacity">>, Record#xlink.stroke_opacity},
+	{<<"stroke-width">>, Record#xlink.stroke_width},
+	{<<"text-anchor">>, Record#xlink.text_anchor},
+	{<<"text-decoration">>, Record#xlink.text_decoration},
+	{<<"text-rendering">>, Record#xlink.text_rendering},
+	{<<"unicode-bidi">>, Record#xlink.unicode_bidi},
+	{<<"visibility">>, Record#xlink.visibility},
+	{<<"word-spacing">>, Record#xlink.word_spacing},
+	{<<"writing-mode">>, Record#xlink.writing_mode}
+].
+
+svg_transfert_function(Record)-> [
+	{<<"type">>, Record#xlink.type},
+	{<<"tableValues">>, Record#xlink.tableValues},
+	{<<"slope">>, Record#xlink.slope},
+	{<<"intercept">>, Record#xlink.intercept},
+	{<<"amplitude">>, Record#xlink.amplitude},
+	{<<"exponent">>, Record#xlink.exponent},
+	{<<"offset">>, Record#xlink.offset}
+].
+
+svg_xlink(Record)-> [
+	{<<"xlink:href">>, Record#xlink.xlinkhref},
+	{<<"xlink:type">>, Record#xlink.xlinktype},
+	{<<"xlink:role">>, Record#xlink.xlinkrole},
+	{<<"xlink:arcrole">>, Record#xlink.xlinkarcrole},
+	{<<"xlink:title">>, Record#xlink.xlinktitle},
+	{<<"xlink:show">>, Record#xlink.xlinkshow},
+	{<<"xlink:actuate">>, Record#xlink.xlinkactuate}
+].