Skip to content

Commit

Permalink
Merge pull request #199 from odilia-app/more-documentation
Browse files Browse the repository at this point in the history
Add some docs
  • Loading branch information
TTWNO authored Jun 27, 2024
2 parents e8fa63c + f60b8e4 commit e6b3aa3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions atspi-common/src/events/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ pub struct AttributesChangedEvent {
pub item: crate::events::ObjectRef,
}

/// The focused page has changed. This event is usually sent only by document readers, signaling
/// that the _physical page equivalent is now different.
/// This event does not encode _which_ page is the new one, only that a new page is now the primary
/// one.
///
/// See `atspi_proxies::document::DocumentProxy::current_page_number` to actively find the
/// page number.
#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize, Eq, Hash, Default)]
pub struct PageChangedEvent {
/// The [`ObjectRef`] which the event applies to.
Expand Down
7 changes: 7 additions & 0 deletions atspi-common/src/events/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ impl HasMatchRule for ObjectEvents {
pub struct PropertyChangeEvent {
/// The [`ObjectRef`] which the event applies to.
pub item: crate::events::ObjectRef,
// TODO: this is not necessary since the string is encoded in the `Property` type.
pub property: String,
pub value: Property,
}
Expand All @@ -254,6 +255,9 @@ impl Default for PropertyChangeEvent {
}
}

/// Any accessibility related property on an [`ObjectRef`].
/// This is used only in the [`PropertyChangeEvent`]; this event gets triggered if a role or accessible
/// description of an item changes.
#[derive(Debug, PartialEq, serde::Serialize, serde::Deserialize)]
#[non_exhaustive]
pub enum Property {
Expand Down Expand Up @@ -563,6 +567,9 @@ pub struct TextChangedEvent {
pub text: String,
}

/// Signal that some attributes about the text (usually styling) have changed.
/// This event does not encode _what_ has changed about the attributes, merely that they have
/// changed.
#[derive(Debug, PartialEq, Clone, serde::Serialize, serde::Deserialize, Eq, Hash, Default)]
pub struct TextAttributesChangedEvent {
/// The [`ObjectRef`] which the event applies to.
Expand Down

0 comments on commit e6b3aa3

Please sign in to comment.