~ubuntu-branches/ubuntu/karmic/openoffice.org-l10n/karmic

« back to all changes in this revision

Viewing changes to ooo-build/patches/src680/cws-atkbridge-20060425.diff

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2006-04-27 19:29:22 UTC
  • Revision ID: james.westby@ubuntu.com-20060427192922-2dburxv3b63f8v0u
Tags: 2.0.2-2ubuntu5
* Copy of the openoffice.org source.
  - debian/control.in: Change source name.
  - debian/changelog: Change source name.
  - debian/control: Regenerate control file.
* Add kurdish translations exported from Rosetta (2006-04-18).
* Workaround bad message strings in recently included GSI files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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( 
 
17
        {
 
18
                        if (
 
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 ) 
 
23
                           )
 
24
                        {
 
25
                                        return 0;
 
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() )
 
56
                        {
 
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
 
83
                {
 
84
                        case VCLEVENT_WINDOW_ENABLED:
 
85
                        {
 
86
+                aNewValue <<= AccessibleStateType::SENSITIVE;
 
87
+                NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
 
88
                                aNewValue <<= AccessibleStateType::ENABLED;
 
89
                                NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
 
90
                        }
 
91
@@ -123,6 +125,8 @@ namespace svt
 
92
                        {
 
93
                                aOldValue <<= AccessibleStateType::ENABLED;
 
94
                                NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
 
95
+                aOldValue <<= AccessibleStateType::SENSITIVE;
 
96
+                NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
 
97
                        }
 
98
                        break;
 
99
                        case VCLEVENT_WINDOW_GETFOCUS:
 
100
@@ -164,7 +168,10 @@ namespace svt
 
101
                if ( m_pTabBar )
 
102
                {
 
103
                        if ( m_pTabBar->IsEnabled() )
 
104
-                               rStateSet.AddState( AccessibleStateType::ENABLED );
 
105
+            {
 
106
+                rStateSet.AddState( AccessibleStateType::ENABLED );
 
107
+                rStateSet.AddState( AccessibleStateType::SENSITIVE );
 
108
+            }
 
109
 
 
110
                        rStateSet.AddState( AccessibleStateType::FOCUSABLE );
 
111
 
 
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
 
121
        {
 
122
                if ( m_bEnabled != bEnabled )
 
123
                {
 
124
-                       Any aOldValue, aNewValue;
 
125
+            Any aOldValue[2], aNewValue[2];
 
126
                        if ( m_bEnabled )
 
127
-                               aOldValue <<= AccessibleStateType::ENABLED;
 
128
-                       else
 
129
-                               aNewValue <<= AccessibleStateType::ENABLED;
 
130
+            {
 
131
+                aOldValue[0] <<= AccessibleStateType::SENSITIVE;
 
132
+                aOldValue[1] <<= AccessibleStateType::ENABLED;
 
133
+            }
 
134
+            else
 
135
+            {
 
136
+
 
137
+                aNewValue[0] <<= AccessibleStateType::ENABLED;
 
138
+                aNewValue[1] <<= AccessibleStateType::SENSITIVE;
 
139
+            }
 
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] );
 
144
                }
 
145
        }
 
146
 
 
147
@@ -203,7 +211,10 @@ namespace svt
 
148
        void AccessibleTabBarPage::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet )
 
149
        {
 
150
                if ( IsEnabled() )
 
151
+        {
 
152
                        rStateSet.AddState( AccessibleStateType::ENABLED );
 
153
+            rStateSet.AddState( AccessibleStateType::SENSITIVE );
 
154
+        }
 
155
 
 
156
                rStateSet.AddState( AccessibleStateType::VISIBLE );
 
157
 
 
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
 
167
 
 
168
                switch ( rVclWindowEvent.GetId() )
 
169
                {
 
170
-                       case VCLEVENT_WINDOW_ENABLED:
 
171
+            case VCLEVENT_WINDOW_ENABLED:
 
172
                        {
 
173
-                               Any aOldValue, aNewValue;
 
174
-                               aNewValue <<= AccessibleStateType::ENABLED;
 
175
-                               NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );                                
 
176
-                       }
 
177
-                       break;
 
178
-                       case VCLEVENT_WINDOW_DISABLED:
 
179
-                       {
 
180
-                               Any aOldValue, aNewValue;
 
181
-                               aOldValue <<= AccessibleStateType::ENABLED;
 
182
-                               NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
 
183
-                       }
 
184
+                aNewValue <<= AccessibleStateType::SENSITIVE;
 
185
+                NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
 
186
+                aNewValue <<= AccessibleStateType::ENABLED;
 
187
+                NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
 
188
+            }
 
189
+            break;
 
190
+            case VCLEVENT_WINDOW_DISABLED:
 
191
+            {
 
192
+                aOldValue <<= AccessibleStateType::ENABLED;
 
193
+                NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
 
194
+                aOldValue <<= AccessibleStateType::SENSITIVE;
 
195
+                NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
 
196
+            }
 
197
                        break;
 
198
                        case VCLEVENT_WINDOW_SHOW:
 
199
                        {
 
200
@@ -395,7 +397,10 @@ namespace svt
 
201
                if ( m_pTabBar )
 
202
                {
 
203
                        if ( m_pTabBar->IsEnabled() )
 
204
-                               rStateSet.AddState( AccessibleStateType::ENABLED );
 
205
+            {
 
206
+                rStateSet.AddState( AccessibleStateType::ENABLED );
 
207
+                rStateSet.AddState( AccessibleStateType::SENSITIVE );
 
208
+            }
 
209
 
 
210
                        rStateSet.AddState( AccessibleStateType::VISIBLE );
 
211
 
 
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
 
221
        {
 
222
        if ( isAlive() )
 
223
                {
 
224
-                       switch ( rVclWindowEvent.GetId() )
 
225
-                       {
 
226
+            ULONG nEventId = rVclWindowEvent.GetId();
 
227
+            switch ( nEventId )
 
228
+            {
 
229
                                case  VCLEVENT_OBJECT_DYING :
 
230
                                {
 
231
                                        m_pTabListBox->RemoveEventListener( LINK( this, AccessibleTabListBoxTable, WindowEventListener ) );
 
232
@@ -115,7 +116,19 @@ namespace svt
 
233
                                        break;
 
234
                                }
 
235
 
 
236
-                               case VCLEVENT_LISTBOX_SELECT :
 
237
+                case VCLEVENT_CONTROL_GETFOCUS :
 
238
+                case VCLEVENT_CONTROL_LOSEFOCUS :
 
239
+                {
 
240
+                    uno::Any aOldValue, aNewValue;
 
241
+                    if ( VCLEVENT_CONTROL_GETFOCUS == nEventId )
 
242
+                        aNewValue <<= AccessibleStateType::FOCUSED;
 
243
+                    else
 
244
+                        aOldValue <<= AccessibleStateType::FOCUSED;
 
245
+                    commitEvent( AccessibleEventId::STATE_CHANGED, aNewValue, aOldValue );
 
246
+                    break;
 
247
+                }
 
248
+
 
249
+                case VCLEVENT_LISTBOX_SELECT :
 
250
                                {
 
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 );
 
265
                        if ( IsEnabled() )
 
266
+            {
 
267
                                rStateSet.AddState( AccessibleStateType::ENABLED );
 
268
+                rStateSet.AddState( AccessibleStateType::SENSITIVE );
 
269
+            }
 
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
 
286
                        if ( IsActive() )
 
287
                                _rStateSet.AddState( AccessibleStateType::ACTIVE );
 
288
                        if ( IsEnabled() )
 
289
+            {
 
290
                                _rStateSet.AddState( AccessibleStateType::ENABLED );
 
291
+                _rStateSet.AddState( AccessibleStateType::SENSITIVE );
 
292
+            }
 
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
 
306
 
 
307
     // Set some states.
 
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
 
314
     if( mpParent )
 
315
     {
 
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
 
385
 {
 
386
        if ( m_bEnabled != bEnabled )
 
387
        {
 
388
-               Any aOldValue, aNewValue;
 
389
+               Any aOldValue[2], aNewValue[2];
 
390
                if ( m_bEnabled )
 
391
-                       aOldValue <<= AccessibleStateType::ENABLED;
 
392
+        {
 
393
+            aOldValue[0] <<= AccessibleStateType::SENSITIVE;
 
394
+            aOldValue[1] <<= AccessibleStateType::ENABLED;
 
395
+        }
 
396
                else
 
397
-                       aNewValue <<= AccessibleStateType::ENABLED;
 
398
+        {
 
399
+            aNewValue[0] <<= AccessibleStateType::ENABLED;
 
400
+            aNewValue[1] <<= AccessibleStateType::SENSITIVE;
 
401
+        }
 
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] );
 
406
        }
 
407
 }
 
408
 
 
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 )
 
419
 {
 
420
        if ( IsEnabled() )
 
421
+    {
 
422
                rStateSet.AddState( AccessibleStateType::ENABLED );
 
423
+        rStateSet.AddState( AccessibleStateType::SENSITIVE );
 
424
+    }
 
425
 
 
426
        rStateSet.AddState( AccessibleStateType::FOCUSABLE );
 
427
 
 
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 )
 
438
 {
 
439
        if ( IsEnabled() )
 
440
+    {
 
441
                rStateSet.AddState( AccessibleStateType::ENABLED );
 
442
+        rStateSet.AddState( AccessibleStateType::SENSITIVE );
 
443
+    }
 
444
 
 
445
        rStateSet.AddState( AccessibleStateType::VISIBLE );
 
446
 
 
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
 
456
                {
 
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 );
 
461
                }
 
462
                break;
 
463
                case VCLEVENT_WINDOW_DISABLED:
 
464
                {
 
465
-                       aOldValue <<= accessibility::AccessibleStateType::ENABLED;
 
466
+            aOldValue <<= accessibility::AccessibleStateType::SENSITIVE;
 
467
                        NotifyAccessibleEvent( accessibility::AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
 
468
+
 
469
+            aOldValue <<= accessibility::AccessibleStateType::ENABLED;
 
470
+            NotifyAccessibleEvent( accessibility::AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
 
471
                }
 
472
                break;
 
473
                case VCLEVENT_WINDOW_MOVE:
 
474
@@ -510,7 +515,10 @@ void VCLXAccessibleComponent::FillAccess
 
475
                }
 
476
 
 
477
                if ( pWindow->IsEnabled() )
 
478
+        {
 
479
                        rStateSet.AddState( accessibility::AccessibleStateType::ENABLED );
 
480
+            rStateSet.AddState( accessibility::AccessibleStateType::SENSITIVE );
 
481
+        }
 
482
 
 
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 );
 
498
         if ( m_bSelected )
 
499
                        pStateSetHelper->AddState( AccessibleStateType::SELECTED );
 
500
                if ( m_bVisible )
 
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
 
510
 {
 
511
        sal_Bool bHighlighted = sal_False;
 
512
 
 
513
-       if ( m_pParent )
 
514
-       {
 
515
-               sal_uInt16 nItemId = m_pParent->GetItemId( m_nItemPos );
 
516
-               if ( nItemId == m_pParent->GetCurItemId() )
 
517
-                       bHighlighted = sal_True;
 
518
-       }
 
519
+    if ( m_pParent && m_pParent->IsHighlighted( m_nItemPos ) )
 
520
+        bHighlighted = sal_True;
 
521
 
 
522
        return bHighlighted;
 
523
 }
 
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 )
 
534
 {
 
535
        rStateSet.AddState( AccessibleStateType::ENABLED );
 
536
+    rStateSet.AddState( AccessibleStateType::SENSITIVE );
 
537
 
 
538
        rStateSet.AddState( AccessibleStateType::VISIBLE );
 
539
 
 
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 )
 
550
 {
 
551
        rStateSet.AddState( AccessibleStateType::ENABLED );
 
552
+    rStateSet.AddState( AccessibleStateType::SENSITIVE );
 
553
 
 
554
        rStateSet.AddState( AccessibleStateType::FOCUSABLE );
 
555
 
 
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
 
565
 {
 
566
        if ( m_pToolBox )
 
567
        {
 
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;
 
573
+        {
 
574
+            aNewValue[0] <<= AccessibleStateType::SENSITIVE;
 
575
+            aNewValue[1] <<= AccessibleStateType::ENABLED;
 
576
+        }
 
577
                else
 
578
-                       aOldValue <<= AccessibleStateType::ENABLED;
 
579
-               NotifyAccessibleEvent( AccessibleEventId::NAME_CHANGED, aOldValue, aNewValue );
 
580
+        {
 
581
+            aOldValue[0] <<= AccessibleStateType::ENABLED;
 
582
+            aOldValue[1] <<= AccessibleStateType::SENSITIVE;
 
583
+        }
 
584
+
 
585
+        NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue[0], aNewValue[0] );
 
586
+        NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue[1], aNewValue[1] );
 
587
        }
 
588
 }
 
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 ) )
 
594
+        {
 
595
                pStateSetHelper->AddState( AccessibleStateType::ENABLED );
 
596
+            pStateSetHelper->AddState( AccessibleStateType::SENSITIVE );
 
597
+        }
 
598
                if ( m_pToolBox->IsItemVisible( m_nItemId ) )
 
599
                {
 
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
 
609
@@ -88,6 +88,9 @@
 
610
 #ifndef _TOOLKIT_AWT_VCLXACCESSIBLETABPAGEWINDOW_HXX_
 
611
 #include <toolkit/awt/vclxaccessibletabpagewindow.hxx>
 
612
 #endif
 
613
+#ifndef _TOOLKIT_AWT_VCLXACCESSIBLEFIXEDTEXT_HXX_
 
614
+#include <toolkit/awt/vclxaccessiblefixedtext.hxx>
 
615
+#endif
 
616
 #ifndef _TOOLKIT_HELPER_MACROS_HXX_
 
617
 #include <toolkit/helper/macros.hxx>
 
618
 #endif
 
619
@@ -133,12 +136,15 @@
 
620
 #include <toolkit/helper/solarrelease.hxx>
 
621
 #endif
 
622
 
 
623
+using namespace ::com::sun::star;
 
624
+
 
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;
 
630
 
 
631
+
 
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
 
636
     }
 
637
 }
 
638
 
 
639
-::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > VCLXWindow::CreateAccessibleContext()
 
640
+uno::Reference< accessibility::XAccessibleContext > VCLXWindow::CreateAccessibleContext()
 
641
 {
 
642
-       ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > xContext;
 
643
+    uno::Reference< accessibility::XAccessibleContext > xContext;
 
644
 
 
645
-       Window* pWindow = GetWindow();
 
646
-       if ( pWindow )
 
647
-       {
 
648
-               WindowType nType = pWindow->GetType();
 
649
+    Window* pWindow = GetWindow();
 
650
+    if ( pWindow )
 
651
+    {
 
652
+        WindowType nType = pWindow->GetType();
 
653
 
 
654
-               if ( nType == WINDOW_MENUBARWINDOW || pWindow->IsMenuFloatingWindow() || pWindow->IsToolbarFloatingWindow() )
 
655
-               {
 
656
-                       ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc( pWindow->GetAccessible() );
 
657
-                       if ( xAcc.is() )
 
658
-                       {
 
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 ) )
 
662
-                               {
 
663
-                                       xContext = xCont;
 
664
-                               }
 
665
-                       }
 
666
-               }
 
667
-               else if ( nType == WINDOW_STATUSBAR )
 
668
-               {
 
669
-                       xContext = (::com::sun::star::accessibility::XAccessibleContext*) new VCLXAccessibleStatusBar( this );
 
670
-               }
 
671
-               else if ( nType == WINDOW_TABCONTROL )
 
672
-               {
 
673
-                       xContext = (::com::sun::star::accessibility::XAccessibleContext*) new VCLXAccessibleTabControl( this );
 
674
-               }
 
675
+        if ( nType == WINDOW_MENUBARWINDOW || pWindow->IsMenuFloatingWindow() || pWindow->IsToolbarFloatingWindow() )
 
676
+        {
 
677
+            uno::Reference< accessibility::XAccessible > xAcc( pWindow->GetAccessible() );
 
678
+            if ( xAcc.is() )
 
679
+            {
 
680
+                uno::Reference< accessibility::XAccessibleContext > xCont( xAcc->getAccessibleContext() );
 
681
+                if ( pWindow->GetType() == WINDOW_MENUBARWINDOW ||
 
682
+                     ( xCont.is() && xCont->getAccessibleRole() == accessibility::AccessibleRole::POPUP_MENU ) )
 
683
+                {
 
684
+                    xContext = xCont;
 
685
+                }
 
686
+            }
 
687
+        }
 
688
+        else if ( nType == WINDOW_STATUSBAR )
 
689
+        {
 
690
+            xContext = (accessibility::XAccessibleContext*) new VCLXAccessibleStatusBar( this );
 
691
+        }
 
692
+        else if ( nType == WINDOW_TABCONTROL )
 
693
+        {
 
694
+            xContext = (accessibility::XAccessibleContext*) new VCLXAccessibleTabControl( this );
 
695
+        }
 
696
         else if ( nType == WINDOW_TABPAGE && pWindow->GetAccessibleParentWindow() && pWindow->GetAccessibleParentWindow()->GetType() == WINDOW_TABCONTROL )
 
697
         {
 
698
-                       xContext = (::com::sun::star::accessibility::XAccessibleContext*) new VCLXAccessibleTabPageWindow( this );
 
699
+            xContext = (accessibility::XAccessibleContext*) new VCLXAccessibleTabPageWindow( this );
 
700
         }
 
701
-               else
 
702
-               {
 
703
-                       xContext = (::com::sun::star::accessibility::XAccessibleContext*) new VCLXAccessibleComponent( this );
 
704
-               }
 
705
-       }
 
706
+        else if ( nType == WINDOW_HELPTEXTWINDOW )
 
707
+        {
 
708
+            xContext = (accessibility::XAccessibleContext*) new VCLXAccessibleFixedText( this );  
 
709
+        }
 
710
+        else
 
711
+        {
 
712
+            xContext = (accessibility::XAccessibleContext*) new VCLXAccessibleComponent( this );
 
713
+        }
 
714
+    }
 
715
 
 
716
-       return xContext;
 
717
+    return xContext;
 
718
 }
 
719
 
 
720
 /*
 
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);
 
739
-    pWindow->Show();
 
740
+    pWindow->Hide();
 
741
 
 
742
 
 
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"); 
 
747
 
 
748
+    mpView = mpSlideSorterView.get();
 
749
+
 
750
     mpSlideSorterController 
 
751
         = ::std::auto_ptr<controller::SlideSorterController>(
 
752
             CreateController());
 
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)
 
791
     {
 
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 );
 
826
         }
 
827
         catch( const uno::Exception& ) {}
 
828
     }
 
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++]);
 
839
         }
 
840
         if(mpFrameSel->IsEnabled())
 
841
+        {
 
842
             pStateSetHelper->AddState(AccessibleStateType::ENABLED);
 
843
+            pStateSetHelper->AddState(AccessibleStateType::SENSITIVE);
 
844
+        }
 
845
 
 
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 );
 
861
         }
 
862
         catch( const uno::Exception& ) {}
 
863
     }
 
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
 
873
 
 
874
 void ChildrenManagerImpl::ClearAccessibleShapeList (void)
 
875
 {
 
876
+    // Copy the list of (visible) shapes to local lists and clear the
 
877
+    // originals.
 
878
+    ChildDescriptorListType aLocalVisibleChildren;
 
879
+    aLocalVisibleChildren.swap(maVisibleChildren);
 
880
+    AccessibleShapeList aLocalAccessibleShapes;
 
881
+    aLocalAccessibleShapes.swap(maAccessibleShapes);
 
882
+
 
883
+    // Tell the listeners that all children are gone.
 
884
+    mrContext.CommitChange (
 
885
+        AccessibleEventId::INVALIDATE_ALL_CHILDREN,
 
886
+        uno::Any(),
 
887
+        uno::Any());
 
888
+
 
889
+    // There are no accessible shapes left so the index assigned to new
 
890
+    // accessible shapes can be reset.
 
891
+    mnNewNameIndex = 1;
 
892
+    
 
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.
 
895
+    
 
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);
 
904
-
 
905
-    maVisibleChildren.clear ();
 
906
-
 
907
+        {
 
908
+            ::comphelper::disposeComponent(I->mxAccessibleShape);
 
909
+            I->mxAccessibleShape = NULL;
 
910
+        }            
 
911
 
 
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)
 
917
         if (J->is())
 
918
         {
 
919
-            mrContext.CommitChange (
 
920
-                AccessibleEventId::CHILD, 
 
921
-                uno::Any(),
 
922
-                uno::makeAny (*J));
 
923
-
 
924
             // Dispose the object.
 
925
                        ::comphelper::disposeComponent(*J);
 
926
+            *J = NULL;
 
927
         }
 
928
-    maAccessibleShapes.clear ();
 
929
-
 
930
-    // Now that no accessible shapes remain we can reset the index assigned
 
931
-    // to new accessible shapes.
 
932
-    mnNewNameIndex = 1;
 
933
 }
 
934
 
 
935
 
 
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
 
945
        else
 
946
        {
 
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() )
 
964
+        {
 
965
                        pStateSet->AddState( AccessibleStateType::ENABLED );
 
966
+            pStateSet->AddState( AccessibleStateType::SENSITIVE );
 
967
+        }
 
968
                if ( mpParent->IsReallyVisible() )
 
969
                        pStateSet->AddState( AccessibleStateType::VISIBLE );
 
970
     }
 
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 );
 
976
+        {
 
977
+            pStateSet->AddState( AccessibleStateType::ENABLED );
 
978
+            pStateSet->AddState( AccessibleStateType::SENSITIVE );
 
979
+        }
 
980
                if ( m_pParent->getCharSetControl()->IsReallyVisible() )
 
981
                        pStateSet->AddState( AccessibleStateType::VISIBLE );
 
982
 
 
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
 
992
        if( IsAlive() )
 
993
        {
 
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
 
1000
                }
 
1001
 
 
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
 
1058
        {
 
1059
                Reference< XAccessible > xValue;
 
1060
 
 
1061
+               if( !_rxKey.is() )
 
1062
+               {
 
1063
+                       // fprintf( stderr, "It was this path that was crashing stuff\n" );
 
1064
+                       return xValue;
 
1065
+               }
 
1066
+
 
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:
 
1083
 
 
1084
        void                            SetAccessibleDescription( USHORT nItemId, const XubString& rStr );
 
1085
        XubString                       GetAccessibleDescription( USHORT nItemId ) const;
 
1086
+    
 
1087
+    // returns whether the item a position nItemPos is highlighted or not.
 
1088
+    bool  IsHighlighted( USHORT nItemPos ) const;
 
1089
 };
 
1090
 
 
1091
 // -----------
 
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 );
 
1107
     
 
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
 
1149
 
 
1150
 // -----------------------------------------------------------------------
 
1151
 
 
1152
-void Application::ImplCallEventListeners( VclWindowEvent* pEvent )
 
1153
+void Application::ImplCallEventListeners( VclSimpleEvent* pEvent )
 
1154
 {
 
1155
     ImplSVData* pSVData = ImplGetSVData();
 
1156
 
 
1157
@@ -1235,7 +1235,7 @@ long    Application::GetTopWindowCount()
 
1158
 {
 
1159
     long nRet = 0;
 
1160
     ImplSVData* pSVData = ImplGetSVData();
 
1161
-    Window *pWin = pSVData->maWinData.mpFirstFrame;
 
1162
+    Window *pWin = pSVData ? pSVData->maWinData.mpFirstFrame : NULL;
 
1163
     while( pWin )
 
1164
     {
 
1165
         if( pWin->ImplGetWindow()->IsTopWindow() )
 
1166
@@ -1251,7 +1251,7 @@ Window* Application::GetTopWindow( long 
 
1167
 {
 
1168
     long nIdx = 0;
 
1169
     ImplSVData* pSVData = ImplGetSVData();
 
1170
-    Window *pWin = pSVData->maWinData.mpFirstFrame;
 
1171
+    Window *pWin = pSVData ? pSVData->maWinData.mpFirstFrame : NULL;
 
1172
     while( pWin )
 
1173
     {
 
1174
         if( pWin->ImplGetWindow()->IsTopWindow() )
 
1175
@@ -1876,10 +1876,12 @@ BOOL Application::IsAccessibilityEnabled
 
1176
 
 
1177
 BOOL InitAccessBridge( BOOL bShowCancel, BOOL &rCancelled )
 
1178
 {
 
1179
-    BOOL bRet = ImplInitAccessBridge( bShowCancel, rCancelled );
 
1180
+    BOOL bRet = true;
 
1181
 
 
1182
-// There is no GUI to re-enable accessibility on Unix ..
 
1183
+// Disable Java bridge on UNIX
 
1184
 #ifndef UNX
 
1185
+    bRet = ImplInitAccessBridge( bShowCancel, rCancelled );
 
1186
+    
 
1187
     if( !bRet && bShowCancel && !rCancelled )
 
1188
     {
 
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 );
 
1193
     }
 
1194
-#endif
 
1195
+#endif // !UNX
 
1196
 
 
1197
     return bRet;
 
1198
 }
 
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; }
 
1217
 
 
1218
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
 
1219
-    BOOL            IsTopmostApplicationMenu();
 
1220
 };
 
1221
 
 
1222
 // To get the transparent mouse-over look, the closer is actually a toolbox
 
1223
@@ -1109,6 +1108,13 @@ void Menu::ImplCallEventListeners( ULONG
 
1224
 {
 
1225
     VclMenuEvent aEvent( this, nEvent, nPos );
 
1226
 
 
1227
+    // This is needed by atk accessibility bridge
 
1228
+    if ( nEvent == VCLEVENT_MENU_HIGHLIGHT )
 
1229
+    {
 
1230
+        ImplSVData* pSVData = ImplGetSVData();
 
1231
+        pSVData->mpApp->ImplCallEventListeners( &aEvent );
 
1232
+    }
 
1233
+    
 
1234
     if ( !maEventListeners.empty() )
 
1235
         maEventListeners.Call( &aEvent );
 
1236
 
 
1237
@@ -2881,7 +2887,20 @@ BOOL Menu::GetSystemMenuData( SystemMenu
 
1238
         return FALSE;
 
1239
 }
 
1240
 
 
1241
-
 
1242
+bool Menu::IsHighlighted( USHORT nItemPos ) const
 
1243
+{
 
1244
+    bool bRet = false;
 
1245
+    
 
1246
+    if( pWindow )
 
1247
+    {
 
1248
+        if( bIsMenuBar )
 
1249
+            bRet = ( nItemPos == static_cast< MenuBarWindow * > (pWindow)->GetHighlightedItem() );
 
1250
+        else
 
1251
+            bRet = ( nItemPos == static_cast< MenuFloatingWindow * > (pWindow)->GetHighlightedItem() );
 
1252
+    }
 
1253
+    
 
1254
+    return bRet;
 
1255
+}
 
1256
 
 
1257
 // -----------
 
1258
 // - MenuBar -
 
1259
@@ -4403,9 +4422,11 @@ void MenuFloatingWindow::KeyInput( const
 
1260
             else
 
1261
             {
 
1262
                                StopExecute();
 
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);
 
1269
             }
 
1270
                }
 
1271
                break;
 
1272
@@ -4619,18 +4640,12 @@ void MenuFloatingWindow::Command( const 
 
1273
 {
 
1274
        ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc;
 
1275
 
 
1276
-       if ( pMenu )
 
1277
+       if ( pMenu && !pMenu->pStartedFrom )
 
1278
                xAcc = pMenu->GetAccessible();
 
1279
 
 
1280
        return xAcc;
 
1281
 }
 
1282
 
 
1283
-
 
1284
-BOOL MenuFloatingWindow::IsTopmostApplicationMenu()
 
1285
-{
 
1286
-    return (!pMenu->pStartedFrom) ? TRUE : FALSE;
 
1287
-}
 
1288
-
 
1289
 MenuBarWindow::MenuBarWindow( Window* pParent ) :
 
1290
     Window( pParent, 0 ),
 
1291
     aCloser( this ),
 
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
 
1303
@@ -0,0 +1,49 @@
 
1304
+cws 'atkbridge'
 
1305
+#Issue number: i#47890#
 
1306
+Submitted by: mmeeks
 
1307
+
 
1308
+Hacked up prototype of atk bridge
 
1309
+
 
1310
+
 
1311
+Serious problems
 
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 ]
 
1322
+
 
1323
+
 
1324
+Test:
 
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 ...
 
1328
+       + AtkSelection
 
1329
+       + AtkHyper*
 
1330
+
 
1331
+* At-poke
 
1332
+       + implement non-gui mode - for to-console event logging
 
1333
+       + 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 (?)
 
1339
+
 
1340
+
 
1341
+Known bugs:
 
1342
+       + AtkText
 
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.)
 
1349
+       + AtkEditableText
 
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
 
1359
@@ -0,0 +1,283 @@
 
1360
+/*************************************************************************
 
1361
+ *
 
1362
+ *  OpenOffice.org - a multi-platform office productivity suite
 
1363
+ *
 
1364
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
1365
+ *
 
1366
+ *  $Revision: 1.1.2.1 $
 
1367
+ *
 
1368
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
1369
+ *
 
1370
+ *  The Contents of this file are made available subject to
 
1371
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
1372
+ *
 
1373
+ *
 
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
 
1378
+ *
 
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.
 
1382
+ *
 
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.
 
1387
+ *
 
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
 
1392
+ *
 
1393
+ ************************************************************************/
 
1394
+
 
1395
+#include "atkwrapper.hxx"
 
1396
+
 
1397
+#include <com/sun/star/accessibility/XAccessibleAction.hpp>
 
1398
+#include <com/sun/star/accessibility/XAccessibleKeyBinding.hpp>
 
1399
+
 
1400
+#include <com/sun/star/awt/Key.hpp>
 
1401
+#include <com/sun/star/awt/KeyModifier.hpp>
 
1402
+
 
1403
+#include <rtl/strbuf.hxx>
 
1404
+#include <algorithm>
 
1405
+#include <map>
 
1406
+
 
1407
+#include <stdio.h>
 
1408
+
 
1409
+using namespace ::com::sun::star;
 
1410
+
 
1411
+// FIXME
 
1412
+static G_CONST_RETURN gchar *
 
1413
+getAsConst( const rtl::OString& rString )
 
1414
+{
 
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 ];
 
1421
+}
 
1422
+
 
1423
+static accessibility::XAccessibleAction*
 
1424
+        getAction( AtkAction *action ) throw (uno::RuntimeException)
 
1425
+{
 
1426
+    AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( action );
 
1427
+    
 
1428
+    if( pWrap )
 
1429
+    {
 
1430
+        if( !pWrap->mpAction && pWrap->mpContext )
 
1431
+        {
 
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();
 
1435
+        }
 
1436
+
 
1437
+        return pWrap->mpAction;
 
1438
+    }
 
1439
+
 
1440
+    return NULL;
 
1441
+}
 
1442
+
 
1443
+extern "C" {
 
1444
+
 
1445
+static gboolean
 
1446
+action_wrapper_do_action (AtkAction *action,
 
1447
+                          gint       i)
 
1448
+{
 
1449
+    try {
 
1450
+        accessibility::XAccessibleAction* pAction = getAction( action );
 
1451
+        if( pAction )
 
1452
+            return pAction->doAccessibleAction( i );
 
1453
+    }
 
1454
+    catch(const uno::Exception& e) {
 
1455
+        g_warning( "Exception in doAccessibleAction()" );
 
1456
+    }
 
1457
+
 
1458
+    return FALSE;
 
1459
+}
 
1460
+
 
1461
+static gint
 
1462
+action_wrapper_get_n_actions (AtkAction *action)
 
1463
+{
 
1464
+    try {
 
1465
+        accessibility::XAccessibleAction* pAction = getAction( action );
 
1466
+        if( pAction )
 
1467
+            return pAction->getAccessibleActionCount();
 
1468
+    }
 
1469
+    catch(const uno::Exception& e) {
 
1470
+        g_warning( "Exception in getAccessibleActionCount()" );
 
1471
+    }
 
1472
+
 
1473
+    return 0;
 
1474
+}
 
1475
+
 
1476
+static G_CONST_RETURN gchar *
 
1477
+action_wrapper_get_description (AtkAction *, gint)
 
1478
+{
 
1479
+    // GAIL implement this only for cells
 
1480
+    g_warning( "Not implemented: get_description()" );
 
1481
+    return "";
 
1482
+}
 
1483
+
 
1484
+static G_CONST_RETURN gchar *
 
1485
+action_wrapper_get_localized_name (AtkAction *, gint)
 
1486
+{
 
1487
+    // GAIL doesn't implement this as well
 
1488
+    g_warning( "Not implemented: get_localized_name()" );
 
1489
+    return "";
 
1490
+}
 
1491
+
 
1492
+#define ACTION_NAME_PAIR( OOoName, AtkName ) \
 
1493
+    std::pair< const rtl::OUString, const gchar * > ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OOoName ) ), AtkName )
 
1494
+
 
1495
+static G_CONST_RETURN gchar *
 
1496
+action_wrapper_get_name (AtkAction *action,
 
1497
+                         gint       i)
 
1498
+{
 
1499
+    static std::map< rtl::OUString, const gchar * > aNameMap;
 
1500
+    
 
1501
+    if( aNameMap.empty() )
 
1502
+    {
 
1503
+        aNameMap.insert( ACTION_NAME_PAIR( "click", "click" ) );
 
1504
+        aNameMap.insert( ACTION_NAME_PAIR( "select", "click" ) );
 
1505
+        aNameMap.insert( ACTION_NAME_PAIR( "togglePopup", "push" ) );
 
1506
+    }
 
1507
+
 
1508
+    try {
 
1509
+        accessibility::XAccessibleAction* pAction = getAction( action );
 
1510
+        if( pAction )
 
1511
+        {
 
1512
+            std::map< rtl::OUString, const gchar * >::iterator iter;
 
1513
+            
 
1514
+            rtl::OUString aDesc( pAction->getAccessibleActionDescription( i ) );
 
1515
+            
 
1516
+            iter = aNameMap.find( aDesc );
 
1517
+            if( iter != aNameMap.end() )
 
1518
+                return iter->second;
 
1519
+            
 
1520
+            std::pair< const rtl::OUString, const gchar * > aNewVal( aDesc, 
 
1521
+                g_strdup( OUStringToConstGChar(aDesc) ) );
 
1522
+            
 
1523
+            if( aNameMap.insert( aNewVal ).second );
 
1524
+                return aNewVal.second;
 
1525
+        }
 
1526
+    }
 
1527
+    catch(const uno::Exception& e) {
 
1528
+        g_warning( "Exception in getAccessibleActionDescription()" );
 
1529
+    }
 
1530
+
 
1531
+    return "";
 
1532
+}
 
1533
+
 
1534
+/* 
 
1535
+*  GNOME Expects a string in the format:
 
1536
+*  
 
1537
+*  <nmemonic>;<full-path>;<accelerator>
 
1538
+*  
 
1539
+*  The keybindings in <full-path> should be separated by ":"
 
1540
+*/
 
1541
+
 
1542
+static inline void
 
1543
+appendKeyStrokes(rtl::OStringBuffer& rBuffer, const uno::Sequence< awt::KeyStroke >& rKeyStrokes)
 
1544
+{
 
1545
+    for( sal_Int32 i = 0; i < rKeyStrokes.getLength(); i++ )
 
1546
+    {
 
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>");
 
1553
+        
 
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 ) ) );
 
1556
+        else
 
1557
+        {
 
1558
+            sal_Char c = '\0';
 
1559
+            
 
1560
+            switch( rKeyStrokes[i].KeyCode )
 
1561
+            {
 
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;
 
1573
+                case 0:
 
1574
+                    break;
 
1575
+                default:
 
1576
+                    g_warning( "Unmapped KeyCode: %d", rKeyStrokes[i].KeyCode );
 
1577
+                    break;
 
1578
+            }
 
1579
+            
 
1580
+            if( c != '\0' )
 
1581
+                rBuffer.append( c );
 
1582
+        }
 
1583
+    }
 
1584
+}
 
1585
+
 
1586
+
 
1587
+static G_CONST_RETURN gchar *
 
1588
+action_wrapper_get_keybinding (AtkAction *action,
 
1589
+                               gint       i)
 
1590
+{
 
1591
+    try {
 
1592
+        accessibility::XAccessibleAction* pAction = getAction( action );
 
1593
+        if( pAction )
 
1594
+        {
 
1595
+            uno::Reference< accessibility::XAccessibleKeyBinding > xBinding( pAction->getAccessibleActionKeyBinding( i ));
 
1596
+            
 
1597
+            if( xBinding.is() )
 
1598
+            {
 
1599
+                rtl::OStringBuffer aRet;
 
1600
+                
 
1601
+                sal_Int32 nmax = std::min( xBinding->getAccessibleKeyBindingCount(), (sal_Int32) 3 );
 
1602
+                for( sal_Int32 n = 0; n < nmax; n++ )
 
1603
+                {
 
1604
+                    appendKeyStrokes( aRet,  xBinding->getAccessibleKeyBinding( n ) );
 
1605
+                    
 
1606
+                    if( n < 2 )
 
1607
+                        aRet.append( (sal_Char) ';' );
 
1608
+                }
 
1609
+                
 
1610
+                // !! FIXME !! remember keystroke in wrapper object ?
 
1611
+                return getAsConst( aRet.makeStringAndClear() );
 
1612
+            }
 
1613
+        }
 
1614
+    }
 
1615
+    catch(const uno::Exception& e) {
 
1616
+        g_warning( "Exception in get_keybinding()" );
 
1617
+    }
 
1618
+
 
1619
+    return "";
 
1620
+}
 
1621
+
 
1622
+static gboolean
 
1623
+action_wrapper_set_description (AtkAction *, gint, const gchar *)
 
1624
+{
 
1625
+    return FALSE;
 
1626
+}
 
1627
+
 
1628
+} // extern "C"
 
1629
+
 
1630
+void
 
1631
+actionIfaceInit (AtkActionIface *iface)
 
1632
+{
 
1633
+  g_return_if_fail (iface != NULL);
 
1634
+
 
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;
 
1642
+}
 
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
 
1649
@@ -0,0 +1,115 @@
 
1650
+/*************************************************************************
 
1651
+ *
 
1652
+ *  OpenOffice.org - a multi-platform office productivity suite
 
1653
+ *
 
1654
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
1655
+ *
 
1656
+ *  $Revision: 1.1.2.1 $
 
1657
+ *
 
1658
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
1659
+ *
 
1660
+ *  The Contents of this file are made available subject to
 
1661
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
1662
+ *
 
1663
+ *
 
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
 
1668
+ *
 
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.
 
1672
+ *
 
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.
 
1677
+ *
 
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
 
1682
+ *
 
1683
+ ************************************************************************/
 
1684
+
 
1685
+#include <plugins/gtk/atkbridge.hxx>
 
1686
+#include <plugins/gtk/gtkframe.hxx>
 
1687
+
 
1688
+#include "atkfactory.hxx"
 
1689
+#include "atkutil.hxx"
 
1690
+#include "atkwindow.hxx"
 
1691
+
 
1692
+#include <stdio.h>
 
1693
+
 
1694
+#if ! ( defined AIX || defined HPUX ) // these have no dl* functions
 
1695
+#include <dlfcn.h>
 
1696
+#endif
 
1697
+
 
1698
+void InitAtkBridge(void)
 
1699
+{
 
1700
+    unsigned int major, minor, micro;
 
1701
+    
 
1702
+    /* check gail minimum version requirements */
 
1703
+    if( sscanf( atk_get_toolkit_version(), "%u.%u.%u", &major, &minor, &micro) < 3 )
 
1704
+    {
 
1705
+        g_warning( "unable to parse gail version number" );
 
1706
+        return;
 
1707
+    }
 
1708
+    
 
1709
+    if( ( (major << 16) | (minor << 8) | micro ) < ( (1 << 16) | 8 << 8 | 6 ) )
 
1710
+    {
 
1711
+        g_warning( "libgail >= 1.8.6 required for accessibility support" );
 
1712
+        return;
 
1713
+    }
 
1714
+
 
1715
+    /* get at-spi version by checking the libspi.so version number  */
 
1716
+#if ! ( defined AIX || defined HPUX ) // these have no dl* functions
 
1717
+    
 
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 );
 
1721
+    
 
1722
+    Dl_info dl_info;
 
1723
+    int ret = dladdr( sym, &dl_info );
 
1724
+    g_return_if_fail( ret != 0 );
 
1725
+
 
1726
+    char path[PATH_MAX];
 
1727
+    if( NULL == realpath(dl_info.dli_fname, path) )
 
1728
+    {
 
1729
+        perror( "unable to resolve libspi.so.0" );
 
1730
+        return;
 
1731
+    }
 
1732
+    
 
1733
+    const char * cp = strrchr(path, '/');
 
1734
+    if( cp != NULL )
 
1735
+        ++cp;
 
1736
+    else
 
1737
+        cp = dl_info.dli_fname;
 
1738
+    
 
1739
+    if( sscanf( cp, "libspi.so.%u.%u.%u", &major, &minor, &micro) < 3 )
 
1740
+    {
 
1741
+        g_warning( "unable to parse at-spi version number: %s", cp );
 
1742
+        return;
 
1743
+    }
 
1744
+
 
1745
+    if( ( (major << 16) | (minor << 8) | micro ) < ( 10 << 8 | 6 ) )
 
1746
+    {
 
1747
+        g_warning( "at-spi >= 1.7 required for accessibility support" );
 
1748
+        return;
 
1749
+    }
 
1750
+    
 
1751
+#endif // ! ( defined AIX || defined HPUX )
 
1752
+    
 
1753
+    /* Initialize the AtkUtilityWrapper class */
 
1754
+    g_type_class_unref( g_type_class_ref( OOO_TYPE_ATK_UTIL ) );
 
1755
+    
 
1756
+    /* Initialize the GailWindow wrapper class */
 
1757
+    g_type_class_unref( g_type_class_ref( OOO_TYPE_WINDOW_WRAPPER ) );
 
1758
+    
 
1759
+    /* Register AtkObject wrapper factory */
 
1760
+    AtkRegistry * registry = atk_get_default_registry();
 
1761
+    if( registry)
 
1762
+        atk_registry_set_factory_type( registry, OOO_TYPE_FIXED, OOO_TYPE_WRAPPER_FACTORY );
 
1763
+}
 
1764
+
 
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
 
1771
@@ -0,0 +1,387 @@
 
1772
+/*************************************************************************
 
1773
+ *
 
1774
+ *  OpenOffice.org - a multi-platform office productivity suite
 
1775
+ *
 
1776
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
1777
+ *
 
1778
+ *  $Revision: 1.1.2.1 $
 
1779
+ *
 
1780
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
1781
+ *
 
1782
+ *  The Contents of this file are made available subject to
 
1783
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
1784
+ *
 
1785
+ *
 
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
 
1790
+ *
 
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.
 
1794
+ *
 
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.
 
1799
+ *
 
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
 
1804
+ *
 
1805
+ ************************************************************************/
 
1806
+
 
1807
+#include "atkwrapper.hxx"
 
1808
+
 
1809
+#include <com/sun/star/accessibility/XAccessibleComponent.hpp>
 
1810
+
 
1811
+#ifdef ENABLE_TRACING
 
1812
+#include <stdio.h>
 
1813
+#endif
 
1814
+
 
1815
+using namespace ::com::sun::star;
 
1816
+
 
1817
+static accessibility::XAccessibleComponent*
 
1818
+    getComponent( AtkComponent *pComponent ) throw (uno::RuntimeException)
 
1819
+{
 
1820
+    AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pComponent );
 
1821
+    if( pWrap )
 
1822
+    {
 
1823
+        if( !pWrap->mpComponent && pWrap->mpContext )
 
1824
+        {
 
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();
 
1828
+        }
 
1829
+        
 
1830
+        return pWrap->mpComponent;
 
1831
+    }
 
1832
+    
 
1833
+    return NULL;
 
1834
+}
 
1835
+
 
1836
+/*****************************************************************************/
 
1837
+
 
1838
+static awt::Point
 
1839
+translatePoint( accessibility::XAccessibleComponent *pComponent, 
 
1840
+                gint x, gint y, AtkCoordType t)
 
1841
+{
 
1842
+    awt::Point aOrigin( 0, 0 );
 
1843
+    if( t == ATK_XY_SCREEN )
 
1844
+        aOrigin = pComponent->getLocationOnScreen();
 
1845
+
 
1846
+#ifdef ENABLE_TRACING
 
1847
+    fprintf(stderr, "coordinates ( %u, %u ) translated to: ( %u, %u )\n", 
 
1848
+        x, y, x - aOrigin.X, y - aOrigin.Y);
 
1849
+#endif
 
1850
+
 
1851
+    return awt::Point( x - aOrigin.X, y - aOrigin.Y );
 
1852
+}
 
1853
+
 
1854
+/*****************************************************************************/
 
1855
+
 
1856
+extern "C" {
 
1857
+
 
1858
+static gboolean
 
1859
+component_wrapper_grab_focus (AtkComponent *component)
 
1860
+{
 
1861
+    try
 
1862
+    {
 
1863
+        accessibility::XAccessibleComponent* pComponent = getComponent( component );
 
1864
+        if( pComponent )
 
1865
+        {
 
1866
+            pComponent->grabFocus();
 
1867
+            return TRUE;
 
1868
+        }
 
1869
+    }
 
1870
+    catch( const uno::Exception &e )
 
1871
+    {
 
1872
+        g_warning( "Exception in grabFocus()" );
 
1873
+    }
 
1874
+    
 
1875
+    return FALSE;
 
1876
+}
 
1877
+
 
1878
+/*****************************************************************************/
 
1879
+
 
1880
+static gboolean
 
1881
+component_wrapper_contains (AtkComponent *component,
 
1882
+                            gint          x,
 
1883
+                            gint          y,
 
1884
+                            AtkCoordType  coord_type)
 
1885
+{
 
1886
+    try
 
1887
+    {
 
1888
+        accessibility::XAccessibleComponent* pComponent = getComponent( component );
 
1889
+        if( pComponent )
 
1890
+            return pComponent->containsPoint( translatePoint( pComponent, x, y, coord_type ) );
 
1891
+    }
 
1892
+    catch( const uno::Exception &e )
 
1893
+    {
 
1894
+        g_warning( "Exception in containsPoint()" );
 
1895
+    }
 
1896
+    
 
1897
+    return FALSE;
 
1898
+}
 
1899
+
 
1900
+/*****************************************************************************/
 
1901
+
 
1902
+static AtkObject *
 
1903
+component_wrapper_ref_accessible_at_point (AtkComponent *component,
 
1904
+                                           gint          x,
 
1905
+                                           gint          y,
 
1906
+                                           AtkCoordType  coord_type)
 
1907
+{
 
1908
+    try
 
1909
+    {
 
1910
+        accessibility::XAccessibleComponent* pComponent = getComponent( component );
 
1911
+        
 
1912
+        if( pComponent )
 
1913
+        {
 
1914
+            uno::Reference< accessibility::XAccessible > xAccessible;
 
1915
+            xAccessible = pComponent->getAccessibleAtPoint(
 
1916
+                translatePoint( pComponent, x, y, coord_type ) );
 
1917
+            
 
1918
+#ifdef ENABLE_TRACING
 
1919
+            fprintf(stderr, "getAccessibleAtPoint( %u, %u ) returned %p\n",
 
1920
+              x, y, xAccessible.get());
 
1921
+            
 
1922
+            uno::Reference< accessibility::XAccessibleComponent > xComponent(
 
1923
+                xAccessible->getAccessibleContext(), uno::UNO_QUERY );
 
1924
+            
 
1925
+            if( xComponent.is() )
 
1926
+            {
 
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 );
 
1930
+            }
 
1931
+#endif
 
1932
+
 
1933
+            return atk_object_wrapper_ref( xAccessible );
 
1934
+        }
 
1935
+    }
 
1936
+    catch( const uno::Exception &e ) 
 
1937
+    {
 
1938
+        g_warning( "Exception in getAccessibleAtPoint()" );
 
1939
+    }
 
1940
+    
 
1941
+    return NULL;
 
1942
+}
 
1943
+
 
1944
+/*****************************************************************************/
 
1945
+
 
1946
+static void
 
1947
+component_wrapper_get_position (AtkComponent   *component,
 
1948
+                                gint           *x,
 
1949
+                                gint           *y,
 
1950
+                                AtkCoordType   coord_type)
 
1951
+{
 
1952
+    try
 
1953
+    {
 
1954
+        accessibility::XAccessibleComponent* pComponent = getComponent( component );
 
1955
+        if( pComponent )
 
1956
+        {
 
1957
+            awt::Point aPos;
 
1958
+            
 
1959
+            if( coord_type == ATK_XY_SCREEN )
 
1960
+                aPos = pComponent->getLocationOnScreen();
 
1961
+            else
 
1962
+                aPos = pComponent->getLocation();
 
1963
+            
 
1964
+            *x = aPos.X;
 
1965
+            *y = aPos.Y;
 
1966
+            
 
1967
+#ifdef ENABLE_TRACING
 
1968
+            fprintf(stderr, "getLocation[OnScreen]() returned: ( %u, %u )\n", *x, *y );
 
1969
+#endif
 
1970
+        }
 
1971
+    }
 
1972
+    catch( const uno::Exception &e ) 
 
1973
+    {
 
1974
+        g_warning( "Exception in getLocation[OnScreen]()" );
 
1975
+    }
 
1976
+}
 
1977
+
 
1978
+/*****************************************************************************/
 
1979
+
 
1980
+static void
 
1981
+component_wrapper_get_size (AtkComponent   *component,
 
1982
+                            gint           *width,
 
1983
+                            gint           *height)
 
1984
+{
 
1985
+    try
 
1986
+    {
 
1987
+        accessibility::XAccessibleComponent* pComponent = getComponent( component );
 
1988
+        if( pComponent )
 
1989
+        {
 
1990
+            awt::Size aSize = pComponent->getSize();
 
1991
+            *width = aSize.Width;
 
1992
+            *height = aSize.Height;
 
1993
+            
 
1994
+#ifdef ENABLE_TRACING
 
1995
+            fprintf(stderr, "getSize() returned: ( %u, %u )\n", *width, *height );
 
1996
+#endif
 
1997
+        }
 
1998
+    }
 
1999
+    catch( const uno::Exception &e ) 
 
2000
+    {
 
2001
+        g_warning( "Exception in getSize()" );
 
2002
+    }
 
2003
+}
 
2004
+
 
2005
+/*****************************************************************************/
 
2006
+
 
2007
+static void
 
2008
+component_wrapper_get_extents (AtkComponent *component,
 
2009
+                               gint         *x,
 
2010
+                               gint         *y,
 
2011
+                               gint         *width,
 
2012
+                               gint         *height,
 
2013
+                               AtkCoordType  coord_type)
 
2014
+{
 
2015
+    component_wrapper_get_position( component, x, y, coord_type );
 
2016
+    component_wrapper_get_size( component, width, height );
 
2017
+}
 
2018
+
 
2019
+/*****************************************************************************/
 
2020
+
 
2021
+static gboolean
 
2022
+component_wrapper_set_extents (AtkComponent *, gint, gint, gint, gint, AtkCoordType)
 
2023
+{
 
2024
+    g_warning( "AtkComponent::set_extents unimplementable" );
 
2025
+    return FALSE;
 
2026
+}
 
2027
+
 
2028
+/*****************************************************************************/
 
2029
+
 
2030
+static gboolean
 
2031
+component_wrapper_set_position (AtkComponent *, gint, gint, AtkCoordType)
 
2032
+{
 
2033
+    g_warning( "AtkComponent::set_position unimplementable" );
 
2034
+    return FALSE;
 
2035
+}
 
2036
+
 
2037
+/*****************************************************************************/
 
2038
+
 
2039
+static gboolean
 
2040
+component_wrapper_set_size (AtkComponent *, gint, gint)
 
2041
+{
 
2042
+    g_warning( "AtkComponent::set_size unimplementable" );
 
2043
+    return FALSE;
 
2044
+}
 
2045
+
 
2046
+/*****************************************************************************/
 
2047
+
 
2048
+static AtkLayer
 
2049
+component_wrapper_get_layer (AtkComponent   *component)
 
2050
+{
 
2051
+    AtkRole role = atk_object_get_role( ATK_OBJECT( component ) );
 
2052
+    AtkLayer layer = ATK_LAYER_WIDGET;
 
2053
+    
 
2054
+    switch (role)
 
2055
+    {
 
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;
 
2062
+            break;
 
2063
+        case ATK_ROLE_MENU:
 
2064
+            {
 
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;
 
2068
+            }
 
2069
+            break;
 
2070
+        
 
2071
+        case ATK_ROLE_LIST:
 
2072
+            {
 
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;
 
2076
+            }
 
2077
+            break;
 
2078
+        
 
2079
+        default:
 
2080
+            ;
 
2081
+    }
 
2082
+    
 
2083
+    return layer;
 
2084
+}
 
2085
+
 
2086
+/*****************************************************************************/
 
2087
+
 
2088
+static gint
 
2089
+component_wrapper_get_mdi_zorder (AtkComponent   *)
 
2090
+{
 
2091
+    // only needed for ATK_LAYER_MDI (not used) or ATK_LAYER_WINDOW (inherited from GAIL)
 
2092
+    return G_MININT;
 
2093
+}
 
2094
+
 
2095
+/*****************************************************************************/
 
2096
+
 
2097
+// This code is mostly stolen from libgail ..
 
2098
+
 
2099
+static guint
 
2100
+component_wrapper_add_focus_handler (AtkComponent    *component,
 
2101
+                                     AtkFocusHandler  handler)
 
2102
+{
 
2103
+    GSignalMatchType match_type;
 
2104
+    gulong ret;
 
2105
+    guint signal_id;
 
2106
+
 
2107
+    match_type = (GSignalMatchType) (G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC);
 
2108
+    signal_id = g_signal_lookup( "focus-event", ATK_TYPE_OBJECT );
 
2109
+
 
2110
+    ret = g_signal_handler_find( component, match_type, signal_id, 0, NULL,
 
2111
+                                 (gpointer) &handler, NULL);
 
2112
+    if (!ret)
 
2113
+    {
 
2114
+        return g_signal_connect_closure_by_id (component,
 
2115
+                                               signal_id, 0,
 
2116
+                                               g_cclosure_new (
 
2117
+                                               G_CALLBACK (handler), NULL,
 
2118
+                                               (GClosureNotify) NULL),
 
2119
+                                               FALSE);
 
2120
+    }
 
2121
+    else
 
2122
+    {
 
2123
+        return 0;
 
2124
+    }
 
2125
+}
 
2126
+
 
2127
+/*****************************************************************************/
 
2128
+
 
2129
+static void
 
2130
+component_wrapper_remove_focus_handler (AtkComponent  *component,
 
2131
+                                        guint         handler_id)
 
2132
+{
 
2133
+    g_signal_handler_disconnect (component, handler_id);
 
2134
+}
 
2135
+
 
2136
+/*****************************************************************************/
 
2137
+
 
2138
+} // extern "C"
 
2139
+
 
2140
+void
 
2141
+componentIfaceInit (AtkComponentIface *iface)
 
2142
+{
 
2143
+  g_return_if_fail (iface != NULL);
 
2144
+
 
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;
 
2158
+}
 
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
 
2165
@@ -0,0 +1,207 @@
 
2166
+/*************************************************************************
 
2167
+ *
 
2168
+ *  OpenOffice.org - a multi-platform office productivity suite
 
2169
+ *
 
2170
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
2171
+ *
 
2172
+ *  $Revision: 1.1.2.1 $
 
2173
+ *
 
2174
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
2175
+ *
 
2176
+ *  The Contents of this file are made available subject to
 
2177
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
2178
+ *
 
2179
+ *
 
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
 
2184
+ *
 
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.
 
2188
+ *
 
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.
 
2193
+ *
 
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
 
2198
+ *
 
2199
+ ************************************************************************/
 
2200
+
 
2201
+#include "atkwrapper.hxx"
 
2202
+#include "atktextattributes.hxx"
 
2203
+
 
2204
+#include <com/sun/star/accessibility/XAccessibleEditableText.hpp>
 
2205
+#include <com/sun/star/accessibility/TextSegment.hpp>
 
2206
+
 
2207
+// #include <functional>
 
2208
+// #include <hash_map>
 
2209
+
 
2210
+#include <stdio.h>
 
2211
+#include <string.h>
 
2212
+
 
2213
+using namespace ::com::sun::star;
 
2214
+
 
2215
+static accessibility::XAccessibleEditableText*
 
2216
+    getEditableText( AtkEditableText *pEditableText ) throw (uno::RuntimeException)
 
2217
+{
 
2218
+    AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pEditableText );
 
2219
+    if( pWrap )
 
2220
+    {
 
2221
+        if( !pWrap->mpEditableText && pWrap->mpContext )
 
2222
+        {
 
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();
 
2226
+        }
 
2227
+        
 
2228
+        return pWrap->mpEditableText;
 
2229
+    }
 
2230
+    
 
2231
+    return NULL;
 
2232
+}
 
2233
+
 
2234
+
 
2235
+/*****************************************************************************/
 
2236
+
 
2237
+extern "C" { 
 
2238
+
 
2239
+static gboolean
 
2240
+editable_text_wrapper_set_run_attributes( AtkEditableText  *text,
 
2241
+                                          AtkAttributeSet  *attribute_set,
 
2242
+                                          gint              nStartOffset,
 
2243
+                                          gint              nEndOffset)
 
2244
+{
 
2245
+    try {
 
2246
+        accessibility::XAccessibleEditableText* pEditableText = getEditableText( text );
 
2247
+        if( pEditableText )
 
2248
+        {
 
2249
+            uno::Sequence< beans::PropertyValue > aAttributeList;
 
2250
+
 
2251
+            if( attribute_set_map_to_property_values( attribute_set, aAttributeList ) )
 
2252
+                return pEditableText->setAttributes(nStartOffset, nEndOffset, aAttributeList);
 
2253
+        }
 
2254
+    }
 
2255
+    catch(const uno::Exception& e) {
 
2256
+        g_warning( "Exception in setAttributes()" );
 
2257
+    }
 
2258
+
 
2259
+    return FALSE;
 
2260
+}
 
2261
+
 
2262
+static void
 
2263
+editable_text_wrapper_set_text_contents( AtkEditableText  *text,
 
2264
+                                         const gchar      *string )
 
2265
+{
 
2266
+    try {
 
2267
+        accessibility::XAccessibleEditableText* pEditableText = getEditableText( text );
 
2268
+        if( pEditableText )
 
2269
+        {
 
2270
+            rtl::OUString aString ( string, strlen(string), RTL_TEXTENCODING_UTF8 );
 
2271
+            pEditableText->setText( aString );
 
2272
+        }
 
2273
+    }
 
2274
+    catch(const uno::Exception& e) {
 
2275
+        g_warning( "Exception in setText()" );
 
2276
+    }
 
2277
+}
 
2278
+
 
2279
+static void
 
2280
+editable_text_wrapper_insert_text( AtkEditableText  *text,
 
2281
+                                   const gchar      *string,
 
2282
+                                   gint             length,
 
2283
+                                   gint             *pos )
 
2284
+{
 
2285
+    try {
 
2286
+        accessibility::XAccessibleEditableText* pEditableText = getEditableText( text );
 
2287
+        if( pEditableText )
 
2288
+        {
 
2289
+            rtl::OUString aString ( string, length, RTL_TEXTENCODING_UTF8 );
 
2290
+            if( pEditableText->insertText( aString, *pos ) )
 
2291
+                *pos += length;
 
2292
+        }
 
2293
+    }
 
2294
+    catch(const uno::Exception& e) {
 
2295
+        g_warning( "Exception in insertText()" );
 
2296
+    }
 
2297
+}
 
2298
+
 
2299
+static void
 
2300
+editable_text_wrapper_cut_text( AtkEditableText  *text,
 
2301
+                                gint             start,
 
2302
+                                gint             end )
 
2303
+{
 
2304
+    try {
 
2305
+        accessibility::XAccessibleEditableText* pEditableText = getEditableText( text );
 
2306
+        if( pEditableText )
 
2307
+            pEditableText->cutText( start, end );
 
2308
+    }
 
2309
+    catch(const uno::Exception& e) {
 
2310
+        g_warning( "Exception in cutText()" );
 
2311
+    }
 
2312
+}
 
2313
+
 
2314
+static void
 
2315
+editable_text_wrapper_delete_text( AtkEditableText  *text,
 
2316
+                                   gint             start,
 
2317
+                                   gint             end )
 
2318
+{
 
2319
+    try {
 
2320
+        accessibility::XAccessibleEditableText* pEditableText = getEditableText( text );
 
2321
+        if( pEditableText )
 
2322
+            pEditableText->deleteText( start, end );
 
2323
+    }
 
2324
+    catch(const uno::Exception& e) {
 
2325
+        g_warning( "Exception in deleteText()" );
 
2326
+    }
 
2327
+}
 
2328
+
 
2329
+static void
 
2330
+editable_text_wrapper_paste_text( AtkEditableText  *text,
 
2331
+                                  gint             pos )
 
2332
+{
 
2333
+    try {
 
2334
+        accessibility::XAccessibleEditableText* pEditableText = getEditableText( text );
 
2335
+        if( pEditableText )
 
2336
+            pEditableText->pasteText( pos );
 
2337
+    }
 
2338
+    catch(const uno::Exception& e) {
 
2339
+        g_warning( "Exception in pasteText()" );
 
2340
+    }
 
2341
+}
 
2342
+
 
2343
+static void
 
2344
+editable_text_wrapper_copy_text( AtkEditableText  *text,
 
2345
+                                 gint             start,
 
2346
+                                 gint             end )
 
2347
+{
 
2348
+    try {
 
2349
+        accessibility::XAccessibleEditableText* pEditableText = getEditableText( text );
 
2350
+        if( pEditableText )
 
2351
+            pEditableText->copyText( start, end );
 
2352
+    }
 
2353
+    catch(const uno::Exception& e) {
 
2354
+        g_warning( "Exception in copyText()" );
 
2355
+    }
 
2356
+}
 
2357
+
 
2358
+} // extern "C"
 
2359
+
 
2360
+void
 
2361
+editableTextIfaceInit (AtkEditableTextIface *iface)
 
2362
+{
 
2363
+  g_return_if_fail (iface != NULL);
 
2364
+
 
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;
 
2372
+}
 
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
 
2379
@@ -0,0 +1,174 @@
 
2380
+/*************************************************************************
 
2381
+ *
 
2382
+ *  OpenOffice.org - a multi-platform office productivity suite
 
2383
+ *
 
2384
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
2385
+ *
 
2386
+ *  $Revision: 1.1.2.1 $
 
2387
+ *
 
2388
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
2389
+ *
 
2390
+ *  The Contents of this file are made available subject to
 
2391
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
2392
+ *
 
2393
+ *
 
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
 
2398
+ *
 
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.
 
2402
+ *
 
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.
 
2407
+ *
 
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
 
2412
+ *
 
2413
+ ************************************************************************/
 
2414
+
 
2415
+#include <plugins/gtk/gtkframe.hxx>
 
2416
+#include "atkwrapper.hxx"
 
2417
+#include "atkfactory.hxx"
 
2418
+
 
2419
+using namespace ::com::sun::star;
 
2420
+
 
2421
+extern "C" {
 
2422
+
 
2423
+/*
 
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.
 
2427
+ */
 
2428
 
2429
+static AtkStateSet *
 
2430
+noop_wrapper_ref_state_set( AtkObject * )
 
2431
+{
 
2432
+    AtkStateSet *state_set = atk_state_set_new();
 
2433
+    atk_state_set_add_state( state_set, ATK_STATE_DEFUNCT );
 
2434
+    return state_set;
 
2435
+}
 
2436
+
 
2437
+static void
 
2438
+atk_noop_object_wrapper_class_init(AtkNoOpObjectClass *klass)
 
2439
+{
 
2440
+    AtkObjectClass *atk_class = ATK_OBJECT_CLASS( klass );
 
2441
+    atk_class->ref_state_set = noop_wrapper_ref_state_set;
 
2442
+}
 
2443
+
 
2444
+static GType
 
2445
+atk_noop_object_wrapper_get_type(void)
 
2446
+{
 
2447
+    static GType type = 0;
 
2448
+
 
2449
+    if (!type)
 
2450
+    {
 
2451
+        static const GTypeInfo typeInfo =
 
2452
+        {
 
2453
+            sizeof (AtkNoOpObjectClass),
 
2454
+            (GBaseInitFunc) NULL,
 
2455
+            (GBaseFinalizeFunc) NULL,
 
2456
+            (GClassInitFunc) atk_noop_object_wrapper_class_init,
 
2457
+            (GClassFinalizeFunc) NULL,
 
2458
+            NULL,
 
2459
+            sizeof (AtkObjectWrapper),
 
2460
+            0,
 
2461
+            (GInstanceInitFunc) NULL,
 
2462
+            NULL
 
2463
+        } ;
 
2464
+        
 
2465
+        type = g_type_register_static (ATK_TYPE_OBJECT, "OOoAtkNoOpObj", &typeInfo, (GTypeFlags)0) ;
 
2466
+  }
 
2467
+  return type;
 
2468
+}
 
2469
+    
 
2470
+AtkObject*
 
2471
+atk_noop_object_wrapper_new()
 
2472
+{
 
2473
+  AtkObject *accessible;
 
2474
+
 
2475
+  accessible = (AtkObject *) g_object_new (atk_noop_object_wrapper_get_type(), NULL);
 
2476
+  g_return_val_if_fail (accessible != NULL, NULL);
 
2477
+
 
2478
+  accessible->role = ATK_ROLE_INVALID;
 
2479
+  accessible->layer = ATK_LAYER_INVALID;
 
2480
+
 
2481
+  return accessible;
 
2482
+}
 
2483
+
 
2484
+/*
 
2485
+ * The wrapper factory
 
2486
+ */
 
2487
+
 
2488
+static GType
 
2489
+wrapper_factory_get_accessible_type(void)
 
2490
+{
 
2491
+  return atk_object_wrapper_get_type();
 
2492
+}
 
2493
+
 
2494
+static AtkObject*
 
2495
+wrapper_factory_create_accessible( GObject *pObj )
 
2496
+{
 
2497
+    GtkWidget* parent_widget = gtk_widget_get_parent( GTK_WIDGET( pObj ) );
 
2498
+    
 
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();
 
2503
+    
 
2504
+    GtkSalFrame* pFrame = GtkSalFrame::getFromWindow( GTK_WINDOW( parent_widget ) );
 
2505
+    g_return_val_if_fail( pFrame != NULL, NULL );
 
2506
+    
 
2507
+    /* HACK: if the parent gtk window has an accessible already assigned, use 
 
2508
+     * this one to avoid endless recursion (see atkwindow.cxx).
 
2509
+     */
 
2510
+    AtkObject* parent_accessible = (AtkObject *) g_object_get_data(G_OBJECT( parent_widget ),
 
2511
+        "ooo:tooltip-accessible");
 
2512
+    
 
2513
+    if( ! parent_accessible )
 
2514
+        parent_accessible = gtk_widget_get_accessible(parent_widget);
 
2515
+    
 
2516
+    uno::Reference< accessibility::XAccessible > xAccessible(pFrame->getAccessible( true ));
 
2517
+    
 
2518
+    if( xAccessible.is() )
 
2519
+        return atk_object_wrapper_new( xAccessible, parent_accessible );
 
2520
+    
 
2521
+    return NULL;
 
2522
+}
 
2523
+
 
2524
+static void
 
2525
+wrapper_factory_class_init( AtkObjectFactoryClass *klass )
 
2526
+{
 
2527
+  klass->create_accessible   = wrapper_factory_create_accessible;
 
2528
+  klass->get_accessible_type = wrapper_factory_get_accessible_type;
 
2529
+}
 
2530
+
 
2531
+GType
 
2532
+wrapper_factory_get_type (void)
 
2533
+{
 
2534
+  static GType t = 0;
 
2535
+
 
2536
+  if (!t) {
 
2537
+    static const GTypeInfo tinfo =
 
2538
+    {
 
2539
+      sizeof (AtkObjectFactoryClass),
 
2540
+      NULL, NULL, (GClassInitFunc) wrapper_factory_class_init,
 
2541
+      NULL, NULL, sizeof (AtkObjectFactory), 0, NULL, NULL
 
2542
+    };
 
2543
+
 
2544
+    t = g_type_register_static (
 
2545
+        ATK_TYPE_OBJECT_FACTORY, "OOoAtkObjectWrapperFactory",
 
2546
+        &tinfo, (GTypeFlags) 0);
 
2547
+  }                                     
 
2548
+                                        
 
2549
+  return t;                                 
 
2550
+}
 
2551
+
 
2552
+} // extern C
 
2553
+
 
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
 
2560
@@ -0,0 +1,49 @@
 
2561
+/*************************************************************************
 
2562
+ *
 
2563
+ *  OpenOffice.org - a multi-platform office productivity suite
 
2564
+ *
 
2565
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
2566
+ *
 
2567
+ *  $Revision: 1.1.2.1 $
 
2568
+ *
 
2569
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
2570
+ *
 
2571
+ *  The Contents of this file are made available subject to
 
2572
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
2573
+ *
 
2574
+ *
 
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
 
2579
+ *
 
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.
 
2583
+ *
 
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.
 
2588
+ *
 
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
 
2593
+ *
 
2594
+ ************************************************************************/
 
2595
+
 
2596
+#ifndef __ATK_FACTORY_HXX__
 
2597
+#define __ATK_FACTORY_HXX__
 
2598
+
 
2599
+#include <atk/atk.h>
 
2600
+
 
2601
+#define OOO_TYPE_WRAPPER_FACTORY wrapper_factory_get_type()
 
2602
+
 
2603
+extern "C" {
 
2604
+    
 
2605
+GType wrapper_factory_get_type (void);
 
2606
+
 
2607
+} // extern "C"
 
2608
+
 
2609
+#endif
 
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
 
2616
@@ -0,0 +1,296 @@
 
2617
+/*************************************************************************
 
2618
+ *
 
2619
+ *  OpenOffice.org - a multi-platform office productivity suite
 
2620
+ *
 
2621
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
2622
+ *
 
2623
+ *  $Revision: 1.1.2.1 $
 
2624
+ *
 
2625
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
2626
+ *
 
2627
+ *  The Contents of this file are made available subject to
 
2628
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
2629
+ *
 
2630
+ *
 
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
 
2635
+ *
 
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.
 
2639
+ *
 
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.
 
2644
+ *
 
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
 
2649
+ *
 
2650
+ ************************************************************************/
 
2651
+
 
2652
+#include "atkwrapper.hxx"
 
2653
+
 
2654
+#include <com/sun/star/accessibility/XAccessibleHypertext.hpp>
 
2655
+
 
2656
+#include <stdio.h>
 
2657
+
 
2658
+using namespace ::com::sun::star;
 
2659
+
 
2660
 
2661
+// ---------------------- AtkHyperlink ----------------------
 
2662
+
 
2663
+typedef struct {
 
2664
+    AtkHyperlink atk_hyper_link;
 
2665
+
 
2666
+    uno::Reference< accessibility::XAccessibleHyperlink > xLink;
 
2667
+} HyperLink;
 
2668
+
 
2669
+static uno::Reference< accessibility::XAccessibleHyperlink >
 
2670
+    getHyperlink( AtkHyperlink *pHyperlink )
 
2671
+{
 
2672
+    HyperLink *pLink = (HyperLink *) pHyperlink;
 
2673
+    return pLink->xLink;
 
2674
+}
 
2675
+
 
2676
+static GObjectClass *hyper_parent_class = NULL;
 
2677
+
 
2678
+extern "C" {
 
2679
+
 
2680
+static void
 
2681
+hyper_link_finalize (GObject *obj)
 
2682
+{
 
2683
+    HyperLink *hl = (HyperLink *) obj;
 
2684
+    hl->xLink.clear();
 
2685
+    hyper_parent_class->finalize (obj);
 
2686
+}
 
2687
+
 
2688
+static gchar *
 
2689
+hyper_link_get_uri( AtkHyperlink *pLink,
 
2690
+                    gint          i )
 
2691
+{
 
2692
+    try {
 
2693
+        uno::Any aAny = getHyperlink( pLink )->getAccessibleActionObject( i );
 
2694
+        rtl::OUString aUri = aAny.get< rtl::OUString > ();
 
2695
+        return OUStringToGChar(aUri);
 
2696
+    }
 
2697
+    catch(const uno::Exception& e) {
 
2698
+        g_warning( "Exception in hyper_link_get_uri" );
 
2699
+    }
 
2700
+    return NULL;
 
2701
+}
 
2702
+
 
2703
+static AtkObject *
 
2704
+hyper_link_get_object( AtkHyperlink *pLink,
 
2705
+                       gint          i)
 
2706
+{
 
2707
+    try {
 
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 );
 
2711
+    }
 
2712
+    catch(const uno::Exception& e) {
 
2713
+        g_warning( "Exception in hyper_link_get_object" );
 
2714
+    }
 
2715
+    return NULL;
 
2716
+}
 
2717
+static gint
 
2718
+hyper_link_get_end_index( AtkHyperlink *pLink )
 
2719
+{
 
2720
+    try {
 
2721
+        return getHyperlink( pLink )->getEndIndex();
 
2722
+    } 
 
2723
+    catch(const uno::Exception& e) {
 
2724
+    }
 
2725
+    return -1;
 
2726
+}
 
2727
+static gint
 
2728
+hyper_link_get_start_index( AtkHyperlink *pLink )
 
2729
+{
 
2730
+    try {
 
2731
+        return getHyperlink( pLink )->getStartIndex();
 
2732
+    } 
 
2733
+    catch(const uno::Exception& e) {
 
2734
+    }
 
2735
+    return -1;
 
2736
+}
 
2737
+static gboolean
 
2738
+hyper_link_is_valid( AtkHyperlink *pLink )
 
2739
+{
 
2740
+    try {
 
2741
+        return getHyperlink( pLink )->isValid();
 
2742
+    }
 
2743
+    catch(const uno::Exception& e) {
 
2744
+    }
 
2745
+    return FALSE;
 
2746
+}
 
2747
+static gint
 
2748
+hyper_link_get_n_anchors( AtkHyperlink *pLink )
 
2749
+{
 
2750
+    try {
 
2751
+        return getHyperlink( pLink )->getAccessibleActionCount();
 
2752
+    }
 
2753
+    catch(const uno::Exception& e) {
 
2754
+    }
 
2755
+    return 0;
 
2756
+}
 
2757
+
 
2758
+static guint
 
2759
+hyper_link_link_state( AtkHyperlink * )
 
2760
+{
 
2761
+    g_warning( "FIXME: hyper_link_link_state unimplemented" );
 
2762
+    return 0;
 
2763
+}
 
2764
+static gboolean
 
2765
+hyper_link_is_selected_link( AtkHyperlink * )
 
2766
+{
 
2767
+    g_warning( "FIXME: hyper_link_is_selected_link unimplemented" );
 
2768
+    return FALSE;
 
2769
+}
 
2770
+
 
2771
+static void
 
2772
+hyper_link_class_init (AtkHyperlinkClass *klass)
 
2773
+{
 
2774
+    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
2775
+
 
2776
+    gobject_class->finalize = hyper_link_finalize;
 
2777
+
 
2778
+    hyper_parent_class = (GObjectClass *)g_type_class_peek_parent (klass);
 
2779
+
 
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;
 
2788
+}
 
2789
+
 
2790
+static GType
 
2791
+hyper_link_get_type (void)
 
2792
+{
 
2793
+    static GType type = 0;
 
2794
+
 
2795
+    if (!type) {
 
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 */
 
2807
+        };
 
2808
+
 
2809
+        static const GInterfaceInfo atk_action_info = {
 
2810
+            (GInterfaceInitFunc) actionIfaceInit,
 
2811
+            (GInterfaceFinalizeFunc) NULL,
 
2812
+            NULL
 
2813
+        };
 
2814
+
 
2815
+        type = g_type_register_static (ATK_TYPE_HYPERLINK,
 
2816
+                                       "OOoAtkObjHyperLink", &tinfo,
 
2817
+                                       (GTypeFlags)0);
 
2818
+        g_type_add_interface_static (type, ATK_TYPE_ACTION,
 
2819
+                                     &atk_action_info);
 
2820
+    }
 
2821
+
 
2822
+    return type;
 
2823
+}
 
2824
+
 
2825
+// ---------------------- AtkHyperText ----------------------
 
2826
+
 
2827
+static accessibility::XAccessibleHypertext*
 
2828
+    getHypertext( AtkHypertext *pHypertext ) throw (uno::RuntimeException)
 
2829
+{
 
2830
+    AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pHypertext );
 
2831
+    if( pWrap )
 
2832
+    {
 
2833
+        if( !pWrap->mpHypertext && pWrap->mpContext )
 
2834
+        {
 
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();
 
2838
+        }
 
2839
+        
 
2840
+        return pWrap->mpHypertext;
 
2841
+    }
 
2842
+    
 
2843
+    return NULL;
 
2844
+}
 
2845
+
 
2846
+
 
2847
+static AtkHyperlink *
 
2848
+hypertext_get_link( AtkHypertext *hypertext,
 
2849
+                    gint          link_index)
 
2850
+{
 
2851
+    try {
 
2852
+        accessibility::XAccessibleHypertext* pHypertext = getHypertext( hypertext );
 
2853
+        if( pHypertext )
 
2854
+        {
 
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 ) );
 
2859
+                pLink = NULL;
 
2860
+            }
 
2861
+            return ATK_HYPERLINK( pLink );
 
2862
+        }
 
2863
+    }
 
2864
+    catch(const uno::Exception& e) {
 
2865
+        g_warning( "Exception in getHyperLink()" );
 
2866
+    }
 
2867
+    
 
2868
+    return NULL;
 
2869
+}
 
2870
+
 
2871
+static gint
 
2872
+hypertext_get_n_links( AtkHypertext *hypertext )
 
2873
+{
 
2874
+    try {
 
2875
+        accessibility::XAccessibleHypertext* pHypertext = getHypertext( hypertext );
 
2876
+        if( pHypertext )
 
2877
+            return pHypertext->getHyperLinkCount();
 
2878
+    }
 
2879
+    catch(const uno::Exception& e) {
 
2880
+        g_warning( "Exception in getHyperLinkCount()" );
 
2881
+    }
 
2882
+    
 
2883
+    return 0;
 
2884
+}
 
2885
+
 
2886
+static gint
 
2887
+hypertext_get_link_index( AtkHypertext *hypertext,
 
2888
+                          gint          index)
 
2889
+{
 
2890
+    try {
 
2891
+        accessibility::XAccessibleHypertext* pHypertext = getHypertext( hypertext );
 
2892
+        if( pHypertext )
 
2893
+            return pHypertext->getHyperLinkIndex( index );
 
2894
+    }
 
2895
+    catch(const uno::Exception& e) {
 
2896
+        g_warning( "Exception in getHyperLinkIndex()" );
 
2897
+    }
 
2898
+    
 
2899
+    return 0;
 
2900
+}
 
2901
+
 
2902
+} // extern "C"
 
2903
+
 
2904
+void
 
2905
+hypertextIfaceInit (AtkHypertextIface *iface)
 
2906
+{
 
2907
+  g_return_if_fail (iface != NULL);
 
2908
+
 
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;
 
2912
+}
 
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
 
2919
@@ -0,0 +1,143 @@
 
2920
+/*************************************************************************
 
2921
+ *
 
2922
+ *  OpenOffice.org - a multi-platform office productivity suite
 
2923
+ *
 
2924
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
2925
+ *
 
2926
+ *  $Revision: 1.1.2.1 $
 
2927
+ *
 
2928
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
2929
+ *
 
2930
+ *  The Contents of this file are made available subject to
 
2931
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
2932
+ *
 
2933
+ *
 
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
 
2938
+ *
 
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.
 
2942
+ *
 
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.
 
2947
+ *
 
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
 
2952
+ *
 
2953
+ ************************************************************************/
 
2954
+
 
2955
+#include "atkwrapper.hxx"
 
2956
+
 
2957
+#include <com/sun/star/accessibility/XAccessibleImage.hpp>
 
2958
+
 
2959
+#include <stdio.h>
 
2960
+
 
2961
+using namespace ::com::sun::star;
 
2962
+
 
2963
+// FIXME
 
2964
+static G_CONST_RETURN gchar *
 
2965
+getAsConst( rtl::OUString rString )
 
2966
+{
 
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 ];
 
2973
+}
 
2974
+
 
2975
+static accessibility::XAccessibleImage*
 
2976
+    getImage( AtkImage *pImage ) throw (uno::RuntimeException)
 
2977
+{
 
2978
+    AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pImage );
 
2979
+    if( pWrap )
 
2980
+    {
 
2981
+        if( !pWrap->mpImage && pWrap->mpContext )
 
2982
+        {
 
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();
 
2986
+        }
 
2987
+        
 
2988
+        return pWrap->mpImage;
 
2989
+    }
 
2990
+    
 
2991
+    return NULL;
 
2992
+}
 
2993
+
 
2994
+extern "C" {
 
2995
+
 
2996
+static G_CONST_RETURN gchar *
 
2997
+image_get_image_description( AtkImage *image )
 
2998
+{
 
2999
+    try {
 
3000
+        accessibility::XAccessibleImage* pImage = getImage( image );
 
3001
+        if( pImage )    
 
3002
+            return getAsConst( pImage->getAccessibleImageDescription() );
 
3003
+    }
 
3004
+    catch(const uno::Exception& e) {
 
3005
+        g_warning( "Exception in getAccessibleImageDescription()" );
 
3006
+    }
 
3007
+    
 
3008
+    return NULL;
 
3009
+}
 
3010
+
 
3011
+static void
 
3012
+image_get_image_position( AtkImage     *image,
 
3013
+                          gint         *x,
 
3014
+                          gint         *y,
 
3015
+                          AtkCoordType  coord_type )
 
3016
+{
 
3017
+    *x = *y = 0;
 
3018
+    if( ATK_IS_COMPONENT( image ) )
 
3019
+        atk_component_get_position( ATK_COMPONENT( image ), x, y, coord_type );
 
3020
+    else
 
3021
+        g_warning( "FIXME: no image position information" );
 
3022
+}
 
3023
+
 
3024
+static void
 
3025
+image_get_image_size( AtkImage *image,
 
3026
+                      gint     *width,
 
3027
+                      gint     *height )
 
3028
+{
 
3029
+    *width = 0;
 
3030
+    *height = 0;
 
3031
+    try {
 
3032
+        accessibility::XAccessibleImage* pImage = getImage( image );
 
3033
+        if( pImage )
 
3034
+        {
 
3035
+            *width = pImage->getAccessibleImageWidth();
 
3036
+            *height = pImage->getAccessibleImageHeight();
 
3037
+        }
 
3038
+    }
 
3039
+    catch(const uno::Exception& e) {
 
3040
+        g_warning( "Exception in getAccessibleImageHeight() or Width" );
 
3041
+    }
 
3042
+}
 
3043
+
 
3044
+static gboolean
 
3045
+image_set_image_description( AtkImage *, const gchar * )
 
3046
+{
 
3047
+    g_warning ("FIXME: no set image description");
 
3048
+    return FALSE;
 
3049
+}
 
3050
+
 
3051
+} // extern "C"
 
3052
+
 
3053
+void
 
3054
+imageIfaceInit (AtkImageIface *iface)
 
3055
+{
 
3056
+  g_return_if_fail (iface != NULL);
 
3057
+
 
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;
 
3062
+}
 
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
 
3069
@@ -0,0 +1,474 @@
 
3070
+/*************************************************************************
 
3071
+ *
 
3072
+ *  OpenOffice.org - a multi-platform office productivity suite
 
3073
+ *
 
3074
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
3075
+ *
 
3076
+ *  $Revision: 1.1.2.1 $
 
3077
+ *
 
3078
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
3079
+ *
 
3080
+ *  The Contents of this file are made available subject to
 
3081
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
3082
+ *
 
3083
+ *
 
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
 
3088
+ *
 
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.
 
3092
+ *
 
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.
 
3097
+ *
 
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
 
3102
+ *
 
3103
+ ************************************************************************/
 
3104
+
 
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>
 
3111
+
 
3112
+#include "atklistener.hxx"
 
3113
+#include "atkwrapper.hxx"
 
3114
+
 
3115
+#include <rtl/ref.hxx>
 
3116
+#include <stdio.h>
 
3117
+
 
3118
+using namespace com::sun::star;
 
3119
+
 
3120
+
 
3121
+#define CSTRING_FROM_ANY(i) rtl::OUStringToOString( i.get< rtl::OUString >(), RTL_TEXTENCODING_UTF8 ).getStr()
 
3122
+
 
3123
+AtkListener::AtkListener( AtkObjectWrapper* pWrapper )
 
3124
+{
 
3125
+    if( pWrapper )
 
3126
+    {
 
3127
+        mpAccessible = ATK_OBJECT( g_object_ref( pWrapper ) );
 
3128
+        updateChildList( pWrapper->mpContext );
 
3129
+    }
 
3130
+}
 
3131
+
 
3132
+AtkListener::~AtkListener()
 
3133
+{
 
3134
+}
 
3135
+
 
3136
+/*****************************************************************************/
 
3137
+
 
3138
+AtkStateType mapState( const uno::Any &rAny )
 
3139
+{
 
3140
+    sal_Int16 nState = accessibility::AccessibleStateType::INVALID;
 
3141
+    rAny >>= nState;
 
3142
+    return mapAtkState( nState );
 
3143
+}
 
3144
+
 
3145
+/*****************************************************************************/
 
3146
+
 
3147
+// XEventListener implementation
 
3148
+void AtkListener::disposing( const lang::EventObject& ) throw (uno::RuntimeException)
 
3149
+{
 
3150
+    if( mpAccessible )
 
3151
+    {
 
3152
+        // Release all interface references to avoid shutdown problems with
 
3153
+        // global mutex
 
3154
+        atk_object_wrapper_dispose( ATK_OBJECT_WRAPPER( mpAccessible ) );
 
3155
+        
 
3156
+        // This is an equivalent to a state change to DEFUNC(T).
 
3157
+        atk_object_notify_state_change( mpAccessible, ATK_STATE_DEFUNCT, TRUE );
 
3158
+
 
3159
+        if( atk_get_focus_object() == mpAccessible )
 
3160
+            atk_focus_tracker_notify( NULL );
 
3161
+        
 
3162
+        // Release the wrapper object so that it can vanish ..
 
3163
+        g_object_unref( mpAccessible );
 
3164
+        mpAccessible = NULL;
 
3165
+    }
 
3166
+}
 
3167
+
 
3168
+/*****************************************************************************/
 
3169
+
 
3170
+static AtkObject *getObjFromAny( const uno::Any &rAny )
 
3171
+{
 
3172
+    uno::Reference< accessibility::XAccessible > xAccessible;
 
3173
+    rAny >>= xAccessible;
 
3174
+    return xAccessible.is() ? atk_object_wrapper_ref( xAccessible ) : NULL;
 
3175
+}
 
3176
+
 
3177
+/*****************************************************************************/
 
3178
+
 
3179
+// Updates the child list held to provide the old IndexInParent on children_changed::remove
 
3180
+void AtkListener::updateChildList(accessibility::XAccessibleContext* pContext)
 
3181
+{
 
3182
+     m_aChildList.clear();
 
3183
+     
 
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) )
 
3188
+     {
 
3189
+         sal_Int32 nChildren = pContext->getAccessibleChildCount();
 
3190
+         m_aChildList.resize(nChildren);
 
3191
+         for(sal_Int32 n = 0; n < nChildren; n++)
 
3192
+         {
 
3193
+             m_aChildList[n] = pContext->getAccessibleChild(n);
 
3194
+         }
 
3195
+     }
 
3196
+}
 
3197
+
 
3198
+/*****************************************************************************/
 
3199
+
 
3200
+void AtkListener::handleChildAdded(
 
3201
+    const uno::Reference< accessibility::XAccessibleContext >& rxParent,
 
3202
+    const uno::Reference< accessibility::XAccessible>& rxAccessible)
 
3203
+{
 
3204
+    AtkObject * pChild = atk_object_wrapper_ref( rxAccessible );
 
3205
+    
 
3206
+    if( pChild )
 
3207
+    {
 
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 );
 
3212
+    }
 
3213
+}
 
3214
+
 
3215
+/*****************************************************************************/
 
3216
+
 
3217
+void AtkListener::handleChildRemoved(
 
3218
+    const uno::Reference< accessibility::XAccessibleContext >& rxParent,
 
3219
+    const uno::Reference< accessibility::XAccessible>& rxChild)
 
3220
+{
 
3221
+    sal_Int32 nIndex = -1;
 
3222
+
 
3223
+    // Locate the child in the children list
 
3224
+    size_t n, nmax = m_aChildList.size();
 
3225
+    for( n = 0; n < nmax; ++n )
 
3226
+    {
 
3227
+        if( rxChild == m_aChildList[n] )
 
3228
+        {
 
3229
+            nIndex = n;
 
3230
+            break;
 
3231
+        }
 
3232
+    }
 
3233
+
 
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
 
3241
+    // for now.
 
3242
+    if( nIndex >= 0 )
 
3243
+    {
 
3244
+        updateChildList(rxParent.get());
 
3245
+
 
3246
+        AtkObject * pChild = atk_object_wrapper_ref( rxChild, false );
 
3247
+        if( pChild )
 
3248
+        {
 
3249
+            g_signal_emit_by_name( mpAccessible, "children_changed::remove", nIndex, pChild, NULL );
 
3250
+            g_object_unref( pChild );
 
3251
+        }
 
3252
+    }
 
3253
+}
 
3254
+
 
3255
+/*****************************************************************************/
 
3256
+
 
3257
+void AtkListener::handleInvalidateChildren(
 
3258
+    const uno::Reference< accessibility::XAccessibleContext >& rxParent)
 
3259
+{
 
3260
+    // Send notifications for all previous children 
 
3261
+    size_t n = m_aChildList.size();
 
3262
+    while( n-- > 0 )
 
3263
+    {
 
3264
+        AtkObject * pChild = atk_object_wrapper_ref( m_aChildList[n], false );
 
3265
+        if( pChild )
 
3266
+        {
 
3267
+            g_signal_emit_by_name( mpAccessible, "children_changed::remove", n, pChild, NULL );
 
3268
+            g_object_unref( pChild );
 
3269
+        }
 
3270
+    }
 
3271
+    
 
3272
+    updateChildList(rxParent.get());
 
3273
+    
 
3274
+    // Send notifications for all new children
 
3275
+    size_t nmax = m_aChildList.size();
 
3276
+    for( n = 0; n < nmax; ++n )
 
3277
+    {
 
3278
+        AtkObject * pChild = atk_object_wrapper_ref( m_aChildList[n] );
 
3279
+    
 
3280
+        if( pChild )
 
3281
+        {
 
3282
+            g_signal_emit_by_name( mpAccessible, "children_changed::add", n, pChild, NULL );
 
3283
+            g_object_unref( pChild );
 
3284
+        }
 
3285
+    }
 
3286
+}
 
3287
+
 
3288
+/*****************************************************************************/
 
3289
+
 
3290
+static uno::Reference< accessibility::XAccessibleContext >
 
3291
+getAccessibleContextFromSource( const uno::Reference< uno::XInterface >& rxSource )
 
3292
+{
 
3293
+    uno::Reference< accessibility::XAccessibleContext > xContext(rxSource, uno::UNO_QUERY);
 
3294
+    if( ! xContext.is() )
 
3295
+    {
 
3296
+         g_warning( "ERROR: Event source does not implement XAccessibleContext" );
 
3297
+
 
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();
 
3303
+    }
 
3304
+    
 
3305
+    return xContext;
 
3306
+}
 
3307
+
 
3308
+/*****************************************************************************/
 
3309
+
 
3310
+// XAccessibleEventListener
 
3311
+void AtkListener::notifyEvent( const accessibility::AccessibleEventObject& aEvent ) throw( uno::RuntimeException )
 
3312
+{
 
3313
+    if( !mpAccessible )
 
3314
+        return;
 
3315
+    
 
3316
+    switch( aEvent.EventId )
 
3317
+    {
 
3318
+    // AtkObject signals:
 
3319
+        // Hierarchy signals
 
3320
+        case accessibility::AccessibleEventId::CHILD:
 
3321
+        {
 
3322
+            uno::Reference< accessibility::XAccessibleContext > xParent;
 
3323
+            uno::Reference< accessibility::XAccessible > xChild;
 
3324
+            
 
3325
+            xParent = getAccessibleContextFromSource(aEvent.Source);
 
3326
+            g_return_if_fail( xParent.is() );
 
3327
+            
 
3328
+            if( aEvent.OldValue >>= xChild )
 
3329
+                handleChildRemoved(xParent, xChild);
 
3330
+            
 
3331
+            if( aEvent.NewValue >>= xChild )
 
3332
+                handleChildAdded(xParent, xChild);
 
3333
+        }
 
3334
+            break;
 
3335
+            
 
3336
+        case accessibility::AccessibleEventId::INVALIDATE_ALL_CHILDREN:
 
3337
+        {
 
3338
+            uno::Reference< accessibility::XAccessibleContext > xParent;
 
3339
+            
 
3340
+            xParent = getAccessibleContextFromSource(aEvent.Source);
 
3341
+            g_return_if_fail( xParent.is() );
 
3342
+            
 
3343
+            handleInvalidateChildren(xParent);
 
3344
+        }
 
3345
+            break;
 
3346
+            
 
3347
+        case accessibility::AccessibleEventId::NAME_CHANGED:
 
3348
+            g_object_notify( G_OBJECT( mpAccessible ), "accessible-name" );
 
3349
+            break;
 
3350
+            
 
3351
+        case accessibility::AccessibleEventId::DESCRIPTION_CHANGED:
 
3352
+            g_object_notify( G_OBJECT( mpAccessible ), "accessible-description" );
 
3353
+            break;
 
3354
+            
 
3355
+        case accessibility::AccessibleEventId::STATE_CHANGED:
 
3356
+        {
 
3357
+            AtkStateType eOldState = mapState( aEvent.OldValue );
 
3358
+            AtkStateType eNewState = mapState( aEvent.NewValue );
 
3359
+
 
3360
+            gboolean bState = eNewState != ATK_STATE_INVALID;
 
3361
+            AtkStateType eRealState = bState ? eNewState : eOldState;
 
3362
+
 
3363
+            atk_object_notify_state_change( mpAccessible, eRealState, bState );
 
3364
+            break;
 
3365
+        }
 
3366
+
 
3367
+        case accessibility::AccessibleEventId::BOUNDRECT_CHANGED:
 
3368
+        
 
3369
+#ifdef HAS_ATKRECTANGLE
 
3370
+            if( ATK_IS_COMPONENT( mpAccessible ) )
 
3371
+            {
 
3372
+                AtkRectangle rect;
 
3373
+            
 
3374
+                atk_component_get_extents( ATK_COMPONENT( mpAccessible ), 
 
3375
+                                           &rect.x,
 
3376
+                                           &rect.y,
 
3377
+                                           &rect.width,
 
3378
+                                           &rect.height,
 
3379
+                                           ATK_XY_SCREEN );
 
3380
+                                           
 
3381
+                g_signal_emit_by_name( mpAccessible, "bounds_changed", &rect );
 
3382
+            }
 
3383
+            else
 
3384
+                g_warning( "bounds_changed event for object not implementing AtkComponent\n");
 
3385
+#endif
 
3386
+            
 
3387
+            break;
 
3388
+        
 
3389
+        case accessibility::AccessibleEventId::VISIBLE_DATA_CHANGED:
 
3390
+            g_signal_emit_by_name( mpAccessible, "visible-data-changed" );
 
3391
+            break;
 
3392
+            
 
3393
+        case accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED:
 
3394
+        {
 
3395
+            AtkObject *pChild = getObjFromAny( aEvent.NewValue );
 
3396
+            if( pChild )
 
3397
+            {
 
3398
+                g_signal_emit_by_name( mpAccessible, "active-descendant-changed", pChild );
 
3399
+                g_object_unref( pChild );
 
3400
+            }
 
3401
+            break;
 
3402
+        }
 
3403
+
 
3404
+        // AtkAction signals ...
 
3405
+        case accessibility::AccessibleEventId::ACTION_CHANGED:
 
3406
+            g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-actions");
 
3407
+            break;
 
3408
+
 
3409
+        // AtkText
 
3410
+        case accessibility::AccessibleEventId::CARET_CHANGED:
 
3411
+        {
 
3412
+            sal_Int32 nPos;
 
3413
+            aEvent.NewValue >>= nPos;
 
3414
+            g_signal_emit_by_name( mpAccessible, "text_caret_moved", nPos );
 
3415
+            break;
 
3416
+        }
 
3417
+        case accessibility::AccessibleEventId::TEXT_CHANGED:
 
3418
+        {
 
3419
+            // TESTME: and remove this comment:
 
3420
+            // cf. comphelper/source/misc/accessibletexthelper.cxx (implInitTextChangedEvent)
 
3421
+            accessibility::TextSegment aDeletedText;
 
3422
+            accessibility::TextSegment aInsertedText;
 
3423
+
 
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 ) );
 
3434
+            break;
 
3435
+        }
 
3436
+        
 
3437
+        case accessibility::AccessibleEventId::TEXT_SELECTION_CHANGED:
 
3438
+        {
 
3439
+            g_signal_emit_by_name( mpAccessible, "text-selection-changed" );
 
3440
+            break;
 
3441
+        }
 
3442
+        
 
3443
+        case accessibility::AccessibleEventId::TEXT_ATTRIBUTE_CHANGED:
 
3444
+            g_signal_emit_by_name( mpAccessible, "text-attributes-changed" );
 
3445
+            break;
 
3446
+
 
3447
+        // AtkValue
 
3448
+        case accessibility::AccessibleEventId::VALUE_CHANGED:
 
3449
+            g_object_notify( G_OBJECT( mpAccessible ), "accessible-value" );
 
3450
+            break;
 
3451
+
 
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 ...
 
3461
+            break;
 
3462
+
 
3463
+        // AtkTable 
 
3464
+        case accessibility::AccessibleEventId::TABLE_MODEL_CHANGED:
 
3465
+        {
 
3466
+            accessibility::AccessibleTableModelChange aChange;
 
3467
+            aEvent.NewValue >>= aChange;
 
3468
+
 
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;
 
3472
+            
 
3473
+            static const struct {
 
3474
+                    const char *row;
 
3475
+                    const char *col;
 
3476
+            } aSignalNames[] = 
 
3477
+            {
 
3478
+                { NULL, NULL }, // dummy
 
3479
+                { "row_inserted", "column_inserted" }, // INSERT = 1
 
3480
+                { "row_deleted", "column_deleted" } // DELETE = 2
 
3481
+            };
 
3482
+            switch( aChange.Type )
 
3483
+            {
 
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 );
 
3494
+                break;
 
3495
+                
 
3496
+            case accessibility::AccessibleTableModelChangeType::UPDATE:
 
3497
+                // This is not really a model change, is it ?
 
3498
+                break;
 
3499
+            default:
 
3500
+                g_warning( "TESTME: unusual table model change %d\n", aChange.Type );
 
3501
+                break;
 
3502
+            }
 
3503
+            g_signal_emit_by_name( G_OBJECT( mpAccessible ), "model-changed" );
 
3504
+            break;
 
3505
+        }
 
3506
+
 
3507
+        case accessibility::AccessibleEventId::TABLE_COLUMN_HEADER_CHANGED:
 
3508
+            g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-table-column-header");
 
3509
+            break;
 
3510
+
 
3511
+        case accessibility::AccessibleEventId::TABLE_CAPTION_CHANGED:
 
3512
+            g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-table-caption");
 
3513
+            break;
 
3514
+            
 
3515
+        case accessibility::AccessibleEventId::TABLE_COLUMN_DESCRIPTION_CHANGED:
 
3516
+            g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-table-column-description");
 
3517
+            break;
 
3518
+            
 
3519
+        case accessibility::AccessibleEventId::TABLE_ROW_DESCRIPTION_CHANGED:
 
3520
+            g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-table-row-description");
 
3521
+            break;
 
3522
+            
 
3523
+        case accessibility::AccessibleEventId::TABLE_ROW_HEADER_CHANGED:
 
3524
+            g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-table-row-header");
 
3525
+            break;
 
3526
+            
 
3527
+        case accessibility::AccessibleEventId::TABLE_SUMMARY_CHANGED:
 
3528
+            g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-table-summary");
 
3529
+            break;
 
3530
+
 
3531
+        case accessibility::AccessibleEventId::SELECTION_CHANGED:
 
3532
+            g_signal_emit_by_name( G_OBJECT( mpAccessible ), "selection_changed");
 
3533
+            break;
 
3534
+            
 
3535
+        case accessibility::AccessibleEventId::HYPERTEXT_CHANGED:
 
3536
+            g_signal_emit_by_name( G_OBJECT( mpAccessible ), "property_change::accessible-hypertext-offset");
 
3537
+            break;
 
3538
+
 
3539
+    default:
 
3540
+            g_warning( "Unknown event notification %d", aEvent.EventId );
 
3541
+            break;
 
3542
+    }
 
3543
+}
 
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
 
3550
@@ -0,0 +1,92 @@
 
3551
+/*************************************************************************
 
3552
+ *
 
3553
+ *  OpenOffice.org - a multi-platform office productivity suite
 
3554
+ *
 
3555
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
3556
+ *
 
3557
+ *  $Revision: 1.1.2.1 $
 
3558
+ *
 
3559
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
3560
+ *
 
3561
+ *  The Contents of this file are made available subject to
 
3562
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
3563
+ *
 
3564
+ *
 
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
 
3569
+ *
 
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.
 
3573
+ *
 
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.
 
3578
+ *
 
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
 
3583
+ *
 
3584
+ ************************************************************************/
 
3585
+
 
3586
+#ifndef _ATK_LISTENER_HXX_
 
3587
+#define _ATK_LISTENER_HXX_
 
3588
+
 
3589
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEEVENTLISTENER_HPP_
 
3590
+#include <com/sun/star/accessibility/XAccessibleEventListener.hpp>
 
3591
+#endif
 
3592
+
 
3593
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
 
3594
+#include <cppuhelper/implbase1.hxx>
 
3595
+#endif
 
3596
+
 
3597
+#include <vector>
 
3598
+
 
3599
+#include "atkwrapper.hxx"
 
3600
+
 
3601
+typedef std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > AccessibleVector;
 
3602
+
 
3603
+class AtkListener : public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleEventListener >
 
3604
+{
 
3605
+public:
 
3606
+    AtkListener(AtkObjectWrapper * pWrapper);
 
3607
+    
 
3608
+    // XEventListener
 
3609
+    virtual void disposing( const ::com::sun::star::lang::EventObject& Source ) 
 
3610
+        throw (::com::sun::star::uno::RuntimeException);
 
3611
+
 
3612
+    // XAccessibleEventListener
 
3613
+    virtual void notifyEvent( const ::com::sun::star::accessibility::AccessibleEventObject& aEvent ) 
 
3614
+        throw( ::com::sun::star::uno::RuntimeException );
 
3615
+    
 
3616
+    AtkObject *mpAccessible;
 
3617
+    AccessibleVector m_aChildList;
 
3618
+
 
3619
+private:
 
3620
+
 
3621
+    virtual ~AtkListener();
 
3622
+
 
3623
+    // Updates the child list held to provide the old IndexInParent on children_changed::remove
 
3624
+    void updateChildList(::com::sun::star::accessibility::XAccessibleContext* pContext);
 
3625
+    
 
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);
 
3630
+    
 
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);
 
3635
+    
 
3636
+    // Process INVALIDATE_ALL_CHILDREN notification
 
3637
+    void handleInvalidateChildren(
 
3638
+        const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >& rxParent);    
 
3639
+};
 
3640
+
 
3641
+#endif /* _ATK_LISTENER_HXX_ */
 
3642
+
 
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
 
3649
@@ -0,0 +1,200 @@
 
3650
+/*************************************************************************
 
3651
+ *
 
3652
+ *  OpenOffice.org - a multi-platform office productivity suite
 
3653
+ *
 
3654
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
3655
+ *
 
3656
+ *  $Revision: 1.1.2.1 $
 
3657
+ *
 
3658
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
3659
+ *
 
3660
+ *  The Contents of this file are made available subject to
 
3661
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
3662
+ *
 
3663
+ *
 
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
 
3668
+ *
 
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.
 
3672
+ *
 
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.
 
3677
+ *
 
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
 
3682
+ *
 
3683
+ ************************************************************************/
 
3684
+
 
3685
+#include "atkwrapper.hxx"
 
3686
+
 
3687
+#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
 
3688
+
 
3689
+#include <stdio.h>
 
3690
+
 
3691
+using namespace ::com::sun::star;
 
3692
+
 
3693
+static accessibility::XAccessibleSelection*
 
3694
+    getSelection( AtkSelection *pSelection ) throw (uno::RuntimeException)
 
3695
+{
 
3696
+    AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pSelection );
 
3697
+    if( pWrap )
 
3698
+    {
 
3699
+        if( !pWrap->mpSelection && pWrap->mpContext )
 
3700
+        {
 
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();
 
3704
+        }
 
3705
+        
 
3706
+        return pWrap->mpSelection;
 
3707
+    }
 
3708
+    
 
3709
+    return NULL;
 
3710
+}
 
3711
+
 
3712
+extern "C" {
 
3713
+
 
3714
+static gboolean
 
3715
+selection_add_selection( AtkSelection *selection,
 
3716
+                         gint          i )
 
3717
+{
 
3718
+    try {
 
3719
+        accessibility::XAccessibleSelection* pSelection = getSelection( selection );
 
3720
+        if( pSelection )
 
3721
+        {
 
3722
+            pSelection->selectAccessibleChild( i );
 
3723
+            return TRUE;
 
3724
+        }
 
3725
+    }
 
3726
+    catch(const uno::Exception& e) {
 
3727
+        g_warning( "Exception in selectAccessibleChild()" );
 
3728
+    }
 
3729
+    
 
3730
+    return FALSE;
 
3731
+}
 
3732
+
 
3733
+static gboolean
 
3734
+selection_clear_selection( AtkSelection *selection )
 
3735
+{
 
3736
+    try {
 
3737
+        accessibility::XAccessibleSelection* pSelection = getSelection( selection );
 
3738
+        if( pSelection )
 
3739
+        {
 
3740
+            pSelection->clearAccessibleSelection();
 
3741
+            return TRUE;
 
3742
+        }
 
3743
+    }
 
3744
+    catch(const uno::Exception& e) {
 
3745
+        g_warning( "Exception in selectAccessibleChild()" );
 
3746
+    }
 
3747
+    
 
3748
+    return FALSE;
 
3749
+}
 
3750
+
 
3751
+static AtkObject*
 
3752
+selection_ref_selection( AtkSelection *selection,
 
3753
+                         gint          i )
 
3754
+{
 
3755
+    try {
 
3756
+        accessibility::XAccessibleSelection* pSelection = getSelection( selection );
 
3757
+        if( pSelection )
 
3758
+            return atk_object_wrapper_ref( pSelection->getSelectedAccessibleChild( i ) );
 
3759
+    }
 
3760
+    catch(const uno::Exception& e) {
 
3761
+        g_warning( "Exception in getSelectedAccessibleChild()" );
 
3762
+    }
 
3763
+    
 
3764
+    return NULL;
 
3765
+}
 
3766
+
 
3767
+static gint
 
3768
+selection_get_selection_count( AtkSelection   *selection)
 
3769
+{
 
3770
+    try {
 
3771
+        accessibility::XAccessibleSelection* pSelection = getSelection( selection );
 
3772
+        if( pSelection )
 
3773
+            return pSelection->getSelectedAccessibleChildCount();
 
3774
+    }
 
3775
+    catch(const uno::Exception& e) {
 
3776
+        g_warning( "Exception in getSelectedAccessibleChildCount()" );
 
3777
+    }
 
3778
+    
 
3779
+    return -1;
 
3780
+}
 
3781
+
 
3782
+static gboolean
 
3783
+selection_is_child_selected( AtkSelection   *selection,
 
3784
+                              gint           i)
 
3785
+{
 
3786
+    try {
 
3787
+        accessibility::XAccessibleSelection* pSelection = getSelection( selection );
 
3788
+        if( pSelection )
 
3789
+            return pSelection->isAccessibleChildSelected( i );
 
3790
+    }
 
3791
+    catch(const uno::Exception& e) {
 
3792
+        g_warning( "Exception in getSelectedAccessibleChildCount()" );
 
3793
+    }
 
3794
+
 
3795
+    return FALSE;
 
3796
+}
 
3797
+
 
3798
+static gboolean
 
3799
+selection_remove_selection( AtkSelection *selection,
 
3800
+                            gint           i )
 
3801
+{
 
3802
+    try {
 
3803
+        accessibility::XAccessibleSelection* pSelection = getSelection( selection );
 
3804
+        if( pSelection )
 
3805
+        {
 
3806
+            pSelection->deselectAccessibleChild( i );
 
3807
+            return TRUE;
 
3808
+        }
 
3809
+    }
 
3810
+    catch(const uno::Exception& e) {
 
3811
+        g_warning( "Exception in getSelectedAccessibleChildCount()" );
 
3812
+    }
 
3813
+    
 
3814
+    return FALSE;
 
3815
+}
 
3816
+
 
3817
+static gboolean
 
3818
+selection_select_all_selection( AtkSelection   *selection)
 
3819
+{
 
3820
+    try {
 
3821
+        accessibility::XAccessibleSelection* pSelection = getSelection( selection );
 
3822
+        if( pSelection )
 
3823
+        {
 
3824
+            pSelection->selectAllAccessibleChildren();
 
3825
+            return TRUE;
 
3826
+        }
 
3827
+    }
 
3828
+    catch(const uno::Exception& e) {
 
3829
+        g_warning( "Exception in getSelectedAccessibleChildCount()" );
 
3830
+    }
 
3831
+    
 
3832
+    return FALSE;
 
3833
+}
 
3834
+
 
3835
+} // extern "C"
 
3836
+
 
3837
+void
 
3838
+selectionIfaceInit( AtkSelectionIface *iface)
 
3839
+{
 
3840
+  g_return_if_fail (iface != NULL);
 
3841
+
 
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;
 
3849
+}
 
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
 
3856
@@ -0,0 +1,726 @@
 
3857
+/*************************************************************************
 
3858
+ *
 
3859
+ *  OpenOffice.org - a multi-platform office productivity suite
 
3860
+ *
 
3861
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
3862
+ *
 
3863
+ *  $Revision: 1.1.2.1 $
 
3864
+ *
 
3865
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
3866
+ *
 
3867
+ *  The Contents of this file are made available subject to
 
3868
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
3869
+ *
 
3870
+ *
 
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
 
3875
+ *
 
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.
 
3879
+ *
 
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.
 
3884
+ *
 
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
 
3889
+ *
 
3890
+ ************************************************************************/
 
3891
+
 
3892
+#include "atkwrapper.hxx"
 
3893
+
 
3894
+#include <com/sun/star/accessibility/XAccessibleTable.hpp>
 
3895
+
 
3896
+#ifdef ENABLE_TRACING
 
3897
+#include <stdio.h>
 
3898
+#endif
 
3899
+
 
3900
+using namespace ::com::sun::star;
 
3901
+
 
3902
+static inline AtkObject *
 
3903
+atk_object_wrapper_conditional_ref( const uno::Reference< accessibility::XAccessible >& rxAccessible )
 
3904
+{
 
3905
+#ifdef ENABLE_TRACING
 
3906
+    fprintf( stderr, ": %p\n", rxAccessible.get() );
 
3907
+#endif
 
3908
+    
 
3909
+    if( rxAccessible.is() )
 
3910
+        return atk_object_wrapper_ref( rxAccessible );
 
3911
+    
 
3912
+    return NULL;
 
3913
+}
 
3914
+
 
3915
+/*****************************************************************************/
 
3916
+
 
3917
+// FIXME
 
3918
+static G_CONST_RETURN gchar *
 
3919
+getAsConst( rtl::OUString rString )
 
3920
+{
 
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 ];
 
3927
+}
 
3928
+
 
3929
+/*****************************************************************************/
 
3930
+
 
3931
+static accessibility::XAccessibleTable*
 
3932
+    getTable( AtkTable *pTable ) throw (uno::RuntimeException)
 
3933
+{
 
3934
+    AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pTable );
 
3935
+    if( pWrap )
 
3936
+    {
 
3937
+        if( !pWrap->mpTable && pWrap->mpContext )
 
3938
+        {
 
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();
 
3942
+        }
 
3943
+        
 
3944
+        return pWrap->mpTable;
 
3945
+    }
 
3946
+    
 
3947
+    return NULL;
 
3948
+}
 
3949
+
 
3950
+/*****************************************************************************/
 
3951
+
 
3952
+extern "C" {
 
3953
+
 
3954
+static AtkObject*
 
3955
+table_wrapper_ref_at (AtkTable *table,
 
3956
+                      gint      row,
 
3957
+                      gint      column)
 
3958
+{
 
3959
+    try {
 
3960
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
3961
+        
 
3962
+#ifdef ENABLE_TRACING
 
3963
+        if( pTable )
 
3964
+            fprintf(stderr, "getAccessibleCellAt( %u, %u ) returns", row, column );
 
3965
+        
 
3966
+        if( column >= 255 )
 
3967
+            fprintf(stderr, "getAccessibleCellAt( %u, %u ) returns", row, column );
 
3968
+            
 
3969
+#endif
 
3970
+
 
3971
+        if( pTable )
 
3972
+            return atk_object_wrapper_conditional_ref( pTable->getAccessibleCellAt( row, column ) );
 
3973
+    }
 
3974
+        
 
3975
+    catch(const uno::Exception& e) {
 
3976
+        g_warning( "Exception in getAccessibleCellAt()" );
 
3977
+    }
 
3978
+
 
3979
+    return NULL;
 
3980
+}
 
3981
+
 
3982
+/*****************************************************************************/
 
3983
+
 
3984
+static gint
 
3985
+table_wrapper_get_index_at (AtkTable      *table,
 
3986
+                            gint          row,
 
3987
+                            gint          column)
 
3988
+{
 
3989
+    try {
 
3990
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
3991
+        
 
3992
+#ifdef ENABLE_TRACING
 
3993
+        if( pTable )
 
3994
+            fprintf(stderr, "getAccessibleIndex( %u, %u ) returns %u\n", 
 
3995
+                row, column, pTable->getAccessibleIndex( row, column ) );
 
3996
+#endif
 
3997
+        
 
3998
+        if( pTable )
 
3999
+            return pTable->getAccessibleIndex( row, column );
 
4000
+    }
 
4001
+    catch(const uno::Exception& e) {
 
4002
+        g_warning( "Exception in getAccessibleIndex()" );
 
4003
+    }
 
4004
+
 
4005
+    return -1;
 
4006
+}
 
4007
+
 
4008
+/*****************************************************************************/
 
4009
+
 
4010
+static gint
 
4011
+table_wrapper_get_column_at_index (AtkTable      *table,
 
4012
+                                   gint          nIndex)
 
4013
+{
 
4014
+    try {
 
4015
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4016
+        
 
4017
+#ifdef ENABLE_TRACING
 
4018
+        if( pTable )
 
4019
+            fprintf(stderr, "getAccessibleColumn( %u ) returns %u\n", 
 
4020
+                nIndex, pTable->getAccessibleColumn( nIndex ) );
 
4021
+#endif
 
4022
+        
 
4023
+        if( pTable )
 
4024
+            return pTable->getAccessibleColumn( nIndex );
 
4025
+    }
 
4026
+    catch(const uno::Exception& e) {
 
4027
+        g_warning( "Exception in getAccessibleColumn()" );
 
4028
+    }
 
4029
+
 
4030
+    return -1;
 
4031
+}
 
4032
+
 
4033
+/*****************************************************************************/
 
4034
+
 
4035
+static gint
 
4036
+table_wrapper_get_row_at_index( AtkTable *table,
 
4037
+                                gint      nIndex )
 
4038
+{
 
4039
+    try {
 
4040
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4041
+        
 
4042
+#ifdef ENABLE_TRACING
 
4043
+        if( pTable )
 
4044
+            fprintf(stderr, "getAccessibleRow( %u ) returns %u\n", 
 
4045
+                nIndex, pTable->getAccessibleRow( nIndex ) );
 
4046
+#endif
 
4047
+
 
4048
+        if( pTable )
 
4049
+            return pTable->getAccessibleRow( nIndex );
 
4050
+    }
 
4051
+    catch(const uno::Exception& e) {
 
4052
+        g_warning( "Exception in getAccessibleRow()" );
 
4053
+    }
 
4054
+
 
4055
+    return -1;
 
4056
+}
 
4057
+
 
4058
+/*****************************************************************************/
 
4059
+
 
4060
+static gint
 
4061
+table_wrapper_get_n_columns( AtkTable *table )
 
4062
+{
 
4063
+    try {
 
4064
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4065
+
 
4066
+#ifdef ENABLE_TRACING
 
4067
+        if( pTable )
 
4068
+            fprintf(stderr, "XAccessibleTable::getAccessibleColumnCount returns %u\n", 
 
4069
+                pTable->getAccessibleColumnCount() );
 
4070
+#endif
 
4071
+
 
4072
+        if( pTable )
 
4073
+            return pTable->getAccessibleColumnCount();
 
4074
+    }
 
4075
+    catch(const uno::Exception& e) {
 
4076
+        g_warning( "Exception in getAccessibleColumnCount()" );
 
4077
+    }
 
4078
+
 
4079
+    return -1;
 
4080
+}
 
4081
+
 
4082
+/*****************************************************************************/
 
4083
+
 
4084
+static gint
 
4085
+table_wrapper_get_n_rows( AtkTable *table )
 
4086
+{
 
4087
+    try {
 
4088
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4089
+        
 
4090
+#ifdef ENABLE_TRACING
 
4091
+        if( pTable )
 
4092
+            fprintf(stderr, "getAccessibleRowCount() returns %u\n", 
 
4093
+                pTable->getAccessibleRowCount() );
 
4094
+#endif
 
4095
+
 
4096
+        if( pTable )
 
4097
+            return pTable->getAccessibleRowCount();
 
4098
+    }
 
4099
+    catch(const uno::Exception& e) {
 
4100
+        g_warning( "Exception in getAccessibleRowCount()" );
 
4101
+    }
 
4102
+
 
4103
+    return -1;
 
4104
+}
 
4105
+
 
4106
+/*****************************************************************************/
 
4107
+
 
4108
+static gint
 
4109
+table_wrapper_get_column_extent_at( AtkTable *table,
 
4110
+                                    gint      row,
 
4111
+                                    gint      column )
 
4112
+{
 
4113
+    try {
 
4114
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4115
+        
 
4116
+#ifdef ENABLE_TRACING
 
4117
+        if( pTable )
 
4118
+            fprintf(stderr, "getAccessibleColumnExtentAt( %u, %u ) returns %u\n", 
 
4119
+                row, column, pTable->getAccessibleColumnExtentAt( row, column ) );
 
4120
+#endif
 
4121
+
 
4122
+        if( pTable )
 
4123
+            return pTable->getAccessibleColumnExtentAt( row, column );
 
4124
+    }
 
4125
+    catch(const uno::Exception& e) {
 
4126
+        g_warning( "Exception in getAccessibleColumnExtentAt()" );
 
4127
+    }
 
4128
+
 
4129
+    return -1;
 
4130
+}
 
4131
+
 
4132
+/*****************************************************************************/
 
4133
+
 
4134
+static gint
 
4135
+table_wrapper_get_row_extent_at( AtkTable *table,
 
4136
+                                 gint      row,
 
4137
+                                 gint      column )
 
4138
+{
 
4139
+    try {
 
4140
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4141
+        
 
4142
+#ifdef ENABLE_TRACING
 
4143
+        if( pTable )
 
4144
+            fprintf(stderr, "getAccessibleRowExtentAt( %u, %u ) returns %u\n", 
 
4145
+                row, column, pTable->getAccessibleRowExtentAt( row, column ) );
 
4146
+#endif
 
4147
+
 
4148
+        if( pTable )
 
4149
+            return pTable->getAccessibleRowExtentAt( row, column );
 
4150
+    }
 
4151
+    catch(const uno::Exception& e) {
 
4152
+        g_warning( "Exception in getAccessibleRowExtentAt()" );
 
4153
+    }
 
4154
+
 
4155
+    return -1;
 
4156
+}
 
4157
+
 
4158
+/*****************************************************************************/
 
4159
+
 
4160
+static AtkObject *
 
4161
+table_wrapper_get_caption( AtkTable *table )
 
4162
+{
 
4163
+    try {
 
4164
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4165
+        
 
4166
+#ifdef ENABLE_TRACING
 
4167
+        if( pTable )
 
4168
+            fprintf(stderr, "getAccessibleCaption() returns" );
 
4169
+#endif
 
4170
+
 
4171
+        if( pTable )
 
4172
+            return atk_object_wrapper_conditional_ref( pTable->getAccessibleCaption() );
 
4173
+    }
 
4174
+        
 
4175
+    catch(const uno::Exception& e) {
 
4176
+        g_warning( "Exception in getAccessibleCaption()" );
 
4177
+    }
 
4178
+
 
4179
+    return NULL;
 
4180
+}
 
4181
+
 
4182
+/*****************************************************************************/
 
4183
+
 
4184
+static G_CONST_RETURN gchar *
 
4185
+table_wrapper_get_row_description( AtkTable *table,
 
4186
+                                   gint      row )
 
4187
+{
 
4188
+    try {
 
4189
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4190
+
 
4191
+#ifdef ENABLE_TRACING
 
4192
+        if( pTable )
 
4193
+            fprintf(stderr, "getAccessibleRowDescription( %u ) returns %s\n", 
 
4194
+                row, getAsConst( pTable->getAccessibleRowDescription( row ) ) );
 
4195
+#endif
 
4196
+
 
4197
+        if( pTable )
 
4198
+            return getAsConst( pTable->getAccessibleRowDescription( row ) );
 
4199
+    }
 
4200
+    catch(const uno::Exception& e) {
 
4201
+        g_warning( "Exception in getAccessibleRowDescription()" );
 
4202
+    }
 
4203
+
 
4204
+    return NULL;
 
4205
+}
 
4206
+
 
4207
+/*****************************************************************************/
 
4208
+
 
4209
+static G_CONST_RETURN gchar *
 
4210
+table_wrapper_get_column_description( AtkTable *table,
 
4211
+                                      gint      column )
 
4212
+{
 
4213
+    try {
 
4214
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4215
+        
 
4216
+#ifdef ENABLE_TRACING
 
4217
+        if( pTable )
 
4218
+            fprintf(stderr, "getAccessibleColumnDescription( %u ) returns %s\n", 
 
4219
+                column, getAsConst( pTable->getAccessibleColumnDescription( column ) ) );
 
4220
+#endif
 
4221
+
 
4222
+        if( pTable )
 
4223
+            return getAsConst( pTable->getAccessibleColumnDescription( column ) );
 
4224
+    }
 
4225
+    catch(const uno::Exception& e) {
 
4226
+        g_warning( "Exception in getAccessibleColumnDescription()" );
 
4227
+    }
 
4228
+
 
4229
+    return NULL;
 
4230
+}
 
4231
+
 
4232
+/*****************************************************************************/
 
4233
+
 
4234
+static AtkObject *
 
4235
+table_wrapper_get_row_header( AtkTable *table,
 
4236
+                              gint      row )
 
4237
+{
 
4238
+    try {
 
4239
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4240
+        if( pTable )
 
4241
+        {
 
4242
+            uno::Reference< accessibility::XAccessibleTable > xRowHeaders( pTable->getAccessibleRowHeaders() );
 
4243
+
 
4244
+#ifdef ENABLE_TRACING
 
4245
+            if( xRowHeaders.is() )
 
4246
+                fprintf(stderr, "getAccessibleRowHeader( %u )->getAccessibleCellAt( 0, %u ) returns",
 
4247
+                    row, row );
 
4248
+            else
 
4249
+                fprintf(stderr, "getAccessibleRowHeader( %u ) returns %p\n", row, xRowHeaders.get() );
 
4250
+#endif
 
4251
+
 
4252
+            if( xRowHeaders.is() )
 
4253
+                return atk_object_wrapper_conditional_ref( xRowHeaders->getAccessibleCellAt( row, 0 ) );
 
4254
+        }
 
4255
+    }
 
4256
+    catch(const uno::Exception& e) {
 
4257
+        g_warning( "Exception in getAccessibleRowHeaders()" );
 
4258
+    }
 
4259
+
 
4260
+    return NULL;
 
4261
+}
 
4262
+
 
4263
+/*****************************************************************************/
 
4264
+
 
4265
+static AtkObject *
 
4266
+table_wrapper_get_column_header( AtkTable *table,
 
4267
+                                 gint      column )
 
4268
+{
 
4269
+    try {
 
4270
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4271
+        
 
4272
+        if( pTable )
 
4273
+        {
 
4274
+            uno::Reference< accessibility::XAccessibleTable > xColumnHeaders( pTable->getAccessibleColumnHeaders() );
 
4275
+
 
4276
+#ifdef ENABLE_TRACING
 
4277
+            if( xColumnHeaders.is() )
 
4278
+                fprintf(stderr, "getAccessibleColumnHeader( %u )->getAccessibleCellAt( 0, %u ) returns",
 
4279
+                    column, column );
 
4280
+            else
 
4281
+                fprintf(stderr, "getAccessibleColumnHeader( %u ) returns %p\n", column, xColumnHeaders.get() );
 
4282
+#endif
 
4283
+
 
4284
+            if( xColumnHeaders.is() )
 
4285
+                return atk_object_wrapper_conditional_ref( xColumnHeaders->getAccessibleCellAt( 0, column ) );
 
4286
+        }
 
4287
+    }
 
4288
+    catch(const uno::Exception& e) {
 
4289
+        g_warning( "Exception in getAccessibleColumnHeaders()" );
 
4290
+    }
 
4291
+
 
4292
+    return NULL;
 
4293
+}
 
4294
+
 
4295
+/*****************************************************************************/
 
4296
+
 
4297
+static AtkObject *
 
4298
+table_wrapper_get_summary( AtkTable *table )
 
4299
+{
 
4300
+    try {
 
4301
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4302
+        
 
4303
+#ifdef ENABLE_TRACING
 
4304
+        if( pTable )
 
4305
+            fprintf(stderr, "getAccessibleSummary() returns" );
 
4306
+#endif
 
4307
+
 
4308
+        if( pTable )
 
4309
+        {
 
4310
+    // FIXME: Summary ??
 
4311
+//            AtkObject* summary;
 
4312
+            return atk_object_wrapper_conditional_ref( pTable->getAccessibleSummary() );
 
4313
+        }
 
4314
+    }
 
4315
+    catch(const uno::Exception& e) {
 
4316
+        g_warning( "Exception in getAccessibleSummary()" );
 
4317
+    }
 
4318
+
 
4319
+    return NULL;
 
4320
+}
 
4321
+
 
4322
+/*****************************************************************************/
 
4323
+
 
4324
+static gint
 
4325
+convertToGIntArray( const uno::Sequence< ::sal_Int32 >& aSequence, gint **pSelected )
 
4326
+{
 
4327
+    if( aSequence.getLength() )
 
4328
+    {
 
4329
+        *pSelected = g_new( gint, aSequence.getLength() );
 
4330
+
 
4331
+        for( sal_Int32 i = 0; i < aSequence.getLength(); i++ )
 
4332
+            (*pSelected) [i] = aSequence[i];
 
4333
+    }
 
4334
+
 
4335
+    return aSequence.getLength();
 
4336
+}
 
4337
+
 
4338
+/*****************************************************************************/
 
4339
+
 
4340
+static gint
 
4341
+table_wrapper_get_selected_columns( AtkTable      *table,
 
4342
+                                    gint          **pSelected )
 
4343
+{
 
4344
+    *pSelected = NULL;
 
4345
+    try {
 
4346
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4347
+        
 
4348
+#ifdef ENABLE_TRACING
 
4349
+        if( pTable )
 
4350
+            fprintf(stderr, "getSelectedAccessibleColumns() \n" );
 
4351
+#endif
 
4352
+        
 
4353
+        if( pTable )
 
4354
+            return convertToGIntArray( pTable->getSelectedAccessibleColumns(), pSelected );
 
4355
+    }
 
4356
+    catch(const uno::Exception& e) {
 
4357
+        g_warning( "Exception in getSelectedAccessibleColumns()" );
 
4358
+    }
 
4359
+
 
4360
+    return 0;
 
4361
+}
 
4362
+
 
4363
+/*****************************************************************************/
 
4364
+
 
4365
+static gint
 
4366
+table_wrapper_get_selected_rows( AtkTable      *table,
 
4367
+                                 gint          **pSelected )
 
4368
+{
 
4369
+    *pSelected = NULL;
 
4370
+    try {
 
4371
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4372
+        
 
4373
+#ifdef ENABLE_TRACING
 
4374
+        if( pTable )
 
4375
+            fprintf(stderr, "getSelectedAccessibleRows() \n" );
 
4376
+#endif
 
4377
+        
 
4378
+        if( pTable )
 
4379
+            return convertToGIntArray( pTable->getSelectedAccessibleRows(), pSelected );
 
4380
+    }
 
4381
+    catch(const uno::Exception& e) {
 
4382
+        g_warning( "Exception in getSelectedAccessibleRows()" );
 
4383
+    }
 
4384
+
 
4385
+    return 0;
 
4386
+}
 
4387
+
 
4388
+/*****************************************************************************/
 
4389
+
 
4390
+static gboolean
 
4391
+table_wrapper_is_column_selected( AtkTable      *table,
 
4392
+                                  gint          column )
 
4393
+{
 
4394
+    try {
 
4395
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4396
+        
 
4397
+#ifdef ENABLE_TRACING
 
4398
+        if( pTable )
 
4399
+            fprintf(stderr, "isAccessibleColumnSelected( %u ) returns %s\n", 
 
4400
+                column, pTable->isAccessibleColumnSelected( column ) ? "true" : "false" );
 
4401
+#endif
 
4402
+        
 
4403
+        if( pTable )
 
4404
+            return pTable->isAccessibleColumnSelected( column );
 
4405
+    }
 
4406
+    catch(const uno::Exception& e) {
 
4407
+        g_warning( "Exception in isAccessibleColumnSelected()" );
 
4408
+    }
 
4409
+
 
4410
+    return 0;
 
4411
+}
 
4412
+
 
4413
+/*****************************************************************************/
 
4414
+
 
4415
+static gboolean
 
4416
+table_wrapper_is_row_selected( AtkTable      *table,
 
4417
+                               gint          row )
 
4418
+{
 
4419
+    try {
 
4420
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4421
+        
 
4422
+#ifdef ENABLE_TRACING
 
4423
+        if( pTable )
 
4424
+            fprintf(stderr, "isAccessibleRowSelected( %u ) returns %s\n", 
 
4425
+                row, pTable->isAccessibleRowSelected( row ) ? "true" : "false" );
 
4426
+#endif
 
4427
+        
 
4428
+        if( pTable )
 
4429
+            return pTable->isAccessibleRowSelected( row );
 
4430
+    }
 
4431
+    catch(const uno::Exception& e) {
 
4432
+        g_warning( "Exception in isAccessibleRowSelected()" );
 
4433
+    }
 
4434
+
 
4435
+    return FALSE;
 
4436
+}
 
4437
+
 
4438
+/*****************************************************************************/
 
4439
+
 
4440
+static gboolean
 
4441
+table_wrapper_is_selected( AtkTable      *table,
 
4442
+                           gint          row,
 
4443
+                           gint          column )
 
4444
+{
 
4445
+    try {
 
4446
+        accessibility::XAccessibleTable* pTable = getTable( table );
 
4447
+        
 
4448
+#ifdef ENABLE_TRACING
 
4449
+        if( pTable )
 
4450
+            fprintf(stderr, "isAccessibleSelected( %u, %u ) returns %s\n", 
 
4451
+                row, column, pTable->isAccessibleSelected( row , column ) ? "true" : "false" );
 
4452
+#endif
 
4453
+        
 
4454
+        if( pTable )
 
4455
+            return pTable->isAccessibleSelected( row, column );
 
4456
+    }
 
4457
+    catch(const uno::Exception& e) {
 
4458
+        g_warning( "Exception in isAccessibleSelected()" );
 
4459
+    }
 
4460
+
 
4461
+    return FALSE;
 
4462
+}
 
4463
+
 
4464
+/*****************************************************************************/
 
4465
+
 
4466
+static gboolean
 
4467
+table_wrapper_add_row_selection( AtkTable *, gint )
 
4468
+{
 
4469
+    g_warning( "FIXME: no simple analogue for add_row_selection" );
 
4470
+    return 0;
 
4471
+}
 
4472
+
 
4473
+/*****************************************************************************/
 
4474
+
 
4475
+static gboolean
 
4476
+table_wrapper_remove_row_selection( AtkTable *, gint )
 
4477
+{
 
4478
+    g_warning( "FIXME: no simple analogue for remove_row_selection" );
 
4479
+    return 0;
 
4480
+}
 
4481
+
 
4482
+/*****************************************************************************/
 
4483
+
 
4484
+static gboolean
 
4485
+table_wrapper_add_column_selection( AtkTable *, gint )
 
4486
+{
 
4487
+    g_warning( "FIXME: no simple analogue for add_column_selection" );
 
4488
+    return 0;
 
4489
+}
 
4490
+
 
4491
+/*****************************************************************************/
 
4492
+
 
4493
+static gboolean
 
4494
+table_wrapper_remove_column_selection( AtkTable *, gint )
 
4495
+{
 
4496
+    g_warning( "FIXME: no simple analogue for remove_column_selection" );
 
4497
+    return 0;
 
4498
+}
 
4499
+
 
4500
+/*****************************************************************************/
 
4501
+
 
4502
+static void
 
4503
+table_wrapper_set_caption( AtkTable *, AtkObject * )
 
4504
+{ // meaningless helper
 
4505
+}
 
4506
+
 
4507
+/*****************************************************************************/
 
4508
+
 
4509
+static void
 
4510
+table_wrapper_set_column_description( AtkTable *, gint, const gchar * )
 
4511
+{ // meaningless helper
 
4512
+}
 
4513
+
 
4514
+
 
4515
+/*****************************************************************************/
 
4516
+
 
4517
+static void
 
4518
+table_wrapper_set_column_header( AtkTable *, gint, AtkObject * )
 
4519
+{ // meaningless helper
 
4520
+}
 
4521
+
 
4522
+
 
4523
+/*****************************************************************************/
 
4524
+
 
4525
+static void
 
4526
+table_wrapper_set_row_description( AtkTable *, gint, const gchar * )
 
4527
+{ // meaningless helper
 
4528
+}
 
4529
+
 
4530
+/*****************************************************************************/
 
4531
+
 
4532
+static void
 
4533
+table_wrapper_set_row_header( AtkTable *, gint, AtkObject * )
 
4534
+{ // meaningless helper
 
4535
+}
 
4536
+
 
4537
+/*****************************************************************************/
 
4538
+
 
4539
+static void
 
4540
+table_wrapper_set_summary( AtkTable *, AtkObject * )
 
4541
+{ // meaningless helper
 
4542
+}
 
4543
+
 
4544
+/*****************************************************************************/
 
4545
+
 
4546
+} // extern "C"
 
4547
+
 
4548
+void
 
4549
+tableIfaceInit (AtkTableIface *iface)
 
4550
+{
 
4551
+  g_return_if_fail (iface != NULL);
 
4552
+
 
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;
 
4582
+}
 
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
 
4589
@@ -0,0 +1,549 @@
 
4590
+/*************************************************************************
 
4591
+ *
 
4592
+ *  OpenOffice.org - a multi-platform office productivity suite
 
4593
+ *
 
4594
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
4595
+ *
 
4596
+ *  $Revision: 1.1.2.1 $
 
4597
+ *
 
4598
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
4599
+ *
 
4600
+ *  The Contents of this file are made available subject to
 
4601
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
4602
+ *
 
4603
+ *
 
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
 
4608
+ *
 
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.
 
4612
+ *
 
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.
 
4617
+ *
 
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
 
4622
+ *
 
4623
+ ************************************************************************/
 
4624
+
 
4625
+#include "atkwrapper.hxx"
 
4626
+#include "atktextattributes.hxx"
 
4627
+
 
4628
+#include <com/sun/star/accessibility/AccessibleTextType.hpp>
 
4629
+#include <com/sun/star/accessibility/TextSegment.hpp>
 
4630
+#include <com/sun/star/accessibility/XAccessibleText.hpp>
 
4631
+
 
4632
+using namespace ::com::sun::star;
 
4633
+
 
4634
+static sal_Int16
 
4635
+text_type_from_boundary(AtkTextBoundary boundary_type)
 
4636
+{
 
4637
+    switch(boundary_type)
 
4638
+    {
 
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;
 
4650
+        default:
 
4651
+            return -1;
 
4652
+    }
 
4653
+}
 
4654
+
 
4655
+/*****************************************************************************/
 
4656
+
 
4657
+static gchar *
 
4658
+adjust_boundaries( accessibility::XAccessibleText* pText,
 
4659
+                   accessibility::TextSegment& rTextSegment, 
 
4660
+                   AtkTextBoundary  boundary_type, 
 
4661
+                   gint * start_offset, gint * end_offset )
 
4662
+{
 
4663
+    accessibility::TextSegment aTextSegment;
 
4664
+    rtl::OUString aString;
 
4665
+    gint start = 0, end = 0;
 
4666
+    
 
4667
+    if( rTextSegment.SegmentText.getLength() > 0 )
 
4668
+    {
 
4669
+        switch(boundary_type)
 
4670
+        {
 
4671
+        case ATK_TEXT_BOUNDARY_CHAR:
 
4672
+            start = rTextSegment.SegmentStart;
 
4673
+            end = rTextSegment.SegmentEnd;
 
4674
+            aString = rTextSegment.SegmentText;
 
4675
+            break;
 
4676
+                
 
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;
 
4681
+            
 
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;
 
4687
+            else
 
4688
+                end = pText->getCharacterCount();
 
4689
+            
 
4690
+            aString = pText->getTextRange(start, end);
 
4691
+            break;
 
4692
+                
 
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;
 
4697
+            
 
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;
 
4703
+            else
 
4704
+                start = 0;
 
4705
+            
 
4706
+            aString = pText->getTextRange(start, end);
 
4707
+            break;
 
4708
+        
 
4709
+        default:
 
4710
+            return NULL;
 
4711
+        }
 
4712
+    }
 
4713
+    
 
4714
+    *start_offset = start;
 
4715
+    *end_offset   = end;
 
4716
+    return OUStringToGChar(aString);
 
4717
+}
 
4718
+
 
4719
+/*****************************************************************************/
 
4720
+
 
4721
+static accessibility::XAccessibleText*
 
4722
+    getText( AtkText *pText ) throw (uno::RuntimeException)
 
4723
+{
 
4724
+    AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pText );
 
4725
+    if( pWrap )
 
4726
+    {
 
4727
+        if( !pWrap->mpText && pWrap->mpContext )
 
4728
+        {
 
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();
 
4732
+        }
 
4733
+        
 
4734
+        return pWrap->mpText;
 
4735
+    }
 
4736
+    
 
4737
+    return NULL;
 
4738
+}
 
4739
+
 
4740
+/*****************************************************************************/
 
4741
+
 
4742
+extern "C" {
 
4743
+
 
4744
+static gchar *
 
4745
+text_wrapper_get_text (AtkText *text,
 
4746
+                       gint     start_offset,
 
4747
+                       gint     end_offset)
 
4748
+{
 
4749
+    gchar * ret = NULL;
 
4750
+
 
4751
+    g_return_val_if_fail( end_offset > start_offset, NULL );
 
4752
+    
 
4753
+    try {
 
4754
+        accessibility::XAccessibleText* pText = getText( text );
 
4755
+        if( pText )
 
4756
+        {
 
4757
+            rtl::OString aUtf8 = rtl::OUStringToOString( pText->getText(), RTL_TEXTENCODING_UTF8 );
 
4758
+            if( -1 == end_offset )
 
4759
+                ret = g_strdup( aUtf8.getStr() );
 
4760
+            else
 
4761
+                ret = g_strndup( aUtf8.getStr() + start_offset, end_offset - start_offset );
 
4762
+        }
 
4763
+    }
 
4764
+    catch(const uno::Exception& e) {
 
4765
+        g_warning( "Exception in getText()" );
 
4766
+    }
 
4767
+    
 
4768
+    return ret;
 
4769
+}
 
4770
+
 
4771
+static gchar *
 
4772
+text_wrapper_get_text_after_offset (AtkText          *text,
 
4773
+                                    gint             offset,
 
4774
+                                    AtkTextBoundary  boundary_type,
 
4775
+                                    gint             *start_offset,
 
4776
+                                    gint             *end_offset)
 
4777
+{
 
4778
+    try {
 
4779
+        accessibility::XAccessibleText* pText = getText( text );
 
4780
+        if( pText )
 
4781
+        {
 
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);
 
4784
+        }
 
4785
+    }
 
4786
+    catch(const uno::Exception& e) {
 
4787
+        g_warning( "Exception in get_text_after_offset()" );
 
4788
+    }
 
4789
+    
 
4790
+    return NULL;
 
4791
+}
 
4792
+
 
4793
+static gchar *
 
4794
+text_wrapper_get_text_at_offset (AtkText          *text,
 
4795
+                                 gint             offset,
 
4796
+                                 AtkTextBoundary  boundary_type,
 
4797
+                                 gint             *start_offset,
 
4798
+                                 gint             *end_offset)
 
4799
+{
 
4800
+    try {
 
4801
+        accessibility::XAccessibleText* pText = getText( text );
 
4802
+        if( pText )
 
4803
+        {
 
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);
 
4806
+        }
 
4807
+    }
 
4808
+    catch(const uno::Exception& e) {
 
4809
+        g_warning( "Exception in get_text_at_offset()" );
 
4810
+    }
 
4811
+    
 
4812
+    return NULL;
 
4813
+}
 
4814
+
 
4815
+static gunichar
 
4816
+text_wrapper_get_character_at_offset (AtkText          *text,
 
4817
+                                      gint             offset)
 
4818
+{
 
4819
+    gint start, end;
 
4820
+    gunichar uc = 0;
 
4821
+    
 
4822
+    gchar * char_as_string = 
 
4823
+        text_wrapper_get_text_at_offset(text, offset, ATK_TEXT_BOUNDARY_CHAR, 
 
4824
+                                        &start, &end);
 
4825
+    if( char_as_string )
 
4826
+    {
 
4827
+        uc = g_utf8_get_char( char_as_string );
 
4828
+        g_free( char_as_string );
 
4829
+    }
 
4830
+    
 
4831
+    return uc;
 
4832
+}
 
4833
+
 
4834
+static gchar *
 
4835
+text_wrapper_get_text_before_offset (AtkText          *text,
 
4836
+                                     gint             offset,
 
4837
+                                     AtkTextBoundary  boundary_type,
 
4838
+                                     gint             *start_offset,
 
4839
+                                     gint             *end_offset)
 
4840
+{
 
4841
+    try {
 
4842
+        accessibility::XAccessibleText* pText = getText( text );
 
4843
+        if( pText )
 
4844
+        {
 
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);
 
4847
+        }
 
4848
+    }
 
4849
+    catch(const uno::Exception& e) {
 
4850
+        g_warning( "Exception in text_before_offset()" );
 
4851
+    }
 
4852
+    
 
4853
+    return NULL;
 
4854
+}
 
4855
+
 
4856
+static gint
 
4857
+text_wrapper_get_caret_offset (AtkText          *text)
 
4858
+{
 
4859
+    try {
 
4860
+        accessibility::XAccessibleText* pText = getText( text );
 
4861
+        if( pText )
 
4862
+            return pText->getCaretPosition();
 
4863
+    }
 
4864
+    catch(const uno::Exception& e) {
 
4865
+        g_warning( "Exception in getCaretPosition()" );
 
4866
+    }
 
4867
+    
 
4868
+    return -1;
 
4869
+}
 
4870
+
 
4871
+static gboolean
 
4872
+text_wrapper_set_caret_offset (AtkText *text,
 
4873
+                               gint     offset)
 
4874
+{
 
4875
+    try {
 
4876
+        accessibility::XAccessibleText* pText = getText( text );
 
4877
+        if( pText )
 
4878
+            return pText->setCaretPosition( offset );
 
4879
+    }
 
4880
+    catch(const uno::Exception& e) {
 
4881
+        g_warning( "Exception in setCaretPosition()" );
 
4882
+    }
 
4883
+    
 
4884
+    return FALSE;
 
4885
+}
 
4886
+
 
4887
+static AtkAttributeSet *
 
4888
+text_wrapper_get_run_attributes( AtkText        *text,
 
4889
+                                 gint           offset,
 
4890
+                                 gint           *start_offset,
 
4891
+                                 gint           *end_offset)
 
4892
+{
 
4893
+    AtkAttributeSet *pSet = NULL;
 
4894
+    
 
4895
+    try {
 
4896
+        accessibility::XAccessibleText* pText = getText( text );
 
4897
+        if( pText )
 
4898
+        {
 
4899
+            uno::Sequence< beans::PropertyValue > aAttributeList = 
 
4900
+                pText->getCharacterAttributes( offset, uno::Sequence< rtl::OUString > () );
 
4901
+            
 
4902
+            pSet = attribute_set_new_from_property_values( aAttributeList, beans::PropertyState_DIRECT_VALUE );
 
4903
+            
 
4904
+            accessibility::TextSegment aTextSegment = 
 
4905
+                pText->getTextAtIndex(offset, accessibility::AccessibleTextType::ATTRIBUTE_RUN);
 
4906
+            
 
4907
+            *start_offset = aTextSegment.SegmentStart;
 
4908
+            *end_offset = aTextSegment.SegmentEnd + 1; // FIXME: TESTME
 
4909
+        }
 
4910
+    }
 
4911
+    catch(const uno::Exception& e) {
 
4912
+        
 
4913
+        g_warning( "Exception in get_run_attributes()" );
 
4914
+        
 
4915
+        if( pSet )
 
4916
+        {
 
4917
+            atk_attribute_set_free( pSet );
 
4918
+            pSet = NULL;
 
4919
+        }
 
4920
+    }
 
4921
+    
 
4922
+    return pSet;
 
4923
+}
 
4924
+
 
4925
+static AtkAttributeSet *
 
4926
+text_wrapper_get_default_attributes( AtkText * )
 
4927
+{
 
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" );
 
4931
+    return NULL;
 
4932
+}
 
4933
+
 
4934
+static void
 
4935
+text_wrapper_get_character_extents( AtkText          *text,
 
4936
+                                    gint             offset,
 
4937
+                                    gint             *x,
 
4938
+                                    gint             *y,
 
4939
+                                    gint             *width,
 
4940
+                                    gint             *height,
 
4941
+                                    AtkCoordType      coords )
 
4942
+{
 
4943
+    try {
 
4944
+        accessibility::XAccessibleText* pText = getText( text );
 
4945
+        if( pText )
 
4946
+        {
 
4947
+            *x = *y = *width = *height = 0;
 
4948
+            awt::Rectangle aRect = pText->getCharacterBounds( offset );
 
4949
+            
 
4950
+            gint origin_x = 0;
 
4951
+            gint origin_y = 0;
 
4952
+            
 
4953
+            if( coords == ATK_XY_SCREEN )
 
4954
+            {
 
4955
+                g_return_if_fail( ATK_IS_COMPONENT( text ) );
 
4956
+                atk_component_get_position( ATK_COMPONENT( text ), &origin_x, &origin_y, coords);
 
4957
+            }
 
4958
+            
 
4959
+            *x = aRect.X + origin_x;
 
4960
+            *y = aRect.Y + origin_y;
 
4961
+            *width = aRect.Width;
 
4962
+            *height = aRect.Height;
 
4963
+        }
 
4964
+    }
 
4965
+    catch(const uno::Exception& e) {
 
4966
+        g_warning( "Exception in getCharacterBounds" );
 
4967
+    }
 
4968
+}
 
4969
+
 
4970
+static gint
 
4971
+text_wrapper_get_character_count (AtkText *text)
 
4972
+{
 
4973
+    try {
 
4974
+        accessibility::XAccessibleText* pText = getText( text );
 
4975
+        if( pText )
 
4976
+            return pText->getCharacterCount();
 
4977
+    }
 
4978
+    catch(const uno::Exception& e) {
 
4979
+        g_warning( "Exception in getCharacterCount" );
 
4980
+    }
 
4981
+    
 
4982
+    return 0;
 
4983
+}
 
4984
+
 
4985
+static gint
 
4986
+text_wrapper_get_offset_at_point (AtkText     *text,
 
4987
+                                  gint         x,
 
4988
+                                  gint         y,
 
4989
+                                  AtkCoordType coords)
 
4990
+{
 
4991
+    try {
 
4992
+        accessibility::XAccessibleText* pText = getText( text );
 
4993
+        if( pText )
 
4994
+        {
 
4995
+            gint origin_x = 0;
 
4996
+            gint origin_y = 0;
 
4997
+            
 
4998
+            if( coords == ATK_XY_SCREEN )
 
4999
+            {
 
5000
+                g_return_val_if_fail( ATK_IS_COMPONENT( text ), -1 );
 
5001
+                atk_component_get_position( ATK_COMPONENT( text ), &origin_x, &origin_y, coords);
 
5002
+            }
 
5003
+            
 
5004
+            return pText->getIndexAtPoint( awt::Point(x - origin_x, y - origin_y) );
 
5005
+        }
 
5006
+    }
 
5007
+    catch(const uno::Exception& e) {
 
5008
+        g_warning( "Exception in getIndexAtPoint" );
 
5009
+    }
 
5010
+    
 
5011
+    return -1;
 
5012
+}
 
5013
+
 
5014
+// FIXME: the whole series of selections API is problematic ...
 
5015
+
 
5016
+static gint
 
5017
+text_wrapper_get_n_selections (AtkText *text)
 
5018
+{
 
5019
+    try {
 
5020
+        accessibility::XAccessibleText* pText = getText( text );
 
5021
+        if( pText )
 
5022
+            return ( pText->getSelectionEnd() > pText->getSelectionStart() ) ? 1 : 0;
 
5023
+    }
 
5024
+    catch(const uno::Exception& e) {
 
5025
+        g_warning( "Exception in getSelectionEnd() or getSelectionStart()" );
 
5026
+    }
 
5027
+    
 
5028
+    return 0;
 
5029
+}
 
5030
+
 
5031
+static gchar *
 
5032
+text_wrapper_get_selection (AtkText *text,
 
5033
+                            gint     selection_num,
 
5034
+                            gint    *start_offset,
 
5035
+                            gint    *end_offset)
 
5036
+{
 
5037
+    g_return_val_if_fail( selection_num == 0, FALSE );
 
5038
+
 
5039
+    try {
 
5040
+        accessibility::XAccessibleText* pText = getText( text );
 
5041
+        if( pText )
 
5042
+        {
 
5043
+            *start_offset = pText->getSelectionStart();
 
5044
+            *end_offset   = pText->getSelectionEnd();
 
5045
+
 
5046
+            return OUStringToGChar( pText->getSelectedText() );
 
5047
+        }
 
5048
+    }
 
5049
+    catch(const uno::Exception& e) {
 
5050
+        g_warning( "Exception in getSelectionEnd(), getSelectionStart() or getSelectedText()" );
 
5051
+    }
 
5052
+    
 
5053
+    return NULL;
 
5054
+}       
 
5055
+
 
5056
+static gboolean
 
5057
+text_wrapper_add_selection (AtkText *text,
 
5058
+                            gint     start_offset,
 
5059
+                            gint     end_offset)
 
5060
+{
 
5061
+    // FIXME: can we try to be more compatible by expanding an
 
5062
+    //        existing adjacent selection ?
 
5063
+
 
5064
+    try {
 
5065
+        accessibility::XAccessibleText* pText = getText( text );
 
5066
+        if( pText )
 
5067
+            return pText->setSelection( start_offset, end_offset ); // ?
 
5068
+    }
 
5069
+    catch(const uno::Exception& e) {
 
5070
+        g_warning( "Exception in setSelection()" );
 
5071
+    }
 
5072
+    
 
5073
+    return FALSE;
 
5074
+}
 
5075
+
 
5076
+static gboolean
 
5077
+text_wrapper_remove_selection (AtkText *text,
 
5078
+                               gint     selection_num)
 
5079
+{
 
5080
+    g_return_val_if_fail( selection_num == 0, FALSE );
 
5081
+
 
5082
+    try {
 
5083
+        accessibility::XAccessibleText* pText = getText( text );
 
5084
+        if( pText )
 
5085
+            return pText->setSelection( 0, 0 ); // ?
 
5086
+    }
 
5087
+    catch(const uno::Exception& e) {
 
5088
+        g_warning( "Exception in setSelection()" );
 
5089
+    }
 
5090
+    
 
5091
+    return FALSE;
 
5092
+}
 
5093
+
 
5094
+static gboolean
 
5095
+text_wrapper_set_selection (AtkText *text,
 
5096
+                            gint     selection_num,
 
5097
+                            gint     start_offset,
 
5098
+                            gint     end_offset)
 
5099
+{
 
5100
+    g_return_val_if_fail( selection_num == 0, FALSE );
 
5101
+    
 
5102
+    try {
 
5103
+        accessibility::XAccessibleText* pText = getText( text );
 
5104
+        if( pText )
 
5105
+            return pText->setSelection( start_offset, end_offset );
 
5106
+    }
 
5107
+    catch(const uno::Exception& e) {
 
5108
+        g_warning( "Exception in setSelection()" );
 
5109
+    }
 
5110
+    
 
5111
+    return FALSE;
 
5112
+}
 
5113
+
 
5114
+} // extern "C"
 
5115
+
 
5116
+void
 
5117
+textIfaceInit (AtkTextIface *iface)
 
5118
+{
 
5119
+  g_return_if_fail (iface != NULL);
 
5120
+
 
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;
 
5138
+}
 
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
 
5145
@@ -0,0 +1,572 @@
 
5146
+/*************************************************************************
 
5147
+ *
 
5148
+ *  OpenOffice.org - a multi-platform office productivity suite
 
5149
+ *
 
5150
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
5151
+ *
 
5152
+ *  $Revision: 1.1.2.1 $
 
5153
+ *
 
5154
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
5155
+ *
 
5156
+ *  The Contents of this file are made available subject to
 
5157
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
5158
+ *
 
5159
+ *
 
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
 
5164
+ *
 
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.
 
5168
+ *
 
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.
 
5173
+ *
 
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
 
5178
+ *
 
5179
+ ************************************************************************/
 
5180
+
 
5181
+#include "atktextattributes.hxx"
 
5182
+
 
5183
+#include <com/sun/star/awt/FontSlant.hpp>
 
5184
+#include <com/sun/star/awt/FontStrikeout.hpp>
 
5185
+#include <com/sun/star/awt/FontUnderline.hpp>
 
5186
+
 
5187
+#include <com/sun/star/style/ParagraphAdjust.hpp>
 
5188
+
 
5189
+#include <svapp.hxx>
 
5190
+#include <outdev.hxx>
 
5191
+
 
5192
+#include <stdio.h>
 
5193
+#include <string.h>
 
5194
+
 
5195
+using namespace ::com::sun::star;
 
5196
+
 
5197
+typedef gchar* (* AtkTextAttrFunc)       ( const uno::Any& rAny );
 
5198
+typedef bool   (* TextPropertyValueFunc) ( uno::Any& rAny, const gchar * value );
 
5199
+
 
5200
+#define STRNCMP_PARAM( s )  s,sizeof( s )-1
 
5201
+
 
5202
+/*****************************************************************************/
 
5203
+
 
5204
+static gchar* 
 
5205
+NullString(const uno::Any&)
 
5206
+{
 
5207
+    return NULL;
 
5208
+}
 
5209
+
 
5210
+static bool 
 
5211
+InvalidValue( uno::Any&, const gchar * )
 
5212
+{
 
5213
+    return false;
 
5214
+}
 
5215
+
 
5216
+/*****************************************************************************/
 
5217
+
 
5218
+static gchar* 
 
5219
+Float2String(const uno::Any& rAny)
 
5220
+{
 
5221
+    return g_strdup_printf( "%.0f", rAny.get<float>() );
 
5222
+}
 
5223
+
 
5224
+static bool 
 
5225
+String2Float( uno::Any& rAny, const gchar * value )
 
5226
+{
 
5227
+    float fval;
 
5228
+    
 
5229
+    if( 1 != sscanf( value, "%f", &fval ) )
 
5230
+        return false;
 
5231
+    
 
5232
+    rAny = uno::makeAny( fval );
 
5233
+    return true;
 
5234
+}
 
5235
+
 
5236
+/*****************************************************************************/
 
5237
+
 
5238
+static gchar*
 
5239
+Long2String(const uno::Any& rAny)
 
5240
+{
 
5241
+    return g_strdup_printf( "%ld", rAny.get<sal_Int32>() );
 
5242
+}
 
5243
+
 
5244
+static bool 
 
5245
+String2Long( uno::Any& rAny, const gchar * value )
 
5246
+{
 
5247
+    sal_Int32 lval;
 
5248
+    
 
5249
+    if( 1 != sscanf( value, "%ld", &lval ) )
 
5250
+        return false;
 
5251
+    
 
5252
+    rAny = uno::makeAny( lval );
 
5253
+    return true;
 
5254
+}
 
5255
+
 
5256
+/*****************************************************************************/
 
5257
+
 
5258
+static gchar* 
 
5259
+Color2String(const uno::Any& rAny)
 
5260
+{
 
5261
+    sal_Int32 nColor = rAny.get<sal_Int32>();
 
5262
+    
 
5263
+    if( nColor != -1 ) // AUTOMATIC
 
5264
+    {
 
5265
+        sal_uInt8 blue  = nColor & 0xFF;
 
5266
+        sal_uInt8 green = (nColor >> 8) & 0xFF;
 
5267
+        sal_uInt8 red   = (nColor >> 16) & 0xFF;
 
5268
+        
 
5269
+        return g_strdup_printf( "%u,%u,%u", red, green, blue );
 
5270
+    }
 
5271
+    
 
5272
+    return NULL;
 
5273
+}
 
5274
+
 
5275
+static bool 
 
5276
+String2Color( uno::Any& rAny, const gchar * value )
 
5277
+{
 
5278
+    int red, green, blue;
 
5279
+    
 
5280
+    if( 3 != sscanf( value, "%d,%d,%d", &red, &green, &blue ) )
 
5281
+        return false;
 
5282
+    
 
5283
+    sal_Int32 nColor = (sal_Int32) blue | ( (sal_Int32) green << 8 ) | ( ( sal_Int32 ) red << 16 );
 
5284
+    rAny = uno::makeAny( nColor );
 
5285
+    return true;
 
5286
+}
 
5287
+
 
5288
+/*****************************************************************************/
 
5289
+
 
5290
+static gchar* 
 
5291
+FontSlant2Style(const uno::Any& rAny)
 
5292
+{            
 
5293
+    const gchar * value = NULL;
 
5294
+    
 
5295
+    switch( rAny.get<awt::FontSlant>() )
 
5296
+    {
 
5297
+        case awt::FontSlant_NONE:
 
5298
+            value = "normal";
 
5299
+            break;
 
5300
+            
 
5301
+        case awt::FontSlant_OBLIQUE:
 
5302
+            value = "oblique";
 
5303
+            break;
 
5304
+            
 
5305
+        case awt::FontSlant_ITALIC:
 
5306
+            value = "italic";
 
5307
+            break;
 
5308
+            
 
5309
+        case awt::FontSlant_REVERSE_OBLIQUE:
 
5310
+            value = "reverse oblique";
 
5311
+            break;
 
5312
+            
 
5313
+        case awt::FontSlant_REVERSE_ITALIC:
 
5314
+            value = "reverse italic";
 
5315
+            break;
 
5316
+            
 
5317
+        default:
 
5318
+            break;
 
5319
+    }
 
5320
+    
 
5321
+    if( value )
 
5322
+         return g_strdup( value );
 
5323
+    
 
5324
+    return NULL;
 
5325
+}
 
5326
+
 
5327
+static bool 
 
5328
+Style2FontSlant( uno::Any& rAny, const gchar * value )
 
5329
+{
 
5330
+    awt::FontSlant aFontSlant;
 
5331
+    
 
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;
 
5342
+    else
 
5343
+        return false;
 
5344
+    
 
5345
+    rAny = uno::makeAny( aFontSlant );
 
5346
+    return true;
 
5347
+}
 
5348
+
 
5349
+/*****************************************************************************/
 
5350
+
 
5351
+static gchar* 
 
5352
+Weight2String(const uno::Any& rAny)
 
5353
+{
 
5354
+    return g_strdup_printf( "%.0f", rAny.get<float>() * 4 );
 
5355
+}
 
5356
+
 
5357
+static bool 
 
5358
+String2Weight( uno::Any& rAny, const gchar * value )
 
5359
+{
 
5360
+    float weight;
 
5361
+    
 
5362
+    if( 1 != sscanf( value, "%f", &weight ) )
 
5363
+        return false;
 
5364
+    
 
5365
+    rAny = uno::makeAny( weight / 4 );
 
5366
+    return true;
 
5367
+}
 
5368
+
 
5369
+
 
5370
+/*****************************************************************************/
 
5371
+
 
5372
+static gchar* 
 
5373
+Adjust2Justification(const uno::Any& rAny)
 
5374
+{
 
5375
+    const gchar * value = NULL;
 
5376
+    
 
5377
+    switch( rAny.get<short>() )
 
5378
+    {
 
5379
+        case style::ParagraphAdjust_LEFT:
 
5380
+            value = "left";
 
5381
+            break;
 
5382
+        
 
5383
+        case style::ParagraphAdjust_RIGHT:
 
5384
+            value = "right";
 
5385
+            break;
 
5386
+            
 
5387
+        case style::ParagraphAdjust_BLOCK:
 
5388
+        case style::ParagraphAdjust_STRETCH:
 
5389
+            value = "fill";
 
5390
+            break;
 
5391
+            
 
5392
+        case style::ParagraphAdjust_CENTER:
 
5393
+            value = "center";
 
5394
+            break;
 
5395
+            
 
5396
+        default:
 
5397
+            break;
 
5398
+    }
 
5399
+    
 
5400
+    if( value )
 
5401
+        return g_strdup( value );
 
5402
+    
 
5403
+    return NULL;
 
5404
+}
 
5405
+
 
5406
+static bool 
 
5407
+Justification2Adjust( uno::Any& rAny, const gchar * value )
 
5408
+{
 
5409
+    short nParagraphAdjust;
 
5410
+    
 
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;
 
5419
+    else
 
5420
+        return false;
 
5421
+    
 
5422
+    rAny = uno::makeAny( nParagraphAdjust );
 
5423
+    return true;
 
5424
+}
 
5425
+
 
5426
+/*****************************************************************************/
 
5427
+
 
5428
+static gchar* 
 
5429
+Strikeout2String(const uno::Any& rAny)
 
5430
+{
 
5431
+    sal_Int16 nStrikeout = rAny.get<sal_Int16>();
 
5432
+    
 
5433
+    if( nStrikeout != 3 ) // DONTKNOW
 
5434
+        return g_strdup( nStrikeout ? "true" : "false" );
 
5435
+    
 
5436
+    return NULL;
 
5437
+}
 
5438
+
 
5439
+static bool 
 
5440
+String2Strikeout( uno::Any& rAny, const gchar * value )
 
5441
+{
 
5442
+    sal_Int16 nStrikeout;
 
5443
+    
 
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;
 
5448
+    else
 
5449
+        return false;
 
5450
+    
 
5451
+    rAny = uno::makeAny( nStrikeout );
 
5452
+    return true;
 
5453
+}
 
5454
+
 
5455
+/*****************************************************************************/
 
5456
+
 
5457
+static gchar* 
 
5458
+Underline2String(const uno::Any& rAny)
 
5459
+{
 
5460
+    const gchar * value = NULL;
 
5461
+    
 
5462
+    switch( rAny.get<short>() )
 
5463
+    {
 
5464
+        case awt::FontUnderline::NONE:
 
5465
+            value = "none";
 
5466
+            break;
 
5467
+
 
5468
+        case awt::FontUnderline::SINGLE:
 
5469
+            value = "single";
 
5470
+            break;
 
5471
+                    
 
5472
+        case awt::FontUnderline::DOUBLE:
 
5473
+            value = "double";
 
5474
+            break;
 
5475
+                    
 
5476
+        default:
 
5477
+            break;
 
5478
+    }
 
5479
+    
 
5480
+    if( value )
 
5481
+        return g_strdup( value );
 
5482
+    
 
5483
+    return NULL;
 
5484
+}
 
5485
+
 
5486
+static bool 
 
5487
+String2Underline( uno::Any& rAny, const gchar * value )
 
5488
+{
 
5489
+    short nUnderline;
 
5490
+    
 
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;
 
5497
+    else
 
5498
+        return false;
 
5499
+    
 
5500
+    rAny = uno::makeAny( nUnderline );
 
5501
+    return true;
 
5502
+}
 
5503
+
 
5504
+/*****************************************************************************/
 
5505
+
 
5506
+static inline Size
 
5507
+LogicToPixel( long margin_x, long margin_y )
 
5508
+{
 
5509
+    OutputDevice * pOutputDevice = Application::GetDefaultDevice();
 
5510
+    return pOutputDevice->LogicToPixel( Size( margin_x, margin_y ), MapMode( MAP_100TH_MM ) );
 
5511
+}
 
5512
+
 
5513
+static inline Size
 
5514
+PixelToLogic( long margin_x, long margin_y )
 
5515
+{
 
5516
+    OutputDevice * pOutputDevice = Application::GetDefaultDevice();
 
5517
+    return pOutputDevice->PixelToLogic( Size( margin_x, margin_y ), MapMode( MAP_100TH_MM ) );
 
5518
+}
 
5519
+
 
5520
+static gchar* 
 
5521
+MarginHeight2Pixel(const uno::Any& rAny)
 
5522
+{
 
5523
+    Size aMargin = LogicToPixel( 0, rAny.get<sal_Int32>() );
 
5524
+    return g_strdup_printf( "%ld",  aMargin.getHeight() );
 
5525
+}
 
5526
+
 
5527
+static bool 
 
5528
+Pixel2MarginHeight( uno::Any& rAny, const gchar * value )
 
5529
+{
 
5530
+    sal_Int32 nHeight;
 
5531
+    
 
5532
+    if( 1 != sscanf( value, "%ld", &nHeight ) )
 
5533
+        return false;
 
5534
+    
 
5535
+    Size aMargin = PixelToLogic( 0, nHeight );
 
5536
+    rAny = uno::makeAny( (sal_Int32) aMargin.getHeight() );
 
5537
+    return true;
 
5538
+}
 
5539
+
 
5540
+static gchar* 
 
5541
+MarginWidth2Pixel(const uno::Any& rAny)
 
5542
+{
 
5543
+    Size aMargin = LogicToPixel( rAny.get<sal_Int32>(), 0 );
 
5544
+    return g_strdup_printf( "%ld",  aMargin.getWidth() );
 
5545
+}
 
5546
+
 
5547
+static bool 
 
5548
+Pixel2MarginWidth( uno::Any& rAny, const gchar * value )
 
5549
+{
 
5550
+    sal_Int32 nWidth;
 
5551
+    
 
5552
+    if( 1 != sscanf( value, "%ld", &nWidth ) )
 
5553
+        return false;
 
5554
+    
 
5555
+    Size aMargin = PixelToLogic( nWidth, 0 );
 
5556
+    rAny = uno::makeAny( (sal_Int32) aMargin.getWidth() );
 
5557
+    return true;
 
5558
+}
 
5559
+
 
5560
+/*****************************************************************************/
 
5561
+
 
5562
+struct AtkTextAttrMapping
 
5563
+{
 
5564
+    const char *          name;
 
5565
+    AtkTextAttrFunc       toAtkTextAttr;
 
5566
+    TextPropertyValueFunc toPropertyValue;
 
5567
+};
 
5568
+
 
5569
+const AtkTextAttrMapping g_TextAttrMap[] =
 
5570
+{
 
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
 
5599
+};
 
5600
+
 
5601
+//
 
5602
+//        FIXME !!
 
5603
+//        "ParaLineSpacing" => ATK_TEXT_ATTR_PIXELS_INSIDE_WRAP ?
 
5604
+
 
5605
+static const sal_Int32 g_TextAttrMapSize = sizeof( g_TextAttrMap ) / sizeof( AtkTextAttrMapping );
 
5606
+
 
5607
+/*****************************************************************************/
 
5608
+
 
5609
+static AtkAttributeSet*
 
5610
+attribute_set_prepend( AtkAttributeSet* attribute_set, 
 
5611
+                       AtkTextAttribute attribute,
 
5612
+                       gchar * value )
 
5613
+{
 
5614
+    AtkAttribute *at = (AtkAttribute *) g_malloc( sizeof (AtkAttribute) );
 
5615
+    at->name  = g_strdup( atk_text_attribute_get_name( attribute ) );
 
5616
+    at->value = value;
 
5617
+    
 
5618
+    return g_slist_prepend(attribute_set, at);
 
5619
+}
 
5620
+
 
5621
+/*****************************************************************************/
 
5622
+
 
5623
+AtkAttributeSet* 
 
5624
+attribute_set_new_from_property_values( 
 
5625
+    const uno::Sequence< beans::PropertyValue >& rAttributeList,
 
5626
+    const beans::PropertyState ePropertyState )
 
5627
+{
 
5628
+    AtkAttributeSet* attribute_set = NULL;
 
5629
+    
 
5630
+    for( sal_Int32 i = 0; i < rAttributeList.getLength(); i++ )
 
5631
+    {
 
5632
+        if( rAttributeList[i].State != ePropertyState )
 
5633
+            continue;
 
5634
+        
 
5635
+        gint j = 0;
 
5636
+        for( ; j < g_TextAttrMapSize; ++j )
 
5637
+        {
 
5638
+            if( 0 == rAttributeList[i].Name.compareToAscii( g_TextAttrMap[j].name ) )
 
5639
+            {
 
5640
+                gchar * value = g_TextAttrMap[j].toAtkTextAttr(rAttributeList[i].Value);
 
5641
+                if( value )
 
5642
+                    attribute_set = attribute_set_prepend( attribute_set, static_cast < AtkTextAttribute > (j), value );
 
5643
+                
 
5644
+                break;
 
5645
+            }
 
5646
+        }
 
5647
+
 
5648
+/*
 
5649
+        if( j == g_TextAttrMapSize )
 
5650
+        {
 
5651
+            const char * state = "unknown";
 
5652
+            switch( rAttributeList[i].State )
 
5653
+            {
 
5654
+                case beans::PropertyState_DIRECT_VALUE:
 
5655
+                    state = "direct value";
 
5656
+                    break;
 
5657
+                    
 
5658
+                case beans::PropertyState_DEFAULT_VALUE:
 
5659
+                    state = "default value";
 
5660
+                    break;
 
5661
+                    
 
5662
+                case beans::PropertyState_AMBIGUOUS_VALUE:
 
5663
+                    state = "ambigues value";
 
5664
+                    break;
 
5665
+                    
 
5666
+                default:
 
5667
+                    break;
 
5668
+            }
 
5669
+            
 
5670
+            fprintf(stderr, "Property %s (%s)\n", OUStringToOString( rAttributeList[i].Name, RTL_TEXTENCODING_UTF8 ).getStr(), state);
 
5671
+        }
 
5672
+*/
 
5673
+    }
 
5674
+    
 
5675
+    return attribute_set;
 
5676
+}
 
5677
+
 
5678
+/*****************************************************************************/
 
5679
+
 
5680
+bool
 
5681
+attribute_set_map_to_property_values(
 
5682
+    AtkAttributeSet* attribute_set, 
 
5683
+    uno::Sequence< beans::PropertyValue >& rValueList )
 
5684
+{
 
5685
+    // Ensure enough space ..
 
5686
+    uno::Sequence< beans::PropertyValue > aAttributeList (g_TextAttrMapSize);
 
5687
+
 
5688
+    sal_Int32 nIndex = 0;
 
5689
+    for( GSList * item = attribute_set; item != NULL; item = g_slist_next( item ) )
 
5690
+    {
 
5691
+        AtkAttribute* attribute = (AtkAttribute *) item;
 
5692
+        
 
5693
+        AtkTextAttribute text_attr = atk_text_attribute_for_name( attribute->name );
 
5694
+        if( text_attr < g_TextAttrMapSize )
 
5695
+        {
 
5696
+            if( g_TextAttrMap[text_attr].name[0] != '\0' )
 
5697
+            {
 
5698
+                if( ! g_TextAttrMap[text_attr].toPropertyValue( aAttributeList[nIndex].Value, attribute->value) )
 
5699
+                    return false;
 
5700
+                
 
5701
+                aAttributeList[nIndex].Name = rtl::OUString::createFromAscii( g_TextAttrMap[text_attr].name );
 
5702
+                aAttributeList[nIndex].State = beans::PropertyState_DIRECT_VALUE;
 
5703
+                ++nIndex;
 
5704
+            }
 
5705
+        }
 
5706
+        else
 
5707
+        {
 
5708
+            // Unsupported text attribute
 
5709
+            return false;
 
5710
+        }
 
5711
+    }
 
5712
+
 
5713
+    aAttributeList.realloc( nIndex );
 
5714
+    rValueList = aAttributeList;
 
5715
+    return true;
 
5716
+}
 
5717
+
 
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
 
5724
@@ -0,0 +1,60 @@
 
5725
+/*************************************************************************
 
5726
+ *
 
5727
+ *  OpenOffice.org - a multi-platform office productivity suite
 
5728
+ *
 
5729
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
5730
+ *
 
5731
+ *  $Revision: 1.1.2.1 $
 
5732
+ *
 
5733
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
5734
+ *
 
5735
+ *  The Contents of this file are made available subject to
 
5736
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
5737
+ *
 
5738
+ *
 
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
 
5743
+ *
 
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.
 
5747
+ *
 
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.
 
5752
+ *
 
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
 
5757
+ *
 
5758
+ ************************************************************************/
 
5759
+
 
5760
+#ifndef __ATK_ATKTEXTATTRIBUTES_HXX__
 
5761
+#define __ATK_ATKTEXTATTRIBUTES_HXX__
 
5762
+
 
5763
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
 
5764
+#include <com/sun/star/uno/Sequence.hxx>
 
5765
+#endif
 
5766
+
 
5767
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
 
5768
+#include <com/sun/star/beans/PropertyValue.hpp>
 
5769
+#endif
 
5770
+
 
5771
+#include <atk/atk.h>
 
5772
+
 
5773
+AtkAttributeSet* 
 
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 );
 
5777
+
 
5778
+bool
 
5779
+attribute_set_map_to_property_values( 
 
5780
+    AtkAttributeSet* attribute_set, 
 
5781
+    com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rValueList );
 
5782
+
 
5783
+
 
5784
+#endif
 
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
 
5791
@@ -0,0 +1,626 @@
 
5792
+/*************************************************************************
 
5793
+ *
 
5794
+ *  OpenOffice.org - a multi-platform office productivity suite
 
5795
+ *
 
5796
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
5797
+ *
 
5798
+ *  $Revision: 1.1.2.1 $
 
5799
+ *
 
5800
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
5801
+ *
 
5802
+ *  The Contents of this file are made available subject to
 
5803
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
5804
+ *
 
5805
+ *
 
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
 
5810
+ *
 
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.
 
5814
+ *
 
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.
 
5819
+ *
 
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
 
5824
+ *
 
5825
+ ************************************************************************/
 
5826
+
 
5827
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLECONTEXT_HPP_
 
5828
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
 
5829
+#endif
 
5830
+
 
5831
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEEVENTBROADCASTER_HPP_
 
5832
+#include <com/sun/star/accessibility/XAccessibleEventBroadcaster.hpp>
 
5833
+#endif
 
5834
+
 
5835
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESELECTION_HPP_
 
5836
+#include <com/sun/star/accessibility/XAccessibleSelection.hpp>
 
5837
+#endif
 
5838
+
 
5839
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEEVENTID_HPP_
 
5840
+#include <com/sun/star/accessibility/AccessibleEventId.hpp>
 
5841
+#endif
 
5842
+
 
5843
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLESTATETYPE_HPP_
 
5844
+#include <com/sun/star/accessibility/AccessibleStateType.hpp>
 
5845
+#endif
 
5846
+
 
5847
+#ifndef _CPPUHELPER_IMPLBASE1_HXX_
 
5848
+#include <cppuhelper/implbase1.hxx>
 
5849
+#endif
 
5850
+
 
5851
+#ifndef _VOS_MUTEX_HXX_
 
5852
+#include <vos/mutex.hxx>
 
5853
+#endif
 
5854
+
 
5855
+#ifndef _RTL_REF_HXX_
 
5856
+#include <rtl/ref.hxx>
 
5857
+#endif
 
5858
+
 
5859
+#ifndef _SV_SVAPP_HXX
 
5860
+#include "svapp.hxx"
 
5861
+#endif
 
5862
+
 
5863
+#include <window.hxx>
 
5864
+#include <menu.hxx>
 
5865
+
 
5866
+#include "atkwrapper.hxx"
 
5867
+#include "atkutil.hxx"
 
5868
+
 
5869
+#include <set>
 
5870
+#include <stdio.h>
 
5871
+
 
5872
+using namespace ::com::sun::star;
 
5873
+
 
5874
+static AtkObject *last_focused_object = NULL;
 
5875
+
 
5876
+/*****************************************************************************/
 
5877
+
 
5878
+extern "C" {
 
5879
+
 
5880
+static gint
 
5881
+atk_wrapper_focus_idle_handler (gpointer data)
 
5882
+{
 
5883
+    vos::OGuard aGuard( Application::GetSolarMutex() );
 
5884
+    
 
5885
+    if( data == last_focused_object )
 
5886
+        atk_focus_tracker_notify( ATK_OBJECT( data ) );
 
5887
+    
 
5888
+    if( data )
 
5889
+        g_object_unref( G_OBJECT(data) );
 
5890
+
 
5891
+    return FALSE;
 
5892
+}
 
5893
+
 
5894
+} // extern "C"
 
5895
+
 
5896
+/*****************************************************************************/
 
5897
+
 
5898
+static void                   
 
5899
+atk_wrapper_focus_tracker_notify_when_idle( const uno::Reference< accessibility::XAccessible > &rAccessible )
 
5900
+{
 
5901
+    AtkObject *accessible = NULL;
 
5902
+    
 
5903
+    if( rAccessible.is() )
 
5904
+        accessible = atk_object_wrapper_ref( rAccessible );
 
5905
+    
 
5906
+    last_focused_object = accessible;
 
5907
+    g_idle_add (atk_wrapper_focus_idle_handler, accessible);
 
5908
+}
 
5909
+
 
5910
+/*****************************************************************************/
 
5911
+
 
5912
+class DocumentFocusListener :  
 
5913
+    public ::cppu::WeakImplHelper1< accessibility::XAccessibleEventListener >
 
5914
+{
 
5915
+    
 
5916
+    std::set< uno::Reference< uno::XInterface > > m_aRefList;
 
5917
+    
 
5918
+public:
 
5919
+    void attachRecursive(
 
5920
+        const uno::Reference< accessibility::XAccessible >& xAccessible
 
5921
+    ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException);
 
5922
+    
 
5923
+    void attachRecursive(
 
5924
+        const uno::Reference< accessibility::XAccessible >& xAccessible,
 
5925
+        const uno::Reference< accessibility::XAccessibleContext >& xContext
 
5926
+    ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException);
 
5927
+
 
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);
 
5933
+
 
5934
+    void detachRecursive(
 
5935
+        const uno::Reference< accessibility::XAccessible >& xAccessible
 
5936
+    ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException);
 
5937
+    
 
5938
+    void detachRecursive(
 
5939
+        const uno::Reference< accessibility::XAccessible >& xAccessible,
 
5940
+        const uno::Reference< accessibility::XAccessibleContext >& xContext
 
5941
+    ) throw (lang::IndexOutOfBoundsException, uno::RuntimeException);
 
5942
+
 
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);
 
5948
+
 
5949
+    static uno::Reference< accessibility::XAccessible > getAccessible(const lang::EventObject& aEvent )
 
5950
+        throw (lang::IndexOutOfBoundsException, uno::RuntimeException);
 
5951
+    
 
5952
+    // XEventListener
 
5953
+    virtual void disposing( const lang::EventObject& Source ) throw (uno::RuntimeException);
 
5954
+
 
5955
+    // XAccessibleEventListener
 
5956
+    virtual void notifyEvent( const accessibility::AccessibleEventObject& aEvent ) throw( uno::RuntimeException );
 
5957
+};
 
5958
+
 
5959
+/*****************************************************************************/
 
5960
+
 
5961
+void DocumentFocusListener::disposing( const lang::EventObject& aEvent ) 
 
5962
+    throw (uno::RuntimeException)
 
5963
+{
 
5964
+//    fprintf(stderr, "In DocumentFocusListener::disposing (%p)\n", this);
 
5965
+//    fprintf(stderr, "m_aRefList has %d entries\n", m_aRefList.size());
 
5966
+    
 
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);
 
5971
+    
 
5972
+//    fprintf(stderr, "m_aRefList has %d entries\n", m_aRefList.size());
 
5973
+
 
5974
+}
 
5975
+
 
5976
+/*****************************************************************************/
 
5977
+
 
5978
+void DocumentFocusListener::notifyEvent( const accessibility::AccessibleEventObject& aEvent ) 
 
5979
+    throw( uno::RuntimeException )
 
5980
+{
 
5981
+    switch( aEvent.EventId )
 
5982
+    {
 
5983
+        case accessibility::AccessibleEventId::STATE_CHANGED:
 
5984
+            try 
 
5985
+            {
 
5986
+                sal_Int16 nState = accessibility::AccessibleStateType::INVALID;
 
5987
+                aEvent.NewValue >>= nState;
 
5988
+            
 
5989
+                if( accessibility::AccessibleStateType::FOCUSED == nState )
 
5990
+                    atk_wrapper_focus_tracker_notify_when_idle( getAccessible(aEvent) );
 
5991
+            }
 
5992
+            catch(lang::IndexOutOfBoundsException e)
 
5993
+            {
 
5994
+                g_warning("Focused object has invalid index in parent");
 
5995
+            }
 
5996
+            break;
 
5997
+            
 
5998
+        case accessibility::AccessibleEventId::CHILD:
 
5999
+        {
 
6000
+            uno::Reference< accessibility::XAccessible > xChild;
 
6001
+            if( (aEvent.OldValue >>= xChild) && xChild.is() )
 
6002
+                detachRecursive(xChild);
 
6003
+            
 
6004
+            if( (aEvent.NewValue >>= xChild) && xChild.is() )
 
6005
+                attachRecursive(xChild);
 
6006
+        }
 
6007
+            break;
 
6008
+            
 
6009
+        case accessibility::AccessibleEventId::INVALIDATE_ALL_CHILDREN:
 
6010
+/*        {
 
6011
+            uno::Reference< accessibility::XAccessible > xAccessible( getAccessible(aEvent) );
 
6012
+            detachRecursive(xAccessible);
 
6013
+            attachRecursive(xAccessible);
 
6014
+        }
 
6015
+*/
 
6016
+            fprintf(stderr, "Invalidate all children called\n" );
 
6017
+            break;
 
6018
+        default:
 
6019
+            break;
 
6020
+    }
 
6021
+}
 
6022
+
 
6023
+/*****************************************************************************/
 
6024
+
 
6025
+uno::Reference< accessibility::XAccessible > DocumentFocusListener::getAccessible(const lang::EventObject& aEvent )
 
6026
+    throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
 
6027
+{
 
6028
+    uno::Reference< accessibility::XAccessible > xAccessible(aEvent.Source, uno::UNO_QUERY);
 
6029
+    
 
6030
+    if( xAccessible.is() )
 
6031
+        return xAccessible;
 
6032
+    
 
6033
+    uno::Reference< accessibility::XAccessibleContext > xContext(aEvent.Source, uno::UNO_QUERY);
 
6034
+
 
6035
+    if( xContext.is() )
 
6036
+    {
 
6037
+        uno::Reference< accessibility::XAccessible > xParent( xContext->getAccessibleParent() );
 
6038
+        if( xParent.is() )
 
6039
+        {
 
6040
+            uno::Reference< accessibility::XAccessibleContext > xParentContext( xParent->getAccessibleContext() );
 
6041
+            if( xParentContext.is() )
 
6042
+            {
 
6043
+                return xParentContext->getAccessibleChild( xContext->getAccessibleIndexInParent() );
 
6044
+            }
 
6045
+        }
 
6046
+    }
 
6047
+    
 
6048
+    return uno::Reference< accessibility::XAccessible >();
 
6049
+}
 
6050
+
 
6051
+/*****************************************************************************/
 
6052
+
 
6053
+void DocumentFocusListener::attachRecursive(
 
6054
+    const uno::Reference< accessibility::XAccessible >& xAccessible 
 
6055
+) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
 
6056
+{
 
6057
+    uno::Reference< accessibility::XAccessibleContext > xContext =
 
6058
+        xAccessible->getAccessibleContext();
 
6059
+
 
6060
+    if( xContext.is() )
 
6061
+        attachRecursive(xAccessible, xContext);
 
6062
+}
 
6063
+
 
6064
+/*****************************************************************************/
 
6065
+
 
6066
+void DocumentFocusListener::attachRecursive(
 
6067
+    const uno::Reference< accessibility::XAccessible >& xAccessible, 
 
6068
+    const uno::Reference< accessibility::XAccessibleContext >& xContext 
 
6069
+)  throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
 
6070
+{
 
6071
+    uno::Reference< accessibility::XAccessibleStateSet > xStateSet =
 
6072
+        xContext->getAccessibleStateSet();
 
6073
+
 
6074
+    if( xStateSet.is() )
 
6075
+        attachRecursive(xAccessible, xContext, xStateSet);
 
6076
+}
 
6077
+
 
6078
+/*****************************************************************************/
 
6079
+
 
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)
 
6085
+{
 
6086
+    if( xStateSet->contains(accessibility::AccessibleStateType::FOCUSED ) )
 
6087
+        atk_wrapper_focus_tracker_notify_when_idle( xAccessible );       
 
6088
+
 
6089
+    uno::Reference< accessibility::XAccessibleEventBroadcaster > xBroadcaster =
 
6090
+        uno::Reference< accessibility::XAccessibleEventBroadcaster >(xContext, uno::UNO_QUERY);
 
6091
+
 
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));
 
6095
+
 
6096
+    if( ! xStateSet->contains(accessibility::AccessibleStateType::MANAGES_DESCENDANTS ) )
 
6097
+    {
 
6098
+        sal_Int32 n, nmax = xContext->getAccessibleChildCount();
 
6099
+        for( n = 0; n < nmax; n++ )
 
6100
+        {
 
6101
+            uno::Reference< accessibility::XAccessible > xChild( xContext->getAccessibleChild( n ) );
 
6102
+            
 
6103
+            if( xChild.is() )
 
6104
+                attachRecursive(xChild);
 
6105
+        }
 
6106
+    }
 
6107
+}
 
6108
+
 
6109
+/*****************************************************************************/
 
6110
+
 
6111
+void DocumentFocusListener::detachRecursive(
 
6112
+    const uno::Reference< accessibility::XAccessible >& xAccessible 
 
6113
+) throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
 
6114
+{
 
6115
+    uno::Reference< accessibility::XAccessibleContext > xContext =
 
6116
+        xAccessible->getAccessibleContext();
 
6117
+
 
6118
+    if( xContext.is() )
 
6119
+        detachRecursive(xAccessible, xContext);
 
6120
+}
 
6121
+
 
6122
+/*****************************************************************************/
 
6123
+
 
6124
+void DocumentFocusListener::detachRecursive(
 
6125
+    const uno::Reference< accessibility::XAccessible >& xAccessible, 
 
6126
+    const uno::Reference< accessibility::XAccessibleContext >& xContext 
 
6127
+)  throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
 
6128
+{
 
6129
+    uno::Reference< accessibility::XAccessibleStateSet > xStateSet =
 
6130
+        xContext->getAccessibleStateSet();
 
6131
+
 
6132
+    if( xStateSet.is() )
 
6133
+        detachRecursive(xAccessible, xContext, xStateSet);
 
6134
+}
 
6135
+
 
6136
+/*****************************************************************************/
 
6137
+
 
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)
 
6143
+{
 
6144
+    if( ! xStateSet->contains(accessibility::AccessibleStateType::MANAGES_DESCENDANTS ) )
 
6145
+    {
 
6146
+        sal_Int32 n, nmax = xContext->getAccessibleChildCount();
 
6147
+        for( n = 0; n < nmax; n++ )
 
6148
+        {
 
6149
+            uno::Reference< accessibility::XAccessible > xChild( xContext->getAccessibleChild( n ) );
 
6150
+            
 
6151
+            if( xChild.is() )
 
6152
+                detachRecursive(xChild);
 
6153
+        }
 
6154
+    }
 
6155
+
 
6156
+    uno::Reference< accessibility::XAccessibleEventBroadcaster > xBroadcaster =
 
6157
+        uno::Reference< accessibility::XAccessibleEventBroadcaster >(xContext, uno::UNO_QUERY);
 
6158
+
 
6159
+    if( xBroadcaster.is() && 0 < m_aRefList.erase(xBroadcaster) )
 
6160
+        xBroadcaster->removeEventListener(static_cast< accessibility::XAccessibleEventListener *>(this));
 
6161
+}
 
6162
+
 
6163
+/*****************************************************************************/
 
6164
+
 
6165
+/*
 
6166
+ * page tabs in gtk are widgets, so we need to simulate focus events for those
 
6167
+ */
 
6168
+
 
6169
+static void handle_tabpage_activated(Window *pWindow)
 
6170
+{
 
6171
+    uno::Reference< accessibility::XAccessible > xAccessible = 
 
6172
+        pWindow->GetAccessible();
 
6173
+    
 
6174
+    if( ! xAccessible.is() )
 
6175
+        return;
 
6176
+    
 
6177
+    uno::Reference< accessibility::XAccessibleSelection > xSelection(
 
6178
+        xAccessible->getAccessibleContext(), uno::UNO_QUERY);
 
6179
+        
 
6180
+    if( xSelection.is() )
 
6181
+        atk_wrapper_focus_tracker_notify_when_idle( xSelection->getSelectedAccessibleChild(0) );
 
6182
+}
 
6183
+
 
6184
+/*****************************************************************************/
 
6185
+
 
6186
+static std::set< Window * > g_aWindowList;
 
6187
+
 
6188
+static void handle_get_focus(::VclWindowEvent const * pEvent)
 
6189
+{
 
6190
+    static rtl::Reference< DocumentFocusListener > aDocumentFocusListener = 
 
6191
+        new DocumentFocusListener();
 
6192
+    
 
6193
+    Window *pWindow = pEvent->GetWindow();
 
6194
+    
 
6195
+    // The menu bar is handled through VCLEVENT_MENU_HIGHLIGHTED
 
6196
+    if( ! pWindow || !pWindow->IsVisible() || pWindow->GetType() == WINDOW_MENUBARWINDOW )
 
6197
+        return;
 
6198
+    
 
6199
+    if( pWindow->GetType() == WINDOW_TABCONTROL )
 
6200
+    {
 
6201
+        handle_tabpage_activated( pWindow );
 
6202
+        return;
 
6203
+    }
 
6204
+    
 
6205
+    uno::Reference< accessibility::XAccessible > xAccessible = 
 
6206
+        pWindow->GetAccessible();
 
6207
+    
 
6208
+    if( ! xAccessible.is() )
 
6209
+        return;
 
6210
+    
 
6211
+    uno::Reference< accessibility::XAccessibleContext > xContext = 
 
6212
+        xAccessible->getAccessibleContext();
 
6213
+        
 
6214
+    if( ! xContext.is() )
 
6215
+        return;
 
6216
+    
 
6217
+    uno::Reference< accessibility::XAccessibleStateSet > xStateSet = 
 
6218
+        xContext->getAccessibleStateSet();
 
6219
+        
 
6220
+    if( ! xStateSet.is() )
 
6221
+        return;
 
6222
+    
 
6223
+    if( xStateSet->contains(accessibility::AccessibleStateType::FOCUSED) &&
 
6224
+        ( pWindow->GetType() != WINDOW_TREELISTBOX ) )
 
6225
+    {
 
6226
+        atk_wrapper_focus_tracker_notify_when_idle( xAccessible );
 
6227
+    }
 
6228
+    else
 
6229
+    {
 
6230
+        if( g_aWindowList.find(pWindow) == g_aWindowList.end() )
 
6231
+        {
 
6232
+            g_aWindowList.insert(pWindow);
 
6233
+            aDocumentFocusListener->attachRecursive(xAccessible, xContext, xStateSet);
 
6234
+        }
 
6235
+    }
 
6236
+}
 
6237
+
 
6238
+/*****************************************************************************/
 
6239
+
 
6240
+static void handle_menu_highlighted(::VclMenuEvent const * pEvent)
 
6241
+{
 
6242
+    try
 
6243
+    {
 
6244
+        Menu* pMenu = pEvent->GetMenu();
 
6245
+        USHORT nPos = pEvent->GetItemPos();
 
6246
+
 
6247
+        if( pMenu &&  nPos != 0xFFFF)
 
6248
+        {
 
6249
+            uno::Reference< accessibility::XAccessible > xAccessible ( pMenu->GetAccessible() );
 
6250
+
 
6251
+            if( xAccessible.is() )
 
6252
+            {
 
6253
+                uno::Reference< accessibility::XAccessibleContext > xContext ( xAccessible->getAccessibleContext() );
 
6254
+
 
6255
+                if( xContext.is() )
 
6256
+                    atk_wrapper_focus_tracker_notify_when_idle( xContext->getAccessibleChild( nPos ) );
 
6257
+            }
 
6258
+        }
 
6259
+    } 
 
6260
+    catch( uno::Exception e )
 
6261
+    {
 
6262
+        g_warning( "Exception caught processing menu highlight events" );
 
6263
+    }
 
6264
+}
 
6265
+
 
6266
+/*****************************************************************************/
 
6267
+
 
6268
+long WindowEventHandler(void *, ::VclSimpleEvent const * pEvent)
 
6269
+{
 
6270
+    switch (pEvent->GetId())
 
6271
+    {
 
6272
+    case VCLEVENT_OBJECT_DYING:
 
6273
+//        fprintf(stderr, "got VCLEVENT_OBJECT_DYING for %p\n", 
 
6274
+//            static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
 
6275
+        break;
 
6276
+    case VCLEVENT_WINDOW_SHOW:
 
6277
+//        fprintf(stderr, "got VCLEVENT_WINDOW_SHOW for %p\n", 
 
6278
+//            static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
 
6279
+        break;
 
6280
+    case VCLEVENT_WINDOW_HIDE:
 
6281
+//        fprintf(stderr, "got VCLEVENT_WINDOW_HIDE for %p\n", 
 
6282
+//            static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
 
6283
+        break;
 
6284
+    case VCLEVENT_WINDOW_CLOSE:
 
6285
+//        fprintf(stderr, "got VCLEVENT_WINDOW_CLOSE for %p\n", 
 
6286
+//            static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
 
6287
+        break;
 
6288
+    case VCLEVENT_WINDOW_GETFOCUS:
 
6289
+        handle_get_focus(static_cast< ::VclWindowEvent const * >(pEvent));
 
6290
+        break;
 
6291
+    case VCLEVENT_WINDOW_DEACTIVATE:
 
6292
+        atk_wrapper_focus_tracker_notify_when_idle(NULL);
 
6293
+        break;
 
6294
+    case VCLEVENT_WINDOW_LOSEFOCUS:
 
6295
+//        fprintf(stderr, "got VCLEVENT_WINDOW_LOSEFOCUS for %p\n", 
 
6296
+//            static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
 
6297
+        break;
 
6298
+    case VCLEVENT_WINDOW_MINIMIZE:
 
6299
+//        fprintf(stderr, "got VCLEVENT_WINDOW_MINIMIZE for %p\n", 
 
6300
+//            static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
 
6301
+        break;
 
6302
+    case VCLEVENT_WINDOW_NORMALIZE:
 
6303
+//        fprintf(stderr, "got VCLEVENT_WINDOW_NORMALIZE for %p\n", 
 
6304
+//            static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
 
6305
+        break;
 
6306
+    case VCLEVENT_WINDOW_KEYINPUT:
 
6307
+    case VCLEVENT_WINDOW_KEYUP:
 
6308
+    case VCLEVENT_WINDOW_COMMAND:
 
6309
+        break;
 
6310
+ /*
 
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());
 
6315
+ */
 
6316
+    case VCLEVENT_MENU_HIGHLIGHT:
 
6317
+        handle_menu_highlighted(static_cast< ::VclMenuEvent const * >(pEvent));
 
6318
+        break;
 
6319
+        
 
6320
+    case VCLEVENT_TABPAGE_ACTIVATE:
 
6321
+        handle_tabpage_activated(static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow());
 
6322
+        break;
 
6323
+    default:
 
6324
+        //fprintf(stderr, "got event %d \n", pEvent->GetId());
 
6325
+        break;
 
6326
+    }
 
6327
+    return 0;
 
6328
+}
 
6329
+
 
6330
+static Link g_aEventListenerLink( NULL, (PSTUB) WindowEventHandler );
 
6331
+
 
6332
+/*****************************************************************************/
 
6333
+
 
6334
+extern "C" {
 
6335
+
 
6336
+static G_CONST_RETURN gchar *
 
6337
+ooo_atk_util_get_toolkit_name (void)
 
6338
+{
 
6339
+    return "VCL";
 
6340
+}
 
6341
+
 
6342
+/*****************************************************************************/
 
6343
+
 
6344
+static G_CONST_RETURN gchar *
 
6345
+ooo_atk_util_get_toolkit_version (void)
 
6346
+{
 
6347
+    /*
 
6348
+     * Version is passed in as a -D flag when this file is
 
6349
+     * compiled.
 
6350
+     */
 
6351
+     
 
6352
+    return VERSION;
 
6353
+}
 
6354
+
 
6355
+/*****************************************************************************/
 
6356
+
 
6357
+/*
 
6358
+ * GObject inheritance 
 
6359
+ */
 
6360
+
 
6361
+static void
 
6362
+ooo_atk_util_class_init (AtkUtilClass *)
 
6363
+{
 
6364
+    AtkUtilClass *atk_class;
 
6365
+    gpointer data;
 
6366
+
 
6367
+    data = g_type_class_peek (ATK_TYPE_UTIL);
 
6368
+    atk_class = ATK_UTIL_CLASS (data);
 
6369
+
 
6370
+    atk_class->get_toolkit_name = ooo_atk_util_get_toolkit_name;
 
6371
+    atk_class->get_toolkit_version = ooo_atk_util_get_toolkit_version;
 
6372
+    
 
6373
+    Application::AddEventListener( g_aEventListenerLink );
 
6374
+}
 
6375
+
 
6376
+} // extern "C"
 
6377
+
 
6378
+/*****************************************************************************/
 
6379
+
 
6380
+GType
 
6381
+ooo_atk_util_get_type (void)
 
6382
+{
 
6383
+    static GType type = 0;
 
6384
+
 
6385
+    if (!type)
 
6386
+    {
 
6387
+        GType parent_type = g_type_from_name( "GailUtil" );
 
6388
+        
 
6389
+        if( ! parent_type )
 
6390
+        {
 
6391
+            g_warning( "Unknown type: GailUtil" );
 
6392
+            parent_type = ATK_TYPE_UTIL;
 
6393
+        }
 
6394
+        
 
6395
+        GTypeQuery type_query;
 
6396
+        g_type_query( parent_type, &type_query );
 
6397
+        
 
6398
+        static const GTypeInfo typeInfo =
 
6399
+        {
 
6400
+            type_query.class_size,
 
6401
+            (GBaseInitFunc) NULL,
 
6402
+            (GBaseFinalizeFunc) NULL,
 
6403
+            (GClassInitFunc) ooo_atk_util_class_init,
 
6404
+            (GClassFinalizeFunc) NULL,
 
6405
+            NULL,
 
6406
+            type_query.instance_size,
 
6407
+            0,
 
6408
+            (GInstanceInitFunc) NULL,
 
6409
+            NULL
 
6410
+        } ;
 
6411
+        
 
6412
+        type = g_type_register_static (parent_type, "OOoUtil", &typeInfo, (GTypeFlags)0) ;
 
6413
+  }
 
6414
+  
 
6415
+  return type;
 
6416
+}
 
6417
+
 
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
 
6424
@@ -0,0 +1,45 @@
 
6425
+/*************************************************************************
 
6426
+ *
 
6427
+ *  OpenOffice.org - a multi-platform office productivity suite
 
6428
+ *
 
6429
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
6430
+ *
 
6431
+ *  $Revision: 1.1.2.1 $
 
6432
+ *
 
6433
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
6434
+ *
 
6435
+ *  The Contents of this file are made available subject to
 
6436
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
6437
+ *
 
6438
+ *
 
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
 
6443
+ *
 
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.
 
6447
+ *
 
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.
 
6452
+ *
 
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
 
6457
+ *
 
6458
+ ************************************************************************/
 
6459
+
 
6460
+#ifndef __ATK_UTIL_HXX__
 
6461
+#define __ATK_UTIL_HXX__ 
 
6462
+
 
6463
+#include <atk/atk.h>
 
6464
+
 
6465
+#define OOO_TYPE_ATK_UTIL ooo_atk_util_get_type()
 
6466
+
 
6467
+GType ooo_atk_util_get_type (void);
 
6468
+
 
6469
+#endif
 
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
 
6476
@@ -0,0 +1,152 @@
 
6477
+/*************************************************************************
 
6478
+ *
 
6479
+ *  OpenOffice.org - a multi-platform office productivity suite
 
6480
+ *
 
6481
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
6482
+ *
 
6483
+ *  $Revision: 1.1.2.1 $
 
6484
+ *
 
6485
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
6486
+ *
 
6487
+ *  The Contents of this file are made available subject to
 
6488
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
6489
+ *
 
6490
+ *
 
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
 
6495
+ *
 
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.
 
6499
+ *
 
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.
 
6504
+ *
 
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
 
6509
+ *
 
6510
+ ************************************************************************/
 
6511
+
 
6512
+#include "atkwrapper.hxx"
 
6513
+
 
6514
+#include <com/sun/star/accessibility/XAccessibleValue.hpp>
 
6515
+
 
6516
+#include <stdio.h>
 
6517
+#include <string.h>
 
6518
+
 
6519
+using namespace ::com::sun::star;
 
6520
+
 
6521
+static accessibility::XAccessibleValue*
 
6522
+    getValue( AtkValue *pValue ) throw (uno::RuntimeException)
 
6523
+{
 
6524
+    AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( pValue );
 
6525
+    if( pWrap )
 
6526
+    {
 
6527
+        if( !pWrap->mpValue && pWrap->mpContext )
 
6528
+        {
 
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();
 
6532
+        }
 
6533
+        
 
6534
+        return pWrap->mpValue;
 
6535
+    }
 
6536
+    
 
6537
+    return NULL;
 
6538
+}
 
6539
+
 
6540
+static void anyToGValue( uno::Any aAny, GValue *pValue )
 
6541
+{
 
6542
+    // FIXME: expand to lots of types etc.
 
6543
+    double aDouble;
 
6544
+    aAny >>= aDouble;
 
6545
+
 
6546
+    memset( pValue,  0, sizeof( GValue ) );
 
6547
+    g_value_init( pValue, G_TYPE_DOUBLE );
 
6548
+    g_value_set_double( pValue, aDouble );
 
6549
+}
 
6550
+
 
6551
+extern "C" {
 
6552
+
 
6553
+static void
 
6554
+value_wrapper_get_current_value( AtkValue *value,
 
6555
+                                 GValue   *gval )
 
6556
+{
 
6557
+    try {
 
6558
+        accessibility::XAccessibleValue* pValue = getValue( value );
 
6559
+        if( pValue )
 
6560
+            anyToGValue( pValue->getCurrentValue(), gval );
 
6561
+    }
 
6562
+    catch(const uno::Exception& e) {
 
6563
+        g_warning( "Exception in getCurrentValue()" );
 
6564
+    }
 
6565
+}
 
6566
+
 
6567
+static void
 
6568
+value_wrapper_get_maximum_value( AtkValue *value,
 
6569
+                                 GValue   *gval )
 
6570
+{
 
6571
+    try {
 
6572
+        accessibility::XAccessibleValue* pValue = getValue( value );
 
6573
+        if( pValue )
 
6574
+            anyToGValue( pValue->getMaximumValue(), gval );
 
6575
+    }
 
6576
+    catch(const uno::Exception& e) {
 
6577
+        g_warning( "Exception in getCurrentValue()" );
 
6578
+    }
 
6579
+}
 
6580
+
 
6581
+static void
 
6582
+value_wrapper_get_minimum_value( AtkValue *value,
 
6583
+                                 GValue   *gval )
 
6584
+{
 
6585
+    try {
 
6586
+        accessibility::XAccessibleValue* pValue = getValue( value );
 
6587
+        if( pValue )
 
6588
+            anyToGValue( pValue->getMinimumValue(), gval );
 
6589
+    }
 
6590
+    catch(const uno::Exception& e) {
 
6591
+        g_warning( "Exception in getCurrentValue()" );
 
6592
+    }
 
6593
+}
 
6594
+
 
6595
+static gboolean
 
6596
+value_wrapper_set_current_value( AtkValue     *value,
 
6597
+                                 const GValue *gval )
 
6598
+{
 
6599
+    try {
 
6600
+        accessibility::XAccessibleValue* pValue = getValue( value );
 
6601
+        if( pValue )
 
6602
+        {
 
6603
+            // FIXME - this needs expanding
 
6604
+            double aDouble = g_value_get_double( gval );
 
6605
+            uno::Any aAny;
 
6606
+            aAny <<= aDouble;
 
6607
+            return pValue->setCurrentValue( aAny );
 
6608
+        }
 
6609
+    }
 
6610
+    catch(const uno::Exception& e) {
 
6611
+        g_warning( "Exception in getCurrentValue()" );
 
6612
+    }
 
6613
+
 
6614
+    return FALSE;
 
6615
+}
 
6616
+
 
6617
+} // extern "C"
 
6618
+
 
6619
+void
 
6620
+valueIfaceInit (AtkValueIface *iface)
 
6621
+{
 
6622
+  g_return_if_fail (iface != NULL);
 
6623
+
 
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;
 
6628
+}
 
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
 
6635
@@ -0,0 +1,149 @@
 
6636
+/*************************************************************************
 
6637
+ *
 
6638
+ *  OpenOffice.org - a multi-platform office productivity suite
 
6639
+ *
 
6640
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
6641
+ *
 
6642
+ *  $Revision: 1.1.2.1 $
 
6643
+ *
 
6644
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
6645
+ *
 
6646
+ *  The Contents of this file are made available subject to
 
6647
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
6648
+ *
 
6649
+ *
 
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
 
6654
+ *
 
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.
 
6658
+ *
 
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.
 
6663
+ *
 
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
 
6668
+ *
 
6669
+ ************************************************************************/
 
6670
 
6671
+#include "atkwindow.hxx"
 
6672
+
 
6673
+#include <plugins/gtk/gtkframe.hxx>
 
6674
+
 
6675
+extern "C" {
 
6676
+
 
6677
+static void (* window_real_initialize) (AtkObject *obj, gpointer data);
 
6678
+static G_CONST_RETURN gchar* (* window_real_get_name) (AtkObject *accessible);
 
6679
+
 
6680
+/*****************************************************************************/
 
6681
+
 
6682
+static void
 
6683
+ooo_window_wrapper_real_initialize(AtkObject *obj, gpointer data)
 
6684
+{
 
6685
+    window_real_initialize(obj, data);
 
6686
+    obj->role = GtkSalFrame::GetAtkRole( GTK_WINDOW( data ) );
 
6687
+    
 
6688
+    if( obj->role == ATK_ROLE_TOOL_TIP )
 
6689
+    {
 
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.
 
6694
+         */
 
6695
+        g_object_set_data( G_OBJECT( data ), "ooo:tooltip-accessible", obj );
 
6696
+    }
 
6697
+}
 
6698
+
 
6699
+/*****************************************************************************/
 
6700
+
 
6701
+static G_CONST_RETURN gchar*
 
6702
+ooo_window_wrapper_real_get_name(AtkObject *accessible)
 
6703
+{
 
6704
+    G_CONST_RETURN gchar* name = NULL;
 
6705
+    
 
6706
+    if( accessible->role == ATK_ROLE_TOOL_TIP )
 
6707
+    {
 
6708
+        AtkObject *child = atk_object_ref_accessible_child(accessible, 0);
 
6709
+        if( child )
 
6710
+        {
 
6711
+            name = atk_object_get_name(child);
 
6712
+            g_object_unref(child);
 
6713
+        }
 
6714
+
 
6715
+        return name;
 
6716
+    }
 
6717
+    
 
6718
+    return window_real_get_name(accessible);
 
6719
+}
 
6720
+
 
6721
+/*****************************************************************************/
 
6722
+
 
6723
+static void
 
6724
+ooo_window_wrapper_class_init (AtkObjectClass *klass)
 
6725
+{
 
6726
+    AtkObjectClass *atk_class;
 
6727
+    gpointer data;
 
6728
+    
 
6729
+    /* 
 
6730
+     * Patch the gobject vtable of GailWindow to refer to our instance of
 
6731
+     * "initialize" and "get_name".
 
6732
+     */
 
6733
+    
 
6734
+    data = g_type_class_peek_parent( klass );
 
6735
+    atk_class = ATK_OBJECT_CLASS (data);
 
6736
+    
 
6737
+    window_real_initialize = atk_class->initialize;
 
6738
+    atk_class->initialize = ooo_window_wrapper_real_initialize;
 
6739
+    
 
6740
+    window_real_get_name = atk_class->get_name;
 
6741
+    atk_class->get_name = ooo_window_wrapper_real_get_name;
 
6742
+}
 
6743
+
 
6744
+} // extern "C"
 
6745
+
 
6746
+/*****************************************************************************/
 
6747
+
 
6748
+GType 
 
6749
+ooo_window_wrapper_get_type (void)
 
6750
+{
 
6751
+    static GType type = 0;
 
6752
+
 
6753
+    if (!type)
 
6754
+    {
 
6755
+        GType parent_type = g_type_from_name( "GailWindow" );
 
6756
+        
 
6757
+        if( ! parent_type )
 
6758
+        {
 
6759
+            g_warning( "Unknown type: GailWindow" );
 
6760
+            parent_type = ATK_TYPE_OBJECT;
 
6761
+        }
 
6762
+        
 
6763
+        GTypeQuery type_query;
 
6764
+        g_type_query( parent_type, &type_query );
 
6765
+        
 
6766
+        static const GTypeInfo typeInfo =
 
6767
+        {
 
6768
+            type_query.class_size,
 
6769
+            (GBaseInitFunc) NULL,
 
6770
+            (GBaseFinalizeFunc) NULL,
 
6771
+            (GClassInitFunc) ooo_window_wrapper_class_init,
 
6772
+            (GClassFinalizeFunc) NULL,
 
6773
+            NULL,
 
6774
+            type_query.instance_size,
 
6775
+            0,
 
6776
+            (GInstanceInitFunc) NULL,
 
6777
+            NULL
 
6778
+        } ;
 
6779
+        
 
6780
+        type = g_type_register_static (parent_type, "OOoWindowAtkObject", &typeInfo, (GTypeFlags)0) ;
 
6781
+    }
 
6782
+    
 
6783
+    return type;
 
6784
+}
 
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
 
6791
@@ -0,0 +1,45 @@
 
6792
+/*************************************************************************
 
6793
+ *
 
6794
+ *  OpenOffice.org - a multi-platform office productivity suite
 
6795
+ *
 
6796
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
6797
+ *
 
6798
+ *  $Revision: 1.1.2.1 $
 
6799
+ *
 
6800
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
6801
+ *
 
6802
+ *  The Contents of this file are made available subject to
 
6803
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
6804
+ *
 
6805
+ *
 
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
 
6810
+ *
 
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.
 
6814
+ *
 
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.
 
6819
+ *
 
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
 
6824
+ *
 
6825
+ ************************************************************************/
 
6826
+
 
6827
+#ifndef __ATK_WINDOW_HXX__
 
6828
+#define __ATK_WINDOW_HXX__ 
 
6829
+
 
6830
+#include <atk/atk.h>
 
6831
+
 
6832
+#define OOO_TYPE_WINDOW_WRAPPER ooo_window_wrapper_get_type()
 
6833
+
 
6834
+GType ooo_window_wrapper_get_type (void);
 
6835
+
 
6836
+#endif
 
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
 
6843
@@ -0,0 +1,820 @@
 
6844
+/*************************************************************************
 
6845
+ *
 
6846
+ *  OpenOffice.org - a multi-platform office productivity suite
 
6847
+ *
 
6848
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
6849
+ *
 
6850
+ *  $Revision: 1.1.2.1 $
 
6851
+ *
 
6852
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
6853
+ *
 
6854
+ *  The Contents of this file are made available subject to
 
6855
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
6856
+ *
 
6857
+ *
 
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
 
6862
+ *
 
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.
 
6866
+ *
 
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.
 
6871
+ *
 
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
 
6876
+ *
 
6877
+ ************************************************************************/
 
6878
+
 
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>
 
6911
+
 
6912
+#include <rtl/ref.hxx>
 
6913
+#include <cppuhelper/factory.hxx>
 
6914
+#include <cppuhelper/queryinterface.hxx>
 
6915
+
 
6916
+#include "atkwrapper.hxx"
 
6917
+#include "atklistener.hxx"
 
6918
+
 
6919
+#ifdef ENABLE_TRACING
 
6920
+#include <stdio.h>
 
6921
+#endif
 
6922
+
 
6923
+#include <string.h>
 
6924
+
 
6925
+using namespace ::com::sun::star;
 
6926
+
 
6927
+static GObjectClass *parent_class = NULL;
 
6928
+static GHashTable   *uno_to_gobject = NULL;
 
6929
+
 
6930
+static G_CONST_RETURN gchar *
 
6931
+getAsConst( rtl::OUString rString )
 
6932
+{
 
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 ];
 
6939
+}
 
6940
+
 
6941
+static AtkRelationType mapRelationType( sal_Int16 nRelation )
 
6942
+{
 
6943
+    AtkRelationType type = ATK_RELATION_NULL;
 
6944
+    
 
6945
+    switch( nRelation )
 
6946
+    {
 
6947
+        case accessibility::AccessibleRelationType::CONTENT_FLOWS_FROM:
 
6948
+            type = ATK_RELATION_FLOWS_FROM;
 
6949
+            break;
 
6950
+        
 
6951
+        case accessibility::AccessibleRelationType::CONTENT_FLOWS_TO:
 
6952
+            type = ATK_RELATION_FLOWS_TO;
 
6953
+            break;
 
6954
+
 
6955
+        case accessibility::AccessibleRelationType::CONTROLLED_BY:
 
6956
+            type = ATK_RELATION_CONTROLLED_BY;
 
6957
+            break;
 
6958
+
 
6959
+        case accessibility::AccessibleRelationType::CONTROLLER_FOR:
 
6960
+            type = ATK_RELATION_CONTROLLER_FOR;
 
6961
+            break;
 
6962
+
 
6963
+        case accessibility::AccessibleRelationType::LABEL_FOR:
 
6964
+            type = ATK_RELATION_LABEL_FOR;
 
6965
+            break;
 
6966
+
 
6967
+        case accessibility::AccessibleRelationType::LABELED_BY:
 
6968
+            type = ATK_RELATION_LABELLED_BY;
 
6969
+            break;
 
6970
+
 
6971
+        case accessibility::AccessibleRelationType::MEMBER_OF:
 
6972
+            type = ATK_RELATION_MEMBER_OF;
 
6973
+            break;
 
6974
+
 
6975
+        case accessibility::AccessibleRelationType::SUB_WINDOW_OF:
 
6976
+            type = ATK_RELATION_SUBWINDOW_OF;
 
6977
+            break;
 
6978
+
 
6979
+        default:
 
6980
+            break;
 
6981
+    }
 
6982
+#if 0
 
6983
+  ATK_RELATION_NODE_CHILD_OF,
 
6984
+  ATK_RELATION_EMBEDS, 
 
6985
+  ATK_RELATION_EMBEDDED_BY, 
 
6986
+  ATK_RELATION_POPUP_FOR, 
 
6987
+#endif
 
6988
+    return type;
 
6989
+}
 
6990
+
 
6991
+
 
6992
+AtkStateType mapAtkState( sal_Int16 nState )
 
6993
+{
 
6994
+    AtkStateType type = ATK_STATE_INVALID;
 
6995
+
 
6996
+    // A perfect / complete mapping ...
 
6997
+    switch( nState )
 
6998
+    {
 
6999
+#define MAP_DIRECT( a ) \
 
7000
+        case accessibility::AccessibleStateType::a: \
 
7001
+            type = ATK_STATE_##a; break
 
7002
+
 
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;
 
7037
+    default:
 
7038
+        break;
 
7039
+    }
 
7040
+
 
7041
+    return type;
 
7042
+}
 
7043
+
 
7044
+static AtkRole mapToAtkRole( sal_Int16 nRole )
 
7045
+{
 
7046
+    AtkRole role = ATK_ROLE_UNKNOWN;
 
7047
+
 
7048
+    switch( nRole )
 
7049
+    {
 
7050
+#define MAP(a,b) \
 
7051
+        case a: role = b; break
 
7052
+            
 
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 );
 
7121
+#undef MAP
 
7122
+        default:
 
7123
+            break;
 
7124
+    }
 
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 */
 
7132
+
 
7133
+    return role;
 
7134
+}
 
7135
+
 
7136
+
 
7137
+static accessibility::XAccessibleContext*
 
7138
+        getContext( AtkObject* obj ) throw (uno::RuntimeException)
 
7139
+{
 
7140
+    AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER( obj );
 
7141
+    
 
7142
+    if( pWrap )
 
7143
+    {
 
7144
+        if( !pWrap->mpContext && pWrap->mpContext )
 
7145
+        {
 
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();
 
7149
+        }
 
7150
+
 
7151
+        return pWrap->mpContext;
 
7152
+    }
 
7153
+
 
7154
+    return NULL;
 
7155
+}
 
7156
+
 
7157
+/*****************************************************************************/
 
7158
+
 
7159
+extern "C" {
 
7160
+
 
7161
+/*****************************************************************************/
 
7162
+
 
7163
+static G_CONST_RETURN gchar*
 
7164
+wrapper_get_name( AtkObject *pObject )
 
7165
+{
 
7166
+    G_CONST_RETURN gchar* name;
 
7167
+
 
7168
+    name = ATK_OBJECT_CLASS (parent_class)->get_name( pObject );
 
7169
+    if (name == NULL)
 
7170
+    {
 
7171
+        try {
 
7172
+            accessibility::XAccessibleContext* pContext = getContext( pObject );
 
7173
+            if( pContext )
 
7174
+                name = getAsConst( pContext->getAccessibleName() );
 
7175
+        }
 
7176
+        catch(const uno::Exception& e) {
 
7177
+            g_warning( "Exception in getAccessibleName()" );
 
7178
+        }
 
7179
+    }
 
7180
+    
 
7181
+    return name;
 
7182
+}
 
7183
+
 
7184
+/*****************************************************************************/
 
7185
+
 
7186
+static G_CONST_RETURN gchar*
 
7187
+wrapper_get_description( AtkObject *pObject )
 
7188
+{
 
7189
+    G_CONST_RETURN gchar* desc;
 
7190
+
 
7191
+    desc = ATK_OBJECT_CLASS (parent_class)->get_description( pObject );
 
7192
+    if (desc == NULL)
 
7193
+    {
 
7194
+        try {
 
7195
+            accessibility::XAccessibleContext* pContext = getContext( pObject );
 
7196
+            if( pContext )
 
7197
+                desc = getAsConst( pContext->getAccessibleDescription() );
 
7198
+        }
 
7199
+        catch(const uno::Exception& e) {
 
7200
+            g_warning( "Exception in getAccessibleDescription()" );
 
7201
+        }
 
7202
+    }
 
7203
+    
 
7204
+    return desc;
 
7205
+}
 
7206
+
 
7207
+/*****************************************************************************/
 
7208
+
 
7209
+static gint
 
7210
+wrapper_get_n_children( AtkObject *pObject )
 
7211
+{
 
7212
+    try {
 
7213
+        accessibility::XAccessibleContext* pContext = getContext( pObject );
 
7214
+        if( pContext )
 
7215
+            return pContext->getAccessibleChildCount();
 
7216
+    }
 
7217
+    catch(const uno::Exception& e) {
 
7218
+        g_warning( "Exception in getAccessibleChildCount()" );
 
7219
+    }
 
7220
+    
 
7221
+    return 0;
 
7222
+}
 
7223
+
 
7224
+/*****************************************************************************/
 
7225
+
 
7226
+static AtkObject *
 
7227
+wrapper_ref_child( AtkObject *pObject,
 
7228
+                   gint       i )
 
7229
+{
 
7230
+    try {
 
7231
+        accessibility::XAccessibleContext* pContext = getContext( pObject );
 
7232
+        if( pContext )
 
7233
+        {
 
7234
+//    fprintf(stderr, "wrapper_ref_child %d of (%d)\n", i,
 
7235
+//        getContext( pObject )->getAccessibleChildCount());
 
7236
+            if( i >= 0 && i <  getContext( pObject )->getAccessibleChildCount())
 
7237
+            {
 
7238
+                uno::Reference< accessibility::XAccessible > xAccessible = 
 
7239
+                    pContext->getAccessibleChild( i );
 
7240
+        
 
7241
+                AtkObject* child = atk_object_wrapper_ref( xAccessible );
 
7242
+                return child;
 
7243
+            }
 
7244
+        }
 
7245
+    }
 
7246
+    catch(const uno::Exception& e) {
 
7247
+        g_warning( "Exception in getAccessibleChildCount()" );
 
7248
+    }
 
7249
+        
 
7250
+    return NULL;
 
7251
+}
 
7252
+
 
7253
+static gint
 
7254
+wrapper_get_index_in_parent( AtkObject *pObject )
 
7255
+{
 
7256
+    try {
 
7257
+        accessibility::XAccessibleContext* pContext = getContext( pObject );
 
7258
+        
 
7259
+#ifdef ENABLE_TRACING
 
7260
+        if( pContext )
 
7261
+            fprintf(stderr, "%p->getAccessibleIndexInParent() returned: %u\n",
 
7262
+                ATK_OBJECT_WRAPPER( pObject )->mpAccessible,
 
7263
+                pContext->getAccessibleIndexInParent());
 
7264
+#endif
 
7265
+        if( pContext )
 
7266
+            return pContext->getAccessibleIndexInParent();
 
7267
+    }
 
7268
+    catch(const uno::Exception& e) {
 
7269
+        g_warning( "Exception in getAccessibleIndexInParent()" );
 
7270
+    }
 
7271
+    return -1;
 
7272
+}
 
7273
+
 
7274
+static AtkRelationSet *
 
7275
+wrapper_ref_relation_set( AtkObject *pObject )
 
7276
+{
 
7277
+    AtkRelationSet *pSet = atk_relation_set_new();
 
7278
+    try {
 
7279
+        accessibility::XAccessibleContext* pContext = getContext( pObject );
 
7280
+        if( pContext )
 
7281
+        {
 
7282
+            uno::Reference< accessibility::XAccessibleRelationSet > xRelationSet;
 
7283
+
 
7284
+            xRelationSet = pContext->getAccessibleRelationSet();
 
7285
+
 
7286
+            sal_Int32 nRelations = xRelationSet.is() ? xRelationSet->getRelationCount() : 0;
 
7287
+            for( sal_Int32 n = 0; n < nRelations; n++ )
 
7288
+            {
 
7289
+                accessibility::AccessibleRelation aRelation = xRelationSet->getRelation( n );
 
7290
+                sal_uInt32 nTargetCount = aRelation.TargetSet.getLength();
 
7291
+                AtkObject **pTargets = (AtkObject **) alloca( nTargetCount * sizeof(AtkObject *) );
 
7292
+            
 
7293
+                for( sal_uInt32 i = 0; i < nTargetCount; i++ )
 
7294
+                {
 
7295
+                    uno::Reference< accessibility::XAccessible > xAccessible(
 
7296
+                            aRelation.TargetSet[i], uno::UNO_QUERY );
 
7297
+                    pTargets[i] = atk_object_wrapper_ref( xAccessible );
 
7298
+                }
 
7299
+        
 
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 ) );
 
7305
+            }
 
7306
+        }
 
7307
+    }
 
7308
+    catch(const uno::Exception &e)
 
7309
+    {
 
7310
+        g_object_unref( G_OBJECT( pSet ) );
 
7311
+        pSet = NULL;
 
7312
+    }
 
7313
+
 
7314
+    return pSet;
 
7315
+}
 
7316
+
 
7317
+static AtkStateSet *
 
7318
+wrapper_ref_state_set( AtkObject *pObject )
 
7319
+{
 
7320
+    AtkStateSet *pSet = atk_state_set_new();
 
7321
+    try {
 
7322
+        accessibility::XAccessibleContext* pContext = getContext( pObject );
 
7323
+        if( pContext )
 
7324
+        {
 
7325
+            uno::Reference< accessibility::XAccessibleStateSet > xStateSet = 
 
7326
+                pContext->getAccessibleStateSet();
 
7327
+
 
7328
+            if( xStateSet.is() )
 
7329
+            {
 
7330
+                uno::Sequence< sal_Int16 > aStates = xStateSet->getStates();
 
7331
+            
 
7332
+                for( sal_Int32 n = 0; n < aStates.getLength(); n++ )
 
7333
+                    atk_state_set_add_state( pSet, mapAtkState( aStates[n] ) );
 
7334
+
 
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 ?
 
7339
+                else
 
7340
+                    atk_state_set_remove_state( pSet, ATK_STATE_FOCUSED );
 
7341
+*/
 
7342
+            }
 
7343
+        }
 
7344
+    }
 
7345
+    
 
7346
+    catch(const uno::Exception &e)
 
7347
+    {
 
7348
+        g_warning( "Exception in wrapper_ref_state_set" );
 
7349
+        
 
7350
+        g_object_unref( G_OBJECT( pSet ) );
 
7351
+        pSet = NULL;
 
7352
+    }
 
7353
+
 
7354
+    return pSet;
 
7355
+}
 
7356
+
 
7357
+static void
 
7358
+atk_object_wrapper_finalize (GObject *obj)
 
7359
+{
 
7360
+    AtkObjectWrapper *pWrap = ATK_OBJECT_WRAPPER (obj);
 
7361
+
 
7362
+    if( pWrap->mpAccessible )
 
7363
+    {
 
7364
+        g_hash_table_remove( uno_to_gobject, pWrap->mpAccessible );
 
7365
+        pWrap->mpAccessible->release();
 
7366
+        pWrap->mpAccessible = NULL;
 
7367
+    }
 
7368
+    
 
7369
+    atk_object_wrapper_dispose( pWrap );
 
7370
+    
 
7371
+    parent_class->finalize( obj );
 
7372
+}
 
7373
+
 
7374
+static void
 
7375
+atk_object_wrapper_class_init (AtkObjectWrapperClass *klass)
 
7376
+{
 
7377
+  GObjectClass *gobject_class = G_OBJECT_CLASS( klass );
 
7378
+  AtkObjectClass *atk_class = ATK_OBJECT_CLASS( klass );
 
7379
+
 
7380
+  parent_class = (GObjectClass *) g_type_class_peek_parent (klass);
 
7381
+
 
7382
+  // GObject methods
 
7383
+  gobject_class->finalize = atk_object_wrapper_finalize;
 
7384
+
 
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;
 
7393
+}
 
7394
+
 
7395
+static void
 
7396
+atk_object_wrapper_init (AtkObjectWrapper      *wrapper,
 
7397
+                         AtkObjectWrapperClass)
 
7398
+{
 
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;    
 
7408
+}
 
7409
+
 
7410
+} // extern "C"
 
7411
+
 
7412
+GType
 
7413
+atk_object_wrapper_get_type (void)
 
7414
+{
 
7415
+  static GType type = 0;
 
7416
+
 
7417
+  if (!type)
 
7418
+    {
 
7419
+      static const GTypeInfo typeInfo =
 
7420
+      {
 
7421
+        sizeof (AtkObjectWrapperClass),
 
7422
+        (GBaseInitFunc) NULL,
 
7423
+        (GBaseFinalizeFunc) NULL,
 
7424
+        (GClassInitFunc) atk_object_wrapper_class_init,
 
7425
+        (GClassFinalizeFunc) NULL,
 
7426
+        NULL,
 
7427
+        sizeof (AtkObjectWrapper),
 
7428
+        0,
 
7429
+        (GInstanceInitFunc) atk_object_wrapper_init,
 
7430
+        NULL
 
7431
+      } ;
 
7432
+      type = g_type_register_static (ATK_TYPE_OBJECT,
 
7433
+                                     "OOoAtkObj",
 
7434
+                                     &typeInfo, (GTypeFlags)0) ;
 
7435
+    }
 
7436
+  return type;
 
7437
+}
 
7438
+
 
7439
+static bool
 
7440
+isOfType( uno::XInterface *pInterface, const uno::Type & rType )
 
7441
+{
 
7442
+    g_return_val_if_fail( pInterface != NULL, false );
 
7443
+
 
7444
+    bool bIs = false;
 
7445
+    try {
 
7446
+        uno::Any aRet = pInterface->queryInterface( rType );
 
7447
+
 
7448
+        bIs = ( ( typelib_TypeClass_INTERFACE == aRet.pType->eTypeClass ) &&
 
7449
+                ( aRet.pReserved != NULL ) );
 
7450
+    } catch( const uno::Exception &e) { }
 
7451
+    
 
7452
+    return bIs;
 
7453
+}
 
7454
+
 
7455
+extern "C" {
 
7456
+typedef  GType (* GetGIfaceType ) (void);
 
7457
+} 
 
7458
+const struct {
 
7459
+        const char          *name;
 
7460
+        GInterfaceInitFunc   aInit;
 
7461
+        GetGIfaceType        aGetGIfaceType;
 
7462
+        const uno::Type &  (*aGetUnoType) (void *);
 
7463
+} aTypeTable[] = {
 
7464
+// re-location heaven:
 
7465
+    {
 
7466
+        "Comp", (GInterfaceInitFunc) componentIfaceInit,
 
7467
+        atk_component_get_type,
 
7468
+        accessibility::XAccessibleComponent::static_type
 
7469
+    },
 
7470
+    {
 
7471
+        "Act",  (GInterfaceInitFunc) actionIfaceInit,
 
7472
+        atk_action_get_type,
 
7473
+        accessibility::XAccessibleAction::static_type
 
7474
+    },
 
7475
+    {
 
7476
+        "Txt",  (GInterfaceInitFunc) textIfaceInit,
 
7477
+        atk_text_get_type,
 
7478
+        accessibility::XAccessibleText::static_type
 
7479
+    },
 
7480
+    {
 
7481
+        "Val",  (GInterfaceInitFunc) valueIfaceInit,
 
7482
+        atk_value_get_type,
 
7483
+        accessibility::XAccessibleValue::static_type
 
7484
+    },
 
7485
+    {
 
7486
+        "Tab",  (GInterfaceInitFunc) tableIfaceInit,
 
7487
+        atk_table_get_type,
 
7488
+        accessibility::XAccessibleTable::static_type
 
7489
+    },
 
7490
+    {
 
7491
+        "Edt",  (GInterfaceInitFunc) editableTextIfaceInit,
 
7492
+        atk_editable_text_get_type,
 
7493
+        accessibility::XAccessibleEditableText::static_type
 
7494
+    },
 
7495
+    {
 
7496
+        "Img",  (GInterfaceInitFunc) imageIfaceInit,
 
7497
+        atk_image_get_type,
 
7498
+        accessibility::XAccessibleImage::static_type
 
7499
+    },
 
7500
+    {
 
7501
+        "Hyp",  (GInterfaceInitFunc) hypertextIfaceInit,
 
7502
+        atk_hypertext_get_type,
 
7503
+        accessibility::XAccessibleHypertext::static_type
 
7504
+    },
 
7505
+    {
 
7506
+        "Sel",  (GInterfaceInitFunc) selectionIfaceInit,
 
7507
+        atk_selection_get_type,
 
7508
+        accessibility::XAccessibleSelection::static_type
 
7509
+    }
 
7510
+    // AtkDocument is a nastily broken interface (so far)
 
7511
+    //  we could impl. get_document_type perhaps though.
 
7512
+};
 
7513
+
 
7514
+const int aTypeTableSize = G_N_ELEMENTS( aTypeTable );
 
7515
+
 
7516
+static GType
 
7517
+ensureTypeFor( uno::XInterface *pAccessible )
 
7518
+{
 
7519
+    int i;
 
7520
+    int bTypes[ aTypeTableSize ] = { 0, };
 
7521
+    rtl::OString aTypeName( "OOoAtkObj" );
 
7522
+
 
7523
+    for( i = 0; i < aTypeTableSize; i++ )
 
7524
+    {
 
7525
+        if( isOfType( pAccessible, aTypeTable[i].aGetUnoType(0) ) )
 
7526
+        {
 
7527
+            aTypeName += aTypeTable[i].name;
 
7528
+            bTypes[i] = TRUE;
 
7529
+        }
 
7530
+//      g_message( "Accessible %p has type '%s' (%d)",
 
7531
+//                 pAccessible, aTypeTable[i].name, bTypes[i] );
 
7532
+    }
 
7533
+
 
7534
+    GType nType = g_type_from_name( aTypeName );
 
7535
+    if( nType == G_TYPE_INVALID )
 
7536
+    {
 
7537
+        GTypeInfo aTypeInfo = {
 
7538
+            sizeof( AtkObjectWrapperClass ),
 
7539
+            NULL, NULL, NULL, NULL, NULL,
 
7540
+            sizeof( AtkObjectWrapper ),
 
7541
+            0, NULL, NULL
 
7542
+        } ;
 
7543
+        nType = g_type_register_static( ATK_TYPE_OBJECT_WRAPPER,
 
7544
+                                        aTypeName, &aTypeInfo, (GTypeFlags)0 ) ;
 
7545
+
 
7546
+        for( int j = 0; j < aTypeTableSize; j++ )
 
7547
+            if( bTypes[j] )
 
7548
+            {
 
7549
+                GInterfaceInfo aIfaceInfo = { NULL, NULL, NULL };
 
7550
+                aIfaceInfo.interface_init = aTypeTable[j].aInit;
 
7551
+                g_type_add_interface_static (nType, aTypeTable[j].aGetGIfaceType(),
 
7552
+                                             &aIfaceInfo);
 
7553
+            }
 
7554
+    }
 
7555
+    return nType;
 
7556
+}
 
7557
+
 
7558
+AtkObject *
 
7559
+atk_object_wrapper_ref( const uno::Reference< accessibility::XAccessible > &rxAccessible, bool create )
 
7560
+{
 
7561
+    g_return_val_if_fail( rxAccessible.get() != NULL, NULL );
 
7562
+
 
7563
+    if( uno_to_gobject )
 
7564
+    {
 
7565
+        gpointer cached = 
 
7566
+            g_hash_table_lookup(uno_to_gobject, (gpointer) rxAccessible.get());
 
7567
+
 
7568
+        if( cached )
 
7569
+            return ATK_OBJECT( g_object_ref( cached ) );
 
7570
+    }
 
7571
+    
 
7572
+    if( create )
 
7573
+        return atk_object_wrapper_new( rxAccessible );
 
7574
+    
 
7575
+    return NULL;
 
7576
+}
 
7577
+
 
7578
+
 
7579
+AtkObject *            
 
7580
+atk_object_wrapper_new( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible,
 
7581
+                        AtkObject* parent )
 
7582
+{
 
7583
+    g_return_val_if_fail( rxAccessible.get() != NULL, NULL );
 
7584
+    
 
7585
+    AtkObjectWrapper *pWrap = NULL;
 
7586
+    
 
7587
+    try {
 
7588
+        uno::Reference< accessibility::XAccessibleContext > xContext(rxAccessible->getAccessibleContext());
 
7589
+        
 
7590
+        g_return_val_if_fail( xContext.get() != NULL, NULL );
 
7591
+        
 
7592
+        GType nType = ensureTypeFor( xContext.get() );
 
7593
+        gpointer obj = g_object_new( nType, NULL);
 
7594
+        
 
7595
+        if( !uno_to_gobject )
 
7596
+            uno_to_gobject = g_hash_table_new (NULL, NULL);
 
7597
+        
 
7598
+        // We assume direct pointer comparison is sufficient...
 
7599
+        g_hash_table_insert( uno_to_gobject, (gpointer) rxAccessible.get(), obj );
 
7600
+        rxAccessible->acquire();
 
7601
+
 
7602
+        pWrap = ATK_OBJECT_WRAPPER( obj );
 
7603
+        pWrap->mpAccessible = rxAccessible.get();
 
7604
+        
 
7605
+        xContext->acquire();
 
7606
+        pWrap->mpContext = xContext.get();
 
7607
+
 
7608
+        AtkObject* atk_obj = ATK_OBJECT(pWrap);
 
7609
+        atk_obj->role = mapToAtkRole( xContext->getAccessibleRole() );
 
7610
+        
 
7611
+        if( parent )
 
7612
+        {
 
7613
+            atk_obj->accessible_parent = parent;
 
7614
+            g_object_ref( atk_obj->accessible_parent );
 
7615
+        }
 
7616
+        else
 
7617
+        {
 
7618
+            uno::Reference< accessibility::XAccessible > xParent(xContext->getAccessibleParent());
 
7619
+            if( xParent.is() )
 
7620
+            {
 
7621
+                atk_obj->accessible_parent = atk_object_wrapper_ref( xParent );
 
7622
+            }
 
7623
+            else
 
7624
+            {
 
7625
+                atk_object_set_parent( atk_obj, atk_get_root() );
 
7626
+                g_object_ref( atk_obj->accessible_parent );
 
7627
+            }
 
7628
+        }
 
7629
+        
 
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 ) )
 
7633
+        {
 
7634
+            uno::Reference< accessibility::XAccessibleEventBroadcaster > xBroadcaster( xContext, uno::UNO_QUERY_THROW );
 
7635
+            xBroadcaster->addEventListener( static_cast< accessibility::XAccessibleEventListener * > ( new AtkListener( pWrap ) ) );
 
7636
+        }
 
7637
+
 
7638
+        return ATK_OBJECT( pWrap );
 
7639
+    } 
 
7640
+    catch (const uno::Exception &e) 
 
7641
+    {
 
7642
+        if( pWrap )
 
7643
+            g_object_unref( pWrap );
 
7644
+        
 
7645
+        return NULL;
 
7646
+    }
 
7647
+}
 
7648
+
 
7649
+#define RELEASE(i) if( i ) { i->release(); i = NULL; }
 
7650
+
 
7651
+void atk_object_wrapper_dispose(AtkObjectWrapper* wrapper)
 
7652
+{
 
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 )
 
7663
+}
 
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
 
7670
@@ -0,0 +1,125 @@
 
7671
+/*************************************************************************
 
7672
+ *
 
7673
+ *  OpenOffice.org - a multi-platform office productivity suite
 
7674
+ *
 
7675
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
7676
+ *
 
7677
+ *  $Revision: 1.1.2.1 $
 
7678
+ *
 
7679
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
7680
+ *
 
7681
+ *  The Contents of this file are made available subject to
 
7682
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
7683
+ *
 
7684
+ *
 
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
 
7689
+ *
 
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.
 
7693
+ *
 
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.
 
7698
+ *
 
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
 
7703
+ *
 
7704
+ ************************************************************************/
 
7705
+
 
7706
+#ifndef __ATK_WRAPPER_HXX__
 
7707
+#define __ATK_WRAPPER_HXX__
 
7708
+
 
7709
+#include <atk/atk.h>
 
7710
+
 
7711
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HPP_
 
7712
+#include <com/sun/star/accessibility/XAccessible.hpp>
 
7713
+#endif
 
7714
+
 
7715
+extern "C" {
 
7716
+
 
7717
+typedef struct _AtkObjectWrapper      AtkObjectWrapper;
 
7718
+typedef struct _AtkObjectWrapperClass AtkObjectWrapperClass;
 
7719
+
 
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;
 
7730
+} } } }
 
7731
+
 
7732
+
 
7733
+struct _AtkObjectWrapper
 
7734
+{
 
7735
+    AtkObject aParent;
 
7736
+
 
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;
 
7748
+    
 
7749
+//    ::rtl::OString * m_pKeyBindings
 
7750
+};
 
7751
+
 
7752
+struct _AtkObjectWrapperClass
 
7753
+{
 
7754
+    AtkObjectClass aParentClass;
 
7755
+};
 
7756
+
 
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 );
 
7761
+    
 
7762
+AtkObject *            atk_object_wrapper_new(
 
7763
+    const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible,
 
7764
+    AtkObject* parent = NULL );
 
7765
+
 
7766
+void                   atk_object_wrapper_dispose(AtkObjectWrapper* wrapper);
 
7767
+
 
7768
+AtkStateType mapAtkState( sal_Int16 nState );
 
7769
+
 
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);
 
7779
+
 
7780
+} // extern "C"
 
7781
+
 
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))
 
7785
+
 
7786
+static inline gchar *
 
7787
+OUStringToGChar(const rtl::OUString& rString )
 
7788
+{
 
7789
+    rtl::OString aUtf8 = rtl::OUStringToOString( rString, RTL_TEXTENCODING_UTF8 );
 
7790
+    return g_strdup( aUtf8 );
 
7791
+}
 
7792
+
 
7793
+#define OUStringToConstGChar( string ) rtl::OUStringToOString( string, RTL_TEXTENCODING_UTF8 ).getStr() 
 
7794
+
 
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
 
7802
@@ -0,0 +1,102 @@
 
7803
+#*************************************************************************
 
7804
+#
 
7805
+#   OpenOffice.org - a multi-platform office productivity suite
 
7806
+#
 
7807
+#   $RCSfile: cws-atkbridge-20060425.diff,v $
 
7808
+#
 
7809
+#   $Revision: 1.1.2.1 $
 
7810
+#
 
7811
+#   last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
7812
+#
 
7813
+#   The Contents of this file are made available subject to
 
7814
+#   the terms of GNU Lesser General Public License Version 2.1.
 
7815
+#
 
7816
+#
 
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
 
7821
+#
 
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.
 
7825
+#
 
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.
 
7830
+#
 
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
 
7835
+#
 
7836
+#*************************************************************************
 
7837
+
 
7838
+PRJ=..$/..$/..
 
7839
+
 
7840
+PRJNAME=vcl
 
7841
+TARGET=gtka11y
 
7842
+ENABLE_EXCEPTIONS=TRUE
 
7843
+
 
7844
+# workaround for makedepend hang
 
7845
+MKDEPENDSOLVER=
 
7846
+LIBTARGET=NO
 
7847
+NO_DEFAULT_STL=YES
 
7848
+
 
7849
+# --- Settings -----------------------------------------------------
 
7850
+
 
7851
+.INCLUDE :  settings.mk
 
7852
+
 
7853
+# --- Files --------------------------------------------------------
 
7854
+
 
7855
+.IF "$(GUIBASE)"!="unx"
 
7856
+
 
7857
+dummy:
 
7858
+       @echo "Nothing to build for GUIBASE $(GUIBASE)"
 
7859
+
 
7860
+.ELSE          # "$(GUIBASE)"!="unx"
 
7861
+
 
7862
+.IF "$(ENABLE_GTK)" != ""
 
7863
+
 
7864
+PKGCONFIG_MODULES=gtk+-2.0
 
7865
+.INCLUDE : pkg_config.mk
 
7866
+
 
7867
+CFLAGS+=-DVERSION=\"$(UPD)$(LAST_MINOR)\"
 
7868
+
 
7869
+ATKVERSION:=$(shell $(PKGCONFIG) --modversion atk | $(AWK) -v num=true -f $(SOLARENV)$/bin$/getcompver.awk)
 
7870
+
 
7871
+.IF $(ATKVERSION) >= "000100070000"
 
7872
+CFLAGS+=-DHAS_ATKRECTANGLE
 
7873
+.ENDIF
 
7874
+
 
7875
+LIB1TARGET=$(SLB)$/$(TARGET).lib
 
7876
+LIB1OBJFILES=\
 
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
 
7893
+
 
7894
+.ELSE # "$(ENABLE_GTK)" != ""
 
7895
+
 
7896
+dummy:
 
7897
+       @echo GTK disabled - nothing to build
 
7898
+.ENDIF
 
7899
+.ENDIF         # "$(GUIBASE)"!="unx"
 
7900
+
 
7901
+# --- Targets ------------------------------------------------------
 
7902
+
 
7903
+.INCLUDE :  target.mk
 
7904
+
 
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
 
7914
@@ -40,6 +40,7 @@
 
7915
 #include <salobj.h>
 
7916
 #include <plugins/gtk/gtkframe.hxx>
 
7917
 #include <plugins/gtk/gtkobject.hxx>
 
7918
+#include <plugins/gtk/atkbridge.hxx>
 
7919
 
 
7920
 #include <rtl/strbuf.hxx>
 
7921
 
 
7922
@@ -47,6 +48,8 @@
 
7923
 #include <stdio.h>
 
7924
 #endif
 
7925
 
 
7926
+#include <dlfcn.h>
 
7927
+
 
7928
 GtkHookedYieldMutex::GtkHookedYieldMutex()
 
7929
 {
 
7930
 }
 
7931
@@ -140,29 +143,6 @@ extern "C" 
 
7932
 #endif
 
7933
             return NULL;
 
7934
         }
 
7935
-        /*  #i47797# as long as we do not have a working atk bridge
 
7936
-         *  prevent atk from interfering with the java accessibility bridge
 
7937
-         */
 
7938
-        #if ! defined HAVE_ATK_ACCESSIBILITY_BRIDGE
 
7939
-        const char* pGtkModules = getenv( "GTK_MODULES" );
 
7940
-        if( pGtkModules )
 
7941
-        {
 
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 )
 
7947
-            {
 
7948
-                rtl::OString aToken = aModules.getToken( 0, ':', nIndex );
 
7949
-                if( aToken.equals( "gail" ) ||
 
7950
-                    aToken.equals( "atk-bridge" ) )
 
7951
-                    continue;
 
7952
-                aModulesOut.append( ':' );
 
7953
-                aModulesOut.append( aToken );
 
7954
-            }
 
7955
-            putenv( strdup( aModulesOut.getStr() ) );
 
7956
-        }
 
7957
-        #endif
 
7958
 
 
7959
                GtkYieldMutex *pYieldMutex;
 
7960
 
 
7961
@@ -189,6 +169,22 @@ extern "C" 
 
7962
         pSalData->Init();
 
7963
         pSalData->initNWF();
 
7964
 
 
7965
+        const char* pGtkModules = getenv( "GTK_MODULES" );
 
7966
+        if( pGtkModules )
 
7967
+        {
 
7968
+            rtl::OString aModules( pGtkModules );
 
7969
+            sal_Int32 nIndex = 0;
 
7970
+            while( nIndex >= 0 )
 
7971
+            {
 
7972
+                rtl::OString aToken = aModules.getToken( 0, ':', nIndex );
 
7973
+                if( aToken.equals( "gail" ) || aToken.equals( "atk-bridge" ) )
 
7974
+                {
 
7975
+                    InitAtkBridge();
 
7976
+                    break;
 
7977
+                }
 
7978
+            }
 
7979
+        }
 
7980
+
 
7981
         return pInstance;
 
7982
     }
 
7983
 }
 
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
 
7994
@@ -45,6 +45,7 @@
 
7995
 #include <floatwin.hxx>
 
7996
 #include <salprn.h>
 
7997
 #include <svapp.hxx>
 
7998
+#include <window.hxx>
 
7999
 
 
8000
 #include <prex.h>
 
8001
 #include <X11/Xatom.h>
 
8002
@@ -60,6 +61,11 @@
 
8003
 #include <cstdio>
 
8004
 #endif
 
8005
 
 
8006
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
 
8007
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
 
8008
+
 
8009
+using namespace com::sun::star;
 
8010
+
 
8011
 int GtkSalFrame::m_nFloats = 0;
 
8012
 
 
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) );
 
8017
     if( m_pWindow )
 
8018
+       {
 
8019
+               g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", NULL );
 
8020
         gtk_widget_destroy( GTK_WIDGET(m_pWindow) );
 
8021
+       }
 
8022
     if( m_pForeignParent )
 
8023
         g_object_unref( G_OBJECT(m_pForeignParent) );
 
8024
     if( m_pForeignTopLevel )
 
8025
         g_object_unref(G_OBJECT( m_pForeignTopLevel) );
 
8026
 }
 
8027
 
 
8028
+/*
 
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 ..
 
8032
+ */
 
8033
+  
 
8034
+GType
 
8035
+ooo_fixed_get_type()
 
8036
+{
 
8037
+    static GType type = 0;
 
8038
+
 
8039
+    if (!type) {
 
8040
+        static const GTypeInfo tinfo =
 
8041
+        {
 
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 */
 
8052
+        };
 
8053
+
 
8054
+        type = g_type_register_static( GTK_TYPE_FIXED, "OOoFixed", 
 
8055
+                                       &tinfo, (GTypeFlags) 0);
 
8056
+    }
 
8057
+
 
8058
+    return type;                                                                       
 
8059
+}
 
8060
+
 
8061
 void GtkSalFrame::InitCommon()
 
8062
 {
 
8063
     // connect signals
 
8064
@@ -459,7 +501,7 @@ void GtkSalFrame::InitCommon()
 
8065
 
 
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) );
 
8072
 
 
8073
@@ -581,6 +623,102 @@ static void lcl_set_accept_focus( GtkWin
 
8074
     }
 
8075
 }
 
8076
 
 
8077
+GtkSalFrame *GtkSalFrame::getFromWindow( GtkWindow *pWindow )
 
8078
+{
 
8079
+       return (GtkSalFrame *) g_object_get_data( G_OBJECT( pWindow ), "SalFrame" );
 
8080
+}
 
8081
+
 
8082
+AtkRole
 
8083
+GtkSalFrame::GetAtkRole( GtkWindow* window )
 
8084
+{
 
8085
+    static AtkRole aDefaultRole = ATK_ROLE_INVALID;
 
8086
+    
 
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" );
 
8091
+    
 
8092
+    AtkRole role = aDefaultRole;
 
8093
+    
 
8094
+    GtkSalFrame * pFrame = getFromWindow( window );
 
8095
+    if( pFrame )
 
8096
+    {
 
8097
+        Window *pWindow = static_cast <Window *> (pFrame->GetInstance());
 
8098
+        if( pWindow )
 
8099
+        {
 
8100
+            // Determine the appropriate role for the GtkWindow
 
8101
+            switch( pWindow->GetAccessibleRole() )
 
8102
+            {
 
8103
+                case accessibility::AccessibleRole::ALERT:
 
8104
+                    role = ATK_ROLE_ALERT;
 
8105
+                    break;
 
8106
+                    
 
8107
+                case accessibility::AccessibleRole::DIALOG:
 
8108
+                    role = ATK_ROLE_DIALOG;
 
8109
+                    break;
 
8110
+            
 
8111
+                case accessibility::AccessibleRole::FRAME:
 
8112
+                    role = ATK_ROLE_FRAME;
 
8113
+                    break;
 
8114
+            
 
8115
+                // Ignore window objects for sub-menus, which are exposed 
 
8116
+                // as children of their parent menu
 
8117
+                case accessibility::AccessibleRole::WINDOW:
 
8118
+                {
 
8119
+                    Window *pChild = pWindow->GetChild( 0 );
 
8120
+                    if( pChild )
 
8121
+                    {
 
8122
+                        uno::Reference< accessibility::XAccessible > xAccessible( pChild->GetAccessible( true ) );
 
8123
+                        if( xAccessible.is() )            
 
8124
+                            role = ATK_ROLE_WINDOW;
 
8125
+                    }
 
8126
+                }
 
8127
+                break;
 
8128
+                
 
8129
+                default:
 
8130
+                {
 
8131
+                    Window *pChild = pWindow->GetChild( 0 );
 
8132
+                    if( pChild )
 
8133
+                    {
 
8134
+                        if( WINDOW_HELPTEXTWINDOW == pChild->GetType() )
 
8135
+                        {
 
8136
+                            role = ATK_ROLE_TOOL_TIP;
 
8137
+                            pChild->SetAccessibleRole( accessibility::AccessibleRole::LABEL );
 
8138
+                        }
 
8139
+                    }
 
8140
+                    break;
 
8141
+                }
 
8142
+            }
 
8143
+        }
 
8144
+    }
 
8145
+    
 
8146
+    return role;
 
8147
+}
 
8148
+
 
8149
+
 
8150
+// FIXME: rename as appropriate
 
8151
+uno::Reference< accessibility::XAccessible >
 
8152
+GtkSalFrame::getAccessible( bool bCreate )
 
8153
+{
 
8154
+       // Yes - this is a hack - but: this abstraction seems totally useless to me
 
8155
+       Window *pWindow = static_cast<Window *>(GetInstance());
 
8156
+    
 
8157
+    g_return_val_if_fail( pWindow != NULL, NULL );
 
8158
+    
 
8159
+    // skip the border window accessible
 
8160
+    if( pWindow->GetType() == WINDOW_BORDERWINDOW )
 
8161
+    {
 
8162
+        pWindow = pWindow->GetAccessibleChildWindow( 0 );
 
8163
+        g_return_val_if_fail( pWindow != NULL, NULL );
 
8164
+    }
 
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);
 
8169
+    
 
8170
+    return pWindow->GetAccessible( bCreate );
 
8171
+}
 
8172
+
 
8173
 void GtkSalFrame::Init( SalFrame* pParent, ULONG nStyle )
 
8174
 {
 
8175
     if( nStyle & SAL_FRAME_STYLE_DEFAULT ) // ensure default style
 
8176
@@ -590,6 +728,8 @@ void GtkSalFrame::Init( SalFrame* pParen
 
8177
     }
 
8178
 
 
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 );
 
8181
+
 
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
 
8194
@@ -0,0 +1,45 @@
 
8195
+/*************************************************************************
 
8196
+ *
 
8197
+ *  OpenOffice.org - a multi-platform office productivity suite
 
8198
+ *
 
8199
+ *  $RCSfile: cws-atkbridge-20060425.diff,v $
 
8200
+ *
 
8201
+ *  $Revision: 1.1.2.1 $
 
8202
+ *
 
8203
+ *  last change: $Author: michael $ $Date: 2006/04/26 11:54:34 $
 
8204
+ *
 
8205
+ *  The Contents of this file are made available subject to
 
8206
+ *  the terms of GNU Lesser General Public License Version 2.1.
 
8207
+ *
 
8208
+ *
 
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
 
8213
+ *
 
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.
 
8217
+ *
 
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.
 
8222
+ *
 
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
 
8227
+ *
 
8228
+ ************************************************************************/
 
8229
+
 
8230
+#ifndef __ATK_BRIDGE_HXX__
 
8231
+#define __ATK_BRIDGE_HXX__
 
8232
+
 
8233
+#ifndef _VCL_DLLAPI_H
 
8234
+#include <dllapi.h>
 
8235
+#endif
 
8236
+
 
8237
+void VCL_DLLPUBLIC InitAtkBridge(void);
 
8238
+
 
8239
+#endif
 
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
 
8248
@@ -43,6 +43,9 @@
 
8249
 #include <gdk/gdkkeysyms.h>
 
8250
 #include <postx.h>
 
8251
 
 
8252
+#include <com/sun/star/uno/Reference.hxx>
 
8253
+#include <com/sun/star/accessibility/XAccessible.hdl>
 
8254
+
 
8255
 #ifndef _SV_SALFRAME_HXX
 
8256
 #include <salframe.hxx>
 
8257
 #endif
 
8258
@@ -355,7 +358,20 @@ public:
 
8259
     virtual bool                SetPluginParent( SystemParentData* pNewParent );
 
8260
 
 
8261
     virtual void                SetBackgroundBitmap( SalBitmap* );
 
8262
+
 
8263
+       static GtkSalFrame         *getFromWindow( GtkWindow *pWindow );
 
8264
+       ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > getAccessible( bool bCreate = true );
 
8265
+    
 
8266
+    static AtkRole              GetAtkRole( GtkWindow* window );
 
8267
 };
 
8268
 
 
8269
 
 
8270
+#define OOO_TYPE_FIXED ooo_fixed_get_type()
 
8271
+
 
8272
+extern "C" {
 
8273
+
 
8274
+GType ooo_fixed_get_type( void );
 
8275
+
 
8276
+} // extern "C"
 
8277
+
 
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_
 
8299
 LIB4FILES=\
 
8300
                        $(SLB)$/gtkapp.lib\
 
8301
+                       $(SLB)$/gtka11y.lib \
 
8302
                        $(SLB)$/gtkgdi.lib\
 
8303
                        $(SLB)$/gtkwin.lib
 
8304
+
 
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