Removing eldbus stuff, we'll be using python-dbus integration for now.
This commit is contained in:
parent
c3a7334bcc
commit
50af0b86a5
|
@ -1,156 +0,0 @@
|
|||
ELDBUS_CONNECTION_TYPE_SESSION = enums.EDBUS_CONNECTION_TYPE_SESSION
|
||||
ELDBUS_CONNECTION_TYPE_SYSTEM = enums.EDBUS_CONNECTION_TYPE_SYSTEM
|
||||
ELDBUS_CONNECTION_TYPE_STARTER = enums.EDBUS_CONNECTION_TYPE_STARTER
|
||||
|
||||
ELDBUS_CONNECTION_EVENT_DEL = enums.EDBUS_CONNECTION_EVENT_DEL
|
||||
ELDBUS_CONNECTION_EVENT_DISCONNECTED = enums.EDBUS_CONNECTION_EVENT_DISCONNECTED
|
||||
|
||||
cdef void eldbus_connection_event_cb(void *data, Eldbus_Connection *conn, void *event_info):
|
||||
pass
|
||||
|
||||
cdef void eldbus_connection_free_cb(void *data, const_void *deadptr):
|
||||
pass
|
||||
|
||||
cdef class Connection(object):
|
||||
"""A connection object"""
|
||||
|
||||
cdef Eldbus_Connection *conn
|
||||
|
||||
def __init__(self, Eldbus_Connection_Type conn_type, private=False):
|
||||
if not private:
|
||||
"""
|
||||
|
||||
Establish a connection to bus and integrate it with the ecore main
|
||||
loop. If a connection of given type was already created before, its
|
||||
reference counter is incremented and the connection is returned.
|
||||
|
||||
:param type: type of connection e.g ELDBUS_CONNECTION_TYPE_SESSION,
|
||||
ELDBUS_CONNECTION_TYPE_SYSTEM or EDBUS_CONNECTION_TYPE_STARTER
|
||||
|
||||
:return: connection with bus
|
||||
|
||||
"""
|
||||
self.conn = eldbus_connection_get(conn_type)
|
||||
else:
|
||||
"""
|
||||
|
||||
Always create and establish a new connection to bus and integrate it with
|
||||
the ecore main loop. Differently from eldbus_connection_get(), this function
|
||||
guarantees to create a new connection to the D-Bus daemon and the connection
|
||||
is not shared by any means.
|
||||
|
||||
:param type: type of connection e.g ELDBUS_CONNECTION_TYPE_SESSION,
|
||||
ELDBUS_CONNECTION_TYPE_SYSTEM or EDBUS_CONNECTION_TYPE_STARTER
|
||||
|
||||
:return: connection with bus
|
||||
|
||||
"""
|
||||
self.conn = eldbus_private_connection_get(conn_type)
|
||||
|
||||
def ref(self):
|
||||
"""
|
||||
|
||||
Increment connection reference count.
|
||||
|
||||
|
||||
"""
|
||||
# NOTE: returns Eldbus_Connection *
|
||||
eldbus_connection_ref(self.conn)
|
||||
return self
|
||||
|
||||
def unref(self):
|
||||
"""
|
||||
|
||||
Decrement connection reference count.
|
||||
|
||||
If reference count reaches 0, the connection to bus will be dropped and all
|
||||
its children will be invalidated.
|
||||
|
||||
"""
|
||||
eldbus_connection_unref(self.conn)
|
||||
|
||||
def free_cb_add(self):
|
||||
"""
|
||||
|
||||
Add a callback function to be called when connection is freed
|
||||
|
||||
:param cb: callback to be called
|
||||
:param data: data passed to callback
|
||||
|
||||
"""
|
||||
eldbus_connection_free_cb_add(self.conn, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def free_cb_del(self):
|
||||
"""
|
||||
|
||||
Remove callback registered in eldbus_connection_free_cb_add().
|
||||
|
||||
"""
|
||||
eldbus_connection_free_cb_del(self.conn, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def data_set(self, key, data):
|
||||
"""
|
||||
|
||||
Set an attached data pointer to an object with a given string key.
|
||||
|
||||
:param key: to identify data
|
||||
:param data: data that will be stored
|
||||
|
||||
"""
|
||||
eldbus_connection_data_set(self.conn, const_char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3)
|
||||
|
||||
def data_get(self, key):
|
||||
"""
|
||||
|
||||
Get data stored in connection.
|
||||
|
||||
:param key: key that identifies data
|
||||
|
||||
:return: pointer to data if found otherwise NULL
|
||||
|
||||
"""
|
||||
void *eldbus_connection_data_get(self.conn, const_char *key) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def data_del(self, key):
|
||||
"""
|
||||
|
||||
Del data stored in connection.
|
||||
|
||||
:param key: that identifies data
|
||||
|
||||
:return: pointer to data if found otherwise NULL
|
||||
|
||||
"""
|
||||
void *eldbus_connection_data_del(self.conn, const_char *key) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def event_callback_add(self, event_type, cb, cb_data):
|
||||
"""
|
||||
|
||||
Add a callback function to be called when an event occurs of the
|
||||
type passed.
|
||||
|
||||
"""
|
||||
eldbus_connection_event_callback_add(self.conn, Eldbus_Connection_Event_Type type, Eldbus_Connection_Event_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1, 3)
|
||||
|
||||
def event_callback_del(self, event_type, cb, cb_data):
|
||||
"""
|
||||
|
||||
Remove callback registered in eldbus_connection_event_callback_add().
|
||||
|
||||
"""
|
||||
eldbus_connection_event_callback_del(self.conn, Eldbus_Connection_Event_Type type, Eldbus_Connection_Event_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1, 3)
|
||||
|
||||
def send(self, msg, cb, cb_data, timeout):
|
||||
"""
|
||||
|
||||
Send a message.
|
||||
|
||||
:param msg: message that will be sent
|
||||
:param cb: if msg is a method call a callback should be passed
|
||||
to be executed when a response arrives
|
||||
:param cb_data: data passed to callback
|
||||
:param timeout: timeout in milliseconds, -1 to use default internal value or
|
||||
ELDBUS_TIMEOUT_INFINITE for no timeout
|
||||
|
||||
"""
|
||||
Eldbus_Pending *eldbus_connection_send(self.conn, Eldbus_Message *msg, EDBus_Message_Cb cb, const_void *cb_data, double timeout) EINA_ARG_NONNULL(1, 2)
|
|
@ -1,322 +0,0 @@
|
|||
from libc.string cimport const_char
|
||||
|
||||
from enums cimport Eldbus_Connection_Type, Eldbus_Connection_Event_Type, \
|
||||
Eldbus_Object_Event_Type, Eldbus_Proxy_Event_Type
|
||||
|
||||
cdef extern from "Eldbus.h":
|
||||
#define ELDBUS_FDO_BUS "org.freedesktop.DBus"
|
||||
#define ELDBUS_FDO_PATH "/org/freedesktop/DBus"
|
||||
#define ELDBUS_FDO_INTERFACE EDBUS_FDO_BUS
|
||||
#define ELDBUS_FDO_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
|
||||
#define ELDBUS_FDO_INTERFACE_OBJECT_MANAGER "org.freedesktop.DBus.ObjectManager"
|
||||
#define ELDBUS_FDO_INTERFACE_INTROSPECTABLE "org.freedesktop.DBus.Introspectable"
|
||||
#define ELDBUS_FDO_INTEFACE_PEER "org.freedesktop.DBus.Peer"
|
||||
#define ELDBUS_ERROR_PENDING_CANCELED "org.enlightenment.DBus.Canceled"
|
||||
|
||||
int eldbus_init()
|
||||
int eldbus_shutdown()
|
||||
|
||||
ctypedef void (*Eldbus_Free_Cb)(void *data, const_void *deadptr)
|
||||
|
||||
ctypedef _Eldbus_Connection Eldbus_Connection
|
||||
ctypedef _Eldbus_Object Eldbus_Object
|
||||
ctypedef _Eldbus_Proxy Eldbus_Proxy
|
||||
ctypedef _Eldbus_Message Eldbus_Message
|
||||
ctypedef _Eldbus_Message_Iter Eldbus_Message_Iter
|
||||
ctypedef _Eldbus_Pending Eldbus_Pending
|
||||
ctypedef _Eldbus_Signal_Handler Eldbus_Signal_Handler
|
||||
|
||||
ctypedef void (*Eldbus_Message_Cb)(void *data, const_Eldbus_Message *msg, EDBus_Pending *pending)
|
||||
ctypedef void (*Eldbus_Signal_Cb)(void *data, const_Eldbus_Message *msg)
|
||||
|
||||
# eldbus_connection.h
|
||||
|
||||
#define ELDBUS_TIMEOUT_INFINITE ((int) 0x7fffffff)
|
||||
Eldbus_Connection *eldbus_connection_get(Eldbus_Connection_Type type)
|
||||
Eldbus_Connection *eldbus_private_connection_get(Eldbus_Connection_Type type)
|
||||
Eldbus_Connection *eldbus_connection_ref(Eldbus_Connection *conn) EINA_ARG_NONNULL(1)
|
||||
void eldbus_connection_unref(Eldbus_Connection *conn) EINA_ARG_NONNULL(1)
|
||||
void eldbus_connection_free_cb_add(Eldbus_Connection *conn, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
void eldbus_connection_free_cb_del(Eldbus_Connection *conn, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
void eldbus_connection_data_set(Eldbus_Connection *conn, const_char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3)
|
||||
void *eldbus_connection_data_get(const_Eldbus_Connection *conn, const char *key) EINA_ARG_NONNULL(1, 2)
|
||||
void *eldbus_connection_data_del(Eldbus_Connection *conn, const_char *key) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
ctypedef void (*Eldbus_Connection_Event_Cb)(void *data, Eldbus_Connection *conn, void *event_info)
|
||||
|
||||
void eldbus_connection_event_callback_add(Eldbus_Connection *conn, Eldbus_Connection_Event_Type type, EDBus_Connection_Event_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1, 3)
|
||||
void eldbus_connection_event_callback_del(Eldbus_Connection *conn, Eldbus_Connection_Event_Type type, EDBus_Connection_Event_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1, 3)
|
||||
Eldbus_Pending *eldbus_connection_send(Eldbus_Connection *conn, EDBus_Message *msg, EDBus_Message_Cb cb, const_void *cb_data, double timeout) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
# eldbus_message.h
|
||||
|
||||
Eldbus_Message *eldbus_message_ref(Eldbus_Message *msg) EINA_ARG_NONNULL(1)
|
||||
|
||||
void eldbus_message_unref(Eldbus_Message *msg) EINA_ARG_NONNULL(1)
|
||||
const_char *eldbus_message_path_get(const Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_message_interface_get(const Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_message_member_get(const Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_message_destination_get(const Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_message_sender_get(const Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_message_signature_get(const Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
Eldbus_Message *eldbus_message_method_call_new(const_char *dest, const char *path, const char *iface, const char *method) EINA_ARG_NONNULL(1, 2, 3, 4) EINA_WARN_UNUSED_RESULT EINA_MALLOC
|
||||
Eldbus_Message *eldbus_message_error_new(const_Eldbus_Message *msg, const char *error_name, const char *error_msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
Eldbus_Message *eldbus_message_method_return_new(const_Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
Eina_Bool eldbus_message_error_get(const_Eldbus_Message *msg, const char **name, const char **text) EINA_ARG_NONNULL(1)
|
||||
Eina_Bool eldbus_message_arguments_get(const_Eldbus_Message *msg, const char *signature, ...) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT
|
||||
Eina_Bool eldbus_message_arguments_vget(const_Eldbus_Message *msg, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT
|
||||
Eina_Bool eldbus_message_arguments_append(Eldbus_Message *msg, const_char *signature, ...) EINA_ARG_NONNULL(1, 2)
|
||||
Eina_Bool eldbus_message_arguments_vappend(Eldbus_Message *msg, const_char *signature, va_list ap) EINA_ARG_NONNULL(1, 2)
|
||||
Eldbus_Message_Iter *eldbus_message_iter_container_new(Eldbus_Message_Iter *iter, int type, const_char* contained_signature) EINA_ARG_NONNULL(1, 3) EINA_WARN_UNUSED_RESULT
|
||||
Eina_Bool eldbus_message_iter_basic_append(Eldbus_Message_Iter *iter, int type, ...) EINA_ARG_NONNULL(1, 3)
|
||||
Eina_Bool eldbus_message_iter_arguments_append(Eldbus_Message_Iter *iter, const_char *signature, ...) EINA_ARG_NONNULL(1, 2)
|
||||
Eina_Bool eldbus_message_iter_arguments_vappend(Eldbus_Message_Iter *iter, const_char *signature, va_list ap) EINA_ARG_NONNULL(1, 2, 3)
|
||||
Eina_Bool eldbus_message_iter_container_close(Eldbus_Message_Iter *iter, Eldbus_Message_Iter *sub) EINA_ARG_NONNULL(1, 2)
|
||||
Eldbus_Message_Iter *eldbus_message_iter_get(const_Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
void eldbus_message_iter_basic_get(Eldbus_Message_Iter *iter, void *value) EINA_ARG_NONNULL(1, 2)
|
||||
char *eldbus_message_iter_signature_get(Eldbus_Message_Iter *iter) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
Eina_Bool eldbus_message_iter_next(Eldbus_Message_Iter *iter) EINA_ARG_NONNULL(1)
|
||||
Eina_Bool eldbus_message_iter_get_and_next(Eldbus_Message_Iter *iter, char type, ...) EINA_ARG_NONNULL(1, 2, 3)
|
||||
Eina_Bool eldbus_message_iter_fixed_array_get(Eldbus_Message_Iter *iter, int signature, void *value, int *n_elements) EINA_ARG_NONNULL(1, 3, 4)
|
||||
Eina_Bool eldbus_message_iter_arguments_get(Eldbus_Message_Iter *iter, const_char *signature, ...) EINA_ARG_NONNULL(1, 2)
|
||||
Eina_Bool eldbus_message_iter_arguments_vget(Eldbus_Message_Iter *iter, const_char *signature, va_list ap) EINA_ARG_NONNULL(1, 2)
|
||||
void eldbus_message_iter_del(Eldbus_Message_Iter *iter) EINA_ARG_NONNULL(1)
|
||||
|
||||
# eldbus_message_helper.h
|
||||
|
||||
ctypedef void (*Eldbus_Dict_Cb_Get)(void *data, const_void *key, Eldbus_Message_Iter *var)
|
||||
void eldbus_message_iter_dict_iterate(Eldbus_Message_Iter *dict, const_char *signature, Eldbus_Dict_Cb_Get cb, const void *data) EINA_ARG_NONNULL(1, 2, 3)
|
||||
|
||||
# eldbus_message_eina_value.h
|
||||
|
||||
Eina_Value *eldbus_message_to_eina_value(const_Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
Eina_Value *eldbus_message_iter_struct_like_to_eina_value(const_Eldbus_Message_Iter *iter)
|
||||
Eina_Bool eldbus_message_from_eina_value(const_char *signature, Eldbus_Message *msg, const Eina_Value *value) EINA_ARG_NONNULL(1, 2, 3)
|
||||
|
||||
# eldbus_signal_handler.h
|
||||
|
||||
Eldbus_Signal_Handler *eldbus_signal_handler_add(Eldbus_Connection *conn, const_char *sender, const char *path, const char *interface, const char *member, EDBus_Signal_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 6)
|
||||
Eldbus_Signal_Handler *eldbus_signal_handler_ref(Eldbus_Signal_Handler *handler) EINA_ARG_NONNULL(1)
|
||||
void eldbus_signal_handler_unref(Eldbus_Signal_Handler *handler) EINA_ARG_NONNULL(1)
|
||||
void eldbus_signal_handler_del(Eldbus_Signal_Handler *handler) EINA_ARG_NONNULL(1)
|
||||
Eina_Bool eldbus_signal_handler_match_extra_set(Eldbus_Signal_Handler *sh, ...) EINA_ARG_NONNULL(1) EINA_SENTINEL
|
||||
Eina_Bool eldbus_signal_handler_match_extra_vset(Eldbus_Signal_Handler *sh, va_list ap) EINA_ARG_NONNULL(1)
|
||||
void eldbus_signal_handler_free_cb_add(Eldbus_Signal_Handler *handler, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
void eldbus_signal_handler_free_cb_del(Eldbus_Signal_Handler *handler, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
const_char *eldbus_signal_handler_sender_get(const Eldbus_Signal_Handler *handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_signal_handler_path_get(const Eldbus_Signal_Handler *handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_signal_handler_interface_get(const Eldbus_Signal_Handler *handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_signal_handler_member_get(const Eldbus_Signal_Handler *handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_signal_handler_match_get(const Eldbus_Signal_Handler *handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
Eldbus_Connection *eldbus_signal_handler_connection_get(const_Eldbus_Signal_Handler *handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
# eldbus_pending.h
|
||||
|
||||
void eldbus_pending_data_set(Eldbus_Pending *pending, const_char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3)
|
||||
void *eldbus_pending_data_get(const_Eldbus_Pending *pending, const char *key) EINA_ARG_NONNULL(1, 2)
|
||||
void *eldbus_pending_data_del(Eldbus_Pending *pending, const_char *key) EINA_ARG_NONNULL(1, 2)
|
||||
void eldbus_pending_cancel(Eldbus_Pending *pending) EINA_ARG_NONNULL(1)
|
||||
|
||||
const_char *eldbus_pending_destination_get(const Eldbus_Pending *pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_pending_path_get(const Eldbus_Pending *pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_pending_interface_get(const Eldbus_Pending *pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_pending_method_get(const Eldbus_Pending *pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
void eldbus_pending_free_cb_add(Eldbus_Pending *pending, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
void eldbus_pending_free_cb_del(Eldbus_Pending *pending, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
# eldbus_object.h
|
||||
|
||||
Eldbus_Object *eldbus_object_get(Eldbus_Connection *conn, const_char *bus, const char *path) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
Eldbus_Object *eldbus_object_ref(Eldbus_Object *obj) EINA_ARG_NONNULL(1)
|
||||
void eldbus_object_unref(Eldbus_Object *obj) EINA_ARG_NONNULL(1)
|
||||
void eldbus_object_free_cb_add(Eldbus_Object *obj, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
void eldbus_object_free_cb_del(Eldbus_Object *obj, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
ctypedef struct Eldbus_Object_Event_Interface_Added:
|
||||
const_char *interface;
|
||||
Eldbus_Proxy *proxy;
|
||||
|
||||
ctypedef struct Eldbus_Object_Event_Interface_Removed:
|
||||
const_char *interface;
|
||||
|
||||
ctypedef struct Eldbus_Object_Event_Property_Changed:
|
||||
const_char *interface
|
||||
Eldbus_Proxy *proxy
|
||||
const_char *name
|
||||
const_Eina_Value *value
|
||||
|
||||
ctypedef struct Eldbus_Object_Event_Property_Removed:
|
||||
const_char *interface
|
||||
Eldbus_Proxy *proxy
|
||||
const_char *name
|
||||
|
||||
ctypedef void (*Eldbus_Object_Event_Cb)(void *data, Eldbus_Object *obj, void *event_info)
|
||||
|
||||
void eldbus_object_event_callback_add(Eldbus_Object *obj, Eldbus_Object_Event_Type type, EDBus_Object_Event_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1, 3)
|
||||
void eldbus_object_event_callback_del(Eldbus_Object *obj, Eldbus_Object_Event_Type type, EDBus_Object_Event_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1, 3)
|
||||
|
||||
Eldbus_Connection *eldbus_object_connection_get(const_Eldbus_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_object_bus_name_get(const Eldbus_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_object_path_get(const Eldbus_Object *obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
Eldbus_Pending *eldbus_object_send(Eldbus_Object *obj, EDBus_Message *msg, EDBus_Message_Cb cb, const_void *cb_data, double timeout) EINA_ARG_NONNULL(1, 2)
|
||||
Eldbus_Signal_Handler *eldbus_object_signal_handler_add(Eldbus_Object *obj, const_char *interface, const char *member, EDBus_Signal_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 4)
|
||||
Eldbus_Message *eldbus_object_method_call_new(Eldbus_Object *obj, const_char *interface, const char *member) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
# eldbus_proxy.h
|
||||
|
||||
Eldbus_Proxy *eldbus_proxy_get(Eldbus_Object *obj, const_char *interface) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT
|
||||
Eldbus_Proxy *eldbus_proxy_ref(Eldbus_Proxy *proxy) EINA_ARG_NONNULL(1)
|
||||
void eldbus_proxy_unref(Eldbus_Proxy *proxy) EINA_ARG_NONNULL(1)
|
||||
|
||||
Eldbus_Object *eldbus_proxy_object_get(const_Eldbus_Proxy *proxy) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_proxy_interface_get(const Eldbus_Proxy *proxy) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
void eldbus_proxy_data_set(Eldbus_Proxy *proxy, const_char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3)
|
||||
void *eldbus_proxy_data_get(const_Eldbus_Proxy *proxy, const char *key) EINA_ARG_NONNULL(1, 2)
|
||||
void *eldbus_proxy_data_del(Eldbus_Proxy *proxy, const_char *key) EINA_ARG_NONNULL(1, 2)
|
||||
void eldbus_proxy_free_cb_add(Eldbus_Proxy *proxy, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
void eldbus_proxy_free_cb_del(Eldbus_Proxy *proxy, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
Eldbus_Message *eldbus_proxy_method_call_new(Eldbus_Proxy *proxy, const_char *member) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT
|
||||
Eldbus_Pending *eldbus_proxy_send(Eldbus_Proxy *proxy, EDBus_Message *msg, EDBus_Message_Cb cb, const_void *cb_data, double timeout) EINA_ARG_NONNULL(1, 2)
|
||||
Eldbus_Pending *eldbus_proxy_call(Eldbus_Proxy *proxy, const_char *member, EDBus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, ...) EINA_ARG_NONNULL(1, 2, 6)
|
||||
Eldbus_Pending *eldbus_proxy_vcall(Eldbus_Proxy *proxy, const_char *member, EDBus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2, 6)
|
||||
|
||||
Eldbus_Signal_Handler *eldbus_proxy_signal_handler_add(Eldbus_Proxy *proxy, const_char *member, EDBus_Signal_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3)
|
||||
|
||||
ctypedef struct Eldbus_Proxy_Event_Property_Changed:
|
||||
const_char *name;
|
||||
const_Eldbus_Proxy *proxy;
|
||||
const_Eina_Value *value;
|
||||
|
||||
ctypedef struct Eldbus_Proxy_Event_Property_Removed:
|
||||
const_char *interface
|
||||
const_Eldbus_Proxy *proxy
|
||||
const_char *name
|
||||
|
||||
ctypedef void (*Eldbus_Proxy_Event_Cb)(void *data, Eldbus_Proxy *proxy, void *event_info)
|
||||
|
||||
void eldbus_proxy_event_callback_add(Eldbus_Proxy *proxy, Eldbus_Proxy_Event_Type type, EDBus_Proxy_Event_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1, 3)
|
||||
void eldbus_proxy_event_callback_del(Eldbus_Proxy *proxy, Eldbus_Proxy_Event_Type type, EDBus_Proxy_Event_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1, 3)
|
||||
|
||||
# eldbus_freedesktop.h
|
||||
|
||||
#define ELDBUS_NAME_REQUEST_FLAG_ALLOW_REPLACEMENT 0x1 /**< Allow another service to become the primary owner if requested */
|
||||
#define ELDBUS_NAME_REQUEST_FLAG_REPLACE_EXISTING 0x2 /**< Request to replace the current primary owner */
|
||||
#define ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE 0x4 /**< If we can not become the primary owner do not place us in the queue */
|
||||
|
||||
# Replies to request for a name */
|
||||
#define ELDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER 1 /**< Service has become the primary owner of the requested name */
|
||||
#define ELDBUS_NAME_REQUEST_REPLY_IN_QUEUE 2 /**< Service could not become the primary owner and has been placed in the queue */
|
||||
#define ELDBUS_NAME_REQUEST_REPLY_EXISTS 3 /**< Service is already in the queue */
|
||||
#define ELDBUS_NAME_REQUEST_REPLY_ALREADY_OWNER 4 /**< Service is already the primary owner */
|
||||
|
||||
Eldbus_Pending *eldbus_name_request(Eldbus_Connection *conn, const_char *bus, unsigned int flags, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
# Replies to releasing a name */
|
||||
#define ELDBUS_NAME_RELEASE_REPLY_RELEASED 1 /**< Service was released from the given name */
|
||||
#define ELDBUS_NAME_RELEASE_REPLY_NON_EXISTENT 2 /**< The given name does not exist on the bus */
|
||||
#define ELDBUS_NAME_RELEASE_REPLY_NOT_OWNER 3 /**< Service is not an owner of the given name */
|
||||
|
||||
Eldbus_Pending *eldbus_name_release(Eldbus_Connection *conn, const_char *bus, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2)
|
||||
Eldbus_Pending *eldbus_name_owner_get(Eldbus_Connection *conn, const_char *bus, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2)
|
||||
Eldbus_Pending *eldbus_name_owner_has(Eldbus_Connection *conn, const_char *bus, EDBus_Message_Cb cb, const void *cb_data)
|
||||
Eldbus_Pending *eldbus_names_list(Eldbus_Connection *conn, EDBus_Message_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1)
|
||||
Eldbus_Pending *eldbus_names_activatable_list(Eldbus_Connection *conn, EDBus_Message_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1)
|
||||
|
||||
# Replies to service starts */
|
||||
#define ELDBUS_NAME_START_REPLY_SUCCESS 1 /**< Service was auto started */
|
||||
#define ELDBUS_NAME_START_REPLY_ALREADY_RUNNING 2 /**< Service was already running */
|
||||
|
||||
Eldbus_Pending *eldbus_name_start(Eldbus_Connection *conn, const_char *bus, unsigned int flags, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
ctypedef void (*Eldbus_Name_Owner_Changed_Cb)(void *data, const_char *bus, const char *old_id, const char *new_id)
|
||||
|
||||
void eldbus_name_owner_changed_callback_add(Eldbus_Connection *conn, const_char *bus, Eldbus_Name_Owner_Changed_Cb cb, const void *cb_data, Eina_Bool allow_initial_call) EINA_ARG_NONNULL(1, 2, 3)
|
||||
void eldbus_name_owner_changed_callback_del(Eldbus_Connection *conn, const_char *bus, Eldbus_Name_Owner_Changed_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2, 3)
|
||||
Eldbus_Pending *eldbus_object_peer_ping(Eldbus_Object *obj, EDBus_Message_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
Eldbus_Pending *eldbus_object_peer_machine_id_get(Eldbus_Object *obj, EDBus_Message_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
Eldbus_Pending *eldbus_object_introspect(Eldbus_Object *obj, EDBus_Message_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
void eldbus_proxy_properties_monitor(Eldbus_Proxy *proxy, Eina_Bool enable) EINA_ARG_NONNULL(1)
|
||||
|
||||
Eldbus_Pending *eldbus_proxy_property_get(Eldbus_Proxy *proxy, const_char *name, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2, 3)
|
||||
Eldbus_Pending *eldbus_proxy_property_set(Eldbus_Proxy *proxy, const_char *name, const char *sig, const void *value, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2, 3, 4)
|
||||
Eldbus_Pending *eldbus_proxy_property_get_all(Eldbus_Proxy *proxy, EDBus_Message_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
Eldbus_Signal_Handler *eldbus_proxy_properties_changed_callback_add(Eldbus_Proxy *proxy, EDBus_Signal_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
Eina_Value *eldbus_proxy_property_local_get(Eldbus_Proxy *proxy, const_char *name) EINA_ARG_NONNULL(1, 2)
|
||||
const_Eina_Hash *eldbus_proxy_property_local_get_all(Eldbus_Proxy *proxy) EINA_ARG_NONNULL(1)
|
||||
Eldbus_Pending *eldbus_object_managed_objects_get(Eldbus_Object *obj, EDBus_Message_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
# eldbus_service.h
|
||||
|
||||
#define ELDBUS_METHOD_FLAG_DEPRECATED 1
|
||||
#define ELDBUS_METHOD_FLAG_NOREPLY (1 << 1)
|
||||
|
||||
#define ELDBUS_SIGNAL_FLAG_DEPRECATED 1
|
||||
|
||||
#define ELDBUS_PROPERTY_FLAG_DEPRECATED 1
|
||||
|
||||
ctypedef struct Eldbus_Arg_Info:
|
||||
const_char *signature
|
||||
const_char *name
|
||||
|
||||
#define ELDBUS_ARGS(args...) (const_Eldbus_Arg_Info[]){ args, { NULL, NULL } }
|
||||
|
||||
ctypedef struct _Eldbus_Service_Interface Eldbus_Service_Interface
|
||||
ctypedef Eldbus_Message * (*Eldbus_Method_Cb)(const_EDBus_Service_Interface *iface, const EDBus_Message *message)
|
||||
|
||||
ctypedef Eina_Bool (*Eldbus_Property_Get_Cb)(const_Eldbus_Service_Interface *iface, const char *propname, EDBus_Message_Iter *iter, const EDBus_Message *request_msg, EDBus_Message **error)
|
||||
|
||||
ctypedef Eldbus_Message *(*Eldbus_Property_Set_Cb)(const_EDBus_Service_Interface *iface, const char *propname, EDBus_Message_Iter *iter, const EDBus_Message *input_msg)
|
||||
|
||||
ctypedef struct Eldbus_Method:
|
||||
const_char *member
|
||||
const_Eldbus_Arg_Info *in
|
||||
const_Eldbus_Arg_Info *out
|
||||
Eldbus_Method_Cb cb
|
||||
unsigned int flags
|
||||
|
||||
ctypedef struct Eldbus_Signal:
|
||||
const_char *name
|
||||
const_Eldbus_Arg_Info *args
|
||||
unsigned int flags
|
||||
|
||||
ctypedef struct Eldbus_Property:
|
||||
const_char *name
|
||||
const_char *type
|
||||
Eldbus_Property_Get_Cb get_func
|
||||
Eldbus_Property_Set_Cb set_func
|
||||
unsigned int flags
|
||||
|
||||
ctypedef struct Eldbus_Service_Interface_Desc:
|
||||
const_char *interface # interface name
|
||||
const_Eldbus_Method *methods # array of the methods that should be registered in this interface, the last item of array should be filled with NULL
|
||||
const_Eldbus_Signal *signals # array of signal that this interface send, the last item of array should be filled with NULL
|
||||
const_Eldbus_Property *properties # array of property that this interface have, the last item of array should be filled with NULL
|
||||
const_Eldbus_Property_Get_Cb default_get # default get function, if a property don't have a get function this will be used
|
||||
const_Eldbus_Property_Set_Cb default_set # default set function, if a property don't have a set function this will be used
|
||||
|
||||
Eldbus_Service_Interface *eldbus_service_interface_register(Eldbus_Connection *conn, const_char *path, const EDBus_Service_Interface_Desc *desc) EINA_ARG_NONNULL(1, 2, 3)
|
||||
void eldbus_service_interface_unregister(Eldbus_Service_Interface *iface) EINA_ARG_NONNULL(1)
|
||||
void eldbus_service_object_unregister(Eldbus_Service_Interface *iface) EINA_ARG_NONNULL(1)
|
||||
Eldbus_Connection *eldbus_service_connection_get(const_Eldbus_Service_Interface *iface) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
const_char *eldbus_service_object_path_get(const Eldbus_Service_Interface *iface) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
Eina_Bool eldbus_service_signal_emit(const_Eldbus_Service_Interface *iface, unsigned int signal_id, ...) EINA_ARG_NONNULL(1)
|
||||
Eldbus_Message *eldbus_service_signal_new(const_Eldbus_Service_Interface *iface, unsigned int signal_id) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
Eina_Bool eldbus_service_signal_send(const_Eldbus_Service_Interface *iface, Eldbus_Message *signal_msg) EINA_ARG_NONNULL(1, 2)
|
||||
void eldbus_service_object_data_set(Eldbus_Service_Interface *iface, const_char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3)
|
||||
void *eldbus_service_object_data_get(const_Eldbus_Service_Interface *iface, const char *key) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT
|
||||
void *eldbus_service_object_data_del(Eldbus_Service_Interface *iface, const_char *key) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
Eina_Bool eldbus_service_property_changed(const_Eldbus_Service_Interface *iface, const char *name) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
Eina_Bool eldbus_service_property_invalidate_set(const_Eldbus_Service_Interface *iface, const char *name, Eina_Bool is_invalidate) EINA_ARG_NONNULL(1, 2)
|
||||
Eina_Bool eldbus_service_object_manager_attach(Eldbus_Service_Interface *iface) EINA_ARG_NONNULL(1)
|
||||
Eina_Bool eldbus_service_object_manager_detach(Eldbus_Service_Interface *iface) EINA_ARG_NONNULL(1)
|
|
@ -1,42 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
"""
|
||||
|
||||
Eldbus is a wrapper around the
|
||||
`dbus <http://www.freedesktop.org/wiki/Software/dbus>`_
|
||||
library, which is a message bus system. It also implements a set of
|
||||
specifications using dbus as interprocess communication.
|
||||
|
||||
"""
|
||||
|
||||
from cpython cimport PyUnicode_AsUTF8String
|
||||
|
||||
def module_cleanup():
|
||||
eldbus_shutdown()
|
||||
|
||||
eldbus_init()
|
||||
atexit.register(module_cleanup)
|
||||
|
||||
include "connection.pxi"
|
||||
include "message.pxi"
|
||||
include "signal_handler.pxi"
|
||||
include "pending.pxi"
|
||||
include "object.pxi"
|
||||
include "proxy.pxi"
|
||||
include "freedesktop.pxi"
|
||||
include "service.pxi"
|
|
@ -1,26 +0,0 @@
|
|||
cdef extern from "Eldbus.h":
|
||||
ctypedef enum Eldbus_Connection_Type:
|
||||
ELDBUS_CONNECTION_TYPE_UNKNOWN
|
||||
ELDBUS_CONNECTION_TYPE_SESSION
|
||||
ELDBUS_CONNECTION_TYPE_SYSTEM
|
||||
ELDBUS_CONNECTION_TYPE_STARTER
|
||||
ELDBUS_CONNECTION_TYPE_LAST
|
||||
|
||||
ctypedef enum Eldbus_Connection_Event_Type:
|
||||
ELDBUS_CONNECTION_EVENT_DEL
|
||||
ELDBUS_CONNECTION_EVENT_DISCONNECTED
|
||||
ELDBUS_CONNECTION_EVENT_LAST # sentinel, not a real event type
|
||||
|
||||
ctypedef enum Eldbus_Object_Event_Type:
|
||||
ELDBUS_OBJECT_EVENT_IFACE_ADDED # a parent path must have a ObjectManager interface
|
||||
ELDBUS_OBJECT_EVENT_IFACE_REMOVED # a parent path must have a ObjectManager interface
|
||||
ELDBUS_OBJECT_EVENT_PROPERTY_CHANGED
|
||||
ELDBUS_OBJECT_EVENT_PROPERTY_REMOVED
|
||||
ELDBUS_OBJECT_EVENT_DEL
|
||||
ELDBUS_OBJECT_EVENT_LAST # sentinel, not a real event type
|
||||
|
||||
ctypedef enum Eldbus_Proxy_Event_Type:
|
||||
ELDBUS_PROXY_EVENT_PROPERTY_CHANGED
|
||||
ELDBUS_PROXY_EVENT_PROPERTY_REMOVED
|
||||
ELDBUS_PROXY_EVENT_DEL
|
||||
ELDBUS_PROXY_EVENT_LAST # sentinel, not a real event type
|
|
@ -1,137 +0,0 @@
|
|||
#define ELDBUS_NAME_REQUEST_FLAG_ALLOW_REPLACEMENT 0x1 /**< Allow another service to become the primary owner if requested */
|
||||
#define ELDBUS_NAME_REQUEST_FLAG_REPLACE_EXISTING 0x2 /**< Request to replace the current primary owner */
|
||||
#define ELDBUS_NAME_REQUEST_FLAG_DO_NOT_QUEUE 0x4 /**< If we can not become the primary owner do not place us in the queue */
|
||||
|
||||
# Replies to request for a name
|
||||
#define ELDBUS_NAME_REQUEST_REPLY_PRIMARY_OWNER 1 /**< Service has become the primary owner of the requested name */
|
||||
#define ELDBUS_NAME_REQUEST_REPLY_IN_QUEUE 2 /**< Service could not become the primary owner and has been placed in the queue */
|
||||
#define ELDBUS_NAME_REQUEST_REPLY_EXISTS 3 /**< Service is already in the queue */
|
||||
#define ELDBUS_NAME_REQUEST_REPLY_ALREADY_OWNER 4 /**< Service is already the primary owner */
|
||||
|
||||
def name_request(conn, bus, flags, cb, cb_data):
|
||||
Eldbus_Pending *eldbus_name_request(Eldbus_Connection *conn, const_char *bus, unsigned int flags, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
# Replies to releasing a name
|
||||
#define ELDBUS_NAME_RELEASE_REPLY_RELEASED 1 /**< Service was released from the given name */
|
||||
#define ELDBUS_NAME_RELEASE_REPLY_NON_EXISTENT 2 /**< The given name does not exist on the bus */
|
||||
#define ELDBUS_NAME_RELEASE_REPLY_NOT_OWNER 3 /**< Service is not an owner of the given name */
|
||||
|
||||
def name_release(conn, bus, cb, cb_data):
|
||||
Eldbus_Pending *eldbus_name_release(Eldbus_Connection *conn, const_char *bus, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def name_owner_get(conn, bus, cb, cb_data):
|
||||
Eldbus_Pending *eldbus_name_owner_get(Eldbus_Connection *conn, const_char *bus, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def name_owner_has(conn, bus, cb, cb_data):
|
||||
Eldbus_Pending *eldbus_name_owner_has(Eldbus_Connection *conn, const_char *bus, EDBus_Message_Cb cb, const void *cb_data)
|
||||
|
||||
def names_list(conn, cb, cb_data):
|
||||
Eldbus_Pending *eldbus_names_list(Eldbus_Connection *conn, EDBus_Message_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1)
|
||||
|
||||
def names_activatable_list(conn, cb, cb_data):
|
||||
Eldbus_Pending *eldbus_names_activatable_list(Eldbus_Connection *conn, EDBus_Message_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1)
|
||||
|
||||
# Replies to service starts
|
||||
#define ELDBUS_NAME_START_REPLY_SUCCESS 1 /**< Service was auto started */
|
||||
#define ELDBUS_NAME_START_REPLY_ALREADY_RUNNING 2 /**< Service was already running */
|
||||
|
||||
def name_start(conn, bus, flags, cb, cb_data):
|
||||
Eldbus_Pending *eldbus_name_start(Eldbus_Connection *conn, const_char *bus, unsigned int flags, EDBus_Message_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
|
||||
typedef void (*Eldbus_Name_Owner_Changed_Cb)(void *data, const_char *bus, const char *old_id, const char *new_id);
|
||||
|
||||
|
||||
def name_owner_changed_callback_add(conn, bus, cb, cb_data, allow_initial_call):
|
||||
"""
|
||||
|
||||
Add a callback to be called when unique id of a bus name changed.
|
||||
|
||||
This function implicitly calls eldbus_name_owner_get() in order to be able to
|
||||
monitor the name. If the only interest is to receive notifications when the
|
||||
name in fact changes, pass EINA_FALSE to @param allow_initial_call so your
|
||||
callback will not be called on first retrieval of name owner. If the
|
||||
initial state is important, pass EINA_TRUE to this parameter.
|
||||
|
||||
@param conn connection
|
||||
@param bus name of bus
|
||||
@param cb callback
|
||||
@param cb_data context data
|
||||
@param allow_initial_call allow call callback with actual id of the bus
|
||||
|
||||
"""
|
||||
void eldbus_name_owner_changed_callback_add(Eldbus_Connection *conn, const_char *bus, Eldbus_Name_Owner_Changed_Cb cb, const void *cb_data, Eina_Bool allow_initial_call) EINA_ARG_NONNULL(1, 2, 3)
|
||||
|
||||
def name_owner_changed_callback_del(conn, bus, cb, cb_data):
|
||||
"""
|
||||
|
||||
Remove callback added with eldbus_name_owner_changed_callback_add().
|
||||
|
||||
@param conn connection
|
||||
@param bus name of bus
|
||||
@param cb callback
|
||||
@param cb_data context data
|
||||
|
||||
"""
|
||||
void eldbus_name_owner_changed_callback_del(Eldbus_Connection *conn, const_char *bus, Eldbus_Name_Owner_Changed_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 2, 3)
|
||||
|
||||
def object_peer_ping(obj, cb, data):
|
||||
Eldbus_Pending *eldbus_object_peer_ping(Eldbus_Object *obj, EDBus_Message_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def object_peer_machine_id_get(obj, cb, data):
|
||||
Eldbus_Pending *eldbus_object_peer_machine_id_get(Eldbus_Object *obj, EDBus_Message_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def object_introspect(obj, cb, data):
|
||||
Eldbus_Pending *eldbus_object_introspect(Eldbus_Object *obj, EDBus_Message_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def proxy_properties_monitor(proxy, enable):
|
||||
"""
|
||||
|
||||
Enable or disable local cache of properties.
|
||||
|
||||
After enable you can call eldbus_proxy_property_local_get() or
|
||||
eldbus_proxy_property_local_get_all() to get cached properties.
|
||||
|
||||
@note After enable, it will asynchrony get the properties values.
|
||||
|
||||
"""
|
||||
void eldbus_proxy_properties_monitor(Eldbus_Proxy *proxy, Eina_Bool enable) EINA_ARG_NONNULL(1)
|
||||
|
||||
def proxy_property_get(proxy, name, cb, data):
|
||||
Eldbus_Pending *eldbus_proxy_property_get(Eldbus_Proxy *proxy, const_char *name, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2, 3)
|
||||
|
||||
def proxy_property_set(proxy, name, sig, value, cb, data):
|
||||
Eldbus_Pending *eldbus_proxy_property_set(Eldbus_Proxy *proxy, const_char *name, const char *sig, const void *value, EDBus_Message_Cb cb, const void *data) EINA_ARG_NONNULL(1, 2, 3, 4)
|
||||
|
||||
def proxy_property_get_add(proxy, cb, data):
|
||||
Eldbus_Pending *eldbus_proxy_property_get_all(Eldbus_Proxy *proxy, EDBus_Message_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def proxy_properties_changed_callback_add(proxy, cb, data):
|
||||
Eldbus_Signal_Handler *eldbus_proxy_properties_changed_callback_add(Eldbus_Proxy *proxy, EDBus_Signal_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def proxy_property_local_get(proxy, name):
|
||||
"""
|
||||
|
||||
Return the cached value of property.
|
||||
This only work if you have enable eldbus_proxy_properties_monitor or
|
||||
if you have call eldbus_proxy_event_callback_add of type
|
||||
ELDBUS_PROXY_EVENT_PROPERTY_CHANGED and the property you want had changed.
|
||||
|
||||
"""
|
||||
Eina_Value *eldbus_proxy_property_local_get(Eldbus_Proxy *proxy, const_char *name) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def proxy_property_local_get_all(proxy):
|
||||
"""
|
||||
|
||||
Return a Eina_Hash with all cached properties.
|
||||
This only work if you have enable eldbus_proxy_properties_monitor or
|
||||
if you have call eldbus_proxy_event_callback_add of type
|
||||
ELDBUS_PROXY_EVENT_PROPERTY_CHANGED.
|
||||
|
||||
"""
|
||||
const_Eina_Hash *eldbus_proxy_property_local_get_all(Eldbus_Proxy *proxy) EINA_ARG_NONNULL(1)
|
||||
|
||||
|
||||
def object_managed_objects_get(obj, cb, data):
|
||||
Eldbus_Pending *eldbus_object_managed_objects_get(Eldbus_Object *obj, EDBus_Message_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
|
@ -1,403 +0,0 @@
|
|||
cdef class Message(object):
|
||||
|
||||
cdef Eldbus_Message *msg
|
||||
|
||||
def ref(self):
|
||||
"""
|
||||
|
||||
Increase message reference.
|
||||
|
||||
"""
|
||||
# NOTE: returns Eldbus_Message *
|
||||
eldbus_message_ref(self.msg)
|
||||
return self
|
||||
|
||||
def unref(self):
|
||||
"""
|
||||
|
||||
Decrease message reference.
|
||||
|
||||
When refcount reaches zero the message and all its resources will be
|
||||
freed.
|
||||
|
||||
"""
|
||||
eldbus_message_unref(self.msg)
|
||||
|
||||
property path:
|
||||
def __get__(self):
|
||||
const_char *eldbus_message_path_get(self.msg)
|
||||
|
||||
property interface:
|
||||
def __get__(self):
|
||||
const_char *eldbus_message_interface_get(self.msg)
|
||||
|
||||
property member:
|
||||
def __get__(self):
|
||||
const_char *eldbus_message_member_get(self.msg)
|
||||
|
||||
property destination:
|
||||
def __get__(self):
|
||||
const_char *eldbus_message_destination_get(self.msg)
|
||||
|
||||
property sender:
|
||||
def __get__(self):
|
||||
const_char *eldbus_message_sender_get(self.msg)
|
||||
|
||||
property signature:
|
||||
def __get__(self):
|
||||
const_char *eldbus_message_signature_get(self.msg)
|
||||
|
||||
@classmethod
|
||||
def method_call_new(cls, dest, path, iface, method):
|
||||
"""
|
||||
|
||||
Create a new message to invoke a method on a remote object.
|
||||
|
||||
:param dest: bus name or unique id of the remote application
|
||||
:param path: object path
|
||||
:param iface: interface name
|
||||
:param method: name of the method to be called
|
||||
|
||||
@return a new Eldbus_Message, free with eldbus_message_unref()
|
||||
|
||||
"""
|
||||
Eldbus_Message *eldbus_message_method_call_new(const_char *dest, const char *path, const char *iface, const char *method) EINA_ARG_NONNULL(1, 2, 3, 4) EINA_WARN_UNUSED_RESULT EINA_MALLOC
|
||||
|
||||
@classmethod
|
||||
def error_new(cls, msg, error_name, error_msg):
|
||||
"""
|
||||
|
||||
Create a new message that is an error reply to another message.
|
||||
|
||||
:param msg: the message we're replying to
|
||||
:param error_name: the error name
|
||||
:param error_msg: the error message string
|
||||
|
||||
@return a new Eldbus_Message, free with eldbus_message_unref()
|
||||
|
||||
"""
|
||||
Eldbus_Message *eldbus_message_error_new( const_Eldbus_Message *msg, const char *error_name, const char *error_msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
@classmethod
|
||||
def method_return_new(cls, msg):
|
||||
"""
|
||||
|
||||
Create a message that is a reply to a method call.
|
||||
|
||||
:param msg: the message we're replying to
|
||||
|
||||
@return new Eldbus_Message, free with eldbus_message_unref()
|
||||
|
||||
"""
|
||||
Eldbus_Message *eldbus_message_method_return_new( const_Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
|
||||
def error_get(self, name, text):
|
||||
"""
|
||||
|
||||
Get the error text and name from a Eldbus_Message.
|
||||
|
||||
If :param msg: is an error message return EINA_TRUE and fill in the name and
|
||||
text of the error.
|
||||
|
||||
:param name: Variable in which to store the error name or @c NULL if it's not
|
||||
desired.
|
||||
:param text: Variable in which to store the error text or @c NULL if it's not
|
||||
desired.
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_message_error_get(self.msg, const_char **name, const char **text) EINA_ARG_NONNULL(1)
|
||||
|
||||
def arguments_get(self, signature, *args):
|
||||
"""
|
||||
|
||||
Get the arguments from an Eldbus_Message
|
||||
|
||||
Get the arguments of an Eldbus_Message storing them in the locations pointed
|
||||
to by the pointer arguments that follow :param signature:. Each pointer
|
||||
argument must be of a type that is appropriate for the correspondent complete
|
||||
type in :param signature:. For complex types such as arrays, structs,
|
||||
dictionaries or variants, a pointer to Eldbus_Message_Iter* must be provided.
|
||||
|
||||
:param signature: The signature of the arguments user is expecting to read
|
||||
@param ... The pointers in which to store the message arguments
|
||||
|
||||
@return EINA_TRUE if the arguments were read succesfully and stored in the
|
||||
respective pointer arguments.
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_message_arguments_get(self.msg, const_char *signature, ...)
|
||||
|
||||
def arguments_vget(self, signature):
|
||||
"""
|
||||
|
||||
Get the arguments from an Eldbus_Message using a va_list.
|
||||
|
||||
:param signature: The signature user is expecting to read from :param msg:.
|
||||
:param ap: The va_list containing the pointer arguments.
|
||||
|
||||
@see eldbus_message_arguments_get()
|
||||
|
||||
@return EINA_TRUE if the arguments were read succesfully and stored in the
|
||||
respective pointer arguments.
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_message_arguments_vget(self.msg, const_char *signature, va_list ap)
|
||||
|
||||
def arguments_append(self, signature, *args):
|
||||
"""
|
||||
|
||||
Append arguments into an Eldbus_Message
|
||||
|
||||
Append arguments into an Eldbus_Message according to the :param signature:
|
||||
provided. For each complete type in :param signature:, a value of the
|
||||
corresponding type must be provided.
|
||||
|
||||
This function supports only basic types. For complex types use
|
||||
eldbus_message_iter_* family of functions.
|
||||
|
||||
:param signature: Signature of the arguments that are being appended.
|
||||
@param ... Values of each argument to append in :param msg:.
|
||||
|
||||
@return EINA_TRUE on success, EINA_FALSE otherwise.
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_message_arguments_append(self.msg, const_char *signature, ...)
|
||||
|
||||
def arguments_vappend(self, signature, va_list_ap):
|
||||
"""
|
||||
|
||||
Append arguments into an Eldbus_Message using a va_list.
|
||||
|
||||
:param signature: Signature of the arguments that are being appended.
|
||||
:param ap: The va_list containing the arguments to append.
|
||||
|
||||
@see eldbus_message_arguments_append().
|
||||
|
||||
@return EINA_TRUE on success, EINA_FALSE otherwise.
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_message_arguments_vappend(self.msg, const_char *signature, va_list ap)
|
||||
|
||||
cdef class MessageIterator(object):
|
||||
|
||||
"""
|
||||
|
||||
Create and append a typed iterator to another iterator.
|
||||
|
||||
After append data to returned iterator it must be closed calling
|
||||
eldbus_message_iter_container_close().
|
||||
|
||||
Container types are for example struct, variant, and array.
|
||||
For variants, the contained_signature should be the type of the single
|
||||
value inside the variant. For structs and dict entries, contained_signature
|
||||
should be NULL; it will be set to whatever types you write into the struct.
|
||||
For arrays, contained_signature should be the type of the array elements.
|
||||
|
||||
:param iter: parent of the new iterator
|
||||
:param type: of iterator (e.g struct, dict, variant or array)
|
||||
:param contained_signature: signature of what iterator will store
|
||||
|
||||
@return the new iterator
|
||||
|
||||
"""
|
||||
Eldbus_Message_Iter *eldbus_message_iter_container_new(Eldbus_Message_Iter *iter, int type, const_char* contained_signature) EINA_ARG_NONNULL(1, 3) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Append a basic type into an Eldbus_Iterator.
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_message_iter_basic_append(Eldbus_Message_Iter *iter, int type, ...) EINA_ARG_NONNULL(1, 3)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Append an argument into an Eldbus_Message_Iter. For each complete type
|
||||
you need to provide the correspondent value. In case of complex types you
|
||||
need to provide an Eldbus_Message_Iter** to be allocated and then filled in.
|
||||
|
||||
It's not possible to open two iterators at same iterator with this function.
|
||||
For example, to create a message with signature="aiai" you need to create the
|
||||
first container with eldbus_message_iter_container_new(), fill the array,
|
||||
close it with eldbus_message_iter_container_close() and then do the same for
|
||||
the second array.
|
||||
|
||||
:param iter: iterator in which data will be appended
|
||||
:param signature: signature of the contained data
|
||||
@param ... values for each complete type
|
||||
|
||||
@see eldbus_message_iter_container_new()
|
||||
@see eldbus_message_iter_container_close()
|
||||
|
||||
@note This function doesn't support variant, use
|
||||
eldbus_message_iter_container_new() instead to create the variant, fill
|
||||
with data and close it.
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_message_iter_arguments_append(Eldbus_Message_Iter *iter, const_char *signature, ...) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Set data to Eldbus_Message_Iter. For each complete in signature
|
||||
you need pass the value, in case of complex type a pointer to be allocated a
|
||||
Eldbus_Message_Iter that you need fill and close.
|
||||
|
||||
It's not possible open two iterators at same Iterator. Example:
|
||||
"aiai", to set this you need create and put the first array with
|
||||
eldbus_message_iter_container_new() fill array with data and close then
|
||||
you could open the second array with eldbus_message_iter_container_new().
|
||||
|
||||
:param iter: iterator
|
||||
:param signature: of data
|
||||
:param ap: va_list with the values
|
||||
|
||||
@note This function don't support variant, use instead
|
||||
eldbus_message_iter_container_new() to create the variant fill
|
||||
data and close it.
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_message_iter_arguments_vappend(Eldbus_Message_Iter *iter, const_char *signature, va_list ap) EINA_ARG_NONNULL(1, 2, 3)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Closes a container-typed value appended to the message.
|
||||
|
||||
:param iter: parent of the sub-iterator
|
||||
:param sub: the iterator that will be closed
|
||||
|
||||
@return EINA_FALSE if iterator was already close or if not enough memory
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_message_iter_container_close(Eldbus_Message_Iter *iter, Eldbus_Message_Iter *sub) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Get the main Eldbus_Message_Iter from the Eldbus_Message.
|
||||
|
||||
"""
|
||||
Eldbus_Message_Iter *eldbus_message_iter_get( const_Eldbus_Message *msg) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Get a basic type from Eldbus_Iterator.
|
||||
|
||||
"""
|
||||
void eldbus_message_iter_basic_get(Eldbus_Message_Iter *iter, void *value) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Returns the current signature of a message iterator.
|
||||
|
||||
@note The returned string must be freed.
|
||||
|
||||
"""
|
||||
char *eldbus_message_iter_signature_get(Eldbus_Message_Iter *iter) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Moves the iterator to the next field, if any.
|
||||
:param iter: iterator
|
||||
|
||||
@return if iterator was reach to end return EINA_FALSE
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_message_iter_next(Eldbus_Message_Iter *iter) EINA_ARG_NONNULL(1)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Get a complete type from Eldbus_Message_Iter if is not at the end
|
||||
of iterator and move to next field.
|
||||
Useful to iterate over arrays.
|
||||
|
||||
:param iter: iterator
|
||||
:param type: of the next completed type in Iterator
|
||||
@param ... pointer of where data will be stored
|
||||
|
||||
:param if: iterator was reach to end or if type different of the type that
|
||||
iterator points return EINA_FALSE
|
||||
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_message_iter_get_and_next(Eldbus_Message_Iter *iter, char type, ...) EINA_ARG_NONNULL(1, 2, 3)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Reads a block of fixed-length values from the message iterator.
|
||||
|
||||
Fixed-length values are those basic types that are not string-like,
|
||||
such as integers, bool, double. The returned block will be from the
|
||||
current position in the array until the end of the array.
|
||||
|
||||
There is one exception here: although ELDBUS_TYPE_UNIX_FD is considered a
|
||||
'fixed' type arrays of this type may not be read with this function.
|
||||
|
||||
The value argument should be the address of a location to store the returned
|
||||
array. So for int32 it should be a "const_dbus_int32_t**" The returned value
|
||||
is by reference and should not be freed.
|
||||
|
||||
Because the array is not copied, this function runs in constant time and is
|
||||
fast; it's much preferred over walking the entire array with an iterator.
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_message_iter_fixed_array_get(Eldbus_Message_Iter *iter, int signature, void *value, int *n_elements) EINA_ARG_NONNULL(1, 3, 4)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Get data from Eldbus_Message_Iter, for each complete type must have
|
||||
a pointer to store his value, in case of complex type a
|
||||
Eldbus_Message_Iter will be need.
|
||||
|
||||
:param iter: iterator
|
||||
:param signature: of the complete data types on interator
|
||||
@param ... pointers of where data will be stored
|
||||
|
||||
@return EINA_FALSE if signature different from signature in iterator
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_message_iter_arguments_get(Eldbus_Message_Iter *iter, const_char *signature, ...) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Get data from Eldbus_Message_Iter, for each complete type must have
|
||||
a pointer to store his value, in case of complex type a
|
||||
Eldbus_Message_Iter will be need.
|
||||
|
||||
:param iter: iterator
|
||||
:param signature: of the complete data types on interator
|
||||
:param ap: va_list of the pointers of where data will be stored
|
||||
|
||||
@return EINA_FALSE if signature different from signature in iterator
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_message_iter_arguments_vget(Eldbus_Message_Iter *iter, const_char *signature, va_list ap) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
|
||||
"""
|
||||
|
||||
Manually delete the iterator.
|
||||
|
||||
Iterators are usually bound to the life of @ref Eldbus_Message
|
||||
they were created from, being deleted automatically once the
|
||||
message is deleted.
|
||||
|
||||
However when dealing with huge arrays or dicts it may become a
|
||||
major memory impact to leave the unused iterators alive. By
|
||||
calling this function one states the iterator is not used anymore
|
||||
and can be deleted.
|
||||
|
||||
:param iter: the iterator to be deleted.
|
||||
|
||||
"""
|
||||
void eldbus_message_iter_del(Eldbus_Message_Iter *iter) EINA_ARG_NONNULL(1)
|
|
@ -1,147 +0,0 @@
|
|||
cdef void eldbus_object_event_cb(void *data, Eldbus_Object *obj, void *event_info):
|
||||
pass
|
||||
|
||||
cdef class Object(object):
|
||||
|
||||
cdef Eldbus_Object *obj
|
||||
|
||||
def __init__(self, Connection eldbus_conn not None, bus, path):
|
||||
"""
|
||||
|
||||
Get an object of the given bus and path.
|
||||
|
||||
:param conn: connection where object belongs
|
||||
:param bus: name of bus or unique-id of who listens for calls of this object
|
||||
:param path: object path of this object
|
||||
|
||||
"""
|
||||
if isinstance(bus, unicode): bus = PyUnicode_AsUTF8String(bus)
|
||||
if isinstance(path, unicode): path = PyUnicode_AsUTF8String(path)
|
||||
self.obj = eldbus_object_get(edbus_conn.conn, bus, path)
|
||||
|
||||
def ref(self):
|
||||
"""
|
||||
|
||||
Increase object reference.
|
||||
|
||||
"""
|
||||
# NOTE: Returns Eldbus_Object *
|
||||
eldbus_object_ref(self.obj)
|
||||
return self
|
||||
|
||||
def unref(self):
|
||||
"""
|
||||
|
||||
Decrease object reference.
|
||||
If reference == 0 object will be freed and all its children.
|
||||
|
||||
"""
|
||||
eldbus_object_unref(self.obj)
|
||||
|
||||
def free_cb_add(self, cb, cb_data):
|
||||
"""
|
||||
|
||||
Add a callback function to be called when object will be freed.
|
||||
|
||||
:param cb: callback that will be executed
|
||||
:param data: passed to callback
|
||||
|
||||
"""
|
||||
eldbus_object_free_cb_add(self.obj, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def free_cb_del(self, cb, cb_data):
|
||||
"""
|
||||
|
||||
Remove callback registered in eldbus_object_free_cb_add().
|
||||
|
||||
"""
|
||||
eldbus_object_free_cb_del(self.obj, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
"""
|
||||
typedef struct _Eldbus_Object_Event_Interface_Added
|
||||
{
|
||||
const_char *interface;
|
||||
Eldbus_Proxy *proxy;
|
||||
} Eldbus_Object_Event_Interface_Added;
|
||||
|
||||
typedef struct _Eldbus_Object_Event_Interface_Removed
|
||||
{
|
||||
const_char *interface;
|
||||
} Eldbus_Object_Event_Interface_Removed;
|
||||
|
||||
typedef struct _Eldbus_Object_Event_Property_Changed
|
||||
{
|
||||
const_char *interface;
|
||||
Eldbus_Proxy *proxy;
|
||||
const_char *name;
|
||||
const_Eina_Value *value;
|
||||
} Eldbus_Object_Event_Property_Changed;
|
||||
|
||||
typedef struct _Eldbus_Object_Event_Property_Removed
|
||||
{
|
||||
const_char *interface;
|
||||
Eldbus_Proxy *proxy;
|
||||
const_char *name;
|
||||
} Eldbus_Object_Event_Property_Removed;
|
||||
"""
|
||||
|
||||
def event_callback_add(self, event_type, cb, cb_data):
|
||||
"""
|
||||
|
||||
Add a callback function to be called when an event of the specified
|
||||
type occurs.
|
||||
|
||||
"""
|
||||
eldbus_object_event_callback_add(self.obj, Eldbus_Object_Event_Type type, Eldbus_Object_Event_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1, 3)
|
||||
|
||||
def event_callback_del(self, event_type, cb, cb_data):
|
||||
"""
|
||||
|
||||
Remove callback registered in eldbus_object_event_callback_add().
|
||||
|
||||
"""
|
||||
eldbus_object_event_callback_del(self.obj, Eldbus_Object_Event_Type type, Eldbus_Object_Event_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1, 3)
|
||||
|
||||
property connection:
|
||||
def __get__(self):
|
||||
Eldbus_Connection *eldbus_object_connection_get(self.obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
property bus_name:
|
||||
def __get__(self):
|
||||
const_char *eldbus_object_bus_name_get(self.obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
property path:
|
||||
def __get__(self):
|
||||
const_char *eldbus_object_path_get(self.obj) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
def send(self, msg, cb, cb_data, timeout):
|
||||
"""
|
||||
|
||||
Send a message.
|
||||
|
||||
:param msg: message that will be sent
|
||||
:param cb: if msg is a method call a callback should be passed
|
||||
to be executed when a response arrives
|
||||
:param cb_data: data passed to callback
|
||||
:param timeout: timeout in milliseconds, -1 to default internal value or
|
||||
ELDBUS_TIMEOUT_INFINITE for no timeout
|
||||
|
||||
"""
|
||||
Eldbus_Pending *eldbus_object_send(self.obj, Eldbus_Message *msg, EDBus_Message_Cb cb, const_void *cb_data, double timeout) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def signal_handler_add(self, interface, member, cb, cb_data):
|
||||
"""
|
||||
|
||||
Add a signal handler.
|
||||
|
||||
:param obj: where the signal is emitted
|
||||
:param interface: of the signal
|
||||
:param member: name of the signal
|
||||
:param cb: callback that will be called when this signal is received
|
||||
:param cb_data: data that will be passed to callback
|
||||
|
||||
"""
|
||||
Eldbus_Signal_Handler *eldbus_object_signal_handler_add(self.obj, const_char *interface, const char *member, Eldbus_Signal_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 4)
|
||||
|
||||
def method_call_new(self, interface, member):
|
||||
Eldbus_Message *eldbus_object_method_call_new(self.obj, const_char *interface, const char *member) EINA_ARG_NONNULL(1, 2, 3) EINA_WARN_UNUSED_RESULT
|
|
@ -1,47 +0,0 @@
|
|||
cdef class Pending(object):
|
||||
|
||||
cdef Eldbus_Pending *pending
|
||||
|
||||
def data_set(self, key, data):
|
||||
eldbus_pending_data_set(self.pending, const_char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3)
|
||||
|
||||
def data_get(self, key):
|
||||
void *eldbus_pending_data_get(self.pending, const_char *key) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def data_del(self, key):
|
||||
void *eldbus_pending_data_del(self.pending, const_char *key) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def cancel(self):
|
||||
eldbus_pending_cancel(self.pending)
|
||||
|
||||
property destination:
|
||||
def __get__(self):
|
||||
const_char *eldbus_pending_destination_get(self.pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
property path:
|
||||
def __get__(self):
|
||||
const_char *eldbus_pending_path_get(self.pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
property interface:
|
||||
def __get__(self):
|
||||
const_char *eldbus_pending_interface_get(self.pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
property method:
|
||||
def __get__(self):
|
||||
const_char *eldbus_pending_method_get(self.pending) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
def free_cb_add(self, cb, cb_data):
|
||||
"""
|
||||
|
||||
Add a callback function to be called when pending will be freed.
|
||||
|
||||
"""
|
||||
eldbus_pending_free_cb_add(self.pending, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def free_cb_del(self, cb, cb_data):
|
||||
"""
|
||||
|
||||
Remove callback registered in eldbus_pending_free_cb_add().
|
||||
|
||||
"""
|
||||
eldbus_pending_free_cb_del(self.pending, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
|
@ -1,181 +0,0 @@
|
|||
ELDBUS_PROXY_EVENT_PROPERTY_CHANGED
|
||||
ELDBUS_PROXY_EVENT_PROPERTY_REMOVED
|
||||
ELDBUS_PROXY_EVENT_DEL
|
||||
|
||||
|
||||
cdef class Proxy(object):
|
||||
|
||||
cdef Eldbus_Proxy *proxy
|
||||
|
||||
def __init__(self, Object eldbus_object not None, interface):
|
||||
"""
|
||||
|
||||
Get a proxy of the following interface name in a Eldbus_Object.
|
||||
|
||||
"""
|
||||
self.proxy = eldbus_proxy_get(edbus_object.obj, const_char *interface) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
def ref(self):
|
||||
"""
|
||||
|
||||
Increase proxy reference.
|
||||
|
||||
"""
|
||||
# NOTE: Returns Eldbus_Proxy *
|
||||
eldbus_proxy_ref(self.proxy)
|
||||
return self
|
||||
|
||||
def unref(self):
|
||||
"""
|
||||
|
||||
Decrease proxy reference.
|
||||
If reference == 0 proxy will be freed and all your children.
|
||||
|
||||
"""
|
||||
void eldbus_proxy_unref(self.proxy) EINA_ARG_NONNULL(1)
|
||||
|
||||
property object:
|
||||
def __get__(self):
|
||||
Eldbus_Object *eldbus_proxy_object_get(const_Eldbus_Proxy *proxy) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
property interface:
|
||||
const_char *eldbus_proxy_interface_get(const Eldbus_Proxy *proxy) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
def data_set(self, key, data):
|
||||
void eldbus_proxy_data_set(self.proxy, const_char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3)
|
||||
|
||||
def data_get(self, key):
|
||||
void *eldbus_proxy_data_get(const_Eldbus_Proxy *proxy, const char *key) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def data_del(self, key):
|
||||
void *eldbus_proxy_data_del(self.proxy, const_char *key) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def free_cb_add(self, cb, cb_data):
|
||||
"""
|
||||
|
||||
Add a callback function to be called when occurs a event of the
|
||||
type passed.
|
||||
|
||||
"""
|
||||
eldbus_proxy_free_cb_add(self.proxy, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def free_cb_del(self, cb, cb_data):
|
||||
"""
|
||||
|
||||
Remove callback registered in eldbus_proxy_free_cb_add().
|
||||
|
||||
"""
|
||||
eldbus_proxy_free_cb_del(self.proxy, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def method_call_new(self, member):
|
||||
"""
|
||||
|
||||
Constructs a new message to invoke a method on a remote interface.
|
||||
|
||||
"""
|
||||
Eldbus_Message *eldbus_proxy_method_call_new(self.proxy, const_char *member) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
def send(self, msg, cb, cb_data, timeout):
|
||||
"""
|
||||
|
||||
Send a message.
|
||||
|
||||
:param msg: message that will be send
|
||||
:param cb: if msg is a method call a callback should be passed
|
||||
:param cb_data: data passed to callback
|
||||
:param timeout: timeout in milliseconds, -1 to default internal value or
|
||||
ELDBUS_TIMEOUT_INFINITE for no timeout
|
||||
|
||||
"""
|
||||
Eldbus_Pending *eldbus_proxy_send(self.proxy, Eldbus_Message *msg, EDBus_Message_Cb cb, const_void *cb_data, double timeout) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def call(self, member, cb, cb_data, timeout, signature, *args):
|
||||
"""
|
||||
|
||||
Call a method in proxy.
|
||||
Send a method call to interface that proxy belong with data.
|
||||
|
||||
:param member: method name
|
||||
:param cb: if msg is a method call a callback should be passed
|
||||
to be execute when response arrive
|
||||
:param cb_data: data passed to callback
|
||||
:param timeout: timeout in milliseconds, -1 to default internal value or
|
||||
ELDBUS_TIMEOUT_INFINITE for no timeout
|
||||
:param signature: of data that will be send
|
||||
@param ... data value
|
||||
|
||||
@note This function only support basic type to complex types use
|
||||
eldbus_message_iter_* functions.
|
||||
|
||||
"""
|
||||
Eldbus_Pending *eldbus_proxy_call(self.proxy, const_char *member, Eldbus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, ...) EINA_ARG_NONNULL(1, 2, 6)
|
||||
|
||||
def vcall(self, member, cb, cb_data, timeout, signature, ap):
|
||||
"""
|
||||
|
||||
Call a method in proxy.
|
||||
Send a method call to interface that proxy belong with data.
|
||||
|
||||
:param member: method name
|
||||
:param cb: callback that will be called when response arrive.
|
||||
:param cb_data: data passed to callback
|
||||
:param timeout: timeout in milliseconds, -1 to default internal value or
|
||||
ELDBUS_TIMEOUT_INFINITE for no timeout
|
||||
:param signature: of data that will be send
|
||||
:param ap: va_list of data value
|
||||
|
||||
@note This function only support basic type to complex types use
|
||||
eldbus_message_iter_* functions.
|
||||
|
||||
"""
|
||||
Eldbus_Pending *eldbus_proxy_vcall(self.proxy, const_char *member, Eldbus_Message_Cb cb, const void *cb_data, double timeout, const char *signature, va_list ap) EINA_ARG_NONNULL(1, 2, 6)
|
||||
|
||||
def signal_handler_add(self, member, cb, cb_data):
|
||||
"""
|
||||
|
||||
Add a signal handler.
|
||||
|
||||
:param proxy: interface where the signal is emitted
|
||||
:param member: name of the signal
|
||||
:param cb: callback that will be called when this signal is received
|
||||
:param cb_data: data that will be passed to callback
|
||||
|
||||
"""
|
||||
Eldbus_Signal_Handler *eldbus_proxy_signal_handler_add(self.proxy, const_char *member, Eldbus_Signal_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 3)
|
||||
|
||||
"""
|
||||
typedef struct _Eldbus_Proxy_Event_Property_Changed
|
||||
{
|
||||
const_char *name;
|
||||
const_Eldbus_Proxy *proxy;
|
||||
const_Eina_Value *value;
|
||||
} Eldbus_Proxy_Event_Property_Changed;
|
||||
|
||||
typedef struct _Eldbus_Proxy_Event_Property_Removed
|
||||
{
|
||||
const_char *interface;
|
||||
const_Eldbus_Proxy *proxy;
|
||||
const_char *name;
|
||||
} Eldbus_Proxy_Event_Property_Removed;
|
||||
|
||||
typedef void (*Eldbus_Proxy_Event_Cb)(void *data, Eldbus_Proxy *proxy, void *event_info);
|
||||
"""
|
||||
|
||||
def event_callback_add(self, event_type, cb, cb_data):
|
||||
"""
|
||||
|
||||
Add a callback function to be called when occurs a event of the
|
||||
type passed.
|
||||
|
||||
"""
|
||||
void eldbus_proxy_event_callback_add(self.proxy, Eldbus_Proxy_Event_Type type, Eldbus_Proxy_Event_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1, 3)
|
||||
|
||||
def event_callback_add(self, event_type, cb, cb_data):
|
||||
"""
|
||||
|
||||
Remove callback registered in eldbus_proxy_event_callback_add().
|
||||
|
||||
"""
|
||||
void eldbus_proxy_event_callback_del(self.proxy, Eldbus_Proxy_Event_Type type, Eldbus_Proxy_Event_Cb cb, const_void *cb_data) EINA_ARG_NONNULL(1, 3)
|
||||
|
||||
|
|
@ -1,266 +0,0 @@
|
|||
#define ELDBUS_METHOD_FLAG_DEPRECATED 1
|
||||
#define ELDBUS_METHOD_FLAG_NOREPLY (1 << 1)
|
||||
|
||||
#define ELDBUS_SIGNAL_FLAG_DEPRECATED 1
|
||||
|
||||
#define ELDBUS_PROPERTY_FLAG_DEPRECATED 1
|
||||
|
||||
typedef struct _Eldbus_Arg_Info
|
||||
{
|
||||
const_char *signature;
|
||||
const_char *name;
|
||||
} Eldbus_Arg_Info;
|
||||
|
||||
|
||||
"""
|
||||
|
||||
@brief Used to insert complete types to signature of methods or signals.
|
||||
|
||||
Example: ELDBUS_ARGS({"s", "interface"}, {"s", "property"})
|
||||
The signature will be "ss" and each string will have a tag name on
|
||||
introspect XML with the respective name.
|
||||
|
||||
"""
|
||||
#define ELDBUS_ARGS(args...) (const_Eldbus_Arg_Info[]){ args, { NULL, NULL } }
|
||||
|
||||
typedef struct _Eldbus_Service_Interface Eldbus_Service_Interface;
|
||||
typedef Eldbus_Message * (*Eldbus_Method_Cb)(self.iface, const_EDBus_Message *message);
|
||||
|
||||
|
||||
cdef Eina_Bool eldbus_property_get_cb(self.iface, const_char *propname, Eldbus_Message_Iter *iter, const Eldbus_Message *request_msg, EDBus_Message **error):
|
||||
"""
|
||||
|
||||
Callback function to append property value to message.
|
||||
|
||||
@param iface interface of property
|
||||
@param propname name of property
|
||||
@param iter variant iterator in which value must be appended
|
||||
@param request_msg message that request property
|
||||
@param error if a error happen you must set a message error to be send caller
|
||||
|
||||
@return EINA_TRUE if success
|
||||
|
||||
@note request_msg and error arguments are only different from NULL when a
|
||||
client request a property with Properties.Get or Properties.GetAll. Upon
|
||||
calls to eldbus_service_property_changed(), this callback will also be called.
|
||||
It's a mistake to return an error in this case because if a property changed,
|
||||
it must have a new value set and it should be able to be read.
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
cdef Eldbus_Message *eldbus_property_set_cb(self.iface, const_char *propname, Eldbus_Message_Iter *iter, const EDBus_Message *input_msg):
|
||||
"""
|
||||
|
||||
Callback function to set property value from message.
|
||||
|
||||
@param iface interface of property
|
||||
@param propname name of property
|
||||
@param input_msg message call where you have to get value
|
||||
|
||||
@return Message of response, could be a simple method_return, error or NULL to send response later.
|
||||
|
||||
"""
|
||||
pass
|
||||
|
||||
"""
|
||||
typedef struct _Eldbus_Method
|
||||
{
|
||||
const_char *member;
|
||||
const_Eldbus_Arg_Info *in;
|
||||
const_Eldbus_Arg_Info *out;
|
||||
Eldbus_Method_Cb cb;
|
||||
unsigned int flags;
|
||||
} Eldbus_Method;
|
||||
|
||||
typedef struct _Eldbus_Signal
|
||||
{
|
||||
const_char *name;
|
||||
const_Eldbus_Arg_Info *args;
|
||||
unsigned int flags;
|
||||
} Eldbus_Signal;
|
||||
|
||||
typedef struct _Eldbus_Property
|
||||
{
|
||||
const_char *name;
|
||||
const_char *type;
|
||||
Eldbus_Property_Get_Cb get_func;
|
||||
Eldbus_Property_Set_Cb set_func;
|
||||
unsigned int flags;
|
||||
} Eldbus_Property;
|
||||
|
||||
typedef struct _Eldbus_Service_Interface_Desc
|
||||
{
|
||||
const_char *interface; /**< interface name */
|
||||
const_Eldbus_Method *methods; /**< array of the methods that should be registered in this interface, the last item of array should be filled with NULL */
|
||||
const_Eldbus_Signal *signals; /**< array of signal that this interface send, the last item of array should be filled with NULL */
|
||||
const_Eldbus_Property *properties; /**< array of property that this interface have, the last item of array should be filled with NULL */
|
||||
const_Eldbus_Property_Get_Cb default_get; /**< default get function, if a property don't have a get function this will be used */
|
||||
const_Eldbus_Property_Set_Cb default_set; /**< default set function, if a property don't have a set function this will be used */
|
||||
} Eldbus_Service_Interface_Desc;
|
||||
"""
|
||||
|
||||
cdef class ServiceInterface(object):
|
||||
|
||||
cdef Eldbus_Service_Interface *iface
|
||||
|
||||
def __init__(self, conn, path, desc):
|
||||
"""
|
||||
|
||||
@brief Register an interface in the given path and connection.
|
||||
|
||||
@param conn where the interface should listen
|
||||
@param path object path
|
||||
@param desc description of interface
|
||||
|
||||
@return Interface
|
||||
|
||||
"""
|
||||
self.iface = eldbus_service_interface_register(Eldbus_Connection *conn, const_char *path, const Eldbus_Service_Interface_Desc *desc) EINA_ARG_NONNULL(1, 2, 3)
|
||||
|
||||
def unregister(self):
|
||||
"""
|
||||
|
||||
@brief Unregister a interface.
|
||||
If this is the last interface of the object path, the object path will be
|
||||
removed too.
|
||||
|
||||
"""
|
||||
void eldbus_service_interface_unregister(Eldbus_Service_Interface *iface) EINA_ARG_NONNULL(1)
|
||||
|
||||
def object_unregister(self):
|
||||
"""
|
||||
|
||||
@brief Unregister all interfaces of the object path that this interface belongs
|
||||
and the object path.
|
||||
|
||||
"""
|
||||
void eldbus_service_object_unregister(Eldbus_Service_Interface *iface) EINA_ARG_NONNULL(1)
|
||||
|
||||
property connection:
|
||||
def __get__(self):
|
||||
Eldbus_Connection *eldbus_service_connection_get(self.iface) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
property path:
|
||||
def __get__(self):
|
||||
const_char *eldbus_service_object_path_get(self.iface) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
def signal_emit(self, signal_id, *args):
|
||||
"""
|
||||
|
||||
@brief Emit a signal handler of the interface with non-complex types.
|
||||
Each signal handler have a internal id, the first signal handler of
|
||||
interface is = 0 the second = 1 and go on.
|
||||
|
||||
@param iface interface of the signal
|
||||
@param signal_id id of signal
|
||||
@param ... values that will be send on signal
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_service_signal_emit(self.iface, unsigned int signal_id, ...) EINA_ARG_NONNULL(1)
|
||||
|
||||
def signal_new(self, signal_id):
|
||||
"""
|
||||
|
||||
@brief Create signal message.
|
||||
Each signal handler have a internal id, the first signal handler of
|
||||
interface is = 0 the second = 1 and go on.
|
||||
This function is used when the signal has complex types.
|
||||
|
||||
@param iface interface of the signal
|
||||
@param signal_id id of signal
|
||||
|
||||
"""
|
||||
Eldbus_Message *eldbus_service_signal_new(self.iface, unsigned int signal_id) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
def signal_send(self, signal_msg):
|
||||
"""
|
||||
|
||||
@brief Send a signal message.
|
||||
|
||||
On success this will call eldbus_message_unref() on the @param signal_msg,
|
||||
which is the intended behavior in 99% of the cases. Remember to increment
|
||||
the refcount if you want to keep it alive.
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_service_signal_send(self.iface, Eldbus_Message *signal_msg) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def object_data_set(self, key, data):
|
||||
"""
|
||||
|
||||
@brief Store data at object path, this data can be obtained from all interfaces
|
||||
of the same object.
|
||||
|
||||
@param iface interface that belong to the object path where data will
|
||||
be stored
|
||||
@param key to identify data
|
||||
@param data
|
||||
|
||||
"""
|
||||
void eldbus_service_object_data_set(Eldbus_Service_Interface *iface, const_char *key, const void *data) EINA_ARG_NONNULL(1, 2, 3)
|
||||
|
||||
def object_data_get(self, key):
|
||||
"""
|
||||
|
||||
@brief Get data stored in object path.
|
||||
|
||||
@param iface interface that belongs to the object path where data are stored
|
||||
@param key that identify data
|
||||
|
||||
@return pointer to data if found otherwise NULL
|
||||
|
||||
"""
|
||||
void *eldbus_service_object_data_get(self.iface, const_char *key) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
def object_data_del(self, key):
|
||||
"""
|
||||
|
||||
@brief Del data stored in object path.
|
||||
|
||||
@param iface interface that belongs to the object path where data are stored
|
||||
@param key that identify data
|
||||
|
||||
@return pointer to data if found otherwise NULL
|
||||
|
||||
"""
|
||||
void *eldbus_service_object_data_del(Eldbus_Service_Interface *iface, const_char *key) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def property_changed(self, name):
|
||||
"""
|
||||
|
||||
@brief Add property to list of changed properties
|
||||
A DBus.PropertiesChanged signal will be sent in an idler with all properties
|
||||
that have changed.
|
||||
|
||||
@param iface Interface containing the changed property
|
||||
@param name Property name
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_service_property_changed(self.iface, const_char *name) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
|
||||
def property_invalidate_set(self, name, is_invalidate):
|
||||
Eina_Bool eldbus_service_property_invalidate_set(self.iface, const_char *name, Eina_Bool is_invalidate) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def object_manager_attach(self):
|
||||
"""
|
||||
|
||||
Attach ObjectManager interface.
|
||||
|
||||
@param iface ObjectManager will be attach in object path of this interface.
|
||||
@return EINA_TRUE if success
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_service_object_manager_attach(Eldbus_Service_Interface *iface) EINA_ARG_NONNULL(1)
|
||||
|
||||
def object_manager_detach(self):
|
||||
"""
|
||||
|
||||
Detach ObjectManager interface.
|
||||
|
||||
@param iface ObjectManager of object path of this interface will be detach.
|
||||
@return EINA_TRUE if success
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_service_object_manager_detach(Eldbus_Service_Interface *iface) EINA_ARG_NONNULL(1)
|
|
@ -1,130 +0,0 @@
|
|||
cdef class SignalHandler(object):
|
||||
|
||||
cdef Eldbus_Signal_Handler *handler
|
||||
|
||||
def __init__(self, Connection eldbus_conn not None, sender, path, interface, member, cb, cb_data):
|
||||
"""
|
||||
|
||||
Add a signal handler.
|
||||
|
||||
:param conn: connection where the signal is emitted
|
||||
:param sender: bus name or unique id of where the signal is emitted
|
||||
:param path: path of remote object
|
||||
:param interface: that signal belongs
|
||||
:param member: name of the signal
|
||||
:param cb: callback that will be called when this signal is received
|
||||
:param cb_data: data that will be passed to callback
|
||||
|
||||
"""
|
||||
self.handler = eldbus_signal_handler_add(edbus_conn.conn, const_char *sender, const char *path, const char *interface, const char *member, Eldbus_Signal_Cb cb, const void *cb_data) EINA_ARG_NONNULL(1, 6)
|
||||
|
||||
def ref(self):
|
||||
"""
|
||||
|
||||
Increase signal handler reference.
|
||||
|
||||
"""
|
||||
# NOTE: Returns Eldbus_Signal_Handler *
|
||||
eldbus_signal_handler_ref(self.handler)
|
||||
return self
|
||||
|
||||
def unref(self):
|
||||
"""
|
||||
|
||||
Decrease signal handler reference.
|
||||
If reference == 0 signal handler will be freed.
|
||||
|
||||
"""
|
||||
eldbus_signal_handler_unref(self.handler)
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
|
||||
Decrease signal handler reference like eldbus_signal_handler_unref()
|
||||
but if reference > 0 this signal handler will stop listening to signals. In other
|
||||
words it will be canceled but memory will not be freed.
|
||||
|
||||
"""
|
||||
eldbus_signal_handler_del(self.handler)
|
||||
|
||||
def match_extra_set(self, *args):
|
||||
"""
|
||||
|
||||
Add extra argument in match of signal handler to obtain specifics signals.
|
||||
|
||||
Example:
|
||||
eldbus_signal_handler_match_extra_set(sh, "arg0", "org.bansheeproject.Banshee", "arg1", "", NULL);
|
||||
With this extra arguments this signal handler callback only will be called
|
||||
when Banshee is started.
|
||||
|
||||
@note For now only argX is supported.
|
||||
|
||||
:param sh: signal handler
|
||||
:param ...: variadic of key and value and must be ended with a NULL
|
||||
|
||||
@note For more information:
|
||||
http://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_signal_handler_match_extra_set(self.handler, ...) EINA_ARG_NONNULL(1) EINA_SENTINEL
|
||||
|
||||
def match_extra_vset(self, ap):
|
||||
"""
|
||||
|
||||
Add extra argument in match of signal handler to obtain specifics signals.
|
||||
|
||||
Example:
|
||||
eldbus_signal_handler_match_extra_set(sh, "arg0", "org.bansheeproject.Banshee", "arg1", "", NULL);
|
||||
With this extra arguments this signal handler callback only will be called
|
||||
when Banshee is started.
|
||||
|
||||
@note For now is only supported argX.
|
||||
|
||||
:param sh: signal handler
|
||||
:param ap: va_list with the keys and values, must be ended with a NULL
|
||||
|
||||
@note To information:
|
||||
http://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules
|
||||
|
||||
"""
|
||||
Eina_Bool eldbus_signal_handler_match_extra_vset(self.handler, va_list ap) EINA_ARG_NONNULL(1)
|
||||
|
||||
def free_cb_add(self, cb, cb_data):
|
||||
"""
|
||||
|
||||
Add a callback function to be called when signal handler will be freed.
|
||||
|
||||
"""
|
||||
void eldbus_signal_handler_free_cb_add(self.handler, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
def free_cb_del(self, cb, cb_data):
|
||||
"""
|
||||
|
||||
Remove callback registered in eldbus_signal_handler_free_cb_add().
|
||||
|
||||
"""
|
||||
void eldbus_signal_handler_free_cb_del(self.handler, Eldbus_Free_Cb cb, const_void *data) EINA_ARG_NONNULL(1, 2)
|
||||
|
||||
property sender:
|
||||
def __get__(self):
|
||||
const_char *eldbus_signal_handler_sender_get(self.handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
property path:
|
||||
def __get__(self):
|
||||
const_char *eldbus_signal_handler_path_get(self.handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
property interface:
|
||||
def __get__(self):
|
||||
const_char *eldbus_signal_handler_interface_get(self.handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
property member:
|
||||
def __get__(self):
|
||||
const_char *eldbus_signal_handler_member_get(self.handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
property match:
|
||||
def __get__(self):
|
||||
const_char *eldbus_signal_handler_match_get(self.handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
||||
|
||||
property connection:
|
||||
def __get__(self):
|
||||
Eldbus_Connection *eldbus_signal_handler_connection_get(self.handler) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT
|
11
setup.py
11
setup.py
|
@ -155,15 +155,6 @@ if set(("build", "build_ext", "install", "bdist", "sdist")) & set(sys.argv):
|
|||
extra_link_args = emotion_libs + eina_libs + evas_libs)
|
||||
modules.append(emotion_ext)
|
||||
|
||||
# === Eldbus ===
|
||||
# eldbus_cflags, eldbus_libs = pkg_config('Eldbus', 'eldbus', "1.7.99")
|
||||
# pydbus_cflags, pydbus_libs = pkg_config('dbus-python', 'dbus-python')
|
||||
# eldbus_ext = Extension("eldbus", ["efl/eldbus/eldbus"+module_suffix],
|
||||
# include_dirs = ['include/'],
|
||||
# extra_compile_args = eldbus_cflags + pydbus_cflags + ecore_cflags,
|
||||
# extra_link_args = eldbus_libs)
|
||||
# modules.append(eldbus_ext)
|
||||
|
||||
# === dbus mainloop integration ===
|
||||
dbus_cflags, dbus_libs = pkg_config('DBus', 'dbus-python', "0.83.0")
|
||||
dbus_ml_ext = Extension("dbus_mainloop",
|
||||
|
@ -202,7 +193,7 @@ if set(("build", "build_ext", "install", "bdist", "sdist")) & set(sys.argv):
|
|||
"gengrid",
|
||||
"genlist",
|
||||
"gesture_layer",
|
||||
"glview",
|
||||
#"glview",
|
||||
"grid",
|
||||
"hover",
|
||||
"hoversel",
|
||||
|
|
Loading…
Reference in New Issue