/
typeTagSvgFeTile.go
2664 lines (2497 loc) · 98.1 KB
/
typeTagSvgFeTile.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package html
import (
"github.com/helmutkemper/iotmaker.webassembly/browser/css"
"github.com/helmutkemper/iotmaker.webassembly/interfaces"
"github.com/helmutkemper/iotmaker.webassembly/platform/algorithm"
"image/color"
"log"
"strconv"
"sync"
"syscall/js"
)
// TagSvgFeTile
//
// English:
//
// The <feTile> SVG filter primitive allows to fill a target rectangle with a repeated, tiled pattern of an input image.
// The effect is similar to the one of a <pattern>.
//
// Português:
//
// A primitiva de filtro SVG <feTile> permite preencher um retângulo de destino com um padrão repetido e lado a lado de
// uma imagem de entrada.
// O efeito é semelhante ao de um <pattern>.
type TagSvgFeTile struct {
// id
//
// English:
//
// Unique id, standard html id property.
//
// Português:
//
// Id único, propriedade padrão id do html.
id string
// selfElement
//
// English:
//
// Reference to self element as js.Value.
//
// Português:
//
// Referencia ao próprio elemento na forma de js.Value.
selfElement js.Value
cssClass *css.Class
x int
y int
// listener
//
// English:
//
// The javascript function removeEventListener needs to receive the function passed in addEventListener
//
// Português:
//
// A função javascript removeEventListener necessitam receber a função passada em addEventListener
listener *sync.Map
// drag
// stage
//
// English:
//
// Browser main document reference captured at startup.
//
// Português:
//
// Referencia do documento principal do navegador capturado na inicialização.
stage js.Value
// isDragging
//
// English:
//
// Indicates the process of dragging the element.
//
// Português:
//
// Indica o processo de arrasto do elemento.
isDragging bool
// dragDifX
//
// English:
//
// Used in calculating element drag.
//
// Português:
//
// Usado no cálculo do arrasto de elemento.
dragDifX int
// dragDifX
//
// English:
//
// Used in calculating element drag.
//
// Português:
//
// Usado no cálculo do arrasto de elemento.
dragDifY int
// deltaMovieX
//
// English:
//
// Additional value added in the SetX() function: (x = x + deltaMovieX) and subtracted in the
// GetX() function: (x = x - deltaMovieX).
//
// Português:
//
// Valor adicional adicionado na função SetX(): (x = x + deltaMovieX) e subtraído na função
// GetX(): (x = x - deltaMovieX).
deltaMovieX int
// deltaMovieY
//
// English:
//
// Additional value added in the SetY() function: (y = y + deltaMovieY) and subtracted in the
// GetY() function: (y = y - deltaMovieY).
//
// Português:
//
// Valor adicional adicionado na função SetY(): (y = y + deltaMovieY) e subtraído na função
// GetY(): (y = y - deltaMovieY).
deltaMovieY int
// tween
//
// English:
//
// Easing tween.
//
// Receives an identifier and a pointer of the tween object to be used in case of multiple
// functions.
//
// Português:
//
// Facilitador de interpolação.
//
// Recebe um identificador e um ponteiro do objeto tween para ser usado em caso de múltiplas
// funções.
tween map[string]interfaces.TweenInterface
points *[]algorithm.Point
pointsLen int
rotateDelta float64
}
// Init
//
// English:
//
// Initializes the object correctly.
//
// Português:
//
// Inicializa o objeto corretamente.
func (e *TagSvgFeTile) Init() (ref *TagSvgFeTile) {
e.listener = new(sync.Map)
e.CreateElement()
e.prepareStageReference()
return e
}
func (e *TagSvgFeTile) prepareStageReference() {
e.stage = js.Global().Get("document").Get("body")
}
func (e *TagSvgFeTile) CreateElement() (ref *TagSvgFeTile) {
e.selfElement = js.Global().Get("document").Call("createElementNS", "http://www.w3.org/2000/svg", "feTile")
if e.selfElement.IsUndefined() == true || e.selfElement.IsNull() == true {
log.Print(KNewElementIsUndefined)
return
}
e.selfElement.Call("setAttribute", "xmlns", "http://www.w3.org/2000/svg")
return e
}
func (e *TagSvgFeTile) AppendToStage() (ref *TagSvgFeTile) {
e.stage.Call("appendChild", e.selfElement)
return e
}
func (e *TagSvgFeTile) AppendById(appendId string) (ref *TagSvgFeTile) {
toAppend := js.Global().Get("document").Call("getElementById", appendId)
if toAppend.IsUndefined() == true || toAppend.IsNull() == true {
log.Print(KIdToAppendNotFound, appendId)
return e
}
toAppend.Call("appendChild", e.selfElement)
return e
}
func (e *TagSvgFeTile) AppendToElement(el js.Value) (ref *TagSvgFeTile) {
e.selfElement.Call("appendChild", el)
return e
}
func (e *TagSvgFeTile) Append(elements ...Compatible) (ref *TagSvgFeTile) {
fragment := js.Global().Get("document").Call("createDocumentFragment")
for _, element := range elements {
fragment.Call("appendChild", element.Get())
}
e.selfElement.Call("appendChild", fragment)
return e
}
func (e *TagSvgFeTile) Get() (el js.Value) {
return e.selfElement
}
// #core start --------------------------------------------------------------------------------------------------------
// Id
//
// English:
//
// The id attribute assigns a unique name to an element.
//
// Portuguese
//
// O atributo id atribui um nome exclusivo a um elemento.
func (e *TagSvgFeTile) Id(id string) (ref *TagSvgFeTile) {
e.selfElement.Call("setAttribute", "id", id)
return e
}
// Lang
//
// English:
//
// The lang attribute specifies the primary language used in contents and attributes containing text content of
// particular elements.
//
// Input:
// value: specifies the primary language used in contents
// const KLanguage... (e.g. KLanguageEnglish)
//
// There is also an xml:lang attribute (with namespace). If both of them are defined, the one with namespace is used and
// the one without is ignored.
//
// In SVG 1.1 there was a lang attribute defined with a different meaning and only applying to <glyph> elements.
// That attribute specified a list of languages according to RFC 5646: Tags for Identifying Languages
// (also known as BCP 47). The glyph was meant to be used if the xml:lang attribute exactly matched one of the languages
// given in the value of this parameter, or if the xml:lang attribute exactly equaled a prefix of one of the languages
// given in the value of this parameter such that the first tag character following the prefix was "-".
//
// Português:
//
// O atributo lang especifica o idioma principal usado em conteúdos e atributos que contêm conteúdo de texto de
// elementos específicos.
//
// Entrada:
// value: especifica o idioma principal usado no conteúdo
// const KLanguage... (ex. KLanguagePortuguese)
//
// Há também um atributo xml:lang (com namespace). Se ambos estiverem definidos, aquele com namespace será usado e o
// sem namespace será ignorado.
//
// No SVG 1.1 havia um atributo lang definido com um significado diferente e aplicando-se apenas aos elementos <glyph>.
// Esse atributo especificou uma lista de idiomas de acordo com a RFC 5646: Tags for Identification Languages
// (também conhecido como BCP 47). O glifo deveria ser usado se o atributo xml:lang correspondesse exatamente a um dos
// idiomas fornecidos no valor desse parâmetro, ou se o atributo xml:lang fosse exatamente igual a um prefixo de um dos
// idiomas fornecidos no valor desse parâmetro de modo que o primeiro caractere de tag após o prefixo fosse "-".
func (e *TagSvgFeTile) Lang(value interface{}) (ref *TagSvgFeTile) {
if converted, ok := value.(Language); ok {
e.selfElement.Call("setAttribute", "lang", converted.String())
return e
}
e.selfElement.Call("setAttribute", "lang", value)
return e
}
// Tabindex
//
// English:
//
// The tabindex attribute allows you to control whether an element is focusable and to define the relative order of the
// element for the purposes of sequential focus navigation.
//
// Português:
//
// O atributo tabindex permite controlar se um elemento é focalizável e definir a ordem relativa do elemento para fins
// de navegação de foco sequencial.
func (e *TagSvgFeTile) Tabindex(value int) (ref *TagSvgFeTile) {
e.selfElement.Call("setAttribute", "tabindex", value)
return e
}
// XmlLang
//
// English:
//
// The xml:lang attribute specifies the primary language used in contents and attributes containing text content of
// particular elements.
//
// Input:
// value: specifies the primary language
// const: KLanguage... (e.g. KLanguageEnglish)
// any other type: interface{}
//
// It is a universal attribute allowed in all XML dialects to mark up the natural human language that an element
// contains.
//
// There is also a lang attribute (without namespace). If both of them are defined, the one with namespace is used and
// the one without is ignored.
//
// Português:
//
// O atributo xml:lang especifica o idioma principal usado em conteúdos e atributos que contêm conteúdo de texto de
// elementos específicos.
//
// Entrada:
// value: especifica o idioma principal
// const: KLanguage... (e.g. KLanguagePortuguese)
// qualquer outro tipo: interface{}
//
// É um atributo universal permitido em todos os dialetos XML para marcar a linguagem humana natural que um elemento
// contém.
//
// Há também um atributo lang (sem namespace). Se ambos estiverem definidos, aquele com namespace será usado e o sem
// namespace será ignorado.
func (e *TagSvgFeTile) XmlLang(value interface{}) (ref *TagSvgFeTile) {
if converted, ok := value.(Language); ok {
e.selfElement.Call("setAttribute", "xml:lang", converted.String())
return e
}
e.selfElement.Call("setAttribute", "xml:lang", value)
return e
}
// #core end ----------------------------------------------------------------------------------------------------------
// #presentation start ------------------------------------------------------------------------------------------------
// BaselineShift
//
// English:
//
// The baseline-shift attribute allows repositioning of the dominant-baseline relative to the dominant-baseline of the
// parent text content element. The shifted object might be a sub- or superscript.
//
// Input:
// baselineShift: allows repositioning of the dominant-baseline relative to the dominant-baseline of the parent text
// content element.
// float32: 0.05 = "5%"
// string: "5%"
// consts KSvgBaselineShift... (e.g. KSvgBaselineShiftAuto)
//
// Notes:
// * As a presentation attribute baseline-shift can be used as a CSS property.
// * This property is going to be deprecated and authors are advised to use vertical-align instead.
//
// Português:
//
// O atributo baseline-shift permite o reposicionamento da linha de base dominante em relação à linha de base dominante
// do elemento de conteúdo de texto pai. O objeto deslocado pode ser um sub ou sobrescrito.
//
// Input:
// baselineShift: permite o reposicionamento da linha de base dominante em relação à linha de base dominante do
// elemento de conteúdo de texto pai.
// float32: 0.05 = "5%"
// string: "5%"
// consts KSvgBaselineShift... (ex. KSvgBaselineShiftAuto)
//
// Notas:
// * Como atributo de apresentação, baseline-shift pode ser usado como propriedade CSS.
// * Essa propriedade será preterida e os autores são aconselhados a usar alinhamento vertical.
func (e *TagSvgFeTile) BaselineShift(baselineShift interface{}) (ref *TagSvgFeTile) {
if converted, ok := baselineShift.(SvgBaselineShift); ok {
e.selfElement.Call("setAttribute", "baseline-shift", converted.String())
return e
}
if converted, ok := baselineShift.(float32); ok {
p := strconv.FormatFloat(100.0*float64(converted), 'g', -1, 64) + "%"
e.selfElement.Call("setAttribute", "baseline-shift", p)
return e
}
e.selfElement.Call("setAttribute", "baseline-shift", baselineShift)
return e
}
// ClipPath
//
// English:
//
// It binds the element it is applied to with a given <clipPath> element.
//
// Input:
// clipPath: the element it is applied
// (e.g. "url(#myClip)", "circle() fill-box", "circle() stroke-box" or "circle() view-box")
//
// Português:
//
// Ele associa o elemento ao qual é aplicado a um determinado elemento <clipPath>.
//
// Entrada:
// clipPath: elemento ao qual é aplicado
// (ex. "url(#myClip)", "circle() fill-box", "circle() stroke-box" ou "circle() view-box")
func (e *TagSvgFeTile) ClipPath(clipPath string) (ref *TagSvgFeTile) {
e.selfElement.Call("setAttribute", "clip-path", clipPath)
return e
}
// ClipRule
//
// English:
//
// It indicates how to determine what side of a path is inside a shape in order to know how a <clipPath> should clip
// its target.
//
// Input:
// value: side of a path
// const: KSvgClipRule... (e.g. KSvgClipRuleNonzero)
// any other type: interface{}
//
// Português:
//
// Ele indica como determinar qual lado de um caminho está dentro de uma forma para saber como um <clipPath> deve
// recortar seu destino.
//
// Input:
// value: lado de um caminho
// const: KSvgClipRule... (e.g. KSvgClipRuleNonzero)
// qualquer outro tipo: interface{}
func (e *TagSvgFeTile) ClipRule(value interface{}) (ref *TagSvgFeTile) {
if converted, ok := value.(SvgClipRule); ok {
e.selfElement.Call("setAttribute", "clip-rule", converted.String())
return e
}
e.selfElement.Call("setAttribute", "clip-rule", value)
return e
}
// Color
//
// English:
//
// It provides a potential indirect value (currentcolor) for the fill, stroke, stop-color, flood-color and
// lighting-color presentation attributes.
//
// Input:
// value: potential indirect value of color
// string: e.g. "black"
// factory: e.g. factoryColor.NewYellow()
// RGBA: e.g. color.RGBA{R: 0xff, G: 0xff, B: 0x00, A: 0xff}
// any other type: interface{}
//
// Notes:
// * As a presentation attribute, color can be used as a CSS property. See CSS color for further information.
//
// Português:
//
// Ele fornece um valor indireto potencial (currentcolor) para os atributos de apresentação de preenchimento, traçado,
// cor de parada, cor de inundação e cor de iluminação.
//
// Entrada:
// value: valor indireto potencial da cor
// string: ex. "black"
// factory: ex. factoryColor.NewYellow()
// RGBA: ex. color.RGBA{R: 0xff, G: 0xff, B: 0x00, A: 0xff}
// qualquer outro tipo: interface{}
//
// Notas:
// * Como atributo de apresentação, a cor pode ser usada como propriedade CSS. Veja cor CSS para mais informações.
func (e *TagSvgFeTile) Color(value interface{}) (ref *TagSvgFeTile) {
if converted, ok := value.(color.RGBA); ok {
e.selfElement.Call("setAttribute", "color", RGBAToJs(converted))
return e
}
e.selfElement.Call("setAttribute", "color", value)
return e
}
// ColorInterpolation
//
// English:
//
// The color-interpolation attribute specifies the color space for gradient interpolations, color animations, and alpha
// compositing.
//
// The color-interpolation property chooses between color operations occurring in the sRGB color space or in a (light
// energy linear) linearized RGB color space. Having chosen the appropriate color space, component-wise linear
// interpolation is used.
//
// When a child element is blended into a background, the value of the color-interpolation property on the child
// determines the type of blending, not the value of the color-interpolation on the parent.
// For gradients which make use of the href or the deprecated xlink:href attribute to reference another gradient, the
// gradient uses the property's value from the gradient element which is directly referenced by the fill or stroke
// property. When animating colors, color interpolation is performed according to the value of the color-interpolation
// property on the element being animated.
//
// Notes:
// * For filter effects, the color-interpolation-filters property controls which color space is used.
// * As a presentation attribute, color-interpolation can be used as a CSS property.
//
// Português:
//
// O atributo color-interpolation especifica o espaço de cores para interpolações de gradiente, animações de cores e
// composição alfa.
//
// A propriedade de interpolação de cores escolhe entre operações de cores que ocorrem no espaço de cores sRGB ou em um
// espaço de cores RGB linearizado (energia de luz linear). Tendo escolhido o espaço de cor apropriado, a interpolação
// linear de componentes é usada.
//
// Quando um elemento filho é mesclado em um plano de fundo, o valor da propriedade color-interpolation no filho
// determina o tipo de mesclagem, não o valor da interpolação de cores no pai.
// Para gradientes que usam o href ou o atributo obsoleto xlink:href para referenciar outro gradiente, o gradiente usa
// o valor da propriedade do elemento gradiente que é diretamente referenciado pela propriedade fill ou stroke.
// Ao animar cores, à interpolação de cores é executada de acordo com o valor da propriedade color-interpolation no
// elemento que está sendo animado.
//
// Notas:
// * Para efeitos de filtro, a propriedade color-interpolation-filters controla qual espaço de cor é usado.
// * Como atributo de apresentação, a interpolação de cores pode ser usada como uma propriedade CSS.
func (e *TagSvgFeTile) ColorInterpolation(value interface{}) (ref *TagSvgFeTile) {
if converted, ok := value.(color.RGBA); ok {
e.selfElement.Call("setAttribute", "color-interpolation", RGBAToJs(converted))
return e
}
e.selfElement.Call("setAttribute", "color-interpolation", value)
return e
}
// ColorInterpolationFilters
//
// English:
//
// The color-interpolation-filters attribute specifies the color space for imaging operations performed via filter
// effects.
//
// Notes:
// * This property just has an affect on filter operations. Therefore, it has no effect on filter primitives like
// <feOffset>, <feImage>, <feTile> or <feFlood>;
// * color-interpolation-filters has a different initial value than color-interpolation. color-interpolation-filters
// has an initial value of linearRGB, whereas color-interpolation has an initial value of sRGB. Thus, in the
// default case, filter effects operations occur in the linearRGB color space, whereas all other color
// interpolations occur by default in the sRGB color space;
// * It has no affect on filter functions, which operate in the sRGB color space;
// * As a presentation attribute, color-interpolation-filters can be used as a CSS property.
//
// Português:
//
// O atributo color-interpolation-filters especifica o espaço de cores para operações de imagem realizadas por meio de
// efeitos de filtro.
//
// Notas:
// * Esta propriedade afeta apenas as operações de filtro. Portanto, não tem efeito em primitivos de filtro como
// <feOffset>, <feImage>, <feTile> ou <feFlood>.
// * color-interpolation-filters tem um valor inicial diferente de color-interpolation. color-interpolation-filters
// tem um valor inicial de linearRGB, enquanto color-interpolation tem um valor inicial de sRGB. Assim, no caso
// padrão, as operações de efeitos de filtro ocorrem no espaço de cores linearRGB, enquanto todas as outras
// interpolações de cores ocorrem por padrão no espaço de cores sRGB.
// * Não afeta as funções de filtro, que operam no espaço de cores sRGB.
// * Como atributo de apresentação, os filtros de interpolação de cores podem ser usados como uma propriedade CSS.
func (e *TagSvgFeTile) ColorInterpolationFilters(value interface{}) (ref *TagSvgFeTile) {
if converted, ok := value.(color.RGBA); ok {
e.selfElement.Call("setAttribute", "color-interpolation-filters", RGBAToJs(converted))
return e
}
e.selfElement.Call("setAttribute", "color-interpolation-filters", value)
return e
}
// Cursor
//
// English:
//
// The cursor attribute specifies the mouse cursor displayed when the mouse pointer is over an element.
//
// This attribute behaves exactly like the css cursor property except that if the browser supports the <cursor> element,
// you should be able to use it with the <funciri> notation.
//
// As a presentation attribute, it also can be used as a property directly inside a CSS stylesheet, see css cursor for
// further information.
//
// Português:
//
// O atributo cursor especifica o cursor do mouse exibido quando o ponteiro do mouse está sobre um elemento.
//
// Este atributo se comporta exatamente como a propriedade cursor css, exceto que, se o navegador suportar o elemento
// <cursor>, você poderá usá-lo com a notação <funciri>.
//
// Como atributo de apresentação, também pode ser usado como propriedade diretamente dentro de uma folha de estilo CSS,
// veja cursor css para mais informações.
func (e *TagSvgFeTile) Cursor(cursor SvgCursor) (ref *TagSvgFeTile) {
e.selfElement.Call("setAttribute", "cursor", cursor.String())
return e
}
// Direction
//
// English:
//
// The direction attribute specifies the inline-base direction of a <text> or <tspan> element. It defines the start
// and end points of a line of text as used by the text-anchor and inline-size properties. It also may affect the
// direction in which characters are positioned if the unicode-bidi property's value is either embed or bidi-override.
//
// It applies only to glyphs oriented perpendicular to the inline-base direction, which includes the usual case of
// horizontally-oriented Latin or Arabic text and the case of narrow-cell Latin or Arabic characters rotated 90 degrees
// clockwise relative to a top-to-bottom inline-base direction.
//
// In many cases, the bidirectional Unicode algorithm produces the desired result automatically, so this attribute
// doesn't need to be specified in those cases. For other cases, such as when using right-to-left languages, it may be
// sufficient to add the direction attribute to the outermost <svg> element, and allow that direction to inherit to all
// text elements:
//
// Notes:
// * As a presentation attribute, direction can be used as a CSS property. See css direction for further
// information.
//
// Português:
//
// O atributo direction especifica a direção da base embutida de um elemento <text> ou <tspan>. Ele define os pontos
// inicial e final de uma linha de texto conforme usado pelas propriedades text-anchor e inline-size.
// Também pode afetar a direção na qual os caracteres são posicionados se o valor da propriedade unicode-bidi for
// incorporado ou substituído por bidi.
//
// Aplica-se apenas a glifos orientados perpendicularmente à direção da base em linha, que inclui o caso usual de texto
// latino ou árabe orientado horizontalmente e o caso de caracteres latinos ou árabes de célula estreita girados 90
// graus no sentido horário em relação a um texto de cima para baixo direção de base em linha.
//
// Em muitos casos, o algoritmo Unicode bidirecional produz o resultado desejado automaticamente, portanto, esse
// atributo não precisa ser especificado nesses casos. Para outros casos, como ao usar idiomas da direita para a
// esquerda, pode ser suficiente adicionar o atributo direction ao elemento <svg> mais externo e permitir que essa
// direção herde todos os elementos de texto:
//
// Notas:
// * Como atributo de apresentação, a direção pode ser usada como uma propriedade CSS. Veja a direção do CSS para
// mais informações.
func (e *TagSvgFeTile) Direction(direction SvgDirection) (ref *TagSvgFeTile) {
e.selfElement.Call("setAttribute", "direction", direction.String())
return e
}
// Display
//
// English:
//
// The display attribute lets you control the rendering of graphical or container elements.
//
// Input:
// value: control the rendering of graphical or container elements
// nil: display="none"
// const: KSvgDisplay... (e.g. KSvgDisplayBlock)
// any other type: interface{}
//
// A value of display="none" indicates that the given element and its children will not be rendered. Any value other
// than none or inherit indicates that the given element will be rendered by the browser.
//
// When applied to a container element, setting display to none causes the container and all of its children to be
// invisible; thus, it acts on groups of elements as a group. This means that any child of an element with
// display="none" will never be rendered even if the child has a value for display other than none.
//
// When the display attribute is set to none, then the given element does not become part of the rendering tree. It has
// implications for the <tspan>, <tref>, and <altGlyph> elements, event processing, for bounding box calculations and
// for calculation of clipping paths:
//
// * If display is set to none on a <tspan>, <tref>, or <altGlyph> element, then the text string is ignored for the
// purposes of text layout.
// * Regarding events, if display is set to none, the element receives no events.
// * The geometry of a graphics element with display set to none is not included in bounding box and clipping paths
// calculations.
//
// The display attribute only affects the direct rendering of a given element, whereas it does not prevent elements
// from being referenced by other elements. For example, setting it to none on a <path> element will prevent that
// element from getting rendered directly onto the canvas, but the <path> element can still be referenced by a
// <textPath> element; furthermore, its geometry will be used in text-on-a-path processing even if the <path> has a
// display value of none.
//
// This attribute also affects direct rendering into offscreen canvases, such as occurs with masks or clip paths. Thus,
// setting display="none" on a child of a <mask> will prevent the given child element from being rendered as part of the
// mask. Similarly, setting display="none" on a child of a <clipPath> element will prevent the given child element from
// contributing to the clipping path.
//
// Notes:
// * As a presentation attribute, display can be used as a CSS property. See css display for further information.
//
// Português:
//
// O atributo display permite controlar a renderização de elementos gráficos ou de contêiner.
//
// Entrada:
// value: controlar a renderização de elementos gráficos ou de contêiner
// nil: display="none"
// const: KSvgDisplay... (ex. KSvgDisplayBlock)
// qualquer outro tipo: interface{}
//
// Um valor de display="none" indica que o elemento fornecido e seus filhos não serão renderizados. Qualquer valor
// diferente de none ou herdar indica que o elemento fornecido será renderizado pelo navegador.
//
// Quando aplicado a um elemento de contêiner, definir display como none faz com que o contêiner e todos os seus filhos
// fiquem invisíveis; assim, atua em grupos de elementos como um grupo. Isso significa que qualquer filho de um elemento
// com display="none" nunca será renderizado, mesmo que o filho tenha um valor para exibição diferente de none.
//
// Quando o atributo display é definido como none, o elemento fornecido não se torna parte da árvore de renderização.
// Tem implicações para os elementos <tspan>, <tref> e <altGlyph>, processamento de eventos, para cálculos de caixa
// delimitadora e para cálculo de caminhos de recorte:
// * Se display for definido como none em um elemento <tspan>, <tref> ou <altGlyph>, a string de texto será ignorada
// para fins de layout de texto.
// * Com relação aos eventos, se display estiver definido como none, o elemento não recebe eventos.
// * A geometria de um elemento gráfico com exibição definida como nenhum não é incluída nos cálculos da caixa
// delimitadora e dos caminhos de recorte.
//
// O atributo display afeta apenas a renderização direta de um determinado elemento, mas não impede que os elementos
// sejam referenciados por outros elementos. Por exemplo, defini-lo como none em um elemento <path> impedirá que esse
// elemento seja renderizado diretamente na tela, mas o elemento <path> ainda pode ser referenciado por um elemento
// <textPath>; além disso, sua geometria será usada no processamento de texto em um caminho, mesmo que o <caminho>
// tenha um valor de exibição de nenhum.
//
// Esse atributo também afeta a renderização direta em telas fora da tela, como ocorre com máscaras ou caminhos de
// clipe. Assim, definir display="none" em um filho de uma <mask> impedirá que o elemento filho fornecido seja
// renderizado como parte da máscara. Da mesma forma, definir display="none" em um filho de um elemento <clipPath>
// impedirá que o elemento filho fornecido contribua para o caminho de recorte.
//
// Notas:
// * Como atributo de apresentação, display pode ser usado como propriedade CSS. Consulte a exibição css para obter
// mais informações.
func (e *TagSvgFeTile) Display(value interface{}) (ref *TagSvgFeTile) {
if value == nil {
e.selfElement.Call("setAttribute", "display", "none")
return e
}
if converted, ok := value.(SvgDisplay); ok {
e.selfElement.Call("setAttribute", "display", converted.String())
return e
}
e.selfElement.Call("setAttribute", "display", value)
return e
}
// DominantBaseline
//
// English:
//
// The dominant-baseline attribute specifies the dominant baseline, which is the baseline used to align the box's text
// and inline-level contents. It also indicates the default alignment baseline of any boxes participating in baseline
// alignment in the box's alignment context.
//
// It is used to determine or re-determine a scaled-baseline-table. A scaled-baseline-table is a compound value with
// three components:
//
// 1. a baseline-identifier for the dominant-baseline,
// 2. a baseline-table, and
// 3. a baseline-table font-size.
//
// Some values of the property re-determine all three values. Others only re-establish the baseline-table font-size.
// When the initial value, auto, would give an undesired result, this property can be used to explicitly set the desired
// scaled-baseline-table.
//
// If there is no baseline table in the nominal font, or if the baseline table lacks an entry for the desired baseline,
// then the browser may use heuristics to determine the position of the desired baseline.
//
// Notes:
// * As a presentation attribute, dominant-baseline can be used as a CSS property.
//
// Português:
//
// O atributo linha de base dominante especifica a linha de base dominante, que é a linha de base usada para alinhar o
// texto da caixa e o conteúdo do nível embutido. Também indica a linha de base de alinhamento padrão de todas as caixas
// que participam do alinhamento da linha de base no contexto de alinhamento da caixa.
//
// Ele é usado para determinar ou re-determinar uma tabela de linha de base dimensionada. Uma tabela de linha de base
// dimensionada é um valor composto com três componentes:
//
// 1. um identificador de linha de base para a linha de base dominante,
// 2. uma tabela de linha de base, e
// 3. um tamanho de fonte da tabela de linha de base.
//
// Alguns valores da propriedade redeterminam todos os três valores. Outros apenas restabelecem o tamanho da fonte da
// tabela de linha de base. Quando o valor inicial, auto, daria um resultado indesejado, essa propriedade pode ser usada
// para definir explicitamente a tabela de linha de base dimensionada desejada.
//
// Se não houver nenhuma tabela de linha de base na fonte nominal, ou se a tabela de linha de base não tiver uma entrada
// para a linha de base desejada, o navegador poderá usar heurística para determinar a posição da linha de base
// desejada.
//
// Notas:
// * Como atributo de apresentação, a linha de base dominante pode ser usada como uma propriedade CSS.
func (e *TagSvgFeTile) DominantBaseline(dominantBaseline SvgDominantBaseline) (ref *TagSvgFeTile) {
e.selfElement.Call("setAttribute", "dominant-baseline", dominantBaseline.String())
return e
}
// Fill
//
// English:
//
// The fill attribute has two different meanings. For shapes and text it's a presentation attribute that defines the
// color (or any SVG paint servers like gradients or patterns) used to paint the element;
//
// for animation it defines the final state of the animation.
//
// Input:
// value: the fill value
// nil: fill="none"
// string: e.g. "black"
// factory: e.g. factoryColor.NewYellow()
// RGBA: e.g. color.RGBA{R: 0xff, G: 0xff, B: 0x00, A: 0xff}
// any other type: interface{}
//
// Português:
//
// O atributo fill tem dois significados diferentes. Para formas e texto, é um atributo de apresentação que define a
// cor (ou qualquer servidor de pintura SVG, como gradientes ou padrões) usado para pintar o elemento;
//
// para animação, define o estado final da animação.
//
// Input:
// value: the fill value
// nil: fill="none"
// string: e.g. "black"
// factory: e.g. factoryColor.NewYellow()
// RGBA: e.g. color.RGBA{R: 0xff, G: 0xff, B: 0x00, A: 0xff}
// qualquer outro tipo: interface{}
func (e *TagSvgFeTile) Fill(value interface{}) (ref *TagSvgFeTile) {
if value == nil {
e.selfElement.Call("setAttribute", "fill", "none")
return e
}
if converted, ok := value.(color.RGBA); ok {
e.selfElement.Call("setAttribute", "fill", RGBAToJs(converted))
return e
}
e.selfElement.Call("setAttribute", "fill", value)
return e
}
// FillOpacity
//
// English:
//
// The fill-opacity attribute is a presentation attribute defining the opacity of the paint server (color, gradient,
// pattern, etc) applied to a shape.
//
// Input:
// value: defining the opacity of the paint
// float32: 1.0 = "100%"
// any other type: interface{}
//
// Notes:
// *As a presentation attribute fill-opacity can be used as a CSS property.
//
// Portuguese
//
// O atributo fill-opacity é um atributo de apresentação que define a opacidade do servidor de pintura (cor, gradiente,
// padrão etc.) aplicado a uma forma.
//
// Entrada:
// value: definindo a opacidade da tinta
// float32: 1.0 = "100%"
// qualquer outro tipo: interface{}
//
// Notes:
// *As a presentation attribute fill-opacity can be used as a CSS property.
func (e *TagSvgFeTile) FillOpacity(value interface{}) (ref *TagSvgFeTile) {
if converted, ok := value.(float32); ok {
p := strconv.FormatFloat(100.0*float64(converted), 'g', -1, 64) + "%"
e.selfElement.Call("setAttribute", "fill-opacity", p)
return e
}
e.selfElement.Call("setAttribute", "fill-opacity", value)
return e
}
// FillRule
//
// English:
//
// The fill-rule attribute is a presentation attribute defining the algorithm to use to determine the inside part of
// a shape.
//
// Notes:
// * As a presentation attribute, fill-rule can be used as a CSS property.
//
// Portuguese
//
// O atributo fill-rule é um atributo de apresentação que define o algoritmo a ser usado para determinar a parte
// interna de uma forma.
//
// Notas:
// * Como atributo de apresentação, fill-rule pode ser usado como uma propriedade CSS.
func (e *TagSvgFeTile) FillRule(fillRule SvgFillRule) (ref *TagSvgFeTile) {
e.selfElement.Call("setAttribute", "fill-rule", fillRule.String())
return e
}
// Filter
//
// English:
//
// The filter attribute specifies the filter effects defined by the <filter> element that shall be applied to its
// element.
//
// Notes:
// * As a presentation attribute, filter can be used as a CSS property. See css filter for further information.
//
// Portuguese
//
// O atributo filter especifica os efeitos de filtro definidos pelo elemento <filter> que devem ser aplicados ao seu
// elemento.
//
// Notas:
// * Como atributo de apresentação, o filtro pode ser usado como propriedade CSS. Veja filtro css para mais
// informações.
func (e *TagSvgFeTile) Filter(filter string) (ref *TagSvgFeTile) {
e.selfElement.Call("setAttribute", "filter", filter)
return e
}
// FloodColor
//
// English:
//
// The flood-color attribute indicates what color to use to flood the current filter primitive subregion.
//
// Notes:
// * As a presentation attribute, flood-color can be used as a CSS property.
//
// Portuguese
//
// The flood-color attribute indicates what color to use to flood the current filter primitive subregion.
//
// Notes:
// * As a presentation attribute, flood-color can be used as a CSS property.
func (e *TagSvgFeTile) FloodColor(floodColor interface{}) (ref *TagSvgFeTile) {
if converted, ok := floodColor.(color.RGBA); ok {
e.selfElement.Call("setAttribute", "flood-color", RGBAToJs(converted))
return e
}
e.selfElement.Call("setAttribute", "flood-color", floodColor)
return e
}
// FloodOpacity
//
// English:
//
// The flood-opacity attribute indicates the opacity value to use across the current filter primitive subregion.
//
// Notes:
// * As a presentation attribute, flood-opacity can be used as a CSS property.
//
// Portuguese
//
// O atributo flood-opacity indica o valor de opacidade a ser usado na sub-região primitiva de filtro atual.
//
// Notas:
// * Como atributo de apresentação, a opacidade de inundação pode ser usada como uma propriedade CSS.
func (e *TagSvgFeTile) FloodOpacity(floodOpacity float64) (ref *TagSvgFeTile) {
e.selfElement.Call("setAttribute", "flood-opacity", floodOpacity)
return e
}
// FontFamily
//
// English:
//
// The font-family attribute indicates which font family will be used to render the text, specified as a prioritized
// list of font family names and/or generic family names.
//
// Notes:
// * As a presentation attribute, font-family can be used as a CSS property. See the css font-family property for
// more information.
//
// Portuguese
//