Shumate.MarkerLayer

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Shumate.Layer Shumate.Layer Gtk.Widget->Shumate.Layer Shumate.MarkerLayer Shumate.MarkerLayer Shumate.Layer->Shumate.MarkerLayer

Subclasses:

None

Methods

Inherited:

Shumate.Layer (1), Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new (viewport)

class

new_full (viewport, mode)

add_marker (marker)

get_markers ()

get_selected ()

get_selection_mode ()

remove_all ()

remove_marker (marker)

select_all_markers ()

select_marker (marker)

set_selection_mode (mode)

unselect_all_markers ()

unselect_marker (marker)

Virtual Methods

Inherited:

Shumate.Layer (1), Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Shumate.Layer (1), Gtk.Widget (34), Gtk.Accessible (1)

Name

Type

Flags

Short Description

selection-mode

Gtk.SelectionMode

r/w

Determines the type of selection that will be performed.

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Short Description

marker-selected

Emitted when a marker in the layer is selected.

marker-unselected

Emitted when a marker in the layer is unselected.

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Class Details

class Shumate.MarkerLayer(**kwargs)
Bases:

Shumate.Layer

Abstract:

No

Structure:

Shumate.MarkerLayerClass

Displays markers on the map. It is responsible for positioning markers correctly, marker selections and group marker operations.

classmethod new(viewport)
Parameters:

viewport (Shumate.Viewport) – the ShumateViewport

Returns:

a new [class`MarkerLayer`] ready to be used as a container for the markers.

Return type:

Shumate.MarkerLayer

Creates a new instance of [class`MarkerLayer`].

classmethod new_full(viewport, mode)
Parameters:
Returns:

a new [class`MarkerLayer`] ready to be used as a container for the markers.

Return type:

Shumate.MarkerLayer

Creates a new instance of [class`MarkerLayer`] with the specified selection mode.

add_marker(marker)
Parameters:

marker (Shumate.Marker) – a [class`Marker`]

Adds the marker to the layer.

get_markers()
Returns:

the list

Return type:

[Shumate.Marker]

Gets a copy of the list of all markers inserted into the layer. You should free the list but not its contents.

get_selected()
Returns:

the list

Return type:

[Shumate.Marker]

Gets a list of selected markers in the layer.

get_selection_mode()
Returns:

the selection mode of the layer.

Return type:

Gtk.SelectionMode

Gets the selection mode of the layer.

remove_all()

Removes all markers from the layer.

remove_marker(marker)
Parameters:

marker (Shumate.Marker) – a [class`Marker`]

Removes the marker from the layer.

select_all_markers()

Selects all selectable markers in the layer.

select_marker(marker)
Parameters:

marker (Shumate.Marker) – a [class`Marker`] that is a child of self

Returns:

True if the marker is now selected, otherwise False

Return type:

bool

Selects a marker in this layer.

If [class`MarkerLayer`]:py:data::selection-mode<Shumate.MarkerLayer.props.selection_mode> is Gtk.SelectionMode.SINGLE or Gtk.SelectionMode.BROWSE, all other markers will be unselected. If the mode is Gtk.SelectionMode.NONE or marker is not selectable, nothing will happen.

set_selection_mode(mode)
Parameters:

mode (Gtk.SelectionMode) – a [enum`Gtk`.SelectionMode] value

Sets the selection mode of the layer.

NOTE: changing selection mode to Gtk.SelectionMode.NONE, Gtk.SelectionMode.SINGLE or Gtk.SelectionMode.BROWSE will clear all previously selected markers.

unselect_all_markers()

Unselects all markers in the layer.

unselect_marker(marker)
Parameters:

marker (Shumate.Marker) – a [class`Marker`] that is a child of self

Unselects a marker in this layer.

This works even if [class`MarkerLayer`]:py:data::selection-mode<Shumate.MarkerLayer.props.selection_mode> is Gtk.SelectionMode.BROWSE. Browse mode only prevents user interaction, not the program, from unselecting a marker.

Signal Details

Shumate.MarkerLayer.signals.marker_selected(marker_layer, marker)
Signal Name:

marker-selected

Flags:

RUN_LAST

Parameters:

Emitted when a marker in the layer is selected.

Shumate.MarkerLayer.signals.marker_unselected(marker_layer, marker)
Signal Name:

marker-unselected

Flags:

RUN_LAST

Parameters:

Emitted when a marker in the layer is unselected.

Property Details

Shumate.MarkerLayer.props.selection_mode
Name:

selection-mode

Type:

Gtk.SelectionMode

Default Value:

Gtk.SelectionMode.NONE

Flags:

READABLE, WRITABLE

Determines the type of selection that will be performed.