]> git.lyx.org Git - lyx.git/blobdiff - src/funcrequest.C
layout file converter for layout files in old format
[lyx.git] / src / funcrequest.C
index 8dfd9f6d792f3e10cdf3a6906fa822824f97a297..ea709c88984960a41c4c4567514e31e055a76475 100644 (file)
 #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;
@@ -27,28 +23,31 @@ using std::vector;
 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_)
 {}
 
@@ -59,40 +58,22 @@ mouse_button::state FuncRequest::button() const
 }
 
 
-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)
+void split(vector<string> & args, string const & str)
 {
        istringstream is(str);
        while (is) {
                char c;
                string s;
                is >> c;
-               if (c == '"')
-                       getline(is, s, '"');
-               else {
-                       is.putback(c);
-                       is >> s;
+               if (is) {
+                       if (c == '"')
+                               getline(is, s, '"');
+                       else {
+                               is.putback(c);
+                               is >> s;
+                       }
+                       args.push_back(s);
                }
-               args.push_back(s);
        }
 }
 
@@ -114,8 +95,8 @@ bool operator==(FuncRequest const & lhs, FuncRequest const & rhs)
 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;
 }