Merge lp:~apinheiro/unity/a11y-internal-dash into lp:unity

Proposed by Alejandro Piñeiro on 2011-10-13
Status: Merged
Merged at revision: 1736
Proposed branch: lp:~apinheiro/unity/a11y-internal-dash
Merge into: lp:unity
Diff against target: 2752 lines (+1917/-282)
41 files modified
plugins/unityshell/src/PanelController.cpp (+0/-8)
plugins/unityshell/src/PlacesGroup.cpp (+13/-0)
plugins/unityshell/src/PlacesGroup.h (+5/-0)
plugins/unityshell/src/PlacesSimpleTile.cpp (+1/-0)
plugins/unityshell/src/PlacesSimpleTile.h (+1/-0)
plugins/unityshell/src/PlacesTile.cpp (+1/-0)
plugins/unityshell/src/PlacesTile.h (+1/-0)
plugins/unityshell/src/ResultView.cpp (+5/-0)
plugins/unityshell/src/ResultView.h (+2/-1)
plugins/unityshell/src/ResultViewGrid.cpp (+10/-0)
plugins/unityshell/src/ResultViewGrid.h (+2/-0)
plugins/unityshell/src/StaticCairoText.cpp (+8/-1)
plugins/unityshell/src/StaticCairoText.h (+3/-0)
plugins/unityshell/src/nux-area-accessible.cpp (+2/-1)
plugins/unityshell/src/nux-base-window-accessible.cpp (+24/-6)
plugins/unityshell/src/nux-base-window-accessible.h (+3/-0)
plugins/unityshell/src/nux-text-entry-accessible.cpp (+124/-0)
plugins/unityshell/src/nux-text-entry-accessible.h (+57/-0)
plugins/unityshell/src/nux-view-accessible.cpp (+2/-2)
plugins/unityshell/src/unity-dash-view-accessible.cpp (+114/-0)
plugins/unityshell/src/unity-dash-view-accessible.h (+57/-0)
plugins/unityshell/src/unity-places-group-accessible.cpp (+168/-0)
plugins/unityshell/src/unity-places-group-accessible.h (+57/-0)
plugins/unityshell/src/unity-places-simple-tile-accessible.cpp (+140/-0)
plugins/unityshell/src/unity-places-simple-tile-accessible.h (+57/-0)
plugins/unityshell/src/unity-places-view-accessible.cpp (+0/-114)
plugins/unityshell/src/unity-places-view-accessible.h (+0/-57)
plugins/unityshell/src/unity-result-accessible.cpp (+132/-0)
plugins/unityshell/src/unity-result-accessible.h (+56/-0)
plugins/unityshell/src/unity-root-accessible.cpp (+135/-36)
plugins/unityshell/src/unity-root-accessible.h (+0/-3)
plugins/unityshell/src/unity-rvgrid-accessible.cpp (+398/-0)
plugins/unityshell/src/unity-rvgrid-accessible.h (+57/-0)
plugins/unityshell/src/unity-sctext-accessible.cpp (+157/-0)
plugins/unityshell/src/unity-sctext-accessible.h (+57/-0)
plugins/unityshell/src/unity-search-bar-accessible.cpp (+40/-23)
plugins/unityshell/src/unity-search-bar-accessible.h (+0/-4)
plugins/unityshell/src/unity-util-accessible.cpp (+0/-11)
plugins/unityshell/src/unity-util-accessible.h (+0/-1)
plugins/unityshell/src/unitya11y.cpp (+28/-7)
plugins/unityshell/src/unityshell.cpp (+0/-7)
To merge this branch: bzr merge lp:~apinheiro/unity/a11y-internal-dash
Reviewer Review Type Date Requested Status
Alex Launi (community) 2011-10-17 Needs Fixing on 2011-10-26
Neil J. Patel 2011-10-13 Pending
Review via email: mp+79286@code.launchpad.net
To post a comment you must log in.
1719. By Gord Allott on 2011-10-13

fixes an issue with the panel service segfaulting on window change

Alejandro Piñeiro (apinheiro) wrote :

BTW, this branch is already being tested by the users, as it is included on this branch:

https://launchpad.net/~apinheiro/+archive/unity-extra-a11y

I already received some positive feedback from ubuntu-accessibility mailing list

1720. By Sam Spilsbury on 2011-10-14

Bug #863114: Cannot raise window from panel after minimize High Triaged
Bug #865890: compiz crashed with SIGSEGV in nux::BaseWindow::GetInputWindowId() (when onboard is used)

1721. By Andrea Azzarone <email address hidden> on 2011-10-15

Merge lp:~andyrock/unity/fix-874410

1722. By Jay Taoko on 2011-10-21

Ported Unity to Nux 2.0

- The Button class in Nux no longer has properties. Refer to Nux API for more details on the signals and functions of that class

- ProcessEvent member functions have been removed (remnant of the former event architecture)

- Removed former Focus API

- ComputeLayout2 has been renamed ComputeContentSize

1723. By Jason Smith on 2011-10-21

make it possible to manually change the unity shading color for testing purposes

1724. By Jason Smith on 2011-10-24

fix hardcoded values

1725. By Tim Penhey on 2011-10-25

Land the large refactoring of the styles and added namespaces.

1726. By Jason Smith on 2011-10-26

merge branch to make alt-tab workspace aware

Alex Launi (alexlauni) wrote :

Hi API. This more or less looks like a good approach however it no long applies to trunk. There are conflicts, and even after those are fixed, it still doesn't compile.

review: Needs Fixing
1727. By Jason Smith on 2011-10-26

merge branch to fix switcher model xids

1728. By Mirco Müller on 2011-10-26

_root_instance was never checked for NULL... not in unity and not in geis. Now it's at least checked in unity.

1729. By Mirco Müller on 2011-10-26

Be properly unref'ing _tray the FilterTrayCallback should be correctly unregistered and not called again.

1730. By Victor Martinez on 2011-10-26

Fix the alignment of the tooltips in relation to the launcher-icons.

1731. By Mirco Müller on 2011-10-26

Add an out-of-bounds check to the DetailXids vector.

1732. By Jason Smith on 2011-10-28

Merge stacking branch from 4.0 branch (manual merge)

1733. By Alex Launi on 2011-10-28

Merge selective introspection branch

1734. By Alejandro Piñeiro on 2011-11-07

a11y: Implement a11y support for Dash internals

It includes:
   * a11y objects for most parts of the Dash.
   * BaseWindow are added to the root window-list by the a11y code

Alejandro Piñeiro (apinheiro) wrote :

> Hi API. This more or less looks like a good approach however it no long
> applies to trunk. There are conflicts, and even after those are fixed, it
> still doesn't compile.

FWIW, I updated this branch the last week.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/PanelController.cpp'
2--- plugins/unityshell/src/PanelController.cpp 2011-10-03 02:23:50 +0000
3+++ plugins/unityshell/src/PanelController.cpp 2011-11-07 19:15:28 +0000
4@@ -24,10 +24,7 @@
5 #include <Nux/BaseWindow.h>
6
7 #include "UScreen.h"
8-
9 #include "PanelView.h"
10-#include "unitya11y.h"
11-#include "unity-util-accessible.h"
12
13 namespace unity
14 {
15@@ -225,11 +222,6 @@
16 geo.height = 24;
17 window->SetGeometry(geo);
18
19- /* FIXME: this should not be manual, should be managed with a
20- show/hide callback like in GAIL*/
21- if (unity_a11y_initialized() == TRUE)
22- unity_util_accessible_add_window(window);
23-
24 windows_.push_back(window);
25
26 LOG_DEBUG(logger) << "Added Panel for Monitor " << i;
27
28=== modified file 'plugins/unityshell/src/PlacesGroup.cpp'
29--- plugins/unityshell/src/PlacesGroup.cpp 2011-10-25 16:32:49 +0000
30+++ plugins/unityshell/src/PlacesGroup.cpp 2011-11-07 19:15:28 +0000
31@@ -51,6 +51,7 @@
32
33 namespace unity
34 {
35+NUX_IMPLEMENT_OBJECT_TYPE(PlacesGroup);
36
37 PlacesGroup::PlacesGroup()
38 : View(NUX_TRACKER_LOCATION),
39@@ -170,6 +171,18 @@
40 g_free(final);
41 }
42
43+nux::StaticCairoText*
44+PlacesGroup::GetLabel()
45+{
46+ return _name;
47+}
48+
49+nux::StaticCairoText*
50+PlacesGroup::GetExpandLabel()
51+{
52+ return _expand_label;
53+}
54+
55 void
56 PlacesGroup::SetIcon(const char* path_to_emblem)
57 {
58
59=== modified file 'plugins/unityshell/src/PlacesGroup.h'
60--- plugins/unityshell/src/PlacesGroup.h 2011-10-11 18:18:13 +0000
61+++ plugins/unityshell/src/PlacesGroup.h 2011-11-07 19:15:28 +0000
62@@ -36,6 +36,7 @@
63
64 class PlacesGroup : public nux::View
65 {
66+ NUX_DECLARE_OBJECT_TYPE(PlacesGroup, nux::View);
67 public:
68
69 PlacesGroup();
70@@ -44,6 +45,9 @@
71 void SetIcon(const char* icon);
72 void SetName(const char* name);
73
74+ nux::StaticCairoText* GetLabel();
75+ nux::StaticCairoText* GetExpandLabel();
76+
77 void SetChildView(nux::View* view);
78 nux::View* GetChildView();
79
80@@ -99,6 +103,7 @@
81 guint _n_total_items;
82 char* _cached_name;
83 bool _draw_sep;
84+
85 };
86
87 }
88
89=== modified file 'plugins/unityshell/src/PlacesSimpleTile.cpp'
90--- plugins/unityshell/src/PlacesSimpleTile.cpp 2011-10-03 23:21:55 +0000
91+++ plugins/unityshell/src/PlacesSimpleTile.cpp 2011-11-07 19:15:28 +0000
92@@ -35,6 +35,7 @@
93
94 namespace unity
95 {
96+NUX_IMPLEMENT_OBJECT_TYPE(PlacesSimpleTile);
97
98 PlacesSimpleTile::PlacesSimpleTile(const char* icon_name,
99 const char* label,
100
101=== modified file 'plugins/unityshell/src/PlacesSimpleTile.h'
102--- plugins/unityshell/src/PlacesSimpleTile.h 2011-09-02 02:27:51 +0000
103+++ plugins/unityshell/src/PlacesSimpleTile.h 2011-11-07 19:15:28 +0000
104@@ -32,6 +32,7 @@
105
106 class PlacesSimpleTile : public unity::Introspectable, public PlacesTile
107 {
108+ NUX_DECLARE_OBJECT_TYPE(PlacesSimpleTile, PlacesTile);
109 public:
110
111 PlacesSimpleTile(const char* icon, const char* label, int icon_size = 64, bool defer_icon_loading = false, const void* id = NULL);
112
113=== modified file 'plugins/unityshell/src/PlacesTile.cpp'
114--- plugins/unityshell/src/PlacesTile.cpp 2011-10-11 18:18:13 +0000
115+++ plugins/unityshell/src/PlacesTile.cpp 2011-11-07 19:15:28 +0000
116@@ -32,6 +32,7 @@
117
118 namespace unity
119 {
120+NUX_IMPLEMENT_OBJECT_TYPE(PlacesTile);
121
122 PlacesTile::PlacesTile(NUX_FILE_LINE_DECL, const void* id) :
123 View(NUX_FILE_LINE_PARAM),
124
125=== modified file 'plugins/unityshell/src/PlacesTile.h'
126--- plugins/unityshell/src/PlacesTile.h 2011-10-11 18:18:13 +0000
127+++ plugins/unityshell/src/PlacesTile.h 2011-11-07 19:15:28 +0000
128@@ -33,6 +33,7 @@
129
130 class PlacesTile : public nux::View
131 {
132+ NUX_DECLARE_OBJECT_TYPE(PlacesTile, nux::View);
133 public:
134 PlacesTile(NUX_FILE_LINE_PROTO, const void* id = NULL);
135 ~PlacesTile();
136
137=== modified file 'plugins/unityshell/src/ResultView.cpp'
138--- plugins/unityshell/src/ResultView.cpp 2011-10-11 18:18:13 +0000
139+++ plugins/unityshell/src/ResultView.cpp 2011-11-07 19:15:28 +0000
140@@ -118,6 +118,11 @@
141 renderer_->Unload(result);
142 }
143
144+ResultView::ResultList ResultView::GetResultList()
145+{
146+ return results_;
147+}
148+
149 void ResultView::SetPreview(PreviewBase* preview, Result& related_result)
150 {
151 if (preview == NULL)
152
153=== modified file 'plugins/unityshell/src/ResultView.h'
154--- plugins/unityshell/src/ResultView.h 2011-10-11 18:18:13 +0000
155+++ plugins/unityshell/src/ResultView.h 2011-11-07 19:15:28 +0000
156@@ -37,7 +37,6 @@
157 {
158 namespace dash
159 {
160-
161 class ResultView : public nux::View
162 {
163 public:
164@@ -53,6 +52,8 @@
165 void AddResult(Result& result);
166 void RemoveResult(Result& result);
167
168+ ResultList GetResultList ();
169+
170 void SetPreview(PreviewBase* preview, Result& related_result);
171
172 nux::Property<bool> expanded;
173
174=== modified file 'plugins/unityshell/src/ResultViewGrid.cpp'
175--- plugins/unityshell/src/ResultViewGrid.cpp 2011-10-11 18:18:13 +0000
176+++ plugins/unityshell/src/ResultViewGrid.cpp 2011-11-07 19:15:28 +0000
177@@ -483,6 +483,7 @@
178
179 ubus_.SendMessage(UBUS_RESULT_VIEW_KEYNAV_CHANGED,
180 g_variant_new("(iiii)", focused_x, focused_y, renderer_->width(), renderer_->height()));
181+ selection_change.emit();
182
183 NeedRedraw();
184 }
185@@ -521,11 +522,14 @@
186
187 ubus_.SendMessage(UBUS_RESULT_VIEW_KEYNAV_CHANGED,
188 g_variant_new("(iiii)", focused_x, focused_y, renderer_->width(), renderer_->height()));
189+ selection_change.emit();
190 }
191 else
192 {
193 selected_index_ = -1;
194 focused_uri_.clear();
195+
196+ selection_change.emit();
197 }
198
199 NeedRedraw();
200@@ -884,5 +888,11 @@
201 current_drag_icon_name_.clear();
202 }
203
204+int
205+ResultViewGrid::GetSelectedIndex()
206+{
207+ return selected_index_;
208+}
209+
210 }
211 }
212
213=== modified file 'plugins/unityshell/src/ResultViewGrid.h'
214--- plugins/unityshell/src/ResultViewGrid.h 2011-10-11 18:18:13 +0000
215+++ plugins/unityshell/src/ResultViewGrid.h 2011-11-07 19:15:28 +0000
216@@ -53,6 +53,8 @@
217 nux::Property<int> vertical_spacing;
218 nux::Property<int> padding;
219
220+ sigc::signal<void> selection_change;
221+ int GetSelectedIndex();
222
223 protected:
224 void MouseMove(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags);
225
226=== modified file 'plugins/unityshell/src/StaticCairoText.cpp'
227--- plugins/unityshell/src/StaticCairoText.cpp 2011-10-11 18:18:13 +0000
228+++ plugins/unityshell/src/StaticCairoText.cpp 2011-11-07 19:15:28 +0000
229@@ -37,6 +37,8 @@
230 // codebase, that is just rude.
231 namespace nux
232 {
233+ NUX_IMPLEMENT_OBJECT_TYPE (StaticCairoText);
234+
235 StaticCairoText::StaticCairoText(const TCHAR* text,
236 NUX_FILE_LINE_DECL) :
237 View(NUX_FILE_LINE_PARAM),
238@@ -230,6 +232,12 @@
239 }
240 }
241
242+NString
243+StaticCairoText::GetText()
244+{
245+ return _text;
246+}
247+
248 void
249 StaticCairoText::SetTextColor(Color textColor)
250 {
251@@ -509,5 +517,4 @@
252 return _accept_key_nav_focus;
253 }
254
255-
256 }
257
258=== modified file 'plugins/unityshell/src/StaticCairoText.h'
259--- plugins/unityshell/src/StaticCairoText.h 2011-10-11 18:18:13 +0000
260+++ plugins/unityshell/src/StaticCairoText.h 2011-11-07 19:15:28 +0000
261@@ -40,6 +40,7 @@
262
263 class StaticCairoText : public View
264 {
265+ NUX_DECLARE_OBJECT_TYPE (StaticCairoText, View);
266 public:
267 typedef enum
268 {
269@@ -84,6 +85,8 @@
270 void SetFont(const char* fontstring);
271 void SetLines(int maximum_lines);
272
273+ NString GetText();
274+
275 int GetLineCount();
276
277 void GetTextExtents(int& width, int& height);
278
279=== modified file 'plugins/unityshell/src/nux-area-accessible.cpp'
280--- plugins/unityshell/src/nux-area-accessible.cpp 2011-10-03 18:08:25 +0000
281+++ plugins/unityshell/src/nux-area-accessible.cpp 2011-11-07 19:15:28 +0000
282@@ -172,7 +172,7 @@
283 area = dynamic_cast<nux::Area*>(nux_object);
284
285 /* focus support based on Focusable, used on the Dash */
286- (static_cast<nux::InputArea*>(area))->OnKeyNavFocusChange.connect(sigc::bind(sigc::ptr_fun(on_focus_changed_cb), accessible));
287+ area->OnKeyNavFocusChange.connect(sigc::bind(sigc::ptr_fun(on_focus_changed_cb), accessible));
288
289 atk_component_add_focus_handler(ATK_COMPONENT(accessible),
290 nux_area_accessible_focus_handler);
291@@ -461,6 +461,7 @@
292 check_focus(NUX_AREA_ACCESSIBLE(accessible));
293 }
294
295+/* Check to use GetTopLevelViewWindow */
296 static AtkObject*
297 search_for_parent_window(AtkObject* object)
298 {
299
300=== modified file 'plugins/unityshell/src/nux-base-window-accessible.cpp'
301--- plugins/unityshell/src/nux-base-window-accessible.cpp 2011-09-06 18:30:26 +0000
302+++ plugins/unityshell/src/nux-base-window-accessible.cpp 2011-11-07 19:15:28 +0000
303@@ -178,9 +178,9 @@
304
305 /* This gives us if the window has the underlying key input */
306 bwindow->begin_key_focus.connect(sigc::bind(sigc::ptr_fun(on_change_keyboard_receiver_cb),
307- accessible, TRUE));
308+ accessible, TRUE));
309 bwindow->end_key_focus.connect(sigc::bind(sigc::ptr_fun(on_change_keyboard_receiver_cb),
310- accessible, FALSE));
311+ accessible, FALSE));
312 }
313
314 static AtkObject*
315@@ -225,7 +225,20 @@
316 {
317 gint signal_id;
318 gboolean is_active;
319-
320+ nux::Object* nux_object = NULL;
321+
322+ nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(self));
323+ if (nux_object == NULL) /* defunct */
324+ return;
325+
326+ /* FIXME: this method is not infalible, as we lose some
327+ window->deactivate, specifically on the Dash, so this could be
328+ improved. As we check the active window using UBus messages we
329+ could use that information, but would make complex the
330+ quicklist.
331+
332+ Anyway, the relevant message is the activate window, it is ok if
333+ we lose some deactivate methods for the moment */
334 is_active = (self->priv->key_focused || self->priv->child_key_focused);
335
336 if (self->priv->active != is_active)
337@@ -256,8 +269,6 @@
338 if (self->priv->key_focused != focus_in)
339 {
340 self->priv->key_focused = focus_in;
341-
342- check_active(self);
343 }
344 }
345
346@@ -271,6 +282,13 @@
347 if (self->priv->child_key_focused != value)
348 {
349 self->priv->child_key_focused = value;
350- check_active(self);
351 }
352 }
353+
354+void
355+nux_base_window_accessible_check_active(NuxBaseWindowAccessible* self)
356+{
357+ g_return_if_fail(NUX_IS_BASE_WINDOW_ACCESSIBLE(self));
358+
359+ check_active(self);
360+}
361
362=== modified file 'plugins/unityshell/src/nux-base-window-accessible.h'
363--- plugins/unityshell/src/nux-base-window-accessible.h 2011-09-06 18:30:26 +0000
364+++ plugins/unityshell/src/nux-base-window-accessible.h 2011-11-07 19:15:28 +0000
365@@ -58,6 +58,9 @@
366 void nux_base_window_set_child_key_focused(NuxBaseWindowAccessible* self,
367 gboolean value);
368
369+void nux_base_window_accessible_check_active(NuxBaseWindowAccessible* self);
370+
371+
372 G_END_DECLS
373
374 #endif /* __NUX_BASE_WINDOW_ACCESSIBLE_H__ */
375
376=== added file 'plugins/unityshell/src/nux-text-entry-accessible.cpp'
377--- plugins/unityshell/src/nux-text-entry-accessible.cpp 1970-01-01 00:00:00 +0000
378+++ plugins/unityshell/src/nux-text-entry-accessible.cpp 2011-11-07 19:15:28 +0000
379@@ -0,0 +1,124 @@
380+/*
381+ * Copyright (C) 2011 Canonical Ltd
382+ *
383+ * This program is free software: you can redistribute it and/or modify
384+ * it under the terms of the GNU General Public License version 3 as
385+ * published by the Free Software Foundation.
386+ *
387+ * This program is distributed in the hope that it will be useful,
388+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
389+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
390+ * GNU General Public License for more details.
391+ *
392+ * You should have received a copy of the GNU General Public License
393+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
394+ *
395+ * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
396+ */
397+
398+/**
399+ * SECTION:nux-text_entry-accessible
400+ * @Title: NuxTextEntryAccessible
401+ * @short_description: Implementation of the ATK interfaces for #TextEntry
402+ * @see_also: nux::TextEntry
403+ *
404+ * #NuxTextEntryAccessible implements the required ATK interfaces for
405+ * #StaticCairoText, mainly exposing the text as his name, as this
406+ * #object is mainly used as a label
407+ *
408+ */
409+
410+#include <glib/gi18n.h>
411+
412+#include "nux-text-entry-accessible.h"
413+
414+#include "unitya11y.h"
415+#include <Nux/TextEntry.h>
416+
417+/* GObject */
418+static void nux_text_entry_accessible_class_init(NuxTextEntryAccessibleClass* klass);
419+static void nux_text_entry_accessible_init(NuxTextEntryAccessible* self);
420+
421+/* AtkObject.h */
422+static void nux_text_entry_accessible_initialize(AtkObject* accessible,
423+ gpointer data);
424+static AtkStateSet* nux_text_entry_accessible_ref_state_set(AtkObject* obj);
425+
426+/* Fixme: it should implement AtkText/AtkTextEditable interfaces */
427+G_DEFINE_TYPE(NuxTextEntryAccessible, nux_text_entry_accessible, NUX_TYPE_VIEW_ACCESSIBLE);
428+
429+
430+#define NUX_TEXT_ENTRY_ACCESSIBLE_GET_PRIVATE(obj) \
431+ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), NUX_TYPE_TEXT_ENTRY_ACCESSIBLE, \
432+ NuxTextEntryAccessiblePrivate))
433+
434+struct _NuxTextEntryAccessiblePrivate
435+{
436+};
437+
438+
439+static void
440+nux_text_entry_accessible_class_init(NuxTextEntryAccessibleClass* klass)
441+{
442+ GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
443+ AtkObjectClass* atk_class = ATK_OBJECT_CLASS(klass);
444+
445+ /* AtkObject */
446+ atk_class->ref_state_set = nux_text_entry_accessible_ref_state_set;
447+ atk_class->initialize = nux_text_entry_accessible_initialize;
448+
449+ g_type_class_add_private(gobject_class, sizeof(NuxTextEntryAccessiblePrivate));
450+}
451+
452+static void
453+nux_text_entry_accessible_init(NuxTextEntryAccessible* self)
454+{
455+ NuxTextEntryAccessiblePrivate* priv =
456+ NUX_TEXT_ENTRY_ACCESSIBLE_GET_PRIVATE(self);
457+
458+ self->priv = priv;
459+}
460+
461+AtkObject*
462+nux_text_entry_accessible_new(nux::Object* object)
463+{
464+ AtkObject* accessible = NULL;
465+
466+ g_return_val_if_fail(dynamic_cast<nux::TextEntry*>(object), NULL);
467+
468+ accessible = ATK_OBJECT(g_object_new(NUX_TYPE_TEXT_ENTRY_ACCESSIBLE, NULL));
469+
470+ atk_object_initialize(accessible, object);
471+
472+ return accessible;
473+}
474+
475+/* AtkObject.h */
476+static void
477+nux_text_entry_accessible_initialize(AtkObject* accessible,
478+ gpointer data)
479+{
480+ ATK_OBJECT_CLASS(nux_text_entry_accessible_parent_class)->initialize(accessible, data);
481+
482+ atk_object_set_role(accessible, ATK_ROLE_ENTRY);
483+}
484+
485+static AtkStateSet*
486+nux_text_entry_accessible_ref_state_set(AtkObject* obj)
487+{
488+ AtkStateSet* state_set = NULL;
489+ nux::Object* nux_object = NULL;
490+
491+ g_return_val_if_fail(NUX_IS_TEXT_ENTRY_ACCESSIBLE(obj), NULL);
492+
493+ state_set = ATK_OBJECT_CLASS(nux_text_entry_accessible_parent_class)->ref_state_set(obj);
494+
495+ nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(obj));
496+ if (nux_object == NULL) /* defunct */
497+ return state_set;
498+
499+ /* Text entry is editable by default */
500+ atk_state_set_add_state(state_set, ATK_STATE_EDITABLE);
501+
502+ return state_set;
503+}
504
505=== added file 'plugins/unityshell/src/nux-text-entry-accessible.h'
506--- plugins/unityshell/src/nux-text-entry-accessible.h 1970-01-01 00:00:00 +0000
507+++ plugins/unityshell/src/nux-text-entry-accessible.h 2011-11-07 19:15:28 +0000
508@@ -0,0 +1,57 @@
509+/*
510+ * Copyright (C) 2011 Canonical Ltd
511+ *
512+ * This program is free software: you can redistribute it and/or modify
513+ * it under the terms of the GNU General Public License version 3 as
514+ * published by the Free Software Foundation.
515+ *
516+ * This program is distributed in the hope that it will be useful,
517+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
518+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
519+ * GNU General Public License for more details.
520+ *
521+ * You should have received a copy of the GNU General Public License
522+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
523+ *
524+ * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
525+ */
526+
527+#ifndef NUX_TEXT_ENTRY_ACCESSIBLE_H
528+#define NUX_TEXT_ENTRY_ACCESSIBLE_H
529+
530+#include <atk/atk.h>
531+
532+#include "nux-view-accessible.h"
533+
534+G_BEGIN_DECLS
535+
536+#define NUX_TYPE_TEXT_ENTRY_ACCESSIBLE (nux_text_entry_accessible_get_type ())
537+#define NUX_TEXT_ENTRY_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NUX_TYPE_TEXT_ENTRY_ACCESSIBLE, NuxTextEntryAccessible))
538+#define NUX_TEXT_ENTRY_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NUX_TYPE_TEXT_ENTRY_ACCESSIBLE, NuxTextEntryAccessibleClass))
539+#define NUX_IS_TEXT_ENTRY_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NUX_TYPE_TEXT_ENTRY_ACCESSIBLE))
540+#define NUX_IS_TEXT_ENTRY_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NUX_TYPE_TEXT_ENTRY_ACCESSIBLE))
541+#define NUX_TEXT_ENTRY_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NUX_TYPE_TEXT_ENTRY_ACCESSIBLE, NuxTextEntryAccessibleClass))
542+
543+typedef struct _NuxTextEntryAccessible NuxTextEntryAccessible;
544+typedef struct _NuxTextEntryAccessibleClass NuxTextEntryAccessibleClass;
545+typedef struct _NuxTextEntryAccessiblePrivate NuxTextEntryAccessiblePrivate;
546+
547+struct _NuxTextEntryAccessible
548+{
549+ NuxViewAccessible parent;
550+
551+ /*< private >*/
552+ NuxTextEntryAccessiblePrivate* priv;
553+};
554+
555+struct _NuxTextEntryAccessibleClass
556+{
557+ NuxViewAccessibleClass parent_class;
558+};
559+
560+GType nux_text_entry_accessible_get_type(void);
561+AtkObject* nux_text_entry_accessible_new(nux::Object* object);
562+
563+G_END_DECLS
564+
565+#endif /* __NUX_TEXT_ENTRY_ACCESSIBLE_H__ */
566
567=== modified file 'plugins/unityshell/src/nux-view-accessible.cpp'
568--- plugins/unityshell/src/nux-view-accessible.cpp 2011-09-06 18:30:26 +0000
569+++ plugins/unityshell/src/nux-view-accessible.cpp 2011-11-07 19:15:28 +0000
570@@ -143,9 +143,9 @@
571 /* Some extra focus things as Focusable is not used on Launcher and
572 some BaseWindow */
573 view->begin_key_focus.connect(sigc::bind(sigc::ptr_fun(on_change_keyboard_receiver_cb),
574- accessible, TRUE));
575+ accessible, TRUE));
576 view->end_key_focus.connect(sigc::bind(sigc::ptr_fun(on_change_keyboard_receiver_cb),
577- accessible, FALSE));
578+ accessible, FALSE));
579 }
580
581 static AtkStateSet*
582
583=== added file 'plugins/unityshell/src/unity-dash-view-accessible.cpp'
584--- plugins/unityshell/src/unity-dash-view-accessible.cpp 1970-01-01 00:00:00 +0000
585+++ plugins/unityshell/src/unity-dash-view-accessible.cpp 2011-11-07 19:15:28 +0000
586@@ -0,0 +1,114 @@
587+/*
588+ * Copyright (C) 2011 Canonical Ltd
589+ *
590+ * This program is free software: you can redistribute it and/or modify
591+ * it under the terms of the GNU General Public License version 3 as
592+ * published by the Free Software Foundation.
593+ *
594+ * This program is distributed in the hope that it will be useful,
595+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
596+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
597+ * GNU General Public License for more details.
598+ *
599+ * You should have received a copy of the GNU General Public License
600+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
601+ *
602+ * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
603+ */
604+
605+/**
606+ * SECTION:unity-dash_view-accessible
607+ * @Title: UnityDashViewAccessible
608+ * @short_description: Implementation of the ATK interfaces for #DashView
609+ * @see_also: DashView
610+ *
611+ * #UnityDashViewAccessible implements the required ATK interfaces for
612+ * #DashView, ie: exposing the different DashViewIcon on the model as
613+ * #child of the object.
614+ *
615+ */
616+
617+#include <glib/gi18n.h>
618+
619+#include "unity-dash-view-accessible.h"
620+
621+#include "unitya11y.h"
622+#include "DashView.h"
623+
624+using namespace unity::dash;
625+
626+/* GObject */
627+static void unity_dash_view_accessible_class_init(UnityDashViewAccessibleClass* klass);
628+static void unity_dash_view_accessible_init(UnityDashViewAccessible* self);
629+static void unity_dash_view_accessible_finalize(GObject* object);
630+
631+/* AtkObject.h */
632+static void unity_dash_view_accessible_initialize(AtkObject* accessible,
633+ gpointer data);
634+
635+G_DEFINE_TYPE(UnityDashViewAccessible, unity_dash_view_accessible, NUX_TYPE_VIEW_ACCESSIBLE)
636+
637+#define UNITY_DASH_VIEW_ACCESSIBLE_GET_PRIVATE(obj) \
638+ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), UNITY_TYPE_DASH_VIEW_ACCESSIBLE, \
639+ UnityDashViewAccessiblePrivate))
640+
641+struct _UnityDashViewAccessiblePrivate
642+{
643+
644+};
645+
646+
647+static void
648+unity_dash_view_accessible_class_init(UnityDashViewAccessibleClass* klass)
649+{
650+ GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
651+ AtkObjectClass* atk_class = ATK_OBJECT_CLASS(klass);
652+
653+ gobject_class->finalize = unity_dash_view_accessible_finalize;
654+
655+ /* AtkObject */
656+ atk_class->initialize = unity_dash_view_accessible_initialize;
657+
658+ g_type_class_add_private(gobject_class, sizeof(UnityDashViewAccessiblePrivate));
659+}
660+
661+static void
662+unity_dash_view_accessible_init(UnityDashViewAccessible* self)
663+{
664+ UnityDashViewAccessiblePrivate* priv =
665+ UNITY_DASH_VIEW_ACCESSIBLE_GET_PRIVATE(self);
666+
667+ self->priv = priv;
668+}
669+
670+static void
671+unity_dash_view_accessible_finalize(GObject* object)
672+{
673+ G_OBJECT_CLASS(unity_dash_view_accessible_parent_class)->finalize(object);
674+}
675+
676+AtkObject*
677+unity_dash_view_accessible_new(nux::Object* object)
678+{
679+ AtkObject* accessible = NULL;
680+
681+ g_return_val_if_fail(dynamic_cast<DashView*>(object), NULL);
682+
683+ accessible = ATK_OBJECT(g_object_new(UNITY_TYPE_DASH_VIEW_ACCESSIBLE, NULL));
684+
685+ atk_object_initialize(accessible, object);
686+ atk_object_set_name(accessible, _("Dash"));
687+
688+ return accessible;
689+}
690+
691+/* AtkObject.h */
692+static void
693+unity_dash_view_accessible_initialize(AtkObject* accessible,
694+ gpointer data)
695+{
696+ ATK_OBJECT_CLASS(unity_dash_view_accessible_parent_class)->initialize(accessible, data);
697+
698+ accessible->role = ATK_ROLE_PANEL;
699+}
700+
701
702=== added file 'plugins/unityshell/src/unity-dash-view-accessible.h'
703--- plugins/unityshell/src/unity-dash-view-accessible.h 1970-01-01 00:00:00 +0000
704+++ plugins/unityshell/src/unity-dash-view-accessible.h 2011-11-07 19:15:28 +0000
705@@ -0,0 +1,57 @@
706+/*
707+ * Copyright (C) 2011 Canonical Ltd
708+ *
709+ * This program is free software: you can redistribute it and/or modify
710+ * it under the terms of the GNU General Public License version 3 as
711+ * published by the Free Software Foundation.
712+ *
713+ * This program is distributed in the hope that it will be useful,
714+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
715+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
716+ * GNU General Public License for more details.
717+ *
718+ * You should have received a copy of the GNU General Public License
719+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
720+ *
721+ * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
722+ */
723+
724+#ifndef UNITY_DASH_VIEW_ACCESSIBLE_H
725+#define UNITY_DASH_VIEW_ACCESSIBLE_H
726+
727+#include <atk/atk.h>
728+
729+#include "nux-view-accessible.h"
730+
731+G_BEGIN_DECLS
732+
733+#define UNITY_TYPE_DASH_VIEW_ACCESSIBLE (unity_dash_view_accessible_get_type ())
734+#define UNITY_DASH_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_DASH_VIEW_ACCESSIBLE, UnityDashViewAccessible))
735+#define UNITY_DASH_VIEW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_DASH_VIEW_ACCESSIBLE, UnityDashViewAccessibleClass))
736+#define UNITY_IS_DASH_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_DASH_VIEW_ACCESSIBLE))
737+#define UNITY_IS_DASH_VIEW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_DASH_VIEW_ACCESSIBLE))
738+#define UNITY_DASH_VIEW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_DASH_VIEW_ACCESSIBLE, UnityDashViewAccessibleClass))
739+
740+typedef struct _UnityDashViewAccessible UnityDashViewAccessible;
741+typedef struct _UnityDashViewAccessibleClass UnityDashViewAccessibleClass;
742+typedef struct _UnityDashViewAccessiblePrivate UnityDashViewAccessiblePrivate;
743+
744+struct _UnityDashViewAccessible
745+{
746+ NuxViewAccessible parent;
747+
748+ /*< private >*/
749+ UnityDashViewAccessiblePrivate* priv;
750+};
751+
752+struct _UnityDashViewAccessibleClass
753+{
754+ NuxViewAccessibleClass parent_class;
755+};
756+
757+GType unity_dash_view_accessible_get_type(void);
758+AtkObject* unity_dash_view_accessible_new(nux::Object* object);
759+
760+G_END_DECLS
761+
762+#endif /* __UNITY_DASH_VIEW_ACCESSIBLE_H__ */
763
764=== added file 'plugins/unityshell/src/unity-places-group-accessible.cpp'
765--- plugins/unityshell/src/unity-places-group-accessible.cpp 1970-01-01 00:00:00 +0000
766+++ plugins/unityshell/src/unity-places-group-accessible.cpp 2011-11-07 19:15:28 +0000
767@@ -0,0 +1,168 @@
768+/*
769+ * Copyright (C) 2011 Canonical Ltd
770+ *
771+ * This program is free software: you can redistribute it and/or modify
772+ * it under the terms of the GNU General Public License version 3 as
773+ * published by the Free Software Foundation.
774+ *
775+ * This program is distributed in the hope that it will be useful,
776+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
777+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
778+ * GNU General Public License for more details.
779+ *
780+ * You should have received a copy of the GNU General Public License
781+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
782+ *
783+ * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
784+ */
785+
786+/**
787+ * SECTION:unity-places_group-accessible
788+ * @Title: UnityPlacesGroupAccessible
789+ * @short_description: Implementation of the ATK interfaces for #PlacesGroup
790+ * @see_also: PlacesGroup
791+ *
792+ * #UnityPlacesGroupAccessible implements the required ATK interfaces for
793+ * #PlacesGroup, mainly exposing the text as his name, as this
794+ * #object is mainly used as a label
795+ *
796+ */
797+
798+#include <glib/gi18n.h>
799+
800+#include "unity-places-group-accessible.h"
801+
802+#include "unitya11y.h"
803+#include "PlacesGroup.h"
804+
805+/* GObject */
806+static void unity_places_group_accessible_class_init(UnityPlacesGroupAccessibleClass* klass);
807+static void unity_places_group_accessible_init(UnityPlacesGroupAccessible* self);
808+
809+/* AtkObject.h */
810+static void unity_places_group_accessible_initialize(AtkObject* accessible,
811+ gpointer data);
812+
813+G_DEFINE_TYPE(UnityPlacesGroupAccessible, unity_places_group_accessible, NUX_TYPE_VIEW_ACCESSIBLE);
814+
815+
816+#define UNITY_PLACES_GROUP_ACCESSIBLE_GET_PRIVATE(obj) \
817+ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), UNITY_TYPE_PLACES_GROUP_ACCESSIBLE, \
818+ UnityPlacesGroupAccessiblePrivate))
819+
820+struct _UnityPlacesGroupAccessiblePrivate
821+{
822+ gchar* stripped_name;
823+};
824+
825+
826+static void
827+unity_places_group_accessible_class_init(UnityPlacesGroupAccessibleClass* klass)
828+{
829+ GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
830+ AtkObjectClass* atk_class = ATK_OBJECT_CLASS(klass);
831+
832+ /* AtkObject */
833+ atk_class->initialize = unity_places_group_accessible_initialize;
834+
835+ g_type_class_add_private(gobject_class, sizeof(UnityPlacesGroupAccessiblePrivate));
836+}
837+
838+static void
839+unity_places_group_accessible_init(UnityPlacesGroupAccessible* self)
840+{
841+ UnityPlacesGroupAccessiblePrivate* priv =
842+ UNITY_PLACES_GROUP_ACCESSIBLE_GET_PRIVATE(self);
843+
844+ self->priv = priv;
845+ priv->stripped_name = NULL;
846+}
847+
848+AtkObject*
849+unity_places_group_accessible_new(nux::Object* object)
850+{
851+ AtkObject* accessible = NULL;
852+
853+ g_return_val_if_fail(dynamic_cast<unity::PlacesGroup*>(object), NULL);
854+
855+ accessible = ATK_OBJECT(g_object_new(UNITY_TYPE_PLACES_GROUP_ACCESSIBLE, NULL));
856+
857+ atk_object_initialize(accessible, object);
858+
859+ return accessible;
860+}
861+
862+/* AtkObject.h */
863+/* expand label are usually focused during the key nav, but it don't
864+ * get a proper name always. In those cases we use the label.
865+ *
866+ * In the same way, it is possible that the PlacesGroup get focused
867+ * so we also set the own name with this label
868+ */
869+static void
870+ensure_proper_name(UnityPlacesGroupAccessible* self)
871+{
872+ unity::PlacesGroup* group = NULL;
873+ nux::Object* nux_object = NULL;
874+ nux::StaticCairoText* label = NULL;
875+ nux::StaticCairoText* expand_label = NULL;
876+ AtkObject* label_accessible = NULL;
877+ AtkObject* expand_label_accessible = NULL;
878+
879+ nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(self));
880+ group = dynamic_cast<unity::PlacesGroup*>(nux_object);
881+
882+ if (group == NULL)
883+ return;
884+
885+ label = group->GetLabel();
886+ expand_label = group->GetExpandLabel();
887+
888+
889+ label_accessible = unity_a11y_get_accessible(label);
890+ expand_label_accessible = unity_a11y_get_accessible(expand_label);
891+
892+ if ((label_accessible == NULL) || (expand_label_accessible == NULL))
893+ return;
894+
895+ atk_object_set_name(ATK_OBJECT(self), atk_object_get_name(label_accessible));
896+
897+ if (expand_label->GetText() == "")
898+ atk_object_set_name(expand_label_accessible, atk_object_get_name(label_accessible));
899+}
900+
901+
902+static void
903+on_label_text_change_cb(nux::StaticCairoText* label, UnityPlacesGroupAccessible* self)
904+{
905+ ensure_proper_name(self);
906+}
907+
908+static void
909+unity_places_group_accessible_initialize(AtkObject* accessible,
910+ gpointer data)
911+{
912+ unity::PlacesGroup* group = NULL;
913+ nux::Object* nux_object = NULL;
914+ nux::StaticCairoText* label = NULL;
915+
916+ ATK_OBJECT_CLASS(unity_places_group_accessible_parent_class)->initialize(accessible, data);
917+
918+ atk_object_set_role(accessible, ATK_ROLE_PANEL);
919+
920+ nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(accessible));
921+ group = dynamic_cast<unity::PlacesGroup*>(nux_object);
922+
923+ if (group == NULL)
924+ return;
925+
926+ label = group->GetLabel();
927+
928+ if (label == NULL)
929+ return;
930+
931+ ensure_proper_name(UNITY_PLACES_GROUP_ACCESSIBLE(accessible));
932+ label->sigTextChanged.connect(sigc::bind(sigc::ptr_fun(on_label_text_change_cb),
933+ UNITY_PLACES_GROUP_ACCESSIBLE(accessible)));
934+}
935+
936
937=== added file 'plugins/unityshell/src/unity-places-group-accessible.h'
938--- plugins/unityshell/src/unity-places-group-accessible.h 1970-01-01 00:00:00 +0000
939+++ plugins/unityshell/src/unity-places-group-accessible.h 2011-11-07 19:15:28 +0000
940@@ -0,0 +1,57 @@
941+/*
942+ * Copyright (C) 2011 Canonical Ltd
943+ *
944+ * This program is free software: you can redistribute it and/or modify
945+ * it under the terms of the GNU General Public License version 3 as
946+ * published by the Free Software Foundation.
947+ *
948+ * This program is distributed in the hope that it will be useful,
949+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
950+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
951+ * GNU General Public License for more details.
952+ *
953+ * You should have received a copy of the GNU General Public License
954+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
955+ *
956+ * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
957+ */
958+
959+#ifndef UNITY_PLACES_GROUP_ACCESSIBLE_H
960+#define UNITY_PLACES_GROUP_ACCESSIBLE_H
961+
962+#include <atk/atk.h>
963+
964+#include "nux-view-accessible.h"
965+
966+G_BEGIN_DECLS
967+
968+#define UNITY_TYPE_PLACES_GROUP_ACCESSIBLE (unity_places_group_accessible_get_type ())
969+#define UNITY_PLACES_GROUP_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_PLACES_GROUP_ACCESSIBLE, UnityPlacesGroupAccessible))
970+#define UNITY_PLACES_GROUP_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_PLACES_GROUP_ACCESSIBLE, UnityPlacesGroupAccessibleClass))
971+#define UNITY_IS_PLACES_GROUP_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_PLACES_GROUP_ACCESSIBLE))
972+#define UNITY_IS_PLACES_GROUP_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_PLACES_GROUP_ACCESSIBLE))
973+#define UNITY_PLACES_GROUP_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_PLACES_GROUP_ACCESSIBLE, UnityPlacesGroupAccessibleClass))
974+
975+typedef struct _UnityPlacesGroupAccessible UnityPlacesGroupAccessible;
976+typedef struct _UnityPlacesGroupAccessibleClass UnityPlacesGroupAccessibleClass;
977+typedef struct _UnityPlacesGroupAccessiblePrivate UnityPlacesGroupAccessiblePrivate;
978+
979+struct _UnityPlacesGroupAccessible
980+{
981+ NuxViewAccessible parent;
982+
983+ /*< private >*/
984+ UnityPlacesGroupAccessiblePrivate* priv;
985+};
986+
987+struct _UnityPlacesGroupAccessibleClass
988+{
989+ NuxViewAccessibleClass parent_class;
990+};
991+
992+GType unity_places_group_accessible_get_type(void);
993+AtkObject* unity_places_group_accessible_new(nux::Object* object);
994+
995+G_END_DECLS
996+
997+#endif /* __UNITY_PLACES_GROUP_ACCESSIBLE_H__ */
998
999=== added file 'plugins/unityshell/src/unity-places-simple-tile-accessible.cpp'
1000--- plugins/unityshell/src/unity-places-simple-tile-accessible.cpp 1970-01-01 00:00:00 +0000
1001+++ plugins/unityshell/src/unity-places-simple-tile-accessible.cpp 2011-11-07 19:15:28 +0000
1002@@ -0,0 +1,140 @@
1003+/*
1004+ * Copyright (C) 2011 Canonical Ltd
1005+ *
1006+ * This program is free software: you can redistribute it and/or modify
1007+ * it under the terms of the GNU General Public License version 3 as
1008+ * published by the Free Software Foundation.
1009+ *
1010+ * This program is distributed in the hope that it will be useful,
1011+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1012+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1013+ * GNU General Public License for more details.
1014+ *
1015+ * You should have received a copy of the GNU General Public License
1016+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1017+ *
1018+ * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
1019+ */
1020+
1021+/**
1022+ * SECTION:unity-places_simple_tile-accessible
1023+ * @Title: UnityPlacesSimpleTileAccessible
1024+ * @short_description: Implementation of the ATK interfaces for #PlacesSimpleTile
1025+ * @see_also: PlacesSimpleTile
1026+ *
1027+ * #UnityPlacesSimpleTileAccessible implements the required ATK interfaces for
1028+ * #PlacesSimpleTile, mainly exposing the text as his name, as this
1029+ * #object is mainly used as a label
1030+ *
1031+ */
1032+
1033+#include <glib/gi18n.h>
1034+
1035+#include "unity-places-simple-tile-accessible.h"
1036+
1037+#include "unitya11y.h"
1038+#include "PlacesSimpleTile.h"
1039+
1040+/* GObject */
1041+static void unity_places_simple_tile_accessible_class_init(UnityPlacesSimpleTileAccessibleClass* klass);
1042+static void unity_places_simple_tile_accessible_init(UnityPlacesSimpleTileAccessible* self);
1043+
1044+/* AtkObject.h */
1045+static void unity_places_simple_tile_accessible_initialize(AtkObject* accessible,
1046+ gpointer data);
1047+static const gchar* unity_places_simple_tile_accessible_get_name(AtkObject* obj);
1048+
1049+G_DEFINE_TYPE(UnityPlacesSimpleTileAccessible, unity_places_simple_tile_accessible, NUX_TYPE_VIEW_ACCESSIBLE);
1050+
1051+
1052+#define UNITY_PLACES_SIMPLE_TILE_ACCESSIBLE_GET_PRIVATE(obj) \
1053+ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), UNITY_TYPE_PLACES_SIMPLE_TILE_ACCESSIBLE, \
1054+ UnityPlacesSimpleTileAccessiblePrivate))
1055+
1056+struct _UnityPlacesSimpleTileAccessiblePrivate
1057+{
1058+ gchar* stripped_name;
1059+};
1060+
1061+
1062+static void
1063+unity_places_simple_tile_accessible_class_init(UnityPlacesSimpleTileAccessibleClass* klass)
1064+{
1065+ GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
1066+ AtkObjectClass* atk_class = ATK_OBJECT_CLASS(klass);
1067+
1068+ /* AtkObject */
1069+ atk_class->get_name = unity_places_simple_tile_accessible_get_name;
1070+ atk_class->initialize = unity_places_simple_tile_accessible_initialize;
1071+
1072+ g_type_class_add_private(gobject_class, sizeof(UnityPlacesSimpleTileAccessiblePrivate));
1073+}
1074+
1075+static void
1076+unity_places_simple_tile_accessible_init(UnityPlacesSimpleTileAccessible* self)
1077+{
1078+ UnityPlacesSimpleTileAccessiblePrivate* priv =
1079+ UNITY_PLACES_SIMPLE_TILE_ACCESSIBLE_GET_PRIVATE(self);
1080+
1081+ self->priv = priv;
1082+ priv->stripped_name = NULL;
1083+}
1084+
1085+AtkObject*
1086+unity_places_simple_tile_accessible_new(nux::Object* object)
1087+{
1088+ AtkObject* accessible = NULL;
1089+
1090+ g_return_val_if_fail(dynamic_cast<unity::PlacesSimpleTile*>(object), NULL);
1091+
1092+ accessible = ATK_OBJECT(g_object_new(UNITY_TYPE_PLACES_SIMPLE_TILE_ACCESSIBLE, NULL));
1093+
1094+ atk_object_initialize(accessible, object);
1095+
1096+ return accessible;
1097+}
1098+
1099+/* AtkObject.h */
1100+static void
1101+unity_places_simple_tile_accessible_initialize(AtkObject* accessible,
1102+ gpointer data)
1103+{
1104+ ATK_OBJECT_CLASS(unity_places_simple_tile_accessible_parent_class)->initialize(accessible, data);
1105+
1106+ atk_object_set_role(accessible, ATK_ROLE_PUSH_BUTTON);
1107+}
1108+
1109+
1110+
1111+static const gchar*
1112+unity_places_simple_tile_accessible_get_name(AtkObject* obj)
1113+{
1114+ const gchar* name;
1115+ UnityPlacesSimpleTileAccessible* self = NULL;
1116+
1117+ g_return_val_if_fail(UNITY_IS_PLACES_SIMPLE_TILE_ACCESSIBLE(obj), NULL);
1118+ self = UNITY_PLACES_SIMPLE_TILE_ACCESSIBLE(obj);
1119+
1120+ name = ATK_OBJECT_CLASS(unity_places_simple_tile_accessible_parent_class)->get_name(obj);
1121+ if (name == NULL)
1122+ {
1123+ unity::PlacesSimpleTile* tile = NULL;
1124+
1125+ if (self->priv->stripped_name != NULL)
1126+ {
1127+ g_free(self->priv->stripped_name);
1128+ self->priv->stripped_name = NULL;
1129+ }
1130+
1131+ tile = dynamic_cast<unity::PlacesSimpleTile*>(nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(obj)));
1132+ if (tile != NULL)
1133+ {
1134+ name = tile->GetLabel();
1135+ pango_parse_markup(name, -1, 0, NULL,
1136+ &self->priv->stripped_name,
1137+ NULL, NULL);
1138+ }
1139+ }
1140+
1141+ return self->priv->stripped_name;
1142+}
1143
1144=== added file 'plugins/unityshell/src/unity-places-simple-tile-accessible.h'
1145--- plugins/unityshell/src/unity-places-simple-tile-accessible.h 1970-01-01 00:00:00 +0000
1146+++ plugins/unityshell/src/unity-places-simple-tile-accessible.h 2011-11-07 19:15:28 +0000
1147@@ -0,0 +1,57 @@
1148+/*
1149+ * Copyright (C) 2011 Canonical Ltd
1150+ *
1151+ * This program is free software: you can redistribute it and/or modify
1152+ * it under the terms of the GNU General Public License version 3 as
1153+ * published by the Free Software Foundation.
1154+ *
1155+ * This program is distributed in the hope that it will be useful,
1156+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1157+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1158+ * GNU General Public License for more details.
1159+ *
1160+ * You should have received a copy of the GNU General Public License
1161+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1162+ *
1163+ * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
1164+ */
1165+
1166+#ifndef UNITY_PLACES_SIMPLE_TILE_ACCESSIBLE_H
1167+#define UNITY_PLACES_SIMPLE_TILE_ACCESSIBLE_H
1168+
1169+#include <atk/atk.h>
1170+
1171+#include "nux-view-accessible.h"
1172+
1173+G_BEGIN_DECLS
1174+
1175+#define UNITY_TYPE_PLACES_SIMPLE_TILE_ACCESSIBLE (unity_places_simple_tile_accessible_get_type ())
1176+#define UNITY_PLACES_SIMPLE_TILE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_PLACES_SIMPLE_TILE_ACCESSIBLE, UnityPlacesSimpleTileAccessible))
1177+#define UNITY_PLACES_SIMPLE_TILE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_PLACES_SIMPLE_TILE_ACCESSIBLE, UnityPlacesSimpleTileAccessibleClass))
1178+#define UNITY_IS_PLACES_SIMPLE_TILE_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_PLACES_SIMPLE_TILE_ACCESSIBLE))
1179+#define UNITY_IS_PLACES_SIMPLE_TILE_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_PLACES_SIMPLE_TILE_ACCESSIBLE))
1180+#define UNITY_PLACES_SIMPLE_TILE_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_PLACES_SIMPLE_TILE_ACCESSIBLE, UnityPlacesSimpleTileAccessibleClass))
1181+
1182+typedef struct _UnityPlacesSimpleTileAccessible UnityPlacesSimpleTileAccessible;
1183+typedef struct _UnityPlacesSimpleTileAccessibleClass UnityPlacesSimpleTileAccessibleClass;
1184+typedef struct _UnityPlacesSimpleTileAccessiblePrivate UnityPlacesSimpleTileAccessiblePrivate;
1185+
1186+struct _UnityPlacesSimpleTileAccessible
1187+{
1188+ NuxViewAccessible parent;
1189+
1190+ /*< private >*/
1191+ UnityPlacesSimpleTileAccessiblePrivate* priv;
1192+};
1193+
1194+struct _UnityPlacesSimpleTileAccessibleClass
1195+{
1196+ NuxViewAccessibleClass parent_class;
1197+};
1198+
1199+GType unity_places_simple_tile_accessible_get_type(void);
1200+AtkObject* unity_places_simple_tile_accessible_new(nux::Object* object);
1201+
1202+G_END_DECLS
1203+
1204+#endif /* __UNITY_PLACES_SIMPLE_TILE_ACCESSIBLE_H__ */
1205
1206=== removed file 'plugins/unityshell/src/unity-places-view-accessible.cpp'
1207--- plugins/unityshell/src/unity-places-view-accessible.cpp 2011-08-08 20:35:24 +0000
1208+++ plugins/unityshell/src/unity-places-view-accessible.cpp 1970-01-01 00:00:00 +0000
1209@@ -1,114 +0,0 @@
1210-/*
1211- * Copyright (C) 2011 Canonical Ltd
1212- *
1213- * This program is free software: you can redistribute it and/or modify
1214- * it under the terms of the GNU General Public License version 3 as
1215- * published by the Free Software Foundation.
1216- *
1217- * This program is distributed in the hope that it will be useful,
1218- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1219- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1220- * GNU General Public License for more details.
1221- *
1222- * You should have received a copy of the GNU General Public License
1223- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1224- *
1225- * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
1226- */
1227-
1228-/**
1229- * SECTION:unity-places_view-accessible
1230- * @Title: UnityPlacesViewAccessible
1231- * @short_description: Implementation of the ATK interfaces for #PlacesView
1232- * @see_also: PlacesView
1233- *
1234- * #UnityPlacesViewAccessible implements the required ATK interfaces for
1235- * #PlacesView, ie: exposing the different PlacesViewIcon on the model as
1236- * #child of the object.
1237- *
1238- */
1239-
1240-#include <glib/gi18n.h>
1241-
1242-#include "unity-places-view-accessible.h"
1243-
1244-#include "unitya11y.h"
1245-#include "DashView.h"
1246-
1247-using namespace unity::dash;
1248-
1249-/* GObject */
1250-static void unity_places_view_accessible_class_init(UnityPlacesViewAccessibleClass* klass);
1251-static void unity_places_view_accessible_init(UnityPlacesViewAccessible* self);
1252-static void unity_places_view_accessible_finalize(GObject* object);
1253-
1254-/* AtkObject.h */
1255-static void unity_places_view_accessible_initialize(AtkObject* accessible,
1256- gpointer data);
1257-
1258-G_DEFINE_TYPE(UnityPlacesViewAccessible, unity_places_view_accessible, NUX_TYPE_VIEW_ACCESSIBLE)
1259-
1260-#define UNITY_PLACES_VIEW_ACCESSIBLE_GET_PRIVATE(obj) \
1261- (G_TYPE_INSTANCE_GET_PRIVATE ((obj), UNITY_TYPE_PLACES_VIEW_ACCESSIBLE, \
1262- UnityPlacesViewAccessiblePrivate))
1263-
1264-struct _UnityPlacesViewAccessiblePrivate
1265-{
1266-
1267-};
1268-
1269-
1270-static void
1271-unity_places_view_accessible_class_init(UnityPlacesViewAccessibleClass* klass)
1272-{
1273- GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
1274- AtkObjectClass* atk_class = ATK_OBJECT_CLASS(klass);
1275-
1276- gobject_class->finalize = unity_places_view_accessible_finalize;
1277-
1278- /* AtkObject */
1279- atk_class->initialize = unity_places_view_accessible_initialize;
1280-
1281- g_type_class_add_private(gobject_class, sizeof(UnityPlacesViewAccessiblePrivate));
1282-}
1283-
1284-static void
1285-unity_places_view_accessible_init(UnityPlacesViewAccessible* self)
1286-{
1287- UnityPlacesViewAccessiblePrivate* priv =
1288- UNITY_PLACES_VIEW_ACCESSIBLE_GET_PRIVATE(self);
1289-
1290- self->priv = priv;
1291-}
1292-
1293-static void
1294-unity_places_view_accessible_finalize(GObject* object)
1295-{
1296- G_OBJECT_CLASS(unity_places_view_accessible_parent_class)->finalize(object);
1297-}
1298-
1299-AtkObject*
1300-unity_places_view_accessible_new(nux::Object* object)
1301-{
1302- AtkObject* accessible = NULL;
1303-
1304- g_return_val_if_fail(dynamic_cast<DashView*>(object), NULL);
1305-
1306- accessible = ATK_OBJECT(g_object_new(UNITY_TYPE_PLACES_VIEW_ACCESSIBLE, NULL));
1307-
1308- atk_object_initialize(accessible, object);
1309- atk_object_set_name(accessible, _("Places"));
1310-
1311- return accessible;
1312-}
1313-
1314-/* AtkObject.h */
1315-static void
1316-unity_places_view_accessible_initialize(AtkObject* accessible,
1317- gpointer data)
1318-{
1319- ATK_OBJECT_CLASS(unity_places_view_accessible_parent_class)->initialize(accessible, data);
1320-
1321- accessible->role = ATK_ROLE_PANEL;
1322-}
1323-
1324
1325=== removed file 'plugins/unityshell/src/unity-places-view-accessible.h'
1326--- plugins/unityshell/src/unity-places-view-accessible.h 2011-07-21 14:59:25 +0000
1327+++ plugins/unityshell/src/unity-places-view-accessible.h 1970-01-01 00:00:00 +0000
1328@@ -1,57 +0,0 @@
1329-/*
1330- * Copyright (C) 2011 Canonical Ltd
1331- *
1332- * This program is free software: you can redistribute it and/or modify
1333- * it under the terms of the GNU General Public License version 3 as
1334- * published by the Free Software Foundation.
1335- *
1336- * This program is distributed in the hope that it will be useful,
1337- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1338- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1339- * GNU General Public License for more details.
1340- *
1341- * You should have received a copy of the GNU General Public License
1342- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1343- *
1344- * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
1345- */
1346-
1347-#ifndef UNITY_PLACES_VIEW_ACCESSIBLE_H
1348-#define UNITY_PLACES_VIEW_ACCESSIBLE_H
1349-
1350-#include <atk/atk.h>
1351-
1352-#include "nux-view-accessible.h"
1353-
1354-G_BEGIN_DECLS
1355-
1356-#define UNITY_TYPE_PLACES_VIEW_ACCESSIBLE (unity_places_view_accessible_get_type ())
1357-#define UNITY_PLACES_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_PLACES_VIEW_ACCESSIBLE, UnityPlacesViewAccessible))
1358-#define UNITY_PLACES_VIEW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_PLACES_VIEW_ACCESSIBLE, UnityPlacesViewAccessibleClass))
1359-#define UNITY_IS_PLACES_VIEW_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_PLACES_VIEW_ACCESSIBLE))
1360-#define UNITY_IS_PLACES_VIEW_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_PLACES_VIEW_ACCESSIBLE))
1361-#define UNITY_PLACES_VIEW_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_PLACES_VIEW_ACCESSIBLE, UnityPlacesViewAccessibleClass))
1362-
1363-typedef struct _UnityPlacesViewAccessible UnityPlacesViewAccessible;
1364-typedef struct _UnityPlacesViewAccessibleClass UnityPlacesViewAccessibleClass;
1365-typedef struct _UnityPlacesViewAccessiblePrivate UnityPlacesViewAccessiblePrivate;
1366-
1367-struct _UnityPlacesViewAccessible
1368-{
1369- NuxViewAccessible parent;
1370-
1371- /*< private >*/
1372- UnityPlacesViewAccessiblePrivate* priv;
1373-};
1374-
1375-struct _UnityPlacesViewAccessibleClass
1376-{
1377- NuxViewAccessibleClass parent_class;
1378-};
1379-
1380-GType unity_places_view_accessible_get_type(void);
1381-AtkObject* unity_places_view_accessible_new(nux::Object* object);
1382-
1383-G_END_DECLS
1384-
1385-#endif /* __UNITY_PLACES_VIEW_ACCESSIBLE_H__ */
1386
1387=== added file 'plugins/unityshell/src/unity-result-accessible.cpp'
1388--- plugins/unityshell/src/unity-result-accessible.cpp 1970-01-01 00:00:00 +0000
1389+++ plugins/unityshell/src/unity-result-accessible.cpp 2011-11-07 19:15:28 +0000
1390@@ -0,0 +1,132 @@
1391+/*
1392+ * Copyright (C) 2011 Canonical Ltd
1393+ *
1394+ * This program is free software: you can redistribute it and/or modify
1395+ * it under the terms of the GNU General Public License version 3 as
1396+ * published by the Free Software Foundation.
1397+ *
1398+ * This program is distributed in the hope that it will be useful,
1399+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1400+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1401+ * GNU General Public License for more details.
1402+ *
1403+ * You should have received a copy of the GNU General Public License
1404+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1405+ *
1406+ * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
1407+ */
1408+
1409+/**
1410+ * SECTION:nux-result-accessible
1411+ * @Title: UnityResultAccessible
1412+ * @short_description: Implementation of the ATK interfaces for a #Result
1413+ * @see_also: unity::dash::Result
1414+ *
1415+ * #UnityResultAccessible implements the required ATK interfaces of
1416+ * nux::Result, in order to represent each one of the elements of a
1417+ * ResultGrid.
1418+ *
1419+ * The idea is having it as a fly-weight object. Note: it represents
1420+ * it, but it doesn't maintain a reference to it.
1421+ *
1422+ */
1423+
1424+#include "unity-result-accessible.h"
1425+#include "unity-rvgrid-accessible.h"
1426+
1427+#include "unitya11y.h"
1428+
1429+/* GObject */
1430+static void unity_result_accessible_class_init(UnityResultAccessibleClass* klass);
1431+static void unity_result_accessible_init(UnityResultAccessible* result_accessible);
1432+
1433+/* AtkObject.h */
1434+static void unity_result_accessible_initialize(AtkObject* accessible,
1435+ gpointer data);
1436+static AtkStateSet* unity_result_accessible_ref_state_set(AtkObject* obj);
1437+
1438+G_DEFINE_TYPE(UnityResultAccessible,
1439+ unity_result_accessible,
1440+ ATK_TYPE_OBJECT);
1441+
1442+#define UNITY_RESULT_ACCESSIBLE_GET_PRIVATE(obj) \
1443+ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), UNITY_TYPE_RESULT_ACCESSIBLE, \
1444+ UnityResultAccessiblePrivate))
1445+
1446+struct _UnityResultAccessiblePrivate
1447+{
1448+};
1449+
1450+static void
1451+unity_result_accessible_class_init(UnityResultAccessibleClass* klass)
1452+{
1453+ GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
1454+ AtkObjectClass* atk_class = ATK_OBJECT_CLASS(klass);
1455+
1456+ /* AtkObject */
1457+ atk_class->initialize = unity_result_accessible_initialize;
1458+ atk_class->ref_state_set = unity_result_accessible_ref_state_set;
1459+
1460+ g_type_class_add_private(gobject_class, sizeof(UnityResultAccessiblePrivate));
1461+}
1462+
1463+static void
1464+unity_result_accessible_init(UnityResultAccessible* result_accessible)
1465+{
1466+ UnityResultAccessiblePrivate* priv =
1467+ UNITY_RESULT_ACCESSIBLE_GET_PRIVATE(result_accessible);
1468+
1469+ result_accessible->priv = priv;
1470+}
1471+
1472+AtkObject*
1473+unity_result_accessible_new()
1474+{
1475+ AtkObject* accessible = NULL;
1476+
1477+ accessible = ATK_OBJECT(g_object_new(UNITY_TYPE_RESULT_ACCESSIBLE, NULL));
1478+
1479+ atk_object_initialize(accessible, NULL);
1480+
1481+ return accessible;
1482+}
1483+
1484+/* AtkObject.h */
1485+static void
1486+unity_result_accessible_initialize(AtkObject* accessible,
1487+ gpointer data)
1488+{
1489+ ATK_OBJECT_CLASS(unity_result_accessible_parent_class)->initialize(accessible, data);
1490+
1491+ /* On unity Result is just data, but on the accessible
1492+ implementation we are using this object to represent each icon
1493+ selected on the result grid, so a push button */
1494+ atk_object_set_role(accessible, ATK_ROLE_PUSH_BUTTON);
1495+}
1496+
1497+static AtkStateSet*
1498+unity_result_accessible_ref_state_set(AtkObject* obj)
1499+{
1500+ AtkStateSet* state_set = NULL;
1501+
1502+ g_return_val_if_fail(UNITY_IS_RESULT_ACCESSIBLE(obj), NULL);
1503+
1504+ state_set = ATK_OBJECT_CLASS(unity_result_accessible_parent_class)->ref_state_set(obj);
1505+
1506+ /* by default, this is a fly-weight/dummy object, so if created we have
1507+ this information */
1508+ atk_state_set_add_state(state_set, ATK_STATE_FOCUSABLE);
1509+ atk_state_set_add_state(state_set, ATK_STATE_ENABLED);
1510+ atk_state_set_add_state(state_set, ATK_STATE_SENSITIVE);
1511+
1512+ atk_state_set_add_state(state_set, ATK_STATE_VISIBLE);
1513+ atk_state_set_add_state(state_set, ATK_STATE_SHOWING);
1514+
1515+ /* This object is not focused, the focused is the parent
1516+ ResultViewGrid */
1517+ // atk_state_set_add_state(state_set, ATK_STATE_FOCUSED);
1518+ atk_state_set_add_state(state_set, ATK_STATE_SELECTED);
1519+ atk_state_set_add_state(state_set, ATK_STATE_ACTIVE);
1520+
1521+ return state_set;
1522+}
1523
1524=== added file 'plugins/unityshell/src/unity-result-accessible.h'
1525--- plugins/unityshell/src/unity-result-accessible.h 1970-01-01 00:00:00 +0000
1526+++ plugins/unityshell/src/unity-result-accessible.h 2011-11-07 19:15:28 +0000
1527@@ -0,0 +1,56 @@
1528+/*
1529+ * Copyright (C) 2011 Canonical Ltd
1530+ *
1531+ * This program is free software: you can redistribute it and/or modify
1532+ * it under the terms of the GNU General Public License version 3 as
1533+ * published by the Free Software Foundation.
1534+ *
1535+ * This program is distributed in the hope that it will be useful,
1536+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1537+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1538+ * GNU General Public License for more details.
1539+ *
1540+ * You should have received a copy of the GNU General Public License
1541+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1542+ *
1543+ * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
1544+ */
1545+
1546+#ifndef UNITY_LAUNCHER_ICON_ACCESSIBLE_H
1547+#define UNITY_LAUNCHER_ICON_ACCESSIBLE_H
1548+
1549+#include <atk/atk.h>
1550+
1551+G_BEGIN_DECLS
1552+
1553+#define UNITY_TYPE_RESULT_ACCESSIBLE (unity_result_accessible_get_type ())
1554+#define UNITY_RESULT_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_RESULT_ACCESSIBLE, UnityResultAccessible))
1555+#define UNITY_RESULT_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_RESULT_ACCESSIBLE, UnityResultAccessibleClass))
1556+#define UNITY_IS_RESULT_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_RESULT_ACCESSIBLE))
1557+#define UNITY_IS_RESULT_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_RESULT_ACCESSIBLE))
1558+#define UNITY_RESULT_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_RESULT_ACCESSIBLE, UnityResultAccessibleClass))
1559+
1560+typedef struct _UnityResultAccessible UnityResultAccessible;
1561+typedef struct _UnityResultAccessibleClass UnityResultAccessibleClass;
1562+typedef struct _UnityResultAccessiblePrivate UnityResultAccessiblePrivate;
1563+
1564+struct _UnityResultAccessible
1565+{
1566+ AtkObject parent;
1567+
1568+ /*< private >*/
1569+ UnityResultAccessiblePrivate* priv;
1570+};
1571+
1572+struct _UnityResultAccessibleClass
1573+{
1574+ AtkObjectClass parent_class;
1575+};
1576+
1577+GType unity_result_accessible_get_type(void);
1578+AtkObject* unity_result_accessible_new();
1579+
1580+
1581+G_END_DECLS
1582+
1583+#endif /* __UNITY_RESULT_ACCESSIBLE_H__ */
1584
1585=== modified file 'plugins/unityshell/src/unity-root-accessible.cpp'
1586--- plugins/unityshell/src/unity-root-accessible.cpp 2011-07-21 14:59:25 +0000
1587+++ plugins/unityshell/src/unity-root-accessible.cpp 2011-11-07 19:15:28 +0000
1588@@ -26,8 +26,12 @@
1589 */
1590
1591 #include "unity-root-accessible.h"
1592+#include "nux-base-window-accessible.h"
1593 #include "unitya11y.h"
1594
1595+#include "UBusWrapper.h"
1596+#include "UBusMessages.h"
1597+
1598 /* GObject */
1599 static void unity_root_accessible_class_init(UnityRootAccessibleClass* klass);
1600 static void unity_root_accessible_init(UnityRootAccessible* root);
1601@@ -42,7 +46,12 @@
1602 static AtkObject* unity_root_accessible_get_parent(AtkObject* obj);
1603 /* private */
1604 static void explore_children(AtkObject* obj);
1605-
1606+static void check_active_window(UnityRootAccessible* self);
1607+static void register_interesting_messages(UnityRootAccessible* self);
1608+static void add_window(UnityRootAccessible* self,
1609+ nux::BaseWindow* window);
1610+static void remove_window(UnityRootAccessible* self,
1611+ nux::BaseWindow* window);
1612
1613 #define UNITY_ROOT_ACCESSIBLE_GET_PRIVATE(obj) \
1614 (G_TYPE_INSTANCE_GET_PRIVATE ((obj), UNITY_TYPE_ROOT_ACCESSIBLE, UnityRootAccessiblePrivate))
1615@@ -102,7 +111,7 @@
1616
1617 if (root->priv->window_list)
1618 {
1619- g_slist_free(root->priv->window_list);
1620+ g_slist_free_full(root->priv->window_list, g_object_unref);
1621 root->priv->window_list = NULL;
1622 }
1623
1624@@ -122,6 +131,8 @@
1625 atk_object_set_name(accessible, "unity");
1626 atk_object_set_parent(accessible, NULL);
1627
1628+ register_interesting_messages(UNITY_ROOT_ACCESSIBLE(accessible));
1629+
1630 ATK_OBJECT_CLASS(unity_root_accessible_parent_class)->initialize(accessible, data);
1631 }
1632
1633@@ -162,40 +173,6 @@
1634 }
1635
1636
1637-
1638-/*
1639- * It adds a window to the internal window_list managed by the
1640- *
1641- *
1642- * FIXME: third parties manually using this method should be
1643- * temporal. This method should be a internal root method, as part of
1644- * a basewindow::show callback, as in the case of gail
1645- */
1646-AtkObject*
1647-unity_root_accessible_add_window(UnityRootAccessible* self,
1648- nux::BaseWindow* window)
1649-{
1650- AtkObject* window_accessible = NULL;
1651- gint index = 0;
1652-
1653- g_return_val_if_fail(UNITY_IS_ROOT_ACCESSIBLE(self), NULL);
1654-
1655- window_accessible =
1656- unity_a11y_get_accessible(window);
1657-
1658- self->priv->window_list =
1659- g_slist_append(self->priv->window_list, window_accessible);
1660-
1661- index = g_slist_index(self->priv->window_list, window_accessible);
1662-
1663- explore_children(window_accessible);
1664-
1665- g_signal_emit_by_name(self, "children-changed::add",
1666- index, window_accessible, NULL);
1667-
1668- return window_accessible;
1669-}
1670-
1671 /* private */
1672 /*
1673 * FIXME: temporal solution
1674@@ -240,3 +217,125 @@
1675 g_object_unref(atk_child);
1676 }
1677 }
1678+
1679+/*
1680+ * Call all the children (NuxBaseWindowAccessible) to check if they
1681+ * are in the proper active or deactive status.
1682+ */
1683+static void
1684+check_active_window(UnityRootAccessible* self)
1685+{
1686+ GSList* iter = NULL;
1687+ NuxBaseWindowAccessible* window = NULL;
1688+
1689+ for (iter = self->priv->window_list; iter != NULL; iter = g_slist_next(iter))
1690+ {
1691+ window = NUX_BASE_WINDOW_ACCESSIBLE(iter->data);
1692+
1693+ nux_base_window_accessible_check_active(window);
1694+ }
1695+}
1696+
1697+/*
1698+ * It adds a window to the internal window_list managed by the Root object
1699+ *
1700+ * Checks if the object is already present. Adds a reference to the
1701+ * accessible object of the window.
1702+ */
1703+static void
1704+add_window(UnityRootAccessible* self,
1705+ nux::BaseWindow* window)
1706+{
1707+ AtkObject* window_accessible = NULL;
1708+ gint index = 0;
1709+
1710+ g_return_if_fail(UNITY_IS_ROOT_ACCESSIBLE(self));
1711+
1712+ window_accessible =
1713+ unity_a11y_get_accessible(window);
1714+
1715+ if (g_slist_find(self->priv->window_list, window_accessible))
1716+ return;
1717+
1718+ self->priv->window_list =
1719+ g_slist_append(self->priv->window_list, window_accessible);
1720+ g_object_ref(window_accessible);
1721+
1722+ index = g_slist_index(self->priv->window_list, window_accessible);
1723+
1724+ explore_children(window_accessible);
1725+
1726+ g_signal_emit_by_name(self, "children-changed::add",
1727+ index, window_accessible, NULL);
1728+}
1729+
1730+
1731+/*
1732+ * It removes the window to the internal window_list managed by the
1733+ * Root object
1734+ *
1735+ * Checks if the object is already present. Removes a reference to the
1736+ * accessible object of the window.
1737+ */
1738+static void
1739+remove_window(UnityRootAccessible* self,
1740+ nux::BaseWindow* window)
1741+{
1742+ AtkObject* window_accessible = NULL;
1743+ gint index = 0;
1744+
1745+ g_return_if_fail(UNITY_IS_ROOT_ACCESSIBLE(self));
1746+
1747+ window_accessible =
1748+ unity_a11y_get_accessible(window);
1749+
1750+ if (!g_slist_find(self->priv->window_list, window_accessible))
1751+ return;
1752+
1753+ index = g_slist_index(self->priv->window_list, window_accessible);
1754+
1755+ self->priv->window_list =
1756+ g_slist_remove(self->priv->window_list, window_accessible);
1757+ g_object_unref(window_accessible);
1758+
1759+ g_signal_emit_by_name(self, "children-changed::remove",
1760+ index, window_accessible, NULL);
1761+}
1762+
1763+static void
1764+ubus_change_visibility_cb(GVariant* variant,
1765+ UnityRootAccessible* self)
1766+{
1767+ check_active_window(self);
1768+}
1769+
1770+static void
1771+wc_change_visibility_window_cb(nux::BaseWindow* window, UnityRootAccessible* self, gboolean visible)
1772+{
1773+ if (visible)
1774+ add_window(self, window);
1775+ else
1776+ remove_window(self, window);
1777+}
1778+
1779+static void
1780+register_interesting_messages(UnityRootAccessible* self)
1781+{
1782+ static unity::UBusManager ubus_manager;
1783+
1784+ ubus_manager.RegisterInterest(UBUS_PLACE_VIEW_SHOWN,
1785+ sigc::bind(sigc::ptr_fun(ubus_change_visibility_cb), self));
1786+ ubus_manager.RegisterInterest(UBUS_PLACE_VIEW_HIDDEN,
1787+ sigc::bind(sigc::ptr_fun(ubus_change_visibility_cb), self));
1788+
1789+ ubus_manager.RegisterInterest(UBUS_LAUNCHER_START_KEY_NAV,
1790+ sigc::bind(sigc::ptr_fun(ubus_change_visibility_cb), self));
1791+ ubus_manager.RegisterInterest(UBUS_LAUNCHER_END_KEY_NAV,
1792+ sigc::bind(sigc::ptr_fun(ubus_change_visibility_cb), self));
1793+
1794+ nux::GetWindowCompositor().sigVisibleViewWindow.
1795+ connect(sigc::bind(sigc::ptr_fun(wc_change_visibility_window_cb), self, TRUE));
1796+
1797+ nux::GetWindowCompositor().sigHiddenViewWindow.
1798+ connect(sigc::bind(sigc::ptr_fun(wc_change_visibility_window_cb), self, FALSE));
1799+}
1800
1801=== modified file 'plugins/unityshell/src/unity-root-accessible.h'
1802--- plugins/unityshell/src/unity-root-accessible.h 2011-09-06 18:30:26 +0000
1803+++ plugins/unityshell/src/unity-root-accessible.h 2011-11-07 19:15:28 +0000
1804@@ -53,9 +53,6 @@
1805 GType unity_root_accessible_get_type(void);
1806 AtkObject* unity_root_accessible_new(void);
1807
1808-AtkObject* unity_root_accessible_add_window(UnityRootAccessible* self,
1809- nux::BaseWindow* window);
1810-
1811 G_END_DECLS
1812
1813 #endif /* __UNITY_ROOT_ACCESSIBLE_H__ */
1814
1815=== added file 'plugins/unityshell/src/unity-rvgrid-accessible.cpp'
1816--- plugins/unityshell/src/unity-rvgrid-accessible.cpp 1970-01-01 00:00:00 +0000
1817+++ plugins/unityshell/src/unity-rvgrid-accessible.cpp 2011-11-07 19:15:28 +0000
1818@@ -0,0 +1,398 @@
1819+/*
1820+ * Copyright (C) 2011 Canonical Ltd
1821+ *
1822+ * This program is free software: you can redistribute it and/or modify
1823+ * it under the terms of the GNU General Public License version 3 as
1824+ * published by the Free Software Foundation.
1825+ *
1826+ * This program is distributed in the hope that it will be useful,
1827+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1828+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1829+ * GNU General Public License for more details.
1830+ *
1831+ * You should have received a copy of the GNU General Public License
1832+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1833+ *
1834+ * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
1835+ */
1836+
1837+/**
1838+ * SECTION:unity-rvgrid-accessible
1839+ * @Title: UnityRvgridAccessible
1840+ * @short_description: Implementation of the ATK interfaces for #ResultViewGrid
1841+ * @see_also: Rvgrid
1842+ *
1843+ * #UnityRvgridAccessible implements the required ATK interfaces for
1844+ * #Rvgrid, ie: exposing the different RvgridIcon on the model as
1845+ * #child of the object.
1846+ *
1847+ */
1848+
1849+#include <glib/gi18n.h>
1850+
1851+#include "unity-rvgrid-accessible.h"
1852+#include "unity-result-accessible.h"
1853+#include "unity-places-group-accessible.h"
1854+
1855+#include "unitya11y.h"
1856+#include "ResultViewGrid.h"
1857+#include "PlacesGroup.h"
1858+
1859+using namespace unity::dash;
1860+
1861+/* GObject */
1862+static void unity_rvgrid_accessible_class_init(UnityRvgridAccessibleClass* klass);
1863+static void unity_rvgrid_accessible_init(UnityRvgridAccessible* self);
1864+static void unity_rvgrid_accessible_finalize(GObject* object);
1865+
1866+/* AtkObject.h */
1867+static void unity_rvgrid_accessible_initialize(AtkObject* accessible,
1868+ gpointer data);
1869+static AtkStateSet* unity_rvgrid_accessible_ref_state_set(AtkObject* obj);
1870+static gint unity_rvgrid_accessible_get_n_children(AtkObject* obj);
1871+static AtkObject* unity_rvgrid_accessible_ref_child(AtkObject* obj,
1872+ gint i);
1873+
1874+/* AtkSelection */
1875+static void atk_selection_interface_init(AtkSelectionIface* iface);
1876+static AtkObject* unity_rvgrid_accessible_ref_selection(AtkSelection* selection,
1877+ gint i);
1878+static gint unity_rvgrid_accessible_get_selection_count(AtkSelection* selection);
1879+static gboolean unity_rvgrid_accessible_is_child_selected(AtkSelection* selection,
1880+ gint i);
1881+
1882+/* private */
1883+
1884+G_DEFINE_TYPE_WITH_CODE(UnityRvgridAccessible, unity_rvgrid_accessible, NUX_TYPE_VIEW_ACCESSIBLE,
1885+ G_IMPLEMENT_INTERFACE(ATK_TYPE_SELECTION, atk_selection_interface_init))
1886+
1887+#define UNITY_RVGRID_ACCESSIBLE_GET_PRIVATE(obj) \
1888+ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), UNITY_TYPE_RVGRID_ACCESSIBLE, \
1889+ UnityRvgridAccessiblePrivate))
1890+
1891+struct _UnityRvgridAccessiblePrivate
1892+{
1893+ sigc::connection on_selection_change_connection;
1894+
1895+ /* dummy selected result object */
1896+ UnityResultAccessible* result;
1897+ gboolean has_selection;
1898+ gboolean focused;
1899+};
1900+
1901+
1902+static void
1903+unity_rvgrid_accessible_class_init(UnityRvgridAccessibleClass* klass)
1904+{
1905+ GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
1906+ AtkObjectClass* atk_class = ATK_OBJECT_CLASS(klass);
1907+
1908+ /* GObject */
1909+ gobject_class->finalize = unity_rvgrid_accessible_finalize;
1910+
1911+ /* AtkObject */
1912+ atk_class->get_n_children = unity_rvgrid_accessible_get_n_children;
1913+ atk_class->ref_child = unity_rvgrid_accessible_ref_child;
1914+ atk_class->initialize = unity_rvgrid_accessible_initialize;
1915+ atk_class->ref_state_set = unity_rvgrid_accessible_ref_state_set;
1916+
1917+ g_type_class_add_private(gobject_class, sizeof(UnityRvgridAccessiblePrivate));
1918+}
1919+
1920+static void
1921+unity_rvgrid_accessible_init(UnityRvgridAccessible* self)
1922+{
1923+ UnityRvgridAccessiblePrivate* priv =
1924+ UNITY_RVGRID_ACCESSIBLE_GET_PRIVATE(self);
1925+
1926+ self->priv = priv;
1927+}
1928+
1929+static void
1930+unity_rvgrid_accessible_finalize(GObject* object)
1931+{
1932+ UnityRvgridAccessible* self = UNITY_RVGRID_ACCESSIBLE(object);
1933+
1934+ self->priv->on_selection_change_connection.disconnect();
1935+
1936+ if (self->priv->result != NULL)
1937+ {
1938+ g_object_unref(self->priv->result);
1939+ self->priv->result = NULL;
1940+ }
1941+
1942+ self->priv->on_selection_change_connection.disconnect();
1943+
1944+ G_OBJECT_CLASS(unity_rvgrid_accessible_parent_class)->finalize(object);
1945+}
1946+
1947+AtkObject*
1948+unity_rvgrid_accessible_new(nux::Object* object)
1949+{
1950+ AtkObject* accessible = NULL;
1951+
1952+ g_return_val_if_fail(dynamic_cast<ResultViewGrid*>(object), NULL);
1953+
1954+ accessible = ATK_OBJECT(g_object_new(UNITY_TYPE_RVGRID_ACCESSIBLE, NULL));
1955+
1956+ atk_object_initialize(accessible, object);
1957+
1958+ return accessible;
1959+}
1960+
1961+/* AtkObject.h */
1962+static void
1963+check_selection(UnityRvgridAccessible* self)
1964+{
1965+ AtkObject* child = NULL;
1966+ gint index = 0;
1967+ ResultView::ResultList result_list;
1968+ Result* result;
1969+ nux::Object* object = NULL;
1970+ ResultViewGrid* rvgrid = NULL;
1971+ std::string name;
1972+
1973+ /* we don't notify until the grid is focused */
1974+ if (self->priv->focused == FALSE)
1975+ return;
1976+
1977+ object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(self));
1978+ if (!object) /* state is defunct */
1979+ return;
1980+
1981+ rvgrid = dynamic_cast<ResultViewGrid*>(object);
1982+
1983+ result_list = rvgrid->GetResultList();
1984+ index = rvgrid->GetSelectedIndex();
1985+
1986+ if (index >= 0)
1987+ {
1988+ result = &result_list[index];
1989+ name = result->name;
1990+
1991+ child = ATK_OBJECT(self->priv->result);
1992+ self->priv->has_selection = TRUE;
1993+ atk_object_set_name(child, name.c_str());
1994+ }
1995+ else
1996+ {
1997+ child = NULL;
1998+ self->priv->has_selection = FALSE;
1999+ }
2000+
2001+ g_signal_emit_by_name(self, "active-descendant-changed", child);
2002+ g_signal_emit_by_name(self, "selection-changed");
2003+}
2004+
2005+static void
2006+on_selection_change_cb(UnityRvgridAccessible* self)
2007+{
2008+ check_selection(self);
2009+}
2010+
2011+static void
2012+search_for_label(UnityRvgridAccessible* self)
2013+{
2014+ AtkObject* label_accessible = NULL;
2015+ nux::Object* nux_object = NULL;
2016+ unity::PlacesGroup* group = NULL;
2017+ AtkObject* iter = NULL;
2018+ nux::StaticCairoText* label = NULL;
2019+
2020+ /* Search for the places group */
2021+ for (iter = atk_object_get_parent(ATK_OBJECT(self)); iter != NULL;
2022+ iter = atk_object_get_parent(iter))
2023+ {
2024+ if (UNITY_IS_PLACES_GROUP_ACCESSIBLE(iter))
2025+ break;
2026+ }
2027+ if (iter == NULL)
2028+ return;
2029+
2030+ nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(iter));
2031+ group = dynamic_cast<unity::PlacesGroup*>(nux_object);
2032+
2033+ if (group == NULL)
2034+ return;
2035+
2036+ label = group->GetLabel();
2037+
2038+ label_accessible = unity_a11y_get_accessible(label);
2039+
2040+ if (label_accessible == NULL)
2041+ return;
2042+
2043+ /* FIXME: I had a froze using relations, require further
2044+ investigation, meanwhile setting directly the name can do the
2045+ work*/
2046+ atk_object_set_name(ATK_OBJECT(self), atk_object_get_name(label_accessible));
2047+}
2048+
2049+static gboolean
2050+check_selection_on_idle(gpointer data)
2051+{
2052+ check_selection(UNITY_RVGRID_ACCESSIBLE(data));
2053+
2054+ return FALSE;
2055+}
2056+
2057+static void
2058+on_focus_event_cb(AtkObject* object,
2059+ gboolean in,
2060+ gpointer data)
2061+{
2062+ UnityRvgridAccessible* self = NULL;
2063+
2064+ g_return_if_fail(UNITY_IS_RVGRID_ACCESSIBLE(data));
2065+
2066+ self = UNITY_RVGRID_ACCESSIBLE(data);
2067+ self->priv->focused = in;
2068+
2069+ /* we check the selection stuff again, to report the selection
2070+ change now */
2071+ g_idle_add(check_selection_on_idle, self);
2072+}
2073+
2074+static void
2075+unity_rvgrid_accessible_initialize(AtkObject* accessible,
2076+ gpointer data)
2077+{
2078+ UnityRvgridAccessible* self = NULL;
2079+ ResultViewGrid* rvgrid = NULL;
2080+ nux::Object* nux_object = NULL;
2081+
2082+ ATK_OBJECT_CLASS(unity_rvgrid_accessible_parent_class)->initialize(accessible, data);
2083+
2084+ atk_object_set_role(accessible, ATK_ROLE_TOOL_BAR);
2085+
2086+ self = UNITY_RVGRID_ACCESSIBLE(accessible);
2087+ nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(accessible));
2088+
2089+ rvgrid = dynamic_cast<ResultViewGrid*>(nux_object);
2090+
2091+ if (rvgrid == NULL)
2092+ return;
2093+
2094+ self->priv->on_selection_change_connection =
2095+ rvgrid->selection_change.connect(sigc::bind(sigc::ptr_fun(on_selection_change_cb), self));
2096+
2097+ g_signal_connect(self, "focus-event",
2098+ G_CALLBACK(on_focus_event_cb), self);
2099+
2100+ self->priv->result = UNITY_RESULT_ACCESSIBLE(unity_result_accessible_new());
2101+ atk_object_set_parent(ATK_OBJECT(self->priv->result), ATK_OBJECT(self));
2102+
2103+ search_for_label(self);
2104+}
2105+
2106+static gint
2107+unity_rvgrid_accessible_get_n_children(AtkObject* obj)
2108+{
2109+ g_return_val_if_fail(UNITY_IS_RVGRID_ACCESSIBLE(obj), 0);
2110+
2111+ /* we have the state MANAGES_DESCENDANT, clients should not ask for
2112+ the children, and just taking care of the relevant signals. So we
2113+ just don't expose the children */
2114+ return 0;
2115+}
2116+
2117+static AtkObject*
2118+unity_rvgrid_accessible_ref_child(AtkObject* obj,
2119+ gint i)
2120+{
2121+ g_return_val_if_fail(UNITY_IS_RVGRID_ACCESSIBLE(obj), NULL);
2122+
2123+ /* we have the state MANAGES_DESCENDANT, clients should not ask for
2124+ the children, and just taking care of the relevant signals. So we
2125+ just don't expose the children */
2126+ return NULL;
2127+}
2128+
2129+static AtkStateSet*
2130+unity_rvgrid_accessible_ref_state_set(AtkObject* obj)
2131+{
2132+ AtkStateSet* state_set = NULL;
2133+ nux::Object* nux_object = NULL;
2134+
2135+ g_return_val_if_fail(UNITY_IS_RVGRID_ACCESSIBLE(obj), NULL);
2136+
2137+ state_set = ATK_OBJECT_CLASS(unity_rvgrid_accessible_parent_class)->ref_state_set(obj);
2138+
2139+ nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(obj));
2140+
2141+ if (nux_object == NULL) /* defunct */
2142+ return state_set;
2143+
2144+ atk_state_set_add_state(state_set, ATK_STATE_MANAGES_DESCENDANTS);
2145+
2146+ return state_set;
2147+}
2148+
2149+
2150+/* AtkSelection */
2151+static void
2152+atk_selection_interface_init(AtkSelectionIface* iface)
2153+{
2154+ iface->ref_selection = unity_rvgrid_accessible_ref_selection;
2155+ iface->get_selection_count = unity_rvgrid_accessible_get_selection_count;
2156+ iface->is_child_selected = unity_rvgrid_accessible_is_child_selected;
2157+
2158+ /* NOTE: for the moment we don't provide the implementation for the
2159+ "interactable" methods, it is, the methods that allow to change
2160+ the selected icon. The Rvgrid doesn't provide that API, and
2161+ right now we are focusing on a normal user input.*/
2162+ /* iface->add_selection = unity_rvgrid_accessible_add_selection; */
2163+ /* iface->clear_selection = unity_rvgrid_accessible_clear_selection; */
2164+ /* iface->remove_selection = unity_rvgrid_accessible_remove_selection; */
2165+
2166+ /* This method will never be implemented, as select all the rvgrid
2167+ icons makes no sense */
2168+ /* iface->select_all = unity_rvgrid_accessible_select_all_selection; */
2169+}
2170+
2171+static AtkObject*
2172+unity_rvgrid_accessible_ref_selection(AtkSelection* selection,
2173+ gint i)
2174+{
2175+ UnityRvgridAccessible* self = NULL;
2176+
2177+ g_return_val_if_fail(UNITY_IS_RVGRID_ACCESSIBLE(selection), NULL);
2178+
2179+ self = UNITY_RVGRID_ACCESSIBLE(selection);
2180+
2181+ if (self->priv->has_selection)
2182+ return ATK_OBJECT(g_object_ref(self->priv->result));
2183+ else
2184+ return NULL;
2185+}
2186+
2187+static gint
2188+unity_rvgrid_accessible_get_selection_count(AtkSelection* selection)
2189+{
2190+ UnityRvgridAccessible* self = NULL;
2191+
2192+ g_return_val_if_fail(UNITY_IS_RVGRID_ACCESSIBLE(selection), 0);
2193+
2194+ self = UNITY_RVGRID_ACCESSIBLE(selection);
2195+
2196+ if (self->priv->has_selection)
2197+ return 0;
2198+ else
2199+ return 1;
2200+}
2201+
2202+static gboolean
2203+unity_rvgrid_accessible_is_child_selected(AtkSelection* selection,
2204+ gint i)
2205+{
2206+ UnityRvgridAccessible* self = NULL;
2207+
2208+ g_return_val_if_fail(UNITY_IS_RVGRID_ACCESSIBLE(selection), FALSE);
2209+
2210+ self = UNITY_RVGRID_ACCESSIBLE(selection);
2211+
2212+ if (self->priv->has_selection && i == 0)
2213+ return TRUE;
2214+ else
2215+ return FALSE;
2216+}
2217
2218=== added file 'plugins/unityshell/src/unity-rvgrid-accessible.h'
2219--- plugins/unityshell/src/unity-rvgrid-accessible.h 1970-01-01 00:00:00 +0000
2220+++ plugins/unityshell/src/unity-rvgrid-accessible.h 2011-11-07 19:15:28 +0000
2221@@ -0,0 +1,57 @@
2222+/*
2223+ * Copyright (C) 2011 Canonical Ltd
2224+ *
2225+ * This program is free software: you can redistribute it and/or modify
2226+ * it under the terms of the GNU General Public License version 3 as
2227+ * published by the Free Software Foundation.
2228+ *
2229+ * This program is distributed in the hope that it will be useful,
2230+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2231+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2232+ * GNU General Public License for more details.
2233+ *
2234+ * You should have received a copy of the GNU General Public License
2235+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2236+ *
2237+ * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
2238+ */
2239+
2240+#ifndef UNITY_RVGRID_ACCESSIBLE_H
2241+#define UNITY_RVGRID_ACCESSIBLE_H
2242+
2243+#include <atk/atk.h>
2244+
2245+#include "nux-view-accessible.h"
2246+
2247+G_BEGIN_DECLS
2248+
2249+#define UNITY_TYPE_RVGRID_ACCESSIBLE (unity_rvgrid_accessible_get_type ())
2250+#define UNITY_RVGRID_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_RVGRID_ACCESSIBLE, UnityRvgridAccessible))
2251+#define UNITY_RVGRID_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_RVGRID_ACCESSIBLE, UnityRvgridAccessibleClass))
2252+#define UNITY_IS_RVGRID_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_RVGRID_ACCESSIBLE))
2253+#define UNITY_IS_RVGRID_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_RVGRID_ACCESSIBLE))
2254+#define UNITY_RVGRID_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_RVGRID_ACCESSIBLE, UnityRvgridAccessibleClass))
2255+
2256+typedef struct _UnityRvgridAccessible UnityRvgridAccessible;
2257+typedef struct _UnityRvgridAccessibleClass UnityRvgridAccessibleClass;
2258+typedef struct _UnityRvgridAccessiblePrivate UnityRvgridAccessiblePrivate;
2259+
2260+struct _UnityRvgridAccessible
2261+{
2262+ NuxViewAccessible parent;
2263+
2264+ /*< private >*/
2265+ UnityRvgridAccessiblePrivate* priv;
2266+};
2267+
2268+struct _UnityRvgridAccessibleClass
2269+{
2270+ NuxViewAccessibleClass parent_class;
2271+};
2272+
2273+GType unity_rvgrid_accessible_get_type(void);
2274+AtkObject* unity_rvgrid_accessible_new(nux::Object* object);
2275+
2276+G_END_DECLS
2277+
2278+#endif /* __UNITY_RVGRID_ACCESSIBLE_H__ */
2279
2280=== added file 'plugins/unityshell/src/unity-sctext-accessible.cpp'
2281--- plugins/unityshell/src/unity-sctext-accessible.cpp 1970-01-01 00:00:00 +0000
2282+++ plugins/unityshell/src/unity-sctext-accessible.cpp 2011-11-07 19:15:28 +0000
2283@@ -0,0 +1,157 @@
2284+/*
2285+ * Copyright (C) 2011 Canonical Ltd
2286+ *
2287+ * This program is free software: you can redistribute it and/or modify
2288+ * it under the terms of the GNU General Public License version 3 as
2289+ * published by the Free Software Foundation.
2290+ *
2291+ * This program is distributed in the hope that it will be useful,
2292+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2293+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2294+ * GNU General Public License for more details.
2295+ *
2296+ * You should have received a copy of the GNU General Public License
2297+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2298+ *
2299+ * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
2300+ */
2301+
2302+/**
2303+ * SECTION:unity-sctext-accessible
2304+ * @Title: UnitySctextAccessible
2305+ * @short_description: Implementation of the ATK interfaces for #StaticCairoText
2306+ * @see_also: StaticCairoText
2307+ *
2308+ * #UnitySctextAccessible implements the required ATK interfaces for
2309+ * #StaticCairoText, mainly exposing the text as his name, as this
2310+ * #object is mainly used as a label
2311+ *
2312+ */
2313+
2314+#include <glib/gi18n.h>
2315+
2316+#include "unity-sctext-accessible.h"
2317+
2318+#include "unitya11y.h"
2319+#include "StaticCairoText.h"
2320+
2321+/* GObject */
2322+static void unity_sctext_accessible_class_init(UnitySctextAccessibleClass* klass);
2323+static void unity_sctext_accessible_init(UnitySctextAccessible* self);
2324+
2325+/* AtkObject.h */
2326+static void unity_sctext_accessible_initialize(AtkObject* accessible,
2327+ gpointer data);
2328+static const gchar* unity_sctext_accessible_get_name(AtkObject* obj);
2329+
2330+G_DEFINE_TYPE(UnitySctextAccessible, unity_sctext_accessible, NUX_TYPE_VIEW_ACCESSIBLE);
2331+
2332+
2333+#define UNITY_SCTEXT_ACCESSIBLE_GET_PRIVATE(obj) \
2334+ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), UNITY_TYPE_SCTEXT_ACCESSIBLE, \
2335+ UnitySctextAccessiblePrivate))
2336+
2337+struct _UnitySctextAccessiblePrivate
2338+{
2339+ gchar* stripped_name;
2340+};
2341+
2342+
2343+static void
2344+unity_sctext_accessible_class_init(UnitySctextAccessibleClass* klass)
2345+{
2346+ GObjectClass* gobject_class = G_OBJECT_CLASS(klass);
2347+ AtkObjectClass* atk_class = ATK_OBJECT_CLASS(klass);
2348+
2349+ /* AtkObject */
2350+ atk_class->get_name = unity_sctext_accessible_get_name;
2351+ atk_class->initialize = unity_sctext_accessible_initialize;
2352+
2353+ g_type_class_add_private(gobject_class, sizeof(UnitySctextAccessiblePrivate));
2354+}
2355+
2356+static void
2357+unity_sctext_accessible_init(UnitySctextAccessible* self)
2358+{
2359+ UnitySctextAccessiblePrivate* priv =
2360+ UNITY_SCTEXT_ACCESSIBLE_GET_PRIVATE(self);
2361+
2362+ self->priv = priv;
2363+ priv->stripped_name = NULL;
2364+}
2365+
2366+AtkObject*
2367+unity_sctext_accessible_new(nux::Object* object)
2368+{
2369+ AtkObject* accessible = NULL;
2370+
2371+ g_return_val_if_fail(dynamic_cast<nux::StaticCairoText*>(object), NULL);
2372+
2373+ accessible = ATK_OBJECT(g_object_new(UNITY_TYPE_SCTEXT_ACCESSIBLE, NULL));
2374+
2375+ atk_object_initialize(accessible, object);
2376+
2377+ return accessible;
2378+}
2379+
2380+/* AtkObject.h */
2381+static void
2382+on_label_text_change_cb(nux::StaticCairoText* label, UnitySctextAccessible* self)
2383+{
2384+ g_object_notify(G_OBJECT(self), "accessible-name");
2385+}
2386+
2387+static void
2388+unity_sctext_accessible_initialize(AtkObject* accessible,
2389+ gpointer data)
2390+{
2391+ nux::Object* nux_object = NULL;
2392+ nux::StaticCairoText* label = NULL;
2393+
2394+ ATK_OBJECT_CLASS(unity_sctext_accessible_parent_class)->initialize(accessible, data);
2395+
2396+ atk_object_set_role(accessible, ATK_ROLE_LABEL);
2397+
2398+ nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(accessible));
2399+ label = dynamic_cast<nux::StaticCairoText*>(nux_object);
2400+
2401+ if (label == NULL) /* status defunct */
2402+ return;
2403+
2404+ label->sigTextChanged.connect(sigc::bind(sigc::ptr_fun(on_label_text_change_cb),
2405+ UNITY_SCTEXT_ACCESSIBLE(accessible)));
2406+}
2407+
2408+static const gchar*
2409+unity_sctext_accessible_get_name(AtkObject* obj)
2410+{
2411+ const gchar* name = NULL;
2412+ UnitySctextAccessible* self = NULL;
2413+
2414+ g_return_val_if_fail(UNITY_IS_SCTEXT_ACCESSIBLE(obj), NULL);
2415+ self = UNITY_SCTEXT_ACCESSIBLE(obj);
2416+
2417+ name = ATK_OBJECT_CLASS(unity_sctext_accessible_parent_class)->get_name(obj);
2418+ if (name == NULL)
2419+ {
2420+ nux::StaticCairoText* text = NULL;
2421+
2422+ if (self->priv->stripped_name != NULL)
2423+ {
2424+ g_free(self->priv->stripped_name);
2425+ self->priv->stripped_name = NULL;
2426+ }
2427+
2428+ text = dynamic_cast<nux::StaticCairoText*>(nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(obj)));
2429+ if (text != NULL)
2430+ {
2431+ name = text->GetText().GetTCharPtr();
2432+ pango_parse_markup(name, -1, 0, NULL,
2433+ &self->priv->stripped_name,
2434+ NULL, NULL);
2435+ name = self->priv->stripped_name;
2436+ }
2437+ }
2438+
2439+ return name;
2440+}
2441
2442=== added file 'plugins/unityshell/src/unity-sctext-accessible.h'
2443--- plugins/unityshell/src/unity-sctext-accessible.h 1970-01-01 00:00:00 +0000
2444+++ plugins/unityshell/src/unity-sctext-accessible.h 2011-11-07 19:15:28 +0000
2445@@ -0,0 +1,57 @@
2446+/*
2447+ * Copyright (C) 2011 Canonical Ltd
2448+ *
2449+ * This program is free software: you can redistribute it and/or modify
2450+ * it under the terms of the GNU General Public License version 3 as
2451+ * published by the Free Software Foundation.
2452+ *
2453+ * This program is distributed in the hope that it will be useful,
2454+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2455+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2456+ * GNU General Public License for more details.
2457+ *
2458+ * You should have received a copy of the GNU General Public License
2459+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2460+ *
2461+ * Authored by: Alejandro Piñeiro Iglesias <apinheiro@igalia.com>
2462+ */
2463+
2464+#ifndef UNITY_SCTEXT_ACCESSIBLE_H
2465+#define UNITY_SCTEXT_ACCESSIBLE_H
2466+
2467+#include <atk/atk.h>
2468+
2469+#include "nux-view-accessible.h"
2470+
2471+G_BEGIN_DECLS
2472+
2473+#define UNITY_TYPE_SCTEXT_ACCESSIBLE (unity_sctext_accessible_get_type ())
2474+#define UNITY_SCTEXT_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNITY_TYPE_SCTEXT_ACCESSIBLE, UnitySctextAccessible))
2475+#define UNITY_SCTEXT_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNITY_TYPE_SCTEXT_ACCESSIBLE, UnitySctextAccessibleClass))
2476+#define UNITY_IS_SCTEXT_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNITY_TYPE_SCTEXT_ACCESSIBLE))
2477+#define UNITY_IS_SCTEXT_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNITY_TYPE_SCTEXT_ACCESSIBLE))
2478+#define UNITY_SCTEXT_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNITY_TYPE_SCTEXT_ACCESSIBLE, UnitySctextAccessibleClass))
2479+
2480+typedef struct _UnitySctextAccessible UnitySctextAccessible;
2481+typedef struct _UnitySctextAccessibleClass UnitySctextAccessibleClass;
2482+typedef struct _UnitySctextAccessiblePrivate UnitySctextAccessiblePrivate;
2483+
2484+struct _UnitySctextAccessible
2485+{
2486+ NuxViewAccessible parent;
2487+
2488+ /*< private >*/
2489+ UnitySctextAccessiblePrivate* priv;
2490+};
2491+
2492+struct _UnitySctextAccessibleClass
2493+{
2494+ NuxViewAccessibleClass parent_class;
2495+};
2496+
2497+GType unity_sctext_accessible_get_type(void);
2498+AtkObject* unity_sctext_accessible_new(nux::Object* object);
2499+
2500+G_END_DECLS
2501+
2502+#endif /* __UNITY_SCTEXT_ACCESSIBLE_H__ */
2503
2504=== modified file 'plugins/unityshell/src/unity-search-bar-accessible.cpp'
2505--- plugins/unityshell/src/unity-search-bar-accessible.cpp 2011-08-08 20:35:24 +0000
2506+++ plugins/unityshell/src/unity-search-bar-accessible.cpp 2011-11-07 19:15:28 +0000
2507@@ -1,4 +1,3 @@
2508-#if 0
2509 /*
2510 * Copyright (C) 2011 Canonical Ltd
2511 *
2512@@ -21,7 +20,7 @@
2513 * SECTION:unity-search_bar-accessible
2514 * @Title: UnitySearchBarAccessible
2515 * @short_description: Implementation of the ATK interfaces for #SearchBar
2516- * @see_also: SearchBar
2517+ * @see_also: SearchBar at DashSearchBar.h
2518 *
2519 * #UnitySearchBarAccessible implements the required ATK interfaces for
2520 * #SearchBar, ie: exposing the different SearchBarIcon on the model as
2521@@ -34,7 +33,9 @@
2522 #include "unity-search-bar-accessible.h"
2523
2524 #include "unitya11y.h"
2525-#include "PlacesSearchBar.h"
2526+#include "DashSearchBar.h"
2527+
2528+using namespace unity::dash;
2529
2530 /* GObject */
2531 static void unity_search_bar_accessible_class_init(UnitySearchBarAccessibleClass* klass);
2532@@ -91,44 +92,60 @@
2533 {
2534 AtkObject* accessible = NULL;
2535
2536- g_return_val_if_fail(dynamic_cast<PlacesSearchBar*>(object), NULL);
2537+ g_return_val_if_fail(dynamic_cast<SearchBar*>(object), NULL);
2538
2539 accessible = ATK_OBJECT(g_object_new(UNITY_TYPE_SEARCH_BAR_ACCESSIBLE, NULL));
2540
2541 atk_object_initialize(accessible, object);
2542- atk_object_set_name(accessible, _("Search Bar"));
2543
2544 return accessible;
2545 }
2546
2547 /* AtkObject.h */
2548 static void
2549+on_search_hint_change_cb(std::string const& s, UnitySearchBarAccessible* self)
2550+{
2551+ SearchBar* search_bar = NULL;
2552+ nux::TextEntry* text_entry = NULL;
2553+ AtkObject* text_entry_accessible = NULL;
2554+ nux::Object* nux_object = NULL;
2555+
2556+ g_return_if_fail(UNITY_IS_SEARCH_BAR_ACCESSIBLE(self));
2557+
2558+ nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(self));
2559+ search_bar = dynamic_cast<SearchBar*>(nux_object);
2560+
2561+ if (search_bar == NULL) /* state defunct */
2562+ return;
2563+
2564+ text_entry = search_bar->text_entry();
2565+
2566+ if (text_entry != NULL)
2567+ {
2568+ text_entry_accessible = unity_a11y_get_accessible(text_entry);
2569+ atk_object_set_name(text_entry_accessible, s.c_str());
2570+ }
2571+}
2572+
2573+
2574+static void
2575 unity_search_bar_accessible_initialize(AtkObject* accessible,
2576 gpointer data)
2577 {
2578 nux::Object* nux_object = NULL;
2579- PlacesSearchBar* search_bar = NULL;
2580- nux::TextEntry* text_entry = NULL;
2581+ SearchBar* search_bar = NULL;
2582+ // nux::TextEntry* text_entry = NULL;
2583
2584 ATK_OBJECT_CLASS(unity_search_bar_accessible_parent_class)->initialize(accessible, data);
2585
2586 accessible->role = ATK_ROLE_PANEL;
2587
2588 nux_object = nux_object_accessible_get_object(NUX_OBJECT_ACCESSIBLE(accessible));
2589- search_bar = dynamic_cast<PlacesSearchBar*>(nux_object);
2590-
2591- text_entry = search_bar->GetTextEntry();
2592-
2593- if (text_entry != NULL)
2594- {
2595- AtkObject* atk_object = unity_a11y_get_accessible(text_entry);
2596-
2597- /* FIXME: this is the general search bar, but right now it is
2598- only supported the Run Command dialog. When a full Places
2599- support is finished, this would change */
2600-
2601- atk_object_set_name(atk_object, _("Run Command Search Entry"));
2602- }
2603+ search_bar = dynamic_cast<SearchBar*>(nux_object);
2604+
2605+ if (search_bar == NULL)
2606+ return;
2607+
2608+ search_bar->search_hint.changed.connect(sigc::bind(sigc::ptr_fun(on_search_hint_change_cb),
2609+ UNITY_SEARCH_BAR_ACCESSIBLE(accessible)));
2610 }
2611-
2612-#endif
2613
2614=== modified file 'plugins/unityshell/src/unity-search-bar-accessible.h'
2615--- plugins/unityshell/src/unity-search-bar-accessible.h 2011-08-08 20:35:24 +0000
2616+++ plugins/unityshell/src/unity-search-bar-accessible.h 2011-11-07 19:15:28 +0000
2617@@ -1,5 +1,3 @@
2618-#if 0
2619-
2620 /*
2621 * Copyright (C) 2011 Canonical Ltd
2622 *
2623@@ -57,5 +55,3 @@
2624 G_END_DECLS
2625
2626 #endif /* __UNITY_SEARCH_BAR_ACCESSIBLE_H__ */
2627-
2628-#endif
2629
2630=== modified file 'plugins/unityshell/src/unity-util-accessible.cpp'
2631--- plugins/unityshell/src/unity-util-accessible.cpp 2011-08-19 15:17:30 +0000
2632+++ plugins/unityshell/src/unity-util-accessible.cpp 2011-11-07 19:15:28 +0000
2633@@ -446,17 +446,6 @@
2634 }
2635
2636 /* Public */
2637-AtkObject*
2638-unity_util_accessible_add_window(nux::BaseWindow* window)
2639-{
2640- AtkObject* atk_obj = NULL;
2641-
2642- atk_obj = unity_root_accessible_add_window
2643- (UNITY_ROOT_ACCESSIBLE(unity_util_accessible_get_root()), window);
2644-
2645- return atk_obj;
2646-}
2647-
2648 void
2649 unity_util_accessible_set_window_thread(nux::WindowThread* wt)
2650 {
2651
2652=== modified file 'plugins/unityshell/src/unity-util-accessible.h'
2653--- plugins/unityshell/src/unity-util-accessible.h 2011-09-06 18:30:26 +0000
2654+++ plugins/unityshell/src/unity-util-accessible.h 2011-11-07 19:15:28 +0000
2655@@ -52,7 +52,6 @@
2656
2657 GType unity_util_accessible_get_type(void);
2658
2659-AtkObject* unity_util_accessible_add_window(nux::BaseWindow* window);
2660 void unity_util_accessible_set_window_thread(nux::WindowThread* wt);
2661
2662 G_END_DECLS
2663
2664=== modified file 'plugins/unityshell/src/unitya11y.cpp'
2665--- plugins/unityshell/src/unitya11y.cpp 2011-10-06 04:18:36 +0000
2666+++ plugins/unityshell/src/unitya11y.cpp 2011-11-07 19:15:28 +0000
2667@@ -29,6 +29,7 @@
2668 #include "nux-view-accessible.h"
2669 #include "nux-base-window-accessible.h"
2670 #include "nux-layout-accessible.h"
2671+#include "nux-text-entry-accessible.h"
2672
2673 /* unity accessible objects */
2674 #include "Launcher.h"
2675@@ -36,11 +37,17 @@
2676 #include "SimpleLauncherIcon.h"
2677 #include "PanelView.h"
2678 #include "DashView.h"
2679+#include "PlacesSimpleTile.h"
2680+#include "PlacesGroup.h"
2681 #include "unity-launcher-accessible.h"
2682 #include "unity-launcher-icon-accessible.h"
2683 #include "unity-panel-view-accessible.h"
2684-#include "unity-places-view-accessible.h"
2685+#include "unity-dash-view-accessible.h"
2686 #include "unity-search-bar-accessible.h"
2687+#include "unity-sctext-accessible.h"
2688+#include "unity-rvgrid-accessible.h"
2689+#include "unity-places-simple-tile-accessible.h"
2690+#include "unity-places-group-accessible.h"
2691
2692 using namespace unity;
2693 using namespace unity::dash;
2694@@ -203,7 +210,7 @@
2695
2696 if (a11y_invoke_module(bridge_path))
2697 {
2698- g_debug("Unity accessibility started, using bridge on %s",
2699+ g_debug("Unity Oneiric accessibility started, using bridge on %s",
2700 bridge_path);
2701 a11y_initialized = TRUE;
2702 }
2703@@ -266,13 +273,27 @@
2704 return unity_panel_view_accessible_new(object);
2705
2706 if (object->Type().IsDerivedFromType(DashView::StaticObjectType))
2707- return unity_places_view_accessible_new(object);
2708-
2709-
2710- //FIXME:if (object->Type().IsDerivedFromType(PlacesSearchBar::StaticObjectType))
2711- //return unity_search_bar_accessible_new(object);
2712+ return unity_dash_view_accessible_new(object);
2713+
2714+ if (object->Type().IsDerivedFromType(PlacesSimpleTile::StaticObjectType))
2715+ return unity_places_simple_tile_accessible_new(object);
2716+
2717+ if (object->Type().IsDerivedFromType(PlacesGroup::StaticObjectType))
2718+ return unity_places_group_accessible_new(object);
2719+
2720+ if (object->Type().IsDerivedFromType(nux::StaticCairoText::StaticObjectType))
2721+ return unity_sctext_accessible_new(object);
2722+
2723+ if (object->Type().IsDerivedFromType(unity::dash::ResultViewGrid::StaticObjectType))
2724+ return unity_rvgrid_accessible_new(object);
2725+
2726+ if (object->Type().IsDerivedFromType(unity::dash::SearchBar::StaticObjectType))
2727+ return unity_search_bar_accessible_new(object);
2728
2729 /* NUX classes */
2730+ if (object->Type().IsDerivedFromType(nux::TextEntry::StaticObjectType))
2731+ return nux_text_entry_accessible_new(object);
2732+
2733 if (object->Type().IsDerivedFromType(nux::BaseWindow::StaticObjectType))
2734 return nux_base_window_accessible_new(object);
2735
2736
2737=== modified file 'plugins/unityshell/src/unityshell.cpp'
2738--- plugins/unityshell/src/unityshell.cpp 2011-10-28 04:06:29 +0000
2739+++ plugins/unityshell/src/unityshell.cpp 2011-11-07 19:15:28 +0000
2740@@ -2395,13 +2395,6 @@
2741 Launcher& launcher = launcher_controller_->launcher();
2742 launcher.hidden_changed.connect(sigc::mem_fun(this, &UnityScreen::OnLauncherHiddenChanged));
2743 AddChild(&launcher);
2744- /* FIXME: this should not be manual, should be managed with a
2745- show/hide callback like in GAIL*/
2746- if (unity_a11y_initialized())
2747- {
2748- AtkObject *atk_obj = unity_util_accessible_add_window(launcher.GetParent());
2749- atk_object_set_name(atk_obj, _("Launcher"));
2750- }
2751
2752 switcher_controller_.reset(new switcher::Controller());
2753