#include #include void dump_layouts (XklConfigRec *config); int main() { Display *dpy; XklEngine *engine; XklConfigRec *current_config, *temp_config; g_type_init_with_debug_flags(G_TYPE_DEBUG_OBJECTS | G_TYPE_DEBUG_SIGNALS); dpy = XOpenDisplay(NULL); engine = xkl_engine_get_instance(dpy); current_config = xkl_config_rec_new(); xkl_config_rec_get_from_server(current_config, engine); xkl_debug(0, "original layouts: "); dump_layouts(current_config); temp_config = xkl_config_rec_new(); xkl_config_rec_get_from_server(temp_config, engine); gint next_group = xkl_engine_get_next_group (engine); printf( "xkl_engine_get_next_group returned %u\n", next_group); return 0; } void dump_layouts (XklConfigRec *config) { gchar **layout = config->layouts; while (*layout != NULL) { printf("%s ", *layout); layout++; } printf("\n"); }