#include <config.h>
#include "funcrequest.h"
-#include "BufferView.h"
-#include "lyxfunc.h" // only for setMessage()
-#include "frontends/LyXView.h"
-#include "debug.h"
-#include "support/std_sstream.h"
#include <iostream>
+#include <sstream>
+#include <vector>
-using std::endl;
using std::getline;
using std::istringstream;
using std::string;
-FuncRequest::FuncRequest()
- : action(LFUN_NOACTION), x(0), y(0), button_(mouse_button::none)
+FuncRequest::FuncRequest(Origin o)
+ : action(LFUN_NOACTION), origin(o), x(0), y(0),
+ button_(mouse_button::none)
{}
-FuncRequest::FuncRequest(kb_action act)
- : action(act), x(0), y(0), button_(mouse_button::none)
+FuncRequest::FuncRequest(kb_action act, Origin o)
+ : action(act), origin(o), x(0), y(0), button_(mouse_button::none)
{}
-FuncRequest::FuncRequest(kb_action act, string const & arg)
- : action(act), argument(arg), x(0), y(0), button_(mouse_button::none)
+FuncRequest::FuncRequest(kb_action act, string const & arg, Origin o)
+ : action(act), argument(arg), origin(o), x(0), y(0),
+ button_(mouse_button::none)
{}
-FuncRequest::FuncRequest(kb_action act, int ax, int ay, mouse_button::state but)
- : action(act), x(ax), y(ay), button_(but)
+FuncRequest::FuncRequest(kb_action act, int ax, int ay,
+ mouse_button::state but, Origin o)
+ : action(act), origin(o), x(ax), y(ay), button_(but)
{}
-FuncRequest::FuncRequest(FuncRequest const & cmd, string const & arg)
- : action(cmd.action), argument(arg),
+FuncRequest::FuncRequest(FuncRequest const & cmd, string const & arg, Origin o)
+ : action(cmd.action), argument(arg), origin(o),
x(cmd.x), y(cmd.y), button_(cmd.button_)
{}
}
-void FuncRequest::message(string const & msg) const
-{
-#warning FIXME
- //if (view_)
- // view_->owner()->getLyXFunc().setMessage(msg);
- //else
- lyxerr << "Dropping message '" << msg << "'" << endl;
-}
-
-
-void FuncRequest::errorMessage(string const & msg) const
-{
-#warning FIXME
- //if (view_)
- // view_->owner()->getLyXFunc().setErrorMessage(msg);
- //else
- lyxerr << "Dropping error message '" << msg << "'" << endl;
-}
-
-
void split(vector<string> & args, string str)
{
istringstream is(str);
std::ostream & operator<<(std::ostream & os, FuncRequest const & cmd)
{
return os
- << " action: " << cmd.action
+ << " action: " << cmd.action
<< " arg: '" << cmd.argument << "'"
- << " x: " << cmd.x
- << " y: " << cmd.y;
+ << " x: " << cmd.x
+ << " y: " << cmd.y;
}