From f89cf24d2093c9982e461a2478d0acb4eeacc408 Mon Sep 17 00:00:00 2001 From: Arturo Espinosa Date: Wed, 15 Apr 1998 07:59:09 +0000 Subject: Year view marks ranges of new dates (on update view). Recurrence iterator Year view marks ranges of new dates (on update view). Recurrence iterator functions are here now (clap, clap, clap). Microsoft Outlook's days are counted. Miguel. svn path=/trunk/; revision=139 --- calendar/cal-util/calobj.c | 18 +++++++++++++++++- calendar/cal-util/calobj.h | 12 ++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) (limited to 'calendar/cal-util') diff --git a/calendar/cal-util/calobj.c b/calendar/cal-util/calobj.c index f02feaf7a1..7e5f535189 100644 --- a/calendar/cal-util/calobj.c +++ b/calendar/cal-util/calobj.c @@ -99,7 +99,13 @@ ical_object_destroy (iCalObject *ico) lfree_if_defined (ico->resources); lfree_if_defined (ico->related); lfree_if_defined (ico->attach); - + + /* Alarms */ + g_free (ico->dalarm.data); + g_free (ico->palarm.data); + g_free (ico->malarm.data); + g_free (ico->aalarm.data); + g_free (ico); } @@ -670,3 +676,13 @@ ical_object_to_vobject (iCalObject *ical) /* FIXME: alarms */ return o; } + +void +ical_foreach (GList *events, iCalObjectFn fn, void *closure) +{ + for (; events; events = events->next){ + iCalObject *ical = events->data; + + (*fn) (ical, ical->dtstart, ical->dtend, closure); + } +} diff --git a/calendar/cal-util/calobj.h b/calendar/cal-util/calobj.h index 9287332d40..8f7abf8871 100644 --- a/calendar/cal-util/calobj.h +++ b/calendar/cal-util/calobj.h @@ -153,11 +153,15 @@ typedef struct { int new; } iCalObject; -iCalObject *ical_new (char *comment, char *organizer, char *summary); -iCalObject *ical_object_new (void); -void ical_object_destroy (iCalObject *ico); +/* The callback for the recurrence generator */ +typedef void (*iCalObjectFn)(iCalObject *, time_t, time_t, void *); + +iCalObject *ical_new (char *comment, char *organizer, char *summary); +iCalObject *ical_object_new (void); +void ical_object_destroy (iCalObject *ico); iCalObject *ical_object_create_from_vobject (VObject *obj, const char *object_name); -VObject *ical_object_to_vobject (iCalObject *ical); +VObject *ical_object_to_vobject (iCalObject *ical); +void ical_foreach (GList *events, iCalObjectFn fn, void *closure); END_GNOME_DECLS -- cgit v1.2.3