ChamplainMarker

## ChamplainMarker ChamplainMarker — A marker to identify points of interest on a map |

## Synopsis

    struct              ChamplainMarker;
    ClutterActor *      champlain_marker_new                (void);
    ClutterActor *      champlain_marker_new_with_text      (const gchar *text,
                                                             const gchar *font,
                                                             ClutterColor *text_color,
                                                             ClutterColor *marker_color);
    ClutterActor *      champlain_marker_new_with_image     (ClutterActor *actor);
    ClutterActor *      champlain_marker_new_full           (const gchar *text,
                                                             ClutterActor *actor);
    ClutterActor *      champlain_marker_new_from_file      (const gchar *filename,
                                                             GError **error);
    void                champlain_marker_set_text           (ChamplainMarker *marker,
                                                             const gchar *text);
    const gchar *       champlain_marker_get_text           (ChamplainMarker *marker);
    void                champlain_marker_set_image          (ChamplainMarker *marker,
                                                             ClutterActor *image);
    ClutterActor *      champlain_marker_get_image          (ChamplainMarker *marker);
    void                champlain_marker_set_use_markup     (ChamplainMarker *marker,
                                                             gboolean use_markup);
    gboolean            champlain_marker_get_use_markup     (ChamplainMarker *marker);
    void                champlain_marker_set_alignment      (ChamplainMarker *marker,
                                                             PangoAlignment alignment);
    PangoAlignment      champlain_marker_get_alignment      (ChamplainMarker *marker);
    void                champlain_marker_set_color          (ChamplainMarker *marker,
                                                             const ClutterColor *color);
    ClutterColor *      champlain_marker_get_color          (ChamplainMarker *marker);
    void                champlain_marker_set_text_color     (ChamplainMarker *marker,
                                                             const ClutterColor *color);
    ClutterColor *      champlain_marker_get_text_color     (ChamplainMarker *marker);
    void                champlain_marker_set_font_name      (ChamplainMarker *marker,
                                                             const gchar *font_name);
    const gchar *       champlain_marker_get_font_name      (ChamplainMarker *marker);
    void                champlain_marker_set_wrap           (ChamplainMarker *marker,
                                                             gboolean wrap);
    gboolean            champlain_marker_get_wrap           (ChamplainMarker *marker);
    void                champlain_marker_set_wrap_mode      (ChamplainMarker *marker,
                                                             PangoWrapMode wrap_mode);
    PangoWrapMode       champlain_marker_get_wrap_mode      (ChamplainMarker *marker);
    void                champlain_marker_set_attributes     (ChamplainMarker *marker,
                                                             PangoAttrList *list);
    void                champlain_marker_set_single_line_mode
                                                            (ChamplainMarker *marker,
                                                             gboolean mode);
    gboolean            champlain_marker_get_single_line_mode
                                                            (ChamplainMarker *marker);
    void                champlain_marker_set_ellipsize      (ChamplainMarker *marker,
                                                             PangoEllipsizeMode mode);
    PangoEllipsizeMode  champlain_marker_get_ellipsize      (ChamplainMarker *marker);
    void                champlain_marker_set_draw_background
                                                            (ChamplainMarker *marker,
                                                             gboolean background);
    gboolean            champlain_marker_get_draw_background
                                                            (ChamplainMarker *marker);
    void                champlain_marker_set_highlight_text_color
                                                            (ClutterColor *color);
    const ClutterColor * champlain_marker_get_highlight_text_color
                                                            (void);
    void                champlain_marker_set_highlight_color
                                                            (ClutterColor *color);
    const ClutterColor * champlain_marker_get_highlight_color
                                                            (void);
    void                champlain_marker_queue_redraw       (ChamplainMarker *marker);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----ClutterActor
                   +----ClutterGroup
                         +----ChamplainBaseMarker
                               +----ChamplainMarker

## Implemented Interfaces

ChamplainMarker implements ClutterScriptable, ClutterAnimatable, AtkImplementorIface and ClutterContainer.

## Properties

      "alignment"                PangoAlignment        : Read / Write
      "color"                    ClutterColor*         : Read / Write
      "draw-background"          gboolean              : Read / Write
      "ellipsize"                PangoEllipsizeMode    : Read / Write
      "font-name"                gchar*                : Read / Write
      "image"                    ClutterActor*         : Read / Write
      "single-line-mode"         gboolean              : Read / Write
      "text"                     gchar*                : Read / Write
      "text-color"               ClutterColor*         : Read / Write
      "use-markup"               gboolean              : Read / Write
      "wrap"                     gboolean              : Read / Write
      "wrap-mode"                PangoWrapMode         : Read / Write

## Description

Markers reprensent points of interest on a map. Markers need to be placed on a layer (a ChamplainLayer). Layers have to be added to a ChamplainView for the markers to show on the map.

A marker is nothing more than a regular ClutterActor. You can draw on it what ever you want. Set the markers position on the map using champlain_marker_set_position.

Champlain has a default type of markers with text. To create one, use champlain_marker_new_with_text.

## Details

### struct ChamplainMarker

    struct ChamplainMarker;

### champlain_marker_new ()

    ClutterActor *      champlain_marker_new                (void);

Creates a new instance of ChamplainMarker.

Returns : | a new ChamplainMarker ready to be used as a ClutterActor.

Since 0.2

### champlain_marker_new_with_text ()

    ClutterActor *      champlain_marker_new_with_text      (const gchar *text,
                                                             const gchar *font,
                                                             ClutterColor *text_color,
                                                             ClutterColor *marker_color);

Creates a new instance of ChamplainMarker with text value.

`text` : | the text of the text
`font` : | the font to use to draw the text, for example "Courrier Bold 11", can be NULL. [allow-none]
`text_color` : | a ClutterColor, the color of the text, can be NULL. [allow-none]
`marker_color` : | a ClutterColor, the color of the marker, can be NULL. [allow-none]
Returns : | a new ChamplainMarker with a drawn marker containing the given text.

Since 0.2

### champlain_marker_new_with_image ()

    ClutterActor *      champlain_marker_new_with_image     (ClutterActor *actor);

Creates a new instance of ChamplainMarker with image.

`actor` : | The actor of the image.
Returns : | a new ChamplainMarker with a drawn marker containing the given image.

Since 0.4

### champlain_marker_new_full ()

    ClutterActor *      champlain_marker_new_full           (const gchar *text,
                                                             ClutterActor *actor);

Creates a new instance of ChamplainMarker consisting of a custom ClutterActor.

`text` : | The text
`actor` : | The image
Returns : | a new ChamplainMarker with a drawn marker containing the given image.

Since 0.4

### champlain_marker_new_from_file ()

    ClutterActor *      champlain_marker_new_from_file      (const gchar *filename,
                                                             GError **error);

Creates a new instance of ChamplainMarker with image loaded 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.4

### champlain_marker_set_text ()

    void                champlain_marker_set_text           (ChamplainMarker *marker,
                                                             const gchar *text);

Sets the marker's text.

`marker` : | The marker
`text` : | The text

Since 0.4

### champlain_marker_get_text ()

    const gchar *       champlain_marker_get_text           (ChamplainMarker *marker);

Get the marker's text.

`marker` : | The marker
Returns : | the marker's text.

Since 0.4

### champlain_marker_set_image ()

    void                champlain_marker_set_image          (ChamplainMarker *marker,
                                                             ClutterActor *image);

Sets the marker's image.

`marker` : | The marker.
`image` : | The image as a `ClutterActor` or NULL to remove the current image. [allow-none]

Since 0.4

### champlain_marker_get_image ()

    ClutterActor *      champlain_marker_get_image          (ChamplainMarker *marker);

Get the marker's image.

`marker` : | The marker
Returns : | the marker's image. [transfer none]

Since 0.4

### champlain_marker_set_use_markup ()

    void                champlain_marker_set_use_markup     (ChamplainMarker *marker,
                                                             gboolean use_markup);

Sets if the marker's text uses markup.

`marker` : | The marker
`use_markup` : | The value

Since 0.4

### champlain_marker_get_use_markup ()

    gboolean            champlain_marker_get_use_markup     (ChamplainMarker *marker);

Check whether the marker uses markup.

`marker` : | The marker
Returns : | if the marker's text contains markup.

Since 0.4

### champlain_marker_set_alignment ()

    void                champlain_marker_set_alignment      (ChamplainMarker *marker,
                                                             PangoAlignment alignment);

Set the marker's text alignment.

`marker` : | The marker
`alignment` : | The marker's alignment

Since 0.4

### champlain_marker_get_alignment ()

    PangoAlignment      champlain_marker_get_alignment      (ChamplainMarker *marker);

Get the marker's text alignment.

`marker` : | The marker
Returns : | the marker's text alignment.

Since 0.4

### champlain_marker_set_color ()

    void                champlain_marker_set_color          (ChamplainMarker *marker,
                                                             const ClutterColor *color);

Set the marker's background color.

`marker` : | The marker
`color` : | The marker's background color or NULL to reset the background to the default color. The color parameter is copied. [allow-none]

Since 0.4

### champlain_marker_get_color ()

    ClutterColor *      champlain_marker_get_color          (ChamplainMarker *marker);

Gets the marker's color.

`marker` : | The marker
Returns : | the marker's color.

Since 0.4

### champlain_marker_set_text_color ()

    void                champlain_marker_set_text_color     (ChamplainMarker *marker,
                                                             const ClutterColor *color);

Set the marker's text color.

`marker` : | The marker
`color` : | The marker's text color or NULL to reset the text to the default color. The color parameter is copied. [allow-none]

Since 0.4

### champlain_marker_get_text_color ()

    ClutterColor *      champlain_marker_get_text_color     (ChamplainMarker *marker);

Gets the marker's text color.

`marker` : | The marker
Returns : | the marker's text color.

Since 0.4

### champlain_marker_set_font_name ()

    void                champlain_marker_set_font_name      (ChamplainMarker *marker,
                                                             const gchar *font_name);

Set the marker's font name such as "Sans 12".

`marker` : | The marker
`font_name` : | The marker's font name or NULL to reset the font to the default value. [allow-none]

Since 0.4

### champlain_marker_get_font_name ()

    const gchar *       champlain_marker_get_font_name      (ChamplainMarker *marker);

Gets the marker's font name.

`marker` : | The marker
Returns : | the marker's font name.

Since 0.4

### champlain_marker_set_wrap ()

    void                champlain_marker_set_wrap           (ChamplainMarker *marker,
                                                             gboolean wrap);

Set if the marker's text wrap.

`marker` : | The marker
`wrap` : | The marker's wrap.

Since 0.4

### champlain_marker_get_wrap ()

    gboolean            champlain_marker_get_wrap           (ChamplainMarker *marker);

Check whether the marker text wraps.

`marker` : | The marker
Returns : | if the marker's text wraps.

Since 0.4

### champlain_marker_set_wrap_mode ()

    void                champlain_marker_set_wrap_mode      (ChamplainMarker *marker,
                                                             PangoWrapMode wrap_mode);

Set the marker's text color.

`marker` : | The marker
`wrap_mode` : | The marker's wrap.

Since 0.4

### champlain_marker_get_wrap_mode ()

    PangoWrapMode       champlain_marker_get_wrap_mode      (ChamplainMarker *marker);

Get the marker's text wrap mode.

`marker` : | The marker
Returns : | the marker's text wrap mode.

Since 0.4

### champlain_marker_set_attributes ()

    void                champlain_marker_set_attributes     (ChamplainMarker *marker,
                                                             PangoAttrList *list);

Set the marker's text attribute.

`marker` : | The marker
`list` : | The marker's text attributes.

Since 0.4

### champlain_marker_set_single_line_mode ()

    void                champlain_marker_set_single_line_mode
                                                            (ChamplainMarker *marker,
                                                             gboolean mode);

Set if the marker's text is on a single line.

`marker` : | The marker
`mode` : | The marker's single line mode

Since 0.4

### champlain_marker_get_single_line_mode ()

    gboolean            champlain_marker_get_single_line_mode
                                                            (ChamplainMarker *marker);

Checks the marker's single line mode.

`marker` : | The marker
Returns : | the marker's text single line mode.

Since 0.4

### champlain_marker_set_ellipsize ()

    void                champlain_marker_set_ellipsize      (ChamplainMarker *marker,
                                                             PangoEllipsizeMode mode);

Set the marker's text ellipsize mode.

`marker` : | The marker
`mode` : | The marker's ellipsize mode.

Since 0.4

### champlain_marker_get_ellipsize ()

    PangoEllipsizeMode  champlain_marker_get_ellipsize      (ChamplainMarker *marker);

Get the marker's text ellipsize mode.

`marker` : | The marker
Returns : | the marker's text ellipsize mode.

Since 0.4

### champlain_marker_set_draw_background ()

    void                champlain_marker_set_draw_background
                                                            (ChamplainMarker *marker,
                                                             gboolean background);

Set if the marker has a background.

`marker` : | The marker
`background` : | value.

Since 0.4

### champlain_marker_get_draw_background ()

    gboolean            champlain_marker_get_draw_background
                                                            (ChamplainMarker *marker);

Checks whether the marker has a background.

`marker` : | The marker
Returns : | if the marker's has a background.

Since 0.4

### champlain_marker_set_highlight_text_color ()

    void                champlain_marker_set_highlight_text_color
                                                            (ClutterColor *color);

Changes the highlight text color, this is to ensure a better integration with the desktop, this is automatically done by GtkChamplainEmbed.

`color` : | a ClutterColor

Since 0.4

### champlain_marker_get_highlight_text_color ()

    const ClutterColor * champlain_marker_get_highlight_text_color
                                                            (void);

Gets the highlight text color.

Returns : | the highlight text color. Should not be freed.

Since 0.4.1

### champlain_marker_set_highlight_color ()

    void                champlain_marker_set_highlight_color
                                                            (ClutterColor *color);

Changes the highlight color, this is to ensure a better integration with the desktop, this is automatically done by GtkChamplainEmbed.

`color` : | a ClutterColor

Since 0.4

### champlain_marker_get_highlight_color ()

    const ClutterColor * champlain_marker_get_highlight_color
                                                            (void);

Gets the highlight color.

Returns : | the highlight color. Should not be freed.

Since 0.4.1

### champlain_marker_queue_redraw ()

    void                champlain_marker_queue_redraw       (ChamplainMarker *marker);

Queue a redraw of the marker as soon as possible. This function should not be used unless you are subclassing ChamplainMarker and adding new properties that affect the aspect of the marker. When they change, call this function to update the marker.

`marker` : | a ChamplainMarker

Since 0.4.3

## Property Details

### The `"alignment"` property

      "alignment"                PangoAlignment        : Read / Write

The marker's alignment

Default value: PANGO_ALIGN_LEFT

Since 0.4

### The `"color"` property

      "color"                    ClutterColor*         : Read / Write

The marker's color

Since 0.4

### The `"draw-background"` property

      "draw-background"          gboolean              : Read / Write

If the marker has a background

Default value: TRUE

Since 0.4

### The `"ellipsize"` property

      "ellipsize"                PangoEllipsizeMode    : Read / Write

The marker's ellipsize mode

Default value: PANGO_ELLIPSIZE_NONE

Since 0.4

### The `"font-name"` property

      "font-name"                gchar*                : Read / Write

The marker's text font name

Default value: "Sans 11"

Since 0.4

### The `"image"` property

      "image"                    ClutterActor*         : Read / Write

The image of the marker

Since 0.4

### The `"single-line-mode"` property

      "single-line-mode"         gboolean              : Read / Write

If the marker is in single line mode

Default value: TRUE

Since 0.4

### The `"text"` property

      "text"                     gchar*                : Read / Write

The text of the marker

Default value: ""

Since 0.4

### The `"text-color"` property

      "text-color"               ClutterColor*         : Read / Write

The marker's text color

Since 0.4

### The `"use-markup"` property

      "use-markup"               gboolean              : Read / Write

If the marker's text uses markup

Default value: FALSE

Since 0.4

### The `"wrap"` property

      "wrap"                     gboolean              : Read / Write

If the marker's text wrap is set

Default value: FALSE

Since 0.4

### The `"wrap-mode"` property

      "wrap-mode"                PangoWrapMode         : Read / Write

The marker's text wrap mode

Default value: PANGO_WRAP_WORD

Since 0.4