diff --git a/src/BufferView_pimpl.C b/src/BufferView_pimpl.C index f0a0edcae4..3f238f14c2 100644 --- a/src/BufferView_pimpl.C +++ b/src/BufferView_pimpl.C @@ -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_); } diff --git a/src/ChangeLog b/src/ChangeLog index b694f7a714..5943da39e8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2003-07-21 Angus Leeming + + * 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 diff --git a/src/buffer.C b/src/buffer.C index 1f1a39945e..d6186200c2 100644 --- a/src/buffer.C +++ b/src/buffer.C @@ -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); } diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index 425311b690..0331a9a882 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,7 @@ +2003-07-21 Angus Leeming + + * screen.C (c-tor, greyOut): use namespace lyx::graphics + rather than the grfx shortcut. 2003-07-15 André Pönitz diff --git a/src/frontends/controllers/ChangeLog b/src/frontends/controllers/ChangeLog index e780b818e0..15e27845d0 100644 --- a/src/frontends/controllers/ChangeLog +++ b/src/frontends/controllers/ChangeLog @@ -1,3 +1,7 @@ +2003-07-21 Angus Leeming + + * ControlGraphics.C (readBB): use namespace lyx::graphics rather than grfx shortcut. + 2003-07-18 Lars Gullik Bjønnes * ControlGraphics.C (dispatchParams): avoid some variable/function diff --git a/src/frontends/controllers/ControlGraphics.C b/src/frontends/controllers/ControlGraphics.C index 5671870de0..cfd8f19ebe 100644 --- a/src/frontends/controllers/ControlGraphics.C +++ b/src/frontends/controllers/ControlGraphics.C @@ -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(); diff --git a/src/frontends/gnome/ChangeLog b/src/frontends/gnome/ChangeLog index d632f36592..a03db39b14 100644 --- a/src/frontends/gnome/ChangeLog +++ b/src/frontends/gnome/ChangeLog @@ -1,3 +1,8 @@ +2003-07-21 Angus Leeming + + * lyx_gui.C (reset): use namespace lyx::graphics rather than grfx + shortcut. + 2003-06-28 Lars Gullik Bjønnes * FileDialog.C: fix const type order diff --git a/src/frontends/gnome/lyx_gui.C b/src/frontends/gnome/lyx_gui.C index 70bcade967..ca1b6f82bc 100644 --- a/src/frontends/gnome/lyx_gui.C +++ b/src/frontends/gnome/lyx_gui.C @@ -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); diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 7179fb2571..236ec7543b 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,11 @@ +2003-07-21 Angus Leeming + + * 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 * QBibTeXDialog.C: diff --git a/src/frontends/qt2/QExternal.C b/src/frontends/qt2/QExternal.C index 4ede9586a6..db265b3c4b 100644 --- a/src/frontends/qt2/QExternal.C +++ b/src/frontends/qt2/QExternal.C @@ -33,7 +33,6 @@ using namespace lyx::support; -namespace grfx = lyx::graphics; typedef QController > 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())); diff --git a/src/frontends/qt2/QGraphics.C b/src/frontends/qt2/QGraphics.C index 9ec47c7931..ea90488b83 100644 --- a/src/frontends/qt2/QGraphics.C +++ b/src/frontends/qt2/QGraphics.C @@ -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) { diff --git a/src/frontends/qt2/QLPainter.C b/src/frontends/qt2/QLPainter.C index 026eb66e12..0dfb029591 100644 --- a/src/frontends/qt2/QLPainter.C +++ b/src/frontends/qt2/QLPainter.C @@ -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(i).qpixmap(), 0, 0, w, h); + qp_->drawPixmap(x, y, static_cast(i).qpixmap(), 0, 0, w, h); return *this; } diff --git a/src/frontends/qt2/QPrefs.C b/src/frontends/qt2/QPrefs.C index aa4ffbf072..cca79d5b4a 100644 --- a/src/frontends/qt2/QPrefs.C +++ b/src/frontends/qt2/QPrefs.C @@ -63,7 +63,6 @@ using std::setfill; using std::setw; using std::endl; -namespace grfx = lyx::graphics; typedef Qt2CB > 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); diff --git a/src/frontends/screen.C b/src/frontends/screen.C index 5629bb4f71..f6ed96a7ad 100644 --- a/src/frontends/screen.C +++ b/src/frontends/screen.C @@ -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(); diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 02040d96cf..d443ea2509 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,12 @@ +2003-07-21 Angus Leeming + + * 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 * FormNote.C (build): add a tooltip. diff --git a/src/frontends/xforms/FormExternal.C b/src/frontends/xforms/FormExternal.C index a7419906a3..353784986b 100644 --- a/src/frontends/xforms/FormExternal.C +++ b/src/frontends/xforms/FormExternal.C @@ -32,8 +32,6 @@ using namespace lyx::support; -namespace grfx = lyx::graphics; - typedef FormController > 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); } } diff --git a/src/frontends/xforms/FormGraphics.C b/src/frontends/xforms/FormGraphics.C index 8dd690560d..cb984e7cf8 100644 --- a/src/frontends/xforms/FormGraphics.C +++ b/src/frontends/xforms/FormGraphics.C @@ -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); } diff --git a/src/frontends/xforms/FormPreferences.C b/src/frontends/xforms/FormPreferences.C index 059ca6781c..082dee34b1 100644 --- a/src/frontends/xforms/FormPreferences.C +++ b/src/frontends/xforms/FormPreferences.C @@ -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: diff --git a/src/frontends/xforms/XPainter.C b/src/frontends/xforms/XPainter.C index 05fd6cc31c..2849928b8e 100644 --- a/src/frontends/xforms/XPainter.C +++ b/src/frontends/xforms/XPainter.C @@ -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(i); + lyx::graphics::xformsImage const & image = + static_cast(i); XGCValues val; val.function = GXcopy; diff --git a/src/frontends/xforms/xformsImage.C b/src/frontends/xforms/xformsImage.C index 7001491131..78392d0a3f 100644 --- a/src/frontends/xforms/xformsImage.C +++ b/src/frontends/xforms/xformsImage.C @@ -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(ob->u_vdata); + lyx::graphics::xformsImage * ptr = + static_cast(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(ob->u_vdata); + lyx::graphics::xformsImage * ptr = + static_cast(ob->u_vdata); ptr->errorCB(str); } diff --git a/src/graphics/ChangeLog b/src/graphics/ChangeLog index 0f0ad5e5d5..3bc09ebf6b 100644 --- a/src/graphics/ChangeLog +++ b/src/graphics/ChangeLog @@ -1,3 +1,12 @@ +2003-07-21 Angus Leeming + + * 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 * Change namespace grfx to lyx::graphics. diff --git a/src/graphics/GraphicsCache.h b/src/graphics/GraphicsCache.h index 1e0f0eb09b..3098c9e4d9 100644 --- a/src/graphics/GraphicsCache.h +++ b/src/graphics/GraphicsCache.h @@ -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. */ diff --git a/src/graphics/GraphicsCacheItem.C b/src/graphics/GraphicsCacheItem.C index 798977f2b4..9c5c4b576e 100644 --- a/src/graphics/GraphicsCacheItem.C +++ b/src/graphics/GraphicsCacheItem.C @@ -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] diff --git a/src/graphics/GraphicsCacheItem.h b/src/graphics/GraphicsCacheItem.h index bcf72f67af..bdc606966a 100644 --- a/src/graphics/GraphicsCacheItem.h +++ b/src/graphics/GraphicsCacheItem.h @@ -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: /// diff --git a/src/graphics/GraphicsParams.h b/src/graphics/GraphicsParams.h index 5d1cb6aa73..98fc614fdb 100644 --- a/src/graphics/GraphicsParams.h +++ b/src/graphics/GraphicsParams.h @@ -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 diff --git a/src/graphics/PreviewLoader.h b/src/graphics/PreviewLoader.h index ba6613bedb..3db6850b8f 100644 --- a/src/graphics/PreviewLoader.h +++ b/src/graphics/PreviewLoader.h @@ -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::slot_type slot_type; /// diff --git a/src/graphics/PreviewedInset.C b/src/graphics/PreviewedInset.C index 7f080a8aea..1881bc5122 100644 --- a/src/graphics/PreviewedInset.C +++ b/src/graphics/PreviewedInset.C @@ -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( diff --git a/src/graphics/PreviewedInset.h b/src/graphics/PreviewedInset.h index 85760603f9..cdb28a2106 100644 --- a/src/graphics/PreviewedInset.h +++ b/src/graphics/PreviewedInset.h @@ -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? diff --git a/src/graphics/Previews.h b/src/graphics/Previews.h index 2bfa1cdf83..5ba3cc33fa 100644 --- a/src/graphics/Previews.h +++ b/src/graphics/Previews.h @@ -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 diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index a4138f980f..ff812778f5 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,10 @@ +2003-07-21 Angus Leeming + + * insetexternal.C: + * insetgraphicsParams.[Ch]: + * insetinclude.C: + * renderers.C: use namespace lyx::graphics rather than grfx shortcut. + 2003-07-21 Martin Vermeer * insetnote.C: fixed greyout and conditionals layout foul-ups. diff --git a/src/insets/insetexternal.C b/src/insets/insetexternal.C index 4683130594..037d452cae 100644 --- a/src/insets/insetexternal.C +++ b/src/insets/insetexternal.C @@ -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; } diff --git a/src/insets/insetgraphicsParams.C b/src/insets/insetgraphicsParams.C index 53c5647d5a..f9e7f29ce7 100644 --- a/src/insets/insetgraphicsParams.C +++ b/src/insets/insetgraphicsParams.C @@ -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; diff --git a/src/insets/insetgraphicsParams.h b/src/insets/insetgraphicsParams.h index b33629b328..c288c65bc2 100644 --- a/src/insets/insetgraphicsParams.h +++ b/src/insets/insetgraphicsParams.h @@ -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. diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index fd6fa9faeb..69f4f2cfe3 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -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); } diff --git a/src/insets/renderers.C b/src/insets/renderers.C index 3839e167bb..9a438bff01 100644 --- a/src/insets/renderers.C +++ b/src/insets/renderers.C @@ -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, diff --git a/src/lyx_main.C b/src/lyx_main.C index b61fe85291..4b725bbd69 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -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); diff --git a/src/lyxfunc.C b/src/lyxfunc.C index e6344f043d..d557b8dfde 100644 --- a/src/lyxfunc.C +++ b/src/lyxfunc.C @@ -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 } diff --git a/src/lyxrc.C b/src/lyxrc.C index 1357d3d447..70f3d0ab85 100644 --- a/src/lyxrc.C +++ b/src/lyxrc.C @@ -40,8 +40,6 @@ using std::ios; using std::endl; using std::vector; -namespace grfx = lyx::graphics; - class kb_keymap; extern boost::scoped_ptr 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'; } diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 546961bc12..7a3242ac63 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,3 +1,8 @@ +2003-07-21 Angus Leeming + + * formula.C (c-tor, addPreview): use namespace lyx::graphics rather + than grfx shortcut. + 2003-07-18 Lars Gullik Bjønnes * math_parser.C (catInit): dont use unprintable control chars in diff --git a/src/mathed/formula.C b/src/mathed/formula.C index d2a2aa98f1..28204a7975 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -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); } diff --git a/src/support/ChangeLog b/src/support/ChangeLog index 51e71ee2d2..424014f011 100644 --- a/src/support/ChangeLog +++ b/src/support/ChangeLog @@ -1,3 +1,8 @@ +2003-07-21 Angus Leeming + + * filename.[Ch]: new files implementing class FileName. + * Makefile.am: add filename.[Ch]. + 2003-07-18 Lars Gullik Bjønnes * BoostFormat.h (boost): remove one extern template. Gcc 3.4. does