namespace grfx -> lyx::graphics

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7239 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2003-07-04 08:23:23 +00:00
parent 961883ed6d
commit fe390e9da1
67 changed files with 226 additions and 97 deletions

View File

@ -1,3 +1,6 @@
2003-07-04 Lars Gullik Bjønnes <larsbj@gullik.net>
* introduce namespace lyx::graphics
2003-07-02 André Pönitz <poenitz@gmx.net> 2003-07-02 André Pönitz <poenitz@gmx.net>

View File

@ -110,6 +110,8 @@ using std::for_each;
using lyx::pos_type; using lyx::pos_type;
using lyx::textclass_type; using lyx::textclass_type;
namespace grfx = lyx::graphics;
// all these externs should eventually be removed. // all these externs should eventually be removed.
extern BufferList bufferlist; extern BufferList bufferlist;

View File

@ -1,3 +1,6 @@
2003-07-04 Lars Gullik Bjønnes <larsbj@gullik.net>
* introduce namespace lyx::graphics
2003-06-27 André Pönitz <poenitz@gmx.net> 2003-06-27 André Pönitz <poenitz@gmx.net>
@ -16,7 +19,7 @@
2003-06-06 Alfredo Braunstein <abraunst@libero.it> 2003-06-06 Alfredo Braunstein <abraunst@libero.it>
* Dialogs.[Ch] (visible): added. * Dialogs.[Ch] (visible): added.
2003-06-03 John Levon <levon@movementarian.org> 2003-06-03 John Levon <levon@movementarian.org>
* lyx_gui.h: add sync_events() * lyx_gui.h: add sync_events()

View File

@ -19,9 +19,12 @@
class LyXFont; class LyXFont;
namespace grfx { namespace lyx {
namespace graphics {
class Image; class Image;
} }
}
/** /**
* Painter - A painter class to encapsulate all graphics parameters and operations * Painter - A painter class to encapsulate all graphics parameters and operations
@ -132,7 +135,7 @@ public:
/// draw an image from the image cache /// draw an image from the image cache
virtual Painter & image(int x, int y, virtual Painter & image(int x, int y,
int w, int h, int w, int h,
grfx::Image const & image) = 0; lyx::graphics::Image const & image) = 0;
/// draw a string at position x, y (y is the baseline) /// draw a string at position x, y (y is the baseline)
virtual Painter & text(int x, int y, virtual Painter & text(int x, int y,

View File

@ -1,3 +1,7 @@
2003-07-04 Lars Gullik Bjønnes <larsbj@gullik.net>
* introduce namespace lyx::graphics
2003-07-03 John Levon <levon@movementarian.org> 2003-07-03 John Levon <levon@movementarian.org>
* ui/QTexinfoDialog.ui: enable View properly * ui/QTexinfoDialog.ui: enable View properly

View File

@ -33,6 +33,8 @@
using namespace lyx::support; using namespace lyx::support;
namespace grfx = lyx::graphics;
typedef QController<ControlExternal, QView<QExternalDialog> > base_class; typedef QController<ControlExternal, QView<QExternalDialog> > base_class;

View File

@ -32,7 +32,8 @@ using namespace lyx::support;
using std::find_if; using std::find_if;
using std::endl; using std::endl;
namespace grfx { namespace lyx {
namespace graphics {
/// Access to this class is through this static method. /// Access to this class is through this static method.
Image::ImagePtr QLImage::newImage() Image::ImagePtr QLImage::newImage()
@ -253,4 +254,5 @@ void QLImage::scale(Params const & params)
xformed_pixmap_ = xformed_pixmap_.xForm(m); xformed_pixmap_ = xformed_pixmap_.xForm(m);
} }
} // namespace grfx } // namespace graphics
} // lyx

View File

@ -18,7 +18,8 @@
#include <qpixmap.h> #include <qpixmap.h>
namespace grfx { namespace lyx {
namespace graphics {
class QLImage : public Image { class QLImage : public Image {
public: public:
@ -80,6 +81,7 @@ private:
QPixmap xformed_pixmap_; QPixmap xformed_pixmap_;
}; };
} // namespace grfx } // namespace graphics
} // namespace lyx
#endif // QLIMAGE_H #endif // QLIMAGE_H

View File

@ -36,6 +36,7 @@
using std::endl; using std::endl;
namespace grfx = lyx::graphics;
QLPainter::QLPainter(QWorkArea & qwa) QLPainter::QLPainter(QWorkArea & qwa)
: Painter(), owner_(qwa), paint_check_(0) : Painter(), owner_(qwa), paint_check_(0)

View File

@ -100,7 +100,7 @@ public:
/// draw an image from the image cache /// draw an image from the image cache
virtual Painter & image(int x, int y, virtual Painter & image(int x, int y,
int w, int h, int w, int h,
grfx::Image const & image); lyx::graphics::Image const & image);
/// draw a string at position x, y (y is the baseline) /// draw a string at position x, y (y is the baseline)
virtual Painter & text(int x, int y, virtual Painter & text(int x, int y,

View File

@ -63,6 +63,8 @@ using std::setfill;
using std::setw; using std::setw;
using std::endl; using std::endl;
namespace grfx = lyx::graphics;
typedef Qt2CB<ControlPrefs, Qt2DB<QPrefsDialog> > base_class; typedef Qt2CB<ControlPrefs, Qt2DB<QPrefsDialog> > base_class;

View File

@ -119,7 +119,7 @@ void parse_init(int & argc, char * argv[])
{ {
static LQApplication a(argc, argv); static LQApplication a(argc, argv);
using namespace grfx; using namespace lyx::graphics;
Image::newImage = boost::bind(&QLImage::newImage); Image::newImage = boost::bind(&QLImage::newImage);
Image::loadableFormats = boost::bind(&QLImage::loadableFormats); Image::loadableFormats = boost::bind(&QLImage::loadableFormats);

View File

@ -48,6 +48,8 @@ using std::min;
using std::max; using std::max;
using std::endl; using std::endl;
namespace grfx = lyx::graphics;
namespace { namespace {
class SplashScreen : boost::noncopyable, boost::signals::trackable { class SplashScreen : boost::noncopyable, boost::signals::trackable {

View File

@ -1,3 +1,7 @@
2003-07-04 Lars Gullik Bjønnes <larsbj@gullik.net>
* introduce namespace lyx::graphics
2003-07-01 Lars Gullik Bjønnes <larsbj@gullik.net> 2003-07-01 Lars Gullik Bjønnes <larsbj@gullik.net>
* introcude namespace lyx::support * introcude namespace lyx::support

View File

@ -32,6 +32,8 @@
using namespace lyx::support; using namespace lyx::support;
namespace grfx = lyx::graphics;
typedef FormController<ControlExternal, FormView<FD_external> > base_class; typedef FormController<ControlExternal, FormView<FD_external> > base_class;
FormExternal::FormExternal(Dialog & parent) FormExternal::FormExternal(Dialog & parent)

View File

@ -68,6 +68,8 @@ extern string user_lyxdir;
using namespace lyx::support; using namespace lyx::support;
namespace grfx = lyx::graphics;
namespace { namespace {
// These should probably go inside the class definition... // These should probably go inside the class definition...

View File

@ -35,6 +35,7 @@ using namespace lyx::support;
using std::endl; using std::endl;
using std::max; using std::max;
namespace grfx = lyx::graphics;
XPainter::XPainter(XWorkArea & xwa) XPainter::XPainter(XWorkArea & xwa)
: Painter(), owner_(xwa) : Painter(), owner_(xwa)

View File

@ -95,7 +95,7 @@ public:
/// draw an image from the image cache /// draw an image from the image cache
virtual Painter & image(int x, int y, virtual Painter & image(int x, int y,
int w, int h, int w, int h,
grfx::Image const & image); lyx::graphics::Image const & image);
/// draw a string at position x, y (y is the baseline) /// draw a string at position x, y (y is the baseline)
virtual Painter & text(int x, int y, virtual Painter & text(int x, int y,

View File

@ -172,7 +172,7 @@ void parse_init(int & argc, char * argv[])
lyxColorHandler.reset(new LyXColorHandler()); lyxColorHandler.reset(new LyXColorHandler());
using namespace grfx; using namespace lyx::graphics;
// connect the image loader based on the xforms library // connect the image loader based on the xforms library
Image::newImage = boost::bind(&xformsImage::newImage); Image::newImage = boost::bind(&xformsImage::newImage);

View File

@ -45,7 +45,8 @@ unsigned int packedcolor(LColor::color c);
} // namespace anon } // namespace anon
namespace grfx { namespace lyx {
namespace graphics {
/// Access to this class is through this static method. /// Access to this class is through this static method.
Image::ImagePtr xformsImage::newImage() Image::ImagePtr xformsImage::newImage()
@ -364,11 +365,14 @@ void xformsImage::errorCB(string const & error_message)
finishedLoading(false); finishedLoading(false);
} }
} // namespace grfx } // namespace graphics
} // namespace lyx
namespace { namespace {
namespace grfx = lyx::graphics;
extern "C" { extern "C" {
int status_report(FL_IMAGE * ob, const char *s) int status_report(FL_IMAGE * ob, const char *s)

View File

@ -24,7 +24,8 @@
struct flimage_; struct flimage_;
typedef flimage_ FL_IMAGE; typedef flimage_ FL_IMAGE;
namespace grfx { namespace lyx {
namespace graphics {
class xformsImage : public Image class xformsImage : public Image
{ {
@ -104,6 +105,7 @@ private:
PixmapStatus pixmap_status_; PixmapStatus pixmap_status_;
}; };
} // namespace grfx } // namespace graphics
} // namespace lyx
#endif // XFORMSIMAGE_H #endif // XFORMSIMAGE_H

View File

@ -1,3 +1,7 @@
2003-07-04 Lars Gullik Bjønnes <larsbj@gullik.net>
* Change namespace grfx to lyx::graphics.
2003-07-01 Lars Gullik Bjønnes <larsbj@gullik.net> 2003-07-01 Lars Gullik Bjønnes <larsbj@gullik.net>
* introcude namespace lyx::support * introcude namespace lyx::support

View File

@ -25,7 +25,8 @@
using namespace lyx::support; using namespace lyx::support;
namespace grfx { namespace lyx {
namespace graphics {
/** The cache contains one item per file, so use a map to find the /** The cache contains one item per file, so use a map to find the
* cache item quickly by filename. * cache item quickly by filename.
@ -113,4 +114,5 @@ Cache::ItemPtr const Cache::item(string const & file) const
return it->second; return it->second;
} }
} // namespace grfx } // namespace graphics
} // namespace lyx

View File

@ -26,7 +26,8 @@
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
namespace grfx { namespace lyx {
namespace graphics {
class CacheItem; class CacheItem;
@ -79,6 +80,7 @@ private:
boost::scoped_ptr<Impl> const pimpl_; boost::scoped_ptr<Impl> const pimpl_;
}; };
} // namespace grfx } // namespace graphics
} // namespace lyx
#endif // GRAPHICSCACHE_H #endif // GRAPHICSCACHE_H

View File

@ -32,7 +32,8 @@ using namespace lyx::support;
using std::endl; using std::endl;
namespace grfx { namespace lyx {
namespace graphics {
struct CacheItem::Impl : public boost::signals::trackable { struct CacheItem::Impl : public boost::signals::trackable {
@ -311,11 +312,14 @@ void CacheItem::Impl::imageLoaded(bool success)
} }
} // namespace grfx } // namespace graphics
} // namespace lyx
namespace { namespace {
namespace grfx = lyx::graphics;
string const findTargetFormat(string const & from) string const findTargetFormat(string const & from)
{ {
typedef grfx::Image::FormatList FormatList; typedef grfx::Image::FormatList FormatList;
@ -351,7 +355,8 @@ string const findTargetFormat(string const & from)
} // anon namespace } // anon namespace
namespace grfx { namespace lyx {
namespace graphics {
void CacheItem::Impl::convertToDisplayFormat() void CacheItem::Impl::convertToDisplayFormat()
{ {
@ -409,4 +414,5 @@ void CacheItem::Impl::convertToDisplayFormat()
converter_->startConversion(); converter_->startConversion();
} }
} // namespace grfx } // namespace graphics
} // namespace lyx

View File

@ -37,7 +37,8 @@
class InsetGraphics; class InsetGraphics;
namespace grfx { namespace lyx {
namespace graphics {
class Image; class Image;
class Converter; class Converter;
@ -95,6 +96,7 @@ private:
boost::scoped_ptr<Impl> const pimpl_; boost::scoped_ptr<Impl> const pimpl_;
}; };
} // namespace grfx } // namespace graphics
} // namespace lyx
#endif // GRAPHICSCACHEITEM_H #endif // GRAPHICSCACHEITEM_H

View File

@ -36,7 +36,8 @@ using namespace lyx::support;
using std::endl; using std::endl;
using std::ostream; using std::ostream;
namespace grfx { namespace lyx {
namespace graphics {
struct Converter::Impl : public boost::signals::trackable { struct Converter::Impl : public boost::signals::trackable {
/// ///
@ -108,7 +109,9 @@ string const & Converter::convertedFile() const
return pimpl_->finished_ ? pimpl_->to_file_ : empty; return pimpl_->finished_ ? pimpl_->to_file_ : empty;
} }
} // namespace grfx } // namespace graphics
} // namespace lyx
//------------------------------ //------------------------------
// Implementation details follow // Implementation details follow
@ -126,7 +129,8 @@ bool build_script(string const & from_file, string const & to_file_base,
} // namespace anon } // namespace anon
namespace grfx { namespace lyx {
namespace graphics {
Converter::Impl::Impl(string const & from_file, string const & to_file_base, Converter::Impl::Impl(string const & from_file, string const & to_file_base,
string const & from_format, string const & to_format) string const & from_format, string const & to_format)
@ -223,7 +227,8 @@ void Converter::Impl::converted(pid_t /* pid */, int retval)
} }
} }
} // namespace grfx } // namespace graphics
} // namespace lyx
namespace { namespace {

View File

@ -22,7 +22,8 @@
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include <boost/utility.hpp> #include <boost/utility.hpp>
namespace grfx { namespace lyx {
namespace graphics {
class Converter : boost::noncopyable { class Converter : boost::noncopyable {
public: public:
@ -65,6 +66,7 @@ private:
boost::scoped_ptr<Impl> const pimpl_; boost::scoped_ptr<Impl> const pimpl_;
}; };
} // namespace grfx } // namespace graphics
} // namespace lyx
#endif // GRAPHICSCONVERTER_H #endif // GRAPHICSCONVERTER_H

View File

@ -19,7 +19,8 @@
using std::endl; using std::endl;
using std::abs; using std::abs;
namespace grfx { namespace lyx {
namespace graphics {
// This is to be connected to a function that will return a new // This is to be connected to a function that will return a new
// instance of a viable derived class. // instance of a viable derived class.
@ -53,4 +54,5 @@ Image::getScaledDimensions(Params const & params) const
return std::make_pair(width, height); return std::make_pair(width, height);
} }
} // namespace grfx } // namespace graphics
} // namespace lyx

View File

@ -33,7 +33,8 @@
#include <vector> #include <vector>
#include <utility> #include <utility>
namespace grfx { namespace lyx {
namespace graphics {
class Params; class Params;
@ -107,6 +108,7 @@ protected:
getScaledDimensions(Params const & params) const; getScaledDimensions(Params const & params) const;
}; };
} // namespace grfx } // namespace graphics
} // namespace lyx
#endif // GRAPHICSIMAGE_H #endif // GRAPHICSIMAGE_H

View File

@ -25,7 +25,8 @@
#include <list> #include <list>
namespace grfx { namespace lyx {
namespace graphics {
struct Loader::Impl : boost::signals::trackable { struct Loader::Impl : boost::signals::trackable {
/// ///
@ -296,4 +297,5 @@ void Loader::Impl::startLoading()
} }
} // namespace grfx } // namespace graphics
} // namespace lyx

View File

@ -32,7 +32,8 @@
class Inset; class Inset;
namespace grfx { namespace lyx {
namespace graphics {
class Image; class Image;
class Params; class Params;
@ -106,6 +107,7 @@ private:
boost::scoped_ptr<Impl> const pimpl_; boost::scoped_ptr<Impl> const pimpl_;
}; };
} // namespace grfx } // namespace graphics
} // namespace lyx
#endif // GRAPHICSLOADER_H #endif // GRAPHICSLOADER_H

View File

@ -18,7 +18,8 @@
using std::abs; using std::abs;
namespace grfx { namespace lyx {
namespace graphics {
Params::Params() Params::Params()
: display(ColorDisplay), : display(ColorDisplay),
@ -95,4 +96,5 @@ bool operator!=(BoundingBox const & a, BoundingBox const & b)
return !(a == b); return !(a == b);
} }
} // namespace grfx } // namespace graphics
} // namespace lyx

View File

@ -18,7 +18,8 @@
#include "LString.h" #include "LString.h"
namespace grfx { namespace lyx {
namespace graphics {
/** Parse a string of the form "200pt 500pt 300mm 5in" into a /** Parse a string of the form "200pt 500pt 300mm 5in" into a
* usable bounding box. * usable bounding box.
@ -67,6 +68,7 @@ struct Params
bool operator==(Params const &, Params const &); bool operator==(Params const &, Params const &);
bool operator!=(Params const &, Params const &); bool operator!=(Params const &, Params const &);
} // namespace grfx } // namespace graphics
} // namespace lyx
#endif // GRAPHICSPARAMS_H #endif // GRAPHICSPARAMS_H

View File

@ -14,7 +14,8 @@
#include "graphics/GraphicsTypes.h" #include "graphics/GraphicsTypes.h"
namespace grfx { namespace lyx {
namespace graphics {
/// The translator between the Display enum and corresponding lyx string. /// The translator between the Display enum and corresponding lyx string.
Translator<DisplayType, string> displayTranslator(DefaultDisplay, "default"); Translator<DisplayType, string> displayTranslator(DefaultDisplay, "default");
@ -41,4 +42,5 @@ void setDisplayTranslator()
} }
} }
} // namespace grfx } // namespace graphics
} // namespace lyx

View File

@ -18,7 +18,8 @@
#include "LString.h" #include "LString.h"
#include "support/translator.h" #include "support/translator.h"
namespace grfx { namespace lyx {
namespace graphics {
/// The status of the loading process /// The status of the loading process
enum ImageStatus { enum ImageStatus {
@ -68,6 +69,7 @@ extern Translator<DisplayType, string> displayTranslator;
/// ///
void setDisplayTranslator(); void setDisplayTranslator();
} // namespace grfx } // namespace graphics
} // namespace lyx
#endif // GRAPHICSTYPES_H #endif // GRAPHICSTYPES_H

View File

@ -19,8 +19,8 @@
using std::endl; using std::endl;
using std::list; using std::list;
namespace lyx {
namespace grfx { namespace graphics {
int LoaderQueue::s_numimages_ = 5; int LoaderQueue::s_numimages_ = 5;
int LoaderQueue::s_millisecs_ = 500; int LoaderQueue::s_millisecs_ = 500;
@ -113,4 +113,5 @@ void LoaderQueue::touch(Cache::ItemPtr const & item)
} }
} // namespace grfx } // namespace graphics
} // namespace lyx

View File

@ -29,7 +29,8 @@
#include <set> #include <set>
#include <queue> #include <queue>
namespace grfx { namespace lyx {
namespace graphics {
class LoaderQueue { class LoaderQueue {
public: public:
@ -74,6 +75,7 @@ private:
void stopLoader(); void stopLoader();
}; };
} // namespace grfx } // namespace graphics
} // namespace lyx
#endif // LOADERQUEUE_H #endif // LOADERQUEUE_H

View File

@ -22,7 +22,8 @@
using namespace lyx::support; using namespace lyx::support;
namespace grfx { namespace lyx {
namespace graphics {
struct PreviewImage::Impl : public boost::signals::trackable { struct PreviewImage::Impl : public boost::signals::trackable {
/// ///
@ -152,4 +153,5 @@ void PreviewImage::Impl::statusChanged()
} }
} }
} // namespace grfx } // namespace graphics
} // namespace lyx

View File

@ -17,7 +17,8 @@
class Inset; class Inset;
namespace grfx { namespace lyx {
namespace graphics {
class PreviewLoader; class PreviewLoader;
class Image; class Image;
@ -55,6 +56,7 @@ private:
boost::scoped_ptr<Impl> const pimpl_; boost::scoped_ptr<Impl> const pimpl_;
}; };
} // namespace grfx } // namespace graphics
} // namespace lyx
#endif // PREVIEWIMAGE_H #endif // PREVIEWIMAGE_H

View File

@ -117,7 +117,8 @@ typedef InProgressProcesses::value_type InProgressProcess;
} // namespace anon } // namespace anon
namespace grfx { namespace lyx {
namespace graphics {
struct PreviewLoader::Impl : public boost::signals::trackable { struct PreviewLoader::Impl : public boost::signals::trackable {
/// ///
@ -241,7 +242,8 @@ Buffer const & PreviewLoader::buffer() const
return pimpl_->buffer(); return pimpl_->buffer();
} }
} // namespace grfx } // namespace graphics
} // namespace lyx
// The details of the Impl // The details of the Impl
@ -306,7 +308,8 @@ void InProgress::stop() const
} // namespace anon } // namespace anon
namespace grfx { namespace lyx {
namespace graphics {
PreviewLoader::Impl::Impl(PreviewLoader & p, Buffer const & b) PreviewLoader::Impl::Impl(PreviewLoader & p, Buffer const & b)
: parent_(p), buffer_(b), font_scaling_factor_(0.0) : parent_(p), buffer_(b), font_scaling_factor_(0.0)
@ -637,8 +640,8 @@ void PreviewLoader::Impl::dumpData(ostream & os,
} }
} }
} // namespace grfx } // namespace graphics
} // namespace lyx
namespace { namespace {

View File

@ -25,7 +25,8 @@
class Buffer; class Buffer;
namespace grfx { namespace lyx {
namespace graphics {
class PreviewImage; class PreviewImage;
@ -92,6 +93,7 @@ private:
boost::scoped_ptr<Impl> const pimpl_; boost::scoped_ptr<Impl> const pimpl_;
}; };
} // namespace grfx } // namespace graphics
} // namespace lyx
#endif // PREVIEWLOADER_H #endif // PREVIEWLOADER_H

View File

@ -30,7 +30,8 @@
using namespace lyx::support; using namespace lyx::support;
namespace grfx { namespace lyx {
namespace graphics {
bool PreviewedInset::activated() bool PreviewedInset::activated()
{ {
@ -50,15 +51,15 @@ void PreviewedInset::generatePreview()
!view() || !view()->buffer()) !view() || !view()->buffer())
return; return;
grfx::Previews & previews = grfx::Previews::get(); Previews & previews = Previews::get();
grfx::PreviewLoader & loader = previews.loader(view()->buffer()); PreviewLoader & loader = previews.loader(view()->buffer());
addPreview(loader); addPreview(loader);
if (!snippet_.empty()) if (!snippet_.empty())
loader.startLoading(); loader.startLoading();
} }
void PreviewedInset::addPreview(grfx::PreviewLoader & ploader) void PreviewedInset::addPreview(PreviewLoader & ploader)
{ {
if (!Previews::activated() || !previewWanted()) if (!Previews::activated() || !previewWanted())
return; return;
@ -88,8 +89,8 @@ void PreviewedInset::removePreview()
if (!view() || !view()->buffer() || snippet_.empty()) if (!view() || !view()->buffer() || snippet_.empty())
return; return;
grfx::Previews & previews = grfx::Previews::get(); Previews & previews = Previews::get();
grfx::PreviewLoader & loader = previews.loader(view()->buffer()); PreviewLoader & loader = previews.loader(view()->buffer());
loader.remove(snippet_); loader.remove(snippet_);
snippet_.erase(); snippet_.erase();
pimage_ = 0; pimage_ = 0;
@ -103,8 +104,8 @@ bool PreviewedInset::previewReady() const
return false; return false;
if (!pimage_ || snippet_ != pimage_->snippet()) { if (!pimage_ || snippet_ != pimage_->snippet()) {
grfx::PreviewLoader & ploader = PreviewLoader & ploader =
grfx::Previews::get().loader(view()->buffer()); Previews::get().loader(view()->buffer());
pimage_ = ploader.preview(snippet_); pimage_ = ploader.preview(snippet_);
} }
@ -115,7 +116,7 @@ bool PreviewedInset::previewReady() const
} }
void PreviewedInset::imageReady(grfx::PreviewImage const & pimage) const void PreviewedInset::imageReady(PreviewImage const & pimage) const
{ {
// Check snippet against the Inset's current contents // Check snippet against the Inset's current contents
if (snippet_ != pimage.snippet()) if (snippet_ != pimage.snippet())
@ -127,4 +128,5 @@ void PreviewedInset::imageReady(grfx::PreviewImage const & pimage) const
view()->updateInset(&inset_); view()->updateInset(&inset_);
} }
} // namespace grfx } // namespace graphics
} // namespace lyx

View File

@ -23,7 +23,8 @@
class Inset; class Inset;
class BufferView; class BufferView;
namespace grfx { namespace lyx {
namespace graphics {
class PreviewImage; class PreviewImage;
class PreviewLoader; class PreviewLoader;
@ -87,7 +88,7 @@ private:
boost::signals::connection connection_; boost::signals::connection connection_;
}; };
} // namespace grfx } // namespace graphics
} // namespace lyx
#endif // PREVIEWEDINSET_H #endif // PREVIEWEDINSET_H

View File

@ -22,9 +22,11 @@
#include <map> #include <map>
namespace lyx {
using namespace lyx::support; using namespace lyx::support;
namespace grfx { namespace graphics {
bool Previews::activated() bool Previews::activated()
{ {
@ -99,4 +101,5 @@ void Previews::generateBufferPreviews(Buffer const & buffer) const
ploader.startLoading(); ploader.startLoading();
} }
} // namespace grfx } // namespace graphics
} // namespace lyx

View File

@ -21,7 +21,8 @@
class Buffer; class Buffer;
namespace grfx { namespace lyx {
namespace graphics {
class PreviewLoader; class PreviewLoader;
@ -66,6 +67,7 @@ private:
boost::scoped_ptr<Impl> const pimpl_; boost::scoped_ptr<Impl> const pimpl_;
}; };
} // namespace grfx } // namespace graphics
} // namespace lyx
#endif // PREVIEWS_H #endif // PREVIEWS_H

View File

@ -1,3 +1,7 @@
2003-07-04 Lars Gullik Bjønnes <larsbj@gullik.net>
* introduce namespace lyx::graphics
2003-07-01 Lars Gullik Bjønnes <larsbj@gullik.net> 2003-07-01 Lars Gullik Bjønnes <larsbj@gullik.net>
* introduce namespace lyx::support * introduce namespace lyx::support

View File

@ -34,9 +34,11 @@ class WordLangTuple;
class ParagraphList; class ParagraphList;
class UpdatableInset; class UpdatableInset;
namespace grfx { namespace lyx {
namespace graphics {
class PreviewLoader; class PreviewLoader;
} }
}
/// Insets /// Insets
class Inset : public InsetBase { class Inset : public InsetBase {
@ -311,7 +313,7 @@ public:
* Most insets have no interest in this capability, so the method * Most insets have no interest in this capability, so the method
* defaults to empty. * defaults to empty.
*/ */
virtual void addPreview(grfx::PreviewLoader &) const {} virtual void addPreview(lyx::graphics::PreviewLoader &) const {}
/** Find the PreviewLoader, add a LaTeX snippet to it and /** Find the PreviewLoader, add a LaTeX snippet to it and
* start the loading process. * start the loading process.

View File

@ -41,6 +41,7 @@ using std::ostream;
using std::endl; using std::endl;
using std::max; using std::max;
namespace grfx = lyx::graphics;
InsetCollapsable::InsetCollapsable(BufferParams const & bp, bool collapsed) InsetCollapsable::InsetCollapsable(BufferParams const & bp, bool collapsed)
: UpdatableInset(), collapsed_(collapsed), inset(bp), : UpdatableInset(), collapsed_(collapsed), inset(bp),

View File

@ -167,7 +167,7 @@ public:
bool = true, bool = false); bool = true, bool = false);
/// ///
void addPreview(grfx::PreviewLoader &) const; void addPreview(lyx::graphics::PreviewLoader &) const;
protected: protected:
/// ///

View File

@ -49,6 +49,7 @@ using namespace lyx::support;
using std::ostream; using std::ostream;
using std::endl; using std::endl;
namespace grfx = lyx::graphics;
namespace { namespace {

View File

@ -36,7 +36,7 @@ public:
/// The name of the tempfile used for manipulations. /// The name of the tempfile used for manipulations.
string tempname; string tempname;
/// how the inset is displayed by LyX /// how the inset is displayed by LyX
grfx::DisplayType display; lyx::graphics::DisplayType display;
/// The scale of the displayed graphic (If shown). /// The scale of the displayed graphic (If shown).
unsigned int lyxscale; unsigned int lyxscale;
}; };

View File

@ -18,11 +18,16 @@
#include "LString.h" #include "LString.h"
#include "lyxlength.h" #include "lyxlength.h"
namespace grfx = lyx::graphics;
class LyXLex; class LyXLex;
namespace grfx { namespace lyx {
namespace graphics {
class Params; class Params;
} }
}
/// This struct holds all the parameters needed by insetGraphics. /// This struct holds all the parameters needed by insetGraphics.
struct InsetGraphicsParams struct InsetGraphicsParams

View File

@ -50,6 +50,8 @@ using std::endl;
using std::vector; using std::vector;
using std::pair; using std::pair;
namespace grfx = lyx::graphics;
extern BufferList bufferlist; extern BufferList bufferlist;

View File

@ -109,7 +109,7 @@ public:
bool loadIfNeeded() const; bool loadIfNeeded() const;
/// ///
void addPreview(grfx::PreviewLoader &) const; void addPreview(lyx::graphics::PreviewLoader &) const;
private: private:
/// get the text displayed on the button /// get the text displayed on the button

View File

@ -59,6 +59,8 @@ using std::endl;
using std::swap; using std::swap;
using std::max; using std::max;
namespace grfx = lyx::graphics;
namespace { namespace {
int const ADD_TO_HEIGHT = 2; int const ADD_TO_HEIGHT = 2;

View File

@ -211,7 +211,7 @@ public:
bool forceDefaultParagraphs(Inset const * in) const; bool forceDefaultParagraphs(Inset const * in) const;
/// ///
void addPreview(grfx::PreviewLoader &) const; void addPreview(lyx::graphics::PreviewLoader &) const;
// //
// Public structures and variables // Public structures and variables

View File

@ -76,6 +76,7 @@ using namespace lyx::support;
using lyx::pos_type; using lyx::pos_type;
using lyx::textclass_type; using lyx::textclass_type;
namespace grfx = lyx::graphics;
// These functions should probably go into bufferview_funcs somehow (Jug) // These functions should probably go into bufferview_funcs somehow (Jug)

View File

@ -230,7 +230,7 @@ public:
void appendParagraphs(Buffer * bp, ParagraphList &); void appendParagraphs(Buffer * bp, ParagraphList &);
/// ///
void addPreview(grfx::PreviewLoader &) const; void addPreview(lyx::graphics::PreviewLoader &) const;
// //
// Public structures and variables // Public structures and variables

View File

@ -28,6 +28,8 @@
using namespace lyx::support; using namespace lyx::support;
namespace grfx = lyx::graphics;
RenderInset::RenderInset() RenderInset::RenderInset()
{} {}

View File

@ -27,7 +27,7 @@ class MetricsInfo;
class PainterInfo; class PainterInfo;
class RenderInset class RenderInset
{ {
public: public:
virtual ~RenderInset(); virtual ~RenderInset();
@ -62,7 +62,7 @@ public:
/// This should provide the text for the button /// This should provide the text for the button
void update(string const &, bool editable); void update(string const &, bool editable);
/// compute the size of the object returned in dim /// compute the size of the object returned in dim
virtual void metrics(MetricsInfo & mi, Dimension & dim) const; virtual void metrics(MetricsInfo & mi, Dimension & dim) const;
/// draw inset and update (xo, yo)-cache /// draw inset and update (xo, yo)-cache
@ -84,7 +84,7 @@ public:
virtual RenderInset * clone() const; virtual RenderInset * clone() const;
/// Refresh the info about which file to display and how to display it. /// Refresh the info about which file to display and how to display it.
void update(grfx::Params const & params); void update(lyx::graphics::Params const & params);
/// compute the size of the object returned in dim /// compute the size of the object returned in dim
virtual void metrics(MetricsInfo & mi, Dimension & dim) const; virtual void metrics(MetricsInfo & mi, Dimension & dim) const;
@ -109,10 +109,10 @@ private:
/// Is the image ready to draw, or should we display a message instead? /// Is the image ready to draw, or should we display a message instead?
bool readyToDisplay() const; bool readyToDisplay() const;
/// The stored data. /// The stored data.
grfx::Loader loader_; lyx::graphics::Loader loader_;
grfx::Params params_; lyx::graphics::Params params_;
/// Cached variable (not copied). /// Cached variable (not copied).
mutable unsigned long checksum_; mutable unsigned long checksum_;

View File

@ -3,7 +3,7 @@
* Copyright 1995-2002 the LyX Team * Copyright 1995-2002 the LyX Team
* Read the file COPYING * Read the file COPYING
* *
* \author unknown * \author Lars Gullik Bjønnes
*/ */
#include <config.h> #include <config.h>
@ -59,6 +59,8 @@ using std::signal;
using std::system; using std::system;
#endif #endif
namespace grfx = lyx::graphics;
extern void LoadLyXFile(string const &); extern void LoadLyXFile(string const &);
extern void QuitLyX(); extern void QuitLyX();

View File

@ -40,6 +40,8 @@ using std::ios;
using std::endl; using std::endl;
using std::vector; using std::vector;
namespace grfx = lyx::graphics;
class kb_keymap; class kb_keymap;
extern boost::scoped_ptr<kb_keymap> toplevel_keymap; extern boost::scoped_ptr<kb_keymap> toplevel_keymap;

View File

@ -337,7 +337,7 @@ enum LyXRCTags {
/// ///
int label_init_length; int label_init_length;
/// ///
grfx::DisplayType display_graphics; lyx::graphics::DisplayType display_graphics;
/// ///
bool show_banner; bool show_banner;
/// ///

View File

@ -1,3 +1,7 @@
2003-07-04 Lars Gullik Bjønnes <larsbj@gullik.net>
* introduce namespace lyx::graphics
2003-07-01 Lars Gullik Bjønnes <larsbj@gullik.net> 2003-07-01 Lars Gullik Bjønnes <larsbj@gullik.net>
* introduce namespace lyx::support * introduce namespace lyx::support

View File

@ -52,6 +52,7 @@
using std::ostream; using std::ostream;
using std::vector; using std::vector;
namespace grfx = lyx::graphics;
class InsetFormula::PreviewImpl : public grfx::PreviewedInset { class InsetFormula::PreviewImpl : public grfx::PreviewedInset {
public: public:

View File

@ -70,7 +70,7 @@ public:
/// ///
void generatePreview() const; void generatePreview() const;
/// ///
void addPreview(grfx::PreviewLoader &) const; void addPreview(lyx::graphics::PreviewLoader &) const;
/// ///
void mutate(string const & type); void mutate(string const & type);