[libchamplain] Add some missing property accessor methods



commit 3b02bb7e84c0f86e7df43e281b16670a83bce744
Author: JiÅ?í Techet <techet gmail com>
Date:   Tue Mar 22 00:22:36 2011 +0100

    Add some missing property accessor methods

 champlain/champlain-label.c        |   19 +++++++++++
 champlain/champlain-label.h        |    1 +
 champlain/champlain-marker-layer.h |    3 +-
 champlain/champlain-path-layer.c   |   45 +++++++++++++++++++++++--
 champlain/champlain-path-layer.h   |    4 ++
 champlain/champlain-view.c         |   63 ++++++++++++++++++++++++++++++++++++
 champlain/champlain-view.h         |    3 ++
 7 files changed, 132 insertions(+), 6 deletions(-)
---
diff --git a/champlain/champlain-label.c b/champlain/champlain-label.c
index 2d7e253..7d22074 100644
--- a/champlain/champlain-label.c
+++ b/champlain/champlain-label.c
@@ -1603,3 +1603,22 @@ champlain_label_get_draw_background (ChamplainLabel *label)
 
   return label->priv->draw_background;
 }
+
+
+/**
+ * champlain_label_get_attributes:
+ * @label: The label
+ *
+ * Gets the label's text attributes.
+ *
+ * Returns: the label's text attributes.
+ *
+ * Since: 0.10
+ */
+PangoAttrList *
+champlain_label_get_attributes (ChamplainLabel *label)
+{
+  g_return_val_if_fail (CHAMPLAIN_IS_LABEL (label), NULL);
+
+  return label->priv->attributes;
+}
diff --git a/champlain/champlain-label.h b/champlain/champlain-label.h
index 195c476..4b4c9a3 100644
--- a/champlain/champlain-label.h
+++ b/champlain/champlain-label.h
@@ -121,6 +121,7 @@ PangoWrapMode champlain_label_get_wrap_mode (ChamplainLabel *label);
 PangoEllipsizeMode champlain_label_get_ellipsize (ChamplainLabel *label);
 gboolean champlain_label_get_single_line_mode (ChamplainLabel *label);
 gboolean champlain_label_get_draw_background (ChamplainLabel *label);
+PangoAttrList *champlain_label_get_attributes (ChamplainLabel *label);
 
 
 G_END_DECLS
diff --git a/champlain/champlain-marker-layer.h b/champlain/champlain-marker-layer.h
index aa58c1a..b830f94 100644
--- a/champlain/champlain-marker-layer.h
+++ b/champlain/champlain-marker-layer.h
@@ -110,8 +110,7 @@ void champlain_marker_layer_unselect_all_markers (ChamplainMarkerLayer *layer);
 
 void champlain_marker_layer_set_selection_mode (ChamplainMarkerLayer *layer,
     ChamplainSelectionMode mode);
-ChamplainSelectionMode champlain_marker_layer_get_selection_mode (
-    ChamplainMarkerLayer *layer);
+ChamplainSelectionMode champlain_marker_layer_get_selection_mode (ChamplainMarkerLayer *layer);
 
 G_END_DECLS
 
diff --git a/champlain/champlain-path-layer.c b/champlain/champlain-path-layer.c
index a536958..950a722 100644
--- a/champlain/champlain-path-layer.c
+++ b/champlain/champlain-path-layer.c
@@ -148,13 +148,11 @@ champlain_path_layer_set_property (GObject *object,
     G_GNUC_UNUSED const GValue *value,
     GParamSpec *pspec)
 {
-  ChamplainPathLayer *self = CHAMPLAIN_PATH_LAYER (object);
-  ChamplainPathLayerPrivate *priv = self->priv;
-
   switch (property_id)
     {
     case PROP_CLOSED_PATH:
-      priv->closed_path = g_value_get_boolean (value);
+      champlain_path_layer_set_closed (CHAMPLAIN_PATH_LAYER (object),
+          g_value_get_boolean (value));
       break;
 
     case PROP_FILL:
@@ -1086,3 +1084,42 @@ champlain_path_layer_get_visible (ChamplainPathLayer *layer)
 
   return layer->priv->visible;
 }
+
+
+/**
+ * champlain_path_layer_set_closed:
+ * @layer: a #ChamplainPathLayer
+ * @value: TRUE to make the path closed
+ *
+ * Makes the path closed.
+ *
+ * Since: 0.10
+ */
+void
+champlain_path_layer_set_closed (ChamplainPathLayer *layer,
+    gboolean value)
+{
+  g_return_if_fail (CHAMPLAIN_IS_PATH_LAYER (layer));
+
+  layer->priv->closed_path = value;
+  g_object_notify (G_OBJECT (layer), "closed");
+}
+
+
+/**
+ * champlain_path_layer_get_closed:
+ * @layer: a #ChamplainPathLayer
+ *
+ * Gets information whether the path is closed.
+ *
+ * Returns: TRUE when the path is closed, FALSE otherwise
+ *
+ * Since: 0.10
+ */
+gboolean
+champlain_path_layer_get_closed (ChamplainPathLayer *layer)
+{
+  g_return_val_if_fail (CHAMPLAIN_IS_PATH_LAYER (layer), FALSE);
+
+  return layer->priv->closed_path;
+}
diff --git a/champlain/champlain-path-layer.h b/champlain/champlain-path-layer.h
index bf9fe15..1a079b6 100644
--- a/champlain/champlain-path-layer.h
+++ b/champlain/champlain-path-layer.h
@@ -107,6 +107,10 @@ gboolean champlain_path_layer_get_visible (ChamplainPathLayer *layer);
 void champlain_path_layer_set_visible (ChamplainPathLayer *layer,
     gboolean value);
 
+gboolean champlain_path_layer_get_closed (ChamplainPathLayer *layer);
+void champlain_path_layer_set_closed (ChamplainPathLayer *layer,
+    gboolean value);
+
 G_END_DECLS
 
 #endif
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 30022c7..b8e4868 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -2615,3 +2615,66 @@ champlain_view_get_license_actor (ChamplainView *view)
 
   return CHAMPLAIN_LICENSE (view->priv->license_actor);
 }
+
+
+/**
+ * champlain_view_get_center_latitude:
+ * @view: The view
+ *
+ * Gets the latitude of the view's center.
+ *
+ * Returns: the latitude.
+ *
+ * Since: 0.10
+ */
+gdouble
+champlain_view_get_center_latitude (ChamplainView *view)
+{
+  DEBUG_LOG ()
+
+  g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), 0.0);
+
+  return view->priv->latitude;
+}
+
+
+/**
+ * champlain_view_get_center_longitude:
+ * @view: The view
+ *
+ * Gets the longitude of the view's center.
+ *
+ * Returns: the latitude.
+ *
+ * Since: 0.10
+ */
+gdouble
+champlain_view_get_center_longitude (ChamplainView *view)
+{
+  DEBUG_LOG ()
+
+  g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), 0.0);
+
+  return view->priv->longitude;
+}
+
+
+/**
+ * champlain_view_get_state:
+ * @view: The view
+ *
+ * Gets the view's state.
+ *
+ * Returns: the state.
+ *
+ * Since: 0.10
+ */
+ChamplainState
+champlain_view_get_state (ChamplainView *view)
+{
+  DEBUG_LOG ()
+
+  g_return_val_if_fail (CHAMPLAIN_IS_VIEW (view), CHAMPLAIN_STATE_NONE);
+
+  return view->priv->state;
+}
diff --git a/champlain/champlain-view.h b/champlain/champlain-view.h
index 8ab0b6e..5e6f2d0 100644
--- a/champlain/champlain-view.h
+++ b/champlain/champlain-view.h
@@ -79,6 +79,8 @@ void champlain_view_go_to (ChamplainView *view,
     gdouble latitude,
     gdouble longitude);
 void champlain_view_stop_go_to (ChamplainView *view);
+gdouble champlain_view_get_center_latitude (ChamplainView *view);
+gdouble champlain_view_get_center_longitude (ChamplainView *view);
 
 void champlain_view_zoom_in (ChamplainView *view);
 void champlain_view_zoom_out (ChamplainView *view);
@@ -119,6 +121,7 @@ gdouble champlain_view_get_deceleration (ChamplainView *view);
 gboolean champlain_view_get_kinetic_mode (ChamplainView *view);
 gboolean champlain_view_get_keep_center_on_resize (ChamplainView *view);
 gboolean champlain_view_get_zoom_on_double_click (ChamplainView *view);
+ChamplainState champlain_view_get_state (ChamplainView *view);
 
 void champlain_view_reload_tiles (ChamplainView *view);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]