diff options
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 26 | ||||
-rw-r--r-- | calendar/gui/Makefile.am | 4 | ||||
-rw-r--r-- | calendar/gui/mark.c | 50 |
3 files changed, 57 insertions, 23 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 0834181958..eb26f487f9 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,29 @@ +2000-08-15 JP Rosevear <jpr@helixcode.com> + + * gui/mark.c (mark_month_item_cb): Callback used to mark every + event in a month. + (mark_month_item): Use cal_client_generate_instances with + above callback + +2000-08-15 JP Rosevear <jpr@helixcode.com> + + * gui/print.c (print_month_small): Use + cal_client_get_objects_in_range + (print_day_details_cb): Callback used to create columns and fill + events into a day view. Code should be shared with e-day-view + in reality. Maybe need to go back to layout.[hc] a bit later + (print_day_details): Use cal_client_generate_instances with + above callback. Iterate over results to expand events to fit. + (print_day_summary_cb): Callback to build list of event info + for a day + (print_day_summary): Use cal_client_generate_instances with + above callback to generate the required event info for printing + (print_todo_details_cb): Callback used create list of todo info + (print_todo_details): Use cal_client_generate_instances with + above callback to generate required todo info for printing. + + * gui/layout.[hc]: No longer used. + 2000-08-12 Federico Mena Quintero <federico@helixcode.com> * gui/calendar-model.c (get_is_overdue): Finished implementing. diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am index 3d92a30ae4..f40e442a69 100644 --- a/calendar/gui/Makefile.am +++ b/calendar/gui/Makefile.am @@ -42,8 +42,6 @@ glade_DATA = \ glade_messages = event-editor-dialog.glade.h evolution_calendar_SOURCES = \ - print.c \ - print.h \ alarm.c \ alarm.h \ calendar-commands.c \ @@ -87,6 +85,8 @@ evolution_calendar_SOURCES = \ mark.h \ popup-menu.c \ popup-menu.h \ + print.c \ + print.h \ prop.c evolution_calendar_LDADD = \ diff --git a/calendar/gui/mark.c b/calendar/gui/mark.c index ea83845b2a..383eca5196 100644 --- a/calendar/gui/mark.c +++ b/calendar/gui/mark.c @@ -25,6 +25,14 @@ #include "calendar-commands.h" #include "mark.h" +/* Closure data */ +struct minfo +{ + GnomeMonthItem *mitem; + time_t start; + time_t end; +}; + /* Frees the specified data when an object is destroyed */ @@ -115,38 +123,35 @@ mark_event_in_month (GnomeMonthItem *mitem, time_t start, time_t end) } } +static gboolean +mark_month_item_cb (CalComponent *comp, time_t istart, time_t iend, gpointer data) +{ + struct minfo *mi = (struct minfo *)data; + + mark_event_in_month (mi->mitem, MAX (istart, mi->start), MIN (iend, mi->end)); + + return TRUE; +} + void mark_month_item (GnomeMonthItem *mitem, GnomeCalendar *gcal) { - time_t month_begin, month_end; - GList *events; - GList *l; + struct minfo mi; g_return_if_fail (mitem != NULL); g_return_if_fail (GNOME_IS_MONTH_ITEM (mitem)); g_return_if_fail (gcal != NULL); g_return_if_fail (GNOME_IS_CALENDAR (gcal)); - month_begin = time_month_begin (time_from_day (mitem->year, mitem->month, 1)); - month_end = time_month_end (month_begin); - - events = cal_client_get_events_in_range (gcal->client, month_begin, month_end); - - for (l = events; l; l = l->next) { - CalObjInstance *coi; - - coi = l->data; - - /* We clip the event's start and end times to the month's limits */ - - mark_event_in_month (mitem, - MAX (coi->start, month_begin), - MIN (coi->end, month_end)); - } - - cal_obj_instance_list_free (events); + mi.mitem = mitem; + mi.start = time_month_begin (time_from_day (mitem->year, mitem->month, 1)); + mi.end = time_month_end (mi.start); + + cal_client_generate_instances (gcal->client, CALOBJ_TYPE_EVENT, mi.start, mi.end, + mark_month_item_cb, &mi); } + void mark_month_item_index (GnomeMonthItem *mitem, int index, GetColorFunc func, gpointer func_data) { @@ -287,3 +292,6 @@ default_color_func (ColorProp propnum, gpointer data) { return color_spec_from_prop (propnum); } + + + |