ChamplainMarker

ChamplainMarker — Base class of libchamplain markers

Properties

gboolean draggable Read / Write
gboolean selectable Read / Write
gboolean selected Read / Write

Signals

void button-press Run Last
void button-release Run Last
void drag-finish Run Last
void drag-motion Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── ClutterActor
            ╰── ChamplainMarker
                ├── ChamplainCustomMarker
                ├── ChamplainLabel
                ╰── ChamplainPoint

Implemented Interfaces

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

Description

Markers represent 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 marker's position on the map using champlain_location_set_location. Don't forget to set the marker's pointer position using clutter_actor_set_translation.

This is a base class of all markers. libchamplain has a more evoluted type of markers with text and image support. See ChamplainLabel for more details.

Functions

champlain_marker_new ()

ClutterActor *
champlain_marker_new (void);

Creates an instance of ChamplainMarker.

Returns

a new ChamplainMarker.

Since 0.12.4


champlain_marker_set_selectable ()

void
champlain_marker_set_selectable (ChamplainMarker *marker,
                                 gboolean value);

Sets the marker as selectable or not.

Parameters

marker

a ChamplainMarker

 

value

the selectable state

 

Since 0.10


champlain_marker_get_selectable ()

gboolean
champlain_marker_get_selectable (ChamplainMarker *marker);

Checks whether the marker is selectable.

Parameters

marker

a ChamplainMarker

 

Returns

the selectable or not state of the marker.

Since 0.10


champlain_marker_set_draggable ()

void
champlain_marker_set_draggable (ChamplainMarker *marker,
                                gboolean value);

Sets the marker as draggable or not.

Parameters

marker

a ChamplainMarker

 

value

the draggable state

 

Since 0.10


champlain_marker_get_draggable ()

gboolean
champlain_marker_get_draggable (ChamplainMarker *marker);

Checks whether the marker is draggable.

Parameters

marker

a ChamplainMarker

 

Returns

the draggable or not state of the marker.

Since 0.10


champlain_marker_set_selected ()

void
champlain_marker_set_selected (ChamplainMarker *marker,
                               gboolean value);

Sets the marker as selected or not. This will affect the "Selected" look of the marker.

Parameters

marker

a ChamplainMarker

 

value

the selected state

 

Since 0.10


champlain_marker_get_selected ()

gboolean
champlain_marker_get_selected (ChamplainMarker *marker);

Checks whether the marker is selected.

Parameters

marker

a ChamplainMarker

 

Returns

the selected or not state of the marker.

Since 0.10


champlain_marker_animate_in ()

void
champlain_marker_animate_in (ChamplainMarker *marker);

Animates the marker as if it were falling from the sky onto the map.

Parameters

marker

a ChamplainMarker

 

Since 0.10


champlain_marker_animate_in_with_delay ()

void
champlain_marker_animate_in_with_delay
                               (ChamplainMarker *marker,
                                guint delay);

Animates the marker as if it were falling from the sky onto the map after delay.

Parameters

marker

a ChamplainMarker

 

delay

The delay in milliseconds

 

Since 0.10


champlain_marker_animate_out ()

void
champlain_marker_animate_out (ChamplainMarker *marker);

Animates the marker as if it were drawn through the sky.

Parameters

marker

a ChamplainMarker

 

Since 0.10


champlain_marker_animate_out_with_delay ()

void
champlain_marker_animate_out_with_delay
                               (ChamplainMarker *marker,
                                guint delay);

Animates the marker as if it were drawn through the sky after delay.

Parameters

marker

a ChamplainMarker

 

delay

The delay in milliseconds

 

Since 0.10


champlain_marker_get_selection_color ()

const ClutterColor *
champlain_marker_get_selection_color (void);

Gets the selection color.

Returns

the selection color. Should not be freed.

Since 0.10


champlain_marker_get_selection_text_color ()

const ClutterColor *
champlain_marker_get_selection_text_color
                               (void);

Gets the selection text color.

Returns

the selection text color. Should not be freed.

Since 0.10


champlain_marker_set_selection_color ()

void
champlain_marker_set_selection_color (ClutterColor *color);

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

Parameters

color

a ClutterColor

 

Since 0.10


champlain_marker_set_selection_text_color ()

void
champlain_marker_set_selection_text_color
                               (ClutterColor *color);

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

Parameters

color

a ClutterColor

 

Since 0.10

Types and Values

struct ChamplainMarker

struct ChamplainMarker;

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

Since 0.10

Property Details

The “draggable” property

  “draggable”                gboolean

The draggable state of the marker

Flags: Read / Write

Default value: FALSE

Since 0.10


The “selectable” property

  “selectable”               gboolean

The selectable state of the marker

Flags: Read / Write

Default value: FALSE

Since 0.10


The “selected” property

  “selected”                 gboolean

The selected state of the marker

Flags: Read / Write

Default value: FALSE

Since 0.10

Signal Details

The “button-press” signal

void
user_function (ChamplainMarker *self,
               ClutterEvent    *event,
               gpointer         user_data)

Emitted when button is pressed.

Parameters

self

a ChamplainMarker

 

event

the underlying ClutterEvent

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since 0.10


The “button-release” signal

void
user_function (ChamplainMarker *self,
               ClutterEvent    *event,
               gpointer         user_data)

Emitted when button is released. This signal is not emmitted at the end of dragging.

Parameters

self

a ChamplainMarker

 

event

the underlying ClutterEvent

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since 0.10


The “drag-finish” signal

void
user_function (ChamplainMarker *self,
               ClutterEvent    *event,
               gpointer         user_data)

Emitted when marker dragging ends (i.e. the button is released at the end of dragging).

Parameters

self

a ChamplainMarker

 

event

the underlying ClutterEvent

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since 0.10


The “drag-motion” signal

void
user_function (ChamplainMarker *self,
               gdouble          dx,
               gdouble          dy,
               ClutterEvent    *event,
               gpointer         user_data)

Emmitted when the marker is dragged by mouse. dx and dy specify by how much the marker has been dragged since last time.

Parameters

self

a ChamplainMarker

 

dx

by how much the marker has been moved in the x direction

 

dy

by how much the marker has been moved in the y direction

 

event

the underlying ClutterEvent

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since 0.10