aboutsummaryrefslogtreecommitdiffstats
path: root/a11y/calendar/ea-week-view.c
diff options
context:
space:
mode:
authorBolian Yin <bolian.yin@sun.com>2003-12-09 09:28:57 +0800
committerBolian Yin <byin@src.gnome.org>2003-12-09 09:28:57 +0800
commit832436edc45892c3c9c35037596110027bdeacd4 (patch)
tree7ddd20ca85d44158ba05941065875c9587421ea7 /a11y/calendar/ea-week-view.c
parente6b3dd0cce336691b2ce44143f67bab26ae58f7e (diff)
downloadgsoc2013-evolution-832436edc45892c3c9c35037596110027bdeacd4.tar.gz
gsoc2013-evolution-832436edc45892c3c9c35037596110027bdeacd4.tar.zst
gsoc2013-evolution-832436edc45892c3c9c35037596110027bdeacd4.zip
shortcut when cal_view is NULL. Change an action name. add check for event
2003-12-05 Bolian Yin <bolian.yin@sun.com> * calendar/ea-cal-view-event.c (ea_cal_view_event_new): shortcut when cal_view is NULL. * calendar/ea-cal-view.c: Change an action name. * calendar/ea-calendar.c (ea_calendar_focus_watcher): add check for event atk object. * calendar/ea-week-view.c (ea_week_view_get_n_children): correct impl. (get_visible_text_item_count): removed. svn path=/trunk/; revision=23678
Diffstat (limited to 'a11y/calendar/ea-week-view.c')
-rw-r--r--a11y/calendar/ea-week-view.c39
1 files changed, 25 insertions, 14 deletions
diff --git a/a11y/calendar/ea-week-view.c b/a11y/calendar/ea-week-view.c
index 995cc01434..3c3e13a268 100644
--- a/a11y/calendar/ea-week-view.c
+++ b/a11y/calendar/ea-week-view.c
@@ -38,8 +38,6 @@ static gint ea_week_view_get_n_children (AtkObject *obj);
static AtkObject* ea_week_view_ref_child (AtkObject *obj,
gint i);
-static void get_visible_text_item_count (GnomeCanvasItem *item, gpointer data);
-
static gpointer parent_class = NULL;
GType
@@ -195,15 +193,33 @@ ea_week_view_get_n_children (AtkObject *accessible)
EWeekView *week_view;
GnomeCanvasGroup *canvas_group;
gint i, count = 0;
+ gint event_index;
g_return_val_if_fail (EA_IS_WEEK_VIEW (accessible), -1);
if (!GTK_ACCESSIBLE (accessible)->widget)
return -1;
week_view = E_WEEK_VIEW (GTK_ACCESSIBLE (accessible)->widget);
- canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root);
- g_list_foreach (canvas_group->item_list, (GFunc)get_visible_text_item_count,
- &count);
+
+ for (event_index = 0; event_index < week_view->events->len;
+ ++event_index) {
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+
+ event = &g_array_index (week_view->events,
+ EWeekViewEvent, event_index);
+ if (!event)
+ continue;
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan,
+ event->spans_index + 0);
+
+ if (!span)
+ continue;
+
+ /* at least one of the event spans is visible, count it */
+ if (span->text_item)
+ ++count;
+ }
/* add the number of visible jump buttons */
for (i = 0; i < E_WEEK_VIEW_MAX_WEEKS * 7; i++) {
@@ -246,10 +262,13 @@ ea_week_view_ref_child (AtkObject *accessible, gint index)
event = &g_array_index (week_view->events,
EWeekViewEvent, event_index);
+ if (!event)
+ continue;
+
span = &g_array_index (week_view->spans, EWeekViewEventSpan,
event->spans_index + span_num);
- if (!event || !span)
+ if (!span)
continue;
current_day = span->start_day;
@@ -284,11 +303,3 @@ ea_week_view_ref_child (AtkObject *accessible, gint index)
#endif
return atk_object;
}
-
-static void get_visible_text_item_count (GnomeCanvasItem *item, gpointer data)
-{
- gint *count = (gint *)data;
-
- if (item && E_IS_TEXT (item))
- ++(*count);
-}