Instruction set reference
HIPE_OP_GET_RANGE_GEOMETRY
Requests where a range of text in an element appears on screen, as one rectangle per line, or where a text cursor appears. This is useful for placing something next to the cursor or a piece of text (such as a completion list or a tooltip), or for highlighting text.
- location: The element containing the text.
- arg[0]: The character offset where the range starts.
- arg[1]: The character offset where the range ends. If empty, the request is for the position of a cursor at arg[0]. If both arguments are empty, the request is for the element's actual text cursor (the end of the selection where the cursor is), if the cursor or selected text is in the element.
The display server responds with a HIPE_OP_RANGE_GEOMETRY instruction.
Notes
Offsets are counted exactly as for HIPE_OP_CARAT_POSITION: in characters, in the element's value for input and textarea elements and otherwise in its text as laid out (the text HIPE_OP_GET_CONTENT returns in mode 2). Negative offsets count from the end: -1 is the position after the last character. For example, "0" and "-1" request the whole text. The order of the two offsets doesn't matter.
To find where the cursor would be drawn at a given offset without moving it, give just arg[0].
