![]() |
![]() |
![]() |
Libxklavier Reference Manual | ![]() |
---|---|---|---|---|
XklEnginePrivate; enum XklEngineStateChange; enum XklEngineFeatures; XklState; XklEngine; XklEngine* xkl_engine_get_instance (Display *display); const gchar* xkl_engine_get_backend_name (XklEngine *engine); guint xkl_engine_get_features (XklEngine *engine); guint xkl_engine_get_max_num_groups (XklEngine *engine); enum XklEngineListenModes; gint xkl_engine_start_listen (XklEngine *engine, guint flags); gint xkl_engine_stop_listen (XklEngine *engine); gint xkl_engine_pause_listen (XklEngine *engine); gint xkl_engine_resume_listen (XklEngine *engine); gboolean xkl_engine_grab_key (XklEngine *engine, gint keycode, guint modifiers); gboolean xkl_engine_ungrab_key (XklEngine *engine, gint keycode, guint modifiers); gint xkl_engine_filter_events (XklEngine *engine, XEvent *evt); void xkl_engine_allow_one_switch_to_secondary_group (XklEngine *engine); Window xkl_engine_get_current_window (XklEngine *engine); XklState* xkl_engine_get_current_state (XklEngine *engine); gchar* xkl_engine_get_window_title (XklEngine *engine, Window win); gboolean xkl_engine_get_state (XklEngine *engine, Window win, XklState *state_out); void xkl_engine_delete_state (XklEngine *engine, Window win); void xkl_engine_save_state (XklEngine *engine, Window win, XklState *state); void xkl_engine_set_window_transparent (XklEngine *engine, Window win, gbooleantransparent ); gboolean xkl_engine_is_window_transparent (XklEngine *engine, Window win); gboolean xkl_engine_is_window_from_same_toplevel_window (XklEngine *engine, Window win1, Window win2); guint xkl_engine_get_num_groups (XklEngine *engine); const gchar** xkl_engine_get_groups_names (XklEngine *engine); const gchar** xkl_engine_get_indicators_names (XklEngine *engine); gint xkl_engine_get_next_group (XklEngine *engine); gint xkl_engine_get_prev_group (XklEngine *engine); gint xkl_engine_get_current_window_group (XklEngine *engine); void xkl_engine_lock_group (XklEngine *engine, gint group); void xkl_engine_set_group_per_toplevel_window (XklEngine *engine, gbooleanis_global ); gboolean xkl_engine_is_group_per_toplevel_window (XklEngine *engine); void xkl_engine_set_indicators_handling (XklEngine *engine, gbooleanwhether_handle ); gboolean xkl_engine_get_indicators_handling (XklEngine *engine); void xkl_engine_set_secondary_groups_mask (XklEngine *engine, guint mask); guint xkl_engine_get_secondary_groups_mask (XklEngine *engine); void xkl_engine_set_default_group (XklEngine *engine, gint group); gint xkl_engine_get_default_group (XklEngine *engine);
"backendName" gchar* : Read "default-group" guint : Read "display" gpointer : Read / Write / Construct Only "features" XklEngineFeatures : Read "indicators-handling" gboolean : Read "max-num-groups" guint : Read "num-groups" guint : Read "secondary-groups-mask" guint : Read
"X-config-changed" : Run Last "X-new-device" : Run Last "X-state-changed" : Run Last "new-toplevel-window" : Run Last
typedef enum { XKLF_CAN_TOGGLE_INDICATORS = 0x01, XKLF_CAN_OUTPUT_CONFIG_AS_ASCII = 0x02, XKLF_CAN_OUTPUT_CONFIG_AS_BINARY = 0x04, XKLF_MULTIPLE_LAYOUTS_SUPPORTED = 0x08, XKLF_REQUIRES_MANUAL_LAYOUT_MANAGEMENT = 0x10, XKLF_DEVICE_DISCOVERY = 0x20, } XklEngineFeatures;
typedef struct { /** * selected group */ gint32 group; /** * set of active indicators */ guint32 indicators; } XklState;
XklEngine* xkl_engine_get_instance (Display *display);
Get the instance of the XklEngine. Within a process, there is always once instance.
|
the X display used by the application |
Returns : |
the singleton instance |
const gchar* xkl_engine_get_backend_name (XklEngine *engine);
What kind of backend is used
|
the engine |
Returns : |
some string id of the backend |
guint xkl_engine_get_features (XklEngine *engine);
Provides information regarding available backend features (combination of XKLF_* constants)
|
the engine |
Returns : |
ORed XKLF_* constants |
guint xkl_engine_get_max_num_groups (XklEngine *engine);
Provides the information on maximum number of simultaneously supported groups (layouts)
|
the engine |
Returns : |
maximum number of the groups in configuration, 0 if no restrictions. |
typedef enum { XKLL_MANAGE_WINDOW_STATES = 0x01, XKLL_TRACK_KEYBOARD_STATE = 0x02, XKLL_MANAGE_LAYOUTS = 0x04 } XklEngineListenModes;
gint xkl_engine_start_listen (XklEngine *engine, guint flags);
Starts listening for XKB-related events
|
the engine |
|
any combination of XKLL_* constants |
Returns : |
0 |
gint xkl_engine_stop_listen (XklEngine *engine);
Stops listening for XKB-related events
|
the engine |
Returns : |
0 |
gint xkl_engine_pause_listen (XklEngine *engine);
Temporary pauses listening for XKB-related events
|
the engine |
Returns : |
0 |
gint xkl_engine_resume_listen (XklEngine *engine);
Resumes listening for XKB-related events
|
the engine |
Returns : |
0 |
gboolean xkl_engine_grab_key (XklEngine *engine, gint keycode, guint modifiers);
Grabs some key
|
the engine |
|
keycode |
|
bitmask of modifiers |
Returns : |
TRUE on success |
gboolean xkl_engine_ungrab_key (XklEngine *engine, gint keycode, guint modifiers);
Ungrabs some key
|
the engine |
|
keycode |
|
bitmask of modifiers |
Returns : |
TRUE on success |
gint xkl_engine_filter_events (XklEngine *engine, XEvent *evt);
Processes X events. Should be included into the main event cycle of an application. One of the most important functions.
|
the engine |
|
delivered X event |
Returns : |
0 if the event it processed - 1 otherwise |
void xkl_engine_allow_one_switch_to_secondary_group (XklEngine *engine);
Allows to switch (once) to the secondary group
|
the engine |
Window xkl_engine_get_current_window (XklEngine *engine);
|
the engine |
Returns : |
currently focused window |
XklState* xkl_engine_get_current_state (XklEngine *engine);
|
the engine |
Returns : |
current state of the keyboard. Returned value is a statically allocated buffer, should not be freed. |
gchar* xkl_engine_get_window_title (XklEngine *engine, Window win);
|
the engine |
|
X window |
Returns : |
the window title of some window or NULL. If not NULL, it should be freed with XFree |
gboolean xkl_engine_get_state (XklEngine *engine, Window win, XklState *state_out);
Finds the state for a given window (for its "App window").
|
the engine |
|
window to query |
|
structure to store the state |
Returns : |
TRUE on success, otherwise FALSE (the error message can be obtained using xkl_GetLastError). |
void xkl_engine_delete_state (XklEngine *engine, Window win);
Drops the state of a given window (of its "App window").
|
the engine |
|
target window |
void xkl_engine_save_state (XklEngine *engine, Window win, XklState *state);
Stores ths state for a given window
|
the engine |
|
target window |
|
new state of the window |
void xkl_engine_set_window_transparent (XklEngine *engine, Window win, gbooleantransparent );
Sets the "transparent" flag. It means focus switching onto this window will never change the state.
|
the engine |
|
window do set the flag for. |
|
gboolean xkl_engine_is_window_transparent (XklEngine *engine, Window win);
|
the engine |
|
window to get the transparent flag from. |
Returns : |
TRUE if the window is "transparent" |
gboolean xkl_engine_is_window_from_same_toplevel_window (XklEngine *engine, Window win1, Window win2);
Checks whether 2 windows have the same topmost window
|
the engine |
|
first window |
|
second window |
Returns : |
TRUE is windows are in the same application |
guint xkl_engine_get_num_groups (XklEngine *engine);
|
the engine |
Returns : |
the total number of groups in the current configuration (keyboard) |
const gchar** xkl_engine_get_groups_names (XklEngine *engine);
|
the engine |
Returns : |
the array of group names for the current XKB configuration (keyboard). This array is static, should not be freed |
const gchar** xkl_engine_get_indicators_names (XklEngine *engine);
|
the engine |
Returns : |
the array of indicator names for the current XKB configuration (keyboard). This array is static, should not be freed |
gint xkl_engine_get_next_group (XklEngine *engine);
Calculates next group id. Does not change the state of anything.
|
the engine |
Returns : |
next group id |
gint xkl_engine_get_prev_group (XklEngine *engine);
Calculates prev group id. Does not change the state of anything.
|
the engine |
Returns : |
prev group id |
gint xkl_engine_get_current_window_group (XklEngine *engine);
|
the engine |
Returns : |
saved group id of the current window. |
void xkl_engine_lock_group (XklEngine *engine, gint group);
Locks the group. Can be used after xkl_GetXXXGroup functions
|
the engine |
|
group number for locking |
void xkl_engine_set_group_per_toplevel_window (XklEngine *engine, gbooleanis_global );
Sets the configuration parameter: group per application
|
the engine |
|
gboolean xkl_engine_is_group_per_toplevel_window (XklEngine *engine);
|
the engine |
Returns : |
the value of the parameter: group per application |
void xkl_engine_set_indicators_handling (XklEngine *engine, gbooleanwhether_handle );
Sets the configuration parameter: perform indicators handling
|
the engine |
|
gboolean xkl_engine_get_indicators_handling (XklEngine *engine);
|
the engine |
Returns : |
the value of the parameter: perform indicator handling |
void xkl_engine_set_secondary_groups_mask (XklEngine *engine, guint mask);
Sets the secondary groups (one bit per group). Secondary groups require explicit "allowance" for switching
|
the engine |
|
new group mask |
guint xkl_engine_get_secondary_groups_mask (XklEngine *engine);
|
the engine |
Returns : |
the secondary group mask |
void xkl_engine_set_default_group (XklEngine *engine, gint group);
Configures the default group set on window creation. If -1, no default group is used
|
the engine |
|
default group |
"default-group"
property"default-group" guint : Read
Default group.
Allowed values: <= 256
Default value: 0
"indicators-handling"
property"indicators-handling" gboolean : Read
Whether engine should handle indicators.
Default value: FALSE
"max-num-groups"
property"max-num-groups" guint : Read
Max number of groups.
Allowed values: <= 256
Default value: 0
"num-groups"
property"num-groups" guint : Read
Current number of groups.
Allowed values: <= 256
Default value: 0
"secondary-groups-mask"
property"secondary-groups-mask" guint : Read
Secondary groups mask.
Allowed values: <= 256
Default value: 0
"X-config-changed"
signalvoid user_function (XklEngine *xklengine, gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"X-new-device"
signalvoid user_function (XklEngine *xklengine, gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"X-state-changed"
signalvoid user_function (XklEngine *xklengine, XklEngineStateChangeType arg1, gint arg2, gboolean arg3, gpointer user_data) : Run Last
|
the object which received the signal. |
|
|
|
|
|
|
|
user data set when the signal handler was connected. |