12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463(* TyXML
* http://www.ocsigen.org/tyxml
* Copyright (C) 2010 by Simon Castellan
* Copyright (C) 2010 by Cecile Herbelin
* Copyright (C) 2010 by Vincent Balat
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, with linking exception;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1301, USA.
*)(** Type instantiations for SVG *)(** This module defines basic data types for data, attributes
and element occurring in SVG documents.
It is based on the specification available at http://www.w3.org/TR/SVG/.
This module is experimental, it may lack of some attributes,
and the interface is very low level and do not take deeply into account
the needs of SVG elements. *)openSvg_typesopenUnitletstring_of_irix=Printf.sprintf"url(%s)"xmoduleUnit=struct(* let rel x = (x, None) *)(* let deg x = (x, Some `Deg) *)(* let grad x = (x, Some `Grad) *)(* let rad x = (x, Some `Rad) *)(* let ms x = (x, Some `Ms) *)(* let s x = (x, Some `S) *)(* let em x = (x, Some `Em) *)(* let ex x = (x, Some `Ex) *)(* let px x = (x, Some `Px) *)(* let in_ x = (x, Some `In) *)(* let cm x = (x, Some `Cm) *)(* let mm x = (x, Some `Mm) *)(* let pt x = (x, Some `Pt) *)(* let pc x = (x, Some `Pc) *)(* let percent x = (x, Some `Percent) *)(* let hz x = (x, Some `Hz) *)(* let khz x = (x, Some `KHz) *)letto_stringf(n,unit)=Printf.sprintf"%g%s"nbeginmatchunitwith|Someunit->funit|None->""endletangle_names=function`Deg->"deg"|`Grad->"grad"|`Rad->"rad"letstring_of_anglea=to_stringangle_namesa(* let time_names = function `Ms -> "ms" | `S -> "s" *)(* let string_of_time a = to_string time_names a *)letlength_names=function|`Em->"em"|`Ex->"ex"|`Px->"px"|`In->"in"|`Cm->"cm"|`Mm->"mm"|`Pt->"pt"|`Pc->"pc"|`Percent->"%"letstring_of_length(a:length)=to_stringlength_namesa(* let freq_names = function `Hz -> "Hz" | `KHz -> "kHz" *)(* let string_of_freq a = to_string freq_names a *)endopenUnitletopt_concat?(sep=" ")sf=function|Somex->s^sep^(fx)|None->sletlist?(sep=" ")fl=String.concatsep(List.mapfl)letstring_of_colors=s(* For now just string, we may want something better in the future. *)letstring_of_icccolors=sletstring_of_paint_without_icc=function|`None->"none"|`CurrentColor->"currentColor"|`Color(c,icc)->opt_concat(string_of_colorc)string_of_icccoloriccletstring_of_paint=function|`Icc(iri,None)->string_of_iriiri|`Icc(iri,Someb)->(string_of_iriiri)^" "^(string_of_paint_without_iccb)|#paint_without_iccasc->string_of_paint_without_icccletstring_of_fill_rule=function|`Nonzero->"nonzero"|`Evenodd->"evenodd"moduleMake_with_wrapped_functions(Xml:Xml_sigs.T)(C:Svg_sigs.Wrapped_functionswithmoduleXml=Xml)=structmoduleXml=XmlmoduleW=Xml.WmoduleInfo=structletcontent_type="image/svg+xml"letalternative_content_types=[]letemptytags=[]letversion="SVG 2"letstandard="https://www.w3.org/TR/SVG2/"letnamespace="http://www.w3.org/2000/svg"(* SVG 2 defines no DTD, and the specification recommends against a
doctype declaration. The printers skip an empty doctype. *)letdoctype=""endtypeuri=Xml.uriletstring_of_uri=Xml.string_of_urileturi_of_string=Xml.uri_of_string(* Mandatory XML stuff. *)type'aattrib=Xml.attribtype+'aelt=Xml.elttype'awrap='aW.ttype'alist_wrap='aW.tlisttype('a,'b)nullary=?a:(('aattrib)list)->unit->'belttype('a,'b,'c)unary=?a:(('aattrib)list)->'beltwrap->'celttype('a,'b,'c)star=?a:(('aattrib)list)->('belt)list_wrap->'celtlettotx=xlettotlx=xlettoeltx=xlettoeltlx=xletto_attribx=xletnullarytag?a()=Xml.node?atag(W.nil())letunarytag?aelt=Xml.node?atag(W.singletonelt)letstartag?aelts=Xml.node?atageltstypealtglyphdef_content=[`Refof(glyphrefelt)list|`Itemof(altglyphitemelt)list]letto_xmlattribsx=xletfloat_attrib=Xml.float_attribletstring_attrib=Xml.string_attribleturi_attribas=Xml.uri_attribasleturis_attribas=Xml.uris_attribas(* wrap C module functions *)letstring_of_coord=C.string_of_lengthletstring_of_length=C.string_of_lengthletstring_of_lengths=C.string_of_lengths(* Custom XML attributes *)letuser_attribfnamev=Xml.string_attribname(W.fmapfv)letnumber_attrib=float_attrib(* for now string_attrib, we may want something better in the
future. *)letcolor_attrib=Xml.string_attrib(* SVG attributes *)letmetadata?achildren=Xml.node?a"metadata"childrenletforeignObject?achildren=Xml.node?a"foreignObject"childrenlettxts=Xml.pcdatasletpcdata=txt(* generated *)leta_version=string_attrib"version"leta_baseProfile=string_attrib"baseProfile"leta_x=user_attribstring_of_coord"x"leta_y=user_attribstring_of_coord"y"leta_width=user_attribstring_of_length"width"leta_height=user_attribstring_of_length"height"leta_preserveAspectRatio=string_attrib"preserveAspectRatio"leta_crossoriginx=user_attribC.string_of_big_variant"crossorigin"xleta_decodingx=user_attribC.string_of_big_variant"decoding"xleta_fetchpriorityx=user_attribC.string_of_big_variant"fetchpriority"xleta_contentScriptType=string_attrib"contentScriptType"leta_contentStyleType=string_attrib"contentStyleType"leta_zoomAndPanx=user_attribC.string_of_big_variant"zoomAndPan"xleta_href=uri_attrib"href"leta_xlink_href=uri_attrib"xlink:href"leta_requiredFeatures=Xml.space_sep_attrib"requiredFeatures"leta_requiredExtensions=Xml.space_sep_attrib"requiredExtensions"leta_systemLanguage=Xml.comma_sep_attrib"systemLanguage"leta_externalResourcesRequired=user_attribC.string_of_bool"externalResourcesRequired"leta_id=string_attrib"id"leta_user_dataname=string_attrib("data-"^name)leta_autofocus()=string_attrib"autofocus"(W.return"autofocus")leta_tabindex=user_attribC.string_of_int"tabindex"leta_lang=string_attrib"lang"leta_xml_base=uri_attrib"xml:base"leta_xml_lang=string_attrib"xml:lang"leta_xml_spacex=user_attribC.string_of_big_variant"xml:space"xleta_type=string_attrib"type"leta_media=Xml.comma_sep_attrib"media"leta_title=string_attrib"title"leta_xlink_title=string_attrib"xlink:title"leta_xlink_type=string_attrib"xlink:type"leta_xlink_role=uri_attrib"xlink:role"leta_xlink_arcrole=uri_attrib"xlink:arcrole"leta_class=Xml.space_sep_attrib"class"leta_style=string_attrib"style"leta_role=Xml.space_sep_attrib"role"leta_arianame=Xml.space_sep_attrib("aria-"^name)leta_transform=user_attribC.string_of_transforms"transform"leta_viewBox=user_attribC.string_of_fourfloats"viewBox"leta_d=string_attrib"d"leta_pathLength=number_attrib"pathLength"leta_rx=user_attribstring_of_length"rx"leta_ry=user_attribstring_of_length"ry"leta_cx=user_attribstring_of_length"cx"leta_cy=user_attribstring_of_length"cy"leta_r=user_attribstring_of_length"r"leta_x1=user_attribstring_of_coord"x1"leta_y1=user_attribstring_of_coord"y1"leta_x2=user_attribstring_of_coord"x2"leta_y2=user_attribstring_of_coord"y2"leta_points=user_attribC.string_of_coords"points"leta_x_list=user_attribstring_of_lengths"x"leta_y_list=user_attribstring_of_lengths"y"leta_dx=user_attribC.string_of_number"dx"leta_dy=user_attribC.string_of_number"dy"leta_dx_list=user_attribstring_of_lengths"dx"leta_dy_list=user_attribstring_of_lengths"dy"leta_lengthAdjustx=user_attribC.string_of_big_variant"lengthAdjust"xleta_textLength=user_attribstring_of_length"textLength"leta_text_anchorx=user_attribC.string_of_big_variant"text-anchor"xleta_text_decorationx=user_attribC.string_of_big_variant"text-decoration"xleta_text_renderingx=user_attribC.string_of_big_variant"text-rendering"xleta_rotate=user_attribC.string_of_numbers"rotate"leta_startOffset=user_attribstring_of_length"startOffset"leta_methodx=user_attribC.string_of_big_variant"method"xleta_spacingx=user_attribC.string_of_big_variant"spacing"xleta_sidex=user_attribC.string_of_big_variant"side"xleta_glyphRef=string_attrib"glyphRef"leta_format=string_attrib"format"leta_markerUnitsx=user_attribC.string_of_big_variant"markerUnits"xleta_refX=user_attribstring_of_coord"refX"leta_refY=user_attribstring_of_coord"refY"leta_markerWidth=user_attribstring_of_length"markerWidth"leta_markerHeight=user_attribstring_of_length"markerHeight"leta_orientx=user_attribC.string_of_orient"orient"xleta_local=string_attrib"local"leta_rendering_intentx=user_attribC.string_of_big_variant"rendering-intent"xleta_gradientUnitsx=user_attribC.string_of_big_variant"gradientUnits"xleta_gradientTransform=user_attribC.string_of_transforms"gradientTransform"leta_spreadMethodx=user_attribC.string_of_big_variant"spreadMethod"xleta_fx=user_attribstring_of_coord"fx"leta_fy=user_attribstring_of_coord"fy"leta_fr=user_attribstring_of_length"fr"leta_offsetx=user_attribC.string_of_offset"offset"xleta_patternUnitsx=user_attribC.string_of_big_variant"patternUnits"xleta_patternContentUnitsx=user_attribC.string_of_big_variant"patternContentUnits"xleta_patternTransformx=user_attribC.string_of_transforms"patternTransform"xleta_clip_path=string_attrib"clip-path"leta_clipPathUnitsx=user_attribC.string_of_big_variant"clipPathUnits"xleta_maskUnitsx=user_attribC.string_of_big_variant"maskUnits"xleta_maskContentUnitsx=user_attribC.string_of_big_variant"maskContentUnits"xleta_filterUnitsx=user_attribC.string_of_big_variant"filterUnits"xleta_primitiveUnitsx=user_attribC.string_of_big_variant"primitiveUnits"xleta_filterRes=user_attribC.string_of_number_optional_number"filterRes"leta_result=string_attrib"result"leta_inx=user_attribC.string_of_in_value"in"xleta_in2x=user_attribC.string_of_in_value"in2"xleta_azimuth=number_attrib"azimuth"leta_elevation=number_attrib"elevation"leta_z=user_attribC.string_of_number"z"leta_pointsAtX=number_attrib"pointsAtX"leta_pointsAtY=number_attrib"pointsAtY"leta_pointsAtZ=number_attrib"pointsAtZ"leta_specularExponent=number_attrib"specularExponent"leta_specularConstant=number_attrib"specularConstant"leta_limitingConeAngle=number_attrib"limitingConeAngle"leta_modex=user_attribC.string_of_big_variant"mode"xleta_feColorMatrix_typex=user_attribC.string_of_big_variant"type"xleta_values=user_attribC.string_of_numbers"values"leta_transfer_typex=user_attribC.string_of_big_variant"type"xleta_tableValues=user_attribC.string_of_numbers"tableValues"leta_intercept=user_attribC.string_of_number"intercept"leta_amplitude=user_attribC.string_of_number"amplitude"leta_exponent=user_attribC.string_of_number"exponent"leta_transfer_offset=user_attribC.string_of_number"offset"leta_feComposite_operatorx=user_attribC.string_of_big_variant"operator"xleta_k1=user_attribC.string_of_number"k1"leta_k2=user_attribC.string_of_number"k2"leta_k3=user_attribC.string_of_number"k3"leta_k4=user_attribC.string_of_number"k4"leta_order=user_attribC.string_of_number_optional_number"order"leta_kernelMatrix=user_attribC.string_of_numbers"kernelMatrix"leta_divisor=user_attribC.string_of_number"divisor"leta_bias=user_attribC.string_of_number"bias"leta_kernelUnitLength=user_attribC.string_of_number_optional_number"kernelUnitLength"leta_targetX=user_attribC.string_of_int"targetX"leta_targetY=user_attribC.string_of_int"targetY"leta_edgeModex=user_attribC.string_of_big_variant"edgeMode"xleta_preserveAlpha=user_attribC.string_of_bool"preserveAlpha"leta_surfaceScale=user_attribC.string_of_number"surfaceScale"leta_diffuseConstant=user_attribC.string_of_number"diffuseConstant"leta_scale=user_attribC.string_of_number"scale"leta_xChannelSelectorx=user_attribC.string_of_big_variant"xChannelSelector"xleta_yChannelSelectorx=user_attribC.string_of_big_variant"yChannelSelector"xleta_stdDeviation=user_attribC.string_of_number_optional_number"stdDeviation"leta_feMorphology_operatorx=user_attribC.string_of_big_variant"operator"xleta_radius=user_attribC.string_of_number_optional_number"radius"leta_baseFrequency=user_attribC.string_of_number_optional_number"baseFrequency"leta_numOctaves=user_attribC.string_of_int"numOctaves"leta_seed=user_attribC.string_of_number"seed"leta_stitchTilesx=user_attribC.string_of_big_variant"stitchTiles"xleta_feTurbulence_typex=user_attribC.string_of_big_variant"type"xleta_xlink_showx=user_attribC.string_of_big_variant"xlink:show"xleta_xlink_actuatex=user_attribC.string_of_big_variant"xlink:actuate"xleta_target=string_attrib"target"leta_downloadfile=user_attribC.unoption_string"download"fileleta_hreflang=string_attrib"hreflang"leta_ping=uris_attrib"ping"leta_referrerpolicyx=user_attribC.string_of_big_variant"referrerpolicy"xleta_rel=Xml.space_sep_attrib"rel"leta_viewTarget=string_attrib"viewTarget"leta_attributeName=string_attrib"attributeName"leta_attributeTypex=user_attribC.string_of_big_variant"attributeType"xleta_begin=string_attrib"begin"leta_dur=string_attrib"dur"leta_end=string_attrib"end"leta_min=string_attrib"min"leta_max=string_attrib"max"leta_restartx=user_attribC.string_of_big_variant"restart"xleta_repeatCount=string_attrib"repeatCount"leta_repeatDur=string_attrib"repeatDur"leta_fill=user_attribC.string_of_paint"fill"leta_animation_fillx=user_attribC.string_of_big_variant"fill"xleta_fill_rule=user_attribC.string_of_fill_rule"fill-rule"leta_calcModex=user_attribC.string_of_big_variant"calcMode"xleta_animation_valuesx=user_attribC.string_of_semicolonstrings"values"xleta_keyTimesx=user_attribC.string_of_semicolonstrings"keyTimes"xleta_keySplinesx=user_attribC.string_of_semicolonstrings"keySplines"xleta_from=string_attrib"from"leta_to=string_attrib"to"leta_by=string_attrib"by"leta_additivex=user_attribC.string_of_big_variant"additive"xleta_accumulatex=user_attribC.string_of_big_variant"accumulate"xleta_keyPoints=user_attribC.string_of_numbers_semicolon"keyPoints"leta_origin=string_attrib"origin"leta_path=string_attrib"path"leta_animateTransform_type=user_attribC.string_of_big_variant"type"leta_horiz_origin_x=user_attribC.string_of_number"horiz-origin-x"leta_horiz_origin_y=user_attribC.string_of_number"horiz-origin-y"leta_horiz_adv_x=user_attribC.string_of_number"horiz-adv-x"leta_vert_origin_x=user_attribC.string_of_number"vert-origin-x"leta_vert_origin_y=user_attribC.string_of_number"vert-origin-y"leta_vert_adv_y=user_attribC.string_of_number"vert-adv-y"leta_unicode=string_attrib"unicode"leta_glyph_name=string_attrib"glyph-name"leta_orientationx=user_attribC.string_of_big_variant"orientation"xleta_arabic_formx=user_attribC.string_of_big_variant"arabic-form"xleta_u1=string_attrib"u1"leta_u2=string_attrib"u2"leta_g1=string_attrib"g1"leta_g2=string_attrib"g2"leta_k=string_attrib"k"leta_font_family=string_attrib"font-family"leta_font_style=string_attrib"font-style"leta_font_variant=string_attrib"font-variant"leta_font_weight=string_attrib"font-weight"leta_font_stretch=string_attrib"font-stretch"leta_font_size=string_attrib"font-size"leta_unicode_range=string_attrib"unicode-range"leta_units_per_em=string_attrib"units-per-em"leta_panose_1=string_attrib"panose-1"leta_stemv=user_attribC.string_of_number"stemv"leta_stemh=user_attribC.string_of_number"stemh"leta_slope=user_attribC.string_of_number"slope"leta_cap_height=user_attribC.string_of_number"cap-height"leta_x_height=user_attribC.string_of_number"x-height"leta_accent_height=user_attribC.string_of_number"accent-height"leta_ascent=user_attribC.string_of_number"ascent"leta_descent=user_attribC.string_of_number"descent"leta_widths=string_attrib"widths"leta_bbox=string_attrib"bbox"leta_ideographic=user_attribC.string_of_number"ideographic"leta_alphabetic=user_attribC.string_of_number"alphabetic"leta_mathematical=user_attribC.string_of_number"mathematical"leta_hanging=user_attribC.string_of_number"hanging"leta_videographic=user_attribC.string_of_number"v-ideographic"leta_v_alphabetic=user_attribC.string_of_number"v-alphabetic"leta_v_mathematical=user_attribC.string_of_number"v-mathematical"leta_v_hanging=user_attribC.string_of_number"v-hanging"leta_underline_position=user_attribC.string_of_number"underline-position"leta_underline_thickness=user_attribC.string_of_number"underline-thickness"leta_strikethrough_position=user_attribC.string_of_number"strikethrough-position"leta_strikethrough_thickness=user_attribC.string_of_number"strikethrough-thickness"leta_overline_position=user_attribC.string_of_number"overline-position"leta_overline_thickness=user_attribC.string_of_number"overline-thickness"leta_string=string_attrib"string"leta_name=string_attrib"name"leta_alignment_baselinex=user_attribC.string_of_alignment_baseline"alignment-baseline"xleta_dominant_baselinex=user_attribC.string_of_dominant_baseline"dominant-baseline"x(** Javascript events *)leta_onabort=Xml.event_handler_attrib"onabort"leta_onactivate=Xml.event_handler_attrib"onactivate"leta_onbegin=Xml.event_handler_attrib"onbegin"leta_onend=Xml.event_handler_attrib"onend"leta_onerror=Xml.event_handler_attrib"onerror"leta_onfocusin=Xml.event_handler_attrib"onfocusin"leta_onfocusout=Xml.event_handler_attrib"onfocusout"leta_onload=Xml.event_handler_attrib"onload"leta_onrepeat=Xml.event_handler_attrib"onrepeat"leta_onresize=Xml.event_handler_attrib"onresize"leta_onscroll=Xml.event_handler_attrib"onscroll"leta_onunload=Xml.event_handler_attrib"onunload"leta_onzoom=Xml.event_handler_attrib"onzoom"leta_onafterprint=Xml.event_handler_attrib"onafterprint"leta_onbeforeprint=Xml.event_handler_attrib"onbeforeprint"leta_onbeforeunload=Xml.event_handler_attrib"onbeforeunload"leta_onhashchange=Xml.event_handler_attrib"onhashchange"leta_onlanguagechange=Xml.event_handler_attrib"onlanguagechange"leta_onmessage=Xml.event_handler_attrib"onmessage"leta_onoffline=Xml.event_handler_attrib"onoffline"leta_ononline=Xml.event_handler_attrib"ononline"leta_onpagehide=Xml.event_handler_attrib"onpagehide"leta_onpageshow=Xml.event_handler_attrib"onpageshow"leta_onpopstate=Xml.event_handler_attrib"onpopstate"leta_onreadystatechange=Xml.event_handler_attrib"onreadystatechange"leta_onredo=Xml.event_handler_attrib"onredo"leta_onrejectionhandled=Xml.event_handler_attrib"onrejectionhandled"leta_onstorage=Xml.event_handler_attrib"onstorage"leta_onundo=Xml.event_handler_attrib"onundo"leta_onunhandledrejection=Xml.event_handler_attrib"onunhandledrejection"(** Javascript mouse events *)leta_onauxclick=Xml.mouse_event_handler_attrib"onauxclick"leta_onbeforeinput=Xml.event_handler_attrib"onbeforeinput"leta_onbeforematch=Xml.event_handler_attrib"onbeforematch"leta_onbeforetoggle=Xml.event_handler_attrib"onbeforetoggle"leta_onblur=Xml.event_handler_attrib"onblur"leta_oncancel=Xml.event_handler_attrib"oncancel"leta_oncanplay=Xml.event_handler_attrib"oncanplay"leta_oncanplaythrough=Xml.event_handler_attrib"oncanplaythrough"leta_onchange=Xml.event_handler_attrib"onchange"leta_onclose=Xml.event_handler_attrib"onclose"leta_oncontextlost=Xml.event_handler_attrib"oncontextlost"leta_oncontextmenu=Xml.mouse_event_handler_attrib"oncontextmenu"leta_oncontextrestored=Xml.event_handler_attrib"oncontextrestored"leta_oncopy=Xml.event_handler_attrib"oncopy"leta_oncuechange=Xml.event_handler_attrib"oncuechange"leta_oncut=Xml.event_handler_attrib"oncut"leta_ondblclick=Xml.mouse_event_handler_attrib"ondblclick"leta_ondrag=Xml.mouse_event_handler_attrib"ondrag"leta_ondragend=Xml.mouse_event_handler_attrib"ondragend"leta_ondragenter=Xml.mouse_event_handler_attrib"ondragenter"leta_ondragleave=Xml.mouse_event_handler_attrib"ondragleave"leta_ondragover=Xml.mouse_event_handler_attrib"ondragover"leta_ondragstart=Xml.mouse_event_handler_attrib"ondragstart"leta_ondrop=Xml.mouse_event_handler_attrib"ondrop"leta_ondurationchange=Xml.event_handler_attrib"ondurationchange"leta_onemptied=Xml.event_handler_attrib"onemptied"leta_onended=Xml.event_handler_attrib"onended"leta_onfocus=Xml.event_handler_attrib"onfocus"leta_ongotpointercapture=Xml.mouse_event_handler_attrib"ongotpointercapture"leta_oninput=Xml.event_handler_attrib"oninput"leta_oninvalid=Xml.event_handler_attrib"oninvalid"leta_onkeydown=Xml.keyboard_event_handler_attrib"onkeydown"leta_onkeypress=Xml.keyboard_event_handler_attrib"onkeypress"leta_onkeyup=Xml.keyboard_event_handler_attrib"onkeyup"leta_onloadeddata=Xml.event_handler_attrib"onloadeddata"leta_onloadedmetadata=Xml.event_handler_attrib"onloadedmetadata"leta_onloadstart=Xml.event_handler_attrib"onloadstart"leta_onlostpointercapture=Xml.mouse_event_handler_attrib"onlostpointercapture"leta_onmousewheel=Xml.event_handler_attrib"onmousewheel"leta_onpaste=Xml.event_handler_attrib"onpaste"leta_onpause=Xml.event_handler_attrib"onpause"leta_onplay=Xml.event_handler_attrib"onplay"leta_onplaying=Xml.event_handler_attrib"onplaying"leta_onpointercancel=Xml.mouse_event_handler_attrib"onpointercancel"leta_onpointerdown=Xml.mouse_event_handler_attrib"onpointerdown"leta_onpointerenter=Xml.mouse_event_handler_attrib"onpointerenter"leta_onpointerleave=Xml.mouse_event_handler_attrib"onpointerleave"leta_onpointermove=Xml.mouse_event_handler_attrib"onpointermove"leta_onpointerout=Xml.mouse_event_handler_attrib"onpointerout"leta_onpointerover=Xml.mouse_event_handler_attrib"onpointerover"leta_onpointerup=Xml.mouse_event_handler_attrib"onpointerup"leta_onprogress=Xml.event_handler_attrib"onprogress"leta_onratechange=Xml.event_handler_attrib"onratechange"leta_onscrollend=Xml.event_handler_attrib"onscrollend"leta_onsecuritypolicyviolation=Xml.event_handler_attrib"onsecuritypolicyviolation"leta_onseeked=Xml.event_handler_attrib"onseeked"leta_onseeking=Xml.event_handler_attrib"onseeking"leta_onselect=Xml.event_handler_attrib"onselect"leta_onshow=Xml.event_handler_attrib"onshow"leta_onstalled=Xml.event_handler_attrib"onstalled"leta_onsubmit=Xml.event_handler_attrib"onsubmit"leta_onsuspend=Xml.event_handler_attrib"onsuspend"leta_ontimeupdate=Xml.event_handler_attrib"ontimeupdate"leta_ontoggle=Xml.event_handler_attrib"ontoggle"leta_onvolumechange=Xml.event_handler_attrib"onvolumechange"leta_onwaiting=Xml.event_handler_attrib"onwaiting"leta_onwheel=Xml.mouse_event_handler_attrib"onwheel"leta_onclick=Xml.mouse_event_handler_attrib"onclick"leta_onmousedown=Xml.mouse_event_handler_attrib"onmousedown"leta_onmouseup=Xml.mouse_event_handler_attrib"onmouseup"leta_onmouseover=Xml.mouse_event_handler_attrib"onmouseover"leta_onmouseout=Xml.mouse_event_handler_attrib"onmouseout"leta_onmousemove=Xml.mouse_event_handler_attrib"onmousemove"(** Javascript touch events *)leta_ontouchstart=Xml.touch_event_handler_attrib"ontouchstart"leta_ontouchend=Xml.touch_event_handler_attrib"ontouchend"leta_ontouchmove=Xml.touch_event_handler_attrib"ontouchmove"leta_ontouchcancel=Xml.touch_event_handler_attrib"ontouchcancel"leta_stop_color=color_attrib"stop-color"leta_stop_opacity=user_attribC.string_of_number"stop-opacity"leta_stroke=user_attribC.string_of_paint"stroke"leta_stroke_width=user_attribC.string_of_length"stroke-width"leta_stroke_linecapx=user_attribC.string_of_big_variant"stroke-linecap"xleta_stroke_linejoinx=user_attribC.string_of_big_variant"stroke-linejoin"xleta_stroke_miterlimit=user_attribC.string_of_number"stroke-miterlimit"leta_stroke_dasharrayx=user_attribC.string_of_strokedasharray"stroke-dasharray"xleta_stroke_dashoffset=user_attribC.string_of_length"stroke-dashoffset"leta_stroke_opacity=user_attribC.string_of_number"stroke-opacity"leta_baseline_shift=string_attrib"baseline-shift"leta_clip=string_attrib"clip"leta_clip_rulex=user_attribC.string_of_big_variant"clip-rule"xleta_color=color_attrib"color"leta_color_interpolationx=user_attribC.string_of_big_variant"color-interpolation"xleta_color_interpolation_filtersx=user_attribC.string_of_big_variant"color-interpolation-filters"xleta_color_profile=string_attrib"color-profile"leta_color_renderingx=user_attribC.string_of_big_variant"color-rendering"xleta_cursor=string_attrib"cursor"leta_directionx=user_attribC.string_of_big_variant"direction"xleta_display=string_attrib"display"leta_enable_backgroundx=user_attribC.string_of_big_variant"enable-background"xleta_fill_opacity=user_attribC.string_of_number"fill-opacity"leta_filter=string_attrib"filter"leta_flood_color=color_attrib"flood-color"leta_flood_opacity=user_attribC.string_of_number"flood-opacity"leta_font_size_adjust=string_attrib"font-size-adjust"leta_glyph_orientation_horizontal=string_attrib"glyph-orientation-horizontal"leta_glyph_orientation_vertical=string_attrib"glyph-orientation-vertical"leta_image_renderingx=user_attribC.string_of_big_variant"image-rendering"xleta_kerning=string_attrib"kerning"leta_letter_spacing=string_attrib"letter-spacing"leta_lighting_color=color_attrib"lighting-color"leta_marker_end=string_attrib"marker-end"leta_marker_mid=string_attrib"marker-mid"leta_marker_start=string_attrib"marker-start"leta_mask=string_attrib"mask"leta_opacity=user_attribC.string_of_number"opacity"leta_overflowx=user_attribC.string_of_big_variant"overflow"xleta_pointer_eventsx=user_attribC.string_of_big_variant"pointer-events"xleta_shape_renderingx=user_attribC.string_of_big_variant"shape-rendering"xleta_unicode_bidix=user_attribC.string_of_big_variant"unicode-bidi"xleta_visibilityx=user_attribC.string_of_big_variant"visibility"xleta_word_spacing=string_attrib"word-spacing"leta_writing_modex=user_attribC.string_of_big_variant"writing-mode"xleta_paint_order=string_attrib"paint-order"leta_text_overflowx=user_attribC.string_of_big_variant"text-overflow"xleta_transform_origin=string_attrib"transform-origin"leta_vector_effectx=user_attribC.string_of_big_variant"vector-effect"xleta_white_spacex=user_attribC.string_of_big_variant"white-space"x(* xlink namespace given a nickname since some attributes mandated by
the svg standard such as xlink:href live in that namespace, and we
refer to them as "xlink:whatever" (see a_xlink_href or a_xlinkshow)
*)letsvg?(a=[])children=letattribs=string_attrib"xmlns"(W.return"http://www.w3.org/2000/svg")::string_attrib"xmlns:xlink"(W.return"http://www.w3.org/1999/xlink")::to_xmlattribsainstar~a:(attribs)"svg"children(* also generated *)letg=star"g"letdefs=star"defs"letdesc=unary"desc"lettitle=unary"title"letsymbol=star"symbol"letuse=star"use"letimage=star"image"letswitch=star"switch"letstyle=unary"style"letpath=star"path"letrect=star"rect"letcircle=star"circle"letellipse=star"ellipse"letline=star"line"letpolyline=star"polyline"letpolygon=star"polygon"lettext=star"text"lettspan=star"tspan"lettref=star"tref"lettextPath=star"textPath"letaltGlyph=unary"altGlyph"letaltGlyphDef=unary"altGlyphDef"letaltGlyphItem=star"altGlyphItem"letglyphRef=nullary"glyphRef"letmarker=star"marker"letcolor_profile=star"color-profile"letlinearGradient=star"linearGradient"letradialGradient=star"radialGradient"letstop=star"stop"letpattern=star"pattern"letclipPath=star"clipPath"letmask=star"mask"letfilter=star"filter"letfeDistantLight=star"feDistantLight"letfePointLight=star"fePointLight"letfeSpotLight=star"feSpotLight"letfeBlend=star"feBlend"letfeColorMatrix=star"feColorMatrix"letfeComponentTransfer=star"feComponentTransfer"letfeFuncA=star"feFuncA"letfeFuncG=star"feFuncG"letfeFuncB=star"feFuncB"letfeFuncR=star"feFuncR"letfeComposite=star"feComposite"letfeConvolveMatrix=star"feConvolveMatrix"letfeDiffuseLighting=star"feDiffuseLighting"letfeDisplacementMap=star"feDisplacementMap"letfeDropShadow=star"feDropShadow"letfeFlood=star"feFlood"letfeGaussianBlur=star"feGaussianBlur"letfeImage=star"feImage"letfeMerge=star"feMerge"letfeMergeNode=star"feMergeNode"letfeMorphology=star"feMorphology"letfeOffset=star"feOffset"letfeSpecularLighting=star"feSpecularLighting"letfeTile=star"feTile"letfeTurbulence=star"feTurbulence"letcursor=star"cursor"leta=star"a"letview=star"view"letscript=unary"script"letanimate=star"animate"letanimation=animateletset=star"set"letanimateMotion=star"animateMotion"letmpath=star"mpath"letanimateColor=star"animateColor"letanimateTransform=star"animateTransform"letfont=star"font"letglyph=star"glyph"letmissing_glyph=star"missing-glyph"lethkern=nullary"hkern"letvkern=nullary"vkern"letfont_face=nullary"font-face"letfont_face_src=star"font-face-src"letfont_face_uri=star"font-face-uri"letfont_face_format=nullary"font-face-format"letfont_face_name=nullary"font-face-name"typedoc=[`Svg]eltletdoc_toeltx=xmoduleI=Xml_stream.Import(Xml)letof_seqs=totl@@I.of_seqsmoduleUnsafe=structletdatas=Xml.encodedpcdatasletleaftag?a()=Xml.leaf?atagletnodetag?aelts=Xml.node?atageltsletcoerce_eltx=xletfloat_attrib=Xml.float_attribletint_attrib=Xml.int_attribletstring_attrib=Xml.string_attribleturi_attribas=Xml.uri_attribasleturis_attribas=Xml.uris_attribasletspace_sep_attrib=Xml.space_sep_attribletcomma_sep_attrib=Xml.comma_sep_attribendendmoduleWrapped_functions(Xml:Xml_sigs.Twithtype('a,'b)W.ft='a->'b)=structmoduleXml=Xmlletstring_of_alignment_baseline=function|`Auto->"auto"|`Baseline->"baseline"|`Before_edge->"before-edge"|`Text_before_edge->"text-before-edge"|`Middle->"middle"|`Central->"central"|`After_edge->"after-edge"|`Text_after_edge->"text-after-edge"|`Ideographic->"ideographic"|`Alphabetic->"alphabetic"|`Hanging->"hanging"|`Mathematical->"mathematical"|`Text_bottom->"text-bottom"|`Text_top->"text-top"|`Inherit->"inherit"letstring_of_big_variant=function|`A->"a"|`Absolute_colorimetric->"absolute-colorimetric"|`Accumulate->"accumulate"|`Align->"align"|`All->"all"|`Always->"always"|`Anonymous->"anonymous"|`Arcs->"arcs"|`Arithmetic->"arithmetic"|`Async->"async"|`Atop->"atop"|`Auto->"auto"|`B->"b"|`Bevel->"bevel"|`Bidi_override->"bidi-override"|`Blink->"blink"|`Break_spaces->"break-spaces"|`Butt->"butt"|`Clip->"clip"|`Collapse->"collapse"|`Color->"color"|`Color_burn->"color-burn"|`Color_dodge->"color-dodge"|`CrispEdges->"crispEdges"|`CSS->"CSS"|`Darken->"darken"|`Default->"default"|`Difference->"difference"|`Dilate->"dilate"|`Disable->"disable"|`Discrete->"discrete"|`Duplicate->"duplicate"|`Ellipsis->"ellipsis"|`Embed->"embed"|`End->"end"|`Erode->"erode"|`Evenodd->"evenodd"|`Exact->"exact"|`Exclusion->"exclusion"|`Fill->"fill"|`Fixed_position->"fixed-position"|`FractalNoise->"fractalNoise"|`Freeze->"freeze"|`G->"g"|`Gamma->"gamma"|`GeometricPrecision->"geometricPrecision"|`H->"h"|`Hard_light->"hard-light"|`Hidden->"hidden"|`High->"high"|`Horizontal_tb->"horizontal-tb"|`Hue->"hue"|`HueRotate->"hueRotate"|`Identity->"identity"|`In->"in"|`Inherit->"inherit"|`Initial->"initial"|`Isolated->"isolated"|`Left->"left"|`Lighten->"lighten"|`Line_through->"line-through"|`Linear->"linear"|`LinearRGB->"linearRGB"|`Low->"low"|`Ltr->"ltr"|`LuminanceToAlpha->"luminanceToAlpha"|`Luminosity->"luminosity"|`Magnify->"magnify"|`Matrix->"matrix"|`Medial->"medial"|`Middle->"middle"|`Miter->"miter"|`Miter_clip->"miter-clip"|`Multiply->"multiply"|`Never->"never"|`New->"new"|`No_referrer->"no-referrer"|`No_referrer_when_downgrade->"no-referrer-when-downgrade"|`Non_rotation->"non-rotation"|`Non_scaling_size->"non-scaling-size"|`Non_scaling_stroke->"non-scaling-stroke"|`None->"none"|`Nonzero->"nonzero"|`Normal->"normal"|`NoStitch->"noStitch"|`Nowrap->"nowrap"|`ObjectBoundingBox->"objectBoundingBox"|`OnLoad->"onLoad"|`OnRequest->"onRequest"|`OptimizeLegibility->"optimizeLegibility"|`OptimizeQuality->"optimizeQuality"|`OptimizeSpeed->"optimizeSpeed"|`Origin->"origin"|`Origin_when_cross_origin->"origin-when-cross-origin"|`Other->"other"|`Out->"out"|`Over->"over"|`Overlay->"overlay"|`Overline->"overline"|`Paced->"paced"|`Pad->"pad"|`Painted->"painted"|`Perceptual->"perceptual"|`Pre->"pre"|`Pre_line->"pre-line"|`Pre_wrap->"pre-wrap"|`Preserve->"preserve"|`R->"r"|`Reflect->"reflect"|`Relative_colorimetric->"relative-colorimetric"|`Remove->"remove"|`Repeat->"repeat"|`Replace->"replace"|`Right->"right"|`Rotate->"rotate"|`Round->"round"|`Rtl->"rtl"|`Same_origin->"same-origin"|`Saturate->"saturate"|`Saturation->"saturation"|`Scale->"scale"|`Screen->"screen"|`Scroll->"scroll"|`SkewX->"skewX"|`SkewY->"skewY"|`Soft_light->"soft-light"|`Spacing->"spacing"|`SpacingAndGlyphs->"spacingAndGlyphs"|`Spline->"spline"|`Square->"square"|`SRGB->"sRGB"|`Start->"start"|`Stitch->"stitch"|`Stretch->"stretch"|`Strict_origin->"strict-origin"|`Strict_origin_when_cross_origin->"strict-origin-when-cross-origin"|`Stroke->"stroke"|`StrokeWidth->"stroke-width"|`Sum->"sum"|`Sync->"sync"|`Table->"table"|`Terminal->"terminal"|`Translate->"translate"|`Turbulence->"turbulence"|`Underline->"underline"|`Unsafe_url->"unsafe-url"|`Use_credentials->"use-credentials"|`UserSpaceOnUse->"userSpaceOnUse"|`V->"v"|`Vertical_lr->"vertical-lr"|`Vertical_rl->"vertical-rl"|`Visible->"visible"|`VisibleFill->"visibleFill"|`VisiblePainted->"visiblePainted"|`VisibleStroke->"visibleStroke"|`WhenNotActive->"whenNotActive"|`Wrap->"wrap"|`XML->"XML"|`Xor->"xor"letstring_of_bool=string_of_boolletstring_of_semicolonstrings=String.concat"; "letunoption_string=function|Somex->x|None->""letstring_of_coords=list(fun(a,b)->Printf.sprintf"%g, %g"ab)letstring_of_dominant_baseline=function|`Auto->"auto"|`Use_script->"use-script"|`No_change->"no-change"|`Reset_size->"reset-size"|`Ideographic->"ideographic"|`Alphabetic->"alphabetic"|`Hanging->"hanging"|`Mathematical->"mathematical"|`Central->"central"|`Middle->"middle"|`Text_after_edge->"text-after-edge"|`Text_before_edge->"text-before-edge"|`Text_bottom->"text-bottom"|`Text_top->"text-top"|`Inherit->"inherit"letstring_of_in_value=function|`SourceGraphic->"SourceGraphic"|`SourceAlpha->"SourceAlpha"|`BackgroundImage->"BackgroundImage"|`BackgroundAlpha->"BackgroundAlpha"|`FillPaint->"FillPaint"|`StrokePaint->"StrokePaint"|`Ref_svg->_svgletstring_of_int=string_of_intletstring_of_length=Unit.string_of_lengthletstring_of_lengths=liststring_of_lengthletstring_of_number=Xml_print.string_of_numberletstring_of_percentagex=(string_of_numberx)^"%"letstring_of_fourfloats(a,b,c,d)=Printf.sprintf"%s %s %s %s"(string_of_numbera)(string_of_numberb)(string_of_numberc)(string_of_numberd)letstring_of_number_optional_number=function|x,Somey->Printf.sprintf"%g, %g"xy|x,None->Printf.sprintf"%g"xletstring_of_numbers=liststring_of_numberletstring_of_numbers_semicolon=list~sep:"; "string_of_numberletstring_of_offset=function|`Numberx->string_of_numberx|`Percentagex->string_of_percentagexletstring_of_orient=function|None->"auto"|Some__svg->string_of_angle__svgletstring_of_paint=string_of_paintletstring_of_fill_rule=string_of_fill_ruleletstring_of_strokedasharray=function|[]->"none"|l->liststring_of_lengthlletstring_of_transform=function|`Matrix(a,b,c,d,e,f)->Printf.sprintf"matrix(%g %g %g %g %g %g)"abcdef|`Translatex->Printf.sprintf"translate(%s)"(string_of_number_optional_numberx)|`Scalex->Printf.sprintf"scale(%s)"(string_of_number_optional_numberx)|`Rotate((angle,x))->Printf.sprintf"rotate(%s %s)"(string_of_angleangle)(matchxwith|Some((x,y))->Printf.sprintf"%g %g"xy|None->"")|`SkewXangle->Printf.sprintf"skewX(%s)"(string_of_angleangle)|`SkewYangle->Printf.sprintf"skewY(%s)"(string_of_angleangle)letstring_of_transformsl=String.concat" "(List.mapstring_of_transforml)endmoduleMake(Xml:Xml_sigs.Twithtype('a,'b)W.ft=('a->'b))=Make_with_wrapped_functions(Xml)(Wrapped_functions(Xml))