+2003-09-04 Angus Leeming <leeming@lyx.org>
+
+ * GraphicsCache.C:
+ * GraphicsCacheItem.C:
+ * GraphicsConverter.C:
+ * PreviewImage.C:
+ * PreviewLoader.C:
+ * PreviewedInset.C:
+ * Previews.C: 'namespace support = lyx::support' rather than
+ 'using lyx::support'.
+
+ * Previews.h: cleaned up some comments.
+
2003-07-26 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* GraphicsTypes.h: do not declare displayTranstor here (and remove
#include <map>
-using namespace lyx::support;
+namespace support = lyx::support;
namespace lyx {
namespace graphics {
void Cache::add(string const & file) const
{
- if (!AbsolutePath(file)) {
+ if (!support::AbsolutePath(file)) {
lyxerr << "Cache::add(" << file << "):\n"
<< "The file must be have an absolute path."
<< std::endl;
#include <boost/bind.hpp>
#include <boost/signals/trackable.hpp>
-using namespace lyx::support;
+namespace support = lyx::support;
+
+using support::Assert;
+using support::ChangeExtension;
+using support::FileMonitor;
+using support::IsFileReadable;
+using support::MakeDisplayPath;
+using support::OnlyFilename;
+using support::getExtFromContents;
+using support::tempName;
+using support::unlink;
+using support::unzipFile;
+using support::zippedFile;
using std::endl;
#include <fstream>
#include <sys/types.h> // needed for pid_t
-using namespace lyx::support;
+namespace support = lyx::support;
+
+using support::ChangeExtension;
+using support::Forkedcall;
+using support::ForkedCallQueue;
+using support::LibFileSearch;
+using support::LibScriptSearch;
+using support::OnlyPath;
+using support::OnlyFilename;
+using support::QuoteName;
+using support::subst;
+using support::tempName;
+using support::unlink;
using std::endl;
using std::ostream;
#include <boost/bind.hpp>
#include <boost/signals/trackable.hpp>
-using namespace lyx::support;
+namespace support = lyx::support;
+
namespace lyx {
namespace graphics {
PreviewImage::Impl::~Impl()
{
- unlink(iloader_.filename());
+ support::unlink(iloader_.filename());
}
break;
case Ready:
- unlink(iloader_.filename());
+ support::unlink(iloader_.filename());
ploader_.emitSignal(parent_);
break;
}
#include <utility>
#include <vector>
-using namespace lyx::support;
+namespace support = lyx::support;
+
using std::endl;
using std::find;
void InProgress::stop() const
{
if (pid)
- ForkedcallsController::get().kill(pid, 0);
+ support::ForkedcallsController::get().kill(pid, 0);
if (!metrics_file.empty())
- unlink(metrics_file);
+ support::unlink(metrics_file);
BitmapFile::const_iterator vit = snippets.begin();
BitmapFile::const_iterator vend = snippets.end();
for (; vit != vend; ++vit) {
if (!vit->second.empty())
- unlink(vit->second);
+ support::unlink(vit->second);
}
}
if (!pconverter_ || status(latex_snippet) != NotFound)
return;
- string const snippet = trim(latex_snippet);
+ string const snippet = support::trim(latex_snippet);
if (snippet.empty())
return;
cs << pconverter_->command << ' ' << latexfile << ' '
<< int(font_scaling_factor_) << ' ' << pconverter_->to;
- string const command = "sh " + LibScriptSearch(STRCONV(cs.str()));
+ string const command = "sh " + support::LibScriptSearch(STRCONV(cs.str()));
// Initiate the conversion from LaTeX to bitmap images files.
- Forkedcall::SignalTypePtr convert_ptr(new Forkedcall::SignalType);
+ support::Forkedcall::SignalTypePtr
+ convert_ptr(new support::Forkedcall::SignalType);
convert_ptr->connect(
boost::bind(&Impl::finishedGenerating, this, _1, _2));
- Forkedcall call;
+ support::Forkedcall call;
int ret = call.startscript(command, convert_ptr);
if (ret != 0) {
{
static int theCounter = 0;
string const filename = tostr(theCounter++) + "lyxpreview";
- return AddName(bufferpath, filename);
+ return support::AddName(bufferpath, filename);
}
double const a = ascent + tp_ascent;
double const d = descent - tp_descent;
- if (!float_equal(a + d, 0, 0.1))
+ if (!support::float_equal(a + d, 0, 0.1))
*it = a / (a + d);
if (++it == end)
#include <boost/bind.hpp>
-#include "debug.h" // temporary
+namespace support = lyx::support;
-using namespace lyx::support;
namespace lyx {
namespace graphics {
if (!Previews::activated() || !previewWanted())
return;
- snippet_ = trim(latexString());
+ snippet_ = support::trim(latexString());
if (snippet_.empty())
return;
#include <map>
-namespace lyx {
+namespace support = lyx::support;
-using namespace lyx::support;
+namespace lyx {
namespace graphics {
bool Previews::activated()
/** Returns the PreviewLoader for this buffer.
* Used by individual insets to update their own preview.
- * We assert that (buffer != 0) but do not pass a Buffer &
- * so that insets do not need to #include buffer.h
*/
PreviewLoader & loader(Buffer const & buffer) const;
- /** Called from the Buffer d-tor.
- * If (buffer == 0), does nothing.
- */
+ /// Called from the Buffer d-tor.
void removeLoader(Buffer const & buffer) const;
/** For a particular buffer, initiate the generation of previews
- * for each and every snippetof LaTeX that's of interest with
+ * for each and every snippet of LaTeX that's of interest with
* a single forked process.
- * If (buffer == 0), does nothing.
*/
void generateBufferPreviews(Buffer const & buffer) const;
* are instantiated.
*/
Previews();
- ///
~Previews();
/// Use the Pimpl idiom to hide the internals.