Lines Matching refs:device

59 	HalDevice *device = HAL_DEVICE (obj);  in hal_device_finalize()  local
61 runner_device_finalized (device); in hal_device_finalize()
65 printf ("************* in finalize for udi=%s\n", device->udi); in hal_device_finalize()
69 g_slist_foreach (device->properties, (GFunc) hal_property_free, NULL); in hal_device_finalize()
71 g_slist_free (device->properties); in hal_device_finalize()
73 g_free (device->udi); in hal_device_finalize()
135 hal_device_init (HalDevice *device) in hal_device_init() argument
139 device->udi = g_strdup_printf ("/org/freedesktop/Hal/devices/temp/%d", in hal_device_init()
141 device->num_addons = 0; in hal_device_init()
142 device->num_addons_ready = 0; in hal_device_init()
175 HalDevice *device; in hal_device_new() local
177 device = g_object_new (HAL_TYPE_DEVICE, NULL, NULL); in hal_device_new()
182 return device; in hal_device_new()
416 hal_device_get_udi (HalDevice *device) in hal_device_get_udi() argument
418 return device->udi; in hal_device_get_udi()
422 hal_device_set_udi (HalDevice *device, const char *udi) in hal_device_set_udi() argument
424 if (device->udi != NULL) in hal_device_set_udi()
425 g_free (device->udi); in hal_device_set_udi()
426 device->udi = g_strdup (udi); in hal_device_set_udi()
430 hal_device_add_capability (HalDevice *device, const char *capability) in hal_device_add_capability() argument
432 if (hal_device_property_strlist_add (device, "info.capabilities", capability)) in hal_device_add_capability()
433 g_signal_emit (device, signals[CAPABILITY_ADDED], 0, capability); in hal_device_add_capability()
437 hal_device_has_capability (HalDevice *device, const char *capability) in hal_device_has_capability() argument
443 caps = hal_device_property_get_strlist (device, "info.capabilities"); in hal_device_has_capability()
459 hal_device_has_property (HalDevice *device, const char *key) in hal_device_has_property() argument
461 g_return_val_if_fail (device != NULL, FALSE); in hal_device_has_property()
464 return hal_device_property_find (device, key) != NULL; in hal_device_has_property()
468 hal_device_num_properties (HalDevice *device) in hal_device_num_properties() argument
470 g_return_val_if_fail (device != NULL, -1); in hal_device_num_properties()
472 return g_slist_length (device->properties); in hal_device_num_properties()
476 hal_device_property_find (HalDevice *device, const char *key) in hal_device_property_find() argument
480 g_return_val_if_fail (device != NULL, NULL); in hal_device_property_find()
483 for (iter = device->properties; iter != NULL; iter = iter->next) { in hal_device_property_find()
494 hal_device_property_to_string (HalDevice *device, const char *key) in hal_device_property_to_string() argument
498 prop = hal_device_property_find (device, key); in hal_device_property_to_string()
506 hal_device_property_foreach (HalDevice *device, in hal_device_property_foreach() argument
512 g_return_if_fail (device != NULL); in hal_device_property_foreach()
515 for (iter = device->properties; iter != NULL; iter = iter->next) { in hal_device_property_foreach()
519 cont = callback (device, p, user_data); in hal_device_property_foreach()
527 hal_device_property_get_type (HalDevice *device, const char *key) in hal_device_property_get_type() argument
531 g_return_val_if_fail (device != NULL, HAL_PROPERTY_TYPE_INVALID); in hal_device_property_get_type()
534 prop = hal_device_property_find (device, key); in hal_device_property_get_type()
543 hal_device_property_get_string (HalDevice *device, const char *key) in hal_device_property_get_string() argument
547 g_return_val_if_fail (device != NULL, NULL); in hal_device_property_get_string()
550 prop = hal_device_property_find (device, key); in hal_device_property_get_string()
559 hal_device_property_get_as_string (HalDevice *device, const char *key, char *buf, size_t bufsize) in hal_device_property_get_as_string() argument
563 g_return_val_if_fail (device != NULL, NULL); in hal_device_property_get_as_string()
567 prop = hal_device_property_find (device, key); in hal_device_property_get_as_string()
623 hal_device_property_get_int (HalDevice *device, const char *key) in hal_device_property_get_int() argument
627 g_return_val_if_fail (device != NULL, -1); in hal_device_property_get_int()
630 prop = hal_device_property_find (device, key); in hal_device_property_get_int()
639 hal_device_property_get_uint64 (HalDevice *device, const char *key) in hal_device_property_get_uint64() argument
643 g_return_val_if_fail (device != NULL, -1); in hal_device_property_get_uint64()
646 prop = hal_device_property_find (device, key); in hal_device_property_get_uint64()
655 hal_device_property_get_bool (HalDevice *device, const char *key) in hal_device_property_get_bool() argument
659 g_return_val_if_fail (device != NULL, FALSE); in hal_device_property_get_bool()
662 prop = hal_device_property_find (device, key); in hal_device_property_get_bool()
671 hal_device_property_get_double (HalDevice *device, const char *key) in hal_device_property_get_double() argument
675 g_return_val_if_fail (device != NULL, -1.0); in hal_device_property_get_double()
678 prop = hal_device_property_find (device, key); in hal_device_property_get_double()
687 hal_device_property_set_string (HalDevice *device, const char *key, in hal_device_property_set_string() argument
693 prop = hal_device_property_find (device, key); in hal_device_property_set_string()
706 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_set_string()
713 device->properties = g_slist_prepend (device->properties, prop); in hal_device_property_set_string()
715 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_set_string()
723 hal_device_property_set_int (HalDevice *device, const char *key, in hal_device_property_set_int() argument
729 prop = hal_device_property_find (device, key); in hal_device_property_set_int()
741 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_set_int()
747 device->properties = g_slist_prepend (device->properties, prop); in hal_device_property_set_int()
749 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_set_int()
757 hal_device_property_set_uint64 (HalDevice *device, const char *key, in hal_device_property_set_uint64() argument
763 prop = hal_device_property_find (device, key); in hal_device_property_set_uint64()
775 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_set_uint64()
781 device->properties = g_slist_prepend (device->properties, prop); in hal_device_property_set_uint64()
783 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_set_uint64()
791 hal_device_property_set_bool (HalDevice *device, const char *key, in hal_device_property_set_bool() argument
797 prop = hal_device_property_find (device, key); in hal_device_property_set_bool()
809 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_set_bool()
815 device->properties = g_slist_prepend (device->properties, prop); in hal_device_property_set_bool()
817 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_set_bool()
825 hal_device_property_set_double (HalDevice *device, const char *key, in hal_device_property_set_double() argument
831 prop = hal_device_property_find (device, key); in hal_device_property_set_double()
843 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_set_double()
849 device->properties = g_slist_prepend (device->properties, prop); in hal_device_property_set_double()
851 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_set_double()
894 hal_device_property_remove (HalDevice *device, const char *key) in hal_device_property_remove() argument
898 prop = hal_device_property_find (device, key); in hal_device_property_remove()
903 device->properties = g_slist_remove (device->properties, prop); in hal_device_property_remove()
907 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_remove()
914 hal_device_property_set_attribute (HalDevice *device, in hal_device_property_set_attribute() argument
921 prop = hal_device_property_find (device, key); in hal_device_property_set_attribute()
930 hal_device_print (HalDevice *device) in hal_device_print() argument
934 fprintf (stderr, "device udi = %s\n", hal_device_get_udi (device)); in hal_device_print()
936 for (iter = device->properties; iter != NULL; iter = iter->next) { in hal_device_print()
984 HalDevice *device; member
996 g_signal_handler_disconnect (ai->device, ai->prop_signal_id); in destroy_async_match_info()
998 g_object_unref (ai->device); in destroy_async_match_info()
1003 prop_changed_cb (HalDevice *device, const char *key, in prop_changed_cb() argument
1016 ai->callback (ai->device, ai->user_data, TRUE); in prop_changed_cb()
1028 ai->callback (ai->device, ai->user_data, FALSE); in async_wait_timeout()
1036 hal_device_async_wait_property (HalDevice *device, in hal_device_async_wait_property() argument
1046 prop = hal_device_property_find (device, key); in hal_device_async_wait_property()
1049 callback (device, user_data, prop != NULL); in hal_device_async_wait_property()
1055 ai->device = g_object_ref (device); in hal_device_async_wait_property()
1060 ai->prop_signal_id = g_signal_connect (device, "property_changed", in hal_device_async_wait_property()
1068 hal_device_callouts_finished (HalDevice *device) in hal_device_callouts_finished() argument
1070 g_signal_emit (device, signals[CALLOUTS_FINISHED], 0); in hal_device_callouts_finished()
1076 hal_device_cancel (HalDevice *device) in hal_device_cancel() argument
1078 HAL_INFO (("udi=%s", device->udi)); in hal_device_cancel()
1079 g_signal_emit (device, signals[CANCELLED], 0); in hal_device_cancel()
1086 hal_device_property_get_strlist (HalDevice *device, in hal_device_property_get_strlist() argument
1091 g_return_val_if_fail (device != NULL, NULL); in hal_device_property_get_strlist()
1094 prop = hal_device_property_find (device, key); in hal_device_property_get_strlist()
1103 hal_device_property_get_strlist_elem (HalDevice *device, in hal_device_property_get_strlist_elem() argument
1110 strlist = hal_device_property_get_strlist (device, key); in hal_device_property_get_strlist_elem()
1122 hal_device_property_strlist_append (HalDevice *device, in hal_device_property_strlist_append() argument
1129 prop = hal_device_property_find (device, key); in hal_device_property_strlist_append()
1137 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_strlist_append()
1144 device->properties = g_slist_prepend (device->properties, prop); in hal_device_property_strlist_append()
1146 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_strlist_append()
1154 hal_device_property_strlist_prepend (HalDevice *device, in hal_device_property_strlist_prepend() argument
1161 prop = hal_device_property_find (device, key); in hal_device_property_strlist_prepend()
1169 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_strlist_prepend()
1176 device->properties = g_slist_prepend (device->properties, prop); in hal_device_property_strlist_prepend()
1178 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_strlist_prepend()
1186 hal_device_property_strlist_remove_elem (HalDevice *device, in hal_device_property_strlist_remove_elem() argument
1193 prop = hal_device_property_find (device, key); in hal_device_property_strlist_remove_elem()
1202 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_strlist_remove_elem()
1211 hal_device_property_strlist_clear (HalDevice *device, in hal_device_property_strlist_clear() argument
1217 prop = hal_device_property_find (device, key); in hal_device_property_strlist_clear()
1222 device->properties = g_slist_prepend (device->properties, prop); in hal_device_property_strlist_clear()
1224 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_strlist_clear()
1234 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_strlist_clear()
1244 hal_device_property_strlist_add (HalDevice *device, in hal_device_property_strlist_add() argument
1254 prop = hal_device_property_find (device, key); in hal_device_property_strlist_add()
1262 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_strlist_add()
1270 device->properties = g_slist_prepend (device->properties, prop); in hal_device_property_strlist_add()
1272 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_strlist_add()
1283 hal_device_property_strlist_remove (HalDevice *device, in hal_device_property_strlist_remove() argument
1290 prop = hal_device_property_find (device, key); in hal_device_property_strlist_remove()
1299 g_signal_emit (device, signals[PROPERTY_CHANGED], 0, in hal_device_property_strlist_remove()
1307 hal_device_property_strlist_is_empty (HalDevice *device, in hal_device_property_strlist_is_empty() argument
1312 if ( hal_device_has_property (device, key)) { in hal_device_property_strlist_is_empty()
1313 strlist = hal_device_property_get_strlist (device, key); in hal_device_property_strlist_is_empty()
1326 hal_device_inc_num_addons (HalDevice *device) in hal_device_inc_num_addons() argument
1328 device->num_addons++; in hal_device_inc_num_addons()
1332 hal_device_inc_num_ready_addons (HalDevice *device) in hal_device_inc_num_ready_addons() argument
1334 if (hal_device_are_all_addons_ready (device)) { in hal_device_inc_num_ready_addons()
1336 device->udi)); in hal_device_inc_num_ready_addons()
1340 device->num_addons_ready++; in hal_device_inc_num_ready_addons()
1345 hal_device_are_all_addons_ready (HalDevice *device) in hal_device_are_all_addons_ready() argument
1347 if (device->num_addons_ready == device->num_addons) { in hal_device_are_all_addons_ready()