Finish the migration from namespace grfx to lyx::graphics.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7334 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-07-21 21:30:57 +00:00
parent 5076f1cdd1
commit 0d4d71dfe6
41 changed files with 225 additions and 187 deletions

View File

@ -326,8 +326,8 @@ void BufferView::Pimpl::buffer(Buffer * b)
owner_->setLayout(layoutname);
}
if (grfx::Previews::activated() && buffer_)
grfx::Previews::get().generateBufferPreviews(*buffer_);
if (lyx::graphics::Previews::activated() && buffer_)
lyx::graphics::Previews::get().generateBufferPreviews(*buffer_);
}

View File

@ -1,3 +1,11 @@
2003-07-21 Angus Leeming <leeming@lyx.org>
* BufferView_pimpl.C (buffer):
* buffer.C (d-tor):
* lyx_main.C (LyX):
* lyxfunc.C (dispatch):
* lyxrc.C (setDefaults, read, output): use namespace lyx::graphics
rather than the grfx shortcut.
2003-07-21 André Pönitz <poenitz@gmx.net>

View File

@ -109,8 +109,6 @@ using std::for_each;
using lyx::pos_type;
using lyx::textclass_type;
namespace grfx = lyx::graphics;
// all these externs should eventually be removed.
extern BufferList bufferlist;
@ -155,7 +153,7 @@ Buffer::~Buffer()
paragraphs.clear();
// Remove any previewed LaTeX snippets assocoated with this buffer.
grfx::Previews::get().removeLoader(this);
lyx::graphics::Previews::get().removeLoader(this);
}

View File

@ -1,3 +1,7 @@
2003-07-21 Angus Leeming <leeming@lyx.org>
* screen.C (c-tor, greyOut): use namespace lyx::graphics
rather than the grfx shortcut.
2003-07-15 André Pönitz <poenitz@gmx.net>

View File

@ -1,3 +1,7 @@
2003-07-21 Angus Leeming <leeming@lyx.org>
* ControlGraphics.C (readBB): use namespace lyx::graphics rather than grfx shortcut.
2003-07-18 Lars Gullik Bjønnes <larsbj@gullik.net>
* ControlGraphics.C (dispatchParams): avoid some variable/function

View File

@ -110,9 +110,9 @@ string const ControlGraphics::readBB(string const & file)
int width = 0;
int height = 0;
grfx::Cache & gc = grfx::Cache::get();
lyx::graphics::Cache & gc = lyx::graphics::Cache::get();
if (gc.inCache(abs_file)) {
grfx::Image const * image = gc.item(abs_file)->image();
lyx::graphics::Image const * image = gc.item(abs_file)->image();
if (image) {
width = image->getWidth();

View File

@ -1,3 +1,8 @@
2003-07-21 Angus Leeming <leeming@lyx.org>
* lyx_gui.C (reset): use namespace lyx::graphics rather than grfx
shortcut.
2003-06-28 Lars Gullik Bjønnes <larsbj@gullik.net>
* FileDialog.C: fix const type order

View File

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

View File

@ -1,3 +1,11 @@
2003-07-21 Angus Leeming <leeming@lyx.org>
* QExternal.C (update_contents, apply):
* QGraphics.C (update_contents, apply):
* QLPainter.C (image):
* QPrefs.C (update_contents, apply): use namespace lyx::graphics rather
than grfx shortcut.
2003-07-21 Juergen Spitzmueller <j.spitzmueller@gmx.de>
* QBibTeXDialog.C:

View File

@ -33,7 +33,6 @@
using namespace lyx::support;
namespace grfx = lyx::graphics;
typedef QController<ControlExternal, QView<QExternalDialog> > base_class;
@ -75,17 +74,17 @@ void QExternal::update_contents()
int item = 0;
switch (params.display) {
case grfx::DefaultDisplay: item = 0; break;
case grfx::MonochromeDisplay: item = 1; break;
case grfx::GrayscaleDisplay: item = 2; break;
case grfx::ColorDisplay: item = 3; break;
case grfx::NoDisplay: item = 0; break;
case lyx::graphics::DefaultDisplay: item = 0; break;
case lyx::graphics::MonochromeDisplay: item = 1; break;
case lyx::graphics::GrayscaleDisplay: item = 2; break;
case lyx::graphics::ColorDisplay: item = 3; break;
case lyx::graphics::NoDisplay: item = 0; break;
}
dialog_->showCB->setCurrentItem(item);
dialog_->showCB->setEnabled(params.display != grfx::NoDisplay &&
dialog_->showCB->setEnabled(params.display != lyx::graphics::NoDisplay &&
!readOnly());
dialog_->displayCB->setChecked(params.display != grfx::NoDisplay);
dialog_->displayscale->setEnabled(params.display != grfx::NoDisplay &&
dialog_->displayCB->setChecked(params.display != lyx::graphics::NoDisplay);
dialog_->displayscale->setEnabled(params.display != lyx::graphics::NoDisplay &&
!readOnly());
dialog_->displayscale->setText(toqstr(tostr(params.lyxscale)));
@ -111,15 +110,15 @@ void QExternal::apply()
controller().getTemplate(dialog_->externalCO->currentItem()).lyxName;
switch (dialog_->showCB->currentItem()) {
case 0: params.display = grfx::DefaultDisplay; break;
case 1: params.display = grfx::MonochromeDisplay; break;
case 2: params.display = grfx::GrayscaleDisplay; break;
case 3: params.display = grfx::ColorDisplay; break;
case 0: params.display = lyx::graphics::DefaultDisplay; break;
case 1: params.display = lyx::graphics::MonochromeDisplay; break;
case 2: params.display = lyx::graphics::GrayscaleDisplay; break;
case 3: params.display = lyx::graphics::ColorDisplay; break;
default:;
}
if (!dialog_->displayCB->isChecked())
params.display = grfx::NoDisplay;
params.display = lyx::graphics::NoDisplay;
params.lyxscale = strToInt(fromqstr(dialog_->displayscale->text()));

View File

@ -223,16 +223,16 @@ void QGraphics::update_contents()
int item = 0;
switch (igp.display) {
case grfx::DefaultDisplay: item = 0; break;
case grfx::MonochromeDisplay: item = 1; break;
case grfx::GrayscaleDisplay: item = 2; break;
case grfx::ColorDisplay: item = 3; break;
case grfx::NoDisplay: item = 0; break;
case lyx::graphics::DefaultDisplay: item = 0; break;
case lyx::graphics::MonochromeDisplay: item = 1; break;
case lyx::graphics::GrayscaleDisplay: item = 2; break;
case lyx::graphics::ColorDisplay: item = 3; break;
case lyx::graphics::NoDisplay: item = 0; break;
}
dialog_->showCB->setCurrentItem(item);
dialog_->showCB->setEnabled(igp.display != grfx::NoDisplay && !readOnly());
dialog_->displayCB->setChecked(igp.display != grfx::NoDisplay);
dialog_->displayscale->setEnabled(igp.display != grfx::NoDisplay && !readOnly());
dialog_->showCB->setEnabled(igp.display != lyx::graphics::NoDisplay && !readOnly());
dialog_->displayCB->setChecked(igp.display != lyx::graphics::NoDisplay);
dialog_->displayscale->setEnabled(igp.display != lyx::graphics::NoDisplay && !readOnly());
dialog_->displayscale->setText(toqstr(tostr(igp.lyxscale)));
//// the output section (width/height)
@ -339,15 +339,15 @@ void QGraphics::apply()
igp.subcaptionText = fromqstr(dialog_->subcaption->text());
switch (dialog_->showCB->currentItem()) {
case 0: igp.display = grfx::DefaultDisplay; break;
case 1: igp.display = grfx::MonochromeDisplay; break;
case 2: igp.display = grfx::GrayscaleDisplay; break;
case 3: igp.display = grfx::ColorDisplay; break;
case 0: igp.display = lyx::graphics::DefaultDisplay; break;
case 1: igp.display = lyx::graphics::MonochromeDisplay; break;
case 2: igp.display = lyx::graphics::GrayscaleDisplay; break;
case 3: igp.display = lyx::graphics::ColorDisplay; break;
default:;
}
if (!dialog_->displayCB->isChecked())
igp.display = grfx::NoDisplay;
igp.display = lyx::graphics::NoDisplay;
string value(fromqstr(dialog_->width->text()));
if (dialog_->widthUnit->currentItem() > 0) {

View File

@ -36,7 +36,6 @@
using std::endl;
namespace grfx = lyx::graphics;
QLPainter::QLPainter(QWorkArea & qwa)
: Painter(), owner_(qwa), paint_check_(0)
@ -190,9 +189,9 @@ Painter & QLPainter::arc(int x, int y,
Painter & QLPainter::image(int x, int y,
int w, int h,
grfx::Image const & i)
lyx::graphics::Image const & i)
{
qp_->drawPixmap(x, y, static_cast<grfx::QLImage const &>(i).qpixmap(), 0, 0, w, h);
qp_->drawPixmap(x, y, static_cast<lyx::graphics::QLImage const &>(i).qpixmap(), 0, 0, w, h);
return *this;
}

View File

@ -63,7 +63,6 @@ using std::setfill;
using std::setw;
using std::endl;
namespace grfx = lyx::graphics;
typedef Qt2CB<ControlPrefs, Qt2DB<QPrefsDialog> > base_class;
@ -172,13 +171,13 @@ void QPrefs::apply()
rc.preview = displaymod->previewCB->isChecked();
grfx::DisplayType dtype(grfx::ColorDisplay);
lyx::graphics::DisplayType dtype(lyx::graphics::ColorDisplay);
switch (displaymod->displayGraphicsCO->currentItem()) {
case 3: dtype = grfx::NoDisplay; break;
case 2: dtype = grfx::ColorDisplay; break;
case 1: dtype = grfx::GrayscaleDisplay; break;
case 0: dtype = grfx::MonochromeDisplay; break;
case 3: dtype = lyx::graphics::NoDisplay; break;
case 2: dtype = lyx::graphics::ColorDisplay; break;
case 1: dtype = lyx::graphics::GrayscaleDisplay; break;
case 0: dtype = lyx::graphics::MonochromeDisplay; break;
}
rc.display_graphics = dtype;
@ -187,7 +186,7 @@ void QPrefs::apply()
#endif
#if 0
if (old_value != rc.display_graphics) {
grfx::GCache & gc = grfx::GCache::get();
lyx::graphics::GCache & gc = lyx::graphics::GCache::get();
gc.changeDisplay();
}
#endif
@ -474,10 +473,10 @@ void QPrefs::update_contents()
int item = 2;
switch (rc.display_graphics) {
case grfx::NoDisplay: item = 3; break;
case grfx::ColorDisplay: item = 2; break;
case grfx::GrayscaleDisplay: item = 1; break;
case grfx::MonochromeDisplay: item = 0; break;
case lyx::graphics::NoDisplay: item = 3; break;
case lyx::graphics::ColorDisplay: item = 2; break;
case lyx::graphics::GrayscaleDisplay: item = 1; break;
case lyx::graphics::MonochromeDisplay: item = 0; break;
default: break;
}
displaymod->displayGraphicsCO->setCurrentItem(item);

View File

@ -48,8 +48,6 @@ using std::min;
using std::max;
using std::endl;
namespace grfx = lyx::graphics;
namespace {
class SplashScreen : boost::noncopyable, boost::signals::trackable {
@ -57,18 +55,18 @@ public:
/// This is a singleton class. Get the instance.
static SplashScreen const & get();
///
grfx::Image const * image() const { return loader_.image(); }
lyx::graphics::Image const * image() const { return loader_.image(); }
///
string const & text() const { return text_; }
///
LyXFont const & font() const { return font_; }
///
void connect(grfx::Loader::slot_type const & slot) const {
void connect(lyx::graphics::Loader::slot_type const & slot) const {
loader_.connect(slot);
}
///
void startLoading() const {
if (loader_.status() == grfx::WaitingToLoad)
if (loader_.status() == lyx::graphics::WaitingToLoad)
loader_.startLoading();
}
@ -79,7 +77,7 @@ private:
SplashScreen();
///
grfx::Loader loader_;
lyx::graphics::Loader loader_;
/// The text to be written on top of the pixmap
string const text_;
/// in this font...
@ -419,7 +417,7 @@ void LyXScreen::greyOut()
// Add a splash screen to the centre of the work area
SplashScreen const & splash = SplashScreen::get();
grfx::Image const * const splash_image = splash.image();
lyx::graphics::Image const * const splash_image = splash.image();
if (splash_image) {
int const w = splash_image->getWidth();
int const h = splash_image->getHeight();

View File

@ -1,3 +1,12 @@
2003-07-21 Angus Leeming <leeming@lyx.org>
* FormExternal.C (update, apply):
* FormGraphics.C (update, apply):
* FormPrefences.C (LnFmisc::update, LnFmisc::apply):
* XPainter.C (image):
* xformsImage.C (status_report, error_report): use namespace
lyx::graphics rather than grfx shortcut.
2003-07-18 Angus Leeming <leeming@lyx.org>
* FormNote.C (build): add a tooltip.

View File

@ -32,8 +32,6 @@
using namespace lyx::support;
namespace grfx = lyx::graphics;
typedef FormController<ControlExternal, FormView<FD_external> > base_class;
FormExternal::FormExternal(Dialog & parent)
@ -56,19 +54,19 @@ void FormExternal::apply()
switch (fl_get_choice(dialog_->choice_display)) {
case 5:
params.display = grfx::NoDisplay;
params.display = lyx::graphics::NoDisplay;
break;
case 4:
params.display = grfx::ColorDisplay;
params.display = lyx::graphics::ColorDisplay;
break;
case 3:
params.display = grfx::GrayscaleDisplay;
params.display = lyx::graphics::GrayscaleDisplay;
break;
case 2:
params.display = grfx::MonochromeDisplay;
params.display = lyx::graphics::MonochromeDisplay;
break;
case 1:
params.display = grfx::DefaultDisplay;
params.display = lyx::graphics::DefaultDisplay;
}
controller().setParams(params);
@ -135,19 +133,19 @@ void FormExternal::update()
fl_set_input(dialog_->input_lyxscale, tostr(params.lyxscale).c_str());
switch (params.display) {
case grfx::NoDisplay:
case lyx::graphics::NoDisplay:
fl_set_choice(dialog_->choice_display, 5);
break;
case grfx::ColorDisplay:
case lyx::graphics::ColorDisplay:
fl_set_choice(dialog_->choice_display, 4);
break;
case grfx::GrayscaleDisplay:
case lyx::graphics::GrayscaleDisplay:
fl_set_choice(dialog_->choice_display, 3);
break;
case grfx::MonochromeDisplay:
case lyx::graphics::MonochromeDisplay:
fl_set_choice(dialog_->choice_display, 2);
break;
case grfx::DefaultDisplay:
case lyx::graphics::DefaultDisplay:
fl_set_choice(dialog_->choice_display, 1);
}
}

View File

@ -301,19 +301,19 @@ void FormGraphics::apply()
switch (fl_get_choice(file_->choice_display)) {
case 5:
igp.display = grfx::NoDisplay;
igp.display = lyx::graphics::NoDisplay;
break;
case 4:
igp.display = grfx::ColorDisplay;
igp.display = lyx::graphics::ColorDisplay;
break;
case 3:
igp.display = grfx::GrayscaleDisplay;
igp.display = lyx::graphics::GrayscaleDisplay;
break;
case 2:
igp.display = grfx::MonochromeDisplay;
igp.display = lyx::graphics::MonochromeDisplay;
break;
case 1:
igp.display = grfx::DefaultDisplay;
igp.display = lyx::graphics::DefaultDisplay;
}
// first item in choice_width means scaling
@ -428,19 +428,19 @@ void FormGraphics::update() {
fl_set_input(file_->input_lyxscale, tostr(igp.lyxscale).c_str());
switch (igp.display) {
case grfx::NoDisplay:
case lyx::graphics::NoDisplay:
fl_set_choice(file_->choice_display, 5);
break;
case grfx::ColorDisplay:
case lyx::graphics::ColorDisplay:
fl_set_choice(file_->choice_display, 4);
break;
case grfx::GrayscaleDisplay:
case lyx::graphics::GrayscaleDisplay:
fl_set_choice(file_->choice_display, 3);
break;
case grfx::MonochromeDisplay:
case lyx::graphics::MonochromeDisplay:
fl_set_choice(file_->choice_display, 2);
break;
case grfx::DefaultDisplay:
case lyx::graphics::DefaultDisplay:
fl_set_choice(file_->choice_display, 1);
}

View File

@ -68,8 +68,6 @@ extern string user_lyxdir;
using namespace lyx::support;
namespace grfx = lyx::graphics;
namespace {
// These should probably go inside the class definition...
@ -1843,22 +1841,22 @@ void FormPreferences::LnFmisc::apply(LyXRC & rc) const
(fl_get_counter_value(dialog_->counter_wm_jump));
// See FIXME below
// grfx::DisplayType old_value = rc.display_graphics;
// lyx::graphics::DisplayType old_value = rc.display_graphics;
switch (fl_get_choice(dialog_->choice_display)) {
case 4:
rc.display_graphics = grfx::NoDisplay;
rc.display_graphics = lyx::graphics::NoDisplay;
break;
case 3:
rc.display_graphics = grfx::ColorDisplay;
rc.display_graphics = lyx::graphics::ColorDisplay;
break;
case 2:
rc.display_graphics = grfx::GrayscaleDisplay;
rc.display_graphics = lyx::graphics::GrayscaleDisplay;
break;
case 1:
rc.display_graphics = grfx::MonochromeDisplay;
rc.display_graphics = lyx::graphics::MonochromeDisplay;
break;
default:
rc.display_graphics = grfx::ColorDisplay;
rc.display_graphics = lyx::graphics::ColorDisplay;
break;
}
@ -1867,7 +1865,7 @@ void FormPreferences::LnFmisc::apply(LyXRC & rc) const
#endif
#if 0
if (old_value != rc.display_graphics) {
grfx::GCache & gc = grfx::GCache::get();
lyx::graphics::GCache & gc = lyx::graphics::GCache::get();
gc.changeDisplay();
}
#endif
@ -1932,16 +1930,16 @@ void FormPreferences::LnFmisc::update(LyXRC const & rc)
fl_set_counter_value(dialog_->counter_wm_jump, rc.wheel_jump);
switch (rc.display_graphics) {
case grfx::NoDisplay:
case lyx::graphics::NoDisplay:
fl_set_choice(dialog_->choice_display, 4);
break;
case grfx::ColorDisplay:
case lyx::graphics::ColorDisplay:
fl_set_choice(dialog_->choice_display, 3);
break;
case grfx::GrayscaleDisplay:
case lyx::graphics::GrayscaleDisplay:
fl_set_choice(dialog_->choice_display, 2);
break;
case grfx::MonochromeDisplay:
case lyx::graphics::MonochromeDisplay:
fl_set_choice(dialog_->choice_display, 1);
break;
default:

View File

@ -35,7 +35,6 @@ using namespace lyx::support;
using std::endl;
using std::max;
namespace grfx = lyx::graphics;
XPainter::XPainter(XWorkArea & xwa)
: Painter(), owner_(xwa)
@ -150,11 +149,11 @@ Painter & XPainter::arc(int x, int y,
Painter & XPainter::image(int x, int y,
int w, int h,
grfx::Image const & i)
int w, int h,
lyx::graphics::Image const & i)
{
grfx::xformsImage const & image =
static_cast<grfx::xformsImage const &>(i);
lyx::graphics::xformsImage const & image =
static_cast<lyx::graphics::xformsImage const &>(i);
XGCValues val;
val.function = GXcopy;

View File

@ -371,8 +371,6 @@ void xformsImage::errorCB(string const & error_message)
namespace {
namespace grfx = lyx::graphics;
extern "C" {
int status_report(FL_IMAGE * ob, const char *s)
@ -386,8 +384,8 @@ int status_report(FL_IMAGE * ob, const char *s)
lyxerr[Debug::GRAPHICS]
<< "xforms image loader. Status: " << str << std::endl;
grfx::xformsImage * ptr =
static_cast<grfx::xformsImage *>(ob->u_vdata);
lyx::graphics::xformsImage * ptr =
static_cast<lyx::graphics::xformsImage *>(ob->u_vdata);
ptr->statusCB(str);
return 0;
@ -405,8 +403,8 @@ static void error_report(FL_IMAGE * ob, const char *s)
lyxerr[Debug::GRAPHICS]
<< "xforms image loader. Error: " << str << std::endl;
grfx::xformsImage * ptr =
static_cast<grfx::xformsImage *>(ob->u_vdata);
lyx::graphics::xformsImage * ptr =
static_cast<lyx::graphics::xformsImage *>(ob->u_vdata);
ptr->errorCB(str);
}

View File

@ -1,3 +1,12 @@
2003-07-21 Angus Leeming <leeming@lyx.org>
* GraphicsCache.h:
* GraphicsCacheItem.[Ch]:
* GraphicsParams.h:
* PreviewLoader.h:
* PreviewedInset.[Ch]:
* Previews.h: use namespace lyx::graphics rather than grfx shortcut.
2003-07-04 Lars Gullik Bjønnes <larsbj@gullik.net>
* Change namespace grfx to lyx::graphics.

View File

@ -9,10 +9,11 @@
*
* Full author contact details are available in file CREDITS
*
* grfx::Cache is the manager of the image cache.
* It is responsible for creating the grfx::CacheItem's and maintaining them.
* lyx::graphics::Cache is the manager of the image cache.
* It is responsible for creating the lyx::graphics::CacheItem's
* and maintaining them.
*
* grfx::Cache is a singleton class. It is possible to have only one
* lyx::graphics::Cache is a singleton class. It is possible to have only one
* instance of it at any moment.
*/

View File

@ -68,7 +68,7 @@ struct CacheItem::Impl : public boost::signals::trackable {
/** Get a notification when the image loading is done.
* Connected to a signal on_finish_ which is passed to
* grfx::Image::loadImage.
* lyx::graphics::Image::loadImage.
*/
void imageLoaded(bool);
@ -318,12 +318,10 @@ void CacheItem::Impl::imageLoaded(bool success)
namespace {
namespace grfx = lyx::graphics;
string const findTargetFormat(string const & from)
{
typedef grfx::Image::FormatList FormatList;
FormatList const formats = grfx::Image::loadableFormats();
typedef lyx::graphics::Image::FormatList FormatList;
FormatList const formats = lyx::graphics::Image::loadableFormats();
// There must be a format to load from.
Assert(!formats.empty());
@ -339,7 +337,7 @@ string const findTargetFormat(string const & from)
// So, we have to convert to a loadable format. Can we?
it = formats.begin();
for (; it != end; ++it) {
if (grfx::Converter::isReachable(from, *it))
if (lyx::graphics::Converter::isReachable(from, *it))
return *it;
else
lyxerr[Debug::GRAPHICS]

View File

@ -9,11 +9,11 @@
*
* Full author contact details are available in file CREDITS
*
* The graphics cache is a container of grfx::CacheItems.
* Each grfx::CacheItem, defined here represents a separate image file.
* The graphics cache is a container of lyx::graphics::CacheItems.
* Each lyx::graphics::CacheItem, defined here represents a separate image file.
*
* The routines here can be used to load the graphics file into memory at
* which point (status() == grfx::Loaded).
* which point (status() == lyx::graphics::Loaded).
* The user is then free to access image() in order to copy it and to then
* transform the copy (rotate, scale, clip) and to generate the pixmap.
*
@ -21,8 +21,8 @@
* file conversion to a loadable format;
* file loading.
*
* Whether you get that, of course, depends on grfx::Converter and on the
* grfx::Image-derived image class.
* Whether you get that, of course, depends on lyx::graphics::Converter and
* on the lyx::graphics::Image-derived image class.
*/
#ifndef GRAPHICSCACHEITEM_H
@ -43,7 +43,7 @@ namespace graphics {
class Image;
class Converter;
/// A grfx::Cache item holder.
/// A lyx::graphics::Cache item holder.
class CacheItem : boost::noncopyable {
public:
///

View File

@ -8,7 +8,7 @@
*
* Full author contact details are available in file CREDITS
*
* Used internally by the grfx::Image.
* Used internally by the lyx::graphics::Image.
*/
#ifndef GRAPHICSPARAMS_H

View File

@ -8,7 +8,7 @@
*
* Full author contact details are available in file CREDITS
*
* grfx::PreviewLoader collects latex snippets together. Then, on a
* lyx::graphics::PreviewLoader collects latex snippets together. Then, on a
* startLoading() call, these are dumped to file and processed, converting
* each snippet to a separate bitmap image file. Once a bitmap file is ready
* to be loaded back into LyX, the PreviewLoader emits a signal to inform
@ -72,7 +72,7 @@ public:
/** Connect and you'll be informed when the bitmap image file
* has been created and is ready for loading through
* grfx::PreviewImage::image().
* lyx::graphics::PreviewImage::image().
*/
typedef boost::signal1<void, PreviewImage const &>::slot_type slot_type;
///

View File

@ -73,7 +73,7 @@ void PreviewedInset::addPreview(PreviewLoader & ploader)
return;
// If this is the first time of calling, connect to the
// grfx::PreviewLoader signal that'll inform us when the preview image
// PreviewLoader signal that'll inform us when the preview image
// is ready for loading.
if (!connection_.connected()) {
connection_ = ploader.connect(

View File

@ -1,6 +1,6 @@
// -*- C++ -*-
/**
* \file PreviewedInset.h
* \file PreviewedInset.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
@ -8,9 +8,9 @@
*
* Full author contact details are available in file CREDITS
*
* grfx::PreviewedInset is an abstract base class that can help insets to
* generate previews. The daughter class must instantiate three small
* methods. The Inset would own an instance of this daughter class.
* lyx::graphics::PreviewedInset is an abstract base class that can help
* insets to generate previews. The daughter class must instantiate three small
* methods. The Inset would own an instance of this daughter class.
*/
#ifndef PREVIEWEDINSET_H
@ -67,9 +67,7 @@ protected:
BufferView * view() const;
private:
/** This method is connected to the grfx::PreviewLoader::imageReady
* signal.
*/
/// This method is connected to the PreviewLoader::imageReady signal.
void imageReady(PreviewImage const &) const;
/// Does the owning inset want a preview?

View File

@ -1,6 +1,6 @@
// -*- C++ -*-
/**
* \file Previews.h
* \file Previews.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
@ -8,8 +8,8 @@
*
* Full author contact details are available in file CREDITS
*
* grfx::Previews is a singleton class that stores the grfx::PreviewLoader
* for each buffer requiring one.
* lyx::graphics::Previews is a singleton class that stores the
* lyx::graphics::PreviewLoader for each buffer requiring one.
*/
#ifndef PREVIEWS_H

View File

@ -1,3 +1,10 @@
2003-07-21 Angus Leeming <leeming@lyx.org>
* insetexternal.C:
* insetgraphicsParams.[Ch]:
* insetinclude.C:
* renderers.C: use namespace lyx::graphics rather than grfx shortcut.
2003-07-21 Martin Vermeer <martin.vermeer@hut.fi>
* insetnote.C: fixed greyout and conditionals layout foul-ups.

View File

@ -49,11 +49,9 @@ using namespace lyx::support;
using std::ostream;
using std::endl;
namespace grfx = lyx::graphics;
namespace {
grfx::DisplayType const defaultDisplayType = grfx::NoDisplay;
lyx::graphics::DisplayType const defaultDisplayType = lyx::graphics::NoDisplay;
unsigned int defaultLyxScale = 100;
@ -182,10 +180,10 @@ void InsetExternal::draw(PainterInfo & pi, int x, int y) const
namespace {
grfx::Params get_grfx_params(InsetExternal::Params const & eparams,
lyx::graphics::Params get_grfx_params(InsetExternal::Params const & eparams,
string const & filepath)
{
grfx::Params gparams;
lyx::graphics::Params gparams;
if (!eparams.filename.empty()) {
Assert(AbsolutePath(filepath));
@ -195,12 +193,12 @@ grfx::Params get_grfx_params(InsetExternal::Params const & eparams,
gparams.scale = eparams.lyxscale;
gparams.display = eparams.display;
if (gparams.display == grfx::DefaultDisplay)
if (gparams.display == lyx::graphics::DefaultDisplay)
gparams.display = lyxrc.display_graphics;
// Override the above if we're not using a gui
if (!lyx_gui::use_gui)
gparams.display = grfx::NoDisplay;
gparams.display = lyx::graphics::NoDisplay;
return gparams;
}
@ -240,7 +238,7 @@ void InsetExternal::setParams(Params const & p, string const & filepath)
bool display_button = (!getTemplatePtr(params_) ||
params_.filename.empty() ||
filepath.empty() ||
params_.display == grfx::NoDisplay);
params_.display == lyx::graphics::NoDisplay);
if (display_button) {
ButtonRenderer * button_ptr =
@ -282,7 +280,7 @@ void InsetExternal::write(Buffer const *, ostream & os) const
os << "\tfilename " << params_.filename << '\n';
if (params_.display != defaultDisplayType)
os << "\tdisplay " << grfx::displayTranslator.find(params_.display)
os << "\tdisplay " << lyx::graphics::displayTranslator.find(params_.display)
<< '\n';
if (params_.lyxscale != defaultLyxScale)
@ -332,7 +330,7 @@ void InsetExternal::read(Buffer const * buffer, LyXLex & lex)
case EX_DISPLAY: {
lex.next();
string const name = lex.getString();
params.display = grfx::displayTranslator.find(name);
params.display = lyx::graphics::displayTranslator.find(name);
break;
}

View File

@ -61,7 +61,7 @@ void InsetGraphicsParams::init()
{
filename.erase();
lyxscale = 100; // lyx scaling in percentage
display = grfx::DefaultDisplay; // display mode; see preferences
display = lyx::graphics::DefaultDisplay; // display mode; see preferences
scale = 100.0; // output scaling in percentage
width = LyXLength();
height = LyXLength();
@ -148,8 +148,8 @@ void InsetGraphicsParams::Write(ostream & os, string const & bufpath) const
}
if (lyxscale != 100)
os << "\tlyxscale " << lyxscale << '\n';
if (display != grfx::DefaultDisplay)
os << "\tdisplay " << grfx::displayTranslator.find(display) << '\n';
if (display != lyx::graphics::DefaultDisplay)
os << "\tdisplay " << lyx::graphics::displayTranslator.find(display) << '\n';
if (!float_equal(scale, 0.0, 0.05)) {
if (!float_equal(scale, 100.0, 0.05))
os << "\tscale " << scale << '\n';
@ -196,7 +196,7 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const & token, string const
} else if (token == "display") {
lex.next();
string const type = lex.getString();
display = grfx::displayTranslator.find(type);
display = lyx::graphics::displayTranslator.find(type);
} else if (token == "scale") {
lex.next();
scale = lex.getFloat();
@ -256,9 +256,9 @@ bool InsetGraphicsParams::Read(LyXLex & lex, string const & token, string const
}
grfx::Params InsetGraphicsParams::as_grfxParams() const
lyx::graphics::Params InsetGraphicsParams::as_grfxParams() const
{
grfx::Params pars;
lyx::graphics::Params pars;
pars.filename = filename;
pars.scale = lyxscale;
pars.angle = rotateAngle;
@ -307,7 +307,7 @@ grfx::Params InsetGraphicsParams::as_grfxParams() const
}
}
if (display == grfx::DefaultDisplay) {
if (display == lyx::graphics::DefaultDisplay) {
pars.display = lyxrc.display_graphics;
} else {
pars.display = display;
@ -315,7 +315,7 @@ grfx::Params InsetGraphicsParams::as_grfxParams() const
// Override the above if we're not using a gui
if (!lyx_gui::use_gui) {
pars.display = grfx::NoDisplay;
pars.display = lyx::graphics::NoDisplay;
}
return pars;

View File

@ -18,8 +18,6 @@
#include "LString.h"
#include "lyxlength.h"
namespace grfx = lyx::graphics;
class LyXLex;
namespace lyx {
@ -37,7 +35,7 @@ struct InsetGraphicsParams
/// Scaling the Screen inside Lyx
unsigned int lyxscale;
/// How to display the image inside LyX
grfx::DisplayType display;
lyx::graphics::DisplayType display;
/// Scaling for output (LaTeX)
float scale;
/// sizes for output (LaTeX)
@ -81,7 +79,7 @@ struct InsetGraphicsParams
// Only a subset of InsetGraphicsParams is needed for display purposes.
// This function also interrogates lyxrc to ascertain whether
// to display or not.
grfx::Params as_grfxParams() const;
lyx::graphics::Params as_grfxParams() const;
private:
/// Initialize the object to a default status.

View File

@ -50,12 +50,10 @@ using std::endl;
using std::vector;
using std::pair;
namespace grfx = lyx::graphics;
extern BufferList bufferlist;
class InsetInclude::PreviewImpl : public grfx::PreviewedInset {
class InsetInclude::PreviewImpl : public lyx::graphics::PreviewedInset {
public:
///
PreviewImpl(InsetInclude & p) : PreviewedInset(p) {}
@ -203,7 +201,7 @@ void InsetInclude::set(Params const & p)
if (preview_->monitoring())
preview_->stopMonitoring();
if (grfx::PreviewedInset::activated() && params_.flag == INPUT)
if (lyx::graphics::PreviewedInset::activated() && params_.flag == INPUT)
preview_->generatePreview();
}
@ -560,7 +558,7 @@ BufferView * InsetInclude::view() const
// preview stuff
//
void InsetInclude::addPreview(grfx::PreviewLoader & ploader) const
void InsetInclude::addPreview(lyx::graphics::PreviewLoader & ploader) const
{
preview_->addPreview(ploader);
}

View File

@ -28,7 +28,6 @@
using namespace lyx::support;
namespace grfx = lyx::graphics;
RenderInset::RenderInset()
{}
@ -128,7 +127,7 @@ RenderInset * GraphicRenderer::clone() const
}
void GraphicRenderer::update(grfx::Params const & params)
void GraphicRenderer::update(lyx::graphics::Params const & params)
{
params_ = params;
@ -158,27 +157,27 @@ boost::signals::connection GraphicRenderer::connect(slot_type const & slot) cons
string const GraphicRenderer::statusMessage() const
{
switch (loader_.status()) {
case grfx::WaitingToLoad:
case lyx::graphics::WaitingToLoad:
return _("Not shown.");
case grfx::Loading:
case lyx::graphics::Loading:
return _("Loading...");
case grfx::Converting:
case lyx::graphics::Converting:
return _("Converting to loadable format...");
case grfx::Loaded:
case lyx::graphics::Loaded:
return _("Loaded into memory. Must now generate pixmap.");
case grfx::ScalingEtc:
case lyx::graphics::ScalingEtc:
return _("Scaling etc...");
case grfx::Ready:
case lyx::graphics::Ready:
return _("Ready to display");
case grfx::ErrorNoFile:
case lyx::graphics::ErrorNoFile:
return _("No file found!");
case grfx::ErrorConverting:
case lyx::graphics::ErrorConverting:
return _("Error converting to loadable format");
case grfx::ErrorLoading:
case lyx::graphics::ErrorLoading:
return _("Error loading file into memory");
case grfx::ErrorGeneratingPixmap:
case lyx::graphics::ErrorGeneratingPixmap:
return _("Error generating the pixmap");
case grfx::ErrorUnknown:
case lyx::graphics::ErrorUnknown:
return _("No image");
}
return string();
@ -187,7 +186,7 @@ string const GraphicRenderer::statusMessage() const
bool GraphicRenderer::readyToDisplay() const
{
if (!loader_.image() || loader_.status() != grfx::Ready)
if (!loader_.image() || loader_.status() != lyx::graphics::Ready)
return false;
return loader_.image()->isDrawable();
}
@ -259,11 +258,12 @@ void GraphicRenderer::draw(PainterInfo & pi, int x, int y) const
}
#endif
if (params_.display != grfx::NoDisplay &&
loader_.status() == grfx::WaitingToLoad)
if (params_.display != lyx::graphics::NoDisplay &&
loader_.status() == lyx::graphics::WaitingToLoad)
loader_.startLoading();
if (params_.display != grfx::NoDisplay && !loader_.monitoring())
if (params_.display != lyx::graphics::NoDisplay &&
!loader_.monitoring())
loader_.startMonitoring();
// This will draw the graphics. If the graphics has not been loaded yet,

View File

@ -59,8 +59,6 @@ using std::signal;
using std::system;
#endif
namespace grfx = lyx::graphics;
extern void LoadLyXFile(string const &);
extern void QuitLyX();
@ -106,7 +104,7 @@ LyX::LyX(int & argc, char * argv[])
// set the DisplayTranslator only once; should that be done here??
// if this should not be in this file, please also remove
// #include "graphics/GraphicsTypes.h" at the top -- Rob Lahaye.
grfx::setDisplayTranslator();
lyx::graphics::setDisplayTranslator();
if (want_gui) {
lyx_gui::parse_init(argc, argv);

View File

@ -1586,7 +1586,8 @@ void LyXFunc::dispatch(FuncRequest const & ev, bool verbose)
#warning FIXME!! The graphics cache no longer has a changeDisplay method.
#endif
#if 0
grfx::GCache & gc = grfx::GCache::get();
lyx::graphics::GCache & gc =
lyx::graphics::GCache::get();
gc.changeDisplay(true);
#endif
}

View File

@ -40,8 +40,6 @@ using std::ios;
using std::endl;
using std::vector;
namespace grfx = lyx::graphics;
class kb_keymap;
extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
@ -232,7 +230,7 @@ void LyXRC::setDefaults() {
check_lastfiles = true;
make_backup = true;
backupdir_path.erase();
display_graphics = grfx::ColorDisplay;
display_graphics = lyx::graphics::ColorDisplay;
// Spellchecker settings:
use_spell_lib = true;
isp_command = "ispell";
@ -378,7 +376,7 @@ int LyXRC::read(string const & filename)
case RC_DISPLAY_GRAPHICS:
if (lexrc.next()) {
display_graphics = grfx::displayTranslator.find(lexrc.getString());
display_graphics = lyx::graphics::displayTranslator.find(lexrc.getString());
}
break;
@ -1203,7 +1201,8 @@ void LyXRC::output(ostream & os) const
if (display_graphics != system_lyxrc.display_graphics) {
os << "# Display graphics within LyX\n"
<< "# monochrome|grayscale|color|none\n"
<< "\\display_graphics " << grfx::displayTranslator.find(display_graphics)
<< "\\display_graphics "
<< lyx::graphics::displayTranslator.find(display_graphics)
<< '\n';
}

View File

@ -1,3 +1,8 @@
2003-07-21 Angus Leeming <leeming@lyx.org>
* formula.C (c-tor, addPreview): use namespace lyx::graphics rather
than grfx shortcut.
2003-07-18 Lars Gullik Bjønnes <larsbj@gullik.net>
* math_parser.C (catInit): dont use unprintable control chars in

View File

@ -52,9 +52,8 @@
using std::ostream;
using std::vector;
namespace grfx = lyx::graphics;
class InsetFormula::PreviewImpl : public grfx::PreviewedInset {
class InsetFormula::PreviewImpl : public lyx::graphics::PreviewedInset {
public:
///
PreviewImpl(InsetFormula & p) : PreviewedInset(p) {}
@ -306,7 +305,7 @@ void InsetFormula::mutate(string const & type)
// preview stuff
//
void InsetFormula::addPreview(grfx::PreviewLoader & ploader) const
void InsetFormula::addPreview(lyx::graphics::PreviewLoader & ploader) const
{
preview_->addPreview(ploader);
}

View File

@ -1,3 +1,8 @@
2003-07-21 Angus Leeming <leeming@lyx.org>
* filename.[Ch]: new files implementing class FileName.
* Makefile.am: add filename.[Ch].
2003-07-18 Lars Gullik Bjønnes <larsbj@gullik.net>
* BoostFormat.h (boost): remove one extern template. Gcc 3.4. does