#include "Toolbars.h"
-#include "buffer.h"
-#include "bufferparams.h"
+#include "Buffer.h"
+#include "BufferParams.h"
#include "debug.h"
-#include "funcrequest.h"
+#include "FuncRequest.h"
#include "FuncStatus.h"
#include "gettext.h"
-#include "lyxfunc.h"
-#include "lyxtextclass.h"
+#include "LyXFunc.h"
+#include "TextClass.h"
#include "LyXView.h"
-#include "lyx_main.h"
+#include "LyX.h"
namespace lyx {
unsigned int flags = static_cast<unsigned int>(tbinfo.flags);
- // Remove default.ui positions. Only when a valid postion is stored
+ // Remove default.ui positions. Only when a valid postion is stored
// in the session file the default.ui value will be overwritten
unsigned int save = flags;
TurnOffFlag(TOP);
}
/*
std::cout << "State " << info.state << " FLAGS: " << flags
- << " ON:" << (flags & ToolbarBackend::ON)
+ << " ON:" << (flags & ToolbarBackend::ON)
<< " OFF:" << (flags & ToolbarBackend::OFF)
- << " L:" << (flags & ToolbarBackend::LEFT)
- << " R:" << (flags & ToolbarBackend::RIGHT)
- << " T:" << (flags & ToolbarBackend::TOP)
- << " B:" << (flags & ToolbarBackend::BOTTOM)
- << " MA:" << (flags & ToolbarBackend::MATH)
- << " RE:" << (flags & ToolbarBackend::REVIEW)
- << " TB:" << (flags & ToolbarBackend::TABLE)
- << " AU:" << (flags & ToolbarBackend::AUTO)
+ << " L:" << (flags & ToolbarBackend::LEFT)
+ << " R:" << (flags & ToolbarBackend::RIGHT)
+ << " T:" << (flags & ToolbarBackend::TOP)
+ << " B:" << (flags & ToolbarBackend::BOTTOM)
+ << " MA:" << (flags & ToolbarBackend::MATH)
+ << " RE:" << (flags & ToolbarBackend::REVIEW)
+ << " TB:" << (flags & ToolbarBackend::TABLE)
+ << " AU:" << (flags & ToolbarBackend::AUTO)
<< std::endl;
*/
// now set the flags
for (; cit != end; ++cit) {
if (cit->name == name) {
unsigned int flags = cit->flags;
+ TurnOffFlag(ON);
+ TurnOffFlag(OFF);
TurnOffFlag(AUTO);
- if (show) {
+ if (show)
TurnOnFlag(ON);
+ else
TurnOnFlag(OFF);
- } else {
- TurnOnFlag(OFF);
- TurnOnFlag(ON);
- }
cit->flags = static_cast<lyx::ToolbarInfo::Flags>(flags);
displayToolbar(*cit, show);
return;
ToolbarInfo::Flags Toolbars::getToolbarState(string const & name)
-{
+{
ToolbarBackend::Toolbars::const_iterator cit = toolbarbackend.begin();
ToolbarBackend::Toolbars::const_iterator end = toolbarbackend.end();
}
+bool Toolbars::visible(string const & name) const
+{
+ std::map<string, ToolbarPtr>::const_iterator it =
+ toolbars_.find(name);
+ if (it == toolbars_.end())
+ return false;
+ return it->second.get()->isVisible();
+}
+
+
void Toolbars::saveToolbarInfo()
{
ToolbarSection & tb = LyX::ref().session().toolbars();
void layoutSelected(LyXView & lv, string const & name)
{
- LyXTextClass const & tc = lv.buffer()->params().getLyXTextClass();
+ TextClass const & tc = lv.buffer()->params().getTextClass();
- LyXTextClass::const_iterator it = tc.begin();
- LyXTextClass::const_iterator const end = tc.end();
+ TextClass::const_iterator it = tc.begin();
+ TextClass::const_iterator const end = tc.end();
for (; it != end; ++it) {
string const & itname = (*it)->name();
// Yes, the lyx::to_utf8(_()) is correct