aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-02-17 22:29:03 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-02-21 17:17:49 +0800
commit1629b3b04f38eb748ae8385e407e01bfaf312a63 (patch)
tree612502aee7dfeecd1a5419416f3bd4ee7b920297 /libempathy-gtk
parent932d46f051bbfbf144dcb063849e4f285daa8586 (diff)
downloadgsoc2013-empathy-1629b3b04f38eb748ae8385e407e01bfaf312a63.tar
gsoc2013-empathy-1629b3b04f38eb748ae8385e407e01bfaf312a63.tar.gz
gsoc2013-empathy-1629b3b04f38eb748ae8385e407e01bfaf312a63.tar.bz2
gsoc2013-empathy-1629b3b04f38eb748ae8385e407e01bfaf312a63.tar.lz
gsoc2013-empathy-1629b3b04f38eb748ae8385e407e01bfaf312a63.tar.xz
gsoc2013-empathy-1629b3b04f38eb748ae8385e407e01bfaf312a63.tar.zst
gsoc2013-empathy-1629b3b04f38eb748ae8385e407e01bfaf312a63.zip
Port to champlain 0.10 (#642010)
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-widget.c15
-rw-r--r--libempathy-gtk/empathy-individual-widget.c29
2 files changed, 19 insertions, 25 deletions
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 3e4dc845a..410b59f00 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -946,7 +946,7 @@ contact_widget_location_update (EmpathyContactWidget *information)
if (display_map)
{
ClutterActor *marker;
- ChamplainLayer *layer;
+ ChamplainMarkerLayer *layer;
information->map_view_embed = gtk_champlain_embed_new ();
information->map_view = gtk_champlain_embed_get_view (
@@ -955,18 +955,17 @@ contact_widget_location_update (EmpathyContactWidget *information)
gtk_container_add (GTK_CONTAINER (information->viewport_map),
information->map_view_embed);
g_object_set (G_OBJECT (information->map_view),
- "show-license", TRUE,
- "scroll-mode", CHAMPLAIN_SCROLL_MODE_KINETIC,
+ "kinetic-mode", TRUE,
"zoom-level", 10,
NULL);
- layer = champlain_layer_new ();
- champlain_view_add_layer (information->map_view, layer);
+ layer = champlain_marker_layer_new_full (CHAMPLAIN_SELECTION_NONE);
+ champlain_view_add_layer (information->map_view, CHAMPLAIN_LAYER (layer));
- marker = champlain_marker_new_with_text (
+ marker = champlain_label_new_with_text (
empathy_contact_get_alias (information->contact), NULL, NULL, NULL);
- champlain_base_marker_set_position (CHAMPLAIN_BASE_MARKER (marker), lat, lon);
- clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
+ champlain_location_set_location (CHAMPLAIN_LOCATION (marker), lat, lon);
+ champlain_marker_layer_add_marker (layer, CHAMPLAIN_MARKER (marker));
champlain_view_center_on (information->map_view, lat, lon);
gtk_widget_show_all (information->viewport_map);
diff --git a/libempathy-gtk/empathy-individual-widget.c b/libempathy-gtk/empathy-individual-widget.c
index 35e12dbe2..8ca5c0f73 100644
--- a/libempathy-gtk/empathy-individual-widget.c
+++ b/libempathy-gtk/empathy-individual-widget.c
@@ -728,8 +728,8 @@ location_update (EmpathyIndividualWidget *self)
#ifdef HAVE_LIBCHAMPLAIN
if (display_map == TRUE)
{
- GPtrArray *markers;
- ChamplainLayer *layer;
+ ChamplainMarkerLayer *layer;
+ ChamplainBoundingBox *bbox;
priv->map_view_embed = gtk_champlain_embed_new ();
priv->map_view = gtk_champlain_embed_get_view (
@@ -738,14 +738,12 @@ location_update (EmpathyIndividualWidget *self)
gtk_container_add (GTK_CONTAINER (priv->viewport_map),
priv->map_view_embed);
g_object_set (G_OBJECT (priv->map_view),
- "show-license", TRUE,
- "scroll-mode", CHAMPLAIN_SCROLL_MODE_KINETIC,
+ "kinetic-mode", TRUE,
"zoom-level", 10,
NULL);
- layer = champlain_layer_new ();
- champlain_view_add_layer (priv->map_view, layer);
- markers = g_ptr_array_new ();
+ layer = champlain_marker_layer_new_full (CHAMPLAIN_SELECTION_NONE);
+ champlain_view_add_layer (priv->map_view, CHAMPLAIN_LAYER (layer));
/* FIXME: For now, we have to do this manually. Once libfolks grows a
* location interface, we can use that. (bgo#627400) */
@@ -793,24 +791,21 @@ location_update (EmpathyIndividualWidget *self)
lon = g_value_get_double (value);
/* Add a marker to the map */
- marker = champlain_marker_new_with_text (
+ marker = champlain_label_new_with_text (
folks_aliasable_get_alias (FOLKS_ALIASABLE (persona)), NULL,
NULL, NULL);
- champlain_base_marker_set_position (
- CHAMPLAIN_BASE_MARKER (marker), lat, lon);
- clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
-
- g_ptr_array_add (markers, marker);
+ champlain_location_set_location (CHAMPLAIN_LOCATION (marker),
+ lat, lon);
+ champlain_marker_layer_add_marker (layer,
+ CHAMPLAIN_MARKER (marker));
g_object_unref (contact);
}
}
/* Zoom to show all of the markers */
- g_ptr_array_add (markers, NULL); /* NULL-terminate the array */
- champlain_view_ensure_markers_visible (priv->map_view,
- (ChamplainBaseMarker **) markers->pdata, FALSE);
- g_ptr_array_free (markers, TRUE);
+ bbox = champlain_layer_get_bounding_box (CHAMPLAIN_LAYER (layer));
+ champlain_view_ensure_visible (priv->map_view, bbox, FALSE);
gtk_widget_show_all (priv->viewport_map);
}