![]() |
![]() |
![]() |
libskk Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
#define SKK_TYPE_CONTEXT void skk_context_add_dictionary (SkkContext *self
,SkkDict *dict
); void skk_context_remove_dictionary (SkkContext *self
,SkkDict *dict
); gboolean skk_context_process_key_events (SkkContext *self
,const gchar *keyseq
); gboolean skk_context_process_key_event (SkkContext *self
,SkkKeyEvent *key
); void skk_context_reset (SkkContext *self
); gchar * skk_context_get_output (SkkContext *self
); gchar * skk_context_peek_output (SkkContext *self
); gchar * skk_context_poll_output (SkkContext *self
); void skk_context_clear_output (SkkContext *self
); void skk_context_get_preedit_underline (SkkContext *self
,guint *offset
,guint *nchars
); void skk_context_save_dictionaries (SkkContext *self
,GError **error
); SkkContext * skk_context_new (SkkDict **dictionaries
,int dictionaries_length1
); SkkDict ** skk_context_get_dictionaries (SkkContext *self
,int *result_length1
); void skk_context_set_dictionaries (SkkContext *self
,SkkDict **value
,int value_length1
); SkkCandidateList * skk_context_get_candidates (SkkContext *self
); SkkInputMode skk_context_get_input_mode (SkkContext *self
); void skk_context_set_input_mode (SkkContext *self
,SkkInputMode value
); gchar ** skk_context_get_auto_start_henkan_keywords (SkkContext *self
,int *result_length1
); void skk_context_set_auto_start_henkan_keywords (SkkContext *self
,gchar **value
,int value_length1
); gboolean skk_context_get_egg_like_newline (SkkContext *self
); void skk_context_set_egg_like_newline (SkkContext *self
,gboolean value
); SkkPeriodStyle skk_context_get_period_style (SkkContext *self
); void skk_context_set_period_style (SkkContext *self
,SkkPeriodStyle value
); SkkRule * skk_context_get_typing_rule (SkkContext *self
); void skk_context_set_typing_rule (SkkContext *self
,SkkRule *value
); SkkKeyEventFilter * skk_context_get_key_event_filter (SkkContext *self
); const gchar * skk_context_get_preedit (SkkContext *self
); struct SkkContext; struct SkkContextClass; void skk_init (void
); enum SkkInputMode;
"auto-start-henkan-keywords" GStrv : Read / Write "candidates" SkkCandidateList* : Read "egg-like-newline" gboolean : Read / Write "input-mode" SkkInputMode : Read / Write "key-event-filter" SkkKeyEventFilter* : Read "period-style" SkkPeriodStyle : Read / Write "preedit" gchar* : Read "typing-rule" SkkRule* : Read / Write
void skk_context_add_dictionary (SkkContext *self
,SkkDict *dict
);
Register dictionary.
|
the SkkContext instance |
|
a dictionary. [in] |
Since 0.0.8
void skk_context_remove_dictionary (SkkContext *self
,SkkDict *dict
);
Unregister dictionary.
|
the SkkContext instance |
|
a dictionary. [in] |
Since 0.0.8
gboolean skk_context_process_key_events (SkkContext *self
,const gchar *keyseq
);
Pass key events (separated by spaces) to the context.
This function is rarely used in programs but in unit tests.
|
the SkkContext instance |
|
a string representing key events, seperated by " ". [in] |
Returns : |
`true` if any of key events are handled, `false` otherwise |
gboolean skk_context_process_key_event (SkkContext *self
,SkkKeyEvent *key
);
Pass one key event to the context.
|
the SkkContext instance |
|
a key event. [in] |
Returns : |
`true` if the key event is handled, `false` otherwise |
void skk_context_reset (SkkContext *self
);
Reset the context.
|
the SkkContext instance |
gchar * skk_context_get_output (SkkContext *self
);
This is replaced with skk_context_poll_output()
.
|
the SkkContext instance |
Returns : |
an output string Deprecated: 0.0.6 |
gchar * skk_context_peek_output (SkkContext *self
);
Peek (retrieve, but not remove) the current output string.
|
the SkkContext instance |
Returns : |
an output string |
Since 0.0.6
gchar * skk_context_poll_output (SkkContext *self
);
Poll (retrieve and remove) the current output string.
|
the SkkContext instance |
Returns : |
an output string |
Since 0.0.6
void skk_context_clear_output (SkkContext *self
);
Clear the output buffer.
|
the SkkContext instance |
Since 0.0.6
void skk_context_get_preedit_underline (SkkContext *self
,guint *offset
,guint *nchars
);
Get underlined range of preedit.
|
the SkkContext instance |
|
starting offset (in chars) of underline. [out] |
|
number of characters to be underlined. [out] |
Since 0.0.6
void skk_context_save_dictionaries (SkkContext *self
,GError **error
);
Save dictionaries on to disk.
|
the SkkContext instance |
|
location to store the error occuring, or NULL to ignore |
SkkContext * skk_context_new (SkkDict **dictionaries
,int dictionaries_length1
);
Create a new Context.
|
an array of Dict. [in][array length=dictionaries_length1] |
|
length of the dictionaries array |
Returns : |
a new Context |
SkkDict ** skk_context_get_dictionaries (SkkContext *self
,int *result_length1
);
Get and return the current value of the "dictionaries" property.
|
the SkkContext instance to query |
Returns : |
the value of the "dictionaries" property |
void skk_context_set_dictionaries (SkkContext *self
,SkkDict **value
,int value_length1
);
Set the value of the "dictionaries" property to value
.
|
the SkkContext instance to modify |
|
the new value of the "dictionaries" property |
SkkCandidateList * skk_context_get_candidates (SkkContext *self
);
Get and return the current value of the "candidates" property.
|
the SkkContext instance to query |
Returns : |
the value of the "candidates" property |
SkkInputMode skk_context_get_input_mode (SkkContext *self
);
Get and return the current value of the "input-mode" property.
|
the SkkContext instance to query |
Returns : |
the value of the "input-mode" property |
void skk_context_set_input_mode (SkkContext *self
,SkkInputMode value
);
Set the value of the "input-mode" property to value
.
|
the SkkContext instance to modify |
|
the new value of the "input-mode" property |
gchar ** skk_context_get_auto_start_henkan_keywords (SkkContext *self
,int *result_length1
);
Get and return the current value of the "auto-start-henkan-keywords" property.
|
the SkkContext instance to query |
Returns : |
the value of the "auto-start-henkan-keywords" property |
void skk_context_set_auto_start_henkan_keywords (SkkContext *self
,gchar **value
,int value_length1
);
Set the value of the "auto-start-henkan-keywords" property to value
.
|
the SkkContext instance to modify |
|
the new value of the "auto-start-henkan-keywords" property |
gboolean skk_context_get_egg_like_newline (SkkContext *self
);
Get and return the current value of the "egg-like-newline" property.
|
the SkkContext instance to query |
Returns : |
the value of the "egg-like-newline" property |
void skk_context_set_egg_like_newline (SkkContext *self
,gboolean value
);
Set the value of the "egg-like-newline" property to value
.
|
the SkkContext instance to modify |
|
the new value of the "egg-like-newline" property |
SkkPeriodStyle skk_context_get_period_style (SkkContext *self
);
Get and return the current value of the "period-style" property.
|
the SkkContext instance to query |
Returns : |
the value of the "period-style" property |
void skk_context_set_period_style (SkkContext *self
,SkkPeriodStyle value
);
Set the value of the "period-style" property to value
.
|
the SkkContext instance to modify |
|
the new value of the "period-style" property |
SkkRule * skk_context_get_typing_rule (SkkContext *self
);
Get and return the current value of the "typing-rule" property.
|
the SkkContext instance to query |
Returns : |
the value of the "typing-rule" property |
void skk_context_set_typing_rule (SkkContext *self
,SkkRule *value
);
Set the value of the "typing-rule" property to value
.
|
the SkkContext instance to modify |
|
the new value of the "typing-rule" property |
SkkKeyEventFilter * skk_context_get_key_event_filter (SkkContext *self
);
Get and return the current value of the "key-event-filter" property.
|
the SkkContext instance to query |
Returns : |
the value of the "key-event-filter" property |
const gchar * skk_context_get_preedit (SkkContext *self
);
Get and return the current value of the "preedit" property.
|
the SkkContext instance to query |
Returns : |
the value of the "preedit" property |
struct SkkContext;
Main entry point of libskk.
Context represents an input context with support for SKK kana-kanji conversion method.
struct SkkContextClass { GObjectClass parent_class; };
The class structure for SKK_TYPE_CONTEXT
. All the fields in this structure are private and should never be accessed directly.
void skk_init (void
);
Initialize libskk.
Must be called before using any functions in libskk.
|
the (null) instance |
typedef enum { SKK_INPUT_MODE_HIRAGANA = SKK_KANA_MODE_HIRAGANA, SKK_INPUT_MODE_KATAKANA = SKK_KANA_MODE_KATAKANA, SKK_INPUT_MODE_HANKAKU_KATAKANA = SKK_KANA_MODE_HANKAKU_KATAKANA, SKK_INPUT_MODE_LATIN, SKK_INPUT_MODE_WIDE_LATIN, SKK_INPUT_MODE_LAST, SKK_INPUT_MODE_DEFAULT = SKK_INPUT_MODE_HIRAGANA } SkkInputMode;
Type to specify input modes.
Hiragana like "あいう...". | |
Katakana like "アイウ...". | |
Half-width katakana like "アイウ...". | |
Half-width latin like "abc...". | |
Full-width latin like "abc...". | |
The default. |
"auto-start-henkan-keywords"
property "auto-start-henkan-keywords" GStrv : Read / Write
Array of strings which triggers automatic conversion.
"egg-like-newline"
property "egg-like-newline" gboolean : Read / Write
Flag to indicate whether or not "\n" is consumed on commit.
Default value: FALSE
"input-mode"
property"input-mode" SkkInputMode : Read / Write
Current input mode.
Default value: SKK_INPUT_MODE_HIRAGANA
"key-event-filter"
property"key-event-filter" SkkKeyEventFilter* : Read
Filter which runs before process_key_event.
This is particularly useful for NICOLA.
See also: SkkNicolaKeyEventFilter
"period-style"
property"period-style" SkkPeriodStyle : Read / Write
Period style used in romaji-to-kana conversion.
Default value: SKK_PERIOD_STYLE_JA_JA
"delete-surrounding-text"
signalgboolean user_function (SkkContext *context,
gint offset,
guint nchars,
gpointer user_data) : Run Last
Signal emitted when the context requests deletion of surrounding-text.
|
the SkkContext instance that received the signal |
|
character offset from the cursor position. |
|
number of characters to delete. |
|
user data set when the signal handler was connected. |
Returns : |
`true` on success, `false` on failure |
"retrieve-surrounding-text"
signalgboolean user_function (SkkContext *context,
gpointer text,
gpointer cursor_pos,
gpointer user_data) : Run Last
Signal emitted when the context requires surrounding-text.
|
the SkkContext instance that received the signal |
|
surrounding text |
|
cursor position in text |
|
user data set when the signal handler was connected. |
Returns : |
`true` on success, `false` on failure |