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-cell-date-edit.h | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'widgets/misc/e-cell-date-edit.h') diff --git a/widgets/misc/e-cell-date-edit.h b/widgets/misc/e-cell-date-edit.h index f3f8beb02b..67af112c94 100644 --- a/widgets/misc/e-cell-date-edit.h +++ b/widgets/misc/e-cell-date-edit.h @@ -30,6 +30,7 @@ #ifndef _E_CELL_DATE_EDIT_H_ #define _E_CELL_DATE_EDIT_H_ +#include #include #define E_CELL_DATE_EDIT_TYPE (e_cell_date_edit_get_type ()) @@ -39,7 +40,15 @@ #define E_IS_CELL_DATE_EDIT_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_CELL_DATE_EDIT_TYPE)) -typedef struct { +typedef struct _ECellDateEdit ECellDateEdit; +typedef struct _ECellDateEditClass ECellDateEditClass; + +/* The type of the callback function optionally used to get the current time. + */ +typedef struct tm (*ECellDateEditGetTimeCallback) (ECellDateEdit *ecde, + gpointer data); + +struct _ECellDateEdit { ECellPopup parent; GtkWidget *popup_window; @@ -64,11 +73,15 @@ typedef struct { /* The freeze count for rebuilding the time list. We only rebuild when this is 0. */ gint freeze_count; -} ECellDateEdit; -typedef struct { + ECellDateEditGetTimeCallback time_callback; + gpointer time_callback_data; + GtkDestroyNotify time_callback_destroy; +}; + +struct _ECellDateEditClass { ECellPopupClass parent_class; -} ECellDateEditClass; +}; GtkType e_cell_date_edit_get_type (void); @@ -81,4 +94,14 @@ ECell *e_cell_date_edit_new (void); void e_cell_date_edit_freeze (ECellDateEdit *ecde); void e_cell_date_edit_thaw (ECellDateEdit *ecde); + +/* 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_cell_date_edit_set_get_time_callback(ECellDateEdit *ecde, + ECellDateEditGetTimeCallback cb, + gpointer data, + GtkDestroyNotify destroy); + + #endif /* _E_CELL_DATE_EDIT_H_ */ -- cgit v1.2.3