diff options
author | Stefano Karapetsas <[email protected]> | 2012-02-22 03:44:27 -0800 |
---|---|---|
committer | Stefano Karapetsas <[email protected]> | 2012-02-22 03:44:27 -0800 |
commit | 2dfe3164d9f195b50e066def8e2a4782b5910c10 (patch) | |
tree | f95660c9462b74c2775355c29df79267fc30501b /plugins/keyboard | |
parent | ecd8a153901507f5d210d6f85103693ef81d49c3 (diff) | |
parent | e46b4adef5c6c6805b3ca6dbfbe99a4299252514 (diff) | |
download | mate-settings-daemon-2dfe3164d9f195b50e066def8e2a4782b5910c10.tar.bz2 mate-settings-daemon-2dfe3164d9f195b50e066def8e2a4782b5910c10.tar.xz |
Merge pull request #3 from haxar/master
gsd to msd complete rename patch by NiceandGently
Diffstat (limited to 'plugins/keyboard')
-rw-r--r-- | plugins/keyboard/Makefile.am | 20 | ||||
-rw-r--r-- | plugins/keyboard/delayed-dialog.c | 4 | ||||
-rw-r--r-- | plugins/keyboard/delayed-dialog.h | 2 | ||||
-rw-r--r-- | plugins/keyboard/gsd-keyboard-manager.h | 62 | ||||
-rw-r--r-- | plugins/keyboard/msd-keyboard-manager.c (renamed from plugins/keyboard/gsd-keyboard-manager.c) | 144 | ||||
-rw-r--r-- | plugins/keyboard/msd-keyboard-manager.h | 62 | ||||
-rw-r--r-- | plugins/keyboard/msd-keyboard-plugin.c (renamed from plugins/keyboard/gsd-keyboard-plugin.c) | 42 | ||||
-rw-r--r-- | plugins/keyboard/msd-keyboard-plugin.h (renamed from plugins/keyboard/gsd-keyboard-plugin.h) | 28 | ||||
-rw-r--r-- | plugins/keyboard/msd-keyboard-xkb.c (renamed from plugins/keyboard/gsd-keyboard-xkb.c) | 70 | ||||
-rw-r--r-- | plugins/keyboard/msd-keyboard-xkb.h (renamed from plugins/keyboard/gsd-keyboard-xkb.h) | 12 | ||||
-rw-r--r-- | plugins/keyboard/msd-xmodmap.c (renamed from plugins/keyboard/gsd-xmodmap.c) | 8 | ||||
-rw-r--r-- | plugins/keyboard/msd-xmodmap.h (renamed from plugins/keyboard/gsd-xmodmap.h) | 4 |
12 files changed, 229 insertions, 229 deletions
diff --git a/plugins/keyboard/Makefile.am b/plugins/keyboard/Makefile.am index fdad2a8..327ad7e 100644 --- a/plugins/keyboard/Makefile.am +++ b/plugins/keyboard/Makefile.am @@ -17,14 +17,14 @@ uidir = $(pkgdatadir) ui_DATA = modmap-dialog.ui libkeyboard_la_SOURCES = \ - gsd-keyboard-plugin.h \ - gsd-keyboard-plugin.c \ - gsd-keyboard-manager.h \ - gsd-keyboard-manager.c \ - gsd-keyboard-xkb.h \ - gsd-keyboard-xkb.c \ - gsd-xmodmap.h \ - gsd-xmodmap.c \ + msd-keyboard-plugin.h \ + msd-keyboard-plugin.c \ + msd-keyboard-manager.h \ + msd-keyboard-manager.c \ + msd-keyboard-xkb.h \ + msd-keyboard-xkb.c \ + msd-xmodmap.h \ + msd-xmodmap.c \ delayed-dialog.h \ delayed-dialog.c \ $(NULL) @@ -41,7 +41,7 @@ libkeyboard_la_CFLAGS = \ $(AM_CFLAGS) libkeyboard_la_LDFLAGS = \ - $(GSD_PLUGIN_LDFLAGS) \ + $(MSD_PLUGIN_LDFLAGS) \ $(NULL) libkeyboard_la_LIBADD = \ @@ -70,4 +70,4 @@ DISTCLEANFILES = \ $(plugin_DATA) \ $(NULL) -@GSD_INTLTOOL_PLUGIN_RULE@ +@MSD_INTLTOOL_PLUGIN_RULE@ diff --git a/plugins/keyboard/delayed-dialog.c b/plugins/keyboard/delayed-dialog.c index 1aa13e1..acbb99a 100644 --- a/plugins/keyboard/delayed-dialog.c +++ b/plugins/keyboard/delayed-dialog.c @@ -33,7 +33,7 @@ static GdkFilterReturn message_filter (GdkXEvent *xevent, static GSList *dialogs = NULL; /** - * gsd_delayed_show_dialog: + * msd_delayed_show_dialog: * @dialog: the dialog * * Shows the dialog as with gtk_widget_show(), unless a window manager @@ -41,7 +41,7 @@ static GSList *dialogs = NULL; * for that to happen before showing the dialog. **/ void -gsd_delayed_show_dialog (GtkWidget *dialog) +msd_delayed_show_dialog (GtkWidget *dialog) { GdkDisplay *display = gtk_widget_get_display (dialog); Display *xdisplay = GDK_DISPLAY_XDISPLAY (display); diff --git a/plugins/keyboard/delayed-dialog.h b/plugins/keyboard/delayed-dialog.h index 353dbe6..a28bf90 100644 --- a/plugins/keyboard/delayed-dialog.h +++ b/plugins/keyboard/delayed-dialog.h @@ -27,7 +27,7 @@ extern "C" { #endif -void gsd_delayed_show_dialog (GtkWidget *dialog); +void msd_delayed_show_dialog (GtkWidget *dialog); #ifdef __cplusplus } diff --git a/plugins/keyboard/gsd-keyboard-manager.h b/plugins/keyboard/gsd-keyboard-manager.h deleted file mode 100644 index a518e9a..0000000 --- a/plugins/keyboard/gsd-keyboard-manager.h +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- - * - * Copyright (C) 2007 William Jon McCann <[email protected]> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - */ - -#ifndef __GSD_KEYBOARD_MANAGER_H -#define __GSD_KEYBOARD_MANAGER_H - -#include <glib-object.h> - -#ifdef __cplusplus -extern "C" { -#endif - -#define GSD_TYPE_KEYBOARD_MANAGER (gsd_keyboard_manager_get_type ()) -#define GSD_KEYBOARD_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_KEYBOARD_MANAGER, GsdKeyboardManager)) -#define GSD_KEYBOARD_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_KEYBOARD_MANAGER, GsdKeyboardManagerClass)) -#define GSD_IS_KEYBOARD_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_KEYBOARD_MANAGER)) -#define GSD_IS_KEYBOARD_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_KEYBOARD_MANAGER)) -#define GSD_KEYBOARD_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_KEYBOARD_MANAGER, GsdKeyboardManagerClass)) - -typedef struct GsdKeyboardManagerPrivate GsdKeyboardManagerPrivate; - -typedef struct -{ - GObject parent; - GsdKeyboardManagerPrivate *priv; -} GsdKeyboardManager; - -typedef struct -{ - GObjectClass parent_class; -} GsdKeyboardManagerClass; - -GType gsd_keyboard_manager_get_type (void); - -GsdKeyboardManager * gsd_keyboard_manager_new (void); -gboolean gsd_keyboard_manager_start (GsdKeyboardManager *manager, - GError **error); -void gsd_keyboard_manager_stop (GsdKeyboardManager *manager); -void gsd_keyboard_manager_apply_settings (GsdKeyboardManager *manager); - -#ifdef __cplusplus -} -#endif - -#endif /* __GSD_KEYBOARD_MANAGER_H */ diff --git a/plugins/keyboard/gsd-keyboard-manager.c b/plugins/keyboard/msd-keyboard-manager.c index 24d6729..0969459 100644 --- a/plugins/keyboard/gsd-keyboard-manager.c +++ b/plugins/keyboard/msd-keyboard-manager.c @@ -47,42 +47,42 @@ #endif #include "mate-settings-profile.h" -#include "gsd-keyboard-manager.h" +#include "msd-keyboard-manager.h" -#include "gsd-keyboard-xkb.h" -#include "gsd-xmodmap.h" +#include "msd-keyboard-xkb.h" +#include "msd-xmodmap.h" -#define GSD_KEYBOARD_MANAGER_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE((o), GSD_TYPE_KEYBOARD_MANAGER, GsdKeyboardManagerPrivate)) +#define MSD_KEYBOARD_MANAGER_GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE((o), MSD_TYPE_KEYBOARD_MANAGER, MsdKeyboardManagerPrivate)) #ifndef HOST_NAME_MAX #define HOST_NAME_MAX 255 #endif -#define GSD_KEYBOARD_KEY "/desktop/mate/peripherals/keyboard" +#define MSD_KEYBOARD_KEY "/desktop/mate/peripherals/keyboard" -#define KEY_REPEAT GSD_KEYBOARD_KEY "/repeat" -#define KEY_CLICK GSD_KEYBOARD_KEY "/click" -#define KEY_RATE GSD_KEYBOARD_KEY "/rate" -#define KEY_DELAY GSD_KEYBOARD_KEY "/delay" -#define KEY_CLICK_VOLUME GSD_KEYBOARD_KEY "/click_volume" +#define KEY_REPEAT MSD_KEYBOARD_KEY "/repeat" +#define KEY_CLICK MSD_KEYBOARD_KEY "/click" +#define KEY_RATE MSD_KEYBOARD_KEY "/rate" +#define KEY_DELAY MSD_KEYBOARD_KEY "/delay" +#define KEY_CLICK_VOLUME MSD_KEYBOARD_KEY "/click_volume" -#define KEY_BELL_VOLUME GSD_KEYBOARD_KEY "/bell_volume" -#define KEY_BELL_PITCH GSD_KEYBOARD_KEY "/bell_pitch" -#define KEY_BELL_DURATION GSD_KEYBOARD_KEY "/bell_duration" -#define KEY_BELL_MODE GSD_KEYBOARD_KEY "/bell_mode" +#define KEY_BELL_VOLUME MSD_KEYBOARD_KEY "/bell_volume" +#define KEY_BELL_PITCH MSD_KEYBOARD_KEY "/bell_pitch" +#define KEY_BELL_DURATION MSD_KEYBOARD_KEY "/bell_duration" +#define KEY_BELL_MODE MSD_KEYBOARD_KEY "/bell_mode" -struct GsdKeyboardManagerPrivate { +struct MsdKeyboardManagerPrivate { gboolean have_xkb; gint xkb_event_base; guint notify; }; -static void gsd_keyboard_manager_class_init (GsdKeyboardManagerClass* klass); -static void gsd_keyboard_manager_init (GsdKeyboardManager* keyboard_manager); -static void gsd_keyboard_manager_finalize (GObject* object); +static void msd_keyboard_manager_class_init (MsdKeyboardManagerClass* klass); +static void msd_keyboard_manager_init (MsdKeyboardManager* keyboard_manager); +static void msd_keyboard_manager_finalize (GObject* object); -G_DEFINE_TYPE (GsdKeyboardManager, gsd_keyboard_manager, G_TYPE_OBJECT) +G_DEFINE_TYPE (MsdKeyboardManager, msd_keyboard_manager, G_TYPE_OBJECT) static gpointer manager_object = NULL; @@ -126,7 +126,7 @@ static gboolean xkb_set_keyboard_autorepeat_rate(int delay, int rate) } #endif -static char* gsd_keyboard_get_hostname_key (const char *subkey) +static char* msd_keyboard_get_hostname_key (const char *subkey) { char hostname[HOST_NAME_MAX + 1]; @@ -137,7 +137,7 @@ static char* gsd_keyboard_get_hostname_key (const char *subkey) char *key; escaped = mateconf_escape_key (hostname, -1); - key = g_strconcat (GSD_KEYBOARD_KEY + key = g_strconcat (MSD_KEYBOARD_KEY "/host-", escaped, "/0/", @@ -158,7 +158,7 @@ typedef enum { } NumLockState; static void -numlock_xkb_init (GsdKeyboardManager *manager) +numlock_xkb_init (MsdKeyboardManager *manager) { Display *dpy = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); gboolean have_xkb; @@ -206,7 +206,7 @@ numlock_set_xkb_state (NumLockState new_state) static char * numlock_mateconf_state_key (void) { - char *key = gsd_keyboard_get_hostname_key ("numlock_on"); + char *key = msd_keyboard_get_hostname_key ("numlock_on"); if (!key) { g_message ("NumLock remembering disabled because hostname is set to \"localhost\""); } @@ -274,7 +274,7 @@ numlock_xkb_callback (GdkXEvent *xev_, } static void -numlock_install_xkb_callback (GsdKeyboardManager *manager) +numlock_install_xkb_callback (MsdKeyboardManager *manager) { if (!manager->priv->have_xkb) return; @@ -290,7 +290,7 @@ static void apply_settings (MateConfClient *client, guint cnxn_id, MateConfEntry *entry, - GsdKeyboardManager *manager) + MsdKeyboardManager *manager) { XKeyboardControl kbdcontrol; gboolean repeat; @@ -322,7 +322,7 @@ apply_settings (MateConfClient *client, g_free (volume_string); #ifdef HAVE_X11_EXTENSIONS_XKB_H - rnumlock = mateconf_client_get_bool (client, GSD_KEYBOARD_KEY "/remember_numlock_state", NULL); + rnumlock = mateconf_client_get_bool (client, MSD_KEYBOARD_KEY "/remember_numlock_state", NULL); #endif /* HAVE_X11_EXTENSIONS_XKB_H */ gdk_error_trap_push (); @@ -370,7 +370,7 @@ apply_settings (MateConfClient *client, } void -gsd_keyboard_manager_apply_settings (GsdKeyboardManager *manager) +msd_keyboard_manager_apply_settings (MsdKeyboardManager *manager) { MateConfClient *client; @@ -380,7 +380,7 @@ gsd_keyboard_manager_apply_settings (GsdKeyboardManager *manager) } static gboolean -start_keyboard_idle_cb (GsdKeyboardManager *manager) +start_keyboard_idle_cb (MsdKeyboardManager *manager) { MateConfClient *client; @@ -391,20 +391,20 @@ start_keyboard_idle_cb (GsdKeyboardManager *manager) manager->priv->have_xkb = 0; client = mateconf_client_get_default (); - mateconf_client_add_dir (client, GSD_KEYBOARD_KEY, MATECONF_CLIENT_PRELOAD_RECURSIVE, NULL); + mateconf_client_add_dir (client, MSD_KEYBOARD_KEY, MATECONF_CLIENT_PRELOAD_RECURSIVE, NULL); /* Essential - xkb initialization should happen before */ - gsd_keyboard_xkb_set_post_activation_callback ((PostActivationCallback) gsd_load_modmap_files, NULL); - gsd_keyboard_xkb_init (client, manager); + msd_keyboard_xkb_set_post_activation_callback ((PostActivationCallback) msd_load_modmap_files, NULL); + msd_keyboard_xkb_init (client, manager); #ifdef HAVE_X11_EXTENSIONS_XKB_H numlock_xkb_init (manager); #endif /* HAVE_X11_EXTENSIONS_XKB_H */ /* apply current settings before we install the callback */ - gsd_keyboard_manager_apply_settings (manager); + msd_keyboard_manager_apply_settings (manager); - manager->priv->notify = mateconf_client_notify_add (client, GSD_KEYBOARD_KEY, + manager->priv->notify = mateconf_client_notify_add (client, MSD_KEYBOARD_KEY, (MateConfClientNotifyFunc) apply_settings, manager, NULL, NULL); @@ -420,7 +420,7 @@ start_keyboard_idle_cb (GsdKeyboardManager *manager) } gboolean -gsd_keyboard_manager_start (GsdKeyboardManager *manager, +msd_keyboard_manager_start (MsdKeyboardManager *manager, GError **error) { mate_settings_profile_start (NULL); @@ -433,15 +433,15 @@ gsd_keyboard_manager_start (GsdKeyboardManager *manager, } void -gsd_keyboard_manager_stop (GsdKeyboardManager *manager) +msd_keyboard_manager_stop (MsdKeyboardManager *manager) { - GsdKeyboardManagerPrivate *p = manager->priv; + MsdKeyboardManagerPrivate *p = manager->priv; g_debug ("Stopping keyboard manager"); if (p->notify != 0) { MateConfClient *client = mateconf_client_get_default (); - mateconf_client_remove_dir (client, GSD_KEYBOARD_KEY, NULL); + mateconf_client_remove_dir (client, MSD_KEYBOARD_KEY, NULL); mateconf_client_notify_remove (client, p->notify); g_object_unref (client); p->notify = 0; @@ -455,18 +455,18 @@ gsd_keyboard_manager_stop (GsdKeyboardManager *manager) } #endif /* HAVE_X11_EXTENSIONS_XKB_H */ - gsd_keyboard_xkb_shutdown (); + msd_keyboard_xkb_shutdown (); } static void -gsd_keyboard_manager_set_property (GObject *object, +msd_keyboard_manager_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { - GsdKeyboardManager *self; + MsdKeyboardManager *self; - self = GSD_KEYBOARD_MANAGER (object); + self = MSD_KEYBOARD_MANAGER (object); switch (prop_id) { default: @@ -476,14 +476,14 @@ gsd_keyboard_manager_set_property (GObject *object, } static void -gsd_keyboard_manager_get_property (GObject *object, +msd_keyboard_manager_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { - GsdKeyboardManager *self; + MsdKeyboardManager *self; - self = GSD_KEYBOARD_MANAGER (object); + self = MSD_KEYBOARD_MANAGER (object); switch (prop_id) { default: @@ -493,16 +493,16 @@ gsd_keyboard_manager_get_property (GObject *object, } static GObject * -gsd_keyboard_manager_constructor (GType type, +msd_keyboard_manager_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties) { - GsdKeyboardManager *keyboard_manager; - GsdKeyboardManagerClass *klass; + MsdKeyboardManager *keyboard_manager; + MsdKeyboardManagerClass *klass; - klass = GSD_KEYBOARD_MANAGER_CLASS (g_type_class_peek (GSD_TYPE_KEYBOARD_MANAGER)); + klass = MSD_KEYBOARD_MANAGER_CLASS (g_type_class_peek (MSD_TYPE_KEYBOARD_MANAGER)); - keyboard_manager = GSD_KEYBOARD_MANAGER (G_OBJECT_CLASS (gsd_keyboard_manager_parent_class)->constructor (type, + keyboard_manager = MSD_KEYBOARD_MANAGER (G_OBJECT_CLASS (msd_keyboard_manager_parent_class)->constructor (type, n_construct_properties, construct_properties)); @@ -510,60 +510,60 @@ gsd_keyboard_manager_constructor (GType type, } static void -gsd_keyboard_manager_dispose (GObject *object) +msd_keyboard_manager_dispose (GObject *object) { - GsdKeyboardManager *keyboard_manager; + MsdKeyboardManager *keyboard_manager; - keyboard_manager = GSD_KEYBOARD_MANAGER (object); + keyboard_manager = MSD_KEYBOARD_MANAGER (object); - G_OBJECT_CLASS (gsd_keyboard_manager_parent_class)->dispose (object); + G_OBJECT_CLASS (msd_keyboard_manager_parent_class)->dispose (object); } static void -gsd_keyboard_manager_class_init (GsdKeyboardManagerClass *klass) +msd_keyboard_manager_class_init (MsdKeyboardManagerClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - object_class->get_property = gsd_keyboard_manager_get_property; - object_class->set_property = gsd_keyboard_manager_set_property; - object_class->constructor = gsd_keyboard_manager_constructor; - object_class->dispose = gsd_keyboard_manager_dispose; - object_class->finalize = gsd_keyboard_manager_finalize; + object_class->get_property = msd_keyboard_manager_get_property; + object_class->set_property = msd_keyboard_manager_set_property; + object_class->constructor = msd_keyboard_manager_constructor; + object_class->dispose = msd_keyboard_manager_dispose; + object_class->finalize = msd_keyboard_manager_finalize; - g_type_class_add_private (klass, sizeof (GsdKeyboardManagerPrivate)); + g_type_class_add_private (klass, sizeof (MsdKeyboardManagerPrivate)); } static void -gsd_keyboard_manager_init (GsdKeyboardManager *manager) +msd_keyboard_manager_init (MsdKeyboardManager *manager) { - manager->priv = GSD_KEYBOARD_MANAGER_GET_PRIVATE (manager); + manager->priv = MSD_KEYBOARD_MANAGER_GET_PRIVATE (manager); } static void -gsd_keyboard_manager_finalize (GObject *object) +msd_keyboard_manager_finalize (GObject *object) { - GsdKeyboardManager *keyboard_manager; + MsdKeyboardManager *keyboard_manager; g_return_if_fail (object != NULL); - g_return_if_fail (GSD_IS_KEYBOARD_MANAGER (object)); + g_return_if_fail (MSD_IS_KEYBOARD_MANAGER (object)); - keyboard_manager = GSD_KEYBOARD_MANAGER (object); + keyboard_manager = MSD_KEYBOARD_MANAGER (object); g_return_if_fail (keyboard_manager->priv != NULL); - G_OBJECT_CLASS (gsd_keyboard_manager_parent_class)->finalize (object); + G_OBJECT_CLASS (msd_keyboard_manager_parent_class)->finalize (object); } -GsdKeyboardManager * -gsd_keyboard_manager_new (void) +MsdKeyboardManager * +msd_keyboard_manager_new (void) { if (manager_object != NULL) { g_object_ref (manager_object); } else { - manager_object = g_object_new (GSD_TYPE_KEYBOARD_MANAGER, NULL); + manager_object = g_object_new (MSD_TYPE_KEYBOARD_MANAGER, NULL); g_object_add_weak_pointer (manager_object, (gpointer *) &manager_object); } - return GSD_KEYBOARD_MANAGER (manager_object); + return MSD_KEYBOARD_MANAGER (manager_object); } diff --git a/plugins/keyboard/msd-keyboard-manager.h b/plugins/keyboard/msd-keyboard-manager.h new file mode 100644 index 0000000..aa3ae95 --- /dev/null +++ b/plugins/keyboard/msd-keyboard-manager.h @@ -0,0 +1,62 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- + * + * Copyright (C) 2007 William Jon McCann <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef __MSD_KEYBOARD_MANAGER_H +#define __MSD_KEYBOARD_MANAGER_H + +#include <glib-object.h> + +#ifdef __cplusplus +extern "C" { +#endif + +#define MSD_TYPE_KEYBOARD_MANAGER (msd_keyboard_manager_get_type ()) +#define MSD_KEYBOARD_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MSD_TYPE_KEYBOARD_MANAGER, MsdKeyboardManager)) +#define MSD_KEYBOARD_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MSD_TYPE_KEYBOARD_MANAGER, MsdKeyboardManagerClass)) +#define MSD_IS_KEYBOARD_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MSD_TYPE_KEYBOARD_MANAGER)) +#define MSD_IS_KEYBOARD_MANAGER_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MSD_TYPE_KEYBOARD_MANAGER)) +#define MSD_KEYBOARD_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MSD_TYPE_KEYBOARD_MANAGER, MsdKeyboardManagerClass)) + +typedef struct MsdKeyboardManagerPrivate MsdKeyboardManagerPrivate; + +typedef struct +{ + GObject parent; + MsdKeyboardManagerPrivate *priv; +} MsdKeyboardManager; + +typedef struct +{ + GObjectClass parent_class; +} MsdKeyboardManagerClass; + +GType msd_keyboard_manager_get_type (void); + +MsdKeyboardManager * msd_keyboard_manager_new (void); +gboolean msd_keyboard_manager_start (MsdKeyboardManager *manager, + GError **error); +void msd_keyboard_manager_stop (MsdKeyboardManager *manager); +void msd_keyboard_manager_apply_settings (MsdKeyboardManager *manager); + +#ifdef __cplusplus +} +#endif + +#endif /* __MSD_KEYBOARD_MANAGER_H */ diff --git a/plugins/keyboard/gsd-keyboard-plugin.c b/plugins/keyboard/msd-keyboard-plugin.c index b501d80..5f89ca2 100644 --- a/plugins/keyboard/gsd-keyboard-plugin.c +++ b/plugins/keyboard/msd-keyboard-plugin.c @@ -24,38 +24,38 @@ #include <gmodule.h> #include "mate-settings-plugin.h" -#include "gsd-keyboard-plugin.h" -#include "gsd-keyboard-manager.h" +#include "msd-keyboard-plugin.h" +#include "msd-keyboard-manager.h" -struct GsdKeyboardPluginPrivate { - GsdKeyboardManager *manager; +struct MsdKeyboardPluginPrivate { + MsdKeyboardManager *manager; }; -#define GSD_KEYBOARD_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), GSD_TYPE_KEYBOARD_PLUGIN, GsdKeyboardPluginPrivate)) +#define MSD_KEYBOARD_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), MSD_TYPE_KEYBOARD_PLUGIN, MsdKeyboardPluginPrivate)) -MATE_SETTINGS_PLUGIN_REGISTER (GsdKeyboardPlugin, gsd_keyboard_plugin) +MATE_SETTINGS_PLUGIN_REGISTER (MsdKeyboardPlugin, msd_keyboard_plugin) static void -gsd_keyboard_plugin_init (GsdKeyboardPlugin *plugin) +msd_keyboard_plugin_init (MsdKeyboardPlugin *plugin) { - plugin->priv = GSD_KEYBOARD_PLUGIN_GET_PRIVATE (plugin); + plugin->priv = MSD_KEYBOARD_PLUGIN_GET_PRIVATE (plugin); - g_debug ("GsdKeyboardPlugin initializing"); + g_debug ("MsdKeyboardPlugin initializing"); - plugin->priv->manager = gsd_keyboard_manager_new (); + plugin->priv->manager = msd_keyboard_manager_new (); } static void -gsd_keyboard_plugin_finalize (GObject *object) +msd_keyboard_plugin_finalize (GObject *object) { - GsdKeyboardPlugin *plugin; + MsdKeyboardPlugin *plugin; g_return_if_fail (object != NULL); - g_return_if_fail (GSD_IS_KEYBOARD_PLUGIN (object)); + g_return_if_fail (MSD_IS_KEYBOARD_PLUGIN (object)); - g_debug ("GsdKeyboardPlugin finalizing"); + g_debug ("MsdKeyboardPlugin finalizing"); - plugin = GSD_KEYBOARD_PLUGIN (object); + plugin = MSD_KEYBOARD_PLUGIN (object); g_return_if_fail (plugin->priv != NULL); @@ -63,7 +63,7 @@ gsd_keyboard_plugin_finalize (GObject *object) g_object_unref (plugin->priv->manager); } - G_OBJECT_CLASS (gsd_keyboard_plugin_parent_class)->finalize (object); + G_OBJECT_CLASS (msd_keyboard_plugin_parent_class)->finalize (object); } static void @@ -75,7 +75,7 @@ impl_activate (MateSettingsPlugin *plugin) g_debug ("Activating keyboard plugin"); error = NULL; - res = gsd_keyboard_manager_start (GSD_KEYBOARD_PLUGIN (plugin)->priv->manager, &error); + res = msd_keyboard_manager_start (MSD_KEYBOARD_PLUGIN (plugin)->priv->manager, &error); if (! res) { g_warning ("Unable to start keyboard manager: %s", error->message); g_error_free (error); @@ -86,19 +86,19 @@ static void impl_deactivate (MateSettingsPlugin *plugin) { g_debug ("Deactivating keyboard plugin"); - gsd_keyboard_manager_stop (GSD_KEYBOARD_PLUGIN (plugin)->priv->manager); + msd_keyboard_manager_stop (MSD_KEYBOARD_PLUGIN (plugin)->priv->manager); } static void -gsd_keyboard_plugin_class_init (GsdKeyboardPluginClass *klass) +msd_keyboard_plugin_class_init (MsdKeyboardPluginClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); MateSettingsPluginClass *plugin_class = MATE_SETTINGS_PLUGIN_CLASS (klass); - object_class->finalize = gsd_keyboard_plugin_finalize; + object_class->finalize = msd_keyboard_plugin_finalize; plugin_class->activate = impl_activate; plugin_class->deactivate = impl_deactivate; - g_type_class_add_private (klass, sizeof (GsdKeyboardPluginPrivate)); + g_type_class_add_private (klass, sizeof (MsdKeyboardPluginPrivate)); } diff --git a/plugins/keyboard/gsd-keyboard-plugin.h b/plugins/keyboard/msd-keyboard-plugin.h index 3d25861..84f2420 100644 --- a/plugins/keyboard/gsd-keyboard-plugin.h +++ b/plugins/keyboard/msd-keyboard-plugin.h @@ -18,8 +18,8 @@ * */ -#ifndef __GSD_KEYBOARD_PLUGIN_H__ -#define __GSD_KEYBOARD_PLUGIN_H__ +#ifndef __MSD_KEYBOARD_PLUGIN_H__ +#define __MSD_KEYBOARD_PLUGIN_H__ #include <glib.h> #include <glib-object.h> @@ -31,27 +31,27 @@ extern "C" { #endif -#define GSD_TYPE_KEYBOARD_PLUGIN (gsd_keyboard_plugin_get_type ()) -#define GSD_KEYBOARD_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_KEYBOARD_PLUGIN, GsdKeyboardPlugin)) -#define GSD_KEYBOARD_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_KEYBOARD_PLUGIN, GsdKeyboardPluginClass)) -#define GSD_IS_KEYBOARD_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_KEYBOARD_PLUGIN)) -#define GSD_IS_KEYBOARD_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_KEYBOARD_PLUGIN)) -#define GSD_KEYBOARD_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_KEYBOARD_PLUGIN, GsdKeyboardPluginClass)) +#define MSD_TYPE_KEYBOARD_PLUGIN (msd_keyboard_plugin_get_type ()) +#define MSD_KEYBOARD_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MSD_TYPE_KEYBOARD_PLUGIN, MsdKeyboardPlugin)) +#define MSD_KEYBOARD_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MSD_TYPE_KEYBOARD_PLUGIN, MsdKeyboardPluginClass)) +#define MSD_IS_KEYBOARD_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MSD_TYPE_KEYBOARD_PLUGIN)) +#define MSD_IS_KEYBOARD_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MSD_TYPE_KEYBOARD_PLUGIN)) +#define MSD_KEYBOARD_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MSD_TYPE_KEYBOARD_PLUGIN, MsdKeyboardPluginClass)) -typedef struct GsdKeyboardPluginPrivate GsdKeyboardPluginPrivate; +typedef struct MsdKeyboardPluginPrivate MsdKeyboardPluginPrivate; typedef struct { MateSettingsPlugin parent; - GsdKeyboardPluginPrivate *priv; -} GsdKeyboardPlugin; + MsdKeyboardPluginPrivate *priv; +} MsdKeyboardPlugin; typedef struct { MateSettingsPluginClass parent_class; -} GsdKeyboardPluginClass; +} MsdKeyboardPluginClass; -GType gsd_keyboard_plugin_get_type (void) G_GNUC_CONST; +GType msd_keyboard_plugin_get_type (void) G_GNUC_CONST; /* All the plugins must implement this function */ G_MODULE_EXPORT GType register_mate_settings_plugin (GTypeModule *module); @@ -60,4 +60,4 @@ G_MODULE_EXPORT GType register_mate_settings_plugin (GTypeModule *module); } #endif -#endif /* __GSD_KEYBOARD_PLUGIN_H__ */ +#endif /* __MSD_KEYBOARD_PLUGIN_H__ */ diff --git a/plugins/keyboard/gsd-keyboard-xkb.c b/plugins/keyboard/msd-keyboard-xkb.c index 0808272..9042f03 100644 --- a/plugins/keyboard/gsd-keyboard-xkb.c +++ b/plugins/keyboard/msd-keyboard-xkb.c @@ -37,14 +37,14 @@ #include <libmatekbd/matekbd-keyboard-config.h> #include <libmatekbd/matekbd-util.h> -#include "gsd-xmodmap.h" -#include "gsd-keyboard-xkb.h" +#include "msd-xmodmap.h" +#include "msd-keyboard-xkb.h" #include "delayed-dialog.h" #include "mate-settings-profile.h" #define GTK_RESPONSE_PRINT 2 -static GsdKeyboardManager* manager = NULL; +static MsdKeyboardManager* manager = NULL; static XklEngine* xkl_engine; static XklConfigRegistry* xkl_registry = NULL; @@ -92,12 +92,12 @@ static const gchar* indicator_off_icon_names[] = { "kbd-capslock-off" }; -//#define noGSDKX +//#define noMSDKX -#ifdef GSDKX +#ifdef MSDKX static FILE *logfile; -static void gsd_keyboard_log_appender(const char file[], const char function[], int level, const char format[], va_list args) +static void msd_keyboard_log_appender(const char file[], const char function[], int level, const char format[], va_list args) { time_t now = time (NULL); fprintf (logfile, "[%08ld,%03d,%s:%s/] \t", now, @@ -150,7 +150,7 @@ activation_error (void) "mateconftool-2 -R /desktop/mate/peripherals/keyboard/kbd"); g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), NULL); - gsd_delayed_show_dialog (dialog); + msd_delayed_show_dialog (dialog); } static void @@ -162,7 +162,7 @@ apply_desktop_settings (void) if (!inited_ok) return; - gsd_keyboard_manager_apply_settings (manager); + msd_keyboard_manager_apply_settings (manager); matekbd_desktop_config_load_from_mateconf (¤t_config); /* again, probably it would be nice to compare things before activating them */ @@ -600,7 +600,7 @@ apply_xkb_settings (void) } static void -gsd_keyboard_xkb_analyze_sysconfig (void) +msd_keyboard_xkb_analyze_sysconfig (void) { MateConfClient *conf_client; @@ -616,7 +616,7 @@ gsd_keyboard_xkb_analyze_sysconfig (void) } static gboolean -gsd_chk_file_list (void) +msd_chk_file_list (void) { GDir *home_dir; const char *fname; @@ -684,16 +684,16 @@ gsd_chk_file_list (void) } static void -gsd_keyboard_xkb_chk_lcl_xmm (void) +msd_keyboard_xkb_chk_lcl_xmm (void) { - if (gsd_chk_file_list ()) { - gsd_modmap_dialog_call (); + if (msd_chk_file_list ()) { + msd_modmap_dialog_call (); } - gsd_load_modmap_files (); + msd_load_modmap_files (); } void -gsd_keyboard_xkb_set_post_activation_callback (PostActivationCallback fun, +msd_keyboard_xkb_set_post_activation_callback (PostActivationCallback fun, void *user_data) { pa_callback = fun; @@ -701,7 +701,7 @@ gsd_keyboard_xkb_set_post_activation_callback (PostActivationCallback fun, } static GdkFilterReturn -gsd_keyboard_xkb_evt_filter (GdkXEvent * xev, GdkEvent * event) +msd_keyboard_xkb_evt_filter (GdkXEvent * xev, GdkEvent * event) { XEvent *xevent = (XEvent *) xev; xkl_engine_filter_events (xkl_engine, xevent); @@ -720,14 +720,14 @@ register_config_callback (MateConfClient * client, /* When new Keyboard is plugged in - reload the settings */ static void -gsd_keyboard_new_device (XklEngine * engine) +msd_keyboard_new_device (XklEngine * engine) { apply_desktop_settings (); apply_xkb_settings (); } static void -gsd_keyboard_update_indicator_icons () +msd_keyboard_update_indicator_icons () { Bool state; int new_state, i; @@ -758,20 +758,20 @@ gsd_keyboard_update_indicator_icons () } static void -gsd_keyboard_state_changed (XklEngine * engine, XklEngineStateChange type, +msd_keyboard_state_changed (XklEngine * engine, XklEngineStateChange type, gint new_group, gboolean restore) { xkl_debug (160, "State changed: type %d, new group: %d, restore: %d.\n", type, new_group, restore); if (type == INDICATORS_CHANGED) { - gsd_keyboard_update_indicator_icons (); + msd_keyboard_update_indicator_icons (); } } void -gsd_keyboard_xkb_init (MateConfClient * client, - GsdKeyboardManager * kbd_manager) +msd_keyboard_xkb_init (MateConfClient * client, + MsdKeyboardManager * kbd_manager) { int i; Display *display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default()); @@ -792,12 +792,12 @@ gsd_keyboard_xkb_init (MateConfClient * client, (indicator_off_icon_names[i]); } - gsd_keyboard_update_indicator_icons (); + msd_keyboard_update_indicator_icons (); -#ifdef GSDKX +#ifdef MSDKX xkl_set_debug_level (200); - logfile = fopen ("/tmp/gsdkx.log", "a"); - xkl_set_log_appender (gsd_keyboard_log_appender); + logfile = fopen ("/tmp/msdkx.log", "a"); + xkl_set_log_appender (msd_keyboard_log_appender); #endif manager = kbd_manager; mate_settings_profile_start ("xkl_engine_get_instance"); @@ -813,12 +813,12 @@ gsd_keyboard_xkb_init (MateConfClient * client, matekbd_keyboard_config_init (¤t_kbd_config, client, xkl_engine); xkl_engine_backup_names_prop (xkl_engine); - gsd_keyboard_xkb_analyze_sysconfig (); + msd_keyboard_xkb_analyze_sysconfig (); mate_settings_profile_start - ("gsd_keyboard_xkb_chk_lcl_xmm"); - gsd_keyboard_xkb_chk_lcl_xmm (); + ("msd_keyboard_xkb_chk_lcl_xmm"); + msd_keyboard_xkb_chk_lcl_xmm (); mate_settings_profile_end - ("gsd_keyboard_xkb_chk_lcl_xmm"); + ("msd_keyboard_xkb_chk_lcl_xmm"); notify_desktop = register_config_callback (client, @@ -833,16 +833,16 @@ gsd_keyboard_xkb_init (MateConfClient * client, apply_xkb_settings); gdk_window_add_filter (NULL, (GdkFilterFunc) - gsd_keyboard_xkb_evt_filter, NULL); + msd_keyboard_xkb_evt_filter, NULL); if (xkl_engine_get_features (xkl_engine) & XKLF_DEVICE_DISCOVERY) g_signal_connect (xkl_engine, "X-new-device", G_CALLBACK - (gsd_keyboard_new_device), NULL); + (msd_keyboard_new_device), NULL); g_signal_connect (xkl_engine, "X-state-changed", G_CALLBACK - (gsd_keyboard_state_changed), NULL); + (msd_keyboard_state_changed), NULL); mate_settings_profile_start ("xkl_engine_start_listen"); xkl_engine_start_listen (xkl_engine, @@ -863,7 +863,7 @@ gsd_keyboard_xkb_init (MateConfClient * client, } void -gsd_keyboard_xkb_shutdown (void) +msd_keyboard_xkb_shutdown (void) { MateConfClient *client; int i; @@ -888,7 +888,7 @@ gsd_keyboard_xkb_shutdown (void) XKLL_MANAGE_WINDOW_STATES); gdk_window_remove_filter (NULL, (GdkFilterFunc) - gsd_keyboard_xkb_evt_filter, NULL); + msd_keyboard_xkb_evt_filter, NULL); client = mateconf_client_get_default (); diff --git a/plugins/keyboard/gsd-keyboard-xkb.h b/plugins/keyboard/msd-keyboard-xkb.h index 41a50c6..7d2d558 100644 --- a/plugins/keyboard/gsd-keyboard-xkb.h +++ b/plugins/keyboard/msd-keyboard-xkb.h @@ -21,20 +21,20 @@ * 02111-1307, USA. */ -#ifndef __GSD_KEYBOARD_XKB_H -#define __GSD_KEYBOARD_XKB_H +#ifndef __MSD_KEYBOARD_XKB_H +#define __MSD_KEYBOARD_XKB_H #include <mateconf/mateconf.h> #include <mateconf/mateconf-client.h> #include <libxklavier/xklavier.h> -#include "gsd-keyboard-manager.h" +#include "msd-keyboard-manager.h" -void gsd_keyboard_xkb_init(MateConfClient* client, GsdKeyboardManager* manager); -void gsd_keyboard_xkb_shutdown(void); +void msd_keyboard_xkb_init(MateConfClient* client, MsdKeyboardManager* manager); +void msd_keyboard_xkb_shutdown(void); typedef void (*PostActivationCallback) (void* userData); -void gsd_keyboard_xkb_set_post_activation_callback(PostActivationCallback fun, void* userData); +void msd_keyboard_xkb_set_post_activation_callback(PostActivationCallback fun, void* userData); #endif diff --git a/plugins/keyboard/gsd-xmodmap.c b/plugins/keyboard/msd-xmodmap.c index b9ffc9c..5baf37c 100644 --- a/plugins/keyboard/gsd-xmodmap.c +++ b/plugins/keyboard/msd-xmodmap.c @@ -28,7 +28,7 @@ #include <gtk/gtk.h> #include <mateconf/mateconf-client.h> -#include "gsd-xmodmap.h" +#include "msd-xmodmap.h" static const char DISABLE_XMM_WARNING_KEY[] = "/desktop/mate/peripherals/keyboard/disable_xmm_and_xkb_warning"; @@ -54,7 +54,7 @@ check_button_callback (GtkWidget *chk_button, } void -gsd_load_modmap_files (void) +msd_load_modmap_files (void) { MateConfClient *client; GSList *tmp; @@ -90,7 +90,7 @@ response_callback (GtkWidget *dialog, if (id == GTK_RESPONSE_OK) { GtkWidget *chk_button = g_object_get_data (G_OBJECT (dialog), "check_button"); check_button_callback (chk_button, NULL); - gsd_load_modmap_files (); + msd_load_modmap_files (); } gtk_widget_destroy (dialog); } @@ -256,7 +256,7 @@ out: } void -gsd_modmap_dialog_call (void) +msd_modmap_dialog_call (void) { GtkBuilder *builder; guint res; diff --git a/plugins/keyboard/gsd-xmodmap.h b/plugins/keyboard/msd-xmodmap.h index 7cfff74..04b4505 100644 --- a/plugins/keyboard/gsd-xmodmap.h +++ b/plugins/keyboard/msd-xmodmap.h @@ -23,7 +23,7 @@ #ifndef XMODMAP_H #define XMODMAP_H -void gsd_load_modmap_files (void); -void gsd_modmap_dialog_call (void); +void msd_load_modmap_files (void); +void msd_modmap_dialog_call (void); #endif |