flatpak: add flatpak module

Pass LoopUtils to callbacks to make it easier to reschedule timeouts.
This commit is contained in:
Wim Taymans 2017-04-17 16:32:25 +02:00
parent a5b39019d1
commit be528ba7c2
17 changed files with 826 additions and 259 deletions

View file

@ -38,10 +38,10 @@ typedef struct _PinosAccessData PinosAccessData;
struct _PinosAccessData {
SpaResult res;
PinosResource *resource;
void *(*async_copy) (PinosAccessData *data, size_t size);
void * (*async_copy) (PinosAccessData *data, size_t size);
void (*complete_cb) (PinosAccessData *data);
void (*free_cb) (PinosAccessData *data);
void *user_data;
void * user_data;
};

View file

@ -102,6 +102,7 @@ pinos_client_new (PinosCore *core,
this->properties = properties;
spa_list_init (&this->resource_list);
pinos_signal_init (&this->properties_changed);
pinos_signal_init (&this->resource_added);
pinos_signal_init (&this->resource_removed);
@ -185,6 +186,8 @@ pinos_client_update_properties (PinosClient *client,
client->info.change_mask = 1 << 0;
client->info.props = client->properties ? &client->properties->dict : NULL;
pinos_signal_emit (&client->properties_changed, client);
spa_list_for_each (resource, &client->resource_list, link) {
pinos_client_notify_info (resource, &client->info);
}

View file

@ -46,6 +46,9 @@ struct _PinosClient {
PinosGlobal *global;
PinosProperties *properties;
PINOS_SIGNAL (properties_changed, (PinosListener *listener,
PinosClient *client));
PinosClientInfo info;
bool ucred_valid;
struct ucred ucred;

View file

@ -111,8 +111,9 @@ do_loop (void *user_data)
static void
do_stop (SpaSource *source,
void *data)
do_stop (SpaLoopUtils *utils,
SpaSource *source,
void *data)
{
PinosDataLoopImpl *impl = data;
impl->running = false;

View file

@ -48,8 +48,9 @@ typedef struct
static void
process_work_queue (SpaSource *source,
void *data)
process_work_queue (SpaLoopUtils *utils,
SpaSource *source,
void *data)
{
PinosWorkQueueImpl *impl = data;
PinosWorkQueue *this = &impl->this;