using std::ios;
using std::ofstream;
using std::string;
-using boost::make_tuple;
namespace lyx {
BindingList::const_iterator it = list.begin();
BindingList::const_iterator it_end = list.end();
for (; it != it_end; ++it) {
- kb_action action = it->get<0>().action;
- string arg = to_utf8(it->get<0>().argument());
+ kb_action action = it->request.action;
+ string arg = to_utf8(it->request.argument());
os << tag << " \""
- << to_utf8(it->get<1>().print(KeySequence::BindFile))
+ << to_utf8(it->sequence.print(KeySequence::BindFile))
<< "\" \""
<< lyxaction.getActionName(action)
<< (arg.empty() ? "" : " ") << arg
BindingList::const_iterator it = list.begin();
BindingList::const_iterator it_end = list.end();
for (; it != it_end; ++it)
- if (it->get<0>().action == action) {
+ if (it->request.action == action) {
has_action = true;
break;
}
if (!has_action)
- list.push_back(make_tuple(action, KeySequence(0, 0), tag));
+ list.push_back(Binding(FuncRequest(action), KeySequence(0, 0), tag));
}
}
return list;
} else {
KeySequence seq = prefix;
seq.addkey(it->code, it->mod.first);
- list.push_back(make_tuple(it->func, seq, tag));
+ list.push_back(Binding(it->func, seq, tag));
}
}
}
#define KEYMAP_H
#include "FuncRequest.h"
-
-#include "frontends/KeyModifier.h"
-#include "frontends/KeySymbol.h"
+#include "KeySequence.h"
#include "support/strfwd.h"
#include <boost/shared_ptr.hpp>
-#include <boost/tuple/tuple.hpp>
#include <vector>
#include <deque>
namespace lyx {
-class KeySequence;
-
/// Defines key maps and actions for key sequences
class KeyMap {
public:
/// Given an action, print the keybindings.
docstring const printbindings(FuncRequest const & func) const;
- typedef boost::tuple<FuncRequest, KeySequence, int> Binding;
+ struct Binding {
+ Binding(FuncRequest const & r, KeySequence const & s, int t)
+ : request(r), sequence(s), tag(t) {}
+ FuncRequest request;
+ KeySequence sequence;
+ int tag;
+ };
typedef std::vector<Binding> BindingList;
/**
* Return all lfun and their associated bindings.
#include <QValidator>
#include <QCloseEvent>
+#include <boost/tuple/tuple.hpp>
+
#include <iomanip>
#include <sstream>
#include <algorithm>
KeyMap::BindingList::const_iterator it = bindinglist.begin();
KeyMap::BindingList::const_iterator it_end = bindinglist.end();
for (; it != it_end; ++it)
- insertShortcutItem(it->get<0>(), it->get<1>(),
- static_cast<item_type>(it->get<2>()));
+ insertShortcutItem(it->request, it->sequence, item_type(it->tag));
shortcutsTW->sortItems(0, Qt::AscendingOrder);
QList<QTreeWidgetItem*> items = shortcutsTW->selectedItems();
newItem->setText(0, lfun_name);
newItem->setText(1, shortcut);
// record BindFile representation to recover KeySequence when needed.
- newItem->setData(1, Qt::UserRole, QVariant(toqstr(seq.print(KeySequence::BindFile))));
+ newItem->setData(1, Qt::UserRole, toqstr(seq.print(KeySequence::BindFile)));
setItemType(newItem, item_tag);
return newItem;
}