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
//! Events directly from the view-process targeting the app windows.
//!
//! These events get processed by [app extensions] to generate the events used in widgets, for example
//! the `KeyboardManager` uses the [`RAW_KEY_INPUT_EVENT`] into focus targeted events.
//!
//! # Synthetic Input
//!
//! You can [`notify`] these events to fake hardware input, please be careful that you mimic the exact sequence a real
//! hardware would generate, [app extensions] can assume that the raw events are correct. The [`DeviceId`] for fake
//! input must be unique but constant for each distinctive *synthetic event source*.
//!
//! [app extensions]: crate::AppExtension
//! [`RAW_KEY_INPUT_EVENT`]: crate::view_process::raw_events::RAW_KEY_INPUT_EVENT
//! [`notify`]: crate::event::Event::notify
//! [`DeviceId`]: crate::view_process::raw_device_events::DeviceId

use std::path::PathBuf;

use zng_layout::unit::{DipPoint, DipSideOffsets, DipSize, Factor, PxPoint, PxRect};
use zng_txt::Txt;
use zng_view_api::{
    api_extension::{ApiExtensionId, ApiExtensionPayload},
    config::{
        AnimationsConfig, ChromeConfig, ColorsConfig, FontAntiAliasing, KeyRepeatConfig, LocaleConfig, MultiClickConfig, TouchConfig,
    },
    keyboard::{Key, KeyCode, KeyLocation, KeyState},
    mouse::{ButtonState, MouseButton, MouseScrollDelta},
    touch::{TouchPhase, TouchUpdate},
    window::{EventCause, FrameId, FrameWaitId, HeadlessOpenData, MonitorInfo, WindowStateAll},
    AxisId, Ime,
};

use crate::{
    event::{event, event_args},
    window::{MonitorId, WindowId},
};

use super::{raw_device_events::DeviceId, ViewHeadless, ViewImage, ViewWindow, WindowOpenData};

event_args! {
    /// Arguments for the [`RAW_KEY_INPUT_EVENT`].
    pub struct RawKeyInputArgs {
        /// Window that received the event.
        pub window_id: WindowId,

        /// Keyboard device that generated the event.
        pub device_id: DeviceId,

        /// Physical key.
        pub key_code: KeyCode,

        /// The location of the key on the keyboard.
        pub key_location: KeyLocation,

        /// If the key was pressed or released.
        pub state: KeyState,

        /// Semantic key.
        ///
        /// Pressing `Shift+A` key will produce `Key::Char('a')` in QWERTY keyboards, the modifiers are not applied.
        pub key: Key,
        /// Semantic key modified by the current active modifiers.
        ///
        /// Pressing `Shift+A` key will produce `Key::Char('A')` in QWERTY keyboards, the modifiers are applied.
        pub key_modified: Key,

        /// Text typed.
        ///
        /// This is only set for `KeyState::Pressed` of a key that generates text.
        ///
        /// This is usually the `key_modified` char, but is also `'\r'` for `Key::Enter`. On Windows when a dead key was
        /// pressed earlier but cannot be combined with the character from this key press, the produced text
        /// will consist of two characters: the dead-key-character followed by the character resulting from this key press.
        pub text: Txt,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_IME_EVENT`].
    pub struct RawImeArgs {
        /// Window that received the event.
        pub window_id: WindowId,

        /// The IME event.
        pub ime: Ime,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_WINDOW_FOCUS_EVENT`].
    pub struct RawWindowFocusArgs {
        /// Window that load focus.
        pub prev_focus: Option<WindowId>,

        /// Window that got focus.
        pub new_focus: Option<WindowId>,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_FRAME_RENDERED_EVENT`].
    pub struct RawFrameRenderedArgs {
        /// Window that presents the rendered frame.
        pub window_id: WindowId,

        /// Frame tag.
        pub frame_id: FrameId,

        /// The frame pixels if it was requested when the frame request was sent to the view process.
        pub frame_image: Option<ViewImage>,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_WINDOW_CHANGED_EVENT`].
    pub struct RawWindowChangedArgs {
        /// Window that has moved, resized or has a state change.
        pub window_id: WindowId,

        /// New state if any part of it has changed.
        pub state: Option<WindowStateAll>,

        /// New window position if it was moved.
        ///
        /// The values are `(global_position, position_in_monitor)`.
        pub position: Option<(PxPoint, DipPoint)>,

        /// New window monitor.
        ///
        /// The window's monitor change when it is moved enough so that most of the
        /// client area is in the new monitor screen.
        pub monitor: Option<MonitorId>,

        /// New window size if it was resized.
        pub size: Option<DipSize>,

        /// New window safe padding.
        pub safe_padding: Option<DipSideOffsets>,

        /// If the app or operating system caused the change.
        pub cause: EventCause,

        /// If the view-process is blocking the event loop for a time waiting for a frame for the new `size` this
        /// ID must be send with the frame to signal that it is the frame for the new size.
        ///
        /// Event loop implementations can use this to resize without visible artifacts
        /// like the clear color flashing on the window corners, there is a timeout to this delay but it
        /// can be a noticeable stutter, a [`render`] or [`render_update`] request for the window unblocks the loop early
        /// to continue the resize operation.
        ///
        /// [`render`]: crate::view_process::ViewRenderer::render
        /// [`render_update`]: crate::view_process::ViewRenderer::render_update
        pub frame_wait_id: Option<FrameWaitId>,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_WINDOW_OPEN_EVENT`].
    pub struct RawWindowOpenArgs {
        /// Window that finished opening.
        pub window_id: WindowId,

        /// Live connection to the window in the view-process.
        pub window: ViewWindow,

        /// Extra data send by the view-process.
        pub data: WindowOpenData,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_HEADLESS_OPEN_EVENT`].
    pub struct RawHeadlessOpenArgs {
        /// Window id that represents the headless surface that finished opening.
        pub window_id: WindowId,

        /// Live connection to the headless surface in the view-process.
        pub surface: ViewHeadless,

        /// Extra data send by the view-process.
        pub data: HeadlessOpenData,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_WINDOW_OR_HEADLESS_OPEN_ERROR_EVENT`].
    pub struct RawWindowOrHeadlessOpenErrorArgs {
        /// Window id that failed to open.
        pub window_id: WindowId,
        /// Error message from the view-process.
        pub error: Txt,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_WINDOW_CLOSE_REQUESTED_EVENT`].
    pub struct RawWindowCloseRequestedArgs {
        /// Window that was requested to close.
        pub window_id: WindowId,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_WINDOW_CLOSE_EVENT`].
    pub struct RawWindowCloseArgs {
        /// Window that has closed.
        pub window_id: WindowId,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_DROPPED_FILE_EVENT`].
    pub struct RawDroppedFileArgs {
        /// Window where it was dropped.
        pub window_id: WindowId,

        /// Path to file that was dropped.
        pub file: PathBuf,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// Arguments for the [`RAW_HOVERED_FILE_EVENT`].
    pub struct RawHoveredFileArgs {
        /// Window where it was dragged over.
        pub window_id: WindowId,

        /// Path to file that was dragged over the window.
        pub file: PathBuf,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// Arguments for the [`RAW_HOVERED_FILE_CANCELLED_EVENT`].
    ///
    /// The file is the one that was last [hovered] into the window.
    ///
    /// [hovered]: RAW_HOVERED_FILE_EVENT
    pub struct RawHoveredFileCancelledArgs {
        /// Window where the file was previously dragged over.
        pub window_id: WindowId,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// Arguments for the [`RAW_MOUSE_MOVED_EVENT`].
    pub struct RawMouseMovedArgs {
        /// Window the mouse was moved over.
        pub window_id: WindowId,

        /// Device that generated this event.
        pub device_id: DeviceId,

        /// Positions of the mouse in between the previous event and this one.
        ///
        /// Mouse move events can be coalesced, i.e. multiple mouse moves packed into a single event.
        pub coalesced_pos: Vec<DipPoint>,

        /// Position of the mouse over the window, (0, 0) is the top-left.
        pub position: DipPoint,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// Arguments for the [`RAW_MOUSE_ENTERED_EVENT`] and [`RAW_MOUSE_LEFT_EVENT`].
    pub struct RawMouseArgs {
        /// Window the mouse entered or left.
        pub window_id: WindowId,

        /// Device that generated this event.
        pub device_id: DeviceId,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// Arguments for the [`RAW_MOUSE_WHEEL_EVENT`].
    pub struct RawMouseWheelArgs {
        /// Window that is hovered by the mouse.
        pub window_id: WindowId,

        /// Device that generated this event.
        pub device_id: DeviceId,

        /// Wheel motion delta, value is in pixels if the *wheel* is a touchpad.
        pub delta: MouseScrollDelta,

        /// Touch state if the device that generated the event is a touchpad.
        pub phase: TouchPhase,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// Arguments for the [`RAW_MOUSE_INPUT_EVENT`].
    pub struct RawMouseInputArgs {
        /// Window that is hovered by the mouse.
        pub window_id: WindowId,

        /// Device that generated this event.
        pub device_id: DeviceId,

        /// If the button was pressed or released.
        pub state: ButtonState,

        /// What button was pressed or released.
        pub button: MouseButton,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_TOUCHPAD_PRESSURE_EVENT`].
    pub struct RawTouchpadPressureArgs {
        /// Window that is touched.
        pub window_id: WindowId,

        /// Device that generated this event.
        pub device_id: DeviceId,

        /// Pressure level between 0 and 1.
        pub pressure: Factor,

        /// Click level.
        pub stage: i64,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_AXIS_MOTION_EVENT`].
    pub struct RawAxisMotionArgs {
        /// Window that received the event.
        pub window_id: WindowId,

        /// Device that generated the event.
        pub device_id: DeviceId,

        /// Analog axis.
        pub axis: AxisId,

        /// Motion amount.
        pub value: f64,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_TOUCH_EVENT`].
    pub struct RawTouchArgs {
        /// Window that was touched.
        pub window_id: WindowId,

        /// Device that generated this event.
        pub device_id: DeviceId,

        /// Coalesced touch updates.
        pub touches: Vec<TouchUpdate>,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_SCALE_FACTOR_CHANGED_EVENT`].
    pub struct RawScaleFactorChangedArgs {
        /// Monitor that has changed.
        pub monitor_id: MonitorId,

        /// Window in the monitor that has changed.
        pub windows: Vec<WindowId>,

        /// New pixel scale factor.
        pub scale_factor: Factor,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_MONITORS_CHANGED_EVENT`].
    pub struct RawMonitorsChangedArgs {
        /// Up-to-date monitors list.
        pub available_monitors: Vec<(MonitorId, MonitorInfo)>,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the image events.
    pub struct RawImageArgs {
        /// Image that changed.
        pub image: ViewImage,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// Arguments for the [`RAW_FRAME_IMAGE_READY_EVENT`].
    pub struct RawFrameImageReadyArgs {
        /// Frame image that is ready.
        pub image: ViewImage,

        /// Window that was captured.
        pub window_id: WindowId,

        /// Frame that was captured.
        pub frame_id: FrameId,

        /// Area of the frame that was captured.
        pub area: PxRect,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// [`RAW_FONT_CHANGED_EVENT`] arguments.
    pub struct RawFontChangedArgs {

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// Arguments for the [`RAW_FONT_AA_CHANGED_EVENT`].
    pub struct RawFontAaChangedArgs {
        /// The new anti-aliasing config.
        pub aa: FontAntiAliasing,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// Arguments for the [`RAW_MULTI_CLICK_CONFIG_CHANGED_EVENT`].
    pub struct RawMultiClickConfigChangedArgs {
        /// New config.
        pub config: MultiClickConfig,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// Arguments for the [`RAW_ANIMATIONS_CONFIG_CHANGED_EVENT`].
    pub struct RawAnimationsConfigChangedArgs {
        /// New config.
        pub config: AnimationsConfig,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// Arguments for the [`RAW_KEY_REPEAT_CONFIG_CHANGED_EVENT`].
    pub struct RawKeyRepeatConfigChangedArgs {
        /// New config.
        pub config: KeyRepeatConfig,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// Arguments for the [`RAW_TOUCH_CONFIG_CHANGED_EVENT`].
    pub struct RawTouchConfigChangedArgs {
        /// New config.
        pub config: TouchConfig,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// Arguments for the [`RAW_LOCALE_CONFIG_CHANGED_EVENT`].
    pub struct RawLocaleChangedArgs {
        /// New config.
        pub config: LocaleConfig,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// Arguments for the [`RAW_COLORS_CONFIG_CHANGED_EVENT`].
    pub struct RawColorsConfigChangedArgs {
        /// New config.
        pub config: ColorsConfig,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_CHROME_CONFIG_CHANGED_EVENT`].
    pub struct RawChromeConfigChangedArgs {
        /// New config.
        pub config: ChromeConfig,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all();
        }
    }

    /// Arguments for the [`RAW_EXTENSION_EVENT`].
    pub struct RawExtensionEventArgs {
        /// Id of the sender extension.
        pub extension_id: ApiExtensionId,
        /// Event payload.
        pub payload: ApiExtensionPayload,

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }

    /// Arguments for [`LOW_MEMORY_EVENT`].
    pub struct LowMemoryArgs {

        ..

        /// Broadcast to all widgets.
        fn delivery_list(&self, list: &mut UpdateDeliveryList) {
            list.search_all()
        }
    }
}

event! {
    /// A key press or release targeting a window.
    ///
    /// This event represents a key input directly from the operating system. It is processed
    /// by `KeyboardManager` to generate the `KEY_INPUT_EVENT` that actually targets the focused widget.
    ///
    /// *See also the [module level documentation](self) for details of how you can fake this event*
    pub static RAW_KEY_INPUT_EVENT: RawKeyInputArgs;

    /// An IME event was received by a window.
    pub static RAW_IME_EVENT: RawImeArgs;

    /// A window received or lost focus.
    pub static RAW_WINDOW_FOCUS_EVENT: RawWindowFocusArgs;

    /// A window was moved, resized or has a state change.
    ///
    /// This event aggregates events moves, resizes and other state changes into a
    /// single event to simplify tracking composite changes, for example, the window changes size and position
    /// when maximized, this can be trivially observed with this event.
    pub static RAW_WINDOW_CHANGED_EVENT: RawWindowChangedArgs;

    /// A frame finished rendering and was presented in a window.
    pub static RAW_FRAME_RENDERED_EVENT: RawFrameRenderedArgs;

    /// A window has finished initializing in the view-process.
    pub static RAW_WINDOW_OPEN_EVENT: RawWindowOpenArgs;

    /// A headless surface has finished initializing in the view-process.
    pub static RAW_HEADLESS_OPEN_EVENT: RawHeadlessOpenArgs;

    /// A window or headless surface initialization failed in the view-process.
    pub static RAW_WINDOW_OR_HEADLESS_OPEN_ERROR_EVENT: RawWindowOrHeadlessOpenErrorArgs;

    /// A window was requested to close.
    pub static RAW_WINDOW_CLOSE_REQUESTED_EVENT: RawWindowCloseRequestedArgs;

    /// A window was destroyed.
    pub static RAW_WINDOW_CLOSE_EVENT: RawWindowCloseArgs;

    /// A file was drag-dropped on a window.
    pub static RAW_DROPPED_FILE_EVENT: RawDroppedFileArgs;

    /// A file was dragged over a window.
    ///
    /// If the file is dropped [`RAW_DROPPED_FILE_EVENT`] will raise.
    pub static RAW_HOVERED_FILE_EVENT: RawHoveredFileArgs;

    /// A dragging file was moved away from the window or the operation was cancelled.
    ///
    /// The file is the last one that emitted a [`RAW_HOVERED_FILE_EVENT`].
    pub static RAW_HOVERED_FILE_CANCELLED_EVENT: RawHoveredFileCancelledArgs;

    /// Mouse pointer moved over a window.
    pub static RAW_MOUSE_MOVED_EVENT: RawMouseMovedArgs;

    /// Mouse pointer started hovering a window.
    pub static RAW_MOUSE_ENTERED_EVENT: RawMouseArgs;

    /// Mouse pointer stopped hovering a window.
    pub static RAW_MOUSE_LEFT_EVENT: RawMouseArgs;

    /// Mouse wheel scrolled when the mouse was over a window.
    pub static RAW_MOUSE_WHEEL_EVENT: RawMouseWheelArgs;

    /// Mouse button was pressed or released when the mouse was over a window.
    pub static RAW_MOUSE_INPUT_EVENT: RawMouseInputArgs;

    /// Touchpad touched when the mouse was over a window.
    pub static RAW_TOUCHPAD_PRESSURE_EVENT: RawTouchpadPressureArgs;

    /// Motion on some analog axis send to a window.
    pub static RAW_AXIS_MOTION_EVENT: RawAxisMotionArgs;

    /// A window was touched.
    pub static RAW_TOUCH_EVENT: RawTouchArgs;

    /// Pixel scale factor for a monitor screen and its windows has changed.
    ///
    /// This can happen if the user change the screen settings. Note that a
    /// window's scale factor can also change if it is moved to a different monitor,
    /// this change can be monitored using [`RAW_WINDOW_CHANGED_EVENT`].
    pub static RAW_SCALE_FACTOR_CHANGED_EVENT: RawScaleFactorChangedArgs;

    /// Monitors added, removed or modified.
    pub static RAW_MONITORS_CHANGED_EVENT: RawMonitorsChangedArgs;

    /// Color scheme or accent color preference changed for a window.
    pub static RAW_COLORS_CONFIG_CHANGED_EVENT: RawColorsConfigChangedArgs;

    /// System window chrome config changed.
    pub static RAW_CHROME_CONFIG_CHANGED_EVENT: RawChromeConfigChangedArgs;

    /// Change in system font anti-aliasing config.
    pub static RAW_FONT_AA_CHANGED_EVENT: RawFontAaChangedArgs;

    /// Change in system text fonts, install or uninstall.
    pub static RAW_FONT_CHANGED_EVENT: RawFontChangedArgs;

    /// Change in system "double-click" config.
    pub static RAW_MULTI_CLICK_CONFIG_CHANGED_EVENT: RawMultiClickConfigChangedArgs;

    /// Change in system animation enabled config.
    pub static RAW_ANIMATIONS_CONFIG_CHANGED_EVENT: RawAnimationsConfigChangedArgs;

    /// Change in system key repeat interval config.
    pub static RAW_KEY_REPEAT_CONFIG_CHANGED_EVENT: RawKeyRepeatConfigChangedArgs;

    /// Change in system touch config.
    pub static RAW_TOUCH_CONFIG_CHANGED_EVENT: RawTouchConfigChangedArgs;

    /// Change in system locale config.
    pub static RAW_LOCALE_CONFIG_CHANGED_EVENT: RawLocaleChangedArgs;

    /// Image metadata loaded without errors.
    pub static RAW_IMAGE_METADATA_LOADED_EVENT: RawImageArgs;

    /// Progressively decoded image has decoded more pixels.
    pub static RAW_IMAGE_PARTIALLY_LOADED_EVENT: RawImageArgs;

    /// Image loaded without errors.
    pub static RAW_IMAGE_LOADED_EVENT: RawImageArgs;

    /// Image failed to load.
    pub static RAW_IMAGE_LOAD_ERROR_EVENT: RawImageArgs;

    /// Image generated from a frame is ready for reading.
    pub static RAW_FRAME_IMAGE_READY_EVENT: RawFrameImageReadyArgs;

    /// System low memory warning, some platforms may kill the app if it does not release memory.
    pub static LOW_MEMORY_EVENT: LowMemoryArgs;

    /// Custom view-process extension event.
    pub static RAW_EXTENSION_EVENT: RawExtensionEventArgs;
}