Wrap most of the frontend code up inside namespace lyx::frontend.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8766 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2004-05-19 15:11:37 +00:00
parent 3e34d6f23c
commit 2a31934f38
458 changed files with 3007 additions and 751 deletions

View File

@ -1,3 +1,10 @@
2004-05-19 Angus Leeming <leeming@lyx.org>
* LaTeXFeatures.C:
* ToolbarBackend.C:
* bufferparams.C:
* lyxfunc.C: small changes due to the introduction of namespace
lyx::frontend and the moving of namespace biblio to lyx::biblio.
2004-05-18 Alfredo Braunstein <abraunst@lyx.org>

View File

@ -41,6 +41,8 @@ using std::ostream;
using std::ostringstream;
using std::set;
namespace biblio = lyx::biblio;
LaTeXFeatures::LaTeXFeatures(Buffer const & b, BufferParams const & p, bool n)
: buffer_(&b), params_(p), nice_(n)

View File

@ -212,6 +212,8 @@ void ToolbarBackend::add(Toolbar & tb,
string const ToolbarBackend::getIcon(FuncRequest const & f)
{
using lyx::frontend::find_xpm;
string fullname;
if (f.action == LFUN_INSERT_MATH) {

View File

@ -55,6 +55,8 @@ using std::ostream;
using std::ostringstream;
using std::pair;
namespace biblio = lyx::biblio;
struct BufferParams::Impl
{

View File

@ -37,6 +37,7 @@ class VSpace;
struct Language;
namespace lyx {
namespace biblio {
enum CiteEngine {
@ -54,6 +55,7 @@ public:
};
} // namespace biblio
} // namespace lyx
/** Buffer parameters.
@ -198,7 +200,7 @@ public:
};
AMS use_amsmath;
///
biblio::CiteEngine cite_engine;
lyx::biblio::CiteEngine cite_engine;
///
bool use_bibtopic;
/// revision tracking for this buffer ?

View File

@ -1,3 +1,9 @@
2004-05-19 Angus Leeming <leeming@lyx.org>
* Dialogs.[Ch]:
* LyXView.[Ch]: small changes due to the introduction of namespace
lyx::frontend and the moving of namespace biblio to lyx::biblio.
2004-04-28 Angus Leeming <leeming@lyx.org>
* LyXView.[Ch]:

View File

@ -21,6 +21,7 @@
using std::string;
using lyx::frontend::Dialog;
// Note that static boost signals break some compilers, so this wrapper

View File

@ -16,10 +16,15 @@
#include <boost/utility.hpp>
#include <boost/signals/signal0.hpp>
class Dialog;
class InsetBase;
class LyXView;
namespace lyx {
namespace frontend {
class Dialog;
} // namespace frontend
} // namespace lyx
/** Container of all dialogs.
*/
class Dialogs : boost::noncopyable
@ -98,9 +103,9 @@ private:
///
bool isValidName(std::string const & name) const;
///
Dialog * find_or_build(std::string const & name);
lyx::frontend::Dialog * find_or_build(std::string const & name);
///
typedef boost::shared_ptr<Dialog> DialogPtr;
typedef boost::shared_ptr<lyx::frontend::Dialog> DialogPtr;
///
DialogPtr build(std::string const & name);

View File

@ -48,6 +48,7 @@ using lyx::support::OnlyFilename;
using std::endl;
using std::string;
using lyx::frontend::ControlCommandBuffer;
string current_layout;

View File

@ -24,7 +24,6 @@ class Toolbars;
class InsetBase;
class Intl;
class Menubar;
class ControlCommandBuffer;
class BufferView;
class Dialogs;
@ -33,6 +32,12 @@ class LyXFont;
class Timeout;
class FuncRequest;
namespace lyx {
namespace frontend {
class ControlCommandBuffer;
} // namespace frontend
} // namespace lyx
/**
* LyXView - main LyX window
*
@ -170,7 +175,10 @@ protected:
/// view's command buffer controller
// this has to be declared _after_ lyxfunc_ as its initialization depends
// on it!
boost::scoped_ptr<ControlCommandBuffer> const controlcommand_;
typedef boost::scoped_ptr<lyx::frontend::ControlCommandBuffer>
CommandBufferPtr;
CommandBufferPtr const controlcommand_;
};
#endif // LYXVIEW_H

View File

@ -13,6 +13,8 @@
#include "BCView.h"
#include "ButtonController.h"
namespace lyx {
namespace frontend {
CheckedWidget::~CheckedWidget()
{}
@ -50,3 +52,6 @@ bool BCView::checkWidgets() const
// return valid status after checking ALL widgets
return valid;
}
} // namespace frontend
} // namespace lyx

View File

@ -18,6 +18,8 @@
#include <list>
#include <string>
namespace lyx {
namespace frontend {
class ButtonController;
class ButtonPolicy;
@ -134,6 +136,8 @@ private:
Widgets read_only_;
};
} // namespace frontend
} // namespace lyx
#include "BCView.tmpl"

View File

@ -19,6 +19,9 @@
#include "ButtonPolicies.h"
#include "debug.h"
namespace lyx {
namespace frontend {
template <class Button, class Widget>
GuiBC<Button, Widget>::GuiBC(ButtonController const & parent,
std::string const & cancel, std::string const & close)
@ -73,3 +76,6 @@ void GuiBC<Button, Widget>::refreshReadOnly() const
setWidgetEnabled(*iter, enable);
}
}
} // namespace frontend
} // namespace lyx

View File

@ -13,6 +13,8 @@
#include "ButtonController.h"
#include "BCView.h"
namespace lyx {
namespace frontend {
BCView & ButtonController::view() const
{
@ -112,3 +114,6 @@ bool ButtonController::readOnly(bool ro) const
view().refresh();
return ro;
}
} // namespace frontend
} // namespace lyx

View File

@ -12,15 +12,14 @@
#ifndef BUTTONCONTROLLER_H
#define BUTTONCONTROLLER_H
#include "ButtonPolicies.h"
#include <boost/scoped_ptr.hpp>
namespace lyx {
namespace frontend {
class BCView;
/** \c ButtonController controls the activation of the OK, Apply and
* Cancel buttons.
*
@ -87,4 +86,7 @@ private:
boost::scoped_ptr<BCView> view_;
};
} // namespace frontend
} // namespace lyx
#endif // BUTTONCONTROLLER_H

View File

@ -17,6 +17,9 @@
using std::endl;
using std::string;
namespace lyx {
namespace frontend {
namespace {
string const printState(ButtonPolicy::State const & state)
@ -625,3 +628,6 @@ void NoRepeatedApplyPolicy::input(SMInput input)
"NoRepeatedApplyPolicy");
}
}
} // namespace frontend
} // namespace lyx

View File

@ -21,6 +21,9 @@
#include "support/std_ostream.h"
namespace lyx {
namespace frontend {
/** An abstract base class for button policies.
A state machine implementation of the various button policies used by the
dialogs. Only the policy is implemented here. Separate ButtonController
@ -465,4 +468,7 @@ public:
}
};
} // namespace frontend
} // namespace lyx
#endif

View File

@ -1,3 +1,8 @@
2004-05-19 Angus Leeming <leeming@lyx.org>
* *.[Ch]: wrap all code up inside namespace lyx::frontend.
Move namespace biblio to lyx::biblio.
2004-05-14 Angus Leeming <leeming@lyx.org>
* biblio.[Ch] (asValidLatexCommand): new function which examines

View File

@ -21,16 +21,21 @@
#include <fstream>
using lyx::support::FileSearch;
using lyx::support::MakeDisplayPath;
using lyx::support::system_lyxdir;
using lyx::support::user_lyxdir;
using std::ostream;
using std::ostringstream;
using std::string;
namespace lyx {
using support::FileSearch;
using support::MakeDisplayPath;
using support::system_lyxdir;
using support::user_lyxdir;
namespace frontend {
ControlAboutlyx::ControlAboutlyx(Dialog & parent)
: Dialog::Controller(parent)
{}
@ -92,3 +97,6 @@ string const ControlAboutlyx::getVersion() const
return ss.str();
}
} // namespace frontend
} // namespace lyx

View File

@ -16,6 +16,9 @@
#include "Dialog.h"
#include <iosfwd>
namespace lyx {
namespace frontend {
/** \c ControlAboutlyx is a controller for the "About LyX" dialogs.
*/
class ControlAboutlyx : public Dialog::Controller {
@ -40,4 +43,7 @@ public:
//@}
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLABOUTLYX_H

View File

@ -25,14 +25,19 @@
#include "support/filetools.h"
#include "support/globbing.h"
using lyx::support::FileFilterList;
using lyx::support::OnlyFilename;
using std::pair;
using std::string;
using std::vector;
namespace lyx {
using support::FileFilterList;
using support::OnlyFilename;
namespace frontend {
ControlBibtex::ControlBibtex(Dialog & d)
: ControlCommand(d, "bibtex")
{}
@ -95,3 +100,6 @@ bool ControlBibtex::usingBibtopic() const
{
return kernel().buffer().params().use_bibtopic;
}
} // namespace frontend
} // namespace lyx

View File

@ -13,20 +13,19 @@
#ifndef CONTROLBIBTEX_H
#define CONTROLBIBTEX_H
#include "ControlCommand.h"
#include <vector>
namespace lyx {
namespace support {
class FileFilterList;
} // namespace support
} // namespace lyx
namespace frontend {
/** A controller for Bibtex dialogs.
*/
class ControlBibtex : public ControlCommand {
@ -37,7 +36,7 @@ public:
/// Browse for a file
std::string const browse(std::string const & in_name,
std::string const & title,
lyx::support::FileFilterList const & filters) const;
support::FileFilterList const & filters) const;
/// get the list of bst files
void getBibStyles(std::vector<std::string> & data) const;
/// get the list of bib files
@ -49,5 +48,7 @@ public:
bool usingBibtopic() const;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLBIBTEX_H

View File

@ -19,6 +19,8 @@
using std::string;
using std::vector;
namespace lyx {
namespace frontend {
ControlBox::ControlBox(Dialog & parent)
: Dialog::Controller(parent)
@ -80,3 +82,6 @@ void box_gui_tokens_special_length(vector<string> & ids,
gui_names.push_back(_("Total Height"));
gui_names.push_back(_("Width"));
}
} // namespace frontend
} // namespace lyx

View File

@ -18,6 +18,9 @@
class InsetBoxParams;
namespace lyx {
namespace frontend {
class ControlBox : public Dialog::Controller {
public:
///
@ -46,4 +49,7 @@ void box_gui_tokens(std::vector<std::string> &, std::vector<std::string> &);
void box_gui_tokens_special_length(std::vector<std::string> &,
std::vector<std::string> &);
} // namespace frontend
} // namespace lyx
#endif // CONTROLBOX_H

View File

@ -23,6 +23,8 @@
using std::string;
using std::vector;
namespace lyx {
namespace frontend {
ControlBranch::ControlBranch(Dialog & parent)
: Dialog::Controller(parent)
@ -55,3 +57,6 @@ BranchList const & ControlBranch::branchlist() const
{
return kernel().buffer().params().branchlist();
}
} // namespace frontend
} // namespace lyx

View File

@ -19,6 +19,8 @@
class BranchList;
class InsetBranchParams;
namespace lyx {
namespace frontend {
class ControlBranch : public Dialog::Controller {
public:
@ -43,4 +45,7 @@ private:
boost::scoped_ptr<InsetBranchParams> params_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLBRANCH_H

View File

@ -21,10 +21,14 @@
#include "lyxfind.h"
#include "support/lstrings.h"
using lyx::support::rtrim;
using std::string;
namespace lyx {
using support::rtrim;
namespace frontend {
ControlChanges::ControlChanges(Dialog & parent)
: Dialog::Controller(parent)
@ -33,7 +37,7 @@ ControlChanges::ControlChanges(Dialog & parent)
bool ControlChanges::find()
{
return lyx::find::findNextChange(kernel().bufferview());
return find::findNextChange(kernel().bufferview());
}
@ -71,12 +75,15 @@ string const ControlChanges::getChangeAuthor()
void ControlChanges::accept()
{
kernel().dispatch(FuncRequest(LFUN_ACCEPT_CHANGE));
lyx::find::findNextChange(kernel().bufferview());
find::findNextChange(kernel().bufferview());
}
void ControlChanges::reject()
{
kernel().dispatch(FuncRequest(LFUN_REJECT_CHANGE));
lyx::find::findNextChange(kernel().bufferview());
find::findNextChange(kernel().bufferview());
}
} // namespace frontend
} // namespace lyx

View File

@ -14,6 +14,9 @@
#include "Dialog.h"
namespace lyx {
namespace frontend {
/**
* A controller for the merge changes dialog.
*/
@ -46,4 +49,7 @@ public:
void reject();
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLCHANGES_H

View File

@ -24,6 +24,8 @@ using bv_funcs::font2string;
using std::string;
namespace lyx {
namespace frontend {
ControlCharacter::ControlCharacter(Dialog & parent)
: Dialog::Controller(parent),
@ -42,7 +44,7 @@ bool ControlCharacter::initialiseParams(string const &)
getSeries() != LyXFont::IGNORE_SERIES ||
getShape() != LyXFont::IGNORE_SHAPE ||
getSize() != LyXFont::IGNORE_SIZE ||
getBar() != frnt::IGNORE ||
getBar() != IGNORE ||
getColor() != LColor::ignore ||
font_->language() != ignore_language)
dialog().bc().valid();
@ -124,51 +126,51 @@ void ControlCharacter::setSize(LyXFont::FONT_SIZE val)
}
frnt::FONT_STATE ControlCharacter::getBar() const
FONT_STATE ControlCharacter::getBar() const
{
if (!font_.get())
return frnt::IGNORE;
return IGNORE;
if (font_->emph() == LyXFont::TOGGLE)
return frnt::EMPH_TOGGLE;
return EMPH_TOGGLE;
if (font_->underbar() == LyXFont::TOGGLE)
return frnt::UNDERBAR_TOGGLE;
return UNDERBAR_TOGGLE;
if (font_->noun() == LyXFont::TOGGLE)
return frnt::NOUN_TOGGLE;
return NOUN_TOGGLE;
if (font_->emph() == LyXFont::IGNORE &&
font_->underbar() == LyXFont::IGNORE &&
font_->noun() == LyXFont::IGNORE)
return frnt::IGNORE;
return IGNORE;
return frnt::INHERIT;
return INHERIT;
}
void ControlCharacter::setBar(frnt::FONT_STATE val)
void ControlCharacter::setBar(FONT_STATE val)
{
switch (val) {
case frnt::IGNORE:
case IGNORE:
font_->setEmph(LyXFont::IGNORE);
font_->setUnderbar(LyXFont::IGNORE);
font_->setNoun(LyXFont::IGNORE);
break;
case frnt::EMPH_TOGGLE:
case EMPH_TOGGLE:
font_->setEmph(LyXFont::TOGGLE);
break;
case frnt::UNDERBAR_TOGGLE:
case UNDERBAR_TOGGLE:
font_->setUnderbar(LyXFont::TOGGLE);
break;
case frnt::NOUN_TOGGLE:
case NOUN_TOGGLE:
font_->setNoun(LyXFont::TOGGLE);
break;
case frnt::INHERIT:
case INHERIT:
font_->setEmph(LyXFont::INHERIT);
font_->setUnderbar(LyXFont::INHERIT);
font_->setNoun(LyXFont::INHERIT);
@ -239,3 +241,6 @@ void ControlCharacter::setToggleAll(bool t)
{
toggleall_ = t;
}
} // namespace frontend
} // namespace lyx

View File

@ -19,6 +19,8 @@
class LColor_color;
namespace lyx {
namespace frontend {
class ControlCharacter : public Dialog::Controller {
public:
@ -42,7 +44,7 @@ public:
///
void setSize(LyXFont::FONT_SIZE);
///
void setBar(frnt::FONT_STATE);
void setBar(FONT_STATE);
///
void setColor(LColor_color);
///
@ -59,7 +61,7 @@ public:
///
LyXFont::FONT_SIZE getSize() const;
///
frnt::FONT_STATE getBar() const;
FONT_STATE getBar() const;
///
LColor_color getColor() const;
///
@ -73,4 +75,7 @@ private:
bool toggleall_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLCHARACTER_H

View File

@ -20,6 +20,8 @@ using std::string;
using std::vector;
using std::pair;
namespace lyx {
namespace frontend {
vector<biblio::CiteStyle> ControlCitation::citeStyles_;
@ -94,3 +96,6 @@ vector<string> const ControlCitation::getCiteStrings(string const & key) const
return styles;
}
} // namespace frontend
} // namespace lyx

View File

@ -16,6 +16,9 @@
#include "ControlCommand.h"
#include "biblio.h"
namespace lyx {
namespace frontend {
/** A controller for Citation dialogs.
*/
class ControlCitation : public ControlCommand {
@ -54,5 +57,7 @@ private:
static std::vector<biblio::CiteStyle> citeStyles_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLCITATION_H

View File

@ -18,6 +18,8 @@
using std::string;
namespace lyx {
namespace frontend {
ControlCommand::ControlCommand(Dialog & dialog, string const & lfun_name)
: Dialog::Controller(dialog),
@ -49,3 +51,6 @@ void ControlCommand::dispatchParams()
params_);
kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
}
} // namespace frontend
} // namespace lyx

View File

@ -19,6 +19,8 @@
#include "Dialog.h"
#include "insets/insetcommandparams.h"
namespace lyx {
namespace frontend {
class ControlCommand : public Dialog::Controller {
public:
@ -47,5 +49,7 @@ private:
std::string const lfun_name_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLCOMMAND_H

View File

@ -25,13 +25,16 @@
#include "support/lyxalgo.h"
#include "support/lstrings.h"
using lyx::support::prefixIs;
using std::back_inserter;
using std::transform;
using std::string;
using std::vector;
namespace lyx {
using support::prefixIs;
namespace frontend {
namespace {
@ -51,7 +54,7 @@ ControlCommandBuffer::ControlCommandBuffer(LyXView & lv)
: lv_(lv), history_pos_(history_.end())
{
transform(lyxaction.func_begin(), lyxaction.func_end(),
back_inserter(commands_), lyx::firster());
back_inserter(commands_), firster());
}
@ -86,7 +89,7 @@ ControlCommandBuffer::completions(string const & prefix, string & new_prefix)
{
vector<string> comp;
lyx::copy_if(commands_.begin(), commands_.end(),
copy_if(commands_.begin(), commands_.end(),
back_inserter(comp), prefix_p(prefix));
if (comp.empty()) {
@ -106,7 +109,7 @@ ControlCommandBuffer::completions(string const & prefix, string & new_prefix)
test += tmp[test.length()];
while (test.length() < tmp.length()) {
vector<string> vtmp;
lyx::copy_if(comp.begin(), comp.end(),
copy_if(comp.begin(), comp.end(),
back_inserter(vtmp), prefix_p(test));
if (vtmp.size() != comp.size()) {
test.erase(test.length() - 1);
@ -129,3 +132,6 @@ void ControlCommandBuffer::dispatch(string const & str)
history_pos_ = history_.end();
lv_.getLyXFunc().dispatch(lyxaction.lookupFunc(str), true);
}
} // namespace frontend
} // namespace lyx

View File

@ -20,6 +20,9 @@
class LyXView;
namespace lyx {
namespace frontend {
/**
* ControlCommandBuffer
*
@ -59,4 +62,7 @@ private:
std::vector<std::string>::const_iterator history_pos_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLCOMMANDBUFFER_H

View File

@ -26,6 +26,8 @@
using std::ostringstream;
using std::string;
namespace lyx {
namespace frontend {
ControlDocument::ControlDocument(Dialog & parent)
: Dialog::Controller(parent)
@ -83,9 +85,9 @@ void ControlDocument::dispatchParams()
setLanguage();
// Set the document class.
lyx::textclass_type const old_class =
textclass_type const old_class =
kernel().buffer().params().textclass;
lyx::textclass_type const new_class = bp_->textclass;
textclass_type const new_class = bp_->textclass;
if (new_class != old_class) {
string const name = textclasslist[new_class].name();
@ -130,7 +132,7 @@ void ControlDocument::setLanguage() const
}
bool ControlDocument::loadTextclass(lyx::textclass_type tc) const
bool ControlDocument::loadTextclass(textclass_type tc) const
{
string const name = textclasslist[tc].name();
kernel().dispatch(FuncRequest(LFUN_TEXTCLASS_LOAD, name));
@ -145,3 +147,6 @@ void ControlDocument::saveAsDefault() const
{
dispatch_bufferparams(kernel(), params(), LFUN_SAVE_AS_DEFAULT);
}
} // namespace frontend
} // namespace lyx

View File

@ -19,6 +19,8 @@
class BufferParams;
class LyXTextClass;
namespace lyx {
namespace frontend {
/** A controller for Document dialogs.
*/
@ -45,10 +47,13 @@ public:
///
void saveAsDefault() const;
///
bool loadTextclass(lyx::textclass_type tc) const;
bool loadTextclass(textclass_type tc) const;
private:
///
boost::scoped_ptr<BufferParams> bp_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLDOCUMENT_H

View File

@ -17,6 +17,8 @@
using std::string;
namespace lyx {
namespace frontend {
ControlERT::ControlERT(Dialog & parent)
: Dialog::Controller(parent), status_(InsetERT::Collapsed)
@ -41,3 +43,6 @@ void ControlERT::dispatchParams()
string const lfun = InsetERTMailer::params2string(status_);
kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
}
} // namespace frontend
} // namespace lyx

View File

@ -17,6 +17,8 @@
#include "Dialog.h"
#include "insets/insetert.h" // InsetERT::ERTStatus
namespace lyx {
namespace frontend {
class ControlERT : public Dialog::Controller {
public:
@ -39,4 +41,7 @@ private:
InsetCollapsable::CollapseStatus status_;
};
} // namespace frontend
} // namespace lyx
#endif

View File

@ -21,6 +21,8 @@
using std::endl;
using std::string;
namespace lyx {
namespace frontend {
ControlErrorList::ControlErrorList(Dialog & d)
: Dialog::Controller(d)
@ -66,9 +68,9 @@ void ControlErrorList::goTo(int item)
return;
}
lyx::pos_type const end = std::min(err.pos_end, pit->size());
lyx::pos_type const start = std::min(err.pos_start, end);
lyx::pos_type const range = end - start;
pos_type const end = std::min(err.pos_end, pit->size());
pos_type const start = std::min(err.pos_start, end);
pos_type const range = end - start;
// Now make the selection.
#ifdef WITH_WARNINGS
@ -80,3 +82,6 @@ void ControlErrorList::goTo(int item)
kernel().bufferview()->putSelectionAt(pos, range, false);
#endif
}
} // namespace frontend
} // namespace lyx

View File

@ -15,12 +15,11 @@
#include "errorlist.h"
#include "Dialog.h"
namespace lyx {
namespace frontend {
/** A controller for the ErrorList dialog.
*/
class ControlErrorList : public Dialog::Controller {
public:
///
@ -47,4 +46,7 @@ private:
std::string name_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLERRORLIST_H

View File

@ -31,16 +31,18 @@
#include "support/globbing.h"
#include "support/tostr.h"
namespace external = lyx::external;
using lyx::support::FileFilterList;
using lyx::support::MakeAbsPath;
using lyx::support::readBB_from_PSFile;
using std::advance;
using std::vector;
using std::string;
namespace lyx {
using support::FileFilterList;
using support::MakeAbsPath;
using support::readBB_from_PSFile;
namespace frontend {
ControlExternal::ControlExternal(Dialog & parent)
: Dialog::Controller(parent),
@ -177,9 +179,9 @@ string const ControlExternal::readBB(string const & file)
int width = 0;
int height = 0;
lyx::graphics::Cache & gc = lyx::graphics::Cache::get();
graphics::Cache & gc = graphics::Cache::get();
if (gc.inCache(abs_file)) {
lyx::graphics::Image const * image = gc.item(abs_file)->image();
graphics::Image const * image = gc.item(abs_file)->image();
if (image) {
width = image->getWidth();
@ -190,27 +192,32 @@ string const ControlExternal::readBB(string const & file)
return ("0 0 " + tostr(width) + ' ' + tostr(height));
}
} // namespace frontend
namespace external {
namespace {
external::RotationDataType origins_array[] = {
external::RotationData::DEFAULT,
external::RotationData::TOPLEFT,
external::RotationData::BOTTOMLEFT,
external::RotationData::BASELINELEFT,
external::RotationData::CENTER,
external::RotationData::TOPCENTER,
external::RotationData::BOTTOMCENTER,
external::RotationData::BASELINECENTER,
external::RotationData::TOPRIGHT,
external::RotationData::BOTTOMRIGHT,
external::RotationData::BASELINERIGHT
RotationDataType origins_array[] = {
RotationData::DEFAULT,
RotationData::TOPLEFT,
RotationData::BOTTOMLEFT,
RotationData::BASELINELEFT,
RotationData::CENTER,
RotationData::TOPCENTER,
RotationData::BOTTOMCENTER,
RotationData::BASELINECENTER,
RotationData::TOPRIGHT,
RotationData::BOTTOMRIGHT,
RotationData::BASELINERIGHT
};
lyx::size_type const origins_array_size =
size_type const origins_array_size =
sizeof(origins_array) / sizeof(origins_array[0]);
vector<external::RotationDataType> const
vector<RotationDataType> const
origins(origins_array, origins_array + origins_array_size);
// These are the strings, corresponding to the above, that the GUI should
@ -224,8 +231,6 @@ char const * const origin_gui_strs[] = {
} // namespace anon
namespace lyx {
namespace external {
vector<RotationDataType> const & all_origins()
{

View File

@ -27,12 +27,16 @@
class InsetExternalParams;
namespace lyx {
namespace external {
class Template;
class RotationDataType;
} // namespace external
} // namespace lyx
} // namespace external
namespace frontend {
class ControlExternal : public Dialog::Controller {
public:
@ -59,7 +63,7 @@ public:
///
int getTemplateNumber(std::string const &) const;
///
lyx::external::Template getTemplate(int) const;
external::Template getTemplate(int) const;
///
std::string const browse(std::string const & input_file,
std::string const & tempalate_name) const;
@ -75,12 +79,13 @@ private:
bool bb_changed_;
};
} // namespace frontend
namespace lyx {
namespace external {
std::vector<RotationDataType> const & all_origins();
std::string const origin_gui_str(lyx::size_type i);
std::string const origin_gui_str(size_type i);
} // namespace external
} // namespace lyx

View File

@ -17,6 +17,8 @@
using std::string;
namespace lyx {
namespace frontend {
ControlFloat::ControlFloat(Dialog & parent)
: Dialog::Controller(parent)
@ -43,3 +45,6 @@ void ControlFloat::dispatchParams()
string const lfun = InsetFloatMailer::params2string(params());
kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
}
} // namespace frontend
} // namespace lyx

View File

@ -16,6 +16,9 @@
class InsetFloatParams;
namespace lyx {
namespace frontend {
class ControlFloat : public Dialog::Controller {
public:
///
@ -37,4 +40,7 @@ private:
boost::scoped_ptr<InsetFloatParams> params_;
};
} // namespace frontend
} // namespace lyx
#endif

View File

@ -32,20 +32,24 @@
#include "support/tostr.h"
#include "support/types.h"
using lyx::support::AddName;
using lyx::support::FileFilterList;
using lyx::support::FileInfo;
using lyx::support::IsFileReadable;
using lyx::support::MakeAbsPath;
using lyx::support::readBB_from_PSFile;
using lyx::support::system_lyxdir;
using lyx::support::user_lyxdir;
using std::make_pair;
using std::string;
using std::pair;
using std::vector;
namespace lyx {
using support::AddName;
using support::FileFilterList;
using support::FileInfo;
using support::IsFileReadable;
using support::MakeAbsPath;
using support::readBB_from_PSFile;
using support::system_lyxdir;
using support::user_lyxdir;
namespace frontend {
ControlGraphics::ControlGraphics(Dialog & parent)
: Dialog::Controller(parent)
@ -111,9 +115,9 @@ string const ControlGraphics::readBB(string const & file)
int width = 0;
int height = 0;
lyx::graphics::Cache & gc = lyx::graphics::Cache::get();
graphics::Cache & gc = graphics::Cache::get();
if (gc.inCache(abs_file)) {
lyx::graphics::Image const * image = gc.item(abs_file)->image();
graphics::Image const * image = gc.item(abs_file)->image();
if (image) {
width = image->getWidth();
@ -143,7 +147,6 @@ void ControlGraphics::editGraphics()
kernel().dispatch(FuncRequest(LFUN_GRAPHICS_EDIT, lfun));
}
namespace frnt {
namespace {
@ -186,7 +189,7 @@ vector<RotationOriginPair> getRotationOriginData()
return data;
data.resize(rorigin_size);
for (lyx::size_type i = 0; i < rorigin_size; ++i) {
for (size_type i = 0; i < rorigin_size; ++i) {
data[i] = make_pair(_(rorigin_gui_strs[i]),
rorigin_lyx_strs[i]);
}
@ -194,4 +197,5 @@ vector<RotationOriginPair> getRotationOriginData()
return data;
}
} // namespace frnt
} // namespace frontend
} // namespace lyx

View File

@ -23,9 +23,11 @@ class InsetGraphics;
class InsetGraphicsParams;
class LyXView;
namespace lyx {
namespace frontend {
/** A controller for Graphics dialogs.
*/
class ControlGraphics : public Dialog::Controller {
public:
///
@ -59,7 +61,6 @@ private:
boost::scoped_ptr<InsetGraphicsParams> params_;
};
namespace frnt {
/// get the units for the bounding box
std::vector<std::string> const getBBUnits();
@ -69,6 +70,7 @@ typedef std::pair<std::string, std::string> RotationOriginPair;
///
std::vector<RotationOriginPair> getRotationOriginData();
} // namespace frnt
} // namespace frontend
} // namespace lyx
#endif // CONTROLGRAPHICS_H

View File

@ -28,14 +28,17 @@
#include <utility>
using lyx::support::FileFilterList;
using lyx::support::IsFileReadable;
using lyx::support::MakeAbsPath;
using lyx::support::OnlyPath;
using std::pair;
using std::string;
namespace lyx {
using support::FileFilterList;
using support::IsFileReadable;
using support::MakeAbsPath;
using support::OnlyPath;
namespace frontend {
ControlInclude::ControlInclude(Dialog & parent)
: Dialog::Controller(parent)
@ -110,3 +113,6 @@ bool ControlInclude::fileExists(string const & file)
return false;
}
} // namespace frontend
} // namespace lyx

View File

@ -18,6 +18,8 @@
#include "Dialog.h"
#include "insets/insetcommandparams.h"
namespace lyx {
namespace frontend {
/** A controller for the Include file dialog.
*/
@ -62,4 +64,7 @@ private:
InsetCommandParams params_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLINCLUDE_H

View File

@ -24,6 +24,8 @@ using std::istringstream;
using std::ostream;
using std::string;
namespace lyx {
namespace frontend {
ControlLog::ControlLog(Dialog & parent)
: Dialog::Controller(parent),
@ -115,3 +117,6 @@ void ControlLog::getContents(std::ostream & ss) const
break;
}
}
} // namespace frontend
} // namespace lyx

View File

@ -15,6 +15,9 @@
#include "Dialog.h"
namespace lyx {
namespace frontend {
/**
* A controller for a read-only text browser.
*/
@ -51,4 +54,7 @@ private:
std::string logfile_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLLOG_H

View File

@ -18,12 +18,15 @@
#include "support/lstrings.h"
#include "support/filetools.h"
using lyx::support::compare;
using lyx::support::LibFileSearch;
using lyx::support::subst;
using std::string;
namespace lyx {
using support::compare;
using support::LibFileSearch;
using support::subst;
namespace frontend {
ControlMath::ControlMath(Dialog & dialog)
: Dialog::Controller(dialog)
@ -344,7 +347,7 @@ string const find_xpm(string const & name)
{
XPMmap const * const begin = sorted_xpm_map;
XPMmap const * const end = begin + nr_sorted_xpm_map;
BOOST_ASSERT(lyx::sorted(begin, end));
BOOST_ASSERT(sorted(begin, end));
XPMmap const * const it =
std::find_if(begin, end, CompareKey(name));
@ -372,3 +375,6 @@ string const find_xpm(string const & name)
return LibFileSearch("images/math/", xpm_name, "xpm");
}
} // namespace frontend
} // namespace lyx

View File

@ -18,6 +18,8 @@
#include "Dialog.h"
#include "lfuns.h" // for kb_action
namespace lyx {
namespace frontend {
class ControlMath : public Dialog::Controller {
public:
@ -87,4 +89,7 @@ extern int const nr_latex_ams_ops;
*/
std::string const find_xpm(std::string const & name);
} // namespace frontend
} // namespace lyx
#endif // NOT CONTROLMATH

View File

@ -18,6 +18,8 @@
using std::string;
namespace lyx {
namespace frontend {
ControlNote::ControlNote(Dialog & parent)
: Dialog::Controller(parent)
@ -44,3 +46,6 @@ void ControlNote::dispatchParams()
string const lfun = InsetNoteMailer::params2string(params());
kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
}
} // namespace frontend
} // namespace lyx

View File

@ -18,6 +18,9 @@
class InsetNoteParams;
namespace lyx {
namespace frontend {
class ControlNote : public Dialog::Controller {
public:
///
@ -40,4 +43,7 @@ private:
boost::scoped_ptr<InsetNoteParams> params_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLNOTE_H

View File

@ -24,6 +24,8 @@ using std::istringstream;
using std::ostringstream;
using std::string;
namespace lyx {
namespace frontend {
ControlParagraph::ControlParagraph(Dialog & parent)
: Dialog::Controller(parent), ininset_(false)
@ -157,3 +159,6 @@ LyXAlignment ControlParagraph::alignDefault() const
{
return aligndefault_;
}
} // namespace frontend
} // namespace lyx

View File

@ -17,6 +17,9 @@
class ParagraphParameters;
namespace lyx {
namespace frontend {
class ControlParagraph : public Dialog::Controller {
public:
///
@ -51,4 +54,7 @@ private:
LyXAlignment aligndefault_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLPARAGRAPH_H

View File

@ -17,6 +17,8 @@
using std::string;
namespace lyx {
namespace frontend {
ControlPreamble::ControlPreamble(Dialog & parent)
: Dialog::Controller(parent)
@ -57,3 +59,6 @@ void ControlPreamble::params(string const & newparams)
{
params_ = newparams;
}
} // namespace frontend
} // namespace lyx

View File

@ -14,6 +14,9 @@
#include "Dialog.h"
namespace lyx {
namespace frontend {
/** A controller for Preamble dialogs.
*/
class ControlPreamble : public Dialog::Controller {
@ -38,4 +41,7 @@ private:
std::string params_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLPREAMBLE_H

View File

@ -26,11 +26,6 @@
#include "support/std_sstream.h"
using lyx::support::AddName;
using lyx::support::FileFilterList;
using lyx::support::system_lyxdir;
using lyx::support::user_lyxdir;
using std::ostringstream;
using std::pair;
using std::string;
@ -39,6 +34,16 @@ using std::vector;
extern BufferList bufferlist;
namespace lyx {
using support::AddName;
using support::FileFilterList;
using support::system_lyxdir;
using support::user_lyxdir;
namespace frontend {
ControlPrefs::ControlPrefs(Dialog & parent)
: Dialog::Controller(parent),
redraw_gui_(false),
@ -171,3 +176,6 @@ string const ControlPrefs::browsedir(string const & path,
{
return browseDir(path, title);
}
} // namespace frontend
} // namespace lyx

View File

@ -22,6 +22,8 @@
class LColor_color;
namespace lyx {
namespace frontend {
class ControlPrefs : public Dialog::Controller {
public:
@ -84,4 +86,7 @@ private:
bool update_screen_font_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLPREFS_H

View File

@ -25,11 +25,16 @@
#include "support/filetools.h"
#include "support/globbing.h"
using lyx::support::ChangeExtension;
using lyx::support::FileFilterList;
using std::string;
namespace lyx {
using support::ChangeExtension;
using support::FileFilterList;
namespace frontend {
ControlPrint::ControlPrint(Dialog & parent)
: Dialog::Controller(parent),
params_(0)
@ -136,3 +141,6 @@ void ControlPrint::dispatchParams()
string const data = target + " " + target_name + " " + command;
kernel().dispatch(FuncRequest(LFUN_PRINT, data));
}
} // namespace frontend
} // namespace lyx

View File

@ -18,6 +18,9 @@
class PrinterParams;
namespace lyx {
namespace frontend {
/** A controller for Print dialogs.
*/
class ControlPrint : public Dialog::Controller {
@ -42,4 +45,7 @@ private:
boost::scoped_ptr<PrinterParams> params_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLPRINT_H

View File

@ -18,15 +18,18 @@
#include "support/filetools.h" // MakeAbsPath, MakeDisplayPath
using lyx::support::MakeAbsPath;
using lyx::support::MakeDisplayPath;
using std::vector;
using std::string;
extern BufferList bufferlist;
namespace lyx {
using support::MakeAbsPath;
using support::MakeDisplayPath;
namespace frontend {
ControlRef::ControlRef(Dialog & d)
: ControlCommand(d, "ref")
@ -82,3 +85,6 @@ string const ControlRef::getBufferName(int num) const
{
return bufferlist.getFileNames()[num];
}
} // namespace frontend
} // namespace lyx

View File

@ -16,6 +16,8 @@
#include "ControlCommand.h"
#include <vector>
namespace lyx {
namespace frontend {
/** A controller for the Ref Dialog.
*/
@ -41,4 +43,7 @@ private:
virtual bool disconnectOnApply() const { return true; }
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLREF_H

View File

@ -17,6 +17,8 @@
using std::string;
namespace lyx {
namespace frontend {
ControlSearch::ControlSearch(Dialog & parent)
: Dialog::Controller(parent)
@ -26,8 +28,8 @@ ControlSearch::ControlSearch(Dialog & parent)
void ControlSearch::find(string const & search, bool casesensitive,
bool matchword, bool forward)
{
string const data = lyx::find::find2string(search, casesensitive,
matchword, forward);
string const data = find::find2string(search, casesensitive,
matchword, forward);
kernel().dispatch(FuncRequest(LFUN_WORD_FIND, data));
}
@ -37,7 +39,10 @@ void ControlSearch::replace(string const & search, string const & replace,
bool forward, bool all)
{
string const data =
lyx::find::replace2string(search, replace, casesensitive,
matchword, all, forward);
find::replace2string(search, replace, casesensitive,
matchword, all, forward);
kernel().dispatch(FuncRequest(LFUN_WORD_REPLACE, data));
}
} // namespace frontend
} // namespace lyx

View File

@ -14,6 +14,8 @@
#include "Dialog.h"
namespace lyx {
namespace frontend {
/** A controller for Search dialogs.
*/
@ -36,4 +38,7 @@ public:
bool forward, bool all);
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLSEARCH_H

View File

@ -20,12 +20,16 @@
#include "support/filetools.h"
#include "support/lstrings.h"
using lyx::support::AddName;
using lyx::support::trim;
using std::vector;
using std::string;
namespace lyx {
using support::AddName;
using support::trim;
namespace frontend {
ControlSendto::ControlSendto(Dialog & parent)
: Dialog::Controller(parent)
@ -110,3 +114,6 @@ void ControlSendto::setCommand(string const & cmd)
{
command_ = trim(cmd);
}
} // namespace frontend
} // namespace lyx

View File

@ -17,6 +17,9 @@
class Format;
namespace lyx {
namespace frontend {
/** A controller for the Custom Export dialogs.
*/
class ControlSendto : public Dialog::Controller {
@ -49,4 +52,7 @@ private:
std::string command_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLSENDTO_H

View File

@ -13,12 +13,15 @@
#include "ControlShowFile.h"
#include "support/filetools.h"
using lyx::support::GetFileContents;
using lyx::support::OnlyFilename;
using std::string;
namespace lyx {
using support::GetFileContents;
using support::OnlyFilename;
namespace frontend {
ControlShowFile::ControlShowFile(Dialog & parent)
: Dialog::Controller(parent)
@ -48,3 +51,6 @@ string ControlShowFile::getFileName()
{
return OnlyFilename(filename_);
}
} // namespace frontend
} // namespace lyx

View File

@ -14,6 +14,9 @@
#include "Dialog.h"
namespace lyx {
namespace frontend {
/** A controller for the ShowFile dialog. */
class ControlShowFile : public Dialog::Controller {
@ -38,4 +41,7 @@ private:
std::string filename_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLSHOWFILE_H

View File

@ -36,13 +36,17 @@
#include "frontends/Alert.h"
using lyx::support::bformat;
using std::advance;
using std::distance;
using std::endl;
using std::string;
namespace lyx {
using support::bformat;
namespace frontend {
ControlSpellchecker::ControlSpellchecker(Dialog & parent)
: Dialog::Controller(parent),
@ -259,7 +263,7 @@ void ControlSpellchecker::replace(string const & replacement)
lyxerr << "ControlSpellchecker::replace("
<< replacement << ")" << std::endl;
BufferView & bufferview = *kernel().bufferview();
lyx::cap::replaceWord(bufferview.cursor(), replacement);
cap::replaceWord(bufferview.cursor(), replacement);
kernel().buffer().markDirty();
bufferview.update();
// fix up the count
@ -299,3 +303,6 @@ void ControlSpellchecker::ignoreAll()
speller_->accept(word_);
check();
}
} // namespace frontend
} // namespace lyx

View File

@ -16,9 +16,11 @@
#include "WordLangTuple.h"
#include <boost/scoped_ptr.hpp>
class SpellBase;
namespace lyx {
namespace frontend {
/** A controller for Spellchecker dialogs.
*/
class ControlSpellchecker : public Dialog::Controller {
@ -88,4 +90,7 @@ private:
boost::scoped_ptr<SpellBase> speller_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLSPELLCHECKER_H

View File

@ -19,6 +19,8 @@
using std::string;
namespace lyx {
namespace frontend {
ControlTabular::ControlTabular(Dialog & parent)
: Dialog::Controller(parent), active_cell_(-1)
@ -218,3 +220,6 @@ void ControlTabular::longTabular(bool yes)
else
set(LyXTabular::UNSET_LONGTABULAR);
}
} // namespace frontend
} // namespace lyx

View File

@ -19,6 +19,8 @@
#include "Dialog.h"
#include "tabular.h"
namespace lyx {
namespace frontend {
class ControlTabular : public Dialog::Controller {
public:
@ -74,4 +76,7 @@ private:
boost::scoped_ptr<LyXTabular> params_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLTABULAR_H

View File

@ -18,6 +18,8 @@
using std::string;
namespace lyx {
namespace frontend {
ControlTabularCreate::ControlTabularCreate(Dialog & parent)
: Dialog::Controller(parent)
@ -44,3 +46,6 @@ void ControlTabularCreate::dispatchParams()
string data = tostr(params().first) + ' ' + tostr(params().second);
kernel().dispatch(FuncRequest(LFUN_TABULAR_INSERT, data));
}
} // namespace frontend
} // namespace lyx

View File

@ -15,6 +15,9 @@
#include "Dialog.h"
#include <utility>
namespace lyx {
namespace frontend {
/** A controller for the TabularCreate Dialog.
*/
class ControlTabularCreate : public Dialog::Controller {
@ -40,4 +43,7 @@ private:
rowsCols params_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLTABULARCREATE_H

View File

@ -16,6 +16,8 @@
using std::string;
namespace lyx {
namespace frontend {
void getTexFileList(ControlTexinfo::texFileSuffix type,
std::vector<string> & list)
@ -59,3 +61,6 @@ string const ControlTexinfo::getClassOptions(string const & filename) const
{
return getListOfOptions(filename, "cls");
}
} // namespace frontend
} // namespace lyx

View File

@ -16,6 +16,9 @@
#include "Dialog.h"
#include "tex_helpers.h"
namespace lyx {
namespace frontend {
/** A controller for Texinfo dialogs. */
class ControlTexinfo : public Dialog::Controller {
@ -50,4 +53,7 @@ private:
void getTexFileList(ControlTexinfo::texFileSuffix type,
std::vector<std::string> & contents);
} // namespace frontend
} // namespace lyx
#endif // CONTROLTEXINFO_H

View File

@ -17,6 +17,8 @@
using std::string;
namespace lyx {
namespace frontend {
ControlThesaurus::ControlThesaurus(Dialog & parent)
: Dialog::Controller(parent)
@ -43,11 +45,11 @@ void ControlThesaurus::replace(string const & newstr)
* deletion/change !
*/
string const data =
lyx::find::replace2string(oldstr_, newstr,
true, // case sensitive
true, // match word
false, // all words
true); // forward
find::replace2string(oldstr_, newstr,
true, // case sensitive
true, // match word
false, // all words
true); // forward
kernel().dispatch(FuncRequest(LFUN_WORD_REPLACE, data));
}
@ -58,3 +60,6 @@ Thesaurus::Meanings const & ControlThesaurus::getMeanings(string const & str)
meanings_ = thesaurus.lookup(str);
return meanings_;
}
} // namespace frontend
} // namespace lyx

View File

@ -16,6 +16,9 @@
#include "Dialog.h"
#include "Thesaurus.h"
namespace lyx {
namespace frontend {
/** A controller for Thesaurus dialogs.
*/
class ControlThesaurus : public Dialog::Controller {
@ -54,4 +57,7 @@ private:
virtual void apply() {}
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLTHESAURUS_H

View File

@ -18,13 +18,15 @@ using std::string;
class Buffer;
namespace lyx {
namespace frontend {
ControlToc::ControlToc(Dialog & d)
: ControlCommand(d, "toc")
{}
void ControlToc::goTo(lyx::toc::TocItem const & item)
void ControlToc::goTo(toc::TocItem const & item)
{
item.goTo(kernel().lyxview());
}
@ -32,24 +34,27 @@ void ControlToc::goTo(lyx::toc::TocItem const & item)
vector<string> const ControlToc::getTypes() const
{
return lyx::toc::getTypes(kernel().buffer());
return toc::getTypes(kernel().buffer());
}
lyx::toc::Toc const ControlToc::getContents(string const & type) const
toc::Toc const ControlToc::getContents(string const & type) const
{
lyx::toc::Toc empty_list;
toc::Toc empty_list;
// This shouldn't be possible...
if (!kernel().isBufferAvailable()) {
return empty_list;
}
lyx::toc::TocList tmp = lyx::toc::getTocList(kernel().buffer());
lyx::toc::TocList::iterator it = tmp.find(type);
toc::TocList tmp = toc::getTocList(kernel().buffer());
toc::TocList::iterator it = tmp.find(type);
if (it == tmp.end()) {
return empty_list;
}
return it->second;
}
} // namespace frontend
} // namespace lyx

View File

@ -17,6 +17,9 @@
#include "toc.h"
#include <vector>
namespace lyx {
namespace frontend {
/** A controller for TOC dialogs.
*/
class ControlToc : public ControlCommand {
@ -25,13 +28,16 @@ public:
ControlToc(Dialog &);
/// Goto this paragraph id
void goTo(lyx::toc::TocItem const &);
void goTo(toc::TocItem const &);
/// Return the list of types available
std::vector<std::string> const getTypes() const;
/// Given a type, returns the contents
lyx::toc::Toc const getContents(std::string const & type) const;
toc::Toc const getContents(std::string const & type) const;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLTOC_H

View File

@ -21,6 +21,8 @@
using std::istringstream;
using std::string;
namespace lyx {
namespace frontend {
ControlVSpace::ControlVSpace(Dialog & parent)
: Dialog::Controller(parent)
@ -61,3 +63,6 @@ VSpace const & ControlVSpace::params() const
{
return params_;
}
} // namespace frontend
} // namespace lyx

View File

@ -16,6 +16,8 @@
#include "Dialog.h"
#include "vspace.h"
namespace lyx {
namespace frontend {
class ControlVSpace : public Dialog::Controller {
public:
@ -41,4 +43,7 @@ private:
VSpace params_;
};
} // namespace frontend
} // namespace lyx
#endif // CONTROLPARAGRAPH_H

View File

@ -17,6 +17,8 @@
using std::string;
namespace lyx {
namespace frontend {
ControlWrap::ControlWrap(Dialog & parent)
: Dialog::Controller(parent)
@ -43,3 +45,6 @@ void ControlWrap::dispatchParams()
string const lfun = InsetWrapMailer::params2string(params());
kernel().dispatch(FuncRequest(LFUN_INSET_APPLY, lfun));
}
} // namespace frontend
} // namespace lyx

View File

@ -16,6 +16,9 @@
class InsetWrapParams;
namespace lyx {
namespace frontend {
class ControlWrap : public Dialog::Controller {
public:
///
@ -37,4 +40,7 @@ private:
boost::scoped_ptr<InsetWrapParams> params_;
};
} // namespace frontend
} // namespace lyx
#endif

View File

@ -18,6 +18,8 @@
using std::string;
namespace lyx {
namespace frontend {
Dialog::Dialog(LyXView & lv, string const & name)
: is_closing_(false), kernel_(lv), name_(name),
@ -203,3 +205,6 @@ string const & Dialog::View::getTitle() const
void Dialog::View::partialUpdate(int)
{}
} // namespace frontend
} // namespace lyx

View File

@ -12,16 +12,17 @@
#ifndef DIALOG_H
#define DIALOG_H
#include "Kernel.h"
#include <boost/utility.hpp>
#include <boost/scoped_ptr.hpp>
class LyXView;
class ButtonController;
namespace lyx {
namespace frontend {
class ButtonController;
/** \c Dialog collects the different parts of a Model-Controller-View
* split of a generic dialog together.
@ -251,5 +252,7 @@ private:
std::string title_;
};
} // namespace frontend
} // namespace lyx
#endif // DIALOG_H

View File

@ -22,6 +22,8 @@
using std::string;
namespace lyx {
namespace frontend {
Kernel::Kernel(LyXView & lyxview)
: lyxview_(lyxview)
@ -110,3 +112,6 @@ Buffer const & Kernel::buffer() const
BOOST_ASSERT(lyxview_.buffer());
return *lyxview_.buffer();
}
} // namespace frontend
} // namespace lyx

View File

@ -14,12 +14,13 @@
#include <string>
class Buffer;
class BufferView;
class FuncRequest;
class LyXView;
namespace lyx {
namespace frontend {
/** \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-
@ -102,5 +103,7 @@ private:
LyXView & lyxview_;
};
} // namespace frontend
} // namespace lyx
#endif // KERNEL_H

View File

@ -24,24 +24,26 @@
#include <algorithm>
using lyx::support::ascii_lowercase;
using lyx::support::bformat;
using lyx::support::compare_ascii_no_case;
using lyx::support::contains;
using lyx::support::getVectorFromString;
using lyx::support::ltrim;
using lyx::support::prefixIs;
using lyx::support::rtrim;
using lyx::support::split;
using lyx::support::subst;
using lyx::support::token;
using lyx::support::trim;
using std::string;
using std::ostringstream;
using std::vector;
namespace lyx {
using support::ascii_lowercase;
using support::bformat;
using support::compare_ascii_no_case;
using support::contains;
using support::getVectorFromString;
using support::ltrim;
using support::prefixIs;
using support::rtrim;
using support::split;
using support::subst;
using support::token;
using support::trim;
namespace biblio {
namespace {
@ -822,3 +824,4 @@ getAuthorYearStrings(string const & key,
}
} // namespace biblio
} // namespace lyx

View File

@ -19,6 +19,7 @@
class Buffer;
/** Functions of use to citation and bibtex GUI controllers and views */
namespace lyx {
namespace biblio {
class CiteEngine_enum;
@ -156,6 +157,8 @@ std::vector<std::string> const
getAuthorYearStrings(std::string const & key,
InfoMap const & map,
std::vector<CiteStyle> const & styles);
} // namespace biblio
} // namespace lyx
#endif // BIBLIOHELPERS_H

View File

@ -17,7 +17,8 @@
using std::vector;
namespace frnt {
namespace lyx {
namespace frontend {
vector<FamilyPair> const getFamilyData()
{
@ -258,4 +259,5 @@ vector<ColorPair> const getColorData()
return color;
}
} // namespace frnt
} // namespace frontend
} // namespace lyx

View File

@ -23,7 +23,8 @@ class LColor_color;
/** Functions of use to the character GUI controller and view */
namespace frnt {
namespace lyx {
namespace frontend {
///
enum FONT_STATE {
@ -65,6 +66,7 @@ std::vector<BarPair> const getBarData();
///
std::vector<ColorPair> const getColorData();
} // namespace frnt
} // namespace frontend
} // namespace lyx
#endif // CHARACTERHELPERS

View File

@ -22,21 +22,23 @@ using std::string;
using std::vector;
namespace lyx {
namespace frontend {
namespace {
struct Sorter
: public std::binary_function<frnt::LanguagePair,
frnt::LanguagePair, bool>
: public std::binary_function<LanguagePair,
LanguagePair, bool>
{
bool operator()(frnt::LanguagePair const & lhs,
frnt::LanguagePair const & rhs) const {
bool operator()(LanguagePair const & lhs,
LanguagePair const & rhs) const {
return lhs.first < rhs.first;
}
};
} // namespace anon
namespace frnt {
vector<LanguagePair> const getLanguageData(bool character_dlg)
{
@ -69,4 +71,5 @@ vector<LanguagePair> const getLanguageData(bool character_dlg)
return langs;
}
} // namespace frnt
} // namespace frontend
} // namespace lyx

View File

@ -18,7 +18,8 @@
#include <utility>
#include <vector>
namespace frnt {
namespace lyx {
namespace frontend {
///
typedef std::pair<std::string, std::string> LanguagePair;
@ -28,6 +29,7 @@ typedef std::pair<std::string, std::string> LanguagePair;
*/
std::vector<LanguagePair> const getLanguageData(bool character_dlg);
} // namespace frnt
} // namespace frontend
} // namespace lyx
#endif // FRNT_LANG_H

View File

@ -21,17 +21,24 @@
#include "support/filetools.h" // OnlyPath, OnlyFilename
#include "support/globbing.h"
using lyx::support::FileFilterList;
using lyx::support::MakeAbsPath;
using lyx::support::MakeRelPath;
using lyx::support::OnlyFilename;
using lyx::support::OnlyPath;
using lyx::support::prefixIs;
using std::pair;
using std::vector;
using std::string;
// sorry this is just a temporary hack we should include vspace.h! (Jug)
extern const char * stringFromUnit(int);
namespace lyx {
using support::FileFilterList;
using support::MakeAbsPath;
using support::MakeRelPath;
using support::OnlyFilename;
using support::OnlyPath;
using support::prefixIs;
namespace frontend {
string const browseFile(string const & filename,
string const & title,
@ -129,9 +136,6 @@ string const browseDir(string const & pathname,
}
// sorry this is just a temporary hack we should include vspace.h! (Jug)
extern const char * stringFromUnit(int);
vector<string> const getLatexUnits()
{
vector<string> units;
@ -141,3 +145,6 @@ vector<string> const getLatexUnits()
return units;
}
} // namespace frontend
} // namespace lyx

View File

@ -19,10 +19,13 @@
namespace lyx {
namespace support {
class FileFilterList;
} // namespace support
} // namespace lyx
namespace frontend {
/** Launch a file dialog and return the chosen file.
filename: a suggested filename.
@ -33,7 +36,7 @@ class FileFilterList;
std::string const
browseFile(std::string const & filename,
std::string const & title,
lyx::support::FileFilterList const & filters,
support::FileFilterList const & filters,
bool save = false,
std::pair<std::string,std::string> const & dir1 =
std::make_pair(std::string(), std::string()),
@ -51,7 +54,7 @@ std::string const
browseRelFile(std::string const & filename,
std::string const & refpath,
std::string const & title,
lyx::support::FileFilterList const & filters,
support::FileFilterList const & filters,
bool save = false,
std::pair<std::string,std::string> const & dir1 =
std::make_pair(std::string(), std::string()),
@ -100,4 +103,7 @@ getSecond(std::vector<Pair> const & pr)
return tmp;
}
} // namespace frontend
} // namespace lyx
#endif // NOT HELPERFUNCS_H

Some files were not shown because too many files have changed in this diff Show More