[Uim] surrounding text
YAMAMOTO Kengo / YamaKen
yamaken at bp.iij4u.or.jp
Thu Nov 9 13:57:11 EET 2006
At Wed, 11 Oct 2006 14:46:43 +0900,
ek.kato at gmail.com wrote:
>
> I've added specific handling with widgets which use/inherit GtkEntry
> and GtkTextView. See details below.
>
> On 10/10/06, YAMAMOTO Kengo / YamaKen <yamaken at bp.iij4u.or.jp> wrote:
> > At Tue, 10 Oct 2006 14:31:01 +0900,
> > ek.kato at gmail.com wrote:
> > >
> > > On 10/10/06, YAMAMOTO Kengo / YamaKen <yamaken at bp.iij4u.or.jp> wrote:
> > > > As written as follows along with enum UTextArea, the cursor of
> > > > UTextArea_Clipboard must always be positioned at end of the text
> > > > virtually.
>
> OK. Now UTextOrigin_End is only supported in the acquisition of
> UTextArea_Clipboard.
Sorry, my expression was confusable. What I meant is that treat
clipboard texts as if its cursor position is always at end, as
follows.
"a clipboard textI"
"I" indicates virtual cursor position. So all following argument
sets must return "a clipboard text".
(UTextOrigin_Begin, 0, UTextExtent_Full)
(UTextOrigin_Cursor, UTextExtent_Full, 0)
(UTextOrigin_End, UTextExtent_Full, 0)
> > > Yes. Our GTK+ bridge knows its widget of the context. I'll
> > > investigate more later about this. But we can't assume all the widget
> > > of the input context support GtkEditable, I think.
> >
> > I see. I'll relax the specification once your investigation (and
> > implementation) has been finished.
>
> I've added GtkEntry and GtkTextView specific handling for deletion
> of UTextArea_Selection. For these widget, now we can guarantee that
> the selected text is on the application.
>
> And for the deletion of text in UTextAreaPrimary, UTextExtent_Full and
> UTextExtent_Line are now supported in these widgets.
>
> For the acquisition of UTextAreaPrimary with GtkTextView, now we can
> get whole text (multiple lines) with UTextExtent_Full.
Good job! Thank you for the implementation.
> The problems for the input context on a custom widget which doesn't
> use/inherit GtkEntry or GtkTextView is still remained. But it can't
> be helped for now.
>
> * Maybe these widget don't support get_surrounding and/or
> delete_surrounding.
I've relaxed the API requirements. Such widgets are simply
allowed to deny the operation.
> * Even if it supports delete_surrounding, we can't use
> UTextExtent_Full and/or UTextExtent_Line.
The relaxed requirements allows returning a string shorter than
requested.
> * A text acquired with UTextArea_Selection doesn't mean it is on the
> target application.
If it is not ensured, I prefer simply denies the operation. But
if such widgets are existing a lot, trying to acquire a most
likely its own selection text will be a valuable
workaround. Please do as you believing as best.
> * How to delete the selected text? We just expect it will be
> replaced with newly committed text.
In Qt, QTextEdit::removeSelectedText() and QLineEdit::del() may
be used to delete selection. Even if a partial deletion is
instructed, following sequence may be used although selected
state will be lost.
1) Delete entire selection
2) Insert the rest selection text partially removed after
------------------------------------------------
YAMAMOTO Kengo / YamaKen yamaken at bp.iij4u.or.jp
FAMILY Given / Nick
More information about the uim
mailing list