:right-sidebar: True PathLayer =================================================================== .. currentmodule:: gi.repository.Shumate .. class:: PathLayer(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Shumate.Layer`, :class:`~gi.repository.Gtk.Widget`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` Implemented Interfaces: :class:`~gi.repository.Gtk.Accessible`, :class:`~gi.repository.Gtk.Buildable`, :class:`~gi.repository.Gtk.ConstraintTarget` A layer displaying line path between inserted :obj:`~gi.repository.Shumate.Location` objects This layer shows a connection between inserted objects implementing the :obj:`~gi.repository.Shumate.Location` interface. This means that both :obj:`~gi.repository.Shumate.Marker` objects and :obj:`~gi.repository.Shumate.Coordinate` objects can be inserted into the layer. Of course, custom objects implementing the :obj:`~gi.repository.Shumate.Location` interface can be used as well. Constructors ------------ .. rst-class:: interim-class .. class:: PathLayer :no-index: .. classmethod:: new(viewport: ~gi.repository.Shumate.Viewport) -> ~gi.repository.Shumate.PathLayer Creates a new instance of :obj:`~gi.repository.Shumate.PathLayer`\. :param viewport: the :obj:`~gi.repository.Shumate.Viewport` Methods ------- .. rst-class:: interim-class .. class:: PathLayer :no-index: .. method:: add_node(location: ~gi.repository.Shumate.Location) -> None Adds a :obj:`~gi.repository.Shumate.Location` object to the layer. The node is prepended to the list. :param location: a :obj:`~gi.repository.Shumate.Location` .. method:: get_closed() -> bool Gets information whether the path is closed. .. method:: get_dash() -> list[int] Returns the list of dash segment lengths. .. method:: get_fill() -> bool Checks whether the path is filled. .. method:: get_fill_color() -> ~gi.repository.Gdk.RGBA Gets the path's fill color. .. method:: get_nodes() -> list[~gi.repository.Shumate.Location] Gets a copy of the list of all :obj:`~gi.repository.Shumate.Location` objects inserted into the layer. You should free the list but not its contents. .. method:: get_outline_color() -> ~gi.repository.Gdk.RGBA Gets the path's outline color. .. method:: get_outline_width() -> float Gets the width of the outline. .. method:: get_stroke() -> bool Checks whether the path is stroked. .. method:: get_stroke_color() -> ~gi.repository.Gdk.RGBA Gets the path's stroke color. .. method:: get_stroke_width() -> float Gets the width of the stroke. .. method:: insert_node(location: ~gi.repository.Shumate.Location, position: int) -> None Inserts a :obj:`~gi.repository.Shumate.Location` object to the specified position. :param location: a :obj:`~gi.repository.Shumate.Location` :param position: position in the list where the :obj:`~gi.repository.Shumate.Location` object should be inserted .. method:: remove_all() -> None Removes all :obj:`~gi.repository.Shumate.Location` objects from the layer. .. method:: remove_node(location: ~gi.repository.Shumate.Location) -> None Removes the :obj:`~gi.repository.Shumate.Location` object from the layer. :param location: a :obj:`~gi.repository.Shumate.Location` .. method:: set_closed(value: bool) -> None Makes the path closed. :param value: :const:`True` to make the path closed .. method:: set_dash(dash_pattern: list[int]) -> None Sets dashed line pattern in a way similar to cairo_set_dash() of cairo. This method supports only integer values for segment lengths. The values have to be passed inside the data pointer of the list (using the %GUINT_TO_POINTER conversion) Pass :const:`None` to use solid line. :param dash_pattern: list of integer values representing lengths of dashes/spaces (see cairo documentation of cairo_set_dash()) .. method:: set_fill(value: bool) -> None Sets the path to be filled :param value: if the path is filled .. method:: set_fill_color(color: ~gi.repository.Gdk.RGBA | None = None) -> None Set the path's fill color. :param color: The path's fill color or :const:`None` to reset to the default color. The color parameter is copied. .. method:: set_outline_color(color: ~gi.repository.Gdk.RGBA | None = None) -> None Set the path's outline color. :param color: The path's outline color or :const:`None` to reset to the default color. The color parameter is copied. .. method:: set_outline_width(value: float) -> None Sets the width of the outline :param value: the width of the outline (in pixels) .. method:: set_stroke(value: bool) -> None Sets the path to be stroked :param value: if the path is stroked .. method:: set_stroke_color(color: ~gi.repository.Gdk.RGBA | None = None) -> None Set the path's stroke color. :param color: The path's stroke color or :const:`None` to reset to the default color. The color parameter is copied. .. method:: set_stroke_width(value: float) -> None Sets the width of the stroke :param value: the width of the stroke (in pixels) Properties ---------- .. rst-class:: interim-class .. class:: PathLayer :no-index: .. attribute:: props.closed :type: bool The type of the None singleton. .. attribute:: props.fill :type: bool The type of the None singleton. .. attribute:: props.fill_color :type: ~gi.repository.Gdk.RGBA The type of the None singleton. .. attribute:: props.outline_color :type: ~gi.repository.Gdk.RGBA The type of the None singleton. .. attribute:: props.outline_width :type: float The type of the None singleton. .. attribute:: props.stroke :type: bool The type of the None singleton. .. attribute:: props.stroke_color :type: ~gi.repository.Gdk.RGBA The type of the None singleton. .. attribute:: props.stroke_width :type: float The type of the None singleton.