X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FFuncRequest.cpp;h=3eb0990a01f7d15e787bf1c6a0247c3914ef3271;hb=243da49ee9877c35f687864ada2c4be227c7c70e;hp=d853ada38e34dd0db01b2fc0580f187aa7925380;hpb=f630be890494c849981e4fb52ea4740506e92bed;p=lyx.git diff --git a/src/FuncRequest.cpp b/src/FuncRequest.cpp index d853ada38e..3eb0990a01 100644 --- a/src/FuncRequest.cpp +++ b/src/FuncRequest.cpp @@ -3,7 +3,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author André Pönitz + * \author André Pönitz * * Full author contact details are available in file CREDITS. */ @@ -11,19 +11,18 @@ #include #include "FuncRequest.h" +#include "LyXAction.h" #include #include #include +using namespace std; namespace lyx { -using std::getline; -using std::istringstream; -using std::vector; -using std::string; - +FuncRequest const FuncRequest::unknown(LFUN_UNKNOWN_ACTION); +FuncRequest const FuncRequest::noaction(LFUN_NOACTION); FuncRequest::FuncRequest(Origin o) : action(LFUN_NOACTION), origin(o), x(0), y(0), @@ -31,24 +30,24 @@ FuncRequest::FuncRequest(Origin o) {} -FuncRequest::FuncRequest(kb_action act, Origin o) +FuncRequest::FuncRequest(FuncCode act, Origin o) : action(act), origin(o), x(0), y(0), button_(mouse_button::none) {} -FuncRequest::FuncRequest(kb_action act, docstring const & arg, Origin o) +FuncRequest::FuncRequest(FuncCode act, docstring const & arg, Origin o) : action(act), argument_(arg), origin(o), x(0), y(0), button_(mouse_button::none) {} -FuncRequest::FuncRequest(kb_action act, string const & arg, Origin o) +FuncRequest::FuncRequest(FuncCode act, string const & arg, Origin o) : action(act), argument_(from_utf8(arg)), origin(o), x(0), y(0), button_(mouse_button::none) {} -FuncRequest::FuncRequest(kb_action act, int ax, int ay, +FuncRequest::FuncRequest(FuncCode act, int ax, int ay, mouse_button::state but, Origin o) : action(act), origin(o), x(ax), y(ay), button_(but) {} @@ -72,7 +71,7 @@ mouse_button::state FuncRequest::button() const } -void split(vector & args, string const & str) +void splitArg(vector & args, string const & str) { istringstream is(str); while (is) { @@ -95,7 +94,7 @@ void split(vector & args, string const & str) string FuncRequest::getArg(unsigned int i) const { vector args; - split(args, to_utf8(argument_)); + splitArg(args, to_utf8(argument_)); return i < args.size() ? args[i] : string(); } @@ -106,10 +105,11 @@ bool operator==(FuncRequest const & lhs, FuncRequest const & rhs) } -std::ostream & operator<<(std::ostream & os, FuncRequest const & cmd) +ostream & operator<<(ostream & os, FuncRequest const & cmd) { return os - << " action: " << cmd.action + << " action: " << cmd.action + << " [" << lyxaction.getActionName(cmd.action) << "] " << " arg: '" << to_utf8(cmd.argument()) << "'" << " x: " << cmd.x << " y: " << cmd.y;