2020-09-06 16:47:38 +01:00
|
|
|
/*
|
2024-12-31 10:51:06 +00:00
|
|
|
* Copyright (C) 2020-2025 Gavin MacGregor
|
2020-09-06 16:47:38 +01:00
|
|
|
*
|
|
|
|
|
* 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 <QObject>
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
2020-12-26 15:34:23 +00:00
|
|
|
#include "pagex26base.h"
|
2020-09-06 16:47:38 +01:00
|
|
|
#include "x26triplets.h"
|
|
|
|
|
|
2020-12-26 15:34:23 +00:00
|
|
|
class LevelOnePage : public PageX26Base //: public QObject
|
2020-09-06 16:47:38 +01:00
|
|
|
{
|
|
|
|
|
//Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2025-02-13 22:55:11 +00:00
|
|
|
using PageX26Base::packet;
|
|
|
|
|
using PageX26Base::setPacket;
|
|
|
|
|
using PageX26Base::packetExists;
|
|
|
|
|
|
2020-09-06 16:47:38 +01:00
|
|
|
enum CycleTypeEnum { CTcycles, CTseconds };
|
|
|
|
|
|
2020-09-16 11:15:46 +01:00
|
|
|
LevelOnePage();
|
2020-09-11 12:06:06 +01:00
|
|
|
|
2020-12-06 17:57:05 +00:00
|
|
|
bool isEmpty() const override;
|
|
|
|
|
|
2025-02-11 18:46:01 +00:00
|
|
|
QByteArray packet(int y, int d) const override;
|
|
|
|
|
bool setPacket(int y, int d, QByteArray pkt) override;
|
2025-02-13 22:55:11 +00:00
|
|
|
bool packetExists(int y, int d) const override;
|
2020-11-27 20:57:21 +00:00
|
|
|
|
2025-02-11 18:46:01 +00:00
|
|
|
bool setControlBit(int b, bool active) override;
|
2020-09-11 12:06:06 +01:00
|
|
|
|
2020-09-06 16:47:38 +01:00
|
|
|
void clearPage();
|
|
|
|
|
|
2025-01-19 19:22:09 +00:00
|
|
|
int maxEnhancements() const override { return 208; };
|
2021-04-25 18:51:59 +01:00
|
|
|
|
2020-09-06 16:47:38 +01:00
|
|
|
/* void setSubPageNumber(int); */
|
|
|
|
|
int cycleValue() const { return m_cycleValue; };
|
2023-08-27 14:25:16 +01:00
|
|
|
void setCycleValue(int newValue);
|
2020-09-06 16:47:38 +01:00
|
|
|
CycleTypeEnum cycleType() const { return m_cycleType; };
|
2023-08-27 14:25:16 +01:00
|
|
|
void setCycleType(CycleTypeEnum newType);
|
2020-09-06 16:47:38 +01:00
|
|
|
int defaultCharSet() const { return m_defaultCharSet; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setDefaultCharSet(int newDefaultCharSet);
|
2020-09-06 16:47:38 +01:00
|
|
|
int defaultNOS() const { return m_defaultNOS; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setDefaultNOS(int defaultNOS);
|
2020-09-06 16:47:38 +01:00
|
|
|
int secondCharSet() const { return m_secondCharSet; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setSecondCharSet(int newSecondCharSet);
|
2020-09-06 16:47:38 +01:00
|
|
|
int secondNOS() const { return m_secondNOS; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setSecondNOS(int newSecondNOS);
|
2025-02-13 22:55:11 +00:00
|
|
|
unsigned char character(int r, int c) const { return PageX26Base::packetExists(r) ? PageX26Base::packet(r).at(c) : 0x20; }
|
|
|
|
|
void setCharacter(int r, int c, unsigned char newChar);
|
2020-09-06 16:47:38 +01:00
|
|
|
int defaultScreenColour() const { return m_defaultScreenColour; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setDefaultScreenColour(int newDefaultScreenColour);
|
2020-09-06 16:47:38 +01:00
|
|
|
int defaultRowColour() const { return m_defaultRowColour; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setDefaultRowColour(int newDefaultRowColour);
|
2020-09-06 16:47:38 +01:00
|
|
|
int colourTableRemap() const { return m_colourTableRemap; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setColourTableRemap(int newColourTableRemap);
|
2020-09-06 16:47:38 +01:00
|
|
|
bool blackBackgroundSubst() const { return m_blackBackgroundSubst; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setBlackBackgroundSubst(bool newBlackBackgroundSubst);
|
2020-09-06 16:47:38 +01:00
|
|
|
int CLUT(int index, int renderLevel=3) const;
|
2023-08-27 14:25:16 +01:00
|
|
|
void setCLUT(int index, int newColour);
|
2021-01-19 18:27:30 +00:00
|
|
|
QColor CLUTtoQColor(int index, int renderlevel=3) const;
|
2023-08-27 14:25:16 +01:00
|
|
|
bool isPaletteDefault(int colour) const;
|
|
|
|
|
bool isPaletteDefault(int fromColour, int toColour) const;
|
2020-12-20 19:38:23 +00:00
|
|
|
int levelRequired() const;
|
2020-09-06 16:47:38 +01:00
|
|
|
bool leftSidePanelDisplayed() const { return m_leftSidePanelDisplayed; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setLeftSidePanelDisplayed(bool newLeftSidePanelDisplayed);
|
2020-09-06 16:47:38 +01:00
|
|
|
bool rightSidePanelDisplayed() const { return m_rightSidePanelDisplayed; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setRightSidePanelDisplayed(bool newRightSidePanelDisplayed);
|
2020-09-06 16:47:38 +01:00
|
|
|
int sidePanelColumns() const { return m_sidePanelColumns; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setSidePanelColumns(int newSidePanelColumns);
|
2020-09-06 16:47:38 +01:00
|
|
|
bool sidePanelStatusL25() const { return m_sidePanelStatusL25; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setSidePanelStatusL25(bool newSidePanelStatusL25);
|
2020-10-29 21:31:23 +00:00
|
|
|
int fastTextLinkPageNumber(int linkNumber) const { return m_fastTextLink[linkNumber].pageNumber; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setFastTextLinkPageNumber(int linkNumber, int pageNumber);
|
2020-09-19 19:34:41 +01:00
|
|
|
int composeLinkFunction(int linkNumber) const { return m_composeLink[linkNumber].function; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setComposeLinkFunction(int linkNumber, int newFunction);
|
2020-09-19 19:34:41 +01:00
|
|
|
bool composeLinkLevel2p5(int linkNumber) const { return m_composeLink[linkNumber].level2p5; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setComposeLinkLevel2p5(int linkNumber, bool newRequired);
|
2020-09-19 19:34:41 +01:00
|
|
|
bool composeLinkLevel3p5(int linkNumber) const { return m_composeLink[linkNumber].level3p5; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setComposeLinkLevel3p5(int linkNumber, bool newRequired);
|
2020-09-19 19:34:41 +01:00
|
|
|
int composeLinkPageNumber(int linkNumber) const { return m_composeLink[linkNumber].pageNumber; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setComposeLinkPageNumber(int linkNumber, int newPageNumber);
|
2020-09-19 19:34:41 +01:00
|
|
|
int composeLinkSubPageCodes(int linkNumber) const { return m_composeLink[linkNumber].subPageCodes; }
|
2023-08-27 14:25:16 +01:00
|
|
|
void setComposeLinkSubPageCodes(int linkNumber, int newSubPageCodes);
|
2020-09-19 19:34:41 +01:00
|
|
|
|
2020-09-06 16:47:38 +01:00
|
|
|
private:
|
|
|
|
|
/* 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];
|
|
|
|
|
|
2025-04-02 19:05:22 +01:00
|
|
|
static constexpr int m_defaultCLUT[32] = {
|
2020-12-18 22:07:27 +00:00
|
|
|
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
|
2020-09-06 16:47:38 +01:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|