[gnome-calendar] gcal-view: added :clear vfunc



commit fcef0d64d1bca404c1391ff4fa3790a09e0971af
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Wed Jun 19 16:01:56 2013 -0400

    gcal-view: added :clear vfunc
    
    Added to prevent the need of a troubling implementation
    of GtkContainer:forall method in DayView and WeekView composited widgets

 src/gcal-view.c |   18 ++++++++++++++++++
 src/gcal-view.h |    3 +++
 2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-view.c b/src/gcal-view.c
index d23ebe5..268bb17 100644
--- a/src/gcal-view.c
+++ b/src/gcal-view.c
@@ -266,3 +266,21 @@ gcal_view_get_by_uuid (GcalView    *view,
 
   return GCAL_VIEW_GET_INTERFACE (view)->get_by_uuid (view, uuid);
 }
+
+/**
+ * gcal_view_clear:
+ * @view: a #GcalView object
+ *
+ * Destroy every children inside the view.
+ *
+ * Note: this is a hack because of not-working container code
+ * for day and week view composited widgets.
+ **/
+void
+gcal_view_clear (GcalView *view)
+{
+  g_return_if_fail (GCAL_IS_VIEW (view));
+  g_return_if_fail (GCAL_VIEW_GET_INTERFACE (view)->clear);
+
+  GCAL_VIEW_GET_INTERFACE (view)->clear (view);
+}
diff --git a/src/gcal-view.h b/src/gcal-view.h
index 1c16f48..4274eb9 100644
--- a/src/gcal-view.h
+++ b/src/gcal-view.h
@@ -72,6 +72,7 @@ struct _GcalViewIface
   /* Container functions related API */
   gboolean        (*draw_event)                         (GcalView *view, icaltimetype *start_date, 
icaltimetype *end_date);
   GtkWidget*      (*get_by_uuid)                        (GcalView *view, const gchar *uuid);
+  void            (*clear)                              (GcalView *view);
 };
 
 GType         gcal_view_get_type                      (void);
@@ -108,6 +109,8 @@ gboolean      gcal_view_draw_event                    (GcalView     *view,
 GtkWidget*    gcal_view_get_by_uuid                   (GcalView     *view,
                                                       const gchar  *uuid);
 
+void          gcal_view_clear                         (GcalView     *view);
+
 G_END_DECLS
 
 #endif /* __GCAL_MONTH_VIEW_H__ */


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