summaryrefslogtreecommitdiff
path: root/atspi/atspi-device-listener.h
diff options
context:
space:
mode:
authorMike Gorse <mgorse@novell.com>2010-11-05 18:10:56 -0400
committerMike Gorse <mgorse@novell.com>2010-11-05 18:10:56 -0400
commit1299779d8ded027a7e277d5e64b76f88c4ba4da7 (patch)
tree08c7272dc5b7b0b8c2cff6cbac55bf65358122d5 /atspi/atspi-device-listener.h
parent46931677d227523bbaf5405e2b715bbf1f6cd776 (diff)
downloadat-spi2-core-1299779d8ded027a7e277d5e64b76f88c4ba4da7.tar.gz
Some work on event support; many bug fixes
Diffstat (limited to 'atspi/atspi-device-listener.h')
-rw-r--r--atspi/atspi-device-listener.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/atspi/atspi-device-listener.h b/atspi/atspi-device-listener.h
new file mode 100644
index 00000000..113ca006
--- /dev/null
+++ b/atspi/atspi-device-listener.h
@@ -0,0 +1,74 @@
+/*
+ * AT-SPI - Assistive Technology Service Provider Interface
+ * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
+ *
+ * Copyright 2002 Ximian, Inc.
+ * 2002 Sun Microsystems Inc.
+ *
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef _ATSPI_DEVICE_LISTENER_H_
+#define _ATSPI_DEVICE_LISTENER_H_
+
+#include "glib-object.h"
+
+#include "atspi-event-types.h"
+
+/**
+ * AtspiDeviceListenerCB:
+ * @stroke: The #AtspiDeviceEvent for which notification is being received.
+ * @user_data: Data which is passed to the client each time this callback is notified.
+ *
+ * A callback function prototype via which clients receive device event notifications.
+ *
+ * Returns: %TRUE if the client wishes to consume/preempt the event, preventing it from being
+ * relayed to the currently focussed application, %FALSE if the event delivery should proceed as normal.
+ **/
+typedef gboolean (*AtspiDeviceListenerCB) (const AtspiDeviceEvent *stroke,
+ void *user_data);
+
+#define ATSPI_TYPE_DEVICE_LISTENER (atspi_device_listener_get_type ())
+#define ATSPI_DEVICE_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_TYPE_DEVICE_LISTENER, AtspiDeviceListener))
+#define ATSPI_DEVICE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATSPI_TYPE_DEVICE_LISTENER, AtspiDeviceListenerClass))
+#define ATSPI_IS_DEVICE_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_TYPE_DEVICE_LISTENER))
+#define ATSPI_IS_DEVICE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATSPI_TYPE_DEVICE_LISTENER))
+#define ATSPI_DEVICE_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATSPI_TYPE_DEVICE_LISTENER, AtspiDeviceListenerClass))
+
+typedef struct _AtspiDeviceListener AtspiDeviceListener;
+struct _AtspiDeviceListener
+{
+ GObject parent;
+ guint id;
+ GList *callbacks;
+};
+
+typedef struct _AtspiDeviceListenerClass AtspiDeviceListenerClass;
+struct _AtspiDeviceListenerClass
+{
+ GObjectClass parent_class;
+ gboolean (*device_event) (AtspiDeviceListener *, const AtspiDeviceEvent *);
+};
+
+GType atspi_device_listener_get_type (void);
+
+AtspiDeviceListener *atspi_device_listener_new (AtspiDeviceListenerCB callback);
+
+void atspi_device_listener_add_callback (AtspiDeviceListener *listener, AtspiDeviceListenerCB callback, void *user_data);
+
+void atspi_device_listener_remove_callback (AtspiDeviceListener *listener, AtspiDeviceListenerCB callback);
+#endif /* _ATSPI_DEVICE_LISTENER_H_ */