wip: clean up some things

This commit is contained in:
Jonathan Kelley committed 2022-11-30 23:54:30 -05:00
1 parent ba26b1001a
commit 3b166c9edd
64 files changed
+540 -599

No files matched your search

+1 -1
View File
@@ -11,7 +11,7 @@ macro_rules! impl_event {
) => {
$(
$( #[$attr] )*
pub fn $name<'a>(_cx: &'a ::dioxus_core::ScopeState, _f: impl FnMut(::dioxus_core::UiEvent<$data>) + 'a) -> ::dioxus_core::Attribute<'a> {
pub fn $name<'a>(_cx: &'a ::dioxus_core::ScopeState, _f: impl FnMut(::dioxus_core::Event<$data>) + 'a) -> ::dioxus_core::Attribute<'a> {
::dioxus_core::Attribute {
name: stringify!($name),
value: ::dioxus_core::AttributeValue::new_listener(_cx, _f),
+2 -2
View File
@@ -1,6 +1,6 @@
use dioxus_core::UiEvent;
use dioxus_core::Event;
pub type AnimationEvent = UiEvent<AnimationData>;
pub type AnimationEvent = Event<AnimationData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]
+2 -2
View File
@@ -1,6 +1,6 @@
use dioxus_core::UiEvent;
use dioxus_core::Event;
pub type ClipboardEvent = UiEvent<ClipboardData>;
pub type ClipboardEvent = Event<ClipboardData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]
pub struct ClipboardData {
+2 -2
View File
@@ -1,6 +1,6 @@
use dioxus_core::UiEvent;
use dioxus_core::Event;
pub type CompositionEvent = UiEvent<CompositionData>;
pub type CompositionEvent = Event<CompositionData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]
pub struct CompositionData {
+2 -2
View File
@@ -1,10 +1,10 @@
use std::any::Any;
use dioxus_core::UiEvent;
use dioxus_core::Event;
use crate::MouseData;
pub type DragEvent = UiEvent<DragData>;
pub type DragEvent = Event<DragData>;
/// The DragEvent interface is a DOM event that represents a drag and drop interaction. The user initiates a drag by
/// placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location
+2 -2
View File
@@ -1,6 +1,6 @@
use dioxus_core::UiEvent;
use dioxus_core::Event;
pub type FocusEvent = UiEvent<FocusData>;
pub type FocusEvent = Event<FocusData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]
+2 -2
View File
@@ -1,8 +1,8 @@
use std::{collections::HashMap, fmt::Debug, sync::Arc};
use dioxus_core::UiEvent;
use dioxus_core::Event;
pub type FormEvent = UiEvent<FormData>;
pub type FormEvent = Event<FormData>;
/* DOMEvent: Send + SyncTarget relatedTarget */
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
+2 -2
View File
@@ -1,6 +1,6 @@
use dioxus_core::UiEvent;
use dioxus_core::Event;
pub type ImageEvent = UiEvent<ImageData>;
pub type ImageEvent = Event<ImageData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]
pub struct ImageData {
+2 -2
View File
@@ -1,11 +1,11 @@
use crate::input_data::{decode_key_location, encode_key_location};
use dioxus_core::UiEvent;
use dioxus_core::Event;
use keyboard_types::{Code, Key, Location, Modifiers};
use std::convert::TryInto;
use std::fmt::{Debug, Formatter};
use std::str::FromStr;
pub type KeyboardEvent = UiEvent<KeyboardData>;
pub type KeyboardEvent = Event<KeyboardData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Clone)]
pub struct KeyboardData {
+2 -2
View File
@@ -1,6 +1,6 @@
use dioxus_core::UiEvent;
use dioxus_core::Event;
pub type MediaEvent = UiEvent<MediaData>;
pub type MediaEvent = Event<MediaData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]
pub struct MediaData {}
+2 -2
View File
@@ -2,11 +2,11 @@ use crate::geometry::{ClientPoint, Coordinates, ElementPoint, PagePoint, ScreenP
use crate::input_data::{
decode_mouse_button_set, encode_mouse_button_set, MouseButton, MouseButtonSet,
};
use dioxus_core::UiEvent;
use dioxus_core::Event;
use keyboard_types::Modifiers;
use std::fmt::{Debug, Formatter};
pub type MouseEvent = UiEvent<MouseData>;
pub type MouseEvent = Event<MouseData>;
/// A synthetic event that wraps a web-style [`MouseEvent`](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent)
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
+2 -2
View File
@@ -1,6 +1,6 @@
use dioxus_core::UiEvent;
use dioxus_core::Event;
pub type PointerEvent = UiEvent<PointerData>;
pub type PointerEvent = Event<PointerData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]
pub struct PointerData {
+2 -2
View File
@@ -1,6 +1,6 @@
use dioxus_core::UiEvent;
use dioxus_core::Event;
pub type ScrollEvent = UiEvent<ScrollData>;
pub type ScrollEvent = Event<ScrollData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]
pub struct ScrollData {}
+2 -2
View File
@@ -1,6 +1,6 @@
use dioxus_core::UiEvent;
use dioxus_core::Event;
pub type SelectionEvent = UiEvent<SelectionData>;
pub type SelectionEvent = Event<SelectionData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]
pub struct SelectionData {}
+2 -2
View File
@@ -1,6 +1,6 @@
use dioxus_core::UiEvent;
use dioxus_core::Event;
pub type ToggleEvent = UiEvent<ToggleData>;
pub type ToggleEvent = Event<ToggleData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]
pub struct ToggleData {}
+2 -2
View File
@@ -1,6 +1,6 @@
use dioxus_core::UiEvent;
use dioxus_core::Event;
pub type TouchEvent = UiEvent<TouchData>;
pub type TouchEvent = Event<TouchData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]
pub struct TouchData {
+2 -2
View File
@@ -1,6 +1,6 @@
use dioxus_core::UiEvent;
use dioxus_core::Event;
pub type TransitionEvent = UiEvent<TransitionData>;
pub type TransitionEvent = Event<TransitionData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone)]
pub struct TransitionData {
+2 -2
View File
@@ -1,10 +1,10 @@
use dioxus_core::UiEvent;
use dioxus_core::Event;
use euclid::UnknownUnit;
use std::fmt::{Debug, Formatter};
use crate::geometry::{LinesVector, PagesVector, PixelsVector, WheelDelta};
pub type WheelEvent = UiEvent<WheelData>;
pub type WheelEvent = Event<WheelData>;
#[cfg_attr(feature = "serialize", derive(serde::Serialize, serde::Deserialize))]
#[derive(Clone)]
pub struct WheelData {