ChamplainLabel

## ChamplainLabel ChamplainLabel — A label to identify points of interest on a map |

## Synopsis

    struct              ChamplainLabel;
    ClutterActor *      champlain_label_new                 (void);
    ClutterActor *      champlain_label_new_with_text       (const gchar *text,
                                                             const gchar *font,
                                                             ClutterColor *text_color,
                                                             ClutterColor *label_color);
    ClutterActor *      champlain_label_new_with_image      (ClutterActor *actor);
    ClutterActor *      champlain_label_new_from_file       (const gchar *filename,
                                                             GError **error);
    ClutterActor *      champlain_label_new_full            (const gchar *text,
                                                             ClutterActor *actor);
    void                champlain_label_set_text            (ChamplainLabel *label,
                                                             const gchar *text);
    void                champlain_label_set_image           (ChamplainLabel *label,
                                                             ClutterActor *image);
    void                champlain_label_set_use_markup      (ChamplainLabel *label,
                                                             gboolean use_markup);
    void                champlain_label_set_alignment       (ChamplainLabel *label,
                                                             PangoAlignment alignment);
    void                champlain_label_set_color           (ChamplainLabel *label,
                                                             const ClutterColor *color);
    void                champlain_label_set_text_color      (ChamplainLabel *label,
                                                             const ClutterColor *color);
    void                champlain_label_set_font_name       (ChamplainLabel *label,
                                                             const gchar *font_name);
    void                champlain_label_set_wrap            (ChamplainLabel *label,
                                                             gboolean wrap);
    void                champlain_label_set_wrap_mode       (ChamplainLabel *label,
                                                             PangoWrapMode wrap_mode);
    void                champlain_label_set_attributes      (ChamplainLabel *label,
                                                             PangoAttrList *list);
    void                champlain_label_set_single_line_mode
                                                            (ChamplainLabel *label,
                                                             gboolean mode);
    void                champlain_label_set_ellipsize       (ChamplainLabel *label,
                                                             PangoEllipsizeMode mode);
    void                champlain_label_set_draw_background (ChamplainLabel *label,
                                                             gboolean background);
    gboolean            champlain_label_get_use_markup      (ChamplainLabel *label);
    const gchar *       champlain_label_get_text            (ChamplainLabel *label);
    ClutterActor *      champlain_label_get_image           (ChamplainLabel *label);
    PangoAlignment      champlain_label_get_alignment       (ChamplainLabel *label);
    ClutterColor *      champlain_label_get_color           (ChamplainLabel *label);
    ClutterColor *      champlain_label_get_text_color      (ChamplainLabel *label);
    const gchar *       champlain_label_get_font_name       (ChamplainLabel *label);
    gboolean            champlain_label_get_wrap            (ChamplainLabel *label);
    PangoWrapMode       champlain_label_get_wrap_mode       (ChamplainLabel *label);
    PangoEllipsizeMode  champlain_label_get_ellipsize       (ChamplainLabel *label);
    gboolean            champlain_label_get_single_line_mode
                                                            (ChamplainLabel *label);
    gboolean            champlain_label_get_draw_background (ChamplainLabel *label);
    PangoAttrList *     champlain_label_get_attributes      (ChamplainLabel *label);

## Object Hierarchy

      GObject
       +----GInitiallyUnowned
             +----ClutterActor
                   +----ChamplainMarker
                         +----ChamplainLabel

## Implemented Interfaces

ChamplainLabel implements ClutterContainer, ClutterScriptable, ClutterAnimatable, AtkImplementorIface and ChamplainLocation.

## 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 ChamplainMarkerLayer). 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_location_set_location.

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

## Details

### struct ChamplainLabel

    struct ChamplainLabel;

The ChamplainLabel structure contains only private data and should be accessed using the provided API

Since 0.10

### champlain_label_new ()

    ClutterActor *      champlain_label_new                 (void);

Creates a new instance of ChamplainLabel.

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

Since 0.10

### champlain_label_new_with_text ()

    ClutterActor *      champlain_label_new_with_text       (const gchar *text,
                                                             const gchar *font,
                                                             ClutterColor *text_color,
                                                             ClutterColor *label_color);

Creates a new instance of ChamplainLabel with text value.

`text` : | the text of the label
`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]
`label_color` : | a ClutterColor, the color of the label, can be NULL. [allow-none]
Returns : | a new ChamplainLabel with a drawn label containing the given text.

Since 0.10

### champlain_label_new_with_image ()

    ClutterActor *      champlain_label_new_with_image      (ClutterActor *actor);

Creates a new instance of ChamplainLabel with image.

`actor` : | The image as a `ClutterActor`.
Returns : | a new ChamplainLabel with a drawn label containing the given image.

Since 0.10

### champlain_label_new_from_file ()

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

Creates a new instance of ChamplainLabel with image loaded from file.

`filename` : | The filename of the image.
`error` : | Return location for an error.
Returns : | a new ChamplainLabel with a drawn label containing the given image.

Since 0.10

### champlain_label_new_full ()

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

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

`text` : | The text of the label
`actor` : | The image as a `ClutterActor`
Returns : | a new ChamplainLabel with a drawn label containing the given image.

Since 0.10

### champlain_label_set_text ()

    void                champlain_label_set_text            (ChamplainLabel *label,
                                                             const gchar *text);

Sets the label's text.

`label` : | a ChamplainLabel
`text` : | The new text of the label

Since 0.10

### champlain_label_set_image ()

    void                champlain_label_set_image           (ChamplainLabel *label,
                                                             ClutterActor *image);

Sets the label's image.

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

Since 0.10

### champlain_label_set_use_markup ()

    void                champlain_label_set_use_markup      (ChamplainLabel *label,
                                                             gboolean use_markup);

Sets if the label's text uses markup.

`label` : | a ChamplainLabel
`use_markup` : | The value

Since 0.10

### champlain_label_set_alignment ()

    void                champlain_label_set_alignment       (ChamplainLabel *label,
                                                             PangoAlignment alignment);

Sets the label's text alignment.

`label` : | a ChamplainLabel
`alignment` : | The label's alignment

Since 0.10

### champlain_label_set_color ()

    void                champlain_label_set_color           (ChamplainLabel *label,
                                                             const ClutterColor *color);

Sets the label's background color.

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

Since 0.10

### champlain_label_set_text_color ()

    void                champlain_label_set_text_color      (ChamplainLabel *label,
                                                             const ClutterColor *color);

Sets the label's text color.

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

Since 0.10

### champlain_label_set_font_name ()

    void                champlain_label_set_font_name       (ChamplainLabel *label,
                                                             const gchar *font_name);

Sets the label's font name such as "Sans 12".

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

Since 0.10

### champlain_label_set_wrap ()

    void                champlain_label_set_wrap            (ChamplainLabel *label,
                                                             gboolean wrap);

Sets if the label's text wrap.

`label` : | a ChamplainLabel
`wrap` : | The label's wrap.

Since 0.10

### champlain_label_set_wrap_mode ()

    void                champlain_label_set_wrap_mode       (ChamplainLabel *label,
                                                             PangoWrapMode wrap_mode);

Sets the label's text wrap mode.

`label` : | a ChamplainLabel
`wrap_mode` : | The label's wrap mode.

Since 0.10

### champlain_label_set_attributes ()

    void                champlain_label_set_attributes      (ChamplainLabel *label,
                                                             PangoAttrList *list);

Sets the label's text attributes.

`label` : | a ChamplainLabel
`list` : | The label's text attributes.

Since 0.10

### champlain_label_set_single_line_mode ()

    void                champlain_label_set_single_line_mode
                                                            (ChamplainLabel *label,
                                                             gboolean mode);

Sets if the label's text is on a single line.

`label` : | a ChamplainLabel
`mode` : | The label's single line mode

Since 0.10

### champlain_label_set_ellipsize ()

    void                champlain_label_set_ellipsize       (ChamplainLabel *label,
                                                             PangoEllipsizeMode mode);

Sets the label's text ellipsize mode.

`label` : | a ChamplainLabel
`mode` : | The label's ellipsize mode.

Since 0.10

### champlain_label_set_draw_background ()

    void                champlain_label_set_draw_background (ChamplainLabel *label,
                                                             gboolean background);

Sets if the label has a background.

`label` : | a ChamplainLabel
`background` : | value.

Since 0.10

### champlain_label_get_use_markup ()

    gboolean            champlain_label_get_use_markup      (ChamplainLabel *label);

Check whether the label uses markup.

`label` : | a ChamplainLabel
Returns : | if the label's text contains markup.

Since 0.10

### champlain_label_get_text ()

    const gchar *       champlain_label_get_text            (ChamplainLabel *label);

Get the label's text.

`label` : | a ChamplainLabel
Returns : | the label's text.

Since 0.10

### champlain_label_get_image ()

    ClutterActor *      champlain_label_get_image           (ChamplainLabel *label);

Get the label's image.

`label` : | a ChamplainLabel
Returns : | the label's image. [transfer none]

Since 0.10

### champlain_label_get_alignment ()

    PangoAlignment      champlain_label_get_alignment       (ChamplainLabel *label);

Get the label's text alignment.

`label` : | a ChamplainLabel
Returns : | the label's text alignment.

Since 0.10

### champlain_label_get_color ()

    ClutterColor *      champlain_label_get_color           (ChamplainLabel *label);

Gets the label's background color.

`label` : | a ChamplainLabel
Returns : | the label's background color.

Since 0.10

### champlain_label_get_text_color ()

    ClutterColor *      champlain_label_get_text_color      (ChamplainLabel *label);

Gets the label's text color.

`label` : | a ChamplainLabel
Returns : | the label's text color.

Since 0.10

### champlain_label_get_font_name ()

    const gchar *       champlain_label_get_font_name       (ChamplainLabel *label);

Gets the label's font name.

`label` : | a ChamplainLabel
Returns : | the label's font name.

Since 0.10

### champlain_label_get_wrap ()

    gboolean            champlain_label_get_wrap            (ChamplainLabel *label);

Checks whether the label text wraps.

`label` : | a ChamplainLabel
Returns : | if the label's text wraps.

Since 0.10

### champlain_label_get_wrap_mode ()

    PangoWrapMode       champlain_label_get_wrap_mode       (ChamplainLabel *label);

Gets the label's text wrap mode.

`label` : | a ChamplainLabel
Returns : | the label's text wrap mode.

Since 0.10

### champlain_label_get_ellipsize ()

    PangoEllipsizeMode  champlain_label_get_ellipsize       (ChamplainLabel *label);

Gets the label's text ellipsize mode.

`label` : | a ChamplainLabel
Returns : | the label's text ellipsize mode.

Since 0.10

### champlain_label_get_single_line_mode ()

    gboolean            champlain_label_get_single_line_mode
                                                            (ChamplainLabel *label);

Checks the label's single line mode.

`label` : | a ChamplainLabel
Returns : | the label's text single line mode.

Since 0.10

### champlain_label_get_draw_background ()

    gboolean            champlain_label_get_draw_background (ChamplainLabel *label);

Checks whether the label has a background.

`label` : | a ChamplainLabel
Returns : | if the label's has a background.

Since 0.10

### champlain_label_get_attributes ()

    PangoAttrList *     champlain_label_get_attributes      (ChamplainLabel *label);

Gets the label's text attributes.

`label` : | a ChamplainLabel
Returns : | the label's text attributes.

Since 0.10

## Property Details

### The `"alignment"` property

      "alignment"                PangoAlignment        : Read / Write

The label's alignment

Default value: PANGO_ALIGN_LEFT

Since 0.10

### The `"color"` property

      "color"                    ClutterColor*         : Read / Write

The label's color

Since 0.10

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

      "draw-background"          gboolean              : Read / Write

If the label has a background

Default value: TRUE

Since 0.10

### The `"ellipsize"` property

      "ellipsize"                PangoEllipsizeMode    : Read / Write

The label's ellipsize mode

Default value: PANGO_ELLIPSIZE_NONE

Since 0.10

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

      "font-name"                gchar*                : Read / Write

The label's text font name

Default value: "Sans 11"

Since 0.10

### The `"image"` property

      "image"                    ClutterActor*         : Read / Write

The image of the label

Since 0.10

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

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

If the label is in single line mode

Default value: TRUE

Since 0.10

### The `"text"` property

      "text"                     gchar*                : Read / Write

The text of the label

Default value: ""

Since 0.10

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

      "text-color"               ClutterColor*         : Read / Write

The label's text color

Since 0.10

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

      "use-markup"               gboolean              : Read / Write

If the label's text uses markup

Default value: FALSE

Since 0.10

### The `"wrap"` property

      "wrap"                     gboolean              : Read / Write

If the label's text wrap is set

Default value: FALSE

Since 0.10

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

      "wrap-mode"                PangoWrapMode         : Read / Write

The label's text wrap mode

Default value: PANGO_WRAP_WORD

Since 0.10