cosmetics + move frontends/* to frontend namespace.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19553 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-08-14 09:54:59 +00:00
parent 7ef45b8610
commit 32268e2632
29 changed files with 109 additions and 95 deletions

View File

@ -38,6 +38,7 @@ using support::bformat;
using support::changeExtension; using support::changeExtension;
using support::FileName; using support::FileName;
using support::makeDisplayPath; using support::makeDisplayPath;
using frontend::LyXView;
bool Importer::Import(LyXView * lv, FileName const & filename, bool Importer::Import(LyXView * lv, FileName const & filename,

View File

@ -22,14 +22,17 @@ namespace lyx {
namespace support { class FileName; } namespace support { class FileName; }
class LyXView;
class ErrorList; class ErrorList;
class Format; class Format;
namespace frontend {
class LyXView;
}
class Importer { class Importer {
public: public:
/// ///
static bool Import(LyXView * lv, support::FileName const & filename, static bool Import(frontend::LyXView * lv, support::FileName const & filename,
std::string const & format, ErrorList & errorList); std::string const & format, ErrorList & errorList);
/// ///

View File

@ -70,6 +70,20 @@
#include <string> #include <string>
#include <vector> #include <vector>
using std::endl;
using std::for_each;
using std::map;
using std::make_pair;
using std::string;
using std::vector;
#ifndef CXX_GLOBAL_CSTD
using std::exit;
using std::signal;
using std::system;
#endif
namespace fs = boost::filesystem;
namespace lyx { namespace lyx {
@ -89,23 +103,11 @@ using support::package;
using support::prependEnvPath; using support::prependEnvPath;
using support::rtrim; using support::rtrim;
using support::Systemcall; using support::Systemcall;
using frontend::LyXView;
namespace Alert = frontend::Alert; namespace Alert = frontend::Alert;
namespace os = support::os; namespace os = support::os;
namespace fs = boost::filesystem;
using std::endl;
using std::for_each;
using std::map;
using std::make_pair;
using std::string;
using std::vector;
#ifndef CXX_GLOBAL_CSTD
using std::exit;
using std::signal;
using std::system;
#endif
/// are we using the GUI at all? /// are we using the GUI at all?

View File

@ -33,7 +33,6 @@ class Inset;
class LyXFunc; class LyXFunc;
class Server; class Server;
class ServerSocket; class ServerSocket;
class LyXView;
class Messages; class Messages;
class Mover; class Mover;
class Movers; class Movers;
@ -42,7 +41,10 @@ class KeyMap;
extern bool use_gui; extern bool use_gui;
namespace frontend { class Application; } namespace frontend {
class Application;
class LyXView;
}
/// initial startup /// initial startup
class LyX : boost::noncopyable { class LyX : boost::noncopyable {
@ -96,7 +98,7 @@ public:
void setGuiLanguage(std::string const & language); void setGuiLanguage(std::string const & language);
/// ///
LyXView * newLyXView(); frontend::LyXView * newLyXView();
/** redraw \c inset in all the BufferViews in which it is currently /** redraw \c inset in all the BufferViews in which it is currently
* visible. If successful return a pointer to the owning Buffer. * visible. If successful return a pointer to the owning Buffer.

View File

@ -118,6 +118,8 @@ namespace lyx {
using bv_funcs::freefont2string; using bv_funcs::freefont2string;
using frontend::LyXView;
using support::absolutePath; using support::absolutePath;
using support::addName; using support::addName;
using support::addPath; using support::addPath;

View File

@ -30,8 +30,10 @@ class FuncRequest;
class FuncStatus; class FuncStatus;
class KeySymbol; class KeySymbol;
class Text; class Text;
class LyXView;
namespace frontend {
class LyXView;
}
/** This class encapsulates all the LyX command operations. /** This class encapsulates all the LyX command operations.
This is the class of the LyX's "high level event handler". This is the class of the LyX's "high level event handler".
@ -48,7 +50,7 @@ public:
void dispatch(FuncRequest const &); void dispatch(FuncRequest const &);
/// ///
void setLyXView(LyXView * lv); void setLyXView(frontend::LyXView * lv);
/// ///
void initKeySequences(KeyMap * kb); void initKeySequences(KeyMap * kb);
@ -86,7 +88,7 @@ private:
BufferView * view() const; BufferView * view() const;
/// ///
LyXView * lyx_view_; frontend::LyXView * lyx_view_;
/// the last character added to the key sequence, in UCS4 encoded form /// the last character added to the key sequence, in UCS4 encoded form
char_type encoded_last_key; char_type encoded_last_key;

View File

@ -71,6 +71,10 @@
#include <clocale> #include <clocale>
#include <sstream> #include <sstream>
using std::endl;
using std::string;
using std::istringstream;
using std::ostringstream;
namespace lyx { namespace lyx {
@ -83,14 +87,9 @@ using cap::replaceSelection;
using support::isStrUnsignedInt; using support::isStrUnsignedInt;
using support::token; using support::token;
using std::endl; namespace frontend {
using std::string;
using std::istringstream;
using std::ostringstream;
extern docstring current_layout; extern docstring current_layout;
}
namespace { namespace {
@ -896,7 +895,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
break; break;
} }
bool change_layout = (current_layout != layout); bool change_layout = (frontend::current_layout != layout);
if (!change_layout && cur.selection() && if (!change_layout && cur.selection() &&
cur.selBegin().pit() != cur.selEnd().pit()) cur.selBegin().pit() != cur.selEnd().pit())
@ -904,7 +903,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
pit_type spit = cur.selBegin().pit(); pit_type spit = cur.selBegin().pit();
pit_type epit = cur.selEnd().pit() + 1; pit_type epit = cur.selEnd().pit() + 1;
while (spit != epit) { while (spit != epit) {
if (pars_[spit].layout()->name() != current_layout) { if (pars_[spit].layout()->name() != frontend::current_layout) {
change_layout = true; change_layout = true;
break; break;
} }

View File

@ -66,7 +66,7 @@ using std::ios;
using std::istream_iterator; using std::istream_iterator;
using boost::shared_ptr; using boost::shared_ptr;
namespace fs = boost::filesystem;
namespace lyx { namespace lyx {
@ -87,9 +87,9 @@ using support::split;
using support::Systemcall; using support::Systemcall;
using support::tempName; using support::tempName;
using support::unlink; using support::unlink;
using frontend::LyXView;
namespace Alert = frontend::Alert; namespace Alert = frontend::Alert;
namespace fs = boost::filesystem;
// this should be static, but I need it in Buffer.cpp // this should be static, but I need it in Buffer.cpp
bool quitting; // flag, that we are quitting the program bool quitting; // flag, that we are quitting the program

View File

@ -18,7 +18,10 @@ namespace lyx {
class Buffer; class Buffer;
class BufferView; class BufferView;
namespace frontend {
class LyXView; class LyXView;
}
/// ///
extern bool quitting; extern bool quitting;
@ -37,7 +40,7 @@ void insertPlaintextFile(BufferView * bv, std::string const & f, bool asParagrap
docstring const getContentsOfPlaintextFile(BufferView * bv, docstring const getContentsOfPlaintextFile(BufferView * bv,
std::string const & f, bool asParagraph); std::string const & f, bool asParagraph);
/// ///
void reconfigure(LyXView & lv); void reconfigure(frontend::LyXView & lv);
} // namespace lyx } // namespace lyx

View File

@ -18,7 +18,6 @@
namespace lyx { namespace lyx {
class BufferView; class BufferView;
class LyXView;
class Color_color; class Color_color;
struct RGBColor; struct RGBColor;
@ -27,6 +26,7 @@ namespace frontend {
class Clipboard; class Clipboard;
class FontLoader; class FontLoader;
class Gui; class Gui;
class LyXView;
class Selection; class Selection;
/// The main application class /// The main application class

View File

@ -25,8 +25,7 @@ using std::string;
namespace lyx { namespace lyx {
using lyx::frontend::Dialog; namespace frontend {
Dialogs::Dialogs(LyXView & lyxview) Dialogs::Dialogs(LyXView & lyxview)
: lyxview_(lyxview), in_show_(false) : lyxview_(lyxview), in_show_(false)
@ -218,5 +217,5 @@ void Dialogs::checkStatus()
} }
} }
} // namespace frontend
} // namespace lyx } // namespace lyx

View File

@ -21,9 +21,11 @@
namespace lyx { namespace lyx {
class Inset; class Inset;
class LyXView;
namespace frontend { class Dialog; } namespace frontend {
class Dialog;
class LyXView;
/** Container of all dialogs. /** Container of all dialogs.
*/ */
@ -98,9 +100,9 @@ private:
/// ///
bool isValidName(std::string const & name) const; bool isValidName(std::string const & name) const;
/// ///
frontend::Dialog * find_or_build(std::string const & name); Dialog * find_or_build(std::string const & name);
/// ///
typedef boost::shared_ptr<frontend::Dialog> DialogPtr; typedef boost::shared_ptr<Dialog> DialogPtr;
/// ///
DialogPtr build(std::string const & name); DialogPtr build(std::string const & name);
@ -119,6 +121,7 @@ private:
boost::signals::connection connection_; boost::signals::connection connection_;
}; };
} // namespace frontend
} // namespace lyx } // namespace lyx
#endif #endif

View File

@ -21,11 +21,11 @@
namespace lyx { namespace lyx {
class LyXView;
class BufferView; class BufferView;
namespace frontend { namespace frontend {
class LyXView;
class WorkArea; class WorkArea;

View File

@ -12,6 +12,7 @@
#include <config.h> #include <config.h>
#include "LyXView.h" #include "LyXView.h"
#include "Dialogs.h" #include "Dialogs.h"
#include "Toolbars.h" #include "Toolbars.h"
#include "Menubar.h" #include "Menubar.h"
@ -47,8 +48,6 @@
#include <boost/bind.hpp> #include <boost/bind.hpp>
namespace lyx {
#ifdef HAVE_SYS_TIME_H #ifdef HAVE_SYS_TIME_H
# include <sys/time.h> # include <sys/time.h>
#endif #endif
@ -56,21 +55,20 @@ namespace lyx {
# include <unistd.h> # include <unistd.h>
#endif #endif
using frontend::WorkArea; using std::endl;
using std::string;
namespace lyx {
using support::bformat; using support::bformat;
using support::FileName; using support::FileName;
using support::makeDisplayPath; using support::makeDisplayPath;
using support::onlyFilename; using support::onlyFilename;
using std::endl; namespace frontend {
using std::string;
using lyx::frontend::ControlCommandBuffer;
docstring current_layout; docstring current_layout;
LyXView::LyXView(int id) LyXView::LyXView(int id)
: work_area_(0), : work_area_(0),
toolbars_(new Toolbars(*this)), toolbars_(new Toolbars(*this)),
@ -530,5 +528,5 @@ Buffer const * const LyXView::updateInset(Inset const * inset) const
return buffer_ptr; return buffer_ptr;
} }
} // namespace frontend
} // namespace lyx } // namespace lyx

View File

@ -29,22 +29,20 @@ namespace lyx {
namespace support { class FileName; } namespace support { class FileName; }
class Buffer;
class Inset;
class Menubar;
class BufferView;
class Dialogs;
class LyXFunc;
class Font; class Font;
class Timeout; class Buffer;
class BufferView;
class FuncRequest; class FuncRequest;
class Inset;
class LyXFunc;
class Timeout;
namespace frontend { namespace frontend {
class WorkArea;
class ControlCommandBuffer;
} // namespace frontend
class ControlCommandBuffer;
class Dialogs;
class Menubar;
class WorkArea;
/** /**
* LyXView - main LyX window * LyXView - main LyX window
@ -75,13 +73,13 @@ public:
std::vector<int> const & workAreaIds() const { return work_area_ids_; } std::vector<int> const & workAreaIds() const { return work_area_ids_; }
/// FIXME: rename to setCurrentWorkArea() /// FIXME: rename to setCurrentWorkArea()
void setWorkArea(frontend::WorkArea * work_area); void setWorkArea(WorkArea * work_area);
/// return the current WorkArea (the one that has the focus). /// return the current WorkArea (the one that has the focus).
frontend::WorkArea const * currentWorkArea() const; WorkArea const * currentWorkArea() const;
/// FIXME: This non-const access is needed because of /// FIXME: This non-const access is needed because of
/// a mis-designed \c ControlSpellchecker. /// a mis-designed \c ControlSpellchecker.
frontend::WorkArea * currentWorkArea(); WorkArea * currentWorkArea();
/** /**
* This is called after the concrete view has been created. * This is called after the concrete view has been created.
@ -293,7 +291,7 @@ protected:
/// view's command buffer controller /// view's command buffer controller
// this has to be declared _after_ lyxfunc_ as its initialization depends // this has to be declared _after_ lyxfunc_ as its initialization depends
// on it! // on it!
typedef boost::scoped_ptr<frontend::ControlCommandBuffer> typedef boost::scoped_ptr<ControlCommandBuffer>
CommandBufferPtr; CommandBufferPtr;
CommandBufferPtr const controlcommand_; CommandBufferPtr const controlcommand_;
@ -303,6 +301,7 @@ private:
std::vector<int> work_area_ids_; std::vector<int> work_area_ids_;
}; };
} // namespace frontend
} // namespace lyx } // namespace lyx
#endif // LYXVIEW_H #endif // LYXVIEW_H

View File

@ -17,6 +17,7 @@
namespace lyx { namespace lyx {
namespace frontend {
/** /**
* The LyX GUI independent menubar class * The LyX GUI independent menubar class
@ -32,6 +33,7 @@ public:
virtual void update() = 0; virtual void update() = 0;
}; };
} // namespace frontend
} // namespace lyx } // namespace lyx
#endif // MENUBAR_H #endif // MENUBAR_H

View File

@ -25,11 +25,11 @@
#include "LyX.h" #include "LyX.h"
namespace lyx {
using std::endl; using std::endl;
using std::string; using std::string;
namespace lyx {
namespace frontend {
Toolbars::Toolbars(LyXView & owner) Toolbars::Toolbars(LyXView & owner)
: owner_(owner), : owner_(owner),
@ -375,5 +375,5 @@ void layoutSelected(LyXView & lv, docstring const & name)
<< endl; << endl;
} }
} // namespace frontend
} // namespace lyx } // namespace lyx

View File

@ -24,12 +24,14 @@
#define TOOLBARS_H #define TOOLBARS_H
#include "ToolbarBackend.h" #include "ToolbarBackend.h"
#include <boost/shared_ptr.hpp>
#include <map>
#include "Session.h" #include "Session.h"
#include <boost/shared_ptr.hpp>
#include <map>
namespace lyx { namespace lyx {
namespace frontend {
class LyXView; class LyXView;
@ -158,6 +160,7 @@ private:
void layoutSelected(LyXView & lv, docstring const & name); void layoutSelected(LyXView & lv, docstring const & name);
} // namespace frontend
} // namespace lyx } // namespace lyx
#endif // NOT TOOLBARS_H #endif // NOT TOOLBARS_H

View File

@ -27,10 +27,10 @@ namespace lyx {
class BufferView; class BufferView;
class FuncRequest; class FuncRequest;
class LyXView;
namespace frontend { namespace frontend {
class LyXView;
class Painter; class Painter;
/// types of cursor in work area /// types of cursor in work area

View File

@ -20,11 +20,10 @@
namespace lyx { namespace lyx {
namespace frontend {
class LyXView; class LyXView;
namespace frontend {
/** /**
* ControlCommandBuffer * ControlCommandBuffer
* *

View File

@ -26,10 +26,11 @@ namespace lyx {
class InsetGraphics; class InsetGraphics;
class InsetGraphicsParams; class InsetGraphicsParams;
class LyXView;
namespace frontend { namespace frontend {
class LyXView;
/** A controller for Graphics dialogs. /** A controller for Graphics dialogs.
*/ */
class ControlGraphics : public Dialog::Controller { class ControlGraphics : public Dialog::Controller {

View File

@ -21,12 +21,10 @@
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
namespace lyx { namespace lyx {
class LyXView;
namespace frontend { namespace frontend {
class ButtonController; class ButtonController;
class LyXView;
/** \c Dialog collects the different parts of a Model-Controller-View /** \c Dialog collects the different parts of a Model-Controller-View
* split of a generic dialog together. * split of a generic dialog together.

View File

@ -19,10 +19,11 @@ namespace lyx {
class Buffer; class Buffer;
class BufferView; class BufferView;
class FuncRequest; class FuncRequest;
class LyXView;
namespace frontend { namespace frontend {
class LyXView;
/** \c Kernel is a wrapper making the LyX kernel available to the dialog. /** \c Kernel is a wrapper making the LyX kernel available to the dialog.
* (Ie, it provides an interface to the Model part of the Model-Controller- * (Ie, it provides an interface to the Model part of the Model-Controller-
* View split. * View split.

View File

@ -99,7 +99,8 @@
using std::string; using std::string;
using namespace lyx::frontend; namespace lyx {
namespace frontend {
namespace { namespace {
@ -133,9 +134,6 @@ private:
} // namespace anon } // namespace anon
namespace lyx {
bool Dialogs::isValidName(string const & name) const bool Dialogs::isValidName(string const & name) const
{ {
return std::find_if(dialognames, end_dialognames, return std::find_if(dialognames, end_dialognames,
@ -272,7 +270,7 @@ Dialogs::DialogPtr Dialogs::build(string const & name)
dialog->bc().bp(new OkApplyCancelPolicy); dialog->bc().bp(new OkApplyCancelPolicy);
} else if (name == "ref") { } else if (name == "ref") {
// full qualification because qt4 has also a ControlRef type // full qualification because qt4 has also a ControlRef type
dialog->setController(new lyx::frontend::ControlRef(*dialog)); dialog->setController(new ControlRef(*dialog));
dialog->setView(new QRef(*dialog)); dialog->setView(new QRef(*dialog));
dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy); dialog->bc().bp(new NoRepeatedApplyReadOnlyPolicy);
} else if (name == "sendto") { } else if (name == "sendto") {
@ -342,5 +340,5 @@ bool Dialogs::tooltipsEnabled()
return false; return false;
} }
} // namespace frontend
} // namespace lyx } // namespace lyx

View File

@ -19,13 +19,12 @@
#include <map> #include <map>
class LyXView;
namespace lyx { namespace lyx {
namespace frontend { namespace frontend {
class GuiWorkArea; class GuiWorkArea;
class GuiView; class GuiView;
class LyXView;
/** /**
* The GuiImplementation class is the interface to all Qt4 components. * The GuiImplementation class is the interface to all Qt4 components.

View File

@ -15,23 +15,24 @@
#include "frontends/Menubar.h" #include "frontends/Menubar.h"
#include "QLPopupMenu.h"
#include <map> #include <map>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include <QObject> #include <QObject>
#include <QMenuBar> #include <QMenuBar>
#include "QLPopupMenu.h" namespace lyx {
class LyXView;
class MenuBackend; class MenuBackend;
class Menu; class Menu;
class MenuItem; class MenuItem;
namespace lyx {
namespace frontend { namespace frontend {
class GuiView; class GuiView;
class LyXView;
class QLMenubar : public QObject, public Menubar { class QLMenubar : public QObject, public Menubar {
Q_OBJECT Q_OBJECT

View File

@ -17,11 +17,13 @@
#define QLTOOLBAR_H #define QLTOOLBAR_H
#include "frontends/Toolbars.h" #include "frontends/Toolbars.h"
#include <boost/scoped_ptr.hpp> #include "Session.h"
#include <QToolBar> #include <QToolBar>
#include <boost/scoped_ptr.hpp>
#include <vector> #include <vector>
#include "Session.h"
class QComboBox; class QComboBox;

View File

@ -23,7 +23,6 @@
namespace lyx { namespace lyx {
class Dialogs;
class RenderGraphic; class RenderGraphic;
class LaTeXFeatures; class LaTeXFeatures;

View File

@ -16,8 +16,6 @@
#include "debug.h" #include "debug.h"
#include "LyX.h" #include "LyX.h"
#include "frontends/Dialogs.h"
namespace lyx { namespace lyx {