Skip to content

Commit dadc102

Browse files
committed
gtk: Implementable implementation for AccessibleText
1 parent f0e1d9e commit dadc102

File tree

3 files changed

+552
-6
lines changed

3 files changed

+552
-6
lines changed

gtk4/src/accessible_text_range.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3-
#[derive(Copy, Clone)]
4-
#[doc(alias = "GtkAccessibleTextRange")]
5-
#[repr(transparent)]
6-
pub struct AccessibleTextRange(crate::ffi::GtkAccessibleTextRange);
3+
use glib::translate::UnsafeFrom;
4+
use gtk4_sys::GtkAccessibleTextRange;
5+
6+
glib::wrapper! {
7+
#[doc(alias = "GtkAccessibleTextRange")]
8+
pub struct AccessibleTextRange(BoxedInline<crate::ffi::GtkAccessibleTextRange>);
9+
}
710

811
impl AccessibleTextRange {
12+
pub fn new(start: usize, length: usize) -> Self {
13+
unsafe { AccessibleTextRange::unsafe_from(GtkAccessibleTextRange { start, length }) }
14+
}
15+
916
pub fn start(&self) -> usize {
10-
self.0.start
17+
self.inner.start
1118
}
1219

1320
pub fn length(&self) -> usize {
14-
self.0.length
21+
self.inner.length
1522
}
1623
}
1724

0 commit comments

Comments
 (0)