[evolution-patches] Re: Seeking review for merging a11y patch to HEAD
- From: Bolian Yin <bolian yin sun com>
- To: ettore ximian com, EvolutionAcc <sceri-evolution-acc sun com>, evolution-patches ximian com
- Subject: [evolution-patches] Re: Seeking review for merging a11y patch to HEAD
- Date: Tue, 22 Jul 2003 15:24:22 +0800
Hi Ettore,
I need to update the patch for a11y directory under evolution. Then new version is attached. I think is cleaner and more complete than the old one. Sorry for the re-send.
Thanks & Regards,
Bolian Yin
Hi, Ettore
As we agreed before, now it it the first time we want to merging our
a11y specific patch to HEAD.
Currently, the patches are not too many. They are :
=====
York
45119: checked in notify atk object when grab focus and cursor move
see attachment : gtkhtml.a11y.diff
the patch depend on the last patch of bug #44607. That patch ensure
cursor can navigate on every element in a mail.
And this patch expose focused atk object. After this patch gnopernicus
can read a mail when you navigate the mail using up/down arrow.
Most work locate in object.c, and the part in utils.c just check NULL
pointer and avoid crashes I met when debugging.
When the mail reader get focus or cursor move to a different object , we
atk_focus_tracker_notify() it.
Todo:
Need to complete atktext interface implementation,
======
Bolian
46435: ECalendar a11y dir setup. basic atk impl. for gnome-calendar and
e-day-view.
see attachment:a11y_setup_for_trunk.all
=======
Gilbert
46065 atk implementation for EPaned
46448 Program crash when use EPaned with GNOME_ACCESSIBILITY != 1
In fact, I merge the two patches into one because they actually finish
one thing.
EPaned is like GtkPaned, so I run-time inherited GalA11yEPaned from
GailContainer, which is also the super class of GailPaned. And the
implementation of GalA11yEPaned is more like what GailPaned does.
see attchment :merge.2003_07_18_15_18_51_bxm46065_bxm46448
I send all to you because I am not sure who in your side has expertise
to review them?
Thank you very much
Gilbert
|
Index: a11y/ChangeLog
===================================================================
RCS file: a11y/ChangeLog
diff -N a11y/ChangeLog
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/ChangeLog 22 Jul 2003 07:06:19 -0000
@@ -0,0 +1,20 @@
+2003-07-17 Bolian Yin <bolian yin sun com>
+ * init.c: init calendar a11y support
+ * Makefile.am: add calendar lib
+ New files are:
+ ea-factory.h
+ calendar/ea-calendar.c
+ calendar/ea-calendar.h
+ calendar/ea-day-view-event-factory.c
+ calendar/ea-day-view-event-factory.h
+ calendar/ea-day-view-event.c
+ calendar/ea-day-view-event.h
+ calendar/ea-day-view.c
+ calendar/ea-day-view.h
+ calendar/ea-gnome-calendar.c
+ calendar/ea-gnome-calendar.h
+
+2003-06-26 Gilbert Fang <gilbert fang sun com>
+
+ * init.c: Initial new file for libevolution-a11y.so framework.
+ * Makefile.am: Initial new file (bug #44592)
Index: a11y/Makefile.am
===================================================================
RCS file: a11y/Makefile.am
diff -N a11y/Makefile.am
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/Makefile.am 22 Jul 2003 07:06:19 -0000
@@ -0,0 +1,34 @@
+# Calendar IDL files
+
+CALENDAR_IDLS = $(top_srcdir)/calendar/idl/evolution-calendar.idl
+
+CALENDAR_IDL_GENERATED_H = evolution-calendar.h
+
+$(CALENDAR_IDL_GENERATED_H): $(CALENDAR_IDLS)
+ $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \
+ $(top_srcdir)/calendar/idl/evolution-calendar.idl
+
+SUBDIRS = calendar
+
+INCLUDES = \
+ -DPREFIX=\"$(prefix)\" \
+ -DSYSCONFDIR=\"$(sysconfdir)\" \
+ -DDATADIR=\"$(datadir)\" \
+ -DLIBDIR=\"$(libdir)\" \
+ -DG_LOG_DOMAIN=\"evolution-a11y\" \
+ -I$(top_srcdir) \
+ -DG_DISABLE_DEPRECATED \
+ -DLIBGNOME_DISABLE_DEPRECATED \
+ $(EVOLUTION_CALENDAR_CFLAGS) \
+ $(A11Y_CFLAGS)
+
+privlib_LTLIBRARIES = libevolution-a11y.la
+
+libevolution_a11y_la_SOURCES = \
+ $(CALENDAR_IDL_GENERATED_H)
+
+BUILT_SOURCES = $(CALENDAR_IDL_GENERATED_H)
+
+libevolution_a11y_la_LIBADD = \
+ $(A11Y_LIBS) \
+ $(top_builddir)/a11y/calendar/libevolution-calendar-a11y.la
Index: a11y/ea-factory.h
===================================================================
RCS file: a11y/ea-factory.h
diff -N a11y/ea-factory.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/ea-factory.h 22 Jul 2003 07:06:19 -0000
@@ -0,0 +1,94 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* Evolution Accessibility: ea-factory.h
+ *
+ * Copyright (C) 2003 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Bolian Yin <bolian yin sun com> Sun Microsystem Inc., 2003
+ *
+ */
+
+/* Evolution Accessibility
+*/
+
+#ifndef _EA_FACTORY_H__
+#define _EA_FACTORY_H__
+
+#include <glib-object.h>
+#include <atk/atkobject.h>
+
+#define EA_FACTORY(type, type_as_function, opt_create_accessible) \
+ \
+static GType \
+type_as_function ## _factory_get_accessible_type (void) \
+{ \
+ return type; \
+} \
+ \
+static AtkObject* \
+type_as_function ## _factory_create_accessible (GObject *obj) \
+{ \
+ GtkWidget *widget; \
+ AtkObject *accessible; \
+ \
+ g_return_val_if_fail (GTK_IS_WIDGET (obj), NULL); \
+ \
+ widget = GTK_WIDGET (obj); \
+ \
+ accessible = opt_create_accessible (widget); \
+ \
+ return accessible; \
+} \
+ \
+static void \
+type_as_function ## _factory_class_init (AtkObjectFactoryClass *klass) \
+{ \
+ klass->create_accessible = type_as_function ## _factory_create_accessible; \
+ klass->get_accessible_type = type_as_function ## _factory_get_accessible_type;\
+} \
+ \
+static GType \
+type_as_function ## _factory_get_type (void) \
+{ \
+ static GType t = 0; \
+ \
+ if (!t) \
+ { \
+ char *name; \
+ static const GTypeInfo tinfo = \
+ { \
+ sizeof (AtkObjectFactoryClass), \
+ NULL, NULL, (GClassInitFunc) type_as_function ## _factory_class_init, \
+ NULL, NULL, sizeof (AtkObjectFactory), 0, NULL, NULL \
+ }; \
+ \
+ name = g_strconcat (g_type_name (type), "Factory", NULL); \
+ t = g_type_register_static ( \
+ ATK_TYPE_OBJECT_FACTORY, name, &tinfo, 0); \
+ g_free (name); \
+ } \
+ \
+ return t; \
+}
+
+#define EA_SET_FACTORY(widget_type, type_as_function) \
+ atk_registry_set_factory_type (atk_get_default_registry (), \
+ widget_type, \
+ type_as_function ## _factory_get_type ())
+
+#endif /* _EA_FACTORY_H__ */
Index: a11y/calendar/Makefile.am
===================================================================
RCS file: a11y/calendar/Makefile.am
diff -N a11y/calendar/Makefile.am
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/calendar/Makefile.am 22 Jul 2003 07:06:19 -0000
@@ -0,0 +1,31 @@
+
+noinst_LTLIBRARIES = libevolution-calendar-a11y.la
+
+INCLUDES = \
+ -DG_LOG_DOMAIN=\"evolution-a11y\" \
+ -I$(top_srcdir)/shell \
+ -I$(top_srcdir)/calendar \
+ -I$(top_srcdir)/calendar/cal-client \
+ -I$(top_srcdir)/libical/src/libical \
+ -I$(top_srcdir)/calendar/gui \
+ -I$(top_srcdir)/widgets \
+ -I$(top_srcdir)/a11y \
+ -DEVOLUTION_DATADIR=\""$(datadir)"\" \
+ -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \
+ -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
+ -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \
+ -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \
+ -DEVOLUTION_UIDIR=\""$(evolutionuidir)"\" \
+ -DG_DISABLE_DEPRECATED \
+ -DPREFIX=\""$(prefix)"\" \
+ $(A11Y_CFLAGS) \
+ $(EVOLUTION_CALENDAR_CFLAGS)
+
+libevolution_calendar_a11y_la_SOURCES = \
+ ea-calendar.c \
+ ea-calendar-helpers.c \
+ ea-day-view.c \
+ ea-day-view-event.c \
+ ea-week-view.c \
+ ea-week-view-event.c \
+ ea-gnome-calendar.c
Index: a11y/calendar/ea-calendar-helpers.c
===================================================================
RCS file: a11y/calendar/ea-calendar-helpers.c
diff -N a11y/calendar/ea-calendar-helpers.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/calendar/ea-calendar-helpers.c 22 Jul 2003 07:06:19 -0000
@@ -0,0 +1,94 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* Evolution Accessibility: ea-calendar-helpers.c
+ *
+ * Copyright (C) 2003 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Bolian Yin <bolian yin sun com> Sun Microsystem Inc., 2003
+ *
+ */
+
+#include "ea-calendar-helpers.h"
+#include "e-day-view.h"
+#include <gal/e-text/e-text.h>
+
+/**
+ * ea_calendar_helpers_get_accessible_for
+ * @canvas_item: the canvas item (e_text) for a event
+ * @returns: the atk object for the canvas_item
+ *
+ **/
+AtkObject *
+ea_calendar_helpers_get_accessible_for (GnomeCanvasItem *canvas_item)
+{
+ AtkObject *atk_obj = NULL;
+ GtkWidget *view_widget;
+ gboolean is_day_view;
+
+ g_return_val_if_fail (E_IS_TEXT (canvas_item), NULL);
+
+ view_widget = ea_calendar_helpers_get_view_widget_from (canvas_item,
+ &is_day_view);
+ if (view_widget) {
+ if (is_day_view) {
+ atk_obj = g_object_get_data (G_OBJECT(canvas_item),
+ "ea-day-view-event");
+ if (!atk_obj)
+ atk_obj = ea_day_view_event_new (G_OBJECT (canvas_item));
+ }
+ else {
+ atk_obj = g_object_get_data (G_OBJECT(canvas_item),
+ "ea-week-view-event");
+ if (!atk_obj)
+ atk_obj = ea_week_view_event_new (G_OBJECT (canvas_item));
+ }
+ }
+ return atk_obj;
+}
+
+/**
+ * ea_calendar_helpers_get_view_widget_from:
+ * @canvas_item: the canvas item (e_text) for a event
+ * @is_day_ivew: %TRUE if the @canvas_item is in a day view
+ * @returns: the day/week view widget if exists
+ *
+ * Get the day/week view widget contains the canvas_item.
+ *
+ **/
+GtkWidget *
+ea_calendar_helpers_get_view_widget_from (GnomeCanvasItem *canvas_item,
+ gboolean *is_day_view)
+{
+ GnomeCanvas *canvas;
+ GtkWidget *view_widget = NULL;
+
+ g_return_val_if_fail (canvas_item, NULL);
+ g_return_val_if_fail (E_IS_TEXT (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)
+ if (E_IS_DAY_VIEW (view_widget))
+ *is_day_view = TRUE;
+ else
+ *is_day_view = FALSE;
+ return view_widget;
+}
Index: a11y/calendar/ea-calendar-helpers.h
===================================================================
RCS file: a11y/calendar/ea-calendar-helpers.h
diff -N a11y/calendar/ea-calendar-helpers.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/calendar/ea-calendar-helpers.h 22 Jul 2003 07:06:19 -0000
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* Evolution Accessibility: ea-calendar-helpers.h
+ *
+ * Copyright (C) 2003 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Bolian Yin <bolian yin sun com> Sun Microsystem Inc., 2003
+ *
+ */
+
+/* Evolution Accessibility
+*/
+
+#ifndef _EA_CALENDAR_HELPERS_H__
+#define _EA_CALENDAR_HELPERS_H__
+
+#include "ea-day-view.h"
+#include "ea-day-view-event.h"
+#include "ea-week-view.h"
+#include "ea-week-view-event.h"
+
+AtkObject *
+ea_calendar_helpers_get_accessible_for (GnomeCanvasItem *canvas_item);
+
+GtkWidget *
+ea_calendar_helpers_get_view_widget_from (GnomeCanvasItem *canvas_item,
+ gboolean *is_day_view);
+
+#endif /* _EA_CALENDAR_HELPERS_H__ */
Index: a11y/calendar/ea-calendar.c
===================================================================
RCS file: a11y/calendar/ea-calendar.c
diff -N a11y/calendar/ea-calendar.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/calendar/ea-calendar.c 22 Jul 2003 07:06:20 -0000
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* Evolution Accessibility: ea-calendar.c
+ *
+ * Copyright (C) 2003 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Bolian Yin <bolian yin sun com> Sun Microsystem Inc., 2003
+ *
+ */
+
+#include <gal/e-text/e-text.h>
+#include "ea-calendar-helpers.h"
+#include "ea-factory.h"
+#include "ea-calendar.h"
+
+#include "calendar/ea-day-view.h"
+#include "calendar/ea-day-view-event.h"
+#include "calendar/ea-week-view.h"
+#include "calendar/ea-gnome-calendar.h"
+
+
+EA_FACTORY (EA_TYPE_DAY_VIEW, ea_day_view, ea_day_view_new);
+EA_FACTORY (EA_TYPE_WEEK_VIEW, ea_week_view, ea_week_view_new);
+EA_FACTORY (EA_TYPE_GNOME_CALENDAR, ea_gnome_calendar, ea_gnome_calendar_new);
+
+static gboolean ea_calendar_focus_watcher (GSignalInvocationHint *ihint,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer data);
+
+void
+gnome_calendar_a11y_init (void)
+{
+ EA_SET_FACTORY (gnome_calendar_get_type(), ea_gnome_calendar);
+ g_signal_add_emission_hook (g_signal_lookup ("event", E_TYPE_TEXT),
+ 0, ea_calendar_focus_watcher,
+ NULL, (GDestroyNotify) NULL);
+}
+
+void
+e_day_view_a11y_init (void)
+{
+ EA_SET_FACTORY (e_day_view_get_type(), ea_day_view);
+}
+
+void
+e_week_view_a11y_init (void)
+{
+ EA_SET_FACTORY (e_week_view_get_type(), ea_week_view);
+}
+
+gboolean
+ea_calendar_focus_watcher (GSignalInvocationHint *ihint,
+ guint n_param_values,
+ const GValue *param_values,
+ gpointer data)
+{
+ GObject *object;
+ GdkEvent *event;
+
+ object = g_value_get_object (param_values + 0);
+ event = g_value_get_boxed (param_values + 1);
+
+ if (E_IS_TEXT (object)) {
+ GnomeCanvasItem *canvas_item;
+ AtkObject *ea_event;
+
+ canvas_item = GNOME_CANVAS_ITEM (object);
+ if (event->type == GDK_FOCUS_CHANGE) {
+ if (event->focus_change.in)
+ ea_event =
+ ea_calendar_helpers_get_accessible_for (canvas_item);
+ else
+ /* focus out */
+ ea_event = NULL;
+ atk_focus_tracker_notify (ea_event);
+
+ }
+ }
+ return TRUE;
+}
Index: a11y/calendar/ea-calendar.h
===================================================================
RCS file: a11y/calendar/ea-calendar.h
diff -N a11y/calendar/ea-calendar.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/calendar/ea-calendar.h 22 Jul 2003 07:06:20 -0000
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* Evolution Accessibility: ea-calendar.h
+ *
+ * Copyright (C) 2003 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Bolian Yin <bolian yin sun com> Sun Microsystem Inc., 2003
+ *
+ */
+
+/* Evolution Accessibility
+*/
+
+#ifndef _EA_CALENDAR_H__
+#define _EA_CALENDAR_H__
+
+void gnome_calendar_a11y_init (void);
+void e_day_view_a11y_init (void);
+void e_week_view_a11y_init (void);
+
+#endif /* _EA_CALENDAR_H__ */
Index: a11y/calendar/ea-day-view-event.c
===================================================================
RCS file: a11y/calendar/ea-day-view-event.c
diff -N a11y/calendar/ea-day-view-event.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/calendar/ea-day-view-event.c 22 Jul 2003 07:06:20 -0000
@@ -0,0 +1,247 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* Evolution Accessibility: ea-day-view.c
+ *
+ * Copyright (C) 2003 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Bolian Yin <bolian yin sun com> Sun Microsystem Inc., 2003
+ *
+ */
+
+#include "ea-day-view-event.h"
+#include "ea-calendar-helpers.h"
+#include <gal/e-text/e-text.h>
+
+static void ea_day_view_event_class_init (EaDayViewEventClass *klass);
+
+static G_CONST_RETURN gchar* ea_day_view_event_get_name (AtkObject *accessible);
+static G_CONST_RETURN gchar* ea_day_view_event_get_description (AtkObject *accessible);
+static AtkObject* ea_day_view_event_get_parent (AtkObject *accessible);
+static gint ea_day_view_event_get_index_in_parent (AtkObject *accessible);
+
+static void ea_day_view_event_real_initialize (AtkObject *obj,
+ gpointer data);
+
+static gpointer parent_class = NULL;
+
+GType
+ea_day_view_event_get_type (void)
+{
+ static GType type = 0;
+ AtkObjectFactory *factory;
+ GTypeQuery query;
+ GType derived_atk_type;
+
+
+ if (!type) {
+ static GTypeInfo tinfo = {
+ sizeof (EaDayViewEventClass),
+ (GBaseInitFunc) NULL, /* base init */
+ (GBaseFinalizeFunc) NULL, /* base finalize */
+ (GClassInitFunc) ea_day_view_event_class_init, /* class init */
+ (GClassFinalizeFunc) NULL, /* class finalize */
+ NULL, /* class data */
+ sizeof (EaDayViewEvent), /* instance size */
+ 0, /* nb preallocs */
+ (GInstanceInitFunc) NULL, /* instance init */
+ NULL /* value table */
+ };
+
+ /*
+ * Figure out the size of the class and instance
+ * we are run-time deriving from (atk object for E_TEXT, in this case)
+ */
+
+ factory = atk_registry_get_factory (atk_get_default_registry (),
+ E_TYPE_TEXT);
+ derived_atk_type = atk_object_factory_get_accessible_type (factory);
+ g_type_query (derived_atk_type, &query);
+
+ tinfo.class_size = query.class_size;
+ tinfo.instance_size = query.instance_size;
+
+ type = g_type_register_static (derived_atk_type,
+ "EaDayViewEvent", &tinfo, 0);
+ }
+
+ return type;
+}
+
+static void
+ea_day_view_event_class_init (EaDayViewEventClass *klass)
+{
+ AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
+
+
+ class->get_name = ea_day_view_event_get_name;
+ class->get_description = ea_day_view_event_get_description;
+ class->get_parent = ea_day_view_event_get_parent;
+ class->get_index_in_parent = ea_day_view_event_get_index_in_parent;
+ class->initialize = ea_day_view_event_real_initialize;
+}
+
+static void
+ea_day_view_event_real_initialize (AtkObject *obj,
+ gpointer data)
+{
+ ATK_OBJECT_CLASS (parent_class)->initialize (obj, data);
+
+ /*
+ obj->role = ATK_ROLE_TEXT;
+ */
+}
+
+AtkObject*
+ea_day_view_event_new (GObject *obj)
+{
+ EDayView *day_view;
+ GtkWidget *view_widget;
+ EDayViewEvent *day_view_event;
+ AtkObject *atk_obj;
+ GnomeCanvasItem *canvas_item;
+ gboolean event_found, is_day_view;
+ gint event_day, event_num;
+
+ g_return_val_if_fail (E_IS_TEXT (obj), NULL);
+
+ canvas_item = GNOME_CANVAS_ITEM (obj);
+ view_widget = ea_calendar_helpers_get_view_widget_from (canvas_item,
+ &is_day_view);
+ if (!view_widget || !is_day_view)
+ return NULL;
+ day_view = E_DAY_VIEW (view_widget);
+
+
+ event_found = e_day_view_find_event_from_item (day_view, canvas_item,
+ &event_day, &event_num);
+ if (!event_found)
+ return NULL;
+
+ if (event_day == E_DAY_VIEW_LONG_EVENT) {
+ /* a long event */
+ day_view_event = &g_array_index (day_view->long_events,
+ EDayViewEvent, event_num);
+ }
+ else {
+ /* a main canvas event */
+ day_view_event = &g_array_index (day_view->events[event_day],
+ EDayViewEvent, event_num);
+ }
+
+ atk_obj = ATK_OBJECT (g_object_new (EA_TYPE_DAY_VIEW_EVENT, NULL));
+ atk_object_initialize (atk_obj, obj);
+
+ /* store our result */
+ g_object_set_data (obj, "e-day-view", day_view);
+ g_object_set_data (obj, "e-day-view-event", day_view_event);
+ g_object_set_data (obj, "ea-day-view-event", atk_obj);
+ fprintf (stderr,"a ea-day-view-event created: %p\n", atk_obj);
+
+ return atk_obj;
+}
+
+static G_CONST_RETURN gchar*
+ea_day_view_event_get_name (AtkObject *accessible)
+{
+ if (!accessible->name)
+ atk_object_set_name(accessible, "day view event");
+ return accessible->name;
+}
+
+static G_CONST_RETURN gchar*
+ea_day_view_event_get_description (AtkObject *accessible)
+{
+ if (!accessible->description)
+ atk_object_set_description(accessible,
+ "day view event");
+ return accessible->description;
+}
+
+static AtkObject *
+ea_day_view_event_get_parent (AtkObject *accessible)
+{
+ AtkGObjectAccessible *atk_gobj;
+ GObject *g_obj;
+ GnomeCanvasItem *canvas_item;
+ GtkWidget *day_view;
+ gboolean is_day_view;
+
+ g_return_val_if_fail (EA_IS_DAY_VIEW_EVENT (accessible), NULL);
+ atk_gobj = ATK_GOBJECT_ACCESSIBLE (accessible);
+
+ g_obj = atk_gobject_accessible_get_object (atk_gobj);
+ if (g_obj == NULL)
+ /* Object is defunct */
+ return NULL;
+ canvas_item = GNOME_CANVAS_ITEM (g_obj);
+
+ day_view = ea_calendar_helpers_get_view_widget_from (canvas_item,
+ &is_day_view);
+
+ if (!day_view || !is_day_view)
+ return NULL;
+
+ return gtk_widget_get_accessible (day_view);
+}
+
+static gint
+ea_day_view_event_get_index_in_parent (AtkObject *accessible)
+{
+ GtkAccessible *ea_parent;
+ EaDayViewEvent *ea_event;
+ EDayView *day_view;
+
+ EDayViewEvent *day_view_event, *event;
+ gint day, event_num;
+
+ g_return_val_if_fail (EA_IS_DAY_VIEW_EVENT (accessible), -1);
+ ea_event = EA_DAY_VIEW_EVENT (accessible);
+ day_view_event = g_object_get_data (G_OBJECT(ea_event), "e-day-view-event");
+ if (!day_view_event)
+ return -1;
+
+ ea_parent = GTK_ACCESSIBLE (atk_object_get_parent (accessible));
+ if (!ea_parent)
+ return -1;
+
+ day_view = E_DAY_VIEW (ea_parent->widget);
+
+ /* the long event comes first in the order */
+ for (event_num = day_view->long_events->len - 1; event_num >= 0;
+ event_num--) {
+ event = &g_array_index (day_view->long_events,
+ EDayViewEvent, event_num);
+ if (day_view_event == event)
+ return event_num;
+
+ }
+
+ for (day = 0; day < day_view->days_shown; day++) {
+ for (event_num = day_view->events[day]->len - 1; event_num >= 0;
+ event_num--) {
+ event = &g_array_index (day_view->events[day],
+ EDayViewEvent, event_num);
+ if (day_view_event == event)
+ return day_view->long_events->len + event_num;
+ }
+ }
+
+ return -1;
+}
Index: a11y/calendar/ea-day-view-event.h
===================================================================
RCS file: a11y/calendar/ea-day-view-event.h
diff -N a11y/calendar/ea-day-view-event.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/calendar/ea-day-view-event.h 22 Jul 2003 07:06:20 -0000
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* Evolution Accessibility: ea-day-view-event.h
+ *
+ * Copyright (C) 2003 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Bolian Yin <bolian yin sun com> Sun Microsystem Inc., 2003
+ *
+ */
+
+#ifndef __EA_DAY_VIEW_EVENT_H__
+#define __EA_DAY_VIEW_EVENT_H__
+
+#include <gtk/gtkaccessible.h>
+#include "ea-day-view.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define EA_TYPE_DAY_VIEW_EVENT (ea_day_view_event_get_type ())
+#define EA_DAY_VIEW_EVENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EA_TYPE_DAY_VIEW_EVENT, EaDayViewEvent))
+#define EA_DAY_VIEW_EVENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EA_TYPE_DAY_VIEW_EVENT, EaDayViewEventClass))
+#define EA_IS_DAY_VIEW_EVENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EA_TYPE_DAY_VIEW_EVENT))
+#define EA_IS_DAY_VIEW_EVENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EA_TYPE_DAY_VIEW_EVENT))
+#define EA_DAY_VIEW_EVENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EA_TYPE_DAY_VIEW_EVENT, EaDayViewEventClass))
+
+typedef struct _EaDayViewEvent EaDayViewEvent;
+typedef struct _EaDayViewEventClass EaDayViewEventClass;
+
+struct _EaDayViewEvent
+{
+ AtkGObjectAccessible parent;
+};
+
+GType ea_day_view_event_get_type (void);
+
+struct _EaDayViewEventClass
+{
+ AtkGObjectAccessibleClass parent_class;
+};
+
+AtkObject *ea_day_view_event_new (GObject *obj);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+#endif /* __EA_DAY_VIEW_EVENT_H__ */
Index: a11y/calendar/ea-day-view.c
===================================================================
RCS file: a11y/calendar/ea-day-view.c
diff -N a11y/calendar/ea-day-view.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/calendar/ea-day-view.c 22 Jul 2003 07:06:20 -0000
@@ -0,0 +1,271 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* Evolution Accessibility: ea-day-view.c
+ *
+ * Copyright (C) 2003 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Bolian Yin <bolian yin sun com> Sun Microsystem Inc., 2003
+ *
+ */
+
+#include "ea-day-view.h"
+#include "ea-day-view-event.h"
+#include "ea-calendar-helpers.h"
+
+static void ea_day_view_class_init (EaDayViewClass *klass);
+
+static G_CONST_RETURN gchar* ea_day_view_get_name (AtkObject *accessible);
+static G_CONST_RETURN gchar* ea_day_view_get_description (AtkObject *accessible);
+static AtkObject* ea_day_view_get_parent (AtkObject *accessible);
+static gint ea_day_view_get_n_children (AtkObject *obj);
+static AtkObject* ea_day_view_ref_child (AtkObject *obj,
+ gint i);
+static gint ea_day_view_get_index_in_parent (AtkObject *accessible);
+
+static void ea_day_view_real_initialize (AtkObject *obj,
+ gpointer data);
+
+static gpointer parent_class = NULL;
+
+GType
+ea_day_view_get_type (void)
+{
+ static GType type = 0;
+ AtkObjectFactory *factory;
+ GTypeQuery query;
+ GType derived_atk_type;
+
+ if (!type) {
+ static GTypeInfo tinfo = {
+ sizeof (EaDayViewClass),
+ (GBaseInitFunc) NULL, /* base init */
+ (GBaseFinalizeFunc) NULL, /* base finalize */
+ (GClassInitFunc) ea_day_view_class_init, /* class init */
+ (GClassFinalizeFunc) NULL, /* class finalize */
+ NULL, /* class data */
+ sizeof (EaDayView), /* instance size */
+ 0, /* nb preallocs */
+ (GInstanceInitFunc) NULL, /* instance init */
+ NULL /* value table */
+ };
+
+ /*
+ * Figure out the size of the class and instance
+ * we are run-time deriving from (GailWidget, in this case)
+ */
+
+ factory = atk_registry_get_factory (atk_get_default_registry (),
+ GTK_TYPE_WIDGET);
+ derived_atk_type = atk_object_factory_get_accessible_type (factory);
+ g_type_query (derived_atk_type, &query);
+
+ tinfo.class_size = query.class_size;
+ tinfo.instance_size = query.instance_size;
+
+ type = g_type_register_static (derived_atk_type,
+ "EaDayView", &tinfo, 0);
+
+ }
+
+ return type;
+}
+
+static void
+ea_day_view_class_init (EaDayViewClass *klass)
+{
+ AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ class->get_name = ea_day_view_get_name;
+ class->get_description = ea_day_view_get_description;
+
+ class->get_parent = ea_day_view_get_parent;
+ class->get_index_in_parent = ea_day_view_get_index_in_parent;
+ class->get_n_children = ea_day_view_get_n_children;
+ class->ref_child = ea_day_view_ref_child;
+
+ class->initialize = ea_day_view_real_initialize;
+}
+
+/**
+ * This function specifies the GtkWidget for which the EaDayView was created
+ * and specifies a handler to be called when the GtkWidget is destroyed.
+ **/
+static void
+ea_day_view_real_initialize (AtkObject *obj,
+ gpointer data)
+{
+ GtkAccessible *accessible;
+ GtkWidget *widget;
+
+ g_return_if_fail (GTK_IS_WIDGET (data));
+
+ widget = GTK_WIDGET (data);
+
+ accessible = GTK_ACCESSIBLE (obj);
+ accessible->widget = widget;
+ gtk_accessible_connect_widget_destroyed (accessible);
+ obj->role = ATK_ROLE_CANVAS;
+}
+
+AtkObject*
+ea_day_view_new (GtkWidget *widget)
+{
+ GObject *object;
+ AtkObject *accessible;
+
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
+
+ object = g_object_new (EA_TYPE_DAY_VIEW, NULL);
+
+ accessible = ATK_OBJECT (object);
+ atk_object_initialize (accessible, widget);
+
+ printf ("EA-day-view created\n");
+
+ return accessible;
+}
+
+static G_CONST_RETURN gchar*
+ea_day_view_get_name (AtkObject *accessible)
+{
+ EDayView *day_view;
+
+ g_return_val_if_fail (EA_IS_DAY_VIEW (accessible), NULL);
+
+ day_view = E_DAY_VIEW (GTK_ACCESSIBLE (accessible)->widget);
+
+ if (!accessible->name) {
+ GnomeCalendarViewType view_type;
+
+ view_type = gnome_calendar_get_view (day_view->calendar);
+
+ if (view_type == GNOME_CAL_WORK_WEEK_VIEW)
+ atk_object_set_name(accessible, "work week view");
+ else
+ atk_object_set_name(accessible, "day view view");
+ }
+ return accessible->name;
+}
+
+static G_CONST_RETURN gchar*
+ea_day_view_get_description (AtkObject *accessible)
+{
+ EDayView *day_view;
+
+ g_return_val_if_fail (EA_IS_DAY_VIEW (accessible), NULL);
+
+ day_view = E_DAY_VIEW (GTK_ACCESSIBLE (accessible)->widget);
+
+ if (!accessible->description) {
+ GnomeCalendarViewType view_type;
+
+ view_type = gnome_calendar_get_view (day_view->calendar);
+
+ if (view_type == GNOME_CAL_WORK_WEEK_VIEW)
+ atk_object_set_description(accessible,
+ "calendar view for a work week");
+ else
+ atk_object_set_description(accessible,
+ "calendar view for one or more days");
+ }
+ return accessible->description;
+}
+
+static AtkObject*
+ea_day_view_get_parent (AtkObject *accessible)
+{
+ EDayView *day_view;
+ GnomeCalendar *gnomeCalendar;
+
+ g_return_val_if_fail (EA_IS_DAY_VIEW (accessible), NULL);
+
+ day_view = E_DAY_VIEW (GTK_ACCESSIBLE (accessible)->widget);
+
+ gnomeCalendar = day_view->calendar;
+
+ return gtk_widget_get_accessible (GTK_WIDGET(gnomeCalendar));
+}
+
+static gint
+ea_day_view_get_n_children (AtkObject *accessible)
+{
+ EDayView *day_view;
+ gint day;
+ gint child_num = 0;
+
+ g_return_val_if_fail (EA_IS_DAY_VIEW (accessible), -1);
+
+ day_view = E_DAY_VIEW (GTK_ACCESSIBLE (accessible)->widget);
+
+ child_num += day_view->long_events->len;
+
+ for (day = 0; day < day_view->days_shown; day++) {
+ child_num += day_view->events[day]->len;
+ }
+
+ return child_num;
+}
+
+static AtkObject *
+ea_day_view_ref_child (AtkObject *accessible, gint i)
+{
+ EDayView *day_view;
+ gint child_num;
+ gint day;
+ AtkObject *atk_object = NULL;
+ EDayViewEvent *event = NULL;
+
+ g_return_val_if_fail (EA_IS_DAY_VIEW (accessible), NULL);
+
+ child_num = atk_object_get_n_accessible_children (accessible);
+ if (child_num <= 0 || i < 0 || i >= child_num)
+ return NULL;
+
+ day_view = E_DAY_VIEW (GTK_ACCESSIBLE (accessible)->widget);
+
+ /* a long event */
+ if (i < day_view->long_events->len) {
+ event = &g_array_index (day_view->long_events,
+ EDayViewEvent, i);
+ }
+ else {
+ i -= day_view->long_events->len;
+ day = 0;
+ while (i >= day_view->events[day]->len) {
+ i -= day_view->events[day]->len;
+ ++day;
+ }
+
+ event = &g_array_index (day_view->events[day],
+ EDayViewEvent, i);
+ }
+ printf ("child event for index=%d is %p\n", i, event);
+ if (event && event->canvas_item) {
+ atk_object = ea_calendar_helpers_get_accessible_for (event->canvas_item);
+ g_object_ref (atk_object);
+ }
+ return atk_object;
+}
+
+static gint
+ea_day_view_get_index_in_parent (AtkObject *accessible)
+{
+ return 1;
+}
Index: a11y/calendar/ea-day-view.h
===================================================================
RCS file: a11y/calendar/ea-day-view.h
diff -N a11y/calendar/ea-day-view.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/calendar/ea-day-view.h 22 Jul 2003 07:06:20 -0000
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* Evolution Accessibility: ea-day-view.h
+ *
+ * Copyright (C) 2003 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Bolian Yin <bolian yin sun com> Sun Microsystem Inc., 2003
+ *
+ */
+
+#ifndef __EA_DAY_VIEW_H__
+#define __EA_DAY_VIEW_H__
+
+#include <gtk/gtkaccessible.h>
+#include "e-day-view.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define EA_TYPE_DAY_VIEW (ea_day_view_get_type ())
+#define EA_DAY_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EA_TYPE_DAY_VIEW, EaDayView))
+#define EA_DAY_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EA_TYPE_DAY_VIEW, EaDayViewClass))
+#define EA_IS_DAY_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EA_TYPE_DAY_VIEW))
+#define EA_IS_DAY_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EA_TYPE_DAY_VIEW))
+#define EA_DAY_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EA_TYPE_DAY_VIEW, EaDayViewClass))
+
+typedef struct _EaDayView EaDayView;
+typedef struct _EaDayViewClass EaDayViewClass;
+
+struct _EaDayView
+{
+ GtkAccessible parent;
+};
+
+GType ea_day_view_get_type (void);
+
+struct _EaDayViewClass
+{
+ GtkAccessibleClass parent_class;
+};
+
+AtkObject* ea_day_view_new (GtkWidget *widget);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __EA_DAY_VIEW_H__ */
Index: a11y/calendar/ea-gnome-calendar.c
===================================================================
RCS file: a11y/calendar/ea-gnome-calendar.c
diff -N a11y/calendar/ea-gnome-calendar.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/calendar/ea-gnome-calendar.c 22 Jul 2003 07:06:20 -0000
@@ -0,0 +1,209 @@
+ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* Evolution Accessibility: ea-gnome-calendar.c
+ *
+ * Copyright (C) 2003 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Bolian Yin <bolian yin sun com> Sun Microsystem Inc., 2003
+ *
+ */
+
+#include "ea-gnome-calendar.h"
+
+static void ea_gnome_calendar_class_init (EaGnomeCalendarClass *klass);
+
+static G_CONST_RETURN gchar* ea_gnome_calendar_get_name (AtkObject *accessible);
+static G_CONST_RETURN gchar* ea_gnome_calendar_get_description (AtkObject *accessible);
+static gint ea_gnome_get_n_children (AtkObject* obj);
+static AtkObject * ea_gnome_ref_child (AtkObject *obj, gint i);
+
+static void ea_gnome_calendar_real_initialize (AtkObject *obj,
+ gpointer data);
+
+static gpointer parent_class = NULL;
+
+GType
+ea_gnome_calendar_get_type (void)
+{
+ static GType type = 0;
+ AtkObjectFactory *factory;
+ GTypeQuery query;
+ GType derived_atk_type;
+
+ if (!type) {
+ static GTypeInfo tinfo = {
+ sizeof (EaGnomeCalendarClass),
+ (GBaseInitFunc) NULL, /* base init */
+ (GBaseFinalizeFunc) NULL, /* base finalize */
+ (GClassInitFunc) ea_gnome_calendar_class_init, /* class init */
+ (GClassFinalizeFunc) NULL, /* class finalize */
+ NULL, /* class data */
+ sizeof (EaGnomeCalendar), /* instance size */
+ 0, /* nb preallocs */
+ (GInstanceInitFunc) NULL, /* instance init */
+ NULL /* value table */
+ };
+
+ /*
+ * Figure out the size of the class and instance
+ * we are run-time deriving from (GailWidget, in this case)
+ */
+
+ factory = atk_registry_get_factory (atk_get_default_registry (),
+ GTK_TYPE_WIDGET);
+ derived_atk_type = atk_object_factory_get_accessible_type (factory);
+ g_type_query (derived_atk_type, &query);
+ tinfo.class_size = query.class_size;
+ tinfo.instance_size = query.instance_size;
+
+ type = g_type_register_static (derived_atk_type,
+ "EaGnomeCalendar", &tinfo, 0);
+
+ }
+
+ return type;
+}
+
+static void
+ea_gnome_calendar_class_init (EaGnomeCalendarClass *klass)
+{
+ AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ class->get_name = ea_gnome_calendar_get_name;
+ class->get_description = ea_gnome_calendar_get_description;
+
+ class->get_n_children = ea_gnome_get_n_children;
+ class->ref_child = ea_gnome_ref_child;
+
+ class->initialize = ea_gnome_calendar_real_initialize;
+}
+
+/**
+ * This function specifies the GtkWidget for which the EaGnomeCalendar
+ * was created and specifies a handler to be called when the GtkWidget is
+ * destroyed.
+ **/
+static void
+ea_gnome_calendar_real_initialize (AtkObject *obj,
+ gpointer data)
+{
+ GtkAccessible *accessible;
+ GtkWidget *widget;
+
+ g_return_if_fail (GTK_IS_WIDGET (data));
+
+ widget = GTK_WIDGET (data);
+
+ accessible = GTK_ACCESSIBLE (obj);
+ accessible->widget = widget;
+ gtk_accessible_connect_widget_destroyed (accessible);
+ obj->role = ATK_ROLE_FILLER;
+}
+
+AtkObject*
+ea_gnome_calendar_new (GtkWidget *widget)
+{
+ GObject *object;
+ AtkObject *accessible;
+
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
+
+ object = g_object_new (EA_TYPE_GNOME_CALENDAR, NULL);
+
+ accessible = ATK_OBJECT (object);
+ atk_object_initialize (accessible, widget);
+
+ fprintf (stderr, "EA-gnome-calendar created: %p\n", accessible);
+
+ return accessible;
+}
+
+static G_CONST_RETURN gchar*
+ea_gnome_calendar_get_name (AtkObject *accessible)
+{
+ if (!accessible->name)
+ atk_object_set_name(accessible, "Gnome Calendar");
+ return accessible->name;
+}
+
+static G_CONST_RETURN gchar*
+ea_gnome_calendar_get_description (AtkObject *accessible)
+{
+ if (!accessible->description)
+ atk_object_set_description(accessible,
+ "Gnome Calendar");
+ return accessible->description;
+}
+
+static gint
+ea_gnome_get_n_children (AtkObject* obj)
+{
+ g_return_val_if_fail (EA_IS_GNOME_CALENDAR (obj), 0);
+
+ return 4;
+}
+
+static AtkObject *
+ea_gnome_ref_child (AtkObject *obj, gint i)
+{
+ AtkObject * child = NULL;
+ GnomeCalendar * calendarWidget;
+ GtkWidget *childWidget;
+
+ g_return_val_if_fail (EA_IS_GNOME_CALENDAR (obj), NULL);
+ /* valid child index range is [0-3] */
+ if (i < 0 || i >3 )
+ return NULL;
+
+ calendarWidget = GNOME_CALENDAR (GTK_ACCESSIBLE (obj)->widget);
+
+ switch (i) {
+ case 0:
+ /* for the search bar */
+ childWidget = gnome_calendar_get_search_bar_widget (calendarWidget);
+ child = gtk_widget_get_accessible (childWidget);
+ atk_object_set_parent (child, obj);
+ atk_object_set_name (child, "search bar");
+ atk_object_set_description (child, "evolution calendar search bar");
+ break;
+ case 1:
+ /* for the day/week view */
+ childWidget = gnome_calendar_get_current_view_widget (calendarWidget);
+ child = gtk_widget_get_accessible (childWidget);
+ atk_object_set_parent (child, obj);
+ break;
+ case 2:
+ /* for calendar */
+ childWidget = gnome_calendar_get_e_calendar_widget (calendarWidget);
+ child = gtk_widget_get_accessible (childWidget);
+ break;
+ case 3:
+ /* for todo list */
+ childWidget =
+ GTK_WIDGET (gnome_calendar_get_task_pad (calendarWidget));
+ child = gtk_widget_get_accessible (childWidget);
+ break;
+ default:
+ break;
+ }
+ if (child)
+ g_object_ref(child);
+ return child;
+}
Index: a11y/calendar/ea-gnome-calendar.h
===================================================================
RCS file: a11y/calendar/ea-gnome-calendar.h
diff -N a11y/calendar/ea-gnome-calendar.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/calendar/ea-gnome-calendar.h 22 Jul 2003 07:06:20 -0000
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* Evolution Accessibility: ea-gnome-calendar.h
+ *
+ * Copyright (C) 2003 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Bolian Yin <bolian yin sun com> Sun Microsystem Inc., 2003
+ *
+ */
+
+#ifndef __EA_GNOME_CALENDAR_H__
+#define __EA_GNOME_CALENDAR_H__
+
+#include <gtk/gtkaccessible.h>
+#include "gnome-cal.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define EA_TYPE_GNOME_CALENDAR (ea_gnome_calendar_get_type ())
+#define EA_GNOME_CALENDAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EA_TYPE_GNOME_CALENDAR, EaGnomeCalendar))
+#define EA_GNOME_CALENDAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EA_TYPE_GNOME_CALENDAR, EaGnomeCalendarClass))
+#define EA_IS_GNOME_CALENDAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EA_TYPE_GNOME_CALENDAR))
+#define EA_IS_GNOME_CALENDAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EA_TYPE_GNOME_CALENDAR))
+#define EA_GNOME_CALENDAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EA_TYPE_GNOME_CALENDAR, EaGnomeCalendarClass))
+
+typedef struct _EaGnomeCalendar EaGnomeCalendar;
+typedef struct _EaGnomeCalendarClass EaGnomeCalendarClass;
+
+struct _EaGnomeCalendar
+{
+ GtkAccessible parent;
+};
+
+GType ea_gnome_calendar_get_type (void);
+
+struct _EaGnomeCalendarClass
+{
+ GtkAccessibleClass parent_class;
+};
+
+AtkObject* ea_gnome_calendar_new (GtkWidget *widget);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+#endif /* __EA_GNOME_CALENDAR_H__ */
Index: a11y/calendar/ea-week-view-event.c
===================================================================
RCS file: a11y/calendar/ea-week-view-event.c
diff -N a11y/calendar/ea-week-view-event.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/calendar/ea-week-view-event.c 22 Jul 2003 07:06:20 -0000
@@ -0,0 +1,209 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* Evolution Accessibility: ea-week-view.c
+ *
+ * Copyright (C) 2003 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Bolian Yin <bolian yin sun com> Sun Microsystem Inc., 2003
+ *
+ */
+
+#include "ea-week-view-event.h"
+#include <gal/e-text/e-text.h>
+
+static void ea_week_view_event_class_init (EaWeekViewEventClass *klass);
+
+static G_CONST_RETURN gchar* ea_week_view_event_get_name (AtkObject *accessible);
+static G_CONST_RETURN gchar* ea_week_view_event_get_description (AtkObject *accessible);
+static AtkObject* ea_week_view_event_get_parent (AtkObject *accessible);
+static gint ea_week_view_event_get_index_in_parent (AtkObject *accessible);
+
+static void ea_week_view_event_real_initialize (AtkObject *obj,
+ gpointer data);
+
+static gpointer parent_class = NULL;
+
+GType
+ea_week_view_event_get_type (void)
+{
+ static GType type = 0;
+ AtkObjectFactory *factory;
+ GTypeQuery query;
+ GType derived_atk_type;
+
+
+ if (!type) {
+ static GTypeInfo tinfo = {
+ sizeof (EaWeekViewEventClass),
+ (GBaseInitFunc) NULL, /* base init */
+ (GBaseFinalizeFunc) NULL, /* base finalize */
+ (GClassInitFunc) ea_week_view_event_class_init, /* class init */
+ (GClassFinalizeFunc) NULL, /* class finalize */
+ NULL, /* class data */
+ sizeof (EaWeekViewEvent), /* instance size */
+ 0, /* nb preallocs */
+ (GInstanceInitFunc) NULL, /* instance init */
+ NULL /* value table */
+ };
+
+ /*
+ * Figure out the size of the class and instance
+ * we are run-time deriving from (atk object for E_TEXT, in this case)
+ */
+
+ factory = atk_registry_get_factory (atk_get_default_registry (),
+ E_TYPE_TEXT);
+ derived_atk_type = atk_object_factory_get_accessible_type (factory);
+ g_type_query (derived_atk_type, &query);
+
+ tinfo.class_size = query.class_size;
+ tinfo.instance_size = query.instance_size;
+
+ type = g_type_register_static (derived_atk_type,
+ "EaWeekViewEvent", &tinfo, 0);
+ }
+
+ return type;
+}
+
+static void
+ea_week_view_event_class_init (EaWeekViewEventClass *klass)
+{
+ AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
+
+
+ class->get_name = ea_week_view_event_get_name;
+ class->get_description = ea_week_view_event_get_description;
+ class->get_parent = ea_week_view_event_get_parent;
+ class->get_index_in_parent = ea_week_view_event_get_index_in_parent;
+ class->initialize = ea_week_view_event_real_initialize;
+}
+
+static void
+ea_week_view_event_real_initialize (AtkObject *obj,
+ gpointer data)
+{
+ ATK_OBJECT_CLASS (parent_class)->initialize (obj, data);
+
+ /*
+ obj->role = ATK_ROLE_TEXT;
+ */
+}
+
+AtkObject*
+ea_week_view_event_new (GObject *obj)
+{
+ GnomeCanvasItem *canvas_item;
+ GtkWidget *view_widget;
+ EWeekView *week_view;
+
+ EWeekViewEvent *week_view_event;
+ AtkObject *atk_obj;
+ gboolean event_found, is_day_view;
+ gint event_num, span_num;
+
+ g_return_val_if_fail (E_IS_TEXT (obj), NULL);
+
+ canvas_item = GNOME_CANVAS_ITEM (obj);
+ view_widget = ea_calendar_helpers_get_view_widget_from (canvas_item,
+ &is_day_view);
+ if (!view_widget || is_day_view)
+ return NULL;
+
+ week_view = E_WEEK_VIEW (view_widget);
+
+ event_found = e_week_view_find_event_from_item (week_view,
+ canvas_item,
+ &event_num,
+ &span_num);
+ if (!event_found)
+ return NULL;
+
+ week_view_event = &g_array_index (week_view->events, EWeekViewEvent,
+ event_num);
+
+ atk_obj = ATK_OBJECT (g_object_new (EA_TYPE_WEEK_VIEW_EVENT, NULL));
+ atk_object_initialize (atk_obj, obj);
+
+ /* store our result */
+ g_object_set_data (obj, "e-week-view", week_view);
+ g_object_set_data (obj, "e-week-view-event", week_view_event);
+ g_object_set_data (obj, "ea-week-view-event", atk_obj);
+ fprintf (stderr,"a ea-week-view-event created: %p\n", atk_obj);
+
+ return atk_obj;
+}
+
+static G_CONST_RETURN gchar*
+ea_week_view_event_get_name (AtkObject *accessible)
+{
+ if (!accessible->name)
+ atk_object_set_name(accessible, "week view event");
+ return accessible->name;
+}
+
+static G_CONST_RETURN gchar*
+ea_week_view_event_get_description (AtkObject *accessible)
+{
+ if (!accessible->description)
+ atk_object_set_description(accessible,
+ "week view event");
+ return accessible->description;
+}
+
+static AtkObject *
+ea_week_view_event_get_parent (AtkObject *accessible)
+{
+ AtkGObjectAccessible *atk_gobj;
+ GObject *g_obj;
+ GnomeCanvasItem *canvas_item;
+ GtkWidget *week_view;
+ gboolean is_day_view;
+
+ g_return_val_if_fail (EA_IS_WEEK_VIEW_EVENT (accessible), NULL);
+ atk_gobj = ATK_GOBJECT_ACCESSIBLE (accessible);
+
+ g_obj = atk_gobject_accessible_get_object (atk_gobj);
+ if (g_obj == NULL)
+ /* Object is defunct */
+ return NULL;
+
+ canvas_item = GNOME_CANVAS_ITEM (g_obj);
+ week_view = ea_calendar_helpers_get_view_widget_from (canvas_item,
+ &is_day_view);
+ if (!week_view || is_day_view)
+ return NULL;
+
+ return gtk_widget_get_accessible (week_view);
+}
+
+static gint
+ea_week_view_event_get_index_in_parent (AtkObject *accessible)
+{
+ EaWeekViewEvent *ea_event;
+ gint index;
+
+ g_return_val_if_fail (EA_IS_WEEK_VIEW_EVENT (accessible), -1);
+ ea_event = EA_WEEK_VIEW_EVENT (accessible);
+ index = (gint) g_object_get_data (G_OBJECT(ea_event),
+ "e-week-view-event-index");
+
+ return index;
+}
Index: a11y/calendar/ea-week-view-event.h
===================================================================
RCS file: a11y/calendar/ea-week-view-event.h
diff -N a11y/calendar/ea-week-view-event.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/calendar/ea-week-view-event.h 22 Jul 2003 07:06:20 -0000
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* Evolution Accessibility: ea-week-view-event.h
+ *
+ * Copyright (C) 2003 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Bolian Yin <bolian yin sun com> Sun Microsystem Inc., 2003
+ *
+ */
+
+#ifndef __EA_WEEK_VIEW_EVENT_H__
+#define __EA_WEEK_VIEW_EVENT_H__
+
+#include <gtk/gtkaccessible.h>
+#include "ea-week-view.h"
+#include "ea-calendar-helpers.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define EA_TYPE_WEEK_VIEW_EVENT (ea_week_view_event_get_type ())
+#define EA_WEEK_VIEW_EVENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EA_TYPE_WEEK_VIEW_EVENT, EaWeekViewEvent))
+#define EA_WEEK_VIEW_EVENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EA_TYPE_WEEK_VIEW_EVENT, EaWeekViewEventClass))
+#define EA_IS_WEEK_VIEW_EVENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EA_TYPE_WEEK_VIEW_EVENT))
+#define EA_IS_WEEK_VIEW_EVENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EA_TYPE_WEEK_VIEW_EVENT))
+#define EA_WEEK_VIEW_EVENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EA_TYPE_WEEK_VIEW_EVENT, EaWeekViewEventClass))
+
+typedef struct _EaWeekViewEvent EaWeekViewEvent;
+typedef struct _EaWeekViewEventClass EaWeekViewEventClass;
+
+struct _EaWeekViewEvent
+{
+ AtkGObjectAccessible parent;
+};
+
+GType ea_week_view_event_get_type (void);
+
+struct _EaWeekViewEventClass
+{
+ AtkGObjectAccessibleClass parent_class;
+};
+
+AtkObject* ea_week_view_event_new (GObject *obj);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+#endif /* __EA_WEEK_VIEW_EVENT_H__ */
Index: a11y/calendar/ea-week-view.c
===================================================================
RCS file: a11y/calendar/ea-week-view.c
diff -N a11y/calendar/ea-week-view.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/calendar/ea-week-view.c 22 Jul 2003 07:06:21 -0000
@@ -0,0 +1,244 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* Evolution Accessibility: ea-week-view.c
+ *
+ * Copyright (C) 2003 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Bolian Yin <bolian yin sun com> Sun Microsystem Inc., 2003
+ *
+ */
+
+#include "ea-week-view.h"
+#include "ea-week-view-event.h"
+
+static void ea_week_view_class_init (EaWeekViewClass *klass);
+
+static G_CONST_RETURN gchar* ea_week_view_get_name (AtkObject *accessible);
+static G_CONST_RETURN gchar* ea_week_view_get_description (AtkObject *accessible);
+static AtkObject* ea_week_view_get_parent (AtkObject *accessible);
+static gint ea_week_view_get_n_children (AtkObject *obj);
+static AtkObject* ea_week_view_ref_child (AtkObject *obj,
+ gint i);
+static gint ea_week_view_get_index_in_parent (AtkObject *accessible);
+
+static void ea_week_view_real_initialize (AtkObject *obj,
+ gpointer data);
+
+static gpointer parent_class = NULL;
+
+GType
+ea_week_view_get_type (void)
+{
+ static GType type = 0;
+ AtkObjectFactory *factory;
+ GTypeQuery query;
+ GType derived_atk_type;
+
+ if (!type) {
+ static GTypeInfo tinfo = {
+ sizeof (EaWeekViewClass),
+ (GBaseInitFunc) NULL, /* base init */
+ (GBaseFinalizeFunc) NULL, /* base finalize */
+ (GClassInitFunc) ea_week_view_class_init, /* class init */
+ (GClassFinalizeFunc) NULL, /* class finalize */
+ NULL, /* class data */
+ sizeof (EaWeekView), /* instance size */
+ 0, /* nb preallocs */
+ (GInstanceInitFunc) NULL, /* instance init */
+ NULL /* value table */
+ };
+
+ /*
+ * Figure out the size of the class and instance
+ * we are run-time deriving from (GailWidget, in this case)
+ */
+
+ factory = atk_registry_get_factory (atk_get_default_registry (),
+ GTK_TYPE_WIDGET);
+ derived_atk_type = atk_object_factory_get_accessible_type (factory);
+ g_type_query (derived_atk_type, &query);
+
+ tinfo.class_size = query.class_size;
+ tinfo.instance_size = query.instance_size;
+
+ type = g_type_register_static (derived_atk_type,
+ "EaWeekView", &tinfo, 0);
+
+ }
+
+ return type;
+}
+
+static void
+ea_week_view_class_init (EaWeekViewClass *klass)
+{
+ AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
+
+ parent_class = g_type_class_peek_parent (klass);
+
+ class->get_name = ea_week_view_get_name;
+ class->get_description = ea_week_view_get_description;
+
+ class->get_parent = ea_week_view_get_parent;
+ class->get_index_in_parent = ea_week_view_get_index_in_parent;
+ class->get_n_children = ea_week_view_get_n_children;
+ class->ref_child = ea_week_view_ref_child;
+
+ class->initialize = ea_week_view_real_initialize;
+}
+
+/**
+ * This function specifies the GtkWidget for which the EaWeekView was created
+ * and specifies a handler to be called when the GtkWidget is destroyed.
+ **/
+static void
+ea_week_view_real_initialize (AtkObject *obj,
+ gpointer data)
+{
+ ATK_OBJECT_CLASS (parent_class)->initialize (obj, data);
+ obj->role = ATK_ROLE_CANVAS;
+}
+
+AtkObject*
+ea_week_view_new (GtkWidget *widget)
+{
+ GObject *object;
+ AtkObject *accessible;
+
+ g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
+
+ object = g_object_new (EA_TYPE_WEEK_VIEW, NULL);
+
+ accessible = ATK_OBJECT (object);
+ atk_object_initialize (accessible, widget);
+
+ fprintf (stderr, "EA-week-view created\n");
+
+ return accessible;
+}
+
+static G_CONST_RETURN gchar*
+ea_week_view_get_name (AtkObject *accessible)
+{
+ EWeekView *week_view;
+
+ g_return_val_if_fail (EA_IS_WEEK_VIEW (accessible), NULL);
+
+ week_view = E_WEEK_VIEW (GTK_ACCESSIBLE (accessible)->widget);
+
+ if (!accessible->name) {
+ GnomeCalendarViewType view_type;
+
+ view_type = gnome_calendar_get_view (week_view->calendar);
+
+ if (view_type == GNOME_CAL_MONTH_VIEW)
+ atk_object_set_name(accessible, "month view");
+ else
+ atk_object_set_name(accessible, "week view");
+ }
+ return accessible->name;
+}
+
+static G_CONST_RETURN gchar*
+ea_week_view_get_description (AtkObject *accessible)
+{
+ EWeekView *week_view;
+
+ g_return_val_if_fail (EA_IS_WEEK_VIEW (accessible), NULL);
+
+ week_view = E_WEEK_VIEW (GTK_ACCESSIBLE (accessible)->widget);
+
+ if (!accessible->description) {
+ GnomeCalendarViewType view_type;
+
+ view_type = gnome_calendar_get_view (week_view->calendar);
+
+ if (view_type == GNOME_CAL_MONTH_VIEW)
+ atk_object_set_description(accessible,
+ "calendar view for a month");
+ else
+ atk_object_set_description(accessible,
+ "calendar view for one or more weeks");
+ }
+ return accessible->description;
+}
+
+static AtkObject*
+ea_week_view_get_parent (AtkObject *accessible)
+{
+ EWeekView *week_view;
+ GnomeCalendar *gnomeCalendar;
+
+ g_return_val_if_fail (EA_IS_WEEK_VIEW (accessible), NULL);
+
+ week_view = E_WEEK_VIEW (GTK_ACCESSIBLE (accessible)->widget);
+
+ gnomeCalendar = week_view->calendar;
+
+ return gtk_widget_get_accessible (GTK_WIDGET(gnomeCalendar));
+}
+
+static gint
+ea_week_view_get_n_children (AtkObject *accessible)
+{
+ EWeekView *week_view;
+
+ g_return_val_if_fail (EA_IS_WEEK_VIEW (accessible), -1);
+
+ week_view = E_WEEK_VIEW (GTK_ACCESSIBLE (accessible)->widget);
+
+ return week_view->events->len;
+}
+
+static AtkObject *
+ea_week_view_ref_child (AtkObject *accessible, gint i)
+{
+ EWeekView *week_view;
+ gint child_num;
+ AtkObject *atk_object = NULL;
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+ gint span_num = 0;
+
+
+ g_return_val_if_fail (EA_IS_WEEK_VIEW (accessible), NULL);
+
+ child_num = atk_object_get_n_accessible_children (accessible);
+ if (child_num <= 0 || i < 0 || i >= child_num)
+ return NULL;
+
+ week_view = E_WEEK_VIEW (GTK_ACCESSIBLE (accessible)->widget);
+
+ event = &g_array_index (week_view->events,
+ EWeekViewEvent, i);
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan,
+ event->spans_index + span_num);
+
+ fprintf (stderr, "refed child event[%d] is %p\n", i, event);
+ if (event) {
+ atk_object = ea_week_view_event_new (G_OBJECT(span->text_item));
+ g_object_ref (atk_object);
+ }
+ return atk_object;
+}
+
+static gint
+ea_week_view_get_index_in_parent (AtkObject *accessible)
+{
+ return 1;
+}
Index: a11y/calendar/ea-week-view.h
===================================================================
RCS file: a11y/calendar/ea-week-view.h
diff -N a11y/calendar/ea-week-view.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ a11y/calendar/ea-week-view.h 22 Jul 2003 07:06:21 -0000
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* vim:expandtab:shiftwidth=4:tabstop=4:
+ */
+/* Evolution Accessibility: ea-week-view.h
+ *
+ * Copyright (C) 2003 Ximian, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Bolian Yin <bolian yin sun com> Sun Microsystem Inc., 2003
+ *
+ */
+
+#ifndef __EA_WEEK_VIEW_H__
+#define __EA_WEEK_VIEW_H__
+
+#include <gtk/gtkaccessible.h>
+#include "e-week-view.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#define EA_TYPE_WEEK_VIEW (ea_week_view_get_type ())
+#define EA_WEEK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EA_TYPE_WEEK_VIEW, EaWeekView))
+#define EA_WEEK_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EA_TYPE_WEEK_VIEW, EaWeekViewClass))
+#define EA_IS_WEEK_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EA_TYPE_WEEK_VIEW))
+#define EA_IS_WEEK_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EA_TYPE_WEEK_VIEW))
+#define EA_WEEK_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EA_TYPE_WEEK_VIEW, EaWeekViewClass))
+
+typedef struct _EaWeekView EaWeekView;
+typedef struct _EaWeekViewClass EaWeekViewClass;
+
+struct _EaWeekView
+{
+ GtkAccessible parent;
+};
+
+GType ea_week_view_get_type (void);
+
+struct _EaWeekViewClass
+{
+ GtkAccessibleClass parent_class;
+};
+
+AtkObject* ea_week_view_new (GtkWidget *widget);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+#endif /* __EA_WEEK_VIEW_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]