From 0847aaed5073ad4cf7cd3a347cf041c5a4121fe3 Mon Sep 17 00:00:00 2001 From: Ankit Date: Sat, 14 Mar 2015 22:01:35 +0530 Subject: [PATCH] Change DBus Interface namespace Changed DBus Interface namespace from GClue to GClueDBus. It had to be done in order to remove conflicts for the GClueLocation class (subclass of GeocodeLocation) which will be added afterwards in order to extend GeoClue. https://bugs.freedesktop.org/show_bug.cgi?id=89395 --- src/Makefile.am | 2 +- src/gclue-location-source.c | 4 ++-- src/gclue-service-client.c | 48 ++++++++++++++++++++++---------------------- src/gclue-service-client.h | 4 ++-- src/gclue-service-location.c | 30 +++++++++++++-------------- src/gclue-service-location.h | 4 ++-- src/gclue-service-manager.c | 36 ++++++++++++++++----------------- src/gclue-service-manager.h | 4 ++-- 8 files changed, 66 insertions(+), 66 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index bb9ad39..485f989 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,7 +15,7 @@ geoclue-interface.c: geoclue-interface.h geoclue-interface.h: Makefile.am $(interface_DATA) $(AM_V_GEN)$(GDBUS_CODEGEN) \ --interface-prefix org.freedesktop.GeoClue2. \ - --c-namespace GClue \ + --c-namespace GClueDBus \ --generate-c-code geoclue-interface \ --generate-docbook=docs \ $(srcdir)/$(interface_DATA) diff --git a/src/gclue-location-source.c b/src/gclue-location-source.c index ce2a1c0..03f2229 100644 --- a/src/gclue-location-source.c +++ b/src/gclue-location-source.c @@ -138,7 +138,7 @@ gclue_location_source_class_init (GClueLocationSourceClass *klass) gParamSpecs[PROP_LOCATION] = g_param_spec_object ("location", "Location", "Location", - GEOCODE_TYPE_LOCATION, + GCLUE_TYPE_LOCATION, G_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_LOCATION, @@ -268,7 +268,7 @@ gclue_location_source_set_location (GClueLocationSource *source, GClueLocationSourcePrivate *priv = source->priv; if (priv->location == NULL) - priv->location = g_object_new (GEOCODE_TYPE_LOCATION, NULL); + priv->location = g_object_new (GCLUE_TYPE_LOCATION, NULL); g_object_set (priv->location, "latitude", geocode_location_get_latitude (location), diff --git a/src/gclue-service-client.c b/src/gclue-service-client.c index 0ff3e85..00f6e9e 100644 --- a/src/gclue-service-client.c +++ b/src/gclue-service-client.c @@ -31,14 +31,14 @@ #define DEFAULT_ACCURACY_LEVEL GCLUE_ACCURACY_LEVEL_CITY static void -gclue_service_client_client_iface_init (GClueClientIface *iface); +gclue_service_client_client_iface_init (GClueDBusClientIface *iface); static void gclue_service_client_initable_iface_init (GInitableIface *iface); G_DEFINE_TYPE_WITH_CODE (GClueServiceClient, gclue_service_client, - GCLUE_TYPE_CLIENT_SKELETON, - G_IMPLEMENT_INTERFACE (GCLUE_TYPE_CLIENT, + GCLUE_DBUS_TYPE_CLIENT_SKELETON, + G_IMPLEMENT_INTERFACE (GCLUE_DBUS_TYPE_CLIENT, gclue_service_client_client_iface_init) G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, gclue_service_client_initable_iface_init)); @@ -180,7 +180,7 @@ on_locator_location_changed (GObject *gobject, else prev_path = "/"; - gclue_client_set_location (GCLUE_CLIENT (client), path); + gclue_dbus_client_set_location (GCLUE_DBUS_CLIENT (client), path); if (!emit_location_updated (client, prev_path, path, &error)) goto error_out; @@ -198,7 +198,7 @@ start_client (GClueServiceClient *client, GClueAccuracyLevel accuracy_level) { GClueServiceClientPrivate *priv = client->priv; - gclue_client_set_active (GCLUE_CLIENT (client), TRUE); + gclue_dbus_client_set_active (GCLUE_DBUS_CLIENT (client), TRUE); priv->locator = gclue_locator_new (accuracy_level); g_signal_connect (priv->locator, "notify::location", @@ -212,7 +212,7 @@ static void stop_client (GClueServiceClient *client) { g_clear_object (&client->priv->locator); - gclue_client_set_active (GCLUE_CLIENT (client), FALSE); + gclue_dbus_client_set_active (GCLUE_DBUS_CLIENT (client), FALSE); } static void @@ -239,7 +239,7 @@ on_agent_props_changed (GDBusProxy *agent_proxy, continue; config = gclue_config_get_singleton (); - id = gclue_client_get_desktop_id (GCLUE_CLIENT (client)); + id = gclue_dbus_client_get_desktop_id (GCLUE_DBUS_CLIENT (client)); max_accuracy = g_variant_get_uint32 (value); /* FIXME: We should be handling all values of max accuracy * level here, not just 0 and non-0. @@ -248,14 +248,14 @@ on_agent_props_changed (GDBusProxy *agent_proxy, GClueAccuracyLevel accuracy; client->priv->agent_stopped = FALSE; - accuracy = gclue_client_get_requested_accuracy_level - (GCLUE_CLIENT (client)); + accuracy = gclue_dbus_client_get_requested_accuracy_level + (GCLUE_DBUS_CLIENT (client)); accuracy = CLAMP (accuracy, 0, max_accuracy); start_client (client, accuracy); g_debug ("Re-started '%s'.", id); } else if (max_accuracy == 0 && - gclue_client_get_active (GCLUE_CLIENT (client)) && + gclue_dbus_client_get_active (GCLUE_DBUS_CLIENT (client)) && !gclue_config_is_system_component (config, id)) { stop_client (client); client->priv->agent_stopped = TRUE; @@ -286,10 +286,10 @@ complete_start (StartData *data, GClueAccuracyLevel accuracy_level) { start_client (data->client, accuracy_level); - gclue_client_complete_start (GCLUE_CLIENT (data->client), + gclue_dbus_client_complete_start (GCLUE_DBUS_CLIENT (data->client), data->invocation); g_debug ("'%s' started.", - gclue_client_get_desktop_id (GCLUE_CLIENT (data->client))); + gclue_dbus_client_get_desktop_id (GCLUE_DBUS_CLIENT (data->client))); start_data_free (data); } @@ -303,8 +303,8 @@ on_authorize_app_ready (GObject *source_object, gboolean authorized = FALSE; GClueAccuracyLevel accuracy_level; - accuracy_level = gclue_client_get_requested_accuracy_level - (GCLUE_CLIENT (data->client)); + accuracy_level = gclue_dbus_client_get_requested_accuracy_level + (GCLUE_DBUS_CLIENT (data->client)); if (!gclue_agent_call_authorize_app_finish (GCLUE_AGENT (source_object), &authorized, &accuracy_level, @@ -330,7 +330,7 @@ error_out: } static gboolean -gclue_service_client_handle_start (GClueClient *client, +gclue_service_client_handle_start (GClueDBusClient *client, GDBusMethodInvocation *invocation) { GClueServiceClientPrivate *priv = GCLUE_SERVICE_CLIENT (client)->priv; @@ -345,7 +345,7 @@ gclue_service_client_handle_start (GClueClient *client, /* Already started */ return TRUE; - desktop_id = gclue_client_get_desktop_id (client); + desktop_id = gclue_dbus_client_get_desktop_id (client); if (desktop_id == NULL) { g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, @@ -374,7 +374,7 @@ gclue_service_client_handle_start (GClueClient *client, data->client = g_object_ref (client); data->invocation = g_object_ref (invocation); - accuracy_level = gclue_client_get_requested_accuracy_level (client); + accuracy_level = gclue_dbus_client_get_requested_accuracy_level (client); /* No agent == No authorization needed */ if (priv->agent_proxy == NULL || @@ -416,12 +416,12 @@ gclue_service_client_handle_start (GClueClient *client, } static gboolean -gclue_service_client_handle_stop (GClueClient *client, +gclue_service_client_handle_stop (GClueDBusClient *client, GDBusMethodInvocation *invocation) { stop_client (GCLUE_SERVICE_CLIENT (client)); - gclue_client_complete_stop (client, invocation); - g_debug ("'%s' stopped.", gclue_client_get_desktop_id (client)); + gclue_dbus_client_complete_stop (client, invocation); + g_debug ("'%s' stopped.", gclue_dbus_client_get_desktop_id (client)); return TRUE; } @@ -589,7 +589,7 @@ gclue_service_client_handle_set_property (GDBusConnection *connection, GError **error, gpointer user_data) { - GClueClient *client = GCLUE_CLIENT (user_data); + GClueDBusClient *client = GCLUE_DBUS_CLIENT (user_data); GClueServiceClientPrivate *priv = GCLUE_SERVICE_CLIENT (client)->priv; GDBusInterfaceSkeletonClass *skeleton_class; GDBusInterfaceVTable *skeleton_vtable; @@ -614,7 +614,7 @@ gclue_service_client_handle_set_property (GDBusConnection *connection, error, user_data); if (ret && strcmp (property_name, "DistanceThreshold") == 0) { - priv->threshold = gclue_client_get_distance_threshold (client); + priv->threshold = gclue_dbus_client_get_distance_threshold (client); g_debug ("New distance threshold: %u", priv->threshold); } @@ -693,7 +693,7 @@ gclue_service_client_class_init (GClueServiceClientClass *klass) } static void -gclue_service_client_client_iface_init (GClueClientIface *iface) +gclue_service_client_client_iface_init (GClueDBusClientIface *iface) { iface->handle_start = gclue_service_client_handle_start; iface->handle_stop = gclue_service_client_handle_stop; @@ -726,7 +726,7 @@ gclue_service_client_init (GClueServiceClient *client) client->priv = G_TYPE_INSTANCE_GET_PRIVATE (client, GCLUE_TYPE_SERVICE_CLIENT, GClueServiceClientPrivate); - gclue_client_set_requested_accuracy_level (GCLUE_CLIENT (client), + gclue_dbus_client_set_requested_accuracy_level (GCLUE_DBUS_CLIENT (client), DEFAULT_ACCURACY_LEVEL); } diff --git a/src/gclue-service-client.h b/src/gclue-service-client.h index 6bd0618..758aa90 100644 --- a/src/gclue-service-client.h +++ b/src/gclue-service-client.h @@ -44,7 +44,7 @@ typedef struct _GClueServiceClientPrivate GClueServiceClientPrivate; struct _GClueServiceClient { - GClueClientSkeleton parent; + GClueDBusClientSkeleton parent; /*< private >*/ GClueServiceClientPrivate *priv; @@ -52,7 +52,7 @@ struct _GClueServiceClient struct _GClueServiceClientClass { - GClueClientSkeletonClass parent_class; + GClueDBusClientSkeletonClass parent_class; }; GType gclue_service_client_get_type (void) G_GNUC_CONST; diff --git a/src/gclue-service-location.c b/src/gclue-service-location.c index 939cd65..a087ced 100644 --- a/src/gclue-service-location.c +++ b/src/gclue-service-location.c @@ -29,7 +29,7 @@ gclue_service_location_initable_iface_init (GInitableIface *iface); G_DEFINE_TYPE_WITH_CODE (GClueServiceLocation, gclue_service_location, - GCLUE_TYPE_LOCATION_SKELETON, + GCLUE_DBUS_TYPE_LOCATION_SKELETON, G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, gclue_service_location_initable_iface_init)); @@ -72,7 +72,7 @@ gclue_service_location_get_property (GObject *object, GParamSpec *pspec) { GClueServiceLocation *self = GCLUE_SERVICE_LOCATION (object); - GClueLocation *location = GCLUE_LOCATION (object); + GClueDBusLocation *location = GCLUE_DBUS_LOCATION (object); switch (prop_id) { case PROP_CLIENT_INFO: @@ -93,11 +93,11 @@ gclue_service_location_get_property (GObject *object, gdouble altitude; loc = geocode_location_new_with_description - (gclue_location_get_latitude (location), - gclue_location_get_longitude (location), - gclue_location_get_accuracy (location), - gclue_location_get_description (location)); - altitude = gclue_location_get_altitude (location); + (gclue_dbus_location_get_latitude (location), + gclue_dbus_location_get_longitude (location), + gclue_dbus_location_get_accuracy (location), + gclue_dbus_location_get_description (location)); + altitude = gclue_dbus_location_get_altitude (location); if (altitude != GEOCODE_LOCATION_ALTITUDE_UNKNOWN) g_object_set (loc, "altitude", altitude, NULL); @@ -117,7 +117,7 @@ gclue_service_location_set_property (GObject *object, GParamSpec *pspec) { GClueServiceLocation *self = GCLUE_SERVICE_LOCATION (object); - GClueLocation *location = GCLUE_LOCATION (object); + GClueDBusLocation *location = GCLUE_DBUS_LOCATION (object); switch (prop_id) { case PROP_CLIENT_INFO: @@ -138,17 +138,17 @@ gclue_service_location_set_property (GObject *object, gdouble altitude; loc = g_value_get_object (value); - gclue_location_set_latitude + gclue_dbus_location_set_latitude (location, geocode_location_get_latitude (loc)); - gclue_location_set_longitude + gclue_dbus_location_set_longitude (location, geocode_location_get_longitude (loc)); - gclue_location_set_accuracy + gclue_dbus_location_set_accuracy (location, geocode_location_get_accuracy (loc)); - gclue_location_set_description + gclue_dbus_location_set_description (location, geocode_location_get_description (loc)); altitude = geocode_location_get_altitude (loc); if (altitude != GEOCODE_LOCATION_ALTITUDE_UNKNOWN) - gclue_location_set_altitude (location, altitude); + gclue_dbus_location_set_altitude (location, altitude); break; } @@ -320,7 +320,7 @@ gclue_service_location_class_init (GClueServiceLocationClass *klass) gParamSpecs[PROP_LOCATION] = g_param_spec_object ("location", "Location", "Location", - GEOCODE_TYPE_LOCATION, + GCLUE_TYPE_LOCATION, G_PARAM_READWRITE); g_object_class_install_property (object_class, PROP_LOCATION, @@ -333,7 +333,7 @@ gclue_service_location_init (GClueServiceLocation *location) location->priv = G_TYPE_INSTANCE_GET_PRIVATE (location, GCLUE_TYPE_SERVICE_LOCATION, GClueServiceLocationPrivate); - gclue_location_set_altitude (GCLUE_LOCATION (location), + gclue_dbus_location_set_altitude (GCLUE_DBUS_LOCATION (location), GEOCODE_LOCATION_ALTITUDE_UNKNOWN); } diff --git a/src/gclue-service-location.h b/src/gclue-service-location.h index aa74ca4..482b88c 100644 --- a/src/gclue-service-location.h +++ b/src/gclue-service-location.h @@ -44,7 +44,7 @@ typedef struct _GClueServiceLocationPrivate GClueServiceLocationPrivate; struct _GClueServiceLocation { - GClueLocationSkeleton parent; + GClueDBusLocationSkeleton parent; /*< private >*/ GClueServiceLocationPrivate *priv; @@ -52,7 +52,7 @@ struct _GClueServiceLocation struct _GClueServiceLocationClass { - GClueLocationSkeletonClass parent_class; + GClueDBusLocationSkeletonClass parent_class; }; GType gclue_service_location_get_type (void) G_GNUC_CONST; diff --git a/src/gclue-service-manager.c b/src/gclue-service-manager.c index d38b473..504f976 100644 --- a/src/gclue-service-manager.c +++ b/src/gclue-service-manager.c @@ -35,14 +35,14 @@ #define AGENT_WAIT_TIMEOUT_USEC 100000 /* microseconds */ static void -gclue_service_manager_manager_iface_init (GClueManagerIface *iface); +gclue_service_manager_manager_iface_init (GClueDBusManagerIface *iface); static void gclue_service_manager_initable_iface_init (GInitableIface *iface); G_DEFINE_TYPE_WITH_CODE (GClueServiceManager, gclue_service_manager, - GCLUE_TYPE_MANAGER_SKELETON, - G_IMPLEMENT_INTERFACE (GCLUE_TYPE_MANAGER, + GCLUE_DBUS_TYPE_MANAGER_SKELETON, + G_IMPLEMENT_INTERFACE (GCLUE_DBUS_TYPE_MANAGER, gclue_service_manager_manager_iface_init) G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, gclue_service_manager_initable_iface_init)) @@ -79,15 +79,15 @@ sync_in_use_property (GClueServiceManager *manager) clients = g_hash_table_get_values (manager->priv->clients); for (l = clients; l != NULL; l = l->next) { - GClueClient *client = GCLUE_CLIENT (l->data); + GClueDBusClient *client = GCLUE_DBUS_CLIENT (l->data); GClueConfig *config; const char *id; - id = gclue_client_get_desktop_id (client); + id = gclue_dbus_client_get_desktop_id (client); config = gclue_config_get_singleton (); - active |= gclue_client_get_active (client); - if (gclue_client_get_active (client) && + active |= gclue_dbus_client_get_active (client); + if (gclue_dbus_client_get_active (client) && !gclue_config_is_system_component (config, id)) { in_use = TRUE; @@ -100,8 +100,8 @@ sync_in_use_property (GClueServiceManager *manager) manager->priv->active = active; g_object_notify (G_OBJECT (manager), "active"); } - if (in_use != gclue_manager_get_in_use (GCLUE_MANAGER (manager))) - gclue_manager_set_in_use (GCLUE_MANAGER (manager), in_use); + if (in_use != gclue_dbus_manager_get_in_use (GCLUE_DBUS_MANAGER (manager))) + gclue_dbus_manager_set_in_use (GCLUE_DBUS_MANAGER (manager), in_use); } static void @@ -119,7 +119,7 @@ on_peer_vanished (GClueClientInfo *info, typedef struct { - GClueManager *manager; + GClueDBusManager *manager; GDBusMethodInvocation *invocation; GClueClientInfo *client_info; } OnClientInfoNewReadyData; @@ -165,7 +165,7 @@ complete_get_client (OnClientInfoNewReadyData *data) G_CALLBACK (sync_in_use_property), data->manager); - gclue_manager_complete_get_client (data->manager, data->invocation, path); + gclue_dbus_manager_complete_get_client (data->manager, data->invocation, path); goto out; error_out: @@ -229,7 +229,7 @@ on_client_info_new_ready (GObject *source_object, } static gboolean -gclue_service_manager_handle_get_client (GClueManager *manager, +gclue_service_manager_handle_get_client (GClueDBusManager *manager, GDBusMethodInvocation *invocation) { GClueServiceManager *self = GCLUE_SERVICE_MANAGER (manager); @@ -244,7 +244,7 @@ gclue_service_manager_handle_get_client (GClueManager *manager, const gchar *existing_path; existing_path = gclue_service_client_get_path (client); - gclue_manager_complete_get_client (manager, + gclue_dbus_manager_complete_get_client (manager, invocation, existing_path); return TRUE; @@ -263,7 +263,7 @@ gclue_service_manager_handle_get_client (GClueManager *manager, typedef struct { - GClueManager *manager; + GClueDBusManager *manager; GDBusMethodInvocation *invocation; GClueClientInfo *info; char *desktop_id; @@ -313,7 +313,7 @@ on_agent_proxy_ready (GObject *source_object, G_CALLBACK (on_agent_vanished), data->manager); - gclue_manager_complete_add_agent (data->manager, data->invocation); + gclue_dbus_manager_complete_add_agent (data->manager, data->invocation); goto out; @@ -373,7 +373,7 @@ on_agent_info_new_ready (GObject *source_object, } static gboolean -gclue_service_manager_handle_add_agent (GClueManager *manager, +gclue_service_manager_handle_add_agent (GClueDBusManager *manager, GDBusMethodInvocation *invocation, const char *id) { @@ -460,7 +460,7 @@ on_avail_accuracy_level_changed (GObject *object, level = gclue_location_source_get_available_accuracy_level (GCLUE_LOCATION_SOURCE (priv->locator)); - gclue_manager_set_available_accuracy_level (GCLUE_MANAGER (user_data), + gclue_dbus_manager_set_available_accuracy_level (GCLUE_DBUS_MANAGER (user_data), level); } @@ -551,7 +551,7 @@ gclue_service_manager_initable_init (GInitable *initable, } static void -gclue_service_manager_manager_iface_init (GClueManagerIface *iface) +gclue_service_manager_manager_iface_init (GClueDBusManagerIface *iface) { iface->handle_get_client = gclue_service_manager_handle_get_client; iface->handle_add_agent = gclue_service_manager_handle_add_agent; diff --git a/src/gclue-service-manager.h b/src/gclue-service-manager.h index 6c524b8..aab7073 100644 --- a/src/gclue-service-manager.h +++ b/src/gclue-service-manager.h @@ -42,7 +42,7 @@ typedef struct _GClueServiceManagerPrivate GClueServiceManagerPrivate; struct _GClueServiceManager { - GClueManagerSkeleton parent; + GClueDBusManagerSkeleton parent; /*< private >*/ GClueServiceManagerPrivate *priv; @@ -50,7 +50,7 @@ struct _GClueServiceManager struct _GClueServiceManagerClass { - GClueManagerSkeletonClass parent_class; + GClueDBusManagerSkeletonClass parent_class; }; GType gclue_service_manager_get_type (void) G_GNUC_CONST; -- 2.1.0