atspi_common/events/
terminal.rs

1#[cfg(feature = "zbus")]
2use crate::{
3	error::AtspiError,
4	events::{MessageConversion, MessageConversionExt},
5};
6use crate::{events::BusProperties, EventProperties};
7use zbus_names::UniqueName;
8use zvariant::ObjectPath;
9
10/// A line of text has been changed.
11#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize, Eq, Hash, Default)]
12pub struct LineChangedEvent {
13	/// The [`crate::ObjectRef`] which the event applies to.
14	pub item: crate::events::ObjectRef,
15}
16
17/// The width of a terminal emulator has changed sufficiently such that the number of characters
18/// able to fit on one *visual* line has changed.
19#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize, Eq, Hash, Default)]
20pub struct ColumnCountChangedEvent {
21	/// The [`crate::ObjectRef`] which the event applies to.
22	pub item: crate::events::ObjectRef,
23}
24
25/// The height of a terminal emulator has changed sufficiently such that the number of lines
26/// able to fit within the terminal has changed.
27#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize, Eq, Hash, Default)]
28pub struct LineCountChangedEvent {
29	/// The [`crate::ObjectRef`] which the event applies to.
30	pub item: crate::events::ObjectRef,
31}
32
33#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize, Eq, Hash, Default)]
34pub struct ApplicationChangedEvent {
35	/// The [`crate::ObjectRef`] which the event applies to.
36	pub item: crate::events::ObjectRef,
37}
38
39/// The width of a terminal emulator has changed sufficiently such that the number of characters
40/// able to fit on one *visual* line has changed.
41#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize, Eq, Hash, Default)]
42pub struct CharWidthChangedEvent {
43	/// The [`crate::ObjectRef`] which the event applies to.
44	pub item: crate::events::ObjectRef,
45}
46
47impl BusProperties for LineChangedEvent {
48	const DBUS_MEMBER: &'static str = "LineChanged";
49	const DBUS_INTERFACE: &'static str = "org.a11y.atspi.Event.Terminal";
50	const MATCH_RULE_STRING: &'static str =
51		"type='signal',interface='org.a11y.atspi.Event.Terminal',member='LineChanged'";
52	const REGISTRY_EVENT_STRING: &'static str = "Terminal:";
53}
54
55impl BusProperties for ColumnCountChangedEvent {
56	const DBUS_MEMBER: &'static str = "ColumncountChanged";
57	const DBUS_INTERFACE: &'static str = "org.a11y.atspi.Event.Terminal";
58	const MATCH_RULE_STRING: &'static str =
59		"type='signal',interface='org.a11y.atspi.Event.Terminal',member='ColumncountChanged'";
60	const REGISTRY_EVENT_STRING: &'static str = "Terminal:";
61}
62
63impl BusProperties for LineCountChangedEvent {
64	const DBUS_MEMBER: &'static str = "LinecountChanged";
65	const DBUS_INTERFACE: &'static str = "org.a11y.atspi.Event.Terminal";
66	const MATCH_RULE_STRING: &'static str =
67		"type='signal',interface='org.a11y.atspi.Event.Terminal',member='LinecountChanged'";
68	const REGISTRY_EVENT_STRING: &'static str = "Terminal:";
69}
70
71impl BusProperties for ApplicationChangedEvent {
72	const DBUS_MEMBER: &'static str = "ApplicationChanged";
73	const DBUS_INTERFACE: &'static str = "org.a11y.atspi.Event.Terminal";
74	const MATCH_RULE_STRING: &'static str =
75		"type='signal',interface='org.a11y.atspi.Event.Terminal',member='ApplicationChanged'";
76	const REGISTRY_EVENT_STRING: &'static str = "Terminal:";
77}
78
79impl BusProperties for CharWidthChangedEvent {
80	const DBUS_MEMBER: &'static str = "CharwidthChanged";
81	const DBUS_INTERFACE: &'static str = "org.a11y.atspi.Event.Terminal";
82	const MATCH_RULE_STRING: &'static str =
83		"type='signal',interface='org.a11y.atspi.Event.Terminal',member='CharwidthChanged'";
84	const REGISTRY_EVENT_STRING: &'static str = "Terminal:";
85}
86
87event_test_cases!(LineChangedEvent);
88impl_to_dbus_message!(LineChangedEvent);
89impl_from_dbus_message!(LineChangedEvent);
90impl_event_properties!(LineChangedEvent);
91impl_from_object_ref!(LineChangedEvent);
92
93event_test_cases!(ColumnCountChangedEvent);
94impl_to_dbus_message!(ColumnCountChangedEvent);
95impl_from_dbus_message!(ColumnCountChangedEvent);
96impl_event_properties!(ColumnCountChangedEvent);
97impl_from_object_ref!(ColumnCountChangedEvent);
98
99event_test_cases!(LineCountChangedEvent);
100impl_to_dbus_message!(LineCountChangedEvent);
101impl_from_dbus_message!(LineCountChangedEvent);
102impl_event_properties!(LineCountChangedEvent);
103impl_from_object_ref!(LineCountChangedEvent);
104
105event_test_cases!(ApplicationChangedEvent);
106impl_to_dbus_message!(ApplicationChangedEvent);
107impl_from_dbus_message!(ApplicationChangedEvent);
108impl_event_properties!(ApplicationChangedEvent);
109impl_from_object_ref!(ApplicationChangedEvent);
110
111event_test_cases!(CharWidthChangedEvent);
112impl_to_dbus_message!(CharWidthChangedEvent);
113impl_from_dbus_message!(CharWidthChangedEvent);
114impl_event_properties!(CharWidthChangedEvent);
115impl_from_object_ref!(CharWidthChangedEvent);