svghmi/inline_svg.ysl2
branchwxPython4
changeset 3405 fdc12f7d27c8
parent 3393 a65bcbb6af20
child 3625 bb1eff4091ab
equal deleted inserted replaced
3391:0ae5a15efa18 3405:fdc12f7d27c8
    54 //
    54 //
    55 // For now, clone unlinkink applies to descendants of all widget except HMI:Page
    55 // For now, clone unlinkink applies to descendants of all widget except HMI:Page
    56 // TODO: narrow application of clone unlinking to active elements,
    56 // TODO: narrow application of clone unlinking to active elements,
    57 //       while keeping static decoration cloned
    57 //       while keeping static decoration cloned
    58 const "targets_not_to_unlink", "$hmi_lists/descendant-or-self::svg:*";
    58 const "targets_not_to_unlink", "$hmi_lists/descendant-or-self::svg:*";
    59 const "to_unlink", "$hmi_elements[not(@id = $hmi_pages/@id)]/descendant-or-self::svg:use";
    59 const "to_unlink", "$hmi_widgets/descendant-or-self::svg:use";
    60 
    60 
    61 def "func:is_unlinkable" {
    61 def "func:is_unlinkable" {
    62     param "targetid";
    62     param "targetid";
    63     param "eltid";
    63     param "eltid";
    64     result "$eltid = $to_unlink/@id and not($targetid = $targets_not_to_unlink/@id)";
    64     result "$eltid = $to_unlink/@id and not($targetid = $targets_not_to_unlink/@id)";
   172 // instead widget is refered through a svg:use.
   172 // instead widget is refered through a svg:use.
   173 svgtmpl "svg:*", mode="unlink_clone" {
   173 svgtmpl "svg:*", mode="unlink_clone" {
   174     param "seed";
   174     param "seed";
   175     choose {
   175     choose {
   176         // node recursive copy ends when finding a widget
   176         // node recursive copy ends when finding a widget
   177         when "@id = $hmi_elements/@id" {
   177         when "@id = $hmi_widgets/@id" {
   178             // place a clone instead of copying
   178             // place a clone instead of copying
   179             use{
   179             use{
   180                 attrib "xlink:href" > «concat('#',@id)»
   180                 attrib "xlink:href" > «concat('#',@id)»
   181             }
   181             }
   182         }
   182         }