From bacd3a85a434032316b3e63b95282175ce2b0659 Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Tue, 3 Jul 2001 04:12:17 +0000 Subject: added functions to set a callback to get the current time, which is used 2001-07-02 Damon Chaplin * e-calendar-item.c: * e-cell-date-edit.c: * e-dateedit.c: added functions to set a callback to get the current time, which is used instead of localtime(). We need this as we have to use our own timezones. svn path=/trunk/; revision=10728 --- widgets/misc/e-calendar-item.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'widgets/misc/e-calendar-item.h') diff --git a/widgets/misc/e-calendar-item.h b/widgets/misc/e-calendar-item.h index 3d4e582e39..0ef25ed62a 100644 --- a/widgets/misc/e-calendar-item.h +++ b/widgets/misc/e-calendar-item.h @@ -55,6 +55,8 @@ typedef enum typedef struct _ECalendarItem ECalendarItem; typedef struct _ECalendarItemClass ECalendarItemClass; +/* The type of the callback function optionally used to get the colors to + use for each day. */ typedef void (*ECalendarItemStyleCallback) (ECalendarItem *calitem, gint year, gint month, @@ -71,6 +73,11 @@ typedef void (*ECalendarItemStyleCallback) (ECalendarItem *calitem, gboolean *bold, gpointer data); +/* The type of the callback function optionally used to get the current time. + */ +typedef struct tm (*ECalendarItemGetTimeCallback) (ECalendarItem *calitem, + gpointer data); + #define E_CALENDAR_ITEM(obj) (GTK_CHECK_CAST((obj), \ e_calendar_item_get_type (), ECalendarItem)) @@ -199,6 +206,10 @@ struct _ECalendarItem gpointer style_callback_data; GtkDestroyNotify style_callback_destroy; + ECalendarItemGetTimeCallback time_callback; + gpointer time_callback_data; + GtkDestroyNotify time_callback_destroy; + /* Colors for drawing. */ GdkColor colors[E_CALENDAR_ITEM_COLOR_LAST]; @@ -313,6 +324,14 @@ void e_calendar_item_set_style_callback (ECalendarItem *calitem, gpointer data, GtkDestroyNotify destroy); +/* Sets a callback to use to get the current time. This is useful if the + application needs to use its own timezone data rather than rely on the + Unix timezone. */ +void e_calendar_item_set_get_time_callback (ECalendarItem *calitem, + ECalendarItemGetTimeCallback cb, + gpointer data, + GtkDestroyNotify destroy); + #ifdef __cplusplus } #endif /* __cplusplus */ -- cgit v1.2.3