Skip to content

Commit

Permalink
gtk: Implementable implementation for AccessibleText
Browse files Browse the repository at this point in the history
  • Loading branch information
felinira committed Jul 4, 2024
1 parent f0e1d9e commit dadc102
Show file tree
Hide file tree
Showing 3 changed files with 552 additions and 6 deletions.
19 changes: 13 additions & 6 deletions gtk4/src/accessible_text_range.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
// Take a look at the license at the top of the repository in the LICENSE file.

#[derive(Copy, Clone)]
#[doc(alias = "GtkAccessibleTextRange")]
#[repr(transparent)]
pub struct AccessibleTextRange(crate::ffi::GtkAccessibleTextRange);
use glib::translate::UnsafeFrom;
use gtk4_sys::GtkAccessibleTextRange;

glib::wrapper! {
#[doc(alias = "GtkAccessibleTextRange")]
pub struct AccessibleTextRange(BoxedInline<crate::ffi::GtkAccessibleTextRange>);
}

impl AccessibleTextRange {
pub fn new(start: usize, length: usize) -> Self {
unsafe { AccessibleTextRange::unsafe_from(GtkAccessibleTextRange { start, length }) }
}

pub fn start(&self) -> usize {
self.0.start
self.inner.start
}

pub fn length(&self) -> usize {
self.0.length
self.inner.length
}
}

Expand Down
Loading

0 comments on commit dadc102

Please sign in to comment.