static void parse_properties(GDBusClient *client, const char *path, const char *interface, DBusMessageIter *iter) { GDBusProxy *proxy; if (g_str_equal(interface, DBUS_INTERFACE_INTROSPECTABLE) == TRUE) return; if (g_str_equal(interface, DBUS_INTERFACE_PROPERTIES) == TRUE) return; proxy = proxy_lookup(client, path, interface); if (proxy) { update_properties(proxy, iter, FALSE); return; } proxy = proxy_new(client, path, interface); if (proxy == NULL) return; update_properties(proxy, iter, FALSE); if (client->proxy_added) client->proxy_added(proxy, client->user_data); client->proxy_list = g_list_append(client->proxy_list, proxy); }
static void constructed (GObject *object) { update_properties (NM_DEVICE (object)); G_OBJECT_CLASS (nm_device_macvlan_parent_class)->constructed (object); }
static void realize_start_notify (NMDevice *device, const NMPlatformLink *plink) { NM_DEVICE_CLASS (nm_device_ip_tunnel_parent_class)->realize_start_notify (device, plink); update_properties (device); }
static void get_all_properties_reply(DBusPendingCall *call, void *user_data) { GDBusProxy *proxy = user_data; GDBusClient *client = proxy->client; DBusMessage *reply = dbus_pending_call_steal_reply(call); DBusMessageIter iter; DBusError error; dbus_error_init(&error); if (dbus_set_error_from_message(&error, reply) == TRUE) { dbus_error_free(&error); goto done; } dbus_message_iter_init(reply, &iter); update_properties(proxy, &iter, FALSE); done: if (g_list_find(client->proxy_list, proxy) == NULL) { if (client->proxy_added) client->proxy_added(proxy, client->user_data); client->proxy_list = g_list_append(client->proxy_list, proxy); } dbus_message_unref(reply); g_dbus_client_unref(client); }
static void context_state_cb(pa_context *context, void *user_data) { struct audio_service *service = user_data; if (!service->context_initialized) { switch (pa_context_get_state(service->context)) { case PA_CONTEXT_CONNECTING: case PA_CONTEXT_AUTHORIZING: case PA_CONTEXT_SETTING_NAME: break; case PA_CONTEXT_READY: g_message("Successfully established connection to pulseaudio context"); service->context_initialized = true; break; case PA_CONTEXT_TERMINATED: g_warning("Connection of our context was terminated from pulseaudio"); break; case PA_CONTEXT_FAILED: g_warning("Failed to establish a connection to pulseaudio"); break; default: break; } if (service->context_initialized) { pa_context_set_subscribe_callback(service->context, context_subscribe_cb, service); pa_context_subscribe(service->context, PA_SUBSCRIPTION_MASK_CARD, NULL, service); update_properties(service); } } }
static void setup (NMDevice *device, NMPlatformLink *plink) { g_assert (plink->type == NM_LINK_TYPE_VXLAN); NM_DEVICE_CLASS (nm_device_vxlan_parent_class)->setup (device, plink); update_properties (device); }
static void realize_start_notify (NMDevice *device, const NMPlatformLink *plink) { g_assert (plink->type == NM_LINK_TYPE_VXLAN); NM_DEVICE_CLASS (nm_device_vxlan_parent_class)->realize_start_notify (device, plink); update_properties (device); }
void load_gauge(GtkWidget *dash, xmlNode *node) { xmlNode *cur_node = NULL; GtkWidget *gauge = NULL; gchar * filename = NULL; gint width = 0; gint height = 0; gint x_offset = 0; gint y_offset = 0; gchar *xml_name = NULL; gchar *datasource = NULL; if (!node->children) { printf("ERROR, load_gauge, xml node is empty!!\n"); return; } cur_node = node->children; while (cur_node->next) { if (cur_node->type == XML_ELEMENT_NODE) { if (g_strcasecmp((gchar *)cur_node->name,"width") == 0) generic_xml_gint_import(cur_node,&width); if (g_strcasecmp((gchar *)cur_node->name,"height") == 0) generic_xml_gint_import(cur_node,&height); if (g_strcasecmp((gchar *)cur_node->name,"x_offset") == 0) generic_xml_gint_import(cur_node,&x_offset); if (g_strcasecmp((gchar *)cur_node->name,"y_offset") == 0) generic_xml_gint_import(cur_node,&y_offset); if (g_strcasecmp((gchar *)cur_node->name,"gauge_xml_name") == 0) generic_xml_gchar_import(cur_node,&xml_name); if (g_strcasecmp((gchar *)cur_node->name,"datasource") == 0) generic_xml_gchar_import(cur_node,&datasource); } cur_node = cur_node->next; } if (xml_name && datasource) { gauge = mtx_gauge_face_new(); gtk_fixed_put(GTK_FIXED(dash),gauge,x_offset,y_offset); xml_name = g_strdelimit(xml_name,"\\",'/'); filename = get_file(g_build_filename(PSEP,GAUGES_DATA_DIR,xml_name,NULL),NULL); mtx_gauge_face_import_xml(MTX_GAUGE_FACE(gauge),filename); gtk_widget_set_usize(gauge,width,height); g_free(filename); OBJ_SET_FULL((gauge),"datasource",g_strdup(datasource),g_free); /* Cheat to get property window created... */ create_preview_list(NULL,NULL); update_properties(gauge,GAUGE_ADD); g_free(xml_name); g_free(datasource); gtk_widget_show_all(dash); } }
/** * update_nodes * * @param op * @param n */ static void update_nodes(unsigned int *op, unsigned int n) { unsigned int i, phandle; for (i = 0; i < n; i++) { phandle = *op++; say(DEBUG, "Update node with phandle %8.8x\n", phandle); update_properties(phandle); } }
static void context_subscribe_cb(pa_context *context, pa_subscription_event_type_t type, uint32_t idx, void *user_data) { struct audio_service *service = user_data; if ((type & PA_SUBSCRIPTION_EVENT_FACILITY_MASK) == PA_SUBSCRIPTION_EVENT_CARD && (type & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_CHANGE) { /* listen for card plug/unplug events */ /* FIXME */ } else if ((type & PA_SUBSCRIPTION_EVENT_TYPE_MASK) == PA_SUBSCRIPTION_EVENT_SINK) { update_properties(service); } }
static gboolean properties_changed(DBusConnection *conn, DBusMessage *msg, void *user_data) { GDBusProxy *proxy = user_data; GDBusClient *client = proxy->client; DBusMessageIter iter, entry; const char *interface; if (dbus_message_iter_init(msg, &iter) == FALSE) return TRUE; if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING) return TRUE; dbus_message_iter_get_basic(&iter, &interface); dbus_message_iter_next(&iter); update_properties(proxy, &iter, TRUE); dbus_message_iter_next(&iter); if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY) return TRUE; dbus_message_iter_recurse(&iter, &entry); while (dbus_message_iter_get_arg_type(&entry) == DBUS_TYPE_STRING) { const char *name; dbus_message_iter_get_basic(&entry, &name); g_hash_table_remove(proxy->prop_list, name); if (proxy->prop_func) proxy->prop_func(proxy, name, NULL, proxy->prop_data); if (client->property_changed) client->property_changed(proxy, name, NULL, client->user_data); dbus_message_iter_next(&entry); } return TRUE; }
void clear_dashboard(GtkWidget *widget) { GList *children = NULL; GtkFixedChild *child = NULL; gint i = 0; gint len = 0; children = g_list_copy(GTK_FIXED(widget)->children); len = g_list_length(children); for (i=0;i<len;i++) { child = g_list_nth_data(children,i); update_properties(child->widget,GAUGE_REMOVE); gtk_widget_destroy(child->widget); } g_list_free(children); }
static void notify_new_device_added (NMDevice *device, NMDevice *new_device) { NMDeviceMacvlan *self = NM_DEVICE_MACVLAN (device); NMDeviceMacvlanPrivate *priv = NM_DEVICE_MACVLAN_GET_PRIVATE (self); if (priv->parent) return; if (!nm_device_is_real (device)) return; update_properties (device); if ( priv->parent_ifindex <= 0 || nm_device_get_ifindex (new_device) != priv->parent_ifindex) return; priv->parent_ifindex = nm_device_get_ifindex (new_device); nm_device_macvlan_set_parent (self, new_device); }
static void link_changed (NMDevice *device, NMPlatformLink *info) { NM_DEVICE_CLASS (nm_device_macvlan_parent_class)->link_changed (device, info); update_properties (device); }