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;
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);
/* 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 */
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;
}
{
GtkWidget *window;
GtkWidget *widget, *vbox, *bbox, *button, *viewport;
- ClutterActor *layer, *view;
+ ClutterActor *view;
+ ChamplainLayer *layer;
g_thread_init (NULL);
gtk_clutter_init (&argc, &argv);
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 };
-70.764141);
clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
- clutter_actor_show (layer);
+ clutter_actor_show (CLUTTER_ACTOR (layer));
return layer;
}
main (int argc,
char *argv[])
{
- ClutterActor* actor, *layer, *stage;
+ ClutterActor* actor, *stage;
+ ChamplainLayer *layer;
g_thread_init (NULL);
clutter_init (&argc, &argv);
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);