-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindow.r
1661 lines (1361 loc) · 46.7 KB
/
window.r
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
REBOL [
; -- Core Header attributes --
title: "Glass window"
file: %window.r
version: 1.2.6
date: 2013-11-20
author: "Maxim Olivier-Adlhoch"
purpose: {Default window manager for Glass, can be subclassed and changed.}
web: http://www.revault.org/modules/window.rmrk
source-encoding: "Windows-1252"
note: {slim Library Manager is Required to use this module.}
; -- slim - Library Manager --
slim-name: 'window
slim-version: 1.2.2
slim-prefix: none
slim-update: http://www.revault.org/downloads/modules/window.r
; -- Licensing details --
copyright: "Copyright © 2013 Maxim Olivier-Adlhoch"
license-type: "Apache License v2.0"
license: {Copyright © 2013 Maxim Olivier-Adlhoch
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.}
;- / history
history: {
v1.2.5 - 2013-09-18
-License changed to Apache v2
v1.2.6 - 2013-11-20
- added anti-aliasing to backplane rendering of window.
- overhauled the drag and drop event handling.
- added 'PRE-RELEASE mouse button event
- fixed MANY drag and drop related bugs.
- added 'DROP-BG event for releasing the mouse on background (window)
}
;- \ history
;- / documentation
documentation: {
currently, windows are styles and derived from viewports.
Windows implement some of the event handling like focus and window close/resize etc.
The window is one of the three stream levels, it takes some of the low-level events
and converts them to higher-level events like selections, hover and such.
currently, the window is also where keystrokes are converted to logical events, these
events are used directly by the field and other marbles.
The window also handles overlay events and the input blocker. The input blocker basically
makes the whole window impervious to mouse events, leaving only the overlay to manage
mouse events.
One big limitation in this release of GLASS is the inability to have more than one active
GLASS window per application. The reasons are quite complex and event related.
This limitation will be lifted in one of the next releases, but some more development of
the streaming and timer event is required to properly map incomming events to opened windows.
Some of this code is currently managed in the basic Event handler which is global to the
whole application. Another limitation is that it is a bit complex to properly handle
the window title right now. these things will be taken care of as the system goes out of
prototype stage.
Eventually we will have different window styles like dialog and requestors, etc.
}
;- \ documentation
]
slim/register [
;- LIBS
epoxy: slim/open 'epoxy none
glob-lib: slim/open/expose 'glob none [!glob to-color]
liquid-lib: slim/open/expose 'liquid none [
!plug
dirty?
liquify*: liquify
content*: content
fill*: fill
link*: link
unlink*: unlink
dirty*: dirty
detach*: detach
process*: --process
]
sillica-lib: sl: slim/open/expose 'sillica none [
master-stylesheet
alloc-marble
regroup-specification
list-stylesheet
collect-style
relative-marble?
prim-bevel
prim-x
prim-label
do-event
]
epoxy-lib: slim/open/expose 'epoxy none [!box-intersection]
frame-lib: slim/open 'frame none
viewport-lib: slim/open 'viewport none
event-lib: slim/open/expose 'event none [
queue-event
clone-event
coordinates-to-offset
marble-at-coordinates
!event
dispatch
]
slim/open/expose 'utils-script none [get-application-title]
;--------------------------------------------------------
;-
;- GLOBALS
;
item: none
default-window-face: make face []
foreach item next first default-window-face [
set in default-window-face item none
]
default-window-face/color: white
;--------------------------------------------------------
;-
;- !WINDOW [ ]
;
; most of the window is the same as a frame.
;
; windows have extra event managing properties & rebol/view window stuff.
!window: make viewport-lib/!viewport [
;--------------------------
;- full-screen?:
;
; stores if this window was displayed in full-screen, is usually setup during
; initial call to display on main window of application
;
; this cannot be changed later via any glass code,
; ;
; edit this and any other required data at your own risk ( check the code for display() )
;--------------------------
full-screen?: false
;- aspects[ ]
aspects: make aspects [
;- offset:
offset: 100x100
;- label:
label: any [get-application-title "Untitled"]
;- block-input?:
; when set to true, the fg-glob's backplane will fill the whole window and send
; a user specified message (usually specified from the marble style) down the queue.
block-input?: none
;- color:
color: theme-window-color
]
;- material[ ]
; same as a frame
material: make material [
;- title:
title: none
]
;- refresh-interval:
;
; milliseconds between refresh
;
; each window may have its own interval
;
; because of view's timer limitations, any value lower than 30 is actually
; going to equate to ~ 30 since we only receive ~30 timer events per second from
; view to begin with.
;
; the default is pretty high (20 frames/second) , its a good idea to
; lower it when:
; viewing large windows
; frames contains many marbles
; many opened window at a time
; machine is too slow
;
; note that if nothing changes in the viewport, no actual refresh will occur.
; a side-effect of liquid's lazyness.
refresh-interval: 20
;- next-refresh:
; an internal value managed by glass which acts as the trigger for the next
; possible refresh.
;
; this is managed by the core-glass-handler
;
; discovered that the time ticks can go to negative values (basically a side-effect when it goes beyond 31 bits)
next-refresh: -1 * power 2 31
;- auto-silence?:
; if true, the window's stream automatically disables
; refresh of a window when it is deactivated.
;
; this means only one window will actively refresh.
auto-silence?: true
;- layout-method:
; the window is a column by default, edit before wrapping a frame.
layout-method: 'column
;--------------------------
;- title?:
;
; do we show a window title?
;--------------------------
title?: true
;--------------------------
;- resize?:
;
;--------------------------
resize?: true
;- view-face:
; stores the face which is added to screen face
view-face: none
;- stream:
; stores the input stream processors.
;
; this is a simple block containing functions which are executed in sequence, which are
; allowed to interfere with the events generated for that window.
;
; when events first come in, they are converted to an !event. This object is then
; used within GLASS instead of the view event!.
stream: none
;- backplug:
; a plug which connects to our glob's layer 0 (the backplane layer).
;
; the backplane is used to very quickly determine what face is under the mouse.
;
; only the top most glob is available, but the shape of the glob's backplane needs not be
; the same as the visual layers...
;
; this means that you can very easily disable a marble's mouse interaction
; just by leaving its backplane draw block empty.
;
backplug: none
;- backplane:
; rendered image of the backplug
backplane: none
;--------------------------
;- raster:
;
; rendered foreground
;--------------------------
raster: none
;--------------------------
;- clip-regions:
;
; one or more regions which are used to clip the display
;--------------------------
clip-regions: []
;--------------------------
;- rt-globs:
;
; link any glob to this in order to shortcut refresh into only redrawing this
; instead of the whole display
;--------------------------
rt-globs: none
;- overlay:
; globs which are draw over all else, this ignores clipping.
; they are used to show popups, menus, etc.
;
; when the overlay is visible, the window may block input to all other globs,
; and will trigger an event of your choice when bg is clicked.
;
; queuing a 'REMOVE-OVERLAY message, removes the overlay from the display and
; disables the input blocker
;
; this is a liquified glob which is compatible with glass, when the overlay is displayed.
; otherwise its none.
overlay: none
;--------------------------
;- last-draw-clipped?:
;
;
;--------------------------
last-draw-clipped?: false
;- triggered-events:
;
; this block is responsible for storing pre-defined event which are triggered
; when events happen relative to the window.
;
; for now only mouse down really makes sense.
;
; these events are queued by the TRIGGER-EVENTS() function.
;
; note that not all events are managed by trigger-event right now... that might change.
;
triggered-events: compose/deep [
; under normal circumstances these are triggered (queued)
normal [
pointer-press [
(
make !event [
action: 'unfocus
]
)
]
]
; when an overlay is being used and the input-blocker is enabled, these events are
; sent instead.
;
; these events change often, since overlay events usually
; are set by the code generating the overlay itself.
;
; event/viewport: will be set by trigger-events()
overlay [
pointer-press [
(
make !event [
action: 'remove-overlay
]
)
]
]
]
;- .
;-----------------------------------------------------------------------------------------------------------
;
;- FUNCTIONS
;
;-----------------------------------------------------------------------------------------------------------
; since the number of windows is limited, and it's a rather high-level
; marble, we add the various window control functions
; in the plug directly, to make it easier to use.
;-----------------
;- display()
; make the window visible on the screen.
;-----------------
display: func [
/center "centers the window in screen"
/local screen off
][
vin [{display()}]
unless visible? [
screen: system/view/screen-face
either full-screen? [
view-face/offset: 0x0
view-face/rate: 1 ; forces timer events in wake-event
view-face/options: [no-border no-title]
view-face/size: screen/size
fill* material/dimension view-face/size
][
view-face/size: content* material/dimension
if center [
;off: content* aspects/offset
fill* aspects/offset ((screen/size - view-face/size / 2) )
]
view-face/offset: content* aspects/offset
view-face/rate: 1 ; forces timer events in wake-event
]
view-face/options: copy []
if resize? [
append view-face/options 'resize
]
unless title? [
append view-face/options 'no-title
]
view-face/text: any [
content* self/aspects/label
all [system/script/header system/script/title]
view-face/text
copy ""
]
vprint ["window size: " content* material/dimension]
vprint ["window title: " view-face/text]
vprint ["window offset: " content* aspects/offset]
append system/view/screen-face/pane view-face
show screen
]
vout
]
;-----------------
;- hide()
;-----------------
hide: func [
][
vin [{hide()}]
if visible? [
remove find system/view/screen-face/pane view-face
show system/view/screen-face
]
vout
]
;-----------------
;- visible?()
;-----------------
visible?: func [][
; always returns logic value
not not find system/view/screen-face/pane view-face
]
;-----------------
;- actions[]
;-----------------
actions: context [
i: 0
;-----------------
;- close-window()
;
; note: the return value is used as the confirmation to close the window.
; so returning none, prevents the window from closing.
;-----------------
close-window: func [
event
][
true
]
]
;- valve []
valve: make valve [
;- type:
type: '!window
;- style-name:
style-name: 'window
;- fg-glob-class:
; class used to allocate and link a glob drawn IN FRONT OF the marble collection
;
; we use this to create an input blocker.
fg-glob-class: make !glob [
valve: make valve [
;- glob/input-spec:
input-spec: [
; list of inputs to generate automatically on setup these will be stored within the instance under input
block-input? !any (false)
dimension !pair
]
;- glob/gel-spec:
gel-spec: [
; block inputs
block-input? dimension
[
(
either (data/block-input?=) [
compose [
pen none
fill-pen (to-color gel/glob/marble/sid)
box (0x0) (data/dimension= )
]
][
; nothing to add to block
[]
]
)
]
; bg layer (ex: shadows, textures)
; keep in mind... this can be switched off for greater performance
;[]
; fg layer
block-input? dimension
[
; here we restore our parent's clip region :-)
;clip (data/parent-clip-region=)
(
either (data/block-input?=) [
compose [
pen none
; dim interface, to indicate blocked input
fill-pen (0.0.0.200)
box (0x0) (data/dimension= )
]
][
; nothing to add to block
[]
]
)
]
; controls layer
;[]
]
]
]
;- bg-glob-class:
; class used to allocate and link a glob drawn BEHIND ALL OTHER marbles
;
; we use this to detect ckiking on the bg of the window.
;
; when this glob is selected, the window event handler will have special events
; triggered.
bg-glob-class: make !glob [
valve: make valve [
;- glob/input-spec:
input-spec: [
; list of inputs to generate automatically on setup these will be stored within the instance under input
color !color
dimension !pair
]
;- glob/gel-spec:
gel-spec: [
; block inputs
dimension
[
pen none
fill-pen (to-color gel/glob/marble/sid)
box (0x0) (data/dimension= )
]
; bg layer (ex: shadows, textures)
; keep in mind... this can be switched off for greater performance
;[]
; fg layer
color dimension
[
pen (data/color=)
fill-pen (data/color=)
box 0x0 (data/dimension= )
]
; controls layer
;[]
]
]
]
;-----------------
;- detect-marble()
;
; returns the marble at specified coordinates for given window
;
; if the backplane layer has changed, it refreshes the backplane image.
;
; note that because the backplane layer usually only connects to the least
; materials and aspects it needs, it rarely ever changes, except when the layout
; changes.
;
; also, because the backplane is only rendered when mouse interaction is required,
; things like scrolling will not cause it to refresh automatically like the main layer would.
;-----------------
detect-marble: funcl [
window [object!]
coordinates [pair!]
;/local size marble blk
][
vin [{detect-marble()}]
marble: none
; is backplane up to date?
if window/backplug/dirty? [
vprint "we must redraw backplane"
size: content* window/material/dimension
if any [
none? window/backplane
all [
image? window/backplane
window/backplane/size <> size
]
][
;vprint ["..................> Window Size changed: " size]
;v?? size
size: any [size 2x2]
window/backplane: make image! max size 2x2
]
; make sure we don't rely on an out of date backplane, and correctly trap any errors
; which might occur while trying to rebuild it.
;window/backplane: none
;- - render backplane
if block? blk: content* window/backplug [
;vprint "...................> Redraw-backplane"
draw window/backplane compose [ pen none anti-alias (none) fill-pen (white) box 0x0 (size) (blk) ]
;set 'global-bkplane window/backplane
]
]
if image? window/backplane [
;vprint "backplane image exists"
; make sure coordinates are within backplane bounds
coordinates: min window/backplane/size coordinates
v?? coordinates
; low-level image to plug
marble: marble-at-coordinates window/backplane coordinates
if marble[vprobe marble/sid]
]
vout
; this can be none or a pointer to the marble
marble
]
;-----------------
;- collect()
;-----------------
collect: func [
glob [object!]
][
vin [{collect()}]
vout
]
;-----------------
;- trigger-events()
;-----------------
trigger-events: func [
window [object!]
event [object!]
mode [word!]
/local
][
vin [{trigger-events()}]
if mode: select window/triggered-events mode [
if mode: select mode event/action [
foreach evt mode [
queue-event clone-event/with evt [
viewport: event/viewport
coordinates: event/coordinates
view-window: event/view-window
]
]
]
]
vout
]
;-----------------
;- set-overlay-trigger()
;
; a handy function which resolves various trigger setups.
;
; the word triggers basically act as often-used predefined operations
; which can be asked for instead of built manually.
;-----------------
set-overlay-trigger: func [
window [object!] "the window MARBLE, not the view-face"
trigger [object! none! word! block!]
][
vin [{set-overlay-trigger()}]
switch type?/word trigger [
object! [
]
none! [
clear window/triggered-events/overlay/pointer-press
]
word! [
switch/default trigger [
; the default action
; simply streams a remove-overlay event.
remove [
window/triggered-events/overlay/pointer-press: reduce [
make !event [
action: 'remove-overlay
]
]
]
ignore [
window/triggered-events/overlay/pointer-press: none
reduce [
; make !event [
; action: 'remove-overlay
; ]
]
]
][
; this is an error, because its a programming error, which must be dealt with
; at development time.
;
; there is no reason to fallback to anything, since this means the programmer
; isn't aware of the api and issued an invalid event.
to-error "unknown trigger preset specified in set-overlay-trigger()"
]
]
block! [
; <TO DO> make sure block contains only events
change head clear window/triggered-events/overlay/pointer-press event/trigger
]
]
vprint "input-blocker trigger was set"
vout
]
;-----------------
;- materialize()
;-----------------
materialize: func [
win [object!]
][
vin [{materialize()}]
win/material/title: liquify*/link process*/with 'window-title [window][
if window: plug/window/view-face [
window/text: pick data 1
window/changes: [text]
show window
window: plug: data: none
]
][
stainless?: true ; always update when dirty.
window: win
] win/aspects/label
vout
]
;-----------------
;- setup-style()
;-----------------
setup-style: func [
window
][
vin [{glass/!} uppercase to-string window/valve/style-name {[} window/sid {]/setup-style()}]
vprint "SETTING UP WINDOW!"
; we setup the face, so it links back to the !window (which is a viewport)
window/view-face: make default-window-face [viewport: window]
; allocate space for the viewport stream
window/stream: copy []
; create a generic handle to our glob's internal backplane (layer 1)
window/backplug: liquify* epoxy/!merge
;- handler context[]
context copy/deep [
;- hovered-marble:
; what marble is currently hovered?
;
; this stores the marble which generated the 'START-HOVER event (if any).
hovered-marble: none
;- selected-marble:
; what marble is currently selected?
;
; this stores the marble which generated the 'SELECT event (if any).
selected-marble: none
;--------------------------
;- dragged-marble:
;
; stores which marble is being dragged, usually the same as the selected marble.
;
; the reason to have a separate select & drag reference, is that is allows us to detect when the
; selection becomes a drag (usually on the first SWIPE event).
;
; when the first swipe event is triggered, it generates a DRAG? event, which is responsible for
; for setting the
;--------------------------
dragged-marble: none
;--------------------------
;- drag-down-event:
;
; stores the event which starts the dragging, so we can
; store an origin of the marble being dragged or swipped
;--------------------------
drag-down-event: none
;--------------------------
;- ctx-selected-marble:
;
; stores the marble which caused the context-press event.
;
; eventually, both selected and ctx selection will be available simultatneously
; (under R3)
;--------------------------
ctx-selected-marble: none
; add viewport handlers!
vprint "adding refresh handler"
event-lib/handle-stream/within 'window-handler
;- window event handler
; note, if we return an event, we intend for the streaming to continue
; returning none or false will consume the event and this event is considered
; completely managed.
;
; as usual, we may modify or even allocate a new event, and even queue new ones!
funcl [
event [object!]
;/local window marble qevent wglob oglob data img size
/extern selected-marble drag-down-event ctx-selected-marble dragged-marble hovered-marble
][
vin "WINDOW HANDLER"
;vprint event/action
window: event/viewport
rval: switch/default event/action [
;----------------------------------
;- -POINTER-MOVE
POINTER-MOVE [
;vprint "------------------->hovering mouse!"
;vprint event/coordinates
marble: detect-marble window event/coordinates
either selected-marble [
;vprint "dragging"
;print "SWIPE?"
; enter swipe mode
;slim/vdump/ignore marble [valve OBSERVERS subordinates]
either drag-down-event [
event: make event compose [
DRAG-ORIGIN: drag-down-event/drag-origin
]
][
if marble [
drag-down-event: event: make event compose [
DRAG-ORIGIN: (content marble/material/position)
]
]
]
event/marble: selected-marble
event/offset: coordinates-to-offset selected-marble event/coordinates
either same? selected-marble marble [
event/action: 'SWIPE
][
; enables temporary drag & drop solution
event: make event compose [drag-drop-candidate: ( marble)]
event/action: 'DROP?
]
][
;vprint "hovering"
; enter hover mode
either all [
same? hovered-marble marble
][
event/action: 'HOVER
event/marble: hovered-marble
if event/marble [
event/offset: coordinates-to-offset hovered-marble event/coordinates
]
][
if hovered-marble [
qevent: clone-event/with event compose [
to-marble: (marble)
to-offset: (either marble [coordinates-to-offset marble event/coordinates][0x0])
]
qevent/action: 'END-HOVER
qevent/marble: hovered-marble
qevent/offset: coordinates-to-offset hovered-marble event/coordinates
; we cause an event to be triggered right now.
; our event handling is halted, until that terminates.
;
; when the dispatched event is done, the next part of hovering is
; done, which might cause the original event to become a 'START-HOVER
; event and be handled AFTER the dispatched event!
dispatch qevent
]
;vprint "=============>"
if marble [
; unless in marble/valve 'style-name [
; global-plug: marble
; ]
;slim/vdump/ignore marble [object!]
event/action: 'START-HOVER
event/marble: marble
event/offset: coordinates-to-offset marble event/coordinates
]