2004-07-13 13:53:38 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* $RCSfile: ViewShellManager.cxx,v $
|
|
|
|
*
|
2005-02-04 13:18:29 +00:00
|
|
|
* $Revision: 1.11 $
|
2004-07-13 13:53:38 +00:00
|
|
|
*
|
2005-02-04 13:18:29 +00:00
|
|
|
* last change: $Author: rt $ $Date: 2005-02-04 14:18:29 $
|
2004-07-13 13:53:38 +00:00
|
|
|
*
|
|
|
|
* The Contents of this file are made available subject to the terms of
|
|
|
|
* either of the following licenses
|
|
|
|
*
|
|
|
|
* - GNU Lesser General Public License Version 2.1
|
|
|
|
* - Sun Industry Standards Source License Version 1.1
|
|
|
|
*
|
|
|
|
* Sun Microsystems Inc., October, 2000
|
|
|
|
*
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2000 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library 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 for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Sun Industry Standards Source License Version 1.1
|
|
|
|
* =================================================
|
|
|
|
* The contents of this file are subject to the Sun Industry Standards
|
|
|
|
* Source License Version 1.1 (the "License"); You may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of the
|
|
|
|
* License at http://www.openoffice.org/license.html.
|
|
|
|
*
|
|
|
|
* Software provided under this License is provided on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
|
|
|
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
|
|
|
|
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
|
|
|
|
* See the License for the specific provisions governing your rights and
|
|
|
|
* obligations concerning the Software.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* Copyright: 2000 by Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s): _______________________________________
|
|
|
|
*
|
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#include "ViewShellManager.hxx"
|
|
|
|
|
|
|
|
#ifndef SD_OBJECT_BAR_MANAGER_HXX
|
|
|
|
#include "ObjectBarManager.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef SD_VIEW_SHELL_HXX
|
|
|
|
#include "ViewShell.hxx"
|
|
|
|
#endif
|
|
|
|
#ifndef SD_VIEW_SHELL_BASE_HXX
|
|
|
|
#include "ViewShellBase.hxx"
|
|
|
|
#endif
|
|
|
|
#include "ViewShellCache.hxx"
|
|
|
|
#include "Window.hxx"
|
2005-02-04 13:18:29 +00:00
|
|
|
#ifndef SD_DRAW_DOC_SHELL_HXX
|
|
|
|
#include "DrawDocShell.hxx"
|
|
|
|
#endif
|
2004-07-13 13:53:38 +00:00
|
|
|
|
|
|
|
#include <sfx2/dispatch.hxx>
|
|
|
|
|
|
|
|
#include <hash_map>
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
#undef VERBOSE
|
2004-07-13 13:53:38 +00:00
|
|
|
|
|
|
|
namespace sd {
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
namespace {
|
|
|
|
|
2004-07-13 13:53:38 +00:00
|
|
|
class ActiveShellDescriptor {
|
|
|
|
public:
|
|
|
|
ActiveShellDescriptor (ViewShell* pViewShell, ShellId nId)
|
2005-01-28 15:33:16 +00:00
|
|
|
: mpViewShell(pViewShell), mnId(nId) {}
|
2004-07-13 13:53:38 +00:00
|
|
|
ViewShell* mpViewShell;
|
|
|
|
ShellId mnId;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IsShell
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
IsShell (const ::sd::ViewShell* pShell) : mpShell(pShell) {}
|
|
|
|
bool operator() (const ActiveShellDescriptor& rDescriptor)
|
|
|
|
{
|
|
|
|
return rDescriptor.mpViewShell == mpShell;
|
|
|
|
}
|
|
|
|
const ViewShell* mpShell;
|
|
|
|
};
|
2005-01-28 15:33:16 +00:00
|
|
|
|
2004-07-13 13:53:38 +00:00
|
|
|
class IsId
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
IsId (ShellId nId) : mnId(nId) {}
|
|
|
|
bool operator() (const ActiveShellDescriptor& rDescriptor)
|
|
|
|
{
|
|
|
|
return rDescriptor.mnId == mnId;
|
|
|
|
}
|
|
|
|
ShellId mnId;
|
|
|
|
};
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
} // end of anonymous namespace
|
2004-07-13 13:53:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
class ViewShellManager::Implementation
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Implementation (
|
|
|
|
ViewShellManager& rManager,
|
|
|
|
ViewShellBase& rBase);
|
|
|
|
~Implementation (void);
|
|
|
|
|
|
|
|
void RegisterDefaultFactory (::std::auto_ptr<ViewShellFactory> pFactory);
|
|
|
|
void RegisterFactory (
|
|
|
|
ShellId nId,
|
|
|
|
::std::auto_ptr<ViewShellFactory> pFactory);
|
|
|
|
ViewShell* ActivateViewShell (
|
|
|
|
ShellId nId,
|
|
|
|
::Window* pParentWindow,
|
|
|
|
FrameView* pFrameView);
|
|
|
|
void DeactivateViewShell (const ViewShell* pShell);
|
|
|
|
void MoveToTop (const ViewShell* pShell);
|
|
|
|
ViewShell* GetShell (ShellId nId);
|
|
|
|
ShellId GetShellId (const ViewShell* pShell);
|
|
|
|
ViewShellBase& GetViewShellBase (void) const;
|
|
|
|
void Shutdown (void);
|
|
|
|
ViewShell* CreateViewShell (
|
|
|
|
ShellId nShellId,
|
|
|
|
::Window* pParentWindow,
|
|
|
|
FrameView* pFrameView);
|
|
|
|
|
|
|
|
/** Remove all shells from the SFX stack above and including the given
|
|
|
|
shell.
|
|
|
|
*/
|
|
|
|
void TakeShellsFromStack (const SfxShell* pShell);
|
|
|
|
|
|
|
|
/** Prevent updates of the shell stack. While the sub shell manager is
|
|
|
|
locked it will update its internal data structures but not alter the
|
|
|
|
shell stack. Use this method when there are several modifications
|
|
|
|
to the shell stack to prevent multiple rebuilds of the shell stack
|
|
|
|
and resulting broadcasts.
|
|
|
|
*/
|
|
|
|
void LockUpdate (void);
|
|
|
|
|
|
|
|
/** Allow updates of the shell stack. This method has to be called the
|
|
|
|
same number of times as LockUpdate() to really allow a rebuild of
|
|
|
|
the shell stack.
|
|
|
|
*/
|
|
|
|
void UnlockUpdate (void);
|
|
|
|
|
|
|
|
private:
|
|
|
|
ViewShellBase& mrBase;
|
|
|
|
|
|
|
|
::std::auto_ptr<ViewShellFactory> mpDefaultFactory;
|
|
|
|
|
|
|
|
typedef ::std::hash_map<ShellId,ViewShellFactory*> SpecializedFactoryList;
|
|
|
|
SpecializedFactoryList maSpecializedFactories;
|
|
|
|
|
|
|
|
/** List of the active view shells. In order to create gather all shells
|
|
|
|
to put on the shell stack each view shell in this list is asked for
|
|
|
|
its sub-shells (typically toolbars).
|
|
|
|
*/
|
|
|
|
typedef ::std::list<ActiveShellDescriptor> ActiveShellList;
|
|
|
|
ActiveShellList maActiveViewShells;
|
|
|
|
|
|
|
|
/** In this member we remember what shells we have pushed on the shell
|
|
|
|
stack.
|
|
|
|
*/
|
|
|
|
typedef ::std::vector<SfxShell*> ShellStack;
|
|
|
|
|
|
|
|
ViewShellCache maCache;
|
|
|
|
|
|
|
|
int mnUpdateLockCount;
|
|
|
|
|
|
|
|
/** When this flag is set then the main view shell is always kept at the
|
|
|
|
top of the shell stack.
|
|
|
|
*/
|
|
|
|
bool mbKeepMainViewShellOnTop;
|
|
|
|
|
|
|
|
/** The PushShellsOnStack() method can be called recursively. This flag
|
|
|
|
is used to communicate between different levels of invocation: if
|
|
|
|
the stack has been updated in an inner call the outer call can (has
|
|
|
|
to) stop and return immediately.
|
|
|
|
*/
|
|
|
|
bool mbShellStackIsUpToDate;
|
|
|
|
|
|
|
|
void GatherActiveShells (ShellStack& rShellList);
|
|
|
|
|
|
|
|
/** This method rebuilds the stack of shells that are stacked upon the
|
|
|
|
view shell base.
|
|
|
|
*/
|
|
|
|
void PushShellsOnStack (void);
|
|
|
|
|
|
|
|
DECL_LINK(WindowEventHandler, VclWindowEvent*);
|
|
|
|
|
|
|
|
void DumpActiveShell (const ActiveShellList& rList);
|
|
|
|
void DumpShellStack (const ShellStack& rStack);
|
|
|
|
void DumpSfxShellStack (void);
|
|
|
|
|
|
|
|
void UpdateShellStack (ShellStack& rRequestedStack);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//===== ViewShellManager ======================================================
|
2004-07-13 13:53:38 +00:00
|
|
|
|
|
|
|
ViewShellManager::ViewShellManager (ViewShellBase& rBase)
|
2005-01-28 15:33:16 +00:00
|
|
|
: mpImpl(new Implementation(*this,rBase)),
|
|
|
|
mbValid(true)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ViewShellManager::~ViewShellManager (void)
|
|
|
|
{
|
2004-09-20 12:38:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
void ViewShellManager::RegisterDefaultFactory (
|
|
|
|
::std::auto_ptr<ViewShellFactory> pFactory)
|
2004-09-20 12:38:00 +00:00
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
if (mbValid)
|
|
|
|
mpImpl->RegisterDefaultFactory(pFactory);
|
|
|
|
}
|
2004-09-20 12:38:00 +00:00
|
|
|
|
2004-07-13 13:53:38 +00:00
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
void ViewShellManager::RegisterFactory (
|
|
|
|
ShellId nId,
|
|
|
|
::std::auto_ptr<ViewShellFactory> pFactory)
|
|
|
|
{
|
|
|
|
if (mbValid)
|
|
|
|
mpImpl->RegisterFactory(nId,pFactory);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ViewShell* ViewShellManager::ActivateViewShell (
|
|
|
|
ShellId nShellId,
|
|
|
|
::Window* pParentWindow,
|
|
|
|
FrameView* pFrameView)
|
|
|
|
{
|
|
|
|
if (mbValid)
|
|
|
|
return mpImpl->ActivateViewShell(nShellId,pParentWindow,pFrameView);
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShellManager::DeactivateViewShell (const ViewShell* pShell)
|
|
|
|
{
|
|
|
|
if (mbValid)
|
|
|
|
mpImpl->DeactivateViewShell(pShell);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShellManager::InvalidateShellStack (const SfxShell* pShell)
|
|
|
|
{
|
|
|
|
if (mbValid)
|
|
|
|
mpImpl->TakeShellsFromStack(pShell);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShellManager::MoveToTop (const ViewShell* pShell)
|
|
|
|
{
|
|
|
|
if (mbValid)
|
|
|
|
mpImpl->MoveToTop(pShell);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ViewShell* ViewShellManager::GetShell (ShellId nId)
|
|
|
|
{
|
|
|
|
if (mbValid)
|
|
|
|
return mpImpl->GetShell(nId);
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ShellId ViewShellManager::GetShellId (const ViewShell* pShell)
|
|
|
|
{
|
|
|
|
if (mbValid)
|
|
|
|
return mpImpl->GetShellId(pShell);
|
|
|
|
else
|
|
|
|
return snInvalidShellId;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ViewShellBase& ViewShellManager::GetViewShellBase (void) const
|
|
|
|
{
|
|
|
|
return mpImpl->GetViewShellBase();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShellManager::Shutdown (void)
|
|
|
|
{
|
|
|
|
if (mbValid)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
mpImpl->Shutdown();
|
|
|
|
mbValid = false;
|
2004-07-13 13:53:38 +00:00
|
|
|
}
|
2005-01-28 15:33:16 +00:00
|
|
|
}
|
2004-09-20 12:38:00 +00:00
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ViewShell* ViewShellManager::CreateViewShell (
|
|
|
|
ShellId nShellId,
|
|
|
|
::Window* pParentWindow,
|
|
|
|
FrameView* pFrameView)
|
|
|
|
{
|
|
|
|
if (mbValid)
|
|
|
|
return mpImpl->CreateViewShell(nShellId,pParentWindow,pFrameView);
|
|
|
|
else
|
|
|
|
return NULL;
|
2004-07-13 13:53:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
//===== ViewShellManager::Implementation ======================================
|
|
|
|
|
|
|
|
ViewShellManager::Implementation::Implementation (
|
|
|
|
ViewShellManager& rManager,
|
|
|
|
ViewShellBase& rBase)
|
|
|
|
: mrBase(rBase),
|
|
|
|
mpDefaultFactory (NULL),
|
|
|
|
maSpecializedFactories (),
|
|
|
|
maActiveViewShells(),
|
|
|
|
maCache (rManager),
|
|
|
|
mnUpdateLockCount(0),
|
|
|
|
mbKeepMainViewShellOnTop(false),
|
|
|
|
mbShellStackIsUpToDate(true)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ViewShellManager::Implementation::~Implementation (void)
|
|
|
|
{
|
|
|
|
Shutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShellManager::Implementation::RegisterDefaultFactory (
|
2004-07-13 13:53:38 +00:00
|
|
|
::std::auto_ptr<ViewShellFactory> pFactory)
|
|
|
|
{
|
|
|
|
mpDefaultFactory = pFactory;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
void ViewShellManager::Implementation::RegisterFactory (
|
2004-07-13 13:53:38 +00:00
|
|
|
ShellId nId,
|
|
|
|
::std::auto_ptr<ViewShellFactory> pFactory)
|
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
maSpecializedFactories[nId] = pFactory.get();
|
2004-07-13 13:53:38 +00:00
|
|
|
pFactory.release();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
ViewShell* ViewShellManager::Implementation::ActivateViewShell (
|
2004-07-13 13:53:38 +00:00
|
|
|
ShellId nShellId,
|
|
|
|
::Window* pParentWindow,
|
|
|
|
FrameView* pFrameView)
|
|
|
|
{
|
2004-09-20 12:38:00 +00:00
|
|
|
// Create a new shell or recycle on in the cache.
|
2005-01-28 15:33:16 +00:00
|
|
|
ViewShell* pViewShell = maCache.GetViewShell (
|
2004-07-13 13:53:38 +00:00
|
|
|
nShellId,
|
|
|
|
pParentWindow,
|
|
|
|
pFrameView);
|
|
|
|
|
|
|
|
// Put shell on top of the active view shells.
|
|
|
|
if (pViewShell != NULL)
|
|
|
|
{
|
|
|
|
::Window* pWindow = pViewShell->GetActiveWindow();
|
|
|
|
if (pWindow != NULL)
|
|
|
|
pWindow->AddEventListener(
|
|
|
|
LINK(
|
|
|
|
this,
|
2005-01-28 15:33:16 +00:00
|
|
|
ViewShellManager::Implementation,
|
2004-07-13 13:53:38 +00:00
|
|
|
WindowEventHandler));
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DBG_ASSERT (pViewShell->GetActiveWindow()!=NULL,
|
|
|
|
"ViewShellManager::ActivateViewShell: "
|
|
|
|
"new view shell has no active window");
|
|
|
|
}
|
|
|
|
// Determine where to put the view shell on the stack. By default
|
|
|
|
// it is put on top of the stack. When the view shell of the center
|
|
|
|
// pane is to be kept top most and the new view shell is not
|
|
|
|
// displayed in the center pane then it is inserted at the position
|
|
|
|
// one below the top.
|
|
|
|
ActiveShellList::iterator iInsertPosition (
|
2005-01-28 15:33:16 +00:00
|
|
|
maActiveViewShells.begin());
|
|
|
|
if (iInsertPosition != maActiveViewShells.end()
|
2004-07-13 13:53:38 +00:00
|
|
|
&& mbKeepMainViewShellOnTop
|
|
|
|
&& ! pViewShell->IsMainViewShell()
|
|
|
|
&& iInsertPosition->mpViewShell->IsMainViewShell())
|
|
|
|
{
|
|
|
|
++iInsertPosition;
|
|
|
|
}
|
2005-01-28 15:33:16 +00:00
|
|
|
maActiveViewShells.insert(
|
2004-07-13 13:53:38 +00:00
|
|
|
iInsertPosition,
|
|
|
|
ActiveShellDescriptor(pViewShell, nShellId));
|
|
|
|
}
|
|
|
|
|
|
|
|
return pViewShell;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
void ViewShellManager::Implementation::DeactivateViewShell (const ViewShell* pShell)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
|
|
|
ActiveShellList::iterator aI (::std::find_if (
|
2005-01-28 15:33:16 +00:00
|
|
|
maActiveViewShells.begin(),
|
|
|
|
maActiveViewShells.end(),
|
2004-07-13 13:53:38 +00:00
|
|
|
IsShell(pShell)));
|
2005-01-28 15:33:16 +00:00
|
|
|
if (aI != maActiveViewShells.end())
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
UpdateLock aLocker (*this);
|
2004-07-13 13:53:38 +00:00
|
|
|
|
|
|
|
ViewShell* pViewShell = aI->mpViewShell;
|
2005-02-04 13:18:29 +00:00
|
|
|
mrBase.GetDocShell()->Disconnect(pViewShell);
|
2004-07-13 13:53:38 +00:00
|
|
|
pViewShell->GetObjectBarManager().Clear();
|
2005-01-28 15:33:16 +00:00
|
|
|
maActiveViewShells.erase (aI);
|
2004-07-13 13:53:38 +00:00
|
|
|
pViewShell->GetActiveWindow()->RemoveEventListener(
|
|
|
|
LINK(
|
|
|
|
this,
|
2005-01-28 15:33:16 +00:00
|
|
|
ViewShellManager::Implementation,
|
2004-07-13 13:53:38 +00:00
|
|
|
WindowEventHandler));
|
2005-01-28 15:33:16 +00:00
|
|
|
TakeShellsFromStack(pViewShell);
|
|
|
|
maCache.ReleaseViewShell (pViewShell);
|
2004-07-13 13:53:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
void ViewShellManager::Implementation::MoveToTop (const ViewShell* pShell)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
|
|
|
ActiveShellList::iterator aI (::std::find_if (
|
2005-01-28 15:33:16 +00:00
|
|
|
maActiveViewShells.begin(),
|
|
|
|
maActiveViewShells.end(),
|
2004-07-13 13:53:38 +00:00
|
|
|
IsShell(pShell)));
|
2004-11-26 14:07:07 +00:00
|
|
|
bool bMove = true;
|
2005-01-28 15:33:16 +00:00
|
|
|
if (aI != maActiveViewShells.end())
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
2004-11-26 14:07:07 +00:00
|
|
|
// Is the shell already at the top of the stack? We have to keep
|
|
|
|
// the case in mind that mbKeepMainViewShellOnTop is true. Shells
|
|
|
|
// that are not the main view shell are placed on the second-to-top
|
|
|
|
// position in this case.
|
2005-01-28 15:33:16 +00:00
|
|
|
if (aI == maActiveViewShells.begin()
|
2004-11-26 14:07:07 +00:00
|
|
|
&& (aI->mpViewShell->IsMainViewShell() || ! mbKeepMainViewShellOnTop))
|
|
|
|
{
|
|
|
|
// The shell is at the top position and is either a) the main
|
|
|
|
// view shell or b) another shell but the main view shell is not
|
|
|
|
// kept at the top position. We do not have to move the shell.
|
2004-07-13 13:53:38 +00:00
|
|
|
bMove = false;
|
2004-11-26 14:07:07 +00:00
|
|
|
}
|
2005-01-28 15:33:16 +00:00
|
|
|
else if (aI == ++maActiveViewShells.begin()
|
2004-07-13 13:53:38 +00:00
|
|
|
&& ! aI->mpViewShell->IsMainViewShell()
|
2004-11-26 14:07:07 +00:00
|
|
|
&& mbKeepMainViewShellOnTop)
|
|
|
|
{
|
|
|
|
// The shell is a the second-to-top position, not the main view
|
|
|
|
// shell and the main view shell is kept at the top position.
|
|
|
|
// Therefore we do not have to move the shell.
|
2004-07-13 13:53:38 +00:00
|
|
|
bMove = false;
|
2004-11-26 14:07:07 +00:00
|
|
|
}
|
2004-07-13 13:53:38 +00:00
|
|
|
}
|
2004-11-26 14:07:07 +00:00
|
|
|
else
|
|
|
|
// The shell is not on the stack. Therefore it can not be moved.
|
|
|
|
// We could insert it but we don't. Use ActivateViewShell() for
|
|
|
|
// that.
|
|
|
|
bMove = false;
|
2004-07-13 13:53:38 +00:00
|
|
|
|
2004-11-26 14:07:07 +00:00
|
|
|
// When the shell is not at the right position it is removed from the
|
|
|
|
// internal list of shells and inserted at the correct position.
|
2004-07-13 13:53:38 +00:00
|
|
|
if (bMove)
|
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
UpdateLock aLock (*this);
|
|
|
|
TakeShellsFromStack(pShell);
|
2004-09-20 12:38:00 +00:00
|
|
|
|
2004-07-13 13:53:38 +00:00
|
|
|
ViewShell* pNonConstViewShell = aI->mpViewShell;
|
|
|
|
ShellId nId = aI->mnId;
|
2005-01-28 15:33:16 +00:00
|
|
|
maActiveViewShells.erase(aI);
|
2004-11-16 15:15:51 +00:00
|
|
|
|
2004-11-26 14:07:07 +00:00
|
|
|
// Find out whether to insert at the top or one below.
|
|
|
|
ActiveShellList::iterator aInsertPosition (
|
2005-01-28 15:33:16 +00:00
|
|
|
maActiveViewShells.begin());
|
2004-11-26 14:07:07 +00:00
|
|
|
if (mbKeepMainViewShellOnTop && ! aI->mpViewShell->IsMainViewShell())
|
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
if (maActiveViewShells.back().mpViewShell->IsMainViewShell())
|
2004-11-26 14:07:07 +00:00
|
|
|
aInsertPosition++;
|
|
|
|
}
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
maActiveViewShells.insert (
|
2004-11-26 14:07:07 +00:00
|
|
|
aInsertPosition,
|
|
|
|
ActiveShellDescriptor(pNonConstViewShell,nId));
|
2004-07-13 13:53:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
ViewShell* ViewShellManager::Implementation::GetShell (ShellId nId)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
|
|
|
ActiveShellList::iterator aI (::std::find_if (
|
2005-01-28 15:33:16 +00:00
|
|
|
maActiveViewShells.begin(),
|
|
|
|
maActiveViewShells.end(),
|
2004-07-13 13:53:38 +00:00
|
|
|
IsId(nId)));
|
2005-01-28 15:33:16 +00:00
|
|
|
if (aI != maActiveViewShells.end())
|
2004-07-13 13:53:38 +00:00
|
|
|
return aI->mpViewShell;
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
ShellId ViewShellManager::Implementation::GetShellId (const ViewShell* pShell)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
|
|
|
ActiveShellList::iterator aI (::std::find_if (
|
2005-01-28 15:33:16 +00:00
|
|
|
maActiveViewShells.begin(),
|
|
|
|
maActiveViewShells.end(),
|
2004-07-13 13:53:38 +00:00
|
|
|
IsShell(pShell)));
|
2005-01-28 15:33:16 +00:00
|
|
|
if (aI != maActiveViewShells.end())
|
2004-07-13 13:53:38 +00:00
|
|
|
return aI->mnId;
|
|
|
|
else
|
|
|
|
return snInvalidShellId;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
void ViewShellManager::Implementation::LockUpdate (void)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
|
|
|
mnUpdateLockCount++;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
void ViewShellManager::Implementation::UnlockUpdate (void)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
|
|
|
mnUpdateLockCount--;
|
|
|
|
if (mnUpdateLockCount < 0)
|
|
|
|
{
|
|
|
|
// This should not happen.
|
|
|
|
OSL_ASSERT (mnUpdateLockCount>=0);
|
|
|
|
mnUpdateLockCount = 0;
|
|
|
|
}
|
|
|
|
if (mnUpdateLockCount == 0)
|
2005-01-28 15:33:16 +00:00
|
|
|
PushShellsOnStack();
|
2004-07-13 13:53:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
void ViewShellManager::Implementation::PushShellsOnStack (void)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
// Create a local stack of the shells that are to push on the shell
|
|
|
|
// stack. We can thus safly create the required shells wile still
|
|
|
|
// having a valid shell stack.
|
|
|
|
ShellStack aShellStack;
|
|
|
|
for (ActiveShellList::reverse_iterator aI (maActiveViewShells.rbegin());
|
|
|
|
aI!=maActiveViewShells.rend();
|
|
|
|
++aI)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
// Get all its sub shells that are placed below the shell.
|
|
|
|
aI->mpViewShell->GetLowerShellList (aShellStack);
|
2004-07-13 13:53:38 +00:00
|
|
|
|
|
|
|
// Put the shell itself on the local stack.
|
2005-01-28 15:33:16 +00:00
|
|
|
aShellStack.push_back (aI->mpViewShell);
|
2004-07-13 13:53:38 +00:00
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
// Get all its sub shells that are placed above the shell.
|
|
|
|
aI->mpViewShell->GetUpperShellList (aShellStack);
|
2004-07-13 13:53:38 +00:00
|
|
|
}
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
// Now update the SFX stack to look like the local stack.
|
|
|
|
UpdateShellStack (aShellStack);
|
2004-07-13 13:53:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
/** Update the SFX shell stack (the portion that is visible to us) so that
|
|
|
|
it matches the internal shell stack. Since we can not look at the
|
|
|
|
shells on the SFX stack directly we use the copy that we created the
|
|
|
|
last time when we rebuilt the SFX stack. This is done in three steps:
|
|
|
|
1. Find the lowest shell in which the two stack differ.
|
|
|
|
2. Remove all shells above and including that shell from the SFX stack.
|
|
|
|
This should not be necessary because deactivated shells should have been
|
|
|
|
removed already.
|
|
|
|
3. Push all shells of the internal stack on the SFX shell stack that are
|
|
|
|
not already present on the later.
|
|
|
|
*/
|
|
|
|
void ViewShellManager::Implementation::UpdateShellStack (ShellStack& rRequestedStack)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
ShellStack aSfxShellStack;
|
|
|
|
ShellStack::const_iterator iSfxShell;
|
|
|
|
ShellStack::iterator iRequestedShell;
|
2004-07-13 13:53:38 +00:00
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
mbShellStackIsUpToDate = false;
|
|
|
|
|
|
|
|
#ifdef VERBOSE
|
|
|
|
OSL_TRACE("UpdateShellStack");
|
|
|
|
OSL_TRACE("Current SFX Stack");
|
|
|
|
DumpSfxShellStack();
|
|
|
|
OSL_TRACE("Requested Stack");
|
|
|
|
DumpShellStack(rRequestedStack);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// 1. Put the SFX shell stack in a local data structure so that it can
|
|
|
|
// be searched properly.
|
|
|
|
for (USHORT nIndex=0; true; nIndex++)
|
|
|
|
{
|
|
|
|
if (mrBase.GetSubShell(nIndex)==NULL)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
aSfxShellStack.reserve(nIndex);
|
|
|
|
while (nIndex-- > 0)
|
|
|
|
aSfxShellStack.push_back(mrBase.GetSubShell(nIndex));
|
|
|
|
break;
|
2004-07-13 13:53:38 +00:00
|
|
|
}
|
|
|
|
}
|
2005-01-28 15:33:16 +00:00
|
|
|
|
|
|
|
// 2. Find the lowest shell in which the two stacks differ.
|
|
|
|
iSfxShell = aSfxShellStack.begin();
|
|
|
|
iRequestedShell = rRequestedStack.begin();
|
|
|
|
while (iSfxShell != aSfxShellStack.end()
|
|
|
|
&& iRequestedShell!=rRequestedStack.end()
|
|
|
|
&& (*iSfxShell)==(*iRequestedShell))
|
|
|
|
{
|
|
|
|
++iSfxShell;
|
|
|
|
++iRequestedShell;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 3. Remove all shells above and including the differing shell from the
|
|
|
|
// SFX stack starting with the shell on top of the stack.
|
|
|
|
while (iSfxShell != aSfxShellStack.end())
|
|
|
|
{
|
|
|
|
SfxShell* pShell = aSfxShellStack.back();
|
|
|
|
aSfxShellStack.pop_back();
|
|
|
|
#ifdef VERBOSE
|
|
|
|
OSL_TRACE("removing shell %p from stack", pShell);
|
|
|
|
#endif
|
|
|
|
mrBase.RemoveSubShell(pShell);
|
|
|
|
}
|
|
|
|
|
|
|
|
// 4. Push shells from the given stack onto the SFX stack.
|
|
|
|
while (iRequestedShell != rRequestedStack.end())
|
|
|
|
{
|
|
|
|
#ifdef VERBOSE
|
|
|
|
OSL_TRACE("pushing shell %p on stack", *iRequestedShell);
|
|
|
|
#endif
|
|
|
|
mrBase.AddSubShell(**iRequestedShell);
|
|
|
|
++iRequestedShell;
|
|
|
|
|
|
|
|
// The pushing of the shell on to the shell stack may have lead to
|
|
|
|
// another invocation of this method. In this case we have to abort
|
|
|
|
// pushing shells on the stack and return immediately.
|
|
|
|
if (mbShellStackIsUpToDate)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 5. Tell the dispatcher to update the SFX shell.
|
|
|
|
if (mrBase.GetDispatcher() != NULL)
|
|
|
|
mrBase.GetDispatcher()->Flush();
|
|
|
|
|
|
|
|
// 6. Finally Tell an invocation of this method on a higher level that it can (has
|
|
|
|
// to) abort and return immediately.
|
|
|
|
mbShellStackIsUpToDate = true;
|
|
|
|
|
|
|
|
#ifdef VERBOSE
|
|
|
|
OSL_TRACE("New current stack");
|
|
|
|
DumpSfxShellStack();
|
|
|
|
#endif
|
2004-07-13 13:53:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
void ViewShellManager::Implementation::TakeShellsFromStack (const SfxShell* pShell)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
#ifdef VERBOSE
|
|
|
|
OSL_TRACE("TakeShellsFromStack(%p)", pShell);
|
|
|
|
DumpSfxShellStack();
|
|
|
|
#endif
|
2004-12-16 09:13:09 +00:00
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
// 0.Make sure that the given shell is on the stack. This is a
|
|
|
|
// preparation for the following assertion.
|
|
|
|
for (USHORT nIndex=0; true; nIndex++)
|
|
|
|
{
|
|
|
|
SfxShell* pShellOnStack = mrBase.GetSubShell(nIndex);
|
|
|
|
if (pShellOnStack == NULL)
|
|
|
|
{
|
|
|
|
// Set pShell to NULL to indicate the following code that the
|
|
|
|
// shell is not on the stack.
|
|
|
|
pShell = NULL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else if (pShellOnStack == pShell)
|
|
|
|
break;
|
|
|
|
}
|
2004-07-13 13:53:38 +00:00
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
if (pShell != NULL)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
// 1. Deactivate our shells on the stack before they are removed so
|
|
|
|
// that during the Deactivation() calls the stack is still intact.
|
|
|
|
for (USHORT nIndex=0; true; nIndex++)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
SfxShell* pShellOnStack = mrBase.GetSubShell(nIndex);
|
|
|
|
pShellOnStack->Deactivate(TRUE);
|
|
|
|
if (pShellOnStack == pShell)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 2. Remove the shells from the stack.
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
SfxShell* pShellOnStack = mrBase.GetSubShell(0);
|
|
|
|
#ifdef VERBOSE
|
|
|
|
OSL_TRACE("removing shell %p from stack", pShellOnStack);
|
|
|
|
#endif
|
|
|
|
mrBase.RemoveSubShell(pShellOnStack);
|
|
|
|
if (pShellOnStack == pShell)
|
2004-12-16 09:13:09 +00:00
|
|
|
break;
|
2004-07-13 13:53:38 +00:00
|
|
|
}
|
2005-01-28 15:33:16 +00:00
|
|
|
|
|
|
|
// 3. Update the stack.
|
2004-07-13 13:53:38 +00:00
|
|
|
if (mrBase.GetDispatcher() != NULL)
|
|
|
|
mrBase.GetDispatcher()->Flush();
|
|
|
|
}
|
2004-12-16 09:13:09 +00:00
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
#ifdef VERBOSE
|
|
|
|
OSL_TRACE("Sfx shell stack is:");
|
|
|
|
DumpSfxShellStack();
|
|
|
|
#endif
|
2004-07-13 13:53:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
ViewShellBase& ViewShellManager::Implementation::GetViewShellBase (void) const
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
|
|
|
return mrBase;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
IMPL_LINK(ViewShellManager::Implementation, WindowEventHandler, VclWindowEvent*, pEvent)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
|
|
|
if (pEvent != NULL)
|
|
|
|
{
|
|
|
|
::Window* pEventWindow
|
|
|
|
= static_cast<VclWindowEvent*>(pEvent)->GetWindow();
|
|
|
|
|
|
|
|
switch (pEvent->GetId())
|
|
|
|
{
|
|
|
|
case VCLEVENT_WINDOW_GETFOCUS:
|
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
for (ActiveShellList::iterator aI(maActiveViewShells.begin());
|
|
|
|
aI!=maActiveViewShells.end();
|
2004-07-13 13:53:38 +00:00
|
|
|
aI++)
|
|
|
|
{
|
|
|
|
if (pEventWindow == static_cast< ::Window*>(
|
|
|
|
aI->mpViewShell->GetActiveWindow()))
|
|
|
|
{
|
|
|
|
MoveToTop (aI->mpViewShell);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case VCLEVENT_WINDOW_LOSEFOCUS:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
ViewShell* ViewShellManager::Implementation::CreateViewShell (
|
2004-07-13 13:53:38 +00:00
|
|
|
ShellId nShellId,
|
|
|
|
::Window* pParentWindow,
|
|
|
|
FrameView* pFrameView)
|
|
|
|
{
|
|
|
|
ViewShell* pViewShell = NULL;
|
|
|
|
|
|
|
|
// Initialize with the default factory.
|
|
|
|
ViewShellFactory* pFactory = mpDefaultFactory.get();
|
|
|
|
|
|
|
|
// Look up a specialized factory.
|
2005-01-28 15:33:16 +00:00
|
|
|
SpecializedFactoryList::iterator aI (maSpecializedFactories.find(nShellId));
|
|
|
|
if (aI != maSpecializedFactories.end())
|
2004-07-13 13:53:38 +00:00
|
|
|
pFactory = aI->second;
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
UpdateLock aLocker (*this);
|
2004-07-13 13:53:38 +00:00
|
|
|
|
|
|
|
if (pFactory!=NULL && pParentWindow!=NULL)
|
|
|
|
{
|
|
|
|
// Create view shell with the factory.
|
|
|
|
pViewShell = pFactory->CreateShell (
|
|
|
|
nShellId,
|
|
|
|
pParentWindow,
|
|
|
|
pFrameView);
|
|
|
|
}
|
|
|
|
|
|
|
|
return pViewShell;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
void ViewShellManager::Implementation::Shutdown (void)
|
2004-09-20 12:38:00 +00:00
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
// Take stacked shells from stack.
|
|
|
|
if ( ! maActiveViewShells.empty())
|
|
|
|
{
|
|
|
|
UpdateLock aLock (*this);
|
|
|
|
|
|
|
|
while ( ! maActiveViewShells.empty())
|
|
|
|
{
|
|
|
|
DeactivateViewShell(maActiveViewShells.front().mpViewShell);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
mrBase.RemoveSubShell (NULL);
|
|
|
|
|
|
|
|
// We have the ownership of the factories and because they can not be
|
|
|
|
// auto_ptrs in an stl list we have to delete them now by hand.
|
|
|
|
for (SpecializedFactoryList::iterator aI (maSpecializedFactories.begin());
|
|
|
|
aI!=maSpecializedFactories.end();
|
|
|
|
aI++)
|
2004-09-20 12:38:00 +00:00
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
delete aI->second;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Destroy members.
|
|
|
|
maCache.Shutdown();
|
|
|
|
mpDefaultFactory.reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShellManager::Implementation::DumpActiveShell (const ActiveShellList& rList)
|
|
|
|
{
|
|
|
|
ActiveShellList::const_iterator aI;
|
|
|
|
for (aI=rList.begin(); aI!=rList.end(); ++aI)
|
|
|
|
{
|
|
|
|
OSL_TRACE (" %d %p",
|
|
|
|
aI->mnId,
|
|
|
|
aI->mpViewShell);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShellManager::Implementation::DumpShellStack (const ShellStack& rStack)
|
|
|
|
{
|
|
|
|
ShellStack::const_reverse_iterator iEntry;
|
|
|
|
for (iEntry=rStack.rbegin(); iEntry!=rStack.rend(); ++iEntry)
|
|
|
|
OSL_TRACE (" %p: %s",
|
|
|
|
*iEntry,
|
|
|
|
::rtl::OUStringToOString((*iEntry)->GetName(),RTL_TEXTENCODING_UTF8).getStr());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ViewShellManager::Implementation::DumpSfxShellStack (void)
|
|
|
|
{
|
|
|
|
USHORT nIndex;
|
|
|
|
for (nIndex=0; true; nIndex++)
|
|
|
|
{
|
|
|
|
SfxShell* pShell = mrBase.GetSubShell(nIndex);
|
|
|
|
if (pShell == NULL)
|
|
|
|
break;
|
|
|
|
OSL_TRACE (" %d : %p: %s",
|
|
|
|
nIndex,
|
|
|
|
pShell,
|
|
|
|
::rtl::OUStringToOString(pShell->GetName(),RTL_TEXTENCODING_UTF8).getStr());
|
2004-09-20 12:38:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
//===== ViewShellManager::UpdateLock ==========================================
|
|
|
|
|
|
|
|
ViewShellManager::UpdateLock::UpdateLock (ViewShellManager& rManager)
|
|
|
|
: mrManagerImplementation(*rManager.mpImpl.get())
|
|
|
|
{
|
|
|
|
mrManagerImplementation.LockUpdate();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-09-20 12:38:00 +00:00
|
|
|
|
2004-07-13 13:53:38 +00:00
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
ViewShellManager::UpdateLock::UpdateLock (ViewShellManager::Implementation& rManagerImplementation)
|
|
|
|
: mrManagerImplementation(rManagerImplementation)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
mrManagerImplementation.LockUpdate();
|
2004-07-13 13:53:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-01-28 15:33:16 +00:00
|
|
|
ViewShellManager::UpdateLock::~UpdateLock (void)
|
2004-07-13 13:53:38 +00:00
|
|
|
{
|
2005-01-28 15:33:16 +00:00
|
|
|
mrManagerImplementation.UnlockUpdate();
|
2004-07-13 13:53:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // end of namespace sd
|
|
|
|
|