Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include <com/sun/star/awt/WindowEvent.hpp>
31 : : #include <com/sun/star/awt/KeyEvent.hpp>
32 : : #include <com/sun/star/awt/KeyModifier.hpp>
33 : : #include <com/sun/star/awt/MouseEvent.hpp>
34 : : #include <com/sun/star/awt/MouseButton.hpp>
35 : : #include <com/sun/star/awt/MouseWheelBehavior.hpp>
36 : : #include <com/sun/star/awt/XTopWindow.hpp>
37 : : #include <com/sun/star/awt/Style.hpp>
38 : : #include <com/sun/star/accessibility/AccessibleRole.hpp>
39 : : #include <com/sun/star/awt/DockingEvent.hpp>
40 : : #include <com/sun/star/awt/EndDockingEvent.hpp>
41 : : #include <com/sun/star/awt/EndPopupModeEvent.hpp>
42 : : #include <com/sun/star/awt/XWindowListener2.hpp>
43 : : #include <com/sun/star/style/VerticalAlignment.hpp>
44 : : #include <com/sun/star/lang/DisposedException.hpp>
45 : : #include <com/sun/star/text/WritingMode2.hpp>
46 : : #include <toolkit/awt/vclxwindow.hxx>
47 : : #include <toolkit/awt/vclxpointer.hxx>
48 : : #include <toolkit/awt/vclxwindows.hxx>
49 : : #include <toolkit/helper/macros.hxx>
50 : : #include <toolkit/helper/vclunohelper.hxx>
51 : : #include <toolkit/helper/convert.hxx>
52 : : #include <toolkit/helper/macros.hxx>
53 : : #include <toolkit/helper/property.hxx>
54 : : #include <toolkit/helper/accessibilityclient.hxx>
55 : : #include <cppuhelper/typeprovider.hxx>
56 : : #include <rtl/memory.h>
57 : : #include <rtl/uuid.h>
58 : : #include <rtl/ustrbuf.hxx>
59 : : #include <vcl/svapp.hxx>
60 : : #include <vcl/window.hxx>
61 : : #include <tools/color.hxx>
62 : : #include <vcl/dockwin.hxx>
63 : : #include <vcl/pdfextoutdevdata.hxx>
64 : : #include <vcl/tabpage.hxx>
65 : : #include <vcl/button.hxx>
66 : : #include <comphelper/asyncnotification.hxx>
67 : : #include <comphelper/flagguard.hxx>
68 : : #include "stylesettings.hxx"
69 : : #include <tools/urlobj.hxx>
70 : : #include <toolkit/helper/unopropertyarrayhelper.hxx>
71 : :
72 : : #include <boost/bind.hpp>
73 : :
74 : : using namespace ::com::sun::star;
75 : :
76 : : using ::com::sun::star::uno::Reference;
77 : : using ::com::sun::star::uno::UNO_QUERY;
78 : : using ::com::sun::star::uno::RuntimeException;
79 : : using ::com::sun::star::lang::EventObject;
80 : : using ::com::sun::star::awt::XWindowListener2;
81 : : using ::com::sun::star::awt::XDockableWindowListener;
82 : : using ::com::sun::star::awt::XDevice;
83 : : using ::com::sun::star::awt::XStyleSettings;
84 : : using ::com::sun::star::lang::DisposedException;
85 : : using ::com::sun::star::style::VerticalAlignment;
86 : : using ::com::sun::star::style::VerticalAlignment_TOP;
87 : : using ::com::sun::star::style::VerticalAlignment_MIDDLE;
88 : : using ::com::sun::star::style::VerticalAlignment_BOTTOM;
89 : : using ::com::sun::star::style::VerticalAlignment_MAKE_FIXED_SIZE;
90 : :
91 : : namespace WritingMode2 = ::com::sun::star::text::WritingMode2;
92 : : namespace MouseWheelBehavior = ::com::sun::star::awt::MouseWheelBehavior;
93 : :
94 : : //====================================================================
95 : : //= VCLXWindowImpl
96 : : //====================================================================
97 : : class SAL_DLLPRIVATE VCLXWindowImpl
98 : : {
99 : : private:
100 : : typedef ::std::vector< VCLXWindow::Callback > CallbackArray;
101 : :
102 : : private:
103 : : VCLXWindow& mrAntiImpl;
104 : : ::toolkit::AccessibilityClient maAccFactory;
105 : : bool mbDisposed;
106 : : bool mbDrawingOntoParent; // no bit mask, is passed around by reference
107 : : sal_Bool mbEnableVisible;
108 : : sal_Bool mbDirectVisible;
109 : :
110 : : ::osl::Mutex maListenerContainerMutex;
111 : : ::cppu::OInterfaceContainerHelper maWindow2Listeners;
112 : : ::cppu::OInterfaceContainerHelper maDockableWindowListeners;
113 : : EventListenerMultiplexer maEventListeners;
114 : : FocusListenerMultiplexer maFocusListeners;
115 : : WindowListenerMultiplexer maWindowListeners;
116 : : KeyListenerMultiplexer maKeyListeners;
117 : : MouseListenerMultiplexer maMouseListeners;
118 : : MouseMotionListenerMultiplexer maMouseMotionListeners;
119 : : PaintListenerMultiplexer maPaintListeners;
120 : : VclContainerListenerMultiplexer maContainerListeners;
121 : : TopWindowListenerMultiplexer maTopWindowListeners;
122 : :
123 : : CallbackArray maCallbackEvents;
124 : : sal_uLong mnCallbackEventId;
125 : :
126 : : public:
127 : : bool mbDisposing : 1;
128 : : bool mbDesignMode : 1;
129 : : bool mbSynthesizingVCLEvent : 1;
130 : : bool mbWithDefaultProps : 1;
131 : :
132 : : sal_uLong mnListenerLockLevel;
133 : : sal_Int16 mnWritingMode;
134 : : sal_Int16 mnContextWritingMode;
135 : :
136 : : UnoPropertyArrayHelper* mpPropHelper;
137 : :
138 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPointer >
139 : : mxPointer;
140 : : ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
141 : : mxAccessibleContext;
142 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >
143 : : mxViewGraphics;
144 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleSettings >
145 : : mxWindowStyleSettings;
146 : :
147 : : public:
148 : 0 : bool& getDrawingOntoParent_ref() { return mbDrawingOntoParent; }
149 : :
150 : : public:
151 : : /** ctor
152 : : @param _pAntiImpl
153 : : the <type>VCLXWindow</type> instance which the object belongs to. Must
154 : : live longer then the object just being constructed.
155 : : */
156 : : VCLXWindowImpl( VCLXWindow& _rAntiImpl, bool _bWithDefaultProps );
157 : :
158 : : /** synchronously mbEnableVisible
159 : : */
160 : 346 : void setEnableVisible( sal_Bool bEnableVisible ) { mbEnableVisible = bEnableVisible; }
161 : 21704 : sal_Bool isEnableVisible() { return mbEnableVisible; }
162 : : /** synchronously mbDirectVisible;
163 : : */
164 : 62229 : void setDirectVisible( sal_Bool bDirectVisible ) { mbDirectVisible = bDirectVisible; }
165 : 112 : sal_Bool isDirectVisible() { return mbDirectVisible; }
166 : :
167 : : /** impl-version of VCLXWindow::ImplExecuteAsyncWithoutSolarLock
168 : : */
169 : : void callBackAsync( const VCLXWindow::Callback& i_callback );
170 : :
171 : : /** notifies the object that its VCLXWindow is being disposed
172 : : */
173 : : void disposing();
174 : :
175 : 447 : inline ::toolkit::AccessibilityClient& getAccessibleFactory()
176 : : {
177 : 447 : return maAccFactory;
178 : : }
179 : :
180 : : Reference< XStyleSettings > getStyleSettings();
181 : :
182 : : /** returns the container of registered XWindowListener2 listeners
183 : : */
184 : 6319 : inline ::cppu::OInterfaceContainerHelper& getWindow2Listeners() { return maWindow2Listeners; }
185 : 3709 : inline ::cppu::OInterfaceContainerHelper& getDockableWindowListeners(){ return maDockableWindowListeners; }
186 : 264 : inline EventListenerMultiplexer& getEventListeners() { return maEventListeners; }
187 : 22513 : inline FocusListenerMultiplexer& getFocusListeners() { return maFocusListeners; }
188 : 208372 : inline WindowListenerMultiplexer& getWindowListeners() { return maWindowListeners; }
189 : 169 : inline KeyListenerMultiplexer& getKeyListeners() { return maKeyListeners; }
190 : 67 : inline MouseListenerMultiplexer& getMouseListeners() { return maMouseListeners; }
191 : 0 : inline MouseMotionListenerMultiplexer& getMouseMotionListeners() { return maMouseMotionListeners; }
192 : 2301 : inline PaintListenerMultiplexer& getPaintListeners() { return maPaintListeners; }
193 : 72996 : inline VclContainerListenerMultiplexer& getContainerListeners() { return maContainerListeners; }
194 : 83623 : inline TopWindowListenerMultiplexer& getTopWindowListeners() { return maTopWindowListeners; }
195 : :
196 : : virtual ~VCLXWindowImpl();
197 : :
198 : : protected:
199 : : virtual void SAL_CALL acquire();
200 : : virtual void SAL_CALL release();
201 : :
202 : : private:
203 : : DECL_LINK( OnProcessCallbacks, void* );
204 : :
205 : : private:
206 : : VCLXWindowImpl(); // never implemented
207 : : VCLXWindowImpl( const VCLXWindowImpl& ); // never implemented
208 : : VCLXWindowImpl& operator=( const VCLXWindowImpl& ); // never implemented
209 : : };
210 : :
211 : : //--------------------------------------------------------------------
212 : 39606 : VCLXWindowImpl::VCLXWindowImpl( VCLXWindow& _rAntiImpl, bool _bWithDefaultProps )
213 : : :mrAntiImpl( _rAntiImpl )
214 : : ,mbDisposed( false )
215 : : ,mbDrawingOntoParent( false )
216 : : ,mbEnableVisible(sal_True)
217 : : ,mbDirectVisible(sal_True)
218 : : ,maListenerContainerMutex( )
219 : : ,maWindow2Listeners( maListenerContainerMutex )
220 : : ,maDockableWindowListeners( maListenerContainerMutex )
221 : : ,maEventListeners( _rAntiImpl )
222 : : ,maFocusListeners( _rAntiImpl )
223 : : ,maWindowListeners( _rAntiImpl )
224 : : ,maKeyListeners( _rAntiImpl )
225 : : ,maMouseListeners( _rAntiImpl )
226 : : ,maMouseMotionListeners( _rAntiImpl )
227 : : ,maPaintListeners( _rAntiImpl )
228 : : ,maContainerListeners( _rAntiImpl )
229 : : ,maTopWindowListeners( _rAntiImpl )
230 : : ,mnCallbackEventId( 0 )
231 : : ,mbDisposing( false )
232 : : ,mbDesignMode( false )
233 : : ,mbSynthesizingVCLEvent( false )
234 : : ,mbWithDefaultProps( _bWithDefaultProps )
235 : : ,mnListenerLockLevel( 0 )
236 : : ,mnWritingMode( WritingMode2::CONTEXT )
237 : : ,mnContextWritingMode( WritingMode2::CONTEXT )
238 [ + - ][ + - ]: 39606 : ,mpPropHelper( NULL )
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
239 : : {
240 : 39606 : }
241 : :
242 [ + - ][ + - ]: 37181 : VCLXWindowImpl::~VCLXWindowImpl()
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
243 : : {
244 [ - + ][ # # ]: 37181 : delete mpPropHelper;
245 [ - + ]: 74362 : }
246 : :
247 : : //--------------------------------------------------------------------
248 : 40277 : void VCLXWindowImpl::disposing()
249 : : {
250 [ + - ]: 40277 : SolarMutexGuard aGuard;
251 [ + + ]: 40277 : if ( mnCallbackEventId )
252 [ + - ]: 1039 : Application::RemoveUserEvent( mnCallbackEventId );
253 : 40277 : mnCallbackEventId = 0;
254 : :
255 : 40277 : mbDisposed= true;
256 : :
257 [ + - ]: 40277 : ::com::sun::star::lang::EventObject aEvent;
258 [ + - ][ + - ]: 40277 : aEvent.Source = mrAntiImpl;
259 : :
260 [ + - ]: 40277 : maDockableWindowListeners.disposeAndClear( aEvent );
261 [ + - ]: 40277 : maEventListeners.disposeAndClear( aEvent );
262 [ + - ]: 40277 : maFocusListeners.disposeAndClear( aEvent );
263 [ + - ]: 40277 : maWindowListeners.disposeAndClear( aEvent );
264 [ + - ]: 40277 : maKeyListeners.disposeAndClear( aEvent );
265 [ + - ]: 40277 : maMouseListeners.disposeAndClear( aEvent );
266 [ + - ]: 40277 : maMouseMotionListeners.disposeAndClear( aEvent );
267 [ + - ]: 40277 : maPaintListeners.disposeAndClear( aEvent );
268 [ + - ]: 40277 : maContainerListeners.disposeAndClear( aEvent );
269 [ + - ]: 40277 : maTopWindowListeners.disposeAndClear( aEvent );
270 : :
271 [ + - ][ - + ]: 40277 : ::toolkit::WindowStyleSettings* pStyleSettings = static_cast< ::toolkit::WindowStyleSettings* >( mxWindowStyleSettings.get() );
272 [ - + ]: 40277 : if ( pStyleSettings != NULL )
273 [ # # ]: 0 : pStyleSettings->dispose();
274 [ + - ][ + - ]: 40277 : mxWindowStyleSettings.clear();
275 : 40277 : }
276 : :
277 : : //--------------------------------------------------------------------
278 : 5038 : void VCLXWindowImpl::callBackAsync( const VCLXWindow::Callback& i_callback )
279 : : {
280 : : DBG_TESTSOLARMUTEX();
281 : 5038 : maCallbackEvents.push_back( i_callback );
282 [ + + ]: 5038 : if ( !mnCallbackEventId )
283 : : {
284 : : // ensure our VCLXWindow is not destroyed while the event is underway
285 : 2419 : mrAntiImpl.acquire();
286 [ + - ]: 2419 : mnCallbackEventId = Application::PostUserEvent( LINK( this, VCLXWindowImpl, OnProcessCallbacks ) );
287 : : }
288 : 5038 : }
289 : :
290 : : //----------------------------------------------------------------------------------------------------------------------
291 : 1380 : IMPL_LINK_NOARG(VCLXWindowImpl, OnProcessCallbacks)
292 : : {
293 [ + - ]: 1380 : const Reference< uno::XInterface > xKeepAlive( mrAntiImpl );
294 : :
295 : : // work on a copy of the callback array
296 [ + - ]: 1380 : CallbackArray aCallbacksCopy;
297 : : {
298 [ + - ]: 1380 : SolarMutexGuard aGuard;
299 [ + - ]: 1380 : aCallbacksCopy = maCallbackEvents;
300 : 1380 : maCallbackEvents.clear();
301 : :
302 : : // we acquired our VCLXWindow once before posting the event, release this one ref now
303 : 1380 : mrAntiImpl.release();
304 : :
305 [ - + ]: 1380 : if ( !mnCallbackEventId )
306 : : // we were disposed while waiting for the mutex to lock
307 : 0 : return 1L;
308 : :
309 [ + - ][ + - ]: 1380 : mnCallbackEventId = 0;
310 : : }
311 : :
312 : : {
313 [ + - ]: 1380 : SolarMutexReleaser aReleaseSolar;
314 [ + - ][ + - ]: 8184 : for ( CallbackArray::const_iterator loop = aCallbacksCopy.begin();
[ + + ]
315 : 4092 : loop != aCallbacksCopy.end();
316 : : ++loop
317 : : )
318 : : {
319 [ + - ]: 2712 : (*loop)();
320 [ + - ]: 1380 : }
321 : : }
322 : :
323 : 1380 : return 0L;
324 : : }
325 : :
326 : : //--------------------------------------------------------------------
327 : 0 : void SAL_CALL VCLXWindowImpl::acquire()
328 : : {
329 : 0 : mrAntiImpl.acquire();
330 : 0 : }
331 : :
332 : : //--------------------------------------------------------------------
333 : 0 : void SAL_CALL VCLXWindowImpl::release()
334 : : {
335 : 0 : mrAntiImpl.release();
336 : 0 : }
337 : :
338 : : //--------------------------------------------------------------------
339 : 0 : Reference< XStyleSettings > VCLXWindowImpl::getStyleSettings()
340 : : {
341 [ # # ]: 0 : SolarMutexGuard aGuard;
342 [ # # ]: 0 : if ( mbDisposed )
343 [ # # ][ # # ]: 0 : throw DisposedException( ::rtl::OUString(), mrAntiImpl );
344 [ # # ]: 0 : if ( !mxWindowStyleSettings.is() )
345 [ # # ][ # # ]: 0 : mxWindowStyleSettings = new ::toolkit::WindowStyleSettings( maListenerContainerMutex, mrAntiImpl );
[ # # ]
346 [ # # ]: 0 : return mxWindowStyleSettings;
347 : : }
348 : :
349 : : //====================================================================
350 : : //====================================================================
351 : :
352 : : // Uses an out-parameter instead of return value, due to the object reference
353 : :
354 : 41845 : void ImplInitWindowEvent( ::com::sun::star::awt::WindowEvent& rEvent, Window* pWindow )
355 : : {
356 [ + - ]: 41845 : Point aPos = pWindow->GetPosPixel();
357 [ + - ]: 41845 : Size aSz = pWindow->GetSizePixel();
358 : :
359 : 41845 : rEvent.X = aPos.X();
360 : 41845 : rEvent.Y = aPos.Y();
361 : :
362 : 41845 : rEvent.Width = aSz.Width();
363 : 41845 : rEvent.Height = aSz.Height();
364 : :
365 [ + - ]: 41845 : pWindow->GetBorder( rEvent.LeftInset, rEvent.TopInset, rEvent.RightInset, rEvent.BottomInset );
366 : 41845 : }
367 : :
368 : : // ----------------------------------------------------
369 : : // class VCLXWindow
370 : : // ----------------------------------------------------
371 : :
372 : : DBG_NAME(VCLXWindow);
373 : :
374 : 39606 : VCLXWindow::VCLXWindow( bool _bWithDefaultProps )
375 : 39606 : :mpImpl( NULL )
376 : : {
377 : : DBG_CTOR( VCLXWindow, 0 );
378 : :
379 [ + - ][ + - ]: 39606 : mpImpl = new VCLXWindowImpl( *this, _bWithDefaultProps );
380 : 39606 : }
381 : :
382 : 37181 : VCLXWindow::~VCLXWindow()
383 : : {
384 : : DBG_DTOR( VCLXWindow, 0 );
385 : :
386 [ + - ][ + - ]: 37181 : delete mpImpl;
387 : :
388 [ - + ]: 37181 : if ( GetWindow() )
389 : : {
390 [ # # ][ # # ]: 0 : GetWindow()->RemoveEventListener( LINK( this, VCLXWindow, WindowEventListener ) );
391 [ # # ][ # # ]: 0 : GetWindow()->SetWindowPeer( NULL, NULL );
392 [ # # ][ # # ]: 0 : GetWindow()->SetAccessible( NULL );
393 : : }
394 [ - + ]: 58853 : }
395 : :
396 : : //----------------------------------------------------------------------------------------------------------------------
397 : 5038 : void VCLXWindow::ImplExecuteAsyncWithoutSolarLock( const Callback& i_callback )
398 : : {
399 : 5038 : mpImpl->callBackAsync( i_callback );
400 : 5038 : }
401 : :
402 : : //----------------------------------------------------------------------------------------------------------------------
403 : 447 : ::toolkit::IAccessibleFactory& VCLXWindow::getAccessibleFactory()
404 : : {
405 : 447 : return mpImpl->getAccessibleFactory().getFactory();
406 : : }
407 : :
408 : 98702 : void VCLXWindow::SetWindow( Window* pWindow )
409 : : {
410 [ + + ]: 98702 : if ( GetWindow() )
411 : : {
412 [ + - ]: 59096 : GetWindow()->RemoveEventListener( LINK( this, VCLXWindow, WindowEventListener ) );
413 : : // GetWindow()->DbgAssertNoEventListeners();
414 : : }
415 : :
416 : 98702 : SetOutputDevice( pWindow );
417 : :
418 [ + + ]: 98702 : if ( GetWindow() )
419 : : {
420 [ + - ]: 39608 : GetWindow()->AddEventListener( LINK( this, VCLXWindow, WindowEventListener ) );
421 [ + - ]: 39608 : sal_Bool bDirectVisible = pWindow ? pWindow->IsVisible() : false;
422 : 39608 : mpImpl->setDirectVisible( bDirectVisible );
423 : : }
424 : 98702 : }
425 : :
426 : 9550 : void VCLXWindow::suspendVclEventListening( )
427 : : {
428 : 9550 : ++mpImpl->mnListenerLockLevel;
429 : 9550 : }
430 : :
431 : 9550 : void VCLXWindow::resumeVclEventListening( )
432 : : {
433 : : DBG_ASSERT( mpImpl->mnListenerLockLevel, "VCLXWindow::resumeVclEventListening: not suspended!" );
434 : 9550 : --mpImpl->mnListenerLockLevel;
435 : 9550 : }
436 : :
437 : 72996 : void VCLXWindow::notifyWindowRemoved( Window& _rWindow )
438 : : {
439 [ - + ]: 72996 : if ( mpImpl->getContainerListeners().getLength() )
440 : : {
441 [ # # ]: 0 : awt::VclContainerEvent aEvent;
442 [ # # ][ # # ]: 0 : aEvent.Source = *this;
443 [ # # ][ # # ]: 0 : aEvent.Child = static_cast< XWindow* >( _rWindow.GetWindowPeer() );
[ # # ]
444 [ # # ][ # # ]: 0 : mpImpl->getContainerListeners().windowRemoved( aEvent );
445 : : }
446 : 72996 : }
447 : :
448 : 1026081 : IMPL_LINK( VCLXWindow, WindowEventListener, VclSimpleEvent*, pEvent )
449 : : {
450 [ + + ]: 1026081 : if ( mpImpl->mnListenerLockLevel )
451 : 2750 : return 0L;
452 : :
453 : : DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" );
454 [ + - ][ + - ]: 1023331 : if ( pEvent && pEvent->ISA( VclWindowEvent ) )
[ + - ]
455 : : {
456 : : DBG_ASSERT( ((VclWindowEvent*)pEvent)->GetWindow() && GetWindow(), "Window???" );
457 : 1023331 : ProcessWindowEvent( *(VclWindowEvent*)pEvent );
458 : : }
459 : 1026081 : return 0;
460 : : }
461 : :
462 : : namespace
463 : : {
464 : 73764 : struct CallWindow2Listener
465 : : {
466 : 5036 : CallWindow2Listener( ::cppu::OInterfaceContainerHelper& i_rWindow2Listeners, const bool i_bEnabled, const EventObject& i_rEvent )
467 : : :m_rWindow2Listeners( i_rWindow2Listeners )
468 : : ,m_bEnabled( i_bEnabled )
469 : 5036 : ,m_aEvent( i_rEvent )
470 : : {
471 : 5036 : }
472 : :
473 : 2710 : void operator()()
474 : : {
475 [ + + ]: 2710 : m_rWindow2Listeners.notifyEach( m_bEnabled ? &XWindowListener2::windowEnabled : &XWindowListener2::windowDisabled, m_aEvent );
476 : 2710 : }
477 : :
478 : : ::cppu::OInterfaceContainerHelper& m_rWindow2Listeners;
479 : : const bool m_bEnabled;
480 : : const EventObject m_aEvent;
481 : : };
482 : : }
483 : :
484 : 1022841 : void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
485 : : {
486 [ + - ]: 1022841 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xThis( (::cppu::OWeakObject*)this );
487 : :
488 [ + + + + : 1022841 : switch ( rVclWindowEvent.GetId() )
+ + + + -
+ + + + -
- - - - -
- - - - -
- + ]
489 : : {
490 : : case VCLEVENT_WINDOW_ENABLED:
491 : : case VCLEVENT_WINDOW_DISABLED:
492 : : {
493 : : Callback aCallback = CallWindow2Listener(
494 : 5036 : mpImpl->getWindow2Listeners(),
495 : 5036 : ( VCLEVENT_WINDOW_ENABLED == rVclWindowEvent.GetId() ),
496 : : EventObject( *this )
497 [ + - ]: 10072 : );
[ + - + - ]
[ + - ][ + - ]
[ + - ]
498 [ + - ][ + - ]: 5036 : ImplExecuteAsyncWithoutSolarLock( aCallback );
499 : : }
500 : 5036 : break;
501 : :
502 : : case VCLEVENT_WINDOW_PAINT:
503 : : {
504 [ + - ][ - + ]: 2301 : if ( mpImpl->getPaintListeners().getLength() )
505 : : {
506 [ # # ]: 0 : ::com::sun::star::awt::PaintEvent aEvent;
507 [ # # ]: 0 : aEvent.Source = (::cppu::OWeakObject*)this;
508 [ # # ]: 0 : aEvent.UpdateRect = AWTRectangle( *(Rectangle*)rVclWindowEvent.GetData() );
509 : 0 : aEvent.Count = 0;
510 [ # # ][ # # ]: 0 : mpImpl->getPaintListeners().windowPaint( aEvent );
511 : : }
512 : : }
513 : 2301 : break;
514 : : case VCLEVENT_WINDOW_MOVE:
515 : : {
516 [ + - ][ + + ]: 48063 : if ( mpImpl->getWindowListeners().getLength() )
517 : : {
518 [ + - ]: 10546 : ::com::sun::star::awt::WindowEvent aEvent;
519 [ + - ]: 10546 : aEvent.Source = (::cppu::OWeakObject*)this;
520 [ + - ]: 10546 : ImplInitWindowEvent( aEvent, rVclWindowEvent.GetWindow() );
521 [ + - ][ + - ]: 10546 : mpImpl->getWindowListeners().windowMoved( aEvent );
522 : : }
523 : : }
524 : 48063 : break;
525 : : case VCLEVENT_WINDOW_RESIZE:
526 : : {
527 [ + - ][ + + ]: 42708 : if ( mpImpl->getWindowListeners().getLength() )
528 : : {
529 [ + - ]: 9564 : ::com::sun::star::awt::WindowEvent aEvent;
530 [ + - ]: 9564 : aEvent.Source = (::cppu::OWeakObject*)this;
531 [ + - ]: 9564 : ImplInitWindowEvent( aEvent, rVclWindowEvent.GetWindow() );
532 [ + - ][ + - ]: 9564 : mpImpl->getWindowListeners().windowResized( aEvent );
533 : : }
534 : : }
535 : 42708 : break;
536 : : case VCLEVENT_WINDOW_SHOW:
537 : : {
538 [ + - ][ + + ]: 34848 : if ( mpImpl->getWindowListeners().getLength() )
539 : : {
540 [ + - ]: 14097 : ::com::sun::star::awt::WindowEvent aEvent;
541 [ + - ]: 14097 : aEvent.Source = (::cppu::OWeakObject*)this;
542 [ + - ]: 14097 : ImplInitWindowEvent( aEvent, rVclWindowEvent.GetWindow() );
543 [ + - ][ + - ]: 14097 : mpImpl->getWindowListeners().windowShown( aEvent );
544 : : }
545 : :
546 : : // For TopWindows this means opened...
547 [ + - ][ + + ]: 34848 : if ( mpImpl->getTopWindowListeners().getLength() )
548 : : {
549 [ + - ]: 3450 : ::com::sun::star::lang::EventObject aEvent;
550 [ + - ]: 3450 : aEvent.Source = (::cppu::OWeakObject*)this;
551 [ + - ][ + - ]: 3450 : mpImpl->getTopWindowListeners().windowOpened( aEvent );
552 : : }
553 : : }
554 : 34848 : break;
555 : : case VCLEVENT_WINDOW_HIDE:
556 : : {
557 [ + - ][ + + ]: 20512 : if ( mpImpl->getWindowListeners().getLength() )
558 : : {
559 [ + - ]: 7638 : ::com::sun::star::awt::WindowEvent aEvent;
560 [ + - ]: 7638 : aEvent.Source = (::cppu::OWeakObject*)this;
561 [ + - ]: 7638 : ImplInitWindowEvent( aEvent, rVclWindowEvent.GetWindow() );
562 [ + - ][ + - ]: 7638 : mpImpl->getWindowListeners().windowHidden( aEvent );
563 : : }
564 : :
565 : : // For TopWindows this means closed...
566 [ + - ][ + + ]: 20512 : if ( mpImpl->getTopWindowListeners().getLength() )
567 : : {
568 [ + - ]: 2 : ::com::sun::star::lang::EventObject aEvent;
569 [ + - ]: 2 : aEvent.Source = (::cppu::OWeakObject*)this;
570 [ + - ][ + - ]: 2 : mpImpl->getTopWindowListeners().windowClosed( aEvent );
571 : : }
572 : : }
573 : 20512 : break;
574 : : case VCLEVENT_WINDOW_ACTIVATE:
575 : : {
576 [ + - ][ + + ]: 7895 : if ( mpImpl->getTopWindowListeners().getLength() )
577 : : {
578 [ + - ]: 2654 : ::com::sun::star::lang::EventObject aEvent;
579 [ + - ]: 2654 : aEvent.Source = (::cppu::OWeakObject*)this;
580 [ + - ][ + - ]: 2654 : mpImpl->getTopWindowListeners().windowActivated( aEvent );
581 : : }
582 : : }
583 : 7895 : break;
584 : : case VCLEVENT_WINDOW_DEACTIVATE:
585 : : {
586 [ + - ][ + + ]: 3682 : if ( mpImpl->getTopWindowListeners().getLength() )
587 : : {
588 [ + - ]: 148 : ::com::sun::star::lang::EventObject aEvent;
589 [ + - ]: 148 : aEvent.Source = (::cppu::OWeakObject*)this;
590 [ + - ][ + - ]: 148 : mpImpl->getTopWindowListeners().windowDeactivated( aEvent );
591 : : }
592 : : }
593 : 3682 : break;
594 : : case VCLEVENT_WINDOW_CLOSE:
595 : : {
596 [ # # ][ # # ]: 0 : if ( mpImpl->getDockableWindowListeners().getLength() )
597 : : {
598 [ # # ]: 0 : ::com::sun::star::lang::EventObject aEvent;
599 [ # # ]: 0 : aEvent.Source = (::cppu::OWeakObject*)this;
600 [ # # ][ # # ]: 0 : mpImpl->getDockableWindowListeners().notifyEach( &XDockableWindowListener::closed, aEvent );
601 : : }
602 [ # # ][ # # ]: 0 : if ( mpImpl->getTopWindowListeners().getLength() )
603 : : {
604 [ # # ]: 0 : ::com::sun::star::lang::EventObject aEvent;
605 [ # # ]: 0 : aEvent.Source = (::cppu::OWeakObject*)this;
606 [ # # ][ # # ]: 0 : mpImpl->getTopWindowListeners().windowClosing( aEvent );
607 : : }
608 : : }
609 : 0 : break;
610 : : case VCLEVENT_CONTROL_GETFOCUS:
611 : : case VCLEVENT_WINDOW_GETFOCUS:
612 : : {
613 [ + - ]: 18266 : if ( ( rVclWindowEvent.GetWindow()->IsCompoundControl()
[ + + + + ]
[ + + + + ]
[ + + ]
614 : 12 : && rVclWindowEvent.GetId() == VCLEVENT_CONTROL_GETFOCUS
615 : : )
616 [ + - ]: 6086 : || ( !rVclWindowEvent.GetWindow()->IsCompoundControl()
617 : 6078 : && rVclWindowEvent.GetId() == VCLEVENT_WINDOW_GETFOCUS
618 : : )
619 : : )
620 : : {
621 [ + - ][ + + ]: 6029 : if ( mpImpl->getFocusListeners().getLength() )
622 : : {
623 [ + - ]: 1494 : ::com::sun::star::awt::FocusEvent aEvent;
624 [ + - ]: 1494 : aEvent.Source = (::cppu::OWeakObject*)this;
625 [ + - ]: 1494 : aEvent.FocusFlags = rVclWindowEvent.GetWindow()->GetGetFocusFlags();
626 : 1494 : aEvent.Temporary = sal_False;
627 [ + - ][ + - ]: 1494 : mpImpl->getFocusListeners().focusGained( aEvent );
628 : : }
629 : : }
630 : : }
631 : 6090 : break;
632 : : case VCLEVENT_CONTROL_LOSEFOCUS:
633 : : case VCLEVENT_WINDOW_LOSEFOCUS:
634 : : {
635 [ + - ]: 10230 : if ( ( rVclWindowEvent.GetWindow()->IsCompoundControl()
[ - + # # ]
[ + - + + ]
[ + + ]
636 : 0 : && rVclWindowEvent.GetId() == VCLEVENT_CONTROL_LOSEFOCUS
637 : : )
638 [ + - ]: 3410 : || ( !rVclWindowEvent.GetWindow()->IsCompoundControl()
639 : 3410 : && rVclWindowEvent.GetId() == VCLEVENT_WINDOW_LOSEFOCUS
640 : : )
641 : : )
642 : : {
643 [ + - ][ + + ]: 3396 : if ( mpImpl->getFocusListeners().getLength() )
644 : : {
645 [ + - ]: 1090 : ::com::sun::star::awt::FocusEvent aEvent;
646 [ + - ]: 1090 : aEvent.Source = (::cppu::OWeakObject*)this;
647 [ + - ]: 1090 : aEvent.FocusFlags = rVclWindowEvent.GetWindow()->GetGetFocusFlags();
648 : 1090 : aEvent.Temporary = sal_False;
649 : :
650 [ + - ]: 1090 : Window* pNext = Application::GetFocusWindow();
651 [ + + ]: 1090 : if ( pNext )
652 : : {
653 : : // Don't care about internals if this control is compound
654 : 1084 : Window* pNextC = pNext;
655 [ + + ][ + - ]: 4354 : while ( pNextC && !pNextC->IsCompoundControl() )
[ + - ][ + + ]
656 [ + - ]: 3270 : pNextC = pNextC->GetParent();
657 [ - + ]: 1084 : if ( pNextC )
658 : 0 : pNext = pNextC;
659 : :
660 [ + - ]: 1084 : pNext->GetComponentInterface( sal_True );
661 [ + - ][ + - ]: 1084 : aEvent.NextFocus = (::cppu::OWeakObject*)pNext->GetWindowPeer();
[ + - ]
662 : : }
663 [ + - ][ + - ]: 1090 : mpImpl->getFocusListeners().focusLost( aEvent );
664 : : }
665 : : }
666 : : }
667 : 3410 : break;
668 : : case VCLEVENT_WINDOW_MINIMIZE:
669 : : {
670 [ + - ][ - + ]: 98 : if ( mpImpl->getTopWindowListeners().getLength() )
671 : : {
672 [ # # ]: 0 : ::com::sun::star::lang::EventObject aEvent;
673 [ # # ]: 0 : aEvent.Source = (::cppu::OWeakObject*)this;
674 [ # # ][ # # ]: 0 : mpImpl->getTopWindowListeners().windowMinimized( aEvent );
675 : : }
676 : : }
677 : 98 : break;
678 : : case VCLEVENT_WINDOW_NORMALIZE:
679 : : {
680 [ + - ][ - + ]: 77 : if ( mpImpl->getTopWindowListeners().getLength() )
681 : : {
682 [ # # ]: 0 : ::com::sun::star::lang::EventObject aEvent;
683 [ # # ]: 0 : aEvent.Source = (::cppu::OWeakObject*)this;
684 [ # # ][ # # ]: 0 : mpImpl->getTopWindowListeners().windowNormalized( aEvent );
685 : : }
686 : : }
687 : 77 : break;
688 : : case VCLEVENT_WINDOW_KEYINPUT:
689 : : {
690 [ # # ][ # # ]: 0 : if ( mpImpl->getKeyListeners().getLength() )
691 : : {
692 : : ::com::sun::star::awt::KeyEvent aEvent( VCLUnoHelper::createKeyEvent(
693 : 0 : *(KeyEvent*)rVclWindowEvent.GetData(), *this
694 [ # # # # ]: 0 : ) );
695 [ # # ][ # # ]: 0 : mpImpl->getKeyListeners().keyPressed( aEvent );
696 : : }
697 : : }
698 : 0 : break;
699 : : case VCLEVENT_WINDOW_KEYUP:
700 : : {
701 [ # # ][ # # ]: 0 : if ( mpImpl->getKeyListeners().getLength() )
702 : : {
703 : : ::com::sun::star::awt::KeyEvent aEvent( VCLUnoHelper::createKeyEvent(
704 : 0 : *(KeyEvent*)rVclWindowEvent.GetData(), *this
705 [ # # # # ]: 0 : ) );
706 [ # # ][ # # ]: 0 : mpImpl->getKeyListeners().keyReleased( aEvent );
707 : : }
708 : : }
709 : 0 : break;
710 : : case VCLEVENT_WINDOW_COMMAND:
711 : : {
712 : 0 : CommandEvent* pCmdEvt = (CommandEvent*)rVclWindowEvent.GetData();
713 [ # # ][ # # ]: 0 : if ( mpImpl->getMouseListeners().getLength() && ( pCmdEvt->GetCommand() == COMMAND_CONTEXTMENU ) )
[ # # ][ # # ]
714 : : {
715 : : // COMMAND_CONTEXTMENU als mousePressed mit PopupTrigger = sal_True versenden...
716 : 0 : Point aWhere = static_cast< CommandEvent* >( rVclWindowEvent.GetData() )->GetMousePosPixel();
717 [ # # ]: 0 : if ( !pCmdEvt->IsMouseEvent() )
718 : : { // for keyboard events, we set the coordinates to -1,-1. This is a slight HACK, but the current API
719 : : // handles a context menu command as special case of a mouse event, which is simply wrong.
720 : : // Without extending the API, we would not have another chance to notify listeners of a
721 : : // keyboard-triggered context menu request
722 : 0 : aWhere = Point( -1, -1 );
723 : : }
724 : :
725 [ # # ]: 0 : MouseEvent aMEvt( aWhere, 1, MOUSE_SIMPLECLICK, MOUSE_LEFT, 0 );
726 [ # # ][ # # ]: 0 : awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( aMEvt, *this ) );
727 : 0 : aEvent.PopupTrigger = sal_True;
728 : :
729 : : Callback aCallback = ::boost::bind(
730 : : &MouseListenerMultiplexer::mousePressed,
731 : 0 : &mpImpl->getMouseListeners(),
732 : : aEvent
733 [ # # ][ # # ]: 0 : );
[ # # ]
[ # # # # ]
734 [ # # ][ # # ]: 0 : ImplExecuteAsyncWithoutSolarLock( aCallback );
[ # # ]
735 : : }
736 : : }
737 : 0 : break;
738 : : case VCLEVENT_WINDOW_MOUSEMOVE:
739 : : {
740 : 0 : MouseEvent* pMouseEvt = (MouseEvent*)rVclWindowEvent.GetData();
741 [ # # ][ # # ]: 0 : if ( mpImpl->getMouseListeners().getLength() && ( pMouseEvt->IsEnterWindow() || pMouseEvt->IsLeaveWindow() ) )
[ # # ][ # # ]
[ # # ]
742 : : {
743 [ # # ][ # # ]: 0 : awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *pMouseEvt, *this ) );
744 : :
745 : : Callback aCallback = ::boost::bind(
746 : 0 : pMouseEvt->IsEnterWindow() ? &MouseListenerMultiplexer::mouseEntered : &MouseListenerMultiplexer::mouseExited,
747 : 0 : &mpImpl->getMouseListeners(),
748 : : aEvent
749 [ # # ][ # # ]: 0 : );
[ # # ][ # # ]
[ # # # # ]
750 [ # # ][ # # ]: 0 : ImplExecuteAsyncWithoutSolarLock( aCallback );
[ # # ]
751 : : }
752 : :
753 [ # # ][ # # ]: 0 : if ( mpImpl->getMouseMotionListeners().getLength() && !pMouseEvt->IsEnterWindow() && !pMouseEvt->IsLeaveWindow() )
[ # # ][ # # ]
[ # # ]
754 : : {
755 [ # # ][ # # ]: 0 : awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *pMouseEvt, *this ) );
756 : 0 : aEvent.ClickCount = 0; // #92138#
757 [ # # ]: 0 : if ( pMouseEvt->GetMode() & MOUSE_SIMPLEMOVE )
758 [ # # ]: 0 : mpImpl->getMouseMotionListeners().mouseMoved( aEvent );
759 : : else
760 [ # # ][ # # ]: 0 : mpImpl->getMouseMotionListeners().mouseDragged( aEvent );
761 : : }
762 : : }
763 : 0 : break;
764 : : case VCLEVENT_WINDOW_MOUSEBUTTONDOWN:
765 : : {
766 [ # # ][ # # ]: 0 : if ( mpImpl->getMouseListeners().getLength() )
767 : : {
768 [ # # ][ # # ]: 0 : awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *(MouseEvent*)rVclWindowEvent.GetData(), *this ) );
769 : : Callback aCallback = ::boost::bind(
770 : : &MouseListenerMultiplexer::mousePressed,
771 : 0 : &mpImpl->getMouseListeners(),
772 : : aEvent
773 [ # # ][ # # ]: 0 : );
[ # # ]
[ # # # # ]
774 [ # # ][ # # ]: 0 : ImplExecuteAsyncWithoutSolarLock( aCallback );
[ # # ]
775 : : }
776 : : }
777 : 0 : break;
778 : : case VCLEVENT_WINDOW_MOUSEBUTTONUP:
779 : : {
780 [ # # ][ # # ]: 0 : if ( mpImpl->getMouseListeners().getLength() )
781 : : {
782 [ # # ][ # # ]: 0 : awt::MouseEvent aEvent( VCLUnoHelper::createMouseEvent( *(MouseEvent*)rVclWindowEvent.GetData(), *this ) );
783 : : Callback aCallback = ::boost::bind(
784 : : &MouseListenerMultiplexer::mouseReleased,
785 : 0 : &mpImpl->getMouseListeners(),
786 : : aEvent
787 [ # # ][ # # ]: 0 : );
[ # # ]
[ # # # # ]
788 [ # # ][ # # ]: 0 : ImplExecuteAsyncWithoutSolarLock( aCallback );
[ # # ]
789 : : }
790 : : }
791 : 0 : break;
792 : : case VCLEVENT_WINDOW_STARTDOCKING:
793 : : {
794 [ # # ][ # # ]: 0 : if ( mpImpl->getDockableWindowListeners().getLength() )
795 : : {
796 : 0 : DockingData *pData = (DockingData*)rVclWindowEvent.GetData();
797 : :
798 [ # # ]: 0 : if( pData )
799 : : {
800 [ # # ]: 0 : ::com::sun::star::awt::DockingEvent aEvent;
801 [ # # ]: 0 : aEvent.Source = (::cppu::OWeakObject*)this;
802 [ # # ]: 0 : aEvent.TrackingRectangle = AWTRectangle( pData->maTrackRect );
803 : 0 : aEvent.MousePos.X = pData->maMousePos.X();
804 : 0 : aEvent.MousePos.Y = pData->maMousePos.Y();
805 : 0 : aEvent.bLiveMode = pData->mbLivemode;
806 : 0 : aEvent.bInteractive = pData->mbInteractive;
807 : :
808 [ # # ][ # # ]: 0 : mpImpl->getDockableWindowListeners().notifyEach( &XDockableWindowListener::startDocking, aEvent );
809 : : }
810 : : }
811 : : }
812 : 0 : break;
813 : : case VCLEVENT_WINDOW_DOCKING:
814 : : {
815 [ # # ][ # # ]: 0 : if ( mpImpl->getDockableWindowListeners().getLength() )
816 : : {
817 : 0 : DockingData *pData = (DockingData*)rVclWindowEvent.GetData();
818 : :
819 [ # # ]: 0 : if( pData )
820 : : {
821 [ # # ]: 0 : ::com::sun::star::awt::DockingEvent aEvent;
822 [ # # ]: 0 : aEvent.Source = (::cppu::OWeakObject*)this;
823 [ # # ]: 0 : aEvent.TrackingRectangle = AWTRectangle( pData->maTrackRect );
824 : 0 : aEvent.MousePos.X = pData->maMousePos.X();
825 : 0 : aEvent.MousePos.Y = pData->maMousePos.Y();
826 : 0 : aEvent.bLiveMode = pData->mbLivemode;
827 : 0 : aEvent.bInteractive = pData->mbInteractive;
828 : :
829 : 0 : Reference< XDockableWindowListener > xFirstListener;
830 [ # # ]: 0 : ::cppu::OInterfaceIteratorHelper aIter( mpImpl->getDockableWindowListeners() );
831 [ # # ][ # # ]: 0 : while ( aIter.hasMoreElements() && !xFirstListener.is() )
[ # # ]
832 : : {
833 [ # # ][ # # ]: 0 : xFirstListener.set( aIter.next(), UNO_QUERY );
834 : : }
835 : :
836 : : ::com::sun::star::awt::DockingData aDockingData =
837 [ # # ][ # # ]: 0 : xFirstListener->docking( aEvent );
838 [ # # ]: 0 : pData->maTrackRect = VCLRectangle( aDockingData.TrackingRectangle );
839 [ # # ][ # # ]: 0 : pData->mbFloating = aDockingData.bFloating;
840 : : }
841 : : }
842 : : }
843 : 0 : break;
844 : : case VCLEVENT_WINDOW_ENDDOCKING:
845 : : {
846 [ # # ][ # # ]: 0 : if ( mpImpl->getDockableWindowListeners().getLength() )
847 : : {
848 : 0 : EndDockingData *pData = (EndDockingData*)rVclWindowEvent.GetData();
849 : :
850 [ # # ]: 0 : if( pData )
851 : : {
852 [ # # ]: 0 : ::com::sun::star::awt::EndDockingEvent aEvent;
853 [ # # ]: 0 : aEvent.Source = (::cppu::OWeakObject*)this;
854 [ # # ]: 0 : aEvent.WindowRectangle = AWTRectangle( pData->maWindowRect );
855 : 0 : aEvent.bFloating = pData->mbFloating;
856 : 0 : aEvent.bCancelled = pData->mbCancelled;
857 [ # # ][ # # ]: 0 : mpImpl->getDockableWindowListeners().notifyEach( &XDockableWindowListener::endDocking, aEvent );
858 : : }
859 : : }
860 : : }
861 : 0 : break;
862 : : case VCLEVENT_WINDOW_PREPARETOGGLEFLOATING:
863 : : {
864 [ # # ][ # # ]: 0 : if ( mpImpl->getDockableWindowListeners().getLength() )
865 : : {
866 : 0 : sal_Bool *p_bFloating = (sal_Bool*)rVclWindowEvent.GetData();
867 : :
868 [ # # ]: 0 : ::com::sun::star::lang::EventObject aEvent;
869 [ # # ]: 0 : aEvent.Source = (::cppu::OWeakObject*)this;
870 : :
871 : 0 : Reference< XDockableWindowListener > xFirstListener;
872 [ # # ]: 0 : ::cppu::OInterfaceIteratorHelper aIter( mpImpl->getDockableWindowListeners() );
873 [ # # ][ # # ]: 0 : while ( aIter.hasMoreElements() && !xFirstListener.is() )
[ # # ]
874 : : {
875 [ # # ][ # # ]: 0 : xFirstListener.set( aIter.next(), UNO_QUERY );
876 : : }
877 : :
878 [ # # ][ # # ]: 0 : *p_bFloating = xFirstListener->prepareToggleFloatingMode( aEvent );
[ # # ][ # # ]
879 : : }
880 : : }
881 : 0 : break;
882 : : case VCLEVENT_WINDOW_TOGGLEFLOATING:
883 : : {
884 [ # # ][ # # ]: 0 : if ( mpImpl->getDockableWindowListeners().getLength() )
885 : : {
886 [ # # ]: 0 : ::com::sun::star::lang::EventObject aEvent;
887 [ # # ]: 0 : aEvent.Source = (::cppu::OWeakObject*)this;
888 [ # # ][ # # ]: 0 : mpImpl->getDockableWindowListeners().notifyEach( &XDockableWindowListener::toggleFloatingMode, aEvent );
889 : : }
890 : : }
891 : 0 : break;
892 : : case VCLEVENT_WINDOW_ENDPOPUPMODE:
893 : : {
894 [ # # ][ # # ]: 0 : if ( mpImpl->getDockableWindowListeners().getLength() )
895 : : {
896 : 0 : EndPopupModeData *pData = (EndPopupModeData*)rVclWindowEvent.GetData();
897 : :
898 [ # # ]: 0 : if( pData )
899 : : {
900 [ # # ]: 0 : ::com::sun::star::awt::EndPopupModeEvent aEvent;
901 [ # # ]: 0 : aEvent.Source = (::cppu::OWeakObject*)this;
902 : 0 : aEvent.FloatingPosition.X = pData->maFloatingPos.X();
903 : 0 : aEvent.FloatingPosition.Y = pData->maFloatingPos.Y();
904 : 0 : aEvent.bTearoff = pData->mbTearoff;
905 [ # # ][ # # ]: 0 : mpImpl->getDockableWindowListeners().notifyEach( &XDockableWindowListener::endPopupMode, aEvent );
906 : : }
907 : : }
908 : : }
909 : 0 : break;
910 : :
911 : 1022841 : }
912 : 1022841 : }
913 : :
914 : 323 : uno::Reference< accessibility::XAccessibleContext > VCLXWindow::CreateAccessibleContext()
915 : : {
916 [ + - ]: 323 : SolarMutexGuard aGuard;
917 [ + - ][ + - ]: 323 : return getAccessibleFactory().createAccessibleContext( this );
[ + - ]
918 : : }
919 : :
920 : 1658 : void VCLXWindow::SetSynthesizingVCLEvent( sal_Bool _b )
921 : : {
922 : 1658 : mpImpl->mbSynthesizingVCLEvent = _b;
923 : 1658 : }
924 : :
925 : 10 : sal_Bool VCLXWindow::IsSynthesizingVCLEvent() const
926 : : {
927 : 10 : return mpImpl->mbSynthesizingVCLEvent;
928 : : }
929 : :
930 : 18 : Size VCLXWindow::ImplCalcWindowSize( const Size& rOutSz ) const
931 : : {
932 : 18 : Size aSz = rOutSz;
933 : :
934 : 18 : Window* pWindow = GetWindow();
935 [ + - ]: 18 : if ( pWindow )
936 : : {
937 : : sal_Int32 nLeft, nTop, nRight, nBottom;
938 [ + - ]: 18 : pWindow->GetBorder( nLeft, nTop, nRight, nBottom );
939 : 18 : aSz.Width() += nLeft+nRight;
940 : 18 : aSz.Height() += nTop+nBottom;
941 : : }
942 : 18 : return aSz;
943 : : }
944 : :
945 : :
946 : : // ::com::sun::star::lang::XUnoTunnel
947 [ + - ][ + + ]: 1515387 : IMPL_XUNOTUNNEL2( VCLXWindow, VCLXDevice )
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ]
948 : :
949 : : // ::com::sun::star::lang::Component
950 : 61248 : void VCLXWindow::dispose( ) throw(::com::sun::star::uno::RuntimeException)
951 : : {
952 [ + - ]: 61248 : SolarMutexGuard aGuard;
953 : :
954 [ + - ]: 61248 : mpImpl->mxViewGraphics = NULL;
955 : :
956 [ + + ]: 61248 : if ( !mpImpl->mbDisposing )
957 : : {
958 : 40277 : mpImpl->mbDisposing = true;
959 : :
960 [ + - ]: 40277 : mpImpl->disposing();
961 : :
962 [ + + ]: 40277 : if ( GetWindow() )
963 : : {
964 : 20850 : OutputDevice* pOutDev = GetOutputDevice();
965 [ + - ]: 20850 : SetWindow( NULL ); // so that handlers are logged off, if necessary (virtual)
966 : 20850 : SetOutputDevice( pOutDev );
967 [ + - ]: 20850 : DestroyOutputDevice();
968 : : }
969 : :
970 : : // #i14103# dispose the accessible context after the window has been destroyed,
971 : : // otherwise the old value in the child event fired in VCLXAccessibleComponent::ProcessWindowEvent()
972 : : // for VCLEVENT_WINDOW_CHILDDESTROYED contains a reference to an already disposed accessible object
973 : : try
974 : : {
975 [ + - ]: 40277 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xComponent( mpImpl->mxAccessibleContext, ::com::sun::star::uno::UNO_QUERY );
976 [ + + ]: 40277 : if ( xComponent.is() )
977 [ + - ][ + - ]: 40277 : xComponent->dispose();
[ # # ]
978 : : }
979 [ # # ]: 0 : catch ( const ::com::sun::star::uno::Exception& )
980 : : {
981 : : OSL_FAIL( "VCLXWindow::dispose: could not dispose the accessible context!" );
982 : : }
983 : 40277 : mpImpl->mxAccessibleContext.clear();
984 : :
985 : 40277 : mpImpl->mbDisposing = false;
986 [ + - ]: 61248 : }
987 : 61248 : }
988 : :
989 : 218 : void VCLXWindow::addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException)
990 : : {
991 [ + - ]: 218 : SolarMutexGuard aGuard;
992 : :
993 [ + - ][ + - ]: 218 : mpImpl->getEventListeners().addInterface( rxListener );
994 : 218 : }
995 : :
996 : 46 : void VCLXWindow::removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException)
997 : : {
998 [ + - ]: 46 : SolarMutexGuard aGuard;
999 : :
1000 [ + - ][ + - ]: 46 : mpImpl->getEventListeners().removeInterface( rxListener );
1001 : 46 : }
1002 : :
1003 : :
1004 : : // ::com::sun::star::awt::XWindow
1005 : 57743 : void VCLXWindow::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw(::com::sun::star::uno::RuntimeException)
1006 : : {
1007 [ + - ]: 57743 : SolarMutexGuard aGuard;
1008 : :
1009 [ + - ]: 57743 : if ( GetWindow() )
1010 : : {
1011 [ + - ][ + - ]: 57743 : if( Window::GetDockingManager()->IsDockable( GetWindow() ) )
[ + + ]
1012 [ + - ][ + - ]: 3709 : Window::GetDockingManager()->SetPosSizePixel( GetWindow() , X, Y, Width, Height, Flags );
1013 : : else
1014 [ + - ]: 54034 : GetWindow()->SetPosSizePixel( X, Y, Width, Height, Flags );
1015 [ + - ]: 57743 : }
1016 : 57743 : }
1017 : :
1018 : 97445 : ::com::sun::star::awt::Rectangle VCLXWindow::getPosSize( ) throw(::com::sun::star::uno::RuntimeException)
1019 : : {
1020 [ + - ]: 97445 : SolarMutexGuard aGuard;
1021 : :
1022 : 97445 : ::com::sun::star::awt::Rectangle aBounds;
1023 [ + - ]: 97445 : if ( GetWindow() )
1024 : : {
1025 [ + - ][ + - ]: 97445 : if( Window::GetDockingManager()->IsDockable( GetWindow() ) )
[ + + ]
1026 [ + - ][ + - ]: 15547 : aBounds = AWTRectangle( Window::GetDockingManager()->GetPosSizePixel( GetWindow() ) );
[ + - ]
1027 : : else
1028 [ + - ][ + - ]: 81898 : aBounds = AWTRectangle( Rectangle( GetWindow()->GetPosPixel(), GetWindow()->GetSizePixel() ) );
[ + - ][ + - ]
1029 : : }
1030 : :
1031 [ + - ]: 97445 : return aBounds;
1032 : : }
1033 : :
1034 : 22623 : void VCLXWindow::setVisible( sal_Bool bVisible ) throw(::com::sun::star::uno::RuntimeException)
1035 : : {
1036 [ + - ]: 22623 : SolarMutexGuard aGuard;
1037 : :
1038 : 22623 : Window* pWindow = GetWindow();
1039 [ + + ]: 22623 : if ( pWindow )
1040 : : {
1041 : 22621 : mpImpl->setDirectVisible( bVisible );
1042 [ + + ][ + - ]: 22621 : pWindow->Show( bVisible && mpImpl->isEnableVisible() );
[ + + ]
1043 [ + - ]: 22623 : }
1044 : 22623 : }
1045 : :
1046 : 964 : void VCLXWindow::setEnable( sal_Bool bEnable ) throw(::com::sun::star::uno::RuntimeException)
1047 : : {
1048 [ + - ]: 964 : SolarMutexGuard aGuard;
1049 : :
1050 : 964 : Window* pWindow = GetWindow();
1051 [ + - ]: 964 : if ( pWindow )
1052 : : {
1053 [ + - ]: 964 : pWindow->Enable( bEnable, sal_False ); // #95824# without children!
1054 [ + - ]: 964 : pWindow->EnableInput( bEnable );
1055 [ + - ]: 964 : }
1056 : 964 : }
1057 : :
1058 : 1542 : void VCLXWindow::setFocus( ) throw(::com::sun::star::uno::RuntimeException)
1059 : : {
1060 [ + - ]: 1542 : SolarMutexGuard aGuard;
1061 : :
1062 [ + - ]: 1542 : if ( GetWindow() )
1063 [ + - ][ + - ]: 1542 : GetWindow()->GrabFocus();
1064 : 1542 : }
1065 : :
1066 : 12392 : void VCLXWindow::addWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException)
1067 : : {
1068 [ + - ]: 12392 : SolarMutexGuard aGuard;
1069 : :
1070 [ + - ]: 12392 : mpImpl->getWindowListeners().addInterface( rxListener );
1071 : :
1072 [ + - ]: 12392 : Reference< XWindowListener2 > xListener2( rxListener, UNO_QUERY );
1073 [ + + ]: 12392 : if ( xListener2.is() )
1074 [ + - ]: 643 : mpImpl->getWindow2Listeners().addInterface( xListener2 );
1075 : :
1076 : : // #100119# Get all resize events, even if height or width 0, or invisible
1077 [ + - ]: 12392 : if ( GetWindow() )
1078 [ + - ][ + - ]: 12392 : GetWindow()->EnableAllResize( sal_True );
1079 : 12392 : }
1080 : :
1081 : 8004 : void VCLXWindow::removeWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException)
1082 : : {
1083 [ + - ]: 8004 : SolarMutexGuard aGuard;
1084 : :
1085 [ + - ]: 8004 : Reference< XWindowListener2 > xListener2( rxListener, UNO_QUERY );
1086 [ + + ]: 8004 : if ( xListener2.is() )
1087 [ + - ]: 640 : mpImpl->getWindow2Listeners().removeInterface( xListener2 );
1088 : :
1089 [ + - ][ + - ]: 8004 : mpImpl->getWindowListeners().removeInterface( rxListener );
1090 : 8004 : }
1091 : :
1092 : 5399 : void VCLXWindow::addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException)
1093 : : {
1094 [ + - ]: 5399 : SolarMutexGuard aGuard;
1095 [ + - ][ + - ]: 5399 : mpImpl->getFocusListeners().addInterface( rxListener );
1096 : 5399 : }
1097 : :
1098 : 5105 : void VCLXWindow::removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException)
1099 : : {
1100 [ + - ]: 5105 : SolarMutexGuard aGuard;
1101 [ + - ][ + - ]: 5105 : mpImpl->getFocusListeners().removeInterface( rxListener );
1102 : 5105 : }
1103 : :
1104 : 167 : void VCLXWindow::addKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException)
1105 : : {
1106 [ + - ]: 167 : SolarMutexGuard aGuard;
1107 [ + - ][ + - ]: 167 : mpImpl->getKeyListeners().addInterface( rxListener );
1108 : 167 : }
1109 : :
1110 : 2 : void VCLXWindow::removeKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException)
1111 : : {
1112 [ + - ]: 2 : SolarMutexGuard aGuard;
1113 [ + - ][ + - ]: 2 : mpImpl->getKeyListeners().removeInterface( rxListener );
1114 : 2 : }
1115 : :
1116 : 45 : void VCLXWindow::addMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException)
1117 : : {
1118 [ + - ]: 45 : SolarMutexGuard aGuard;
1119 [ + - ][ + - ]: 45 : mpImpl->getMouseListeners().addInterface( rxListener );
1120 : 45 : }
1121 : :
1122 : 22 : void VCLXWindow::removeMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException)
1123 : : {
1124 [ + - ]: 22 : SolarMutexGuard aGuard;
1125 [ + - ][ + - ]: 22 : mpImpl->getMouseListeners().removeInterface( rxListener );
1126 : 22 : }
1127 : :
1128 : 0 : void VCLXWindow::addMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException)
1129 : : {
1130 [ # # ]: 0 : SolarMutexGuard aGuard;
1131 [ # # ][ # # ]: 0 : mpImpl->getMouseMotionListeners().addInterface( rxListener );
1132 : 0 : }
1133 : :
1134 : 0 : void VCLXWindow::removeMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException)
1135 : : {
1136 [ # # ]: 0 : SolarMutexGuard aGuard;
1137 [ # # ][ # # ]: 0 : mpImpl->getMouseMotionListeners().removeInterface( rxListener );
1138 : 0 : }
1139 : :
1140 : 0 : void VCLXWindow::addPaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException)
1141 : : {
1142 [ # # ]: 0 : SolarMutexGuard aGuard;
1143 [ # # ][ # # ]: 0 : mpImpl->getPaintListeners().addInterface( rxListener );
1144 : 0 : }
1145 : :
1146 : 0 : void VCLXWindow::removePaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& rxListener ) throw(::com::sun::star::uno::RuntimeException)
1147 : : {
1148 [ # # ]: 0 : SolarMutexGuard aGuard;
1149 [ # # ][ # # ]: 0 : mpImpl->getPaintListeners().removeInterface( rxListener );
1150 : 0 : }
1151 : :
1152 : : // ::com::sun::star::awt::XWindowPeer
1153 : 619 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > VCLXWindow::getToolkit( ) throw(::com::sun::star::uno::RuntimeException)
1154 : : {
1155 : : // no guard. nothing to guard here.
1156 : : // 82463 - 12/21/00 - fs
1157 : 619 : return Application::GetVCLToolkit();
1158 : : }
1159 : :
1160 : 0 : void VCLXWindow::setPointer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPointer >& rxPointer ) throw(::com::sun::star::uno::RuntimeException)
1161 : : {
1162 [ # # ]: 0 : SolarMutexGuard aGuard;
1163 : :
1164 : 0 : VCLXPointer* pPointer = VCLXPointer::GetImplementation( rxPointer );
1165 [ # # ]: 0 : if ( pPointer )
1166 : : {
1167 [ # # ]: 0 : mpImpl->mxPointer = rxPointer;
1168 [ # # ]: 0 : if ( GetWindow() )
1169 [ # # ]: 0 : GetWindow()->SetPointer( pPointer->GetPointer() );
1170 [ # # ]: 0 : }
1171 : 0 : }
1172 : :
1173 : 1743 : void VCLXWindow::setBackground( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException)
1174 : : {
1175 [ + - ]: 1743 : SolarMutexGuard aGuard;
1176 : :
1177 [ + - ]: 1743 : if ( GetWindow() )
1178 : : {
1179 : 1743 : Color aColor( (sal_uInt32)nColor );
1180 [ + - ][ + - ]: 1743 : GetWindow()->SetBackground( aColor );
[ + - ]
1181 [ + - ]: 1743 : GetWindow()->SetControlBackground( aColor );
1182 : :
1183 [ + - ]: 1743 : WindowType eWinType = GetWindow()->GetType();
1184 [ + - ][ - + ]: 1743 : if ( ( eWinType == WINDOW_WINDOW ) ||
[ # # ]
1185 : : ( eWinType == WINDOW_WORKWINDOW ) ||
1186 : : ( eWinType == WINDOW_FLOATINGWINDOW ) )
1187 : : {
1188 [ + - ]: 1743 : GetWindow()->Invalidate();
1189 : : }
1190 [ + - ]: 1743 : }
1191 : 1743 : }
1192 : :
1193 : 0 : void VCLXWindow::invalidate( sal_Int16 nInvalidateFlags ) throw(::com::sun::star::uno::RuntimeException)
1194 : : {
1195 [ # # ]: 0 : SolarMutexGuard aGuard;
1196 : :
1197 [ # # ]: 0 : if ( GetWindow() )
1198 [ # # ][ # # ]: 0 : GetWindow()->Invalidate( (sal_uInt16) nInvalidateFlags );
1199 : 0 : }
1200 : :
1201 : 0 : void VCLXWindow::invalidateRect( const ::com::sun::star::awt::Rectangle& rRect, sal_Int16 nInvalidateFlags ) throw(::com::sun::star::uno::RuntimeException)
1202 : : {
1203 [ # # ]: 0 : SolarMutexGuard aGuard;
1204 : :
1205 [ # # ]: 0 : if ( GetWindow() )
1206 [ # # ][ # # ]: 0 : GetWindow()->Invalidate( VCLRectangle(rRect), (sal_uInt16) nInvalidateFlags );
[ # # ]
1207 : 0 : }
1208 : :
1209 : :
1210 : : // ::com::sun::star::awt::XVclWindowPeer
1211 : 0 : sal_Bool VCLXWindow::isChild( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& rxPeer ) throw(::com::sun::star::uno::RuntimeException)
1212 : : {
1213 [ # # ]: 0 : SolarMutexGuard aGuard;
1214 : :
1215 : 0 : sal_Bool bIsChild = sal_False;
1216 : 0 : Window* pWindow = GetWindow();
1217 [ # # ]: 0 : if ( pWindow )
1218 : : {
1219 [ # # ]: 0 : Window* pPeerWindow = VCLUnoHelper::GetWindow( rxPeer );
1220 [ # # ][ # # ]: 0 : bIsChild = pPeerWindow && pWindow->IsChild( pPeerWindow );
[ # # ]
1221 : : }
1222 : :
1223 [ # # ]: 0 : return bIsChild;
1224 : : }
1225 : :
1226 : 4196 : void VCLXWindow::setDesignMode( sal_Bool bOn ) throw(::com::sun::star::uno::RuntimeException)
1227 : : {
1228 [ + - ]: 4196 : SolarMutexGuard aGuard;
1229 : :
1230 [ + - ]: 4196 : mpImpl->mbDesignMode = bOn;
1231 : 4196 : }
1232 : :
1233 : 11990 : sal_Bool VCLXWindow::isDesignMode( ) throw(::com::sun::star::uno::RuntimeException)
1234 : : {
1235 [ + - ]: 11990 : SolarMutexGuard aGuard;
1236 [ + - ]: 11990 : return mpImpl->mbDesignMode;
1237 : : }
1238 : :
1239 : 0 : void VCLXWindow::enableClipSiblings( sal_Bool bClip ) throw(::com::sun::star::uno::RuntimeException)
1240 : : {
1241 [ # # ]: 0 : SolarMutexGuard aGuard;
1242 : :
1243 [ # # ]: 0 : if ( GetWindow() )
1244 [ # # ][ # # ]: 0 : GetWindow()->EnableClipSiblings( bClip );
1245 : 0 : }
1246 : :
1247 : 0 : void VCLXWindow::setForeground( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException)
1248 : : {
1249 [ # # ]: 0 : SolarMutexGuard aGuard;
1250 : :
1251 [ # # ]: 0 : if ( GetWindow() )
1252 : : {
1253 : 0 : Color aColor( (sal_uInt32)nColor );
1254 [ # # ]: 0 : GetWindow()->SetControlForeground( aColor );
1255 [ # # ]: 0 : }
1256 : 0 : }
1257 : :
1258 : 0 : void VCLXWindow::setControlFont( const ::com::sun::star::awt::FontDescriptor& rFont ) throw(::com::sun::star::uno::RuntimeException)
1259 : : {
1260 [ # # ]: 0 : SolarMutexGuard aGuard;
1261 : :
1262 [ # # ]: 0 : if ( GetWindow() )
1263 [ # # ][ # # ]: 0 : GetWindow()->SetControlFont( VCLUnoHelper::CreateFont( rFont, GetWindow()->GetControlFont() ) );
[ # # ][ # # ]
[ # # ][ # # ]
1264 : 0 : }
1265 : :
1266 : 0 : void VCLXWindow::getStyles( sal_Int16 nType, ::com::sun::star::awt::FontDescriptor& Font, sal_Int32& ForegroundColor, sal_Int32& BackgroundColor ) throw(::com::sun::star::uno::RuntimeException)
1267 : : {
1268 [ # # ]: 0 : SolarMutexGuard aGuard;
1269 : :
1270 [ # # ]: 0 : if ( GetWindow() )
1271 : : {
1272 : 0 : const StyleSettings& rStyleSettings = GetWindow()->GetSettings().GetStyleSettings();
1273 : :
1274 [ # # # ]: 0 : switch ( nType )
1275 : : {
1276 : : case ::com::sun::star::awt::Style::FRAME:
1277 : : {
1278 [ # # ]: 0 : Font = VCLUnoHelper::CreateFontDescriptor( rStyleSettings.GetAppFont() );
1279 : 0 : ForegroundColor = rStyleSettings.GetWindowTextColor().GetColor();
1280 : 0 : BackgroundColor = rStyleSettings.GetWindowColor().GetColor();
1281 : : }
1282 : 0 : break;
1283 : : case ::com::sun::star::awt::Style::DIALOG:
1284 : : {
1285 [ # # ]: 0 : Font = VCLUnoHelper::CreateFontDescriptor( rStyleSettings.GetAppFont() );
1286 : 0 : ForegroundColor = rStyleSettings.GetDialogTextColor().GetColor();
1287 : 0 : BackgroundColor = rStyleSettings.GetDialogColor().GetColor();
1288 : : }
1289 : 0 : break;
1290 : : default: OSL_FAIL( "VCLWindow::getStyles() - unknown Type" );
1291 : : }
1292 : :
1293 [ # # ]: 0 : }
1294 : 0 : }
1295 : :
1296 : : namespace toolkit
1297 : : {
1298 : 493 : static void setColorSettings( Window* _pWindow, const ::com::sun::star::uno::Any& _rValue,
1299 : : void (StyleSettings::*pSetter)( const Color& ), const Color& (StyleSettings::*pGetter)( ) const )
1300 : : {
1301 : 493 : sal_Int32 nColor = 0;
1302 [ + - ]: 493 : if ( !( _rValue >>= nColor ) )
1303 [ + - ][ + - ]: 493 : nColor = (Application::GetSettings().GetStyleSettings().*pGetter)().GetColor();
[ + - ]
1304 : :
1305 [ + - ]: 493 : AllSettings aSettings = _pWindow->GetSettings();
1306 [ + - ]: 493 : StyleSettings aStyleSettings = aSettings.GetStyleSettings();
1307 : :
1308 [ + - ][ + - ]: 493 : (aStyleSettings.*pSetter)( Color( nColor ) );
1309 : :
1310 [ + - ]: 493 : aSettings.SetStyleSettings( aStyleSettings );
1311 [ + - ][ + - ]: 493 : _pWindow->SetSettings( aSettings, sal_True );
[ + - ]
1312 : 493 : }
1313 : : }
1314 : :
1315 : : // Terminated by BASEPROPERTY_NOTFOUND (or 0)
1316 : 576 : void VCLXWindow::PushPropertyIds( std::list< sal_uInt16 > &rIds,
1317 : : int nFirstId, ...)
1318 : : {
1319 : : va_list pVarArgs;
1320 : 576 : va_start( pVarArgs, nFirstId );
1321 : :
1322 [ + + ]: 13961 : for ( int nId = nFirstId; nId != BASEPROPERTY_NOTFOUND;
1323 : 13385 : nId = va_arg( pVarArgs, int ) )
1324 [ + - ]: 13385 : rIds.push_back( (sal_uInt16) nId );
1325 : :
1326 : 576 : va_end( pVarArgs );
1327 : 576 : }
1328 : :
1329 : 576 : void VCLXWindow::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds, bool bWithDefaults )
1330 : : {
1331 : : // These are common across ~all VCLXWindow derived classes
1332 [ - + ]: 576 : if( bWithDefaults )
1333 : : PushPropertyIds( rIds,
1334 : : BASEPROPERTY_ALIGN,
1335 : : BASEPROPERTY_BACKGROUNDCOLOR,
1336 : : BASEPROPERTY_BORDER,
1337 : : BASEPROPERTY_BORDERCOLOR,
1338 : : BASEPROPERTY_DEFAULTCONTROL,
1339 : : BASEPROPERTY_ENABLED,
1340 : : BASEPROPERTY_FONTDESCRIPTOR,
1341 : : BASEPROPERTY_HELPTEXT,
1342 : : BASEPROPERTY_HELPURL,
1343 : : BASEPROPERTY_TEXT,
1344 : : BASEPROPERTY_PRINTABLE,
1345 : : BASEPROPERTY_ENABLEVISIBLE, // for visibility
1346 : : BASEPROPERTY_TABSTOP,
1347 [ # # ]: 0 : 0);
1348 : :
1349 : : // lovely hack from:
1350 : : // void UnoControlModel::ImplRegisterProperty( sal_uInt16 nPropId )
1351 [ + - ]: 576 : std::list< sal_uInt16 >::const_iterator iter;
1352 [ + - ][ + - ]: 5307 : for( iter = rIds.begin(); iter != rIds.end(); ++iter) {
[ + - ][ + - ]
[ + + ]
1353 [ + - ][ + + ]: 5241 : if( *iter == BASEPROPERTY_FONTDESCRIPTOR )
1354 : : {
1355 : : // some properties are not included in the FontDescriptor, but everytime
1356 : : // when we have a FontDescriptor we want to have these properties too.
1357 : : // => Easier to register the here, istead everywhere where I register the FontDescriptor...
1358 : :
1359 [ + - ]: 510 : rIds.push_back( BASEPROPERTY_TEXTCOLOR );
1360 [ + - ]: 510 : rIds.push_back( BASEPROPERTY_TEXTLINECOLOR );
1361 [ + - ]: 510 : rIds.push_back( BASEPROPERTY_FONTRELIEF );
1362 [ + - ]: 510 : rIds.push_back( BASEPROPERTY_FONTEMPHASISMARK );
1363 : 510 : break;
1364 : : }
1365 : : }
1366 : 576 : }
1367 : :
1368 : 0 : void VCLXWindow::GetPropertyIds( std::list< sal_uInt16 >& _out_rIds )
1369 : : {
1370 : 0 : return ImplGetPropertyIds( _out_rIds, mpImpl->mbWithDefaultProps );
1371 : : }
1372 : :
1373 : 0 : ::cppu::OInterfaceContainerHelper& VCLXWindow::GetContainerListeners()
1374 : : {
1375 : 0 : return mpImpl->getContainerListeners();
1376 : : }
1377 : :
1378 : 10257 : ::cppu::OInterfaceContainerHelper& VCLXWindow::GetTopWindowListeners()
1379 : : {
1380 : 10257 : return mpImpl->getTopWindowListeners();
1381 : : }
1382 : :
1383 : : namespace
1384 : : {
1385 : 1608 : void lcl_updateWritingMode( Window& _rWindow, const sal_Int16 _nWritingMode, const sal_Int16 _nContextWritingMode )
1386 : : {
1387 : 1608 : sal_Bool bEnableRTL = sal_False;
1388 [ + - + + ]: 1608 : switch ( _nWritingMode )
1389 : : {
1390 : 4 : case WritingMode2::LR_TB: bEnableRTL = sal_False; break;
1391 : 0 : case WritingMode2::RL_TB: bEnableRTL = sal_True; break;
1392 : : case WritingMode2::CONTEXT:
1393 : : {
1394 : : // consult our ContextWritingMode. If it has an explicit RTL/LTR value, then use
1395 : : // it. If it doesn't (but is CONTEXT itself), then just ask the parent window of our
1396 : : // own window for its RTL mode
1397 [ + + + + ]: 1166 : switch ( _nContextWritingMode )
1398 : : {
1399 : 764 : case WritingMode2::LR_TB: bEnableRTL = sal_False; break;
1400 : 172 : case WritingMode2::RL_TB: bEnableRTL = sal_True; break;
1401 : : case WritingMode2::CONTEXT:
1402 : : {
1403 : 102 : const Window* pParent = _rWindow.GetParent();
1404 : : OSL_ENSURE( pParent, "lcl_updateWritingMode: cannot determine context's writing mode!" );
1405 [ + - ]: 102 : if ( pParent )
1406 : 102 : bEnableRTL = pParent->IsRTLEnabled();
1407 : : }
1408 : 102 : break;
1409 : : }
1410 : : }
1411 : 1166 : break;
1412 : : default:
1413 : : OSL_FAIL( "lcl_updateWritingMode: unsupported WritingMode!" );
1414 : : } // switch ( nWritingMode )
1415 : :
1416 : 1608 : _rWindow.EnableRTL( bEnableRTL );
1417 : 1608 : }
1418 : : }
1419 : :
1420 : 50034 : void VCLXWindow::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value ) throw(::com::sun::star::uno::RuntimeException)
1421 : : {
1422 [ + - ]: 50034 : SolarMutexGuard aGuard;
1423 : :
1424 : 50034 : Window* pWindow = GetWindow();
1425 [ - + ]: 50034 : if ( !pWindow )
1426 : 50034 : return;
1427 : :
1428 : 50034 : sal_Bool bVoid = Value.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_VOID;
1429 : :
1430 [ + - ]: 50034 : WindowType eWinType = pWindow->GetType();
1431 [ + - ]: 50034 : sal_uInt16 nPropType = GetPropertyId( PropertyName );
1432 [ + + + + : 50034 : switch ( nPropType )
+ - + + +
- + + + +
+ + + + -
- + + + +
+ - - - -
+ + + + +
+ ]
1433 : : {
1434 : : case BASEPROPERTY_REFERENCE_DEVICE:
1435 : : {
1436 [ - + ]: 369 : Control* pControl = dynamic_cast< Control* >( pWindow );
1437 : : OSL_ENSURE( pControl, "VCLXWindow::setProperty( RefDevice ): need a Control for this!" );
1438 [ + - ]: 369 : if ( !pControl )
1439 : : break;
1440 [ + - ]: 369 : Reference< XDevice > xDevice( Value, UNO_QUERY );
1441 [ + - ]: 369 : OutputDevice* pDevice = VCLUnoHelper::GetOutputDevice( xDevice );
1442 [ + - ]: 369 : pControl->SetReferenceDevice( pDevice );
1443 : : }
1444 : 369 : break;
1445 : :
1446 : : case BASEPROPERTY_CONTEXT_WRITING_MODE:
1447 : : {
1448 : 877 : OSL_VERIFY( Value >>= mpImpl->mnContextWritingMode );
1449 [ + + ]: 877 : if ( mpImpl->mnWritingMode == WritingMode2::CONTEXT )
1450 [ + - ]: 719 : lcl_updateWritingMode( *pWindow, mpImpl->mnWritingMode, mpImpl->mnContextWritingMode );
1451 : : }
1452 : 877 : break;
1453 : :
1454 : : case BASEPROPERTY_WRITING_MODE:
1455 : : {
1456 : 889 : sal_Bool bProperType = ( Value >>= mpImpl->mnWritingMode );
1457 : : OSL_ENSURE( bProperType, "VCLXWindow::setProperty( 'WritingMode' ): illegal value type!" );
1458 [ + - ]: 889 : if ( bProperType )
1459 [ + - ]: 889 : lcl_updateWritingMode( *pWindow, mpImpl->mnWritingMode, mpImpl->mnContextWritingMode );
1460 : : }
1461 : 889 : break;
1462 : :
1463 : : case BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR:
1464 : : {
1465 : 352 : sal_uInt16 nWheelBehavior( MouseWheelBehavior::SCROLL_FOCUS_ONLY );
1466 : 352 : OSL_VERIFY( Value >>= nWheelBehavior );
1467 : :
1468 [ + - ]: 352 : AllSettings aSettings = pWindow->GetSettings();
1469 [ + - ]: 352 : MouseSettings aMouseSettings = aSettings.GetMouseSettings();
1470 : :
1471 : 352 : sal_uInt16 nVclBehavior( MOUSE_WHEEL_FOCUS_ONLY );
1472 [ - + + + ]: 352 : switch ( nWheelBehavior )
1473 : : {
1474 : 0 : case MouseWheelBehavior::SCROLL_DISABLED: nVclBehavior = MOUSE_WHEEL_DISABLE; break;
1475 : 136 : case MouseWheelBehavior::SCROLL_FOCUS_ONLY: nVclBehavior = MOUSE_WHEEL_FOCUS_ONLY; break;
1476 : 68 : case MouseWheelBehavior::SCROLL_ALWAYS: nVclBehavior = MOUSE_WHEEL_ALWAYS; break;
1477 : : default:
1478 : : OSL_FAIL( "VCLXWindow::setProperty( 'MouseWheelBehavior' ): illegal property value!" );
1479 : : }
1480 : :
1481 [ + - ]: 352 : aMouseSettings.SetWheelBehavior( nVclBehavior );
1482 [ + - ]: 352 : aSettings.SetMouseSettings( aMouseSettings );
1483 [ + - ][ + - ]: 352 : pWindow->SetSettings( aSettings, sal_True );
[ + - ]
1484 : : }
1485 : 352 : break;
1486 : :
1487 : : case BASEPROPERTY_NATIVE_WIDGET_LOOK:
1488 : : {
1489 : 858 : sal_Bool bEnable( sal_True );
1490 : 858 : OSL_VERIFY( Value >>= bEnable );
1491 [ + - ]: 858 : pWindow->EnableNativeWidget( bEnable );
1492 : : }
1493 : 858 : break;
1494 : :
1495 : : case BASEPROPERTY_PLUGINPARENT:
1496 : : {
1497 : : // set parent handle
1498 [ # # ]: 0 : SetSystemParent_Impl( Value );
1499 : : }
1500 : 0 : break;
1501 : :
1502 : : case BASEPROPERTY_ENABLED:
1503 : : {
1504 : 844 : sal_Bool b = sal_Bool();
1505 [ + - ]: 844 : if ( Value >>= b )
1506 [ + - ]: 844 : setEnable( b );
1507 : : }
1508 : 844 : break;
1509 : : case BASEPROPERTY_ENABLEVISIBLE:
1510 : : {
1511 : 877 : sal_Bool b = sal_False;
1512 [ + - ]: 877 : if ( Value >>= b )
1513 : : {
1514 [ + + ]: 877 : if( b != mpImpl->isEnableVisible() )
1515 : : {
1516 : 346 : mpImpl->setEnableVisible( b );
1517 [ + + ][ + - ]: 346 : pWindow->Show( b && mpImpl->isDirectVisible() );
[ + + ]
1518 : : }
1519 : : }
1520 : : }
1521 : 877 : break;
1522 : : case BASEPROPERTY_TEXT:
1523 : : case BASEPROPERTY_LABEL:
1524 : : case BASEPROPERTY_TITLE:
1525 : : {
1526 : 265 : ::rtl::OUString aText;
1527 [ + - ]: 265 : if ( Value >>= aText )
1528 : : {
1529 [ - + ]: 265 : switch (eWinType)
1530 : : {
1531 : : case WINDOW_OKBUTTON:
1532 : : case WINDOW_CANCELBUTTON:
1533 : : case WINDOW_HELPBUTTON:
1534 : : // Standard Button: overwrite only if not empty.
1535 [ # # ]: 0 : if (!aText.isEmpty())
1536 [ # # ][ # # ]: 0 : pWindow->SetText( aText );
[ # # ]
1537 : 0 : break;
1538 : :
1539 : : default:
1540 [ + - ][ + - ]: 265 : pWindow->SetText( aText );
[ + - ]
1541 : 265 : break;
1542 : : }
1543 : 265 : }
1544 : : }
1545 : 265 : break;
1546 : : case BASEPROPERTY_ACCESSIBLENAME:
1547 : : {
1548 : 0 : ::rtl::OUString aText;
1549 [ # # ]: 0 : if ( Value >>= aText )
1550 [ # # ][ # # ]: 0 : pWindow->SetAccessibleName( aText );
[ # # ]
1551 : : }
1552 : 0 : break;
1553 : : case BASEPROPERTY_HELPURL:
1554 : : {
1555 : 737 : ::rtl::OUString aURL;
1556 [ + - ]: 737 : if ( Value >>= aURL )
1557 : : {
1558 [ + - ]: 737 : INetURLObject aHelpURL( aURL );
1559 [ - + ]: 737 : if ( aHelpURL.GetProtocol() == INET_PROT_HID )
1560 [ # # ][ # # ]: 0 : pWindow->SetHelpId( rtl::OUStringToOString( aHelpURL.GetURLPath(), RTL_TEXTENCODING_UTF8 ) );
[ # # ]
1561 : : else
1562 [ + - ][ + - ]: 737 : pWindow->SetHelpId( rtl::OUStringToOString( aURL, RTL_TEXTENCODING_UTF8 ) );
[ + - ]
1563 : 737 : }
1564 : : }
1565 : 737 : break;
1566 : : case BASEPROPERTY_HELPTEXT:
1567 : : {
1568 : 923 : ::rtl::OUString aHelpText;
1569 [ + - ]: 923 : if ( Value >>= aHelpText )
1570 : : {
1571 [ + - ][ + - ]: 923 : pWindow->SetQuickHelpText( aHelpText );
[ + - ]
1572 : 923 : }
1573 : : }
1574 : 923 : break;
1575 : : case BASEPROPERTY_FONTDESCRIPTOR:
1576 : : {
1577 [ - + ]: 2675 : if ( bVoid )
1578 [ # # ][ # # ]: 0 : pWindow->SetControlFont( Font() );
[ # # ]
1579 : : else
1580 : : {
1581 : 2675 : ::com::sun::star::awt::FontDescriptor aFont;
1582 [ + - ][ + - ]: 2675 : if ( Value >>= aFont )
1583 [ + - ][ + - ]: 2675 : pWindow->SetControlFont( VCLUnoHelper::CreateFont( aFont, pWindow->GetControlFont() ) );
[ + - ][ + - ]
[ + - ]
1584 : : }
1585 : : }
1586 : 2675 : break;
1587 : : case BASEPROPERTY_FONTRELIEF:
1588 : : {
1589 : 705 : sal_Int16 n = sal_Int16();
1590 [ + - ]: 705 : if ( Value >>= n )
1591 : : {
1592 [ + - ]: 705 : Font aFont = pWindow->GetControlFont();
1593 [ + - ]: 705 : aFont.SetRelief( (FontRelief)n );
1594 [ + - ][ + - ]: 705 : pWindow->SetControlFont( aFont );
1595 : : }
1596 : : }
1597 : 705 : break;
1598 : : case BASEPROPERTY_FONTEMPHASISMARK:
1599 : : {
1600 : 705 : sal_Int16 n = sal_Int16();
1601 [ + - ]: 705 : if ( Value >>= n )
1602 : : {
1603 [ + - ]: 705 : Font aFont = pWindow->GetControlFont();
1604 [ + - ]: 705 : aFont.SetEmphasisMark( n );
1605 [ + - ][ + - ]: 705 : pWindow->SetControlFont( aFont );
1606 : : }
1607 : : }
1608 : 705 : break;
1609 : : case BASEPROPERTY_BACKGROUNDCOLOR:
1610 [ + + ]: 527 : if ( bVoid )
1611 : : {
1612 [ + + + ]: 525 : switch ( eWinType )
1613 : : {
1614 : : // set dialog color for default
1615 : : case WINDOW_DIALOG:
1616 : : case WINDOW_MESSBOX:
1617 : : case WINDOW_INFOBOX:
1618 : : case WINDOW_WARNINGBOX:
1619 : : case WINDOW_ERRORBOX:
1620 : : case WINDOW_QUERYBOX:
1621 : : case WINDOW_TABPAGE:
1622 : : {
1623 : 2 : Color aColor = pWindow->GetSettings().GetStyleSettings().GetDialogColor();
1624 [ + - ][ + - ]: 2 : pWindow->SetBackground( aColor );
[ + - ]
1625 [ + - ]: 2 : pWindow->SetControlBackground( aColor );
1626 : : break;
1627 : : }
1628 : :
1629 : : case WINDOW_FIXEDTEXT:
1630 : : case WINDOW_CHECKBOX:
1631 : : case WINDOW_RADIOBUTTON:
1632 : : case WINDOW_GROUPBOX:
1633 : : case WINDOW_FIXEDLINE:
1634 : : {
1635 : : // support transparency only for special controls
1636 [ + - ]: 72 : pWindow->SetBackground();
1637 [ + - ]: 72 : pWindow->SetControlBackground();
1638 [ + - ]: 72 : pWindow->SetPaintTransparent( sal_True );
1639 : 72 : break;
1640 : : }
1641 : :
1642 : : default:
1643 : : {
1644 : : // default code which enables transparency for
1645 : : // compound controls. It's not real transparency
1646 : : // as most of these controls repaint their client
1647 : : // area completely new.
1648 [ + - ][ + + ]: 451 : if ( pWindow->IsCompoundControl() )
1649 [ + - ]: 158 : pWindow->SetBackground();
1650 [ + - ]: 451 : pWindow->SetControlBackground();
1651 : 525 : break;
1652 : : }
1653 : : }
1654 : : }
1655 : : else
1656 : : {
1657 : 2 : sal_Int32 nColor = 0;
1658 [ + - ]: 2 : if ( Value >>= nColor )
1659 : : {
1660 : 2 : Color aColor( nColor );
1661 [ + - ]: 2 : pWindow->SetControlBackground( aColor );
1662 [ + - ][ + - ]: 2 : pWindow->SetBackground( aColor );
[ + - ]
1663 [ - + ]: 2 : switch ( eWinType )
1664 : : {
1665 : : // reset paint transparent mode
1666 : : case WINDOW_FIXEDTEXT:
1667 : : case WINDOW_CHECKBOX:
1668 : : case WINDOW_RADIOBUTTON:
1669 : : case WINDOW_GROUPBOX:
1670 : : case WINDOW_FIXEDLINE:
1671 [ # # ]: 0 : pWindow->SetPaintTransparent( sal_False );
1672 : : default: ;
1673 : : }
1674 [ + - ]: 2 : pWindow->Invalidate(); // Invalidate if control does not respond to it
1675 : : }
1676 : : }
1677 : 527 : break;
1678 : : case BASEPROPERTY_TEXTCOLOR:
1679 [ + + ]: 607 : if ( bVoid )
1680 : : {
1681 [ + - ]: 605 : pWindow->SetControlForeground();
1682 : : }
1683 : : else
1684 : : {
1685 : 2 : sal_Int32 nColor = 0;
1686 [ + - ]: 2 : if ( Value >>= nColor )
1687 : : {
1688 : 2 : Color aColor( nColor );
1689 [ + - ]: 2 : pWindow->SetTextColor( aColor );
1690 [ + - ]: 2 : pWindow->SetControlForeground( aColor );
1691 : : }
1692 : : }
1693 : 607 : break;
1694 : : case BASEPROPERTY_TEXTLINECOLOR:
1695 [ + - ]: 571 : if ( bVoid )
1696 : : {
1697 [ + - ]: 571 : pWindow->SetTextLineColor();
1698 : : }
1699 : : else
1700 : : {
1701 : 0 : sal_Int32 nColor = 0;
1702 [ # # ]: 0 : if ( Value >>= nColor )
1703 : : {
1704 : 0 : Color aColor( nColor );
1705 [ # # ]: 0 : pWindow->SetTextLineColor( aColor );
1706 : : }
1707 : : }
1708 : 571 : break;
1709 : : case BASEPROPERTY_FILLCOLOR:
1710 [ # # ]: 0 : if ( bVoid )
1711 [ # # ]: 0 : pWindow->SetFillColor();
1712 : : else
1713 : : {
1714 : 0 : sal_Int32 nColor = 0;
1715 [ # # ]: 0 : if ( Value >>= nColor )
1716 : : {
1717 : 0 : Color aColor( nColor );
1718 [ # # ]: 0 : pWindow->SetFillColor( aColor );
1719 : : }
1720 : : }
1721 : 0 : break;
1722 : : case BASEPROPERTY_LINECOLOR:
1723 [ # # ]: 0 : if ( bVoid )
1724 [ # # ]: 0 : pWindow->SetLineColor();
1725 : : else
1726 : : {
1727 : 0 : sal_Int32 nColor = 0;
1728 [ # # ]: 0 : if ( Value >>= nColor )
1729 : : {
1730 : 0 : Color aColor( nColor );
1731 [ # # ]: 0 : pWindow->SetLineColor( aColor );
1732 : : }
1733 : : }
1734 : 0 : break;
1735 : : case BASEPROPERTY_BORDER:
1736 : : {
1737 [ + - ]: 525 : WinBits nStyle = pWindow->GetStyle();
1738 : 525 : sal_uInt16 nBorder = 0;
1739 : 525 : Value >>= nBorder;
1740 [ + + ]: 525 : if ( !nBorder )
1741 : : {
1742 [ + - ]: 24 : pWindow->SetStyle( nStyle & ~WB_BORDER );
1743 : : }
1744 : : else
1745 : : {
1746 [ + - ]: 501 : pWindow->SetStyle( nStyle | WB_BORDER );
1747 [ + - ]: 501 : pWindow->SetBorderStyle( nBorder );
1748 : : }
1749 : : }
1750 : 525 : break;
1751 : : case BASEPROPERTY_TABSTOP:
1752 : : {
1753 [ + - ]: 643 : WinBits nStyle = pWindow->GetStyle() & ~WB_TABSTOP;
1754 [ - + ]: 643 : if ( !bVoid )
1755 : : {
1756 : 0 : sal_Bool bTab = false;
1757 : 0 : Value >>= bTab;
1758 [ # # ]: 0 : if ( bTab )
1759 : 0 : nStyle |= WB_TABSTOP;
1760 : : else
1761 : 0 : nStyle |= WB_NOTABSTOP;
1762 : : }
1763 [ + - ]: 643 : pWindow->SetStyle( nStyle );
1764 : : }
1765 : 643 : break;
1766 : : case BASEPROPERTY_VERTICALALIGN:
1767 : : {
1768 : 465 : VerticalAlignment eAlign = VerticalAlignment_MAKE_FIXED_SIZE;
1769 [ + - ]: 465 : WinBits nStyle = pWindow->GetStyle();
1770 : 465 : nStyle &= ~(WB_TOP|WB_VCENTER|WB_BOTTOM);
1771 [ + + ]: 465 : if ( !bVoid )
1772 [ + - ]: 2 : Value >>= eAlign;
1773 [ - + - + ]: 465 : switch ( eAlign )
1774 : : {
1775 : : case VerticalAlignment_TOP:
1776 : 0 : nStyle |= WB_TOP;
1777 : 0 : break;
1778 : : case VerticalAlignment_MIDDLE:
1779 : 2 : nStyle |= WB_VCENTER;
1780 : 2 : break;
1781 : : case VerticalAlignment_BOTTOM:
1782 : 0 : nStyle |= WB_BOTTOM;
1783 : 0 : break;
1784 : : default: ; // for warning free code, MAKE_FIXED_SIZE
1785 : : }
1786 [ + - ]: 465 : pWindow->SetStyle( nStyle );
1787 : : }
1788 : 465 : break;
1789 : : case BASEPROPERTY_ALIGN:
1790 : : {
1791 : 543 : sal_Int16 nAlign = PROPERTY_ALIGN_LEFT;
1792 [ + + + ]: 543 : switch ( eWinType )
1793 : : {
1794 : : case WINDOW_COMBOBOX:
1795 : : case WINDOW_BUTTON:
1796 : : case WINDOW_PUSHBUTTON:
1797 : : case WINDOW_OKBUTTON:
1798 : : case WINDOW_CANCELBUTTON:
1799 : : case WINDOW_HELPBUTTON:
1800 : 92 : nAlign = PROPERTY_ALIGN_CENTER;
1801 : : // no break here!
1802 : : case WINDOW_FIXEDTEXT:
1803 : : case WINDOW_EDIT:
1804 : : case WINDOW_MULTILINEEDIT:
1805 : : case WINDOW_CHECKBOX:
1806 : : case WINDOW_RADIOBUTTON:
1807 : : case WINDOW_LISTBOX:
1808 : : {
1809 [ + - ]: 329 : WinBits nStyle = pWindow->GetStyle();
1810 : 329 : nStyle &= ~(WB_LEFT|WB_CENTER|WB_RIGHT);
1811 [ + - ]: 329 : if ( !bVoid )
1812 : 329 : Value >>= nAlign;
1813 [ + + ]: 329 : if ( nAlign == PROPERTY_ALIGN_LEFT )
1814 : 227 : nStyle |= WB_LEFT;
1815 [ + - ]: 102 : else if ( nAlign == PROPERTY_ALIGN_CENTER )
1816 : 102 : nStyle |= WB_CENTER;
1817 : : else
1818 : 0 : nStyle |= WB_RIGHT;
1819 [ + - ]: 329 : pWindow->SetStyle( nStyle );
1820 : : }
1821 : 329 : break;
1822 : : }
1823 : : }
1824 : 543 : break;
1825 : : case BASEPROPERTY_MULTILINE:
1826 : : {
1827 [ + + ][ + + ]: 291 : if ( ( eWinType == WINDOW_FIXEDTEXT )
[ + + ][ + - ]
[ + + ][ + - ]
[ + - ][ - + ]
1828 : : || ( eWinType == WINDOW_CHECKBOX )
1829 : : || ( eWinType == WINDOW_RADIOBUTTON )
1830 : : || ( eWinType == WINDOW_BUTTON )
1831 : : || ( eWinType == WINDOW_PUSHBUTTON )
1832 : : || ( eWinType == WINDOW_OKBUTTON )
1833 : : || ( eWinType == WINDOW_CANCELBUTTON )
1834 : : || ( eWinType == WINDOW_HELPBUTTON )
1835 : : )
1836 : : {
1837 [ + - ]: 124 : WinBits nStyle = pWindow->GetStyle();
1838 : 124 : sal_Bool bMulti = false;
1839 : 124 : Value >>= bMulti;
1840 [ + + ]: 124 : if ( bMulti )
1841 : 20 : nStyle |= WB_WORDBREAK;
1842 : : else
1843 : 104 : nStyle &= ~WB_WORDBREAK;
1844 [ + - ]: 124 : pWindow->SetStyle( nStyle );
1845 : : }
1846 : : }
1847 : 291 : break;
1848 : : case BASEPROPERTY_ORIENTATION:
1849 : : {
1850 [ # # ]: 0 : switch ( eWinType )
1851 : : {
1852 : : case WINDOW_FIXEDLINE:
1853 : : {
1854 : 0 : sal_Int32 nOrientation = 0;
1855 [ # # ]: 0 : if ( Value >>= nOrientation )
1856 : : {
1857 [ # # ]: 0 : WinBits nStyle = pWindow->GetStyle();
1858 : 0 : nStyle &= ~(WB_HORZ|WB_VERT);
1859 [ # # ]: 0 : if ( nOrientation == 0 )
1860 : 0 : nStyle |= WB_HORZ;
1861 : : else
1862 : 0 : nStyle |= WB_VERT;
1863 : :
1864 [ # # ]: 0 : pWindow->SetStyle( nStyle );
1865 : : }
1866 : : }
1867 : 0 : break;
1868 : : }
1869 : : }
1870 : 0 : break;
1871 : : case BASEPROPERTY_AUTOMNEMONICS:
1872 : : {
1873 : 0 : sal_Bool bAutoMnemonics = false;
1874 : 0 : Value >>= bAutoMnemonics;
1875 [ # # ]: 0 : AllSettings aSettings = pWindow->GetSettings();
1876 [ # # ]: 0 : StyleSettings aStyleSettings = aSettings.GetStyleSettings();
1877 [ # # ]: 0 : if ( aStyleSettings.GetAutoMnemonic() != bAutoMnemonics )
1878 : : {
1879 [ # # ]: 0 : aStyleSettings.SetAutoMnemonic( bAutoMnemonics );
1880 [ # # ]: 0 : aSettings.SetStyleSettings( aStyleSettings );
1881 [ # # ]: 0 : pWindow->SetSettings( aSettings );
1882 [ # # ][ # # ]: 0 : }
1883 : : }
1884 : 0 : break;
1885 : : case BASEPROPERTY_MOUSETRANSPARENT:
1886 : : {
1887 : 0 : sal_Bool bMouseTransparent = false;
1888 : 0 : Value >>= bMouseTransparent;
1889 [ # # ]: 0 : pWindow->SetMouseTransparent( bMouseTransparent );
1890 : : }
1891 : 0 : break;
1892 : : case BASEPROPERTY_PAINTTRANSPARENT:
1893 : : {
1894 : 0 : sal_Bool bPaintTransparent = false;
1895 : 0 : Value >>= bPaintTransparent;
1896 [ # # ]: 0 : pWindow->SetPaintTransparent( bPaintTransparent );
1897 : : // pWindow->SetBackground();
1898 : : }
1899 : 0 : break;
1900 : :
1901 : : case BASEPROPERTY_REPEAT:
1902 : : {
1903 : 276 : sal_Bool bRepeat( sal_False );
1904 : 276 : Value >>= bRepeat;
1905 : :
1906 [ + - ]: 276 : WinBits nStyle = pWindow->GetStyle();
1907 [ + + ]: 276 : if ( bRepeat )
1908 : 86 : nStyle |= WB_REPEAT;
1909 : : else
1910 : 190 : nStyle &= ~WB_REPEAT;
1911 [ + - ]: 276 : pWindow->SetStyle( nStyle );
1912 : : }
1913 : 276 : break;
1914 : :
1915 : : case BASEPROPERTY_REPEAT_DELAY:
1916 : : {
1917 : 330 : sal_Int32 nRepeatDelay = 0;
1918 [ + - ]: 330 : if ( Value >>= nRepeatDelay )
1919 : : {
1920 [ + - ]: 330 : AllSettings aSettings = pWindow->GetSettings();
1921 [ + - ]: 330 : MouseSettings aMouseSettings = aSettings.GetMouseSettings();
1922 : :
1923 [ + - ]: 330 : aMouseSettings.SetButtonRepeat( nRepeatDelay );
1924 [ + - ]: 330 : aSettings.SetMouseSettings( aMouseSettings );
1925 : :
1926 [ + - ][ + - ]: 330 : pWindow->SetSettings( aSettings, sal_True );
[ + - ]
1927 : : }
1928 : : }
1929 : 330 : break;
1930 : :
1931 : : case BASEPROPERTY_SYMBOL_COLOR:
1932 [ + - ]: 4 : ::toolkit::setColorSettings( pWindow, Value, &StyleSettings::SetButtonTextColor, &StyleSettings::GetButtonTextColor );
1933 : 4 : break;
1934 : :
1935 : : case BASEPROPERTY_BORDERCOLOR:
1936 [ + - ]: 489 : ::toolkit::setColorSettings( pWindow, Value, &StyleSettings::SetMonoColor, &StyleSettings::GetMonoColor);
1937 : 489 : break;
1938 : : case BASEPROPERTY_DEFAULTCONTROL:
1939 : : {
1940 : 906 : rtl::OUString aName;
1941 : 906 : Value >>= aName;
1942 : 50034 : break;
1943 : : }
1944 [ + - ][ + - ]: 50034 : }
1945 : : }
1946 : :
1947 : 96 : ::com::sun::star::uno::Any VCLXWindow::getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException)
1948 : : {
1949 [ + - ]: 96 : SolarMutexGuard aGuard;
1950 : :
1951 : 96 : ::com::sun::star::uno::Any aProp;
1952 [ + - ]: 96 : if ( GetWindow() )
1953 : : {
1954 [ + - ]: 96 : WindowType eWinType = GetWindow()->GetType();
1955 [ + - ]: 96 : sal_uInt16 nPropType = GetPropertyId( PropertyName );
1956 [ - - - - : 96 : switch ( nPropType )
- - - - +
- - - - -
- - - - -
- - - - -
- - - - -
- - - -
- ]
1957 : : {
1958 : : case BASEPROPERTY_REFERENCE_DEVICE:
1959 : : {
1960 [ # # ]: 0 : Control* pControl = dynamic_cast< Control* >( GetWindow() );
1961 : : OSL_ENSURE( pControl, "VCLXWindow::setProperty( RefDevice ): need a Control for this!" );
1962 [ # # ]: 0 : if ( !pControl )
1963 : 0 : break;
1964 : :
1965 [ # # ]: 0 : VCLXDevice* pDevice = new VCLXDevice;
1966 [ # # ]: 0 : pDevice->SetOutputDevice( pControl->GetReferenceDevice() );
1967 [ # # ][ # # ]: 0 : aProp <<= Reference< XDevice >( pDevice );
1968 : : }
1969 : 0 : break;
1970 : :
1971 : : case BASEPROPERTY_CONTEXT_WRITING_MODE:
1972 [ # # ]: 0 : aProp <<= mpImpl->mnContextWritingMode;
1973 : 0 : break;
1974 : :
1975 : : case BASEPROPERTY_WRITING_MODE:
1976 [ # # ]: 0 : aProp <<= mpImpl->mnWritingMode;
1977 : 0 : break;
1978 : :
1979 : : case BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR:
1980 : : {
1981 : 0 : sal_uInt16 nVclBehavior = GetWindow()->GetSettings().GetMouseSettings().GetWheelBehavior();
1982 : 0 : sal_Int16 nBehavior = MouseWheelBehavior::SCROLL_FOCUS_ONLY;
1983 [ # # # # ]: 0 : switch ( nVclBehavior )
1984 : : {
1985 : 0 : case MOUSE_WHEEL_DISABLE: nBehavior = MouseWheelBehavior::SCROLL_DISABLED; break;
1986 : 0 : case MOUSE_WHEEL_FOCUS_ONLY: nBehavior = MouseWheelBehavior::SCROLL_FOCUS_ONLY; break;
1987 : 0 : case MOUSE_WHEEL_ALWAYS: nBehavior = MouseWheelBehavior::SCROLL_ALWAYS; break;
1988 : : default:
1989 : : OSL_FAIL( "VCLXWindow::getProperty( 'MouseWheelBehavior' ): illegal VCL value!" );
1990 : : }
1991 [ # # ]: 0 : aProp <<= nBehavior;
1992 : : }
1993 : 0 : break;
1994 : :
1995 : : case BASEPROPERTY_NATIVE_WIDGET_LOOK:
1996 [ # # ][ # # ]: 0 : aProp <<= (sal_Bool) GetWindow()->IsNativeWidgetEnabled();
1997 : 0 : break;
1998 : :
1999 : : case BASEPROPERTY_ENABLED:
2000 [ # # ][ # # ]: 0 : aProp <<= (sal_Bool) GetWindow()->IsEnabled();
2001 : 0 : break;
2002 : :
2003 : : case BASEPROPERTY_ENABLEVISIBLE:
2004 [ # # ]: 0 : aProp <<= (sal_Bool) mpImpl->isEnableVisible();
2005 : 0 : break;
2006 : :
2007 : : case BASEPROPERTY_HIGHCONTRASTMODE:
2008 [ # # ]: 0 : aProp <<= (sal_Bool) GetWindow()->GetSettings().GetStyleSettings().GetHighContrastMode();
2009 : 0 : break;
2010 : :
2011 : : case BASEPROPERTY_TEXT:
2012 : : case BASEPROPERTY_LABEL:
2013 : : case BASEPROPERTY_TITLE:
2014 : : {
2015 [ + - ][ + - ]: 96 : ::rtl::OUString aText = GetWindow()->GetText();
[ + - ]
2016 [ + - ]: 96 : aProp <<= aText;
2017 : : }
2018 : 96 : break;
2019 : : case BASEPROPERTY_ACCESSIBLENAME:
2020 : : {
2021 [ # # ][ # # ]: 0 : ::rtl::OUString aText = GetWindow()->GetAccessibleName();
[ # # ]
2022 [ # # ]: 0 : aProp <<= aText;
2023 : : }
2024 : 0 : break;
2025 : : case BASEPROPERTY_HELPTEXT:
2026 : : {
2027 [ # # ][ # # ]: 0 : ::rtl::OUString aText = GetWindow()->GetQuickHelpText();
2028 [ # # ]: 0 : aProp <<= aText;
2029 : : }
2030 : 0 : break;
2031 : : case BASEPROPERTY_HELPURL:
2032 : : {
2033 [ # # ][ # # ]: 0 : rtl::OUString aHelpId( rtl::OStringToOUString( GetWindow()->GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
2034 [ # # ]: 0 : aProp <<= ::rtl::OUString( aHelpId );
2035 : : }
2036 : 0 : break;
2037 : : case BASEPROPERTY_FONTDESCRIPTOR:
2038 : : {
2039 [ # # ]: 0 : Font aFont = GetWindow()->GetControlFont();
2040 [ # # ]: 0 : ::com::sun::star::awt::FontDescriptor aFD = VCLUnoHelper::CreateFontDescriptor( aFont );
2041 [ # # ][ # # ]: 0 : aProp <<= aFD;
2042 : : }
2043 : 0 : break;
2044 : : case BASEPROPERTY_BACKGROUNDCOLOR:
2045 [ # # ][ # # ]: 0 : aProp <<= (sal_Int32) GetWindow()->GetControlBackground().GetColor();
2046 : 0 : break;
2047 : : case BASEPROPERTY_DISPLAYBACKGROUNDCOLOR:
2048 [ # # ][ # # ]: 0 : aProp <<= (sal_Int32) GetWindow()->GetDisplayBackground().GetColor().GetColor();
[ # # ]
2049 : 0 : break;
2050 : : case BASEPROPERTY_FONTRELIEF:
2051 [ # # ][ # # ]: 0 : aProp <<= (sal_Int16) GetWindow()->GetControlFont().GetRelief();
[ # # ][ # # ]
2052 : 0 : break;
2053 : : case BASEPROPERTY_FONTEMPHASISMARK:
2054 [ # # ][ # # ]: 0 : aProp <<= (sal_Int16) GetWindow()->GetControlFont().GetEmphasisMark();
[ # # ][ # # ]
2055 : 0 : break;
2056 : : case BASEPROPERTY_TEXTCOLOR:
2057 [ # # ][ # # ]: 0 : aProp <<= (sal_Int32) GetWindow()->GetControlForeground().GetColor();
2058 : 0 : break;
2059 : : case BASEPROPERTY_TEXTLINECOLOR:
2060 [ # # ]: 0 : aProp <<= (sal_Int32) GetWindow()->GetTextLineColor().GetColor();
2061 : 0 : break;
2062 : : case BASEPROPERTY_FILLCOLOR:
2063 [ # # ]: 0 : aProp <<= (sal_Int32) GetWindow()->GetFillColor().GetColor();
2064 : 0 : break;
2065 : : case BASEPROPERTY_LINECOLOR:
2066 [ # # ]: 0 : aProp <<= (sal_Int32) GetWindow()->GetLineColor().GetColor();
2067 : 0 : break;
2068 : : case BASEPROPERTY_BORDER:
2069 : : {
2070 : 0 : sal_Int16 nBorder = 0;
2071 [ # # ][ # # ]: 0 : if ( GetWindow()->GetStyle() & WB_BORDER )
2072 [ # # ]: 0 : nBorder = GetWindow()->GetBorderStyle();
2073 [ # # ]: 0 : aProp <<= nBorder;
2074 : : }
2075 : 0 : break;
2076 : : case BASEPROPERTY_TABSTOP:
2077 [ # # ][ # # ]: 0 : aProp <<= (sal_Bool) ( GetWindow()->GetStyle() & WB_TABSTOP ) ? sal_True : sal_False;
2078 : 0 : break;
2079 : : case BASEPROPERTY_VERTICALALIGN:
2080 : : {
2081 [ # # ]: 0 : WinBits nStyle = GetWindow()->GetStyle();
2082 [ # # ]: 0 : if ( nStyle & WB_TOP )
2083 [ # # ]: 0 : aProp <<= VerticalAlignment_TOP;
2084 [ # # ]: 0 : else if ( nStyle & WB_VCENTER )
2085 [ # # ]: 0 : aProp <<= VerticalAlignment_MIDDLE;
2086 [ # # ]: 0 : else if ( nStyle & WB_BOTTOM )
2087 [ # # ]: 0 : aProp <<= VerticalAlignment_BOTTOM;
2088 : : }
2089 : 0 : break;
2090 : : case BASEPROPERTY_ALIGN:
2091 : : {
2092 [ # # ]: 0 : switch ( eWinType )
2093 : : {
2094 : : case WINDOW_FIXEDTEXT:
2095 : : case WINDOW_EDIT:
2096 : : case WINDOW_MULTILINEEDIT:
2097 : : case WINDOW_CHECKBOX:
2098 : : case WINDOW_RADIOBUTTON:
2099 : : case WINDOW_LISTBOX:
2100 : : case WINDOW_COMBOBOX:
2101 : : case WINDOW_BUTTON:
2102 : : case WINDOW_PUSHBUTTON:
2103 : : case WINDOW_OKBUTTON:
2104 : : case WINDOW_CANCELBUTTON:
2105 : : case WINDOW_HELPBUTTON:
2106 : : {
2107 [ # # ]: 0 : WinBits nStyle = GetWindow()->GetStyle();
2108 [ # # ]: 0 : if ( nStyle & WB_LEFT )
2109 [ # # ]: 0 : aProp <<= (sal_Int16) PROPERTY_ALIGN_LEFT;
2110 [ # # ]: 0 : else if ( nStyle & WB_CENTER )
2111 [ # # ]: 0 : aProp <<= (sal_Int16) PROPERTY_ALIGN_CENTER;
2112 [ # # ]: 0 : else if ( nStyle & WB_RIGHT )
2113 [ # # ]: 0 : aProp <<= (sal_Int16) PROPERTY_ALIGN_RIGHT;
2114 : : }
2115 : 0 : break;
2116 : : }
2117 : : }
2118 : : case BASEPROPERTY_MULTILINE:
2119 : : {
2120 [ # # ][ # # ]: 0 : if ( ( eWinType == WINDOW_FIXEDTEXT )
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ][ # # ]
2121 : : || ( eWinType == WINDOW_CHECKBOX )
2122 : : || ( eWinType == WINDOW_RADIOBUTTON )
2123 : : || ( eWinType == WINDOW_BUTTON )
2124 : : || ( eWinType == WINDOW_PUSHBUTTON )
2125 : : || ( eWinType == WINDOW_OKBUTTON )
2126 : : || ( eWinType == WINDOW_CANCELBUTTON )
2127 : : || ( eWinType == WINDOW_HELPBUTTON )
2128 : : )
2129 [ # # ][ # # ]: 0 : aProp <<= (sal_Bool) ( GetWindow()->GetStyle() & WB_WORDBREAK ) ? sal_True : sal_False;
2130 : : }
2131 : 0 : break;
2132 : : case BASEPROPERTY_AUTOMNEMONICS:
2133 : : {
2134 : 0 : sal_Bool bAutoMnemonics = GetWindow()->GetSettings().GetStyleSettings().GetAutoMnemonic();
2135 [ # # ]: 0 : aProp <<= bAutoMnemonics;
2136 : : }
2137 : 0 : break;
2138 : : case BASEPROPERTY_MOUSETRANSPARENT:
2139 : : {
2140 [ # # ]: 0 : sal_Bool bMouseTransparent = GetWindow()->IsMouseTransparent();
2141 [ # # ]: 0 : aProp <<= bMouseTransparent;
2142 : : }
2143 : 0 : break;
2144 : : case BASEPROPERTY_PAINTTRANSPARENT:
2145 : : {
2146 [ # # ]: 0 : sal_Bool bPaintTransparent = GetWindow()->IsPaintTransparent();
2147 [ # # ]: 0 : aProp <<= bPaintTransparent;
2148 : : }
2149 : 0 : break;
2150 : :
2151 : : case BASEPROPERTY_REPEAT:
2152 [ # # ][ # # ]: 0 : aProp <<= (sal_Bool)( 0 != ( GetWindow()->GetStyle() & WB_REPEAT ) );
2153 : 0 : break;
2154 : :
2155 : : case BASEPROPERTY_REPEAT_DELAY:
2156 : : {
2157 : 0 : sal_Int32 nButtonRepeat = GetWindow()->GetSettings().GetMouseSettings().GetButtonRepeat();
2158 [ # # ]: 0 : aProp <<= (sal_Int32)nButtonRepeat;
2159 : : }
2160 : 0 : break;
2161 : :
2162 : : case BASEPROPERTY_SYMBOL_COLOR:
2163 [ # # ]: 0 : aProp <<= (sal_Int32)GetWindow()->GetSettings().GetStyleSettings().GetButtonTextColor().GetColor();
2164 : 0 : break;
2165 : :
2166 : : case BASEPROPERTY_BORDERCOLOR:
2167 [ # # ]: 0 : aProp <<= (sal_Int32)GetWindow()->GetSettings().GetStyleSettings().GetMonoColor().GetColor();
2168 : 96 : break;
2169 : : }
2170 : : }
2171 [ + - ]: 96 : return aProp;
2172 : : }
2173 : :
2174 : :
2175 : : // ::com::sun::star::awt::XLayoutConstrains
2176 : 0 : ::com::sun::star::awt::Size VCLXWindow::getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException)
2177 : : {
2178 [ # # ]: 0 : SolarMutexGuard aGuard;
2179 : :
2180 : : // Use this method only for those components which can be created through
2181 : : // ::com::sun::star::awt::Toolkit , but do not have an interface
2182 : :
2183 : 0 : Size aSz;
2184 [ # # ]: 0 : if ( GetWindow() )
2185 : : {
2186 [ # # ]: 0 : WindowType nWinType = GetWindow()->GetType();
2187 [ # # # # ]: 0 : switch ( nWinType )
2188 : : {
2189 : : case WINDOW_CONTROL:
2190 [ # # ][ # # ]: 0 : aSz.Width() = GetWindow()->GetTextWidth( GetWindow()->GetText() )+2*12;
[ # # ]
2191 [ # # ]: 0 : aSz.Height() = GetWindow()->GetTextHeight()+2*6;
2192 : 0 : break;
2193 : :
2194 : : case WINDOW_PATTERNBOX:
2195 : : case WINDOW_NUMERICBOX:
2196 : : case WINDOW_METRICBOX:
2197 : : case WINDOW_CURRENCYBOX:
2198 : : case WINDOW_DATEBOX:
2199 : : case WINDOW_TIMEBOX:
2200 : : case WINDOW_LONGCURRENCYBOX:
2201 [ # # ][ # # ]: 0 : aSz.Width() = GetWindow()->GetTextWidth( GetWindow()->GetText() )+2*2;
[ # # ]
2202 [ # # ]: 0 : aSz.Height() = GetWindow()->GetTextHeight()+2*2;
2203 : 0 : break;
2204 : : case WINDOW_SCROLLBARBOX:
2205 [ # # ]: 0 : return VCLXScrollBar::implGetMinimumSize( GetWindow() );
2206 : : default:
2207 [ # # ]: 0 : aSz = GetWindow()->GetOptimalSize( WINDOWSIZE_MINIMUM );
2208 : : }
2209 : : }
2210 : :
2211 [ # # ]: 0 : return ::com::sun::star::awt::Size( aSz.Width(), aSz.Height() );
2212 : : }
2213 : :
2214 : 0 : ::com::sun::star::awt::Size VCLXWindow::getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException)
2215 : : {
2216 : 0 : return getMinimumSize();
2217 : : }
2218 : :
2219 : 0 : ::com::sun::star::awt::Size VCLXWindow::calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException)
2220 : : {
2221 [ # # ]: 0 : SolarMutexGuard aGuard;
2222 : :
2223 : 0 : ::com::sun::star::awt::Size aNewSize( rNewSize );
2224 [ # # ]: 0 : ::com::sun::star::awt::Size aMinSize = getMinimumSize();
2225 : :
2226 [ # # ]: 0 : if ( aNewSize.Width < aMinSize.Width )
2227 : 0 : aNewSize.Width = aMinSize.Width;
2228 [ # # ]: 0 : if ( aNewSize.Height < aMinSize.Height )
2229 : 0 : aNewSize.Height = aMinSize.Height;
2230 : :
2231 [ # # ]: 0 : return aNewSize;
2232 : : }
2233 : :
2234 : :
2235 : : // ::com::sun::star::awt::XView
2236 : 9214 : sal_Bool VCLXWindow::setGraphics( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& rxDevice ) throw(::com::sun::star::uno::RuntimeException)
2237 : : {
2238 [ + - ]: 9214 : SolarMutexGuard aGuard;
2239 : :
2240 [ + - ][ + + ]: 9214 : if ( VCLUnoHelper::GetOutputDevice( rxDevice ) )
2241 [ + - ]: 4293 : mpImpl->mxViewGraphics = rxDevice;
2242 : : else
2243 [ + - ]: 4921 : mpImpl->mxViewGraphics = NULL;
2244 : :
2245 [ + - ]: 9214 : return mpImpl->mxViewGraphics.is();
2246 : : }
2247 : :
2248 : 106 : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > VCLXWindow::getGraphics( ) throw(::com::sun::star::uno::RuntimeException)
2249 : : {
2250 [ + - ]: 106 : SolarMutexGuard aGuard;
2251 : :
2252 [ + - ]: 106 : return mpImpl->mxViewGraphics;
2253 : : }
2254 : :
2255 : 0 : ::com::sun::star::awt::Size VCLXWindow::getSize( ) throw(::com::sun::star::uno::RuntimeException)
2256 : : {
2257 [ # # ]: 0 : SolarMutexGuard aGuard;
2258 : :
2259 : 0 : Size aSz;
2260 [ # # ]: 0 : if ( GetWindow() )
2261 [ # # ]: 0 : aSz = GetWindow()->GetSizePixel();
2262 [ # # ]: 0 : return ::com::sun::star::awt::Size( aSz.Width(), aSz.Height() );
2263 : : }
2264 : :
2265 : 4042 : void VCLXWindow::draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException)
2266 : : {
2267 [ + - ]: 4042 : SolarMutexGuard aGuard;
2268 : :
2269 : 4042 : Window* pWindow = GetWindow();
2270 [ - + ]: 4042 : if ( !pWindow )
2271 : : return;
2272 : :
2273 [ + - ][ + + ]: 4042 : if ( isDesignMode() || mpImpl->isEnableVisible() )
[ + - ][ + - ]
2274 : : {
2275 [ - + ]: 4042 : TabPage* pTabPage = dynamic_cast< TabPage* >( pWindow );
2276 [ - + ]: 4042 : if ( pTabPage )
2277 : : {
2278 : 0 : Point aPos( nX, nY );
2279 [ # # ]: 0 : Size aSize = pWindow->GetSizePixel();
2280 : :
2281 [ # # ]: 0 : OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( mpImpl->mxViewGraphics );
2282 [ # # ]: 0 : aPos = pDev->PixelToLogic( aPos );
2283 [ # # ]: 0 : aSize = pDev->PixelToLogic( aSize );
2284 : :
2285 [ # # ]: 0 : pTabPage->Draw( pDev, aPos, aSize, 0 );
2286 : : return;
2287 : : }
2288 : :
2289 [ + - ]: 4042 : OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( mpImpl->mxViewGraphics );
2290 : 4042 : Point aPos( nX, nY );
2291 : :
2292 [ - + ]: 4042 : if ( !pDev )
2293 [ # # ]: 0 : pDev = pWindow->GetParent();
2294 : :
2295 [ + - ][ + - ]: 4042 : if ( pWindow->GetParent() && !pWindow->IsSystemWindow() && ( pWindow->GetParent() == pDev ) )
[ + - ][ + - ]
[ + - ][ - + ]
[ - + ]
2296 : : {
2297 : : // #i40647# don't draw here if this is a recursive call
2298 : : // sometimes this is called recursively, because the Update call on the parent
2299 : : // (strangely) triggers another paint. Prevent a stack overflow here
2300 : : // Yes, this is only fixing symptoms for the moment ....
2301 : : // #i40647# / 2005-01-18 / frank.schoenheit@sun.com
2302 [ # # ]: 0 : if ( !mpImpl->getDrawingOntoParent_ref() )
2303 : : {
2304 [ # # ]: 0 : ::comphelper::FlagGuard aDrawingflagGuard( mpImpl->getDrawingOntoParent_ref() );
2305 : :
2306 [ # # ]: 0 : sal_Bool bWasVisible = pWindow->IsVisible();
2307 [ # # ]: 0 : Point aOldPos( pWindow->GetPosPixel() );
2308 : :
2309 [ # # ][ # # ]: 0 : if ( bWasVisible && aOldPos == aPos )
[ # # ]
2310 : : {
2311 [ # # ]: 0 : pWindow->Update();
2312 : : return;
2313 : : }
2314 : :
2315 [ # # ]: 0 : pWindow->SetPosPixel( aPos );
2316 : :
2317 : : // Update parent first to avoid painting the parent upon the update
2318 : : // of this window, as it may otherwise cause the parent
2319 : : // to hide this window again
2320 [ # # ][ # # ]: 0 : if( pWindow->GetParent() )
2321 [ # # ][ # # ]: 0 : pWindow->GetParent()->Update();
2322 : :
2323 [ # # ]: 0 : pWindow->Show();
2324 [ # # ]: 0 : pWindow->Update();
2325 [ # # ]: 0 : pWindow->SetParentUpdateMode( sal_False );
2326 [ # # ]: 0 : pWindow->Hide();
2327 [ # # ]: 0 : pWindow->SetParentUpdateMode( sal_True );
2328 : :
2329 [ # # ]: 0 : pWindow->SetPosPixel( aOldPos );
2330 [ # # ]: 0 : if ( bWasVisible )
2331 [ # # ][ # # ]: 0 : pWindow->Show( sal_True );
[ # # ]
2332 : : }
2333 : : }
2334 [ + - ]: 4042 : else if ( pDev )
2335 : : {
2336 [ + - ]: 4042 : Size aSz = pWindow->GetSizePixel();
2337 [ + - ]: 4042 : aSz = pDev->PixelToLogic( aSz );
2338 [ + - ]: 4042 : Point aP = pDev->PixelToLogic( aPos );
2339 : :
2340 [ + - ]: 4042 : vcl::PDFExtOutDevData* pPDFExport = dynamic_cast<vcl::PDFExtOutDevData*>(pDev->GetExtOutDevData());
2341 : 4042 : bool bDrawSimple = ( pDev->GetOutDevType() == OUTDEV_PRINTER )
2342 : 4042 : || ( pDev->GetOutDevViewType() == OUTDEV_VIEWTYPE_PRINTPREVIEW )
2343 [ - + ]: 8084 : || ( pPDFExport != NULL );
[ + - + - ]
2344 [ - + ]: 4042 : if ( bDrawSimple )
2345 : : {
2346 [ # # ]: 0 : pWindow->Draw( pDev, aP, aSz, WINDOW_DRAW_NOCONTROLS );
2347 : : }
2348 : : else
2349 : : {
2350 [ + - ]: 4042 : sal_Bool bOldNW =pWindow->IsNativeWidgetEnabled();
2351 [ + + ]: 4042 : if( bOldNW )
2352 [ + - ]: 1379 : pWindow->EnableNativeWidget(sal_False);
2353 [ + - ]: 4042 : pWindow->PaintToDevice( pDev, aP, aSz );
2354 [ + + ]: 4042 : if( bOldNW )
2355 [ + - ]: 4042 : pWindow->EnableNativeWidget(sal_True);
2356 : : }
2357 : : }
2358 [ + - ][ + - ]: 4042 : }
2359 : : }
2360 : :
2361 : 20240 : void VCLXWindow::setZoom( float fZoomX, float /*fZoomY*/ ) throw(::com::sun::star::uno::RuntimeException)
2362 : : {
2363 [ + - ]: 20240 : SolarMutexGuard aGuard;
2364 : :
2365 [ + - ]: 20240 : if ( GetWindow() )
2366 : : {
2367 : : // Fraction::Fraction takes a double, but we have a float only.
2368 : : // The implicit conversion from float to double can result in a precision loss, i.e. 1.2 is converted to
2369 : : // 1.200000000047something. To prevent this, we convert explicitly to double, and round it.
2370 : 20240 : double nZoom( fZoomX );
2371 : 20240 : nZoom = ::rtl::math::round( nZoom, 4 );
2372 [ + - ][ + - ]: 20240 : GetWindow()->SetZoom( Fraction( nZoom ) );
2373 [ + - ]: 20240 : }
2374 : 20240 : }
2375 : :
2376 : : // ::com::sun::star::lang::XEventListener
2377 : 671 : void SAL_CALL VCLXWindow::disposing( const ::com::sun::star::lang::EventObject& _rSource ) throw (::com::sun::star::uno::RuntimeException)
2378 : : {
2379 [ + - ]: 671 : SolarMutexGuard aGuard;
2380 : :
2381 : : // check if it comes from our AccessibleContext
2382 [ + - ]: 671 : uno::Reference< uno::XInterface > aAC( mpImpl->mxAccessibleContext, uno::UNO_QUERY );
2383 [ + - ]: 671 : uno::Reference< uno::XInterface > xSource( _rSource.Source, uno::UNO_QUERY );
2384 : :
2385 [ + - ][ + - ]: 671 : if ( aAC.get() == xSource.get() )
[ + + ]
2386 : : { // yep, it does
2387 [ + - ]: 447 : mpImpl->mxAccessibleContext = uno::Reference< accessibility::XAccessibleContext >();
2388 [ + - ]: 671 : }
2389 : 671 : }
2390 : :
2391 : : // ::com::sun::star::accessibility::XAccessible
2392 : 1846 : ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > VCLXWindow::getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException)
2393 : : {
2394 : : using namespace ::com::sun::star;
2395 : :
2396 [ + - ]: 1846 : SolarMutexGuard aGuard;
2397 : :
2398 : : // already disposed
2399 [ - + ]: 1846 : if( ! mpImpl )
2400 : 0 : return uno::Reference< accessibility::XAccessibleContext >();
2401 : :
2402 [ + + ][ + - ]: 1846 : if ( !mpImpl->mxAccessibleContext.is() && GetWindow() )
[ + + ]
2403 : : {
2404 [ + - ][ + - ]: 447 : mpImpl->mxAccessibleContext = CreateAccessibleContext();
2405 : :
2406 : : // add as event listener to this component
2407 : : // in case somebody disposes it, we do not want to have a (though weak) reference to a dead
2408 : : // object
2409 [ + - ]: 447 : uno::Reference< lang::XComponent > xComp( mpImpl->mxAccessibleContext, uno::UNO_QUERY );
2410 [ + - ]: 447 : if ( xComp.is() )
2411 [ + - ][ + - ]: 447 : xComp->addEventListener( this );
[ + - ]
2412 : : }
2413 : :
2414 [ + - ]: 1846 : return mpImpl->mxAccessibleContext;
2415 : : }
2416 : :
2417 : : // ::com::sun::star::awt::XDockable
2418 : 3709 : void SAL_CALL VCLXWindow::addDockableWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDockableWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
2419 : : {
2420 [ + - ]: 3709 : SolarMutexGuard aGuard;
2421 : :
2422 [ + - ]: 3709 : if ( xListener.is() )
2423 [ + - ][ + - ]: 3709 : mpImpl->getDockableWindowListeners().addInterface( xListener );
2424 : :
2425 : 3709 : }
2426 : :
2427 : 0 : void SAL_CALL VCLXWindow::removeDockableWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDockableWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException)
2428 : : {
2429 [ # # ]: 0 : SolarMutexGuard aGuard;
2430 : :
2431 [ # # ][ # # ]: 0 : mpImpl->getDockableWindowListeners().removeInterface( xListener );
2432 : 0 : }
2433 : :
2434 : 3709 : void SAL_CALL VCLXWindow::enableDocking( sal_Bool bEnable ) throw (::com::sun::star::uno::RuntimeException)
2435 : : {
2436 [ + - ]: 3709 : SolarMutexGuard aGuard;
2437 : :
2438 : 3709 : Window* pWindow = GetWindow();
2439 [ + - ]: 3709 : if ( pWindow )
2440 [ + - ][ + - ]: 3709 : pWindow->EnableDocking( bEnable );
2441 : 3709 : }
2442 : :
2443 : 6859 : sal_Bool SAL_CALL VCLXWindow::isFloating( ) throw (::com::sun::star::uno::RuntimeException)
2444 : : {
2445 [ + - ]: 6859 : SolarMutexGuard aGuard;
2446 : :
2447 : 6859 : Window* pWindow = GetWindow();
2448 [ + - ]: 6859 : if( pWindow )
2449 [ + - ][ + - ]: 6859 : return Window::GetDockingManager()->IsFloating( pWindow );
2450 : : else
2451 [ + - ]: 6859 : return sal_False;
2452 : : }
2453 : :
2454 : 3709 : void SAL_CALL VCLXWindow::setFloatingMode( sal_Bool bFloating ) throw (::com::sun::star::uno::RuntimeException)
2455 : : {
2456 [ + - ]: 3709 : SolarMutexGuard aGuard;
2457 : :
2458 : 3709 : Window* pWindow = GetWindow();
2459 [ + - ]: 3709 : if( pWindow )
2460 [ + - ][ + - ]: 3709 : Window::GetDockingManager()->SetFloatingMode( pWindow, bFloating );
[ + - ]
2461 : 3709 : }
2462 : :
2463 : 0 : sal_Bool SAL_CALL VCLXWindow::isLocked( ) throw (::com::sun::star::uno::RuntimeException)
2464 : : {
2465 [ # # ]: 0 : SolarMutexGuard aGuard;
2466 : :
2467 : 0 : Window* pWindow = GetWindow();
2468 [ # # ]: 0 : if( pWindow )
2469 [ # # ][ # # ]: 0 : return Window::GetDockingManager()->IsLocked( pWindow );
2470 : : else
2471 [ # # ]: 0 : return sal_False;
2472 : : }
2473 : :
2474 : 0 : void SAL_CALL VCLXWindow::lock( ) throw (::com::sun::star::uno::RuntimeException)
2475 : : {
2476 [ # # ]: 0 : SolarMutexGuard aGuard;
2477 : :
2478 : 0 : Window* pWindow = GetWindow();
2479 [ # # ][ # # ]: 0 : if( pWindow && !Window::GetDockingManager()->IsFloating( pWindow ) )
[ # # ][ # # ]
[ # # ]
2480 [ # # ][ # # ]: 0 : Window::GetDockingManager()->Lock( pWindow );
[ # # ]
2481 : 0 : }
2482 : :
2483 : 0 : void SAL_CALL VCLXWindow::unlock( ) throw (::com::sun::star::uno::RuntimeException)
2484 : : {
2485 [ # # ]: 0 : SolarMutexGuard aGuard;
2486 : :
2487 : 0 : Window* pWindow = GetWindow();
2488 [ # # ][ # # ]: 0 : if( pWindow && !Window::GetDockingManager()->IsFloating( pWindow ) )
[ # # ][ # # ]
[ # # ]
2489 [ # # ][ # # ]: 0 : Window::GetDockingManager()->Unlock( pWindow );
[ # # ]
2490 : 0 : }
2491 : 0 : void SAL_CALL VCLXWindow::startPopupMode( const ::com::sun::star::awt::Rectangle& ) throw (::com::sun::star::uno::RuntimeException)
2492 : : {
2493 : : // TODO: remove interface in the next incompatible build
2494 [ # # ][ # # ]: 0 : SolarMutexGuard aGuard;
2495 : :
2496 : 0 : }
2497 : :
2498 : 0 : sal_Bool SAL_CALL VCLXWindow::isInPopupMode( ) throw (::com::sun::star::uno::RuntimeException)
2499 : : {
2500 : : // TODO: remove interface in the next incompatible build
2501 [ # # ]: 0 : SolarMutexGuard aGuard;
2502 [ # # ]: 0 : return sal_False;
2503 : : }
2504 : :
2505 : :
2506 : : // ::com::sun::star::awt::XWindow2
2507 : :
2508 : 3709 : void SAL_CALL VCLXWindow::setOutputSize( const ::com::sun::star::awt::Size& aSize ) throw (::com::sun::star::uno::RuntimeException)
2509 : : {
2510 [ + - ]: 3709 : SolarMutexGuard aGuard;
2511 : : Window *pWindow;
2512 [ + - ]: 3709 : if( (pWindow = GetWindow()) != NULL )
2513 : : {
2514 [ - + ]: 3709 : DockingWindow *pDockingWindow = dynamic_cast< DockingWindow* >(pWindow);
2515 [ + - ]: 3709 : if( pDockingWindow )
2516 [ + - ]: 3709 : pDockingWindow->SetOutputSizePixel( VCLSize( aSize ) );
2517 : : else
2518 [ # # ]: 0 : pWindow->SetOutputSizePixel( VCLSize( aSize ) );
2519 [ + - ]: 3709 : }
2520 : 3709 : }
2521 : :
2522 : 0 : ::com::sun::star::awt::Size SAL_CALL VCLXWindow::getOutputSize( ) throw (::com::sun::star::uno::RuntimeException)
2523 : : {
2524 [ # # ]: 0 : SolarMutexGuard aGuard;
2525 : : Window *pWindow;
2526 [ # # ]: 0 : if( (pWindow = GetWindow()) != NULL )
2527 : : {
2528 [ # # ]: 0 : DockingWindow *pDockingWindow = dynamic_cast< DockingWindow* >(pWindow);
2529 [ # # ]: 0 : if( pDockingWindow )
2530 [ # # ]: 0 : return AWTSize( pDockingWindow->GetOutputSizePixel() );
2531 : : else
2532 : 0 : return AWTSize( pWindow->GetOutputSizePixel() );
2533 : : }
2534 : : else
2535 [ # # ]: 0 : return ::com::sun::star::awt::Size();
2536 : : }
2537 : :
2538 : 11306 : sal_Bool SAL_CALL VCLXWindow::isVisible( ) throw (::com::sun::star::uno::RuntimeException)
2539 : : {
2540 [ + - ]: 11306 : SolarMutexGuard aGuard;
2541 [ + - ]: 11306 : if( GetWindow() )
2542 [ + - ]: 11306 : return GetWindow()->IsVisible();
2543 : : else
2544 [ + - ]: 11306 : return sal_False;
2545 : : }
2546 : :
2547 : 11614 : sal_Bool SAL_CALL VCLXWindow::isActive( ) throw (::com::sun::star::uno::RuntimeException)
2548 : : {
2549 [ + - ]: 11614 : SolarMutexGuard aGuard;
2550 [ + - ]: 11614 : if( GetWindow() )
2551 [ + - ]: 11614 : return GetWindow()->IsActive();
2552 : : else
2553 [ + - ]: 11614 : return sal_False;
2554 : :
2555 : : }
2556 : :
2557 : 44 : sal_Bool SAL_CALL VCLXWindow::isEnabled( ) throw (::com::sun::star::uno::RuntimeException)
2558 : : {
2559 [ + - ]: 44 : SolarMutexGuard aGuard;
2560 [ + - ]: 44 : if( GetWindow() )
2561 [ + - ]: 44 : return GetWindow()->IsEnabled();
2562 : : else
2563 [ + - ]: 44 : return sal_False;
2564 : : }
2565 : :
2566 : 0 : sal_Bool SAL_CALL VCLXWindow::hasFocus( ) throw (::com::sun::star::uno::RuntimeException)
2567 : : {
2568 [ # # ]: 0 : SolarMutexGuard aGuard;
2569 [ # # ]: 0 : if( GetWindow() )
2570 [ # # ]: 0 : return GetWindow()->HasFocus();
2571 : : else
2572 [ # # ]: 0 : return sal_False;
2573 : : }
2574 : :
2575 : : // ::com::sun::star::beans::XPropertySetInfo
2576 : :
2577 : : UnoPropertyArrayHelper *
2578 : 0 : VCLXWindow::GetPropHelper()
2579 : : {
2580 [ # # ]: 0 : SolarMutexGuard aGuard;
2581 [ # # ]: 0 : if ( mpImpl->mpPropHelper == NULL )
2582 : : {
2583 [ # # ]: 0 : std::list< sal_uInt16 > aIDs;
2584 [ # # ]: 0 : GetPropertyIds( aIDs );
2585 [ # # ]: 0 : mpImpl->mpPropHelper = new UnoPropertyArrayHelper( aIDs );
2586 : : }
2587 [ # # ]: 0 : return mpImpl->mpPropHelper;
2588 : : }
2589 : :
2590 : : ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL
2591 : 0 : VCLXWindow::getProperties() throw (::com::sun::star::uno::RuntimeException)
2592 : : {
2593 : 0 : return GetPropHelper()->getProperties();
2594 : : }
2595 : : ::com::sun::star::beans::Property SAL_CALL
2596 : 0 : VCLXWindow::getPropertyByName( const ::rtl::OUString& rName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException)
2597 : : {
2598 : 0 : return GetPropHelper()->getPropertyByName( rName );
2599 : : }
2600 : :
2601 : : ::sal_Bool SAL_CALL
2602 : 0 : VCLXWindow::hasPropertyByName( const ::rtl::OUString& rName ) throw (::com::sun::star::uno::RuntimeException)
2603 : : {
2604 : 0 : return GetPropHelper()->hasPropertyByName( rName );
2605 : : }
2606 : :
2607 : 0 : Reference< XStyleSettings > SAL_CALL VCLXWindow::getStyleSettings() throw (RuntimeException)
2608 : : {
2609 : 0 : return mpImpl->getStyleSettings();
2610 [ + - ][ + - ]: 843 : }
2611 : :
2612 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|