Verified Commit a41c6de4 authored by James Westman's avatar James Westman
Browse files

simple-map: Add map property

parent d4f26428
......@@ -60,6 +60,7 @@ enum {
PROP_LICENSE,
PROP_SCALE,
PROP_SHOW_ZOOM_BUTTONS,
PROP_MAP,
N_PROPS
};
......@@ -118,6 +119,10 @@ shumate_simple_map_get_property (GObject *object,
g_value_set_boolean (value, shumate_simple_map_get_show_zoom_buttons (self));
break;
case PROP_MAP:
g_value_set_object (value, shumate_simple_map_get_map (self));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
......@@ -242,6 +247,13 @@ shumate_simple_map_class_init (ShumateSimpleMapClass *klass)
SHUMATE_TYPE_SCALE,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
properties[PROP_MAP] =
g_param_spec_object ("map",
"Map",
"Map",
SHUMATE_TYPE_MAP,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
properties[PROP_SHOW_ZOOM_BUTTONS] =
g_param_spec_boolean ("show-zoom-buttons",
"Show zoom buttons",
......@@ -511,6 +523,23 @@ shumate_simple_map_get_show_zoom_buttons (ShumateSimpleMap *self)
}
/**
* shumate_simple_map_get_map:
* @self: a [class@SimpleMap]
*
* Gets the [class@SimpleMap]'s underlying [class@Map].
*
* Returns: (transfer none): a [class@Map]
*/
ShumateMap *
shumate_simple_map_get_map (ShumateSimpleMap *self)
{
g_return_val_if_fail (SHUMATE_IS_SIMPLE_MAP (self), NULL);
return self->map;
}
/**
* shumate_simple_map_set_show_zoom_buttons:
* @self: a [class@SimpleMap]
......
......@@ -18,6 +18,7 @@
#pragma once
#include <gtk/gtk.h>
#include <shumate/shumate-map.h>
#include <shumate/shumate-map-source.h>
#include <shumate/shumate-layer.h>
#include <shumate/shumate-compass.h>
......@@ -56,4 +57,6 @@ gboolean shumate_simple_map_get_show_zoom_buttons (ShumateSimpleMap *se
void shumate_simple_map_set_show_zoom_buttons (ShumateSimpleMap *self,
gboolean show_zoom_buttons);
ShumateMap *shumate_simple_map_get_map (ShumateSimpleMap *self);
G_END_DECLS
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment