/**
* atspi_device_listener_new:
- * @callback: (scope notify): an #AtspiDeviceListenerCB callback function,
+ * @callback: (scope notified): an #AtspiDeviceListenerCB callback function,
* or NULL.
- * @callback_destroyed: A #GDestroyNotify called when the listener is freed
- * and data associated with the callback should be freed. Can be NULL.
* @user_data: (closure): a pointer to data which will be passed to the
* callback when invoked.
+ * @callback_destroyed: A #GDestroyNotify called when the listener is freed
+ * and data associated with the callback should be freed. Can be NULL.
*
* Create a new #AtspiDeviceListener with a specified callback function.
*
- * Returns: a pointer to a newly-created #AtspiDeviceListener.
+ * Returns: (transfer full): a pointer to a newly-created #AtspiDeviceListener.
*
**/
AtspiDeviceListener *
atspi_device_listener_new (AtspiDeviceListenerCB callback,
- GDestroyNotify callback_destroyed,
- void *user_data)
+ void *user_data,
+ GDestroyNotify callback_destroyed)
{
AtspiDeviceListener *listener = g_object_new (atspi_device_listener_get_type (), NULL);
}
/**
- * atspi_device_listener_new_simple:
- * @callback: (scope notify): an #AtspiDeviceListenerCB callback function,
+ * atspi_device_listener_new_simple: (skip):
+ * @callback: (scope notified): an #AtspiDeviceListenerCB callback function,
* or NULL.
* @callback_destroyed: A #GDestroyNotify called when the listener is freed
* and data associated with the callback should be freed. Can be NULL.
/**
* atspi_device_listener_add_callback:
* @listener: the #AtspiDeviceListener instance to modify.
- * @callback: (scope notify): an #AtspiDeviceListenerCB function pointer.
+ * @callback: (scope notified): an #AtspiDeviceListenerCB function pointer.
* @user_data: (closure): a pointer to data which will be passed to the
* callback when invoked.
* @callback_destroyed: A #GDestroyNotify called when the listener is freed
GType atspi_device_listener_get_type (void);
-AtspiDeviceListener *atspi_device_listener_new (AtspiDeviceListenerCB callback, GDestroyNotify callback_destroyed, void *user_data);
+AtspiDeviceListener *atspi_device_listener_new (AtspiDeviceListenerCB callback, void *user_data, GDestroyNotify callback_destroyed);
AtspiDeviceListener *atspi_device_listener_new_simple (AtspiDeviceListenerSimpleCB callback, GDestroyNotify callback_destroyed);
}
/**
- * atspi_event_listener_new_simple:
+ * atspi_event_listener_new:
+ * @callback: (scope notified): An #AtspiEventListenerSimpleCB to be called
+ * when an event is fired.
+ * @user_data: (closure): data to pass to the callback.
+ * @callback_destroyed: A #GDestroyNotify called when the listener is freed
+ * and data associated with the callback should be freed. Can be NULL.
+ *
+ * Returns: (transfer full): A new #AtspiEventListener.
+ */
+AtspiEventListener *
+atspi_event_listener_new (AtspiEventListenerCB callback,
+ gpointer user_data,
+ GDestroyNotify callback_destroyed)
+{
+ AtspiEventListener *listener = g_object_new (ATSPI_TYPE_EVENT_LISTENER, NULL);
+ listener->callback = callback;
+ callback_ref (callback, callback_destroyed);
+ listener->user_data = user_data;
+ listener->cb_destroyed = callback_destroyed;
+ return listener;
+}
+
+/**
+ * atspi_event_listener_new_simple: (skip)
* @callback: (scope notified): An #AtspiEventListenerSimpleCB to be called
* when an event is fired.
* @callback_destroyed: A #GDestroyNotify called when the listener is freed
}
/**
- * atspi_event_listener_register_no_data:
+ * atspi_event_listener_register_no_data: (skip)
* @callback: (scope notified): the #AtspiEventListenerSimpleCB to be
* registered against an event type.
* @callback_destroyed: A #GDestroyNotify called when the callback is destroyed.
GType atspi_event_listener_get_type (void);
AtspiEventListener *
+atspi_event_listener_new (AtspiEventListenerCB callback,
+ gpointer user_data,
+ GDestroyNotify callback_destroyed);
+
+AtspiEventListener *
atspi_event_listener_new_simple (AtspiEventListenerSimpleCB callback,
GDestroyNotify callback_destroyed);