*/
ClutterActor *
champlain_marker_new_with_text (const gchar *text,
- const gchar *font,
- ClutterColor *text_color,
- ClutterColor *marker_color)
+ const gchar *font,
+ ClutterColor *text_color,
+ ClutterColor *marker_color)
{
ChamplainMarker *marker = CHAMPLAIN_MARKER (champlain_marker_new ());
* Since: 0.2
*/
ClutterActor *
-champlain_marker_new_with_image (const gchar *filename, GError **error)
+champlain_marker_new_with_image (ClutterActor *actor,
+ GError **error)
+{
+ ChamplainMarker *marker = CHAMPLAIN_MARKER (champlain_marker_new ());
+ if (actor != NULL)
+ {
+ champlain_marker_set_image (marker, actor);
+ }
+
+ return CLUTTER_ACTOR (marker);
+}
+
+/**
+ * champlain_marker_new_from_file:
+ * @filename: The filename of the image.
+ * @error: Return location for an error.
+ *
+ * Returns a new #ChamplainMarker with a drawn marker containing the given
+ * image.
+ *
+ * Since: 0.2
+ */
+ClutterActor *
+champlain_marker_new_from_file (const gchar *filename,
+ GError **error)
{
if (filename == NULL)
return NULL;
}
/**
- * champlain_marker_new_with_image_full:
- * @filename: The name of an image file to load.
- * @width: Width of the image in pixel or -1.
- * @height: Height of the image in pixel or -1.
- * @anchor_x: X coordinate of the anchor point.
- * @anchor_y: Y coordinate of the anchor point.
+ * champlain_marker_new_full:
+ * @text: The text
+ * @actor: The image
* @error: Return location for an error.
*
* Returns a new #ChamplainMarker with a drawn marker containing the given
*/
ClutterActor *
champlain_marker_new_full (const gchar *text,
- const gchar *filename,
+ ClutterActor *actor,
GError **error)
{
- if (filename == NULL)
- return NULL;
-
ChamplainMarker *marker = CHAMPLAIN_MARKER (champlain_marker_new ());
- ClutterActor *actor = clutter_texture_new_from_file (filename, error);
-
if (actor != NULL)
{
champlain_marker_set_image (marker, actor);
ClutterActor *champlain_marker_new_with_text (const gchar *text,
const gchar *font, ClutterColor *text_color, ClutterColor *marker_color);
-ClutterActor *champlain_marker_new_with_image (const gchar *filename,
+ClutterActor *champlain_marker_new_with_image (ClutterActor *actor,
+ GError **error);
+
+ClutterActor *champlain_marker_new_from_file (const gchar *filename,
GError **error);
ClutterActor *champlain_marker_new_full (const gchar *text,
- const gchar *image_filename,
+ ClutterActor *actor,
GError **error);
void champlain_marker_set_text (ChamplainMarker *marker,
g_signal_connect_after (marker, "button-release-event",
G_CALLBACK (marker_button_release_cb), view);
- marker = champlain_marker_new_full ("New York", "/usr/share/icons/gnome/24x24/emblems/emblem-generic.png", NULL);
+ marker = champlain_marker_new_from_file ("/usr/share/icons/gnome/24x24/emblems/emblem-generic.png", NULL);
+ champlain_marker_set_text (CHAMPLAIN_MARKER (marker), "New York");
champlain_base_marker_set_position (CHAMPLAIN_BASE_MARKER (marker), 40.77, -73.98);
clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
- marker = champlain_marker_new_with_image ("/usr/share/icons/Tango/24x24/emblems/emblem-important.png", NULL);
+ marker = champlain_marker_new_from_file ("/usr/share/icons/Tango/24x24/emblems/emblem-important.png", NULL);
champlain_base_marker_set_position (CHAMPLAIN_BASE_MARKER (marker), 47.130885,
-70.764141);
clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
- marker = champlain_marker_new_with_image ("/usr/share/icons/Tango/24x24/emblems/emblem-favorite.png", NULL);
+ marker = champlain_marker_new_from_file ("/usr/share/icons/Tango/24x24/emblems/emblem-favorite.png", NULL);
champlain_marker_set_draw_background (CHAMPLAIN_MARKER (marker), FALSE);
champlain_base_marker_set_position (CHAMPLAIN_BASE_MARKER (marker), 45.41484,
-71.918907);