[empathy] Use libchamplain 0.3.3 new Gtk embed API



commit 0b23d0983acb95ced196c766ee112143ec314c22
Author: Pierre-Luc Beaudoin <pierre-luc beaudoin collabora co uk>
Date:   Fri Jun 12 01:19:26 2009 -0400

    Use libchamplain 0.3.3 new Gtk embed API

 configure.ac                            |    4 ++--
 libempathy-gtk/empathy-contact-widget.c |   12 ++++++------
 src/empathy-map-view.c                  |    7 +++----
 3 files changed, 11 insertions(+), 12 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index c921c40..c881e75 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,8 +35,8 @@ ENCHANT_REQUIRED=1.2.0
 ISO_CODES_REQUIRED=0.35
 LIBNOTIFY_REQUIRED=0.4.4
 LIBCANBERRA_GTK_REQUIRED=0.4
-LIBCHAMPLAIN_REQUIRED=0.3.0
-LIBCHAMPLAIN_GTK_REQUIRED=0.3.0
+LIBCHAMPLAIN_REQUIRED=0.3.3
+LIBCHAMPLAIN_GTK_REQUIRED=0.3.3
 CLUTTER_GTK_REQUIRED=0.8.2
 GEOCLUE_REQUIRED=0.11
 WEBKIT_REQUIRED=1.1.7
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 6c10153..12a1393 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -105,7 +105,7 @@ typedef struct
 #if HAVE_LIBCHAMPLAIN
   GtkWidget *viewport_map;
   GtkWidget *map_view_embed;
-  ClutterActor *map_view;
+  ChamplainView *map_view;
 #endif
 
   /* Groups */
@@ -1420,9 +1420,9 @@ contact_widget_location_update (EmpathyContactWidget *information)
       ClutterActor *marker;
       ChamplainLayer *layer;
 
-      information->map_view = champlain_view_new ();
-      information->map_view_embed = champlain_view_embed_new (
-          CHAMPLAIN_VIEW (information->map_view));
+      information->map_view_embed = gtk_champlain_embed_new ();
+      information->map_view = gtk_champlain_embed_get_view (
+          GTK_CHAMPLAIN_EMBED (information->map_view_embed));
 
       gtk_container_add (GTK_CONTAINER (information->viewport_map),
           information->map_view_embed);
@@ -1431,14 +1431,14 @@ contact_widget_location_update (EmpathyContactWidget *information)
           NULL);
 
       layer = champlain_layer_new ();
-      champlain_view_add_layer (CHAMPLAIN_VIEW (information->map_view), layer);
+      champlain_view_add_layer (information->map_view, layer);
 
       marker = champlain_marker_new_with_text (
           empathy_contact_get_name (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_view_center_on (CHAMPLAIN_VIEW(information->map_view), lat, lon);
+      champlain_view_center_on (information->map_view, lat, lon);
       gtk_widget_show_all (information->viewport_map);
     }
 #endif
diff --git a/src/empathy-map-view.c b/src/empathy-map-view.c
index 05f5291..3a2210f 100644
--- a/src/empathy-map-view.c
+++ b/src/empathy-map-view.c
@@ -142,14 +142,13 @@ empathy_map_view_show (void)
   window->list_store = list_store;
 
   /* Set up map view */
-  window->map_view = CHAMPLAIN_VIEW (champlain_view_new ());
+  embed = gtk_champlain_embed_new ();
+  window->map_view = gtk_champlain_embed_get_view (GTK_CHAMPLAIN_EMBED (embed));
   g_object_set (G_OBJECT (window->map_view), "zoom-level", 1,
      "scroll-mode", CHAMPLAIN_SCROLL_MODE_KINETIC, NULL);
   champlain_view_center_on (window->map_view, 36, 0);
 
-  embed = champlain_view_embed_new (window->map_view);
-  gtk_container_add (GTK_CONTAINER (sw),
-     GTK_WIDGET (embed));
+  gtk_container_add (GTK_CONTAINER (sw), embed);
   gtk_widget_show_all (embed);
 
   window->layer = g_object_ref (champlain_layer_new ());



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]