Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: IMContextMeta

[990:14] static extends: object

Generated metadata helpers for IMContext class surfaces.

Methods

  • properties ()

    Returns property metadata for IMContext.

    • @r A list.
  • signals ()

    Returns signal metadata for IMContext.

    • @r A list.

class: IMContextDeletesurroundingCallback

[570:7] extends: object

Generated low-level callback wrapper for GIR callback delete-surrounding.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • IMContextDeletesurroundingCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, offset, n_chars, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: IMContextPreeditstartCallback

[850:7] extends: object

Generated low-level callback wrapper for GIR callback preedit-start.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • IMContextPreeditstartCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: IMContextCommitCallback

[500:7] extends: object

Generated low-level callback wrapper for GIR callback commit.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • IMContextCommitCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, str, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: IMContext

[32:7] extends: object

The interface for GTK input methods. GtkIMContext is used by GTK text input widgets like GtkText to map from key events to Unicode character strings. An input method may consume multiple key events in sequence before finally outputting 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. To do so, the GtkIMContext will emit [signal@Gtk.IMContext::preedit-start], [signal@Gtk.IMContext::preedit-changed] and [signal@Gtk.IMContext::preedit-end] signals. For instance, the built-in GTK input method [class@Gtk.IMContextSimple] implements the input of arbitrary Unicode code points by holding down the Control and Shift keys and then typing u followed by the hexadecimal digits of the code point. When releasing the Control and Shift keys, preediting ends and the character is inserted as text. For example, Ctrl+Shift+u 2 0 A C results in the € sign. Additional input methods can be made available for use by GTK widgets as loadable modules. An input method module is a small shared library which provides a GIOExtension for the extension point named "gtk-im-module". To connect a widget to the users preferred input method, you should use [class@Gtk.IMMulticontext].

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • IMContext (Handle = null)

    Creates a new IMContext by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • asObject ()

    Wraps this handle as Object.

    • @r A Object object.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnCommit (callback Fn, UserData = null)

    The ::commit signal is emitted when a complete input sequence has been entered by the user. If the commit comes after a preediting sequence, the ::commit signal is emitted after ::preedit-end. This can be a single character immediately after a key press or the final result of preediting.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (IMContext Self, string Str).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnDeletesurrounding (callback Fn, UserData = null)

    The ::delete-surrounding signal is emitted when the input method needs to delete all or part of the context surrounding the cursor.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (IMContext Self, int Offset, int N_chars).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnInvalidcomposition (callback Fn, UserData = null)

    Emitted when the filtered keys do not compose to a single valid character.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (IMContext Self, string Str).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnPreeditchanged (callback Fn, UserData = null)

    The ::preedit-changed signal is emitted whenever the preedit sequence currently being entered has changed. It is also emitted at the end of a preedit sequence, in which case [method@Gtk.IMContext.get_preedit_string] returns the empty string.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (IMContext Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnPreeditend (callback Fn, UserData = null)

    The ::preedit-end signal is emitted when a preediting sequence has been completed or canceled.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (IMContext Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnPreeditstart (callback Fn, UserData = null)

    The ::preedit-start signal is emitted when a new preediting sequence starts.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (IMContext Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnRetrievesurrounding (callback Fn, UserData = null)

    The ::retrieve-surrounding signal is emitted when the input method requires the context surrounding the cursor. The callback should set the input method surrounding context by calling the [method@Gtk.IMContext.set_surrounding] method.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (IMContext Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • getProperty (string Name)

    Reads one generated property by name.

  • setProperty (string Name, Value)

    Writes one generated property by name.

  • setInputhints (string Value)

    Additional hints that allow input methods to fine-tune their behaviour.

    • @p Value is the new property value.
    • @r None.
  • setInputpurpose (string Value)

    The purpose of the text field that the `GtkIMContext is connected to. This property can be used by on-screen keyboards and other input methods to adjust their behaviour.

    • @p Value is the new property value.
    • @r None.
  • activate_osk (object event)

    Requests the platform to show an on-screen keyboard for user input. This method will return %TRUE if this request was actually performed to the platform, other environmental factors may result in an on-screen keyboard effectively not showing up.

    • @p event is a [class@Gdk.Event].
  • delete_surrounding (int offset, int n_chars)

    Asks the widget that the input context is attached to delete characters around the cursor position by emitting the ::delete_surrounding signal. Note that @offset and @n_chars are in characters not in bytes which differs from the usage other places in GtkIMContext. In order to use this function, you should first call [method@Gtk.IMContext.get_surrounding] to get the current context, and call this function immediately afterwards to make sure that you know what you are deleting. You should also account for the fact that even if the signal was handled, the input context might not have deleted all the characters that were requested to be deleted. This function is used by an input method that wants to make substitutions in the existing text in response to new input. It is not useful for applications.

    • @p offset is offset from cursor position in chars; a negative value means start before the cursor..
    • @p n_chars is number of characters to delete..
  • filter_keypress (object event)

    Allow an input method to internally handle key press and release events. If this function returns %TRUE, then no further processing should be done for this key event.

    • @p event is the key event.
  • focus_in ()

    Notify the input method that the widget to which this input context corresponds has gained focus. The input method may, for example, change the displayed feedback to reflect this change.

    • @r None.
  • focus_out ()

    Notify the input method that the widget to which this input context corresponds has lost focus. The input method may, for example, change the displayed feedback or reset the contexts state to reflect this change.

    • @r None.
  • reset ()

    Notify the input method that a change such as a change in cursor position has been made. This will typically cause the input method to clear the preedit state.

    • @r None.
  • set_client_widget (object widget)

    Set the client widget for the input context. This is the GtkWidget holding the input focus. This widget is used in order to correctly position status windows, and may also be used for purposes internal to the input method.

    • @p widget is the client widget. This may be %NULL to indicate that the previous client widget no longer exists..
    • @r None.
  • set_cursor_location (area)

    Notify the input method that a change in cursor position has been made. The location is relative to the client widget.

    • @p area is new location.
    • @r None.
  • set_surrounding (string text, int len, int cursor_index)

    Sets surrounding context around the insertion point and preedit string. This function is expected to be called in response to the [signal@Gtk.IMContext::retrieve-surrounding] signal, and will likely have no effect if called at other times.

    • @p text is text surrounding the insertion point, as UTF-8. the preedit string should not be included within @text.
    • @p len is the length of @text, or -1 if @text is nul-terminated.
    • @p cursor_index is the byte index of the insertion cursor within @text..
    • @r None.
  • set_surrounding_with_selection (string text, int len, int cursor_index, int anchor_index)

    Sets surrounding context around the insertion point and preedit string. This function is expected to be called in response to the [signal@Gtk.IMContext::retrieve_surrounding] signal, and will likely have no effect if called at other times.

    • @p text is text surrounding the insertion point, as UTF-8. the preedit string should not be included within @text.
    • @p len is the length of @text, or -1 if @text is nul-terminated.
    • @p cursor_index is the byte index of the insertion cursor within @text.
    • @p anchor_index is the byte index of the selection bound within @text.
    • @r None.
  • set_use_preedit (bool use_preedit)

    Sets whether the IM context should use the preedit string to display feedback. If @use_preedit is %FALSE (default is %TRUE), then the IM context may use some other method to display feedback, such as displaying it in a child of the root window.

    • @p use_preedit is whether the IM context should use the preedit string..
    • @r None.

class: IMContextInvalidcompositionCallback

[640:7] extends: object

Generated low-level callback wrapper for GIR callback invalid-composition.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • IMContextInvalidcompositionCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, str, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: IMContextPreeditendCallback

[780:7] extends: object

Generated low-level callback wrapper for GIR callback preedit-end.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • IMContextPreeditendCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: IMContextRetrievesurroundingCallback

[920:7] extends: object

Generated low-level callback wrapper for GIR callback retrieve-surrounding.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • IMContextRetrievesurroundingCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: IMContextPreeditchangedCallback

[710:7] extends: object

Generated low-level callback wrapper for GIR callback preedit-changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • IMContextPreeditchangedCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.