diff options
author | Bolian Yin <bolian.yin@sun.com> | 2003-11-11 18:34:29 +0800 |
---|---|---|
committer | Bolian Yin <byin@src.gnome.org> | 2003-11-11 18:34:29 +0800 |
commit | f7cc8f7cbd3e7b83c33fe85b2311895b8d5ee242 (patch) | |
tree | 24090c6745029873e1bf0a609ce5c95207a79a4c | |
parent | 59b0ca9123615e8082f2dcbbd9b56ffcf99354d4 (diff) | |
download | gsoc2013-evolution-f7cc8f7cbd3e7b83c33fe85b2311895b8d5ee242.tar gsoc2013-evolution-f7cc8f7cbd3e7b83c33fe85b2311895b8d5ee242.tar.gz gsoc2013-evolution-f7cc8f7cbd3e7b83c33fe85b2311895b8d5ee242.tar.bz2 gsoc2013-evolution-f7cc8f7cbd3e7b83c33fe85b2311895b8d5ee242.tar.lz gsoc2013-evolution-f7cc8f7cbd3e7b83c33fe85b2311895b8d5ee242.tar.xz gsoc2013-evolution-f7cc8f7cbd3e7b83c33fe85b2311895b8d5ee242.tar.zst gsoc2013-evolution-f7cc8f7cbd3e7b83c33fe85b2311895b8d5ee242.zip |
Fixes #50538
2003-11-11 Bolian Yin <bolian.yin@sun.com>
Fixes #50538
* e-calendar-item: make e_calendar_item_normalize_date public func.
add "selection_preview_changed" signal.
move some definition of constants to .h
svn path=/trunk/; revision=23284
-rw-r--r-- | widgets/misc/ChangeLog | 8 | ||||
-rw-r--r-- | widgets/misc/e-calendar-item.c | 54 | ||||
-rw-r--r-- | widgets/misc/e-calendar-item.h | 39 |
3 files changed, 61 insertions, 40 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 6661784039..134ce4d7f5 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,11 @@ +2003-11-11 Bolian Yin <bolian.yin@sun.com> + + Fixes #50538 + + * e-calendar-item: make e_calendar_item_normalize_date public func. + add "selection_preview_changed" signal. + move some definition of constants to .h + 2003-11-10 Ettore Perazzoli <ettore@ximian.com> * e-source-selector.c (e_source_selector_new): Expand all the diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index 883ec6e0d6..e929587f8f 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -46,36 +46,6 @@ #include <libgnome/gnome-i18n.h> #include <gal/util/e-util.h> -/* - * These are the padding sizes between various pieces of the calendar. - */ - -/* The minimum padding around the numbers in each cell/day. */ -#define E_CALENDAR_ITEM_MIN_CELL_XPAD 4 -#define E_CALENDAR_ITEM_MIN_CELL_YPAD 0 - -/* Vertical padding. */ -#define E_CALENDAR_ITEM_YPAD_ABOVE_DAY_LETTERS 1 -#define E_CALENDAR_ITEM_YPAD_BELOW_DAY_LETTERS 0 -#define E_CALENDAR_ITEM_YPAD_ABOVE_CELLS 1 -#define E_CALENDAR_ITEM_YPAD_BELOW_CELLS 2 - -/* Horizontal padding in the heading bars. */ -#define E_CALENDAR_ITEM_XPAD_BEFORE_MONTH_NAME_WITH_BUTTON 16 -#define E_CALENDAR_ITEM_XPAD_BEFORE_MONTH_NAME 3 -#define E_CALENDAR_ITEM_XPAD_AFTER_MONTH_NAME 3 -#define E_CALENDAR_ITEM_XPAD_AFTER_MONTH_NAME_WITH_BUTTON 16 - -/* Horizontal padding in the month displays. */ -#define E_CALENDAR_ITEM_XPAD_BEFORE_WEEK_NUMBERS 4 -#define E_CALENDAR_ITEM_XPAD_AFTER_WEEK_NUMBERS 2 -#define E_CALENDAR_ITEM_XPAD_BEFORE_CELLS 1 -#define E_CALENDAR_ITEM_XPAD_AFTER_CELLS 4 - -/* The number of rows & columns of days in each month. */ -#define E_CALENDAR_ROWS_PER_MONTH 6 -#define E_CALENDAR_COLS_PER_MONTH 7 - static const int e_calendar_item_days_in_month[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; @@ -168,11 +138,6 @@ static void e_calendar_item_get_month_info (ECalendarItem *calitem, gint *days_in_prev_month); static void e_calendar_item_recalc_sizes(ECalendarItem *calitem); -static gint e_calendar_item_get_week_number (ECalendarItem *calitem, - gint day, - gint month, - gint year); - static void e_calendar_item_get_day_style (ECalendarItem *calitem, gint year, gint month, @@ -197,9 +162,6 @@ static void e_calendar_item_check_selection_start(ECalendarItem *calitem, gint *start_day, gint end_month, gint end_day); -static void e_calendar_item_normalize_date (ECalendarItem *calitem, - gint *year, - gint *month); static void e_calendar_item_add_days_to_selection(ECalendarItem *calitem, gint days); static void e_calendar_item_round_up_selection (ECalendarItem *calitem, @@ -272,6 +234,7 @@ enum { enum { DATE_RANGE_CHANGED, SELECTION_CHANGED, + SELECTION_PREVIEW_CHANGED, LAST_SIGNAL }; @@ -376,6 +339,14 @@ e_calendar_item_class_init (ECalendarItemClass *class) G_STRUCT_OFFSET (ECalendarItemClass, selection_changed), gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); + e_calendar_item_signals[SELECTION_PREVIEW_CHANGED] = + g_signal_new ("selection_preview_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECalendarItemClass, selection_preview_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); object_class->destroy = e_calendar_item_destroy; object_class->get_arg = e_calendar_item_get_arg; @@ -394,6 +365,7 @@ e_calendar_item_class_init (ECalendarItemClass *class) class->date_range_changed = NULL; class->selection_changed = NULL; + class->selection_preview_changed = NULL; e_calendar_item_a11y_init (); } @@ -1576,7 +1548,7 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, } -static gint +gint e_calendar_item_get_week_number (ECalendarItem *calitem, gint day, gint month, @@ -1715,6 +1687,8 @@ e_calendar_item_selection_add_days (ECalendarItem *calitem, gint n_days, e_calendar_item_set_selection_if_emission (calitem, &gdate_start, &gdate_end, FALSE); + g_signal_emit_by_name (G_OBJECT (calitem), + "selection_preview_changed"); } static gint @@ -2531,7 +2505,7 @@ e_calendar_item_set_display_popup (ECalendarItem *calitem, /* This will make sure that the given year & month are valid, i.e. if month is < 0 or > 11 the year and month will be updated accordingly. */ -static void +void e_calendar_item_normalize_date (ECalendarItem *calitem, gint *year, gint *month) diff --git a/widgets/misc/e-calendar-item.h b/widgets/misc/e-calendar-item.h index 218095f741..f7f1110b68 100644 --- a/widgets/misc/e-calendar-item.h +++ b/widgets/misc/e-calendar-item.h @@ -36,9 +36,39 @@ extern "C" { #define E_CALENDAR_ITEM_YPAD_ABOVE_MONTH_NAME 1 #define E_CALENDAR_ITEM_YPAD_BELOW_MONTH_NAME 1 +/* The number of rows & columns of days in each month. */ +#define E_CALENDAR_ROWS_PER_MONTH 6 +#define E_CALENDAR_COLS_PER_MONTH 7 + /* Used to mark days as bold in e_calendar_item_mark_day(). */ #define E_CALENDAR_ITEM_MARK_BOLD 1 +/* + * These are the padding sizes between various pieces of the calendar. + */ + +/* The minimum padding around the numbers in each cell/day. */ +#define E_CALENDAR_ITEM_MIN_CELL_XPAD 4 +#define E_CALENDAR_ITEM_MIN_CELL_YPAD 0 + +/* Vertical padding. */ +#define E_CALENDAR_ITEM_YPAD_ABOVE_DAY_LETTERS 1 +#define E_CALENDAR_ITEM_YPAD_BELOW_DAY_LETTERS 0 +#define E_CALENDAR_ITEM_YPAD_ABOVE_CELLS 1 +#define E_CALENDAR_ITEM_YPAD_BELOW_CELLS 2 + +/* Horizontal padding in the heading bars. */ +#define E_CALENDAR_ITEM_XPAD_BEFORE_MONTH_NAME_WITH_BUTTON 16 +#define E_CALENDAR_ITEM_XPAD_BEFORE_MONTH_NAME 3 +#define E_CALENDAR_ITEM_XPAD_AFTER_MONTH_NAME 3 +#define E_CALENDAR_ITEM_XPAD_AFTER_MONTH_NAME_WITH_BUTTON 16 + +/* Horizontal padding in the month displays. */ +#define E_CALENDAR_ITEM_XPAD_BEFORE_WEEK_NUMBERS 4 +#define E_CALENDAR_ITEM_XPAD_AFTER_WEEK_NUMBERS 2 +#define E_CALENDAR_ITEM_XPAD_BEFORE_CELLS 1 +#define E_CALENDAR_ITEM_XPAD_AFTER_CELLS 4 + /* These index our colors array. */ typedef enum @@ -231,6 +261,7 @@ struct _ECalendarItemClass void (* date_range_changed) (ECalendarItem *calitem); void (* selection_changed) (ECalendarItem *calitem); + void (* selection_preview_changed) (ECalendarItem *calitem); }; @@ -332,6 +363,14 @@ void e_calendar_item_set_get_time_callback (ECalendarItem *calitem, ECalendarItemGetTimeCallback cb, gpointer data, GtkDestroyNotify destroy); +void e_calendar_item_normalize_date (ECalendarItem *calitem, + gint *year, + gint *month); +gint e_calendar_item_get_week_number (ECalendarItem *calitem, + gint day, + gint month, + gint year); + #ifdef __cplusplus } |