Top | ![]() |
![]() |
![]() |
![]() |
InfTextMoveOperation * inf_text_move_operation_new (guint position
,gint length
);
Creates a new move operation that, when applied, changes the caret and selection of the applying user.
[constructor]
guint
inf_text_move_operation_get_position (InfTextMoveOperation *operation
);
Returns the position at which operation
places the user's cursor.
gint
inf_text_move_operation_get_length (InfTextMoveOperation *operation
);
Returns the length to which operation
changes the user's selection.
Negative means selection towards the beginning of the buffer.
void inf_text_move_operation_transform_insert (guint insert_position
,guint insert_length
,guint *move_position
,gint *move_length
,gboolean left_gravity
);
Changes *move_position
and *move_length
so that they point to the same
region when insert_length
characters are inserted at insert_position
.
If text is inserted at the same position as move_position
, then
move_position
is kept at the position it currently is if left_gravity
is
TRUE
, otherwise it is shifted to the right.
If *move_length
is nonzero, then the selection length is never enlarged if
text is inserted at the selection bounds, not depending on whether
left_gravity
is set or not.
insert_position |
The position at which text is inserted. |
|
insert_length |
The number of inserted characters. |
|
move_position |
Points to the character offset to which the caret is moved. |
[inout] |
move_length |
Points to the number of characters selected. Negative means towards the beginning. |
[inout] |
left_gravity |
Whether the move position and length have left gravity. |
void inf_text_move_operation_transform_delete (guint delete_position
,guint delete_length
,guint *move_position
,gint *move_length
);
Changes *move_position
and *move_length
so that they point to the same
region when delete_length
characters are deleted starting from
delete_position
.