Use interfaces

Add interfaces and events on objects. Use this to communicate with the
objects and transparently convert/marshall to network in the protocols.
This commit is contained in:
Wim Taymans 2017-03-02 16:06:45 +01:00
parent 9b7debbfd3
commit e0813b679d
16 changed files with 1307 additions and 822 deletions

View file

@ -37,11 +37,6 @@ typedef struct _PinosResource PinosResource;
typedef void (*PinosDestroy) (void *object);
typedef SpaResult (*PinosDispatchFunc) (void *object,
uint32_t opcode,
void *message,
void *data);
struct _PinosResource {
PinosCore *core;
SpaList link;
@ -53,6 +48,10 @@ struct _PinosResource {
void *object;
PinosDestroy destroy;
const void *interface;
const void *event;
const void *marshall;
PINOS_SIGNAL (destroy_signal, (PinosListener *listener,
PinosResource *resource));
};
@ -64,14 +63,6 @@ PinosResource * pinos_resource_new (PinosClient *client,
PinosDestroy destroy);
void pinos_resource_destroy (PinosResource *resource);
void pinos_resource_set_dispatch (PinosResource *resource,
PinosDispatchFunc func,
void *data);
SpaResult pinos_resource_dispatch (PinosResource *resource,
uint32_t opcode,
void *message);
#ifdef __cplusplus
}
#endif