]> err.no Git - libchamplain/commitdiff
Fix compile warnings in the demos
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Mon, 9 Mar 2009 20:29:03 +0000 (22:29 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Mon, 9 Mar 2009 20:29:03 +0000 (22:29 +0200)
demos/Makefile.am
demos/animated-marker.c
demos/launcher-gtk.c
demos/launcher.c

index 710c090752e644067113924beaf5b75b655d93d0..1d01fd85ae0011deb17c4405df6f1b4a78e8d77e 100644 (file)
@@ -2,7 +2,7 @@ noinst_PROGRAMS = launcher animated-marker
 
 INCLUDES = -I$(top_srcdir)
 
-AM_CPPFLAGS = $(DEPS_CFLAGS)
+AM_CPPFLAGS = $(DEPS_CFLAGS) $(WARN_CFLAGS)
 AM_LDFLAGS = $(DEPS_LIBS)
 
 launcher_SOURCES = launcher.c
index 9559750953aa7f7984c651dc17b37aae73198339..f8fec3ae33358eb3c446df40cb16a792af7e764f 100644 (file)
@@ -31,9 +31,7 @@ static ClutterActor*
 create_marker ()
 {
   ClutterActor *marker;
-  ClutterColor orange = { 0xf3, 0x94, 0x07, 0xbb };
-  ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
-  ClutterActor *actor, *bg;
+  ClutterActor *bg;
   ClutterTimeline *timeline;
   ClutterBehaviour *behaviour;
   ClutterAlpha *alpha;
@@ -107,7 +105,8 @@ create_marker ()
 int
 main (int argc, char *argv[])
 {
-  ClutterActor* actor, *layer, *marker, *stage;
+  ClutterActor* actor, *marker, *stage;
+  ChamplainLayer *layer;
 
   g_thread_init (NULL);
   clutter_init (&argc, &argv);
@@ -122,7 +121,7 @@ main (int argc, char *argv[])
 
   /* Create the marker layer */
   layer = champlain_layer_new ();
-  clutter_actor_show (layer);
+  clutter_actor_show (CLUTTER_ACTOR (layer));
   champlain_view_add_layer (CHAMPLAIN_VIEW (actor), layer);
 
   /* Create a marker */
index 69c35b030628d4aa66bfc44b994111896921db0b..e528f7de4fa6841dbcf33cfd0fe8c6d9dc7ec13f 100644 (file)
@@ -37,28 +37,29 @@ on_destroy (GtkWidget *widget, gpointer data)
   gtk_main_quit ();
 }
 
-static ClutterActor*
+static ChamplainLayer *
 create_marker_layer ()
 {
-  ClutterActor *layer, *marker;
+  ClutterActor *marker;
+  ChamplainLayer * layer;
 
-  layer = champlain_layer_new();
+  layer = champlain_layer_new ();
 
   ClutterColor orange = { 0xf3, 0x94, 0x07, 0xbb };
   ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
-  marker = champlain_marker_new_with_label("MontrĂ©al", "Airmole 14", NULL, NULL);
-  champlain_marker_set_position(CHAMPLAIN_MARKER(marker), 45.528178, -73.563788);
-  clutter_container_add(CLUTTER_CONTAINER(layer), marker, NULL);
+  marker = champlain_marker_new_with_label ("MontrĂ©al", "Airmole 14", NULL, NULL);
+  champlain_marker_set_position (CHAMPLAIN_MARKER (marker), 45.528178, -73.563788);
+  clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
 
-  marker = champlain_marker_new_with_label("New York", "Sans 25", &white, NULL);
-  champlain_marker_set_position(CHAMPLAIN_MARKER(marker), 40.77, -73.98);
-  clutter_container_add(CLUTTER_CONTAINER(layer), marker, NULL);
+  marker = champlain_marker_new_with_label ("New York", "Sans 25", &white, NULL);
+  champlain_marker_set_position (CHAMPLAIN_MARKER (marker), 40.77, -73.98);
+  clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
 
-  marker = champlain_marker_new_with_label("Saint-Tite-des-Caps", "Serif 12", NULL, &orange);
-  champlain_marker_set_position(CHAMPLAIN_MARKER(marker), 47.130885, -70.764141);
-  clutter_container_add(CLUTTER_CONTAINER(layer), marker, NULL);
+  marker = champlain_marker_new_with_label ("Saint-Tite-des-Caps", "Serif 12", NULL, &orange);
+  champlain_marker_set_position(CHAMPLAIN_MARKER (marker), 47.130885, -70.764141);
+  clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
 
-  clutter_actor_hide(layer);
+  clutter_actor_hide (CLUTTER_ACTOR (layer));
   return layer;
 }
 
@@ -129,7 +130,8 @@ main (int argc,
 {
   GtkWidget *window;
   GtkWidget *widget, *vbox, *bbox, *button, *viewport;
-  ClutterActor *layer, *view;
+  ClutterActor *view;
+  ChamplainLayer *layer;
 
   g_thread_init (NULL);
   gtk_clutter_init (&argc, &argv);
index 315f061a7efae7668a9daa9c151a857ecde631b6..71adcb26a2250eaaafd918af08271583e38f77f3 100644 (file)
@@ -49,10 +49,11 @@ marker_button_release_cb (ClutterActor *actor,
   return TRUE;
 }
 
-static ClutterActor*
+static ChamplainLayer *
 create_marker_layer (ChamplainView *view)
 {
-  ClutterActor *layer, *marker;
+  ClutterActor *marker;
+  ChamplainLayer *layer;
   ClutterColor orange = { 0xf3, 0x94, 0x07, 0xbb };
   ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
 
@@ -78,7 +79,7 @@ create_marker_layer (ChamplainView *view)
       -70.764141);
   clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
 
-  clutter_actor_show (layer);
+  clutter_actor_show (CLUTTER_ACTOR (layer));
   return layer;
 }
 
@@ -86,7 +87,8 @@ int
 main (int argc,
       char *argv[])
 {
-  ClutterActor* actor, *layer, *stage;
+  ClutterActor* actor, *stage;
+  ChamplainLayer *layer;
 
   g_thread_init (NULL);
   clutter_init (&argc, &argv);
@@ -103,6 +105,11 @@ main (int argc,
   layer = create_marker_layer (CHAMPLAIN_VIEW (actor));
   champlain_view_add_layer (CHAMPLAIN_VIEW (actor), layer);
 
+  /* Connect to the click event */
+  g_signal_connect (actor, "button-release-event",
+      G_CALLBACK (map_view_button_release_cb),
+      actor);
+
   /* Finish initialising the map view */
   g_object_set (G_OBJECT (actor), "zoom-level", 12,
       "scroll-mode", CHAMPLAIN_SCROLL_MODE_KINETIC, NULL);