Skip to content

Arbitrary selection of text on text object activation

Usage:

currently, the 'state' argument for the gobj_activate function has three valid values: 0, 1 or 2. (at least for the text objext, text_activate)

The arbitrary selection of text achived using the following: Let s be the starting point and e the end point (using characters as unit), SSS...SSS and EEE...EEE the binary encoding of these numbers respectively.

we have to encode these values in an >=32 bits integer (int)

1SSS SSSS SSSS SSSS EEEE EEEE EEEE EEEE

Ex: state = ((0b1 << 31) | (0x0003 << 16) | 0x0009), select from char 3 to char 9.

We set bit 32 to 1 in order to distinguish it from the other valid 'state' values (0, 1 and 2).

Edited by Guillem Bartrina

Merge request reports