mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 09:49:19 +02:00
text highlighting, misc fixes
This commit is contained in:
parent
9296cef55e
commit
083629c6bf
7 changed files with 252 additions and 87 deletions
|
@ -66,8 +66,15 @@ public class ApiServerImplementation extends ApiInterface.Stub implements ApiMet
|
|||
setPageStart((TextPosition)parameters[0]);
|
||||
return ApiObject.Void.Instance;
|
||||
case HIGHLIGHT_AREA:
|
||||
{
|
||||
myReader.getTextView().highlight(
|
||||
getZLTextPosition((TextPosition)parameters[0]),
|
||||
getZLTextPosition((TextPosition)parameters[1])
|
||||
);
|
||||
return ApiObject.Void.Instance;
|
||||
}
|
||||
case CLEAR_HIGHLIGHTING:
|
||||
myReader.getTextView().clearHighlighting();
|
||||
return ApiObject.Void.Instance;
|
||||
default:
|
||||
return unsupportedMethodError(method);
|
||||
|
@ -96,6 +103,14 @@ public class ApiServerImplementation extends ApiInterface.Stub implements ApiMet
|
|||
);
|
||||
}
|
||||
|
||||
private ZLTextFixedPosition getZLTextPosition(TextPosition position) {
|
||||
return new ZLTextFixedPosition(
|
||||
position.ParagraphIndex,
|
||||
position.ElementIndex,
|
||||
position.CharIndex
|
||||
);
|
||||
}
|
||||
|
||||
private boolean isPageEndOfSection() {
|
||||
final ZLTextWordCursor cursor = myReader.getTextView().getEndCursor();
|
||||
return cursor.isEndOfParagraph() && cursor.getParagraphCursor().isEndOfSection();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue