aboutsummaryrefslogtreecommitdiffstats
path: root/a11y/calendar
diff options
context:
space:
mode:
authorBolian Yin <bolian.yin@sun.com>2003-08-27 11:36:42 +0800
committerBolian Yin <byin@src.gnome.org>2003-08-27 11:36:42 +0800
commite8fc140c7030594e556b56242afd2b52abc61634 (patch)
tree876546f299eef99a70b4c31868d83f6a903604bd /a11y/calendar
parent7e3eb5f87d84f5c7e7c945bb971367861928a9a0 (diff)
downloadgsoc2013-evolution-e8fc140c7030594e556b56242afd2b52abc61634.tar
gsoc2013-evolution-e8fc140c7030594e556b56242afd2b52abc61634.tar.gz
gsoc2013-evolution-e8fc140c7030594e556b56242afd2b52abc61634.tar.bz2
gsoc2013-evolution-e8fc140c7030594e556b56242afd2b52abc61634.tar.lz
gsoc2013-evolution-e8fc140c7030594e556b56242afd2b52abc61634.tar.xz
gsoc2013-evolution-e8fc140c7030594e556b56242afd2b52abc61634.tar.zst
gsoc2013-evolution-e8fc140c7030594e556b56242afd2b52abc61634.zip
add widgets directory; move calendar idl stuff to calendar directory; stop
2003-08-27 Bolian Yin <bolian.yin@sun.com> * Makefile.am: add widgets directory; move calendar idl stuff to calendar directory; stop make a single shared lib for whole a11y stuff. * ea-factory.h: make factory macros available to GOBJECT * calendar/Makefile.am: add calendar idl stuff * calendar/ea-cal-view-event.c: add atkcomponent interface. * calendar/ea-gnome-calendar.c (ea_gcal_switch_view_cb): add details for "children_changed". * new widgets directory for widgets a11y stuff, new files are: widgets/Makefile.am, widgets/ea-calendar-item.c, widgets/ea-calendar-item.h, widgets/ea-widgets.c, widgets/ea-widgets.h svn path=/trunk/; revision=22384
Diffstat (limited to 'a11y/calendar')
-rw-r--r--a11y/calendar/Makefile.am44
-rw-r--r--a11y/calendar/ea-cal-view-event.c134
-rw-r--r--a11y/calendar/ea-gnome-calendar.c26
3 files changed, 196 insertions, 8 deletions
diff --git a/a11y/calendar/Makefile.am b/a11y/calendar/Makefile.am
index 849e152135..2c3a26f2ba 100644
--- a/a11y/calendar/Makefile.am
+++ b/a11y/calendar/Makefile.am
@@ -1,4 +1,46 @@
+# Calendar IDL files
+
+CALENDAR_IDLS = $(top_srcdir)/calendar/idl/evolution-calendar.idl
+SHELL_IDLS = \
+ $(top_srcdir)/shell/Evolution-Activity.idl \
+ $(top_srcdir)/shell/Evolution-ConfigControl.idl \
+ $(top_srcdir)/shell/Evolution-Offline.idl \
+ $(top_srcdir)/shell/Evolution-Session.idl \
+ $(top_srcdir)/shell/Evolution-Shell.idl \
+ $(top_srcdir)/shell/Evolution-ShellComponent.idl \
+ $(top_srcdir)/shell/Evolution-ShellComponentDnd.idl \
+ $(top_srcdir)/shell/Evolution-ShellView.idl \
+ $(top_srcdir)/shell/Evolution-Shortcuts.idl \
+ $(top_srcdir)/shell/Evolution-Storage.idl \
+ $(top_srcdir)/shell/Evolution-StorageSetView.idl \
+ $(top_srcdir)/shell/Evolution-Wizard.idl \
+ $(top_srcdir)/shell/Evolution-common.idl \
+ $(top_srcdir)/shell/Evolution.idl
+
+CALENDAR_IDL_GENERATED_H = evolution-calendar.h
+CALENDAR_IDL_GENERATED_C = \
+ evolution-calendar-common.c \
+ evolution-calendar-skels.c \
+ evolution-calendar-stubs.c
+SHELL_IDL_GENERATED_H = Evolution.h
+SHELL_IDL_GENERATED_C = \
+ Evolution-common.c \
+ Evolution-skels.c \
+ Evolution-stubs.c
+
+$(CALENDAR_IDL_GENERATED_H): $(CALENDAR_IDLS)
+ $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \
+ $(top_srcdir)/calendar/idl/evolution-calendar.idl
+
+$(SHELL_IDL_GENERATED_H): $(SHELL_IDLS)
+ $(ORBIT_IDL) -I $(srcdir) $(IDL_INCLUDES) \
+ $(top_srcdir)/shell/Evolution.idl
+
+IDL_GENERATED = $(SHELL_IDL_GENERATED_H) $(CALENDAR_IDL_GENERATED_H)
+BUILT_SOURCES = $(IDL_GENERATED)
+CLEANFILES = $(BUILT_SOURCES) $(CALENDAR_IDL_GENERATED_C) $(SHELL_IDL_GENERATED_C)
+
noinst_LTLIBRARIES = libevolution-calendar-a11y.la
INCLUDES = \
@@ -22,6 +64,8 @@ INCLUDES = \
$(EVOLUTION_CALENDAR_CFLAGS)
libevolution_calendar_a11y_la_SOURCES = \
+ $(CALENDAR_IDL_GENERATED_H) \
+ $(SHELL_IDL_GENERATED_H) \
ea-calendar.c \
ea-calendar.h \
ea-calendar-helpers.c \
diff --git a/a11y/calendar/ea-cal-view-event.c b/a11y/calendar/ea-cal-view-event.c
index 40418a56e1..deffa32ce8 100644
--- a/a11y/calendar/ea-cal-view-event.c
+++ b/a11y/calendar/ea-cal-view-event.c
@@ -36,6 +36,12 @@ static G_CONST_RETURN gchar* ea_cal_view_event_get_description (AtkObject *acces
static AtkObject* ea_cal_view_event_get_parent (AtkObject *accessible);
static gint ea_cal_view_event_get_index_in_parent (AtkObject *accessible);
+/* component interface */
+static void atk_component_interface_init (AtkComponentIface *iface);
+static void ea_cal_view_get_extents (AtkComponent *component,
+ gint *x, gint *y, gint *width, gint *height,
+ AtkCoordType coord_type);
+
static gpointer parent_class = NULL;
GType
@@ -61,6 +67,12 @@ ea_cal_view_event_get_type (void)
NULL /* value table */
};
+ static const GInterfaceInfo atk_component_info = {
+ (GInterfaceInitFunc) atk_component_interface_init,
+ (GInterfaceFinalizeFunc) NULL,
+ NULL
+ };
+
/*
* Figure out the size of the class and instance
* we are run-time deriving from (atk object for E_TEXT, in this case)
@@ -77,6 +89,8 @@ ea_cal_view_event_get_type (void)
/* we inherit the component, text and other interfaces from E_TEXT */
type = g_type_register_static (derived_atk_type,
"EaCalViewEvent", &tinfo, 0);
+ g_type_add_interface_static (type, ATK_TYPE_COMPONENT,
+ &atk_component_info);
}
return type;
@@ -104,7 +118,6 @@ ea_cal_view_event_new (GObject *obj)
GObject *target_obj;
ECalView *cal_view;
-
g_return_val_if_fail (E_IS_TEXT (obj), NULL);
cal_view = ea_calendar_helpers_get_cal_view_from (GNOME_CANVAS_ITEM (obj));
if (E_IS_WEEK_VIEW (cal_view)) {
@@ -136,10 +149,13 @@ ea_cal_view_event_new (GObject *obj)
target_obj = obj;
if (!atk_obj) {
+ static AtkRole event_role = ATK_ROLE_INVALID;
atk_obj = ATK_OBJECT (g_object_new (EA_TYPE_CAL_VIEW_EVENT,
NULL));
atk_object_initialize (atk_obj, target_obj);
- atk_obj->role = ATK_ROLE_TEXT;
+ if (event_role == ATK_ROLE_INVALID)
+ event_role = atk_role_register ("Calendar Event");
+ atk_obj->role = event_role;
#ifdef ACC_DEBUG
printf ("EvoAcc: ea_cal_view_event created %p for item=%p\n",
atk_obj, target_obj);
@@ -328,3 +344,117 @@ ea_cal_view_event_get_index_in_parent (AtkObject *accessible)
}
return -1;
}
+
+/* Atk Component Interface */
+
+static void
+atk_component_interface_init (AtkComponentIface *iface)
+{
+ g_return_if_fail (iface != NULL);
+
+ iface->get_extents = ea_cal_view_get_extents;
+}
+
+static void
+ea_cal_view_get_extents (AtkComponent *component,
+ gint *x,
+ gint *y,
+ gint *width,
+ gint *height,
+ AtkCoordType coord_type)
+{
+ GObject *g_obj;
+ GnomeCanvasItem *canvas_item;
+ gint x_window, y_window;
+ gint scroll_x, scroll_y;
+ ECalView *cal_view;
+ gint item_x, item_y, item_w, item_h;
+ GtkWidget *canvas = NULL;
+
+ g_return_if_fail (EA_IS_CAL_VIEW_EVENT (component));
+
+ g_obj = atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE(component));
+ if (!g_obj)
+ /* defunct object*/
+ return;
+ g_return_if_fail (E_IS_TEXT (g_obj));
+
+ canvas_item = GNOME_CANVAS_ITEM (g_obj);
+ cal_view = ea_calendar_helpers_get_cal_view_from (canvas_item);
+ if (!cal_view)
+ return;
+
+ if (E_IS_DAY_VIEW (cal_view)) {
+ gint day, event_num;
+
+ if (!e_day_view_find_event_from_item (E_DAY_VIEW (cal_view),
+ canvas_item,
+ &day, &event_num))
+ return;
+ if (day == E_DAY_VIEW_LONG_EVENT) {
+ gint start_day, end_day;
+ if (!e_day_view_get_long_event_position (E_DAY_VIEW (cal_view),
+ event_num,
+ &start_day,
+ &end_day,
+ &item_x,
+ &item_y,
+ &item_w,
+ &item_h))
+ return;
+ canvas = E_DAY_VIEW (cal_view)->top_canvas;
+ }
+ else {
+ if (!e_day_view_get_event_position (E_DAY_VIEW (cal_view), day,
+ event_num,
+ &item_x, &item_y,
+ &item_w, &item_h))
+
+ return;
+ canvas = E_DAY_VIEW (cal_view)->main_canvas;
+ }
+ }
+ else if (E_IS_WEEK_VIEW (cal_view)) {
+ gint event_num, span_num;
+ if (!e_week_view_find_event_from_item (E_WEEK_VIEW (cal_view),
+ canvas_item, &event_num,
+ &span_num))
+ return;
+
+ if (!e_week_view_get_span_position (E_WEEK_VIEW (cal_view),
+ event_num, span_num,
+ &item_x, &item_y, &item_w))
+ return;
+ item_h = E_WEEK_VIEW_ICON_HEIGHT;
+ canvas = E_WEEK_VIEW (cal_view)->main_canvas;
+ }
+ else
+ return;
+
+ if (!canvas)
+ return;
+
+ gdk_window_get_origin (canvas->window,
+ &x_window, &y_window);
+ gnome_canvas_get_scroll_offsets (GNOME_CANVAS (canvas), &scroll_x, &scroll_y);
+
+ *x = item_x + x_window - scroll_x;
+ *y = item_y + y_window - scroll_y;
+ *width = item_w;
+ *height = item_h;
+
+ if (coord_type == ATK_XY_WINDOW) {
+ GdkWindow *window;
+ gint x_toplevel, y_toplevel;
+
+ window = gdk_window_get_toplevel (GTK_WIDGET (cal_view)->window);
+ gdk_window_get_origin (window, &x_toplevel, &y_toplevel);
+
+ *x -= x_toplevel;
+ *y -= y_toplevel;
+ }
+
+#ifdef ACC_DEBUG
+ printf ("Event Bounds (%d, %d, %d, %d)\n", *x, *y, *width, *height);
+#endif
+}
diff --git a/a11y/calendar/ea-gnome-calendar.c b/a11y/calendar/ea-gnome-calendar.c
index 20361f1451..407b8ed95f 100644
--- a/a11y/calendar/ea-gnome-calendar.c
+++ b/a11y/calendar/ea-gnome-calendar.c
@@ -117,14 +117,14 @@ ea_gnome_calendar_new (GtkWidget *widget)
/* listen on view type change
*/
+ g_signal_connect (widget, "dates_shown_changed",
+ G_CALLBACK (ea_gcal_dates_change_cb),
+ accessible);
notebook = gnome_calendar_get_view_notebook_widget (gcal);
if (notebook) {
g_signal_connect (notebook, "switch_page",
G_CALLBACK (ea_gcal_switch_view_cb),
accessible);
- g_signal_connect (widget, "dates_shown_changed",
- G_CALLBACK (ea_gcal_dates_change_cb),
- accessible);
}
#ifdef ACC_DEBUG
@@ -213,10 +213,19 @@ static void
ea_gcal_switch_view_cb (GtkNotebook *widget, GtkNotebookPage *page,
guint index, gpointer data)
{
- g_signal_emit_by_name (G_OBJECT(data), "children_changed",
- 0, NULL, NULL);
+ GtkWidget *new_widget;
+
+ new_widget = gtk_notebook_get_nth_page (widget, index);
+
+ /* views are always the second child in gnome calendar
+ */
+ if (new_widget)
+ g_signal_emit_by_name (G_OBJECT(data), "children_changed::add",
+ 1, gtk_widget_get_accessible (new_widget), NULL);
+
#ifdef ACC_DEBUG
- printf ("AccDebug: switch view: children_changed notified\n");
+ printf ("AccDebug: view switch to widget %p (index=%d) \n",
+ new_widget, index);
#endif
}
@@ -231,4 +240,9 @@ ea_gcal_dates_change_cb (GnomeCalendar *gcal, gpointer data)
new_name = calendar_get_text_for_folder_bar_label (gcal);
atk_object_set_name (ATK_OBJECT(data), new_name);
+ g_signal_emit_by_name (data, "visible_data_changed");
+
+#ifdef ACC_DEBUG
+ printf ("AccDebug: calendar dates changed, label=%s\n", new_name);
+#endif
}