[Calendar][Accessibility]Fix for bug 339136

Boby Wang <[email protected]>
Newsgroups gmane.comp.gnome.evolution.patches
Organization SCERI
Message-ID <1145535794.28405.2.camel@sweeper>
Hi,
    I have attached a patch for bug 339136. You can view the detail of
it in URL http://bugzilla.gnome.org/show_bug.cgi?id=339136
-- 
Boby Wang <[email protected]>
SCERI

_______________________________________________
Evolution-patches mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/evolution-patches
20060420-cal.diff (text/x-patch, 8.2 KB)
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/a11y/ChangeLog,v
retrieving revision 1.49
diff -u -r1.49 ChangeLog
--- ChangeLog	20 Mar 2006 06:27:54 -0000	1.49
+++ ChangeLog	20 Apr 2006 12:13:48 -0000
@@ -1,3 +1,26 @@
+2006-04-20  Boby Wang <[email protected]>
+
+	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_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-main-item.c:
+	(ea_week_view_main_item_class_init),
+	(ea_week_view_main_item_ref_state_set):
+	add necessary AtkStateSet to EaWeekViewMainItem
+	* calendar/ea-week-view.c:
+	* calendar/ea-week-view.h:
+	change the base class of EaWeekView from GtkAccessible to EaCalView
+
 2006-03-20  Boby Wang <[email protected]>
 	Fix for #319308
 
Index: calendar/ea-cal-view-event.c
===================================================================
RCS file: /cvs/gnome/evolution/a11y/calendar/ea-cal-view-event.c,v
retrieving revision 1.12
diff -u -r1.12 ea-cal-view-event.c
--- calendar/ea-cal-view-event.c	17 Jun 2005 15:20:23 -0000	1.12
+++ calendar/ea-cal-view-event.c	20 Apr 2006 12:13:49 -0000
@@ -31,11 +31,13 @@
 #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 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 +77,7 @@
 			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 */
 		};
 
@@ -135,9 +137,22 @@
 	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
 static void ea_cal_view_finalize (GObject *object)
 {
@@ -363,6 +378,18 @@
 		return -1;
 	}
 	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 */
Index: calendar/ea-cal-view-event.h
===================================================================
RCS file: /cvs/gnome/evolution/a11y/calendar/ea-cal-view-event.h,v
retrieving revision 1.2
diff -u -r1.2 ea-cal-view-event.h
--- calendar/ea-cal-view-event.h	20 Aug 2003 07:46:04 -0000	1.2
+++ calendar/ea-cal-view-event.h	20 Apr 2006 12:13:49 -0000
@@ -45,6 +45,7 @@
 struct _EaCalViewEvent
 {
 	AtkGObjectAccessible parent;
+	AtkStateSet *state_set;
 };
 
 GType ea_cal_view_event_get_type (void);
Index: calendar/ea-calendar.c
===================================================================
RCS file: /cvs/gnome/evolution/a11y/calendar/ea-calendar.c,v
retrieving revision 1.7
diff -u -r1.7 ea-calendar.c
--- calendar/ea-calendar.c	17 Jun 2005 15:20:23 -0000	1.7
+++ calendar/ea-calendar.c	20 Apr 2006 12:13:49 -0000
@@ -98,7 +98,7 @@
 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
Index: calendar/ea-day-view.c
===================================================================
RCS file: /cvs/gnome/evolution/a11y/calendar/ea-day-view.c,v
retrieving revision 1.10
diff -u -r1.10 ea-day-view.c
--- calendar/ea-day-view.c	6 Mar 2006 09:56:30 -0000	1.10
+++ calendar/ea-day-view.c	20 Apr 2006 12:13:49 -0000
@@ -72,7 +72,7 @@
 		 */
 
 		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);
 
Index: calendar/ea-week-view-main-item.c
===================================================================
RCS file: /cvs/gnome/evolution/a11y/calendar/ea-week-view-main-item.c,v
retrieving revision 1.4
diff -u -r1.4 ea-week-view-main-item.c
--- calendar/ea-week-view-main-item.c	27 Jan 2006 14:50:38 -0000	1.4
+++ calendar/ea-week-view-main-item.c	20 Apr 2006 12:13:49 -0000
@@ -42,6 +42,7 @@
 						     gint i);
 static AtkObject * ea_week_view_main_item_get_parent (AtkObject *accessible);
 static gint ea_week_view_main_item_get_index_in_parent (AtkObject *accessible);
+static AtkStateSet* ea_week_view_main_item_ref_state_set (AtkObject *obj);
 
 /* callbacks */
 static void ea_week_view_main_item_dates_change_cb (GnomeCalendar *gcal, gpointer data);
@@ -228,6 +229,8 @@
 	class->ref_child = ea_week_view_main_item_ref_child;
 	class->get_parent = ea_week_view_main_item_get_parent;
 	class->get_index_in_parent = ea_week_view_main_item_get_index_in_parent;
+
+	class->ref_state_set = ea_week_view_main_item_ref_state_set;
 }
 
 AtkObject* 
@@ -403,6 +406,23 @@
 	/* always the first child of ea-week-view */
 	return 0;
 }
+
+static AtkStateSet*
+ea_week_view_main_item_ref_state_set (AtkObject *obj)
+{
+	AtkStateSet *state_set;
+	
+	state_set = ATK_OBJECT_CLASS (parent_class)->ref_state_set (obj);
+	if (state_set == NULL)
+		return NULL;
+
+	atk_state_set_add_state (state_set, ATK_STATE_ENABLED);
+	atk_state_set_add_state (state_set, ATK_STATE_SENSITIVE);
+	atk_state_set_add_state (state_set, ATK_STATE_SHOWING);
+
+	return state_set;
+}
+
 
 /* callbacks */
 
Index: calendar/ea-week-view.c
===================================================================
RCS file: /cvs/gnome/evolution/a11y/calendar/ea-week-view.c,v
retrieving revision 1.14
diff -u -r1.14 ea-week-view.c
--- calendar/ea-week-view.c	6 Mar 2006 09:56:30 -0000	1.14
+++ calendar/ea-week-view.c	20 Apr 2006 12:13:49 -0000
@@ -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"
Index: calendar/ea-week-view.h
===================================================================
RCS file: /cvs/gnome/evolution/a11y/calendar/ea-week-view.h,v
retrieving revision 1.2
diff -u -r1.2 ea-week-view.h
--- calendar/ea-week-view.h	20 Aug 2003 07:46:05 -0000	1.2
+++ calendar/ea-week-view.h	20 Apr 2006 12:13:49 -0000
@@ -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 @@
 
 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);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.