From f5fb13632fff66848316aa76f5fa6303f79878dd Mon Sep 17 00:00:00 2001 From: "Sergey V. Udaltsov" Date: Sat, 18 Dec 2004 04:38:49 +0000 Subject: [PATCH] reflect libgswitchit changes --- capplets/keyboard/ChangeLog | 9 ++++ .../keyboard/gnome-keyboard-properties-xkb.c | 26 ++++++------ .../keyboard/gnome-keyboard-properties-xkb.h | 8 ++-- .../gnome-keyboard-properties-xkblt.c | 16 +++---- .../gnome-keyboard-properties-xkbmc.c | 6 +-- .../gnome-keyboard-properties-xkbot.c | 12 +++--- gnome-settings-daemon/ChangeLog | 4 ++ .../gnome-settings-keyboard-xkb.c | 42 +++++++++---------- 8 files changed, 68 insertions(+), 55 deletions(-) diff --git a/capplets/keyboard/ChangeLog b/capplets/keyboard/ChangeLog index 531b07b6b..51a1f9508 100644 --- a/capplets/keyboard/ChangeLog +++ b/capplets/keyboard/ChangeLog @@ -1,3 +1,12 @@ +2004-12-13 Sergey V. Udaltsov + + * gnome-keyboard-properties-xkb.c, + gnome-keyboard-properties-xkb.h, + gnome-keyboard-properties-xkblt.c, + gnome-keyboard-properties-xkbmc.c, + gnome-keyboard-properties-xkbot.c: reflect massive changes in libgswitchit + + 2004-12-09 Sergey V. Udaltsov * gnome-keyboard-properties-xkblt.c: using of the XklGetMaxNumGroups diff --git a/capplets/keyboard/gnome-keyboard-properties-xkb.c b/capplets/keyboard/gnome-keyboard-properties-xkb.c index 1191f9354..cf59020e8 100644 --- a/capplets/keyboard/gnome-keyboard-properties-xkb.c +++ b/capplets/keyboard/gnome-keyboard-properties-xkb.c @@ -30,7 +30,7 @@ #include #include -#include "libgswitchit/gswitchit_xkb_config.h" +#include "libgswitchit/gswitchit_config.h" #include "capplet-util.h" #include "gconf-property-editor.h" @@ -42,7 +42,7 @@ #define CWID(s) glade_xml_get_widget (chooserDialog, s) -static GSwitchItXkbConfig initialConfig; +static GSwitchItKbdConfig initialConfig; char * xci_desc_to_utf8 (XklConfigItem * ci) @@ -101,7 +101,7 @@ model_to_widget (GConfPropertyEditor * peditor, GConfValue * value) static void cleanup_xkb_tabs (GladeXML * dialog) { - GSwitchItXkbConfigTerm (&initialConfig); + GSwitchItKbdConfigTerm (&initialConfig); XklConfigFreeRegistry (); XklConfigTerm (); XklTerm (); @@ -111,7 +111,7 @@ static void reset_to_defaults (GtkWidget * button, GladeXML * dialog) { gconf_client_set_bool (gconf_client_get_default (), - GSWITCHIT_CONFIG_XKB_KEY_OVERRIDE_SETTINGS, + GSWITCHIT_KBD_CONFIG_KEY_OVERRIDE_SETTINGS, TRUE, NULL); /* all the rest is g-s-d's business */ } @@ -152,7 +152,7 @@ setup_xkb_tabs (GladeXML * dialog, GConfChangeSet * changeset) // fill_models_option_menu (dialog); gconf_peditor_new_string - (changeset, (gchar *) GSWITCHIT_CONFIG_XKB_KEY_MODEL, + (changeset, (gchar *) GSWITCHIT_KBD_CONFIG_KEY_MODEL, WID ("xkb_model"), "conv-to-widget-cb", model_to_widget, "conv-from-widget-cb", model_from_widget, NULL); @@ -179,13 +179,13 @@ setup_xkb_tabs (GladeXML * dialog, GConfChangeSet * changeset) "destroy", G_CALLBACK (cleanup_xkb_tabs), dialog); gconf_client_notify_add (gconf_client_get_default (), - GSWITCHIT_CONFIG_XKB_KEY_MODEL, + GSWITCHIT_KBD_CONFIG_KEY_MODEL, (GConfClientNotifyFunc) update_model, dialog, NULL, NULL); - GSwitchItXkbConfigInit (&initialConfig, confClient); + GSwitchItKbdConfigInit (&initialConfig, confClient); g_object_unref (confClient); - GSwitchItXkbConfigLoadInitial (&initialConfig); + GSwitchItKbdConfigLoadInitial (&initialConfig); enable_disable_restoring (dialog); @@ -203,16 +203,16 @@ setup_xkb_tabs (GladeXML * dialog, GConfChangeSet * changeset) void enable_disable_restoring (GladeXML * dialog) { - GSwitchItXkbConfig gswic; + GSwitchItKbdConfig gswic; GConfClient *confClient = gconf_client_get_default (); gboolean enable; - GSwitchItXkbConfigInit (&gswic, confClient); + GSwitchItKbdConfigInit (&gswic, confClient); g_object_unref (confClient); - GSwitchItXkbConfigLoad (&gswic); + GSwitchItKbdConfigLoad (&gswic); - enable = !GSwitchItXkbConfigEquals (&gswic, &initialConfig); + enable = !GSwitchItKbdConfigEquals (&gswic, &initialConfig); - GSwitchItXkbConfigTerm (&gswic); + GSwitchItKbdConfigTerm (&gswic); gtk_widget_set_sensitive (WID ("xkb_reset_to_defaults"), enable); } diff --git a/capplets/keyboard/gnome-keyboard-properties-xkb.h b/capplets/keyboard/gnome-keyboard-properties-xkb.h index c63be2e7a..a50fb61fa 100644 --- a/capplets/keyboard/gnome-keyboard-properties-xkb.h +++ b/capplets/keyboard/gnome-keyboard-properties-xkb.h @@ -64,22 +64,22 @@ extern void choose_model (GladeXML * dialog); #define get_selected_layouts_list() \ gconf_client_get_list (gconf_client_get_default (), \ - GSWITCHIT_CONFIG_XKB_KEY_LAYOUTS, \ + GSWITCHIT_KBD_CONFIG_KEY_LAYOUTS, \ GCONF_VALUE_STRING, NULL) #define set_selected_layouts_list(list) \ gconf_client_set_list (gconf_client_get_default (), \ - GSWITCHIT_CONFIG_XKB_KEY_LAYOUTS, \ + GSWITCHIT_KBD_CONFIG_KEY_LAYOUTS, \ GCONF_VALUE_STRING, (list), NULL) #define get_selected_options_list() \ gconf_client_get_list (gconf_client_get_default (), \ - GSWITCHIT_CONFIG_XKB_KEY_OPTIONS, \ + GSWITCHIT_KBD_CONFIG_KEY_OPTIONS, \ GCONF_VALUE_STRING, NULL) #define set_selected_options_list(list) \ gconf_client_set_list (gconf_client_get_default (), \ - GSWITCHIT_CONFIG_XKB_KEY_OPTIONS, \ + GSWITCHIT_KBD_CONFIG_KEY_OPTIONS, \ GCONF_VALUE_STRING, (list), NULL) G_END_DECLS diff --git a/capplets/keyboard/gnome-keyboard-properties-xkblt.c b/capplets/keyboard/gnome-keyboard-properties-xkblt.c index c1dcfa97a..e964c5d66 100644 --- a/capplets/keyboard/gnome-keyboard-properties-xkblt.c +++ b/capplets/keyboard/gnome-keyboard-properties-xkblt.c @@ -29,7 +29,7 @@ #include #include -#include "libgswitchit/gswitchit_xkb_config.h" +#include "libgswitchit/gswitchit_config.h" #include "capplet-util.h" #include "gconf-property-editor.h" @@ -67,8 +67,8 @@ add_variant_to_available_layouts_tree (const XklConfigItemPtr GtkTreeIter iter; GtkTreeStore *treeStore = GTK_TREE_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (layoutsTree))); - const gchar *fullLayoutName = GSwitchItConfigMergeItems (current1stLevelId, - configItem->name); + const gchar *fullLayoutName = GSwitchItKbdConfigMergeItems (current1stLevelId, + configItem->name); char *utfVariantName = xci_desc_to_utf8 (configItem); gtk_tree_store_append (treeStore, &iter, ¤t1stLevelIter); @@ -189,8 +189,8 @@ fill_selected_layouts_tree (GladeXML * dialog) char *v1, *utfVisible; const char *visible = (char *) curLayout->data; gtk_list_store_append (listStore, &iter); - if (GSwitchItConfigGetDescriptions (visible, &sl, &l, &sv, &v)) - visible = GSwitchItConfigFormatFullLayout (l, v); + if (GSwitchItKbdConfigGetDescriptions (visible, &sl, &l, &sv, &v)) + visible = GSwitchItKbdConfigFormatFullLayout (l, v); v1 = g_strdup (visible); utfVisible = g_locale_to_utf8 (g_strstrip (v1), -1, NULL, NULL, NULL); gtk_list_store_set (listStore, &iter, @@ -280,7 +280,7 @@ add_selected_layout (GtkWidget * button, GladeXML * dialog) while (option != NULL) { char *g, *o; - if (GSwitchItConfigSplitItems (option->data, &g, &o)) + if (GSwitchItKbdConfigSplitItems (option->data, &g, &o)) { if (!g_ascii_strcasecmp (g, GROUP_SWITCHERS_GROUP)) { @@ -298,7 +298,7 @@ add_selected_layout (GtkWidget * button, GladeXML * dialog) &ci )) { - const gchar* id = GSwitchItConfigMergeItems (GROUP_SWITCHERS_GROUP, DEFAULT_GROUP_SWITCH); + const gchar* id = GSwitchItKbdConfigMergeItems (GROUP_SWITCHERS_GROUP, DEFAULT_GROUP_SWITCH); optionsList = g_slist_append (optionsList, g_strdup (id)); set_selected_options_list (optionsList); } @@ -392,7 +392,7 @@ void register_layouts_gconf_listener (GladeXML * dialog) { gconf_client_notify_add (gconf_client_get_default (), - GSWITCHIT_CONFIG_XKB_KEY_LAYOUTS, + GSWITCHIT_KBD_CONFIG_KEY_LAYOUTS, (GConfClientNotifyFunc) update_layouts_list, dialog, NULL, NULL); } diff --git a/capplets/keyboard/gnome-keyboard-properties-xkbmc.c b/capplets/keyboard/gnome-keyboard-properties-xkbmc.c index 99d00293e..906f47e6f 100644 --- a/capplets/keyboard/gnome-keyboard-properties-xkbmc.c +++ b/capplets/keyboard/gnome-keyboard-properties-xkbmc.c @@ -30,7 +30,7 @@ #include #include -#include "libgswitchit/gswitchit_xkb_config.h" +#include "libgswitchit/gswitchit_config.h" #include "capplet-util.h" #include "gconf-property-editor.h" @@ -118,7 +118,7 @@ xkb_model_chooser_response (GtkDialog *dialog, 1, &modelName, -1); gconf_client_set_string (gconf_client_get_default (), - GSWITCHIT_CONFIG_XKB_KEY_MODEL, + GSWITCHIT_KBD_CONFIG_KEY_MODEL, modelName, NULL); g_free(modelName); } @@ -132,7 +132,7 @@ choose_model(GladeXML * dialog) GtkWidget* chooser = CWID ( "xkb_model_chooser"); gtk_window_set_transient_for (GTK_WINDOW (chooser), GTK_WINDOW (WID ("keyboard_dialog"))); currentModelName = gconf_client_get_string (gconf_client_get_default (), - GSWITCHIT_CONFIG_XKB_KEY_MODEL, NULL); + GSWITCHIT_KBD_CONFIG_KEY_MODEL, NULL); fill_models_list (chooserDialog); g_signal_connect (G_OBJECT (chooser), "response", G_CALLBACK (xkb_model_chooser_response), chooserDialog); diff --git a/capplets/keyboard/gnome-keyboard-properties-xkbot.c b/capplets/keyboard/gnome-keyboard-properties-xkbot.c index e428e08a3..b737959ee 100644 --- a/capplets/keyboard/gnome-keyboard-properties-xkbot.c +++ b/capplets/keyboard/gnome-keyboard-properties-xkbot.c @@ -29,7 +29,7 @@ #include #include -#include "libgswitchit/gswitchit_xkb_config.h" +#include "libgswitchit/gswitchit_config.h" #include "capplet-util.h" #include "gconf-property-editor.h" @@ -91,7 +91,7 @@ can_add_option (GladeXML * dialog) gtk_tree_model_get (availableOptionsModel, &aiter, 1, &selectedFullOptionId, -1); - if (!GSwitchItConfigSplitItems + if (!GSwitchItKbdConfigSplitItems (selectedFullOptionId, &selectedGroupId, &selectedOptionId)) { gtk_tree_path_free (groupPath); @@ -125,7 +125,7 @@ can_add_option (GladeXML * dialog) // look for options within same group char *sgid = NULL, *soid = NULL; gtk_tree_model_get (selectedOptionsModel, &siter, 1, &sid, -1); - if (GSwitchItConfigSplitItems + if (GSwitchItKbdConfigSplitItems (sid, &sgid, &soid) && !g_strcasecmp (sgid, selectedGroupId)) { @@ -247,7 +247,7 @@ add_option_to_available_options_tree (const XklConfigItemPtr GtkTreeIter iter; GtkTreeStore *treeStore = GTK_TREE_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (optionsTree))); - const gchar *fullOptionName = GSwitchItConfigMergeItems (current1stLevelId, + const gchar *fullOptionName = GSwitchItKbdConfigMergeItems (current1stLevelId, configItem->name); char *utfOptionName = xci_desc_to_utf8 (configItem); @@ -327,7 +327,7 @@ fill_selected_options_tree (GladeXML * dialog) char *groupName, *optionName; const char *visible = (char *) curOption->data; - if (GSwitchItConfigSplitItems (visible, &groupName, &optionName)) + if (GSwitchItKbdConfigSplitItems (visible, &groupName, &optionName)) { XklConfigItem citem; char *v1, *utfVisible; @@ -372,7 +372,7 @@ void register_options_gconf_listener (GladeXML * dialog) { gconf_client_notify_add (gconf_client_get_default (), - GSWITCHIT_CONFIG_XKB_KEY_OPTIONS, + GSWITCHIT_KBD_CONFIG_KEY_OPTIONS, (GConfClientNotifyFunc) update_options_list, dialog, NULL, NULL); } diff --git a/gnome-settings-daemon/ChangeLog b/gnome-settings-daemon/ChangeLog index 194cd8738..06f516337 100644 --- a/gnome-settings-daemon/ChangeLog +++ b/gnome-settings-daemon/ChangeLog @@ -1,3 +1,7 @@ +2004-12-18 Sergey V. Udaltsov + + * gnome-settings-keyboard-xkb.c: reflect changes in libgswitchit + 2004-12-16 Bastien Nocera * actions/acme-volume-alsa.c: (acme_volume_alsa_set_mute): mute diff --git a/gnome-settings-daemon/gnome-settings-keyboard-xkb.c b/gnome-settings-daemon/gnome-settings-keyboard-xkb.c index a6b770978..5ce2e0f25 100644 --- a/gnome-settings-daemon/gnome-settings-keyboard-xkb.c +++ b/gnome-settings-daemon/gnome-settings-keyboard-xkb.c @@ -26,7 +26,7 @@ # include "config.h" #endif -#include +//#include #include #include #include @@ -38,12 +38,12 @@ #include #include -#include +#include #include "gnome-settings-keyboard-xkb.h" #include "gnome-settings-daemon.h" -static GSwitchItXkbConfig gswic; +static GSwitchItKbdConfig gswic; static gboolean initedOk; static PostActivationCallback paCallback = NULL; @@ -116,17 +116,17 @@ apply_settings (void) return; confClient = gconf_client_get_default (); - GSwitchItXkbConfigInit (&gswic, confClient); + GSwitchItKbdConfigInit (&gswic, confClient); g_object_unref (confClient); - GSwitchItXkbConfigLoad (&gswic); + GSwitchItKbdConfigLoad (&gswic); if (gswic.overrideSettings) { /* initialization - from the system settings */ - GSwitchItXkbConfigLoadInitial (&gswic); + GSwitchItKbdConfigLoadInitial (&gswic); gswic.overrideSettings = FALSE; - GSwitchItXkbConfigSave (&gswic); + GSwitchItKbdConfigSave (&gswic); } else { - if (GSwitchItXkbConfigActivate (&gswic)) { + if (GSwitchItKbdConfigActivate (&gswic)) { if (paCallback != NULL) { (*paCallback) (paCallbackUserData); } @@ -137,26 +137,26 @@ apply_settings (void) } } - GSwitchItXkbConfigTerm (&gswic); + GSwitchItKbdConfigTerm (&gswic); } static void gnome_settings_keyboard_xkb_sysconfig_changed_response (GtkDialog * dialog, SysConfigChangedMsgResponse what2do, - GSwitchItXkbConfig + GSwitchItKbdConfig * pgswicNow) { switch (what2do) { case RESPONSE_USE_X: - GSwitchItXkbConfigSave (pgswicNow); + GSwitchItKbdConfigSave (pgswicNow); break; case RESPONSE_USE_GNOME: /* Do absolutely nothing - just keep things the way they are */ break; } gtk_widget_destroy (GTK_WIDGET (dialog)); - GSwitchItXkbConfigTerm (pgswicNow); + GSwitchItKbdConfigTerm (pgswicNow); g_free (pgswicNow); } @@ -164,21 +164,21 @@ static void gnome_settings_keyboard_xkb_analyze_sysconfig (void) { GConfClient *confClient; - GSwitchItXkbConfig gswicWas, *pgswicNow; + GSwitchItKbdConfig gswicWas, *pgswicNow; gboolean isConfigChanged; if (!initedOk) return; - pgswicNow = g_new (GSwitchItXkbConfig, 1); + pgswicNow = g_new (GSwitchItKbdConfig, 1); confClient = gconf_client_get_default (); - GSwitchItXkbConfigInit (&gswicWas, confClient); - GSwitchItXkbConfigInit (pgswicNow, confClient); + GSwitchItKbdConfigInit (&gswicWas, confClient); + GSwitchItKbdConfigInit (pgswicNow, confClient); g_object_unref (confClient); - GSwitchItXkbConfigLoadSysBackup (&gswicWas); - GSwitchItXkbConfigLoadInitial (pgswicNow); + GSwitchItKbdConfigLoadSysBackup (&gswicWas); + GSwitchItKbdConfigLoadInitial (pgswicNow); isConfigChanged = g_slist_length (gswicWas.layouts) && - !GSwitchItXkbConfigEquals (pgswicNow, &gswicWas); + !GSwitchItKbdConfigEquals (pgswicNow, &gswicWas); /* config was changed!!! */ if (isConfigChanged) { GtkWidget *msg = gtk_message_dialog_new_with_markup (NULL, @@ -202,10 +202,10 @@ gnome_settings_keyboard_xkb_analyze_sysconfig (void) pgswicNow); gtk_widget_show (msg); } - GSwitchItXkbConfigSaveSysBackup (pgswicNow); + GSwitchItKbdConfigSaveSysBackup (pgswicNow); if (!isConfigChanged) g_free (pgswicNow); - GSwitchItXkbConfigTerm (&gswicWas); + GSwitchItKbdConfigTerm (&gswicWas); } static void