Skip to main content

bevy_window/cursor/
custom_cursor.rs

1use crate::cursor::CursorIcon;
2use alloc::string::String;
3use bevy_asset::Handle;
4use bevy_ecs::template::FromTemplate;
5use bevy_image::{Image, TextureAtlas};
6use bevy_math::URect;
7
8#[cfg(feature = "bevy_reflect")]
9use bevy_reflect::{std_traits::ReflectDefault, Reflect};
10
11/// A custom cursor created from an image.
12#[derive(#[automatically_derived]
impl ::core::fmt::Debug for CustomCursorImage {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        let names: &'static _ =
            &["handle", "texture_atlas", "flip_x", "flip_y", "rect",
                        "hotspot"];
        let values: &[&dyn ::core::fmt::Debug] =
            &[&self.handle, &self.texture_atlas, &self.flip_x, &self.flip_y,
                        &self.rect, &&self.hotspot];
        ::core::fmt::Formatter::debug_struct_fields_finish(f,
            "CustomCursorImage", names, values)
    }
}Debug, #[automatically_derived]
impl ::core::clone::Clone for CustomCursorImage {
    #[inline]
    fn clone(&self) -> CustomCursorImage {
        CustomCursorImage {
            handle: ::core::clone::Clone::clone(&self.handle),
            texture_atlas: ::core::clone::Clone::clone(&self.texture_atlas),
            flip_x: ::core::clone::Clone::clone(&self.flip_x),
            flip_y: ::core::clone::Clone::clone(&self.flip_y),
            rect: ::core::clone::Clone::clone(&self.rect),
            hotspot: ::core::clone::Clone::clone(&self.hotspot),
        }
    }
}Clone, #[automatically_derived]
impl ::core::default::Default for CustomCursorImage {
    #[inline]
    fn default() -> CustomCursorImage {
        CustomCursorImage {
            handle: ::core::default::Default::default(),
            texture_atlas: ::core::default::Default::default(),
            flip_x: ::core::default::Default::default(),
            flip_y: ::core::default::Default::default(),
            rect: ::core::default::Default::default(),
            hotspot: ::core::default::Default::default(),
        }
    }
}Default, #[automatically_derived]
impl ::core::cmp::PartialEq for CustomCursorImage {
    #[inline]
    fn eq(&self, other: &CustomCursorImage) -> bool {
        self.flip_x == other.flip_x && self.flip_y == other.flip_y &&
                        self.handle == other.handle &&
                    self.texture_atlas == other.texture_atlas &&
                self.rect == other.rect && self.hotspot == other.hotspot
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for CustomCursorImage {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Handle<Image>>;
        let _: ::core::cmp::AssertParamIsEq<Option<TextureAtlas>>;
        let _: ::core::cmp::AssertParamIsEq<bool>;
        let _: ::core::cmp::AssertParamIsEq<Option<URect>>;
        let _: ::core::cmp::AssertParamIsEq<(u16, u16)>;
    }
}Eq, #[automatically_derived]
impl ::core::hash::Hash for CustomCursorImage {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&self.handle, state);
        ::core::hash::Hash::hash(&self.texture_atlas, state);
        ::core::hash::Hash::hash(&self.flip_x, state);
        ::core::hash::Hash::hash(&self.flip_y, state);
        ::core::hash::Hash::hash(&self.rect, state);
        ::core::hash::Hash::hash(&self.hotspot, state)
    }
}Hash, impl ::core::default::Default for CustomCursorImageTemplate {
    fn default() -> Self {
        Self {
            handle: ::core::default::Default::default(),
            texture_atlas: ::core::default::Default::default(),
            flip_x: ::core::default::Default::default(),
            flip_y: ::core::default::Default::default(),
            rect: ::core::default::Default::default(),
            hotspot: ::core::default::Default::default(),
        }
    }
}FromTemplate)]
13#[cfg_attr(
14    feature = "bevy_reflect",
15    derive(const _: () =
    {
        impl bevy_reflect::GetTypeRegistration for CustomCursorImage where  {
            fn get_type_registration() -> bevy_reflect::TypeRegistration {
                let mut registration =
                    bevy_reflect::TypeRegistration::of::<Self>();
                registration.insert::<bevy_reflect::ReflectFromPtr>(bevy_reflect::FromType::<Self>::from_type());
                registration.insert::<bevy_reflect::ReflectFromReflect>(bevy_reflect::FromType::<Self>::from_type());
                registration.register_type_data::<ReflectDefault, Self>();
                registration
            }
            #[inline(never)]
            fn register_type_dependencies(registry:
                    &mut bevy_reflect::TypeRegistry) {
                <Handle<Image> as
                        bevy_reflect::__macro_exports::RegisterForReflection>::__register(registry);
                <Option<TextureAtlas> as
                        bevy_reflect::__macro_exports::RegisterForReflection>::__register(registry);
                <bool as
                        bevy_reflect::__macro_exports::RegisterForReflection>::__register(registry);
                <Option<URect> as
                        bevy_reflect::__macro_exports::RegisterForReflection>::__register(registry);
                <(u16, u16) as
                        bevy_reflect::__macro_exports::RegisterForReflection>::__register(registry);
            }
        }
        impl bevy_reflect::Typed for CustomCursorImage where  {
            #[inline]
            fn type_info() -> &'static bevy_reflect::TypeInfo {
                static CELL: bevy_reflect::utility::NonGenericTypeInfoCell =
                    bevy_reflect::utility::NonGenericTypeInfoCell::new();
                CELL.get_or_set(||
                        {
                            bevy_reflect::TypeInfo::Struct(bevy_reflect::structs::StructInfo::new::<Self>(&[bevy_reflect::NamedField::new::<Handle<Image>>("handle"),
                                                bevy_reflect::NamedField::new::<Option<TextureAtlas>>("texture_atlas"),
                                                bevy_reflect::NamedField::new::<bool>("flip_x"),
                                                bevy_reflect::NamedField::new::<bool>("flip_y"),
                                                bevy_reflect::NamedField::new::<Option<URect>>("rect"),
                                                bevy_reflect::NamedField::new::<(u16, u16)>("hotspot")]))
                        })
            }
        }
        #[allow(deprecated, reason =
        "derives on a deprecated type shouldn't be considered a usage")]
        impl bevy_reflect::TypePath for CustomCursorImage where  {
            fn type_path() -> &'static str {
                "bevy_window::cursor::custom_cursor::CustomCursorImage"
            }
            fn short_type_path() -> &'static str { "CustomCursorImage" }
            fn type_ident() -> ::core::option::Option<&'static str> {
                ::core::option::Option::Some("CustomCursorImage")
            }
            fn crate_name() -> ::core::option::Option<&'static str> {
                ::core::option::Option::Some("bevy_window::cursor::custom_cursor".split(':').next().unwrap())
            }
            fn module_path() -> ::core::option::Option<&'static str> {
                ::core::option::Option::Some("bevy_window::cursor::custom_cursor")
            }
        }
        impl bevy_reflect::Reflect for CustomCursorImage where  {
            #[inline]
            fn into_any(self:
                    bevy_reflect::__macro_exports::alloc_utils::Box<Self>)
                ->
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn ::core::any::Any> {
                self
            }
            #[inline]
            fn as_any(&self) -> &dyn ::core::any::Any { self }
            #[inline]
            fn as_any_mut(&mut self) -> &mut dyn ::core::any::Any { self }
            #[inline]
            fn into_reflect(self:
                    bevy_reflect::__macro_exports::alloc_utils::Box<Self>)
                ->
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect> {
                self
            }
            #[inline]
            fn as_reflect(&self) -> &dyn bevy_reflect::Reflect { self }
            #[inline]
            fn as_reflect_mut(&mut self) -> &mut dyn bevy_reflect::Reflect {
                self
            }
            #[inline]
            fn set(&mut self,
                value:
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect>)
                ->
                    ::core::result::Result<(),
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect>> {
                *self = <dyn bevy_reflect::Reflect>::take(value)?;
                ::core::result::Result::Ok(())
            }
        }
        #[allow(non_upper_case_globals)]
        const _: () =
            {
                static __INVENTORY: ::inventory::Node =
                    ::inventory::Node {
                        value: &{
                                bevy_reflect::__macro_exports::auto_register::AutomaticReflectRegistrations(<CustomCursorImage
                                        as
                                        bevy_reflect::__macro_exports::auto_register::RegisterForReflection>::__register)
                            },
                        next: ::inventory::__private::UnsafeCell::new(::inventory::__private::Option::None),
                    };
                #[link_section = ".text.startup"]
                unsafe extern "C" fn __ctor() {
                    unsafe {
                        ::inventory::ErasedNode::submit(__INVENTORY.value,
                            &__INVENTORY)
                    }
                }
                #[used]
                #[link_section = ".init_array"]
                static __CTOR: unsafe extern "C" fn() = __ctor;
            };
        impl bevy_reflect::structs::Struct for CustomCursorImage where  {
            fn field(&self, name: &str)
                -> ::core::option::Option<&dyn bevy_reflect::PartialReflect> {
                match name {
                    "handle" => ::core::option::Option::Some(&self.handle),
                    "texture_atlas" =>
                        ::core::option::Option::Some(&self.texture_atlas),
                    "flip_x" => ::core::option::Option::Some(&self.flip_x),
                    "flip_y" => ::core::option::Option::Some(&self.flip_y),
                    "rect" => ::core::option::Option::Some(&self.rect),
                    "hotspot" => ::core::option::Option::Some(&self.hotspot),
                    _ => ::core::option::Option::None,
                }
            }
            fn field_mut(&mut self, name: &str)
                ->
                    ::core::option::Option<&mut dyn bevy_reflect::PartialReflect> {
                match name {
                    "handle" => ::core::option::Option::Some(&mut self.handle),
                    "texture_atlas" =>
                        ::core::option::Option::Some(&mut self.texture_atlas),
                    "flip_x" => ::core::option::Option::Some(&mut self.flip_x),
                    "flip_y" => ::core::option::Option::Some(&mut self.flip_y),
                    "rect" => ::core::option::Option::Some(&mut self.rect),
                    "hotspot" =>
                        ::core::option::Option::Some(&mut self.hotspot),
                    _ => ::core::option::Option::None,
                }
            }
            fn field_at(&self, index: usize)
                -> ::core::option::Option<&dyn bevy_reflect::PartialReflect> {
                match index {
                    0usize => ::core::option::Option::Some(&self.handle),
                    1usize => ::core::option::Option::Some(&self.texture_atlas),
                    2usize => ::core::option::Option::Some(&self.flip_x),
                    3usize => ::core::option::Option::Some(&self.flip_y),
                    4usize => ::core::option::Option::Some(&self.rect),
                    5usize => ::core::option::Option::Some(&self.hotspot),
                    _ => ::core::option::Option::None,
                }
            }
            fn field_at_mut(&mut self, index: usize)
                ->
                    ::core::option::Option<&mut dyn bevy_reflect::PartialReflect> {
                match index {
                    0usize => ::core::option::Option::Some(&mut self.handle),
                    1usize =>
                        ::core::option::Option::Some(&mut self.texture_atlas),
                    2usize => ::core::option::Option::Some(&mut self.flip_x),
                    3usize => ::core::option::Option::Some(&mut self.flip_y),
                    4usize => ::core::option::Option::Some(&mut self.rect),
                    5usize => ::core::option::Option::Some(&mut self.hotspot),
                    _ => ::core::option::Option::None,
                }
            }
            fn name_at(&self, index: usize) -> ::core::option::Option<&str> {
                match index {
                    0usize => ::core::option::Option::Some("handle"),
                    1usize => ::core::option::Option::Some("texture_atlas"),
                    2usize => ::core::option::Option::Some("flip_x"),
                    3usize => ::core::option::Option::Some("flip_y"),
                    4usize => ::core::option::Option::Some("rect"),
                    5usize => ::core::option::Option::Some("hotspot"),
                    _ => ::core::option::Option::None,
                }
            }
            fn index_of_name(&self, name: &str)
                -> ::core::option::Option<usize> {
                match name {
                    "handle" => ::core::option::Option::Some(0usize),
                    "texture_atlas" => ::core::option::Option::Some(1usize),
                    "flip_x" => ::core::option::Option::Some(2usize),
                    "flip_y" => ::core::option::Option::Some(3usize),
                    "rect" => ::core::option::Option::Some(4usize),
                    "hotspot" => ::core::option::Option::Some(5usize),
                    _ => ::core::option::Option::None,
                }
            }
            fn field_len(&self) -> usize { 6usize }
            fn iter_fields(&self) -> bevy_reflect::structs::FieldIter {
                bevy_reflect::structs::FieldIter::new(self)
            }
            fn to_dynamic_struct(&self)
                -> bevy_reflect::structs::DynamicStruct {
                let mut dynamic: bevy_reflect::structs::DynamicStruct =
                    ::core::default::Default::default();
                dynamic.set_represented_type(bevy_reflect::PartialReflect::get_represented_type_info(self));
                dynamic.insert_boxed("handle",
                    bevy_reflect::PartialReflect::to_dynamic(&self.handle));
                dynamic.insert_boxed("texture_atlas",
                    bevy_reflect::PartialReflect::to_dynamic(&self.texture_atlas));
                dynamic.insert_boxed("flip_x",
                    bevy_reflect::PartialReflect::to_dynamic(&self.flip_x));
                dynamic.insert_boxed("flip_y",
                    bevy_reflect::PartialReflect::to_dynamic(&self.flip_y));
                dynamic.insert_boxed("rect",
                    bevy_reflect::PartialReflect::to_dynamic(&self.rect));
                dynamic.insert_boxed("hotspot",
                    bevy_reflect::PartialReflect::to_dynamic(&self.hotspot));
                dynamic
            }
        }
        impl bevy_reflect::PartialReflect for CustomCursorImage where  {
            #[inline]
            fn get_represented_type_info(&self)
                -> ::core::option::Option<&'static bevy_reflect::TypeInfo> {
                ::core::option::Option::Some(<Self as
                            bevy_reflect::Typed>::type_info())
            }
            #[inline]
            fn try_apply(&mut self, value: &dyn bevy_reflect::PartialReflect)
                -> ::core::result::Result<(), bevy_reflect::ApplyError> {
                if let bevy_reflect::ReflectRef::Struct(struct_value) =
                        bevy_reflect::PartialReflect::reflect_ref(value) {
                    for (name, value) in
                        bevy_reflect::structs::Struct::iter_fields(struct_value) {
                        if let ::core::option::Option::Some(v) =
                                bevy_reflect::structs::Struct::field_mut(self, name) {
                            bevy_reflect::PartialReflect::try_apply(v, value)?;
                        }
                    }
                } else {
                    return ::core::result::Result::Err(bevy_reflect::ApplyError::MismatchedKinds {
                                from_kind: bevy_reflect::PartialReflect::reflect_kind(value),
                                to_kind: bevy_reflect::ReflectKind::Struct,
                            });
                }
                ::core::result::Result::Ok(())
            }
            #[inline]
            fn reflect_kind(&self) -> bevy_reflect::ReflectKind {
                bevy_reflect::ReflectKind::Struct
            }
            #[inline]
            fn reflect_ref(&self) -> bevy_reflect::ReflectRef {
                bevy_reflect::ReflectRef::Struct(self)
            }
            #[inline]
            fn reflect_mut(&mut self) -> bevy_reflect::ReflectMut {
                bevy_reflect::ReflectMut::Struct(self)
            }
            #[inline]
            fn reflect_owned(self:
                    bevy_reflect::__macro_exports::alloc_utils::Box<Self>)
                -> bevy_reflect::ReflectOwned {
                bevy_reflect::ReflectOwned::Struct(self)
            }
            #[inline]
            fn try_into_reflect(self:
                    bevy_reflect::__macro_exports::alloc_utils::Box<Self>)
                ->
                    ::core::result::Result<bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect>,
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::PartialReflect>> {
                ::core::result::Result::Ok(self)
            }
            #[inline]
            fn try_as_reflect(&self)
                -> ::core::option::Option<&dyn bevy_reflect::Reflect> {
                ::core::option::Option::Some(self)
            }
            #[inline]
            fn try_as_reflect_mut(&mut self)
                -> ::core::option::Option<&mut dyn bevy_reflect::Reflect> {
                ::core::option::Option::Some(self)
            }
            #[inline]
            fn into_partial_reflect(self:
                    bevy_reflect::__macro_exports::alloc_utils::Box<Self>)
                ->
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::PartialReflect> {
                self
            }
            #[inline]
            fn as_partial_reflect(&self)
                -> &dyn bevy_reflect::PartialReflect {
                self
            }
            #[inline]
            fn as_partial_reflect_mut(&mut self)
                -> &mut dyn bevy_reflect::PartialReflect {
                self
            }
            fn reflect_hash(&self) -> ::core::option::Option<u64> {
                use ::core::hash::{Hash, Hasher};
                let mut hasher = bevy_reflect::utility::reflect_hasher();
                Hash::hash(&::core::any::Any::type_id(self), &mut hasher);
                Hash::hash(self, &mut hasher);
                ::core::option::Option::Some(Hasher::finish(&hasher))
            }
            fn reflect_partial_eq(&self,
                value: &dyn bevy_reflect::PartialReflect)
                -> ::core::option::Option<bool> {
                let value =
                    <dyn bevy_reflect::PartialReflect>::try_downcast_ref::<Self>(value);
                if let ::core::option::Option::Some(value) = value {
                    ::core::option::Option::Some(::core::cmp::PartialEq::eq(self,
                            value))
                } else { ::core::option::Option::Some(false) }
            }
            fn reflect_partial_cmp(&self,
                value: &dyn bevy_reflect::PartialReflect)
                -> ::core::option::Option<::core::cmp::Ordering> {
                (bevy_reflect::structs::struct_partial_cmp)(self, value)
            }
            fn debug(&self, f: &mut ::core::fmt::Formatter<'_>)
                -> ::core::fmt::Result {
                ::core::fmt::Debug::fmt(self, f)
            }
            #[inline]
            fn reflect_clone(&self)
                ->
                    ::core::result::Result<bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect>,
                    bevy_reflect::ReflectCloneError> {
                ::core::result::Result::Ok(bevy_reflect::__macro_exports::alloc_utils::Box::new(::core::clone::Clone::clone(self)))
            }
        }
        impl bevy_reflect::FromReflect for CustomCursorImage where  {
            fn from_reflect(reflect: &dyn bevy_reflect::PartialReflect)
                -> ::core::option::Option<Self> {
                if let bevy_reflect::ReflectRef::Struct(__ref_struct) =
                        bevy_reflect::PartialReflect::reflect_ref(reflect) {
                    let mut __this =
                        <Self as ::core::default::Default>::default();
                    if let ::core::option::Option::Some(__field) =
                            (||
                                        <Handle<Image> as
                                                bevy_reflect::FromReflect>::from_reflect(bevy_reflect::structs::Struct::field(__ref_struct,
                                                    "handle")?))() {
                        __this.handle = __field;
                    }
                    if let ::core::option::Option::Some(__field) =
                            (||
                                        <Option<TextureAtlas> as
                                                bevy_reflect::FromReflect>::from_reflect(bevy_reflect::structs::Struct::field(__ref_struct,
                                                    "texture_atlas")?))() {
                        __this.texture_atlas = __field;
                    }
                    if let ::core::option::Option::Some(__field) =
                            (||
                                        <bool as
                                                bevy_reflect::FromReflect>::from_reflect(bevy_reflect::structs::Struct::field(__ref_struct,
                                                    "flip_x")?))() {
                        __this.flip_x = __field;
                    }
                    if let ::core::option::Option::Some(__field) =
                            (||
                                        <bool as
                                                bevy_reflect::FromReflect>::from_reflect(bevy_reflect::structs::Struct::field(__ref_struct,
                                                    "flip_y")?))() {
                        __this.flip_y = __field;
                    }
                    if let ::core::option::Option::Some(__field) =
                            (||
                                        <Option<URect> as
                                                bevy_reflect::FromReflect>::from_reflect(bevy_reflect::structs::Struct::field(__ref_struct,
                                                    "rect")?))() {
                        __this.rect = __field;
                    }
                    if let ::core::option::Option::Some(__field) =
                            (||
                                        <(u16, u16) as
                                                bevy_reflect::FromReflect>::from_reflect(bevy_reflect::structs::Struct::field(__ref_struct,
                                                    "hotspot")?))() {
                        __this.hotspot = __field;
                    }
                    ::core::option::Option::Some(__this)
                } else { ::core::option::Option::None }
            }
        }
    };Reflect),
16    reflect(Debug, Default, Hash, PartialEq, Clone)
17)]
18pub struct CustomCursorImage {
19    /// Handle to the image to use as the cursor. The image must be in 8 bit int
20    /// or 32 bit float rgba. PNG images work well for this.
21    pub handle: Handle<Image>,
22    /// An optional texture atlas used to render the image.
23    #[template(built_in)]
24    pub texture_atlas: Option<TextureAtlas>,
25    /// Whether the image should be flipped along its x-axis.
26    ///
27    /// If true, the cursor's `hotspot` automatically flips along with the
28    /// image.
29    pub flip_x: bool,
30    /// Whether the image should be flipped along its y-axis.
31    ///
32    /// If true, the cursor's `hotspot` automatically flips along with the
33    /// image.
34    pub flip_y: bool,
35    /// An optional rectangle representing the region of the image to render,
36    /// instead of rendering the full image. This is an easy one-off alternative
37    /// to using a [`TextureAtlas`].
38    ///
39    /// When used with a [`TextureAtlas`], the rect is offset by the atlas's
40    /// minimal (top-left) corner position.
41    pub rect: Option<URect>,
42    /// X and Y coordinates of the hotspot in pixels. The hotspot must be within
43    /// the image bounds.
44    ///
45    /// If you are flipping the image using `flip_x` or `flip_y`, you don't need
46    /// to adjust this field to account for the flip because it is adjusted
47    /// automatically.
48    pub hotspot: (u16, u16),
49}
50
51/// A custom cursor created from a URL. Note that this currently only works on the web.
52#[derive(#[automatically_derived]
impl ::core::fmt::Debug for CustomCursorUrl {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f,
            "CustomCursorUrl", "url", &self.url, "hotspot", &&self.hotspot)
    }
}Debug, #[automatically_derived]
impl ::core::clone::Clone for CustomCursorUrl {
    #[inline]
    fn clone(&self) -> CustomCursorUrl {
        CustomCursorUrl {
            url: ::core::clone::Clone::clone(&self.url),
            hotspot: ::core::clone::Clone::clone(&self.hotspot),
        }
    }
}Clone, #[automatically_derived]
impl ::core::default::Default for CustomCursorUrl {
    #[inline]
    fn default() -> CustomCursorUrl {
        CustomCursorUrl {
            url: ::core::default::Default::default(),
            hotspot: ::core::default::Default::default(),
        }
    }
}Default, #[automatically_derived]
impl ::core::cmp::PartialEq for CustomCursorUrl {
    #[inline]
    fn eq(&self, other: &CustomCursorUrl) -> bool {
        self.url == other.url && self.hotspot == other.hotspot
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for CustomCursorUrl {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<String>;
        let _: ::core::cmp::AssertParamIsEq<(u16, u16)>;
    }
}Eq, #[automatically_derived]
impl ::core::hash::Hash for CustomCursorUrl {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&self.url, state);
        ::core::hash::Hash::hash(&self.hotspot, state)
    }
}Hash)]
53#[cfg_attr(
54    feature = "bevy_reflect",
55    derive(const _: () =
    {
        impl bevy_reflect::GetTypeRegistration for CustomCursorUrl where  {
            fn get_type_registration() -> bevy_reflect::TypeRegistration {
                let mut registration =
                    bevy_reflect::TypeRegistration::of::<Self>();
                registration.insert::<bevy_reflect::ReflectFromPtr>(bevy_reflect::FromType::<Self>::from_type());
                registration.insert::<bevy_reflect::ReflectFromReflect>(bevy_reflect::FromType::<Self>::from_type());
                registration.register_type_data::<ReflectDefault, Self>();
                registration
            }
            #[inline(never)]
            fn register_type_dependencies(registry:
                    &mut bevy_reflect::TypeRegistry) {
                <String as
                        bevy_reflect::__macro_exports::RegisterForReflection>::__register(registry);
                <(u16, u16) as
                        bevy_reflect::__macro_exports::RegisterForReflection>::__register(registry);
            }
        }
        impl bevy_reflect::Typed for CustomCursorUrl where  {
            #[inline]
            fn type_info() -> &'static bevy_reflect::TypeInfo {
                static CELL: bevy_reflect::utility::NonGenericTypeInfoCell =
                    bevy_reflect::utility::NonGenericTypeInfoCell::new();
                CELL.get_or_set(||
                        {
                            bevy_reflect::TypeInfo::Struct(bevy_reflect::structs::StructInfo::new::<Self>(&[bevy_reflect::NamedField::new::<String>("url"),
                                                bevy_reflect::NamedField::new::<(u16, u16)>("hotspot")]))
                        })
            }
        }
        #[allow(deprecated, reason =
        "derives on a deprecated type shouldn't be considered a usage")]
        impl bevy_reflect::TypePath for CustomCursorUrl where  {
            fn type_path() -> &'static str {
                "bevy_window::cursor::custom_cursor::CustomCursorUrl"
            }
            fn short_type_path() -> &'static str { "CustomCursorUrl" }
            fn type_ident() -> ::core::option::Option<&'static str> {
                ::core::option::Option::Some("CustomCursorUrl")
            }
            fn crate_name() -> ::core::option::Option<&'static str> {
                ::core::option::Option::Some("bevy_window::cursor::custom_cursor".split(':').next().unwrap())
            }
            fn module_path() -> ::core::option::Option<&'static str> {
                ::core::option::Option::Some("bevy_window::cursor::custom_cursor")
            }
        }
        impl bevy_reflect::Reflect for CustomCursorUrl where  {
            #[inline]
            fn into_any(self:
                    bevy_reflect::__macro_exports::alloc_utils::Box<Self>)
                ->
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn ::core::any::Any> {
                self
            }
            #[inline]
            fn as_any(&self) -> &dyn ::core::any::Any { self }
            #[inline]
            fn as_any_mut(&mut self) -> &mut dyn ::core::any::Any { self }
            #[inline]
            fn into_reflect(self:
                    bevy_reflect::__macro_exports::alloc_utils::Box<Self>)
                ->
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect> {
                self
            }
            #[inline]
            fn as_reflect(&self) -> &dyn bevy_reflect::Reflect { self }
            #[inline]
            fn as_reflect_mut(&mut self) -> &mut dyn bevy_reflect::Reflect {
                self
            }
            #[inline]
            fn set(&mut self,
                value:
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect>)
                ->
                    ::core::result::Result<(),
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect>> {
                *self = <dyn bevy_reflect::Reflect>::take(value)?;
                ::core::result::Result::Ok(())
            }
        }
        #[allow(non_upper_case_globals)]
        const _: () =
            {
                static __INVENTORY: ::inventory::Node =
                    ::inventory::Node {
                        value: &{
                                bevy_reflect::__macro_exports::auto_register::AutomaticReflectRegistrations(<CustomCursorUrl
                                        as
                                        bevy_reflect::__macro_exports::auto_register::RegisterForReflection>::__register)
                            },
                        next: ::inventory::__private::UnsafeCell::new(::inventory::__private::Option::None),
                    };
                #[link_section = ".text.startup"]
                unsafe extern "C" fn __ctor() {
                    unsafe {
                        ::inventory::ErasedNode::submit(__INVENTORY.value,
                            &__INVENTORY)
                    }
                }
                #[used]
                #[link_section = ".init_array"]
                static __CTOR: unsafe extern "C" fn() = __ctor;
            };
        impl bevy_reflect::structs::Struct for CustomCursorUrl where  {
            fn field(&self, name: &str)
                -> ::core::option::Option<&dyn bevy_reflect::PartialReflect> {
                match name {
                    "url" => ::core::option::Option::Some(&self.url),
                    "hotspot" => ::core::option::Option::Some(&self.hotspot),
                    _ => ::core::option::Option::None,
                }
            }
            fn field_mut(&mut self, name: &str)
                ->
                    ::core::option::Option<&mut dyn bevy_reflect::PartialReflect> {
                match name {
                    "url" => ::core::option::Option::Some(&mut self.url),
                    "hotspot" =>
                        ::core::option::Option::Some(&mut self.hotspot),
                    _ => ::core::option::Option::None,
                }
            }
            fn field_at(&self, index: usize)
                -> ::core::option::Option<&dyn bevy_reflect::PartialReflect> {
                match index {
                    0usize => ::core::option::Option::Some(&self.url),
                    1usize => ::core::option::Option::Some(&self.hotspot),
                    _ => ::core::option::Option::None,
                }
            }
            fn field_at_mut(&mut self, index: usize)
                ->
                    ::core::option::Option<&mut dyn bevy_reflect::PartialReflect> {
                match index {
                    0usize => ::core::option::Option::Some(&mut self.url),
                    1usize => ::core::option::Option::Some(&mut self.hotspot),
                    _ => ::core::option::Option::None,
                }
            }
            fn name_at(&self, index: usize) -> ::core::option::Option<&str> {
                match index {
                    0usize => ::core::option::Option::Some("url"),
                    1usize => ::core::option::Option::Some("hotspot"),
                    _ => ::core::option::Option::None,
                }
            }
            fn index_of_name(&self, name: &str)
                -> ::core::option::Option<usize> {
                match name {
                    "url" => ::core::option::Option::Some(0usize),
                    "hotspot" => ::core::option::Option::Some(1usize),
                    _ => ::core::option::Option::None,
                }
            }
            fn field_len(&self) -> usize { 2usize }
            fn iter_fields(&self) -> bevy_reflect::structs::FieldIter {
                bevy_reflect::structs::FieldIter::new(self)
            }
            fn to_dynamic_struct(&self)
                -> bevy_reflect::structs::DynamicStruct {
                let mut dynamic: bevy_reflect::structs::DynamicStruct =
                    ::core::default::Default::default();
                dynamic.set_represented_type(bevy_reflect::PartialReflect::get_represented_type_info(self));
                dynamic.insert_boxed("url",
                    bevy_reflect::PartialReflect::to_dynamic(&self.url));
                dynamic.insert_boxed("hotspot",
                    bevy_reflect::PartialReflect::to_dynamic(&self.hotspot));
                dynamic
            }
        }
        impl bevy_reflect::PartialReflect for CustomCursorUrl where  {
            #[inline]
            fn get_represented_type_info(&self)
                -> ::core::option::Option<&'static bevy_reflect::TypeInfo> {
                ::core::option::Option::Some(<Self as
                            bevy_reflect::Typed>::type_info())
            }
            #[inline]
            fn try_apply(&mut self, value: &dyn bevy_reflect::PartialReflect)
                -> ::core::result::Result<(), bevy_reflect::ApplyError> {
                if let bevy_reflect::ReflectRef::Struct(struct_value) =
                        bevy_reflect::PartialReflect::reflect_ref(value) {
                    for (name, value) in
                        bevy_reflect::structs::Struct::iter_fields(struct_value) {
                        if let ::core::option::Option::Some(v) =
                                bevy_reflect::structs::Struct::field_mut(self, name) {
                            bevy_reflect::PartialReflect::try_apply(v, value)?;
                        }
                    }
                } else {
                    return ::core::result::Result::Err(bevy_reflect::ApplyError::MismatchedKinds {
                                from_kind: bevy_reflect::PartialReflect::reflect_kind(value),
                                to_kind: bevy_reflect::ReflectKind::Struct,
                            });
                }
                ::core::result::Result::Ok(())
            }
            #[inline]
            fn reflect_kind(&self) -> bevy_reflect::ReflectKind {
                bevy_reflect::ReflectKind::Struct
            }
            #[inline]
            fn reflect_ref(&self) -> bevy_reflect::ReflectRef {
                bevy_reflect::ReflectRef::Struct(self)
            }
            #[inline]
            fn reflect_mut(&mut self) -> bevy_reflect::ReflectMut {
                bevy_reflect::ReflectMut::Struct(self)
            }
            #[inline]
            fn reflect_owned(self:
                    bevy_reflect::__macro_exports::alloc_utils::Box<Self>)
                -> bevy_reflect::ReflectOwned {
                bevy_reflect::ReflectOwned::Struct(self)
            }
            #[inline]
            fn try_into_reflect(self:
                    bevy_reflect::__macro_exports::alloc_utils::Box<Self>)
                ->
                    ::core::result::Result<bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect>,
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::PartialReflect>> {
                ::core::result::Result::Ok(self)
            }
            #[inline]
            fn try_as_reflect(&self)
                -> ::core::option::Option<&dyn bevy_reflect::Reflect> {
                ::core::option::Option::Some(self)
            }
            #[inline]
            fn try_as_reflect_mut(&mut self)
                -> ::core::option::Option<&mut dyn bevy_reflect::Reflect> {
                ::core::option::Option::Some(self)
            }
            #[inline]
            fn into_partial_reflect(self:
                    bevy_reflect::__macro_exports::alloc_utils::Box<Self>)
                ->
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::PartialReflect> {
                self
            }
            #[inline]
            fn as_partial_reflect(&self)
                -> &dyn bevy_reflect::PartialReflect {
                self
            }
            #[inline]
            fn as_partial_reflect_mut(&mut self)
                -> &mut dyn bevy_reflect::PartialReflect {
                self
            }
            fn reflect_hash(&self) -> ::core::option::Option<u64> {
                use ::core::hash::{Hash, Hasher};
                let mut hasher = bevy_reflect::utility::reflect_hasher();
                Hash::hash(&::core::any::Any::type_id(self), &mut hasher);
                Hash::hash(self, &mut hasher);
                ::core::option::Option::Some(Hasher::finish(&hasher))
            }
            fn reflect_partial_eq(&self,
                value: &dyn bevy_reflect::PartialReflect)
                -> ::core::option::Option<bool> {
                let value =
                    <dyn bevy_reflect::PartialReflect>::try_downcast_ref::<Self>(value);
                if let ::core::option::Option::Some(value) = value {
                    ::core::option::Option::Some(::core::cmp::PartialEq::eq(self,
                            value))
                } else { ::core::option::Option::Some(false) }
            }
            fn reflect_partial_cmp(&self,
                value: &dyn bevy_reflect::PartialReflect)
                -> ::core::option::Option<::core::cmp::Ordering> {
                (bevy_reflect::structs::struct_partial_cmp)(self, value)
            }
            fn debug(&self, f: &mut ::core::fmt::Formatter<'_>)
                -> ::core::fmt::Result {
                ::core::fmt::Debug::fmt(self, f)
            }
            #[inline]
            fn reflect_clone(&self)
                ->
                    ::core::result::Result<bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect>,
                    bevy_reflect::ReflectCloneError> {
                ::core::result::Result::Ok(bevy_reflect::__macro_exports::alloc_utils::Box::new(::core::clone::Clone::clone(self)))
            }
        }
        impl bevy_reflect::FromReflect for CustomCursorUrl where  {
            fn from_reflect(reflect: &dyn bevy_reflect::PartialReflect)
                -> ::core::option::Option<Self> {
                if let bevy_reflect::ReflectRef::Struct(__ref_struct) =
                        bevy_reflect::PartialReflect::reflect_ref(reflect) {
                    let mut __this =
                        <Self as ::core::default::Default>::default();
                    if let ::core::option::Option::Some(__field) =
                            (||
                                        <String as
                                                bevy_reflect::FromReflect>::from_reflect(bevy_reflect::structs::Struct::field(__ref_struct,
                                                    "url")?))() {
                        __this.url = __field;
                    }
                    if let ::core::option::Option::Some(__field) =
                            (||
                                        <(u16, u16) as
                                                bevy_reflect::FromReflect>::from_reflect(bevy_reflect::structs::Struct::field(__ref_struct,
                                                    "hotspot")?))() {
                        __this.hotspot = __field;
                    }
                    ::core::option::Option::Some(__this)
                } else { ::core::option::Option::None }
            }
        }
    };Reflect),
56    reflect(Debug, Default, Hash, PartialEq, Clone)
57)]
58pub struct CustomCursorUrl {
59    /// Web URL to an image to use as the cursor. PNGs are preferred. Cursor
60    /// creation can fail if the image is invalid or not reachable.
61    pub url: String,
62    /// X and Y coordinates of the hotspot in pixels. The hotspot must be within
63    /// the image bounds.
64    pub hotspot: (u16, u16),
65}
66
67/// Custom cursor image data.
68#[derive(#[automatically_derived]
impl ::core::fmt::Debug for CustomCursor {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            CustomCursor::Image(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Image",
                    &__self_0),
            CustomCursor::Url(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Url",
                    &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::clone::Clone for CustomCursor {
    #[inline]
    fn clone(&self) -> CustomCursor {
        match self {
            CustomCursor::Image(__self_0) =>
                CustomCursor::Image(::core::clone::Clone::clone(__self_0)),
            CustomCursor::Url(__self_0) =>
                CustomCursor::Url(::core::clone::Clone::clone(__self_0)),
        }
    }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for CustomCursor {
    #[inline]
    fn eq(&self, other: &CustomCursor) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (CustomCursor::Image(__self_0), CustomCursor::Image(__arg1_0))
                    => __self_0 == __arg1_0,
                (CustomCursor::Url(__self_0), CustomCursor::Url(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => unsafe { ::core::intrinsics::unreachable() }
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for CustomCursor {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<CustomCursorImage>;
        let _: ::core::cmp::AssertParamIsEq<CustomCursorUrl>;
    }
}Eq, #[automatically_derived]
impl ::core::hash::Hash for CustomCursor {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            CustomCursor::Image(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            CustomCursor::Url(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
        }
    }
}Hash, impl ::core::default::Default for CustomCursorTemplate {
    fn default() -> Self { Self::Image(::core::default::Default::default()) }
}FromTemplate)]
69#[cfg_attr(
70    feature = "bevy_reflect",
71    derive(const _: () =
    {
        impl bevy_reflect::GetTypeRegistration for CustomCursor where  {
            fn get_type_registration() -> bevy_reflect::TypeRegistration {
                let mut registration =
                    bevy_reflect::TypeRegistration::of::<Self>();
                registration.insert::<bevy_reflect::ReflectFromPtr>(bevy_reflect::FromType::<Self>::from_type());
                registration.insert::<bevy_reflect::ReflectFromReflect>(bevy_reflect::FromType::<Self>::from_type());
                registration
            }
            #[inline(never)]
            fn register_type_dependencies(registry:
                    &mut bevy_reflect::TypeRegistry) {
                <CustomCursorImage as
                        bevy_reflect::__macro_exports::RegisterForReflection>::__register(registry);
                <CustomCursorUrl as
                        bevy_reflect::__macro_exports::RegisterForReflection>::__register(registry);
            }
        }
        impl bevy_reflect::Typed for CustomCursor where  {
            #[inline]
            fn type_info() -> &'static bevy_reflect::TypeInfo {
                static CELL: bevy_reflect::utility::NonGenericTypeInfoCell =
                    bevy_reflect::utility::NonGenericTypeInfoCell::new();
                CELL.get_or_set(||
                        {
                            bevy_reflect::TypeInfo::Enum(bevy_reflect::enums::EnumInfo::new::<Self>(&[bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("Image",
                                                        &[bevy_reflect::UnnamedField::new::<CustomCursorImage>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("Url",
                                                        &[bevy_reflect::UnnamedField::new::<CustomCursorUrl>(0usize)]))]))
                        })
            }
        }
        #[allow(deprecated, reason =
        "derives on a deprecated type shouldn't be considered a usage")]
        impl bevy_reflect::TypePath for CustomCursor where  {
            fn type_path() -> &'static str {
                "bevy_window::cursor::custom_cursor::CustomCursor"
            }
            fn short_type_path() -> &'static str { "CustomCursor" }
            fn type_ident() -> ::core::option::Option<&'static str> {
                ::core::option::Option::Some("CustomCursor")
            }
            fn crate_name() -> ::core::option::Option<&'static str> {
                ::core::option::Option::Some("bevy_window::cursor::custom_cursor".split(':').next().unwrap())
            }
            fn module_path() -> ::core::option::Option<&'static str> {
                ::core::option::Option::Some("bevy_window::cursor::custom_cursor")
            }
        }
        impl bevy_reflect::Reflect for CustomCursor where  {
            #[inline]
            fn into_any(self:
                    bevy_reflect::__macro_exports::alloc_utils::Box<Self>)
                ->
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn ::core::any::Any> {
                self
            }
            #[inline]
            fn as_any(&self) -> &dyn ::core::any::Any { self }
            #[inline]
            fn as_any_mut(&mut self) -> &mut dyn ::core::any::Any { self }
            #[inline]
            fn into_reflect(self:
                    bevy_reflect::__macro_exports::alloc_utils::Box<Self>)
                ->
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect> {
                self
            }
            #[inline]
            fn as_reflect(&self) -> &dyn bevy_reflect::Reflect { self }
            #[inline]
            fn as_reflect_mut(&mut self) -> &mut dyn bevy_reflect::Reflect {
                self
            }
            #[inline]
            fn set(&mut self,
                value:
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect>)
                ->
                    ::core::result::Result<(),
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect>> {
                *self = <dyn bevy_reflect::Reflect>::take(value)?;
                ::core::result::Result::Ok(())
            }
        }
        #[allow(non_upper_case_globals)]
        const _: () =
            {
                static __INVENTORY: ::inventory::Node =
                    ::inventory::Node {
                        value: &{
                                bevy_reflect::__macro_exports::auto_register::AutomaticReflectRegistrations(<CustomCursor
                                        as
                                        bevy_reflect::__macro_exports::auto_register::RegisterForReflection>::__register)
                            },
                        next: ::inventory::__private::UnsafeCell::new(::inventory::__private::Option::None),
                    };
                #[link_section = ".text.startup"]
                unsafe extern "C" fn __ctor() {
                    unsafe {
                        ::inventory::ErasedNode::submit(__INVENTORY.value,
                            &__INVENTORY)
                    }
                }
                #[used]
                #[link_section = ".init_array"]
                static __CTOR: unsafe extern "C" fn() = __ctor;
            };
        impl bevy_reflect::enums::Enum for CustomCursor where  {
            fn field(&self, __name_param: &str)
                -> ::core::option::Option<&dyn bevy_reflect::PartialReflect> {
                match self { _ => ::core::option::Option::None, }
            }
            fn field_at(&self, __index_param: usize)
                -> ::core::option::Option<&dyn bevy_reflect::PartialReflect> {
                match self {
                    CustomCursor::Image { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    CustomCursor::Url { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    _ => ::core::option::Option::None,
                }
            }
            fn field_mut(&mut self, __name_param: &str)
                ->
                    ::core::option::Option<&mut dyn bevy_reflect::PartialReflect> {
                match self { _ => ::core::option::Option::None, }
            }
            fn field_at_mut(&mut self, __index_param: usize)
                ->
                    ::core::option::Option<&mut dyn bevy_reflect::PartialReflect> {
                match self {
                    CustomCursor::Image { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    CustomCursor::Url { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    _ => ::core::option::Option::None,
                }
            }
            fn index_of(&self, __name_param: &str)
                -> ::core::option::Option<usize> {
                match self { _ => ::core::option::Option::None, }
            }
            fn name_at(&self, __index_param: usize)
                -> ::core::option::Option<&str> {
                match self { _ => ::core::option::Option::None, }
            }
            fn iter_fields(&self) -> bevy_reflect::enums::VariantFieldIter {
                bevy_reflect::enums::VariantFieldIter::new(self)
            }
            #[inline]
            fn field_len(&self) -> usize {
                match self {
                    CustomCursor::Image { .. } => 1usize,
                    CustomCursor::Url { .. } => 1usize,
                    _ => 0,
                }
            }
            #[inline]
            fn variant_name(&self) -> &str {
                match self {
                    CustomCursor::Image { .. } => "Image",
                    CustomCursor::Url { .. } => "Url",
                    _ =>
                        ::core::panicking::panic("internal error: entered unreachable code"),
                }
            }
            #[inline]
            fn variant_index(&self) -> usize {
                match self {
                    CustomCursor::Image { .. } => 0usize,
                    CustomCursor::Url { .. } => 1usize,
                    _ =>
                        ::core::panicking::panic("internal error: entered unreachable code"),
                }
            }
            #[inline]
            fn variant_type(&self) -> bevy_reflect::enums::VariantType {
                match self {
                    CustomCursor::Image { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    CustomCursor::Url { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    _ =>
                        ::core::panicking::panic("internal error: entered unreachable code"),
                }
            }
            fn to_dynamic_enum(&self) -> bevy_reflect::enums::DynamicEnum {
                bevy_reflect::enums::DynamicEnum::from_ref::<Self>(self)
            }
        }
        impl bevy_reflect::PartialReflect for CustomCursor where  {
            #[inline]
            fn get_represented_type_info(&self)
                -> ::core::option::Option<&'static bevy_reflect::TypeInfo> {
                ::core::option::Option::Some(<Self as
                            bevy_reflect::Typed>::type_info())
            }
            #[inline]
            fn try_apply(&mut self,
                __value_param: &dyn bevy_reflect::PartialReflect)
                -> ::core::result::Result<(), bevy_reflect::ApplyError> {
                if let bevy_reflect::ReflectRef::Enum(__value_param) =
                        bevy_reflect::PartialReflect::reflect_ref(__value_param) {
                    if bevy_reflect::enums::Enum::variant_name(self) ==
                            bevy_reflect::enums::Enum::variant_name(__value_param) {
                        match bevy_reflect::enums::Enum::variant_type(__value_param)
                            {
                            bevy_reflect::enums::VariantType::Struct => {
                                for field in
                                    bevy_reflect::enums::Enum::iter_fields(__value_param) {
                                    let name = field.name().unwrap();
                                    if let ::core::option::Option::Some(v) =
                                            bevy_reflect::enums::Enum::field_mut(self, name) {
                                        bevy_reflect::PartialReflect::try_apply(v, field.value())?;
                                    }
                                }
                            }
                            bevy_reflect::enums::VariantType::Tuple => {
                                for (index, field) in
                                    ::core::iter::Iterator::enumerate(bevy_reflect::enums::Enum::iter_fields(__value_param))
                                    {
                                    if let ::core::option::Option::Some(v) =
                                            bevy_reflect::enums::Enum::field_at_mut(self, index) {
                                        bevy_reflect::PartialReflect::try_apply(v, field.value())?;
                                    }
                                }
                            }
                            _ => {}
                        }
                    } else {
                        match bevy_reflect::enums::Enum::variant_name(__value_param)
                            {
                            "Image" => {
                                *self =
                                    CustomCursor::Image {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("Image"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <CustomCursorImage as
                                                            bevy_reflect::FromReflect>::from_reflect(__0).ok_or(bevy_reflect::ApplyError::MismatchedTypes {
                                                        from_type: ::core::convert::Into::into(bevy_reflect::DynamicTypePath::reflect_type_path(__0)),
                                                        to_type: ::core::convert::Into::into(<CustomCursorImage as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "Url" => {
                                *self =
                                    CustomCursor::Url {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("Url"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <CustomCursorUrl as
                                                            bevy_reflect::FromReflect>::from_reflect(__0).ok_or(bevy_reflect::ApplyError::MismatchedTypes {
                                                        from_type: ::core::convert::Into::into(bevy_reflect::DynamicTypePath::reflect_type_path(__0)),
                                                        to_type: ::core::convert::Into::into(<CustomCursorUrl as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            name => {
                                return ::core::result::Result::Err(bevy_reflect::ApplyError::UnknownVariant {
                                            enum_name: ::core::convert::Into::into(bevy_reflect::DynamicTypePath::reflect_type_path(self)),
                                            variant_name: ::core::convert::Into::into(name),
                                        });
                            }
                        }
                    }
                } else {
                    return ::core::result::Result::Err(bevy_reflect::ApplyError::MismatchedKinds {
                                from_kind: bevy_reflect::PartialReflect::reflect_kind(__value_param),
                                to_kind: bevy_reflect::ReflectKind::Enum,
                            });
                }
                ::core::result::Result::Ok(())
            }
            fn reflect_kind(&self) -> bevy_reflect::ReflectKind {
                bevy_reflect::ReflectKind::Enum
            }
            fn reflect_ref(&self) -> bevy_reflect::ReflectRef {
                bevy_reflect::ReflectRef::Enum(self)
            }
            fn reflect_mut(&mut self) -> bevy_reflect::ReflectMut {
                bevy_reflect::ReflectMut::Enum(self)
            }
            fn reflect_owned(self:
                    bevy_reflect::__macro_exports::alloc_utils::Box<Self>)
                -> bevy_reflect::ReflectOwned {
                bevy_reflect::ReflectOwned::Enum(self)
            }
            #[inline]
            fn try_into_reflect(self:
                    bevy_reflect::__macro_exports::alloc_utils::Box<Self>)
                ->
                    ::core::result::Result<bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect>,
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::PartialReflect>> {
                ::core::result::Result::Ok(self)
            }
            #[inline]
            fn try_as_reflect(&self)
                -> ::core::option::Option<&dyn bevy_reflect::Reflect> {
                ::core::option::Option::Some(self)
            }
            #[inline]
            fn try_as_reflect_mut(&mut self)
                -> ::core::option::Option<&mut dyn bevy_reflect::Reflect> {
                ::core::option::Option::Some(self)
            }
            #[inline]
            fn into_partial_reflect(self:
                    bevy_reflect::__macro_exports::alloc_utils::Box<Self>)
                ->
                    bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::PartialReflect> {
                self
            }
            #[inline]
            fn as_partial_reflect(&self)
                -> &dyn bevy_reflect::PartialReflect {
                self
            }
            #[inline]
            fn as_partial_reflect_mut(&mut self)
                -> &mut dyn bevy_reflect::PartialReflect {
                self
            }
            fn reflect_hash(&self) -> ::core::option::Option<u64> {
                use ::core::hash::{Hash, Hasher};
                let mut hasher = bevy_reflect::utility::reflect_hasher();
                Hash::hash(&::core::any::Any::type_id(self), &mut hasher);
                Hash::hash(self, &mut hasher);
                ::core::option::Option::Some(Hasher::finish(&hasher))
            }
            fn reflect_partial_eq(&self,
                value: &dyn bevy_reflect::PartialReflect)
                -> ::core::option::Option<bool> {
                let value =
                    <dyn bevy_reflect::PartialReflect>::try_downcast_ref::<Self>(value);
                if let ::core::option::Option::Some(value) = value {
                    ::core::option::Option::Some(::core::cmp::PartialEq::eq(self,
                            value))
                } else { ::core::option::Option::Some(false) }
            }
            fn reflect_partial_cmp(&self,
                value: &dyn bevy_reflect::PartialReflect)
                -> ::core::option::Option<::core::cmp::Ordering> {
                (bevy_reflect::enums::enum_partial_cmp)(self, value)
            }
            #[inline]
            fn reflect_clone(&self)
                ->
                    ::core::result::Result<bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect>,
                    bevy_reflect::ReflectCloneError> {
                ::core::result::Result::Ok(bevy_reflect::__macro_exports::alloc_utils::Box::new(::core::clone::Clone::clone(self)))
            }
        }
        impl bevy_reflect::FromReflect for CustomCursor where  {
            fn from_reflect(__param0: &dyn bevy_reflect::PartialReflect)
                -> ::core::option::Option<Self> {
                if let bevy_reflect::ReflectRef::Enum(__param0) =
                        bevy_reflect::PartialReflect::reflect_ref(__param0) {
                    match bevy_reflect::enums::Enum::variant_name(__param0) {
                        "Image" =>
                            ::core::option::Option::Some(CustomCursor::Image {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <CustomCursorImage as
                                                    bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "Url" =>
                            ::core::option::Option::Some(CustomCursor::Url {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <CustomCursorUrl as
                                                    bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        name => ::core::option::Option::None,
                    }
                } else { ::core::option::Option::None }
            }
        }
    };Reflect),
72    reflect(Clone, PartialEq, Hash)
73)]
74pub enum CustomCursor {
75    #[default]
76    /// Use an image as the cursor.
77    Image(CustomCursorImage),
78    /// Use a URL to an image as the cursor. Note that this currently only works on the web.
79    Url(CustomCursorUrl),
80}
81
82impl From<CustomCursor> for CursorIcon {
83    fn from(cursor: CustomCursor) -> Self {
84        CursorIcon::Custom(cursor)
85    }
86}