[gnome-calendar] subscriber-view: add ::clear_state to reset widget
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] subscriber-view: add ::clear_state to reset widget
- Date: Mon, 5 Jan 2015 16:08:12 +0000 (UTC)
commit 6989eb36c53bea533495e2071245aa6be7e16401
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Tue Dec 30 10:22:24 2014 -0500
subscriber-view: add ::clear_state to reset widget
GcalSubscriberView::clear_state is implemented by descendants to reset
the state of the drawing
src/gcal-subscriber-view.c | 17 ++++++++++++++++-
src/gcal-subscriber-view.h | 5 +++--
2 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/src/gcal-subscriber-view.c b/src/gcal-subscriber-view.c
index eabe3ca..25e346e 100644
--- a/src/gcal-subscriber-view.c
+++ b/src/gcal-subscriber-view.c
@@ -56,6 +56,8 @@ static gboolean gcal_subscriber_view_is_child_multicell (GcalSubscr
static guint gcal_subscriber_view_get_child_cell (GcalSubscriberView
*subscriber,
GcalEventWidget
*child);
+static void gcal_subscriber_view_clear_state (GcalSubscriberView
*subscriber_view);
+
static void gcal_subscriber_view_component_added (ECalDataModelSubscriber *subscriber,
ECalClient *client,
ECalComponent *comp);
@@ -82,7 +84,8 @@ static void
event_activated (GcalEventWidget *widget,
gpointer user_data)
{
- /* FIXME: clear_widget marks + popover + any state */
+ /* FIXME: implement clear_state vfunc in descendants */
+ gcal_subscriber_view_clear_state (GCAL_SUBSCRIBER_VIEW (user_data));
g_signal_emit (GCAL_SUBSCRIBER_VIEW (user_data), signals[EVENT_ACTIVATED], 0, widget);
}
@@ -320,6 +323,18 @@ gcal_subscriber_view_get_child_cell (GcalSubscriberView *subscriber,
return 0;
}
+static void
+gcal_subscriber_view_clear_state (GcalSubscriberView *subscriber_view)
+{
+ GcalSubscriberViewClass *klass;
+
+ g_return_if_fail (GCAL_IS_SUBSCRIBER_VIEW (subscriber_view));
+
+ klass = GCAL_SUBSCRIBER_VIEW_GET_CLASS (subscriber_view);
+ if (klass->clear_state)
+ klass->clear_state (subscriber_view);
+}
+
/* ECalDataModelSubscriber interface API */
static void
gcal_subscriber_view_component_added (ECalDataModelSubscriber *subscriber,
diff --git a/src/gcal-subscriber-view.h b/src/gcal-subscriber-view.h
index b3831c8..d052ca1 100644
--- a/src/gcal-subscriber-view.h
+++ b/src/gcal-subscriber-view.h
@@ -53,8 +53,9 @@ struct _GcalSubscriberViewClass
void (*event_activated) (GcalSubscriberView *subscriber_view, GcalEventWidget *event_widget);
/*< public >*/
- gboolean (*is_child_multicell) (GcalSubscriberView *subscriber, GcalEventWidget *child);
- guint (*get_child_cell) (GcalSubscriberView *subscriber, GcalEventWidget *child);
+ gboolean (*is_child_multicell) (GcalSubscriberView *subscriber_view, GcalEventWidget *child);
+ guint (*get_child_cell) (GcalSubscriberView *subscriber_view, GcalEventWidget *child);
+ void (*clear_state) (GcalSubscriberView *subscriber_view);
/* gcal-view replacements */
GtkWidget* (*get_child_by_uuid) (GcalSubscriberView *subscriber_view, const gchar *uuid);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]