summaryrefslogtreecommitdiff
path: root/plugins/a11y-keyboard
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/a11y-keyboard')
-rw-r--r--plugins/a11y-keyboard/Makefile.am15
-rw-r--r--plugins/a11y-keyboard/msd-a11y-keyboard-atspi.c33
-rw-r--r--plugins/a11y-keyboard/msd-a11y-keyboard-manager.c16
3 files changed, 25 insertions, 39 deletions
diff --git a/plugins/a11y-keyboard/Makefile.am b/plugins/a11y-keyboard/Makefile.am
index 92072e2..0ea0e4a 100644
--- a/plugins/a11y-keyboard/Makefile.am
+++ b/plugins/a11y-keyboard/Makefile.am
@@ -42,8 +42,6 @@ liba11y_keyboard_la_SOURCES = \
msd-a11y-keyboard-plugin.c \
msd-a11y-keyboard-manager.h \
msd-a11y-keyboard-manager.c \
- msd-a11y-keyboard-atspi.h \
- msd-a11y-keyboard-atspi.c \
msd-a11y-preferences-dialog.h \
msd-a11y-preferences-dialog.c \
$(NULL)
@@ -57,7 +55,6 @@ liba11y_keyboard_la_CPPFLAGS = \
liba11y_keyboard_la_CFLAGS = \
$(SETTINGS_PLUGIN_CFLAGS) \
$(LIBNOTIFY_CFLAGS) \
- $(LIBATSPI_CFLAGS) \
$(AM_CFLAGS) \
$(WARN_CFLAGS) \
$(NULL)
@@ -69,9 +66,19 @@ liba11y_keyboard_la_LDFLAGS = \
liba11y_keyboard_la_LIBADD = \
$(SETTINGS_PLUGIN_LIBS) \
$(LIBNOTIFY_LIBS) \
- $(LIBATSPI_LIBS) \
$(NULL)
+if HAVE_LIBATSPI
+liba11y_keyboard_la_SOURCES += \
+ msd-a11y-keyboard-atspi.h \
+ msd-a11y-keyboard-atspi.c \
+ $(NULL)
+liba11y_keyboard_la_CFLAGS += \
+ $(LIBATSPI_CFLAGS)
+liba11y_keyboard_la_LIBADD += \
+ $(LIBATSPI_LIBS)
+endif
+
plugin_in_files = \
a11y-keyboard.mate-settings-plugin.desktop.in \
$(NULL)
diff --git a/plugins/a11y-keyboard/msd-a11y-keyboard-atspi.c b/plugins/a11y-keyboard/msd-a11y-keyboard-atspi.c
index d4c3ec4..0873f0a 100644
--- a/plugins/a11y-keyboard/msd-a11y-keyboard-atspi.c
+++ b/plugins/a11y-keyboard/msd-a11y-keyboard-atspi.c
@@ -22,8 +22,6 @@
#include "msd-a11y-keyboard-atspi.h"
#include <glib-object.h>
-
-#ifdef HAVE_LIBATSPI
#include <gdk/gdk.h>
#include <atspi/atspi.h>
@@ -152,37 +150,6 @@ msd_a11y_keyboard_atspi_stop (MsdA11yKeyboardAtspi *self)
self->listening = FALSE;
}
-#else /* ! defined(HAVE_LIBATSPI): AT-SPI is not available, provide stubs */
-
-struct _MsdA11yKeyboardAtspi
-{
- GObject parent;
-};
-
-G_DEFINE_TYPE (MsdA11yKeyboardAtspi, msd_a11y_keyboard_atspi, G_TYPE_OBJECT)
-
-static void
-msd_a11y_keyboard_atspi_class_init (MsdA11yKeyboardAtspiClass *klass G_GNUC_UNUSED)
-{
-}
-
-static void
-msd_a11y_keyboard_atspi_init (MsdA11yKeyboardAtspi *self G_GNUC_UNUSED)
-{
-}
-
-void
-msd_a11y_keyboard_atspi_start (MsdA11yKeyboardAtspi *self G_GNUC_UNUSED)
-{
-}
-
-void
-msd_a11y_keyboard_atspi_stop (MsdA11yKeyboardAtspi *self G_GNUC_UNUSED)
-{
-}
-
-#endif /* ! defined(HAVE_LIBATSPI) */
-
MsdA11yKeyboardAtspi *
msd_a11y_keyboard_atspi_new ()
{
diff --git a/plugins/a11y-keyboard/msd-a11y-keyboard-manager.c b/plugins/a11y-keyboard/msd-a11y-keyboard-manager.c
index 67a690b..40fbdca 100644
--- a/plugins/a11y-keyboard/msd-a11y-keyboard-manager.c
+++ b/plugins/a11y-keyboard/msd-a11y-keyboard-manager.c
@@ -49,11 +49,15 @@
#include "mate-settings-profile.h"
#include "msd-a11y-keyboard-manager.h"
-#include "msd-a11y-keyboard-atspi.h"
+#ifdef HAVE_LIBATSPI
+# include "msd-a11y-keyboard-atspi.h"
+#endif
#include "msd-a11y-preferences-dialog.h"
#define CONFIG_SCHEMA "org.mate.accessibility-keyboard"
-#define KEY_CAPSLOCK_BEEP_ENABLED "capslock-beep-enable"
+#ifdef HAVE_LIBATSPI
+# define KEY_CAPSLOCK_BEEP_ENABLED "capslock-beep-enable"
+#endif
#define NOTIFICATION_TIMEOUT 30
struct MsdA11yKeyboardManagerPrivate
@@ -66,7 +70,9 @@ struct MsdA11yKeyboardManagerPrivate
GtkWidget *preferences_dialog;
GtkStatusIcon *status_icon;
XkbDescRec *original_xkb_desc;
+#ifdef HAVE_LIBATSPI
MsdA11yKeyboardAtspi *capslock_beep;
+#endif
GSettings *settings;
@@ -987,6 +993,7 @@ keyboard_callback (GSettings *settings,
maybe_show_status_icon (manager);
}
+#ifdef HAVE_LIBATSPI
static void
capslock_beep_callback (GSettings *settings,
gchar *key G_GNUC_UNUSED,
@@ -997,6 +1004,7 @@ capslock_beep_callback (GSettings *settings,
else
msd_a11y_keyboard_atspi_stop (manager->priv->capslock_beep);
}
+#endif
static gboolean
start_a11y_keyboard_idle_cb (MsdA11yKeyboardManager *manager)
@@ -1008,11 +1016,13 @@ start_a11y_keyboard_idle_cb (MsdA11yKeyboardManager *manager)
manager->priv->settings = g_settings_new (CONFIG_SCHEMA);
+#ifdef HAVE_LIBATSPI
manager->priv->capslock_beep = msd_a11y_keyboard_atspi_new ();
if (g_settings_get_boolean (manager->priv->settings, KEY_CAPSLOCK_BEEP_ENABLED))
msd_a11y_keyboard_atspi_start (manager->priv->capslock_beep);
g_signal_connect (manager->priv->settings, "changed::"KEY_CAPSLOCK_BEEP_ENABLED,
G_CALLBACK (capslock_beep_callback), manager);
+#endif
if (!xkb_enabled (manager))
goto out;
@@ -1126,7 +1136,9 @@ msd_a11y_keyboard_manager_stop (MsdA11yKeyboardManager *manager)
p->slowkeys_shortcut_val = FALSE;
p->stickykeys_shortcut_val = FALSE;
+#ifdef HAVE_LIBATSPI
g_clear_object (&p->capslock_beep);
+#endif
}
static void