Skip to content

Commit

Permalink
refactor(macros): Rename `impl_try_from_event_for_user_facing_event_t…
Browse files Browse the repository at this point in the history
…ype`

Macro `impl_try_from_event_for_user_facing_event_type` does not implement
trait for user facing type at all.

Now named: `impl_try_from_event_for_interface_enum`
  • Loading branch information
luukvanderduim committed Dec 18, 2024
1 parent b116f84 commit 4abb224
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions atspi-common/src/events/event_wrappers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl_from_user_facing_type_for_event_enum!(ReloadEvent, Event::Document);
impl_from_user_facing_type_for_event_enum!(LoadCompleteEvent, Event::Document);

impl_from_interface_event_enum_for_event!(DocumentEvents, Event::Document);
impl_try_from_event_for_user_facing_event_type!(DocumentEvents, Event::Document);
impl_try_from_event_for_interface_enum!(DocumentEvents, Event::Document);
event_wrapper_test_cases!(DocumentEvents, LoadCompleteEvent);

impl HasMatchRule for DocumentEvents {
Expand Down Expand Up @@ -600,7 +600,7 @@ impl_from_user_facing_type_for_event_enum!(BoundsChangedEvent, Event::Object);
impl_from_user_facing_type_for_event_enum!(ObjectPropertyChangeEvent, Event::Object);

impl_from_interface_event_enum_for_event!(ObjectEvents, Event::Object);
impl_try_from_event_for_user_facing_event_type!(ObjectEvents, Event::Object);
impl_try_from_event_for_interface_enum!(ObjectEvents, Event::Object);
event_wrapper_test_cases!(ObjectEvents, ObjectPropertyChangeEvent);

impl_from_user_facing_event_for_interface_event_enum!(
Expand Down Expand Up @@ -1108,7 +1108,7 @@ impl EventProperties for FocusEvents {

impl_from_user_facing_type_for_event_enum!(FocusEvent, Event::Focus);
impl_from_interface_event_enum_for_event!(FocusEvents, Event::Focus);
impl_try_from_event_for_user_facing_event_type!(FocusEvents, Event::Focus);
impl_try_from_event_for_interface_enum!(FocusEvents, Event::Focus);
event_wrapper_test_cases!(FocusEvents, FocusEvent);
impl HasMatchRule for FocusEvents {
const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Focus'";
Expand Down Expand Up @@ -1189,7 +1189,7 @@ impl EventProperties for KeyboardEvents {

impl_from_user_facing_type_for_event_enum!(ModifiersEvent, Event::Keyboard);
impl_from_interface_event_enum_for_event!(KeyboardEvents, Event::Keyboard);
impl_try_from_event_for_user_facing_event_type!(KeyboardEvents, Event::Keyboard);
impl_try_from_event_for_interface_enum!(KeyboardEvents, Event::Keyboard);
event_wrapper_test_cases!(KeyboardEvents, ModifiersEvent);

impl HasMatchRule for KeyboardEvents {
Expand Down Expand Up @@ -1299,7 +1299,7 @@ impl_from_user_facing_type_for_event_enum!(ButtonEvent, Event::Mouse);
impl_from_user_facing_type_for_event_enum!(RelEvent, Event::Mouse);
impl_from_user_facing_type_for_event_enum!(AbsEvent, Event::Mouse);
impl_from_interface_event_enum_for_event!(MouseEvents, Event::Mouse);
impl_try_from_event_for_user_facing_event_type!(MouseEvents, Event::Mouse);
impl_try_from_event_for_interface_enum!(MouseEvents, Event::Mouse);

event_wrapper_test_cases!(MouseEvents, AbsEvent);

Expand Down Expand Up @@ -1434,7 +1434,7 @@ impl_from_user_facing_type_for_event_enum!(ColumnCountChangedEvent, Event::Termi
impl_from_user_facing_type_for_event_enum!(LineChangedEvent, Event::Terminal);

impl_from_interface_event_enum_for_event!(TerminalEvents, Event::Terminal);
impl_try_from_event_for_user_facing_event_type!(TerminalEvents, Event::Terminal);
impl_try_from_event_for_interface_enum!(TerminalEvents, Event::Terminal);

event_wrapper_test_cases!(TerminalEvents, LineChangedEvent);

Expand Down Expand Up @@ -1742,7 +1742,7 @@ impl_from_user_facing_type_for_event_enum!(DesktopCreateEvent, Event::Window);
impl_from_user_facing_type_for_event_enum!(CreateEvent, Event::Window);

impl_from_interface_event_enum_for_event!(WindowEvents, Event::Window);
impl_try_from_event_for_user_facing_event_type!(WindowEvents, Event::Window);
impl_try_from_event_for_interface_enum!(WindowEvents, Event::Window);

event_wrapper_test_cases!(WindowEvents, MoveEvent);

Expand Down
2 changes: 1 addition & 1 deletion atspi-common/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ macro_rules! impl_from_interface_event_enum_for_event {
/// }
/// }
/// ```
macro_rules! impl_try_from_event_for_user_facing_event_type {
macro_rules! impl_try_from_event_for_interface_enum {
($outer_type:ty, $outer_variant:path) => {
impl TryFrom<Event> for $outer_type {
type Error = AtspiError;
Expand Down

0 comments on commit 4abb224

Please sign in to comment.