Skip to content
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

feat: Add basic text support on Unix #362

Merged
merged 20 commits into from
May 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2aafda1
feat: Add basic text support on Unix
DataTriny Sep 24, 2023
152e495
Fix and rename conversion functions
DataTriny Mar 10, 2024
de45a9a
Add stub implementation of text attributes related methods
DataTriny Mar 10, 2024
f181a75
Ensure `PlatformNode` supports the text interface before calling rela…
DataTriny Mar 10, 2024
329fec2
Fix signature of methods returning extents
DataTriny Mar 16, 2024
23b2edf
Fixes after rebase
DataTriny May 15, 2024
c1fbda6
Fix bugs with caret movement and selection changes
DataTriny May 15, 2024
549a17e
Drop `get_character_at_offset` method
DataTriny May 16, 2024
a79d5d2
Emit text insertion/removal events
DataTriny May 18, 2024
d3a6a4c
Ensure text selection and caret events are fired after focus events
DataTriny May 19, 2024
67ca82f
Credit Chromium for the diffing algorithm
DataTriny May 19, 2024
069bfb6
Emit text change events on all text nodes
DataTriny May 19, 2024
a23b63b
Mention text edit support in the main README
DataTriny May 20, 2024
98f7753
Fixes after rebase
DataTriny May 23, 2024
bd68191
Use let-else inside `emit_text_selection_change`
DataTriny May 24, 2024
bb37d4e
Actually fire `text-changed` events when inline textboxes are updated…
DataTriny May 24, 2024
12aa336
Fix string slicing inside `emit_text_change_if_needed_parent`
DataTriny May 24, 2024
e969add
Fix caret movement events
DataTriny May 25, 2024
cc23e1e
Refactor text range extents computation
DataTriny May 25, 2024
bfe3556
Fix `prefix_usv_index`, it's actually the index at which the diff starts
DataTriny May 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Drop get_character_at_offset method
  • Loading branch information
DataTriny committed May 26, 2024
commit 549a17e07098b67e15bf2c4e4f8654107706ecf2
9 changes: 0 additions & 9 deletions platforms/atspi-common/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1046,15 +1046,6 @@ impl PlatformNode {
})
}

pub fn character_at_offset(&self, offset: i32) -> Result<i32> {
self.resolve_for_text(|node| {
let start = text_position_from_offset(&node, offset).ok_or(Error::IndexOutOfRange)?;
let mut range = start.to_degenerate_range();
range.set_end(start.forward_to_character_end());
Ok(range.text().chars().next().unwrap_or('\0') as i32)
})
}

pub fn text_attribute_value(&self, _offset: i32, _attribute_name: &str) -> Result<String> {
// TODO: Implement rich text.
Err(Error::UnsupportedInterface)
Expand Down
7 changes: 0 additions & 7 deletions platforms/atspi-common/src/simplified.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,13 +261,6 @@ impl Accessible {
}
}

pub fn character_at_offset(&self, offset: i32) -> Result<i32> {
match self {
Self::Node(node) => node.character_at_offset(offset),
Self::Root(_) => Err(Error::UnsupportedInterface),
}
}

pub fn text_attribute_value(&self, offset: i32, attribute_name: &str) -> Result<String> {
match self {
Self::Node(node) => node.text_attribute_value(offset, attribute_name),
Expand Down
6 changes: 0 additions & 6 deletions platforms/unix/src/atspi/interfaces/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ impl TextInterface {
self.node.set_caret_offset(offset).map_err(self.map_error())
}

fn get_character_at_offset(&self, offset: i32) -> fdo::Result<i32> {
self.node
.character_at_offset(offset)
.map_err(self.map_error())
}

fn get_attribute_value(&self, offset: i32, attribute_name: &str) -> fdo::Result<String> {
self.node
.text_attribute_value(offset, attribute_name)
Expand Down