[gnome-calendar] gcal-view: cleaned GcalView API



commit a5157748bc4f6b89279243ff9b7add412bbb8cf7
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Fri Jun 14 11:15:47 2013 -0400

    gcal-view: cleaned GcalView API
    
    Removed GcalView:remove_by_uuid method.
    Reordered gcal-view header file.

 TODO                  |    2 --
 src/gcal-month-view.c |    1 -
 src/gcal-view.c       |   40 ++++++++++++++++++++--------------------
 src/gcal-view.h       |   15 ++++++---------
 src/gcal-week-view.c  |    3 +--
 src/gcal-year-view.c  |   14 ++++++--------
 6 files changed, 33 insertions(+), 42 deletions(-)
---
diff --git a/TODO b/TODO
index c152114..f020575 100644
--- a/TODO
+++ b/TODO
@@ -14,8 +14,6 @@ TODO
  - Rework GcalViews to implement the new API (remove every "New API" comment)
  - Review views title string: "Year 2013", shouldn't say "Year"
  - Review gtk-styles.css file for actually working css definitions
- - Checkout the need ot GcalView:remove_by_uuid (could be replaced by)
-   GcalView:get_by_uuid ** gtk_widget_destroy
  - Add css file and svg image to resources files
  - Reorder funcs inside GcalWindow
  - Fix nav-button css to matches pushed-down state (font-color goes white)
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index c8f9db3..ae4823d 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -213,7 +213,6 @@ gcal_month_view_init (GcalMonthView *self)
 static void
 gcal_view_interface_init (GcalViewIface *iface)
 {
-  iface->remove_by_uuid = gcal_month_view_remove_by_uuid;
   iface->reposition_child = gcal_month_view_reposition_child;
 
   iface->clear_selection = gcal_month_view_clear_selection;
diff --git a/src/gcal-view.c b/src/gcal-view.c
index 20f760a..9302083 100644
--- a/src/gcal-view.c
+++ b/src/gcal-view.c
@@ -116,26 +116,6 @@ gcal_view_get_date (GcalView *view)
 }
 
 void
-gcal_view_remove_by_uuid (GcalView    *view,
-                          const gchar *uuid)
-{
-  g_return_if_fail (GCAL_IS_VIEW (view));
-  g_return_if_fail (GCAL_VIEW_GET_INTERFACE (view)->remove_by_uuid);
-
-  GCAL_VIEW_GET_INTERFACE (view)->remove_by_uuid (view, uuid);
-}
-
-GtkWidget*
-gcal_view_get_by_uuid (GcalView    *view,
-                       const gchar *uuid)
-{
-  g_return_val_if_fail (GCAL_IS_VIEW (view), NULL);
-  g_return_if_fail (GCAL_VIEW_GET_INTERFACE (view)->get_by_uuid);
-
-  return GCAL_VIEW_GET_INTERFACE (view)->get_by_uuid (view, uuid);
-}
-
-void
 gcal_view_reposition_child (GcalView    *view,
                             const gchar *uuid)
 {
@@ -282,3 +262,23 @@ gcal_view_get_right_header (GcalView *view)
 
   return GCAL_VIEW_GET_INTERFACE (view)->get_right_header (view);
 }
+
+/**
+ * gcal_view_get_by_uuid:
+ * @view: a #GcalView
+ * @uuid: the uuid of the event-widget
+ *
+ * The uuid is formed by source-uid:event-uid, and the widget with
+ * this uuid is fetched by this method
+ *
+ * Returns: a #GcalEventWidget as #GtkWidget
+ **/
+GtkWidget*
+gcal_view_get_by_uuid (GcalView    *view,
+                       const gchar *uuid)
+{
+  g_return_val_if_fail (GCAL_IS_VIEW (view), NULL);
+  g_return_if_fail (GCAL_VIEW_GET_INTERFACE (view)->get_by_uuid);
+
+  return GCAL_VIEW_GET_INTERFACE (view)->get_by_uuid (view, uuid);
+}
diff --git a/src/gcal-view.h b/src/gcal-view.h
index 871522b..2914a67 100644
--- a/src/gcal-view.h
+++ b/src/gcal-view.h
@@ -51,9 +51,6 @@ struct _GcalViewIface
   void            (*create_event)                       (GcalView *view, icaltimetype *start_span, 
icaltimetype *end_span, gdouble x, gdouble y);
   void            (*updated)                            (GcalView *view, icaltimetype *date);
 
-  /* Container functions related API */
-  void            (*remove_by_uuid)                     (GcalView *view, const gchar *uuid);
-  GtkWidget*      (*get_by_uuid)                        (GcalView *view, const gchar *uuid);
   void            (*reposition_child)                   (GcalView *view, const gchar *uuid);
 
 /* FIXME remove me in favor of the one below */
@@ -75,6 +72,9 @@ struct _GcalViewIface
   /* Update NavBar headings */
   gchar*          (*get_left_header)                    (GcalView     *view);
   gchar*          (*get_right_header)                   (GcalView     *view);
+
+  /* Container functions related API */
+  GtkWidget*      (*get_by_uuid)                        (GcalView *view, const gchar *uuid);
 };
 
 GType         gcal_view_get_type                      (void);
@@ -85,12 +85,6 @@ void          gcal_view_set_date                      (GcalView     *view,
 
 icaltimetype* gcal_view_get_date                      (GcalView     *view);
 
-void          gcal_view_remove_by_uuid                (GcalView     *view,
-                                                      const gchar  *uuid);
-
-GtkWidget*    gcal_view_get_by_uuid                   (GcalView     *view,
-                                                      const gchar  *uuid);
-
 void          gcal_view_reposition_child              (GcalView     *view,
                                                       const gchar  *uuid);
 
@@ -116,6 +110,9 @@ gchar*        gcal_view_get_left_header               (GcalView     *view);
 
 gchar*        gcal_view_get_right_header              (GcalView     *view);
 
+GtkWidget*    gcal_view_get_by_uuid                   (GcalView     *view,
+                                                      const gchar  *uuid);
+
 G_END_DECLS
 
 #endif /* __GCAL_MONTH_VIEW_H__ */
diff --git a/src/gcal-week-view.c b/src/gcal-week-view.c
index ac84e7e..669e08f 100644
--- a/src/gcal-week-view.c
+++ b/src/gcal-week-view.c
@@ -236,9 +236,8 @@ gcal_view_interface_init (GcalViewIface *iface)
 {
   iface->get_initial_date = gcal_week_view_get_initial_date;
   iface->get_final_date = gcal_week_view_get_final_date;
-
   iface->contains_date = gcal_week_view_contains_date;
-  iface->remove_by_uuid = gcal_week_view_remove_by_uuid;
+
   iface->get_by_uuid = gcal_week_view_get_by_uuid;
 }
 
diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c
index cfc0a5f..2f48655 100644
--- a/src/gcal-year-view.c
+++ b/src/gcal-year-view.c
@@ -208,21 +208,19 @@ gcal_year_view_init (GcalYearView *self)
 static void
 gcal_view_interface_init (GcalViewIface *iface)
 {
-  iface->get_initial_date = gcal_year_view_get_initial_date;
-  iface->get_final_date = gcal_year_view_get_final_date;
-
-  iface->contains_date = gcal_year_view_contains_date;
-  iface->remove_by_uuid = gcal_year_view_remove_by_uuid;
-  iface->get_by_uuid = gcal_year_view_get_by_uuid;
   iface->reposition_child = gcal_year_view_reposition_child;
-
   iface->clear_selection = gcal_year_view_clear_selection;
-
   iface->create_event_on_current_unit = gcal_year_view_create_event_on_current_unit;
 
   /* New API */
+  iface->get_initial_date = gcal_year_view_get_initial_date;
+  iface->get_final_date = gcal_year_view_get_final_date;
+  iface->contains_date = gcal_year_view_contains_date;
+
   iface->get_left_header = gcal_year_view_get_left_header;
   iface->get_right_header = gcal_year_view_get_right_header;
+
+  iface->get_by_uuid = gcal_year_view_get_by_uuid;
 }
 
 static void


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