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"
|
|
|
|
|
2017-06-10 19:51:44 +00:00
|
|
|
#include "Application.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
|
|
|
{
|
2017-02-28 21:58:44 +00:00
|
|
|
for (WorkArea * wa : work_areas_)
|
2017-09-14 13:50:30 +00:00
|
|
|
wa->scheduleRedraw(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
|
|
|
|
2017-06-10 19:51:44 +00:00
|
|
|
bool WorkAreaManager::unhide(Buffer * buf)
|
|
|
|
{
|
|
|
|
if (!work_areas_.empty())
|
|
|
|
return true;
|
|
|
|
return theApp()->unhide(buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-11-11 22:30:21 +00:00
|
|
|
void WorkAreaManager::updateTitles()
|
|
|
|
{
|
2017-02-28 21:58:44 +00:00
|
|
|
for (WorkArea * wa : work_areas_)
|
|
|
|
wa->updateWindowTitle();
|
2007-11-11 22:30:21 +00:00
|
|
|
}
|
|
|
|
|
2017-02-28 21:58:44 +00:00
|
|
|
|
2007-10-02 09:00:08 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|