1
cvs diff: Diffing fpicker
2
cvs diff: Diffing fpicker/prj
3
cvs diff: Diffing fpicker/source
4
cvs diff: Diffing fpicker/source/generic
5
cvs diff: Diffing fpicker/source/office
6
cvs diff: Diffing fpicker/source/unx
7
cvs diff: Diffing fpicker/source/unx/gnome
8
Index: fpicker/source/unx/gnome/FPentry.cxx
9
===================================================================
10
RCS file: /cvs/gsl/fpicker/source/unx/gnome/FPentry.cxx,v
11
retrieving revision 1.4
12
retrieving revision 1.4.26.1
13
diff -u -p -r1.4 -r1.4.26.1
14
--- fpicker/source/unx/gnome/FPentry.cxx 8 Sep 2005 23:34:31 -0000 1.4
15
+++ fpicker/source/unx/gnome/FPentry.cxx 7 Dec 2005 14:37:07 -0000 1.4.26.1
16
@@ -158,8 +158,7 @@ void* SAL_CALL component_getFactory(
19
/* crude gtkplug check */ !g_type_from_name( "GdkDisplay" ) ||
20
- /* old version */ !( gtk_major_version >= 2 && gtk_minor_version >= 4 ) ||
21
- /* #i42429# */ Application::GetSettings().GetMiscSettings().GetEnableATToolSupport()
22
+ /* old version */ !( gtk_major_version >= 2 && gtk_minor_version >= 4 )
26
cvs diff: Diffing fpicker/source/win32
27
cvs diff: Diffing fpicker/source/win32/filepicker
28
cvs diff: Diffing fpicker/source/win32/filepicker/workbench
29
cvs diff: Diffing fpicker/source/win32/folderpicker
30
cvs diff: Diffing fpicker/source/win32/folderpicker/workbench
31
cvs diff: Diffing fpicker/source/win32/misc
32
cvs diff: Diffing fpicker/util
33
cvs diff: Diffing svtools
34
cvs diff: Diffing svtools/bmpmaker
35
cvs diff: Diffing svtools/inc
36
cvs diff: Diffing svtools/inc/svtools
37
cvs diff: Diffing svtools/prj
38
cvs diff: Diffing svtools/qa
39
cvs diff: Diffing svtools/qa/unoapi
40
cvs diff: Diffing svtools/source
41
cvs diff: Diffing svtools/source/Accessibility
42
Index: svtools/source/Accessibility/accessibleiconchoicectrlentry.cxx
43
===================================================================
44
RCS file: /cvs/util/svtools/source/Accessibility/accessibleiconchoicectrlentry.cxx,v
45
retrieving revision 1.16
46
retrieving revision 1.15.106.2
47
diff -u -p -r1.16 -r1.15.106.2
48
--- svtools/source/Accessibility/accessibleiconchoicectrlentry.cxx 31 Jan 2006 18:46:28 -0000 1.16
49
+++ svtools/source/Accessibility/accessibleiconchoicectrlentry.cxx 6 Feb 2006 10:26:28 -0000 1.15.106.2
50
@@ -441,6 +441,7 @@ throw(RuntimeException)
51
pStateSetHelper->AddState( AccessibleStateType::TRANSIENT );
52
pStateSetHelper->AddState( AccessibleStateType::SELECTABLE );
53
pStateSetHelper->AddState( AccessibleStateType::ENABLED );
54
+ pStateSetHelper->AddState( AccessibleStateType::SENSITIVE );
55
if ( IsShowing_Impl() )
57
pStateSetHelper->AddState( AccessibleStateType::SHOWING );
58
Index: svtools/source/Accessibility/accessiblelistboxentry.cxx
59
===================================================================
60
RCS file: /cvs/util/svtools/source/Accessibility/accessiblelistboxentry.cxx,v
61
retrieving revision 1.25
62
retrieving revision 1.25.106.1
63
diff -u -p -r1.25 -r1.25.106.1
64
--- svtools/source/Accessibility/accessiblelistboxentry.cxx 8 Sep 2005 14:25:58 -0000 1.25
65
+++ svtools/source/Accessibility/accessiblelistboxentry.cxx 6 Dec 2005 08:41:55 -0000 1.25.106.1
66
@@ -503,6 +503,7 @@ namespace svt
67
pStateSetHelper->AddState( AccessibleStateType::TRANSIENT );
68
pStateSetHelper->AddState( AccessibleStateType::SELECTABLE );
69
pStateSetHelper->AddState( AccessibleStateType::ENABLED );
70
+ pStateSetHelper->AddState( AccessibleStateType::SENSITIVE );
71
if ( getListBox()->IsInplaceEditingEnabled() )
72
pStateSetHelper->AddState( AccessibleStateType::EDITABLE );
73
if ( IsShowing_Impl() )
74
Index: svtools/source/Accessibility/accessibletabbar.cxx
75
===================================================================
76
RCS file: /cvs/util/svtools/source/Accessibility/accessibletabbar.cxx,v
77
retrieving revision 1.12
78
retrieving revision 1.11.84.2
79
diff -u -p -r1.12 -r1.11.84.2
80
--- svtools/source/Accessibility/accessibletabbar.cxx 31 Jan 2006 18:30:03 -0000 1.12
81
+++ svtools/source/Accessibility/accessibletabbar.cxx 6 Feb 2006 10:26:01 -0000 1.11.84.2
82
@@ -115,6 +115,8 @@ namespace svt
84
case VCLEVENT_WINDOW_ENABLED:
86
+ aNewValue <<= AccessibleStateType::SENSITIVE;
87
+ NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
88
aNewValue <<= AccessibleStateType::ENABLED;
89
NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
91
@@ -123,6 +125,8 @@ namespace svt
93
aOldValue <<= AccessibleStateType::ENABLED;
94
NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
95
+ aOldValue <<= AccessibleStateType::SENSITIVE;
96
+ NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
99
case VCLEVENT_WINDOW_GETFOCUS:
100
@@ -164,7 +168,10 @@ namespace svt
103
if ( m_pTabBar->IsEnabled() )
104
- rStateSet.AddState( AccessibleStateType::ENABLED );
106
+ rStateSet.AddState( AccessibleStateType::ENABLED );
107
+ rStateSet.AddState( AccessibleStateType::SENSITIVE );
110
rStateSet.AddState( AccessibleStateType::FOCUSABLE );
112
Index: svtools/source/Accessibility/accessibletabbarpage.cxx
113
===================================================================
114
RCS file: /cvs/util/svtools/source/Accessibility/accessibletabbarpage.cxx,v
115
retrieving revision 1.11
116
retrieving revision 1.10.106.2
117
diff -u -p -r1.11 -r1.10.106.2
118
--- svtools/source/Accessibility/accessibletabbarpage.cxx 31 Jan 2006 18:30:28 -0000 1.11
119
+++ svtools/source/Accessibility/accessibletabbarpage.cxx 6 Feb 2006 10:26:47 -0000 1.10.106.2
120
@@ -142,13 +142,21 @@ namespace svt
122
if ( m_bEnabled != bEnabled )
124
- Any aOldValue, aNewValue;
125
+ Any aOldValue[2], aNewValue[2];
127
- aOldValue <<= AccessibleStateType::ENABLED;
129
- aNewValue <<= AccessibleStateType::ENABLED;
131
+ aOldValue[0] <<= AccessibleStateType::SENSITIVE;
132
+ aOldValue[1] <<= AccessibleStateType::ENABLED;
137
+ aNewValue[0] <<= AccessibleStateType::ENABLED;
138
+ aNewValue[1] <<= AccessibleStateType::SENSITIVE;
140
m_bEnabled = bEnabled;
141
- NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
142
+ NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue[0], aNewValue[0] );
143
+ NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue[1], aNewValue[1] );
147
@@ -203,7 +211,10 @@ namespace svt
148
void AccessibleTabBarPage::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet )
152
rStateSet.AddState( AccessibleStateType::ENABLED );
153
+ rStateSet.AddState( AccessibleStateType::SENSITIVE );
156
rStateSet.AddState( AccessibleStateType::VISIBLE );
158
Index: svtools/source/Accessibility/accessibletabbarpagelist.cxx
159
===================================================================
160
RCS file: /cvs/util/svtools/source/Accessibility/accessibletabbarpagelist.cxx,v
161
retrieving revision 1.17
162
retrieving revision 1.16.72.2
163
diff -u -p -r1.17 -r1.16.72.2
164
--- svtools/source/Accessibility/accessibletabbarpagelist.cxx 31 Jan 2006 18:30:44 -0000 1.17
165
+++ svtools/source/Accessibility/accessibletabbarpagelist.cxx 6 Feb 2006 10:26:54 -0000 1.16.72.2
166
@@ -251,19 +251,21 @@ namespace svt
168
switch ( rVclWindowEvent.GetId() )
170
- case VCLEVENT_WINDOW_ENABLED:
171
+ case VCLEVENT_WINDOW_ENABLED:
173
- Any aOldValue, aNewValue;
174
- aNewValue <<= AccessibleStateType::ENABLED;
175
- NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
178
- case VCLEVENT_WINDOW_DISABLED:
180
- Any aOldValue, aNewValue;
181
- aOldValue <<= AccessibleStateType::ENABLED;
182
- NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
184
+ aNewValue <<= AccessibleStateType::SENSITIVE;
185
+ NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
186
+ aNewValue <<= AccessibleStateType::ENABLED;
187
+ NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
190
+ case VCLEVENT_WINDOW_DISABLED:
192
+ aOldValue <<= AccessibleStateType::ENABLED;
193
+ NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
194
+ aOldValue <<= AccessibleStateType::SENSITIVE;
195
+ NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
198
case VCLEVENT_WINDOW_SHOW:
200
@@ -395,7 +397,10 @@ namespace svt
203
if ( m_pTabBar->IsEnabled() )
204
- rStateSet.AddState( AccessibleStateType::ENABLED );
206
+ rStateSet.AddState( AccessibleStateType::ENABLED );
207
+ rStateSet.AddState( AccessibleStateType::SENSITIVE );
210
rStateSet.AddState( AccessibleStateType::VISIBLE );
212
Index: svtools/source/Accessibility/accessibletablistboxtable.cxx
213
===================================================================
214
RCS file: /cvs/util/svtools/source/Accessibility/accessibletablistboxtable.cxx,v
215
retrieving revision 1.8
216
retrieving revision 1.8.14.1
217
diff -u -p -r1.8 -r1.8.14.1
218
--- svtools/source/Accessibility/accessibletablistboxtable.cxx 6 Feb 2006 12:56:48 -0000 1.8
219
+++ svtools/source/Accessibility/accessibletablistboxtable.cxx 9 Mar 2006 12:01:53 -0000 1.8.14.1
220
@@ -106,8 +106,9 @@ namespace svt
224
- switch ( rVclWindowEvent.GetId() )
226
+ ULONG nEventId = rVclWindowEvent.GetId();
227
+ switch ( nEventId )
229
case VCLEVENT_OBJECT_DYING :
231
m_pTabListBox->RemoveEventListener( LINK( this, AccessibleTabListBoxTable, WindowEventListener ) );
232
@@ -115,7 +116,19 @@ namespace svt
236
- case VCLEVENT_LISTBOX_SELECT :
237
+ case VCLEVENT_CONTROL_GETFOCUS :
238
+ case VCLEVENT_CONTROL_LOSEFOCUS :
240
+ uno::Any aOldValue, aNewValue;
241
+ if ( VCLEVENT_CONTROL_GETFOCUS == nEventId )
242
+ aNewValue <<= AccessibleStateType::FOCUSED;
244
+ aOldValue <<= AccessibleStateType::FOCUSED;
245
+ commitEvent( AccessibleEventId::STATE_CHANGED, aNewValue, aOldValue );
249
+ case VCLEVENT_LISTBOX_SELECT :
251
// First send an event that tells the listeners of a
252
// modified selection. The active descendant event is
253
cvs diff: Diffing svtools/source/brwbox
254
Index: svtools/source/brwbox/brwbox3.cxx
255
===================================================================
256
RCS file: /cvs/util/svtools/source/brwbox/brwbox3.cxx,v
257
retrieving revision 1.16
258
retrieving revision 1.16.106.1
259
diff -u -p -r1.16 -r1.16.106.1
260
--- svtools/source/brwbox/brwbox3.cxx 8 Sep 2005 14:29:19 -0000 1.16
261
+++ svtools/source/brwbox/brwbox3.cxx 6 Dec 2005 11:50:53 -0000 1.16.106.1
262
@@ -357,7 +357,10 @@ void BrowseBox::FillAccessibleStateSet(
263
if ( GetUpdateMode() )
264
rStateSet.AddState( AccessibleStateType::EDITABLE );
267
rStateSet.AddState( AccessibleStateType::ENABLED );
268
+ rStateSet.AddState( AccessibleStateType::SENSITIVE );
270
if ( IsReallyVisible() )
271
rStateSet.AddState( AccessibleStateType::VISIBLE );
272
if ( eObjType == ::svt::BBTYPE_TABLE )
273
cvs diff: Diffing svtools/source/cmdparse
274
cvs diff: Diffing svtools/source/config
275
cvs diff: Diffing svtools/source/config/test
276
cvs diff: Diffing svtools/source/contnr
277
Index: svtools/source/contnr/svtabbx.cxx
278
===================================================================
279
RCS file: /cvs/util/svtools/source/contnr/svtabbx.cxx,v
280
retrieving revision 1.18
281
retrieving revision 1.16.106.3
282
diff -u -p -r1.18 -r1.16.106.3
283
--- svtools/source/contnr/svtabbx.cxx 6 Feb 2006 13:37:19 -0000 1.18
284
+++ svtools/source/contnr/svtabbx.cxx 16 Feb 2006 13:38:08 -0000 1.16.106.3
285
@@ -1206,7 +1206,10 @@ void SvHeaderTabListBox::FillAccessibleS
287
_rStateSet.AddState( AccessibleStateType::ACTIVE );
290
_rStateSet.AddState( AccessibleStateType::ENABLED );
291
+ _rStateSet.AddState( AccessibleStateType::SENSITIVE );
293
if ( IsReallyVisible() )
294
_rStateSet.AddState( AccessibleStateType::VISIBLE );
295
if ( _eType == ::svt::BBTYPE_TABLE )
296
cvs diff: Diffing svtools/source/control
297
Index: svtools/source/control/valueacc.cxx
298
===================================================================
299
RCS file: /cvs/util/svtools/source/control/valueacc.cxx,v
300
retrieving revision 1.17
301
retrieving revision 1.17.108.1
302
diff -u -p -r1.17 -r1.17.108.1
303
--- svtools/source/control/valueacc.cxx 8 Sep 2005 15:08:48 -0000 1.17
304
+++ svtools/source/control/valueacc.cxx 6 Dec 2005 11:50:54 -0000 1.17.108.1
305
@@ -319,6 +319,7 @@ uno::Reference< accessibility::XAccessib
308
pStateSet->AddState (accessibility::AccessibleStateType::ENABLED);
309
+ pStateSet->AddState (accessibility::AccessibleStateType::SENSITIVE);
310
pStateSet->AddState (accessibility::AccessibleStateType::SHOWING);
311
pStateSet->AddState (accessibility::AccessibleStateType::VISIBLE);
312
pStateSet->AddState (accessibility::AccessibleStateType::MANAGES_DESCENDANTS);
313
@@ -991,6 +992,7 @@ uno::Reference< accessibility::XAccessib
316
pStateSet->AddState (accessibility::AccessibleStateType::ENABLED);
317
+ pStateSet->AddState (accessibility::AccessibleStateType::SENSITIVE);
318
pStateSet->AddState (accessibility::AccessibleStateType::SHOWING);
319
pStateSet->AddState (accessibility::AccessibleStateType::VISIBLE);
320
pStateSet->AddState (accessibility::AccessibleStateType::TRANSIENT);
321
cvs diff: Diffing svtools/source/dialogs
322
cvs diff: Diffing svtools/source/edit
323
Index: svtools/source/edit/textwindowaccessibility.cxx
324
===================================================================
325
RCS file: /cvs/util/svtools/source/edit/textwindowaccessibility.cxx,v
326
retrieving revision 1.26
327
retrieving revision 1.24.104.3
328
diff -u -p -r1.26 -r1.24.104.3
329
--- svtools/source/edit/textwindowaccessibility.cxx 1 Feb 2006 14:40:09 -0000 1.26
330
+++ svtools/source/edit/textwindowaccessibility.cxx 6 Feb 2006 10:27:37 -0000 1.24.104.3
331
@@ -1421,6 +1421,8 @@ Document::retrieveParagraphNumber(Paragr
332
= (static_cast< ::sal_Int64 >(1)
333
<< ::css::accessibility::AccessibleStateType::ENABLED)
334
| (static_cast< ::sal_Int64 >(1)
335
+ << ::css::accessibility::AccessibleStateType::SENSITIVE)
336
+ | (static_cast< ::sal_Int64 >(1)
337
<< ::css::accessibility::AccessibleStateType::FOCUSABLE)
338
| (static_cast< ::sal_Int64 >(1)
339
<< ::css::accessibility::AccessibleStateType::MULTI_LINE);
340
cvs diff: Diffing svtools/source/filepicker
341
cvs diff: Diffing svtools/source/filerec
342
cvs diff: Diffing svtools/source/filter.vcl
343
cvs diff: Diffing svtools/source/filter.vcl/filter
344
cvs diff: Diffing svtools/source/filter.vcl/igif
345
cvs diff: Diffing svtools/source/filter.vcl/ixbm
346
cvs diff: Diffing svtools/source/filter.vcl/ixpm
347
cvs diff: Diffing svtools/source/filter.vcl/jpeg
348
cvs diff: Diffing svtools/source/filter.vcl/wmf
349
cvs diff: Diffing svtools/source/fsstor
350
cvs diff: Diffing svtools/source/hatchwindow
351
cvs diff: Diffing svtools/source/inc
352
cvs diff: Diffing svtools/source/items
353
cvs diff: Diffing svtools/source/items1
354
cvs diff: Diffing svtools/source/java
355
cvs diff: Diffing svtools/source/memtools
356
cvs diff: Diffing svtools/source/misc
357
cvs diff: Diffing svtools/source/misc1
358
cvs diff: Diffing svtools/source/notify
359
cvs diff: Diffing svtools/source/numbers
360
cvs diff: Diffing svtools/source/passwordcontainer
361
cvs diff: Diffing svtools/source/plugapp
362
cvs diff: Diffing svtools/source/productregistration
363
cvs diff: Diffing svtools/source/svdde
364
cvs diff: Diffing svtools/source/svhtml
365
cvs diff: Diffing svtools/source/svrtf
366
cvs diff: Diffing svtools/source/svsql
367
cvs diff: Diffing svtools/source/syslocale
368
cvs diff: Diffing svtools/source/undo
369
cvs diff: Diffing svtools/source/uno
370
cvs diff: Diffing svtools/source/urlobj
371
cvs diff: Diffing svtools/uno
372
cvs diff: Diffing svtools/unx
373
cvs diff: Diffing svtools/unx/inc
374
cvs diff: Diffing svtools/unx/source
375
cvs diff: Diffing svtools/unx/source/svdde
376
cvs diff: Diffing svtools/util
377
cvs diff: Diffing svtools/util/defs
378
Index: svtools/util/defs/wntmsci7
379
===================================================================
380
RCS file: svtools/util/defs/wntmsci7
381
diff -N svtools/util/defs/wntmsci7
382
--- toolkit/source/awt/accessiblemenubasecomponent.cxx 9 Sep 2005 13:01:15 -0000 1.21
383
+++ toolkit/source/awt/accessiblemenubasecomponent.cxx 5 Dec 2005 14:27:11 -0000 1.21.30.1
384
@@ -196,13 +196,20 @@ void OAccessibleMenuBaseComponent::SetEn
386
if ( m_bEnabled != bEnabled )
388
- Any aOldValue, aNewValue;
389
+ Any aOldValue[2], aNewValue[2];
391
- aOldValue <<= AccessibleStateType::ENABLED;
393
+ aOldValue[0] <<= AccessibleStateType::SENSITIVE;
394
+ aOldValue[1] <<= AccessibleStateType::ENABLED;
397
- aNewValue <<= AccessibleStateType::ENABLED;
399
+ aNewValue[0] <<= AccessibleStateType::ENABLED;
400
+ aNewValue[1] <<= AccessibleStateType::SENSITIVE;
402
m_bEnabled = bEnabled;
403
- NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
404
+ NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue[0], aNewValue[0] );
405
+ NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue[1], aNewValue[1] );
409
Index: toolkit/source/awt/accessiblemenucomponent.cxx
410
===================================================================
411
RCS file: /cvs/gsl/toolkit/source/awt/accessiblemenucomponent.cxx,v
412
retrieving revision 1.13
413
retrieving revision 1.13.32.1
414
diff -u -p -r1.13 -r1.13.32.1
415
--- toolkit/source/awt/accessiblemenucomponent.cxx 9 Sep 2005 13:01:32 -0000 1.13
416
+++ toolkit/source/awt/accessiblemenucomponent.cxx 5 Dec 2005 14:27:12 -0000 1.13.32.1
417
@@ -128,7 +128,10 @@ sal_Bool OAccessibleMenuComponent::IsSho
418
void OAccessibleMenuComponent::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet )
422
rStateSet.AddState( AccessibleStateType::ENABLED );
423
+ rStateSet.AddState( AccessibleStateType::SENSITIVE );
426
rStateSet.AddState( AccessibleStateType::FOCUSABLE );
428
Index: toolkit/source/awt/accessiblemenuitemcomponent.cxx
429
===================================================================
430
RCS file: /cvs/gsl/toolkit/source/awt/accessiblemenuitemcomponent.cxx,v
431
retrieving revision 1.14
432
retrieving revision 1.14.32.1
433
diff -u -p -r1.14 -r1.14.32.1
434
--- toolkit/source/awt/accessiblemenuitemcomponent.cxx 9 Sep 2005 13:01:57 -0000 1.14
435
+++ toolkit/source/awt/accessiblemenuitemcomponent.cxx 5 Dec 2005 14:27:12 -0000 1.14.32.1
436
@@ -274,7 +274,10 @@ void OAccessibleMenuItemComponent::SetIt
437
void OAccessibleMenuItemComponent::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet )
441
rStateSet.AddState( AccessibleStateType::ENABLED );
442
+ rStateSet.AddState( AccessibleStateType::SENSITIVE );
445
rStateSet.AddState( AccessibleStateType::VISIBLE );
447
Index: toolkit/source/awt/vclxaccessiblecomponent.cxx
448
===================================================================
449
RCS file: /cvs/gsl/toolkit/source/awt/vclxaccessiblecomponent.cxx,v
450
retrieving revision 1.53
451
retrieving revision 1.52.32.2
452
diff -u -p -r1.53 -r1.52.32.2
453
--- toolkit/source/awt/vclxaccessiblecomponent.cxx 31 Jan 2006 18:21:29 -0000 1.53
454
+++ toolkit/source/awt/vclxaccessiblecomponent.cxx 6 Feb 2006 10:28:37 -0000 1.52.32.2
455
@@ -391,12 +391,17 @@ void VCLXAccessibleComponent::ProcessWin
457
aNewValue <<= accessibility::AccessibleStateType::ENABLED;
458
NotifyAccessibleEvent( accessibility::AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
459
+ aNewValue <<= accessibility::AccessibleStateType::SENSITIVE;
460
+ NotifyAccessibleEvent( accessibility::AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
463
case VCLEVENT_WINDOW_DISABLED:
465
- aOldValue <<= accessibility::AccessibleStateType::ENABLED;
466
+ aOldValue <<= accessibility::AccessibleStateType::SENSITIVE;
467
NotifyAccessibleEvent( accessibility::AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
469
+ aOldValue <<= accessibility::AccessibleStateType::ENABLED;
470
+ NotifyAccessibleEvent( accessibility::AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
473
case VCLEVENT_WINDOW_MOVE:
474
@@ -510,7 +515,10 @@ void VCLXAccessibleComponent::FillAccess
477
if ( pWindow->IsEnabled() )
479
rStateSet.AddState( accessibility::AccessibleStateType::ENABLED );
480
+ rStateSet.AddState( accessibility::AccessibleStateType::SENSITIVE );
483
if ( pWindow->HasChildPathFocus() &&
484
( getAccessibleRole() == accessibility::AccessibleRole::FRAME ||
485
Index: toolkit/source/awt/vclxaccessiblelistitem.cxx
486
===================================================================
487
RCS file: /cvs/gsl/toolkit/source/awt/vclxaccessiblelistitem.cxx,v
488
retrieving revision 1.27
489
retrieving revision 1.27.32.1
490
diff -u -p -r1.27 -r1.27.32.1
491
--- toolkit/source/awt/vclxaccessiblelistitem.cxx 9 Sep 2005 13:06:59 -0000 1.27
492
+++ toolkit/source/awt/vclxaccessiblelistitem.cxx 5 Dec 2005 14:27:13 -0000 1.27.32.1
493
@@ -373,6 +373,7 @@ Reference< XAccessibleStateSet > SAL_CAL
494
pStateSetHelper->AddState( AccessibleStateType::TRANSIENT );
495
pStateSetHelper->AddState( AccessibleStateType::SELECTABLE );
496
pStateSetHelper->AddState( AccessibleStateType::ENABLED );
497
+ pStateSetHelper->AddState( AccessibleStateType::SENSITIVE );
499
pStateSetHelper->AddState( AccessibleStateType::SELECTED );
501
Index: toolkit/source/awt/vclxaccessiblemenuitem.cxx
502
===================================================================
503
RCS file: /cvs/gsl/toolkit/source/awt/vclxaccessiblemenuitem.cxx,v
504
retrieving revision 1.35
505
retrieving revision 1.35.32.1
506
diff -u -p -r1.35 -r1.35.32.1
507
--- toolkit/source/awt/vclxaccessiblemenuitem.cxx 9 Sep 2005 13:07:49 -0000 1.35
508
+++ toolkit/source/awt/vclxaccessiblemenuitem.cxx 16 Nov 2005 15:59:22 -0000 1.35.32.1
509
@@ -114,12 +114,8 @@ sal_Bool VCLXAccessibleMenuItem::IsHighl
511
sal_Bool bHighlighted = sal_False;
515
- sal_uInt16 nItemId = m_pParent->GetItemId( m_nItemPos );
516
- if ( nItemId == m_pParent->GetCurItemId() )
517
- bHighlighted = sal_True;
519
+ if ( m_pParent && m_pParent->IsHighlighted( m_nItemPos ) )
520
+ bHighlighted = sal_True;
524
Index: toolkit/source/awt/vclxaccessiblestatusbaritem.cxx
525
===================================================================
526
RCS file: /cvs/gsl/toolkit/source/awt/vclxaccessiblestatusbaritem.cxx,v
527
retrieving revision 1.6
528
retrieving revision 1.6.32.1
529
diff -u -p -r1.6 -r1.6.32.1
530
--- toolkit/source/awt/vclxaccessiblestatusbaritem.cxx 9 Sep 2005 13:09:29 -0000 1.6
531
+++ toolkit/source/awt/vclxaccessiblestatusbaritem.cxx 5 Dec 2005 14:27:13 -0000 1.6.32.1
532
@@ -203,6 +203,7 @@ void VCLXAccessibleStatusBarItem::SetIte
533
void VCLXAccessibleStatusBarItem::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet )
535
rStateSet.AddState( AccessibleStateType::ENABLED );
536
+ rStateSet.AddState( AccessibleStateType::SENSITIVE );
538
rStateSet.AddState( AccessibleStateType::VISIBLE );
540
Index: toolkit/source/awt/vclxaccessibletabpage.cxx
541
===================================================================
542
RCS file: /cvs/gsl/toolkit/source/awt/vclxaccessibletabpage.cxx,v
543
retrieving revision 1.17
544
retrieving revision 1.17.32.1
545
diff -u -p -r1.17 -r1.17.32.1
546
--- toolkit/source/awt/vclxaccessibletabpage.cxx 9 Sep 2005 13:09:58 -0000 1.17
547
+++ toolkit/source/awt/vclxaccessibletabpage.cxx 5 Dec 2005 14:27:14 -0000 1.17.32.1
548
@@ -228,6 +228,7 @@ void VCLXAccessibleTabPage::Update( bool
549
void VCLXAccessibleTabPage::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet )
551
rStateSet.AddState( AccessibleStateType::ENABLED );
552
+ rStateSet.AddState( AccessibleStateType::SENSITIVE );
554
rStateSet.AddState( AccessibleStateType::FOCUSABLE );
556
Index: toolkit/source/awt/vclxaccessibletoolboxitem.cxx
557
===================================================================
558
RCS file: /cvs/gsl/toolkit/source/awt/vclxaccessibletoolboxitem.cxx,v
559
retrieving revision 1.39
560
retrieving revision 1.38.32.2
561
diff -u -p -r1.39 -r1.38.32.2
562
--- toolkit/source/awt/vclxaccessibletoolboxitem.cxx 26 Jan 2006 17:54:59 -0000 1.39
563
+++ toolkit/source/awt/vclxaccessibletoolboxitem.cxx 30 Jan 2006 15:06:05 -0000 1.38.32.2
564
@@ -274,13 +274,21 @@ void VCLXAccessibleToolBoxItem::ToggleEn
568
- Any aOldValue, aNewValue;
569
+ Any aOldValue[2], aNewValue[2];
570
const XubString& sText = m_pToolBox->GetItemText( m_nItemId );
571
if ( m_pToolBox->IsItemEnabled( m_nItemId ) )
572
- aNewValue <<= AccessibleStateType::ENABLED;
574
+ aNewValue[0] <<= AccessibleStateType::SENSITIVE;
575
+ aNewValue[1] <<= AccessibleStateType::ENABLED;
578
- aOldValue <<= AccessibleStateType::ENABLED;
579
- NotifyAccessibleEvent( AccessibleEventId::NAME_CHANGED, aOldValue, aNewValue );
581
+ aOldValue[0] <<= AccessibleStateType::ENABLED;
582
+ aOldValue[1] <<= AccessibleStateType::SENSITIVE;
585
+ NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue[0], aNewValue[0] );
586
+ NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue[1], aNewValue[1] );
589
// -----------------------------------------------------------------------------
590
@@ -458,7 +466,10 @@ Reference< XAccessibleStateSet > SAL_CAL
591
if ( m_bIndeterminate )
592
pStateSetHelper->AddState( AccessibleStateType::INDETERMINATE );
593
if ( m_pToolBox->IsItemEnabled( m_nItemId ) )
595
pStateSetHelper->AddState( AccessibleStateType::ENABLED );
596
+ pStateSetHelper->AddState( AccessibleStateType::SENSITIVE );
598
if ( m_pToolBox->IsItemVisible( m_nItemId ) )
600
pStateSetHelper->AddState( AccessibleStateType::VISIBLE );
601
Index: toolkit/source/awt/vclxwindow.cxx
602
===================================================================
603
RCS file: /cvs/gsl/toolkit/source/awt/vclxwindow.cxx,v
604
retrieving revision 1.58
605
retrieving revision 1.57.10.2
606
diff -u -p -r1.58 -r1.57.10.2
607
--- toolkit/source/awt/vclxwindow.cxx 14 Mar 2006 10:53:33 -0000 1.58
608
+++ toolkit/source/awt/vclxwindow.cxx 22 Mar 2006 09:36:46 -0000 1.57.10.2
610
#ifndef _TOOLKIT_AWT_VCLXACCESSIBLETABPAGEWINDOW_HXX_
611
#include <toolkit/awt/vclxaccessibletabpagewindow.hxx>
613
+#ifndef _TOOLKIT_AWT_VCLXACCESSIBLEFIXEDTEXT_HXX_
614
+#include <toolkit/awt/vclxaccessiblefixedtext.hxx>
616
#ifndef _TOOLKIT_HELPER_MACROS_HXX_
617
#include <toolkit/helper/macros.hxx>
619
@@ -133,12 +136,15 @@
620
#include <toolkit/helper/solarrelease.hxx>
623
+using namespace ::com::sun::star;
625
using ::com::sun::star::style::VerticalAlignment;
626
using ::com::sun::star::style::VerticalAlignment_TOP;
627
using ::com::sun::star::style::VerticalAlignment_MIDDLE;
628
using ::com::sun::star::style::VerticalAlignment_BOTTOM;
629
using ::com::sun::star::style::VerticalAlignment_MAKE_FIXED_SIZE;
632
//#define SYNCHRON_NOTIFICATION
633
// define this for notifying mouse events synchronously when they happen
634
// disadvantage: potential of deadlocks, since this means that the
635
@@ -924,47 +930,51 @@ void VCLXWindow::ProcessWindowEvent( con
639
-::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > VCLXWindow::CreateAccessibleContext()
640
+uno::Reference< accessibility::XAccessibleContext > VCLXWindow::CreateAccessibleContext()
642
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > xContext;
643
+ uno::Reference< accessibility::XAccessibleContext > xContext;
645
- Window* pWindow = GetWindow();
648
- WindowType nType = pWindow->GetType();
649
+ Window* pWindow = GetWindow();
652
+ WindowType nType = pWindow->GetType();
654
- if ( nType == WINDOW_MENUBARWINDOW || pWindow->IsMenuFloatingWindow() || pWindow->IsToolbarFloatingWindow() )
656
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc( pWindow->GetAccessible() );
659
- ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > xCont( xAcc->getAccessibleContext() );
660
- if ( pWindow->GetType() == WINDOW_MENUBARWINDOW
661
- || ( xCont.is() && xCont->getAccessibleRole() == ::com::sun::star::accessibility::AccessibleRole::POPUP_MENU ) )
667
- else if ( nType == WINDOW_STATUSBAR )
669
- xContext = (::com::sun::star::accessibility::XAccessibleContext*) new VCLXAccessibleStatusBar( this );
671
- else if ( nType == WINDOW_TABCONTROL )
673
- xContext = (::com::sun::star::accessibility::XAccessibleContext*) new VCLXAccessibleTabControl( this );
675
+ if ( nType == WINDOW_MENUBARWINDOW || pWindow->IsMenuFloatingWindow() || pWindow->IsToolbarFloatingWindow() )
677
+ uno::Reference< accessibility::XAccessible > xAcc( pWindow->GetAccessible() );
680
+ uno::Reference< accessibility::XAccessibleContext > xCont( xAcc->getAccessibleContext() );
681
+ if ( pWindow->GetType() == WINDOW_MENUBARWINDOW ||
682
+ ( xCont.is() && xCont->getAccessibleRole() == accessibility::AccessibleRole::POPUP_MENU ) )
688
+ else if ( nType == WINDOW_STATUSBAR )
690
+ xContext = (accessibility::XAccessibleContext*) new VCLXAccessibleStatusBar( this );
692
+ else if ( nType == WINDOW_TABCONTROL )
694
+ xContext = (accessibility::XAccessibleContext*) new VCLXAccessibleTabControl( this );
696
else if ( nType == WINDOW_TABPAGE && pWindow->GetAccessibleParentWindow() && pWindow->GetAccessibleParentWindow()->GetType() == WINDOW_TABCONTROL )
698
- xContext = (::com::sun::star::accessibility::XAccessibleContext*) new VCLXAccessibleTabPageWindow( this );
699
+ xContext = (accessibility::XAccessibleContext*) new VCLXAccessibleTabPageWindow( this );
703
- xContext = (::com::sun::star::accessibility::XAccessibleContext*) new VCLXAccessibleComponent( this );
706
+ else if ( nType == WINDOW_HELPTEXTWINDOW )
708
+ xContext = (accessibility::XAccessibleContext*) new VCLXAccessibleFixedText( this );
712
+ xContext = (accessibility::XAccessibleContext*) new VCLXAccessibleComponent( this );
721
cvs diff: Diffing toolkit/source/controls
722
cvs diff: Diffing toolkit/source/helper
723
cvs diff: Diffing toolkit/test
724
cvs diff: Diffing toolkit/test/accessibility
725
cvs diff: Diffing toolkit/test/accessibility/ov
726
cvs diff: Diffing toolkit/test/accessibility/tools
727
cvs diff: Diffing toolkit/util
728
cvs diff: Diffing toolkit/util/defs
729
Index: toolkit/util/defs/wntmsci7
730
===================================================================
731
RCS file: toolkit/util/defs/wntmsci7
732
diff -N toolkit/util/defs/wntmsci7
733
--- sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx 6 Apr 2006 16:26:52 -0000 1.22
734
+++ sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx 13 Apr 2006 09:51:26 -0000 1.21.14.2
735
@@ -111,7 +111,7 @@ SlideSorterViewShell::SlideSorterViewShe
736
pWindow->SetUseDropScroll (false);
737
// Change the winbits so that the active window accepts the focus.
738
pWindow->SetStyle ((pWindow->GetStyle() & ~WB_DIALOGCONTROL) | WB_TABSTOP);
743
SetPool( &GetDoc()->GetPool() );
744
@@ -268,6 +268,8 @@ void SlideSorterViewShell::CreateModelVi
745
DBG_ASSERT (mpSlideSorterView.get()!=NULL,
746
"Can not create view for slide browser");
748
+ mpView = mpSlideSorterView.get();
750
mpSlideSorterController
751
= ::std::auto_ptr<controller::SlideSorterController>(
753
cvs diff: Diffing sd/source/ui/slidesorter/view
754
cvs diff: Diffing sd/source/ui/toolpanel
755
cvs diff: Diffing sd/source/ui/toolpanel/controls
756
cvs diff: Diffing sd/source/ui/tools
757
cvs diff: Diffing sd/source/ui/unoidl
758
cvs diff: Diffing sd/source/ui/view
759
cvs diff: Diffing sd/source/unotypes
760
cvs diff: Diffing sd/uiconfig
761
cvs diff: Diffing sd/uiconfig/sdraw
762
cvs diff: Diffing sd/uiconfig/sdraw/accelerator
763
cvs diff: Diffing sd/uiconfig/sdraw/accelerator/de
764
cvs diff: Diffing sd/uiconfig/sdraw/accelerator/en-GB
765
cvs diff: Diffing sd/uiconfig/sdraw/accelerator/en-US
766
cvs diff: Diffing sd/uiconfig/sdraw/accelerator/es
767
cvs diff: Diffing sd/uiconfig/sdraw/accelerator/fr
768
cvs diff: Diffing sd/uiconfig/sdraw/menubar
769
cvs diff: Diffing sd/uiconfig/sdraw/statusbar
770
cvs diff: Diffing sd/uiconfig/sdraw/toolbar
771
cvs diff: Diffing sd/uiconfig/simpress
772
cvs diff: Diffing sd/uiconfig/simpress/accelerator
773
cvs diff: Diffing sd/uiconfig/simpress/accelerator/de
774
cvs diff: Diffing sd/uiconfig/simpress/accelerator/en-GB
775
cvs diff: Diffing sd/uiconfig/simpress/accelerator/en-US
776
cvs diff: Diffing sd/uiconfig/simpress/accelerator/es
777
cvs diff: Diffing sd/uiconfig/simpress/accelerator/fr
778
cvs diff: Diffing sd/uiconfig/simpress/menubar
779
cvs diff: Diffing sd/uiconfig/simpress/statusbar
780
cvs diff: Diffing sd/uiconfig/simpress/toolbar
781
cvs diff: Diffing sd/util
782
cvs diff: Diffing sd/util/defs
783
Index: sd/util/defs/wntmsci8
784
===================================================================
785
RCS file: sd/util/defs/wntmsci8
786
diff -N sd/util/defs/wntmsci8
787
--- svx/source/accessibility/AccessibleContextBase.cxx 8 Sep 2005 20:13:15 -0000 1.21
788
+++ svx/source/accessibility/AccessibleContextBase.cxx 6 Dec 2005 11:51:38 -0000 1.21.172.1
789
@@ -108,6 +108,7 @@ AccessibleContextBase::AccessibleContext
790
if (pStateSet != NULL)
792
pStateSet->AddState (AccessibleStateType::ENABLED);
793
+ pStateSet->AddState (AccessibleStateType::SENSITIVE);
794
pStateSet->AddState (AccessibleStateType::SHOWING);
795
pStateSet->AddState (AccessibleStateType::VISIBLE);
796
pStateSet->AddState (AccessibleStateType::FOCUSABLE);
797
Index: svx/source/accessibility/AccessibleControlShape.cxx
798
===================================================================
799
RCS file: /cvs/graphics/svx/source/accessibility/AccessibleControlShape.cxx,v
800
retrieving revision 1.21
801
retrieving revision 1.21.168.1
802
diff -u -p -r1.21 -r1.21.168.1
803
--- svx/source/accessibility/AccessibleControlShape.cxx 8 Sep 2005 20:13:41 -0000 1.21
804
+++ svx/source/accessibility/AccessibleControlShape.cxx 6 Dec 2005 11:51:38 -0000 1.21.168.1
805
@@ -885,6 +885,7 @@ void AccessibleControlShape::initializeC
806
// we need to reset some states of the composed set, because they either do not apply
807
// for controls in alive mode, or are in the responsibility of the UNO-control, anyway
808
pComposedStates->RemoveState( AccessibleStateType::ENABLED ); // this is controlled by the UNO-control
809
+ pComposedStates->RemoveState( AccessibleStateType::SENSITIVE ); // this is controlled by the UNO-control
810
pComposedStates->RemoveState( AccessibleStateType::FOCUSABLE ); // this is controlled by the UNO-control
811
pComposedStates->RemoveState( AccessibleStateType::SELECTABLE ); // this does not hold for an alive UNO-control
812
#if OSL_DEBUG_LEVEL > 0
813
Index: svx/source/accessibility/AccessibleEditableTextPara.cxx
814
===================================================================
815
RCS file: /cvs/graphics/svx/source/accessibility/AccessibleEditableTextPara.cxx,v
816
retrieving revision 1.45
817
retrieving revision 1.43.172.3
818
diff -u -p -r1.45 -r1.43.172.3
819
--- svx/source/accessibility/AccessibleEditableTextPara.cxx 1 Feb 2006 14:59:29 -0000 1.45
820
+++ svx/source/accessibility/AccessibleEditableTextPara.cxx 6 Feb 2006 10:33:18 -0000 1.43.172.3
821
@@ -197,6 +197,7 @@ namespace accessibility
822
pStateSet->AddState( AccessibleStateType::VISIBLE );
823
pStateSet->AddState( AccessibleStateType::SHOWING );
824
pStateSet->AddState( AccessibleStateType::ENABLED );
825
+ pStateSet->AddState( AccessibleStateType::SENSITIVE );
827
catch( const uno::Exception& ) {}
829
Index: svx/source/accessibility/AccessibleFrameSelector.cxx
830
===================================================================
831
RCS file: /cvs/graphics/svx/source/accessibility/AccessibleFrameSelector.cxx,v
832
retrieving revision 1.3
833
retrieving revision 1.3.172.1
834
diff -u -p -r1.3 -r1.3.172.1
835
--- svx/source/accessibility/AccessibleFrameSelector.cxx 8 Sep 2005 20:15:10 -0000 1.3
836
+++ svx/source/accessibility/AccessibleFrameSelector.cxx 6 Dec 2005 11:51:38 -0000 1.3.172.1
837
@@ -292,7 +292,10 @@ Reference< XAccessibleStateSet > AccFram
838
pStateSetHelper->AddState(aStandardStates[nState++]);
840
if(mpFrameSel->IsEnabled())
842
pStateSetHelper->AddState(AccessibleStateType::ENABLED);
843
+ pStateSetHelper->AddState(AccessibleStateType::SENSITIVE);
846
sal_Bool bIsParent = meBorder == FRAMEBORDER_NONE;
847
if(mpFrameSel->HasFocus() &&
848
Index: svx/source/accessibility/AccessibleImageBullet.cxx
849
===================================================================
850
RCS file: /cvs/graphics/svx/source/accessibility/AccessibleImageBullet.cxx,v
851
retrieving revision 1.17
852
retrieving revision 1.17.172.1
853
diff -u -p -r1.17 -r1.17.172.1
854
--- svx/source/accessibility/AccessibleImageBullet.cxx 8 Sep 2005 20:15:49 -0000 1.17
855
+++ svx/source/accessibility/AccessibleImageBullet.cxx 6 Dec 2005 11:51:39 -0000 1.17.172.1
856
@@ -145,6 +145,7 @@ namespace accessibility
857
pStateSet->AddState( AccessibleStateType::VISIBLE );
858
pStateSet->AddState( AccessibleStateType::SHOWING );
859
pStateSet->AddState( AccessibleStateType::ENABLED );
860
+ pStateSet->AddState( AccessibleStateType::SENSITIVE );
862
catch( const uno::Exception& ) {}
864
Index: svx/source/accessibility/ChildrenManagerImpl.cxx
865
===================================================================
866
RCS file: /cvs/graphics/svx/source/accessibility/ChildrenManagerImpl.cxx,v
867
retrieving revision 1.33
868
retrieving revision 1.33.172.1
869
diff -u -p -r1.33 -r1.33.172.1
870
--- svx/source/accessibility/ChildrenManagerImpl.cxx 8 Sep 2005 20:20:26 -0000 1.33
871
+++ svx/source/accessibility/ChildrenManagerImpl.cxx 30 Mar 2006 08:27:45 -0000 1.33.172.1
872
@@ -537,34 +537,45 @@ void ChildrenManagerImpl::AddAccessibleS
874
void ChildrenManagerImpl::ClearAccessibleShapeList (void)
876
+ // Copy the list of (visible) shapes to local lists and clear the
878
+ ChildDescriptorListType aLocalVisibleChildren;
879
+ aLocalVisibleChildren.swap(maVisibleChildren);
880
+ AccessibleShapeList aLocalAccessibleShapes;
881
+ aLocalAccessibleShapes.swap(maAccessibleShapes);
883
+ // Tell the listeners that all children are gone.
884
+ mrContext.CommitChange (
885
+ AccessibleEventId::INVALIDATE_ALL_CHILDREN,
889
+ // There are no accessible shapes left so the index assigned to new
890
+ // accessible shapes can be reset.
891
+ mnNewNameIndex = 1;
893
+ // Now the objects in the local lists can be safely disposed without
894
+ // having problems with callers that want to update their child lists.
896
// Clear the list of visible accessible objects. Objects not created on
897
// demand for XShapes are treated below.
898
- ChildDescriptorListType::iterator I,aEnd = maVisibleChildren.end();
899
- for (I=maVisibleChildren.begin(); I != aEnd; ++I)
900
+ ChildDescriptorListType::iterator I,aEnd = aLocalVisibleChildren.end();
901
+ for (I=aLocalVisibleChildren.begin(); I != aEnd; ++I)
902
if ( I->mxAccessibleShape.is() && I->mxShape.is() )
903
- I->disposeAccessibleObject(mrContext);
905
- maVisibleChildren.clear ();
908
+ ::comphelper::disposeComponent(I->mxAccessibleShape);
909
+ I->mxAccessibleShape = NULL;
912
// Dispose all objects in the accessible shape list.
913
- AccessibleShapeList::iterator J,aEnd2 = maAccessibleShapes.end();
914
- for (J=maAccessibleShapes.begin(); J != aEnd2; ++J)
915
+ AccessibleShapeList::iterator J,aEnd2 = aLocalAccessibleShapes.end();
916
+ for (J=aLocalAccessibleShapes.begin(); J != aEnd2; ++J)
919
- mrContext.CommitChange (
920
- AccessibleEventId::CHILD,
922
- uno::makeAny (*J));
924
// Dispose the object.
925
::comphelper::disposeComponent(*J);
928
- maAccessibleShapes.clear ();
930
- // Now that no accessible shapes remain we can reset the index assigned
931
- // to new accessible shapes.
932
- mnNewNameIndex = 1;
936
Index: svx/source/accessibility/GraphCtlAccessibleContext.cxx
937
===================================================================
938
RCS file: /cvs/graphics/svx/source/accessibility/GraphCtlAccessibleContext.cxx,v
939
retrieving revision 1.18
940
retrieving revision 1.18.168.1
941
diff -u -p -r1.18 -r1.18.168.1
942
--- svx/source/accessibility/GraphCtlAccessibleContext.cxx 8 Sep 2005 20:21:42 -0000 1.18
943
+++ svx/source/accessibility/GraphCtlAccessibleContext.cxx 6 Dec 2005 11:51:39 -0000 1.18.168.1
944
@@ -482,6 +482,7 @@ Reference< XAccessibleStateSet > SAL_CAL
947
// pStateSetHelper->AddState( AccessibleStateType::ENABLED );
948
+ // pStateSetHelper->AddState( AccessibleStateType::SENSITIVE );
949
pStateSetHelper->AddState( AccessibleStateType::FOCUSABLE );
950
if( mpControl->HasFocus() )
951
pStateSetHelper->AddState( AccessibleStateType::FOCUSED );
952
Index: svx/source/accessibility/charmapacc.cxx
953
===================================================================
954
RCS file: /cvs/graphics/svx/source/accessibility/charmapacc.cxx,v
955
retrieving revision 1.9
956
retrieving revision 1.9.172.1
957
diff -u -p -r1.9 -r1.9.172.1
958
--- svx/source/accessibility/charmapacc.cxx 8 Sep 2005 20:23:00 -0000 1.9
959
+++ svx/source/accessibility/charmapacc.cxx 6 Dec 2005 11:51:39 -0000 1.9.172.1
960
@@ -251,7 +251,10 @@ Reference< XAccessibleStateSet > SAL_CAL
961
if ( mpParent->IsActive() )
962
pStateSet->AddState( AccessibleStateType::ACTIVE );
963
if ( mpParent->IsEnabled() )
965
pStateSet->AddState( AccessibleStateType::ENABLED );
966
+ pStateSet->AddState( AccessibleStateType::SENSITIVE );
968
if ( mpParent->IsReallyVisible() )
969
pStateSet->AddState( AccessibleStateType::VISIBLE );
971
@@ -483,7 +486,10 @@ uno::Reference< accessibility::XAccessib
972
if ( m_pParent->getCharSetControl()->IsActive() )
973
pStateSet->AddState( AccessibleStateType::ACTIVE );
974
if ( m_pParent->getCharSetControl()->IsEnabled() )
975
- pStateSet->AddState( AccessibleStateType::ENABLED );
977
+ pStateSet->AddState( AccessibleStateType::ENABLED );
978
+ pStateSet->AddState( AccessibleStateType::SENSITIVE );
980
if ( m_pParent->getCharSetControl()->IsReallyVisible() )
981
pStateSet->AddState( AccessibleStateType::VISIBLE );
983
Index: svx/source/accessibility/svxrectctaccessiblecontext.cxx
984
===================================================================
985
RCS file: /cvs/graphics/svx/source/accessibility/svxrectctaccessiblecontext.cxx,v
986
retrieving revision 1.18
987
retrieving revision 1.18.172.1
988
diff -u -p -r1.18 -r1.18.172.1
989
--- svx/source/accessibility/svxrectctaccessiblecontext.cxx 8 Sep 2005 20:23:56 -0000 1.18
990
+++ svx/source/accessibility/svxrectctaccessiblecontext.cxx 6 Dec 2005 11:51:39 -0000 1.18.172.1
991
@@ -434,6 +434,7 @@ Reference< XAccessibleStateSet > SAL_CAL
994
// pStateSetHelper->AddState( AccessibleStateType::ENABLED );
995
+ // pStateSetHelper->AddState( AccessibleStateType::SENSITIVE );
996
pStateSetHelper->AddState( AccessibleStateType::FOCUSABLE );
997
if( mpRepr->HasFocus() )
998
pStateSetHelper->AddState( AccessibleStateType::FOCUSED );
999
@@ -1039,6 +1040,7 @@ Reference< XAccessibleStateSet > SAL_CAL
1002
pStateSetHelper->AddState( AccessibleStateType::ENABLED );
1003
+ pStateSetHelper->AddState( AccessibleStateType::SENSITIVE );
1004
pStateSetHelper->AddState( AccessibleStateType::OPAQUE );
1005
pStateSetHelper->AddState( AccessibleStateType::SELECTABLE );
1006
pStateSetHelper->AddState( AccessibleStateType::SHOWING );
1007
cvs diff: Diffing svx/source/customshapes
1008
cvs diff: Diffing svx/source/dialog
1009
cvs diff: Diffing svx/source/editeng
1010
cvs diff: Diffing svx/source/engine3d
1011
cvs diff: Diffing svx/source/fmcomp
1012
cvs diff: Diffing svx/source/form
1013
cvs diff: Diffing svx/source/gallery2
1014
cvs diff: Diffing svx/source/gengal
1015
cvs diff: Diffing svx/source/inc
1016
cvs diff: Diffing svx/source/init
1017
cvs diff: Diffing svx/source/intro
1018
cvs diff: Diffing svx/source/items
1019
cvs diff: Diffing svx/source/mnuctrls
1020
cvs diff: Diffing svx/source/msfilter
1021
cvs diff: Diffing svx/source/options
1022
cvs diff: Diffing svx/source/outliner
1023
cvs diff: Diffing svx/source/sdr
1024
cvs diff: Diffing svx/source/sdr/animation
1025
cvs diff: Diffing svx/source/sdr/contact
1026
cvs diff: Diffing svx/source/sdr/event
1027
cvs diff: Diffing svx/source/sdr/mixer
1028
cvs diff: Diffing svx/source/sdr/properties
1029
cvs diff: Diffing svx/source/src
1030
cvs diff: Diffing svx/source/stbctrls
1031
cvs diff: Diffing svx/source/svdraw
1032
cvs diff: Diffing svx/source/svrtf
1033
cvs diff: Diffing svx/source/svxlink
1034
cvs diff: Diffing svx/source/tbxctrls
1035
cvs diff: Diffing svx/source/toolbars
1036
cvs diff: Diffing svx/source/unodialogs
1037
cvs diff: Diffing svx/source/unodialogs/inc
1038
cvs diff: Diffing svx/source/unodialogs/textconversiondlgs
1039
cvs diff: Diffing svx/source/unodraw
1040
cvs diff: Diffing svx/source/unoedit
1041
cvs diff: Diffing svx/source/unogallery
1042
cvs diff: Diffing svx/source/xml
1043
cvs diff: Diffing svx/source/xoutdev
1044
cvs diff: Diffing svx/uiconfig
1045
cvs diff: Diffing svx/uiconfig/accelerator
1046
cvs diff: Diffing svx/uiconfig/accelerator/en-GB
1047
cvs diff: Diffing svx/uiconfig/accelerator/en-US
1048
cvs diff: Diffing svx/uiconfig/accelerator/es
1049
cvs diff: Diffing svx/util
1050
cvs diff: Diffing svx/util/defs
1051
Index: svx/util/defs/wntmsci7
1052
===================================================================
1053
RCS file: svx/util/defs/wntmsci7
1054
diff -N svx/util/defs/wntmsci7
1055
--- comphelper/source/misc/accessiblewrapper.cxx 8 Sep 2005 02:48:04 -0000 1.9
1056
+++ comphelper/source/misc/accessiblewrapper.cxx 1 Mar 2006 12:12:20 -0000 1.8.156.3
1057
@@ -151,6 +151,12 @@ namespace comphelper
1059
Reference< XAccessible > xValue;
1061
+ if( !_rxKey.is() )
1063
+ // fprintf( stderr, "It was this path that was crashing stuff\n" );
1067
// do we have this child in the cahce?
1068
AccessibleMap::const_iterator aPos = m_aChildrenMap.find( _rxKey );
1069
if ( m_aChildrenMap.end() != aPos )
1070
cvs diff: Diffing comphelper/source/officeinstdir
1071
cvs diff: Diffing comphelper/source/processfactory
1072
cvs diff: Diffing comphelper/source/property
1073
cvs diff: Diffing comphelper/source/streaming
1074
cvs diff: Diffing comphelper/util
1075
cvs diff: Diffing comphelper/util/defs
1076
Index: comphelper/util/defs/wntmsci7
1077
===================================================================
1078
RCS file: comphelper/util/defs/wntmsci7
1079
diff -N comphelper/util/defs/wntmsci7
1080
--- vcl/inc/menu.hxx 9 Sep 2005 11:09:19 -0000 1.35
1081
+++ vcl/inc/menu.hxx 16 Nov 2005 15:57:55 -0000 1.35.12.1
1082
@@ -379,6 +379,9 @@ public:
1084
void SetAccessibleDescription( USHORT nItemId, const XubString& rStr );
1085
XubString GetAccessibleDescription( USHORT nItemId ) const;
1087
+ // returns whether the item a position nItemPos is highlighted or not.
1088
+ bool IsHighlighted( USHORT nItemPos ) const;
1092
Index: vcl/inc/svapp.hxx
1093
===================================================================
1094
RCS file: /cvs/gsl/vcl/inc/svapp.hxx,v
1095
retrieving revision 1.36
1096
retrieving revision 1.35.12.2
1097
diff -u -p -r1.36 -r1.35.12.2
1098
--- vcl/inc/svapp.hxx 7 Apr 2006 15:28:31 -0000 1.36
1099
+++ vcl/inc/svapp.hxx 13 Apr 2006 10:10:38 -0000 1.35.12.2
1100
@@ -348,7 +348,7 @@ public:
1101
static void AddKeyListener( const Link& rKeyListener );
1102
static void RemoveKeyListener( const Link& rKeyListener );
1103
static void ImplCallEventListeners( ULONG nEvent, Window* pWin, void* pData );
1104
- static void ImplCallEventListeners( VclWindowEvent* pEvent );
1105
+ static void ImplCallEventListeners( VclSimpleEvent* pEvent );
1106
static BOOL HandleKey( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent );
1108
static ULONG PostKeyEvent( ULONG nEvent, Window *pWin, KeyEvent* pKeyEvent );
1109
cvs diff: Diffing vcl/prj
1110
Index: vcl/prj/build.lst
1111
===================================================================
1112
RCS file: /cvs/gsl/vcl/prj/build.lst,v
1113
retrieving revision 1.42
1114
retrieving revision 1.41.72.2
1115
diff -u -p -r1.42 -r1.41.72.2
1116
--- vcl/prj/build.lst 30 Aug 2005 09:37:21 -0000 1.42
1117
+++ vcl/prj/build.lst 21 Sep 2005 07:13:26 -0000 1.41.72.2
1118
@@ -18,6 +18,7 @@ vc vcl\unx\source\gdi nmake - u vc_
1119
vc vcl\unx\source\window nmake - u vc__winu vc_unot NULL
1120
vc vcl\unx\source\src nmake - u vc__srcu vc_unot NULL
1121
vc vcl\unx\dummy nmake - u vc__du vc_unot NULL
1122
+vc vcl\unx\gtk\a11y nmake - u vc__gtky vc_unot NULL
1123
vc vcl\unx\gtk\app nmake - u vc__gtka vc_unot NULL
1124
vc vcl\unx\gtk\window nmake - u vc__gtkw vc_unot NULL
1125
vc vcl\unx\gtk\gdi nmake - u vc__gtkg vc_unot NULL
1126
@@ -30,5 +31,5 @@ vc vcl\mac\source\app nmake - m vc_
1127
vc vcl\mac\source\gdi nmake - m vc__gdim vc_unot NULL
1128
vc vcl\mac\source\window nmake - m vc__winm vc_unot NULL
1129
vc vcl\mac\source\src nmake - m vc__srcm vc_unot NULL
1130
-vc vcl\util nmake - all vc_util vc__plug.u vc__appa.u vc__appm.m vc__appu.u vc__appw.w vc__gdim.m vc__gdiu.u vc__gdiw.w vc__srcm.m vc__srcu.u vc__srcw.w vc__wina.u vc__winm.m vc__winu.u vc__winw.w vc__du.u vc__gtka.u vc__gtkw.u vc__gtkg.u vc__kde.u vc_app vc_ctrl vc_gdi vc_hlp vc_src vc_win vc_glyphs NULL
1131
+vc vcl\util nmake - all vc_util vc__plug.u vc__appa.u vc__appm.m vc__appu.u vc__appw.w vc__gdim.m vc__gdiu.u vc__gdiw.w vc__srcm.m vc__srcu.u vc__srcw.w vc__wina.u vc__winm.m vc__winu.u vc__winw.w vc__du.u vc__gtka.u vc__gtky.u vc__gtkw.u vc__gtkg.u vc__kde.u vc_app vc_ctrl vc_gdi vc_hlp vc_src vc_win vc_glyphs NULL
1132
vc vcl\workben nmake - all vc_wrkb vc_util NULL
1133
cvs diff: Diffing vcl/qa
1134
cvs diff: Diffing vcl/qa/complex
1135
cvs diff: Diffing vcl/qa/complex/memCheck
1136
cvs diff: Diffing vcl/qa/complex/persistent_window_states
1137
cvs diff: Diffing vcl/qa/testdocuments
1138
cvs diff: Diffing vcl/source
1139
cvs diff: Diffing vcl/source/app
1140
Index: vcl/source/app/svapp.cxx
1141
===================================================================
1142
RCS file: /cvs/gsl/vcl/source/app/svapp.cxx,v
1143
retrieving revision 1.62
1144
retrieving revision 1.58.10.8
1145
diff -u -p -r1.62 -r1.58.10.8
1146
--- vcl/source/app/svapp.cxx 7 Apr 2006 15:29:41 -0000 1.62
1147
+++ vcl/source/app/svapp.cxx 13 Apr 2006 10:11:31 -0000 1.58.10.8
1148
@@ -875,7 +875,7 @@ void Application::ImplCallEventListeners
1150
// -----------------------------------------------------------------------
1152
-void Application::ImplCallEventListeners( VclWindowEvent* pEvent )
1153
+void Application::ImplCallEventListeners( VclSimpleEvent* pEvent )
1155
ImplSVData* pSVData = ImplGetSVData();
1157
@@ -1235,7 +1235,7 @@ long Application::GetTopWindowCount()
1160
ImplSVData* pSVData = ImplGetSVData();
1161
- Window *pWin = pSVData->maWinData.mpFirstFrame;
1162
+ Window *pWin = pSVData ? pSVData->maWinData.mpFirstFrame : NULL;
1165
if( pWin->ImplGetWindow()->IsTopWindow() )
1166
@@ -1251,7 +1251,7 @@ Window* Application::GetTopWindow( long
1169
ImplSVData* pSVData = ImplGetSVData();
1170
- Window *pWin = pSVData->maWinData.mpFirstFrame;
1171
+ Window *pWin = pSVData ? pSVData->maWinData.mpFirstFrame : NULL;
1174
if( pWin->ImplGetWindow()->IsTopWindow() )
1175
@@ -1876,10 +1876,12 @@ BOOL Application::IsAccessibilityEnabled
1177
BOOL InitAccessBridge( BOOL bShowCancel, BOOL &rCancelled )
1179
- BOOL bRet = ImplInitAccessBridge( bShowCancel, rCancelled );
1182
-// There is no GUI to re-enable accessibility on Unix ..
1183
+// Disable Java bridge on UNIX
1185
+ bRet = ImplInitAccessBridge( bShowCancel, rCancelled );
1187
if( !bRet && bShowCancel && !rCancelled )
1189
// disable accessibility if the user chooses to continue
1190
@@ -1889,7 +1891,7 @@ BOOL InitAccessBridge( BOOL bShowCancel,
1191
aSettings.SetMiscSettings( aMisc );
1192
Application::SetSettings( aSettings );
1199
cvs diff: Diffing vcl/source/control
1200
cvs diff: Diffing vcl/source/ex
1201
cvs diff: Diffing vcl/source/gdi
1202
cvs diff: Diffing vcl/source/glyphs
1203
cvs diff: Diffing vcl/source/helper
1204
cvs diff: Diffing vcl/source/src
1205
cvs diff: Diffing vcl/source/unotypes
1206
cvs diff: Diffing vcl/source/window
1207
Index: vcl/source/window/menu.cxx
1208
===================================================================
1209
RCS file: /cvs/gsl/vcl/source/window/menu.cxx,v
1210
retrieving revision 1.133
1211
retrieving revision 1.127.12.7
1212
diff -u -p -r1.133 -r1.127.12.7
1213
--- vcl/source/window/menu.cxx 7 Apr 2006 15:34:24 -0000 1.133
1214
+++ vcl/source/window/menu.cxx 13 Apr 2006 10:14:51 -0000 1.127.12.7
1215
@@ -574,7 +574,6 @@ public:
1216
USHORT GetPosInParent() const { return nPosInParent; }
1218
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
1219
- BOOL IsTopmostApplicationMenu();
1222
// To get the transparent mouse-over look, the closer is actually a toolbox
1223
@@ -1109,6 +1108,13 @@ void Menu::ImplCallEventListeners( ULONG
1225
VclMenuEvent aEvent( this, nEvent, nPos );
1227
+ // This is needed by atk accessibility bridge
1228
+ if ( nEvent == VCLEVENT_MENU_HIGHLIGHT )
1230
+ ImplSVData* pSVData = ImplGetSVData();
1231
+ pSVData->mpApp->ImplCallEventListeners( &aEvent );
1234
if ( !maEventListeners.empty() )
1235
maEventListeners.Call( &aEvent );
1237
@@ -2881,7 +2887,20 @@ BOOL Menu::GetSystemMenuData( SystemMenu
1242
+bool Menu::IsHighlighted( USHORT nItemPos ) const
1244
+ bool bRet = false;
1249
+ bRet = ( nItemPos == static_cast< MenuBarWindow * > (pWindow)->GetHighlightedItem() );
1251
+ bRet = ( nItemPos == static_cast< MenuFloatingWindow * > (pWindow)->GetHighlightedItem() );
1259
@@ -4403,9 +4422,11 @@ void MenuFloatingWindow::KeyInput( const
1263
- MenuFloatingWindow* pFloat = ((PopupMenu*)pMenu->pStartedFrom)->ImplGetFloatingWindow();
1264
+ PopupMenu* pPopupMenu = (PopupMenu*)pMenu->pStartedFrom;
1265
+ MenuFloatingWindow* pFloat = pPopupMenu->ImplGetFloatingWindow();
1266
pFloat->GrabFocus();
1267
pFloat->KillActivePopup();
1268
+ pPopupMenu->pStartedFrom->ImplCallHighlight(pFloat->nHighlightedItem);
1272
@@ -4619,18 +4640,12 @@ void MenuFloatingWindow::Command( const
1274
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc;
1277
+ if ( pMenu && !pMenu->pStartedFrom )
1278
xAcc = pMenu->GetAccessible();
1284
-BOOL MenuFloatingWindow::IsTopmostApplicationMenu()
1286
- return (!pMenu->pStartedFrom) ? TRUE : FALSE;
1289
MenuBarWindow::MenuBarWindow( Window* pParent ) :
1290
Window( pParent, 0 ),
1292
cvs diff: Diffing vcl/test
1293
cvs diff: Diffing vcl/unx
1294
cvs diff: Diffing vcl/unx/dummy
1295
cvs diff: Diffing vcl/unx/gtk
1296
cvs diff: Diffing vcl/unx/gtk/a11y
1297
Index: vcl/unx/gtk/a11y/TODO
1298
===================================================================
1299
RCS file: vcl/unx/gtk/a11y/TODO
1300
diff -N vcl/unx/gtk/a11y/TODO
1301
--- /dev/null 1 Jan 1970 00:00:00 -0000
1302
+++ vcl/unx/gtk/a11y/TODO 31 May 2005 14:08:21 -0000 1.1.2.6
1305
+#Issue number: i#47890#
1306
+Submitted by: mmeeks
1308
+Hacked up prototype of atk bridge
1312
+ + Threading/locking:
1313
+ + incoming CORBA calls & the GDK lock
1314
+ + how are these being processed & on what thread ?
1315
+ + are we holding the GDK_THREADS lock ?
1316
+ + can we even do that ?
1317
+ + is it really necessary to be thread safe ?
1318
+ + how does this work in combination with the (unsafe) GAIL code ?
1319
+ + what should incoming CORBA calls be doing ?
1320
+ + esp. since we can't tell if they're coming from
1321
+ in-proc or not either [ though this is unlikely ]
1325
+ + in-line text editing, does the TEXT_CHANGED signal get it right,
1326
+ + why not copy/paste/delete etc. ?
1327
+ + check vs. writer & other bits ...
1332
+ + implement non-gui mode - for to-console event logging
1334
+ + more detail from remaining events
1335
+ + add a Tree navigation thing instead (?)
1336
+ + poke a sub-child (?)
1337
+ + embed a tree widget inside the tree view ?
1338
+ + AtkHyperText testing (?)
1343
+ + selection interface - multiple selections ?
1344
+ + word boundary issues
1345
+ + copy AccessibleTextImpl.java's getAfterIndex eg.
1346
+ + the 'getFoo' methods need to use UNO_QUERY_THROW &
1347
+ throw an exception to avoid null pointer dereferences.
1348
+ + AtkAttributeSet (etc.)
1350
+ + finish/test AtkTable
1351
+ + HyperLink 'link_activated', HyperText 'link_selected' (?)
1352
+ + tooltips create new toplevels with broken roles.
1353
Index: vcl/unx/gtk/a11y/atkaction.cxx
1354
===================================================================
1355
RCS file: vcl/unx/gtk/a11y/atkaction.cxx
1356
diff -N vcl/unx/gtk/a11y/atkaction.cxx
1357
--- /dev/null 1 Jan 1970 00:00:00 -0000
1358
+++ vcl/unx/gtk/a11y/atkaction.cxx 31 Mar 2006 12:19:38 -0000 1.1.2.8
1360
+/*************************************************************************
1362
+ * OpenOffice.org - a multi-platform office productivity suite
1364
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
1366
+ * $Revision: 1.1.2.1 $
1368
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
1370
+ * The Contents of this file are made available subject to
1371
+ * the terms of GNU Lesser General Public License Version 2.1.
1374
+ * GNU Lesser General Public License Version 2.1
1375
+ * =============================================
1376
+ * Copyright 2005 by Sun Microsystems, Inc.
1377
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
1379
+ * This library is free software; you can redistribute it and/or
1380
+ * modify it under the terms of the GNU Lesser General Public
1381
+ * License version 2.1, as published by the Free Software Foundation.
1383
+ * This library is distributed in the hope that it will be useful,
1384
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1385
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1386
+ * Lesser General Public License for more details.
1388
+ * You should have received a copy of the GNU Lesser General Public
1389
+ * License along with this library; if not, write to the Free Software
1390
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1391
+ * MA 02111-1307 USA
1393
+ ************************************************************************/
1395
+#include "atkwrapper.hxx"
1397
+#include <com/sun/star/accessibility/XAccessibleAction.hpp>
1398
+#include <com/sun/star/accessibility/XAccessibleKeyBinding.hpp>
1400
+#include <com/sun/star/awt/Key.hpp>
1401
+#include <com/sun/star/awt/KeyModifier.hpp>
1403
+#include <rtl/strbuf.hxx>
1404
+#include <algorithm>
1409
+using namespace ::com::sun::star;
1412
+static G_CONST_RETURN gchar *
1413
+getAsConst( const rtl::OString& rString )
1415
+ static const int nMax = 10;
1416
+ static rtl::OString aUgly[nMax];
1417
+ static int nIdx = 0;
1418
+ nIdx = (nIdx + 1) % nMax;
1419
+ aUgly[nIdx] = rString;
1420
+ return aUgly[ nIdx ];
1423
+static accessibility::XAccessibleAction*
1424
+ getAction( AtkAction *action ) throw (uno::RuntimeException)
1426
+ AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( action );
1430
+ if( !pWrap->mpAction && pWrap->mpContext )
1432
+ uno::Any any = pWrap->mpContext->queryInterface( accessibility::XAccessibleAction::static_type(NULL) );
1433
+ pWrap->mpAction = reinterpret_cast< accessibility::XAccessibleAction * > (any.pReserved);
1434
+ pWrap->mpAction->acquire();
1437
+ return pWrap->mpAction;
1446
+action_wrapper_do_action (AtkAction *action,
1450
+ accessibility::XAccessibleAction* pAction = getAction( action );
1452
+ return pAction->doAccessibleAction( i );
1454
+ catch(const uno::Exception& e) {
1455
+ g_warning( "Exception in doAccessibleAction()" );
1462
+action_wrapper_get_n_actions (AtkAction *action)
1465
+ accessibility::XAccessibleAction* pAction = getAction( action );
1467
+ return pAction->getAccessibleActionCount();
1469
+ catch(const uno::Exception& e) {
1470
+ g_warning( "Exception in getAccessibleActionCount()" );
1476
+static G_CONST_RETURN gchar *
1477
+action_wrapper_get_description (AtkAction *, gint)
1479
+ // GAIL implement this only for cells
1480
+ g_warning( "Not implemented: get_description()" );
1484
+static G_CONST_RETURN gchar *
1485
+action_wrapper_get_localized_name (AtkAction *, gint)
1487
+ // GAIL doesn't implement this as well
1488
+ g_warning( "Not implemented: get_localized_name()" );
1492
+#define ACTION_NAME_PAIR( OOoName, AtkName ) \
1493
+ std::pair< const rtl::OUString, const gchar * > ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OOoName ) ), AtkName )
1495
+static G_CONST_RETURN gchar *
1496
+action_wrapper_get_name (AtkAction *action,
1499
+ static std::map< rtl::OUString, const gchar * > aNameMap;
1501
+ if( aNameMap.empty() )
1503
+ aNameMap.insert( ACTION_NAME_PAIR( "click", "click" ) );
1504
+ aNameMap.insert( ACTION_NAME_PAIR( "select", "click" ) );
1505
+ aNameMap.insert( ACTION_NAME_PAIR( "togglePopup", "push" ) );
1509
+ accessibility::XAccessibleAction* pAction = getAction( action );
1512
+ std::map< rtl::OUString, const gchar * >::iterator iter;
1514
+ rtl::OUString aDesc( pAction->getAccessibleActionDescription( i ) );
1516
+ iter = aNameMap.find( aDesc );
1517
+ if( iter != aNameMap.end() )
1518
+ return iter->second;
1520
+ std::pair< const rtl::OUString, const gchar * > aNewVal( aDesc,
1521
+ g_strdup( OUStringToConstGChar(aDesc) ) );
1523
+ if( aNameMap.insert( aNewVal ).second );
1524
+ return aNewVal.second;
1527
+ catch(const uno::Exception& e) {
1528
+ g_warning( "Exception in getAccessibleActionDescription()" );
1535
+* GNOME Expects a string in the format:
1537
+* <nmemonic>;<full-path>;<accelerator>
1539
+* The keybindings in <full-path> should be separated by ":"
1543
+appendKeyStrokes(rtl::OStringBuffer& rBuffer, const uno::Sequence< awt::KeyStroke >& rKeyStrokes)
1545
+ for( sal_Int32 i = 0; i < rKeyStrokes.getLength(); i++ )
1547
+ if( rKeyStrokes[i].Modifiers & awt::KeyModifier::SHIFT )
1548
+ rBuffer.append("<Shift>");
1549
+ if( rKeyStrokes[i].Modifiers & awt::KeyModifier::MOD1 )
1550
+ rBuffer.append("<Control>");
1551
+ if( rKeyStrokes[i].Modifiers & awt::KeyModifier::MOD2 )
1552
+ rBuffer.append("<Alt>");
1554
+ if( ( rKeyStrokes[i].KeyCode >= awt::Key::A ) && ( rKeyStrokes[i].KeyCode <= awt::Key::Z ) )
1555
+ rBuffer.append( (sal_Char) ( 'a' + ( rKeyStrokes[i].KeyCode - awt::Key::A ) ) );
1558
+ sal_Char c = '\0';
1560
+ switch( rKeyStrokes[i].KeyCode )
1562
+ case awt::Key::TAB: c = '\t'; break;
1563
+ case awt::Key::SPACE: c = ' '; break;
1564
+ case awt::Key::ADD: c = '+'; break;
1565
+ case awt::Key::SUBTRACT: c = '-'; break;
1566
+ case awt::Key::MULTIPLY: c = '*'; break;
1567
+ case awt::Key::DIVIDE: c = '/'; break;
1568
+ case awt::Key::POINT: c = '.'; break;
1569
+ case awt::Key::COMMA: c = ','; break;
1570
+ case awt::Key::LESS: c = '<'; break;
1571
+ case awt::Key::GREATER: c = '>'; break;
1572
+ case awt::Key::EQUAL: c = '='; break;
1576
+ g_warning( "Unmapped KeyCode: %d", rKeyStrokes[i].KeyCode );
1581
+ rBuffer.append( c );
1587
+static G_CONST_RETURN gchar *
1588
+action_wrapper_get_keybinding (AtkAction *action,
1592
+ accessibility::XAccessibleAction* pAction = getAction( action );
1595
+ uno::Reference< accessibility::XAccessibleKeyBinding > xBinding( pAction->getAccessibleActionKeyBinding( i ));
1597
+ if( xBinding.is() )
1599
+ rtl::OStringBuffer aRet;
1601
+ sal_Int32 nmax = std::min( xBinding->getAccessibleKeyBindingCount(), (sal_Int32) 3 );
1602
+ for( sal_Int32 n = 0; n < nmax; n++ )
1604
+ appendKeyStrokes( aRet, xBinding->getAccessibleKeyBinding( n ) );
1607
+ aRet.append( (sal_Char) ';' );
1610
+ // !! FIXME !! remember keystroke in wrapper object ?
1611
+ return getAsConst( aRet.makeStringAndClear() );
1615
+ catch(const uno::Exception& e) {
1616
+ g_warning( "Exception in get_keybinding()" );
1623
+action_wrapper_set_description (AtkAction *, gint, const gchar *)
1631
+actionIfaceInit (AtkActionIface *iface)
1633
+ g_return_if_fail (iface != NULL);
1635
+ iface->do_action = action_wrapper_do_action;
1636
+ iface->get_n_actions = action_wrapper_get_n_actions;
1637
+ iface->get_description = action_wrapper_get_description;
1638
+ iface->get_keybinding = action_wrapper_get_keybinding;
1639
+ iface->get_name = action_wrapper_get_name;
1640
+ iface->get_localized_name = action_wrapper_get_localized_name;
1641
+ iface->set_description = action_wrapper_set_description;
1643
Index: vcl/unx/gtk/a11y/atkbridge.cxx
1644
===================================================================
1645
RCS file: vcl/unx/gtk/a11y/atkbridge.cxx
1646
diff -N vcl/unx/gtk/a11y/atkbridge.cxx
1647
--- /dev/null 1 Jan 1970 00:00:00 -0000
1648
+++ vcl/unx/gtk/a11y/atkbridge.cxx 11 Apr 2006 08:45:10 -0000 1.1.2.5
1650
+/*************************************************************************
1652
+ * OpenOffice.org - a multi-platform office productivity suite
1654
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
1656
+ * $Revision: 1.1.2.1 $
1658
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
1660
+ * The Contents of this file are made available subject to
1661
+ * the terms of GNU Lesser General Public License Version 2.1.
1664
+ * GNU Lesser General Public License Version 2.1
1665
+ * =============================================
1666
+ * Copyright 2005 by Sun Microsystems, Inc.
1667
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
1669
+ * This library is free software; you can redistribute it and/or
1670
+ * modify it under the terms of the GNU Lesser General Public
1671
+ * License version 2.1, as published by the Free Software Foundation.
1673
+ * This library is distributed in the hope that it will be useful,
1674
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1675
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1676
+ * Lesser General Public License for more details.
1678
+ * You should have received a copy of the GNU Lesser General Public
1679
+ * License along with this library; if not, write to the Free Software
1680
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1681
+ * MA 02111-1307 USA
1683
+ ************************************************************************/
1685
+#include <plugins/gtk/atkbridge.hxx>
1686
+#include <plugins/gtk/gtkframe.hxx>
1688
+#include "atkfactory.hxx"
1689
+#include "atkutil.hxx"
1690
+#include "atkwindow.hxx"
1694
+#if ! ( defined AIX || defined HPUX ) // these have no dl* functions
1698
+void InitAtkBridge(void)
1700
+ unsigned int major, minor, micro;
1702
+ /* check gail minimum version requirements */
1703
+ if( sscanf( atk_get_toolkit_version(), "%u.%u.%u", &major, &minor, µ) < 3 )
1705
+ g_warning( "unable to parse gail version number" );
1709
+ if( ( (major << 16) | (minor << 8) | micro ) < ( (1 << 16) | 8 << 8 | 6 ) )
1711
+ g_warning( "libgail >= 1.8.6 required for accessibility support" );
1715
+ /* get at-spi version by checking the libspi.so version number */
1716
+#if ! ( defined AIX || defined HPUX ) // these have no dl* functions
1718
+ /* libspi should be mapped by loading libatk-bridge.so already */
1719
+ void * sym = dlsym( RTLD_DEFAULT, "spi_accessible_new" );
1720
+ g_return_if_fail( sym != NULL );
1723
+ int ret = dladdr( sym, &dl_info );
1724
+ g_return_if_fail( ret != 0 );
1726
+ char path[PATH_MAX];
1727
+ if( NULL == realpath(dl_info.dli_fname, path) )
1729
+ perror( "unable to resolve libspi.so.0" );
1733
+ const char * cp = strrchr(path, '/');
1737
+ cp = dl_info.dli_fname;
1739
+ if( sscanf( cp, "libspi.so.%u.%u.%u", &major, &minor, µ) < 3 )
1741
+ g_warning( "unable to parse at-spi version number: %s", cp );
1745
+ if( ( (major << 16) | (minor << 8) | micro ) < ( 10 << 8 | 6 ) )
1747
+ g_warning( "at-spi >= 1.7 required for accessibility support" );
1751
+#endif // ! ( defined AIX || defined HPUX )
1753
+ /* Initialize the AtkUtilityWrapper class */
1754
+ g_type_class_unref( g_type_class_ref( OOO_TYPE_ATK_UTIL ) );
1756
+ /* Initialize the GailWindow wrapper class */
1757
+ g_type_class_unref( g_type_class_ref( OOO_TYPE_WINDOW_WRAPPER ) );
1759
+ /* Register AtkObject wrapper factory */
1760
+ AtkRegistry * registry = atk_get_default_registry();
1762
+ atk_registry_set_factory_type( registry, OOO_TYPE_FIXED, OOO_TYPE_WRAPPER_FACTORY );
1765
Index: vcl/unx/gtk/a11y/atkcomponent.cxx
1766
===================================================================
1767
RCS file: vcl/unx/gtk/a11y/atkcomponent.cxx
1768
diff -N vcl/unx/gtk/a11y/atkcomponent.cxx
1769
--- /dev/null 1 Jan 1970 00:00:00 -0000
1770
+++ vcl/unx/gtk/a11y/atkcomponent.cxx 31 Mar 2006 12:19:39 -0000 1.1.2.9
1772
+/*************************************************************************
1774
+ * OpenOffice.org - a multi-platform office productivity suite
1776
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
1778
+ * $Revision: 1.1.2.1 $
1780
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
1782
+ * The Contents of this file are made available subject to
1783
+ * the terms of GNU Lesser General Public License Version 2.1.
1786
+ * GNU Lesser General Public License Version 2.1
1787
+ * =============================================
1788
+ * Copyright 2005 by Sun Microsystems, Inc.
1789
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
1791
+ * This library is free software; you can redistribute it and/or
1792
+ * modify it under the terms of the GNU Lesser General Public
1793
+ * License version 2.1, as published by the Free Software Foundation.
1795
+ * This library is distributed in the hope that it will be useful,
1796
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1797
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1798
+ * Lesser General Public License for more details.
1800
+ * You should have received a copy of the GNU Lesser General Public
1801
+ * License along with this library; if not, write to the Free Software
1802
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1803
+ * MA 02111-1307 USA
1805
+ ************************************************************************/
1807
+#include "atkwrapper.hxx"
1809
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
1811
+#ifdef ENABLE_TRACING
1815
+using namespace ::com::sun::star;
1817
+static accessibility::XAccessibleComponent*
1818
+ getComponent( AtkComponent *pComponent ) throw (uno::RuntimeException)
1820
+ AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pComponent );
1823
+ if( !pWrap->mpComponent && pWrap->mpContext )
1825
+ uno::Any any = pWrap->mpContext->queryInterface( accessibility::XAccessibleComponent::static_type(NULL) );
1826
+ pWrap->mpComponent = reinterpret_cast< accessibility::XAccessibleComponent * > (any.pReserved);
1827
+ pWrap->mpComponent->acquire();
1830
+ return pWrap->mpComponent;
1836
+/*****************************************************************************/
1839
+translatePoint( accessibility::XAccessibleComponent *pComponent,
1840
+ gint x, gint y, AtkCoordType t)
1842
+ awt::Point aOrigin( 0, 0 );
1843
+ if( t == ATK_XY_SCREEN )
1844
+ aOrigin = pComponent->getLocationOnScreen();
1846
+#ifdef ENABLE_TRACING
1847
+ fprintf(stderr, "coordinates ( %u, %u ) translated to: ( %u, %u )\n",
1848
+ x, y, x - aOrigin.X, y - aOrigin.Y);
1851
+ return awt::Point( x - aOrigin.X, y - aOrigin.Y );
1854
+/*****************************************************************************/
1859
+component_wrapper_grab_focus (AtkComponent *component)
1863
+ accessibility::XAccessibleComponent* pComponent = getComponent( component );
1866
+ pComponent->grabFocus();
1870
+ catch( const uno::Exception &e )
1872
+ g_warning( "Exception in grabFocus()" );
1878
+/*****************************************************************************/
1881
+component_wrapper_contains (AtkComponent *component,
1884
+ AtkCoordType coord_type)
1888
+ accessibility::XAccessibleComponent* pComponent = getComponent( component );
1890
+ return pComponent->containsPoint( translatePoint( pComponent, x, y, coord_type ) );
1892
+ catch( const uno::Exception &e )
1894
+ g_warning( "Exception in containsPoint()" );
1900
+/*****************************************************************************/
1903
+component_wrapper_ref_accessible_at_point (AtkComponent *component,
1906
+ AtkCoordType coord_type)
1910
+ accessibility::XAccessibleComponent* pComponent = getComponent( component );
1914
+ uno::Reference< accessibility::XAccessible > xAccessible;
1915
+ xAccessible = pComponent->getAccessibleAtPoint(
1916
+ translatePoint( pComponent, x, y, coord_type ) );
1918
+#ifdef ENABLE_TRACING
1919
+ fprintf(stderr, "getAccessibleAtPoint( %u, %u ) returned %p\n",
1920
+ x, y, xAccessible.get());
1922
+ uno::Reference< accessibility::XAccessibleComponent > xComponent(
1923
+ xAccessible->getAccessibleContext(), uno::UNO_QUERY );
1925
+ if( xComponent.is() )
1927
+ awt::Rectangle rect = xComponent->getBounds();
1928
+ fprintf(stderr, "%p->getBounds() returned: ( %u, %u, %u, %u )\n",
1929
+ xAccessible.get(), rect.X, rect.Y, rect.Width, rect.Height );
1933
+ return atk_object_wrapper_ref( xAccessible );
1936
+ catch( const uno::Exception &e )
1938
+ g_warning( "Exception in getAccessibleAtPoint()" );
1944
+/*****************************************************************************/
1947
+component_wrapper_get_position (AtkComponent *component,
1950
+ AtkCoordType coord_type)
1954
+ accessibility::XAccessibleComponent* pComponent = getComponent( component );
1959
+ if( coord_type == ATK_XY_SCREEN )
1960
+ aPos = pComponent->getLocationOnScreen();
1962
+ aPos = pComponent->getLocation();
1967
+#ifdef ENABLE_TRACING
1968
+ fprintf(stderr, "getLocation[OnScreen]() returned: ( %u, %u )\n", *x, *y );
1972
+ catch( const uno::Exception &e )
1974
+ g_warning( "Exception in getLocation[OnScreen]()" );
1978
+/*****************************************************************************/
1981
+component_wrapper_get_size (AtkComponent *component,
1987
+ accessibility::XAccessibleComponent* pComponent = getComponent( component );
1990
+ awt::Size aSize = pComponent->getSize();
1991
+ *width = aSize.Width;
1992
+ *height = aSize.Height;
1994
+#ifdef ENABLE_TRACING
1995
+ fprintf(stderr, "getSize() returned: ( %u, %u )\n", *width, *height );
1999
+ catch( const uno::Exception &e )
2001
+ g_warning( "Exception in getSize()" );
2005
+/*****************************************************************************/
2008
+component_wrapper_get_extents (AtkComponent *component,
2013
+ AtkCoordType coord_type)
2015
+ component_wrapper_get_position( component, x, y, coord_type );
2016
+ component_wrapper_get_size( component, width, height );
2019
+/*****************************************************************************/
2022
+component_wrapper_set_extents (AtkComponent *, gint, gint, gint, gint, AtkCoordType)
2024
+ g_warning( "AtkComponent::set_extents unimplementable" );
2028
+/*****************************************************************************/
2031
+component_wrapper_set_position (AtkComponent *, gint, gint, AtkCoordType)
2033
+ g_warning( "AtkComponent::set_position unimplementable" );
2037
+/*****************************************************************************/
2040
+component_wrapper_set_size (AtkComponent *, gint, gint)
2042
+ g_warning( "AtkComponent::set_size unimplementable" );
2046
+/*****************************************************************************/
2049
+component_wrapper_get_layer (AtkComponent *component)
2051
+ AtkRole role = atk_object_get_role( ATK_OBJECT( component ) );
2052
+ AtkLayer layer = ATK_LAYER_WIDGET;
2056
+ case ATK_ROLE_POPUP_MENU:
2057
+ case ATK_ROLE_MENU_ITEM:
2058
+ case ATK_ROLE_CHECK_MENU_ITEM:
2059
+ case ATK_ROLE_SEPARATOR:
2060
+ case ATK_ROLE_LIST_ITEM:
2061
+ layer = ATK_LAYER_POPUP;
2063
+ case ATK_ROLE_MENU:
2065
+ AtkObject * parent = atk_object_get_parent( ATK_OBJECT( component ) );
2066
+ if( atk_object_get_role( parent ) != ATK_ROLE_MENU_BAR )
2067
+ layer = ATK_LAYER_POPUP;
2071
+ case ATK_ROLE_LIST:
2073
+ AtkObject * parent = atk_object_get_parent( ATK_OBJECT( component ) );
2074
+ if( atk_object_get_role( parent ) == ATK_ROLE_COMBO_BOX )
2075
+ layer = ATK_LAYER_POPUP;
2086
+/*****************************************************************************/
2089
+component_wrapper_get_mdi_zorder (AtkComponent *)
2091
+ // only needed for ATK_LAYER_MDI (not used) or ATK_LAYER_WINDOW (inherited from GAIL)
2095
+/*****************************************************************************/
2097
+// This code is mostly stolen from libgail ..
2100
+component_wrapper_add_focus_handler (AtkComponent *component,
2101
+ AtkFocusHandler handler)
2103
+ GSignalMatchType match_type;
2107
+ match_type = (GSignalMatchType) (G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC);
2108
+ signal_id = g_signal_lookup( "focus-event", ATK_TYPE_OBJECT );
2110
+ ret = g_signal_handler_find( component, match_type, signal_id, 0, NULL,
2111
+ (gpointer) &handler, NULL);
2114
+ return g_signal_connect_closure_by_id (component,
2117
+ G_CALLBACK (handler), NULL,
2118
+ (GClosureNotify) NULL),
2127
+/*****************************************************************************/
2130
+component_wrapper_remove_focus_handler (AtkComponent *component,
2133
+ g_signal_handler_disconnect (component, handler_id);
2136
+/*****************************************************************************/
2141
+componentIfaceInit (AtkComponentIface *iface)
2143
+ g_return_if_fail (iface != NULL);
2145
+ iface->add_focus_handler = component_wrapper_add_focus_handler;
2146
+ iface->contains = component_wrapper_contains;
2147
+ iface->get_extents = component_wrapper_get_extents;
2148
+ iface->get_layer = component_wrapper_get_layer;
2149
+ iface->get_mdi_zorder = component_wrapper_get_mdi_zorder;
2150
+ iface->get_position = component_wrapper_get_position;
2151
+ iface->get_size = component_wrapper_get_size;
2152
+ iface->grab_focus = component_wrapper_grab_focus;
2153
+ iface->ref_accessible_at_point = component_wrapper_ref_accessible_at_point;
2154
+ iface->remove_focus_handler = component_wrapper_remove_focus_handler;
2155
+ iface->set_extents = component_wrapper_set_extents;
2156
+ iface->set_position = component_wrapper_set_position;
2157
+ iface->set_size = component_wrapper_set_size;
2159
Index: vcl/unx/gtk/a11y/atkeditabletext.cxx
2160
===================================================================
2161
RCS file: vcl/unx/gtk/a11y/atkeditabletext.cxx
2162
diff -N vcl/unx/gtk/a11y/atkeditabletext.cxx
2163
--- /dev/null 1 Jan 1970 00:00:00 -0000
2164
+++ vcl/unx/gtk/a11y/atkeditabletext.cxx 15 Feb 2006 10:59:21 -0000 1.1.2.7
2166
+/*************************************************************************
2168
+ * OpenOffice.org - a multi-platform office productivity suite
2170
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
2172
+ * $Revision: 1.1.2.1 $
2174
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
2176
+ * The Contents of this file are made available subject to
2177
+ * the terms of GNU Lesser General Public License Version 2.1.
2180
+ * GNU Lesser General Public License Version 2.1
2181
+ * =============================================
2182
+ * Copyright 2005 by Sun Microsystems, Inc.
2183
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
2185
+ * This library is free software; you can redistribute it and/or
2186
+ * modify it under the terms of the GNU Lesser General Public
2187
+ * License version 2.1, as published by the Free Software Foundation.
2189
+ * This library is distributed in the hope that it will be useful,
2190
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2191
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2192
+ * Lesser General Public License for more details.
2194
+ * You should have received a copy of the GNU Lesser General Public
2195
+ * License along with this library; if not, write to the Free Software
2196
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2197
+ * MA 02111-1307 USA
2199
+ ************************************************************************/
2201
+#include "atkwrapper.hxx"
2202
+#include "atktextattributes.hxx"
2204
+#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
2205
+#include <com/sun/star/accessibility/TextSegment.hpp>
2207
+// #include <functional>
2208
+// #include <hash_map>
2211
+#include <string.h>
2213
+using namespace ::com::sun::star;
2215
+static accessibility::XAccessibleEditableText*
2216
+ getEditableText( AtkEditableText *pEditableText ) throw (uno::RuntimeException)
2218
+ AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pEditableText );
2221
+ if( !pWrap->mpEditableText && pWrap->mpContext )
2223
+ uno::Any any = pWrap->mpContext->queryInterface( accessibility::XAccessibleEditableText::static_type(NULL) );
2224
+ pWrap->mpEditableText = reinterpret_cast< accessibility::XAccessibleEditableText * > (any.pReserved);
2225
+ pWrap->mpEditableText->acquire();
2228
+ return pWrap->mpEditableText;
2235
+/*****************************************************************************/
2240
+editable_text_wrapper_set_run_attributes( AtkEditableText *text,
2241
+ AtkAttributeSet *attribute_set,
2242
+ gint nStartOffset,
2246
+ accessibility::XAccessibleEditableText* pEditableText = getEditableText( text );
2247
+ if( pEditableText )
2249
+ uno::Sequence< beans::PropertyValue > aAttributeList;
2251
+ if( attribute_set_map_to_property_values( attribute_set, aAttributeList ) )
2252
+ return pEditableText->setAttributes(nStartOffset, nEndOffset, aAttributeList);
2255
+ catch(const uno::Exception& e) {
2256
+ g_warning( "Exception in setAttributes()" );
2263
+editable_text_wrapper_set_text_contents( AtkEditableText *text,
2264
+ const gchar *string )
2267
+ accessibility::XAccessibleEditableText* pEditableText = getEditableText( text );
2268
+ if( pEditableText )
2270
+ rtl::OUString aString ( string, strlen(string), RTL_TEXTENCODING_UTF8 );
2271
+ pEditableText->setText( aString );
2274
+ catch(const uno::Exception& e) {
2275
+ g_warning( "Exception in setText()" );
2280
+editable_text_wrapper_insert_text( AtkEditableText *text,
2281
+ const gchar *string,
2286
+ accessibility::XAccessibleEditableText* pEditableText = getEditableText( text );
2287
+ if( pEditableText )
2289
+ rtl::OUString aString ( string, length, RTL_TEXTENCODING_UTF8 );
2290
+ if( pEditableText->insertText( aString, *pos ) )
2294
+ catch(const uno::Exception& e) {
2295
+ g_warning( "Exception in insertText()" );
2300
+editable_text_wrapper_cut_text( AtkEditableText *text,
2305
+ accessibility::XAccessibleEditableText* pEditableText = getEditableText( text );
2306
+ if( pEditableText )
2307
+ pEditableText->cutText( start, end );
2309
+ catch(const uno::Exception& e) {
2310
+ g_warning( "Exception in cutText()" );
2315
+editable_text_wrapper_delete_text( AtkEditableText *text,
2320
+ accessibility::XAccessibleEditableText* pEditableText = getEditableText( text );
2321
+ if( pEditableText )
2322
+ pEditableText->deleteText( start, end );
2324
+ catch(const uno::Exception& e) {
2325
+ g_warning( "Exception in deleteText()" );
2330
+editable_text_wrapper_paste_text( AtkEditableText *text,
2334
+ accessibility::XAccessibleEditableText* pEditableText = getEditableText( text );
2335
+ if( pEditableText )
2336
+ pEditableText->pasteText( pos );
2338
+ catch(const uno::Exception& e) {
2339
+ g_warning( "Exception in pasteText()" );
2344
+editable_text_wrapper_copy_text( AtkEditableText *text,
2349
+ accessibility::XAccessibleEditableText* pEditableText = getEditableText( text );
2350
+ if( pEditableText )
2351
+ pEditableText->copyText( start, end );
2353
+ catch(const uno::Exception& e) {
2354
+ g_warning( "Exception in copyText()" );
2361
+editableTextIfaceInit (AtkEditableTextIface *iface)
2363
+ g_return_if_fail (iface != NULL);
2365
+ iface->set_text_contents = editable_text_wrapper_set_text_contents;
2366
+ iface->insert_text = editable_text_wrapper_insert_text;
2367
+ iface->copy_text = editable_text_wrapper_copy_text;
2368
+ iface->cut_text = editable_text_wrapper_cut_text;
2369
+ iface->delete_text = editable_text_wrapper_delete_text;
2370
+ iface->paste_text = editable_text_wrapper_paste_text;
2371
+ iface->set_run_attributes = editable_text_wrapper_set_run_attributes;
2373
Index: vcl/unx/gtk/a11y/atkfactory.cxx
2374
===================================================================
2375
RCS file: vcl/unx/gtk/a11y/atkfactory.cxx
2376
diff -N vcl/unx/gtk/a11y/atkfactory.cxx
2377
--- /dev/null 1 Jan 1970 00:00:00 -0000
2378
+++ vcl/unx/gtk/a11y/atkfactory.cxx 31 Mar 2006 12:19:39 -0000 1.1.2.12
2380
+/*************************************************************************
2382
+ * OpenOffice.org - a multi-platform office productivity suite
2384
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
2386
+ * $Revision: 1.1.2.1 $
2388
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
2390
+ * The Contents of this file are made available subject to
2391
+ * the terms of GNU Lesser General Public License Version 2.1.
2394
+ * GNU Lesser General Public License Version 2.1
2395
+ * =============================================
2396
+ * Copyright 2005 by Sun Microsystems, Inc.
2397
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
2399
+ * This library is free software; you can redistribute it and/or
2400
+ * modify it under the terms of the GNU Lesser General Public
2401
+ * License version 2.1, as published by the Free Software Foundation.
2403
+ * This library is distributed in the hope that it will be useful,
2404
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2405
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2406
+ * Lesser General Public License for more details.
2408
+ * You should have received a copy of the GNU Lesser General Public
2409
+ * License along with this library; if not, write to the Free Software
2410
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2411
+ * MA 02111-1307 USA
2413
+ ************************************************************************/
2415
+#include <plugins/gtk/gtkframe.hxx>
2416
+#include "atkwrapper.hxx"
2417
+#include "atkfactory.hxx"
2419
+using namespace ::com::sun::star;
2424
+ * Instances of this dummy object class are returned whenever we have to
2425
+ * create an AtkObject, but can't touch the OOo object anymore since it
2426
+ * is already disposed.
2429
+static AtkStateSet *
2430
+noop_wrapper_ref_state_set( AtkObject * )
2432
+ AtkStateSet *state_set = atk_state_set_new();
2433
+ atk_state_set_add_state( state_set, ATK_STATE_DEFUNCT );
2438
+atk_noop_object_wrapper_class_init(AtkNoOpObjectClass *klass)
2440
+ AtkObjectClass *atk_class = ATK_OBJECT_CLASS( klass );
2441
+ atk_class->ref_state_set = noop_wrapper_ref_state_set;
2445
+atk_noop_object_wrapper_get_type(void)
2447
+ static GType type = 0;
2451
+ static const GTypeInfo typeInfo =
2453
+ sizeof (AtkNoOpObjectClass),
2454
+ (GBaseInitFunc) NULL,
2455
+ (GBaseFinalizeFunc) NULL,
2456
+ (GClassInitFunc) atk_noop_object_wrapper_class_init,
2457
+ (GClassFinalizeFunc) NULL,
2459
+ sizeof (AtkObjectWrapper),
2461
+ (GInstanceInitFunc) NULL,
2465
+ type = g_type_register_static (ATK_TYPE_OBJECT, "OOoAtkNoOpObj", &typeInfo, (GTypeFlags)0) ;
2471
+atk_noop_object_wrapper_new()
2473
+ AtkObject *accessible;
2475
+ accessible = (AtkObject *) g_object_new (atk_noop_object_wrapper_get_type(), NULL);
2476
+ g_return_val_if_fail (accessible != NULL, NULL);
2478
+ accessible->role = ATK_ROLE_INVALID;
2479
+ accessible->layer = ATK_LAYER_INVALID;
2481
+ return accessible;
2485
+ * The wrapper factory
2489
+wrapper_factory_get_accessible_type(void)
2491
+ return atk_object_wrapper_get_type();
2495
+wrapper_factory_create_accessible( GObject *pObj )
2497
+ GtkWidget* parent_widget = gtk_widget_get_parent( GTK_WIDGET( pObj ) );
2499
+ // gail_container_real_remove_gtk tries to re-instanciate an accessible
2500
+ // for a widget that is about to vanish ..
2501
+ if( ! parent_widget )
2502
+ return atk_noop_object_wrapper_new();
2504
+ GtkSalFrame* pFrame = GtkSalFrame::getFromWindow( GTK_WINDOW( parent_widget ) );
2505
+ g_return_val_if_fail( pFrame != NULL, NULL );
2507
+ /* HACK: if the parent gtk window has an accessible already assigned, use
2508
+ * this one to avoid endless recursion (see atkwindow.cxx).
2510
+ AtkObject* parent_accessible = (AtkObject *) g_object_get_data(G_OBJECT( parent_widget ),
2511
+ "ooo:tooltip-accessible");
2513
+ if( ! parent_accessible )
2514
+ parent_accessible = gtk_widget_get_accessible(parent_widget);
2516
+ uno::Reference< accessibility::XAccessible > xAccessible(pFrame->getAccessible( true ));
2518
+ if( xAccessible.is() )
2519
+ return atk_object_wrapper_new( xAccessible, parent_accessible );
2525
+wrapper_factory_class_init( AtkObjectFactoryClass *klass )
2527
+ klass->create_accessible = wrapper_factory_create_accessible;
2528
+ klass->get_accessible_type = wrapper_factory_get_accessible_type;
2532
+wrapper_factory_get_type (void)
2534
+ static GType t = 0;
2537
+ static const GTypeInfo tinfo =
2539
+ sizeof (AtkObjectFactoryClass),
2540
+ NULL, NULL, (GClassInitFunc) wrapper_factory_class_init,
2541
+ NULL, NULL, sizeof (AtkObjectFactory), 0, NULL, NULL
2544
+ t = g_type_register_static (
2545
+ ATK_TYPE_OBJECT_FACTORY, "OOoAtkObjectWrapperFactory",
2546
+ &tinfo, (GTypeFlags) 0);
2554
Index: vcl/unx/gtk/a11y/atkfactory.hxx
2555
===================================================================
2556
RCS file: vcl/unx/gtk/a11y/atkfactory.hxx
2557
diff -N vcl/unx/gtk/a11y/atkfactory.hxx
2558
--- /dev/null 1 Jan 1970 00:00:00 -0000
2559
+++ vcl/unx/gtk/a11y/atkfactory.hxx 5 Jan 2006 14:06:31 -0000 1.1.2.1
2561
+/*************************************************************************
2563
+ * OpenOffice.org - a multi-platform office productivity suite
2565
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
2567
+ * $Revision: 1.1.2.1 $
2569
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
2571
+ * The Contents of this file are made available subject to
2572
+ * the terms of GNU Lesser General Public License Version 2.1.
2575
+ * GNU Lesser General Public License Version 2.1
2576
+ * =============================================
2577
+ * Copyright 2005 by Sun Microsystems, Inc.
2578
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
2580
+ * This library is free software; you can redistribute it and/or
2581
+ * modify it under the terms of the GNU Lesser General Public
2582
+ * License version 2.1, as published by the Free Software Foundation.
2584
+ * This library is distributed in the hope that it will be useful,
2585
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2586
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2587
+ * Lesser General Public License for more details.
2589
+ * You should have received a copy of the GNU Lesser General Public
2590
+ * License along with this library; if not, write to the Free Software
2591
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2592
+ * MA 02111-1307 USA
2594
+ ************************************************************************/
2596
+#ifndef __ATK_FACTORY_HXX__
2597
+#define __ATK_FACTORY_HXX__
2599
+#include <atk/atk.h>
2601
+#define OOO_TYPE_WRAPPER_FACTORY wrapper_factory_get_type()
2605
+GType wrapper_factory_get_type (void);
2610
Index: vcl/unx/gtk/a11y/atkhypertext.cxx
2611
===================================================================
2612
RCS file: vcl/unx/gtk/a11y/atkhypertext.cxx
2613
diff -N vcl/unx/gtk/a11y/atkhypertext.cxx
2614
--- /dev/null 1 Jan 1970 00:00:00 -0000
2615
+++ vcl/unx/gtk/a11y/atkhypertext.cxx 31 Mar 2006 12:19:39 -0000 1.1.2.10
2617
+/*************************************************************************
2619
+ * OpenOffice.org - a multi-platform office productivity suite
2621
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
2623
+ * $Revision: 1.1.2.1 $
2625
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
2627
+ * The Contents of this file are made available subject to
2628
+ * the terms of GNU Lesser General Public License Version 2.1.
2631
+ * GNU Lesser General Public License Version 2.1
2632
+ * =============================================
2633
+ * Copyright 2005 by Sun Microsystems, Inc.
2634
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
2636
+ * This library is free software; you can redistribute it and/or
2637
+ * modify it under the terms of the GNU Lesser General Public
2638
+ * License version 2.1, as published by the Free Software Foundation.
2640
+ * This library is distributed in the hope that it will be useful,
2641
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2642
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2643
+ * Lesser General Public License for more details.
2645
+ * You should have received a copy of the GNU Lesser General Public
2646
+ * License along with this library; if not, write to the Free Software
2647
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2648
+ * MA 02111-1307 USA
2650
+ ************************************************************************/
2652
+#include "atkwrapper.hxx"
2654
+#include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
2658
+using namespace ::com::sun::star;
2661
+// ---------------------- AtkHyperlink ----------------------
2664
+ AtkHyperlink atk_hyper_link;
2666
+ uno::Reference< accessibility::XAccessibleHyperlink > xLink;
2669
+static uno::Reference< accessibility::XAccessibleHyperlink >
2670
+ getHyperlink( AtkHyperlink *pHyperlink )
2672
+ HyperLink *pLink = (HyperLink *) pHyperlink;
2673
+ return pLink->xLink;
2676
+static GObjectClass *hyper_parent_class = NULL;
2681
+hyper_link_finalize (GObject *obj)
2683
+ HyperLink *hl = (HyperLink *) obj;
2684
+ hl->xLink.clear();
2685
+ hyper_parent_class->finalize (obj);
2689
+hyper_link_get_uri( AtkHyperlink *pLink,
2693
+ uno::Any aAny = getHyperlink( pLink )->getAccessibleActionObject( i );
2694
+ rtl::OUString aUri = aAny.get< rtl::OUString > ();
2695
+ return OUStringToGChar(aUri);
2697
+ catch(const uno::Exception& e) {
2698
+ g_warning( "Exception in hyper_link_get_uri" );
2704
+hyper_link_get_object( AtkHyperlink *pLink,
2708
+ uno::Any aAny = getHyperlink( pLink )->getAccessibleActionObject( i );
2709
+ uno::Reference< accessibility::XAccessible > xObj( aAny, uno::UNO_QUERY_THROW );
2710
+ return atk_object_wrapper_ref( xObj );
2712
+ catch(const uno::Exception& e) {
2713
+ g_warning( "Exception in hyper_link_get_object" );
2718
+hyper_link_get_end_index( AtkHyperlink *pLink )
2721
+ return getHyperlink( pLink )->getEndIndex();
2723
+ catch(const uno::Exception& e) {
2728
+hyper_link_get_start_index( AtkHyperlink *pLink )
2731
+ return getHyperlink( pLink )->getStartIndex();
2733
+ catch(const uno::Exception& e) {
2738
+hyper_link_is_valid( AtkHyperlink *pLink )
2741
+ return getHyperlink( pLink )->isValid();
2743
+ catch(const uno::Exception& e) {
2748
+hyper_link_get_n_anchors( AtkHyperlink *pLink )
2751
+ return getHyperlink( pLink )->getAccessibleActionCount();
2753
+ catch(const uno::Exception& e) {
2759
+hyper_link_link_state( AtkHyperlink * )
2761
+ g_warning( "FIXME: hyper_link_link_state unimplemented" );
2765
+hyper_link_is_selected_link( AtkHyperlink * )
2767
+ g_warning( "FIXME: hyper_link_is_selected_link unimplemented" );
2772
+hyper_link_class_init (AtkHyperlinkClass *klass)
2774
+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
2776
+ gobject_class->finalize = hyper_link_finalize;
2778
+ hyper_parent_class = (GObjectClass *)g_type_class_peek_parent (klass);
2780
+ klass->get_uri = hyper_link_get_uri;
2781
+ klass->get_object = hyper_link_get_object;
2782
+ klass->get_end_index = hyper_link_get_end_index;
2783
+ klass->get_start_index = hyper_link_get_start_index;
2784
+ klass->is_valid = hyper_link_is_valid;
2785
+ klass->get_n_anchors = hyper_link_get_n_anchors;
2786
+ klass->link_state = hyper_link_link_state;
2787
+ klass->is_selected_link = hyper_link_is_selected_link;
2791
+hyper_link_get_type (void)
2793
+ static GType type = 0;
2796
+ static const GTypeInfo tinfo = {
2797
+ sizeof (AtkHyperlinkClass),
2798
+ NULL, /* base init */
2799
+ NULL, /* base finalize */
2800
+ (GClassInitFunc) hyper_link_class_init,
2801
+ NULL, /* class finalize */
2802
+ NULL, /* class data */
2803
+ sizeof (HyperLink), /* instance size */
2804
+ 0, /* nb preallocs */
2805
+ NULL, /* instance init */
2806
+ NULL /* value table */
2809
+ static const GInterfaceInfo atk_action_info = {
2810
+ (GInterfaceInitFunc) actionIfaceInit,
2811
+ (GInterfaceFinalizeFunc) NULL,
2815
+ type = g_type_register_static (ATK_TYPE_HYPERLINK,
2816
+ "OOoAtkObjHyperLink", &tinfo,
2818
+ g_type_add_interface_static (type, ATK_TYPE_ACTION,
2819
+ &atk_action_info);
2825
+// ---------------------- AtkHyperText ----------------------
2827
+static accessibility::XAccessibleHypertext*
2828
+ getHypertext( AtkHypertext *pHypertext ) throw (uno::RuntimeException)
2830
+ AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pHypertext );
2833
+ if( !pWrap->mpHypertext && pWrap->mpContext )
2835
+ uno::Any any = pWrap->mpContext->queryInterface( accessibility::XAccessibleHypertext::static_type(NULL) );
2836
+ pWrap->mpHypertext = reinterpret_cast< accessibility::XAccessibleHypertext * > (any.pReserved);
2837
+ pWrap->mpHypertext->acquire();
2840
+ return pWrap->mpHypertext;
2847
+static AtkHyperlink *
2848
+hypertext_get_link( AtkHypertext *hypertext,
2852
+ accessibility::XAccessibleHypertext* pHypertext = getHypertext( hypertext );
2855
+ HyperLink *pLink = (HyperLink *)g_object_new( hyper_link_get_type(), NULL );
2856
+ pLink->xLink = pHypertext->getHyperLink( link_index );
2857
+ if( !pLink->xLink.is() ) {
2858
+ g_object_unref( G_OBJECT( pLink ) );
2861
+ return ATK_HYPERLINK( pLink );
2864
+ catch(const uno::Exception& e) {
2865
+ g_warning( "Exception in getHyperLink()" );
2872
+hypertext_get_n_links( AtkHypertext *hypertext )
2875
+ accessibility::XAccessibleHypertext* pHypertext = getHypertext( hypertext );
2877
+ return pHypertext->getHyperLinkCount();
2879
+ catch(const uno::Exception& e) {
2880
+ g_warning( "Exception in getHyperLinkCount()" );
2887
+hypertext_get_link_index( AtkHypertext *hypertext,
2891
+ accessibility::XAccessibleHypertext* pHypertext = getHypertext( hypertext );
2893
+ return pHypertext->getHyperLinkIndex( index );
2895
+ catch(const uno::Exception& e) {
2896
+ g_warning( "Exception in getHyperLinkIndex()" );
2905
+hypertextIfaceInit (AtkHypertextIface *iface)
2907
+ g_return_if_fail (iface != NULL);
2909
+ iface->get_link = hypertext_get_link;
2910
+ iface->get_n_links = hypertext_get_n_links;
2911
+ iface->get_link_index = hypertext_get_link_index;
2913
Index: vcl/unx/gtk/a11y/atkimage.cxx
2914
===================================================================
2915
RCS file: vcl/unx/gtk/a11y/atkimage.cxx
2916
diff -N vcl/unx/gtk/a11y/atkimage.cxx
2917
--- /dev/null 1 Jan 1970 00:00:00 -0000
2918
+++ vcl/unx/gtk/a11y/atkimage.cxx 31 Mar 2006 12:19:39 -0000 1.1.2.5
2920
+/*************************************************************************
2922
+ * OpenOffice.org - a multi-platform office productivity suite
2924
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
2926
+ * $Revision: 1.1.2.1 $
2928
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
2930
+ * The Contents of this file are made available subject to
2931
+ * the terms of GNU Lesser General Public License Version 2.1.
2934
+ * GNU Lesser General Public License Version 2.1
2935
+ * =============================================
2936
+ * Copyright 2005 by Sun Microsystems, Inc.
2937
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
2939
+ * This library is free software; you can redistribute it and/or
2940
+ * modify it under the terms of the GNU Lesser General Public
2941
+ * License version 2.1, as published by the Free Software Foundation.
2943
+ * This library is distributed in the hope that it will be useful,
2944
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2945
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2946
+ * Lesser General Public License for more details.
2948
+ * You should have received a copy of the GNU Lesser General Public
2949
+ * License along with this library; if not, write to the Free Software
2950
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
2951
+ * MA 02111-1307 USA
2953
+ ************************************************************************/
2955
+#include "atkwrapper.hxx"
2957
+#include <com/sun/star/accessibility/XAccessibleImage.hpp>
2961
+using namespace ::com::sun::star;
2964
+static G_CONST_RETURN gchar *
2965
+getAsConst( rtl::OUString rString )
2967
+ static const int nMax = 10;
2968
+ static rtl::OString aUgly[nMax];
2969
+ static int nIdx = 0;
2970
+ nIdx = (nIdx + 1) % nMax;
2971
+ aUgly[nIdx] = rtl::OUStringToOString( rString, RTL_TEXTENCODING_UTF8 );
2972
+ return aUgly[ nIdx ];
2975
+static accessibility::XAccessibleImage*
2976
+ getImage( AtkImage *pImage ) throw (uno::RuntimeException)
2978
+ AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pImage );
2981
+ if( !pWrap->mpImage && pWrap->mpContext )
2983
+ uno::Any any = pWrap->mpContext->queryInterface( accessibility::XAccessibleImage::static_type(NULL) );
2984
+ pWrap->mpImage = reinterpret_cast< accessibility::XAccessibleImage * > (any.pReserved);
2985
+ pWrap->mpImage->acquire();
2988
+ return pWrap->mpImage;
2996
+static G_CONST_RETURN gchar *
2997
+image_get_image_description( AtkImage *image )
3000
+ accessibility::XAccessibleImage* pImage = getImage( image );
3002
+ return getAsConst( pImage->getAccessibleImageDescription() );
3004
+ catch(const uno::Exception& e) {
3005
+ g_warning( "Exception in getAccessibleImageDescription()" );
3012
+image_get_image_position( AtkImage *image,
3015
+ AtkCoordType coord_type )
3018
+ if( ATK_IS_COMPONENT( image ) )
3019
+ atk_component_get_position( ATK_COMPONENT( image ), x, y, coord_type );
3021
+ g_warning( "FIXME: no image position information" );
3025
+image_get_image_size( AtkImage *image,
3032
+ accessibility::XAccessibleImage* pImage = getImage( image );
3035
+ *width = pImage->getAccessibleImageWidth();
3036
+ *height = pImage->getAccessibleImageHeight();
3039
+ catch(const uno::Exception& e) {
3040
+ g_warning( "Exception in getAccessibleImageHeight() or Width" );
3045
+image_set_image_description( AtkImage *, const gchar * )
3047
+ g_warning ("FIXME: no set image description");
3054
+imageIfaceInit (AtkImageIface *iface)
3056
+ g_return_if_fail (iface != NULL);
3058
+ iface->set_image_description = image_set_image_description;
3059
+ iface->get_image_description = image_get_image_description;
3060
+ iface->get_image_position = image_get_image_position;
3061
+ iface->get_image_size = image_get_image_size;
3063
Index: vcl/unx/gtk/a11y/atklistener.cxx
3064
===================================================================
3065
RCS file: vcl/unx/gtk/a11y/atklistener.cxx
3066
diff -N vcl/unx/gtk/a11y/atklistener.cxx
3067
--- /dev/null 1 Jan 1970 00:00:00 -0000
3068
+++ vcl/unx/gtk/a11y/atklistener.cxx 31 Mar 2006 14:09:17 -0000 1.1.2.20
3070
+/*************************************************************************
3072
+ * OpenOffice.org - a multi-platform office productivity suite
3074
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
3076
+ * $Revision: 1.1.2.1 $
3078
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
3080
+ * The Contents of this file are made available subject to
3081
+ * the terms of GNU Lesser General Public License Version 2.1.
3084
+ * GNU Lesser General Public License Version 2.1
3085
+ * =============================================
3086
+ * Copyright 2005 by Sun Microsystems, Inc.
3087
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
3089
+ * This library is free software; you can redistribute it and/or
3090
+ * modify it under the terms of the GNU Lesser General Public
3091
+ * License version 2.1, as published by the Free Software Foundation.
3093
+ * This library is distributed in the hope that it will be useful,
3094
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3095
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3096
+ * Lesser General Public License for more details.
3098
+ * You should have received a copy of the GNU Lesser General Public
3099
+ * License along with this library; if not, write to the Free Software
3100
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
3101
+ * MA 02111-1307 USA
3103
+ ************************************************************************/
3105
+#include <com/sun/star/accessibility/TextSegment.hpp>
3106
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
3107
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
3108
+#include <com/sun/star/accessibility/AccessibleTableModelChange.hpp>
3109
+#include <com/sun/star/accessibility/AccessibleTableModelChangeType.hpp>
3110
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
3112
+#include "atklistener.hxx"
3113
+#include "atkwrapper.hxx"
3115
+#include <rtl/ref.hxx>
3118
+using namespace com::sun::star;
3121
+#define CSTRING_FROM_ANY(i) rtl::OUStringToOString( i.get< rtl::OUString >(), RTL_TEXTENCODING_UTF8 ).getStr()
3123
+AtkListener::AtkListener( AtkObjectWrapper* pWrapper )
3127
+ mpAccessible = ATK_OBJECT( g_object_ref( pWrapper ) );
3128
+ updateChildList( pWrapper->mpContext );
3132
+AtkListener::~AtkListener()
3136
+/*****************************************************************************/
3138
+AtkStateType mapState( const uno::Any &rAny )
3140
+ sal_Int16 nState = accessibility::AccessibleStateType::INVALID;
3142
+ return mapAtkState( nState );
3145
+/*****************************************************************************/
3147
+// XEventListener implementation
3148
+void AtkListener::disposing( const lang::EventObject& ) throw (uno::RuntimeException)
3150
+ if( mpAccessible )
3152
+ // Release all interface references to avoid shutdown problems with
3154
+ atk_object_wrapper_dispose( ATK_OBJECT_WRAPPER( mpAccessible ) );
3156
+ // This is an equivalent to a state change to DEFUNC(T).
3157
+ atk_object_notify_state_change( mpAccessible, ATK_STATE_DEFUNCT, TRUE );
3159
+ if( atk_get_focus_object() == mpAccessible )
3160
+ atk_focus_tracker_notify( NULL );
3162
+ // Release the wrapper object so that it can vanish ..
3163
+ g_object_unref( mpAccessible );
3164
+ mpAccessible = NULL;
3168
+/*****************************************************************************/
3170
+static AtkObject *getObjFromAny( const uno::Any &rAny )
3172
+ uno::Reference< accessibility::XAccessible > xAccessible;
3173
+ rAny >>= xAccessible;
3174
+ return xAccessible.is() ? atk_object_wrapper_ref( xAccessible ) : NULL;
3177
+/*****************************************************************************/
3179
+// Updates the child list held to provide the old IndexInParent on children_changed::remove
3180
+void AtkListener::updateChildList(accessibility::XAccessibleContext* pContext)
3182
+ m_aChildList.clear();
3184
+ uno::Reference< accessibility::XAccessibleStateSet > xStateSet = pContext->getAccessibleStateSet();
3185
+ if( xStateSet.is()
3186
+ && !xStateSet->contains(accessibility::AccessibleStateType::DEFUNC)
3187
+ && !xStateSet->contains(accessibility::AccessibleStateType::MANAGES_DESCENDANTS) )
3189
+ sal_Int32 nChildren = pContext->getAccessibleChildCount();
3190
+ m_aChildList.resize(nChildren);
3191
+ for(sal_Int32 n = 0; n < nChildren; n++)
3193
+ m_aChildList[n] = pContext->getAccessibleChild(n);
3198
+/*****************************************************************************/
3200
+void AtkListener::handleChildAdded(
3201
+ const uno::Reference< accessibility::XAccessibleContext >& rxParent,
3202
+ const uno::Reference< accessibility::XAccessible>& rxAccessible)
3204
+ AtkObject * pChild = atk_object_wrapper_ref( rxAccessible );
3208
+ updateChildList(rxParent.get());
3209
+ g_signal_emit_by_name( mpAccessible, "children_changed::add",
3210
+ atk_object_get_index_in_parent( pChild ), pChild, NULL );
3211
+ g_object_unref( pChild );
3215
+/*****************************************************************************/
3217
+void AtkListener::handleChildRemoved(
3218
+ const uno::Reference< accessibility::XAccessibleContext >& rxParent,
3219
+ const uno::Reference< accessibility::XAccessible>& rxChild)
3221
+ sal_Int32 nIndex = -1;
3223
+ // Locate the child in the children list
3224
+ size_t n, nmax = m_aChildList.size();
3225
+ for( n = 0; n < nmax; ++n )
3227
+ if( rxChild == m_aChildList[n] )
3234
+ // FIXME: two problems here:
3235
+ // a) we get child-removed events for objects that are no real childs
3236
+ // in the accessibility hierarchy
3237
+ // b) spi_atk_bridge_signal_listener ignores the given parameters
3238
+ // for children_changed events and always asks the parent for the
3239
+ // 0. child, which breaks somehow on vanishing list boxes.
3240
+ // Ignoring "remove" events for objects not in the m_aChildList
3244
+ updateChildList(rxParent.get());
3246
+ AtkObject * pChild = atk_object_wrapper_ref( rxChild, false );
3249
+ g_signal_emit_by_name( mpAccessible, "children_changed::remove", nIndex, pChild, NULL );
3250
+ g_object_unref( pChild );
3255
+/*****************************************************************************/
3257
+void AtkListener::handleInvalidateChildren(
3258
+ const uno::Reference< accessibility::XAccessibleContext >& rxParent)
3260
+ // Send notifications for all previous children
3261
+ size_t n = m_aChildList.size();
3264
+ AtkObject * pChild = atk_object_wrapper_ref( m_aChildList[n], false );
3267
+ g_signal_emit_by_name( mpAccessible, "children_changed::remove", n, pChild, NULL );
3268
+ g_object_unref( pChild );
3272
+ updateChildList(rxParent.get());
3274
+ // Send notifications for all new children
3275
+ size_t nmax = m_aChildList.size();
3276
+ for( n = 0; n < nmax; ++n )
3278
+ AtkObject * pChild = atk_object_wrapper_ref( m_aChildList[n] );
3282
+ g_signal_emit_by_name( mpAccessible, "children_changed::add", n, pChild, NULL );
3283
+ g_object_unref( pChild );
3288
+/*****************************************************************************/
3290
+static uno::Reference< accessibility::XAccessibleContext >
3291
+getAccessibleContextFromSource( const uno::Reference< uno::XInterface >& rxSource )
3293
+ uno::Reference< accessibility::XAccessibleContext > xContext(rxSource, uno::UNO_QUERY);
3294
+ if( ! xContext.is() )
3296
+ g_warning( "ERROR: Event source does not implement XAccessibleContext" );
3298
+ // Second try - query for XAccessible, which should give us access to
3299
+ // XAccessibleContext.
3300
+ uno::Reference< accessibility::XAccessible > xAccessible(rxSource, uno::UNO_QUERY);
3301
+ if( xAccessible.is() )
3302
+ xContext = xAccessible->getAccessibleContext();
3308
+/*****************************************************************************/
3310
+// XAccessibleEventListener
3311
+void AtkListener::notifyEvent( const accessibility::AccessibleEventObject& aEvent ) throw( uno::RuntimeException )
3313
+ if( !mpAccessible )
3316
+ switch( aEvent.EventId )
3318
+ // AtkObject signals:
3319
+ // Hierarchy signals
3320
+ case accessibility::AccessibleEventId::CHILD:
3322
+ uno::Reference< accessibility::XAccessibleContext > xParent;
3323
+ uno::Reference< accessibility::XAccessible > xChild;
3325
+ xParent = getAccessibleContextFromSource(aEvent.Source);
3326
+ g_return_if_fail( xParent.is() );
3328
+ if( aEvent.OldValue >>= xChild )
3329
+ handleChildRemoved(xParent, xChild);
3331
+ if( aEvent.NewValue >>= xChild )
3332
+ handleChildAdded(xParent, xChild);
3336
+ case accessibility::AccessibleEventId::INVALIDATE_ALL_CHILDREN:
3338
+ uno::Reference< accessibility::XAccessibleContext > xParent;
3340
+ xParent = getAccessibleContextFromSource(aEvent.Source);
3341
+ g_return_if_fail( xParent.is() );
3343
+ handleInvalidateChildren(xParent);
3347
+ case accessibility::AccessibleEventId::NAME_CHANGED:
3348
+ g_object_notify( G_OBJECT( mpAccessible ), "accessible-name" );
3351
+ case accessibility::AccessibleEventId::DESCRIPTION_CHANGED:
3352
+ g_object_notify( G_OBJECT( mpAccessible ), "accessible-description" );
3355
+ case accessibility::AccessibleEventId::STATE_CHANGED:
3357
+ AtkStateType eOldState = mapState( aEvent.OldValue );
3358
+ AtkStateType eNewState = mapState( aEvent.NewValue );
3360
+ gboolean bState = eNewState != ATK_STATE_INVALID;
3361
+ AtkStateType eRealState = bState ? eNewState : eOldState;
3363
+ atk_object_notify_state_change( mpAccessible, eRealState, bState );
3367
+ case accessibility::AccessibleEventId::BOUNDRECT_CHANGED:
3369
+#ifdef HAS_ATKRECTANGLE
3370
+ if( ATK_IS_COMPONENT( mpAccessible ) )
3372
+ AtkRectangle rect;
3374
+ atk_component_get_extents( ATK_COMPONENT( mpAccessible ),
3381
+ g_signal_emit_by_name( mpAccessible, "bounds_changed", &rect );
3384
+ g_warning( "bounds_changed event for object not implementing AtkComponent\n");
3389
+ case accessibility::AccessibleEventId::VISIBLE_DATA_CHANGED:
3390
+ g_signal_emit_by_name( mpAccessible, "visible-data-changed" );
3393
+ case accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED:
3395
+ AtkObject *pChild = getObjFromAny( aEvent.NewValue );
3398
+ g_signal_emit_by_name( mpAccessible, "active-descendant-changed", pChild );
3399
+ g_object_unref( pChild );
3404
+ // AtkAction signals ...
3405
+ case accessibility::AccessibleEventId::ACTION_CHANGED:
3406
+ g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-actions");
3410
+ case accessibility::AccessibleEventId::CARET_CHANGED:
3413
+ aEvent.NewValue >>= nPos;
3414
+ g_signal_emit_by_name( mpAccessible, "text_caret_moved", nPos );
3417
+ case accessibility::AccessibleEventId::TEXT_CHANGED:
3419
+ // TESTME: and remove this comment:
3420
+ // cf. comphelper/source/misc/accessibletexthelper.cxx (implInitTextChangedEvent)
3421
+ accessibility::TextSegment aDeletedText;
3422
+ accessibility::TextSegment aInsertedText;
3424
+ // TODO: when GNOME starts to send "update" kind of events, change
3425
+ // we need to re-think this implementation as well
3426
+ if( aEvent.OldValue >>= aDeletedText )
3427
+ g_signal_emit_by_name( mpAccessible, "text_changed::delete",
3428
+ (gint) aDeletedText.SegmentStart,
3429
+ (gint)( aDeletedText.SegmentEnd - aDeletedText.SegmentStart ) );
3430
+ if( aEvent.NewValue >>= aInsertedText )
3431
+ g_signal_emit_by_name( mpAccessible, "text_changed::insert",
3432
+ (gint) aInsertedText.SegmentStart,
3433
+ (gint)( aInsertedText.SegmentEnd - aInsertedText.SegmentStart ) );
3437
+ case accessibility::AccessibleEventId::TEXT_SELECTION_CHANGED:
3439
+ g_signal_emit_by_name( mpAccessible, "text-selection-changed" );
3443
+ case accessibility::AccessibleEventId::TEXT_ATTRIBUTE_CHANGED:
3444
+ g_signal_emit_by_name( mpAccessible, "text-attributes-changed" );
3448
+ case accessibility::AccessibleEventId::VALUE_CHANGED:
3449
+ g_object_notify( G_OBJECT( mpAccessible ), "accessible-value" );
3452
+ case accessibility::AccessibleEventId::CONTENT_FLOWS_FROM_RELATION_CHANGED:
3453
+ case accessibility::AccessibleEventId::CONTENT_FLOWS_TO_RELATION_CHANGED:
3454
+ case accessibility::AccessibleEventId::CONTROLLED_BY_RELATION_CHANGED:
3455
+ case accessibility::AccessibleEventId::CONTROLLER_FOR_RELATION_CHANGED:
3456
+ case accessibility::AccessibleEventId::LABEL_FOR_RELATION_CHANGED:
3457
+ case accessibility::AccessibleEventId::LABELED_BY_RELATION_CHANGED:
3458
+ case accessibility::AccessibleEventId::MEMBER_OF_RELATION_CHANGED:
3459
+ case accessibility::AccessibleEventId::SUB_WINDOW_OF_RELATION_CHANGED:
3460
+ // FIXME: ask Bill how Atk copes with this little lot ...
3464
+ case accessibility::AccessibleEventId::TABLE_MODEL_CHANGED:
3466
+ accessibility::AccessibleTableModelChange aChange;
3467
+ aEvent.NewValue >>= aChange;
3469
+ g_warning( "Test me: table model change event" );
3470
+ sal_Int32 nRowsChanged = aChange.LastRow - aChange.FirstRow + 1;
3471
+ sal_Int32 nColumnsChanged = aChange.LastColumn - aChange.FirstColumn + 1;
3473
+ static const struct {
3476
+ } aSignalNames[] =
3478
+ { NULL, NULL }, // dummy
3479
+ { "row_inserted", "column_inserted" }, // INSERT = 1
3480
+ { "row_deleted", "column_deleted" } // DELETE = 2
3482
+ switch( aChange.Type )
3484
+ case accessibility::AccessibleTableModelChangeType::INSERT:
3485
+ case accessibility::AccessibleTableModelChangeType::DELETE:
3486
+ if( nRowsChanged > 0 )
3487
+ g_signal_emit_by_name( G_OBJECT( mpAccessible ),
3488
+ aSignalNames[aChange.Type].row,
3489
+ aChange.FirstRow, nRowsChanged );
3490
+ if( nColumnsChanged > 0 )
3491
+ g_signal_emit_by_name( G_OBJECT( mpAccessible ),
3492
+ aSignalNames[aChange.Type].col,
3493
+ aChange.FirstColumn, nColumnsChanged );
3496
+ case accessibility::AccessibleTableModelChangeType::UPDATE:
3497
+ // This is not really a model change, is it ?
3500
+ g_warning( "TESTME: unusual table model change %d\n", aChange.Type );
3503
+ g_signal_emit_by_name( G_OBJECT( mpAccessible ), "model-changed" );
3507
+ case accessibility::AccessibleEventId::TABLE_COLUMN_HEADER_CHANGED:
3508
+ g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-table-column-header");
3511
+ case accessibility::AccessibleEventId::TABLE_CAPTION_CHANGED:
3512
+ g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-table-caption");
3515
+ case accessibility::AccessibleEventId::TABLE_COLUMN_DESCRIPTION_CHANGED:
3516
+ g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-table-column-description");
3519
+ case accessibility::AccessibleEventId::TABLE_ROW_DESCRIPTION_CHANGED:
3520
+ g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-table-row-description");
3523
+ case accessibility::AccessibleEventId::TABLE_ROW_HEADER_CHANGED:
3524
+ g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-table-row-header");
3527
+ case accessibility::AccessibleEventId::TABLE_SUMMARY_CHANGED:
3528
+ g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-table-summary");
3531
+ case accessibility::AccessibleEventId::SELECTION_CHANGED:
3532
+ g_signal_emit_by_name( G_OBJECT( mpAccessible ), "selection_changed");
3535
+ case accessibility::AccessibleEventId::HYPERTEXT_CHANGED:
3536
+ g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-hypertext-offset");
3540
+ g_warning( "Unknown event notification %d", aEvent.EventId );
3544
Index: vcl/unx/gtk/a11y/atklistener.hxx
3545
===================================================================
3546
RCS file: vcl/unx/gtk/a11y/atklistener.hxx
3547
diff -N vcl/unx/gtk/a11y/atklistener.hxx
3548
--- /dev/null 1 Jan 1970 00:00:00 -0000
3549
+++ vcl/unx/gtk/a11y/atklistener.hxx 15 Feb 2006 10:59:24 -0000 1.1.2.7
3551
+/*************************************************************************
3553
+ * OpenOffice.org - a multi-platform office productivity suite
3555
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
3557
+ * $Revision: 1.1.2.1 $
3559
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
3561
+ * The Contents of this file are made available subject to
3562
+ * the terms of GNU Lesser General Public License Version 2.1.
3565
+ * GNU Lesser General Public License Version 2.1
3566
+ * =============================================
3567
+ * Copyright 2005 by Sun Microsystems, Inc.
3568
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
3570
+ * This library is free software; you can redistribute it and/or
3571
+ * modify it under the terms of the GNU Lesser General Public
3572
+ * License version 2.1, as published by the Free Software Foundation.
3574
+ * This library is distributed in the hope that it will be useful,
3575
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3576
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3577
+ * Lesser General Public License for more details.
3579
+ * You should have received a copy of the GNU Lesser General Public
3580
+ * License along with this library; if not, write to the Free Software
3581
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
3582
+ * MA 02111-1307 USA
3584
+ ************************************************************************/
3586
+#ifndef _ATK_LISTENER_HXX_
3587
+#define _ATK_LISTENER_HXX_
3589
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEEVENTLISTENER_HPP_
3590
+#include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
3593
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
3594
+#include <cppuhelper/implbase1.hxx>
3599
+#include "atkwrapper.hxx"
3601
+typedef std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > AccessibleVector;
3603
+class AtkListener : public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleEventListener >
3606
+ AtkListener(AtkObjectWrapper * pWrapper);
3609
+ virtual void disposing( const ::com::sun::star::lang::EventObject& Source )
3610
+ throw (::com::sun::star::uno::RuntimeException);
3612
+ // XAccessibleEventListener
3613
+ virtual void notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent )
3614
+ throw( ::com::sun::star::uno::RuntimeException );
3616
+ AtkObject *mpAccessible;
3617
+ AccessibleVector m_aChildList;
3621
+ virtual ~AtkListener();
3623
+ // Updates the child list held to provide the old IndexInParent on children_changed::remove
3624
+ void updateChildList(::com::sun::star::accessibility::XAccessibleContext* pContext);
3626
+ // Process CHILD_EVENT notifications with a new child added
3627
+ void handleChildAdded(
3628
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& rxParent,
3629
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxChild);
3631
+ // Process CHILD_EVENT notifications with a child removed
3632
+ void handleChildRemoved(
3633
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& rxParent,
3634
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxChild);
3636
+ // Process INVALIDATE_ALL_CHILDREN notification
3637
+ void handleInvalidateChildren(
3638
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& rxParent);
3641
+#endif /* _ATK_LISTENER_HXX_ */
3643
Index: vcl/unx/gtk/a11y/atkselection.cxx
3644
===================================================================
3645
RCS file: vcl/unx/gtk/a11y/atkselection.cxx
3646
diff -N vcl/unx/gtk/a11y/atkselection.cxx
3647
--- /dev/null 1 Jan 1970 00:00:00 -0000
3648
+++ vcl/unx/gtk/a11y/atkselection.cxx 15 Feb 2006 10:59:24 -0000 1.1.2.6
3650
+/*************************************************************************
3652
+ * OpenOffice.org - a multi-platform office productivity suite
3654
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
3656
+ * $Revision: 1.1.2.1 $
3658
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
3660
+ * The Contents of this file are made available subject to
3661
+ * the terms of GNU Lesser General Public License Version 2.1.
3664
+ * GNU Lesser General Public License Version 2.1
3665
+ * =============================================
3666
+ * Copyright 2005 by Sun Microsystems, Inc.
3667
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
3669
+ * This library is free software; you can redistribute it and/or
3670
+ * modify it under the terms of the GNU Lesser General Public
3671
+ * License version 2.1, as published by the Free Software Foundation.
3673
+ * This library is distributed in the hope that it will be useful,
3674
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3675
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3676
+ * Lesser General Public License for more details.
3678
+ * You should have received a copy of the GNU Lesser General Public
3679
+ * License along with this library; if not, write to the Free Software
3680
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
3681
+ * MA 02111-1307 USA
3683
+ ************************************************************************/
3685
+#include "atkwrapper.hxx"
3687
+#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
3691
+using namespace ::com::sun::star;
3693
+static accessibility::XAccessibleSelection*
3694
+ getSelection( AtkSelection *pSelection ) throw (uno::RuntimeException)
3696
+ AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pSelection );
3699
+ if( !pWrap->mpSelection && pWrap->mpContext )
3701
+ uno::Any any = pWrap->mpContext->queryInterface( accessibility::XAccessibleSelection::static_type(NULL) );
3702
+ pWrap->mpSelection = reinterpret_cast< accessibility::XAccessibleSelection * > (any.pReserved);
3703
+ pWrap->mpSelection->acquire();
3706
+ return pWrap->mpSelection;
3715
+selection_add_selection( AtkSelection *selection,
3719
+ accessibility::XAccessibleSelection* pSelection = getSelection( selection );
3722
+ pSelection->selectAccessibleChild( i );
3726
+ catch(const uno::Exception& e) {
3727
+ g_warning( "Exception in selectAccessibleChild()" );
3734
+selection_clear_selection( AtkSelection *selection )
3737
+ accessibility::XAccessibleSelection* pSelection = getSelection( selection );
3740
+ pSelection->clearAccessibleSelection();
3744
+ catch(const uno::Exception& e) {
3745
+ g_warning( "Exception in selectAccessibleChild()" );
3752
+selection_ref_selection( AtkSelection *selection,
3756
+ accessibility::XAccessibleSelection* pSelection = getSelection( selection );
3758
+ return atk_object_wrapper_ref( pSelection->getSelectedAccessibleChild( i ) );
3760
+ catch(const uno::Exception& e) {
3761
+ g_warning( "Exception in getSelectedAccessibleChild()" );
3768
+selection_get_selection_count( AtkSelection *selection)
3771
+ accessibility::XAccessibleSelection* pSelection = getSelection( selection );
3773
+ return pSelection->getSelectedAccessibleChildCount();
3775
+ catch(const uno::Exception& e) {
3776
+ g_warning( "Exception in getSelectedAccessibleChildCount()" );
3783
+selection_is_child_selected( AtkSelection *selection,
3787
+ accessibility::XAccessibleSelection* pSelection = getSelection( selection );
3789
+ return pSelection->isAccessibleChildSelected( i );
3791
+ catch(const uno::Exception& e) {
3792
+ g_warning( "Exception in getSelectedAccessibleChildCount()" );
3799
+selection_remove_selection( AtkSelection *selection,
3803
+ accessibility::XAccessibleSelection* pSelection = getSelection( selection );
3806
+ pSelection->deselectAccessibleChild( i );
3810
+ catch(const uno::Exception& e) {
3811
+ g_warning( "Exception in getSelectedAccessibleChildCount()" );
3818
+selection_select_all_selection( AtkSelection *selection)
3821
+ accessibility::XAccessibleSelection* pSelection = getSelection( selection );
3824
+ pSelection->selectAllAccessibleChildren();
3828
+ catch(const uno::Exception& e) {
3829
+ g_warning( "Exception in getSelectedAccessibleChildCount()" );
3838
+selectionIfaceInit( AtkSelectionIface *iface)
3840
+ g_return_if_fail (iface != NULL);
3842
+ iface->add_selection = selection_add_selection;
3843
+ iface->clear_selection = selection_clear_selection;
3844
+ iface->ref_selection = selection_ref_selection;
3845
+ iface->get_selection_count = selection_get_selection_count;
3846
+ iface->is_child_selected = selection_is_child_selected;
3847
+ iface->remove_selection = selection_remove_selection;
3848
+ iface->select_all_selection = selection_select_all_selection;
3850
Index: vcl/unx/gtk/a11y/atktable.cxx
3851
===================================================================
3852
RCS file: vcl/unx/gtk/a11y/atktable.cxx
3853
diff -N vcl/unx/gtk/a11y/atktable.cxx
3854
--- /dev/null 1 Jan 1970 00:00:00 -0000
3855
+++ vcl/unx/gtk/a11y/atktable.cxx 31 Mar 2006 12:19:39 -0000 1.1.2.8
3857
+/*************************************************************************
3859
+ * OpenOffice.org - a multi-platform office productivity suite
3861
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
3863
+ * $Revision: 1.1.2.1 $
3865
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
3867
+ * The Contents of this file are made available subject to
3868
+ * the terms of GNU Lesser General Public License Version 2.1.
3871
+ * GNU Lesser General Public License Version 2.1
3872
+ * =============================================
3873
+ * Copyright 2005 by Sun Microsystems, Inc.
3874
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
3876
+ * This library is free software; you can redistribute it and/or
3877
+ * modify it under the terms of the GNU Lesser General Public
3878
+ * License version 2.1, as published by the Free Software Foundation.
3880
+ * This library is distributed in the hope that it will be useful,
3881
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3882
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3883
+ * Lesser General Public License for more details.
3885
+ * You should have received a copy of the GNU Lesser General Public
3886
+ * License along with this library; if not, write to the Free Software
3887
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
3888
+ * MA 02111-1307 USA
3890
+ ************************************************************************/
3892
+#include "atkwrapper.hxx"
3894
+#include <com/sun/star/accessibility/XAccessibleTable.hpp>
3896
+#ifdef ENABLE_TRACING
3900
+using namespace ::com::sun::star;
3902
+static inline AtkObject *
3903
+atk_object_wrapper_conditional_ref( const uno::Reference< accessibility::XAccessible >& rxAccessible )
3905
+#ifdef ENABLE_TRACING
3906
+ fprintf( stderr, ": %p\n", rxAccessible.get() );
3909
+ if( rxAccessible.is() )
3910
+ return atk_object_wrapper_ref( rxAccessible );
3915
+/*****************************************************************************/
3918
+static G_CONST_RETURN gchar *
3919
+getAsConst( rtl::OUString rString )
3921
+ static const int nMax = 10;
3922
+ static rtl::OString aUgly[nMax];
3923
+ static int nIdx = 0;
3924
+ nIdx = (nIdx + 1) % nMax;
3925
+ aUgly[nIdx] = rtl::OUStringToOString( rString, RTL_TEXTENCODING_UTF8 );
3926
+ return aUgly[ nIdx ];
3929
+/*****************************************************************************/
3931
+static accessibility::XAccessibleTable*
3932
+ getTable( AtkTable *pTable ) throw (uno::RuntimeException)
3934
+ AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pTable );
3937
+ if( !pWrap->mpTable && pWrap->mpContext )
3939
+ uno::Any any = pWrap->mpContext->queryInterface( accessibility::XAccessibleTable::static_type(NULL) );
3940
+ pWrap->mpTable = reinterpret_cast< accessibility::XAccessibleTable * > (any.pReserved);
3941
+ pWrap->mpTable->acquire();
3944
+ return pWrap->mpTable;
3950
+/*****************************************************************************/
3955
+table_wrapper_ref_at (AtkTable *table,
3960
+ accessibility::XAccessibleTable* pTable = getTable( table );
3962
+#ifdef ENABLE_TRACING
3964
+ fprintf(stderr, "getAccessibleCellAt( %u, %u ) returns", row, column );
3966
+ if( column >= 255 )
3967
+ fprintf(stderr, "getAccessibleCellAt( %u, %u ) returns", row, column );
3972
+ return atk_object_wrapper_conditional_ref( pTable->getAccessibleCellAt( row, column ) );
3975
+ catch(const uno::Exception& e) {
3976
+ g_warning( "Exception in getAccessibleCellAt()" );
3982
+/*****************************************************************************/
3985
+table_wrapper_get_index_at (AtkTable *table,
3990
+ accessibility::XAccessibleTable* pTable = getTable( table );
3992
+#ifdef ENABLE_TRACING
3994
+ fprintf(stderr, "getAccessibleIndex( %u, %u ) returns %u\n",
3995
+ row, column, pTable->getAccessibleIndex( row, column ) );
3999
+ return pTable->getAccessibleIndex( row, column );
4001
+ catch(const uno::Exception& e) {
4002
+ g_warning( "Exception in getAccessibleIndex()" );
4008
+/*****************************************************************************/
4011
+table_wrapper_get_column_at_index (AtkTable *table,
4015
+ accessibility::XAccessibleTable* pTable = getTable( table );
4017
+#ifdef ENABLE_TRACING
4019
+ fprintf(stderr, "getAccessibleColumn( %u ) returns %u\n",
4020
+ nIndex, pTable->getAccessibleColumn( nIndex ) );
4024
+ return pTable->getAccessibleColumn( nIndex );
4026
+ catch(const uno::Exception& e) {
4027
+ g_warning( "Exception in getAccessibleColumn()" );
4033
+/*****************************************************************************/
4036
+table_wrapper_get_row_at_index( AtkTable *table,
4040
+ accessibility::XAccessibleTable* pTable = getTable( table );
4042
+#ifdef ENABLE_TRACING
4044
+ fprintf(stderr, "getAccessibleRow( %u ) returns %u\n",
4045
+ nIndex, pTable->getAccessibleRow( nIndex ) );
4049
+ return pTable->getAccessibleRow( nIndex );
4051
+ catch(const uno::Exception& e) {
4052
+ g_warning( "Exception in getAccessibleRow()" );
4058
+/*****************************************************************************/
4061
+table_wrapper_get_n_columns( AtkTable *table )
4064
+ accessibility::XAccessibleTable* pTable = getTable( table );
4066
+#ifdef ENABLE_TRACING
4068
+ fprintf(stderr, "XAccessibleTable::getAccessibleColumnCount returns %u\n",
4069
+ pTable->getAccessibleColumnCount() );
4073
+ return pTable->getAccessibleColumnCount();
4075
+ catch(const uno::Exception& e) {
4076
+ g_warning( "Exception in getAccessibleColumnCount()" );
4082
+/*****************************************************************************/
4085
+table_wrapper_get_n_rows( AtkTable *table )
4088
+ accessibility::XAccessibleTable* pTable = getTable( table );
4090
+#ifdef ENABLE_TRACING
4092
+ fprintf(stderr, "getAccessibleRowCount() returns %u\n",
4093
+ pTable->getAccessibleRowCount() );
4097
+ return pTable->getAccessibleRowCount();
4099
+ catch(const uno::Exception& e) {
4100
+ g_warning( "Exception in getAccessibleRowCount()" );
4106
+/*****************************************************************************/
4109
+table_wrapper_get_column_extent_at( AtkTable *table,
4114
+ accessibility::XAccessibleTable* pTable = getTable( table );
4116
+#ifdef ENABLE_TRACING
4118
+ fprintf(stderr, "getAccessibleColumnExtentAt( %u, %u ) returns %u\n",
4119
+ row, column, pTable->getAccessibleColumnExtentAt( row, column ) );
4123
+ return pTable->getAccessibleColumnExtentAt( row, column );
4125
+ catch(const uno::Exception& e) {
4126
+ g_warning( "Exception in getAccessibleColumnExtentAt()" );
4132
+/*****************************************************************************/
4135
+table_wrapper_get_row_extent_at( AtkTable *table,
4140
+ accessibility::XAccessibleTable* pTable = getTable( table );
4142
+#ifdef ENABLE_TRACING
4144
+ fprintf(stderr, "getAccessibleRowExtentAt( %u, %u ) returns %u\n",
4145
+ row, column, pTable->getAccessibleRowExtentAt( row, column ) );
4149
+ return pTable->getAccessibleRowExtentAt( row, column );
4151
+ catch(const uno::Exception& e) {
4152
+ g_warning( "Exception in getAccessibleRowExtentAt()" );
4158
+/*****************************************************************************/
4161
+table_wrapper_get_caption( AtkTable *table )
4164
+ accessibility::XAccessibleTable* pTable = getTable( table );
4166
+#ifdef ENABLE_TRACING
4168
+ fprintf(stderr, "getAccessibleCaption() returns" );
4172
+ return atk_object_wrapper_conditional_ref( pTable->getAccessibleCaption() );
4175
+ catch(const uno::Exception& e) {
4176
+ g_warning( "Exception in getAccessibleCaption()" );
4182
+/*****************************************************************************/
4184
+static G_CONST_RETURN gchar *
4185
+table_wrapper_get_row_description( AtkTable *table,
4189
+ accessibility::XAccessibleTable* pTable = getTable( table );
4191
+#ifdef ENABLE_TRACING
4193
+ fprintf(stderr, "getAccessibleRowDescription( %u ) returns %s\n",
4194
+ row, getAsConst( pTable->getAccessibleRowDescription( row ) ) );
4198
+ return getAsConst( pTable->getAccessibleRowDescription( row ) );
4200
+ catch(const uno::Exception& e) {
4201
+ g_warning( "Exception in getAccessibleRowDescription()" );
4207
+/*****************************************************************************/
4209
+static G_CONST_RETURN gchar *
4210
+table_wrapper_get_column_description( AtkTable *table,
4214
+ accessibility::XAccessibleTable* pTable = getTable( table );
4216
+#ifdef ENABLE_TRACING
4218
+ fprintf(stderr, "getAccessibleColumnDescription( %u ) returns %s\n",
4219
+ column, getAsConst( pTable->getAccessibleColumnDescription( column ) ) );
4223
+ return getAsConst( pTable->getAccessibleColumnDescription( column ) );
4225
+ catch(const uno::Exception& e) {
4226
+ g_warning( "Exception in getAccessibleColumnDescription()" );
4232
+/*****************************************************************************/
4235
+table_wrapper_get_row_header( AtkTable *table,
4239
+ accessibility::XAccessibleTable* pTable = getTable( table );
4242
+ uno::Reference< accessibility::XAccessibleTable > xRowHeaders( pTable->getAccessibleRowHeaders() );
4244
+#ifdef ENABLE_TRACING
4245
+ if( xRowHeaders.is() )
4246
+ fprintf(stderr, "getAccessibleRowHeader( %u )->getAccessibleCellAt( 0, %u ) returns",
4249
+ fprintf(stderr, "getAccessibleRowHeader( %u ) returns %p\n", row, xRowHeaders.get() );
4252
+ if( xRowHeaders.is() )
4253
+ return atk_object_wrapper_conditional_ref( xRowHeaders->getAccessibleCellAt( row, 0 ) );
4256
+ catch(const uno::Exception& e) {
4257
+ g_warning( "Exception in getAccessibleRowHeaders()" );
4263
+/*****************************************************************************/
4266
+table_wrapper_get_column_header( AtkTable *table,
4270
+ accessibility::XAccessibleTable* pTable = getTable( table );
4274
+ uno::Reference< accessibility::XAccessibleTable > xColumnHeaders( pTable->getAccessibleColumnHeaders() );
4276
+#ifdef ENABLE_TRACING
4277
+ if( xColumnHeaders.is() )
4278
+ fprintf(stderr, "getAccessibleColumnHeader( %u )->getAccessibleCellAt( 0, %u ) returns",
4281
+ fprintf(stderr, "getAccessibleColumnHeader( %u ) returns %p\n", column, xColumnHeaders.get() );
4284
+ if( xColumnHeaders.is() )
4285
+ return atk_object_wrapper_conditional_ref( xColumnHeaders->getAccessibleCellAt( 0, column ) );
4288
+ catch(const uno::Exception& e) {
4289
+ g_warning( "Exception in getAccessibleColumnHeaders()" );
4295
+/*****************************************************************************/
4298
+table_wrapper_get_summary( AtkTable *table )
4301
+ accessibility::XAccessibleTable* pTable = getTable( table );
4303
+#ifdef ENABLE_TRACING
4305
+ fprintf(stderr, "getAccessibleSummary() returns" );
4310
+ // FIXME: Summary ??
4311
+// AtkObject* summary;
4312
+ return atk_object_wrapper_conditional_ref( pTable->getAccessibleSummary() );
4315
+ catch(const uno::Exception& e) {
4316
+ g_warning( "Exception in getAccessibleSummary()" );
4322
+/*****************************************************************************/
4325
+convertToGIntArray( const uno::Sequence< ::sal_Int32 >& aSequence, gint **pSelected )
4327
+ if( aSequence.getLength() )
4329
+ *pSelected = g_new( gint, aSequence.getLength() );
4331
+ for( sal_Int32 i = 0; i < aSequence.getLength(); i++ )
4332
+ (*pSelected) [i] = aSequence[i];
4335
+ return aSequence.getLength();
4338
+/*****************************************************************************/
4341
+table_wrapper_get_selected_columns( AtkTable *table,
4342
+ gint **pSelected )
4344
+ *pSelected = NULL;
4346
+ accessibility::XAccessibleTable* pTable = getTable( table );
4348
+#ifdef ENABLE_TRACING
4350
+ fprintf(stderr, "getSelectedAccessibleColumns() \n" );
4354
+ return convertToGIntArray( pTable->getSelectedAccessibleColumns(), pSelected );
4356
+ catch(const uno::Exception& e) {
4357
+ g_warning( "Exception in getSelectedAccessibleColumns()" );
4363
+/*****************************************************************************/
4366
+table_wrapper_get_selected_rows( AtkTable *table,
4367
+ gint **pSelected )
4369
+ *pSelected = NULL;
4371
+ accessibility::XAccessibleTable* pTable = getTable( table );
4373
+#ifdef ENABLE_TRACING
4375
+ fprintf(stderr, "getSelectedAccessibleRows() \n" );
4379
+ return convertToGIntArray( pTable->getSelectedAccessibleRows(), pSelected );
4381
+ catch(const uno::Exception& e) {
4382
+ g_warning( "Exception in getSelectedAccessibleRows()" );
4388
+/*****************************************************************************/
4391
+table_wrapper_is_column_selected( AtkTable *table,
4395
+ accessibility::XAccessibleTable* pTable = getTable( table );
4397
+#ifdef ENABLE_TRACING
4399
+ fprintf(stderr, "isAccessibleColumnSelected( %u ) returns %s\n",
4400
+ column, pTable->isAccessibleColumnSelected( column ) ? "true" : "false" );
4404
+ return pTable->isAccessibleColumnSelected( column );
4406
+ catch(const uno::Exception& e) {
4407
+ g_warning( "Exception in isAccessibleColumnSelected()" );
4413
+/*****************************************************************************/
4416
+table_wrapper_is_row_selected( AtkTable *table,
4420
+ accessibility::XAccessibleTable* pTable = getTable( table );
4422
+#ifdef ENABLE_TRACING
4424
+ fprintf(stderr, "isAccessibleRowSelected( %u ) returns %s\n",
4425
+ row, pTable->isAccessibleRowSelected( row ) ? "true" : "false" );
4429
+ return pTable->isAccessibleRowSelected( row );
4431
+ catch(const uno::Exception& e) {
4432
+ g_warning( "Exception in isAccessibleRowSelected()" );
4438
+/*****************************************************************************/
4441
+table_wrapper_is_selected( AtkTable *table,
4446
+ accessibility::XAccessibleTable* pTable = getTable( table );
4448
+#ifdef ENABLE_TRACING
4450
+ fprintf(stderr, "isAccessibleSelected( %u, %u ) returns %s\n",
4451
+ row, column, pTable->isAccessibleSelected( row , column ) ? "true" : "false" );
4455
+ return pTable->isAccessibleSelected( row, column );
4457
+ catch(const uno::Exception& e) {
4458
+ g_warning( "Exception in isAccessibleSelected()" );
4464
+/*****************************************************************************/
4467
+table_wrapper_add_row_selection( AtkTable *, gint )
4469
+ g_warning( "FIXME: no simple analogue for add_row_selection" );
4473
+/*****************************************************************************/
4476
+table_wrapper_remove_row_selection( AtkTable *, gint )
4478
+ g_warning( "FIXME: no simple analogue for remove_row_selection" );
4482
+/*****************************************************************************/
4485
+table_wrapper_add_column_selection( AtkTable *, gint )
4487
+ g_warning( "FIXME: no simple analogue for add_column_selection" );
4491
+/*****************************************************************************/
4494
+table_wrapper_remove_column_selection( AtkTable *, gint )
4496
+ g_warning( "FIXME: no simple analogue for remove_column_selection" );
4500
+/*****************************************************************************/
4503
+table_wrapper_set_caption( AtkTable *, AtkObject * )
4504
+{ // meaningless helper
4507
+/*****************************************************************************/
4510
+table_wrapper_set_column_description( AtkTable *, gint, const gchar * )
4511
+{ // meaningless helper
4515
+/*****************************************************************************/
4518
+table_wrapper_set_column_header( AtkTable *, gint, AtkObject * )
4519
+{ // meaningless helper
4523
+/*****************************************************************************/
4526
+table_wrapper_set_row_description( AtkTable *, gint, const gchar * )
4527
+{ // meaningless helper
4530
+/*****************************************************************************/
4533
+table_wrapper_set_row_header( AtkTable *, gint, AtkObject * )
4534
+{ // meaningless helper
4537
+/*****************************************************************************/
4540
+table_wrapper_set_summary( AtkTable *, AtkObject * )
4541
+{ // meaningless helper
4544
+/*****************************************************************************/
4549
+tableIfaceInit (AtkTableIface *iface)
4551
+ g_return_if_fail (iface != NULL);
4553
+ iface->ref_at = table_wrapper_ref_at;
4554
+ iface->get_n_rows = table_wrapper_get_n_rows;
4555
+ iface->get_n_columns = table_wrapper_get_n_columns;
4556
+ iface->get_index_at = table_wrapper_get_index_at;
4557
+ iface->get_column_at_index = table_wrapper_get_column_at_index;
4558
+ iface->get_row_at_index = table_wrapper_get_row_at_index;
4559
+ iface->is_row_selected = table_wrapper_is_row_selected;
4560
+ iface->is_selected = table_wrapper_is_selected;
4561
+ iface->get_selected_rows = table_wrapper_get_selected_rows;
4562
+ iface->add_row_selection = table_wrapper_add_row_selection;
4563
+ iface->remove_row_selection = table_wrapper_remove_row_selection;
4564
+ iface->add_column_selection = table_wrapper_add_column_selection;
4565
+ iface->remove_column_selection = table_wrapper_remove_column_selection;
4566
+ iface->get_selected_columns = table_wrapper_get_selected_columns;
4567
+ iface->is_column_selected = table_wrapper_is_column_selected;
4568
+ iface->get_column_extent_at = table_wrapper_get_column_extent_at;
4569
+ iface->get_row_extent_at = table_wrapper_get_row_extent_at;
4570
+ iface->get_row_header = table_wrapper_get_row_header;
4571
+ iface->set_row_header = table_wrapper_set_row_header;
4572
+ iface->get_column_header = table_wrapper_get_column_header;
4573
+ iface->set_column_header = table_wrapper_set_column_header;
4574
+ iface->get_caption = table_wrapper_get_caption;
4575
+ iface->set_caption = table_wrapper_set_caption;
4576
+ iface->get_summary = table_wrapper_get_summary;
4577
+ iface->set_summary = table_wrapper_set_summary;
4578
+ iface->get_row_description = table_wrapper_get_row_description;
4579
+ iface->set_row_description = table_wrapper_set_row_description;
4580
+ iface->get_column_description = table_wrapper_get_column_description;
4581
+ iface->set_column_description = table_wrapper_set_column_description;
4583
Index: vcl/unx/gtk/a11y/atktext.cxx
4584
===================================================================
4585
RCS file: vcl/unx/gtk/a11y/atktext.cxx
4586
diff -N vcl/unx/gtk/a11y/atktext.cxx
4587
--- /dev/null 1 Jan 1970 00:00:00 -0000
4588
+++ vcl/unx/gtk/a11y/atktext.cxx 13 Apr 2006 12:48:16 -0000 1.1.2.14
4590
+/*************************************************************************
4592
+ * OpenOffice.org - a multi-platform office productivity suite
4594
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
4596
+ * $Revision: 1.1.2.1 $
4598
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
4600
+ * The Contents of this file are made available subject to
4601
+ * the terms of GNU Lesser General Public License Version 2.1.
4604
+ * GNU Lesser General Public License Version 2.1
4605
+ * =============================================
4606
+ * Copyright 2005 by Sun Microsystems, Inc.
4607
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
4609
+ * This library is free software; you can redistribute it and/or
4610
+ * modify it under the terms of the GNU Lesser General Public
4611
+ * License version 2.1, as published by the Free Software Foundation.
4613
+ * This library is distributed in the hope that it will be useful,
4614
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4615
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4616
+ * Lesser General Public License for more details.
4618
+ * You should have received a copy of the GNU Lesser General Public
4619
+ * License along with this library; if not, write to the Free Software
4620
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
4621
+ * MA 02111-1307 USA
4623
+ ************************************************************************/
4625
+#include "atkwrapper.hxx"
4626
+#include "atktextattributes.hxx"
4628
+#include <com/sun/star/accessibility/AccessibleTextType.hpp>
4629
+#include <com/sun/star/accessibility/TextSegment.hpp>
4630
+#include <com/sun/star/accessibility/XAccessibleText.hpp>
4632
+using namespace ::com::sun::star;
4635
+text_type_from_boundary(AtkTextBoundary boundary_type)
4637
+ switch(boundary_type)
4639
+ case ATK_TEXT_BOUNDARY_CHAR:
4640
+ return accessibility::AccessibleTextType::CHARACTER;
4641
+ case ATK_TEXT_BOUNDARY_WORD_START:
4642
+ case ATK_TEXT_BOUNDARY_WORD_END:
4643
+ return accessibility::AccessibleTextType::WORD;
4644
+ case ATK_TEXT_BOUNDARY_SENTENCE_START:
4645
+ case ATK_TEXT_BOUNDARY_SENTENCE_END:
4646
+ return accessibility::AccessibleTextType::SENTENCE;
4647
+ case ATK_TEXT_BOUNDARY_LINE_START:
4648
+ case ATK_TEXT_BOUNDARY_LINE_END:
4649
+ return accessibility::AccessibleTextType::LINE;
4655
+/*****************************************************************************/
4658
+adjust_boundaries( accessibility::XAccessibleText* pText,
4659
+ accessibility::TextSegment& rTextSegment,
4660
+ AtkTextBoundary boundary_type,
4661
+ gint * start_offset, gint * end_offset )
4663
+ accessibility::TextSegment aTextSegment;
4664
+ rtl::OUString aString;
4665
+ gint start = 0, end = 0;
4667
+ if( rTextSegment.SegmentText.getLength() > 0 )
4669
+ switch(boundary_type)
4671
+ case ATK_TEXT_BOUNDARY_CHAR:
4672
+ start = rTextSegment.SegmentStart;
4673
+ end = rTextSegment.SegmentEnd;
4674
+ aString = rTextSegment.SegmentText;
4677
+ case ATK_TEXT_BOUNDARY_WORD_START:
4678
+ case ATK_TEXT_BOUNDARY_SENTENCE_START:
4679
+ case ATK_TEXT_BOUNDARY_LINE_START:
4680
+ start = rTextSegment.SegmentStart;
4682
+ // Determine the start index of the next segment
4683
+ aTextSegment = pText->getTextBehindIndex(rTextSegment.SegmentEnd,
4684
+ text_type_from_boundary(boundary_type));
4685
+ if( aTextSegment.SegmentText.getLength() > 0 )
4686
+ end = aTextSegment.SegmentStart - 1;
4688
+ end = pText->getCharacterCount();
4690
+ aString = pText->getTextRange(start, end);
4693
+ case ATK_TEXT_BOUNDARY_WORD_END:
4694
+ case ATK_TEXT_BOUNDARY_SENTENCE_END:
4695
+ case ATK_TEXT_BOUNDARY_LINE_END:
4696
+ end = rTextSegment.SegmentEnd;
4698
+ // Determine the end index of the previous segment
4699
+ aTextSegment = pText->getTextBeforeIndex(rTextSegment.SegmentStart,
4700
+ text_type_from_boundary(boundary_type));
4701
+ if( aTextSegment.SegmentText.getLength() > 0 )
4702
+ start = aTextSegment.SegmentEnd + 1;
4706
+ aString = pText->getTextRange(start, end);
4714
+ *start_offset = start;
4715
+ *end_offset = end;
4716
+ return OUStringToGChar(aString);
4719
+/*****************************************************************************/
4721
+static accessibility::XAccessibleText*
4722
+ getText( AtkText *pText ) throw (uno::RuntimeException)
4724
+ AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pText );
4727
+ if( !pWrap->mpText && pWrap->mpContext )
4729
+ uno::Any any = pWrap->mpContext->queryInterface( accessibility::XAccessibleText::static_type(NULL) );
4730
+ pWrap->mpText = reinterpret_cast< accessibility::XAccessibleText * > (any.pReserved);
4731
+ pWrap->mpText->acquire();
4734
+ return pWrap->mpText;
4740
+/*****************************************************************************/
4745
+text_wrapper_get_text (AtkText *text,
4746
+ gint start_offset,
4749
+ gchar * ret = NULL;
4751
+ g_return_val_if_fail( end_offset > start_offset, NULL );
4754
+ accessibility::XAccessibleText* pText = getText( text );
4757
+ rtl::OString aUtf8 = rtl::OUStringToOString( pText->getText(), RTL_TEXTENCODING_UTF8 );
4758
+ if( -1 == end_offset )
4759
+ ret = g_strdup( aUtf8.getStr() );
4761
+ ret = g_strndup( aUtf8.getStr() + start_offset, end_offset - start_offset );
4764
+ catch(const uno::Exception& e) {
4765
+ g_warning( "Exception in getText()" );
4772
+text_wrapper_get_text_after_offset (AtkText *text,
4774
+ AtkTextBoundary boundary_type,
4775
+ gint *start_offset,
4779
+ accessibility::XAccessibleText* pText = getText( text );
4782
+ accessibility::TextSegment aTextSegment = pText->getTextBehindIndex(offset, text_type_from_boundary(boundary_type));
4783
+ return adjust_boundaries(pText, aTextSegment, boundary_type, start_offset, end_offset);
4786
+ catch(const uno::Exception& e) {
4787
+ g_warning( "Exception in get_text_after_offset()" );
4794
+text_wrapper_get_text_at_offset (AtkText *text,
4796
+ AtkTextBoundary boundary_type,
4797
+ gint *start_offset,
4801
+ accessibility::XAccessibleText* pText = getText( text );
4804
+ accessibility::TextSegment aTextSegment = pText->getTextAtIndex(offset, text_type_from_boundary(boundary_type));
4805
+ return adjust_boundaries(pText, aTextSegment, boundary_type, start_offset, end_offset);
4808
+ catch(const uno::Exception& e) {
4809
+ g_warning( "Exception in get_text_at_offset()" );
4816
+text_wrapper_get_character_at_offset (AtkText *text,
4822
+ gchar * char_as_string =
4823
+ text_wrapper_get_text_at_offset(text, offset, ATK_TEXT_BOUNDARY_CHAR,
4825
+ if( char_as_string )
4827
+ uc = g_utf8_get_char( char_as_string );
4828
+ g_free( char_as_string );
4835
+text_wrapper_get_text_before_offset (AtkText *text,
4837
+ AtkTextBoundary boundary_type,
4838
+ gint *start_offset,
4842
+ accessibility::XAccessibleText* pText = getText( text );
4845
+ accessibility::TextSegment aTextSegment = pText->getTextBeforeIndex(offset, text_type_from_boundary(boundary_type));
4846
+ return adjust_boundaries(pText, aTextSegment, boundary_type, start_offset, end_offset);
4849
+ catch(const uno::Exception& e) {
4850
+ g_warning( "Exception in text_before_offset()" );
4857
+text_wrapper_get_caret_offset (AtkText *text)
4860
+ accessibility::XAccessibleText* pText = getText( text );
4862
+ return pText->getCaretPosition();
4864
+ catch(const uno::Exception& e) {
4865
+ g_warning( "Exception in getCaretPosition()" );
4872
+text_wrapper_set_caret_offset (AtkText *text,
4876
+ accessibility::XAccessibleText* pText = getText( text );
4878
+ return pText->setCaretPosition( offset );
4880
+ catch(const uno::Exception& e) {
4881
+ g_warning( "Exception in setCaretPosition()" );
4887
+static AtkAttributeSet *
4888
+text_wrapper_get_run_attributes( AtkText *text,
4890
+ gint *start_offset,
4893
+ AtkAttributeSet *pSet = NULL;
4896
+ accessibility::XAccessibleText* pText = getText( text );
4899
+ uno::Sequence< beans::PropertyValue > aAttributeList =
4900
+ pText->getCharacterAttributes( offset, uno::Sequence< rtl::OUString > () );
4902
+ pSet = attribute_set_new_from_property_values( aAttributeList, beans::PropertyState_DIRECT_VALUE );
4904
+ accessibility::TextSegment aTextSegment =
4905
+ pText->getTextAtIndex(offset, accessibility::AccessibleTextType::ATTRIBUTE_RUN);
4907
+ *start_offset = aTextSegment.SegmentStart;
4908
+ *end_offset = aTextSegment.SegmentEnd + 1; // FIXME: TESTME
4911
+ catch(const uno::Exception& e) {
4913
+ g_warning( "Exception in get_run_attributes()" );
4917
+ atk_attribute_set_free( pSet );
4925
+static AtkAttributeSet *
4926
+text_wrapper_get_default_attributes( AtkText * )
4928
+ // currently there is no way to determine the default values. Maybe getCharacterAttributes
4929
+ // should return default and direct values ??
4930
+ g_warning( "FIXME: get_default_attributes unimplemented - needs new UNO API semantic" );
4935
+text_wrapper_get_character_extents( AtkText *text,
4941
+ AtkCoordType coords )
4944
+ accessibility::XAccessibleText* pText = getText( text );
4947
+ *x = *y = *width = *height = 0;
4948
+ awt::Rectangle aRect = pText->getCharacterBounds( offset );
4950
+ gint origin_x = 0;
4951
+ gint origin_y = 0;
4953
+ if( coords == ATK_XY_SCREEN )
4955
+ g_return_if_fail( ATK_IS_COMPONENT( text ) );
4956
+ atk_component_get_position( ATK_COMPONENT( text ), &origin_x, &origin_y, coords);
4959
+ *x = aRect.X + origin_x;
4960
+ *y = aRect.Y + origin_y;
4961
+ *width = aRect.Width;
4962
+ *height = aRect.Height;
4965
+ catch(const uno::Exception& e) {
4966
+ g_warning( "Exception in getCharacterBounds" );
4971
+text_wrapper_get_character_count (AtkText *text)
4974
+ accessibility::XAccessibleText* pText = getText( text );
4976
+ return pText->getCharacterCount();
4978
+ catch(const uno::Exception& e) {
4979
+ g_warning( "Exception in getCharacterCount" );
4986
+text_wrapper_get_offset_at_point (AtkText *text,
4989
+ AtkCoordType coords)
4992
+ accessibility::XAccessibleText* pText = getText( text );
4995
+ gint origin_x = 0;
4996
+ gint origin_y = 0;
4998
+ if( coords == ATK_XY_SCREEN )
5000
+ g_return_val_if_fail( ATK_IS_COMPONENT( text ), -1 );
5001
+ atk_component_get_position( ATK_COMPONENT( text ), &origin_x, &origin_y, coords);
5004
+ return pText->getIndexAtPoint( awt::Point(x - origin_x, y - origin_y) );
5007
+ catch(const uno::Exception& e) {
5008
+ g_warning( "Exception in getIndexAtPoint" );
5014
+// FIXME: the whole series of selections API is problematic ...
5017
+text_wrapper_get_n_selections (AtkText *text)
5020
+ accessibility::XAccessibleText* pText = getText( text );
5022
+ return ( pText->getSelectionEnd() > pText->getSelectionStart() ) ? 1 : 0;
5024
+ catch(const uno::Exception& e) {
5025
+ g_warning( "Exception in getSelectionEnd() or getSelectionStart()" );
5032
+text_wrapper_get_selection (AtkText *text,
5033
+ gint selection_num,
5034
+ gint *start_offset,
5037
+ g_return_val_if_fail( selection_num == 0, FALSE );
5040
+ accessibility::XAccessibleText* pText = getText( text );
5043
+ *start_offset = pText->getSelectionStart();
5044
+ *end_offset = pText->getSelectionEnd();
5046
+ return OUStringToGChar( pText->getSelectedText() );
5049
+ catch(const uno::Exception& e) {
5050
+ g_warning( "Exception in getSelectionEnd(), getSelectionStart() or getSelectedText()" );
5057
+text_wrapper_add_selection (AtkText *text,
5058
+ gint start_offset,
5061
+ // FIXME: can we try to be more compatible by expanding an
5062
+ // existing adjacent selection ?
5065
+ accessibility::XAccessibleText* pText = getText( text );
5067
+ return pText->setSelection( start_offset, end_offset ); // ?
5069
+ catch(const uno::Exception& e) {
5070
+ g_warning( "Exception in setSelection()" );
5077
+text_wrapper_remove_selection (AtkText *text,
5078
+ gint selection_num)
5080
+ g_return_val_if_fail( selection_num == 0, FALSE );
5083
+ accessibility::XAccessibleText* pText = getText( text );
5085
+ return pText->setSelection( 0, 0 ); // ?
5087
+ catch(const uno::Exception& e) {
5088
+ g_warning( "Exception in setSelection()" );
5095
+text_wrapper_set_selection (AtkText *text,
5096
+ gint selection_num,
5097
+ gint start_offset,
5100
+ g_return_val_if_fail( selection_num == 0, FALSE );
5103
+ accessibility::XAccessibleText* pText = getText( text );
5105
+ return pText->setSelection( start_offset, end_offset );
5107
+ catch(const uno::Exception& e) {
5108
+ g_warning( "Exception in setSelection()" );
5117
+textIfaceInit (AtkTextIface *iface)
5119
+ g_return_if_fail (iface != NULL);
5121
+ iface->get_text = text_wrapper_get_text;
5122
+ iface->get_character_at_offset = text_wrapper_get_character_at_offset;
5123
+ iface->get_text_before_offset = text_wrapper_get_text_before_offset;
5124
+ iface->get_text_at_offset = text_wrapper_get_text_at_offset;
5125
+ iface->get_text_after_offset = text_wrapper_get_text_after_offset;
5126
+ iface->get_caret_offset = text_wrapper_get_caret_offset;
5127
+ iface->set_caret_offset = text_wrapper_set_caret_offset;
5128
+ iface->get_character_count = text_wrapper_get_character_count;
5129
+ iface->get_n_selections = text_wrapper_get_n_selections;
5130
+ iface->get_selection = text_wrapper_get_selection;
5131
+ iface->add_selection = text_wrapper_add_selection;
5132
+ iface->remove_selection = text_wrapper_remove_selection;
5133
+ iface->set_selection = text_wrapper_set_selection;
5134
+ iface->get_run_attributes = text_wrapper_get_run_attributes;
5135
+ iface->get_default_attributes = text_wrapper_get_default_attributes;
5136
+ iface->get_character_extents = text_wrapper_get_character_extents;
5137
+ iface->get_offset_at_point = text_wrapper_get_offset_at_point;
5139
Index: vcl/unx/gtk/a11y/atktextattributes.cxx
5140
===================================================================
5141
RCS file: vcl/unx/gtk/a11y/atktextattributes.cxx
5142
diff -N vcl/unx/gtk/a11y/atktextattributes.cxx
5143
--- /dev/null 1 Jan 1970 00:00:00 -0000
5144
+++ vcl/unx/gtk/a11y/atktextattributes.cxx 31 Mar 2006 12:19:40 -0000 1.1.2.3
5146
+/*************************************************************************
5148
+ * OpenOffice.org - a multi-platform office productivity suite
5150
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
5152
+ * $Revision: 1.1.2.1 $
5154
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
5156
+ * The Contents of this file are made available subject to
5157
+ * the terms of GNU Lesser General Public License Version 2.1.
5160
+ * GNU Lesser General Public License Version 2.1
5161
+ * =============================================
5162
+ * Copyright 2005 by Sun Microsystems, Inc.
5163
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
5165
+ * This library is free software; you can redistribute it and/or
5166
+ * modify it under the terms of the GNU Lesser General Public
5167
+ * License version 2.1, as published by the Free Software Foundation.
5169
+ * This library is distributed in the hope that it will be useful,
5170
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
5171
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5172
+ * Lesser General Public License for more details.
5174
+ * You should have received a copy of the GNU Lesser General Public
5175
+ * License along with this library; if not, write to the Free Software
5176
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
5177
+ * MA 02111-1307 USA
5179
+ ************************************************************************/
5181
+#include "atktextattributes.hxx"
5183
+#include <com/sun/star/awt/FontSlant.hpp>
5184
+#include <com/sun/star/awt/FontStrikeout.hpp>
5185
+#include <com/sun/star/awt/FontUnderline.hpp>
5187
+#include <com/sun/star/style/ParagraphAdjust.hpp>
5189
+#include <svapp.hxx>
5190
+#include <outdev.hxx>
5193
+#include <string.h>
5195
+using namespace ::com::sun::star;
5197
+typedef gchar* (* AtkTextAttrFunc) ( const uno::Any& rAny );
5198
+typedef bool (* TextPropertyValueFunc) ( uno::Any& rAny, const gchar * value );
5200
+#define STRNCMP_PARAM( s ) s,sizeof( s )-1
5202
+/*****************************************************************************/
5205
+NullString(const uno::Any&)
5211
+InvalidValue( uno::Any&, const gchar * )
5216
+/*****************************************************************************/
5219
+Float2String(const uno::Any& rAny)
5221
+ return g_strdup_printf( "%.0f", rAny.get<float>() );
5225
+String2Float( uno::Any& rAny, const gchar * value )
5229
+ if( 1 != sscanf( value, "%f", &fval ) )
5232
+ rAny = uno::makeAny( fval );
5236
+/*****************************************************************************/
5239
+Long2String(const uno::Any& rAny)
5241
+ return g_strdup_printf( "%ld", rAny.get<sal_Int32>() );
5245
+String2Long( uno::Any& rAny, const gchar * value )
5249
+ if( 1 != sscanf( value, "%ld", &lval ) )
5252
+ rAny = uno::makeAny( lval );
5256
+/*****************************************************************************/
5259
+Color2String(const uno::Any& rAny)
5261
+ sal_Int32 nColor = rAny.get<sal_Int32>();
5263
+ if( nColor != -1 ) // AUTOMATIC
5265
+ sal_uInt8 blue = nColor & 0xFF;
5266
+ sal_uInt8 green = (nColor >> 8) & 0xFF;
5267
+ sal_uInt8 red = (nColor >> 16) & 0xFF;
5269
+ return g_strdup_printf( "%u,%u,%u", red, green, blue );
5276
+String2Color( uno::Any& rAny, const gchar * value )
5278
+ int red, green, blue;
5280
+ if( 3 != sscanf( value, "%d,%d,%d", &red, &green, &blue ) )
5283
+ sal_Int32 nColor = (sal_Int32) blue | ( (sal_Int32) green << 8 ) | ( ( sal_Int32 ) red << 16 );
5284
+ rAny = uno::makeAny( nColor );
5288
+/*****************************************************************************/
5291
+FontSlant2Style(const uno::Any& rAny)
5293
+ const gchar * value = NULL;
5295
+ switch( rAny.get<awt::FontSlant>() )
5297
+ case awt::FontSlant_NONE:
5301
+ case awt::FontSlant_OBLIQUE:
5302
+ value = "oblique";
5305
+ case awt::FontSlant_ITALIC:
5309
+ case awt::FontSlant_REVERSE_OBLIQUE:
5310
+ value = "reverse oblique";
5313
+ case awt::FontSlant_REVERSE_ITALIC:
5314
+ value = "reverse italic";
5322
+ return g_strdup( value );
5328
+Style2FontSlant( uno::Any& rAny, const gchar * value )
5330
+ awt::FontSlant aFontSlant;
5332
+ if( strncmp( value, STRNCMP_PARAM( "normal" ) ) )
5333
+ aFontSlant = awt::FontSlant_NONE;
5334
+ else if( strncmp( value, STRNCMP_PARAM( "oblique" ) ) )
5335
+ aFontSlant = awt::FontSlant_OBLIQUE;
5336
+ else if( strncmp( value, STRNCMP_PARAM( "italic" ) ) )
5337
+ aFontSlant = awt::FontSlant_ITALIC;
5338
+ else if( strncmp( value, STRNCMP_PARAM( "reverse oblique" ) ) )
5339
+ aFontSlant = awt::FontSlant_REVERSE_OBLIQUE;
5340
+ else if( strncmp( value, STRNCMP_PARAM( "reverse italic" ) ) )
5341
+ aFontSlant = awt::FontSlant_REVERSE_ITALIC;
5345
+ rAny = uno::makeAny( aFontSlant );
5349
+/*****************************************************************************/
5352
+Weight2String(const uno::Any& rAny)
5354
+ return g_strdup_printf( "%.0f", rAny.get<float>() * 4 );
5358
+String2Weight( uno::Any& rAny, const gchar * value )
5362
+ if( 1 != sscanf( value, "%f", &weight ) )
5365
+ rAny = uno::makeAny( weight / 4 );
5370
+/*****************************************************************************/
5373
+Adjust2Justification(const uno::Any& rAny)
5375
+ const gchar * value = NULL;
5377
+ switch( rAny.get<short>() )
5379
+ case style::ParagraphAdjust_LEFT:
5383
+ case style::ParagraphAdjust_RIGHT:
5387
+ case style::ParagraphAdjust_BLOCK:
5388
+ case style::ParagraphAdjust_STRETCH:
5392
+ case style::ParagraphAdjust_CENTER:
5401
+ return g_strdup( value );
5407
+Justification2Adjust( uno::Any& rAny, const gchar * value )
5409
+ short nParagraphAdjust;
5411
+ if( strncmp( value, STRNCMP_PARAM( "left" ) ) )
5412
+ nParagraphAdjust = style::ParagraphAdjust_LEFT;
5413
+ else if( strncmp( value, STRNCMP_PARAM( "right" ) ) )
5414
+ nParagraphAdjust = style::ParagraphAdjust_RIGHT;
5415
+ else if( strncmp( value, STRNCMP_PARAM( "fill" ) ) )
5416
+ nParagraphAdjust = style::ParagraphAdjust_BLOCK;
5417
+ else if( strncmp( value, STRNCMP_PARAM( "center" ) ) )
5418
+ nParagraphAdjust = style::ParagraphAdjust_CENTER;
5422
+ rAny = uno::makeAny( nParagraphAdjust );
5426
+/*****************************************************************************/
5429
+Strikeout2String(const uno::Any& rAny)
5431
+ sal_Int16 nStrikeout = rAny.get<sal_Int16>();
5433
+ if( nStrikeout != 3 ) // DONTKNOW
5434
+ return g_strdup( nStrikeout ? "true" : "false" );
5440
+String2Strikeout( uno::Any& rAny, const gchar * value )
5442
+ sal_Int16 nStrikeout;
5444
+ if( strncmp( value, STRNCMP_PARAM( "true" ) ) )
5445
+ nStrikeout = awt::FontStrikeout::SINGLE;
5446
+ else if( strncmp( value, STRNCMP_PARAM( "false" ) ) )
5447
+ nStrikeout = awt::FontStrikeout::NONE;
5451
+ rAny = uno::makeAny( nStrikeout );
5455
+/*****************************************************************************/
5458
+Underline2String(const uno::Any& rAny)
5460
+ const gchar * value = NULL;
5462
+ switch( rAny.get<short>() )
5464
+ case awt::FontUnderline::NONE:
5468
+ case awt::FontUnderline::SINGLE:
5472
+ case awt::FontUnderline::DOUBLE:
5481
+ return g_strdup( value );
5487
+String2Underline( uno::Any& rAny, const gchar * value )
5491
+ if( strncmp( value, STRNCMP_PARAM( "none" ) ) )
5492
+ nUnderline = awt::FontUnderline::NONE;
5493
+ else if( strncmp( value, STRNCMP_PARAM( "single" ) ) )
5494
+ nUnderline = awt::FontUnderline::SINGLE;
5495
+ else if( strncmp( value, STRNCMP_PARAM( "double" ) ) )
5496
+ nUnderline = awt::FontUnderline::DOUBLE;
5500
+ rAny = uno::makeAny( nUnderline );
5504
+/*****************************************************************************/
5507
+LogicToPixel( long margin_x, long margin_y )
5509
+ OutputDevice * pOutputDevice = Application::GetDefaultDevice();
5510
+ return pOutputDevice->LogicToPixel( Size( margin_x, margin_y ), MapMode( MAP_100TH_MM ) );
5514
+PixelToLogic( long margin_x, long margin_y )
5516
+ OutputDevice * pOutputDevice = Application::GetDefaultDevice();
5517
+ return pOutputDevice->PixelToLogic( Size( margin_x, margin_y ), MapMode( MAP_100TH_MM ) );
5521
+MarginHeight2Pixel(const uno::Any& rAny)
5523
+ Size aMargin = LogicToPixel( 0, rAny.get<sal_Int32>() );
5524
+ return g_strdup_printf( "%ld", aMargin.getHeight() );
5528
+Pixel2MarginHeight( uno::Any& rAny, const gchar * value )
5530
+ sal_Int32 nHeight;
5532
+ if( 1 != sscanf( value, "%ld", &nHeight ) )
5535
+ Size aMargin = PixelToLogic( 0, nHeight );
5536
+ rAny = uno::makeAny( (sal_Int32) aMargin.getHeight() );
5541
+MarginWidth2Pixel(const uno::Any& rAny)
5543
+ Size aMargin = LogicToPixel( rAny.get<sal_Int32>(), 0 );
5544
+ return g_strdup_printf( "%ld", aMargin.getWidth() );
5548
+Pixel2MarginWidth( uno::Any& rAny, const gchar * value )
5552
+ if( 1 != sscanf( value, "%ld", &nWidth ) )
5555
+ Size aMargin = PixelToLogic( nWidth, 0 );
5556
+ rAny = uno::makeAny( (sal_Int32) aMargin.getWidth() );
5560
+/*****************************************************************************/
5562
+struct AtkTextAttrMapping
5564
+ const char * name;
5565
+ AtkTextAttrFunc toAtkTextAttr;
5566
+ TextPropertyValueFunc toPropertyValue;
5569
+const AtkTextAttrMapping g_TextAttrMap[] =
5571
+ { "", NullString, InvalidValue }, // ATK_TEXT_ATTR_INVALID = 0
5572
+ { "ParaLeftMargin", MarginWidth2Pixel, Pixel2MarginWidth }, // ATK_TEXT_ATTR_LEFT_MARGIN
5573
+ { "ParaRightMargin", MarginWidth2Pixel, Pixel2MarginWidth }, // ATK_TEXT_ATTR_RIGHT_MARGIN
5574
+ { "ParaFirstLineIndent", Long2String, String2Long }, // ATK_TEXT_ATTR_INDENT
5575
+ { "", NullString, InvalidValue }, // ATK_TEXT_ATTR_INVISIBLE
5576
+ { "", NullString, InvalidValue }, // ATK_TEXT_ATTR_EDITABLE
5577
+ { "ParaTopMargin", MarginHeight2Pixel, Pixel2MarginHeight }, // ATK_TEXT_ATTR_PIXELS_ABOVE_LINES
5578
+ { "ParaBottomMargin", MarginHeight2Pixel, Pixel2MarginHeight }, // ATK_TEXT_ATTR_PIXELS_BELOW_LINES
5579
+ { "", NullString, InvalidValue }, // ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP
5580
+ { "", NullString, InvalidValue }, // ATK_TEXT_ATTR_BG_FULL_HEIGHT
5581
+ { "", NullString, InvalidValue }, // ATK_TEXT_ATTR_RISE
5582
+ { "CharUnderline", Underline2String, String2Underline }, // ATK_TEXT_ATTR_UNDERLINE
5583
+ { "CharStrikeout", Strikeout2String, String2Strikeout }, // ATK_TEXT_ATTR_STRIKETHROUGH
5584
+ { "CharHeight", Float2String, String2Float }, // ATK_TEXT_ATTR_SIZE
5585
+ { "", NullString, InvalidValue }, // ATK_TEXT_ATTR_SCALE
5586
+ { "CharWeight", Weight2String, String2Weight }, // ATK_TEXT_ATTR_WEIGHT
5587
+ { "", NullString, InvalidValue }, // ATK_TEXT_ATTR_LANGUAGE
5588
+ { "", NullString, InvalidValue }, // ATK_TEXT_ATTR_FAMILY_NAME
5589
+ { "CharBackColor", Color2String, String2Color }, // ATK_TEXT_ATTR_BG_COLOR
5590
+ { "CharColor", Color2String, String2Color }, // ATK_TEXT_ATTR_FG_COLOR
5591
+ { "", NullString, InvalidValue }, // ATK_TEXT_ATTR_BG_STIPPLE
5592
+ { "", NullString, InvalidValue }, // ATK_TEXT_ATTR_FG_STIPPLE
5593
+ { "", NullString, InvalidValue }, // ATK_TEXT_ATTR_WRAP_MODE
5594
+ { "", NullString, InvalidValue }, // ATK_TEXT_ATTR_DIRECTION
5595
+ { "ParaAdjust", Adjust2Justification, Justification2Adjust }, // ATK_TEXT_ATTR_JUSTIFICATION
5596
+ { "", NullString, InvalidValue }, // ATK_TEXT_ATTR_STRETCH
5597
+ { "", NullString, InvalidValue }, // ATK_TEXT_ATTR_VARIANT
5598
+ { "CharPosture", FontSlant2Style, Style2FontSlant } // ATK_TEXT_ATTR_STYLE
5603
+// "ParaLineSpacing" => ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP ?
5605
+static const sal_Int32 g_TextAttrMapSize = sizeof( g_TextAttrMap ) / sizeof( AtkTextAttrMapping );
5607
+/*****************************************************************************/
5609
+static AtkAttributeSet*
5610
+attribute_set_prepend( AtkAttributeSet* attribute_set,
5611
+ AtkTextAttribute attribute,
5614
+ AtkAttribute *at = (AtkAttribute *) g_malloc( sizeof (AtkAttribute) );
5615
+ at->name = g_strdup( atk_text_attribute_get_name( attribute ) );
5616
+ at->value = value;
5618
+ return g_slist_prepend(attribute_set, at);
5621
+/*****************************************************************************/
5624
+attribute_set_new_from_property_values(
5625
+ const uno::Sequence< beans::PropertyValue >& rAttributeList,
5626
+ const beans::PropertyState ePropertyState )
5628
+ AtkAttributeSet* attribute_set = NULL;
5630
+ for( sal_Int32 i = 0; i < rAttributeList.getLength(); i++ )
5632
+ if( rAttributeList[i].State != ePropertyState )
5636
+ for( ; j < g_TextAttrMapSize; ++j )
5638
+ if( 0 == rAttributeList[i].Name.compareToAscii( g_TextAttrMap[j].name ) )
5640
+ gchar * value = g_TextAttrMap[j].toAtkTextAttr(rAttributeList[i].Value);
5642
+ attribute_set = attribute_set_prepend( attribute_set, static_cast < AtkTextAttribute > (j), value );
5649
+ if( j == g_TextAttrMapSize )
5651
+ const char * state = "unknown";
5652
+ switch( rAttributeList[i].State )
5654
+ case beans::PropertyState_DIRECT_VALUE:
5655
+ state = "direct value";
5658
+ case beans::PropertyState_DEFAULT_VALUE:
5659
+ state = "default value";
5662
+ case beans::PropertyState_AMBIGUOUS_VALUE:
5663
+ state = "ambigues value";
5670
+ fprintf(stderr, "Property %s (%s)\n", OUStringToOString( rAttributeList[i].Name, RTL_TEXTENCODING_UTF8 ).getStr(), state);
5675
+ return attribute_set;
5678
+/*****************************************************************************/
5681
+attribute_set_map_to_property_values(
5682
+ AtkAttributeSet* attribute_set,
5683
+ uno::Sequence< beans::PropertyValue >& rValueList )
5685
+ // Ensure enough space ..
5686
+ uno::Sequence< beans::PropertyValue > aAttributeList (g_TextAttrMapSize);
5688
+ sal_Int32 nIndex = 0;
5689
+ for( GSList * item = attribute_set; item != NULL; item = g_slist_next( item ) )
5691
+ AtkAttribute* attribute = (AtkAttribute *) item;
5693
+ AtkTextAttribute text_attr = atk_text_attribute_for_name( attribute->name );
5694
+ if( text_attr < g_TextAttrMapSize )
5696
+ if( g_TextAttrMap[text_attr].name[0] != '\0' )
5698
+ if( ! g_TextAttrMap[text_attr].toPropertyValue( aAttributeList[nIndex].Value, attribute->value) )
5701
+ aAttributeList[nIndex].Name = rtl::OUString::createFromAscii( g_TextAttrMap[text_attr].name );
5702
+ aAttributeList[nIndex].State = beans::PropertyState_DIRECT_VALUE;
5708
+ // Unsupported text attribute
5713
+ aAttributeList.realloc( nIndex );
5714
+ rValueList = aAttributeList;
5718
Index: vcl/unx/gtk/a11y/atktextattributes.hxx
5719
===================================================================
5720
RCS file: vcl/unx/gtk/a11y/atktextattributes.hxx
5721
diff -N vcl/unx/gtk/a11y/atktextattributes.hxx
5722
--- /dev/null 1 Jan 1970 00:00:00 -0000
5723
+++ vcl/unx/gtk/a11y/atktextattributes.hxx 22 Dec 2005 08:24:30 -0000 1.1.2.1
5725
+/*************************************************************************
5727
+ * OpenOffice.org - a multi-platform office productivity suite
5729
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
5731
+ * $Revision: 1.1.2.1 $
5733
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
5735
+ * The Contents of this file are made available subject to
5736
+ * the terms of GNU Lesser General Public License Version 2.1.
5739
+ * GNU Lesser General Public License Version 2.1
5740
+ * =============================================
5741
+ * Copyright 2005 by Sun Microsystems, Inc.
5742
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
5744
+ * This library is free software; you can redistribute it and/or
5745
+ * modify it under the terms of the GNU Lesser General Public
5746
+ * License version 2.1, as published by the Free Software Foundation.
5748
+ * This library is distributed in the hope that it will be useful,
5749
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
5750
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5751
+ * Lesser General Public License for more details.
5753
+ * You should have received a copy of the GNU Lesser General Public
5754
+ * License along with this library; if not, write to the Free Software
5755
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
5756
+ * MA 02111-1307 USA
5758
+ ************************************************************************/
5760
+#ifndef __ATK_ATKTEXTATTRIBUTES_HXX__
5761
+#define __ATK_ATKTEXTATTRIBUTES_HXX__
5763
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
5764
+#include <com/sun/star/uno/Sequence.hxx>
5767
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
5768
+#include <com/sun/star/beans/PropertyValue.hpp>
5771
+#include <atk/atk.h>
5774
+attribute_set_new_from_property_values(
5775
+ const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rAttributeList,
5776
+ const com::sun::star::beans::PropertyState ePropertyState );
5779
+attribute_set_map_to_property_values(
5780
+ AtkAttributeSet* attribute_set,
5781
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rValueList );
5785
Index: vcl/unx/gtk/a11y/atkutil.cxx
5786
===================================================================
5787
RCS file: vcl/unx/gtk/a11y/atkutil.cxx
5788
diff -N vcl/unx/gtk/a11y/atkutil.cxx
5789
--- /dev/null 1 Jan 1970 00:00:00 -0000
5790
+++ vcl/unx/gtk/a11y/atkutil.cxx 31 Mar 2006 12:19:40 -0000 1.1.2.15
5792
+/*************************************************************************
5794
+ * OpenOffice.org - a multi-platform office productivity suite
5796
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
5798
+ * $Revision: 1.1.2.1 $
5800
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
5802
+ * The Contents of this file are made available subject to
5803
+ * the terms of GNU Lesser General Public License Version 2.1.
5806
+ * GNU Lesser General Public License Version 2.1
5807
+ * =============================================
5808
+ * Copyright 2005 by Sun Microsystems, Inc.
5809
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
5811
+ * This library is free software; you can redistribute it and/or
5812
+ * modify it under the terms of the GNU Lesser General Public
5813
+ * License version 2.1, as published by the Free Software Foundation.
5815
+ * This library is distributed in the hope that it will be useful,
5816
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
5817
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
5818
+ * Lesser General Public License for more details.
5820
+ * You should have received a copy of the GNU Lesser General Public
5821
+ * License along with this library; if not, write to the Free Software
5822
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
5823
+ * MA 02111-1307 USA
5825
+ ************************************************************************/
5827
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLECONTEXT_HPP_
5828
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
5831
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEEVENTBROADCASTER_HPP_
5832
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
5835
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESELECTION_HPP_
5836
+#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
5839
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEEVENTID_HPP_
5840
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
5843
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLESTATETYPE_HPP_
5844
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
5847
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
5848
+#include <cppuhelper/implbase1.hxx>
5851
+#ifndef _VOS_MUTEX_HXX_
5852
+#include <vos/mutex.hxx>
5855
+#ifndef _RTL_REF_HXX_
5856
+#include <rtl/ref.hxx>
5859
+#ifndef _SV_SVAPP_HXX
5860
+#include "svapp.hxx"
5863
+#include <window.hxx>
5864
+#include <menu.hxx>
5866
+#include "atkwrapper.hxx"
5867
+#include "atkutil.hxx"
5872
+using namespace ::com::sun::star;
5874
+static AtkObject *last_focused_object = NULL;
5876
+/*****************************************************************************/
5881
+atk_wrapper_focus_idle_handler (gpointer data)
5883
+ vos::OGuard aGuard( Application::GetSolarMutex() );
5885
+ if( data == last_focused_object )
5886
+ atk_focus_tracker_notify( ATK_OBJECT( data ) );
5889
+ g_object_unref( G_OBJECT(data) );
5896
+/*****************************************************************************/
5899
+atk_wrapper_focus_tracker_notify_when_idle( const uno::Reference< accessibility::XAccessible > &rAccessible )
5901
+ AtkObject *accessible = NULL;
5903
+ if( rAccessible.is() )
5904
+ accessible = atk_object_wrapper_ref( rAccessible );
5906
+ last_focused_object = accessible;
5907
+ g_idle_add (atk_wrapper_focus_idle_handler, accessible);
5910
+/*****************************************************************************/
5912
+class DocumentFocusListener :
5913
+ public ::cppu::WeakImplHelper1< accessibility::XAccessibleEventListener >
5916
+ std::set< uno::Reference< uno::XInterface > > m_aRefList;
5919
+ void attachRecursive(
5920
+ const uno::Reference< accessibility::XAccessible >& xAccessible
5921
+ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException);
5923
+ void attachRecursive(
5924
+ const uno::Reference< accessibility::XAccessible >& xAccessible,
5925
+ const uno::Reference< accessibility::XAccessibleContext >& xContext
5926
+ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException);
5928
+ void attachRecursive(
5929
+ const uno::Reference< accessibility::XAccessible >& xAccessible,
5930
+ const uno::Reference< accessibility::XAccessibleContext >& xContext,
5931
+ const uno::Reference< accessibility::XAccessibleStateSet >& xStateSet
5932
+ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException);
5934
+ void detachRecursive(
5935
+ const uno::Reference< accessibility::XAccessible >& xAccessible
5936
+ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException);
5938
+ void detachRecursive(
5939
+ const uno::Reference< accessibility::XAccessible >& xAccessible,
5940
+ const uno::Reference< accessibility::XAccessibleContext >& xContext
5941
+ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException);
5943
+ void detachRecursive(
5944
+ const uno::Reference< accessibility::XAccessible >& xAccessible,
5945
+ const uno::Reference< accessibility::XAccessibleContext >& xContext,
5946
+ const uno::Reference< accessibility::XAccessibleStateSet >& xStateSet
5947
+ ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException);
5949
+ static uno::Reference< accessibility::XAccessible > getAccessible(const lang::EventObject& aEvent )
5950
+ throw (lang::IndexOutOfBoundsException, uno::RuntimeException);
5953
+ virtual void disposing( const lang::EventObject& Source ) throw (uno::RuntimeException);
5955
+ // XAccessibleEventListener
5956
+ virtual void notifyEvent( const accessibility::AccessibleEventObject& aEvent ) throw( uno::RuntimeException );
5959
+/*****************************************************************************/
5961
+void DocumentFocusListener::disposing( const lang::EventObject& aEvent )
5962
+ throw (uno::RuntimeException)
5964
+// fprintf(stderr, "In DocumentFocusListener::disposing (%p)\n", this);
5965
+// fprintf(stderr, "m_aRefList has %d entries\n", m_aRefList.size());
5967
+ // Unref the object here, but do not remove as listener since the object
5968
+ // might no longer be in a state that safely allows this.
5969
+ if( aEvent.Source.is() )
5970
+ m_aRefList.erase(aEvent.Source);
5972
+// fprintf(stderr, "m_aRefList has %d entries\n", m_aRefList.size());
5976
+/*****************************************************************************/
5978
+void DocumentFocusListener::notifyEvent( const accessibility::AccessibleEventObject& aEvent )
5979
+ throw( uno::RuntimeException )
5981
+ switch( aEvent.EventId )
5983
+ case accessibility::AccessibleEventId::STATE_CHANGED:
5986
+ sal_Int16 nState = accessibility::AccessibleStateType::INVALID;
5987
+ aEvent.NewValue >>= nState;
5989
+ if( accessibility::AccessibleStateType::FOCUSED == nState )
5990
+ atk_wrapper_focus_tracker_notify_when_idle( getAccessible(aEvent) );
5992
+ catch(lang::IndexOutOfBoundsException e)
5994
+ g_warning("Focused object has invalid index in parent");
5998
+ case accessibility::AccessibleEventId::CHILD:
6000
+ uno::Reference< accessibility::XAccessible > xChild;
6001
+ if( (aEvent.OldValue >>= xChild) && xChild.is() )
6002
+ detachRecursive(xChild);
6004
+ if( (aEvent.NewValue >>= xChild) && xChild.is() )
6005
+ attachRecursive(xChild);
6009
+ case accessibility::AccessibleEventId::INVALIDATE_ALL_CHILDREN:
6011
+ uno::Reference< accessibility::XAccessible > xAccessible( getAccessible(aEvent) );
6012
+ detachRecursive(xAccessible);
6013
+ attachRecursive(xAccessible);
6016
+ fprintf(stderr, "Invalidate all children called\n" );
6023
+/*****************************************************************************/
6025
+uno::Reference< accessibility::XAccessible > DocumentFocusListener::getAccessible(const lang::EventObject& aEvent )
6026
+ throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
6028
+ uno::Reference< accessibility::XAccessible > xAccessible(aEvent.Source, uno::UNO_QUERY);
6030
+ if( xAccessible.is() )
6031
+ return xAccessible;
6033
+ uno::Reference< accessibility::XAccessibleContext > xContext(aEvent.Source, uno::UNO_QUERY);
6035
+ if( xContext.is() )
6037
+ uno::Reference< accessibility::XAccessible > xParent( xContext->getAccessibleParent() );
6038
+ if( xParent.is() )
6040
+ uno::Reference< accessibility::XAccessibleContext > xParentContext( xParent->getAccessibleContext() );
6041
+ if( xParentContext.is() )
6043
+ return xParentContext->getAccessibleChild( xContext->getAccessibleIndexInParent() );
6048
+ return uno::Reference< accessibility::XAccessible >();
6051
+/*****************************************************************************/
6053
+void DocumentFocusListener::attachRecursive(
6054
+ const uno::Reference< accessibility::XAccessible >& xAccessible
6055
+) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
6057
+ uno::Reference< accessibility::XAccessibleContext > xContext =
6058
+ xAccessible->getAccessibleContext();
6060
+ if( xContext.is() )
6061
+ attachRecursive(xAccessible, xContext);
6064
+/*****************************************************************************/
6066
+void DocumentFocusListener::attachRecursive(
6067
+ const uno::Reference< accessibility::XAccessible >& xAccessible,
6068
+ const uno::Reference< accessibility::XAccessibleContext >& xContext
6069
+) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
6071
+ uno::Reference< accessibility::XAccessibleStateSet > xStateSet =
6072
+ xContext->getAccessibleStateSet();
6074
+ if( xStateSet.is() )
6075
+ attachRecursive(xAccessible, xContext, xStateSet);
6078
+/*****************************************************************************/
6080
+void DocumentFocusListener::attachRecursive(
6081
+ const uno::Reference< accessibility::XAccessible >& xAccessible,
6082
+ const uno::Reference< accessibility::XAccessibleContext >& xContext,
6083
+ const uno::Reference< accessibility::XAccessibleStateSet >& xStateSet
6084
+) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
6086
+ if( xStateSet->contains(accessibility::AccessibleStateType::FOCUSED ) )
6087
+ atk_wrapper_focus_tracker_notify_when_idle( xAccessible );
6089
+ uno::Reference< accessibility::XAccessibleEventBroadcaster > xBroadcaster =
6090
+ uno::Reference< accessibility::XAccessibleEventBroadcaster >(xContext, uno::UNO_QUERY);
6092
+ // If not already done, add the broadcaster to the list and attach as listener.
6093
+ if( xBroadcaster.is() && m_aRefList.insert(xBroadcaster).second )
6094
+ xBroadcaster->addEventListener(static_cast< accessibility::XAccessibleEventListener *>(this));
6096
+ if( ! xStateSet->contains(accessibility::AccessibleStateType::MANAGES_DESCENDANTS ) )
6098
+ sal_Int32 n, nmax = xContext->getAccessibleChildCount();
6099
+ for( n = 0; n < nmax; n++ )
6101
+ uno::Reference< accessibility::XAccessible > xChild( xContext->getAccessibleChild( n ) );
6104
+ attachRecursive(xChild);
6109
+/*****************************************************************************/
6111
+void DocumentFocusListener::detachRecursive(
6112
+ const uno::Reference< accessibility::XAccessible >& xAccessible
6113
+) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
6115
+ uno::Reference< accessibility::XAccessibleContext > xContext =
6116
+ xAccessible->getAccessibleContext();
6118
+ if( xContext.is() )
6119
+ detachRecursive(xAccessible, xContext);
6122
+/*****************************************************************************/
6124
+void DocumentFocusListener::detachRecursive(
6125
+ const uno::Reference< accessibility::XAccessible >& xAccessible,
6126
+ const uno::Reference< accessibility::XAccessibleContext >& xContext
6127
+) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
6129
+ uno::Reference< accessibility::XAccessibleStateSet > xStateSet =
6130
+ xContext->getAccessibleStateSet();
6132
+ if( xStateSet.is() )
6133
+ detachRecursive(xAccessible, xContext, xStateSet);
6136
+/*****************************************************************************/
6138
+void DocumentFocusListener::detachRecursive(
6139
+ const uno::Reference< accessibility::XAccessible >&,
6140
+ const uno::Reference< accessibility::XAccessibleContext >& xContext,
6141
+ const uno::Reference< accessibility::XAccessibleStateSet >& xStateSet
6142
+) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
6144
+ if( ! xStateSet->contains(accessibility::AccessibleStateType::MANAGES_DESCENDANTS ) )
6146
+ sal_Int32 n, nmax = xContext->getAccessibleChildCount();
6147
+ for( n = 0; n < nmax; n++ )
6149
+ uno::Reference< accessibility::XAccessible > xChild( xContext->getAccessibleChild( n ) );
6152
+ detachRecursive(xChild);
6156
+ uno::Reference< accessibility::XAccessibleEventBroadcaster > xBroadcaster =
6157
+ uno::Reference< accessibility::XAccessibleEventBroadcaster >(xContext, uno::UNO_QUERY);
6159
+ if( xBroadcaster.is() && 0 < m_aRefList.erase(xBroadcaster) )
6160
+ xBroadcaster->removeEventListener(static_cast< accessibility::XAccessibleEventListener *>(this));
6163
+/*****************************************************************************/
6166
+ * page tabs in gtk are widgets, so we need to simulate focus events for those
6169
+static void handle_tabpage_activated(Window *pWindow)
6171
+ uno::Reference< accessibility::XAccessible > xAccessible =
6172
+ pWindow->GetAccessible();
6174
+ if( ! xAccessible.is() )
6177
+ uno::Reference< accessibility::XAccessibleSelection > xSelection(
6178
+ xAccessible->getAccessibleContext(), uno::UNO_QUERY);
6180
+ if( xSelection.is() )
6181
+ atk_wrapper_focus_tracker_notify_when_idle( xSelection->getSelectedAccessibleChild(0) );
6184
+/*****************************************************************************/
6186
+static std::set< Window * > g_aWindowList;
6188
+static void handle_get_focus(::VclWindowEvent const * pEvent)
6190
+ static rtl::Reference< DocumentFocusListener > aDocumentFocusListener =
6191
+ new DocumentFocusListener();
6193
+ Window *pWindow = pEvent->GetWindow();
6195
+ // The menu bar is handled through VCLEVENT_MENU_HIGHLIGHTED
6196
+ if( ! pWindow || !pWindow->IsVisible() || pWindow->GetType() == WINDOW_MENUBARWINDOW )
6199
+ if( pWindow->GetType() == WINDOW_TABCONTROL )
6201
+ handle_tabpage_activated( pWindow );
6205
+ uno::Reference< accessibility::XAccessible > xAccessible =
6206
+ pWindow->GetAccessible();
6208
+ if( ! xAccessible.is() )
6211
+ uno::Reference< accessibility::XAccessibleContext > xContext =
6212
+ xAccessible->getAccessibleContext();
6214
+ if( ! xContext.is() )
6217
+ uno::Reference< accessibility::XAccessibleStateSet > xStateSet =
6218
+ xContext->getAccessibleStateSet();
6220
+ if( ! xStateSet.is() )
6223
+ if( xStateSet->contains(accessibility::AccessibleStateType::FOCUSED) &&
6224
+ ( pWindow->GetType() != WINDOW_TREELISTBOX ) )
6226
+ atk_wrapper_focus_tracker_notify_when_idle( xAccessible );
6230
+ if( g_aWindowList.find(pWindow) == g_aWindowList.end() )
6232
+ g_aWindowList.insert(pWindow);
6233
+ aDocumentFocusListener->attachRecursive(xAccessible, xContext, xStateSet);
6238
+/*****************************************************************************/
6240
+static void handle_menu_highlighted(::VclMenuEvent const * pEvent)
6244
+ Menu* pMenu = pEvent->GetMenu();
6245
+ USHORT nPos = pEvent->GetItemPos();
6247
+ if( pMenu && nPos != 0xFFFF)
6249
+ uno::Reference< accessibility::XAccessible > xAccessible ( pMenu->GetAccessible() );
6251
+ if( xAccessible.is() )
6253
+ uno::Reference< accessibility::XAccessibleContext > xContext ( xAccessible->getAccessibleContext() );
6255
+ if( xContext.is() )
6256
+ atk_wrapper_focus_tracker_notify_when_idle( xContext->getAccessibleChild( nPos ) );
6260
+ catch( uno::Exception e )
6262
+ g_warning( "Exception caught processing menu highlight events" );
6266
+/*****************************************************************************/
6268
+long WindowEventHandler(void *, ::VclSimpleEvent const * pEvent)
6270
+ switch (pEvent->GetId())
6272
+ case VCLEVENT_OBJECT_DYING:
6273
+// fprintf(stderr, "got VCLEVENT_OBJECT_DYING for %p\n",
6274
+// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
6276
+ case VCLEVENT_WINDOW_SHOW:
6277
+// fprintf(stderr, "got VCLEVENT_WINDOW_SHOW for %p\n",
6278
+// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
6280
+ case VCLEVENT_WINDOW_HIDE:
6281
+// fprintf(stderr, "got VCLEVENT_WINDOW_HIDE for %p\n",
6282
+// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
6284
+ case VCLEVENT_WINDOW_CLOSE:
6285
+// fprintf(stderr, "got VCLEVENT_WINDOW_CLOSE for %p\n",
6286
+// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
6288
+ case VCLEVENT_WINDOW_GETFOCUS:
6289
+ handle_get_focus(static_cast< ::VclWindowEvent const * >(pEvent));
6291
+ case VCLEVENT_WINDOW_DEACTIVATE:
6292
+ atk_wrapper_focus_tracker_notify_when_idle(NULL);
6294
+ case VCLEVENT_WINDOW_LOSEFOCUS:
6295
+// fprintf(stderr, "got VCLEVENT_WINDOW_LOSEFOCUS for %p\n",
6296
+// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
6298
+ case VCLEVENT_WINDOW_MINIMIZE:
6299
+// fprintf(stderr, "got VCLEVENT_WINDOW_MINIMIZE for %p\n",
6300
+// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
6302
+ case VCLEVENT_WINDOW_NORMALIZE:
6303
+// fprintf(stderr, "got VCLEVENT_WINDOW_NORMALIZE for %p\n",
6304
+// static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
6306
+ case VCLEVENT_WINDOW_KEYINPUT:
6307
+ case VCLEVENT_WINDOW_KEYUP:
6308
+ case VCLEVENT_WINDOW_COMMAND:
6311
+ fprintf(stderr, "got VCLEVENT_WINDOW_COMMAND (%d) for %p\n",
6312
+ static_cast< ::CommandEvent const * > (
6313
+ static_cast< ::VclWindowEvent const * >(pEvent)->GetData())->GetCommand(),
6314
+ static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
6316
+ case VCLEVENT_MENU_HIGHLIGHT:
6317
+ handle_menu_highlighted(static_cast< ::VclMenuEvent const * >(pEvent));
6320
+ case VCLEVENT_TABPAGE_ACTIVATE:
6321
+ handle_tabpage_activated(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
6324
+ //fprintf(stderr, "got event %d \n", pEvent->GetId());
6330
+static Link g_aEventListenerLink( NULL, (PSTUB) WindowEventHandler );
6332
+/*****************************************************************************/
6336
+static G_CONST_RETURN gchar *
6337
+ooo_atk_util_get_toolkit_name (void)
6342
+/*****************************************************************************/
6344
+static G_CONST_RETURN gchar *
6345
+ooo_atk_util_get_toolkit_version (void)
6348
+ * Version is passed in as a -D flag when this file is
6355
+/*****************************************************************************/
6358
+ * GObject inheritance
6362
+ooo_atk_util_class_init (AtkUtilClass *)
6364
+ AtkUtilClass *atk_class;
6367
+ data = g_type_class_peek (ATK_TYPE_UTIL);
6368
+ atk_class = ATK_UTIL_CLASS (data);
6370
+ atk_class->get_toolkit_name = ooo_atk_util_get_toolkit_name;
6371
+ atk_class->get_toolkit_version = ooo_atk_util_get_toolkit_version;
6373
+ Application::AddEventListener( g_aEventListenerLink );
6378
+/*****************************************************************************/
6381
+ooo_atk_util_get_type (void)
6383
+ static GType type = 0;
6387
+ GType parent_type = g_type_from_name( "GailUtil" );
6389
+ if( ! parent_type )
6391
+ g_warning( "Unknown type: GailUtil" );
6392
+ parent_type = ATK_TYPE_UTIL;
6395
+ GTypeQuery type_query;
6396
+ g_type_query( parent_type, &type_query );
6398
+ static const GTypeInfo typeInfo =
6400
+ type_query.class_size,
6401
+ (GBaseInitFunc) NULL,
6402
+ (GBaseFinalizeFunc) NULL,
6403
+ (GClassInitFunc) ooo_atk_util_class_init,
6404
+ (GClassFinalizeFunc) NULL,
6406
+ type_query.instance_size,
6408
+ (GInstanceInitFunc) NULL,
6412
+ type = g_type_register_static (parent_type, "OOoUtil", &typeInfo, (GTypeFlags)0) ;
6418
Index: vcl/unx/gtk/a11y/atkutil.hxx
6419
===================================================================
6420
RCS file: vcl/unx/gtk/a11y/atkutil.hxx
6421
diff -N vcl/unx/gtk/a11y/atkutil.hxx
6422
--- /dev/null 1 Jan 1970 00:00:00 -0000
6423
+++ vcl/unx/gtk/a11y/atkutil.hxx 5 Jan 2006 14:06:32 -0000 1.1.2.4
6425
+/*************************************************************************
6427
+ * OpenOffice.org - a multi-platform office productivity suite
6429
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
6431
+ * $Revision: 1.1.2.1 $
6433
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
6435
+ * The Contents of this file are made available subject to
6436
+ * the terms of GNU Lesser General Public License Version 2.1.
6439
+ * GNU Lesser General Public License Version 2.1
6440
+ * =============================================
6441
+ * Copyright 2005 by Sun Microsystems, Inc.
6442
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
6444
+ * This library is free software; you can redistribute it and/or
6445
+ * modify it under the terms of the GNU Lesser General Public
6446
+ * License version 2.1, as published by the Free Software Foundation.
6448
+ * This library is distributed in the hope that it will be useful,
6449
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
6450
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6451
+ * Lesser General Public License for more details.
6453
+ * You should have received a copy of the GNU Lesser General Public
6454
+ * License along with this library; if not, write to the Free Software
6455
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6456
+ * MA 02111-1307 USA
6458
+ ************************************************************************/
6460
+#ifndef __ATK_UTIL_HXX__
6461
+#define __ATK_UTIL_HXX__
6463
+#include <atk/atk.h>
6465
+#define OOO_TYPE_ATK_UTIL ooo_atk_util_get_type()
6467
+GType ooo_atk_util_get_type (void);
6470
Index: vcl/unx/gtk/a11y/atkvalue.cxx
6471
===================================================================
6472
RCS file: vcl/unx/gtk/a11y/atkvalue.cxx
6473
diff -N vcl/unx/gtk/a11y/atkvalue.cxx
6474
--- /dev/null 1 Jan 1970 00:00:00 -0000
6475
+++ vcl/unx/gtk/a11y/atkvalue.cxx 15 Feb 2006 10:59:25 -0000 1.1.2.4
6477
+/*************************************************************************
6479
+ * OpenOffice.org - a multi-platform office productivity suite
6481
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
6483
+ * $Revision: 1.1.2.1 $
6485
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
6487
+ * The Contents of this file are made available subject to
6488
+ * the terms of GNU Lesser General Public License Version 2.1.
6491
+ * GNU Lesser General Public License Version 2.1
6492
+ * =============================================
6493
+ * Copyright 2005 by Sun Microsystems, Inc.
6494
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
6496
+ * This library is free software; you can redistribute it and/or
6497
+ * modify it under the terms of the GNU Lesser General Public
6498
+ * License version 2.1, as published by the Free Software Foundation.
6500
+ * This library is distributed in the hope that it will be useful,
6501
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
6502
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6503
+ * Lesser General Public License for more details.
6505
+ * You should have received a copy of the GNU Lesser General Public
6506
+ * License along with this library; if not, write to the Free Software
6507
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6508
+ * MA 02111-1307 USA
6510
+ ************************************************************************/
6512
+#include "atkwrapper.hxx"
6514
+#include <com/sun/star/accessibility/XAccessibleValue.hpp>
6517
+#include <string.h>
6519
+using namespace ::com::sun::star;
6521
+static accessibility::XAccessibleValue*
6522
+ getValue( AtkValue *pValue ) throw (uno::RuntimeException)
6524
+ AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pValue );
6527
+ if( !pWrap->mpValue && pWrap->mpContext )
6529
+ uno::Any any = pWrap->mpContext->queryInterface( accessibility::XAccessibleValue::static_type(NULL) );
6530
+ pWrap->mpValue = reinterpret_cast< accessibility::XAccessibleValue * > (any.pReserved);
6531
+ pWrap->mpValue->acquire();
6534
+ return pWrap->mpValue;
6540
+static void anyToGValue( uno::Any aAny, GValue *pValue )
6542
+ // FIXME: expand to lots of types etc.
6546
+ memset( pValue, 0, sizeof( GValue ) );
6547
+ g_value_init( pValue, G_TYPE_DOUBLE );
6548
+ g_value_set_double( pValue, aDouble );
6554
+value_wrapper_get_current_value( AtkValue *value,
6558
+ accessibility::XAccessibleValue* pValue = getValue( value );
6560
+ anyToGValue( pValue->getCurrentValue(), gval );
6562
+ catch(const uno::Exception& e) {
6563
+ g_warning( "Exception in getCurrentValue()" );
6568
+value_wrapper_get_maximum_value( AtkValue *value,
6572
+ accessibility::XAccessibleValue* pValue = getValue( value );
6574
+ anyToGValue( pValue->getMaximumValue(), gval );
6576
+ catch(const uno::Exception& e) {
6577
+ g_warning( "Exception in getCurrentValue()" );
6582
+value_wrapper_get_minimum_value( AtkValue *value,
6586
+ accessibility::XAccessibleValue* pValue = getValue( value );
6588
+ anyToGValue( pValue->getMinimumValue(), gval );
6590
+ catch(const uno::Exception& e) {
6591
+ g_warning( "Exception in getCurrentValue()" );
6596
+value_wrapper_set_current_value( AtkValue *value,
6597
+ const GValue *gval )
6600
+ accessibility::XAccessibleValue* pValue = getValue( value );
6603
+ // FIXME - this needs expanding
6604
+ double aDouble = g_value_get_double( gval );
6607
+ return pValue->setCurrentValue( aAny );
6610
+ catch(const uno::Exception& e) {
6611
+ g_warning( "Exception in getCurrentValue()" );
6620
+valueIfaceInit (AtkValueIface *iface)
6622
+ g_return_if_fail (iface != NULL);
6624
+ iface->get_current_value = value_wrapper_get_current_value;
6625
+ iface->get_maximum_value = value_wrapper_get_maximum_value;
6626
+ iface->get_minimum_value = value_wrapper_get_minimum_value;
6627
+ iface->set_current_value = value_wrapper_set_current_value;
6629
Index: vcl/unx/gtk/a11y/atkwindow.cxx
6630
===================================================================
6631
RCS file: vcl/unx/gtk/a11y/atkwindow.cxx
6632
diff -N vcl/unx/gtk/a11y/atkwindow.cxx
6633
--- /dev/null 1 Jan 1970 00:00:00 -0000
6634
+++ vcl/unx/gtk/a11y/atkwindow.cxx 31 Mar 2006 12:19:40 -0000 1.1.2.6
6636
+/*************************************************************************
6638
+ * OpenOffice.org - a multi-platform office productivity suite
6640
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
6642
+ * $Revision: 1.1.2.1 $
6644
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
6646
+ * The Contents of this file are made available subject to
6647
+ * the terms of GNU Lesser General Public License Version 2.1.
6650
+ * GNU Lesser General Public License Version 2.1
6651
+ * =============================================
6652
+ * Copyright 2005 by Sun Microsystems, Inc.
6653
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
6655
+ * This library is free software; you can redistribute it and/or
6656
+ * modify it under the terms of the GNU Lesser General Public
6657
+ * License version 2.1, as published by the Free Software Foundation.
6659
+ * This library is distributed in the hope that it will be useful,
6660
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
6661
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6662
+ * Lesser General Public License for more details.
6664
+ * You should have received a copy of the GNU Lesser General Public
6665
+ * License along with this library; if not, write to the Free Software
6666
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6667
+ * MA 02111-1307 USA
6669
+ ************************************************************************/
6671
+#include "atkwindow.hxx"
6673
+#include <plugins/gtk/gtkframe.hxx>
6677
+static void (* window_real_initialize) (AtkObject *obj, gpointer data);
6678
+static G_CONST_RETURN gchar* (* window_real_get_name) (AtkObject *accessible);
6680
+/*****************************************************************************/
6683
+ooo_window_wrapper_real_initialize(AtkObject *obj, gpointer data)
6685
+ window_real_initialize(obj, data);
6686
+ obj->role = GtkSalFrame::GetAtkRole( GTK_WINDOW( data ) );
6688
+ if( obj->role == ATK_ROLE_TOOL_TIP )
6690
+ /* HACK: Avoid endless loop when get_name is called from
6691
+ * gail_window_new() context, which leads to the code path
6692
+ * showing up in wrapper_factory_create_accessible with no
6693
+ * accessible assigned to the GtkWindow yet.
6695
+ g_object_set_data( G_OBJECT( data ), "ooo:tooltip-accessible", obj );
6699
+/*****************************************************************************/
6701
+static G_CONST_RETURN gchar*
6702
+ooo_window_wrapper_real_get_name(AtkObject *accessible)
6704
+ G_CONST_RETURN gchar* name = NULL;
6706
+ if( accessible->role == ATK_ROLE_TOOL_TIP )
6708
+ AtkObject *child = atk_object_ref_accessible_child(accessible, 0);
6711
+ name = atk_object_get_name(child);
6712
+ g_object_unref(child);
6718
+ return window_real_get_name(accessible);
6721
+/*****************************************************************************/
6724
+ooo_window_wrapper_class_init (AtkObjectClass *klass)
6726
+ AtkObjectClass *atk_class;
6730
+ * Patch the gobject vtable of GailWindow to refer to our instance of
6731
+ * "initialize" and "get_name".
6734
+ data = g_type_class_peek_parent( klass );
6735
+ atk_class = ATK_OBJECT_CLASS (data);
6737
+ window_real_initialize = atk_class->initialize;
6738
+ atk_class->initialize = ooo_window_wrapper_real_initialize;
6740
+ window_real_get_name = atk_class->get_name;
6741
+ atk_class->get_name = ooo_window_wrapper_real_get_name;
6746
+/*****************************************************************************/
6749
+ooo_window_wrapper_get_type (void)
6751
+ static GType type = 0;
6755
+ GType parent_type = g_type_from_name( "GailWindow" );
6757
+ if( ! parent_type )
6759
+ g_warning( "Unknown type: GailWindow" );
6760
+ parent_type = ATK_TYPE_OBJECT;
6763
+ GTypeQuery type_query;
6764
+ g_type_query( parent_type, &type_query );
6766
+ static const GTypeInfo typeInfo =
6768
+ type_query.class_size,
6769
+ (GBaseInitFunc) NULL,
6770
+ (GBaseFinalizeFunc) NULL,
6771
+ (GClassInitFunc) ooo_window_wrapper_class_init,
6772
+ (GClassFinalizeFunc) NULL,
6774
+ type_query.instance_size,
6776
+ (GInstanceInitFunc) NULL,
6780
+ type = g_type_register_static (parent_type, "OOoWindowAtkObject", &typeInfo, (GTypeFlags)0) ;
6785
Index: vcl/unx/gtk/a11y/atkwindow.hxx
6786
===================================================================
6787
RCS file: vcl/unx/gtk/a11y/atkwindow.hxx
6788
diff -N vcl/unx/gtk/a11y/atkwindow.hxx
6789
--- /dev/null 1 Jan 1970 00:00:00 -0000
6790
+++ vcl/unx/gtk/a11y/atkwindow.hxx 5 Jan 2006 14:06:34 -0000 1.1.2.1
6792
+/*************************************************************************
6794
+ * OpenOffice.org - a multi-platform office productivity suite
6796
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
6798
+ * $Revision: 1.1.2.1 $
6800
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
6802
+ * The Contents of this file are made available subject to
6803
+ * the terms of GNU Lesser General Public License Version 2.1.
6806
+ * GNU Lesser General Public License Version 2.1
6807
+ * =============================================
6808
+ * Copyright 2005 by Sun Microsystems, Inc.
6809
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
6811
+ * This library is free software; you can redistribute it and/or
6812
+ * modify it under the terms of the GNU Lesser General Public
6813
+ * License version 2.1, as published by the Free Software Foundation.
6815
+ * This library is distributed in the hope that it will be useful,
6816
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
6817
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6818
+ * Lesser General Public License for more details.
6820
+ * You should have received a copy of the GNU Lesser General Public
6821
+ * License along with this library; if not, write to the Free Software
6822
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6823
+ * MA 02111-1307 USA
6825
+ ************************************************************************/
6827
+#ifndef __ATK_WINDOW_HXX__
6828
+#define __ATK_WINDOW_HXX__
6830
+#include <atk/atk.h>
6832
+#define OOO_TYPE_WINDOW_WRAPPER ooo_window_wrapper_get_type()
6834
+GType ooo_window_wrapper_get_type (void);
6837
Index: vcl/unx/gtk/a11y/atkwrapper.cxx
6838
===================================================================
6839
RCS file: vcl/unx/gtk/a11y/atkwrapper.cxx
6840
diff -N vcl/unx/gtk/a11y/atkwrapper.cxx
6841
--- /dev/null 1 Jan 1970 00:00:00 -0000
6842
+++ vcl/unx/gtk/a11y/atkwrapper.cxx 31 Mar 2006 12:19:40 -0000 1.1.2.22
6844
+/*************************************************************************
6846
+ * OpenOffice.org - a multi-platform office productivity suite
6848
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
6850
+ * $Revision: 1.1.2.1 $
6852
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
6854
+ * The Contents of this file are made available subject to
6855
+ * the terms of GNU Lesser General Public License Version 2.1.
6858
+ * GNU Lesser General Public License Version 2.1
6859
+ * =============================================
6860
+ * Copyright 2005 by Sun Microsystems, Inc.
6861
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
6863
+ * This library is free software; you can redistribute it and/or
6864
+ * modify it under the terms of the GNU Lesser General Public
6865
+ * License version 2.1, as published by the Free Software Foundation.
6867
+ * This library is distributed in the hope that it will be useful,
6868
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
6869
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6870
+ * Lesser General Public License for more details.
6872
+ * You should have received a copy of the GNU Lesser General Public
6873
+ * License along with this library; if not, write to the Free Software
6874
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
6875
+ * MA 02111-1307 USA
6877
+ ************************************************************************/
6879
+#include <com/sun/star/uno/Any.hxx>
6880
+#include <com/sun/star/uno/Type.hxx>
6881
+#include <com/sun/star/uno/Sequence.hxx>
6882
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
6883
+#include <com/sun/star/accessibility/AccessibleRelation.hpp>
6884
+#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
6885
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
6886
+#include <com/sun/star/accessibility/XAccessible.hpp>
6887
+#include <com/sun/star/accessibility/XAccessibleText.hpp>
6888
+#include <com/sun/star/accessibility/XAccessibleValue.hpp>
6889
+#include <com/sun/star/accessibility/XAccessibleAction.hpp>
6890
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
6891
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
6892
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
6893
+#include <com/sun/star/accessibility/XAccessibleStateSet.hpp>
6894
+#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
6895
+#include <com/sun/star/accessibility/XAccessibleTable.hpp>
6896
+#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
6897
+#include <com/sun/star/accessibility/XAccessibleImage.hpp>
6898
+#include <com/sun/star/accessibility/XAccessibleHyperlink.hpp>
6899
+#include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
6900
+#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
6901
+#include <com/sun/star/awt/XExtendedToolkit.hpp>
6902
+#include <com/sun/star/awt/XTopWindow.hpp>
6903
+#include <com/sun/star/awt/XTopWindowListener.hpp>
6904
+#include <com/sun/star/awt/XWindow.hpp>
6905
+#include <com/sun/star/lang/XComponent.hpp>
6906
+#include <com/sun/star/lang/XServiceInfo.hpp>
6907
+#include <com/sun/star/lang/XInitialization.hpp>
6908
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
6909
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
6910
+#include <com/sun/star/beans/Property.hpp>
6912
+#include <rtl/ref.hxx>
6913
+#include <cppuhelper/factory.hxx>
6914
+#include <cppuhelper/queryinterface.hxx>
6916
+#include "atkwrapper.hxx"
6917
+#include "atklistener.hxx"
6919
+#ifdef ENABLE_TRACING
6923
+#include <string.h>
6925
+using namespace ::com::sun::star;
6927
+static GObjectClass *parent_class = NULL;
6928
+static GHashTable *uno_to_gobject = NULL;
6930
+static G_CONST_RETURN gchar *
6931
+getAsConst( rtl::OUString rString )
6933
+ static const int nMax = 10;
6934
+ static rtl::OString aUgly[nMax];
6935
+ static int nIdx = 0;
6936
+ nIdx = (nIdx + 1) % nMax;
6937
+ aUgly[nIdx] = rtl::OUStringToOString( rString, RTL_TEXTENCODING_UTF8 );
6938
+ return aUgly[ nIdx ];
6941
+static AtkRelationType mapRelationType( sal_Int16 nRelation )
6943
+ AtkRelationType type = ATK_RELATION_NULL;
6945
+ switch( nRelation )
6947
+ case accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM:
6948
+ type = ATK_RELATION_FLOWS_FROM;
6951
+ case accessibility::AccessibleRelationType::CONTENT_FLOWS_TO:
6952
+ type = ATK_RELATION_FLOWS_TO;
6955
+ case accessibility::AccessibleRelationType::CONTROLLED_BY:
6956
+ type = ATK_RELATION_CONTROLLED_BY;
6959
+ case accessibility::AccessibleRelationType::CONTROLLER_FOR:
6960
+ type = ATK_RELATION_CONTROLLER_FOR;
6963
+ case accessibility::AccessibleRelationType::LABEL_FOR:
6964
+ type = ATK_RELATION_LABEL_FOR;
6967
+ case accessibility::AccessibleRelationType::LABELED_BY:
6968
+ type = ATK_RELATION_LABELLED_BY;
6971
+ case accessibility::AccessibleRelationType::MEMBER_OF:
6972
+ type = ATK_RELATION_MEMBER_OF;
6975
+ case accessibility::AccessibleRelationType::SUB_WINDOW_OF:
6976
+ type = ATK_RELATION_SUBWINDOW_OF;
6983
+ ATK_RELATION_NODE_CHILD_OF,
6984
+ ATK_RELATION_EMBEDS,
6985
+ ATK_RELATION_EMBEDDED_BY,
6986
+ ATK_RELATION_POPUP_FOR,
6992
+AtkStateType mapAtkState( sal_Int16 nState )
6994
+ AtkStateType type = ATK_STATE_INVALID;
6996
+ // A perfect / complete mapping ...
6999
+#define MAP_DIRECT( a ) \
7000
+ case accessibility::AccessibleStateType::a: \
7001
+ type = ATK_STATE_##a; break
7003
+ MAP_DIRECT( INVALID );
7004
+ MAP_DIRECT( ACTIVE );
7005
+ MAP_DIRECT( ARMED );
7006
+ MAP_DIRECT( BUSY );
7007
+ MAP_DIRECT( CHECKED );
7008
+ MAP_DIRECT( EDITABLE );
7009
+ MAP_DIRECT( ENABLED );
7010
+ MAP_DIRECT( EXPANDABLE );
7011
+ MAP_DIRECT( EXPANDED );
7012
+ MAP_DIRECT( FOCUSABLE );
7013
+ MAP_DIRECT( FOCUSED );
7014
+ MAP_DIRECT( HORIZONTAL );
7015
+ MAP_DIRECT( ICONIFIED );
7016
+ MAP_DIRECT( INDETERMINATE );
7017
+ MAP_DIRECT( MANAGES_DESCENDANTS );
7018
+ MAP_DIRECT( MODAL );
7019
+ MAP_DIRECT( MULTI_LINE );
7020
+ MAP_DIRECT( OPAQUE );
7021
+ MAP_DIRECT( PRESSED );
7022
+ MAP_DIRECT( RESIZABLE );
7023
+ MAP_DIRECT( SELECTABLE );
7024
+ MAP_DIRECT( SELECTED );
7025
+ MAP_DIRECT( SENSITIVE );
7026
+ MAP_DIRECT( SHOWING );
7027
+ MAP_DIRECT( SINGLE_LINE );
7028
+ MAP_DIRECT( STALE );
7029
+ MAP_DIRECT( TRANSIENT );
7030
+ MAP_DIRECT( VERTICAL );
7031
+ MAP_DIRECT( VISIBLE );
7032
+ // a spelling error ...
7033
+ case accessibility::AccessibleStateType::DEFUNC:
7034
+ type = ATK_STATE_DEFUNCT; break;
7035
+ case accessibility::AccessibleStateType::MULTI_SELECTABLE:
7036
+ type = ATK_STATE_MULTISELECTABLE; break;
7044
+static AtkRole mapToAtkRole( sal_Int16 nRole )
7046
+ AtkRole role = ATK_ROLE_UNKNOWN;
7051
+ case a: role = b; break
7053
+ MAP( ::accessibility::AccessibleRole::UNKNOWN, ATK_ROLE_UNKNOWN );
7054
+ MAP( ::accessibility::AccessibleRole::ALERT, ATK_ROLE_ALERT );
7055
+ MAP( ::accessibility::AccessibleRole::COLUMN_HEADER, ATK_ROLE_COLUMN_HEADER );
7056
+ MAP( ::accessibility::AccessibleRole::CANVAS, ATK_ROLE_CANVAS );
7057
+ MAP( ::accessibility::AccessibleRole::CHECK_BOX, ATK_ROLE_CHECK_BOX );
7058
+ MAP( ::accessibility::AccessibleRole::CHECK_MENU_ITEM, ATK_ROLE_CHECK_MENU_ITEM );
7059
+ MAP( ::accessibility::AccessibleRole::COLOR_CHOOSER, ATK_ROLE_COLOR_CHOOSER );
7060
+ MAP( ::accessibility::AccessibleRole::COMBO_BOX, ATK_ROLE_COMBO_BOX );
7061
+ MAP( ::accessibility::AccessibleRole::DATE_EDITOR, ATK_ROLE_DATE_EDITOR );
7062
+ MAP( ::accessibility::AccessibleRole::DESKTOP_ICON, ATK_ROLE_DESKTOP_ICON );
7063
+ MAP( ::accessibility::AccessibleRole::DESKTOP_PANE, ATK_ROLE_DESKTOP_FRAME ); // ? pane
7064
+ MAP( ::accessibility::AccessibleRole::DIRECTORY_PANE, ATK_ROLE_DIRECTORY_PANE );
7065
+ MAP( ::accessibility::AccessibleRole::DIALOG, ATK_ROLE_DIALOG );
7066
+ MAP( ::accessibility::AccessibleRole::DOCUMENT, ATK_ROLE_UNKNOWN ); // - FIXME -
7067
+ MAP( ::accessibility::AccessibleRole::EMBEDDED_OBJECT, ATK_ROLE_UNKNOWN ); // - FIXME -
7068
+ MAP( ::accessibility::AccessibleRole::END_NOTE, ATK_ROLE_UNKNOWN ); // - FIXME -
7069
+ MAP( ::accessibility::AccessibleRole::FILE_CHOOSER, ATK_ROLE_FILE_CHOOSER );
7070
+ MAP( ::accessibility::AccessibleRole::FILLER, ATK_ROLE_FILLER );
7071
+ MAP( ::accessibility::AccessibleRole::FONT_CHOOSER, ATK_ROLE_FONT_CHOOSER );
7072
+ MAP( ::accessibility::AccessibleRole::FOOTER, ATK_ROLE_FOOTER );
7073
+ MAP( ::accessibility::AccessibleRole::FOOTNOTE, ATK_ROLE_TEXT ); // - FIXME -
7074
+ MAP( ::accessibility::AccessibleRole::FRAME, ATK_ROLE_FRAME );
7075
+ MAP( ::accessibility::AccessibleRole::GLASS_PANE, ATK_ROLE_GLASS_PANE );
7076
+ MAP( ::accessibility::AccessibleRole::GRAPHIC, ATK_ROLE_UNKNOWN ); // - FIXME -
7077
+ MAP( ::accessibility::AccessibleRole::GROUP_BOX, ATK_ROLE_UNKNOWN ); // - FIXME -
7078
+ MAP( ::accessibility::AccessibleRole::HEADER, ATK_ROLE_HEADER );
7079
+ MAP( ::accessibility::AccessibleRole::HEADING, ATK_ROLE_HEADER ); // - FIXME -
7080
+ MAP( ::accessibility::AccessibleRole::HYPER_LINK, ATK_ROLE_TEXT ); // - FIXME -
7081
+ MAP( ::accessibility::AccessibleRole::ICON, ATK_ROLE_ICON );
7082
+ MAP( ::accessibility::AccessibleRole::INTERNAL_FRAME, ATK_ROLE_INTERNAL_FRAME );
7083
+ MAP( ::accessibility::AccessibleRole::LABEL, ATK_ROLE_LABEL );
7084
+ MAP( ::accessibility::AccessibleRole::LAYERED_PANE, ATK_ROLE_LAYERED_PANE );
7085
+ MAP( ::accessibility::AccessibleRole::LIST, ATK_ROLE_LIST );
7086
+ MAP( ::accessibility::AccessibleRole::LIST_ITEM, ATK_ROLE_LIST_ITEM );
7087
+ MAP( ::accessibility::AccessibleRole::MENU, ATK_ROLE_MENU );
7088
+ MAP( ::accessibility::AccessibleRole::MENU_BAR, ATK_ROLE_MENU_BAR );
7089
+ MAP( ::accessibility::AccessibleRole::MENU_ITEM, ATK_ROLE_MENU_ITEM );
7090
+ MAP( ::accessibility::AccessibleRole::OPTION_PANE, ATK_ROLE_OPTION_PANE );
7091
+ MAP( ::accessibility::AccessibleRole::PAGE_TAB, ATK_ROLE_PAGE_TAB );
7092
+ MAP( ::accessibility::AccessibleRole::PAGE_TAB_LIST, ATK_ROLE_PAGE_TAB_LIST );
7093
+ MAP( ::accessibility::AccessibleRole::PANEL, ATK_ROLE_PANEL );
7094
+ MAP( ::accessibility::AccessibleRole::PARAGRAPH, ATK_ROLE_PARAGRAPH );
7095
+ MAP( ::accessibility::AccessibleRole::PASSWORD_TEXT, ATK_ROLE_PASSWORD_TEXT );
7096
+ MAP( ::accessibility::AccessibleRole::POPUP_MENU, ATK_ROLE_POPUP_MENU );
7097
+ MAP( ::accessibility::AccessibleRole::PUSH_BUTTON, ATK_ROLE_PUSH_BUTTON );
7098
+ MAP( ::accessibility::AccessibleRole::PROGRESS_BAR, ATK_ROLE_PROGRESS_BAR );
7099
+ MAP( ::accessibility::AccessibleRole::RADIO_BUTTON, ATK_ROLE_RADIO_BUTTON );
7100
+ MAP( ::accessibility::AccessibleRole::RADIO_MENU_ITEM, ATK_ROLE_RADIO_MENU_ITEM );
7101
+ MAP( ::accessibility::AccessibleRole::ROW_HEADER, ATK_ROLE_ROW_HEADER );
7102
+ MAP( ::accessibility::AccessibleRole::ROOT_PANE, ATK_ROLE_ROOT_PANE );
7103
+ MAP( ::accessibility::AccessibleRole::SCROLL_BAR, ATK_ROLE_SCROLL_BAR );
7104
+ MAP( ::accessibility::AccessibleRole::SCROLL_PANE, ATK_ROLE_SCROLL_PANE );
7105
+ MAP( ::accessibility::AccessibleRole::SHAPE, ATK_ROLE_UNKNOWN ); // - FIXME -
7106
+ MAP( ::accessibility::AccessibleRole::SEPARATOR, ATK_ROLE_SEPARATOR );
7107
+ MAP( ::accessibility::AccessibleRole::SLIDER, ATK_ROLE_SLIDER );
7108
+ MAP( ::accessibility::AccessibleRole::SPIN_BOX, ATK_ROLE_SPIN_BUTTON ); // ?
7109
+ MAP( ::accessibility::AccessibleRole::SPLIT_PANE, ATK_ROLE_SPLIT_PANE );
7110
+ MAP( ::accessibility::AccessibleRole::STATUS_BAR, ATK_ROLE_STATUSBAR );
7111
+ MAP( ::accessibility::AccessibleRole::TABLE, ATK_ROLE_TABLE );
7112
+ MAP( ::accessibility::AccessibleRole::TABLE_CELL, ATK_ROLE_TABLE_CELL );
7113
+ MAP( ::accessibility::AccessibleRole::TEXT, ATK_ROLE_TEXT );
7114
+ MAP( ::accessibility::AccessibleRole::TEXT_FRAME, ATK_ROLE_UNKNOWN ); // - FIXME -
7115
+ MAP( ::accessibility::AccessibleRole::TOGGLE_BUTTON, ATK_ROLE_TOGGLE_BUTTON );
7116
+ MAP( ::accessibility::AccessibleRole::TOOL_BAR, ATK_ROLE_TOOL_BAR );
7117
+ MAP( ::accessibility::AccessibleRole::TOOL_TIP, ATK_ROLE_TOOL_TIP );
7118
+ MAP( ::accessibility::AccessibleRole::TREE, ATK_ROLE_TREE );
7119
+ MAP( ::accessibility::AccessibleRole::VIEW_PORT, ATK_ROLE_VIEWPORT );
7120
+ MAP( ::accessibility::AccessibleRole::WINDOW, ATK_ROLE_WINDOW );
7125
+/* Roles unimplemented by OO.o / a11y:
7126
+ ATK_ROLE_INVALID, ATK_ROLE_ACCEL_LABEL, ATK_ROLE_ANIMATION,
7127
+ ATK_ROLE_ARROW, ATK_ROLE_CALENDAR, ATK_ROLE_DIAL,
7128
+ ATK_ROLE_DRAWING_AREA, ATK_ROLE_HTML_CONTAINER, ATK_ROLE_IMAGE,
7129
+ ATK_ROLE_TABLE_COLUMN_HEADER, ATK_ROLE_TABLE_ROW_HEADER, ATK_ROLE_TEAR_OFF_MENU_ITEM,
7130
+ ATK_ROLE_TERMINAL, ATK_ROLE_TREE_TABLE, ATK_ROLE_RULER,
7131
+ ATK_ROLE_APPLICATION, ATK_ROLE_AUTOCOMPLETE, ATK_ROLE_EDITBAR */
7137
+static accessibility::XAccessibleContext*
7138
+ getContext( AtkObject* obj ) throw (uno::RuntimeException)
7140
+ AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( obj );
7144
+ if( !pWrap->mpContext && pWrap->mpContext )
7146
+ uno::Any any = pWrap->mpContext->queryInterface( accessibility::XAccessibleContext::static_type(NULL) );
7147
+ pWrap->mpContext = reinterpret_cast< accessibility::XAccessibleContext * > (any.pReserved);
7148
+ pWrap->mpContext->acquire();
7151
+ return pWrap->mpContext;
7157
+/*****************************************************************************/
7161
+/*****************************************************************************/
7163
+static G_CONST_RETURN gchar*
7164
+wrapper_get_name( AtkObject *pObject )
7166
+ G_CONST_RETURN gchar* name;
7168
+ name = ATK_OBJECT_CLASS (parent_class)->get_name( pObject );
7172
+ accessibility::XAccessibleContext* pContext = getContext( pObject );
7174
+ name = getAsConst( pContext->getAccessibleName() );
7176
+ catch(const uno::Exception& e) {
7177
+ g_warning( "Exception in getAccessibleName()" );
7184
+/*****************************************************************************/
7186
+static G_CONST_RETURN gchar*
7187
+wrapper_get_description( AtkObject *pObject )
7189
+ G_CONST_RETURN gchar* desc;
7191
+ desc = ATK_OBJECT_CLASS (parent_class)->get_description( pObject );
7195
+ accessibility::XAccessibleContext* pContext = getContext( pObject );
7197
+ desc = getAsConst( pContext->getAccessibleDescription() );
7199
+ catch(const uno::Exception& e) {
7200
+ g_warning( "Exception in getAccessibleDescription()" );
7207
+/*****************************************************************************/
7210
+wrapper_get_n_children( AtkObject *pObject )
7213
+ accessibility::XAccessibleContext* pContext = getContext( pObject );
7215
+ return pContext->getAccessibleChildCount();
7217
+ catch(const uno::Exception& e) {
7218
+ g_warning( "Exception in getAccessibleChildCount()" );
7224
+/*****************************************************************************/
7227
+wrapper_ref_child( AtkObject *pObject,
7231
+ accessibility::XAccessibleContext* pContext = getContext( pObject );
7234
+// fprintf(stderr, "wrapper_ref_child %d of (%d)\n", i,
7235
+// getContext( pObject )->getAccessibleChildCount());
7236
+ if( i >= 0 && i < getContext( pObject )->getAccessibleChildCount())
7238
+ uno::Reference< accessibility::XAccessible > xAccessible =
7239
+ pContext->getAccessibleChild( i );
7241
+ AtkObject* child = atk_object_wrapper_ref( xAccessible );
7246
+ catch(const uno::Exception& e) {
7247
+ g_warning( "Exception in getAccessibleChildCount()" );
7254
+wrapper_get_index_in_parent( AtkObject *pObject )
7257
+ accessibility::XAccessibleContext* pContext = getContext( pObject );
7259
+#ifdef ENABLE_TRACING
7261
+ fprintf(stderr, "%p->getAccessibleIndexInParent() returned: %u\n",
7262
+ ATK_OBJECT_WRAPPER( pObject )->mpAccessible,
7263
+ pContext->getAccessibleIndexInParent());
7266
+ return pContext->getAccessibleIndexInParent();
7268
+ catch(const uno::Exception& e) {
7269
+ g_warning( "Exception in getAccessibleIndexInParent()" );
7274
+static AtkRelationSet *
7275
+wrapper_ref_relation_set( AtkObject *pObject )
7277
+ AtkRelationSet *pSet = atk_relation_set_new();
7279
+ accessibility::XAccessibleContext* pContext = getContext( pObject );
7282
+ uno::Reference< accessibility::XAccessibleRelationSet > xRelationSet;
7284
+ xRelationSet = pContext->getAccessibleRelationSet();
7286
+ sal_Int32 nRelations = xRelationSet.is() ? xRelationSet->getRelationCount() : 0;
7287
+ for( sal_Int32 n = 0; n < nRelations; n++ )
7289
+ accessibility::AccessibleRelation aRelation = xRelationSet->getRelation( n );
7290
+ sal_uInt32 nTargetCount = aRelation.TargetSet.getLength();
7291
+ AtkObject **pTargets = (AtkObject **) alloca( nTargetCount * sizeof(AtkObject *) );
7293
+ for( sal_uInt32 i = 0; i < nTargetCount; i++ )
7295
+ uno::Reference< accessibility::XAccessible > xAccessible(
7296
+ aRelation.TargetSet[i], uno::UNO_QUERY );
7297
+ pTargets[i] = atk_object_wrapper_ref( xAccessible );
7300
+ AtkRelation *pRel = atk_relation_new
7301
+ ( pTargets, nTargetCount,
7302
+ mapRelationType( aRelation.RelationType ) );
7303
+ atk_relation_set_add( pSet, pRel );
7304
+ g_object_unref( G_OBJECT( pRel ) );
7308
+ catch(const uno::Exception &e)
7310
+ g_object_unref( G_OBJECT( pSet ) );
7317
+static AtkStateSet *
7318
+wrapper_ref_state_set( AtkObject *pObject )
7320
+ AtkStateSet *pSet = atk_state_set_new();
7322
+ accessibility::XAccessibleContext* pContext = getContext( pObject );
7325
+ uno::Reference< accessibility::XAccessibleStateSet > xStateSet =
7326
+ pContext->getAccessibleStateSet();
7328
+ if( xStateSet.is() )
7330
+ uno::Sequence< sal_Int16 > aStates = xStateSet->getStates();
7332
+ for( sal_Int32 n = 0; n < aStates.getLength(); n++ )
7333
+ atk_state_set_add_state( pSet, mapAtkState( aStates[n] ) );
7335
+ // We need to emulate FOCUS state for menus, menu-items etc.
7336
+ if( pObject == atk_get_focus_object() )
7337
+ atk_state_set_add_state( pSet, ATK_STATE_FOCUSED );
7338
+/* FIXME - should we do this ?
7340
+ atk_state_set_remove_state( pSet, ATK_STATE_FOCUSED );
7346
+ catch(const uno::Exception &e)
7348
+ g_warning( "Exception in wrapper_ref_state_set" );
7350
+ g_object_unref( G_OBJECT( pSet ) );
7358
+atk_object_wrapper_finalize (GObject *obj)
7360
+ AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER (obj);
7362
+ if( pWrap->mpAccessible )
7364
+ g_hash_table_remove( uno_to_gobject, pWrap->mpAccessible );
7365
+ pWrap->mpAccessible->release();
7366
+ pWrap->mpAccessible = NULL;
7369
+ atk_object_wrapper_dispose( pWrap );
7371
+ parent_class->finalize( obj );
7375
+atk_object_wrapper_class_init (AtkObjectWrapperClass *klass)
7377
+ GObjectClass *gobject_class = G_OBJECT_CLASS( klass );
7378
+ AtkObjectClass *atk_class = ATK_OBJECT_CLASS( klass );
7380
+ parent_class = (GObjectClass *) g_type_class_peek_parent (klass);
7382
+ // GObject methods
7383
+ gobject_class->finalize = atk_object_wrapper_finalize;
7385
+ // AtkObject methods
7386
+ atk_class->get_name = wrapper_get_name;
7387
+ atk_class->get_description = wrapper_get_description;
7388
+ atk_class->get_n_children = wrapper_get_n_children;
7389
+ atk_class->ref_child = wrapper_ref_child;
7390
+ atk_class->get_index_in_parent = wrapper_get_index_in_parent;
7391
+ atk_class->ref_relation_set = wrapper_ref_relation_set;
7392
+ atk_class->ref_state_set = wrapper_ref_state_set;
7396
+atk_object_wrapper_init (AtkObjectWrapper *wrapper,
7397
+ AtkObjectWrapperClass)
7399
+ wrapper->mpAction = NULL;
7400
+ wrapper->mpComponent = NULL;
7401
+ wrapper->mpEditableText = NULL;
7402
+ wrapper->mpHypertext = NULL;
7403
+ wrapper->mpImage = NULL;
7404
+ wrapper->mpSelection = NULL;
7405
+ wrapper->mpTable = NULL;
7406
+ wrapper->mpText = NULL;
7407
+ wrapper->mpValue = NULL;
7413
+atk_object_wrapper_get_type (void)
7415
+ static GType type = 0;
7419
+ static const GTypeInfo typeInfo =
7421
+ sizeof (AtkObjectWrapperClass),
7422
+ (GBaseInitFunc) NULL,
7423
+ (GBaseFinalizeFunc) NULL,
7424
+ (GClassInitFunc) atk_object_wrapper_class_init,
7425
+ (GClassFinalizeFunc) NULL,
7427
+ sizeof (AtkObjectWrapper),
7429
+ (GInstanceInitFunc) atk_object_wrapper_init,
7432
+ type = g_type_register_static (ATK_TYPE_OBJECT,
7434
+ &typeInfo, (GTypeFlags)0) ;
7440
+isOfType( uno::XInterface *pInterface, const uno::Type & rType )
7442
+ g_return_val_if_fail( pInterface != NULL, false );
7446
+ uno::Any aRet = pInterface->queryInterface( rType );
7448
+ bIs = ( ( typelib_TypeClass_INTERFACE == aRet.pType->eTypeClass ) &&
7449
+ ( aRet.pReserved != NULL ) );
7450
+ } catch( const uno::Exception &e) { }
7456
+typedef GType (* GetGIfaceType ) (void);
7460
+ GInterfaceInitFunc aInit;
7461
+ GetGIfaceType aGetGIfaceType;
7462
+ const uno::Type & (*aGetUnoType) (void *);
7464
+// re-location heaven:
7466
+ "Comp", (GInterfaceInitFunc) componentIfaceInit,
7467
+ atk_component_get_type,
7468
+ accessibility::XAccessibleComponent::static_type
7471
+ "Act", (GInterfaceInitFunc) actionIfaceInit,
7472
+ atk_action_get_type,
7473
+ accessibility::XAccessibleAction::static_type
7476
+ "Txt", (GInterfaceInitFunc) textIfaceInit,
7477
+ atk_text_get_type,
7478
+ accessibility::XAccessibleText::static_type
7481
+ "Val", (GInterfaceInitFunc) valueIfaceInit,
7482
+ atk_value_get_type,
7483
+ accessibility::XAccessibleValue::static_type
7486
+ "Tab", (GInterfaceInitFunc) tableIfaceInit,
7487
+ atk_table_get_type,
7488
+ accessibility::XAccessibleTable::static_type
7491
+ "Edt", (GInterfaceInitFunc) editableTextIfaceInit,
7492
+ atk_editable_text_get_type,
7493
+ accessibility::XAccessibleEditableText::static_type
7496
+ "Img", (GInterfaceInitFunc) imageIfaceInit,
7497
+ atk_image_get_type,
7498
+ accessibility::XAccessibleImage::static_type
7501
+ "Hyp", (GInterfaceInitFunc) hypertextIfaceInit,
7502
+ atk_hypertext_get_type,
7503
+ accessibility::XAccessibleHypertext::static_type
7506
+ "Sel", (GInterfaceInitFunc) selectionIfaceInit,
7507
+ atk_selection_get_type,
7508
+ accessibility::XAccessibleSelection::static_type
7510
+ // AtkDocument is a nastily broken interface (so far)
7511
+ // we could impl. get_document_type perhaps though.
7514
+const int aTypeTableSize = G_N_ELEMENTS( aTypeTable );
7517
+ensureTypeFor( uno::XInterface *pAccessible )
7520
+ int bTypes[ aTypeTableSize ] = { 0, };
7521
+ rtl::OString aTypeName( "OOoAtkObj" );
7523
+ for( i = 0; i < aTypeTableSize; i++ )
7525
+ if( isOfType( pAccessible, aTypeTable[i].aGetUnoType(0) ) )
7527
+ aTypeName += aTypeTable[i].name;
7530
+// g_message( "Accessible %p has type '%s' (%d)",
7531
+// pAccessible, aTypeTable[i].name, bTypes[i] );
7534
+ GType nType = g_type_from_name( aTypeName );
7535
+ if( nType == G_TYPE_INVALID )
7537
+ GTypeInfo aTypeInfo = {
7538
+ sizeof( AtkObjectWrapperClass ),
7539
+ NULL, NULL, NULL, NULL, NULL,
7540
+ sizeof( AtkObjectWrapper ),
7543
+ nType = g_type_register_static( ATK_TYPE_OBJECT_WRAPPER,
7544
+ aTypeName, &aTypeInfo, (GTypeFlags)0 ) ;
7546
+ for( int j = 0; j < aTypeTableSize; j++ )
7549
+ GInterfaceInfo aIfaceInfo = { NULL, NULL, NULL };
7550
+ aIfaceInfo.interface_init = aTypeTable[j].aInit;
7551
+ g_type_add_interface_static (nType, aTypeTable[j].aGetGIfaceType(),
7559
+atk_object_wrapper_ref( const uno::Reference< accessibility::XAccessible > &rxAccessible, bool create )
7561
+ g_return_val_if_fail( rxAccessible.get() != NULL, NULL );
7563
+ if( uno_to_gobject )
7566
+ g_hash_table_lookup(uno_to_gobject, (gpointer) rxAccessible.get());
7569
+ return ATK_OBJECT( g_object_ref( cached ) );
7573
+ return atk_object_wrapper_new( rxAccessible );
7580
+atk_object_wrapper_new( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible,
7581
+ AtkObject* parent )
7583
+ g_return_val_if_fail( rxAccessible.get() != NULL, NULL );
7585
+ AtkObjectWrapper *pWrap = NULL;
7588
+ uno::Reference< accessibility::XAccessibleContext > xContext(rxAccessible->getAccessibleContext());
7590
+ g_return_val_if_fail( xContext.get() != NULL, NULL );
7592
+ GType nType = ensureTypeFor( xContext.get() );
7593
+ gpointer obj = g_object_new( nType, NULL);
7595
+ if( !uno_to_gobject )
7596
+ uno_to_gobject = g_hash_table_new (NULL, NULL);
7598
+ // We assume direct pointer comparison is sufficient...
7599
+ g_hash_table_insert( uno_to_gobject, (gpointer) rxAccessible.get(), obj );
7600
+ rxAccessible->acquire();
7602
+ pWrap = ATK_OBJECT_WRAPPER( obj );
7603
+ pWrap->mpAccessible = rxAccessible.get();
7605
+ xContext->acquire();
7606
+ pWrap->mpContext = xContext.get();
7608
+ AtkObject* atk_obj = ATK_OBJECT(pWrap);
7609
+ atk_obj->role = mapToAtkRole( xContext->getAccessibleRole() );
7613
+ atk_obj->accessible_parent = parent;
7614
+ g_object_ref( atk_obj->accessible_parent );
7618
+ uno::Reference< accessibility::XAccessible > xParent(xContext->getAccessibleParent());
7619
+ if( xParent.is() )
7621
+ atk_obj->accessible_parent = atk_object_wrapper_ref( xParent );
7625
+ atk_object_set_parent( atk_obj, atk_get_root() );
7626
+ g_object_ref( atk_obj->accessible_parent );
7630
+ // Attach a listener to the UNO object if it's not TRANSIENT
7631
+ uno::Reference< accessibility::XAccessibleStateSet > xStateSet( xContext->getAccessibleStateSet() );
7632
+ if( xStateSet.is() && ! xStateSet->contains( accessibility::AccessibleStateType::TRANSIENT ) )
7634
+ uno::Reference< accessibility::XAccessibleEventBroadcaster > xBroadcaster( xContext, uno::UNO_QUERY_THROW );
7635
+ xBroadcaster->addEventListener( static_cast< accessibility::XAccessibleEventListener * > ( new AtkListener( pWrap ) ) );
7638
+ return ATK_OBJECT( pWrap );
7640
+ catch (const uno::Exception &e)
7643
+ g_object_unref( pWrap );
7649
+#define RELEASE(i) if( i ) { i->release(); i = NULL; }
7651
+void atk_object_wrapper_dispose(AtkObjectWrapper* wrapper)
7653
+ RELEASE( wrapper->mpContext )
7654
+ RELEASE( wrapper->mpAction )
7655
+ RELEASE( wrapper->mpComponent )
7656
+ RELEASE( wrapper->mpEditableText )
7657
+ RELEASE( wrapper->mpHypertext )
7658
+ RELEASE( wrapper->mpImage )
7659
+ RELEASE( wrapper->mpSelection )
7660
+ RELEASE( wrapper->mpTable )
7661
+ RELEASE( wrapper->mpText )
7662
+ RELEASE( wrapper->mpValue )
7664
Index: vcl/unx/gtk/a11y/atkwrapper.hxx
7665
===================================================================
7666
RCS file: vcl/unx/gtk/a11y/atkwrapper.hxx
7667
diff -N vcl/unx/gtk/a11y/atkwrapper.hxx
7668
--- /dev/null 1 Jan 1970 00:00:00 -0000
7669
+++ vcl/unx/gtk/a11y/atkwrapper.hxx 31 Mar 2006 12:19:40 -0000 1.1.2.9
7671
+/*************************************************************************
7673
+ * OpenOffice.org - a multi-platform office productivity suite
7675
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
7677
+ * $Revision: 1.1.2.1 $
7679
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
7681
+ * The Contents of this file are made available subject to
7682
+ * the terms of GNU Lesser General Public License Version 2.1.
7685
+ * GNU Lesser General Public License Version 2.1
7686
+ * =============================================
7687
+ * Copyright 2005 by Sun Microsystems, Inc.
7688
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
7690
+ * This library is free software; you can redistribute it and/or
7691
+ * modify it under the terms of the GNU Lesser General Public
7692
+ * License version 2.1, as published by the Free Software Foundation.
7694
+ * This library is distributed in the hope that it will be useful,
7695
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
7696
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7697
+ * Lesser General Public License for more details.
7699
+ * You should have received a copy of the GNU Lesser General Public
7700
+ * License along with this library; if not, write to the Free Software
7701
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
7702
+ * MA 02111-1307 USA
7704
+ ************************************************************************/
7706
+#ifndef __ATK_WRAPPER_HXX__
7707
+#define __ATK_WRAPPER_HXX__
7709
+#include <atk/atk.h>
7711
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HPP_
7712
+#include <com/sun/star/accessibility/XAccessible.hpp>
7717
+typedef struct _AtkObjectWrapper AtkObjectWrapper;
7718
+typedef struct _AtkObjectWrapperClass AtkObjectWrapperClass;
7720
+namespace com { namespace sun { namespace star { namespace accessibility {
7721
+ class XAccessibleAction;
7722
+ class XAccessibleComponent;
7723
+ class XAccessibleEditableText;
7724
+ class XAccessibleHypertext;
7725
+ class XAccessibleImage;
7726
+ class XAccessibleSelection;
7727
+ class XAccessibleTable;
7728
+ class XAccessibleText;
7729
+ class XAccessibleValue;
7733
+struct _AtkObjectWrapper
7735
+ AtkObject aParent;
7737
+ ::com::sun::star::accessibility::XAccessible *mpAccessible;
7738
+ ::com::sun::star::accessibility::XAccessibleContext *mpContext;
7739
+ ::com::sun::star::accessibility::XAccessibleAction *mpAction;
7740
+ ::com::sun::star::accessibility::XAccessibleComponent *mpComponent;
7741
+ ::com::sun::star::accessibility::XAccessibleEditableText *mpEditableText;
7742
+ ::com::sun::star::accessibility::XAccessibleHypertext *mpHypertext;
7743
+ ::com::sun::star::accessibility::XAccessibleImage *mpImage;
7744
+ ::com::sun::star::accessibility::XAccessibleSelection *mpSelection;
7745
+ ::com::sun::star::accessibility::XAccessibleTable *mpTable;
7746
+ ::com::sun::star::accessibility::XAccessibleText *mpText;
7747
+ ::com::sun::star::accessibility::XAccessibleValue *mpValue;
7749
+// ::rtl::OString * m_pKeyBindings
7752
+struct _AtkObjectWrapperClass
7754
+ AtkObjectClass aParentClass;
7757
+GType atk_object_wrapper_get_type (void) G_GNUC_CONST;
7758
+AtkObject * atk_object_wrapper_ref(
7759
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible,
7760
+ bool create = true );
7762
+AtkObject * atk_object_wrapper_new(
7763
+ const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible,
7764
+ AtkObject* parent = NULL );
7766
+void atk_object_wrapper_dispose(AtkObjectWrapper* wrapper);
7768
+AtkStateType mapAtkState( sal_Int16 nState );
7770
+void actionIfaceInit(AtkActionIface *iface);
7771
+void componentIfaceInit(AtkComponentIface *iface);
7772
+void editableTextIfaceInit(AtkEditableTextIface *iface);
7773
+void hypertextIfaceInit(AtkHypertextIface *iface);
7774
+void imageIfaceInit(AtkImageIface *iface);
7775
+void selectionIfaceInit(AtkSelectionIface *iface);
7776
+void tableIfaceInit(AtkTableIface *iface);
7777
+void textIfaceInit(AtkTextIface *iface);
7778
+void valueIfaceInit(AtkValueIface *iface);
7782
+#define ATK_TYPE_OBJECT_WRAPPER atk_object_wrapper_get_type()
7783
+#define ATK_OBJECT_WRAPPER(obj) \
7784
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_OBJECT_WRAPPER, AtkObjectWrapper))
7786
+static inline gchar *
7787
+OUStringToGChar(const rtl::OUString& rString )
7789
+ rtl::OString aUtf8 = rtl::OUStringToOString( rString, RTL_TEXTENCODING_UTF8 );
7790
+ return g_strdup( aUtf8 );
7793
+#define OUStringToConstGChar( string ) rtl::OUStringToOString( string, RTL_TEXTENCODING_UTF8 ).getStr()
7795
+#endif /* __ATK_WRAPPER_HXX__ */
7796
Index: vcl/unx/gtk/a11y/makefile.mk
7797
===================================================================
7798
RCS file: vcl/unx/gtk/a11y/makefile.mk
7799
diff -N vcl/unx/gtk/a11y/makefile.mk
7800
--- /dev/null 1 Jan 1970 00:00:00 -0000
7801
+++ vcl/unx/gtk/a11y/makefile.mk 31 Mar 2006 14:09:18 -0000 1.1.2.13
7803
+#*************************************************************************
7805
+# OpenOffice.org - a multi-platform office productivity suite
7807
+# $RCSfile: cws-atkbridge-20060425.diff,v $
7809
+# $Revision: 1.1.2.1 $
7811
+# last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
7813
+# The Contents of this file are made available subject to
7814
+# the terms of GNU Lesser General Public License Version 2.1.
7817
+# GNU Lesser General Public License Version 2.1
7818
+# =============================================
7819
+# Copyright 2005 by Sun Microsystems, Inc.
7820
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
7822
+# This library is free software; you can redistribute it and/or
7823
+# modify it under the terms of the GNU Lesser General Public
7824
+# License version 2.1, as published by the Free Software Foundation.
7826
+# This library is distributed in the hope that it will be useful,
7827
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
7828
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7829
+# Lesser General Public License for more details.
7831
+# You should have received a copy of the GNU Lesser General Public
7832
+# License along with this library; if not, write to the Free Software
7833
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
7834
+# MA 02111-1307 USA
7836
+#*************************************************************************
7842
+ENABLE_EXCEPTIONS=TRUE
7844
+# workaround for makedepend hang
7849
+# --- Settings -----------------------------------------------------
7851
+.INCLUDE : settings.mk
7853
+# --- Files --------------------------------------------------------
7855
+.IF "$(GUIBASE)"!="unx"
7858
+ @echo "Nothing to build for GUIBASE $(GUIBASE)"
7860
+.ELSE # "$(GUIBASE)"!="unx"
7862
+.IF "$(ENABLE_GTK)" != ""
7864
+PKGCONFIG_MODULES=gtk+-2.0
7865
+.INCLUDE : pkg_config.mk
7867
+CFLAGS+=-DVERSION=\"$(UPD)$(LAST_MINOR)\"
7869
+ATKVERSION:=$(shell $(PKGCONFIG) --modversion atk | $(AWK) -v num=true -f $(SOLARENV)$/bin$/getcompver.awk)
7871
+.IF $(ATKVERSION) >= "000100070000"
7872
+CFLAGS+=-DHAS_ATKRECTANGLE
7875
+LIB1TARGET=$(SLB)$/$(TARGET).lib
7877
+ $(SLO)$/atkaction.obj \
7878
+ $(SLO)$/atkbridge.obj \
7879
+ $(SLO)$/atkcomponent.obj \
7880
+ $(SLO)$/atkeditabletext.obj \
7881
+ $(SLO)$/atkfactory.obj \
7882
+ $(SLO)$/atkhypertext.obj \
7883
+ $(SLO)$/atkimage.obj \
7884
+ $(SLO)$/atklistener.obj \
7885
+ $(SLO)$/atkselection.obj \
7886
+ $(SLO)$/atktable.obj \
7887
+ $(SLO)$/atktext.obj \
7888
+ $(SLO)$/atktextattributes.obj \
7889
+ $(SLO)$/atkutil.obj \
7890
+ $(SLO)$/atkvalue.obj \
7891
+ $(SLO)$/atkwindow.obj \
7892
+ $(SLO)$/atkwrapper.obj
7894
+.ELSE # "$(ENABLE_GTK)" != ""
7897
+ @echo GTK disabled - nothing to build
7899
+.ENDIF # "$(GUIBASE)"!="unx"
7901
+# --- Targets ------------------------------------------------------
7903
+.INCLUDE : target.mk
7905
cvs diff: Diffing vcl/unx/gtk/app
7906
Index: vcl/unx/gtk/app/gtkinst.cxx
7907
===================================================================
7908
RCS file: /cvs/gsl/vcl/unx/gtk/app/gtkinst.cxx,v
7909
retrieving revision 1.11
7910
retrieving revision 1.9.6.9
7911
diff -u -p -r1.11 -r1.9.6.9
7912
--- vcl/unx/gtk/app/gtkinst.cxx 2 Nov 2005 13:32:37 -0000 1.11
7913
+++ vcl/unx/gtk/app/gtkinst.cxx 16 Feb 2006 11:08:15 -0000 1.9.6.9
7916
#include <plugins/gtk/gtkframe.hxx>
7917
#include <plugins/gtk/gtkobject.hxx>
7918
+#include <plugins/gtk/atkbridge.hxx>
7920
#include <rtl/strbuf.hxx>
7928
GtkHookedYieldMutex::GtkHookedYieldMutex()
7931
@@ -140,29 +143,6 @@ extern "C"
7935
- /* #i47797# as long as we do not have a working atk bridge
7936
- * prevent atk from interfering with the java accessibility bridge
7938
- #if ! defined HAVE_ATK_ACCESSIBILITY_BRIDGE
7939
- const char* pGtkModules = getenv( "GTK_MODULES" );
7942
- rtl::OString aModules( pGtkModules );
7943
- rtl::OStringBuffer aModulesOut( aModules.getLength() + 11 );
7944
- aModulesOut.append( "GTK_MODULES=" );
7945
- sal_Int32 nIndex = 0;
7946
- while( nIndex >= 0 )
7948
- rtl::OString aToken = aModules.getToken( 0, ':', nIndex );
7949
- if( aToken.equals( "gail" ) ||
7950
- aToken.equals( "atk-bridge" ) )
7952
- aModulesOut.append( ':' );
7953
- aModulesOut.append( aToken );
7955
- putenv( strdup( aModulesOut.getStr() ) );
7959
GtkYieldMutex *pYieldMutex;
7961
@@ -189,6 +169,22 @@ extern "C"
7963
pSalData->initNWF();
7965
+ const char* pGtkModules = getenv( "GTK_MODULES" );
7968
+ rtl::OString aModules( pGtkModules );
7969
+ sal_Int32 nIndex = 0;
7970
+ while( nIndex >= 0 )
7972
+ rtl::OString aToken = aModules.getToken( 0, ':', nIndex );
7973
+ if( aToken.equals( "gail" ) || aToken.equals( "atk-bridge" ) )
7984
cvs diff: Diffing vcl/unx/gtk/gdi
7985
cvs diff: Diffing vcl/unx/gtk/window
7986
Index: vcl/unx/gtk/window/gtkframe.cxx
7987
===================================================================
7988
RCS file: /cvs/gsl/vcl/unx/gtk/window/gtkframe.cxx,v
7989
retrieving revision 1.45
7990
retrieving revision 1.28.6.21
7991
diff -u -p -r1.45 -r1.28.6.21
7992
--- vcl/unx/gtk/window/gtkframe.cxx 6 Apr 2006 15:40:19 -0000 1.45
7993
+++ vcl/unx/gtk/window/gtkframe.cxx 13 Apr 2006 10:15:28 -0000 1.28.6.21
7995
#include <floatwin.hxx>
7997
#include <svapp.hxx>
7998
+#include <window.hxx>
8001
#include <X11/Xatom.h>
8006
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
8007
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
8009
+using namespace com::sun::star;
8011
int GtkSalFrame::m_nFloats = 0;
8013
static USHORT GetKeyModCode( guint state )
8014
@@ -405,13 +411,49 @@ GtkSalFrame::~GtkSalFrame()
8015
if( m_pFixedContainer )
8016
gtk_widget_destroy( GTK_WIDGET(m_pFixedContainer) );
8019
+ g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", NULL );
8020
gtk_widget_destroy( GTK_WIDGET(m_pWindow) );
8022
if( m_pForeignParent )
8023
g_object_unref( G_OBJECT(m_pForeignParent) );
8024
if( m_pForeignTopLevel )
8025
g_object_unref(G_OBJECT( m_pForeignTopLevel) );
8029
+ * Always use a sub-class of GtkFixed we can tag for a11y. This allows us to
8030
+ * utilize GAIL for the toplevel window and toolkit implementation incl.
8031
+ * key event listener support ..
8035
+ooo_fixed_get_type()
8037
+ static GType type = 0;
8040
+ static const GTypeInfo tinfo =
8042
+ sizeof (GtkFixedClass),
8043
+ (GBaseInitFunc) NULL, /* base init */
8044
+ (GBaseFinalizeFunc) NULL, /* base finalize */
8045
+ (GClassInitFunc) NULL, /* class init */
8046
+ (GClassFinalizeFunc) NULL, /* class finalize */
8047
+ NULL, /* class data */
8048
+ sizeof (GtkFixed), /* instance size */
8049
+ 0, /* nb preallocs */
8050
+ (GInstanceInitFunc) NULL, /* instance init */
8051
+ NULL /* value table */
8054
+ type = g_type_register_static( GTK_TYPE_FIXED, "OOoFixed",
8055
+ &tinfo, (GTypeFlags) 0);
8061
void GtkSalFrame::InitCommon()
8064
@@ -459,7 +501,7 @@ void GtkSalFrame::InitCommon()
8066
// add the fixed container child,
8067
// fixed is needed since we have to position plugin windows
8068
- m_pFixedContainer = GTK_FIXED(gtk_fixed_new());
8069
+ m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), NULL ));
8070
gtk_container_add( GTK_CONTAINER(m_pWindow), GTK_WIDGET(m_pFixedContainer) );
8071
gtk_widget_show( GTK_WIDGET(m_pFixedContainer) );
8073
@@ -581,6 +623,102 @@ static void lcl_set_accept_focus( GtkWin
8077
+GtkSalFrame *GtkSalFrame::getFromWindow( GtkWindow *pWindow )
8079
+ return (GtkSalFrame *) g_object_get_data( G_OBJECT( pWindow ), "SalFrame" );
8083
+GtkSalFrame::GetAtkRole( GtkWindow* window )
8085
+ static AtkRole aDefaultRole = ATK_ROLE_INVALID;
8087
+ // Special role for sub-menu and combo-box popups that are exposed directly
8088
+ // by their parents already.
8089
+ if( aDefaultRole == ATK_ROLE_INVALID )
8090
+ aDefaultRole = atk_role_register( "redundant object" );
8092
+ AtkRole role = aDefaultRole;
8094
+ GtkSalFrame * pFrame = getFromWindow( window );
8097
+ Window *pWindow = static_cast <Window *> (pFrame->GetInstance());
8100
+ // Determine the appropriate role for the GtkWindow
8101
+ switch( pWindow->GetAccessibleRole() )
8103
+ case accessibility::AccessibleRole::ALERT:
8104
+ role = ATK_ROLE_ALERT;
8107
+ case accessibility::AccessibleRole::DIALOG:
8108
+ role = ATK_ROLE_DIALOG;
8111
+ case accessibility::AccessibleRole::FRAME:
8112
+ role = ATK_ROLE_FRAME;
8115
+ // Ignore window objects for sub-menus, which are exposed
8116
+ // as children of their parent menu
8117
+ case accessibility::AccessibleRole::WINDOW:
8119
+ Window *pChild = pWindow->GetChild( 0 );
8122
+ uno::Reference< accessibility::XAccessible > xAccessible( pChild->GetAccessible( true ) );
8123
+ if( xAccessible.is() )
8124
+ role = ATK_ROLE_WINDOW;
8131
+ Window *pChild = pWindow->GetChild( 0 );
8134
+ if( WINDOW_HELPTEXTWINDOW == pChild->GetType() )
8136
+ role = ATK_ROLE_TOOL_TIP;
8137
+ pChild->SetAccessibleRole( accessibility::AccessibleRole::LABEL );
8150
+// FIXME: rename as appropriate
8151
+uno::Reference< accessibility::XAccessible >
8152
+GtkSalFrame::getAccessible( bool bCreate )
8154
+ // Yes - this is a hack - but: this abstraction seems totally useless to me
8155
+ Window *pWindow = static_cast<Window *>(GetInstance());
8157
+ g_return_val_if_fail( pWindow != NULL, NULL );
8159
+ // skip the border window accessible
8160
+ if( pWindow->GetType() == WINDOW_BORDERWINDOW )
8162
+ pWindow = pWindow->GetAccessibleChildWindow( 0 );
8163
+ g_return_val_if_fail( pWindow != NULL, NULL );
8165
+ // replace the top-level role Dialog with something more appropriate ..
8166
+ else if( pWindow->GetAccessibleRole() == accessibility::AccessibleRole::ALERT ||
8167
+ pWindow->GetAccessibleRole() == accessibility::AccessibleRole::DIALOG )
8168
+ pWindow->SetAccessibleRole(accessibility::AccessibleRole::OPTION_PANE);
8170
+ return pWindow->GetAccessible( bCreate );
8173
void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
8175
if( nStyle & SAL_FRAME_STYLE_DEFAULT ) // ensure default style
8176
@@ -590,6 +728,8 @@ void GtkSalFrame::Init( SalFrame* pParen
8179
m_pWindow = GTK_WINDOW( gtk_widget_new( GTK_TYPE_WINDOW, "type", ((nStyle & SAL_FRAME_STYLE_FLOAT) && ! (nStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION)) ? GTK_WINDOW_POPUP : GTK_WINDOW_TOPLEVEL, "visible", FALSE, NULL ) );
8180
+ g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", this );
8182
m_pParent = static_cast<GtkSalFrame*>(pParent);
8183
m_pForeignParent = NULL;
8184
m_aForeignParentWindow = None;
8185
cvs diff: Diffing vcl/unx/inc
8186
cvs diff: Diffing vcl/unx/inc/plugins
8187
cvs diff: Diffing vcl/unx/inc/plugins/gtk
8188
Index: vcl/unx/inc/plugins/gtk/atkbridge.hxx
8189
===================================================================
8190
RCS file: vcl/unx/inc/plugins/gtk/atkbridge.hxx
8191
diff -N vcl/unx/inc/plugins/gtk/atkbridge.hxx
8192
--- /dev/null 1 Jan 1970 00:00:00 -0000
8193
+++ vcl/unx/inc/plugins/gtk/atkbridge.hxx 12 Jan 2006 13:57:32 -0000 1.1.2.3
8195
+/*************************************************************************
8197
+ * OpenOffice.org - a multi-platform office productivity suite
8199
+ * $RCSfile: cws-atkbridge-20060425.diff,v $
8201
+ * $Revision: 1.1.2.1 $
8203
+ * last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
8205
+ * The Contents of this file are made available subject to
8206
+ * the terms of GNU Lesser General Public License Version 2.1.
8209
+ * GNU Lesser General Public License Version 2.1
8210
+ * =============================================
8211
+ * Copyright 2005 by Sun Microsystems, Inc.
8212
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
8214
+ * This library is free software; you can redistribute it and/or
8215
+ * modify it under the terms of the GNU Lesser General Public
8216
+ * License version 2.1, as published by the Free Software Foundation.
8218
+ * This library is distributed in the hope that it will be useful,
8219
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
8220
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8221
+ * Lesser General Public License for more details.
8223
+ * You should have received a copy of the GNU Lesser General Public
8224
+ * License along with this library; if not, write to the Free Software
8225
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
8226
+ * MA 02111-1307 USA
8228
+ ************************************************************************/
8230
+#ifndef __ATK_BRIDGE_HXX__
8231
+#define __ATK_BRIDGE_HXX__
8233
+#ifndef _VCL_DLLAPI_H
8234
+#include <dllapi.h>
8237
+void VCL_DLLPUBLIC InitAtkBridge(void);
8240
Index: vcl/unx/inc/plugins/gtk/gtkframe.hxx
8241
===================================================================
8242
RCS file: /cvs/gsl/vcl/unx/inc/plugins/gtk/gtkframe.hxx,v
8243
retrieving revision 1.21
8244
retrieving revision 1.14.22.11
8245
diff -u -p -r1.21 -r1.14.22.11
8246
--- vcl/unx/inc/plugins/gtk/gtkframe.hxx 19 Jan 2006 18:27:42 -0000 1.21
8247
+++ vcl/unx/inc/plugins/gtk/gtkframe.hxx 16 Feb 2006 11:08:18 -0000 1.14.22.11
8249
#include <gdk/gdkkeysyms.h>
8252
+#include <com/sun/star/uno/Reference.hxx>
8253
+#include <com/sun/star/accessibility/XAccessible.hdl>
8255
#ifndef _SV_SALFRAME_HXX
8256
#include <salframe.hxx>
8258
@@ -355,7 +358,20 @@ public:
8259
virtual bool SetPluginParent( SystemParentData* pNewParent );
8261
virtual void SetBackgroundBitmap( SalBitmap* );
8263
+ static GtkSalFrame *getFromWindow( GtkWindow *pWindow );
8264
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > getAccessible( bool bCreate = true );
8266
+ static AtkRole GetAtkRole( GtkWindow* window );
8270
+#define OOO_TYPE_FIXED ooo_fixed_get_type()
8274
+GType ooo_fixed_get_type( void );
8278
#endif //_VCL_GTKFRAME_HXX
8279
cvs diff: Diffing vcl/unx/inc/plugins/kde
8280
cvs diff: Diffing vcl/unx/kde
8281
cvs diff: Diffing vcl/unx/source
8282
cvs diff: Diffing vcl/unx/source/app
8283
cvs diff: Diffing vcl/unx/source/gdi
8284
cvs diff: Diffing vcl/unx/source/inc
8285
cvs diff: Diffing vcl/unx/source/plugadapt
8286
cvs diff: Diffing vcl/unx/source/src
8287
cvs diff: Diffing vcl/unx/source/window
8288
cvs diff: Diffing vcl/util
8289
Index: vcl/util/makefile.mk
8290
===================================================================
8291
RCS file: /cvs/gsl/vcl/util/makefile.mk,v
8292
retrieving revision 1.78
8293
retrieving revision 1.65.110.12
8294
diff -u -p -r1.78 -r1.65.110.12
8295
--- vcl/util/makefile.mk 7 Apr 2006 15:36:14 -0000 1.78
8296
+++ vcl/util/makefile.mk 13 Apr 2006 10:18:03 -0000 1.65.110.12
8297
@@ -358,8 +358,10 @@ PKGCONFIG_MODULES=gtk+-2.0 gthread-2.0
8298
LIB4TARGET=$(SLB)$/igtk_plug_
8301
+ $(SLB)$/gtka11y.lib \
8305
SHL4TARGET=vclplug_gtk$(UPD)$(DLLPOSTFIX)
8306
SHL4IMPLIB=igtk_plug_
8307
SHL4LIBS=$(LIB4TARGET)
8308
cvs diff: Diffing vcl/util/defs
8309
Index: vcl/util/defs/wntmsci7
8310
===================================================================
8311
RCS file: vcl/util/defs/wntmsci7
8312
diff -N vcl/util/defs/wntmsci7