Skip to main content

bevy_text/
text_edit.rs

1use bevy_clipboard::ClipboardRead;
2use bevy_math::Vec2;
3use bevy_reflect::Reflect;
4use parley::PlainEditorDriver;
5use smol_str::SmolStr;
6
7use crate::TextBrush;
8
9/// A selection within IME preedit text, expressed as byte offsets from the start of the preedit.
10///
11/// The anchor and focus map directly onto parley's `Selection::new(anchor, focus)` when
12/// the preedit is applied. If `anchor == focus`, the selection is a caret.
13///
14/// This corresponds to [`ImePredit::Commit.cursor`](https://docs.rs/bevy/latest/bevy/prelude/enum.Ime.html#variant.Preedit.field.cursor)
15/// from `bevy_window`.
16#[derive(#[automatically_derived]
impl ::core::fmt::Debug for PreeditCursor {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f, "PreeditCursor",
            "anchor", &self.anchor, "focus", &&self.focus)
    }
}Debug, #[automatically_derived]
impl ::core::clone::Clone for PreeditCursor {
    #[inline]
    fn clone(&self) -> PreeditCursor {
        let _: ::core::clone::AssertParamIsClone<usize>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for PreeditCursor { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for PreeditCursor {
    #[inline]
    fn eq(&self, other: &PreeditCursor) -> bool {
        self.anchor == other.anchor && self.focus == other.focus
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for PreeditCursor {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<usize>;
    }
}Eq, const _: () =
    {
        impl bevy_reflect::GetTypeRegistration for PreeditCursor 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) {
                <usize as
                        bevy_reflect::__macro_exports::RegisterForReflection>::__register(registry);
            }
        }
        impl bevy_reflect::Typed for PreeditCursor 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::<usize>("anchor"),
                                                bevy_reflect::NamedField::new::<usize>("focus")]))
                        })
            }
        }
        #[allow(deprecated, reason =
        "derives on a deprecated type shouldn't be considered a usage")]
        impl bevy_reflect::TypePath for PreeditCursor where  {
            fn type_path() -> &'static str {
                "bevy_text::text_edit::PreeditCursor"
            }
            fn short_type_path() -> &'static str { "PreeditCursor" }
            fn type_ident() -> ::core::option::Option<&'static str> {
                ::core::option::Option::Some("PreeditCursor")
            }
            fn crate_name() -> ::core::option::Option<&'static str> {
                ::core::option::Option::Some("bevy_text::text_edit".split(':').next().unwrap())
            }
            fn module_path() -> ::core::option::Option<&'static str> {
                ::core::option::Option::Some("bevy_text::text_edit")
            }
        }
        impl bevy_reflect::Reflect for PreeditCursor 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(<PreeditCursor
                                        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 PreeditCursor where  {
            fn field(&self, name: &str)
                -> ::core::option::Option<&dyn bevy_reflect::PartialReflect> {
                match name {
                    "anchor" => ::core::option::Option::Some(&self.anchor),
                    "focus" => ::core::option::Option::Some(&self.focus),
                    _ => ::core::option::Option::None,
                }
            }
            fn field_mut(&mut self, name: &str)
                ->
                    ::core::option::Option<&mut dyn bevy_reflect::PartialReflect> {
                match name {
                    "anchor" => ::core::option::Option::Some(&mut self.anchor),
                    "focus" => ::core::option::Option::Some(&mut self.focus),
                    _ => ::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.anchor),
                    1usize => ::core::option::Option::Some(&self.focus),
                    _ => ::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.anchor),
                    1usize => ::core::option::Option::Some(&mut self.focus),
                    _ => ::core::option::Option::None,
                }
            }
            fn name_at(&self, index: usize) -> ::core::option::Option<&str> {
                match index {
                    0usize => ::core::option::Option::Some("anchor"),
                    1usize => ::core::option::Option::Some("focus"),
                    _ => ::core::option::Option::None,
                }
            }
            fn index_of_name(&self, name: &str)
                -> ::core::option::Option<usize> {
                match name {
                    "anchor" => ::core::option::Option::Some(0usize),
                    "focus" => ::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("anchor",
                    bevy_reflect::PartialReflect::to_dynamic(&self.anchor));
                dynamic.insert_boxed("focus",
                    bevy_reflect::PartialReflect::to_dynamic(&self.focus));
                dynamic
            }
        }
        impl bevy_reflect::PartialReflect for PreeditCursor 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_partial_eq(&self,
                value: &dyn bevy_reflect::PartialReflect)
                -> ::core::option::Option<bool> {
                (bevy_reflect::structs::struct_partial_eq)(self, value)
            }
            fn reflect_partial_cmp(&self,
                value: &dyn bevy_reflect::PartialReflect)
                -> ::core::option::Option<::core::cmp::Ordering> {
                (bevy_reflect::structs::struct_partial_cmp)(self, value)
            }
            #[inline]
            #[allow(unreachable_code, reason =
            "Ignored fields without a `clone` attribute will early-return with an error")]
            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(Self {
                            anchor: <usize as
                                        bevy_reflect::PartialReflect>::reflect_clone_and_take(&self.anchor)?,
                            focus: <usize as
                                        bevy_reflect::PartialReflect>::reflect_clone_and_take(&self.focus)?,
                        }))
            }
        }
        impl bevy_reflect::FromReflect for PreeditCursor 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 __this =
                        Self {
                            anchor: <usize as
                                        bevy_reflect::FromReflect>::from_reflect(bevy_reflect::structs::Struct::field(__ref_struct,
                                            "anchor")?)?,
                            focus: <usize as
                                        bevy_reflect::FromReflect>::from_reflect(bevy_reflect::structs::Struct::field(__ref_struct,
                                            "focus")?)?,
                        };
                    ::core::option::Option::Some(__this)
                } else { ::core::option::Option::None }
            }
        }
    };Reflect)]
17pub struct PreeditCursor {
18    /// Anchor byte offset within the preedit text.
19    pub anchor: usize,
20    /// Focus (caret) byte offset within the preedit text.
21    pub focus: usize,
22}
23
24/// Deferred text input edit and navigation actions applied by the `apply_text_edits` system.
25#[derive(#[automatically_derived]
impl ::core::fmt::Debug for TextEdit {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            TextEdit::Copy => ::core::fmt::Formatter::write_str(f, "Copy"),
            TextEdit::Cut => ::core::fmt::Formatter::write_str(f, "Cut"),
            TextEdit::Paste => ::core::fmt::Formatter::write_str(f, "Paste"),
            TextEdit::Insert(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Insert",
                    &__self_0),
            TextEdit::Backspace =>
                ::core::fmt::Formatter::write_str(f, "Backspace"),
            TextEdit::BackspaceWord =>
                ::core::fmt::Formatter::write_str(f, "BackspaceWord"),
            TextEdit::Delete =>
                ::core::fmt::Formatter::write_str(f, "Delete"),
            TextEdit::DeleteWord =>
                ::core::fmt::Formatter::write_str(f, "DeleteWord"),
            TextEdit::Left(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Left",
                    &__self_0),
            TextEdit::Right(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Right",
                    &__self_0),
            TextEdit::WordLeft(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "WordLeft", &__self_0),
            TextEdit::WordRight(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "WordRight", &__self_0),
            TextEdit::Up(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Up",
                    &__self_0),
            TextEdit::Down(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Down",
                    &__self_0),
            TextEdit::TextStart(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "TextStart", &__self_0),
            TextEdit::TextEnd(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "TextEnd", &__self_0),
            TextEdit::HardLineStart(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "HardLineStart", &__self_0),
            TextEdit::HardLineEnd(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "HardLineEnd", &__self_0),
            TextEdit::LineStart(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "LineStart", &__self_0),
            TextEdit::LineEnd(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "LineEnd", &__self_0),
            TextEdit::CollapseSelection =>
                ::core::fmt::Formatter::write_str(f, "CollapseSelection"),
            TextEdit::SelectAll =>
                ::core::fmt::Formatter::write_str(f, "SelectAll"),
            TextEdit::SelectAllIfCollapsed =>
                ::core::fmt::Formatter::write_str(f, "SelectAllIfCollapsed"),
            TextEdit::MoveToPoint(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "MoveToPoint", &__self_0),
            TextEdit::SelectWordAtPoint(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "SelectWordAtPoint", &__self_0),
            TextEdit::SelectLineAtPoint(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "SelectLineAtPoint", &__self_0),
            TextEdit::SelectedHardLineAtPoint(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "SelectedHardLineAtPoint", &__self_0),
            TextEdit::ExtendSelectionToPoint(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ExtendSelectionToPoint", &__self_0),
            TextEdit::ShiftClickExtension(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "ShiftClickExtension", &__self_0),
            TextEdit::ImeSetCompose { value: __self_0, cursor: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "ImeSetCompose", "value", __self_0, "cursor", &__self_1),
            TextEdit::ImeCommit { value: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "ImeCommit", "value", &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::clone::Clone for TextEdit {
    #[inline]
    fn clone(&self) -> TextEdit {
        match self {
            TextEdit::Copy => TextEdit::Copy,
            TextEdit::Cut => TextEdit::Cut,
            TextEdit::Paste => TextEdit::Paste,
            TextEdit::Insert(__self_0) =>
                TextEdit::Insert(::core::clone::Clone::clone(__self_0)),
            TextEdit::Backspace => TextEdit::Backspace,
            TextEdit::BackspaceWord => TextEdit::BackspaceWord,
            TextEdit::Delete => TextEdit::Delete,
            TextEdit::DeleteWord => TextEdit::DeleteWord,
            TextEdit::Left(__self_0) =>
                TextEdit::Left(::core::clone::Clone::clone(__self_0)),
            TextEdit::Right(__self_0) =>
                TextEdit::Right(::core::clone::Clone::clone(__self_0)),
            TextEdit::WordLeft(__self_0) =>
                TextEdit::WordLeft(::core::clone::Clone::clone(__self_0)),
            TextEdit::WordRight(__self_0) =>
                TextEdit::WordRight(::core::clone::Clone::clone(__self_0)),
            TextEdit::Up(__self_0) =>
                TextEdit::Up(::core::clone::Clone::clone(__self_0)),
            TextEdit::Down(__self_0) =>
                TextEdit::Down(::core::clone::Clone::clone(__self_0)),
            TextEdit::TextStart(__self_0) =>
                TextEdit::TextStart(::core::clone::Clone::clone(__self_0)),
            TextEdit::TextEnd(__self_0) =>
                TextEdit::TextEnd(::core::clone::Clone::clone(__self_0)),
            TextEdit::HardLineStart(__self_0) =>
                TextEdit::HardLineStart(::core::clone::Clone::clone(__self_0)),
            TextEdit::HardLineEnd(__self_0) =>
                TextEdit::HardLineEnd(::core::clone::Clone::clone(__self_0)),
            TextEdit::LineStart(__self_0) =>
                TextEdit::LineStart(::core::clone::Clone::clone(__self_0)),
            TextEdit::LineEnd(__self_0) =>
                TextEdit::LineEnd(::core::clone::Clone::clone(__self_0)),
            TextEdit::CollapseSelection => TextEdit::CollapseSelection,
            TextEdit::SelectAll => TextEdit::SelectAll,
            TextEdit::SelectAllIfCollapsed => TextEdit::SelectAllIfCollapsed,
            TextEdit::MoveToPoint(__self_0) =>
                TextEdit::MoveToPoint(::core::clone::Clone::clone(__self_0)),
            TextEdit::SelectWordAtPoint(__self_0) =>
                TextEdit::SelectWordAtPoint(::core::clone::Clone::clone(__self_0)),
            TextEdit::SelectLineAtPoint(__self_0) =>
                TextEdit::SelectLineAtPoint(::core::clone::Clone::clone(__self_0)),
            TextEdit::SelectedHardLineAtPoint(__self_0) =>
                TextEdit::SelectedHardLineAtPoint(::core::clone::Clone::clone(__self_0)),
            TextEdit::ExtendSelectionToPoint(__self_0) =>
                TextEdit::ExtendSelectionToPoint(::core::clone::Clone::clone(__self_0)),
            TextEdit::ShiftClickExtension(__self_0) =>
                TextEdit::ShiftClickExtension(::core::clone::Clone::clone(__self_0)),
            TextEdit::ImeSetCompose { value: __self_0, cursor: __self_1 } =>
                TextEdit::ImeSetCompose {
                    value: ::core::clone::Clone::clone(__self_0),
                    cursor: ::core::clone::Clone::clone(__self_1),
                },
            TextEdit::ImeCommit { value: __self_0 } =>
                TextEdit::ImeCommit {
                    value: ::core::clone::Clone::clone(__self_0),
                },
        }
    }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for TextEdit {
    #[inline]
    fn eq(&self, other: &TextEdit) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (TextEdit::Insert(__self_0), TextEdit::Insert(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (TextEdit::Left(__self_0), TextEdit::Left(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (TextEdit::Right(__self_0), TextEdit::Right(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (TextEdit::WordLeft(__self_0), TextEdit::WordLeft(__arg1_0))
                    => __self_0 == __arg1_0,
                (TextEdit::WordRight(__self_0), TextEdit::WordRight(__arg1_0))
                    => __self_0 == __arg1_0,
                (TextEdit::Up(__self_0), TextEdit::Up(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (TextEdit::Down(__self_0), TextEdit::Down(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (TextEdit::TextStart(__self_0), TextEdit::TextStart(__arg1_0))
                    => __self_0 == __arg1_0,
                (TextEdit::TextEnd(__self_0), TextEdit::TextEnd(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (TextEdit::HardLineStart(__self_0),
                    TextEdit::HardLineStart(__arg1_0)) => __self_0 == __arg1_0,
                (TextEdit::HardLineEnd(__self_0),
                    TextEdit::HardLineEnd(__arg1_0)) => __self_0 == __arg1_0,
                (TextEdit::LineStart(__self_0), TextEdit::LineStart(__arg1_0))
                    => __self_0 == __arg1_0,
                (TextEdit::LineEnd(__self_0), TextEdit::LineEnd(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (TextEdit::MoveToPoint(__self_0),
                    TextEdit::MoveToPoint(__arg1_0)) => __self_0 == __arg1_0,
                (TextEdit::SelectWordAtPoint(__self_0),
                    TextEdit::SelectWordAtPoint(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (TextEdit::SelectLineAtPoint(__self_0),
                    TextEdit::SelectLineAtPoint(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (TextEdit::SelectedHardLineAtPoint(__self_0),
                    TextEdit::SelectedHardLineAtPoint(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (TextEdit::ExtendSelectionToPoint(__self_0),
                    TextEdit::ExtendSelectionToPoint(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (TextEdit::ShiftClickExtension(__self_0),
                    TextEdit::ShiftClickExtension(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (TextEdit::ImeSetCompose { value: __self_0, cursor: __self_1
                    }, TextEdit::ImeSetCompose {
                    value: __arg1_0, cursor: __arg1_1 }) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (TextEdit::ImeCommit { value: __self_0 },
                    TextEdit::ImeCommit { value: __arg1_0 }) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, const _: () =
    {
        impl bevy_reflect::GetTypeRegistration for TextEdit 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) {
                <SmolStr as
                        bevy_reflect::__macro_exports::RegisterForReflection>::__register(registry);
                <bool as
                        bevy_reflect::__macro_exports::RegisterForReflection>::__register(registry);
                <Vec2 as
                        bevy_reflect::__macro_exports::RegisterForReflection>::__register(registry);
                <Option<PreeditCursor> as
                        bevy_reflect::__macro_exports::RegisterForReflection>::__register(registry);
            }
        }
        impl bevy_reflect::Typed for TextEdit 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::Unit(bevy_reflect::enums::UnitVariantInfo::new("Copy")),
                                                bevy_reflect::enums::VariantInfo::Unit(bevy_reflect::enums::UnitVariantInfo::new("Cut")),
                                                bevy_reflect::enums::VariantInfo::Unit(bevy_reflect::enums::UnitVariantInfo::new("Paste")),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("Insert",
                                                        &[bevy_reflect::UnnamedField::new::<SmolStr>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Unit(bevy_reflect::enums::UnitVariantInfo::new("Backspace")),
                                                bevy_reflect::enums::VariantInfo::Unit(bevy_reflect::enums::UnitVariantInfo::new("BackspaceWord")),
                                                bevy_reflect::enums::VariantInfo::Unit(bevy_reflect::enums::UnitVariantInfo::new("Delete")),
                                                bevy_reflect::enums::VariantInfo::Unit(bevy_reflect::enums::UnitVariantInfo::new("DeleteWord")),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("Left",
                                                        &[bevy_reflect::UnnamedField::new::<bool>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("Right",
                                                        &[bevy_reflect::UnnamedField::new::<bool>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("WordLeft",
                                                        &[bevy_reflect::UnnamedField::new::<bool>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("WordRight",
                                                        &[bevy_reflect::UnnamedField::new::<bool>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("Up",
                                                        &[bevy_reflect::UnnamedField::new::<bool>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("Down",
                                                        &[bevy_reflect::UnnamedField::new::<bool>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("TextStart",
                                                        &[bevy_reflect::UnnamedField::new::<bool>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("TextEnd",
                                                        &[bevy_reflect::UnnamedField::new::<bool>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("HardLineStart",
                                                        &[bevy_reflect::UnnamedField::new::<bool>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("HardLineEnd",
                                                        &[bevy_reflect::UnnamedField::new::<bool>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("LineStart",
                                                        &[bevy_reflect::UnnamedField::new::<bool>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("LineEnd",
                                                        &[bevy_reflect::UnnamedField::new::<bool>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Unit(bevy_reflect::enums::UnitVariantInfo::new("CollapseSelection")),
                                                bevy_reflect::enums::VariantInfo::Unit(bevy_reflect::enums::UnitVariantInfo::new("SelectAll")),
                                                bevy_reflect::enums::VariantInfo::Unit(bevy_reflect::enums::UnitVariantInfo::new("SelectAllIfCollapsed")),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("MoveToPoint",
                                                        &[bevy_reflect::UnnamedField::new::<Vec2>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("SelectWordAtPoint",
                                                        &[bevy_reflect::UnnamedField::new::<Vec2>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("SelectLineAtPoint",
                                                        &[bevy_reflect::UnnamedField::new::<Vec2>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("SelectedHardLineAtPoint",
                                                        &[bevy_reflect::UnnamedField::new::<Vec2>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("ExtendSelectionToPoint",
                                                        &[bevy_reflect::UnnamedField::new::<Vec2>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Tuple(bevy_reflect::enums::TupleVariantInfo::new("ShiftClickExtension",
                                                        &[bevy_reflect::UnnamedField::new::<Vec2>(0usize)])),
                                                bevy_reflect::enums::VariantInfo::Struct(bevy_reflect::enums::StructVariantInfo::new("ImeSetCompose",
                                                        &[bevy_reflect::NamedField::new::<SmolStr>("value"),
                                                                    bevy_reflect::NamedField::new::<Option<PreeditCursor>>("cursor")])),
                                                bevy_reflect::enums::VariantInfo::Struct(bevy_reflect::enums::StructVariantInfo::new("ImeCommit",
                                                        &[bevy_reflect::NamedField::new::<SmolStr>("value")]))]))
                        })
            }
        }
        #[allow(deprecated, reason =
        "derives on a deprecated type shouldn't be considered a usage")]
        impl bevy_reflect::TypePath for TextEdit where  {
            fn type_path() -> &'static str {
                "bevy_text::text_edit::TextEdit"
            }
            fn short_type_path() -> &'static str { "TextEdit" }
            fn type_ident() -> ::core::option::Option<&'static str> {
                ::core::option::Option::Some("TextEdit")
            }
            fn crate_name() -> ::core::option::Option<&'static str> {
                ::core::option::Option::Some("bevy_text::text_edit".split(':').next().unwrap())
            }
            fn module_path() -> ::core::option::Option<&'static str> {
                ::core::option::Option::Some("bevy_text::text_edit")
            }
        }
        impl bevy_reflect::Reflect for TextEdit 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(<TextEdit
                                        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 TextEdit where  {
            fn field(&self, __name_param: &str)
                -> ::core::option::Option<&dyn bevy_reflect::PartialReflect> {
                match self {
                    TextEdit::ImeSetCompose { value: __value, .. } if
                        __name_param == "value" =>
                        ::core::option::Option::Some(__value),
                    TextEdit::ImeSetCompose { cursor: __value, .. } if
                        __name_param == "cursor" =>
                        ::core::option::Option::Some(__value),
                    TextEdit::ImeCommit { value: __value, .. } if
                        __name_param == "value" =>
                        ::core::option::Option::Some(__value),
                    _ => ::core::option::Option::None,
                }
            }
            fn field_at(&self, __index_param: usize)
                -> ::core::option::Option<&dyn bevy_reflect::PartialReflect> {
                match self {
                    TextEdit::Insert { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::Left { 0: __value, .. } if __index_param == 0usize
                        => ::core::option::Option::Some(__value),
                    TextEdit::Right { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::WordLeft { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::WordRight { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::Up { 0: __value, .. } if __index_param == 0usize
                        => ::core::option::Option::Some(__value),
                    TextEdit::Down { 0: __value, .. } if __index_param == 0usize
                        => ::core::option::Option::Some(__value),
                    TextEdit::TextStart { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::TextEnd { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::HardLineStart { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::HardLineEnd { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::LineStart { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::LineEnd { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::MoveToPoint { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::SelectWordAtPoint { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::SelectLineAtPoint { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::SelectedHardLineAtPoint { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::ExtendSelectionToPoint { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::ShiftClickExtension { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::ImeSetCompose { value: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::ImeSetCompose { cursor: __value, .. } if
                        __index_param == 1usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::ImeCommit { value: __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 {
                    TextEdit::ImeSetCompose { value: __value, .. } if
                        __name_param == "value" =>
                        ::core::option::Option::Some(__value),
                    TextEdit::ImeSetCompose { cursor: __value, .. } if
                        __name_param == "cursor" =>
                        ::core::option::Option::Some(__value),
                    TextEdit::ImeCommit { value: __value, .. } if
                        __name_param == "value" =>
                        ::core::option::Option::Some(__value),
                    _ => ::core::option::Option::None,
                }
            }
            fn field_at_mut(&mut self, __index_param: usize)
                ->
                    ::core::option::Option<&mut dyn bevy_reflect::PartialReflect> {
                match self {
                    TextEdit::Insert { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::Left { 0: __value, .. } if __index_param == 0usize
                        => ::core::option::Option::Some(__value),
                    TextEdit::Right { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::WordLeft { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::WordRight { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::Up { 0: __value, .. } if __index_param == 0usize
                        => ::core::option::Option::Some(__value),
                    TextEdit::Down { 0: __value, .. } if __index_param == 0usize
                        => ::core::option::Option::Some(__value),
                    TextEdit::TextStart { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::TextEnd { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::HardLineStart { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::HardLineEnd { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::LineStart { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::LineEnd { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::MoveToPoint { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::SelectWordAtPoint { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::SelectLineAtPoint { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::SelectedHardLineAtPoint { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::ExtendSelectionToPoint { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::ShiftClickExtension { 0: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::ImeSetCompose { value: __value, .. } if
                        __index_param == 0usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::ImeSetCompose { cursor: __value, .. } if
                        __index_param == 1usize =>
                        ::core::option::Option::Some(__value),
                    TextEdit::ImeCommit { value: __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 {
                    TextEdit::ImeSetCompose { .. } if __name_param == "value" =>
                        ::core::option::Option::Some(0usize),
                    TextEdit::ImeSetCompose { .. } if __name_param == "cursor"
                        => ::core::option::Option::Some(1usize),
                    TextEdit::ImeCommit { .. } if __name_param == "value" =>
                        ::core::option::Option::Some(0usize),
                    _ => ::core::option::Option::None,
                }
            }
            fn name_at(&self, __index_param: usize)
                -> ::core::option::Option<&str> {
                match self {
                    TextEdit::ImeSetCompose { .. } if __index_param == 0usize =>
                        ::core::option::Option::Some("value"),
                    TextEdit::ImeSetCompose { .. } if __index_param == 1usize =>
                        ::core::option::Option::Some("cursor"),
                    TextEdit::ImeCommit { .. } if __index_param == 0usize =>
                        ::core::option::Option::Some("value"),
                    _ => ::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 {
                    TextEdit::Copy { .. } => 0usize,
                    TextEdit::Cut { .. } => 0usize,
                    TextEdit::Paste { .. } => 0usize,
                    TextEdit::Insert { .. } => 1usize,
                    TextEdit::Backspace { .. } => 0usize,
                    TextEdit::BackspaceWord { .. } => 0usize,
                    TextEdit::Delete { .. } => 0usize,
                    TextEdit::DeleteWord { .. } => 0usize,
                    TextEdit::Left { .. } => 1usize,
                    TextEdit::Right { .. } => 1usize,
                    TextEdit::WordLeft { .. } => 1usize,
                    TextEdit::WordRight { .. } => 1usize,
                    TextEdit::Up { .. } => 1usize,
                    TextEdit::Down { .. } => 1usize,
                    TextEdit::TextStart { .. } => 1usize,
                    TextEdit::TextEnd { .. } => 1usize,
                    TextEdit::HardLineStart { .. } => 1usize,
                    TextEdit::HardLineEnd { .. } => 1usize,
                    TextEdit::LineStart { .. } => 1usize,
                    TextEdit::LineEnd { .. } => 1usize,
                    TextEdit::CollapseSelection { .. } => 0usize,
                    TextEdit::SelectAll { .. } => 0usize,
                    TextEdit::SelectAllIfCollapsed { .. } => 0usize,
                    TextEdit::MoveToPoint { .. } => 1usize,
                    TextEdit::SelectWordAtPoint { .. } => 1usize,
                    TextEdit::SelectLineAtPoint { .. } => 1usize,
                    TextEdit::SelectedHardLineAtPoint { .. } => 1usize,
                    TextEdit::ExtendSelectionToPoint { .. } => 1usize,
                    TextEdit::ShiftClickExtension { .. } => 1usize,
                    TextEdit::ImeSetCompose { .. } => 2usize,
                    TextEdit::ImeCommit { .. } => 1usize,
                    _ => 0,
                }
            }
            #[inline]
            fn variant_name(&self) -> &str {
                match self {
                    TextEdit::Copy { .. } => "Copy",
                    TextEdit::Cut { .. } => "Cut",
                    TextEdit::Paste { .. } => "Paste",
                    TextEdit::Insert { .. } => "Insert",
                    TextEdit::Backspace { .. } => "Backspace",
                    TextEdit::BackspaceWord { .. } => "BackspaceWord",
                    TextEdit::Delete { .. } => "Delete",
                    TextEdit::DeleteWord { .. } => "DeleteWord",
                    TextEdit::Left { .. } => "Left",
                    TextEdit::Right { .. } => "Right",
                    TextEdit::WordLeft { .. } => "WordLeft",
                    TextEdit::WordRight { .. } => "WordRight",
                    TextEdit::Up { .. } => "Up",
                    TextEdit::Down { .. } => "Down",
                    TextEdit::TextStart { .. } => "TextStart",
                    TextEdit::TextEnd { .. } => "TextEnd",
                    TextEdit::HardLineStart { .. } => "HardLineStart",
                    TextEdit::HardLineEnd { .. } => "HardLineEnd",
                    TextEdit::LineStart { .. } => "LineStart",
                    TextEdit::LineEnd { .. } => "LineEnd",
                    TextEdit::CollapseSelection { .. } => "CollapseSelection",
                    TextEdit::SelectAll { .. } => "SelectAll",
                    TextEdit::SelectAllIfCollapsed { .. } =>
                        "SelectAllIfCollapsed",
                    TextEdit::MoveToPoint { .. } => "MoveToPoint",
                    TextEdit::SelectWordAtPoint { .. } => "SelectWordAtPoint",
                    TextEdit::SelectLineAtPoint { .. } => "SelectLineAtPoint",
                    TextEdit::SelectedHardLineAtPoint { .. } =>
                        "SelectedHardLineAtPoint",
                    TextEdit::ExtendSelectionToPoint { .. } =>
                        "ExtendSelectionToPoint",
                    TextEdit::ShiftClickExtension { .. } =>
                        "ShiftClickExtension",
                    TextEdit::ImeSetCompose { .. } => "ImeSetCompose",
                    TextEdit::ImeCommit { .. } => "ImeCommit",
                    _ =>
                        ::core::panicking::panic("internal error: entered unreachable code"),
                }
            }
            #[inline]
            fn variant_index(&self) -> usize {
                match self {
                    TextEdit::Copy { .. } => 0usize,
                    TextEdit::Cut { .. } => 1usize,
                    TextEdit::Paste { .. } => 2usize,
                    TextEdit::Insert { .. } => 3usize,
                    TextEdit::Backspace { .. } => 4usize,
                    TextEdit::BackspaceWord { .. } => 5usize,
                    TextEdit::Delete { .. } => 6usize,
                    TextEdit::DeleteWord { .. } => 7usize,
                    TextEdit::Left { .. } => 8usize,
                    TextEdit::Right { .. } => 9usize,
                    TextEdit::WordLeft { .. } => 10usize,
                    TextEdit::WordRight { .. } => 11usize,
                    TextEdit::Up { .. } => 12usize,
                    TextEdit::Down { .. } => 13usize,
                    TextEdit::TextStart { .. } => 14usize,
                    TextEdit::TextEnd { .. } => 15usize,
                    TextEdit::HardLineStart { .. } => 16usize,
                    TextEdit::HardLineEnd { .. } => 17usize,
                    TextEdit::LineStart { .. } => 18usize,
                    TextEdit::LineEnd { .. } => 19usize,
                    TextEdit::CollapseSelection { .. } => 20usize,
                    TextEdit::SelectAll { .. } => 21usize,
                    TextEdit::SelectAllIfCollapsed { .. } => 22usize,
                    TextEdit::MoveToPoint { .. } => 23usize,
                    TextEdit::SelectWordAtPoint { .. } => 24usize,
                    TextEdit::SelectLineAtPoint { .. } => 25usize,
                    TextEdit::SelectedHardLineAtPoint { .. } => 26usize,
                    TextEdit::ExtendSelectionToPoint { .. } => 27usize,
                    TextEdit::ShiftClickExtension { .. } => 28usize,
                    TextEdit::ImeSetCompose { .. } => 29usize,
                    TextEdit::ImeCommit { .. } => 30usize,
                    _ =>
                        ::core::panicking::panic("internal error: entered unreachable code"),
                }
            }
            #[inline]
            fn variant_type(&self) -> bevy_reflect::enums::VariantType {
                match self {
                    TextEdit::Copy { .. } =>
                        bevy_reflect::enums::VariantType::Unit,
                    TextEdit::Cut { .. } =>
                        bevy_reflect::enums::VariantType::Unit,
                    TextEdit::Paste { .. } =>
                        bevy_reflect::enums::VariantType::Unit,
                    TextEdit::Insert { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::Backspace { .. } =>
                        bevy_reflect::enums::VariantType::Unit,
                    TextEdit::BackspaceWord { .. } =>
                        bevy_reflect::enums::VariantType::Unit,
                    TextEdit::Delete { .. } =>
                        bevy_reflect::enums::VariantType::Unit,
                    TextEdit::DeleteWord { .. } =>
                        bevy_reflect::enums::VariantType::Unit,
                    TextEdit::Left { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::Right { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::WordLeft { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::WordRight { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::Up { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::Down { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::TextStart { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::TextEnd { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::HardLineStart { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::HardLineEnd { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::LineStart { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::LineEnd { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::CollapseSelection { .. } =>
                        bevy_reflect::enums::VariantType::Unit,
                    TextEdit::SelectAll { .. } =>
                        bevy_reflect::enums::VariantType::Unit,
                    TextEdit::SelectAllIfCollapsed { .. } =>
                        bevy_reflect::enums::VariantType::Unit,
                    TextEdit::MoveToPoint { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::SelectWordAtPoint { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::SelectLineAtPoint { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::SelectedHardLineAtPoint { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::ExtendSelectionToPoint { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::ShiftClickExtension { .. } =>
                        bevy_reflect::enums::VariantType::Tuple,
                    TextEdit::ImeSetCompose { .. } =>
                        bevy_reflect::enums::VariantType::Struct,
                    TextEdit::ImeCommit { .. } =>
                        bevy_reflect::enums::VariantType::Struct,
                    _ =>
                        ::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 TextEdit 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)
                            {
                            "Copy" => { *self = TextEdit::Copy {} }
                            "Cut" => { *self = TextEdit::Cut {} }
                            "Paste" => { *self = TextEdit::Paste {} }
                            "Insert" => {
                                *self =
                                    TextEdit::Insert {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("Insert"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <SmolStr 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(<SmolStr as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "Backspace" => { *self = TextEdit::Backspace {} }
                            "BackspaceWord" => { *self = TextEdit::BackspaceWord {} }
                            "Delete" => { *self = TextEdit::Delete {} }
                            "DeleteWord" => { *self = TextEdit::DeleteWord {} }
                            "Left" => {
                                *self =
                                    TextEdit::Left {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("Left"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <bool 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(<bool as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "Right" => {
                                *self =
                                    TextEdit::Right {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("Right"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <bool 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(<bool as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "WordLeft" => {
                                *self =
                                    TextEdit::WordLeft {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("WordLeft"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <bool 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(<bool as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "WordRight" => {
                                *self =
                                    TextEdit::WordRight {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("WordRight"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <bool 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(<bool as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "Up" => {
                                *self =
                                    TextEdit::Up {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("Up"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <bool 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(<bool as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "Down" => {
                                *self =
                                    TextEdit::Down {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("Down"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <bool 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(<bool as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "TextStart" => {
                                *self =
                                    TextEdit::TextStart {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("TextStart"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <bool 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(<bool as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "TextEnd" => {
                                *self =
                                    TextEdit::TextEnd {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("TextEnd"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <bool 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(<bool as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "HardLineStart" => {
                                *self =
                                    TextEdit::HardLineStart {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("HardLineStart"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <bool 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(<bool as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "HardLineEnd" => {
                                *self =
                                    TextEdit::HardLineEnd {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("HardLineEnd"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <bool 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(<bool as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "LineStart" => {
                                *self =
                                    TextEdit::LineStart {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("LineStart"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <bool 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(<bool as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "LineEnd" => {
                                *self =
                                    TextEdit::LineEnd {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("LineEnd"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <bool 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(<bool as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "CollapseSelection" => {
                                *self = TextEdit::CollapseSelection {}
                            }
                            "SelectAll" => { *self = TextEdit::SelectAll {} }
                            "SelectAllIfCollapsed" => {
                                *self = TextEdit::SelectAllIfCollapsed {}
                            }
                            "MoveToPoint" => {
                                *self =
                                    TextEdit::MoveToPoint {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("MoveToPoint"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <Vec2 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(<Vec2 as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "SelectWordAtPoint" => {
                                *self =
                                    TextEdit::SelectWordAtPoint {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("SelectWordAtPoint"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <Vec2 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(<Vec2 as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "SelectLineAtPoint" => {
                                *self =
                                    TextEdit::SelectLineAtPoint {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("SelectLineAtPoint"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <Vec2 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(<Vec2 as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "SelectedHardLineAtPoint" => {
                                *self =
                                    TextEdit::SelectedHardLineAtPoint {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("SelectedHardLineAtPoint"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <Vec2 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(<Vec2 as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "ExtendSelectionToPoint" => {
                                *self =
                                    TextEdit::ExtendSelectionToPoint {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("ExtendSelectionToPoint"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <Vec2 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(<Vec2 as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "ShiftClickExtension" => {
                                *self =
                                    TextEdit::ShiftClickExtension {
                                        0: {
                                            let __0 = __value_param.field_at(0usize);
                                            let __0 =
                                                __0.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("ShiftClickExtension"),
                                                            field_name: ::core::convert::Into::into(".0"),
                                                        })?;
                                            <Vec2 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(<Vec2 as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "ImeSetCompose" => {
                                *self =
                                    TextEdit::ImeSetCompose {
                                        value: {
                                            let __value = __value_param.field("value");
                                            let __value =
                                                __value.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("ImeSetCompose"),
                                                            field_name: ::core::convert::Into::into("value"),
                                                        })?;
                                            <SmolStr as
                                                            bevy_reflect::FromReflect>::from_reflect(__value).ok_or(bevy_reflect::ApplyError::MismatchedTypes {
                                                        from_type: ::core::convert::Into::into(bevy_reflect::DynamicTypePath::reflect_type_path(__value)),
                                                        to_type: ::core::convert::Into::into(<SmolStr as
                                                                    bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                        cursor: {
                                            let __cursor = __value_param.field("cursor");
                                            let __cursor =
                                                __cursor.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("ImeSetCompose"),
                                                            field_name: ::core::convert::Into::into("cursor"),
                                                        })?;
                                            <Option<PreeditCursor> as
                                                            bevy_reflect::FromReflect>::from_reflect(__cursor).ok_or(bevy_reflect::ApplyError::MismatchedTypes {
                                                        from_type: ::core::convert::Into::into(bevy_reflect::DynamicTypePath::reflect_type_path(__cursor)),
                                                        to_type: ::core::convert::Into::into(<Option<PreeditCursor>
                                                                    as bevy_reflect::TypePath>::type_path()),
                                                    })?
                                        },
                                    }
                            }
                            "ImeCommit" => {
                                *self =
                                    TextEdit::ImeCommit {
                                        value: {
                                            let __value = __value_param.field("value");
                                            let __value =
                                                __value.ok_or(bevy_reflect::ApplyError::MissingEnumField {
                                                            variant_name: ::core::convert::Into::into("ImeCommit"),
                                                            field_name: ::core::convert::Into::into("value"),
                                                        })?;
                                            <SmolStr as
                                                            bevy_reflect::FromReflect>::from_reflect(__value).ok_or(bevy_reflect::ApplyError::MismatchedTypes {
                                                        from_type: ::core::convert::Into::into(bevy_reflect::DynamicTypePath::reflect_type_path(__value)),
                                                        to_type: ::core::convert::Into::into(<SmolStr 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> {
                (bevy_reflect::enums::enum_hash)(self)
            }
            fn reflect_partial_eq(&self,
                value: &dyn bevy_reflect::PartialReflect)
                -> ::core::option::Option<bool> {
                (bevy_reflect::enums::enum_partial_eq)(self, value)
            }
            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]
            #[allow(unreachable_code, reason =
            "Ignored fields without a `clone` attribute will early-return with an error")]
            fn reflect_clone(&self)
                ->
                    ::core::result::Result<bevy_reflect::__macro_exports::alloc_utils::Box<dyn bevy_reflect::Reflect>,
                    bevy_reflect::ReflectCloneError> {
                let this = self;
                ::core::result::Result::Ok(bevy_reflect::__macro_exports::alloc_utils::Box::new(match this
                            {
                            TextEdit::Copy {} => TextEdit::Copy {},
                            TextEdit::Cut {} => TextEdit::Cut {},
                            TextEdit::Paste {} => TextEdit::Paste {},
                            TextEdit::Insert { 0: __0 } =>
                                TextEdit::Insert {
                                    0: <SmolStr as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::Backspace {} => TextEdit::Backspace {},
                            TextEdit::BackspaceWord {} => TextEdit::BackspaceWord {},
                            TextEdit::Delete {} => TextEdit::Delete {},
                            TextEdit::DeleteWord {} => TextEdit::DeleteWord {},
                            TextEdit::Left { 0: __0 } =>
                                TextEdit::Left {
                                    0: <bool as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::Right { 0: __0 } =>
                                TextEdit::Right {
                                    0: <bool as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::WordLeft { 0: __0 } =>
                                TextEdit::WordLeft {
                                    0: <bool as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::WordRight { 0: __0 } =>
                                TextEdit::WordRight {
                                    0: <bool as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::Up { 0: __0 } =>
                                TextEdit::Up {
                                    0: <bool as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::Down { 0: __0 } =>
                                TextEdit::Down {
                                    0: <bool as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::TextStart { 0: __0 } =>
                                TextEdit::TextStart {
                                    0: <bool as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::TextEnd { 0: __0 } =>
                                TextEdit::TextEnd {
                                    0: <bool as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::HardLineStart { 0: __0 } =>
                                TextEdit::HardLineStart {
                                    0: <bool as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::HardLineEnd { 0: __0 } =>
                                TextEdit::HardLineEnd {
                                    0: <bool as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::LineStart { 0: __0 } =>
                                TextEdit::LineStart {
                                    0: <bool as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::LineEnd { 0: __0 } =>
                                TextEdit::LineEnd {
                                    0: <bool as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::CollapseSelection {} =>
                                TextEdit::CollapseSelection {},
                            TextEdit::SelectAll {} => TextEdit::SelectAll {},
                            TextEdit::SelectAllIfCollapsed {} =>
                                TextEdit::SelectAllIfCollapsed {},
                            TextEdit::MoveToPoint { 0: __0 } =>
                                TextEdit::MoveToPoint {
                                    0: <Vec2 as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::SelectWordAtPoint { 0: __0 } =>
                                TextEdit::SelectWordAtPoint {
                                    0: <Vec2 as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::SelectLineAtPoint { 0: __0 } =>
                                TextEdit::SelectLineAtPoint {
                                    0: <Vec2 as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::SelectedHardLineAtPoint { 0: __0 } =>
                                TextEdit::SelectedHardLineAtPoint {
                                    0: <Vec2 as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::ExtendSelectionToPoint { 0: __0 } =>
                                TextEdit::ExtendSelectionToPoint {
                                    0: <Vec2 as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::ShiftClickExtension { 0: __0 } =>
                                TextEdit::ShiftClickExtension {
                                    0: <Vec2 as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__0)?,
                                },
                            TextEdit::ImeSetCompose { value: __value, cursor: __cursor }
                                =>
                                TextEdit::ImeSetCompose {
                                    value: <SmolStr as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__value)?,
                                    cursor: <Option<PreeditCursor> as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__cursor)?,
                                },
                            TextEdit::ImeCommit { value: __value } =>
                                TextEdit::ImeCommit {
                                    value: <SmolStr as
                                                bevy_reflect::PartialReflect>::reflect_clone_and_take(__value)?,
                                },
                        }))
            }
        }
        impl bevy_reflect::FromReflect for TextEdit 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) {
                        "Copy" => ::core::option::Option::Some(TextEdit::Copy {}),
                        "Cut" => ::core::option::Option::Some(TextEdit::Cut {}),
                        "Paste" => ::core::option::Option::Some(TextEdit::Paste {}),
                        "Insert" =>
                            ::core::option::Option::Some(TextEdit::Insert {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <SmolStr as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "Backspace" =>
                            ::core::option::Option::Some(TextEdit::Backspace {}),
                        "BackspaceWord" =>
                            ::core::option::Option::Some(TextEdit::BackspaceWord {}),
                        "Delete" =>
                            ::core::option::Option::Some(TextEdit::Delete {}),
                        "DeleteWord" =>
                            ::core::option::Option::Some(TextEdit::DeleteWord {}),
                        "Left" =>
                            ::core::option::Option::Some(TextEdit::Left {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <bool as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "Right" =>
                            ::core::option::Option::Some(TextEdit::Right {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <bool as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "WordLeft" =>
                            ::core::option::Option::Some(TextEdit::WordLeft {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <bool as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "WordRight" =>
                            ::core::option::Option::Some(TextEdit::WordRight {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <bool as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "Up" =>
                            ::core::option::Option::Some(TextEdit::Up {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <bool as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "Down" =>
                            ::core::option::Option::Some(TextEdit::Down {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <bool as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "TextStart" =>
                            ::core::option::Option::Some(TextEdit::TextStart {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <bool as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "TextEnd" =>
                            ::core::option::Option::Some(TextEdit::TextEnd {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <bool as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "HardLineStart" =>
                            ::core::option::Option::Some(TextEdit::HardLineStart {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <bool as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "HardLineEnd" =>
                            ::core::option::Option::Some(TextEdit::HardLineEnd {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <bool as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "LineStart" =>
                            ::core::option::Option::Some(TextEdit::LineStart {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <bool as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "LineEnd" =>
                            ::core::option::Option::Some(TextEdit::LineEnd {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <bool as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "CollapseSelection" =>
                            ::core::option::Option::Some(TextEdit::CollapseSelection {}),
                        "SelectAll" =>
                            ::core::option::Option::Some(TextEdit::SelectAll {}),
                        "SelectAllIfCollapsed" =>
                            ::core::option::Option::Some(TextEdit::SelectAllIfCollapsed {}),
                        "MoveToPoint" =>
                            ::core::option::Option::Some(TextEdit::MoveToPoint {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <Vec2 as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "SelectWordAtPoint" =>
                            ::core::option::Option::Some(TextEdit::SelectWordAtPoint {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <Vec2 as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "SelectLineAtPoint" =>
                            ::core::option::Option::Some(TextEdit::SelectLineAtPoint {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <Vec2 as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "SelectedHardLineAtPoint" =>
                            ::core::option::Option::Some(TextEdit::SelectedHardLineAtPoint {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <Vec2 as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "ExtendSelectionToPoint" =>
                            ::core::option::Option::Some(TextEdit::ExtendSelectionToPoint {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <Vec2 as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "ShiftClickExtension" =>
                            ::core::option::Option::Some(TextEdit::ShiftClickExtension {
                                    0: {
                                        let __0 = __param0.field_at(0usize);
                                        let __0 = __0?;
                                        <Vec2 as bevy_reflect::FromReflect>::from_reflect(__0)?
                                    },
                                }),
                        "ImeSetCompose" =>
                            ::core::option::Option::Some(TextEdit::ImeSetCompose {
                                    value: {
                                        let __value = __param0.field("value");
                                        let __value = __value?;
                                        <SmolStr as
                                                    bevy_reflect::FromReflect>::from_reflect(__value)?
                                    },
                                    cursor: {
                                        let __cursor = __param0.field("cursor");
                                        let __cursor = __cursor?;
                                        <Option<PreeditCursor> as
                                                    bevy_reflect::FromReflect>::from_reflect(__cursor)?
                                    },
                                }),
                        "ImeCommit" =>
                            ::core::option::Option::Some(TextEdit::ImeCommit {
                                    value: {
                                        let __value = __param0.field("value");
                                        let __value = __value?;
                                        <SmolStr as
                                                    bevy_reflect::FromReflect>::from_reflect(__value)?
                                    },
                                }),
                        name => ::core::option::Option::None,
                    }
                } else { ::core::option::Option::None }
            }
        }
    };Reflect)]
26pub enum TextEdit {
27    /// Copy the current selection into the clipboard.
28    ///
29    /// Typically generated in response to copy commands such as Ctrl + C or Cmd + C.
30    Copy,
31    /// Copy the current selection into the clipboard, and the delete the selected text.
32    ///
33    /// Typically generated in response to cut commands such as Ctrl + X or Cmd + X.
34    Cut,
35    /// Paste the current clipboard contents at the cursor. If there is a selection, replaces the selection with the clipboard contents instead.
36    ///
37    /// Typically generated in response to paste commands such as Ctrl + V or Cmd + V.
38    Paste,
39    /// Insert a character or string at the cursor. If there is a selection, replaces the selection with the character instead.
40    ///
41    /// Ordinarily, this is derived from `bevy_input::keyboard::KeyboardInput::logical_key`,
42    /// which stores a [`SmolStr`] inside of the `Key::Character` variant, which may represent multiple bytes.
43    Insert(SmolStr),
44    /// Delete the character behind the cursor.
45    /// If there is a selection, deletes the selection instead.
46    ///
47    /// Typically generated in response to the Backspace key.
48    ///
49    /// This operation removes an entire Unicode grapheme cluster, which may consist of multiple bytes,
50    /// shifting the cursor position accordingly.
51    Backspace,
52    /// Delete the word behind the cursor.
53    /// If there is a selection, deletes the selection instead.
54    ///
55    /// Typically generated in response to Ctrl + Backspace or Option + Backspace.
56    BackspaceWord,
57    /// Delete the character at the cursor.
58    /// If there is a selection, deletes the selection instead.
59    ///
60    /// Typically generated in response to the Delete key.
61    ///
62    /// This operation removes an entire Unicode grapheme cluster, which may consist of multiple bytes,
63    /// shifting the cursor position accordingly.
64    Delete,
65    /// Delete the word at the cursor.
66    /// If there is a selection, deletes the selection instead.
67    ///
68    /// Typically generated in response to Ctrl + Delete or Option + Delete.
69    DeleteWord,
70    /// Moves the cursor by one position to the left.
71    /// `true` moves and extends selection.
72    ///
73    /// Typically generated in response to the Left key.
74    Left(bool),
75    /// Moves the cursor by one position to the right.
76    /// `true` moves and extends selection.
77    ///
78    /// Typically generated in response to the Right key.
79    Right(bool),
80    /// Moves the cursor a word to the left.
81    /// `true` moves and extends selection.
82    ///
83    /// Typically generated in response to Ctrl + Left or Option + Left.
84    WordLeft(bool),
85    /// Moves the cursor a word to the right.
86    /// `true` moves and extends selection.
87    ///
88    /// Typically generated in response to Ctrl + Right or Option + Right.
89    WordRight(bool),
90    /// Moves the cursor up by one visual line.
91    /// `true` moves and extends selection.
92    ///
93    /// Typically generated in response to the Up key.
94    Up(bool),
95    /// Moves the cursor down by one visual line.
96    /// `true` moves and extends selection.
97    ///
98    /// Typically generated in response to the Down key.
99    Down(bool),
100    /// Moves the cursor to the start of the text.
101    /// `true` moves and extends selection.
102    ///
103    /// Typically generated in response to Ctrl + Home or Command + Up.
104    TextStart(bool),
105    /// Moves the cursor to the end of the text.
106    /// `true` moves and extends selection.
107    ///
108    /// Typically generated in response to Ctrl + End or Command + Down.
109    TextEnd(bool),
110    /// Moves the cursor to the start of the current hard line.
111    /// A hardline is a line separated by a newline character.
112    /// `true` moves and extends selection.
113    ///
114    /// Typically generated in response to Command + Left.
115    HardLineStart(bool),
116    /// Moves the cursor to the end of the current hard line.
117    /// `true` moves and extends selection.
118    ///
119    /// Typically generated in response to Command + Right.
120    HardLineEnd(bool),
121    /// Moves the cursor to the start of the current visual line.
122    /// `true` moves and extends selection.
123    ///
124    /// Typically generated in response to the Home key.
125    LineStart(bool),
126    /// Moves the cursor to the end of the current visual line.
127    /// `true` moves and extends selection.
128    ///
129    /// Typically generated in response to the End key.
130    LineEnd(bool),
131    /// Collapses the current selection to a caret.
132    ///
133    /// Typically generated in response to the Escape key.
134    CollapseSelection,
135    /// Selects all text.
136    ///
137    /// Typically generated in response to select-all commands such as Ctrl + A or Cmd + A.
138    SelectAll,
139    /// Selects all text if the current selection is collapsed.
140    ///
141    /// Typically generated in response to a chain of focus gained by pointer press into
142    /// pointer release events.
143    SelectAllIfCollapsed,
144    /// Moves the cursor to the given point.
145    ///
146    /// Typically generated in response to a pointer press within the text area.
147    MoveToPoint(Vec2),
148    /// Selects the word at the given point.
149    ///
150    /// Typically generated in response to a double-click within the text area.
151    SelectWordAtPoint(Vec2),
152    /// Selects the line at the given point.
153    ///
154    /// A line here means a single row of glyphs, all sharing the same baseline.
155    ///
156    /// Typically generated in response to a triple-click within the text area.
157    SelectLineAtPoint(Vec2),
158    /// Selects the hard line at the given point.
159    ///
160    /// A “hard line” is the portion of text between explicit newline characters.
161    ///
162    /// Typically generated in response to a triple-click within the text area.
163    SelectedHardLineAtPoint(Vec2),
164    /// Extends the current selection to the given point.
165    ///
166    /// Typically generated in response to dragging a pointer within the text area.
167    ExtendSelectionToPoint(Vec2),
168    /// Extends the current selection from the existing anchor to the given point.
169    ///
170    /// Typically generated in response to shift-clicking within the text area.
171    ShiftClickExtension(Vec2),
172    /// Set the IME preedit/composing text at the cursor, or clear it if `value` is empty.
173    ///
174    /// The preedit text is excluded from [`EditableText::value`](crate::EditableText::value).
175    /// `cursor` describes the selection within the preedit text, or `None` to hide the cursor.
176    ///
177    /// Passing an empty `value` clears any in-progress composition; `cursor` is ignored in
178    /// that case. Use [`TextEdit::clear_ime_compose`] as a convenience constructor.
179    ///
180    /// Typically generated in response to [`bevy_window::Ime::Preedit`] events.
181    ///
182    /// [`bevy_window::Ime::Preedit`]: https://docs.rs/bevy/latest/bevy/prelude/enum.Ime.html#variant.Preedit
183    ImeSetCompose {
184        /// The current preedit string. An empty string clears the composition.
185        value: SmolStr,
186        /// Selection within the preedit text, or `None` to hide the cursor.
187        cursor: Option<PreeditCursor>,
188    },
189    /// Accept IME composition and insert `value` at the cursor.
190    ///
191    /// Clears any in-progress preedit first, then inserts the committed string,
192    /// respecting [`EditableText::max_characters`](crate::EditableText::max_characters)
193    /// and the `char_filter`.
194    ///
195    /// Typically generated in response to [`bevy_window::Ime::Commit`] events.
196    ///
197    /// [`bevy_window::Ime::Commit`]: https://docs.rs/bevy/latest/bevy/prelude/enum.Ime.html#variant.Commit
198    ImeCommit {
199        /// The committed text to insert at the cursor.
200        value: SmolStr,
201    },
202}
203
204impl TextEdit {
205    /// Convenience constructor for a [`TextEdit::ImeSetCompose`] that clears the preedit.
206    pub fn clear_ime_compose() -> Self {
207        Self::ImeSetCompose {
208            value: SmolStr::new_inline(""),
209            cursor: None,
210        }
211    }
212
213    /// Apply the [`TextEdit`] to the text editor driver.
214    ///
215    /// Note that some edits, such as [`TextEdit::Paste`], may need to be deferred across frames due to asynchronous clipboard I/O.
216    /// For proper handling of deferred edits, use [`EditableText::apply_pending_edits`](super::EditableText::apply_pending_edits) instead,
217    /// which manages the queuing and application of edits by storing them in the [`EditableText`](super::EditableText) component.
218    pub fn apply<'a>(
219        self,
220        driver: &'a mut PlainEditorDriver<TextBrush>,
221        clipboard: &mut bevy_clipboard::Clipboard,
222        max_characters: Option<usize>,
223        char_filter: impl Fn(char) -> bool,
224    ) {
225        match self {
226            TextEdit::Copy => {
227                if let Some(text) = driver.editor.selected_text()
228                    && let Err(e) = clipboard.set_text(text)
229                {
230                    {
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event src/text_edit.rs:230",
                        "bevy_text::text_edit", ::tracing::Level::WARN,
                        ::tracing_core::__macro_support::Option::Some("src/text_edit.rs"),
                        ::tracing_core::__macro_support::Option::Some(230u32),
                        ::tracing_core::__macro_support::Option::Some("bevy_text::text_edit"),
                        ::tracing_core::field::FieldSet::new(&["message"],
                            ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::WARN <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::WARN <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("Failed to write selection to clipboard: {0:?}",
                                                    e) as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};bevy_log::warn!("Failed to write selection to clipboard: {e:?}");
231                }
232            }
233            TextEdit::Cut => {
234                if let Some(text) = driver.editor.selected_text() {
235                    match clipboard.set_text(text) {
236                        Ok(()) => driver.delete(),
237                        Err(e) => {
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event src/text_edit.rs:237",
                        "bevy_text::text_edit", ::tracing::Level::WARN,
                        ::tracing_core::__macro_support::Option::Some("src/text_edit.rs"),
                        ::tracing_core::__macro_support::Option::Some(237u32),
                        ::tracing_core::__macro_support::Option::Some("bevy_text::text_edit"),
                        ::tracing_core::field::FieldSet::new(&["message"],
                            ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::WARN <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::WARN <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("Failed to write selection to clipboard: {0:?}",
                                                    e) as &dyn ::tracing::field::Value))])
            });
    } else { ; }
}bevy_log::warn!("Failed to write selection to clipboard: {e:?}"),
238                    }
239                }
240            }
241            TextEdit::Paste => {
242                // It's nice to be able to provide apply as a public method, but Paste is a little buggy.
243                // We'll try our best since that works on native, but we should warn users away from doing so.
244                {
    {
        static SHOULD_FIRE: ::bevy_utils::OnceFlag =
            ::bevy_utils::OnceFlag::new();
        if SHOULD_FIRE.set() {
            {
                use ::tracing::__macro_support::Callsite as _;
                static __CALLSITE: ::tracing::callsite::DefaultCallsite =
                    {
                        static META: ::tracing::Metadata<'static> =
                            {
                                ::tracing_core::metadata::Metadata::new("event src/text_edit.rs:244",
                                    "bevy_text::text_edit", ::tracing::Level::WARN,
                                    ::tracing_core::__macro_support::Option::Some("src/text_edit.rs"),
                                    ::tracing_core::__macro_support::Option::Some(244u32),
                                    ::tracing_core::__macro_support::Option::Some("bevy_text::text_edit"),
                                    ::tracing_core::field::FieldSet::new(&["message"],
                                        ::tracing_core::callsite::Identifier(&__CALLSITE)),
                                    ::tracing::metadata::Kind::EVENT)
                            };
                        ::tracing::callsite::DefaultCallsite::new(&META)
                    };
                let enabled =
                    ::tracing::Level::WARN <=
                                ::tracing::level_filters::STATIC_MAX_LEVEL &&
                            ::tracing::Level::WARN <=
                                ::tracing::level_filters::LevelFilter::current() &&
                        {
                            let interest = __CALLSITE.interest();
                            !interest.is_never() &&
                                ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                                    interest)
                        };
                if enabled {
                    (|value_set: ::tracing::field::ValueSet|
                                {
                                    let meta = __CALLSITE.metadata();
                                    ::tracing::Event::dispatch(meta, &value_set);
                                    ;
                                })({
                            #[allow(unused_imports)]
                            use ::tracing::field::{debug, display, Value};
                            __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("Directly applying a Paste edit is not recommended, as it cannot defer asynchronous clipboard reads.\n                    For proper handling of async clipboard operations, use `EditableText::apply_pending_edits` instead.")
                                                        as &dyn ::tracing::field::Value))])
                        });
                } else { ; }
            };
        }
    }
};bevy_log::warn_once!("Directly applying a Paste edit is not recommended, as it cannot defer asynchronous clipboard reads.
245                    For proper handling of async clipboard operations, use `EditableText::apply_pending_edits` instead.");
246
247                let mut read = clipboard.fetch_text();
248                poll_and_apply_paste(&mut read, driver, max_characters, char_filter);
249            }
250            TextEdit::Insert(text) => {
251                let _ = insert_filtered(driver, text.as_str(), max_characters, char_filter);
252            }
253            TextEdit::Backspace => driver.backdelete(),
254            TextEdit::BackspaceWord => driver.backdelete_word(),
255            TextEdit::Delete => driver.delete(),
256            TextEdit::DeleteWord => driver.delete_word(),
257            TextEdit::Left(false) => driver.move_left(),
258            TextEdit::Right(false) => driver.move_right(),
259            TextEdit::WordLeft(false) => driver.move_word_left(),
260            TextEdit::WordRight(false) => driver.move_word_right(),
261            TextEdit::Up(false) => driver.move_up(),
262            TextEdit::Down(false) => driver.move_down(),
263            TextEdit::TextStart(false) => driver.move_to_text_start(),
264            TextEdit::TextEnd(false) => driver.move_to_text_end(),
265            TextEdit::HardLineStart(false) => driver.move_to_hard_line_start(),
266            TextEdit::HardLineEnd(false) => driver.move_to_hard_line_end(),
267            TextEdit::LineStart(false) => driver.move_to_line_start(),
268            TextEdit::LineEnd(false) => driver.move_to_line_end(),
269            TextEdit::Left(true) => driver.select_left(),
270            TextEdit::Right(true) => driver.select_right(),
271            TextEdit::WordLeft(true) => driver.select_word_left(),
272            TextEdit::WordRight(true) => driver.select_word_right(),
273            TextEdit::Up(true) => driver.select_up(),
274            TextEdit::Down(true) => driver.select_down(),
275            TextEdit::TextStart(true) => driver.select_to_text_start(),
276            TextEdit::TextEnd(true) => driver.select_to_text_end(),
277            TextEdit::HardLineStart(true) => driver.select_to_hard_line_start(),
278            TextEdit::HardLineEnd(true) => driver.select_to_hard_line_end(),
279            TextEdit::LineStart(true) => driver.select_to_line_start(),
280            TextEdit::LineEnd(true) => driver.select_to_line_end(),
281            TextEdit::CollapseSelection => driver.collapse_selection(),
282            TextEdit::SelectAll => driver.select_all(),
283            TextEdit::SelectAllIfCollapsed => {
284                if driver.editor.raw_selection().is_collapsed() {
285                    driver.select_all();
286                }
287            }
288            TextEdit::MoveToPoint(point) => driver.move_to_point(point.x, point.y),
289            TextEdit::SelectWordAtPoint(point) => driver.select_word_at_point(point.x, point.y),
290            TextEdit::SelectLineAtPoint(point) => driver.select_line_at_point(point.x, point.y),
291            TextEdit::SelectedHardLineAtPoint(point) => {
292                driver.select_hard_line_at_point(point.x, point.y);
293            }
294            TextEdit::ExtendSelectionToPoint(point) => {
295                driver.extend_selection_to_point(point.x, point.y);
296            }
297            TextEdit::ShiftClickExtension(point) => driver.shift_click_extension(point.x, point.y),
298            TextEdit::ImeSetCompose { value, cursor } => {
299                if value.is_empty() {
300                    driver.clear_compose();
301                } else {
302                    let cursor = cursor.map(|c| (c.anchor, c.focus));
303                    driver.set_compose(&value, cursor);
304                }
305            }
306            TextEdit::ImeCommit { value: text } => {
307                driver.clear_compose();
308                if text.chars().all(&char_filter)
309                    && max_characters.is_none_or(|max| {
310                        driver.editor.text().chars().count() + text.chars().count() <= max
311                    })
312                {
313                    driver.insert_or_replace_selection(text.as_str());
314                }
315            }
316        }
317    }
318}
319
320/// Reason an [`insert_filtered`] call was rejected.
321///
322/// The two branches matter to callers (paste warns on [`CharFilter`](Self::CharFilter) but
323/// not on [`MaxLength`](Self::MaxLength)), so a bool return wouldn't suffice.
324enum InsertRejection {
325    /// At least one character failed the user-supplied filter.
326    CharFilter,
327    /// The insertion would exceed `max_characters`.
328    MaxLength,
329}
330
331/// Insert (or replace the current selection with) `text`, subject to the char filter and
332/// `max_characters`.
333///
334/// Shared by [`TextEdit::Insert`] and [`TextEdit::Paste`] paths to ensure consistent behavior.
335fn insert_filtered(
336    driver: &mut PlainEditorDriver<TextBrush>,
337    text: &str,
338    max_characters: Option<usize>,
339    char_filter: impl Fn(char) -> bool,
340) -> Result<(), InsertRejection> {
341    if !text.chars().all(char_filter) {
342        return Err(InsertRejection::CharFilter);
343    }
344    if let Some(max) = max_characters {
345        let select_len = driver
346            .editor
347            .selected_text()
348            .map(str::chars)
349            .map(Iterator::count)
350            .unwrap_or(0);
351        if max < driver.editor.text().chars().count() - select_len + text.chars().count() {
352            return Err(InsertRejection::MaxLength);
353        }
354    }
355    driver.insert_or_replace_selection(text);
356    Ok(())
357}
358
359/// Polls a clipboard read and, if ready, applies the resulting text as a paste.
360///
361/// Returns `true` when the read has resolved (applied, filter-rejected, or errored)
362/// and the caller should move on.
363/// Returns `false` when the read is still pending
364/// and the caller should hold onto the [`ClipboardRead`] to poll again on a later frame.
365pub(crate) fn poll_and_apply_paste(
366    read: &mut ClipboardRead,
367    driver: &mut PlainEditorDriver<TextBrush>,
368    max_characters: Option<usize>,
369    char_filter: impl Fn(char) -> bool,
370) -> bool {
371    match read.poll_result() {
372        Some(Ok(text)) => {
373            if #[allow(non_exhaustive_omitted_patterns)] match insert_filtered(driver, &text,
        max_characters, char_filter) {
    Err(InsertRejection::CharFilter) => true,
    _ => false,
}matches!(
374                insert_filtered(driver, &text, max_characters, char_filter),
375                Err(InsertRejection::CharFilter)
376            ) {
377                {
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event src/text_edit.rs:377",
                        "bevy_text::text_edit", ::tracing::Level::DEBUG,
                        ::tracing_core::__macro_support::Option::Some("src/text_edit.rs"),
                        ::tracing_core::__macro_support::Option::Some(377u32),
                        ::tracing_core::__macro_support::Option::Some("bevy_text::text_edit"),
                        ::tracing_core::field::FieldSet::new(&["message"],
                            ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::DEBUG <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::DEBUG <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("Paste rejected: clipboard contents contained characters not allowed by the char filter.")
                                            as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};bevy_log::debug!(
378                    "Paste rejected: clipboard contents contained characters not allowed by the char filter."
379                );
380            }
381            true
382        }
383        Some(Err(e)) => {
384            {
    use ::tracing::__macro_support::Callsite as _;
    static __CALLSITE: ::tracing::callsite::DefaultCallsite =
        {
            static META: ::tracing::Metadata<'static> =
                {
                    ::tracing_core::metadata::Metadata::new("event src/text_edit.rs:384",
                        "bevy_text::text_edit", ::tracing::Level::WARN,
                        ::tracing_core::__macro_support::Option::Some("src/text_edit.rs"),
                        ::tracing_core::__macro_support::Option::Some(384u32),
                        ::tracing_core::__macro_support::Option::Some("bevy_text::text_edit"),
                        ::tracing_core::field::FieldSet::new(&["message"],
                            ::tracing_core::callsite::Identifier(&__CALLSITE)),
                        ::tracing::metadata::Kind::EVENT)
                };
            ::tracing::callsite::DefaultCallsite::new(&META)
        };
    let enabled =
        ::tracing::Level::WARN <= ::tracing::level_filters::STATIC_MAX_LEVEL
                &&
                ::tracing::Level::WARN <=
                    ::tracing::level_filters::LevelFilter::current() &&
            {
                let interest = __CALLSITE.interest();
                !interest.is_never() &&
                    ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                        interest)
            };
    if enabled {
        (|value_set: ::tracing::field::ValueSet|
                    {
                        let meta = __CALLSITE.metadata();
                        ::tracing::Event::dispatch(meta, &value_set);
                        ;
                    })({
                #[allow(unused_imports)]
                use ::tracing::field::{debug, display, Value};
                __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("Failed to read clipboard for paste: {0:?}",
                                                    e) as &dyn ::tracing::field::Value))])
            });
    } else { ; }
};bevy_log::warn!("Failed to read clipboard for paste: {e:?}");
385            true
386        }
387        None => false,
388    }
389}