From adcb9e228978aded6cdf78f6dd1f8c460b650504 Mon Sep 17 00:00:00 2001 From: Andrew Wu Date: Tue, 9 Dec 2003 07:09:24 +0000 Subject: add entries for new source files add cases for jump button. add cases for 2003-12-09 Andrew Wu * calendar/Makefile.am: add entries for new source files * calendar/ea-calendar-helpers.c: add cases for jump button. * calendar/ea-calendar.c: add cases for week view and week view main item. * calendar/ea-jump-button.c: new impl. * calendar/ea-week-view-cell.c: new impl. * calendar/ea-week-view-main-item.c: new impl. * calendar/ea-week-view.c: add main item as first child. svn path=/trunk/; revision=23892 --- a11y/calendar/ea-calendar-helpers.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'a11y/calendar/ea-calendar-helpers.c') diff --git a/a11y/calendar/ea-calendar-helpers.c b/a11y/calendar/ea-calendar-helpers.c index 535265ebeb..9b484d0040 100644 --- a/a11y/calendar/ea-calendar-helpers.c +++ b/a11y/calendar/ea-calendar-helpers.c @@ -25,14 +25,16 @@ #include "ea-calendar-helpers.h" #include "ea-cal-view-event.h" +#include "ea-jump-button.h" #include "e-day-view.h" #include "e-week-view.h" #include +#include /** * ea_calendar_helpers_get_accessible_for - * @canvas_item: the canvas item (e_text) for a event + * @canvas_item: the canvas item for a event or a jump button * @returns: the atk object for the canvas_item * **/ @@ -42,7 +44,7 @@ ea_calendar_helpers_get_accessible_for (GnomeCanvasItem *canvas_item) AtkObject *atk_obj = NULL; GObject *g_obj; - g_return_val_if_fail (E_IS_TEXT (canvas_item), NULL); + g_return_val_if_fail ((E_IS_TEXT (canvas_item)) || (GNOME_IS_CANVAS_ITEM (canvas_item)), NULL);; g_obj = G_OBJECT (canvas_item); /* we cannot use atk_gobject_accessible_for_object here, @@ -50,14 +52,22 @@ ea_calendar_helpers_get_accessible_for (GnomeCanvasItem *canvas_item) * registered facotry of E_TEXT */ atk_obj = g_object_get_data (g_obj, "accessible-object"); - if (!atk_obj) + if (!atk_obj) { + if (E_IS_TEXT (canvas_item)) { atk_obj = ea_cal_view_event_new (g_obj); + } + else if (GNOME_IS_CANVAS_PIXBUF(canvas_item)) { + atk_obj = ea_jump_button_new (g_obj); + } + else + return NULL; + } return atk_obj; } /** * ea_calendar_helpers_get_view_widget_from: - * @canvas_item: the canvas item (e_text) for a event + * @canvas_item: the canvas item for a event or a jump button * @returns: the cal view widget if exists * * Get the cal view widget contains the canvas_item. @@ -70,16 +80,16 @@ ea_calendar_helpers_get_cal_view_from (GnomeCanvasItem *canvas_item) GtkWidget *view_widget = NULL; g_return_val_if_fail (canvas_item, NULL); - g_return_val_if_fail (E_IS_TEXT (canvas_item), NULL); + g_return_val_if_fail ((E_IS_TEXT (canvas_item)) || (GNOME_IS_CANVAS_ITEM (canvas_item)), NULL); /* canvas_item is the e_text for the event */ /* canvas_item->canvas is the ECanvas for day view */ /* parent of canvas_item->canvas is the EDayView or EWeekView widget */ canvas = canvas_item->canvas; view_widget = gtk_widget_get_parent (GTK_WIDGET(canvas)); - if (!view_widget || !E_IS_CALENDAR_VIEW (view_widget)) + if (!view_widget || !E_IS_CAL_VIEW (view_widget)) return NULL; - return E_CALENDAR_VIEW (view_widget); + return E_CAL_VIEW (view_widget); } /** -- cgit