Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GI.IBus.Functions
Contents
- Methods
- acceleratorName
- acceleratorParse
- acceleratorValid
- attrBackgroundNew
- attrForegroundNew
- emojiDictLoad
- emojiDictSave
- freeStrv
- getAddress
- getDaemonUid
- getLanguageName
- getLocalMachineId
- getSocketPath
- getTimeout
- getUntranslatedLanguageName
- getUserName
- init
- keyEventFromString
- keyEventToString
- keyvalConvertCase
- keyvalFromName
- keyvalName
- keyvalToLower
- keyvalToUnicode
- keyvalToUpper
- main
- quit
- setDisplay
- setLogHandler
- unicodeToKeyval
- unsetLogHandler
- writeAddress
Description
Synopsis
- acceleratorName :: (HasCallStack, MonadIO m) => Word32 -> [ModifierType] -> m Text
- acceleratorParse :: (HasCallStack, MonadIO m) => Text -> m (Word32, [ModifierType])
- acceleratorValid :: (HasCallStack, MonadIO m) => Word32 -> [ModifierType] -> m Bool
- attrBackgroundNew :: (HasCallStack, MonadIO m) => Word32 -> Word32 -> Word32 -> m Attribute
- attrForegroundNew :: (HasCallStack, MonadIO m) => Word32 -> Word32 -> Word32 -> m Attribute
- emojiDictLoad :: (HasCallStack, MonadIO m) => Text -> m (Map Text (Ptr ()))
- emojiDictSave :: (HasCallStack, MonadIO m) => Text -> Map Text (Ptr ()) -> m ()
- freeStrv :: (HasCallStack, MonadIO m) => Text -> m ()
- getAddress :: (HasCallStack, MonadIO m) => m Text
- getDaemonUid :: (HasCallStack, MonadIO m) => m CLong
- getLanguageName :: (HasCallStack, MonadIO m) => Text -> m Text
- getLocalMachineId :: (HasCallStack, MonadIO m) => m Text
- getSocketPath :: (HasCallStack, MonadIO m) => m Text
- getTimeout :: (HasCallStack, MonadIO m) => m Int32
- getUntranslatedLanguageName :: (HasCallStack, MonadIO m) => Text -> m Text
- getUserName :: (HasCallStack, MonadIO m) => m Text
- init :: (HasCallStack, MonadIO m) => m ()
- keyEventFromString :: (HasCallStack, MonadIO m) => Text -> m (Bool, Word32, Word32)
- keyEventToString :: (HasCallStack, MonadIO m) => Word32 -> Word32 -> m Text
- keyvalConvertCase :: (HasCallStack, MonadIO m) => Word32 -> m (Word32, Word32)
- keyvalFromName :: (HasCallStack, MonadIO m) => Text -> m Word32
- keyvalName :: (HasCallStack, MonadIO m) => Word32 -> m Text
- keyvalToLower :: (HasCallStack, MonadIO m) => Word32 -> m Word32
- keyvalToUnicode :: (HasCallStack, MonadIO m) => Word32 -> m Char
- keyvalToUpper :: (HasCallStack, MonadIO m) => Word32 -> m Word32
- main :: (HasCallStack, MonadIO m) => m ()
- quit :: (HasCallStack, MonadIO m) => m ()
- setDisplay :: (HasCallStack, MonadIO m) => Text -> m ()
- setLogHandler :: (HasCallStack, MonadIO m) => Bool -> m ()
- unicodeToKeyval :: (HasCallStack, MonadIO m) => Char -> m Word32
- unsetLogHandler :: (HasCallStack, MonadIO m) => m ()
- writeAddress :: (HasCallStack, MonadIO m) => Text -> m ()
Methods
acceleratorName
Arguments
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> [ModifierType] |
|
-> m Text | Returns: a newly-allocated accelerator name |
Converts an accelerator keyval and modifier mask into a string
parseable by gtk_accelerator_parse()
. For example, if you pass in
KEY_q
and IBUS_CONTROL_MASK
, this function returns “<Control>q”.
If you need to display accelerators in the user interface,
see gtk_accelerator_get_label()
.
acceleratorParse
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m (Word32, [ModifierType]) |
Parses a string representing an accelerator. The format looks like
“<Control>a” or “<Shift><Alt>F1” or “<Releasegt
;z”
(the last one is for key release).
The parser is fairly liberal and allows lower or upper case, and also
abbreviations such as “<Ctl>” and “<Ctrl>”. Key names are
parsed using gdk_keyval_from_name()
. For character keys the name is not the
symbol, but the lowercase name, e.g. one would use “<Ctrl>minus”
instead of “<Ctrl>-”.
If the parse fails, acceleratorKey
and acceleratorMods
will
be set to 0 (zero).
Since: 1.5.18
acceleratorValid
Arguments
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> [ModifierType] |
|
-> m Bool | Returns: |
Determines whether a given keyval and modifier mask constitute
a valid keyboard accelerator. For example, the KEY_a
keyval
plus IBUS_CONTROL_MASK
is valid - this is a “Ctrl+a” accelerator.
But, you can't, for instance, use the KEY_Control_L
keyval
as an accelerator.
attrBackgroundNew
Arguments
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> Word32 |
|
-> Word32 |
|
-> m Attribute | Returns: A newly allocated |
Creates a new background Attribute
.
attrForegroundNew
Arguments
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> Word32 |
|
-> Word32 |
|
-> m Attribute | Returns: A newly allocated |
Creates a new foreground Attribute
.
emojiDictLoad
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m (Map Text (Ptr ())) | Returns: An Emoji dictionary file loaded from the saved cache file. A hash table of { emoji character, |
No description available in the introspection data.
emojiDictSave
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Map Text (Ptr ()) |
|
-> m () |
Saves the Emoji dictionary to the cache file.
Recommend to use emojiDataSave
instead becase GSList in
GHashTable does not work with Gir and Vala.
Calls emojiDataSave
internally. The format of the hash table
changed and now is { emoji character, EmojiData
object }.
freeStrv
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m () |
Deprecated: This function has been deprecated and shouldnot be used in newly written code.
Free a list of strings.
getAddress
Arguments
:: (HasCallStack, MonadIO m) | |
=> m Text | Returns: D-Bus address of IBus. See also: |
Return the D-Bus address of IBus. It will find the address from following source: <orderedlist> <listitem><para>Environment variable IBUS_ADDRESS</para></listitem> <listitem><para>Socket file under ~/.config/ibus/bus/</para></listitem> </orderedlist>
getDaemonUid
Arguments
:: (HasCallStack, MonadIO m) | |
=> m CLong | Returns: UID of ibus-daemon; or 0 if UID is not available. |
Deprecated: This function has been deprecated and shouldnot be used in newly written code.
Get UID of ibus-daemon.
getLanguageName
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Text | Returns: translated language name |
No description available in the introspection data.
getLocalMachineId
Arguments
:: (HasCallStack, MonadIO m) | |
=> m Text | Returns: A newly allocated string that shows the UUID of the machine. |
Obtains the machine UUID of the machine this process is running on.
getSocketPath
Arguments
:: (HasCallStack, MonadIO m) | |
=> m Text | Returns: A newly allocated string that stores the path of socket file. |
Get the path of socket file.
getTimeout
Arguments
:: (HasCallStack, MonadIO m) | |
=> m Int32 | Returns: A GDBus timeout in milliseconds. -1 when default timeout for GDBus should be used. |
Get the GDBus timeout in milliseconds. The timeout is for clients (e.g. im-ibus.so), not for ibus-daemon. Note that the timeout for ibus-daemon could be set by --timeout command line option of the daemon.
getUntranslatedLanguageName
getUntranslatedLanguageName Source #
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Text | Returns: untranslated language name |
No description available in the introspection data.
getUserName
Arguments
:: (HasCallStack, MonadIO m) | |
=> m Text | Returns: A newly allocated string that stores current user name. |
Get the current user name.
It is determined by:
<orderedlist>
<listitem><para>getlogin()
</para></listitem>
<listitem><para>Environment variable SUDO_USER</para></listitem>
<listitem><para>Environment variable USERHELPER_UID</para></listitem>
<listitem><para>Environment variable USERNAME</para></listitem>
<listitem><para>Environment variable LOGNAME</para></listitem>
<listitem><para>Environment variable USER</para></listitem>
<listitem><para>Environment variable LNAME</para></listitem>
</orderedlist>
init
init :: (HasCallStack, MonadIO m) => m () Source #
Initialize the ibus types.
keyEventFromString
Parse key event string and return key symbol and modifiers.
keyEventToString
Arguments
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> Word32 |
|
-> m Text | Returns: The name of a key symbol and modifier. |
Return the name of a key symbol and modifiers.
For example, if press ctrl, shift, and enter, then this function returns: Shift+Control+enter.
keyvalConvertCase
Arguments
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m (Word32, Word32) |
Obtains the upper- and lower-case versions of the keyval symbol
.
Examples of keyvals are KEY_a
, KEY_Return
, KEY_F1
, etc.
keyvalFromName
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Word32 | Returns: Corresponding key symbol. |
Return the key symbol that associate with the key name.
keyvalName
Arguments
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m Text | Returns: Corresponding key name. |
Return the name of a key symbol.
Note that the returned string is used internally, so don't free it.
keyvalToLower
Arguments
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m Word32 | Returns: the lower case form of |
Converts a key value to lower case, if applicable.
keyvalToUnicode
Arguments
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m Char | Returns: the corresponding unicode character, or 0 if there is no corresponding character. |
Convert from an IBus key symbol to the corresponding ISO10646 (Unicode) character.
keyvalToUpper
Arguments
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> m Word32 | Returns: the upper case form of |
Converts a key value to upper case, if applicable.
main
main :: (HasCallStack, MonadIO m) => m () Source #
quit
quit :: (HasCallStack, MonadIO m) => m () Source #
setDisplay
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m () |
Set the display address.
setLogHandler
Arguments
:: (HasCallStack, MonadIO m) | |
=> Bool |
|
-> m () |
Sets GLIB's log handler to ours. Our log handler adds time info including hour, minute, second, and microsecond, like:
(ibus-daemon:7088): IBUS-DEBUG: 18:06:45.822819: ibus-daemon started
If verbose
is True
, all levels of messages will be logged. Otherwise,
DEBUG and WARNING messages will be ignored. The function is used in
ibus-daemon, but can be useful for IBus client programs as well for
debugging. It's totally fine for not calling this function. If you
don't set a custom GLIB log handler, the default GLIB log handler will
be used.
unicodeToKeyval
Arguments
:: (HasCallStack, MonadIO m) | |
=> Char |
|
-> m Word32 | Returns: the corresponding IBus key symbol, if one exists. or, if there is no corresponding symbol, wc | 0x01000000 |
Convert from a ISO10646 character to a key symbol.
unsetLogHandler
unsetLogHandler :: (HasCallStack, MonadIO m) => m () Source #
Remove the log handler which is set by ibus_set_log_handler.
writeAddress
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m () |
Write D-Bus address to socket file.
See also: getAddress
.