## atspi-devicelistener atspi-devicelistener — An interface for creating and manipulating device listeners. |

## Functions

gboolean | (*AtspiDeviceListenerCB) ()
gboolean | (*AtspiDeviceListenerSimpleCB) ()
AtspiDeviceListener * | atspi_device_listener_new ()
AtspiDeviceListener * | atspi_device_listener_new_simple ()
void | atspi_device_listener_add_callback ()
void | atspi_device_listener_remove_callback ()

## Types and Values

struct | AtspiDeviceListener
struct | AtspiDeviceListenerClass

## Object Hierarchy

        GObject
        ╰── AtspiDeviceListener

## Description

An interface for creating and manipulating device listeners with callback functions.

## Functions

### AtspiDeviceListenerCB ()

    gboolean
    (*AtspiDeviceListenerCB) (const AtspiDeviceEvent *stroke,
                              void *user_data);

A callback function prototype via which clients receive device event notifications.

#### Parameters

stroke | The AtspiDeviceEvent for which notification is being received. | [transfer full]
user_data | Data which is passed to the client each time this callback is notified. |

#### 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.

### AtspiDeviceListenerSimpleCB ()

    gboolean
    (*AtspiDeviceListenerSimpleCB) (const AtspiDeviceEvent *stroke);

Similar to AtspiDeviceListenerCB, but with no user data.

#### Parameters

stroke | The AtspiDeviceEvent for which notification is being received. | [transfer full]

#### 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.

### atspi_device_listener_new ()

    AtspiDeviceListener *
    atspi_device_listener_new (AtspiDeviceListenerCB callback,
                               void *user_data,
                               GDestroyNotify callback_destroyed);

Creates a new AtspiDeviceListener with a specified callback function.

#### Parameters

callback | an AtspiDeviceListenerCB callback function, or NULL. | [scope notified]
user_data | a pointer to data which will be passed to the callback when invoked. | [closure]
callback_destroyed | A GDestroyNotify called when the listener is freed and data associated with the callback should be freed. It can be NULL. |

#### Returns

a pointer to a newly-created AtspiDeviceListener.

[transfer full]

### atspi_device_listener_new_simple ()

    AtspiDeviceListener *
    atspi_device_listener_new_simple (AtspiDeviceListenerSimpleCB callback,
                                      GDestroyNotify callback_destroyed);

Creates a new AtspiDeviceListener with a specified callback function. This method is similar to atspi_device_listener_new, but callback takes no user data.

[skip]

#### Parameters

callback | an AtspiDeviceListenerCB callback function, or NULL. | [scope notified]
callback_destroyed | A GDestroyNotify called when the listener is freed and data associated with the callback should be freed. It an be NULL. |

#### Returns

a pointer to a newly-created AtspiDeviceListener.

### atspi_device_listener_add_callback ()

    void
    atspi_device_listener_add_callback (AtspiDeviceListener *listener,
                                        AtspiDeviceListenerCB callback,
                                        GDestroyNotify callback_destroyed,
                                        void *user_data);

Adds an in-process callback function to an existing AtspiDeviceListener.

#### Parameters

listener | the AtspiDeviceListener instance to modify. |
callback | an AtspiDeviceListenerCB function pointer. | [scope notified]
callback_destroyed | A GDestroyNotify called when the listener is freed and data associated with the callback should be freed. It can be NULL. |
user_data | a pointer to data which will be passed to the callback when invoked. | [closure]

### atspi_device_listener_remove_callback ()

    void
    atspi_device_listener_remove_callback (AtspiDeviceListener *listener,
                                           AtspiDeviceListenerCB callback);

Removes an in-process callback function from an existing AtspiDeviceListener.

#### Parameters

listener | the AtspiDeviceListener instance to modify. |
callback | an AtspiDeviceListenerCB function pointer. | [scope call]

## Types and Values

### struct AtspiDeviceListener

    struct AtspiDeviceListener;

### struct AtspiDeviceListenerClass

    struct AtspiDeviceListenerClass {
      GObjectClass parent_class;
      gboolean (*device_event) (AtspiDeviceListener *listener, const AtspiDeviceEvent *event);
    };