add new signal "selected_time_changed" a11y initialization new public
2003-11-04 Bolian Yin <bolian.yin@sun.com> * gui/e-cal-view.c: add new signal "selected_time_changed" * gui/e-day-view-main-item.c (e_day_view_main_item_class_init): a11y initialization * gui/e-day-view-top-item (e_day_view_top_item_get_day_label): new public function. * gui/e-day-view.c (e_day_view_ensure_rows_visible, e_day_view_update_calendar_selection_time): make static functions public (e_day_view_cursor_key_up, e_day_view_cursor_key_down, e_day_view_cursor_key_left, e_day_view_cursor_key_right): emit "selected_time_changed". svn path=/trunk/; revision=23179
This commit is contained in:
@ -1,3 +1,13 @@
|
||||
2003-11-04 Bolian Yin <bolian.yin@sun.com>
|
||||
|
||||
* gui/e-cal-view.c: add new signal "selected_time_changed"
|
||||
* gui/e-day-view-main-item.c (e_day_view_main_item_class_init):
|
||||
a11y initialization
|
||||
* gui/e-day-view-top-item (e_day_view_top_item_get_day_label):
|
||||
new public function.
|
||||
* gui/e-day-view.c (e_day_view_ensure_rows_visible, e_day_view_update_calendar_selection_time): make static functions public
|
||||
(e_day_view_cursor_key_up, e_day_view_cursor_key_down, e_day_view_cursor_key_left, e_day_view_cursor_key_right): emit "selected_time_changed".
|
||||
|
||||
2003-11-03 Ettore Perazzoli <ettore@ximian.com>
|
||||
|
||||
* gui/e-meeting-model.c (SELECT_NAMES_OAFID): Append "_2".
|
||||
|
||||
@ -94,6 +94,7 @@ enum props {
|
||||
/* Signal IDs */
|
||||
enum {
|
||||
SELECTION_CHANGED,
|
||||
SELECTED_TIME_CHANGED,
|
||||
TIMEZONE_CHANGED,
|
||||
EVENT_CHANGED,
|
||||
EVENT_ADDED,
|
||||
@ -154,6 +155,7 @@ e_cal_view_class_init (ECalViewClass *klass)
|
||||
object_class->destroy = e_cal_view_destroy;
|
||||
|
||||
klass->selection_changed = NULL;
|
||||
klass->selected_time_changed = NULL;
|
||||
klass->event_changed = NULL;
|
||||
klass->event_added = NULL;
|
||||
|
||||
@ -177,6 +179,14 @@ e_cal_view_class_init (ECalViewClass *klass)
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
e_cal_view_signals[SELECTED_TIME_CHANGED] =
|
||||
g_signal_new ("selected_time_changed",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ECalViewClass, selected_time_changed),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
e_cal_view_signals[TIMEZONE_CHANGED] =
|
||||
g_signal_new ("timezone_changed",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
|
||||
@ -76,6 +76,7 @@ struct _ECalViewClass {
|
||||
|
||||
/* Notification signals */
|
||||
void (* selection_changed) (ECalView *cal_view);
|
||||
void (* selected_time_changed) (ECalView *cal_view);
|
||||
void (* timezone_changed) (ECalView *cal_view, icaltimezone *old_zone, icaltimezone *new_zone);
|
||||
void (* event_changed) (ECalView *day_view, ECalViewEvent *event);
|
||||
void (* event_added) (ECalView *day_view, ECalViewEvent *event);
|
||||
|
||||
@ -94,6 +94,7 @@ enum props {
|
||||
/* Signal IDs */
|
||||
enum {
|
||||
SELECTION_CHANGED,
|
||||
SELECTED_TIME_CHANGED,
|
||||
TIMEZONE_CHANGED,
|
||||
EVENT_CHANGED,
|
||||
EVENT_ADDED,
|
||||
@ -154,6 +155,7 @@ e_cal_view_class_init (ECalViewClass *klass)
|
||||
object_class->destroy = e_cal_view_destroy;
|
||||
|
||||
klass->selection_changed = NULL;
|
||||
klass->selected_time_changed = NULL;
|
||||
klass->event_changed = NULL;
|
||||
klass->event_added = NULL;
|
||||
|
||||
@ -177,6 +179,14 @@ e_cal_view_class_init (ECalViewClass *klass)
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
e_cal_view_signals[SELECTED_TIME_CHANGED] =
|
||||
g_signal_new ("selected_time_changed",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET (ECalViewClass, selected_time_changed),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__VOID,
|
||||
G_TYPE_NONE, 0);
|
||||
e_cal_view_signals[TIMEZONE_CHANGED] =
|
||||
g_signal_new ("timezone_changed",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
|
||||
@ -76,6 +76,7 @@ struct _ECalViewClass {
|
||||
|
||||
/* Notification signals */
|
||||
void (* selection_changed) (ECalView *cal_view);
|
||||
void (* selected_time_changed) (ECalView *cal_view);
|
||||
void (* timezone_changed) (ECalView *cal_view, icaltimezone *old_zone, icaltimezone *new_zone);
|
||||
void (* event_changed) (ECalView *day_view, ECalViewEvent *event);
|
||||
void (* event_added) (ECalView *day_view, ECalViewEvent *event);
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#include "e-util/e-categories-config.h"
|
||||
#include "e-day-view-layout.h"
|
||||
#include "e-day-view-main-item.h"
|
||||
#include "ea-calendar.h"
|
||||
|
||||
static void e_day_view_main_item_class_init (EDayViewMainItemClass *class);
|
||||
static void e_day_view_main_item_init (EDayViewMainItem *dvtitem);
|
||||
@ -106,6 +107,9 @@ e_day_view_main_item_class_init (EDayViewMainItemClass *class)
|
||||
item_class->draw = e_day_view_main_item_draw;
|
||||
item_class->point = e_day_view_main_item_point;
|
||||
item_class->event = e_day_view_main_item_event;
|
||||
|
||||
/* init the accessibility support for e_day_view */
|
||||
e_day_view_main_item_a11y_init ();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -165,12 +165,10 @@ e_day_view_top_item_draw (GnomeCanvasItem *canvas_item,
|
||||
EDayView *day_view;
|
||||
GtkStyle *style;
|
||||
GdkGC *gc, *fg_gc, *bg_gc, *light_gc, *dark_gc;
|
||||
gchar buffer[128], *format;
|
||||
gchar buffer[128];
|
||||
GdkRectangle clip_rect;
|
||||
gint canvas_width, canvas_height, left_edge, day, date_width, date_x;
|
||||
gint item_height, event_num;
|
||||
struct tm day_start = { 0 };
|
||||
struct icaltimetype day_start_tt;
|
||||
PangoLayout *layout;
|
||||
|
||||
#if 0
|
||||
@ -245,34 +243,8 @@ e_day_view_top_item_draw (GnomeCanvasItem *canvas_item,
|
||||
/* Draw the date. Set a clipping rectangle so we don't draw over the
|
||||
next day. */
|
||||
for (day = 0; day < day_view->days_shown; day++) {
|
||||
day_start_tt = icaltime_from_timet_with_zone (day_view->day_starts[day], FALSE,
|
||||
e_cal_view_get_timezone (E_CAL_VIEW (day_view)));
|
||||
day_start.tm_year = day_start_tt.year - 1900;
|
||||
day_start.tm_mon = day_start_tt.month - 1;
|
||||
day_start.tm_mday = day_start_tt.day;
|
||||
day_start.tm_isdst = -1;
|
||||
|
||||
day_start.tm_wday = time_day_of_week (day_start_tt.day,
|
||||
day_start_tt.month - 1,
|
||||
day_start_tt.year);
|
||||
|
||||
if (day_view->date_format == E_DAY_VIEW_DATE_FULL)
|
||||
/* strftime format %A = full weekday name, %d = day of month,
|
||||
%B = full month name. Don't use any other specifiers. */
|
||||
format = _("%A %d %B");
|
||||
else if (day_view->date_format == E_DAY_VIEW_DATE_ABBREVIATED)
|
||||
/* strftime format %a = abbreviated weekday name, %d = day of month,
|
||||
%b = abbreviated month name. Don't use any other specifiers. */
|
||||
format = _("%a %d %b");
|
||||
else if (day_view->date_format == E_DAY_VIEW_DATE_NO_WEEKDAY)
|
||||
/* strftime format %d = day of month, %b = abbreviated month name.
|
||||
Don't use any other specifiers. */
|
||||
format = _("%d %b");
|
||||
else
|
||||
format = "%d";
|
||||
|
||||
e_utf8_strftime (buffer, sizeof (buffer), format, &day_start);
|
||||
|
||||
e_day_view_top_item_get_day_label (day_view, day,
|
||||
buffer, sizeof (buffer));
|
||||
clip_rect.x = day_view->day_offsets[day] - x;
|
||||
clip_rect.y = 2 - y;
|
||||
clip_rect.width = day_view->day_widths[day];
|
||||
@ -690,4 +662,40 @@ e_day_view_top_item_event (GnomeCanvasItem *item, GdkEvent *event)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
e_day_view_top_item_get_day_label (EDayView *day_view, gint day,
|
||||
gchar *buffer, gint buffer_len)
|
||||
{
|
||||
struct icaltimetype day_start_tt;
|
||||
struct tm day_start = { 0 };
|
||||
gchar *format;
|
||||
|
||||
day_start_tt = icaltime_from_timet_with_zone (day_view->day_starts[day],
|
||||
FALSE,
|
||||
e_cal_view_get_timezone (E_CAL_VIEW (day_view)));
|
||||
day_start.tm_year = day_start_tt.year - 1900;
|
||||
day_start.tm_mon = day_start_tt.month - 1;
|
||||
day_start.tm_mday = day_start_tt.day;
|
||||
day_start.tm_isdst = -1;
|
||||
|
||||
day_start.tm_wday = time_day_of_week (day_start_tt.day,
|
||||
day_start_tt.month - 1,
|
||||
day_start_tt.year);
|
||||
|
||||
if (day_view->date_format == E_DAY_VIEW_DATE_FULL)
|
||||
/* strftime format %A = full weekday name, %d = day of month,
|
||||
%B = full month name. Don't use any other specifiers. */
|
||||
format = _("%A %d %B");
|
||||
else if (day_view->date_format == E_DAY_VIEW_DATE_ABBREVIATED)
|
||||
/* strftime format %a = abbreviated weekday name, %d = day of month,
|
||||
%b = abbreviated month name. Don't use any other specifiers. */
|
||||
format = _("%a %d %b");
|
||||
else if (day_view->date_format == E_DAY_VIEW_DATE_NO_WEEKDAY)
|
||||
/* strftime format %d = day of month, %b = abbreviated month name.
|
||||
Don't use any other specifiers. */
|
||||
format = _("%d %b");
|
||||
else
|
||||
format = "%d";
|
||||
|
||||
e_utf8_strftime (buffer, buffer_len, format, &day_start);
|
||||
}
|
||||
|
||||
@ -55,7 +55,8 @@ typedef struct {
|
||||
|
||||
|
||||
GtkType e_day_view_top_item_get_type (void);
|
||||
|
||||
void e_day_view_top_item_get_day_label (EDayView *day_view, gint day,
|
||||
gchar *buffer, gint buffer_len);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@ -184,9 +184,6 @@ static void e_day_view_cursor_key_left (EDayView *day_view,
|
||||
GdkEventKey *event);
|
||||
static void e_day_view_cursor_key_right (EDayView *day_view,
|
||||
GdkEventKey *event);
|
||||
static void e_day_view_ensure_rows_visible (EDayView *day_view,
|
||||
gint start_row,
|
||||
gint end_row);
|
||||
static void e_day_view_scroll (EDayView *day_view,
|
||||
gfloat pages_to_scroll);
|
||||
|
||||
@ -219,7 +216,6 @@ static gboolean e_day_view_on_time_canvas_scroll (GtkWidget *widget,
|
||||
GdkEventScroll *scroll,
|
||||
EDayView *day_view);
|
||||
|
||||
static void e_day_view_update_calendar_selection_time (EDayView *day_view);
|
||||
static gboolean e_day_view_on_main_canvas_motion (GtkWidget *widget,
|
||||
GdkEventMotion *event,
|
||||
EDayView *day_view);
|
||||
@ -3295,7 +3291,7 @@ e_day_view_on_main_canvas_button_release (GtkWidget *widget,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
void
|
||||
e_day_view_update_calendar_selection_time (EDayView *day_view)
|
||||
{
|
||||
time_t start, end;
|
||||
@ -5228,6 +5224,7 @@ e_day_view_cursor_key_up (EDayView *day_view, GdkEventKey *event)
|
||||
day_view->selection_start_row,
|
||||
day_view->selection_end_row);
|
||||
|
||||
g_signal_emit_by_name (day_view, "selected_time_changed");
|
||||
e_day_view_update_calendar_selection_time (day_view);
|
||||
|
||||
/* FIXME: Optimise? */
|
||||
@ -5260,6 +5257,7 @@ e_day_view_cursor_key_down (EDayView *day_view, GdkEventKey *event)
|
||||
day_view->selection_start_row,
|
||||
day_view->selection_end_row);
|
||||
|
||||
g_signal_emit_by_name (day_view, "selected_time_changed");
|
||||
e_day_view_update_calendar_selection_time (day_view);
|
||||
|
||||
/* FIXME: Optimise? */
|
||||
@ -5283,6 +5281,7 @@ e_day_view_cursor_key_left (EDayView *day_view, GdkEventKey *event)
|
||||
gtk_widget_queue_draw (day_view->top_canvas);
|
||||
gtk_widget_queue_draw (day_view->main_canvas);
|
||||
}
|
||||
g_signal_emit_by_name (day_view, "selected_time_changed");
|
||||
}
|
||||
|
||||
|
||||
@ -5301,6 +5300,7 @@ e_day_view_cursor_key_right (EDayView *day_view, GdkEventKey *event)
|
||||
gtk_widget_queue_draw (day_view->top_canvas);
|
||||
gtk_widget_queue_draw (day_view->main_canvas);
|
||||
}
|
||||
g_signal_emit_by_name (day_view, "selected_time_changed");
|
||||
}
|
||||
|
||||
|
||||
@ -5348,7 +5348,7 @@ e_day_view_check_if_new_event_fits (EDayView *day_view)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
void
|
||||
e_day_view_ensure_rows_visible (EDayView *day_view,
|
||||
gint start_row,
|
||||
gint end_row)
|
||||
|
||||
@ -577,6 +577,11 @@ gboolean e_day_view_find_event_from_item (EDayView *day_view,
|
||||
GnomeCanvasItem *item,
|
||||
gint *day_return,
|
||||
gint *event_num_return);
|
||||
void e_day_view_update_calendar_selection_time (EDayView *day_view);
|
||||
void e_day_view_ensure_rows_visible (EDayView *day_view,
|
||||
gint start_row,
|
||||
gint end_row);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user