Port to CMake from qmake, and split decoder into subdirectory
Qt 5 has had to be dropped as CMakeLists.txt uses qt_* specific commands which are implemented in Qt 6 onwards. cmake --install is only working on Linux at the moment; it installs the executable and the bundled example tti files into /usr/local/share/doc The teletext decoder with its document storage has been moved to a subdirectory with the intention of making it possible to use in other projects, but some further separation of editing stuff will be needed.
This commit is contained in:
81
src/qteletextmaker/x26commands.h
Normal file
81
src/qteletextmaker/x26commands.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2024 Gavin MacGregor
|
||||
*
|
||||
* This file is part of QTeletextMaker.
|
||||
*
|
||||
* QTeletextMaker is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* QTeletextMaker is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with QTeletextMaker. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef X26COMMANDS_H
|
||||
#define X26COMMANDS_H
|
||||
|
||||
#include <QUndoCommand>
|
||||
|
||||
#include "document.h"
|
||||
#include "x26model.h"
|
||||
#include "x26triplets.h"
|
||||
|
||||
class InsertTripletCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
InsertTripletCommand(TeletextDocument *teletextDocument, X26Model *x26Model, int row, int count, const X26Triplet newTriplet, QUndoCommand *parent = 0);
|
||||
|
||||
void redo() override;
|
||||
void undo() override;
|
||||
|
||||
private:
|
||||
TeletextDocument *m_teletextDocument;
|
||||
X26Model *m_x26Model;
|
||||
int m_subPageIndex, m_row, m_count;
|
||||
X26Triplet m_insertedTriplet;
|
||||
bool m_firstDo;
|
||||
};
|
||||
|
||||
class DeleteTripletCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
DeleteTripletCommand(TeletextDocument *teletextDocument, X26Model *x26Model, int row, int count, QUndoCommand *parent = 0);
|
||||
|
||||
void redo() override;
|
||||
void undo() override;
|
||||
|
||||
private:
|
||||
TeletextDocument *m_teletextDocument;
|
||||
X26Model *m_x26Model;
|
||||
int m_subPageIndex, m_row, m_count;
|
||||
X26Triplet m_deletedTriplet;
|
||||
};
|
||||
|
||||
class EditTripletCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
enum { Id = 201 };
|
||||
enum EditTripletEnum { ETaddress, ETmode, ETdata };
|
||||
|
||||
EditTripletCommand(TeletextDocument *teletextDocument, X26Model *x26Model, int row, int tripletPart, int bitsToKeep, int newValue, int role, QUndoCommand *parent = 0);
|
||||
|
||||
void redo() override;
|
||||
void undo() override;
|
||||
bool mergeWith(const QUndoCommand *) override;
|
||||
int id() const override { return Id; }
|
||||
|
||||
private:
|
||||
TeletextDocument *m_teletextDocument;
|
||||
X26Model *m_x26Model;
|
||||
int m_subPageIndex, m_row, m_role;
|
||||
X26Triplet m_oldTriplet, m_newTriplet;
|
||||
bool m_firstDo;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user