Lines Matching defs:ctx
287 * @ctx: the context for the connection to hald
295 libhal_ctx_set_user_data(LibHalContext *ctx, void *user_data)
297 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
298 ctx->user_data = user_data;
304 * @ctx: the context for the connection to hald
311 libhal_ctx_get_user_data(LibHalContext *ctx)
313 LIBHAL_CHECK_LIBHALCONTEXT(ctx, NULL);
314 return ctx->user_data;
413 * @ctx: the context for the connection to hald
422 libhal_device_get_all_properties (LibHalContext *ctx, const char *udi, DBusError *error)
432 LIBHAL_CHECK_LIBHALCONTEXT(ctx, NULL);
447 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
952 LibHalContext *ctx = (LibHalContext *) user_data;
954 if (ctx->is_shutdown)
974 if (ctx->device_added != NULL) {
975 ctx->device_added (ctx, udi);
986 if (ctx->device_removed != NULL) {
987 ctx->device_removed (ctx, udi);
1000 if (ctx->device_new_capability != NULL) {
1001 ctx->device_new_capability (ctx, udi, capability);
1014 if (ctx->device_condition != NULL) {
1015 ctx->device_condition (ctx, object_path, condition_name, condition_detail);
1022 if (ctx->device_property_modified != NULL) {
1048 ctx->device_property_modified (ctx,
1069 * @ctx: the context for the connection to hald
1080 libhal_get_all_devices (LibHalContext *ctx, int *num_devices, DBusError *error)
1088 LIBHAL_CHECK_LIBHALCONTEXT(ctx, NULL);
1102 reply = dbus_connection_send_with_reply_and_block (ctx->connection, message, -1, &_error);
1133 * @ctx: the context for the connection to hald
1144 libhal_device_get_property_type (LibHalContext *ctx, const char *udi, const char *key, DBusError *error)
1152 LIBHAL_CHECK_LIBHALCONTEXT(ctx, LIBHAL_PROPERTY_TYPE_INVALID); /* or return NULL? */
1168 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
1191 * @ctx: the context for the connection to hald
1204 libhal_device_get_property_strlist (LibHalContext *ctx, const char *udi, const char *key, DBusError *error)
1212 LIBHAL_CHECK_LIBHALCONTEXT(ctx, NULL);
1230 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
1262 * @ctx: the context for the connection to hald
1274 libhal_device_get_property_string (LibHalContext *ctx,
1284 LIBHAL_CHECK_LIBHALCONTEXT(ctx, NULL);
1303 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
1339 * @ctx: the context for the connection to hald
1349 libhal_device_get_property_int (LibHalContext *ctx,
1358 LIBHAL_CHECK_LIBHALCONTEXT(ctx, -1);
1376 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
1410 * @ctx: the context for the connection to hald
1420 libhal_device_get_property_uint64 (LibHalContext *ctx,
1429 LIBHAL_CHECK_LIBHALCONTEXT(ctx, -1);
1447 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
1480 * @ctx: the context for the connection to hald
1490 libhal_device_get_property_double (LibHalContext *ctx,
1499 LIBHAL_CHECK_LIBHALCONTEXT(ctx, -1.0);
1517 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
1550 * @ctx: the context for the connection to hald
1560 libhal_device_get_property_bool (LibHalContext *ctx,
1569 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
1587 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
1621 libhal_device_set_property_helper (LibHalContext *ctx,
1637 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
1696 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
1716 * @ctx: the context for the connection to hald
1728 libhal_device_set_property_string (LibHalContext *ctx,
1734 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
1739 return libhal_device_set_property_helper (ctx, udi, key,
1746 * @ctx: the context for the connection to hald
1758 libhal_device_set_property_int (LibHalContext *ctx, const char *udi,
1761 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
1765 return libhal_device_set_property_helper (ctx, udi, key,
1772 * @ctx: the context for the connection to hald
1784 libhal_device_set_property_uint64 (LibHalContext *ctx, const char *udi,
1787 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
1791 return libhal_device_set_property_helper (ctx, udi, key,
1798 * @ctx: the context for the connection to hald
1810 libhal_device_set_property_double (LibHalContext *ctx, const char *udi,
1813 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
1817 return libhal_device_set_property_helper (ctx, udi, key,
1824 * @ctx: the context for the connection to hald
1836 libhal_device_set_property_bool (LibHalContext *ctx, const char *udi,
1839 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
1843 return libhal_device_set_property_helper (ctx, udi, key,
1851 * @ctx: the context for the connection to hald
1862 libhal_device_remove_property (LibHalContext *ctx,
1865 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
1869 return libhal_device_set_property_helper (ctx, udi, key, DBUS_TYPE_INVALID,
1876 * @ctx: the context for the connection to hald
1888 libhal_device_property_strlist_append (LibHalContext *ctx,
1898 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
1916 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
1935 * @ctx: the context for the connection to hald
1947 libhal_device_property_strlist_prepend (LibHalContext *ctx,
1957 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
1975 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
1994 * @ctx: the context for the connection to hald
2006 libhal_device_property_strlist_remove_index (LibHalContext *ctx,
2016 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
2033 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
2052 * @ctx: the context for the connection to hald
2064 libhal_device_property_strlist_remove (LibHalContext *ctx,
2073 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
2091 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
2111 * @ctx: the context for the connection to hald
2122 libhal_device_lock (LibHalContext *ctx,
2131 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
2153 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
2183 * @ctx: the context for the connection to hald
2193 libhal_device_unlock (LibHalContext *ctx,
2199 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
2215 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
2235 * @ctx: the context for the connection to hald
2247 libhal_new_device (LibHalContext *ctx, DBusError *error)
2255 LIBHAL_CHECK_LIBHALCONTEXT(ctx, NULL);
2269 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
2307 * @ctx: the context for the connection to hald
2326 libhal_device_commit_to_gdl (LibHalContext *ctx,
2333 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
2353 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
2372 * @ctx: the context for the connection to hald
2386 libhal_remove_device (LibHalContext *ctx, const char *udi, DBusError *error)
2392 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
2410 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
2429 * @ctx: the context for the connection to hald
2438 libhal_device_exists (LibHalContext *ctx, const char *udi, DBusError *error)
2446 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
2464 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
2497 * @ctx: the context for the connection to hald
2507 libhal_device_property_exists (LibHalContext *ctx,
2516 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
2534 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
2566 * @ctx: the context for the connection to hald
2576 libhal_merge_properties (LibHalContext *ctx,
2583 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
2603 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
2622 * @ctx: the context for the connection to hald
2642 libhal_device_matches (LibHalContext *ctx,
2652 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
2674 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
2706 * @ctx: the context for the connection to hald
2715 libhal_device_print (LibHalContext *ctx, const char *udi, DBusError *error)
2722 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
2727 if ((pset = libhal_device_get_all_properties (ctx, udi, error)) == NULL)
2788 * @ctx: the context for the connection to hald
2800 libhal_manager_find_device_string_match (LibHalContext *ctx,
2810 LIBHAL_CHECK_LIBHALCONTEXT(ctx, NULL);
2830 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
2862 * @ctx: the context for the connection to hald
2872 libhal_device_add_capability (LibHalContext *ctx,
2879 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
2897 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
2916 * @ctx: the context for the connection to hald
2927 libhal_device_query_capability (LibHalContext *ctx, const char *udi, const char *capability, DBusError *error)
2933 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
2939 caps = libhal_device_get_property_strlist (ctx, udi, "info.capabilities", error);
2955 * @ctx: the context for the connection to hald
2965 libhal_find_device_by_capability (LibHalContext *ctx,
2974 LIBHAL_CHECK_LIBHALCONTEXT(ctx, NULL);
2992 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
3023 * @ctx: the context for the connection to hald
3032 libhal_device_property_watch_all (LibHalContext *ctx, DBusError *error)
3034 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3036 dbus_bus_add_match (ctx->connection,
3049 * @ctx: the context for the connection to hald
3062 libhal_device_add_property_watch (LibHalContext *ctx, const char *udi, DBusError *error)
3066 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3074 dbus_bus_add_match (ctx->connection, buf, error);
3084 * @ctx: the context for the connection to hald
3093 libhal_device_remove_property_watch (LibHalContext *ctx, const char *udi, DBusError *error)
3097 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3105 dbus_bus_remove_match (ctx->connection, buf, error);
3123 LibHalContext *ctx;
3132 ctx = calloc (1, sizeof (LibHalContext));
3133 if (ctx == NULL) {
3140 ctx->is_initialized = FALSE;
3141 ctx->is_shutdown = FALSE;
3142 ctx->connection = NULL;
3143 ctx->is_direct = FALSE;
3145 return ctx;
3150 * @ctx: context to enable/disable cache for
3159 libhal_ctx_set_cache (LibHalContext *ctx, dbus_bool_t use_cache)
3161 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3163 ctx->cache_enabled = use_cache;
3169 * @ctx: context to set connection for
3177 libhal_ctx_set_dbus_connection (LibHalContext *ctx, DBusConnection *conn)
3179 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3184 ctx->connection = conn;
3190 * @ctx: context to get connection for
3197 libhal_ctx_get_dbus_connection (LibHalContext *ctx)
3199 LIBHAL_CHECK_LIBHALCONTEXT(ctx, NULL);
3201 return ctx->connection;
3207 * @ctx: Context for connection to hald (D-BUS connection should be set with libhal_ctx_set_dbus_connection)
3215 libhal_ctx_init (LibHalContext *ctx, DBusError *error)
3220 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3222 if (ctx->connection == NULL)
3226 hald_exists = dbus_bus_name_has_owner (ctx->connection, "org.freedesktop.Hal", &_error);
3237 if (!dbus_connection_add_filter (ctx->connection, filter_func, ctx, NULL)) {
3241 dbus_bus_add_match (ctx->connection,
3250 ctx->is_initialized = TRUE;
3251 ctx->is_direct = FALSE;
3268 LibHalContext *ctx;
3271 ctx = libhal_ctx_new ();
3272 if (ctx == NULL)
3276 libhal_ctx_free (ctx);
3277 ctx = NULL;
3282 ctx->connection = dbus_connection_open (hald_addr, &_error);
3285 libhal_ctx_free (ctx);
3286 ctx = NULL;
3290 ctx->is_initialized = TRUE;
3291 ctx->is_direct = TRUE;
3294 return ctx;
3299 * @ctx: the context for the connection to hald
3307 libhal_ctx_shutdown (LibHalContext *ctx, DBusError *error)
3311 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3313 if (ctx->is_direct) {
3315 /*dbus_connection_unref (ctx->connection);*/
3318 dbus_bus_remove_match (ctx->connection,
3332 dbus_connection_remove_filter (ctx->connection, filter_func, ctx);
3335 ctx->is_initialized = FALSE;
3342 * @ctx: pointer to a LibHalContext
3349 libhal_ctx_free (LibHalContext *ctx)
3351 free (ctx);
3357 * @ctx: the context for the connection to hald
3365 libhal_ctx_set_device_added (LibHalContext *ctx, LibHalDeviceAdded callback)
3367 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3369 ctx->device_added = callback;
3375 * @ctx: the context for the connection to hald
3383 libhal_ctx_set_device_removed (LibHalContext *ctx, LibHalDeviceRemoved callback)
3385 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3387 ctx->device_removed = callback;
3393 * @ctx: the context for the connection to hald
3401 libhal_ctx_set_device_new_capability (LibHalContext *ctx, LibHalDeviceNewCapability callback)
3403 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3405 ctx->device_new_capability = callback;
3411 * @ctx: the context for the connection to hald
3419 libhal_ctx_set_device_lost_capability (LibHalContext *ctx, LibHalDeviceLostCapability callback)
3421 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3423 ctx->device_lost_capability = callback;
3429 * @ctx: the context for the connection to hald
3437 libhal_ctx_set_device_property_modified (LibHalContext *ctx, LibHalDevicePropertyModified callback)
3439 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3441 ctx->device_property_modified = callback;
3447 * @ctx: the context for the connection to hald
3455 libhal_ctx_set_device_condition (LibHalContext *ctx, LibHalDeviceCondition callback)
3457 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3459 ctx->device_condition = callback;
3488 * @ctx: the context for the connection to hald
3497 libhal_device_rescan (LibHalContext *ctx, const char *udi, DBusError *error)
3504 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3518 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
3545 * @ctx: the context for the connection to hald
3554 libhal_device_reprobe (LibHalContext *ctx, const char *udi, DBusError *error)
3561 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3576 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
3603 * @ctx: the context for the connection to hald
3614 dbus_bool_t libhal_device_emit_condition (LibHalContext *ctx,
3626 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3647 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
3685 * @ctx: the context for the connection to hald
3697 libhal_device_addon_is_ready (LibHalContext *ctx, const char *udi, DBusError *error)
3705 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3722 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
3747 * @ctx: the context for the connection to hald
3760 libhal_device_claim_interface (LibHalContext *ctx,
3772 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
3792 reply = dbus_connection_send_with_reply_and_block (ctx->connection,
4153 * @ctx: the context for the connection to hald
4162 libhal_device_commit_changeset (LibHalContext *ctx, LibHalChangeSet *changeset, DBusError *error)
4175 LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
4257 reply = dbus_connection_send_with_reply_and_block (ctx->connection,