diff options
author | Pierre-Luc Beaudoin <pierre-luc@pierlux.com> | 2009-03-09 22:29:03 +0200 |
---|---|---|
committer | Pierre-Luc Beaudoin <pierre-luc@pierlux.com> | 2009-03-09 22:29:03 +0200 |
commit | 1dd9cb8d3a8cefbe8520946aa71076a936891644 (patch) | |
tree | f82455b4295170bd966a2a369fa8c9d7f84eda76 /demos | |
parent | 7ce2069d962966c97aeabe07952f459ae144f7b5 (diff) | |
download | libchamplain-1dd9cb8d3a8cefbe8520946aa71076a936891644.tar.gz |
Fix compile warnings in the demos
Diffstat (limited to 'demos')
-rw-r--r-- | demos/Makefile.am | 2 | ||||
-rw-r--r-- | demos/animated-marker.c | 9 | ||||
-rw-r--r-- | demos/launcher-gtk.c | 30 | ||||
-rw-r--r-- | demos/launcher.c | 15 |
4 files changed, 32 insertions, 24 deletions
diff --git a/demos/Makefile.am b/demos/Makefile.am index 710c090..1d01fd8 100644 --- a/demos/Makefile.am +++ b/demos/Makefile.am @@ -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 diff --git a/demos/animated-marker.c b/demos/animated-marker.c index 9559750..f8fec3a 100644 --- a/demos/animated-marker.c +++ b/demos/animated-marker.c @@ -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 */ diff --git a/demos/launcher-gtk.c b/demos/launcher-gtk.c index 69c35b0..e528f7d 100644 --- a/demos/launcher-gtk.c +++ b/demos/launcher-gtk.c @@ -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); diff --git a/demos/launcher.c b/demos/launcher.c index 315f061..71adcb2 100644 --- a/demos/launcher.c +++ b/demos/launcher.c @@ -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); |