3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "funcrequest.h"
21 using std::istringstream;
26 FuncRequest::FuncRequest()
27 : action(LFUN_NOACTION), x(0), y(0), button_(mouse_button::none)
31 FuncRequest::FuncRequest(kb_action act)
32 : action(act), x(0), y(0), button_(mouse_button::none)
36 FuncRequest::FuncRequest(kb_action act, string const & arg)
37 : action(act), argument(arg), x(0), y(0), button_(mouse_button::none)
41 FuncRequest::FuncRequest(kb_action act, int ax, int ay, mouse_button::state but)
42 : action(act), x(ax), y(ay), button_(but)
46 FuncRequest::FuncRequest(FuncRequest const & cmd, string const & arg)
47 : action(cmd.action), argument(arg),
48 x(cmd.x), y(cmd.y), button_(cmd.button_)
52 mouse_button::state FuncRequest::button() const
58 void split(vector<string> & args, string str)
60 istringstream is(str);
76 string FuncRequest::getArg(unsigned int i) const
79 split(args, argument);
80 return i < args.size() ? args[i] : string();
84 bool operator==(FuncRequest const & lhs, FuncRequest const & rhs)
86 return lhs.action == rhs.action && lhs.argument == rhs.argument;
90 std::ostream & operator<<(std::ostream & os, FuncRequest const & cmd)
93 << " action: " << cmd.action
94 << " arg: '" << cmd.argument << "'"