diff options
author | Boby Wang <boby.wang@sun.com> | 2006-04-28 17:27:52 +0800 |
---|---|---|
committer | Li Yuan <liyuan@src.gnome.org> | 2006-04-28 17:27:52 +0800 |
commit | 3871eb6425bbd343bb14c0442c38fb7ab3b4427c (patch) | |
tree | b3d1cd9b97e8229923767cdb3e53a0a592b9de4a /a11y/calendar | |
parent | aeae812f66a1457e6844bed09c85299cd49a3381 (diff) | |
download | gsoc2013-evolution-3871eb6425bbd343bb14c0442c38fb7ab3b4427c.tar gsoc2013-evolution-3871eb6425bbd343bb14c0442c38fb7ab3b4427c.tar.gz gsoc2013-evolution-3871eb6425bbd343bb14c0442c38fb7ab3b4427c.tar.bz2 gsoc2013-evolution-3871eb6425bbd343bb14c0442c38fb7ab3b4427c.tar.lz gsoc2013-evolution-3871eb6425bbd343bb14c0442c38fb7ab3b4427c.tar.xz gsoc2013-evolution-3871eb6425bbd343bb14c0442c38fb7ab3b4427c.tar.zst gsoc2013-evolution-3871eb6425bbd343bb14c0442c38fb7ab3b4427c.zip |
Fix for #339136
2006-04-28 Boby Wang <boby.wang@sun.com>
Fix for #339136
* calendar/ea-cal-view-event.c: (ea_cal_view_event_get_type),
(ea_cal_view_event_class_init), (ea_cal_view_event_init),
(ea_cal_view_event_dispose),
(ea_cal_view_event_get_index_in_parent),
(ea_cal_view_event_ref_state_set):
add necessary AtkStateSet to EaCalViewEvent.
* calendar/ea-cal-view-event.h:
add necessary AtkStateSet to EaCalViewEvent.
* calendar/ea-calendar.c: (e_cal_view_a11y_init):
replace e_cal_view_get_type with e_calendar_view_get_type
* calendar/ea-day-view.c: (ea_day_view_get_type):
replace e_cal_view_get_type with e_calendar_view_get_type
* calendar/ea-week-view.c:
* calendar/ea-week-view.h:
change the base class of EaWeekView from GtkAccessible to EaCalView
svn path=/trunk/; revision=31924
Diffstat (limited to 'a11y/calendar')
-rw-r--r-- | a11y/calendar/ea-cal-view-event.c | 49 | ||||
-rw-r--r-- | a11y/calendar/ea-cal-view-event.h | 1 | ||||
-rw-r--r-- | a11y/calendar/ea-calendar.c | 2 | ||||
-rw-r--r-- | a11y/calendar/ea-day-view.c | 2 | ||||
-rw-r--r-- | a11y/calendar/ea-week-view.c | 1 | ||||
-rw-r--r-- | a11y/calendar/ea-week-view.h | 6 |
6 files changed, 51 insertions, 10 deletions
diff --git a/a11y/calendar/ea-cal-view-event.c b/a11y/calendar/ea-cal-view-event.c index 41330b6ffd..fa5631a859 100644 --- a/a11y/calendar/ea-cal-view-event.c +++ b/a11y/calendar/ea-cal-view-event.c @@ -1,6 +1,4 @@ /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* vim:expandtab:shiftwidth=8:tabstop=8: - */ /* Evolution Accessibility: ea-cal-view-event.c * * Copyright (C) 2003 Ximian, Inc. @@ -31,11 +29,14 @@ #include <libgnome/gnome-i18n.h> static void ea_cal_view_event_class_init (EaCalViewEventClass *klass); +static void ea_cal_view_event_init (EaCalViewEvent *a11y); +static void ea_cal_view_event_dispose (GObject *object); static G_CONST_RETURN gchar* ea_cal_view_event_get_name (AtkObject *accessible); static G_CONST_RETURN gchar* ea_cal_view_event_get_description (AtkObject *accessible); static AtkObject* ea_cal_view_event_get_parent (AtkObject *accessible); static gint ea_cal_view_event_get_index_in_parent (AtkObject *accessible); +static AtkStateSet *ea_cal_view_event_ref_state_set (AtkObject *accessible); /* component interface */ static void atk_component_interface_init (AtkComponentIface *iface); @@ -75,7 +76,7 @@ ea_cal_view_event_get_type (void) NULL, /* class data */ sizeof (EaCalViewEvent), /* instance size */ 0, /* nb preallocs */ - (GInstanceInitFunc) NULL, /* instance init */ + (GInstanceInitFunc) ea_cal_view_event_init, /* instance init */ NULL /* value table */ }; @@ -123,19 +124,33 @@ static void ea_cal_view_event_class_init (EaCalViewEventClass *klass) { AtkObjectClass *class = ATK_OBJECT_CLASS (klass); -#ifdef ACC_DEBUG GObjectClass *gobject_class = G_OBJECT_CLASS (klass); +#ifdef ACC_DEBUG gobject_class->finalize = ea_cal_view_finalize; #endif parent_class = g_type_class_peek_parent (klass); + gobject_class->dispose = ea_cal_view_event_dispose; class->get_name = ea_cal_view_event_get_name; class->get_description = ea_cal_view_event_get_description; class->get_parent = ea_cal_view_event_get_parent; class->get_index_in_parent = ea_cal_view_event_get_index_in_parent; + class->ref_state_set = ea_cal_view_event_ref_state_set; + +} +static void +ea_cal_view_event_init (EaCalViewEvent *a11y) +{ + a11y->state_set = atk_state_set_new (); + atk_state_set_add_state (a11y->state_set, ATK_STATE_TRANSIENT); + atk_state_set_add_state (a11y->state_set, ATK_STATE_ENABLED); + atk_state_set_add_state (a11y->state_set, ATK_STATE_SENSITIVE); + atk_state_set_add_state (a11y->state_set, ATK_STATE_SELECTABLE); + atk_state_set_add_state (a11y->state_set, ATK_STATE_SHOWING); + atk_state_set_add_state (a11y->state_set, ATK_STATE_FOCUSABLE); } #ifdef ACC_DEBUG @@ -210,6 +225,20 @@ ea_cal_view_event_new (GObject *obj) return atk_obj; } +static void +ea_cal_view_event_dispose (GObject *object) +{ + EaCalViewEvent *a11y = EA_CAL_VIEW_EVENT (object); + + if (a11y->state_set) { + g_object_unref (a11y->state_set); + a11y->state_set = NULL; + } + + if (G_OBJECT_CLASS(parent_class)->dispose) + G_OBJECT_CLASS(parent_class)->dispose (object); +} + static G_CONST_RETURN gchar* ea_cal_view_event_get_name (AtkObject *accessible) { @@ -365,6 +394,18 @@ ea_cal_view_event_get_index_in_parent (AtkObject *accessible) return -1; } +static AtkStateSet * +ea_cal_view_event_ref_state_set (AtkObject *accessible) +{ + EaCalViewEvent *atk_event = EA_CAL_VIEW_EVENT (accessible); + + g_return_val_if_fail (atk_event->state_set, NULL); + + g_object_ref (atk_event->state_set); + + return atk_event->state_set; +} + /* Atk Component Interface */ static void diff --git a/a11y/calendar/ea-cal-view-event.h b/a11y/calendar/ea-cal-view-event.h index f139dde9fb..e095bca64f 100644 --- a/a11y/calendar/ea-cal-view-event.h +++ b/a11y/calendar/ea-cal-view-event.h @@ -45,6 +45,7 @@ typedef struct _EaCalViewEventClass EaCalViewEventClass; struct _EaCalViewEvent { AtkGObjectAccessible parent; + AtkStateSet *state_set; }; GType ea_cal_view_event_get_type (void); diff --git a/a11y/calendar/ea-calendar.c b/a11y/calendar/ea-calendar.c index 809a9f75df..a11d2eea7a 100644 --- a/a11y/calendar/ea-calendar.c +++ b/a11y/calendar/ea-calendar.c @@ -98,7 +98,7 @@ gnome_calendar_a11y_init (void) void e_cal_view_a11y_init (void) { - EA_SET_FACTORY (e_cal_view_get_type(), ea_cal_view); + EA_SET_FACTORY (e_calendar_view_get_type(), ea_cal_view); } void diff --git a/a11y/calendar/ea-day-view.c b/a11y/calendar/ea-day-view.c index 5f9eedfeca..b85b40087f 100644 --- a/a11y/calendar/ea-day-view.c +++ b/a11y/calendar/ea-day-view.c @@ -72,7 +72,7 @@ ea_day_view_get_type (void) */ factory = atk_registry_get_factory (atk_get_default_registry (), - e_cal_view_get_type()); + e_calendar_view_get_type()); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); diff --git a/a11y/calendar/ea-week-view.c b/a11y/calendar/ea-week-view.c index b4b68174b3..a524c5bd6a 100644 --- a/a11y/calendar/ea-week-view.c +++ b/a11y/calendar/ea-week-view.c @@ -24,7 +24,6 @@ */ #include "ea-week-view.h" -#include "ea-cal-view.h" #include "ea-cal-view-event.h" #include "ea-calendar-helpers.h" #include "ea-gnome-calendar.h" diff --git a/a11y/calendar/ea-week-view.h b/a11y/calendar/ea-week-view.h index f0ed117375..70237181e8 100644 --- a/a11y/calendar/ea-week-view.h +++ b/a11y/calendar/ea-week-view.h @@ -26,7 +26,7 @@ #ifndef __EA_WEEK_VIEW_H__ #define __EA_WEEK_VIEW_H__ -#include <gtk/gtkaccessible.h> +#include "ea-cal-view.h" #include "e-week-view.h" #ifdef __cplusplus @@ -45,14 +45,14 @@ typedef struct _EaWeekViewClass EaWeekViewClass; struct _EaWeekView { - GtkAccessible parent; + EaCalView parent; }; GType ea_week_view_get_type (void); struct _EaWeekViewClass { - GtkAccessibleClass parent_class; + EaCalViewClass parent_class; }; AtkObject* ea_week_view_new (GtkWidget *widget); |