/**
* \file Toolbar_pimpl.C
* Copyright 1995 Matthias Ettrich
- * Copyright 1995-2001 The LyX Team.
* Copyright 1996-1998 Lars Gullik Bjønnes
- * See the file COPYING.
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * \author Lars Gullik Bjønnes, larsbj@lyx.org
+ * \author Lars Gullik Bjønnes
+ *
+ * Full author contact details are available in file CREDITS
*/
// Added pseudo-action handling, asierra 180296
#include "XFormsView.h"
#include "lyxfunc.h"
#include "FuncStatus.h"
-#include "BufferView.h"
#include "buffer.h"
#include "funcrequest.h"
-#include "MathsSymbols.h"
#include "gettext.h"
#include "Tooltips.h"
#include FORMS_H_LOCATION
#include "support/filetools.h"
#include "support/lstrings.h"
-#include <boost/tuple/tuple.hpp>
-
using std::endl;
// some constants
Toolbar::Pimpl::toolbarItem::toolbarItem()
: action(LFUN_NOACTION), icon(0)
-{
-}
+{}
Toolbar::Pimpl::toolbarItem::~toolbarItem()
ToolbarList::const_iterator end = toollist_.end();
for (; p != end; ++p) {
if (p->action == ToolbarDefaults::LAYOUTS && combox_) {
- if (owner_->getLyXFunc()->getStatus(LFUN_LAYOUT).disabled())
+ if (owner_->getLyXFunc().getStatus(LFUN_LAYOUT).disabled())
combox_->deactivate();
else
combox_->activate();
if (!p->icon)
continue;
- FuncStatus const status = owner_->getLyXFunc()->getStatus(p->action);
+ FuncStatus const status = owner_->getLyXFunc().getStatus(p->action);
if (status.onoff(true)) {
// I'd like to use a different color
// here, but then the problem is to
for (LyXTextClass::const_iterator cit = tc.begin();
cit != end; ++cit) {
if (_((*cit)->name()) == layoutguiname) {
- owner_->getLyXFunc()->dispatch(FuncRequest(LFUN_LAYOUT, (*cit)->name()));
+ owner_->getLyXFunc().dispatch(FuncRequest(LFUN_LAYOUT, (*cit)->name()));
return;
}
}
{
XFormsView * owner = static_cast<XFormsView *>(ob->u_vdata);
- owner->getLyXFunc()->dispatch(int(ac), true);
+ owner->getLyXFunc().dispatch(int(ac), true);
}
}
-void setPixmap(FL_OBJECT * obj, int action, int buttonwidth, int height)
+void setPixmap(FL_OBJECT * obj, int action)
{
string xpm_name;
-
- kb_action act;
- string arg;
- boost::tie(act, arg) = lyxaction.retrieveActionArg(action);
+ FuncRequest ev = lyxaction.retrieveActionArg(action);
- string const name = lyxaction.getActionName(act);
- if (!arg.empty())
- xpm_name = subst(name + ' ' + arg, ' ','_');
+ string const name = lyxaction.getActionName(ev.action);
+ if (!ev.argument.empty())
+ xpm_name = subst(name + ' ' + ev.argument, ' ','_');
else
xpm_name = name;
string fullname = LibFileSearch("images", xpm_name, "xpm");
+ if (ev.action == LFUN_INSERT_MATH && !ev.argument.empty()) {
+ string arg = ev.argument.substr(1);
+ fullname = LibFileSearch("images/math/", arg, "xpm");
+ }
+
if (!fullname.empty()) {
lyxerr[Debug::GUI] << "Full icon name is `"
<< fullname << "'" << endl;
return;
}
- if (act == LFUN_INSERT_MATH && !arg.empty()) {
- char const ** pixmap = get_pixmap_from_symbol(arg.c_str(),
- buttonwidth,
- height);
- if (pixmap) {
- lyxerr[Debug::GUI] << "Using mathed-provided icon"
- << endl;
- fl_set_pixmapbutton_data(obj,
- const_cast<char **>(pixmap));
- return;
- }
- }
-
lyxerr << "Unable to find icon `" << xpm_name << "'" << endl;
fullname = LibFileSearch("images", "unknown", "xpm");
if (!fullname.empty()) {
// The view that this object belongs to.
obj->u_vdata = owner_;
- setPixmap(obj, action, buttonwidth, height);
+ setPixmap(obj, action);
// we must remember to update the positions
xpos += buttonwidth;
// ypos is constant