summaryrefslogtreecommitdiff
path: root/toolkit/source/layout/vcl
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/source/layout/vcl')
-rw-r--r--toolkit/source/layout/vcl/wbutton.cxx284
-rw-r--r--toolkit/source/layout/vcl/wfield.cxx290
-rw-r--r--toolkit/source/layout/vcl/wrapper.cxx909
-rw-r--r--toolkit/source/layout/vcl/wrapper.hxx149
4 files changed, 0 insertions, 1632 deletions
diff --git a/toolkit/source/layout/vcl/wbutton.cxx b/toolkit/source/layout/vcl/wbutton.cxx
deleted file mode 100644
index 0cb855192f2f..000000000000
--- a/toolkit/source/layout/vcl/wbutton.cxx
+++ /dev/null
@@ -1,284 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "wrapper.hxx"
-
-#include <com/sun/star/awt/PosSize.hpp>
-#include <com/sun/star/awt/XActionListener.hpp>
-#include <com/sun/star/awt/XButton.hpp>
-#include <com/sun/star/graphic/XGraphic.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <toolkit/awt/vclxwindow.hxx>
-#include <toolkit/awt/vclxwindows.hxx>
-#include <toolkit/helper/convert.hxx>
-#include <vcl/button.hxx>
-#include <vcl/event.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/svapp.hxx>
-#include <vcl/window.hxx>
-
-#include <list>
-
-#include <layout/core/helper.hxx>
-
-using namespace ::com::sun::star;
-
-using rtl::OUString;
-
-namespace layout
-{
-
-class ImageImpl
-{
- public:
- uno::Reference< graphic::XGraphic > mxGraphic;
- ImageImpl( const char *pName )
- : mxGraphic( layoutimpl::loadGraphic( pName ) )
- {
- if ( !mxGraphic.is() )
- {
- OSL_TRACE( "ERROR: failed to load image: `%s'", pName );
- }
- }
-};
-
-class ButtonImpl : public ControlImpl
- , public ::cppu::WeakImplHelper1< awt::XActionListener >
-{
- Link maClickHdl;
-
-public:
- uno::Reference< awt::XButton > mxButton;
- ButtonImpl( Context *context, const PeerHandle &peer, Window *window )
- : ControlImpl( context, peer, window )
- , mxButton( peer, uno::UNO_QUERY )
- {
- /* We have default action when clicked, always listen. */
- mxButton->addActionListener( this );
- }
-
- ~ButtonImpl()
- {
- }
-
- virtual void Click() { /* make me pure virtual? */ };
-
- Link& GetClickHdl ()
- {
- return maClickHdl;
- }
-
- virtual void SetClickHdl( Link const& link )
- {
- maClickHdl = link;
- }
-
- void SAL_CALL disposing( lang::EventObject const& e )
- throw (uno::RuntimeException)
- {
- mxButton->removeActionListener( this );
- ControlImpl::disposing (e);
- mxButton.clear ();
- }
-
- virtual void SAL_CALL actionPerformed( const awt::ActionEvent& )
- throw (uno::RuntimeException)
- {
- if ( !maClickHdl )
- Click();
- else
- maClickHdl.Call( static_cast<Window *>( mpWindow ) );
- }
-
- bool SetModeImage( uno::Reference< graphic::XGraphic > xGraph )
- {
- setProperty( "Graphic", uno::Any( xGraph ) );
- return true;
- }
-};
-
-Button::~Button ()
-{
-}
-
-String Button::GetStandardText (sal_uInt16 button_type)
-{
- return ::Button::GetStandardText (button_type);
-}
-
-void Button::SetText( OUString const& rStr )
-{
- if ( !getImpl().mxButton.is() )
- return;
- getImpl().mxButton->setLabel( rStr );
-}
-
-void Button::Click()
-{
-}
-
-IMPL_GET_IMPL( Button );
-
-class PushButtonImpl : public ButtonImpl
- , public ::cppu::WeakImplHelper1< awt::XItemListener >
-{
- Link maToggleHdl;
-public:
- PushButtonImpl( Context *context, const PeerHandle &peer, Window *window )
- : ButtonImpl( context, peer, window )
- {
- }
-
- void SetToggleHdl( const Link& link )
- {
- // XButton doesn't have an explicit event for Toggle. Anyway, it is a
- // superset of the clicks: all clicks, and explicit toggles
- if (!link && !!maToggleHdl)
- mxButton->removeActionListener( this );
- else if (!!link && !maToggleHdl)
- mxButton->addActionListener( this );
- maToggleHdl = link;
- }
- void SAL_CALL disposing( lang::EventObject const& e )
- throw (uno::RuntimeException)
- {
- ButtonImpl::disposing (e);
- }
- virtual void SAL_CALL actionPerformed( awt::ActionEvent const& e )
- throw (uno::RuntimeException)
- {
- ButtonImpl::actionPerformed( e );
- fireToggle();
- }
- virtual void SAL_CALL itemStateChanged( const awt::ItemEvent& )
- throw (uno::RuntimeException)
- {
- maToggleHdl.Call( static_cast<Window *>( mpWindow ) );
- }
- void fireToggle()
- {
- maToggleHdl.Call( static_cast<Window *>( mpWindow ) );
- }
-
-};
-
-PushButton::~PushButton ()
-{
- SetToggleHdl (Link ());
-}
-
-void PushButton::SetToggleHdl( const Link& link )
-{
- if (&getImpl () && getImpl().mxButton.is ())
- getImpl().SetToggleHdl( link );
-}
-
-IMPL_GET_IMPL( PushButton );
-
-#define BUTTON_IMPL(t, parent, response) \
- class t##Impl : public parent##Impl \
- { \
- public: \
- t##Impl( Context *context, PeerHandle const& peer, Window *window ) \
- : parent##Impl( context, peer, window ) \
- { \
- } \
- void Click() \
- { \
- if (Dialog *d = static_cast<Dialog *> (mpCtx)) \
- d->EndDialog( response ); \
- } \
- }
-
-/* Common button types currently unavailable in OOo: */
-/* mpReset */
-/* mpApply */
-/* mpAction */
-#define RET_RESET 6
-#define RET_APPLY 7
-#define BUTTONID_RESET RET_RESET
-#define BUTTONID_APPLY RET_APPLY
-
-BUTTON_IMPL( CancelButton, PushButton, BUTTONID_CANCEL );
-BUTTON_IMPL( YesButton, PushButton, BUTTONID_YES );
-BUTTON_IMPL( NoButton, PushButton, BUTTONID_NO );
-BUTTON_IMPL( RetryButton, PushButton, BUTTONID_RETRY );
-BUTTON_IMPL( IgnoreButton, PushButton, BUTTONID_IGNORE );
-BUTTON_IMPL( HelpButton, PushButton, BUTTONID_HELP );
-
-CancelButton::CancelButton ( Context *context, char const* pId, sal_uInt32 nId )
- : PushButton( new CancelButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) )
-{
- Window *parent = dynamic_cast<Window*> (context);
- if (parent)
- SetParent (parent);
-}
-
-YesButton::YesButton ( Context *context, char const* pId, sal_uInt32 nId )
- : PushButton( new YesButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) )
-{
- Window *parent = dynamic_cast<Window*> (context);
- if (parent)
- SetParent (parent);
-}
-
-NoButton::NoButton ( Context *context, char const* pId, sal_uInt32 nId )
- : PushButton( new NoButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) )
-{
- Window *parent = dynamic_cast<Window*> (context);
- if (parent)
- SetParent (parent);
-}
-
-RetryButton::RetryButton ( Context *context, char const* pId, sal_uInt32 nId )
- : PushButton( new RetryButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) )
-{
- Window *parent = dynamic_cast<Window*> (context);
- if (parent)
- SetParent (parent);
-}
-
-IgnoreButton::IgnoreButton ( Context *context, char const* pId, sal_uInt32 nId )
- : PushButton( new IgnoreButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) )
-{
- Window *parent = dynamic_cast<Window*> (context);
- if (parent)
- SetParent (parent);
-}
-
-HelpButton::HelpButton ( Context *context, char const* pId, sal_uInt32 nId )
- : PushButton( new HelpButtonImpl( context, context->GetPeerHandle( pId, nId ), this ) )
-{
- Window *parent = dynamic_cast<Window*> (context);
- if (parent)
- SetParent (parent);
-}
-
-} // namespace layout
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/layout/vcl/wfield.cxx b/toolkit/source/layout/vcl/wfield.cxx
deleted file mode 100644
index 78b4484c2298..000000000000
--- a/toolkit/source/layout/vcl/wfield.cxx
+++ /dev/null
@@ -1,290 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "wrapper.hxx"
-
-#include <comphelper/processfactory.hxx>
-#include <com/sun/star/awt/XMetricField.hpp>
-#include <com/sun/star/awt/XNumericField.hpp>
-#include <com/sun/star/awt/XTextComponent.hpp>
-#include <com/sun/star/awt/XListBox.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <com/sun/star/awt/XActionListener.hpp>
-#include <com/sun/star/awt/XItemListener.hpp>
-#include <com/sun/star/awt/XMouseListener.hpp>
-#include <vcl/combobox.hxx>
-#include <vcl/lstbox.hxx>
-
-#include <toolkit/awt/vclxwindows.hxx>
-
-using namespace ::com::sun::star;
-using rtl::OUString;
-
-#define LAYOUT_API_CALLS_HANDLER 0
-
-namespace layout
-{
-
-class EditImpl : public ControlImpl
- , public ::cppu::WeakImplHelper1< awt::XTextListener >
-{
-public:
- Link maModifyHdl;
-
- uno::Reference< awt::XTextComponent > mxEdit;
- EditImpl( Context *context, const PeerHandle &peer, Window *window )
- : ControlImpl( context, peer, window )
- , mxEdit( peer, uno::UNO_QUERY )
- {
- }
-
- ~EditImpl ();
-
- virtual void SAL_CALL disposing( lang::EventObject const& e )
- throw (uno::RuntimeException);
-
- virtual void SetModifyHdl( Link const& link );
-
- void SAL_CALL textChanged( const awt::TextEvent& /* rEvent */ )
- throw (uno::RuntimeException)
- {
- maModifyHdl.Call( mpWindow );
- }
-};
-
-EditImpl::~EditImpl ()
-{
-}
-
-void SAL_CALL EditImpl::disposing( lang::EventObject const& e )
- throw (uno::RuntimeException)
-{
- ControlImpl::disposing (e);
- mxEdit.clear ();
-}
-
-void EditImpl::SetModifyHdl( Link const& link )
-{
- if (!link && !!maModifyHdl)
- mxEdit->removeTextListener( this );
- else if (!!link && !maModifyHdl)
- mxEdit->addTextListener( this );
- maModifyHdl = link;
-}
-
-Edit::~Edit ()
-{
- SetModifyHdl (Link ());
-}
-
-void Edit::SetModifyHdl( const Link& link )
-{
- if (&getImpl () && getImpl().mxEdit.is ())
- getImpl().SetModifyHdl( link );
-}
-
-IMPL_GET_IMPL( Edit );
-
-class ListBoxImpl : public ControlImpl
- , public ::cppu::WeakImplHelper1< awt::XActionListener >
- , public ::cppu::WeakImplHelper1< awt::XItemListener >
- , public ::cppu::WeakImplHelper1< awt::XMouseListener >
-{
- Link maClickHdl;
- Link maSelectHdl;
- Link maDoubleClickHdl;
-
-public:
- uno::Reference< awt::XListBox > mxListBox;
- ListBoxImpl( Context *context, const PeerHandle &peer, Window *window )
- : ControlImpl( context, peer, window )
- , mxListBox( peer, uno::UNO_QUERY )
- {
- SelectEntryPos (0, true);
- }
-
- sal_uInt16 InsertEntry (String const& rStr, sal_uInt16 nPos)
- {
- if ( nPos == LISTBOX_APPEND )
- nPos = mxListBox->getItemCount();
- mxListBox->addItem( rtl::OUString( rStr ), nPos );
- return nPos;
- }
-
- void RemoveEntry( sal_uInt16 nPos )
- {
- mxListBox->removeItems( nPos, 1 );
- }
-
- sal_uInt16 RemoveEntry( String const& rStr, sal_uInt16 nPos)
- {
- if ( nPos == LISTBOX_APPEND )
- nPos = mxListBox->getItemCount();
- mxListBox->addItem( rtl::OUString( rStr ), nPos );
- return nPos;
- }
-
- sal_uInt16 GetEntryPos( String const& rStr ) const
- {
- uno::Sequence< rtl::OUString> aItems( mxListBox->getItems() );
- rtl::OUString rKey( rStr );
- sal_uInt16 n = sal::static_int_cast< sal_uInt16 >(aItems.getLength());
- for (sal_uInt16 i = 0; i < n; i++)
- {
- if ( aItems[ i ] == rKey )
- return i;
- }
- return LISTBOX_ENTRY_NOTFOUND;
- }
-
- OUString GetEntry( sal_uInt16 nPos ) const
- {
- return mxListBox->getItem( nPos );
- }
-
- sal_uInt16 GetEntryCount() const
- {
- return mxListBox->getItemCount();
- }
-
- void SelectEntryPos( sal_uInt16 nPos, bool bSelect )
- {
- mxListBox->selectItemPos( nPos, bSelect );
- }
-
- sal_uInt16 GetSelectEntryCount() const
- {
- return sal::static_int_cast< sal_uInt16 >( mxListBox->getSelectedItems().getLength() );
- }
-
- sal_uInt16 GetSelectEntryPos( sal_uInt16 nSelIndex ) const
- {
- sal_uInt16 nSelected = 0;
- if ( mxListBox->isMutipleMode() )
- {
- uno::Sequence< short > aItems( mxListBox->getSelectedItemsPos() );
- if ( nSelIndex < aItems.getLength() )
- nSelected = aItems[ nSelIndex ];
- }
- else
- nSelected = mxListBox->getSelectedItemPos();
- return nSelected;
- }
-
- virtual void SAL_CALL disposing( lang::EventObject const& e )
- throw (uno::RuntimeException)
- {
- ControlImpl::disposing (e);
- mxListBox.clear ();
- }
-
- Link& GetClickHdl ()
- {
- return maClickHdl;
- }
-
- void SetClickHdl( Link const& link )
- {
- if (!link && !!maClickHdl)
- mxListBox->removeActionListener( this );
- else if (!!link && !maClickHdl)
- mxListBox->addActionListener( this );
- maClickHdl = link;
- }
-
- void SAL_CALL actionPerformed( const awt::ActionEvent& /* rEvent */ )
- throw (uno::RuntimeException)
- {
- maClickHdl.Call( mpWindow );
- }
-
- Link& GetSelectHdl ()
- {
- return maSelectHdl;
- }
-
- void SetSelectHdl( Link const& link )
- {
- if (!link && !!maSelectHdl)
- mxListBox->removeItemListener( this );
- else if (!!link && !maSelectHdl)
- mxListBox->addItemListener( this );
- maSelectHdl = link;
- }
-
- void SAL_CALL itemStateChanged (awt::ItemEvent const&)
- throw (uno::RuntimeException)
- {
- maSelectHdl.Call (static_cast <ListBox*> (mpWindow));
- }
-
- Link& GetDoubleClickHdl ()
- {
- return maDoubleClickHdl;
- }
-
- void SetDoubleClickHdl (Link const& link)
- {
- if (!link && !!maDoubleClickHdl)
- mxWindow->removeMouseListener (this);
- else if (!!link && !maSelectHdl)
- mxWindow->addMouseListener (this);
- maDoubleClickHdl = link;
- }
-
- void SAL_CALL mousePressed (awt::MouseEvent const&) throw (uno::RuntimeException)
- {
- }
- void SAL_CALL mouseReleased (awt::MouseEvent const& e) throw (uno::RuntimeException)
- {
- if (e.ClickCount == 2)
- maDoubleClickHdl.Call (mpWindow);
- }
- void SAL_CALL mouseEntered (awt::MouseEvent const&) throw (uno::RuntimeException)
- {
- }
- void SAL_CALL mouseExited (awt::MouseEvent const&) throw (uno::RuntimeException)
- {
- }
-};
-
-ListBox::~ListBox ()
-{
-}
-
-void ListBox::SetNoSelection ()
-{
- GetListBox ()->SetNoSelection ();
-}
-
-IMPL_GET_IMPL (ListBox);
-IMPL_GET_WINDOW (ListBox);
-
-} // namespace layout
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/layout/vcl/wrapper.cxx b/toolkit/source/layout/vcl/wrapper.cxx
deleted file mode 100644
index 8e437bc874ad..000000000000
--- a/toolkit/source/layout/vcl/wrapper.cxx
+++ /dev/null
@@ -1,909 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <tools/rc.h>
-//#define RESOURCE_PUBLISH_PROTECTED 1
-#if RESOURCE_PUBLISH_PROTECTED
-// ugh, override non-helpful proctection
-#define protected public
-#endif /* RESOURCE_PUBLISH_PROTECTED */
-#include <tools/rc.hxx>
-#undef protected
-
-
-#include "wrapper.hxx"
-
-#include <awt/vclxplugin.hxx>
-#include <awt/vclxtabcontrol.hxx>
-#include <com/sun/star/awt/PosSize.hpp>
-#include <com/sun/star/awt/VclWindowPeerAttribute.hpp>
-#include <com/sun/star/awt/WindowAttribute.hpp>
-#include <com/sun/star/awt/XDialog2.hpp>
-#include <com/sun/star/awt/XProgressBar.hpp>
-#include <com/sun/star/awt/XSimpleTabController.hpp>
-#include <com/sun/star/awt/XTabListener.hpp>
-#include <com/sun/star/graphic/XGraphic.hpp>
-#include <comphelper/processfactory.hxx>
-#include <layout/core/factory.hxx>
-#include <layout/core/localized-string.hxx>
-#include <layout/core/root.hxx>
-#include <toolkit/awt/vclxwindow.hxx>
-#include <vcl/ctrl.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/image.hxx>
-#include <vcl/tabctrl.hxx>
-#include <vcl/tabpage.hxx>
-#include <vcl/window.hxx>
-
-using namespace ::com::sun::star;
-using rtl::OUString;
-
-namespace layout
-{
-
-// Context bits ...
-class ContextImpl
-{
- uno::Reference< awt::XLayoutRoot > mxRoot;
- uno::Reference< container::XNameAccess > mxNameAccess;
- PeerHandle mxTopLevel;
-
-public:
- ContextImpl( char const *pPath )
- {
- uno::Sequence< uno::Any > aParams( 1 );
- aParams[0] <<= OUString( pPath, strlen( pPath ), RTL_TEXTENCODING_UTF8 );
-
- uno::Reference< lang::XSingleServiceFactory > xFactory(
- comphelper::createProcessComponent(
- OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Layout")) ),
- uno::UNO_QUERY );
- if ( !xFactory.is() )
- {
- throw uno::RuntimeException(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "Layout engine not installed" ) ),
- uno::Reference< uno::XInterface >() );
- }
- mxRoot = uno::Reference< awt::XLayoutRoot >(
- xFactory->createInstanceWithArguments( aParams ),
- uno::UNO_QUERY );
-
- mxNameAccess = uno::Reference< container::XNameAccess >( mxRoot, uno::UNO_QUERY );
- }
-
- ~ContextImpl()
- {
- }
-
- PeerHandle getByName( const OUString &rName )
- {
- uno::Any val = mxNameAccess->getByName( rName );
- PeerHandle xRet;
- val >>= xRet;
- return xRet;
- }
- PeerHandle getTopLevel()
- {
- return mxTopLevel;
- }
- void setTopLevel( PeerHandle xToplevel )
- {
- mxTopLevel = xToplevel;
- }
-};
-
-Context::Context( const char *pPath )
- : pImpl( new ContextImpl( pPath ) )
-{
-}
-Context::~Context()
-{
- delete pImpl;
- pImpl = NULL;
-}
-
-PeerHandle Context::GetPeerHandle( const char *id, sal_uInt32 nId ) const
-{
- PeerHandle xHandle;
- xHandle = pImpl->getByName( OUString( id, strlen( id ), RTL_TEXTENCODING_UTF8 ) );
- if ( !xHandle.is() )
- {
- OSL_TRACE( "Failed to fetch widget '%s'", id );
- }
-
- if ( nId != 0 )
- {
- rtl::OString aStr = rtl::OString::valueOf( (sal_Int32) nId );
- xHandle = GetPeerHandle( aStr.getStr(), 0 );
- }
- return xHandle;
-}
-
-WindowImpl::WindowImpl (Context *context, const PeerHandle &peer, Window *window)
- : mpWindow (window)
- , mpCtx (context)
- , mxWindow (peer, uno::UNO_QUERY)
- , mxVclPeer (peer, uno::UNO_QUERY)
- , mvclWindow (0)
- , bFirstTimeVisible (true)
-{
-}
-
-WindowImpl::~WindowImpl ()
-{
- if (mpWindow)
- mpWindow->mpImpl = 0;
- if (mvclWindow)
- {
- VCLXWindow *v = mvclWindow->GetWindowPeer ();
- v->SetWindow (0);
- mvclWindow->SetComponentInterface (uno::Reference <awt::XWindowPeer> ());
- mvclWindow->SetWindowPeer (uno::Reference <awt::XWindowPeer> (), 0);
- delete mvclWindow;
- mvclWindow = 0;
- }
-}
-
-void WindowImpl::wrapperGone ()
-{
- mvclWindow = 0;
- mpWindow->mpImpl = 0;
- mpWindow = 0;
- mpCtx = 0;
- if ( mxWindow.is() )
- {
- uno::Reference< lang::XComponent > xComp( mxWindow, uno::UNO_QUERY );
- mxWindow.clear ();
- if ( xComp.is() )
- xComp->dispose();
- }
-}
-
-void SAL_CALL WindowImpl::disposing (lang::EventObject const&)
- throw (uno::RuntimeException)
-{
- if (mxWindow.is ())
- mxWindow.clear ();
-}
-
-void WindowImpl::setProperty (char const *name, uno::Any any)
-{
- if ( !this || !mxVclPeer.is() )
- return;
- mxVclPeer->setProperty
- ( rtl::OUString( name, strlen( name ), RTL_TEXTENCODING_ASCII_US ), any );
-}
-
-void WindowImpl::redraw (bool resize)
-{
- uno::Reference <awt::XWindow> ref (mxWindow, uno::UNO_QUERY);
- ::Window* window = VCLXWindow::GetImplementation (ref)->GetWindow ();
- ::Window* parent = window->GetParent();
- ::Rectangle r = Rectangle (parent->GetPosPixel (),
- parent->GetSizePixel ());
- parent->Invalidate (r, INVALIDATE_CHILDREN | INVALIDATE_NOCHILDREN );
- if (resize)
- parent->SetPosSizePixel (0, 0, 1, 1, awt::PosSize::SIZE);
- else
- parent->SetPosSizePixel (0, 0, r.nRight - r.nLeft, r.nBottom - r.nTop,
- awt::PosSize::SIZE);
-}
-
-Window::Window( WindowImpl *pImpl )
- : mpImpl( pImpl )
-{
- mpImpl->mvclWindow = GetVCLXWindow () ? GetWindow () : 0;
-}
-
-Window::~Window()
-{
- /* likely to be an UNO object - with floating references */
- if (mpImpl)
- mpImpl->wrapperGone ();
- mpImpl = 0;
-}
-
-///IMPL_GET_IMPL( Control );
-
-static ControlImpl* null_control_impl = 0;
-
-ControlImpl &Control::getImpl () const
-{
- if (ControlImpl* c = static_cast<ControlImpl *>(mpImpl))
- return *c;
- return *null_control_impl;
-}
-
-Control::~Control ()
-{
- SetGetFocusHdl (Link ());
- SetLoseFocusHdl (Link ());
-}
-
-void Window::setRes (ResId const& res)
-{
-#if RESOURCE_PUBLISH_PROTECTED
- // Resources are shut-off from use. Is that really necessary?
- Resource &r = *GetWindow ();
- r.GetRes (res);
-#else /* !RESOURCE_PUBLISH_PROTECTED */
- //We *must* derive. Is this also really necessary?
- //Resource r (res);
-
- // ugh, I wonder which solution is cleaner...
- class Resource_open_up : public Resource
- {
- public:
- Resource_open_up (ResId const& r)
- : Resource (r)
- {
- }
- static sal_Int32 GetLongRes (void *p)
- {
- return Resource::GetLongRes (p);
- }
- void* GetClassRes ()
- {
- return Resource::GetClassRes ();
- }
- sal_Int32 ReadLongRes ()
- {
- return Resource::ReadLongRes ();
- }
- UniString ReadStringRes ()
- {
- return Resource::ReadStringRes ();
- }
- rtl::OString ReadByteStringRes()
- {
- return Resource::ReadByteStringRes();
- }
- };
-
- Resource_open_up r (res);
-#endif /* !RESOURCE_PUBLISH_PROTECTED */
- sal_uInt32 mask = r.ReadLongRes ();
- if (mask & WINDOW_HELPID)
- SetHelpId (r.ReadByteStringRes());
- if ( mask & WINDOW_TEXT )
- SetText( r.ReadStringRes ());
-}
-
-void Window::SetParent( ::Window *parent )
-{
- uno::Reference <awt::XWindow> ref( GetPeer(), uno::UNO_QUERY );
- if (VCLXWindow *vcl = VCLXWindow::GetImplementation( ref ))
- if (::Window *window = vcl->GetWindow())
- window->SetParent( parent );
-}
-
-void Window::SetParent( Window *parent )
-{
- /* Let's hear it for C++: poor man's dynamic binding. */
- parent->ParentSet (this);
-}
-
-void Window::ParentSet (Window *window)
-{
- window->SetParent (GetWindow ());
-}
-
-PeerHandle Window::GetPeer() const
-{
- if ( !mpImpl )
- return PeerHandle();
- return mpImpl->mxWindow;
-}
-
-uno::Reference<awt::XWindow> Window::GetRef() const
-{
- return uno::Reference <awt::XWindow> ( GetPeer(), uno::UNO_QUERY );
-}
-
-VCLXWindow* Window::GetVCLXWindow() const
-{
- return VCLXWindow::GetImplementation( GetRef() );
-}
-
-::Window* Window::GetWindow() const
-{
- return GetVCLXWindow()->GetWindow();
-}
-
-::Window* Window::GetParent() const
-{
- return GetWindow()->GetParent();
-}
-
-void Window::SetHelpId( const rtl::OString& id )
-{
- GetWindow()->SetHelpId( id );
-}
-
-void Window::Invalidate (sal_uInt8 flags)
-{
- GetWindow ()->Invalidate (flags);
-}
-
-struct ToolkitVclPropsMap
-{
- WinBits vclStyle;
- long initAttr;
- const char *propName;
-
- // the value to give the prop to enable/disable it -- not the most brilliant
- // type declaration and storage, but does the work... properties are
- // either a boolean or a short since they are either a directly wrappers for
- // a WinBit, or aggregates related (like Align for WB_LEFT, _RIGHT and _CENTER).
- bool isBoolean;
- short enableProp, disableProp;
-};
-
-#define TYPE_BOOL true
-#define TYPE_SHORT false
-#define NOTYPE 0
-static const ToolkitVclPropsMap toolkitVclPropsMap[] =
-{
- { WB_BORDER, awt::WindowAttribute::BORDER, "Border", TYPE_SHORT, 1, 0 },
- { WB_NOBORDER, awt::VclWindowPeerAttribute::NOBORDER, "Border", TYPE_SHORT, 0, 1 },
- { WB_SIZEABLE, awt::WindowAttribute::SIZEABLE, NULL, NOTYPE, 0, 0 },
- { WB_MOVEABLE, awt::WindowAttribute::MOVEABLE, NULL, NOTYPE, 0, 0 },
- { WB_CLOSEABLE, awt::WindowAttribute::CLOSEABLE, NULL, NOTYPE, 0, 0 },
-
- { WB_HSCROLL, awt::VclWindowPeerAttribute::HSCROLL, NULL, NOTYPE, 0, 0 },
- { WB_VSCROLL, awt::VclWindowPeerAttribute::VSCROLL, NULL, NOTYPE, 0, 0 },
- { WB_LEFT, awt::VclWindowPeerAttribute::LEFT, "Align", TYPE_SHORT, 0, 0 },
- { WB_CENTER, awt::VclWindowPeerAttribute::CENTER, "Align", TYPE_SHORT, 1, 0 },
- { WB_RIGHT, awt::VclWindowPeerAttribute::RIGHT, "Align", TYPE_SHORT, 2, 0 },
- { WB_SPIN, awt::VclWindowPeerAttribute::SPIN, NULL, NOTYPE, 0, 0 },
- { WB_SORT, awt::VclWindowPeerAttribute::SORT, NULL, NOTYPE, 0, 0 },
- { WB_DROPDOWN, awt::VclWindowPeerAttribute::DROPDOWN, "Dropdown", TYPE_BOOL, 1, 0 },
- { WB_DEFBUTTON, awt::VclWindowPeerAttribute::DEFBUTTON, "DefaultButton", TYPE_BOOL, 1, 0 },
- { WB_READONLY, awt::VclWindowPeerAttribute::READONLY, NULL, NOTYPE, 0, 0 },
- { WB_CLIPCHILDREN, awt::VclWindowPeerAttribute::CLIPCHILDREN, NULL, NOTYPE, 0, 0 },
- { WB_GROUP, awt::VclWindowPeerAttribute::GROUP, NULL, NOTYPE, 0, 0 },
-
- { WB_OK, awt::VclWindowPeerAttribute::OK, NULL, NOTYPE, 0, 0 },
- { WB_OK_CANCEL, awt::VclWindowPeerAttribute::OK_CANCEL, NULL, NOTYPE, 0, 0 },
- { WB_YES_NO, awt::VclWindowPeerAttribute::YES_NO, NULL, NOTYPE, 0, 0 },
- { WB_YES_NO_CANCEL, awt::VclWindowPeerAttribute::YES_NO_CANCEL, NULL, NOTYPE, 1, 0 },
- { WB_RETRY_CANCEL, awt::VclWindowPeerAttribute::RETRY_CANCEL, NULL, NOTYPE, 1, 0 },
- { WB_DEF_OK, awt::VclWindowPeerAttribute::DEF_OK, NULL, NOTYPE, 0, 0 },
- { WB_DEF_CANCEL, awt::VclWindowPeerAttribute::DEF_CANCEL, NULL, NOTYPE, 1, 0 },
- { WB_DEF_RETRY, awt::VclWindowPeerAttribute::DEF_RETRY, NULL, NOTYPE, 0, 0 },
- { WB_DEF_YES, awt::VclWindowPeerAttribute::DEF_YES, NULL, NOTYPE, 0, 0 },
- { WB_DEF_NO, awt::VclWindowPeerAttribute::DEF_NO, NULL, NOTYPE, 0, 0 },
-
- { WB_AUTOHSCROLL, awt::VclWindowPeerAttribute::AUTOHSCROLL, "AutoHScroll", TYPE_BOOL, 1, 0 },
- { WB_AUTOVSCROLL, awt::VclWindowPeerAttribute::AUTOVSCROLL, "AutoVScroll", TYPE_BOOL, 1, 0 },
-
- { WB_WORDBREAK, 0, "MultiLine", TYPE_BOOL, 1, 0 },
- { WB_NOPOINTERFOCUS, 0, "FocusOnClick", TYPE_BOOL, 1, 0 },
- { WB_TOGGLE, 0, "Toggle", TYPE_BOOL, 1, 0 },
- { WB_REPEAT, 0, "Repeat", TYPE_BOOL, 1, 0 },
- { WB_NOHIDESELECTION, 0, "HideInactiveSelection", TYPE_BOOL, 1, 0 },
-};
-#undef TYPE_BOOL
-#undef TYPE_SHORT
-#undef NOTYPE
-
-static const int toolkitVclPropsMapLen =
- sizeof( toolkitVclPropsMap ) / sizeof( ToolkitVclPropsMap );
-
-/* Unpleasant way to get an xToolkit pointer ... */
-uno::Reference< awt::XToolkit > getToolkit()
-{
- static uno::Reference< awt::XToolkit > xToolkit;
- if (!xToolkit.is())
- {
- // Urgh ...
- xToolkit = uno::Reference< awt::XToolkit >(
- ::comphelper::getProcessServiceFactory()->createInstance(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ) ),
- uno::UNO_QUERY );
- if ( !xToolkit.is() )
- throw uno::RuntimeException(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "failed to create toolkit!") ),
- uno::Reference< uno::XInterface >() );
- }
- return xToolkit;
-}
-
-void Window::Show( bool bVisible )
-{
- if ( !getImpl().mxWindow.is() )
- return;
- getImpl().mxWindow->setVisible( bVisible );
- if (!bVisible)
- getImpl ().bFirstTimeVisible = true;
- else if (GetParent() && getImpl().bFirstTimeVisible)
- {
- getImpl().redraw ();
- getImpl().bFirstTimeVisible = false;
- }
-}
-
-void Window::SetText( OUString const& str )
-{
- GetWindow()->SetText( str );
-}
-
-ControlImpl::ControlImpl (Context *context, const PeerHandle &peer, Window *window)
- : WindowImpl( context, peer, window )
-{
-}
-
-ControlImpl::~ControlImpl ()
-{
- if ((!!mGetFocusHdl || !!mLoseFocusHdl) && mxWindow.is ())
- /* Disposing will be done @ VCLXWindow::dispose () maFocusListeners.disposeAndClear()
- don't do it twice */
- mxWindow.clear ();
-}
-
-void ControlImpl::SetGetFocusHdl (Link const& link)
-{
- if (!mLoseFocusHdl || !link)
- UpdateListening (link);
- mGetFocusHdl = link;
-}
-
-void ControlImpl::SetLoseFocusHdl (Link const& link)
-{
- if (!mGetFocusHdl || !link)
- UpdateListening (link);
- mLoseFocusHdl = link;
-}
-
-void ControlImpl::UpdateListening (Link const& link)
-{
- if (!link && (!!mGetFocusHdl || !!mLoseFocusHdl)
- && (!mGetFocusHdl || !mLoseFocusHdl))
- mxWindow->removeFocusListener (this);
- else if (!!link && !mGetFocusHdl && !mLoseFocusHdl)
- mxWindow->addFocusListener (this);
-}
-
-void SAL_CALL ControlImpl::disposing (lang::EventObject const&)
- throw (uno::RuntimeException)
-{
-/// mxWindow.clear ();
-}
-
-void SAL_CALL ControlImpl::focusGained (awt::FocusEvent const&)
- throw (uno::RuntimeException)
-{
- mGetFocusHdl.Call (mpWindow);
-}
-
-void SAL_CALL ControlImpl::focusLost (awt::FocusEvent const&)
- throw (uno::RuntimeException)
-{
- mLoseFocusHdl.Call (mpWindow);
-}
-
-void Control::SetGetFocusHdl (Link const& link)
-{
- if (&getImpl () && getImpl().mxWindow.is ())
- getImpl ().SetGetFocusHdl (link);
-}
-
-void Control::SetLoseFocusHdl (Link const& link)
-{
- if (&getImpl () && getImpl().mxWindow.is ())
- getImpl ().SetLoseFocusHdl (link);
-}
-
-class DialogImpl : public WindowImpl
-{
-public:
- uno::Reference< awt::XDialog2 > mxDialog;
- DialogImpl( Context *context, PeerHandle const &peer, Window *window );
-};
-
-DialogImpl::DialogImpl( Context *context, const PeerHandle &peer, Window *window )
- : WindowImpl( context, peer, window )
- , mxDialog( peer, uno::UNO_QUERY )
-{
-}
-
-Dialog::Dialog( ::Window *parent, const char *xml_file, const char *id, sal_uInt32 nId )
- : Context( xml_file )
- , Window( new DialogImpl( this, Context::GetPeerHandle( id, nId ), this ) )
-{
- if ( parent )
- SetParent( parent );
-}
-
-Dialog::~Dialog ()
-{
-}
-
-IMPL_GET_IMPL (Dialog);
-
-#define MX_DIALOG if (getImpl ().mxDialog.is ()) getImpl ().mxDialog
-#define RETURN_MX_DIALOG if (getImpl ().mxDialog.is ()) return getImpl ().mxDialog
-
-short Dialog::Execute()
-{
- RETURN_MX_DIALOG->execute ();
- return -1;
-}
-
-void Dialog::EndDialog( long result )
-{
- MX_DIALOG->endDialog (result);
-}
-
-void Dialog::SetTitle( OUString const& str )
-{
- MX_DIALOG->setTitle (str);
-}
-
-#define MESSAGE_BOX_MEMBER_INIT\
- Dialog (parent, xml_file, id)\
- , imageError (this, "FI_ERROR")\
- , imageInfo (this, "FI_INFO")\
- , imageQuery (this, "FI_QUERY")\
- , imageWarning (this, "FI_WARNING")\
- , messageText (this, "FT_MESSAGE")\
- , cancelButton (this, "BTN_CANCEL")\
- , helpButton (this, "BTN_HELP")\
- , ignoreButton (this, "BTN_IGNORE")\
- , noButton (this, "BTN_NO")\
- , retryButton (this, "BTN_RETRY")\
- , yesButton (this, "BTN_YES")
-
-MessageBox::MessageBox (::Window *parent, char const* message,
- char const* yes, char const* no, const rtl::OString& help_id,
- char const* xml_file, char const* id)
- : MESSAGE_BOX_MEMBER_INIT
-{
- ignoreButton.Hide ();
- retryButton.Hide ();
- init (message, yes, no, help_id);
-}
-
-MessageBox::MessageBox (::Window *parent, OUString const& message,
- OUString yes, OUString no, const rtl::OString& help_id,
- char const* xml_file, char const* id)
- : MESSAGE_BOX_MEMBER_INIT
-{
- ignoreButton.Hide ();
- retryButton.Hide ();
- init (message, yes, no, help_id);
-}
-
-#if !defined (__GNUC__)
-#define __PRETTY_FUNCTION__ __FUNCTION__
-#endif /* !__GNUC__ */
-
-MessageBox::MessageBox (::Window *parent, WinBits bits, char const* message,
- char const* yes, char const* no, const rtl::OString& help_id,
- char const* xml_file, char const* id)
- : MESSAGE_BOX_MEMBER_INIT
-{
- // HIG suggests using verbs instead of yes/no/retry etc.
- // This constructor provides client-code compatibility: Client code should be fixed.
-#ifndef __SUNPRO_CC
- OSL_TRACE ("%s: warning, deprecated vcl/Messbox compatibility", __PRETTY_FUNCTION__);
-#endif
- bits_init (bits, OUString::createFromAscii (message), OUString::createFromAscii (yes), OUString::createFromAscii (no), help_id);
-}
-
-MessageBox::MessageBox (::Window *parent, WinBits bits, OUString const& message,
- OUString yes, OUString no, const rtl::OString& help_id,
- char const* xml_file, char const* id)
- : MESSAGE_BOX_MEMBER_INIT
-{
- // HIG suggests using verbs instead of yes/no/retry etc.
- // This constructor provides client-code compatibility: Client code should be fixed.
-#ifndef __SUNPRO_CC
- OSL_TRACE ("%s: warning, deprecated vcl/Messbox compatibility", __PRETTY_FUNCTION__);
-#endif
- bits_init (bits, message, yes, no, help_id);
-}
-
-void MessageBox::bits_init (WinBits bits, OUString const& message,
- OUString yes, OUString no, const rtl::OString& help_id)
-{
- if ( bits & ( WB_OK_CANCEL | WB_OK ))
- yes = Button::GetStandardText ( BUTTON_OK );
- if ( bits & (WB_YES_NO | WB_YES_NO_CANCEL ))
- {
- yes = Button::GetStandardText ( BUTTON_YES );
- no = Button::GetStandardText ( BUTTON_NO );
- }
- if (! (bits & (WB_RETRY_CANCEL | WB_YES_NO_CANCEL | WB_ABORT_RETRY_IGNORE )))
- cancelButton.Hide ();
- if (! (bits & (WB_RETRY_CANCEL | WB_ABORT_RETRY_IGNORE)))
- retryButton.Hide ();
- if ( bits & WB_ABORT_RETRY_IGNORE )
- cancelButton.SetText ( Button::GetStandardText (BUTTON_ABORT));
- else
- ignoreButton.Hide ();
- if ( !(bits & ( WB_OK | WB_OK_CANCEL | WB_YES_NO | WB_YES_NO_CANCEL)))
- yesButton.Hide ();
- if ( !(bits & ( WB_YES_NO | WB_YES_NO_CANCEL)))
- noButton.Hide ();
-
- init (message, yes, no, help_id);
-}
-
-void MessageBox::init (char const* message, char const* yes, char const* no, const rtl::OString& help_id)
-{
- init ( OUString::createFromAscii (message), OUString::createFromAscii (yes), OUString::createFromAscii (no), help_id);
-}
-
-void MessageBox::init (OUString const& message, OUString const& yes, OUString const& no, const rtl::OString& help_id)
-{
- imageError.Hide ();
- imageInfo.Hide ();
- imageQuery.Hide ();
- imageWarning.Hide ();
- if (message.getLength ())
- messageText.SetText (message);
- if (yes.getLength ())
- {
- yesButton.SetText (yes);
- if (yes != OUString (Button::GetStandardText (BUTTON_OK))
- && yes != OUString (Button::GetStandardText (BUTTON_YES)))
- SetTitle (yes);
- if (no.getLength ())
- noButton.SetText (no);
- else
- noButton.Hide ();
- }
- if (help_id.getLength() != 0)
- SetHelpId (help_id);
- else
- helpButton.Hide ();
-}
-
-class TabControlImpl
- : public ControlImpl
- , public ::cppu::WeakImplHelper1 <awt::XTabListener>
-{
- Link mActivatePageHdl;
- Link mDeactivatePageHdl;
-
-public:
- uno::Reference <awt::XSimpleTabController> mxTabControl;
- TabControlImpl (Context *context, const PeerHandle &peer, Window *window)
- : ControlImpl (context, peer, window)
- , mxTabControl (peer, uno::UNO_QUERY)
- {
- }
-
- virtual void SAL_CALL disposing (lang::EventObject const& e)
- throw (uno::RuntimeException)
- {
- ControlImpl::disposing (e);
- mxTabControl.clear ();
- }
-
- void SetActivatePageHdl (Link const& link)
- {
- if (!mDeactivatePageHdl || !link)
- UpdateListening (link);
- mActivatePageHdl = link;
- }
-
- void SetDeactivatePageHdl (Link const& link)
- {
- if (!mActivatePageHdl || !link)
- UpdateListening (link);
- mDeactivatePageHdl = link;
- }
-
- void UpdateListening (Link const& link)
- {
- if (!link && (!!mActivatePageHdl || !!mDeactivatePageHdl))
- mxTabControl->removeTabListener (this);
- else if (!!link && !mActivatePageHdl && !mDeactivatePageHdl)
- mxTabControl->addTabListener (this);
- }
-
- void SAL_CALL activated (sal_Int32)
- throw (uno::RuntimeException)
- {
- mActivatePageHdl.Call (mpWindow);
- }
-
- void SAL_CALL deactivated (sal_Int32)
- throw (uno::RuntimeException)
- {
- mDeactivatePageHdl.Call (mpWindow);
- }
-
- void SAL_CALL inserted (sal_Int32)
- throw (uno::RuntimeException)
- {
- }
-
- void SAL_CALL removed (sal_Int32)
- throw (uno::RuntimeException)
- {
- }
-
- void SAL_CALL changed (sal_Int32, uno::Sequence <beans::NamedValue> const&)
- throw (uno::RuntimeException)
- {
- }
-};
-
-IMPL_GET_WINDOW (TabControl);
-
-#define MX_TABCONTROL if (getImpl ().mxTabControl.is ()) getImpl ().mxTabControl
-#define RETURN_MX_TABCONTROL if (getImpl ().mxTabControl.is ()) return getImpl ().mxTabControl
-
-TabControl::~TabControl ()
-{
- SetActivatePageHdl (Link ());
- SetDeactivatePageHdl (Link ());
-}
-
-void TabControl::SetActivatePageHdl (Link const& link)
-{
- if (&getImpl () && getImpl().mxTabControl.is ())
- getImpl ().SetActivatePageHdl (link);
-}
-void TabControl::SetDeactivatePageHdl (Link const& link)
-{
- if (&getImpl () && getImpl().mxTabControl.is ())
- getImpl ().SetDeactivatePageHdl (link);
-}
-
-IMPL_GET_IMPL (TabControl);
-
-class TabPageImpl : public WindowImpl
-{
-public:
- uno::Reference< awt::XWindow > mxTabPage;
- TabPageImpl( Context *context, const PeerHandle &peer, Window *window )
- : WindowImpl( context, peer, window )
- , mxTabPage( peer, uno::UNO_QUERY )
- {
- }
-};
-
-::Window* TabPage::global_parent = 0;
-TabControl* TabPage::global_tabcontrol = 0;
-
-IMPL_GET_IMPL( TabPage );
-
-TabPage::~TabPage()
-{
- delete GetTabPage();
-}
-
-IMPL_GET_WINDOW( TabPage );
-
-void TabPage::ActivatePage()
-{
-}
-
-void TabPage::DeactivatePage()
-{
-}
-
-class FixedTextImpl : public ControlImpl
-{
-public:
- uno::Reference< awt::XFixedText > mxFixedText;
- FixedTextImpl( Context *context, const PeerHandle &peer, Window *window )
- : ControlImpl( context, peer, window )
- , mxFixedText( peer, uno::UNO_QUERY )
- {
- }
-
- ~FixedTextImpl ();
-
- virtual void SAL_CALL disposing( lang::EventObject const& e )
- throw (uno::RuntimeException);
-};
-
-FixedTextImpl::~FixedTextImpl ()
-{
-}
-
-void SAL_CALL FixedTextImpl::disposing( lang::EventObject const& e )
- throw (uno::RuntimeException)
-{
- ControlImpl::disposing (e);
- mxFixedText.clear ();
-}
-
-FixedText::FixedText ( Context *context, char const* pId, sal_uInt32 nId )
- : Control( new FixedTextImpl( context, context->GetPeerHandle( pId, nId ), this ) )
-{
- Window *parent = dynamic_cast<Window*> (context);
- if (parent)
- SetParent (parent);
-}
-
-FixedText::~FixedText ()
-{
-}
-
-IMPL_GET_IMPL( FixedText );
-
-void FixedText::SetText( OUString const& rStr )
-{
- if ( !getImpl().mxFixedText.is() )
- return;
- getImpl().mxFixedText->setText( rStr );
-}
-
-class ProgressBarImpl : public ControlImpl
-{
-public:
- uno::Reference< awt::XProgressBar > mxProgressBar;
- ProgressBarImpl( Context *context, const PeerHandle &peer, Window *window )
- : ControlImpl( context, peer, window )
- , mxProgressBar( peer, uno::UNO_QUERY )
- {
- }
-
- virtual void SAL_CALL disposing( lang::EventObject const& e )
- throw (uno::RuntimeException)
- {
- ControlImpl::disposing (e);
- mxProgressBar.clear ();
- }
-};
-
-
-class FixedImageImpl: public ControlImpl
-{
-public:
- uno::Reference< graphic::XGraphic > mxGraphic;
- FixedImageImpl( Context *context, const PeerHandle &peer, Window *window)
- : ControlImpl( context, peer, window )
- , mxGraphic( peer, uno::UNO_QUERY )
- {
- if ( !mxGraphic.is() )
- {
- OSL_FAIL( "ERROR: failed to load image: `%s'" );
- }
- }
-};
-
-FixedImage::FixedImage ( Context *context, char const* pId, sal_uInt32 nId )
- : Control( new FixedImageImpl( context, context->GetPeerHandle( pId, nId ), this ) )
-{
- Window *parent = dynamic_cast<Window*> (context);
- if (parent)
- SetParent (parent);
-}
-
-IMPL_GET_IMPL( FixedImage )
-
-} // namespace layout
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/layout/vcl/wrapper.hxx b/toolkit/source/layout/vcl/wrapper.hxx
deleted file mode 100644
index 3ac89468cfa4..000000000000
--- a/toolkit/source/layout/vcl/wrapper.hxx
+++ /dev/null
@@ -1,149 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef LAYOUT_VCL_WRAPPER_HXX
-#define LAYOUT_VCL_WRAPPER_HXX
-
-#include <layout/layout.hxx>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/awt/XDialog2.hpp>
-#include <com/sun/star/awt/XFocusListener.hpp>
-#include <com/sun/star/awt/XWindow.hpp>
-#include <com/sun/star/awt/XVclWindowPeer.hpp>
-#include <cppuhelper/implbase1.hxx>
-
-#include <cstring>
-
-namespace layout
-{
-
-namespace css = com::sun::star;
-
-class WindowImpl
-{
-public:
- Window *mpWindow;
- Context *mpCtx;
- css::uno::Reference< css::awt::XWindow > mxWindow;
- css::uno::Reference< css::awt::XVclWindowPeer > mxVclPeer;
- ::Window *mvclWindow;
- bool bFirstTimeVisible;
-
- WindowImpl (Context *context, PeerHandle const &peer, Window *window);
- virtual ~WindowImpl ();
-
- void wrapperGone();
- void setProperty (char const *name, css::uno::Any any);
- void redraw (bool resize=false);
-
- // XFocusListener
- virtual void SAL_CALL disposing (css::lang::EventObject const&) throw (css::uno::RuntimeException);
-};
-
-class ControlImpl : public WindowImpl
- , public ::cppu::WeakImplHelper1 <css::awt::XFocusListener>
-{
-public:
- Link mGetFocusHdl;
- Link mLoseFocusHdl;
-
- ControlImpl( Context *context, PeerHandle const& peer, Window *window );
- ~ControlImpl ();
-
- virtual void SetGetFocusHdl (Link const& link);
- virtual void SetLoseFocusHdl (Link const& link);
- virtual void UpdateListening (Link const& link);
-
- // XFocusListener
- virtual void SAL_CALL disposing (css::lang::EventObject const&) throw (css::uno::RuntimeException);
- void SAL_CALL focusGained (css::awt::FocusEvent const& e) throw (css::uno::RuntimeException);
- void SAL_CALL focusLost (css::awt::FocusEvent const& e) throw (css::uno::RuntimeException);
-};
-
-inline WindowImpl &Window::getImpl() const{ return *(static_cast< WindowImpl * >( mpImpl )); }
-
-// Helpers for defining boiler-plate constructors ...
-// Could in-line in top-level but not with safe static_casts.
-#define IMPL_GET_IMPL(t) \
- inline t##Impl &t::getImpl() const \
- { \
- return *(static_cast<t##Impl *>(mpImpl)); \
- }
-#define IMPL_CONSTRUCTORS_BODY(t,par,unoName,body) \
- t::t( Context *context, const char *pId, sal_uInt32 nId ) \
- : par( new t##Impl( context, context->GetPeerHandle( pId, nId ), this ) ) \
- { \
- Window *parent = dynamic_cast<Window*> (context);\
- body;\
- if (parent)\
- SetParent (parent);\
- } \
- t::t( Window *parent, WinBits bits) \
- : par( new t##Impl( parent->getContext(), Window::CreatePeer( parent, bits, unoName ), this ) ) \
- { \
- body;\
- if ( parent )\
- SetParent (parent);\
- } \
- t::t( Window *parent, ResId const& res) \
- : par( new t##Impl( parent->getContext(), Window::CreatePeer( parent, 0, unoName ), this ) ) \
- { \
- body;\
- setRes (res);\
- if (parent)\
- SetParent (parent);\
- }
-#define IMPL_CONSTRUCTORS(t,par,unoName) IMPL_CONSTRUCTORS_BODY(t, par, unoName, )
-#define IMPL_CONSTRUCTORS_2(t,win_par,other_par,unoName) \
- t::t( Context *context, const char *pId, sal_uInt32 nId ) \
- : win_par( new t##Impl( context, context->GetPeerHandle( pId, nId ), this ) ) \
- , other_par( new other_par##Impl( Window::GetPeer() ) ) \
- { \
- } \
- t::t( Window *parent, WinBits bits) \
- : win_par( new t##Impl( parent->getContext(), Window::CreatePeer( parent, bits, unoName ), this ) ) \
- , other_par( new other_par##Impl( Window::GetPeer() ) ) \
- { \
- }
-
-#define IMPL_IMPL(t, parent) \
- class t##Impl : public parent##Impl \
- { \
- public: \
- t##Impl( Context *context, PeerHandle const& peer, Window *window ) \
- : parent##Impl( context, peer, window ) \
- { \
- } \
- };
-
-
-} // namespace layout
-
-#endif /* LAYOUT_VCL_WRAPPER_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */