[Galago-commits] r2942 - in trunk/notification-daemon: . src/themes/standard

galago-commits at freedesktop.org galago-commits at freedesktop.org
Sun Nov 5 16:35:38 PST 2006


Author: chipx86
Date: 2006-11-05 16:34:59 -0800 (Sun, 05 Nov 2006)
New Revision: 2942

Modified:
   trunk/notification-daemon/ChangeLog
   trunk/notification-daemon/NEWS
   trunk/notification-daemon/src/themes/standard/theme.c
Log:
Make the standard notification theme (mostly) accessible to screen readers. This could stand some improvement.


Modified: trunk/notification-daemon/ChangeLog
===================================================================
--- trunk/notification-daemon/ChangeLog	2006-11-05 20:18:31 UTC (rev 2941)
+++ trunk/notification-daemon/ChangeLog	2006-11-06 00:34:59 UTC (rev 2942)
@@ -1,3 +1,9 @@
+Sun Nov 05 16:33:36 PST 2006  Christian Hammond <chipx86 at chipx86.com>
+
+	* src/themes/standard/theme.c:
+	  - Make the standard notification theme (mostly) accessible to screen
+	    readers. This could stand some improvement.
+
 Sun Nov 05 12:18:00 PST 2006  Christian Hammond <chipx86 at chipx86.com>
 
 	* configure.ac:

Modified: trunk/notification-daemon/NEWS
===================================================================
--- trunk/notification-daemon/NEWS	2006-11-05 20:18:31 UTC (rev 2941)
+++ trunk/notification-daemon/NEWS	2006-11-06 00:34:59 UTC (rev 2942)
@@ -1,8 +1,8 @@
 version 0.3.7:
 	* Fixed a compatibility issue with dbus-glib 0.72. Patch by Pawel Worach.
 	  (Bug #95)
+	* Added initial accessibility support with the standard theme engine.
 
-
 version 0.3.6 (8-October-2006):
 	* Added a GConf key to allow users to specify which corner of the screen
 	  notifications should appear in. Patch by M.S. (Ticket #57)

Modified: trunk/notification-daemon/src/themes/standard/theme.c
===================================================================
--- trunk/notification-daemon/src/themes/standard/theme.c	2006-11-05 20:18:31 UTC (rev 2941)
+++ trunk/notification-daemon/src/themes/standard/theme.c	2006-11-06 00:34:59 UTC (rev 2942)
@@ -196,6 +196,7 @@
 	GtkWidget *close_button;
 	GtkWidget *image;
 	GtkWidget *alignment;
+	AtkObject *atkobj;
 	WindowData *windata;
 
 	windata = g_new0(WindowData, 1);
@@ -204,11 +205,14 @@
 
 	win = gtk_window_new(GTK_WINDOW_POPUP);
 	windata->win = win;
+	gtk_window_set_title(GTK_WINDOW(win), "Notification");
 	gtk_widget_add_events(win, GDK_BUTTON_RELEASE_MASK);
 	gtk_widget_realize(win);
+
 	g_object_set_data_full(G_OBJECT(win), "windata", windata,
 						   (GDestroyNotify)destroy_windata);
 	gtk_widget_set_app_paintable(win, TRUE);
+	atk_object_set_role(gtk_widget_get_accessible(win), ATK_ROLE_ALERT);
 
 	g_signal_connect(G_OBJECT(win), "expose-event",
 					 G_CALLBACK(draw_border), windata);
@@ -254,6 +258,9 @@
 	gtk_misc_set_alignment(GTK_MISC(windata->summary_label), 0, 0);
 	gtk_label_set_line_wrap(GTK_LABEL(windata->summary_label), TRUE);
 
+	atkobj = gtk_widget_get_accessible(windata->summary_label);
+	atk_object_set_description(atkobj, "Notification summary text.");
+
 	/* Add the close button */
 	close_button = gtk_button_new();
 	gtk_widget_show(close_button);
@@ -264,6 +271,12 @@
 	g_signal_connect_swapped(G_OBJECT(close_button), "clicked",
 							 G_CALLBACK(gtk_widget_destroy), win);
 
+	atkobj = gtk_widget_get_accessible(close_button);
+	atk_action_set_description(ATK_ACTION(atkobj), 0,
+							   "Closes the notification.");
+	atk_object_set_name(atkobj, "");
+	atk_object_set_description(atkobj, "Closes the notification.");
+
 	image = gtk_image_new_from_stock(GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
 	gtk_widget_show(image);
 	gtk_container_add(GTK_CONTAINER(close_button), image);
@@ -293,6 +306,9 @@
 	g_signal_connect_swapped(G_OBJECT(windata->body_label), "url_activated",
 							 G_CALLBACK(windata->url_clicked), win);
 
+	atkobj = gtk_widget_get_accessible(windata->body_label);
+	atk_object_set_description(atkobj, "Notification body text.");
+
 	alignment = gtk_alignment_new(1, 0.5, 0, 0);
 	gtk_widget_show(alignment);
 	gtk_box_pack_start(GTK_BOX(vbox), alignment, FALSE, TRUE, 0);
@@ -314,7 +330,15 @@
 	value = (GValue *)g_hash_table_lookup(hints, "urgency");
 
 	if (value)
+	{
 		windata->urgency = g_value_get_uchar(value);
+
+		if (windata->urgency == URGENCY_CRITICAL) {
+			gtk_window_set_title(GTK_WINDOW(nw), "Critical Notification");
+		} else {
+			gtk_window_set_title(GTK_WINDOW(nw), "Notification");
+		}
+	}
 }
 
 void



More information about the galago-commits mailing list