2020-09-06 16:47:38 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) 2020 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/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2020-09-11 12:06:06 +01:00
|
|
|
#ifndef LEVELONEPAGE_H
|
|
|
|
|
#define LEVELONEPAGE_H
|
2020-09-06 16:47:38 +01:00
|
|
|
|
|
|
|
|
#include <QByteArray>
|
|
|
|
|
#include <QColor>
|
|
|
|
|
#include <QList>
|
|
|
|
|
#include <QObject>
|
|
|
|
|
#include <QString>
|
|
|
|
|
#include <QTextStream>
|
|
|
|
|
|
2020-09-11 12:06:06 +01:00
|
|
|
#include "pagebase.h"
|
2020-09-06 16:47:38 +01:00
|
|
|
#include "x26triplets.h"
|
|
|
|
|
|
|
|
|
|
QColor CLUTtoQColor(int myColour);
|
|
|
|
|
|
|
|
|
|
// If we inherit from QObject then we can't copy construct, so "make a new subpage that's a copy of this one" wouldn't work
|
2020-09-16 11:15:46 +01:00
|
|
|
class LevelOnePage : public PageBase //: public QObject
|
2020-09-06 16:47:38 +01:00
|
|
|
{
|
|
|
|
|
//Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
enum CycleTypeEnum { CTcycles, CTseconds };
|
|
|
|
|
|
2020-09-16 11:15:46 +01:00
|
|
|
LevelOnePage();
|
2020-09-16 20:49:52 +01:00
|
|
|
LevelOnePage(const PageBase &);
|
2020-09-11 12:06:06 +01:00
|
|
|
|
2020-09-15 22:37:50 +01:00
|
|
|
QByteArray packet(int, int=0);
|
2020-09-12 19:34:08 +01:00
|
|
|
bool setPacket(int, QByteArray);
|
|
|
|
|
bool setPacket(int, int, QByteArray);
|
2020-09-11 12:06:06 +01:00
|
|
|
bool packetNeeded(int, int=0) const;
|
|
|
|
|
|
2020-09-06 16:47:38 +01:00
|
|
|
void clearPage();
|
|
|
|
|
void loadPagePacket(QByteArray &);
|
|
|
|
|
void savePage(QTextStream *, int, int);
|
|
|
|
|
QString exportURLHash(QString);
|
|
|
|
|
|
|
|
|
|
/* void setSubPageNumber(int); */
|
|
|
|
|
int cycleValue() const { return m_cycleValue; };
|
|
|
|
|
void setCycleValue(int);
|
|
|
|
|
CycleTypeEnum cycleType() const { return m_cycleType; };
|
|
|
|
|
void setCycleType(CycleTypeEnum);
|
|
|
|
|
int defaultCharSet() const { return m_defaultCharSet; }
|
|
|
|
|
void setDefaultCharSet(int);
|
|
|
|
|
int defaultNOS() const { return m_defaultNOS; }
|
|
|
|
|
void setDefaultNOS(int);
|
|
|
|
|
int secondCharSet() const { return m_secondCharSet; }
|
|
|
|
|
void setSecondCharSet(int);
|
|
|
|
|
int secondNOS() const { return m_secondNOS; }
|
|
|
|
|
void setSecondNOS(int);
|
|
|
|
|
unsigned char character(int row, int column) const { return m_level1Page[row][column]; }
|
|
|
|
|
void setCharacter(int, int, unsigned char);
|
|
|
|
|
int defaultScreenColour() const { return m_defaultScreenColour; }
|
|
|
|
|
void setDefaultScreenColour(int);
|
|
|
|
|
int defaultRowColour() const { return m_defaultRowColour; }
|
|
|
|
|
void setDefaultRowColour(int);
|
|
|
|
|
int colourTableRemap() const { return m_colourTableRemap; }
|
|
|
|
|
void setColourTableRemap(int);
|
|
|
|
|
bool blackBackgroundSubst() const { return m_blackBackgroundSubst; }
|
|
|
|
|
void setBlackBackgroundSubst(bool);
|
|
|
|
|
int CLUT(int index, int renderLevel=3) const;
|
|
|
|
|
void setCLUT(int, int);
|
|
|
|
|
bool leftSidePanelDisplayed() const { return m_leftSidePanelDisplayed; }
|
|
|
|
|
void setLeftSidePanelDisplayed(bool);
|
|
|
|
|
bool rightSidePanelDisplayed() const { return m_rightSidePanelDisplayed; }
|
|
|
|
|
void setRightSidePanelDisplayed(bool);
|
|
|
|
|
int sidePanelColumns() const { return m_sidePanelColumns; }
|
|
|
|
|
void setSidePanelColumns(int);
|
|
|
|
|
bool sidePanelStatusL25() const { return m_sidePanelStatusL25; }
|
|
|
|
|
void setSidePanelStatusL25(bool);
|
2020-10-29 21:31:23 +00:00
|
|
|
int fastTextLinkPageNumber(int linkNumber) const { return m_fastTextLink[linkNumber].pageNumber; }
|
|
|
|
|
void setFastTextLinkPageNumber(int, int);
|
2020-09-19 19:34:41 +01:00
|
|
|
int composeLinkFunction(int linkNumber) const { return m_composeLink[linkNumber].function; }
|
|
|
|
|
void setComposeLinkFunction(int, int);
|
|
|
|
|
bool composeLinkLevel2p5(int linkNumber) const { return m_composeLink[linkNumber].level2p5; }
|
|
|
|
|
void setComposeLinkLevel2p5(int, bool);
|
|
|
|
|
bool composeLinkLevel3p5(int linkNumber) const { return m_composeLink[linkNumber].level3p5; }
|
|
|
|
|
void setComposeLinkLevel3p5(int, bool);
|
|
|
|
|
int composeLinkPageNumber(int linkNumber) const { return m_composeLink[linkNumber].pageNumber; }
|
|
|
|
|
void setComposeLinkPageNumber(int, int);
|
|
|
|
|
int composeLinkSubPageCodes(int linkNumber) const { return m_composeLink[linkNumber].subPageCodes; }
|
|
|
|
|
void setComposeLinkSubPageCodes(int, int);
|
|
|
|
|
|
2020-09-06 16:47:38 +01:00
|
|
|
QString colourHash(int);
|
|
|
|
|
QList<X26Triplet> localEnhance;
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
int controlBitsToPS() const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
unsigned char m_level1Page[25][40];
|
|
|
|
|
/* int m_subPageNumber; */
|
|
|
|
|
int m_cycleValue;
|
|
|
|
|
CycleTypeEnum m_cycleType;
|
|
|
|
|
int m_defaultCharSet, m_defaultNOS, m_secondCharSet, m_secondNOS;
|
|
|
|
|
int m_defaultScreenColour, m_defaultRowColour, m_colourTableRemap, m_sidePanelColumns;
|
|
|
|
|
bool m_blackBackgroundSubst, m_leftSidePanelDisplayed, m_rightSidePanelDisplayed, m_sidePanelStatusL25;
|
|
|
|
|
int m_CLUT[32];
|
2020-10-29 21:31:23 +00:00
|
|
|
struct fastTextLink {
|
|
|
|
|
int pageNumber;
|
|
|
|
|
int subPageNumber;
|
|
|
|
|
} m_fastTextLink[6];
|
2020-09-19 19:34:41 +01:00
|
|
|
struct composeLink {
|
|
|
|
|
int function;
|
|
|
|
|
bool level2p5, level3p5;
|
|
|
|
|
int pageNumber, subPageCodes;
|
|
|
|
|
} m_composeLink[8];
|
|
|
|
|
|
2020-09-12 19:34:08 +01:00
|
|
|
X26Triplet m_paddingX26Triplet;
|
2020-09-06 16:47:38 +01:00
|
|
|
|
|
|
|
|
const int defaultCLUT[32] = {
|
|
|
|
|
0x000, 0xf00, 0x0f0, 0xff0, 0x00f, 0xf0f, 0x0ff, 0xfff,
|
|
|
|
|
0x000, 0x700, 0x070, 0x770, 0x007, 0x707, 0x077, 0x777,
|
|
|
|
|
0xf05, 0xf70, 0x0f7, 0xffb, 0x0ca, 0x500, 0x652, 0xc77,
|
|
|
|
|
0x333, 0xf77, 0x7f7, 0xff7, 0x77f, 0xf7f, 0x7ff, 0xddd
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|