2007-10-02 09:00:08 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file WorkAreaManager.cpp
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author Abdelrazak Younes
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
#include "WorkAreaManager.h"
|
|
|
|
|
2007-11-12 22:15:51 +00:00
|
|
|
#include "WorkArea.h"
|
2007-10-02 16:32:58 +00:00
|
|
|
|
|
|
|
|
2007-11-12 22:15:51 +00:00
|
|
|
namespace lyx {
|
2007-10-02 09:00:08 +00:00
|
|
|
namespace frontend {
|
|
|
|
|
2007-10-02 09:12:13 +00:00
|
|
|
void WorkAreaManager::add(WorkArea * wa)
|
2007-10-02 09:00:08 +00:00
|
|
|
{
|
|
|
|
work_areas_.push_back(wa);
|
|
|
|
}
|
|
|
|
|
2007-10-02 14:39:48 +00:00
|
|
|
|
|
|
|
void WorkAreaManager::remove(WorkArea * wa)
|
|
|
|
{
|
|
|
|
work_areas_.remove(wa);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-01-08 02:03:54 +00:00
|
|
|
void WorkAreaManager::redrawAll(bool update_metrics)
|
2007-10-02 09:00:08 +00:00
|
|
|
{
|
2007-11-12 22:15:51 +00:00
|
|
|
for (iterator it = work_areas_.begin(); it != work_areas_.end(); ++it)
|
2010-01-08 02:03:54 +00:00
|
|
|
(*it)->redraw(update_metrics);
|
2007-10-02 09:00:08 +00:00
|
|
|
}
|
|
|
|
|
2007-10-02 14:39:48 +00:00
|
|
|
|
2007-10-02 09:12:13 +00:00
|
|
|
void WorkAreaManager::closeAll()
|
2007-10-02 09:00:08 +00:00
|
|
|
{
|
2007-10-02 16:32:58 +00:00
|
|
|
while (!work_areas_.empty())
|
|
|
|
// WorkArea is de-registering itself.
|
|
|
|
(*work_areas_.begin())->close();
|
2007-10-02 09:00:08 +00:00
|
|
|
}
|
|
|
|
|
2007-11-11 22:30:21 +00:00
|
|
|
|
|
|
|
void WorkAreaManager::updateTitles()
|
|
|
|
{
|
2007-11-12 22:15:51 +00:00
|
|
|
for (iterator it = work_areas_.begin(); it != work_areas_.end(); ++it)
|
2007-11-11 22:30:21 +00:00
|
|
|
(*it)->updateWindowTitle();
|
|
|
|
}
|
|
|
|
|
2007-10-02 09:00:08 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|