author | wazlaf <wazlaf> | 2002-10-13 13:49:11 (UTC) |
---|---|---|
committer | wazlaf <wazlaf> | 2002-10-13 13:49:11 (UTC) |
commit | 68c37a3412ef4609ba0209318ef2b06f7dd1aaf1 (patch) (side-by-side diff) | |
tree | f81ee5460dd49c4fcb8a61bf50911c5036742bed /noncore/apps/opie-console/emulation_layer.h | |
parent | 0e6d241e26211a8ffff07ba8e23f4a3cec9065be (diff) | |
download | opie-68c37a3412ef4609ba0209318ef2b06f7dd1aaf1.zip opie-68c37a3412ef4609ba0209318ef2b06f7dd1aaf1.tar.gz opie-68c37a3412ef4609ba0209318ef2b06f7dd1aaf1.tar.bz2 |
Scripting functionality added. What this currently does is catch keys in the emulation_layer
and store them in a "Script" instance. This can later be saved to a file and on request
"replayed" by sending the typed keys to the associated IOLayer
Diffstat (limited to 'noncore/apps/opie-console/emulation_layer.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/emulation_layer.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/emulation_layer.h b/noncore/apps/opie-console/emulation_layer.h index 91a4856..928ad04 100644 --- a/noncore/apps/opie-console/emulation_layer.h +++ b/noncore/apps/opie-console/emulation_layer.h @@ -29,12 +29,13 @@ #include "widget_layer.h" #include "screen.h" #include <qtimer.h> #include <stdio.h> #include <qtextcodec.h> #include "keytrans.h" +#include "script.h" class EmulationLayer : public QObject { Q_OBJECT public: @@ -101,12 +102,28 @@ public: virtual void setConnect(bool r); void setColumns(int columns); void setKeytrans(int no); void setKeytrans(const char * no); + /* Scripts */ + + /* Create a new script and record all typed characters */ + void startRecording(); + + /* Return whether we are currently recording a script */ + bool isRecording(); + + /* Return the current script (or NULL) */ + Script *script(); + + /* Stop recording and remove the current script from memory */ + void clearScript(); + + /* Run a script by forwarding its keys to the EmulationLayer */ + void runScript(const Script *); protected: WidgetLayer* gui; Screen* scr; // referes to one `screen' Screen* screen[2]; // 0 = primary, 1 = alternate void setScreen(int n); // set `scr' to `screen[n]' @@ -136,11 +153,11 @@ private: private: QTimer bulk_timer; int bulk_nlcnt; // bulk newline counter char* SelectedText; int bulk_incnt; // bulk counter - + Script *m_script; }; #endif // ifndef EMULATION_H |