Go to the documentation of this file.
109 int _anchor_point,
int _relative_pos,
110 int _anchor_vertical,
int _anchor_horizontal,
111 int _row_count,
int _column_count,
112 int _row_lock,
int _column_lock,
113 int _pen_style,
int _window_style)
125 QMutexLocker locker(&
m_lock);
139 if ((!_pen_style && !
GetExists()) || _pen_style)
142 if ((!_window_style && !
GetExists()) || _window_style)
145 Resize(_row_count, _column_count);
184 QString(
"Shrinked nr %1 nc %2 rc %3 cc %4 tr %5 tc %6").arg(new_rows)
197 auto *new_text =
new CC708Character[
static_cast<size_t>(new_rows) * new_columns];
206 for (; j < new_columns; ++j)
207 new_text[i * new_columns + j].m_attr =
m_pen.
m_attr;
209 for (; i < new_rows; ++i)
210 for (
uint j = 0; j < new_columns; ++j)
211 new_text[i * new_columns + j].m_attr =
m_pen.
m_attr;
233 for (
uint j = 0; j < new_columns; ++j)
247 QMutexLocker locker(&
m_lock);
262 QMutexLocker locker(&
m_lock);
303 QMutexLocker locker(&
m_lock);
305 std::vector<CC708String*> list;
312 bool createdNonblankStrings =
false;
313 std::array<QChar,k708MaxColumns> chars {};
316 bool inLeadingSpaces =
true;
317 bool inTrailingSpaces =
true;
318 bool createdString =
false;
333 if (inLeadingSpaces && isDisplayable)
336 inLeadingSpaces =
false;
340 inTrailingSpaces =
false;
344 cur->
m_str = QString(&chars[strStart], i - strStart);
346 createdString =
true;
347 createdNonblankStrings =
true;
348 inTrailingSpaces =
true;
357 if (!inTrailingSpaces || !createdString)
359 bool allSpaces = (inLeadingSpaces || inTrailingSpaces);
362 createdNonblankStrings =
true;
363 cur->
m_str = QString(&chars[strStart], length);
371 if (!createdNonblankStrings)
378 while (!strings.empty())
380 delete strings.back();
387 static const std::array<const uint,8> style2justify
393 if ((style < 1) || (style > 7))
420 QString dbg_char = ch;
421 if (ch.toLatin1() < 32)
422 dbg_char = QString(
"0x%1").arg( (
int)ch.toLatin1(), 0,16);
426 LOG(VB_VBI, LOG_DEBUG,
427 QString(
"AddChar(%1) at (c %2, r %3) INVALID win(%4,%5)")
438 if (ch.toLatin1() == 0x0D)
445 QMutexLocker locker(&
m_lock);
450 if (ch.toLatin1() == 0x0E)
465 if (ch.toLatin1() == 0x08)
478 if (ch.toLatin1() == 0x0c)
494 LOG(VB_VBI, LOG_DEBUG, QString(
"AddChar(%1) at (c %2, r %3) -> (%4,%5)")
500 QMutexLocker locker(&
m_lock);
546 LOG(VB_VBI, LOG_DEBUG, QString(
"IncrPen dir%1: (c %2, r %3) -> (%4,%5)")
548 .arg(new_column).arg(new_row));
564 Scroll(new_row, new_column);
589 LOG(VB_VBI, LOG_DEBUG, QString(
"DecrPen dir%1: (c %2, r %3) -> (%4,%5)")
591 .arg(new_column).arg(new_row));
607 Scroll(new_row, new_column);
624 QString(
"SetPenLocation nr %1 nc %2 rc %3 cc %4 tr %5 tc %6").arg(row)
652 static const std::array<const uint8_t,8> kStyle2Font
653 { 0, 0, 1, 2, 3, 4, 3, 4 };
655 if ((style < 1) || (style > 7))
675 : m_attr(win.m_pen.m_attr)
702 static constexpr std::array<const uint8_t,4> kX {0, 96, 255, 255};
703 return {kX[(eia708color>>4)&3], kX[(eia708color>>2)&3], kX[eia708color&3]};
const uint k708JustifyFull
CC708CharacterAttribute m_attr
const uint k708JustifyRight
const uint k708AttrEdgeDepressed
bool operator==(const CC708CharacterAttribute &other) const
void SetPenLocation(uint row, uint column)
const uint k708AttrColorBlack
void SetWindowStyle(uint style)
const uint k708JustifyLeft
const uint k708BorderShadowLeft
const uint k708AttrFontCursive
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
const uint k708BorderNone
const uint k708DirTopToBottom
const uint k708AttrEdgeUniform
void Resize(uint new_rows, uint new_columns)
CC708Character & GetCCChar(void) const
void IncrPenLocation(void)
const uint k708DirBottomToTop
void DecrPenLocation(void)
const uint k708AttrEdgeNone
const uint k708BorderRaised
const uint k708AttrOffsetSubscript
const uint k708AttrOpacityTransparent
const uint k708AttrFontMonospacedSansSerif
CC708CharacterAttribute m_attr
const uint k708EffectSnap
const uint k708DirLeftToRight
const uint k708JustifyCenter
const uint k708AttrFontDefault
const uint k708AttrOpacityFlash
const uint k708AttrEdgeLeftDropShadow
static QColor ConvertToQColor(uint eia708color)
const uint k708EffectWipe
void Scroll(int row, int col)
const uint k708BorderShadowRight
void SetExists(bool value)
const uint k708AttrSizeLarge
const uint k708BorderDepressed
const uint k708AttrSizeStandard
const uint k708AttrSizeSmall
const uint k708AttrEdgeRightDropShadow
const uint k708AttrEdgeRaised
const uint k708AttrOffsetNormal
const uint k708AttrColorWhite
void SetPenStyle(uint style)
const uint k708AttrFontProportionalSerif
const uint k708AttrFontCasual
const uint k708AttrFontProportionalSansSerif
std::vector< CC708String * > GetStrings(void) const
static void DisposeStrings(std::vector< CC708String * > &strings)
void LimitPenLocation(void)
void DefineWindow(int priority, bool visible, int anchor_point, int relative_pos, int anchor_vertical, int anchor_horizontal, int row_count, int column_count, int row_lock, int column_lock, int pen_style, int window_style)
const uint k708AttrFontSmallCaps
CC708CharacterAttribute m_attr
void SetVisible(bool value)
const uint k708BorderUniform
bool IsPenValid(void) const
const uint k708AttrOffsetSuperscript
const uint k708EffectFade
const uint k708AttrOpacitySolid
const uint k708AttrFontMonospacedSerif
const uint k708AttrOpacityTranslucent
bool GetExists(void) const
const uint k708DirRightToLeft