diff options
| author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-11-24 04:57:26 +0100 |
|---|---|---|
| committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2014-11-24 05:07:06 +0100 |
| commit | 1e5115b0b40bcf57501d4b0b5dce8e7ecd61432d (patch) | |
| tree | 0dc00efad34dcc3a013ca26612fa759298ed9490 /src/qregisters.h | |
| parent | d503c3b07c2157658f699294c44ad5be244727a5 (diff) | |
Q-Register loading and saving using the IOView class
* EW can save Q-Registers now
* the new E% may be used to save a q-register without making it
the current document
Diffstat (limited to 'src/qregisters.h')
| -rw-r--r-- | src/qregisters.h | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/qregisters.h b/src/qregisters.h index 80222f8..9dd3989 100644 --- a/src/qregisters.h +++ b/src/qregisters.h @@ -27,6 +27,7 @@ #include "sciteco.h" #include "interface.h" +#include "ioview.h" #include "undo.h" #include "rbtree.h" #include "parser.h" @@ -35,8 +36,8 @@ namespace SciTECO { namespace QRegisters { - /* initialized after Interface.main() in main() */ - extern ViewCurrent view; + /* initialized after Interface::main() in main() */ + extern IOView view; } /* @@ -134,12 +135,12 @@ public: void execute(bool locals = true); + /* + * Load and save already care about undo token + * creation. + */ void load(const gchar *filename); - inline void - undo_load(void) - { - undo_set_string(); - } + void save(const gchar *filename); }; class QRegisterBufferInfo : public QRegister { @@ -356,6 +357,16 @@ private: State *done(const gchar *str); }; +class StateEPctCommand : public StateExpectQReg { +private: + State *got_register(QRegister ®); +}; + +class StateSaveQReg : public StateExpectFile { +private: + State *done(const gchar *str); +}; + class StateCtlUCommand : public StateExpectQReg { public: StateCtlUCommand() : StateExpectQReg(true) {} @@ -433,6 +444,8 @@ namespace States { extern StatePopQReg popqreg; extern StateEQCommand eqcommand; extern StateLoadQReg loadqreg; + extern StateEPctCommand epctcommand; + extern StateSaveQReg saveqreg; extern StateCtlUCommand ctlucommand; extern StateEUCommand eucommand; extern StateSetQRegString setqregstring_nobuilding; |
