tabwindow.cxx (b63233d8) | tabwindow.cxx (53d915a9) |
---|---|
1/************************************************************** | 1/************************************************************** |
2 * | 2 * |
3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at | 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at |
10 * | 10 * |
11 * http://www.apache.org/licenses/LICENSE-2.0 | 11 * http://www.apache.org/licenses/LICENSE-2.0 |
12 * | 12 * |
13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. | 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. |
19 * | 19 * |
20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_framework.hxx" 26#include <tabwin/tabwindow.hxx> 27#include <properties.h> --- 105 unchanged lines hidden (view full) --- 133 ResetableGuard aLock( m_aLock ); 134 css::uno::Reference< css::awt::XDevice > xDevice( m_xTopWindow, css::uno::UNO_QUERY ); 135 css::uno::Reference< css::awt::XWindow > xWindow( m_xTopWindow, css::uno::UNO_QUERY ); 136 css::uno::Reference< css::awt::XWindow > xTabControlWindow( m_xTabControlWindow ); 137 css::uno::Reference< css::awt::XWindow > xContainerWindow( m_xContainerWindow ); 138 aLock.unlock(); 139 /* SAFE AREA ----------------------------------------------------------------------------------------------- */ 140 | 20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_framework.hxx" 26#include <tabwin/tabwindow.hxx> 27#include <properties.h> --- 105 unchanged lines hidden (view full) --- 133 ResetableGuard aLock( m_aLock ); 134 css::uno::Reference< css::awt::XDevice > xDevice( m_xTopWindow, css::uno::UNO_QUERY ); 135 css::uno::Reference< css::awt::XWindow > xWindow( m_xTopWindow, css::uno::UNO_QUERY ); 136 css::uno::Reference< css::awt::XWindow > xTabControlWindow( m_xTabControlWindow ); 137 css::uno::Reference< css::awt::XWindow > xContainerWindow( m_xContainerWindow ); 138 aLock.unlock(); 139 /* SAFE AREA ----------------------------------------------------------------------------------------------- */ 140 |
141 // Convert relativ size to output size. | 141 // Convert relative size to output size. |
142 if ( xWindow.is() && xDevice.is() ) 143 { 144 css::awt::Rectangle aRectangle = xWindow->getPosSize(); 145 css::awt::DeviceInfo aInfo = xDevice->getInfo(); | 142 if ( xWindow.is() && xDevice.is() ) 143 { 144 css::awt::Rectangle aRectangle = xWindow->getPosSize(); 145 css::awt::DeviceInfo aInfo = xDevice->getInfo(); |
146 css::awt::Size aSize ( aRectangle.Width - aInfo.LeftInset - aInfo.RightInset , | 146 css::awt::Size aSize ( aRectangle.Width - aInfo.LeftInset - aInfo.RightInset , |
147 aRectangle.Height - aInfo.TopInset - aInfo.BottomInset ); 148 149 css::awt::Size aContainerWindowSize; 150 css::awt::Size aTabControlSize; 151 152 aContainerWindowSize.Width = aSize.Width; 153 aTabControlSize.Width = aSize.Width; 154 --- 125 unchanged lines hidden (view full) --- 280 /* SAFE AREA ----------------------------------------------------------------------------------------------- */ 281 282 implts_SendNotification( NOTIFY_DEACTIVATED, nPageId ); 283 284 return 1; 285} 286 287//--------------------------------------------------------------------------------------------------------- | 147 aRectangle.Height - aInfo.TopInset - aInfo.BottomInset ); 148 149 css::awt::Size aContainerWindowSize; 150 css::awt::Size aTabControlSize; 151 152 aContainerWindowSize.Width = aSize.Width; 153 aTabControlSize.Width = aSize.Width; 154 --- 125 unchanged lines hidden (view full) --- 280 /* SAFE AREA ----------------------------------------------------------------------------------------------- */ 281 282 implts_SendNotification( NOTIFY_DEACTIVATED, nPageId ); 283 284 return 1; 285} 286 287//--------------------------------------------------------------------------------------------------------- |
288// XInitilization | 288// XInitialization |
289//--------------------------------------------------------------------------------------------------------- 290 291void SAL_CALL TabWindow::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) 292throw (css::uno::Exception, css::uno::RuntimeException) 293{ 294 const rtl::OUString aTopWindowArgName( RTL_CONSTASCII_USTRINGPARAM( "TopWindow" )); 295 const rtl::OUString aSizeArgName( RTL_CONSTASCII_USTRINGPARAM( "Size" )); 296 --- 576 unchanged lines hidden (view full) --- 873} 874 875void SAL_CALL TabWindow::setFastPropertyValue_NoBroadcast( sal_Int32, 876 const css::uno::Any&) 877throw( css::uno::Exception ) 878{ 879} 880 | 289//--------------------------------------------------------------------------------------------------------- 290 291void SAL_CALL TabWindow::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) 292throw (css::uno::Exception, css::uno::RuntimeException) 293{ 294 const rtl::OUString aTopWindowArgName( RTL_CONSTASCII_USTRINGPARAM( "TopWindow" )); 295 const rtl::OUString aSizeArgName( RTL_CONSTASCII_USTRINGPARAM( "Size" )); 296 --- 576 unchanged lines hidden (view full) --- 873} 874 875void SAL_CALL TabWindow::setFastPropertyValue_NoBroadcast( sal_Int32, 876 const css::uno::Any&) 877throw( css::uno::Exception ) 878{ 879} 880 |
881void SAL_CALL TabWindow::getFastPropertyValue( css::uno::Any& aValue , | 881void SAL_CALL TabWindow::getFastPropertyValue( css::uno::Any& aValue , |
882 sal_Int32 nHandle ) const 883{ 884 switch( nHandle ) 885 { 886 case TABWINDOW_PROPHANDLE_PARENTWINDOW: 887 aValue <<= m_xContainerWindow; 888 break; 889 case TABWINDOW_PROPHANDLE_TOPWINDOW: 890 aValue <<= m_xTopWindow; 891 break; 892 } 893} 894 895::cppu::IPropertyArrayHelper& SAL_CALL TabWindow::getInfoHelper() 896{ 897 // Optimize this method ! | 882 sal_Int32 nHandle ) const 883{ 884 switch( nHandle ) 885 { 886 case TABWINDOW_PROPHANDLE_PARENTWINDOW: 887 aValue <<= m_xContainerWindow; 888 break; 889 case TABWINDOW_PROPHANDLE_TOPWINDOW: 890 aValue <<= m_xTopWindow; 891 break; 892 } 893} 894 895::cppu::IPropertyArrayHelper& SAL_CALL TabWindow::getInfoHelper() 896{ 897 // Optimize this method ! |
898 // We initialize a static variable only one time. And we don't must use a mutex at every call! | 898 // We initialize a static variable only one time. And we don't need to use a mutex at every call! |
899 // For the first call; pInfoHelper is NULL - for the second call pInfoHelper is different from NULL! 900 static ::cppu::OPropertyArrayHelper* pInfoHelper = NULL; 901 902 if( pInfoHelper == NULL ) 903 { 904 // Ready for multithreading 905 osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ; 906 --- 10 unchanged lines hidden (view full) --- 917 918 return(*pInfoHelper); 919} 920 921css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL TabWindow::getPropertySetInfo() 922throw ( css::uno::RuntimeException ) 923{ 924 // Optimize this method ! | 899 // For the first call; pInfoHelper is NULL - for the second call pInfoHelper is different from NULL! 900 static ::cppu::OPropertyArrayHelper* pInfoHelper = NULL; 901 902 if( pInfoHelper == NULL ) 903 { 904 // Ready for multithreading 905 osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ; 906 --- 10 unchanged lines hidden (view full) --- 917 918 return(*pInfoHelper); 919} 920 921css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL TabWindow::getPropertySetInfo() 922throw ( css::uno::RuntimeException ) 923{ 924 // Optimize this method ! |
925 // We initialize a static variable only one time. And we don't must use a mutex at every call! | 925 // We initialize a static variable only one time. And we don't need to use a mutex at every call! |
926 // For the first call; pInfo is NULL - for the second call pInfo is different from NULL! 927 static css::uno::Reference< css::beans::XPropertySetInfo >* pInfo = NULL; 928 929 if( pInfo == NULL ) 930 { 931 // Ready for multithreading 932 osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ; 933 // Control this pointer again, another instance can be faster then these! --- 7 unchanged lines hidden (view full) --- 941 } 942 943 return (*pInfo); 944} 945 946const css::uno::Sequence< css::beans::Property > TabWindow::impl_getStaticPropertyDescriptor() 947{ 948 // Create a new static property array to initialize sequence! | 926 // For the first call; pInfo is NULL - for the second call pInfo is different from NULL! 927 static css::uno::Reference< css::beans::XPropertySetInfo >* pInfo = NULL; 928 929 if( pInfo == NULL ) 930 { 931 // Ready for multithreading 932 osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ; 933 // Control this pointer again, another instance can be faster then these! --- 7 unchanged lines hidden (view full) --- 941 } 942 943 return (*pInfo); 944} 945 946const css::uno::Sequence< css::beans::Property > TabWindow::impl_getStaticPropertyDescriptor() 947{ 948 // Create a new static property array to initialize sequence! |
949 // Table of all predefined properties of this class. Its used from OPropertySetHelper-class! | 949 // Table of all predefined properties of this class. It's used from OPropertySetHelper-class! |
950 // Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!! 951 // It's necessary for methods of OPropertySetHelper. 952 // ATTENTION: 953 // YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!! 954 955 static const com::sun::star::beans::Property pProperties[] = 956 { 957 com::sun::star::beans::Property( TABWINDOW_PROPNAME_PARENTWINDOW, --- 7 unchanged lines hidden (view full) --- 965 }; // Use it to initialize sequence! 966 static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, TABWINDOW_PROPCOUNT ); 967 968 // Return static "PropertyDescriptor" 969 return lPropertyDescriptor; 970} 971 972} | 950 // Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!! 951 // It's necessary for methods of OPropertySetHelper. 952 // ATTENTION: 953 // YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!! 954 955 static const com::sun::star::beans::Property pProperties[] = 956 { 957 com::sun::star::beans::Property( TABWINDOW_PROPNAME_PARENTWINDOW, --- 7 unchanged lines hidden (view full) --- 965 }; // Use it to initialize sequence! 966 static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, TABWINDOW_PROPCOUNT ); 967 968 // Return static "PropertyDescriptor" 969 return lPropertyDescriptor; 970} 971 972} |
973 |
|