1.20 <WebKitInputMethodContext>

Class: <WebKitInputMethodContext>

It derives from <GObject>.

Base class for input method contexts.

WebKitInputMethodContext defines the interface to implement WebKit input methods. The input methods are used by WebKit, when editable content is focused, to map from key events to Unicode character strings.

An input method may consume multiple key events in sequence and finally output the composed result. This is called preediting, and an input method may provide feedback about this process by displaying the intermediate composition states as preedit text.

Fields

parent-instance
priv

Properties

Property: input-method-context:input-hints self

The <WebKitInputHints> of the input associated with this context.

Its value is a <WebKitInputHints> (or, to set it, a list of its symbols, or one of them).

Set it with (set! (input-method-context:input-hints self) value).

Property: input-method-context:input-purpose self

The <WebKitInputPurpose> of the input associated with this context.

Its value is a <WebKitInputPurpose> (or, to set it, one of its symbols).

Set it with (set! (input-method-context:input-purpose self) value).

Procedures

Method: input-method-context:filter-key-event? self key-event ⇒ %return
Method: filter-key-event? self key-event ⇒ %return

Allow key-event to be handled by the input method.

If #t is returned, then no further processing should be done for the key event.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

key-event

Passed: a <GdkEvent>.

the key event to filter

%return

Returned: a boolean.

#t if the key event was handled, or #f otherwise

Method: input-method-context:get-input-hints self ⇒ %return
Method: get-input-hints self ⇒ %return

Get the value of the input-method-context:input-hints property.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

%return

Returned: a <WebKitInputHints>.

the <WebKitInputHints> of the input associated with self

Method: input-method-context:get-input-purpose self ⇒ %return
Method: get-input-purpose self ⇒ %return

Get the value of the input-method-context:input-purpose property.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

%return

Returned: a <WebKitInputPurpose>.

the <WebKitInputPurpose> of the input associated with self

Method: input-method-context:get-preedit self ⇒ text underlines cursor-offset
Method: get-preedit self ⇒ text underlines cursor-offset

Get the pre-edit string and a list of WebKitInputMethodUnderline.

Get the current pre-edit string for the self, and a list of WebKitInputMethodUnderline to apply to the string. The string will be displayed inserted at cursor-offset.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

text

Returned: a string, or #f.

location to store the preedit string

underlines

Returned: a list, each a <WebKitInputMethodUnderline>, or #f.

location to store the underlines as a GList of <WebKitInputMethodUnderline>

cursor-offset

Returned: an unsigned 32-bit integer.

location to store the position of cursor in preedit string

Method: input-method-context:notify-cursor-area self x y width height
Method: notify-cursor-area self x y width height

Notify self that cursor area changed in input associated.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

x

Passed: a 32-bit integer.

the x coordinate of cursor location

y

Passed: a 32-bit integer.

the y coordinate of cursor location

width

Passed: a 32-bit integer.

the width of cursor area

height

Passed: a 32-bit integer.

the height of cursor area

Method: input-method-context:notify-focus-in self
Method: notify-focus-in self

Notify self that input associated has gained focus.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

Method: input-method-context:notify-focus-out self
Method: notify-focus-out self

Notify self that input associated has lost focus.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

Method: input-method-context:notify-surrounding self text length cursor-index selection-index
Method: notify-surrounding self text length cursor-index selection-index

Notify self that the context surrounding the cursor has changed.

If there’s no selection selection-index is the same as cursor-index.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

text

Passed: a string.

text surrounding the insertion point

length

Passed: a 32-bit integer.

the length of text, or -1 if text is nul-terminated

cursor-index

Passed: an unsigned 32-bit integer.

the byte index of the insertion cursor within text.

selection-index

Passed: an unsigned 32-bit integer.

the byte index of the selection cursor within text.

Method: input-method-context:reset self
Method: reset self

Reset the self.

This will typically cause the input to clear the preedit state.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

Method: input-method-context:set-enable-preedit self enabled
Method: set-enable-preedit self enabled

Set whether self should enable preedit to display feedback.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

enabled

Passed: a boolean.

whether to enable preedit

Method: input-method-context:set-input-hints self hints
Method: set-input-hints self hints

Set the value of the input-method-context:input-hints property.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

hints

Passed: a <WebKitInputHints>, or a list of its symbols, or one of them.

a <WebKitInputHints>

Method: input-method-context:set-input-purpose self purpose
Method: set-input-purpose self purpose

Set the value of the input-method-context:input-purpose property.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

purpose

Passed: a <WebKitInputPurpose>, or one of its symbols.

a <WebKitInputPurpose>

Signals

Signal: input-method-context:committed

Connect a handler with (connect object input-method-context:committed handler). It is called as (handler self text).

Emitted when a complete input sequence has been entered by the user. This can be a single character immediately after a key press or the final result of preediting.

self

Passed: a <WebKitInputMethodContext>.

text

Passed: a string.

the string result

Signal: input-method-context:delete-surrounding

Connect a handler with (connect object input-method-context:delete-surrounding handler). It is called as (handler self offset n-chars).

Emitted when the input method wants to delete the context surrounding the cursor. If offset is a negative value, it means a position before the cursor.

self

Passed: a <WebKitInputMethodContext>.

offset

Passed: a 32-bit integer.

the character offset from the cursor position of the text to be deleted.

n-chars

Passed: an unsigned 32-bit integer.

the number of characters to be deleted

Signal: input-method-context:preedit-changed

Connect a handler with (connect object input-method-context:preedit-changed handler). It is called as (handler self).

Emitted whenever the preedit sequence currently being entered has changed. It is also emitted at the end of a preedit sequence, in which case input-method-context:get-preedit returns the empty string.

self

Passed: a <WebKitInputMethodContext>.

Signal: input-method-context:preedit-finished

Connect a handler with (connect object input-method-context:preedit-finished handler). It is called as (handler self).

Emitted when a preediting sequence has been completed or canceled.

self

Passed: a <WebKitInputMethodContext>.

Signal: input-method-context:preedit-started

Connect a handler with (connect object input-method-context:preedit-started handler). It is called as (handler self).

Emitted when a new preediting sequence starts.

self

Passed: a <WebKitInputMethodContext>.

Virtual methods

Virtual method: input-method-context:do-committed implementor self text

To override it in a new class, give register-type #:vfuncs `((committed . ,procedure)). The procedure is called as (procedure self text).

implementor

Passed: the class whose implementation to call: <WebKitInputMethodContext>, or a class that derives from it, or its GType number.

self

Passed: a <WebKitInputMethodContext>.

text

Passed: a string.

Virtual method: input-method-context:do-delete-surrounding implementor self offset n-chars

To override it in a new class, give register-type #:vfuncs `((delete-surrounding . ,procedure)). The procedure is called as (procedure self offset n-chars).

implementor

Passed: the class whose implementation to call: <WebKitInputMethodContext>, or a class that derives from it, or its GType number.

self

Passed: a <WebKitInputMethodContext>.

offset

Passed: a 32-bit integer.

n-chars

Passed: an unsigned 32-bit integer.

Virtual method: input-method-context:do-filter-key-event implementor self key-event ⇒ %return

Allow key-event to be handled by the input method.

If #t is returned, then no further processing should be done for the key event.

To override it in a new class, give register-type #:vfuncs `((filter-key-event . ,procedure)). The procedure is called as (procedure self key-event) ⇒ %return.

implementor

Passed: the class whose implementation to call: <WebKitInputMethodContext>, or a class that derives from it, or its GType number.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

key-event

Passed: a <GdkEvent>.

the key event to filter

%return

Returned: a boolean.

#t if the key event was handled, or #f otherwise

Virtual method: input-method-context:do-get-preedit implementor self ⇒ text underlines cursor-offset

Get the pre-edit string and a list of WebKitInputMethodUnderline.

Get the current pre-edit string for the self, and a list of WebKitInputMethodUnderline to apply to the string. The string will be displayed inserted at cursor-offset.

To override it in a new class, give register-type #:vfuncs `((get-preedit . ,procedure)). The procedure is called as (procedure self) ⇒ text underlines cursor-offset.

implementor

Passed: the class whose implementation to call: <WebKitInputMethodContext>, or a class that derives from it, or its GType number.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

text

Returned: a string, or #f.

location to store the preedit string

underlines

Returned: a list, each a <WebKitInputMethodUnderline>, or #f.

location to store the underlines as a GList of <WebKitInputMethodUnderline>

cursor-offset

Returned: an unsigned 32-bit integer.

location to store the position of cursor in preedit string

Virtual method: input-method-context:do-notify-cursor-area implementor self x y width height

Notify self that cursor area changed in input associated.

To override it in a new class, give register-type #:vfuncs `((notify-cursor-area . ,procedure)). The procedure is called as (procedure self x y width height).

implementor

Passed: the class whose implementation to call: <WebKitInputMethodContext>, or a class that derives from it, or its GType number.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

x

Passed: a 32-bit integer.

the x coordinate of cursor location

y

Passed: a 32-bit integer.

the y coordinate of cursor location

width

Passed: a 32-bit integer.

the width of cursor area

height

Passed: a 32-bit integer.

the height of cursor area

Virtual method: input-method-context:do-notify-focus-in implementor self

Notify self that input associated has gained focus.

To override it in a new class, give register-type #:vfuncs `((notify-focus-in . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <WebKitInputMethodContext>, or a class that derives from it, or its GType number.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

Virtual method: input-method-context:do-notify-focus-out implementor self

Notify self that input associated has lost focus.

To override it in a new class, give register-type #:vfuncs `((notify-focus-out . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <WebKitInputMethodContext>, or a class that derives from it, or its GType number.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

Virtual method: input-method-context:do-notify-surrounding implementor self text length cursor-index selection-index

Notify self that the context surrounding the cursor has changed.

If there’s no selection selection-index is the same as cursor-index.

To override it in a new class, give register-type #:vfuncs `((notify-surrounding . ,procedure)). The procedure is called as (procedure self text length cursor-index selection-index).

implementor

Passed: the class whose implementation to call: <WebKitInputMethodContext>, or a class that derives from it, or its GType number.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

text

Passed: a string.

text surrounding the insertion point

length

Passed: an unsigned 32-bit integer.

the length of text, or -1 if text is nul-terminated

cursor-index

Passed: an unsigned 32-bit integer.

the byte index of the insertion cursor within text.

selection-index

Passed: an unsigned 32-bit integer.

the byte index of the selection cursor within text.

Virtual method: input-method-context:do-preedit-changed implementor self

To override it in a new class, give register-type #:vfuncs `((preedit-changed . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <WebKitInputMethodContext>, or a class that derives from it, or its GType number.

self

Passed: a <WebKitInputMethodContext>.

Virtual method: input-method-context:do-preedit-finished implementor self

To override it in a new class, give register-type #:vfuncs `((preedit-finished . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <WebKitInputMethodContext>, or a class that derives from it, or its GType number.

self

Passed: a <WebKitInputMethodContext>.

Virtual method: input-method-context:do-preedit-started implementor self

To override it in a new class, give register-type #:vfuncs `((preedit-started . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <WebKitInputMethodContext>, or a class that derives from it, or its GType number.

self

Passed: a <WebKitInputMethodContext>.

Virtual method: input-method-context:do-reset implementor self

Reset the self.

This will typically cause the input to clear the preedit state.

To override it in a new class, give register-type #:vfuncs `((reset . ,procedure)). The procedure is called as (procedure self).

implementor

Passed: the class whose implementation to call: <WebKitInputMethodContext>, or a class that derives from it, or its GType number.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

Virtual method: input-method-context:do-set-enable-preedit implementor self enabled

Set whether self should enable preedit to display feedback.

To override it in a new class, give register-type #:vfuncs `((set-enable-preedit . ,procedure)). The procedure is called as (procedure self enabled).

implementor

Passed: the class whose implementation to call: <WebKitInputMethodContext>, or a class that derives from it, or its GType number.

self

Passed: a <WebKitInputMethodContext>.

a <WebKitInputMethodContext>

enabled

Passed: a boolean.

whether to enable preedit