Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:28:16

0001 /*
0002  * AT-SPI - Assistive Technology Service Provider Interface
0003  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
0004  *
0005  * Copyright 2002 Ximian, Inc.
0006  *           2002 Sun Microsystems Inc.
0007  * Copyright 2010, 2011 Novell, Inc.
0008  *
0009  *
0010  * This library is free software; you can redistribute it and/or
0011  * modify it under the terms of the GNU Lesser General Public
0012  * License as published by the Free Software Foundation; either
0013  * version 2.1 of the License, or (at your option) any later version.
0014  *
0015  * This library is distributed in the hope that it will be useful,
0016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0018  * Lesser General Public License for more details.
0019  *
0020  * You should have received a copy of the GNU Lesser General Public
0021  * License along with this library; if not, write to the
0022  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0023  * Boston, MA 02110-1301, USA.
0024  */
0025 
0026 #ifndef _ATSPI_DEVICE_LISTENER_H_
0027 #define _ATSPI_DEVICE_LISTENER_H_
0028 
0029 #include "glib-object.h"
0030 
0031 #include "atspi-types.h"
0032 
0033 G_BEGIN_DECLS
0034 
0035 GType atspi_device_event_get_type (void);
0036 
0037 /**
0038  * AtspiDeviceListenerCB:
0039  * @stroke: (transfer full): The #AtspiDeviceEvent for which notification is
0040  *          being received.
0041  * @user_data: Data which is passed to the client each time this callback is notified.
0042  *
0043  * A callback function prototype via which clients receive device event notifications.
0044  *
0045  * Returns: #TRUE if the client wishes to consume/preempt the event, preventing it from being
0046  * relayed to the currently focussed application, #FALSE if the event delivery should proceed as normal.
0047  **/
0048 typedef gboolean (*AtspiDeviceListenerCB) (AtspiDeviceEvent *stroke,
0049                                            void *user_data);
0050 
0051 /**
0052  * AtspiDeviceListenerSimpleCB:
0053  * @stroke: (transfer full): The #AtspiDeviceEvent for which notification is
0054  *          being received.
0055  *
0056  * Similar to #AtspiDeviceListenerCB, but with no user data.
0057  *
0058  * Returns: #TRUE if the client wishes to consume/preempt the event, preventing it from being
0059  * relayed to the currently focussed application, #FALSE if the event delivery should proceed as normal.
0060  **/
0061 typedef gboolean (*AtspiDeviceListenerSimpleCB) (const AtspiDeviceEvent *stroke);
0062 
0063 #define ATSPI_TYPE_DEVICE_LISTENER (atspi_device_listener_get_type ())
0064 #define ATSPI_DEVICE_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATSPI_TYPE_DEVICE_LISTENER, AtspiDeviceListener))
0065 #define ATSPI_DEVICE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ATSPI_TYPE_DEVICE_LISTENER, AtspiDeviceListenerClass))
0066 #define ATSPI_IS_DEVICE_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATSPI_TYPE_DEVICE_LISTENER))
0067 #define ATSPI_IS_DEVICE_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ATSPI_TYPE_DEVICE_LISTENER))
0068 #define ATSPI_DEVICE_LISTENER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ATSPI_TYPE_DEVICE_LISTENER, AtspiDeviceListenerClass))
0069 
0070 typedef struct _AtspiDeviceListener AtspiDeviceListener;
0071 struct _AtspiDeviceListener
0072 {
0073   GObject parent;
0074   guint id;
0075   GList *callbacks;
0076 };
0077 
0078 typedef struct _AtspiDeviceListenerClass AtspiDeviceListenerClass;
0079 struct _AtspiDeviceListenerClass
0080 {
0081   GObjectClass parent_class;
0082   gboolean (*device_event) (AtspiDeviceListener *listener, const AtspiDeviceEvent *event);
0083 };
0084 
0085 GType atspi_device_listener_get_type (void);
0086 
0087 AtspiDeviceListener *atspi_device_listener_new (AtspiDeviceListenerCB callback, void *user_data, GDestroyNotify callback_destroyed);
0088 
0089 AtspiDeviceListener *atspi_device_listener_new_simple (AtspiDeviceListenerSimpleCB callback, GDestroyNotify callback_destroyed);
0090 
0091 void atspi_device_listener_add_callback (AtspiDeviceListener *listener, AtspiDeviceListenerCB callback, GDestroyNotify callback_destroyed, void *user_data);
0092 
0093 void atspi_device_listener_remove_callback (AtspiDeviceListener *listener, AtspiDeviceListenerCB callback);
0094 
0095 G_END_DECLS
0096 
0097 #endif /* _ATSPI_DEVICE_LISTENER_H_ */