summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Udaltsov <svu@gnome.org>2006-03-04 03:49:00 +0000
committerSergey Udaltsov <svu@gnome.org>2006-03-04 03:49:00 +0000
commitc5842939cfa5e43def4040c3fc6c586df7fbdd68 (patch)
tree75f929b64dfdc4431a5ed21a528ce9237cf86de5
parentb98579ef2b02d193fc31945a7b03a6eff5acae4e (diff)
downloadlibxklavier-c5842939cfa5e43def4040c3fc6c586df7fbdd68.tar.gz
testing the signals emission
-rw-r--r--tests/test_monitor.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_monitor.c b/tests/test_monitor.c
index 309981e..20cfd9a 100644
--- a/tests/test_monitor.c
+++ b/tests/test_monitor.c
@@ -22,6 +22,14 @@ print_usage()
printf(" -l3 - listen to track the keyboard state\n");
}
+void
+state_changed(XklEngine * engine, XklStateChange type, gint new_group,
+ gboolean restore)
+{
+ xkl_debug(0, "State changed: %d,%d,%d\n", type, new_group,
+ restore);
+}
+
int
main(int argc, char *argv[])
{
@@ -85,6 +93,9 @@ main(int argc, char *argv[])
current_config = xkl_config_rec_new();
xkl_config_rec_get_from_server(current_config, engine);
+ g_signal_connect(engine, "X-state-changed",
+ G_CALLBACK(state_changed), NULL);
+
xkl_debug(0, "Now, listening: %X...\n", listener_type);
xkl_engine_start_listen(engine, listener_type);