]> err.no Git - libchamplain/commitdiff
New getters as in the bug 581786
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Mon, 11 May 2009 12:41:26 +0000 (14:41 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Tue, 12 May 2009 01:35:43 +0000 (21:35 -0400)
bindings/perl/Champlain/xs/ChamplainView.xs
champlain/champlain-view.c
champlain/champlain-view.h

index ea9d24351ce0b8e9bf474397dff2febd2a8b7103..caf403a77545dadeec64451a2c52f74d2c2b2fed 100644 (file)
@@ -23,7 +23,7 @@ champlain_view_zoom_in (ChamplainView *view)
 
 void
 champlain_view_zoom_out (ChamplainView *view)
-       
+
 
 void
 champlain_view_add_layer (ChamplainView *view, ChamplainLayer *layer)
@@ -104,3 +104,37 @@ champlain_view_ensure_markers_visible (ChamplainView *view, AV *av_markers, gboo
                
                champlain_view_ensure_markers_visible(view, markers, animate);
                g_free(markers);
+
+gint
+champlain_view_get_zoom_level (ChamplainView *view)
+
+
+gint
+champlain_view_get_min_zoom_level (ChamplainView *view)
+
+
+gint
+champlain_view_get_max_zoom_level (ChamplainView *view)
+
+
+ChamplainMapSource*
+champlain_view_get_map_source (ChamplainView *view)
+
+gdouble
+champlain_view_get_decel_rate (ChamplainView *view)
+
+
+ChamplainScrollMode
+champlain_view_get_scroll_mode (ChamplainView *view)
+
+
+gboolean
+champlain_view_get_keep_center_on_resize (ChamplainView *view)
+
+
+gboolean
+champlain_view_get_show_license (ChamplainView *view)
+
+
+gboolean
+champlain_view_get_zoom_on_double_click (ChamplainView *view)
index e3616bdf6963d8c210b31ad4b31d16a6d5995318..1de362c822bf3ffa2f93ac1a2c2406c8da12b8fe 100644 (file)
@@ -1963,3 +1963,164 @@ view_set_zoom_level_at (ChamplainView *view,
   g_object_notify (G_OBJECT (view), "zoom-level");
   return TRUE;
 }
+
+/**
+ * champlain_view_get_zoom_level:
+ * @view: The view
+ *
+ * Returns the view's current zoom level.
+ *
+ * Since: 0.4
+ */
+gint
+champlain_view_get_zoom_level (ChamplainView *view)
+{
+  g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), 0);
+
+  ChamplainViewPrivate *priv = view->priv;
+
+  return priv->zoom_level;
+}
+
+/**
+ * champlain_view_get_min_zoom_level:
+ * @view: The view
+ *
+ * Returns the view's minimal zoom level allowed.
+ *
+ * Since: 0.4
+ */
+gint
+champlain_view_get_min_zoom_level (ChamplainView *view)
+{
+  g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), 0);
+
+  ChamplainViewPrivate *priv = view->priv;
+
+  return priv->min_zoom_level;
+}
+
+/**
+ * champlain_view_get_max_zoom_level:
+ * @view: The view
+ *
+ * Returns the view's maximal zoom level allowed.
+ *
+ * Since: 0.4
+ */
+gint
+champlain_view_get_max_zoom_level (ChamplainView *view)
+{
+  g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), 0);
+
+  ChamplainViewPrivate *priv = view->priv;
+
+  return priv->max_zoom_level;
+}
+
+/**
+ * champlain_view_get_map_source:
+ * @view: The view
+ *
+ * Returns the view's current map source. If you need to keep a reference to the
+ * map source then you have to call #g_object_ref.
+ *
+ * Since: 0.4
+ */
+ChamplainMapSource*
+champlain_view_get_map_source (ChamplainView *view)
+{
+  g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), NULL);
+
+  ChamplainViewPrivate *priv = view->priv;
+
+  return priv->map_source;
+}
+
+/**
+ * champlain_view_get_decel_rate:
+ * @view: The view
+ *
+ * Returns the view's deceleration rate.
+ *
+ * Since: 0.4
+ */
+gdouble
+champlain_view_get_decel_rate (ChamplainView *view)
+{
+  g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), 0.0);
+
+  ChamplainViewPrivate *priv = view->priv;
+  gdouble decel = 0.0;
+  g_object_get (priv->finger_scroll, "decel-rate", &decel, NULL);
+  return decel;
+}
+
+/**
+ * champlain_view_get_scroll_mode:
+ * @view: The view
+ *
+ * Returns the view's scroll mode behaviour.
+ *
+ * Since: 0.4
+ */
+ChamplainScrollMode
+champlain_view_get_scroll_mode (ChamplainView *view)
+{
+  g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), CHAMPLAIN_SCROLL_MODE_PUSH);
+
+  ChamplainViewPrivate *priv = view->priv;
+  return priv->scroll_mode;
+}
+
+/**
+ * champlain_view_get_keep_center_on_resize:
+ * @view: The view
+ *
+ * Returns TRUE if the view keeps the center or resize.
+ *
+ * Since: 0.4
+ */
+gboolean
+champlain_view_get_keep_center_on_resize (ChamplainView *view)
+{
+  g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), FALSE);
+
+  ChamplainViewPrivate *priv = view->priv;
+  return priv->keep_center_on_resize;
+}
+
+/**
+ * champlain_view_get_keep_center_on_resize:
+ * @view: The view
+ *
+ * Returns TRUE if the view displays the license.
+ *
+ * Since: 0.4
+ */
+gboolean
+champlain_view_get_show_license (ChamplainView *view)
+{
+  g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), FALSE);
+
+  ChamplainViewPrivate *priv = view->priv;
+  return priv->show_license;
+}
+
+/**
+ * champlain_view_get_zoom_on_double_click:
+ * @view: The view
+ *
+ * Returns TRUE if the view zooms on double click.
+ *
+ * Since: 0.4
+ */
+gboolean
+champlain_view_get_zoom_on_double_click (ChamplainView *view)
+{
+  g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), FALSE);
+
+  ChamplainViewPrivate *priv = view->priv;
+  return priv->zoom_on_double_click;
+}
+
index 05763c0cbb98b42d83a7667d008e661e6bc7b16c..c998b609df767a04d866ae6c74266ebf8c08be84 100644 (file)
@@ -129,6 +129,16 @@ gboolean champlain_view_get_coords_at (ChamplainView *view,
     gdouble *lat,
     gdouble *lon);
 
+gint champlain_view_get_zoom_level (ChamplainView *view);
+gint champlain_view_get_min_zoom_level (ChamplainView *view);
+gint champlain_view_get_max_zoom_level (ChamplainView *view);
+ChamplainMapSource* champlain_view_get_map_source (ChamplainView *view);
+gdouble champlain_view_get_decel_rate (ChamplainView *view);
+ChamplainScrollMode champlain_view_get_scroll_mode (ChamplainView *view);
+gboolean champlain_view_get_keep_center_on_resize (ChamplainView *view);
+gboolean champlain_view_get_show_license (ChamplainView *view);
+gboolean champlain_view_get_zoom_on_double_click (ChamplainView *view);
+
 G_END_DECLS
 
 #endif