Esempio n. 1
0
void
um_realm_manager_new (GCancellable *cancellable,
                      GAsyncReadyCallback callback,
                      gpointer user_data)
{
        GSimpleAsyncResult *async;
        NewClosure *closure;

        g_debug ("Connecting to realmd...");

        async = g_simple_async_result_new (NULL, callback, user_data,
                                           um_realm_manager_new);
        closure = g_slice_new (NewClosure);
        closure->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
        g_simple_async_result_set_op_res_gpointer (async, closure, new_closure_free);

        g_async_initable_new_async (UM_TYPE_REALM_MANAGER, G_PRIORITY_DEFAULT,
                                    cancellable, on_manager_new, g_object_ref (async),
                                    "flags", G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_NONE,
                                    "name", "org.freedesktop.realmd",
                                    "bus-type", G_BUS_TYPE_SYSTEM,
                                    "object-path", "/org/freedesktop/realmd",
                                    "get-proxy-type-func", um_realm_object_manager_client_get_proxy_type,
                                    NULL);

        g_object_unref (async);
}
static void
on_connection_future_ensure_sidecar_returned (GObject *source_object,
    GAsyncResult *result,
    gpointer user_data)
{
  GSimpleAsyncResult *res = G_SIMPLE_ASYNC_RESULT (user_data);
  gchar *object_path;
  GError *error = NULL;

  g_return_if_fail (TP_IS_CONNECTION (source_object));

  object_path = _tp_yts_connection_future_ensure_sidecar_finish (
      TP_CONNECTION (source_object), result, NULL, &error);

  if (error != NULL)
    {
      g_simple_async_result_set_from_error (res, error);
      g_clear_error (&error);
      g_simple_async_result_complete_in_idle (res);
      g_object_unref (res);
      return;
    }

  g_async_initable_new_async (TP_TYPE_YTS_STATUS, G_PRIORITY_DEFAULT, NULL,
      on_status_new_returned, res,
      "dbus-daemon", tp_proxy_get_dbus_daemon (source_object),
      "dbus-connection", tp_proxy_get_dbus_connection (source_object),
      "bus-name", tp_proxy_get_bus_name (source_object),
      "object-path", object_path,
      NULL);

  g_free (object_path);
}
void
_nm_dbus_new_proxy_for_connection_async (GDBusConnection *connection,
                                         const char *path,
                                         const char *interface,
                                         GCancellable *cancellable,
                                         GAsyncReadyCallback callback,
                                         gpointer user_data)
{
	GType proxy_type;
	const char *name;

	proxy_type = GPOINTER_TO_SIZE (g_hash_table_lookup (proxy_types, interface));
	if (!proxy_type)
		proxy_type = G_TYPE_DBUS_PROXY;

	if (_nm_dbus_is_connection_private (connection))
		name = NULL;
	else
		name = NM_DBUS_SERVICE;

	g_async_initable_new_async (proxy_type, G_PRIORITY_DEFAULT,
	                            cancellable, callback, user_data,
	                            "g-connection", connection,
	                            "g-flags", NM_DBUS_PROXY_FLAGS,
	                            "g-name", name,
	                            "g-object-path", path,
	                            "g-interface-name", interface,
	                            NULL);
}
static void
create_sms_ready (MMModemMessaging *self,
                  GAsyncResult *res,
                  CreateSmsContext *ctx)
{
    GError *error = NULL;
    gchar *sms_path = NULL;

    if (!mm_gdbus_modem_messaging_call_create_finish (MM_GDBUS_MODEM_MESSAGING (self),
                                                      &sms_path,
                                                      res,
                                                      &error)) {
        g_simple_async_result_take_error (ctx->result, error);
        create_sms_context_complete_and_free (ctx);
        g_free (sms_path);
        return;
    }

    g_async_initable_new_async (MM_TYPE_SMS,
                                G_PRIORITY_DEFAULT,
                                ctx->cancellable,
                                (GAsyncReadyCallback)new_sms_object_ready,
                                ctx,
                                "g-flags",          G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
                                "g-name",           MM_DBUS_SERVICE,
                                "g-connection",     g_dbus_proxy_get_connection (G_DBUS_PROXY (self)),
                                "g-object-path",    sms_path,
                                "g-interface-name", "org.freedesktop.ModemManager1.Sms",
                                NULL);
    g_free (sms_path);
}
Esempio n. 5
0
void
hev_iobj_new_async (GCancellable *cancellable,
			GAsyncReadyCallback callback, gpointer user_data)
{
	g_debug ("%s:%d[%s]", __FILE__, __LINE__, __FUNCTION__);

	g_async_initable_new_async (HEV_TYPE_IOBJ, G_PRIORITY_DEFAULT,
				cancellable, callback, user_data, NULL);
}
void hev_serial_port_new_async(const gchar *path,
			GCancellable *cancellable, GAsyncReadyCallback callback,
			gpointer user_data)
{
	g_debug("%s:%d[%s]", __FILE__, __LINE__, __FUNCTION__);

	g_async_initable_new_async(HEV_TYPE_SERIAL_PORT, G_PRIORITY_DEFAULT,
				cancellable, callback, user_data, "path", path, NULL);
}
Esempio n. 7
0
/**
 * goa_client_new:
 * @cancellable: A #GCancellable or %NULL.
 * @callback: Function that will be called when the result is ready.
 * @user_data: Data to pass to @callback.
 *
 * Asynchronously gets a #GoaClient. When the operation is
 * finished, @callback will be invoked in the <link
 * linkend="g-main-context-push-thread-default">thread-default main
 * loop</link> of the thread you are calling this method from.
 */
void
goa_client_new (GCancellable        *cancellable,
                   GAsyncReadyCallback  callback,
                   gpointer             user_data)
{
  g_async_initable_new_async (GOA_TYPE_CLIENT,
                              G_PRIORITY_DEFAULT,
                              cancellable,
                              callback,
                              user_data,
                              NULL);
}
void
empathy_server_tls_handler_new_async (TpChannel *channel,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data)
{
    g_assert (TP_IS_CHANNEL (channel));
    g_assert (channel != NULL);

    g_async_initable_new_async (EMPATHY_TYPE_SERVER_TLS_HANDLER,
                                G_PRIORITY_DEFAULT, NULL, callback, user_data,
                                "channel", channel, NULL);
}
Esempio n. 9
0
void
mm_sim_sierra_new (MMBaseModem *modem,
                   GCancellable *cancellable,
                   GAsyncReadyCallback callback,
                   gpointer user_data)
{
    g_async_initable_new_async (MM_TYPE_SIM_SIERRA,
                                G_PRIORITY_DEFAULT,
                                cancellable,
                                callback,
                                user_data,
                                MM_BASE_SIM_MODEM, modem,
                                NULL);
}
Esempio n. 10
0
void
mm_sim_novatel_lte_new (MMBaseModem *modem,
                        GCancellable *cancellable,
                        GAsyncReadyCallback callback,
                        gpointer user_data)
{
    g_async_initable_new_async (MM_TYPE_SIM_NOVATEL_LTE,
                                G_PRIORITY_DEFAULT,
                                cancellable,
                                callback,
                                user_data,
                                MM_SIM_MODEM, modem,
                                NULL);
}
Esempio n. 11
0
static void
create_next_sms (ListSmsContext *ctx)
{
    g_async_initable_new_async (MM_TYPE_SMS,
                                G_PRIORITY_DEFAULT,
                                ctx->cancellable,
                                (GAsyncReadyCallback)list_build_object_ready,
                                ctx,
                                "g-flags",          G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
                                "g-name",           MM_DBUS_SERVICE,
                                "g-connection",     g_dbus_proxy_get_connection (G_DBUS_PROXY (ctx->self)),
                                "g-object-path",    ctx->sms_paths[ctx->i],
                                "g-interface-name", "org.freedesktop.ModemManager1.Sms",
                                NULL);
}
void mm_broadband_bearer_novatel_new (MMBroadbandModemNovatel *modem,
                                      MMBearerProperties *properties,
                                      GCancellable *cancellable,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data)
{
    g_async_initable_new_async (
        MM_TYPE_BROADBAND_BEARER_NOVATEL,
        G_PRIORITY_DEFAULT,
        cancellable,
        callback,
        user_data,
        MM_BEARER_MODEM, modem,
        NULL);
}
Esempio n. 13
0
void
gclue_client_info_new_async (const char         *bus_name,
                             GDBusConnection    *connection,
                             GCancellable       *cancellable,
                             GAsyncReadyCallback callback,
                             gpointer            user_data)
{
        g_async_initable_new_async (GCLUE_TYPE_CLIENT_INFO,
                                    G_PRIORITY_DEFAULT,
                                    cancellable,
                                    callback,
                                    user_data,
                                    "bus-name", bus_name,
                                    "connection", connection,
                                    NULL);
}
/**
 * nma_mobile_providers_database_new:
 * @country_codes: (allow-none): Path to the country codes file.
 * @service_providers: (allow-none): Path to the service providers file.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 */
void
nma_mobile_providers_database_new (const gchar *country_codes,
                                   const gchar *service_providers,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data)
{
	g_async_initable_new_async (NMA_TYPE_MOBILE_PROVIDERS_DATABASE,
	                            G_PRIORITY_DEFAULT,
	                            cancellable,
	                            callback,
	                            user_data,
	                            "country-codes",     country_codes,
	                            "service-providers", service_providers,
	                            NULL);
}
void hev_impathy_server_sasl_handler_new_async(
			TpAccount *account, TpChannel *channel,
			GAsyncReadyCallback callback,
			gpointer user_data)
{
	g_debug("%s:%d[%s]", __FILE__, __LINE__, __FUNCTION__);

	g_return_if_fail(TP_IS_ACCOUNT(account));
	g_return_if_fail(TP_IS_CHANNEL(channel));
	g_return_if_fail(NULL!=callback);

	g_async_initable_new_async(HEV_TYPE_IMPATHY_SERVER_SASL_HANDLER,
				G_PRIORITY_DEFAULT, NULL, callback, user_data,
				"account", account, "channel", channel,
				NULL);
}
Esempio n. 16
0
void
mm_sim_qmi_new (MMBaseModem         *modem,
                gboolean             dms_uim_deprecated,
                GCancellable        *cancellable,
                GAsyncReadyCallback  callback,
                gpointer             user_data)
{
    g_async_initable_new_async (MM_TYPE_SIM_QMI,
                                G_PRIORITY_DEFAULT,
                                cancellable,
                                callback,
                                user_data,
                                MM_BASE_SIM_MODEM, modem,
                                MM_SIM_QMI_DMS_UIM_DEPRECATED, dms_uim_deprecated,
                                NULL);
}
void
empathy_server_sasl_handler_new_async (TpAccount *account,
    TpChannel *channel,
    GAsyncReadyCallback callback,
    gpointer user_data)
{
  g_return_if_fail (TP_IS_ACCOUNT (account));
  g_return_if_fail (TP_IS_CHANNEL (channel));
  g_return_if_fail (callback != NULL);

  g_async_initable_new_async (EMPATHY_TYPE_SERVER_SASL_HANDLER,
      G_PRIORITY_DEFAULT, NULL, callback, user_data,
      "account", account,
      "channel", channel,
      NULL);
}
Esempio n. 18
0
void
mtn_connman_new (GCancellable        *cancellable,
                 GAsyncReadyCallback  callback,
                 gpointer             user_data)
{
    g_async_initable_new_async (MTN_TYPE_CONNMAN,
                                G_PRIORITY_DEFAULT,
                                cancellable,
                                callback,
                                user_data,
                                "g-bus-type", G_BUS_TYPE_SYSTEM,
                                "g-interface-info", mtn_connman_get_interface_info (),
                                "g-interface-name", "net.connman.Manager",
                                "g-name", "net.connman",
                                "g-object-path", "/",
                                NULL);
}
void
mm_broadband_bearer_huawei_new (MMBroadbandModemHuawei *modem,
                                MMBearerProperties *config,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data)
{
    g_async_initable_new_async (
        MM_TYPE_BROADBAND_BEARER_HUAWEI,
        G_PRIORITY_DEFAULT,
        cancellable,
        callback,
        user_data,
        MM_BASE_BEARER_MODEM, modem,
        MM_BASE_BEARER_CONFIG, config,
        NULL);
}
Esempio n. 20
0
void
mtn_connman_service_new (const char          *object_path,
                         GCancellable        *cancellable,
                         GAsyncReadyCallback  callback,
                         gpointer             user_data)
{
    g_async_initable_new_async (MTN_TYPE_CONNMAN_SERVICE,
                                G_PRIORITY_DEFAULT,
                                cancellable,
                                callback,
                                user_data,
                                "g-bus-type", G_BUS_TYPE_SYSTEM,
                                "g-interface-info", mtn_connman_service_get_interface_info (),
                                "g-interface-name", "net.connman.Service",
                                "g-name", "net.connman",
                                "g-object-path", object_path,
                                NULL);
}
Esempio n. 21
0
/**
 * mm_manager_new:
 * @connection: A #GDBusConnection.
 * @flags: Flags from the #GDBusObjectManagerClientFlags enumeration.
 * @cancellable: (allow-none): A #GCancellable or %NULL.
 * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
 * @user_data: User data to pass to @callback.
 *
 * Asynchronously creates a #MMManager.
 *
 * When the operation is finished, @callback will be invoked in the
 * <link linkend="g-main-context-push-thread-default">thread-default main loop</link>
 * of the thread you are calling this method from.
 *
 * You can then call mm_manager_new_finish() to get the result of the operation.
 *
 * See mm_manager_new_sync() for the synchronous, blocking version of this constructor.
 */
void
mm_manager_new (GDBusConnection               *connection,
                GDBusObjectManagerClientFlags  flags,
                GCancellable                  *cancellable,
                GAsyncReadyCallback            callback,
                gpointer                       user_data)
{
    g_async_initable_new_async (MM_TYPE_MANAGER,
                                G_PRIORITY_DEFAULT,
                                cancellable,
                                callback,
                                user_data,
                                "name", MM_DBUS_SERVICE,
                                "object-path", MM_DBUS_PATH,
                                "flags", flags,
                                "connection", connection,
                                "get-proxy-type-func", mm_gdbus_object_manager_client_get_proxy_type,
                                NULL);
}
/**
 * e_gdbus_cal_factory_proxy_new_for_bus:
 * @bus_type: A #GBusType.
 * @flags: Flags used when constructing the proxy.
 * @name: A bus name (well-known or unique).
 * @object_path: An object path.
 * @cancellable: A #GCancellable or %NULL.
 * @callback: Callback function to invoke when the proxy is ready.
 * @user_data: User data to pass to @callback.
 *
 * Like g_dbus_proxy_new_for_bus() but returns a #EGdbusCalFactoryProxy.
 *
 * This is a failable asynchronous constructor - when the proxy is ready, callback will be invoked and you can use e_gdbus_cal_factory_proxy_new_for_bus_finish() to get the result.
 */
void e_gdbus_cal_factory_proxy_new_for_bus (GBusType             bus_type,
                           GDBusProxyFlags      flags,
                           const gchar         *name,
                           const gchar         *object_path,
                           GCancellable        *cancellable,
                           GAsyncReadyCallback  callback,
                           gpointer             user_data)
{
  g_async_initable_new_async (E_GDBUS_TYPE_CAL_FACTORY_PROXY,
			      G_PRIORITY_DEFAULT,
			      cancellable,
			      callback,
			      user_data,
                              "g-flags", flags,
                              "g-name", name,
                              "g-bus-type", bus_type,
                              "g-object-path", object_path,
                              "g-interface-name", "org.gnome.evolution.dataserver.CalendarFactory",
			      NULL);
}
void
mm_broadband_bearer_hso_new (MMBroadbandModemHso *modem,
                             MMBearerProperties *properties,
                             GCancellable *cancellable,
                             GAsyncReadyCallback callback,
                             gpointer user_data)
{
    g_async_initable_new_async (
        MM_TYPE_BROADBAND_BEARER_HSO,
        G_PRIORITY_DEFAULT,
        cancellable,
        callback,
        user_data,
        MM_BEARER_MODEM, modem,
        MM_BROADBAND_BEARER_3GPP_APN,      mm_bearer_properties_get_apn (properties),
        MM_BROADBAND_BEARER_IP_TYPE,       mm_bearer_properties_get_ip_type (properties),
        MM_BROADBAND_BEARER_ALLOW_ROAMING, mm_bearer_properties_get_allow_roaming (properties),
        MM_BROADBAND_BEARER_HSO_USER,      mm_bearer_properties_get_user (properties),
        MM_BROADBAND_BEARER_HSO_PASSWORD,  mm_bearer_properties_get_password (properties),
        NULL);
}
Esempio n. 24
0
/**
 * cockpit_fake_manager_new_for_bus:
 * @bus_type: dbus bus to listen on
 * @flags: flags for the object manager
 * @bus_name: name of service to look for objects on
 * @object_paths: the paths to initially poke
 * @cancellable: optional cancellation object
 * @callback: called when operation finishes
 * @user_data: data for callback
 *
 * Create a new CockpitFakeManager.
 *
 * The @object_paths are poked and introspected. These are added
 * as well as anything else discovered along the way, before the
 * async operation completes.
 *
 * If @object_paths is NULL it will default to the root '/' DBus
 * path. If @object_paths is an empty array, then nothing is
 * poked during initialization.
 */
void
cockpit_fake_manager_new_for_bus (GBusType bus_type,
                                  GDBusObjectManagerClientFlags flags,
                                  const gchar *bus_name,
                                  const gchar **object_paths,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data)
{
  g_return_if_fail (g_dbus_is_name (bus_name));

  g_async_initable_new_async (COCKPIT_TYPE_FAKE_MANAGER,
                              G_PRIORITY_DEFAULT,
                              cancellable,
                              callback,
                              user_data,
                              "bus-type", bus_type,
                              "flags", flags,
                              "name", bus_name,
                              "object-paths", object_paths,
                              NULL);
}