-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gtk: Implementable implementation for AccessibleText #1789
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You import it, then only use it in certain places... Usually we do |
||
|
||
glib::wrapper! { | ||
#[doc(alias = "GtkAccessibleTextRange")] | ||
pub struct AccessibleTextRange(BoxedInline<crate::ffi::GtkAccessibleTextRange>); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be moved to a separate commit. |
||
|
||
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 | ||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.