properties_interface = NULL;
}
-/**
- * Add a dbus object.
- *
- * @param conn the connection on with the object should listen
- * @param object_path a unique string identifying an object (e.g. org/enlightenment/WindowManager
- * @param data custom data to set on the object (retrievable via
- * e_dbus_object_data_get())
- */
EAPI E_DBus_Object *
e_dbus_object_add(E_DBus_Connection *conn, const char *object_path, void *data)
{
E_DBus_Object *obj;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(conn, NULL);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(object_path, NULL);
+
obj = calloc(1, sizeof(E_DBus_Object));
if (!obj) return NULL;
return obj;
}
-/**
- * Free a dbus object
- *
- * @param obj the object to free
- */
EAPI void
e_dbus_object_free(E_DBus_Object *obj)
{
free(obj);
}
-/**
- * @brief Fetch the data pointer for a dbus object
- * @param obj the dbus object
- */
EAPI void *
e_dbus_object_data_get(E_DBus_Object *obj)
{
return obj->data;
}
-/**
- * @brief Get the dbus connection of a dbus object
- * @param obj the dbus object
- */
EAPI E_DBus_Connection *
e_dbus_object_conn_get(E_DBus_Object *obj)
{
return obj->conn;
}
-/**
- * @brief Get the path of a dbus object
- * @param obj the dbus object
- */
EAPI const char *
e_dbus_object_path_get(E_DBus_Object *obj)
{
return obj->path;
}
-/**
- * @brief Get the interfaces of a dbus object
- * @param obj the dbus object
- */
EAPI const Eina_List *
e_dbus_object_interfaces_get(E_DBus_Object *obj)
{
return obj->interfaces;
}
-/**
- * @brief Sets the callback to fetch properties from an object
- * @param obj the object
- * @param func the callback
- */
EAPI void
e_dbus_object_property_get_cb_set(E_DBus_Object *obj, E_DBus_Object_Property_Get_Cb func)
{
obj->cb_property_get = func;
}
-/**
- * @brief Sets the callback to set properties on an object
- * @param obj the object
- * @param func the callback
- */
EAPI void
e_dbus_object_property_set_cb_set(E_DBus_Object *obj, E_DBus_Object_Property_Set_Cb func)
{
EAPI void
e_dbus_object_interface_attach(E_DBus_Object *obj, E_DBus_Interface *iface)
{
+ EINA_SAFETY_ON_NULL_RETURN(obj);
+ EINA_SAFETY_ON_NULL_RETURN(iface);
+
e_dbus_interface_ref(iface);
obj->interfaces = eina_list_append(obj->interfaces, iface);
obj->introspection_dirty = 1;
DBG("e_dbus_object_interface_detach (%s, %s) ", obj->path, iface->name);
found = eina_list_data_find(obj->interfaces, iface);
- if (found == NULL) return;
+ if (!found) return;
obj->interfaces = eina_list_remove(obj->interfaces, iface);
obj->introspection_dirty = 1;
}
-/**
- * Add a method to an object
- *
- * @param iface the E_DBus_Interface to which this method belongs
- * @param member the name of the method
- * @param signature an optional message signature. if provided, then messages
- * with invalid signatures will be automatically rejected
- * (an Error response will be sent) and introspection data
- * will be available.
- *
- * @return 1 if successful, 0 if failed (e.g. no memory)
- */
EAPI int
e_dbus_interface_method_add(E_DBus_Interface *iface, const char *member, const char *signature, const char *reply_signature, E_DBus_Method_Cb func)
{
return 1;
}
-/**
- * Add a signal to an object
- *
- * @param iface the E_DBus_Interface to which this signal belongs
- * @param name the name of the signal
- * @param signature an optional message signature.
- *
- * @return 1 if successful, 0 if failed (e.g. no memory)
- */
EAPI int
e_dbus_interface_signal_add(E_DBus_Interface *iface, const char *name, const char *signature)
{
eina_strbuf_append(buf, "\"/>\n");
}
+
+
+DBusConnection *e_dbus_conn_object_get(E_DBus_Connection *conn)
+{
+ if (conn!=NULL)
+ return conn->conn;
+}