diff options
| author | 2017-01-22 22:35:13 -0500 | |
|---|---|---|
| committer | 2017-01-22 22:35:13 -0500 | |
| commit | 291ded52ac4ab8234fc30468e941c1800adffe8c (patch) | |
| tree | 18cc6dce3434ecf7e363a52590bd9484394898b0 /externals/qhexedit/commands.h | |
| parent | Merge pull request #2458 from wwylele/reset-accel-gyro (diff) | |
| parent | Removed unused and outdated external qhexedit (diff) | |
| download | yuzu-291ded52ac4ab8234fc30468e941c1800adffe8c.tar.gz yuzu-291ded52ac4ab8234fc30468e941c1800adffe8c.tar.xz yuzu-291ded52ac4ab8234fc30468e941c1800adffe8c.zip | |
Merge pull request #2466 from Kloen/we-dont-need-this
Removed unused and outdated external qhexedit
Diffstat (limited to '')
| -rw-r--r-- | externals/qhexedit/commands.h | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/externals/qhexedit/commands.h b/externals/qhexedit/commands.h deleted file mode 100644 index 9931b3fb5..000000000 --- a/externals/qhexedit/commands.h +++ /dev/null | |||
| @@ -1,70 +0,0 @@ | |||
| 1 | #ifndef COMMANDS_H | ||
| 2 | #define COMMANDS_H | ||
| 3 | |||
| 4 | /** \cond docNever */ | ||
| 5 | |||
| 6 | #include <QUndoCommand> | ||
| 7 | |||
| 8 | #include "xbytearray.h" | ||
| 9 | |||
| 10 | /*! CharCommand is a class to prived undo/redo functionality in QHexEdit. | ||
| 11 | A QUndoCommand represents a single editing action on a document. CharCommand | ||
| 12 | is responsable for manipulations on single chars. It can insert. replace and | ||
| 13 | remove characters. A manipulation stores allways to actions | ||
| 14 | 1. redo (or do) action | ||
| 15 | 2. undo action. | ||
| 16 | |||
| 17 | CharCommand also supports command compression via mergeWidht(). This allows | ||
| 18 | the user to execute a undo command contation e.g. 3 steps in a single command. | ||
| 19 | If you for example insert a new byt "34" this means for the editor doing 3 | ||
| 20 | steps: insert a "00", replace it with "03" and the replace it with "34". These | ||
| 21 | 3 steps are combined into a single step, insert a "34". | ||
| 22 | */ | ||
| 23 | class CharCommand : public QUndoCommand | ||
| 24 | { | ||
| 25 | public: | ||
| 26 | enum { Id = 1234 }; | ||
| 27 | enum Cmd {insert, remove, replace}; | ||
| 28 | |||
| 29 | CharCommand(XByteArray * xData, Cmd cmd, int charPos, char newChar, | ||
| 30 | QUndoCommand *parent=0); | ||
| 31 | |||
| 32 | void undo(); | ||
| 33 | void redo(); | ||
| 34 | bool mergeWith(const QUndoCommand *command); | ||
| 35 | int id() const { return Id; } | ||
| 36 | |||
| 37 | private: | ||
| 38 | XByteArray * _xData; | ||
| 39 | int _charPos; | ||
| 40 | bool _wasChanged; | ||
| 41 | char _newChar; | ||
| 42 | char _oldChar; | ||
| 43 | Cmd _cmd; | ||
| 44 | }; | ||
| 45 | |||
| 46 | /*! ArrayCommand provides undo/redo functionality for handling binary strings. It | ||
| 47 | can undo/redo insert, replace and remove binary strins (QByteArrays). | ||
| 48 | */ | ||
| 49 | class ArrayCommand : public QUndoCommand | ||
| 50 | { | ||
| 51 | public: | ||
| 52 | enum Cmd {insert, remove, replace}; | ||
| 53 | ArrayCommand(XByteArray * xData, Cmd cmd, int baPos, QByteArray newBa=QByteArray(), int len=0, | ||
| 54 | QUndoCommand *parent=0); | ||
| 55 | void undo(); | ||
| 56 | void redo(); | ||
| 57 | |||
| 58 | private: | ||
| 59 | Cmd _cmd; | ||
| 60 | XByteArray * _xData; | ||
| 61 | int _baPos; | ||
| 62 | int _len; | ||
| 63 | QByteArray _wasChanged; | ||
| 64 | QByteArray _newBa; | ||
| 65 | QByteArray _oldBa; | ||
| 66 | }; | ||
| 67 | |||
| 68 | /** \endcond docNever */ | ||
| 69 | |||
| 70 | #endif // COMMANDS_H | ||