bool enable = true;
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_BUFFER_TOGGLE_READ_ONLY:
flag.setOnOff(isReadonly());
{
if (isInternal()) {
// FIXME? if there is an Buffer LFUN that can be dispatched even
- // if internal, put a switch '(cmd.action_)' here.
+ // if internal, put a switch '(cmd.action())' here.
dr.dispatched(false);
return;
}
bool dispatched = true;
undo().beginUndoGroup();
- switch (func.action_) {
+ switch (func.action()) {
case LFUN_BUFFER_TOGGLE_READ_ONLY:
if (lyxvc().inUse())
lyxvc().toggleReadOnly();
bformat(_("Branch \"%1$s\" does not exist."), branchName);
dr.setMessage(msg);
} else {
- branch->setSelected(func.action_ == LFUN_BRANCH_ACTIVATE);
+ branch->setSelected(func.action() == LFUN_BRANCH_ACTIVATE);
dr.setError(false);
dr.update(Update::Force);
}
bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
{
+ FuncCode const act = cmd.action();
+
// Can we use a readonly buffer?
if (buffer_.isReadonly()
- && !lyxaction.funcHasFlag(cmd.action_, LyXAction::ReadOnly)
- && !lyxaction.funcHasFlag(cmd.action_, LyXAction::NoBuffer)) {
+ && !lyxaction.funcHasFlag(act, LyXAction::ReadOnly)
+ && !lyxaction.funcHasFlag(act, LyXAction::NoBuffer)) {
flag.message(from_utf8(N_("Document is read-only")));
flag.setEnabled(false);
return true;
}
+
// Are we in a DELETED change-tracking region?
if (lookupChangeType(d->cursor_, true) == Change::DELETED
- && !lyxaction.funcHasFlag(cmd.action_, LyXAction::ReadOnly)
- && !lyxaction.funcHasFlag(cmd.action_, LyXAction::NoBuffer)) {
+ && !lyxaction.funcHasFlag(act, LyXAction::ReadOnly)
+ && !lyxaction.funcHasFlag(act, LyXAction::NoBuffer)) {
flag.message(from_utf8(N_("This portion of the document is deleted.")));
flag.setEnabled(false);
return true;
if (cur.getStatus(cmd, flag))
return true;
- switch (cmd.action_) {
+ switch (act) {
// FIXME: This is a bit problematic because we don't check if this is
// a document BufferView or not for these LFUNs. We probably have to
//lyxerr << [ cmd = " << cmd << "]" << endl;
// Make sure that the cached BufferView is correct.
- LYXERR(Debug::ACTION, " action[" << cmd.action_ << ']'
+ LYXERR(Debug::ACTION, " action[" << cmd.action() << ']'
<< " arg[" << to_utf8(cmd.argument()) << ']'
- << " x[" << cmd.x_ << ']'
- << " y[" << cmd.y_ << ']'
+ << " x[" << cmd.x() << ']'
+ << " y[" << cmd.y() << ']'
<< " button[" << cmd.button() << ']');
string const argument = to_utf8(cmd.argument());
// Don't dispatch function that does not apply to internal buffers.
if (buffer_.isInternal()
- && lyxaction.funcHasFlag(cmd.action_, LyXAction::NoInternal))
+ && lyxaction.funcHasFlag(cmd.action(), LyXAction::NoInternal))
return;
// We'll set this back to false if need be.
bool dispatched = true;
buffer_.undo().beginUndoGroup();
- switch (cmd.action_) {
+ FuncCode const act = cmd.action();
+ switch (act) {
case LFUN_BUFFER_PARAMS_APPLY: {
DocumentClass const * const oldClass = buffer_.params().documentClassPtr();
if (searched_string.empty())
break;
- bool const fw = cmd.action_ == LFUN_WORD_FIND_FORWARD;
+ bool const fw = act == LFUN_WORD_FIND_FORWARD;
docstring const data =
find2string(searched_string, true, false, fw);
find(this, FuncRequest(LFUN_WORD_FIND, data));
showCursor();
p = getPos(cur, cur.boundary());
}*/
- int const scrolled = scroll(cmd.action_ == LFUN_SCREEN_UP
+ int const scrolled = scroll(act == LFUN_SCREEN_UP
? -height_ : height_);
- if (cmd.action_ == LFUN_SCREEN_UP && scrolled > -height_)
+ if (act == LFUN_SCREEN_UP && scrolled > -height_)
p = Point(0, 0);
- if (cmd.action_ == LFUN_SCREEN_DOWN && scrolled < height_)
+ if (act == LFUN_SCREEN_DOWN && scrolled < height_)
p = Point(width_, height_);
Cursor old = cur;
bool const in_texted = cur.inTexted();
updateHoveredInset();
d->text_metrics_[&buffer_.text()].editXY(cur, p.x_, p.y_,
- true, cmd.action_ == LFUN_SCREEN_UP);
+ true, act == LFUN_SCREEN_UP);
//FIXME: what to do with cur.x_target()?
bool update = in_texted && cur.bv().checkDepm(cur, old);
cur.finishUndo();
// surrounding Text will handle this event.
// make sure we stay within the screen...
- cmd.y_ = min(max(cmd.y_, -1), height_);
+ cmd.set_y(min(max(cmd.y(), -1), height_));
- d->mouse_position_cache_.x_ = cmd.x_;
- d->mouse_position_cache_.y_ = cmd.y_;
+ d->mouse_position_cache_.x_ = cmd.x();
+ d->mouse_position_cache_.y_ = cmd.y();
- if (cmd.action_ == LFUN_MOUSE_MOTION && cmd.button() == mouse_button::none) {
+ if (cmd.action() == LFUN_MOUSE_MOTION && cmd.button() == mouse_button::none) {
updateHoveredInset();
return;
}
// Build temporary cursor.
- Inset * inset = d->text_metrics_[&buffer_.text()].editXY(cur, cmd.x_, cmd.y_);
+ Inset * inset = d->text_metrics_[&buffer_.text()].editXY(cur, cmd.x(), cmd.y());
// Put anchor at the same position.
cur.resetAnchor();
return CmdDefExists;
FuncRequest func = lyxaction.lookupFunc(def);
- if (func.action_ == LFUN_NOACTION
- || func.action_ == LFUN_UNKNOWN_ACTION) {
+ if (func.action() == LFUN_NOACTION
+ || func.action() == LFUN_UNKNOWN_ACTION) {
return CmdDefInvalid;
}
// Is this a function that acts on inset at point?
Inset * inset = cur.nextInset();
- if (lyxaction.funcHasFlag(cmd.action_, LyXAction::AtPoint)
+ if (lyxaction.funcHasFlag(cmd.action(), LyXAction::AtPoint)
&& inset && inset->getStatus(cur, cmd, status))
return true;
buffer()->undo().beginUndoGroup();
// Is this a function that acts on inset at point?
- if (lyxaction.funcHasFlag(cmd.action_, LyXAction::AtPoint)
+ if (lyxaction.funcHasFlag(cmd.action(), LyXAction::AtPoint)
&& nextInset()) {
result().dispatched(true);
result().update(Update::FitCursor | Update::Force);
FuncRequest::FuncRequest(FuncRequest const & cmd, docstring const & arg, Origin o)
- : argument_(arg), action_(cmd.action_), origin_(o),
+ : argument_(arg), action_(cmd.action()), origin_(o),
x_(cmd.x_), y_(cmd.y_), button_(cmd.button_)
{}
FuncRequest::FuncRequest(FuncRequest const & cmd, string const & arg, Origin o)
- : argument_(from_utf8(arg)), action_(cmd.action_), origin_(o),
+ : argument_(from_utf8(arg)), action_(cmd.action()), origin_(o),
x_(cmd.x_), y_(cmd.y_), button_(cmd.button_)
{}
-mouse_button::state FuncRequest::button() const
-{
- return button_;
-}
-
-
namespace {
// Extracts arguments from str into args. Arguments are delimted by
bool operator==(FuncRequest const & lhs, FuncRequest const & rhs)
{
- return lhs.action_ == rhs.action_ && lhs.argument() == rhs.argument();
+ return lhs.action() == rhs.action() && lhs.argument() == rhs.argument();
}
ostream & operator<<(ostream & os, FuncRequest const & cmd)
{
return os
- << " action: " << cmd.action_
- << " [" << lyxaction.getActionName(cmd.action_) << "] "
+ << " action: " << cmd.action()
+ << " [" << lyxaction.getActionName(cmd.action()) << "] "
<< " arg: '" << to_utf8(cmd.argument()) << "'"
- << " x: " << cmd.x_
- << " y: " << cmd.y_;
+ << " x: " << cmd.x()
+ << " y: " << cmd.y();
}
FuncRequest(FuncRequest const & cmd, std::string const & arg,
Origin o = INTERNAL);
- /// access to button
- mouse_button::state button() const;
+ /// access the whole argument
+ docstring const & argument() const { return argument_; }
+ ///
+ FuncCode action() const { return action_ ; }
+ ///
+ void setAction(FuncCode act) { action_ = act; }
+ ///
+ Origin origin() const { return origin_; }
+ ///
+ void setOrigin(Origin o) { origin_ = o; }
+ ///
+ int x() const { return x_; }
+ ///
+ int y() const { return y_; }
+ ///
+ void set_y(int y) { y_ = y; }
+ ///
+ mouse_button::state button() const { return button_; }
/// argument parsing, extract argument i as std::string
std::string getArg(unsigned int i) const;
-
/// argument parsing, extract argument i as std::string,
/// eating all characters up to the end of the command line
std::string getLongArg(unsigned int i) const;
- /// access the whole argument
- docstring const & argument() const { return argument_; }
-
///
static FuncRequest const unknown;
///
private:
/// the action's string argument
docstring argument_;
-public:
/// the action
FuncCode action_;
/// who initiated the action
size_t KeyMap::bind(string const & seq, FuncRequest const & func)
{
LYXERR(Debug::KBMAP, "BIND: Sequence `" << seq << "' Action `"
- << func.action_ << '\'');
+ << func.action() << '\'');
KeySequence k(0, 0);
it->prefixes.reset();
}
it->func = func;
- it->func.origin_ = FuncRequest::KEYBOARD;
+ it->func.setOrigin(FuncRequest::KEYBOARD);
return;
} else if (!it->prefixes.get()) {
lyxerr << "Error: New binding for '"
newone->mod = seq->modifiers[r];
if (r + 1 == seq->length()) {
newone->func = func;
- newone->func.origin_ = FuncRequest::KEYBOARD;
+ newone->func.setOrigin(FuncRequest::KEYBOARD);
newone->prefixes.reset();
} else {
newone->prefixes.reset(new KeyMap);
string cmd = lexrc.getString();
FuncRequest func = lyxaction.lookupFunc(cmd);
- if (func.action_ == LFUN_UNKNOWN_ACTION) {
+ if (func.action() == LFUN_UNKNOWN_ACTION) {
lexrc.printError("BN_BIND: Unknown LyX function `$$Token'");
error = true;
break;
string cmd = lexrc.getString();
FuncRequest func = lyxaction.lookupFunc(cmd);
- if (func.action_ == LFUN_UNKNOWN_ACTION) {
+ if (func.action() == LFUN_UNKNOWN_ACTION) {
lexrc.printError("BN_UNBIND: Unknown LyX"
" function `$$Token'");
error = true;
BindingList::const_iterator it = list.begin();
BindingList::const_iterator it_end = list.end();
for (; it != it_end; ++it) {
- FuncCode action = it->request.action_;
+ FuncCode action = it->request.action();
string arg = to_utf8(it->request.argument());
os << tag << " \""
BindingList::const_iterator bit = list.begin();
BindingList::const_iterator const ben = list.end();
for (; bit != ben; ++bit)
- if (bit->request.action_ == action) {
+ if (bit->request.action() == action) {
has_action = true;
break;
}
void regexpDispatch(Cursor & cur, FuncRequest const & cmd)
{
- LASSERT(cmd.action_ == LFUN_REGEXP_MODE, return);
+ LASSERT(cmd.action() == LFUN_REGEXP_MODE, return);
if (cur.inRegexped()) {
cur.message(_("Already in regular expression mode"));
return;
ci->setButtonLabel();
cur.recordUndo();
- if (cmd.action_ == LFUN_INDEX_INSERT) {
+ if (cmd.action() == LFUN_INDEX_INSERT) {
docstring ds = subst(text->getStringToIndex(cur), '\n', ' ');
text->insertInset(cur, inset);
if (edit)
bool sel = cur.selection();
// Signals that, even if needsUpdate == false, an update of the
// cursor paragraph is required
- bool singleParUpdate = lyxaction.funcHasFlag(cmd.action_,
+ bool singleParUpdate = lyxaction.funcHasFlag(cmd.action(),
LyXAction::SingleParUpdate);
// Signals that a full-screen update is required
- bool needsUpdate = !(lyxaction.funcHasFlag(cmd.action_,
+ bool needsUpdate = !(lyxaction.funcHasFlag(cmd.action(),
LyXAction::NoUpdate) || singleParUpdate);
- switch (cmd.action_) {
+ FuncCode const act = cmd.action();
+ switch (act) {
case LFUN_PARAGRAPH_MOVE_DOWN: {
pit_type const pit = cur.pit();
case LFUN_BUFFER_BEGIN:
case LFUN_BUFFER_BEGIN_SELECT:
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_BUFFER_BEGIN_SELECT);
+ needsUpdate |= cur.selHandle(act == LFUN_BUFFER_BEGIN_SELECT);
if (cur.depth() == 1)
needsUpdate |= cursorTop(cur);
else
case LFUN_BUFFER_END:
case LFUN_BUFFER_END_SELECT:
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_BUFFER_END_SELECT);
+ needsUpdate |= cur.selHandle(act == LFUN_BUFFER_END_SELECT);
if (cur.depth() == 1)
needsUpdate |= cursorBottom(cur);
else
case LFUN_INSET_BEGIN:
case LFUN_INSET_BEGIN_SELECT:
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_INSET_BEGIN_SELECT);
+ needsUpdate |= cur.selHandle(act == LFUN_INSET_BEGIN_SELECT);
if (cur.depth() == 1 || !cur.top().at_begin())
needsUpdate |= cursorTop(cur);
else
case LFUN_INSET_END:
case LFUN_INSET_END_SELECT:
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_INSET_END_SELECT);
+ needsUpdate |= cur.selHandle(act == LFUN_INSET_END_SELECT);
if (cur.depth() == 1 || !cur.top().at_end())
needsUpdate |= cursorBottom(cur);
else
case LFUN_CHAR_FORWARD:
case LFUN_CHAR_FORWARD_SELECT:
//LYXERR0(" LFUN_CHAR_FORWARD[SEL]:\n" << cur);
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_CHAR_FORWARD_SELECT);
+ needsUpdate |= cur.selHandle(act == LFUN_CHAR_FORWARD_SELECT);
needsUpdate |= cursorForward(cur);
if (!needsUpdate && oldTopSlice == cur.top()
case LFUN_CHAR_BACKWARD:
case LFUN_CHAR_BACKWARD_SELECT:
//lyxerr << "handle LFUN_CHAR_BACKWARD[_SELECT]:\n" << cur << endl;
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_CHAR_BACKWARD_SELECT);
+ needsUpdate |= cur.selHandle(act == LFUN_CHAR_BACKWARD_SELECT);
needsUpdate |= cursorBackward(cur);
if (!needsUpdate && oldTopSlice == cur.top()
case LFUN_CHAR_LEFT:
case LFUN_CHAR_LEFT_SELECT:
if (lyxrc.visual_cursor) {
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_CHAR_LEFT_SELECT);
+ needsUpdate |= cur.selHandle(act == LFUN_CHAR_LEFT_SELECT);
needsUpdate |= cursorVisLeft(cur);
if (!needsUpdate && oldTopSlice == cur.top()
&& cur.boundary() == oldBoundary) {
}
} else {
if (reverseDirectionNeeded(cur)) {
- cmd.action_ = cmd.action_ == LFUN_CHAR_LEFT_SELECT ?
- LFUN_CHAR_FORWARD_SELECT : LFUN_CHAR_FORWARD;
+ cmd.setAction(cmd.action() == LFUN_CHAR_LEFT_SELECT ?
+ LFUN_CHAR_FORWARD_SELECT : LFUN_CHAR_FORWARD);
} else {
- cmd.action_ = cmd.action_ == LFUN_CHAR_LEFT_SELECT ?
- LFUN_CHAR_BACKWARD_SELECT : LFUN_CHAR_BACKWARD;
+ cmd.setAction(cmd.action() == LFUN_CHAR_LEFT_SELECT ?
+ LFUN_CHAR_BACKWARD_SELECT : LFUN_CHAR_BACKWARD);
}
dispatch(cur, cmd);
return;
case LFUN_CHAR_RIGHT:
case LFUN_CHAR_RIGHT_SELECT:
if (lyxrc.visual_cursor) {
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_CHAR_RIGHT_SELECT);
+ needsUpdate |= cur.selHandle(cmd.action() == LFUN_CHAR_RIGHT_SELECT);
needsUpdate |= cursorVisRight(cur);
if (!needsUpdate && oldTopSlice == cur.top()
&& cur.boundary() == oldBoundary) {
}
} else {
if (reverseDirectionNeeded(cur)) {
- cmd.action_ = cmd.action_ == LFUN_CHAR_RIGHT_SELECT ?
- LFUN_CHAR_BACKWARD_SELECT : LFUN_CHAR_BACKWARD;
+ cmd.setAction(cmd.action() == LFUN_CHAR_RIGHT_SELECT ?
+ LFUN_CHAR_BACKWARD_SELECT : LFUN_CHAR_BACKWARD);
} else {
- cmd.action_ = cmd.action_ == LFUN_CHAR_RIGHT_SELECT ?
- LFUN_CHAR_FORWARD_SELECT : LFUN_CHAR_FORWARD;
+ cmd.setAction(cmd.action() == LFUN_CHAR_RIGHT_SELECT ?
+ LFUN_CHAR_FORWARD_SELECT : LFUN_CHAR_FORWARD);
}
dispatch(cur, cmd);
return;
case LFUN_UP:
case LFUN_DOWN: {
// stop/start the selection
- bool select = cmd.action_ == LFUN_DOWN_SELECT ||
- cmd.action_ == LFUN_UP_SELECT;
+ bool select = cmd.action() == LFUN_DOWN_SELECT ||
+ cmd.action() == LFUN_UP_SELECT;
// move cursor up/down
- bool up = cmd.action_ == LFUN_UP_SELECT || cmd.action_ == LFUN_UP;
+ bool up = cmd.action() == LFUN_UP_SELECT || cmd.action() == LFUN_UP;
bool const atFirstOrLastRow = cur.atFirstOrLastRow(up);
if (!atFirstOrLastRow) {
case LFUN_PARAGRAPH_UP:
case LFUN_PARAGRAPH_UP_SELECT:
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_PARAGRAPH_UP_SELECT);
+ needsUpdate |= cur.selHandle(cmd.action() == LFUN_PARAGRAPH_UP_SELECT);
needsUpdate |= cursorUpParagraph(cur);
break;
case LFUN_PARAGRAPH_DOWN:
case LFUN_PARAGRAPH_DOWN_SELECT:
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_PARAGRAPH_DOWN_SELECT);
+ needsUpdate |= cur.selHandle(cmd.action() == LFUN_PARAGRAPH_DOWN_SELECT);
needsUpdate |= cursorDownParagraph(cur);
break;
case LFUN_LINE_BEGIN:
case LFUN_LINE_BEGIN_SELECT:
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_LINE_BEGIN_SELECT);
+ needsUpdate |= cur.selHandle(cmd.action() == LFUN_LINE_BEGIN_SELECT);
needsUpdate |= tm->cursorHome(cur);
break;
case LFUN_LINE_END:
case LFUN_LINE_END_SELECT:
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_LINE_END_SELECT);
+ needsUpdate |= cur.selHandle(cmd.action() == LFUN_LINE_END_SELECT);
needsUpdate |= tm->cursorEnd(cur);
break;
case LFUN_WORD_RIGHT:
case LFUN_WORD_RIGHT_SELECT:
if (lyxrc.visual_cursor) {
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_WORD_RIGHT_SELECT);
+ needsUpdate |= cur.selHandle(cmd.action() == LFUN_WORD_RIGHT_SELECT);
needsUpdate |= cursorVisRightOneWord(cur);
if (!needsUpdate && oldTopSlice == cur.top()
&& cur.boundary() == oldBoundary) {
}
} else {
if (reverseDirectionNeeded(cur)) {
- cmd.action_ = cmd.action_ == LFUN_WORD_RIGHT_SELECT ?
- LFUN_WORD_BACKWARD_SELECT : LFUN_WORD_BACKWARD;
+ cmd.setAction(cmd.action() == LFUN_WORD_RIGHT_SELECT ?
+ LFUN_WORD_BACKWARD_SELECT : LFUN_WORD_BACKWARD);
} else {
- cmd.action_ = cmd.action_ == LFUN_WORD_RIGHT_SELECT ?
- LFUN_WORD_FORWARD_SELECT : LFUN_WORD_FORWARD;
+ cmd.setAction(cmd.action() == LFUN_WORD_RIGHT_SELECT ?
+ LFUN_WORD_FORWARD_SELECT : LFUN_WORD_FORWARD);
}
dispatch(cur, cmd);
return;
case LFUN_WORD_FORWARD:
case LFUN_WORD_FORWARD_SELECT:
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_WORD_FORWARD_SELECT);
+ needsUpdate |= cur.selHandle(cmd.action() == LFUN_WORD_FORWARD_SELECT);
needsUpdate |= cursorForwardOneWord(cur);
break;
case LFUN_WORD_LEFT:
case LFUN_WORD_LEFT_SELECT:
if (lyxrc.visual_cursor) {
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_WORD_LEFT_SELECT);
+ needsUpdate |= cur.selHandle(cmd.action() == LFUN_WORD_LEFT_SELECT);
needsUpdate |= cursorVisLeftOneWord(cur);
if (!needsUpdate && oldTopSlice == cur.top()
&& cur.boundary() == oldBoundary) {
}
} else {
if (reverseDirectionNeeded(cur)) {
- cmd.action_ = cmd.action_ == LFUN_WORD_LEFT_SELECT ?
- LFUN_WORD_FORWARD_SELECT : LFUN_WORD_FORWARD;
+ cmd.setAction(cmd.action() == LFUN_WORD_LEFT_SELECT ?
+ LFUN_WORD_FORWARD_SELECT : LFUN_WORD_FORWARD);
} else {
- cmd.action_ = cmd.action_ == LFUN_WORD_LEFT_SELECT ?
- LFUN_WORD_BACKWARD_SELECT : LFUN_WORD_BACKWARD;
+ cmd.setAction(cmd.action() == LFUN_WORD_LEFT_SELECT ?
+ LFUN_WORD_BACKWARD_SELECT : LFUN_WORD_BACKWARD);
}
dispatch(cur, cmd);
return;
case LFUN_WORD_BACKWARD:
case LFUN_WORD_BACKWARD_SELECT:
- needsUpdate |= cur.selHandle(cmd.action_ == LFUN_WORD_BACKWARD_SELECT);
+ needsUpdate |= cur.selHandle(cmd.action() == LFUN_WORD_BACKWARD_SELECT);
needsUpdate |= cursorBackwardOneWord(cur);
break;
CursorSlice old = bvcur.top();
int const wh = bv->workHeight();
- int const y = max(0, min(wh - 1, cmd.y_));
+ int const y = max(0, min(wh - 1, cmd.y()));
- tm->setCursorFromCoordinates(cur, cmd.x_, y);
- cur.setTargetX(cmd.x_);
- if (cmd.y_ >= wh)
+ tm->setCursorFromCoordinates(cur, cmd.x(), y);
+ cur.setTargetX(cmd.x());
+ if (cmd.y() >= wh)
lyx::dispatch(FuncRequest(LFUN_DOWN_SELECT));
- else if (cmd.y_ < 0)
+ else if (cmd.y() < 0)
lyx::dispatch(FuncRequest(LFUN_UP_SELECT));
// This is to allow jumping over large insets
if (cur.top() == old) {
- if (cmd.y_ >= wh)
+ if (cmd.y() >= wh)
lyx::dispatch(FuncRequest(LFUN_DOWN_SELECT));
- else if (cmd.y_ < 0)
+ else if (cmd.y() < 0)
lyx::dispatch(FuncRequest(LFUN_UP_SELECT));
}
// We continue with our existing selection or start a new one, so don't
case LFUN_ACCENT_HUNGARIAN_UMLAUT:
case LFUN_ACCENT_CIRCLE:
case LFUN_ACCENT_OGONEK:
- theApp()->handleKeyFunc(cmd.action_);
+ theApp()->handleKeyFunc(cmd.action());
if (!cmd.argument().empty())
// FIXME: Are all these characters encoded in one byte in utf8?
bv->translateAndInsert(cmd.argument()[0], this, cur);
bool enable = true;
InsetCode code = NO_CODE;
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_DEPTH_DECREMENT:
enable = changeDepthAllowed(cur, DEC_DEPTH);
{
try {
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_LINE_INSERT:
return new InsetLine;
QString name1;
QString name2;
QString path;
- switch (f.action_) {
+ switch (f.action()) {
case LFUN_MATH_INSERT:
if (!f.argument().empty()) {
path = "math/";
}
}
default:
- name2 = toqstr(lyxaction.getActionName(f.action_));
+ name2 = toqstr(lyxaction.getActionName(f.action()));
name1 = name2;
if (!f.argument().empty()) {
<< " or filename "
<< "\"" << name2 << "\""
<< " for command \""
- << lyxaction.getActionName(f.action_)
+ << lyxaction.getActionName(f.action())
<< '(' << to_utf8(f.argument()) << ")\"");
if (unknown) {
{
FuncStatus flag;
- if (cmd.action_ == LFUN_NOACTION) {
+ if (cmd.action() == LFUN_NOACTION) {
flag.message(from_utf8(N_("Nothing to do")));
flag.setEnabled(false);
return flag;
}
- if (cmd.action_ == LFUN_UNKNOWN_ACTION) {
+ if (cmd.action() == LFUN_UNKNOWN_ACTION) {
flag.unknown(true);
flag.setEnabled(false);
flag.message(from_utf8(N_("Unknown action")));
// -- And I'd rather let an inset decide which LFUNs it is willing
// to handle (Andre')
bool enable = true;
- switch (cmd.action_) {
+ switch (cmd.action()) {
// This could be used for the no-GUI version. The GUI version is handled in
// GuiView::getStatus(). See above.
// argument contains ';'-terminated commands
string const firstcmd = token(to_utf8(cmd.argument()), ';', 0);
FuncRequest func(lyxaction.lookupFunc(firstcmd));
- func.origin_ = cmd.origin_;
+ func.setOrigin(cmd.origin());
flag = getStatus(func);
break;
}
string first;
arg = split(arg, first, ';');
FuncRequest func(lyxaction.lookupFunc(first));
- func.origin_ = cmd.origin_;
+ func.setOrigin(cmd.origin());
flag = getStatus(func);
// if this one is enabled, the whole thing is
if (flag.enabled())
FuncRequest func;
string name = to_utf8(cmd.argument());
if (theTopLevelCmdDef().lock(name, func)) {
- func.origin_ = cmd.origin_;
+ func.setOrigin(cmd.origin());
flag = getStatus(func);
theTopLevelCmdDef().release(name);
} else {
// entries that are buffer or view-related.
//FIXME: Abdel (09/02/10) This has very bad effect on Linux, don't know why...
/*
- if (cmd.origin_ == FuncRequest::MENU && !current_view_->hasFocus()) {
+ if (cmd.origin() == FuncRequest::MENU && !current_view_->hasFocus()) {
enable = false;
break;
}
static docstring makeDispatchMessage(docstring const & msg,
FuncRequest const & cmd)
{
- const bool verbose = (cmd.origin_ == FuncRequest::MENU
- || cmd.origin_ == FuncRequest::TOOLBAR
- || cmd.origin_ == FuncRequest::COMMANDBUFFER);
+ const bool verbose = (cmd.origin() == FuncRequest::MENU
+ || cmd.origin() == FuncRequest::TOOLBAR
+ || cmd.origin() == FuncRequest::COMMANDBUFFER);
- if (cmd.action_ == LFUN_SELF_INSERT || !verbose) {
+ if (cmd.action() == LFUN_SELF_INSERT || !verbose) {
LYXERR(Debug::ACTION, "dispatch msg is " << msg);
return msg;
}
if (!dispatch_msg.empty())
dispatch_msg += ' ';
- docstring comname = from_utf8(lyxaction.getActionName(cmd.action_));
+ docstring comname = from_utf8(lyxaction.getActionName(cmd.action()));
bool argsadded = false;
if (!cmd.argument().empty()) {
- if (cmd.action_ != LFUN_UNKNOWN_ACTION) {
+ if (cmd.action() != LFUN_UNKNOWN_ACTION) {
comname += ' ' + cmd.argument();
argsadded = true;
}
void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr)
{
string const argument = to_utf8(cmd.argument());
- FuncCode const action = cmd.action_;
+ FuncCode const action = cmd.action();
LYXERR(Debug::ACTION, "cmd: " << cmd);
// Assumes that the action will be dispatched.
dr.dispatched(true);
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_WINDOW_NEW:
createView(toqstr(cmd.argument()));
string first;
arg = split(arg, first, ';');
FuncRequest func(lyxaction.lookupFunc(first));
- func.origin_ = cmd.origin_;
+ func.setOrigin(cmd.origin());
dispatch(func);
}
// the buffer may have been closed by one action
string first;
arg = split(arg, first, ';');
FuncRequest func(lyxaction.lookupFunc(first));
- func.origin_ = cmd.origin_;
- FuncStatus stat = getStatus(func);
+ func.setOrigin(cmd.origin());
+ FuncStatus const stat = getStatus(func);
if (stat.enabled()) {
dispatch(func);
break;
case LFUN_CALL: {
FuncRequest func;
if (theTopLevelCmdDef().lock(argument, func)) {
- func.origin_ = cmd.origin_;
+ func.setOrigin(cmd.origin());
dispatch(func);
theTopLevelCmdDef().release(argument);
} else {
- if (func.action_ == LFUN_UNKNOWN_ACTION) {
+ if (func.action() == LFUN_UNKNOWN_ACTION) {
// unknown command definition
lyxerr << "Warning: unknown command definition `"
<< argument << "'"
// update completion. We do it here and not in
// processKeySym to avoid another redraw just for a
// changed inline completion
- if (cmd.origin_ == FuncRequest::KEYBOARD) {
- if (cmd.action_ == LFUN_SELF_INSERT
- || (cmd.action_ == LFUN_ERT_INSERT && bv->cursor().inMathed()))
+ if (cmd.origin() == FuncRequest::KEYBOARD) {
+ if (cmd.action() == LFUN_SELF_INSERT
+ || (cmd.action() == LFUN_ERT_INSERT && bv->cursor().inMathed()))
current_view_->updateCompletion(bv->cursor(), true, true);
- else if (cmd.action_ == LFUN_CHAR_DELETE_BACKWARD)
+ else if (cmd.action() == LFUN_CHAR_DELETE_BACKWARD)
current_view_->updateCompletion(bv->cursor(), false, true);
else
current_view_->updateCompletion(bv->cursor(), false, false);
d->cancel_meta_seq.reset();
FuncRequest func = d->cancel_meta_seq.addkey(keysym, state);
- LYXERR(Debug::KEY, "action first set to [" << func.action_ << ']');
+ LYXERR(Debug::KEY, "action first set to [" << func.action() << ']');
// When not cancel or meta-fake, do the normal lookup.
// Note how the meta_fake Mod1 bit is OR-ed in and reset afterwards.
// Mostly, meta_fake_bit = NoModifier. RVDK_PATCH_5.
- if ((func.action_ != LFUN_CANCEL) && (func.action_ != LFUN_META_PREFIX)) {
+ if ((func.action() != LFUN_CANCEL) && (func.action() != LFUN_META_PREFIX)) {
// remove Caps Lock and Mod2 as a modifiers
func = d->keyseq.addkey(keysym, (state | d->meta_fake_bit));
- LYXERR(Debug::KEY, "action now set to [" << func.action_ << ']');
+ LYXERR(Debug::KEY, "action now set to [" << func.action() << ']');
}
// Dont remove this unless you know what you are doing.
d->meta_fake_bit = NoModifier;
// Can this happen now ?
- if (func.action_ == LFUN_NOACTION)
+ if (func.action() == LFUN_NOACTION)
func = FuncRequest(LFUN_COMMAND_PREFIX);
- LYXERR(Debug::KEY, " Key [action=" << func.action_ << "]["
+ LYXERR(Debug::KEY, " Key [action=" << func.action() << "]["
<< d->keyseq.print(KeySequence::Portable) << ']');
// already here we know if it any point in going further
// Maybe user can only reach the key via holding down shift.
// Let's see. But only if shift is the only modifier
- if (func.action_ == LFUN_UNKNOWN_ACTION && state == ShiftModifier) {
+ if (func.action() == LFUN_UNKNOWN_ACTION && state == ShiftModifier) {
LYXERR(Debug::KEY, "Trying without shift");
func = d->keyseq.addkey(keysym, NoModifier);
- LYXERR(Debug::KEY, "Action now " << func.action_);
+ LYXERR(Debug::KEY, "Action now " << func.action());
}
- if (func.action_ == LFUN_UNKNOWN_ACTION) {
+ if (func.action() == LFUN_UNKNOWN_ACTION) {
// Hmm, we didn't match any of the keysequences. See
// if it's normal insertable text not already covered
// by a binding
}
}
- if (func.action_ == LFUN_SELF_INSERT) {
+ if (func.action() == LFUN_SELF_INSERT) {
if (encoded_last_key != 0) {
docstring const arg(1, encoded_last_key);
lyx::dispatch(FuncRequest(LFUN_SELF_INSERT, arg,
upPB->setEnabled(history_pos_ != history_.begin());
downPB->setEnabled(history_pos_ != history_.end());
FuncRequest func = lyxaction.lookupFunc(str);
- func.origin_ = FuncRequest::COMMANDBUFFER;
+ func.setOrigin(FuncRequest::COMMANDBUFFER);
lyx::dispatch(func);
}
QTreeWidgetItem * PrefShortcuts::insertShortcutItem(FuncRequest const & lfun,
KeySequence const & seq, KeyMap::ItemType tag)
{
- FuncCode action = lfun.action_;
+ FuncCode const action = lfun.action();
string const action_name = lyxaction.getActionName(action);
QString const lfun_name = toqstr(from_utf8(action_name)
+ ' ' + lfun.argument());
docstring makeCmdString(FuncRequest const & f)
{
- docstring actionStr = from_ascii(lyxaction.getActionName(f.action_));
+ docstring actionStr = from_ascii(lyxaction.getActionName(f.action()));
if (!f.argument().empty())
actionStr += " " + f.argument();
return actionStr;
QString const new_lfun = shortcut_->lfunLE->text();
FuncRequest func = lyxaction.lookupFunc(fromqstr(new_lfun));
- if (func.action_ == LFUN_UNKNOWN_ACTION) {
+ if (func.action() == LFUN_UNKNOWN_ACTION) {
Alert::error(_("Failed to create shortcut"),
_("Unknown or invalid LyX function"));
return;
// check to see if there's been any change
FuncRequest oldBinding = system_bind_.getBinding(k);
- if (oldBinding.action_ == LFUN_UNKNOWN_ACTION)
+ if (oldBinding.action() == LFUN_UNKNOWN_ACTION)
oldBinding = user_bind_.getBinding(k);
if (oldBinding == func)
// nothing has changed
return;
// make sure this key isn't already bound---and, if so, not unbound
- FuncCode const unbind = user_unbind_.getBinding(k).action_;
+ FuncCode const unbind = user_unbind_.getBinding(k).action();
docstring const action_string = makeCmdString(oldBinding);
- if (oldBinding.action_ > LFUN_NOACTION && unbind == LFUN_UNKNOWN_ACTION
+ if (oldBinding.action() > LFUN_NOACTION && unbind == LFUN_UNKNOWN_ACTION
&& save_lfun_ != toqstr(action_string)) {
// FIXME Perhaps we should offer to over-write the old shortcut?
// If so, we'll need to remove it from our list, etc.
? &(documentBufferView()->buffer()) : 0;
// Check whether we need a buffer
- if (!lyxaction.funcHasFlag(cmd.action_, LyXAction::NoBuffer) && !buf) {
+ if (!lyxaction.funcHasFlag(cmd.action(), LyXAction::NoBuffer) && !buf) {
// no, exit directly
flag.message(from_utf8(N_("Command not allowed with"
"out any document open")));
return true;
}
- if (cmd.origin_ == FuncRequest::TOC) {
+ if (cmd.origin() == FuncRequest::TOC) {
GuiToc * toc = static_cast<GuiToc*>(findOrBuild("toc", false));
FuncStatus fs;
if (toc->getStatus(documentBufferView()->cursor(), cmd, fs))
return true;
}
- switch(cmd.action_) {
+ switch(cmd.action()) {
case LFUN_BUFFER_IMPORT:
break;
Buffer * buffer = documentBufferView()
? &(documentBufferView()->buffer()) : 0;
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_VC_REGISTER:
if (!buffer || !ensureBufferClean(buffer))
break;
Buffer * doc_buffer = documentBufferView()
? &(documentBufferView()->buffer()) : 0;
- if (cmd.origin_ == FuncRequest::TOC) {
+ if (cmd.origin() == FuncRequest::TOC) {
GuiToc * toc = static_cast<GuiToc*>(findOrBuild("toc", false));
// FIXME: do we need to pass a DispatchResult object here?
toc->doDispatch(bv->cursor(), cmd);
string const argument = to_utf8(cmd.argument());
- switch(cmd.action_) {
+ switch(cmd.action()) {
case LFUN_BUFFER_CHILD_OPEN:
openChildDocument(to_utf8(cmd.argument()));
break;
case LFUN_BUFFER_ZOOM_IN:
case LFUN_BUFFER_ZOOM_OUT:
if (cmd.argument().empty()) {
- if (cmd.action_ == LFUN_BUFFER_ZOOM_IN)
+ if (cmd.action() == LFUN_BUFFER_ZOOM_IN)
lyxrc.zoom += 20;
else
lyxrc.zoom -= 20;
void GuiWorkArea::dispatch(FuncRequest const & cmd0, KeyModifier mod)
{
// Handle drag&drop
- if (cmd0.action_ == LFUN_FILE_OPEN) {
+ if (cmd0.action() == LFUN_FILE_OPEN) {
DispatchResult dr;
lyx_view_->dispatch(cmd0, dr);
return;
FuncRequest cmd;
- if (cmd0.action_ == LFUN_MOUSE_PRESS) {
+ if (cmd0.action() == LFUN_MOUSE_PRESS) {
if (mod == ShiftModifier)
cmd = FuncRequest(cmd0, "region-select");
else if (mod == ControlModifier)
cmd = cmd0;
bool const notJustMovingTheMouse =
- cmd.action_ != LFUN_MOUSE_MOTION || cmd.button() != mouse_button::none;
+ cmd.action() != LFUN_MOUSE_MOTION || cmd.button() != mouse_button::none;
// In order to avoid bad surprise in the middle of an operation, we better stop
// the blinking cursor.
buffer_view_->mouseEventDispatch(cmd);
// Skip these when selecting
- if (cmd.action_ != LFUN_MOUSE_MOTION) {
+ if (cmd.action() != LFUN_MOUSE_MOTION) {
completer_->updateVisibility(false, false);
lyx_view_->updateDialogs();
lyx_view_->updateStatusBar();
// so they come at a steady rate:
if (e->y() <= 20)
// _Force_ a scroll up:
- cmd.y_ = -40;
+ cmd.set_y(-40);
else
- cmd.y_ = viewport()->height();
+ cmd.set_y(viewport()->height());
// Store the event, to be handled when the timeout expires.
synthetic_mouse_event_.cmd = cmd;
FuncRequest::Origin origin = FuncRequest::MENU)
: kind_(kind), label_(label), func_(func), optional_(optional)
{
- func_.origin_ = origin;
+ func_.setOrigin(origin);
}
// boost::shared_ptr<MenuDefinition> needs this apprently...
return toqstr(bindings.begin()->print(KeySequence::ForGui));
LYXERR(Debug::KBMAP, "No binding for "
- << lyxaction.getActionName(func_.action_)
+ << lyxaction.getActionName(func_.action())
<< '(' << func_.argument() << ')');
return QString();
}
TocItem const & item =
gui_view_.tocModels().currentItem(current_type_, index);
- switch (cmd.action_)
+ switch (cmd.action())
{
case LFUN_CHANGE_ACCEPT:
case LFUN_CHANGE_REJECT:
// Start an undo group.
cur.beginUndoGroup();
- switch (cmd.action_)
+ switch (cmd.action())
{
case LFUN_CHANGE_ACCEPT:
case LFUN_CHANGE_REJECT:
case LFUN_OUTLINE_DOWN:
case LFUN_OUTLINE_IN:
case LFUN_OUTLINE_OUT:
- outline(cmd.action_);
+ outline(cmd.action());
break;
default:
void ToolbarInfo::add(ToolbarItem const & item)
{
items.push_back(item);
- items.back().func_.origin_ = FuncRequest::TOOLBAR;
+ items.back().func_.setOrigin(FuncRequest::TOOLBAR);
}
void Inset::doDispatch(Cursor & cur, FuncRequest &cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_MOUSE_RELEASE:
// if the derived inset did not explicitly handle mouse_release,
// we assume we request the settings dialog
// Dialogs::checkStatus() ensures that the dialog is deactivated if
// LFUN_INSET_APPLY is disabled.
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
// Allow modification of our data.
// This needs to be handled in the doDispatch method of our
void InsetBibitem::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
InsetCommandParams p(BIBITEM_CODE);
void InsetBibtex::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_EDIT:
editDatabases();
bool InsetBibtex::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_EDIT:
flag.setEnabled(true);
return true;
void InsetBox::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
//lyxerr << "InsetBox::dispatch MODIFY" << endl;
bool InsetBox::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "changetype")
void InsetBranch::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
InsetBranchParams params;
InsetBranch::string2params(to_utf8(cmd.argument()), params);
if (!our_branch)
break;
}
- our_branch->setSelected(cmd.action_ == LFUN_BRANCH_ACTIVATE);
+ our_branch->setSelected(cmd.action() == LFUN_BRANCH_ACTIVATE);
break;
}
case LFUN_INSET_TOGGLE:
bool InsetBranch::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
flag.setEnabled(true);
break;
bool InsetCaption::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_BREAK_PARAGRAPH:
status.setEnabled(false);
bool InsetCollapsable::hitButton(FuncRequest const & cmd) const
{
- return button_dim.contains(cmd.x_, cmd.y_);
+ return button_dim.contains(cmd.x(), cmd.y());
}
//lyxerr << "InsetCollapsable::doDispatch (begin): cmd: " << cmd
// << " cur: " << cur << " bvcur: " << cur.bv().cursor() << endl;
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_MOUSE_PRESS:
if (hitButton(cmd)) {
switch (cmd.button()) {
bool InsetCollapsable::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_TOGGLE:
if (cmd.argument() == "open")
flag.setEnabled(status_ != Open);
void InsetCommand::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
if (cmd.getArg(0) == "changetype") {
p_.setCmdName(cmd.getArg(1));
bool InsetCommand::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
// suppress these
case LFUN_ERT_INSERT:
status.setEnabled(false);
void InsetERT::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
setStatus(cur, string2params(to_utf8(cmd.argument())));
break;
bool InsetERT::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
status.setEnabled(true);
return true;
void InsetExternal::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_EDIT: {
InsetExternalParams p = params();
bool InsetExternal::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_EDIT:
case LFUN_INSET_MODIFY:
bool InsetFlex::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_DISSOLVE:
if (!cmd.argument().empty()) {
InsetLayout const & il = getLayout();
void InsetFlex::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_DISSOLVE:
if (!cmd.argument().empty()) {
InsetLayout const & il = getLayout();
void InsetFloat::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
InsetFloatParams params;
bool InsetFloat::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
void InsetGraphics::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_EDIT: {
InsetGraphicsParams p = params();
if (!cmd.argument().empty())
bool InsetGraphics::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_EDIT:
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_EDIT: {
editIncluded(to_utf8(params()["filename"]));
bool InsetInclude::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_EDIT:
flag.setEnabled(true);
void InsetIndex::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
if (cmd.getArg(0) == "changetype") {
bool InsetIndex::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "changetype") {
void InsetPrintIndex::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
if (cmd.argument() == from_ascii("toggle-subindex")) {
bool InsetPrintIndex::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
if (cmd.argument() == from_ascii("toggle-subindex")) {
case MENU_INFO:
case ICON_INFO: {
FuncRequest func = lyxaction.lookupFunc(name);
- return func.action_ != LFUN_UNKNOWN_ACTION;
+ return func.action() != LFUN_UNKNOWN_ACTION;
}
case LYXRC_INFO: {
ostringstream oss;
bool InsetInfo::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_SETTINGS:
return InsetCollapsable::getStatus(cur, cmd, flag);
void InsetInfo::doDispatch(Cursor & cur, FuncRequest & cmd)
{
// allow selection, copy but not cut, delete etc
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_SETTINGS:
InsetCollapsable::doDispatch(cur, cmd);
break;
break;
case SHORTCUT_INFO:
case SHORTCUTS_INFO: {
- FuncRequest func = lyxaction.lookupFunc(name_);
- if (func.action_ == LFUN_UNKNOWN_ACTION) {
+ FuncRequest const func = lyxaction.lookupFunc(name_);
+ if (func.action() == LFUN_UNKNOWN_ACTION) {
error("Unknown action %1$s");
break;
}
}
case MENU_INFO: {
docstring_list names;
- FuncRequest func = lyxaction.lookupFunc(name_);
- if (func.action_ == LFUN_UNKNOWN_ACTION) {
+ FuncRequest const func = lyxaction.lookupFunc(name_);
+ if (func.action() == LFUN_UNKNOWN_ACTION) {
error("Unknown action %1$s");
break;
}
FuncStatus & status) const
{
bool enabled;
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_LABEL_INSERT_AS_REF:
case LFUN_LABEL_COPY_AS_REF:
enabled = true;
void InsetLabel::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
InsetCommandParams p(LABEL_CODE);
void InsetListings::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
InsetListings::string2params(to_utf8(cmd.argument()), params());
bool InsetListings::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
status.setEnabled(true);
void InsetNewline::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
InsetNewlineParams params;
bool InsetNewline::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
// we handle these
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "newline") {
void InsetNewpage::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
InsetNewpageParams params;
bool InsetNewpage::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
// we handle these
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "newpage") {
void InsetPrintNomencl::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
InsetCommandParams p(NOMENCL_PRINT_CODE);
bool InsetPrintNomencl::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_DIALOG_UPDATE:
case LFUN_INSET_MODIFY:
void InsetNote::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
string2params(to_utf8(cmd.argument()), params_);
bool InsetNote::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
// disallow comment and greyed out in commands
void InsetPhantom::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
string2params(to_utf8(cmd.argument()), params_);
bool InsetPhantom::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "phantom") {
void InsetSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
string2params(to_utf8(cmd.argument()), params_);
bool InsetSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
// we handle these
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "space") {
FuncStatus & status) const
{
bool enabled;
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_LAYOUT:
enabled = !forcePlainLayout();
break;
CursorSlice sl = cur.top();
Cursor & bvcur = cur.bv().cursor();
- switch (cmd.action_) {
+ FuncCode const act = cmd.action();
+
+ switch (act) {
case LFUN_MOUSE_PRESS: {
//lyxerr << "# InsetTabular::MousePress\n" << cur.bv().cursor() << endl;
// select row
- if (cmd.x_ < xo(cur.bv()) + ADD_TO_TABULAR_WIDTH
- || cmd.x_ > xo(cur.bv()) + tabular.width()) {
- row_type r = rowFromY(cur, cmd.y_);
+ if (cmd.x() < xo(cur.bv()) + ADD_TO_TABULAR_WIDTH
+ || cmd.x() > xo(cur.bv()) + tabular.width()) {
+ row_type r = rowFromY(cur, cmd.y());
cur.idx() = tabular.getFirstCellInRow(r);
cur.pos() = 0;
cur.resetAnchor();
}
// select column
int const y0 = yo(cur.bv()) - tabular.rowAscent(0);
- if (cmd.y_ < y0 + ADD_TO_TABULAR_WIDTH
- || cmd.y_ > y0 + tabular.height()) {
- col_type c = columnFromX(cur, cmd.x_);
+ if (cmd.y() < y0 + ADD_TO_TABULAR_WIDTH
+ || cmd.y() > y0 + tabular.height()) {
+ col_type c = columnFromX(cur, cmd.x());
cur.idx() = tabular.cellIndex(0, c);
cur.pos() = 0;
cur.resetAnchor();
}
// select (additional) row
if (rowselect_) {
- row_type r = rowFromY(cur, cmd.y_);
+ row_type r = rowFromY(cur, cmd.y());
cur.idx() = tabular.getLastCellInRow(r);
// we need to reset the cursor's pit and pos now, as the old ones
// may no longer be valid.
}
// select (additional) column
if (colselect_) {
- col_type c = columnFromX(cur, cmd.x_);
+ col_type c = columnFromX(cur, cmd.x());
cur.idx() = tabular.cellIndex(tabular.nrows() - 1, c);
// we need to reset the cursor's pit and pos now, as the old ones
// may no longer be valid.
if (bvcur.idx() == cur.idx() &&
!(bvcur.anchor_.idx() == cur.idx() && bvcur.pos() != cur.pos()))
cur.noUpdate();
- setCursorFromCoordinates(cur, cmd.x_, cmd.y_);
+ setCursorFromCoordinates(cur, cmd.x(), cmd.y());
bvcur.setCursor(cur);
bvcur.setSelection(true);
// if this is a multicell selection, we just set the cursor to
EntryDirection entry_from = ENTRY_DIRECTION_IGNORE;
FuncCode finish_lfun;
- if (cmd.action_ == LFUN_CHAR_FORWARD
- || cmd.action_ == LFUN_CHAR_FORWARD_SELECT) {
+ if (act == LFUN_CHAR_FORWARD
+ || act == LFUN_CHAR_FORWARD_SELECT) {
next_cell = true;
finish_lfun = LFUN_FINISHED_FORWARD;
}
- else if (cmd.action_ == LFUN_CHAR_BACKWARD
- || cmd.action_ == LFUN_CHAR_BACKWARD_SELECT) {
+ else if (act == LFUN_CHAR_BACKWARD
+ || act == LFUN_CHAR_BACKWARD_SELECT) {
next_cell = false;
finish_lfun = LFUN_FINISHED_BACKWARD;
}
// LEFT or RIGHT commands --- the interpretation will depend on the
// table's direction.
else {
- bool const right = cmd.action_ == LFUN_CHAR_RIGHT
- || cmd.action_ == LFUN_CHAR_RIGHT_SELECT;
+ bool const right = act == LFUN_CHAR_RIGHT
+ || act == LFUN_CHAR_RIGHT_SELECT;
next_cell = isRightToLeft(cur) != right;
if (lyxrc.visual_cursor)
finish_lfun = right ? LFUN_FINISHED_RIGHT : LFUN_FINISHED_LEFT;
}
- bool const select = cmd.action_ == LFUN_CHAR_FORWARD_SELECT ||
- cmd.action_ == LFUN_CHAR_BACKWARD_SELECT ||
- cmd.action_ == LFUN_CHAR_RIGHT_SELECT ||
- cmd.action_ == LFUN_CHAR_LEFT_SELECT;
+ bool const select = act == LFUN_CHAR_FORWARD_SELECT ||
+ act == LFUN_CHAR_BACKWARD_SELECT ||
+ act == LFUN_CHAR_RIGHT_SELECT ||
+ act == LFUN_CHAR_LEFT_SELECT;
// If we have a multicell selection or we're
// not doing some LFUN_*_SELECT thing anyway...
// if our Text didn't do anything to the cursor
// then we try to put the cursor into the cell below
// setting also the right targetX.
- cur.selHandle(cmd.action_ == LFUN_DOWN_SELECT);
+ cur.selHandle(act == LFUN_DOWN_SELECT);
if (tabular.cellRow(cur.idx()) != tabular.nrows() - 1) {
cur.idx() = tabular.cellBelow(cur.idx());
cur.pit() = 0;
// if our Text didn't do anything to the cursor
// then we try to put the cursor into the cell above
// setting also the right targetX.
- cur.selHandle(cmd.action_ == LFUN_UP_SELECT);
+ cur.selHandle(act == LFUN_UP_SELECT);
if (tabular.cellRow(cur.idx()) != 0) {
cur.idx() = tabular.cellAbove(cur.idx());
cur.pit() = cur.lastpit();
case LFUN_CLIPBOARD_PASTE:
case LFUN_PRIMARY_SELECTION_PASTE: {
- docstring const clip = (cmd.action_ == LFUN_CLIPBOARD_PASTE) ?
+ docstring const clip = (act == LFUN_CLIPBOARD_PASTE) ?
theClipboard().getAsText() :
theSelection().get();
if (clip.empty())
bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
if (&cur.inset() != this || cmd.getArg(0) != "tabular")
break;
void InsetText::doDispatch(Cursor & cur, FuncRequest & cmd)
{
LYXERR(Debug::ACTION, "InsetText::doDispatch()"
- << " [ cmd.action_ = " << cmd.action_ << ']');
+ << " [ cmd.action() = " << cmd.action() << ']');
if (getLayout().isPassThru()) {
// Force any new text to latex_language FIXME: This
cur.real_current_font.setLanguage(latex_language);
}
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_PASTE:
case LFUN_CLIPBOARD_PASTE:
case LFUN_SELECTION_PASTE:
bool InsetText::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_DISSOLVE: {
bool const main_inset = &buffer().inset() == this;
bool const target_inset = cmd.argument().empty()
void InsetVSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
InsetVSpace::string2params(to_utf8(cmd.argument()), space_);
bool InsetVSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
// we handle these
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "vspace") {
void InsetWrap::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
InsetWrapParams params;
InsetWrap::string2params(to_utf8(cmd.argument()), params);
bool InsetWrap::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
flag.setEnabled(true);
bool find(BufferView * bv, FuncRequest const & ev)
{
- if (!bv || ev.action_ != LFUN_WORD_FIND)
+ if (!bv || ev.action() != LFUN_WORD_FIND)
return false;
//lyxerr << "find called, cmd: " << ev << endl;
void replace(BufferView * bv, FuncRequest const & ev, bool has_deleted)
{
- if (!bv || ev.action_ != LFUN_WORD_REPLACE)
+ if (!bv || ev.action() != LFUN_WORD_REPLACE)
return;
// data is of the form
bool InsetMathAMSArray::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
istringstream is(to_utf8(cmd.argument()));
string s;
void InsetMathCases::doDispatch(Cursor & cur, FuncRequest & cmd)
{
//lyxerr << "*** InsetMathCases: request: " << cmd << endl;
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
istringstream is(to_utf8(cmd.argument()));
string s;
bool InsetMathCases::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
istringstream is(to_utf8(cmd.argument()));
string s;
Parse::flags parseflg = Parse::QUIET | Parse::USETEXT;
- switch (cmd.action_) {
+ FuncCode const act = cmd.action();
+ switch (act) {
// insert file functions
case LFUN_LINE_DELETE:
case LFUN_WORD_BACKWARD:
case LFUN_WORD_LEFT_SELECT:
case LFUN_WORD_LEFT:
- cur.selHandle(cmd.action_ == LFUN_WORD_BACKWARD_SELECT ||
- cmd.action_ == LFUN_WORD_LEFT_SELECT ||
- cmd.action_ == LFUN_LINE_BEGIN_SELECT);
+ cur.selHandle(act == LFUN_WORD_BACKWARD_SELECT ||
+ act == LFUN_WORD_LEFT_SELECT ||
+ act == LFUN_LINE_BEGIN_SELECT);
cur.macroModeClose();
if (cur.pos() != 0) {
cur.pos() = 0;
case LFUN_WORD_RIGHT:
case LFUN_LINE_END_SELECT:
case LFUN_LINE_END:
- cur.selHandle(cmd.action_ == LFUN_WORD_FORWARD_SELECT ||
- cmd.action_ == LFUN_WORD_RIGHT_SELECT ||
- cmd.action_ == LFUN_LINE_END_SELECT);
+ cur.selHandle(act == LFUN_WORD_FORWARD_SELECT ||
+ act == LFUN_WORD_RIGHT_SELECT ||
+ act == LFUN_LINE_END_SELECT);
cur.macroModeClose();
cur.clearTargetX();
if (cur.pos() != cur.lastpos()) {
bool InsetMathGrid::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
istringstream is(to_utf8(cmd.argument()));
string s;
void InsetMathHull::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- //lyxerr << "action: " << cmd.action_ << endl;
- switch (cmd.action_) {
+ //lyxerr << "action: " << cmd.action() << endl;
+ switch (cmd.action()) {
case LFUN_FINISHED_BACKWARD:
case LFUN_FINISHED_FORWARD:
case LFUN_FINISHED_RIGHT:
case LFUN_FINISHED_LEFT:
- //lyxerr << "action: " << cmd.action_ << endl;
+ //lyxerr << "action: " << cmd.action() << endl;
InsetMathGrid::doDispatch(cur, cmd);
cur.undispatched();
break;
bool InsetMathHull::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_FINISHED_BACKWARD:
case LFUN_FINISHED_FORWARD:
case LFUN_FINISHED_RIGHT:
Parse::flags parseflg = Parse::QUIET | Parse::USETEXT;
- switch (cmd.action_) {
+ FuncCode const act = cmd.action();
+ switch (act) {
case LFUN_CLIPBOARD_PASTE:
parseflg |= Parse::VERBATIM;
case LFUN_CHAR_BACKWARD_SELECT:
case LFUN_CHAR_FORWARD_SELECT: {
// are we in a selection?
- bool select = (cmd.action_ == LFUN_CHAR_RIGHT_SELECT
- || cmd.action_ == LFUN_CHAR_LEFT_SELECT
- || cmd.action_ == LFUN_CHAR_BACKWARD_SELECT
- || cmd.action_ == LFUN_CHAR_FORWARD_SELECT);
+ bool select = (act == LFUN_CHAR_RIGHT_SELECT
+ || act == LFUN_CHAR_LEFT_SELECT
+ || act == LFUN_CHAR_BACKWARD_SELECT
+ || act == LFUN_CHAR_FORWARD_SELECT);
// are we moving forward or backwards?
// If the command was RIGHT or LEFT, then whether we're moving forward
// or backwards depends on the cursor movement mode (logical or visual):
bool forward;
FuncCode finish_lfun;
- if (cmd.action_ == LFUN_CHAR_FORWARD
- || cmd.action_ == LFUN_CHAR_FORWARD_SELECT) {
+ if (act == LFUN_CHAR_FORWARD
+ || act == LFUN_CHAR_FORWARD_SELECT) {
forward = true;
finish_lfun = LFUN_FINISHED_FORWARD;
}
- else if (cmd.action_ == LFUN_CHAR_BACKWARD
- || cmd.action_ == LFUN_CHAR_BACKWARD_SELECT) {
+ else if (act == LFUN_CHAR_BACKWARD
+ || act == LFUN_CHAR_BACKWARD_SELECT) {
forward = false;
finish_lfun = LFUN_FINISHED_BACKWARD;
}
else {
- bool right = (cmd.action_ == LFUN_CHAR_RIGHT_SELECT
- || cmd.action_ == LFUN_CHAR_RIGHT);
+ bool right = (act == LFUN_CHAR_RIGHT_SELECT
+ || act == LFUN_CHAR_RIGHT);
if (lyxrc.visual_cursor || !reverseDirectionNeeded(cur))
forward = right;
else
}
// stop/start the selection
- bool select = cmd.action_ == LFUN_DOWN_SELECT ||
- cmd.action_ == LFUN_UP_SELECT;
+ bool select = act == LFUN_DOWN_SELECT ||
+ act == LFUN_UP_SELECT;
cur.selHandle(select);
// go up/down
- bool up = cmd.action_ == LFUN_UP || cmd.action_ == LFUN_UP_SELECT;
+ bool up = act == LFUN_UP || act == LFUN_UP_SELECT;
bool successful = cur.upDownInMath(up);
if (successful)
break;
case LFUN_LINE_BEGIN_SELECT:
case LFUN_WORD_BACKWARD_SELECT:
case LFUN_WORD_LEFT_SELECT:
- cur.selHandle(cmd.action_ == LFUN_WORD_BACKWARD_SELECT ||
- cmd.action_ == LFUN_WORD_LEFT_SELECT ||
- cmd.action_ == LFUN_LINE_BEGIN_SELECT);
+ cur.selHandle(act == LFUN_WORD_BACKWARD_SELECT ||
+ act == LFUN_WORD_LEFT_SELECT ||
+ act == LFUN_LINE_BEGIN_SELECT);
cur.macroModeClose();
if (cur.pos() != 0) {
cur.pos() = 0;
case LFUN_WORD_FORWARD_SELECT:
case LFUN_WORD_RIGHT_SELECT:
case LFUN_LINE_END_SELECT:
- cur.selHandle(cmd.action_ == LFUN_WORD_FORWARD_SELECT ||
- cmd.action_ == LFUN_WORD_RIGHT_SELECT ||
- cmd.action_ == LFUN_LINE_END_SELECT);
+ cur.selHandle(act == LFUN_WORD_FORWARD_SELECT ||
+ act == LFUN_WORD_RIGHT_SELECT ||
+ act == LFUN_LINE_END_SELECT);
cur.macroModeClose();
cur.clearTargetX();
if (cur.pos() != cur.lastpos()) {
case LFUN_MATH_MACRO_FOLD:
case LFUN_MATH_MACRO_UNFOLD: {
Cursor it = cur;
- bool fold = cmd.action_ == LFUN_MATH_MACRO_FOLD;
+ bool fold = act == LFUN_MATH_MACRO_FOLD;
bool found = findMacroToFoldUnfold(it, fold);
if (found) {
MathMacro * macro = it.nextInset()->asInsetMath()->asMacro();
//string tc = "mathnormal";
bool ret = true;
string const arg = to_utf8(cmd.argument());
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
flag.setEnabled(false);
break;
case LFUN_MATH_MACRO_FOLD:
case LFUN_MATH_MACRO_UNFOLD: {
Cursor it = cur;
- bool found = findMacroToFoldUnfold(it, cmd.action_ == LFUN_MATH_MACRO_FOLD);
+ bool found = findMacroToFoldUnfold(it, cmd.action() == LFUN_MATH_MACRO_FOLD);
flag.setEnabled(found);
break;
}
void InsetMathRef::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "ref") {
MathData ar;
bool InsetMathRef::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
// we handle these
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
{
//LYXERR("InsetMathScript: request: " << cmd);
- if (cmd.action_ == LFUN_MATH_LIMITS) {
+ if (cmd.action() == LFUN_MATH_LIMITS) {
if (!cmd.argument().empty()) {
if (cmd.argument() == "limits")
limits_ = 1;
bool InsetMathSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & status) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
// we handle these
case LFUN_INSET_MODIFY:
case LFUN_INSET_DIALOG_UPDATE:
void InsetMathSpace::doDispatch(Cursor & cur, FuncRequest & cmd)
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY:
if (cmd.getArg(0) == "mathspace") {
MathData ar;
bool InsetMathSplit::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
istringstream is(to_utf8(cmd.argument()));
string s;
bool InsetMathSubstack::getStatus(Cursor & cur, FuncRequest const & cmd,
FuncStatus & flag) const
{
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_INSET_MODIFY: {
istringstream is(to_utf8(cmd.argument()));
string s;
void MathMacroTemplate::doDispatch(Cursor & cur, FuncRequest & cmd)
{
string const arg = to_utf8(cmd.argument());
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_MATH_MACRO_ADD_PARAM:
if (numargs_ < 9) {
{
bool ret = true;
string const arg = to_utf8(cmd.argument());
- switch (cmd.action_) {
+ switch (cmd.action()) {
case LFUN_MATH_MACRO_ADD_PARAM: {
int num = numargs_ + 1;
if (arg.size() != 0)