X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2FTimeout.C;h=7ef659b3d9482d6e2c5411cb61639e41791b0ff7;hb=31334d39348282d4586eb82b9bb5e91f03018542;hp=114d88aa3fd765eba52e0ca82a0c459e9a26ff54;hpb=d0a3af12d9ae8b208f7a70099db29632ad8a7dba;p=lyx.git diff --git a/src/frontends/Timeout.C b/src/frontends/Timeout.C index 114d88aa3f..7ef659b3d9 100644 --- a/src/frontends/Timeout.C +++ b/src/frontends/Timeout.C @@ -1,34 +1,25 @@ /** - * \file Timeout.C - * Copyright 2001 LyX Team - * Read COPYING + * \file Timeout.cpp + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. * * \author Lars Gullik Bjønnes * \author John Levon + * + * Full author contact details are available in file CREDITS. */ -#ifdef __GNUG__ -#pragma implementation -#endif #include #include "Timeout.h" -#include "debug.h" - -#include "Timeout_pimpl.h" -Timeout::Timeout(unsigned int msec, Type t) - : type(t), timeout_ms(msec) -{ - pimpl_ = new Pimpl(this); -} +namespace lyx { Timeout::~Timeout() { pimpl_->stop(); - delete pimpl_; } @@ -43,25 +34,29 @@ void Timeout::start() pimpl_->start(); } + void Timeout::stop() { pimpl_->stop(); } + void Timeout::restart() { pimpl_->stop(); pimpl_->start(); } + void Timeout::emit() { pimpl_->reset(); - timeout.emit(); + timeout(); if (type == CONTINUOUS) pimpl_->start(); } + Timeout & Timeout::setType(Type t) { type = t; @@ -71,6 +66,12 @@ Timeout & Timeout::setType(Type t) Timeout & Timeout::setTimeout(unsigned int msec) { + // Can't have a timeout of zero! + BOOST_ASSERT(msec); + timeout_ms = msec; return * this; } + + +} // namespace lyx