Skip to content

Commit

Permalink
Revise: excise all the shiny extra UI goodness from the PR as requested
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
  • Loading branch information
SlySven committed May 7, 2024
1 parent 4755e20 commit 0611553
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 625 deletions.
21 changes: 10 additions & 11 deletions src/Host.h
Expand Up @@ -4,7 +4,7 @@
/***************************************************************************
* Copyright (C) 2008-2013 by Heiko Koehn - KoehnHeiko@googlemail.com *
* Copyright (C) 2014 by Ahmed Charles - acharles@outlook.com *
* Copyright (C) 2015-2020, 2022-2023 by Stephen Lyons *
* Copyright (C) 2015-2020, 2022-2024 by Stephen Lyons *
* - slysven@virginmedia.com *
* Copyright (C) 2016 by Ian Adkins - ieadkins@gmail.com *
* Copyright (C) 2018 by Huadong Qi - novload@outlook.com *
Expand Down Expand Up @@ -424,7 +424,6 @@ class Host : public QObject
bool showIdsInEditor() const { return mShowIDsInEditor; }
void setShowIdsInEditor(const bool isShown) { mShowIDsInEditor = isShown; if (mpEditorDialog) {mpEditorDialog->showIDLabels(isShown);} }


cTelnet mTelnet;
QPointer<TMainConsole> mpConsole;
dlgPackageManager* mpPackageManager;
Expand Down Expand Up @@ -707,15 +706,15 @@ class Host : public QObject
// shortcut to switch between the input line and the main window
CaretShortcut mCaretShortcut = CaretShortcut::None;

// Support a long-standing hack for using the <SGR>1m (Bold) code to select
// a set of brighter 8 colors (the second eight) from the 256 colors for
// "16 color" mode of operation - alongside the basic <SGR>30m (Black) to
// <SGR>37m (White) set of codes. Using the "AIXTERM" codes (<SGR>90m to
// <SGR>97m) codes or the <SGR>38::5:Nm ones are later (better) ways of
// accessing that second set of 8 but some Servers only know the first for
// 16 color operation. The prior behaviour for Mudlet would be almost
// equivalent to this option being true but it limits the ability to have
// completely separate bold (and faint) font weightings:
// Support a long-standing hack among all clients for using the <SGR>1m
// Bold) code to select a set of brighter 8 colors (the second eight) from
// the 256 colors for "16 color" mode of operation - alongside the basic
// <SGR>30m (Black) to <SGR>37m (White) set of codes. Using the "AIXTERM"
// codes (<SGR>90m to <SGR>97m) codes or the <SGR>38::5:Nm ones are later
// (better) ways of accessing that second set of 8 but some Servers only
// know the first for 16 color operation. The prior behaviour for Mudlet
// would be almost equivalent to this option being true but it limits the
// ability to have completely separate bold (and faint) font weightings:
bool mBoldIsBright = true;

signals:
Expand Down
2 changes: 1 addition & 1 deletion src/TAccessibleTextEdit.cpp
@@ -1,7 +1,7 @@
/***************************************************************************
* Copyright (C) 2008-2013 by Heiko Koehn - KoehnHeiko@googlemail.com *
* Copyright (C) 2014-2017 by Ahmed Charles - acharles@outlook.com *
* Copyright (C) 2014-2020, 2023 by Stephen Lyons *
* Copyright (C) 2014-2020, 2023-2024 by Stephen Lyons *
* - slysven@virginmedia.com *
* Copyright (C) 2022 by Thiago Jung Bauermann - bauermann@kolabnow.com *
* *
Expand Down
122 changes: 20 additions & 102 deletions src/TBuffer.cpp

Large diffs are not rendered by default.

32 changes: 2 additions & 30 deletions src/TBuffer.h
Expand Up @@ -4,7 +4,7 @@
/***************************************************************************
* Copyright (C) 2008-2013 by Heiko Koehn - KoehnHeiko@googlemail.com *
* Copyright (C) 2014 by Ahmed Charles - acharles@outlook.com *
* Copyright (C) 2015, 2017-2018, 2020, 2022-2023 by Stephen Lyons *
* Copyright (C) 2015, 2017-2018, 2020, 2022-2024 by Stephen Lyons *
* - slysven@virginmedia.com *
* *
* This program is free software; you can redistribute it and/or modify *
Expand Down Expand Up @@ -300,27 +300,6 @@ class TBuffer
static const int csmCssFontWeight_bold = 800;
#endif

// Used to record if some particular SGR codes have been received from the
// Game Server - only used in the TMainConsole instance
enum SgrCodeFlag {
Sgr_None = 0x0,
Sgr_Bold = 0x1, // May be combined with Sgr_30_37 (for original {?} 16 colors) or, more hopefully used for a font rendering effect
Sgr_Faint = 0x2, // Usage is probably rare, would suggest that Server is NOT using Sgr_Bold to select bright colors in a 16 color mode
Sgr_Blinking = 0x4, // Either Blink or Fast Blink code has been seen - at present we convert them to italics
Sgr_Conceal = 0x8, // The hidden/concealed code has been seen - at present Mudlet does not handle it and shows the text
Sgr_30_37 = 0x10, // Basic 8 FG colors unless combined with Sgr_Bold for 16 colors
Sgr_90_97 = 0x20, // Basic 16 FG colors when combined with Sgr_30_37, would suggest that Server is NOT using Sgr_Bold to select bright colors in a 16 color mode
Sgr_38_2 = 0x40, // 16M FG colors, would suggest that Server is NOT using Sgr_Bold to select bright colors in a 16 color mode
Sgr_38_5 = 0x80, // 256 FG colors, would suggest that Server is NOT using Sgr_Bold to select bright colors in a 16 color mode
Sgr_40_47 = 0x100, // Basic 8 BG colors might be combined with Sgr_Bold for 16 colors but that doesn't make much sense as it would also change the FG color as well
Sgr_100_107 = 0x200, // Basic 16 BG colors when combined with Sgr_30_37, would suggest that Server is NOT using Sgr_Bold to select bright colors in a 16 color mode
Sgr_48_2 = 0x400, // 16M BG colors, would suggest that Server is NOT using Sgr_Bold to select bright colors in a 16 color mode
Sgr_48_5 = 0x800, // 256 BG colors, would suggest that Server is NOT using Sgr_Bold to select bright colors in a 16 color mode
Sgr_AltFont = 0x1000 // Any of the alternate font codes (SGR 11 to 19)
};
Q_DECLARE_FLAGS(SgrCodeFlags, SgrCodeFlag)


QPoint insert(QPoint&, const QString& text, int, int, int, int, int, int, bool bold, bool italics, bool underline, bool strikeout);
bool insertInLine(QPoint& cursor, const QString& what, const TChar& format);
void expandLine(int y, int count, TChar&);
Expand Down Expand Up @@ -369,8 +348,6 @@ class TBuffer
// is apparently incompatible with using a default constructor - sigh!
void encodingChanged(const QByteArray &);
void clearSearchHighlights();
SgrCodeFlags getSgrCodesSeen() const { return mSgrCodesSeen; }
void resetSgrCodesSeen() { mSgrCodesSeen = Sgr_None; }

static int lengthInGraphemes(const QString& text);

Expand Down Expand Up @@ -406,7 +383,7 @@ class TBuffer
void decodeSGR48(const QStringList&, bool isColonSeparated = true);
void decodeOSC(const QString&);
void resetColors();
void setSgrCodeSeenFlag(const SgrCodeFlag);


QPointer<TConsole> mpConsole;

Expand Down Expand Up @@ -480,13 +457,8 @@ class TBuffer

QByteArray mEncoding;
QTextCodec* mMainIncomingCodec = nullptr;

bool mProcessingServerText = false;
SgrCodeFlags mSgrCodesSeen = Sgr_None;
};

Q_DECLARE_OPERATORS_FOR_FLAGS(TBuffer::SgrCodeFlags)

#ifndef QT_NO_DEBUG_STREAM
// Dumper for the TChar::AttributeFlags - so that qDebug gives a detailed broken
// down results when presented with the value rather than just a hex value.
Expand Down
2 changes: 1 addition & 1 deletion src/TLuaInterpreter.cpp
@@ -1,6 +1,6 @@
/***************************************************************************
* Copyright (C) 2008-2013 by Heiko Koehn - KoehnHeiko@googlemail.com *
* Copyright (C) 2013-2023 by Stephen Lyons - slysven@virginmedia.com *
* Copyright (C) 2013-2024 by Stephen Lyons - slysven@virginmedia.com *
* Copyright (C) 2014-2017 by Ahmed Charles - acharles@outlook.com *
* Copyright (C) 2016 by Eric Wallace - eewallace@gmail.com *
* Copyright (C) 2016 by Chris Leacy - cleacy1972@gmail.com *
Expand Down
2 changes: 1 addition & 1 deletion src/TLuaInterpreter.h
Expand Up @@ -3,7 +3,7 @@

/***************************************************************************
* Copyright (C) 2008-2013 by Heiko Koehn - KoehnHeiko@googlemail.com *
* Copyright (C) 2013-2016, 2018-2023 by Stephen Lyons *
* Copyright (C) 2013-2016, 2018-2024 by Stephen Lyons *
* - slysven@virginmedia.com *
* Copyright (C) 2014 by Ahmed Charles - acharles@outlook.com *
* Copyright (C) 2016-2018 by Ian Adkins - ieadkins@gmail.com *
Expand Down
2 changes: 1 addition & 1 deletion src/TLuaInterpreterUI.cpp
@@ -1,6 +1,6 @@
/***************************************************************************
* Copyright (C) 2008-2013 by Heiko Koehn - KoehnHeiko@googlemail.com *
* Copyright (C) 2013-2022 by Stephen Lyons - slysven@virginmedia.com *
* Copyright (C) 2013-2024 by Stephen Lyons - slysven@virginmedia.com *
* Copyright (C) 2014-2017 by Ahmed Charles - acharles@outlook.com *
* Copyright (C) 2016 by Eric Wallace - eewallace@gmail.com *
* Copyright (C) 2016 by Chris Leacy - cleacy1972@gmail.com *
Expand Down
5 changes: 1 addition & 4 deletions src/TMainConsole.h
Expand Up @@ -4,7 +4,7 @@
/***************************************************************************
* Copyright (C) 2008-2012 by Heiko Koehn - KoehnHeiko@googlemail.com *
* Copyright (C) 2014 by Ahmed Charles - acharles@outlook.com *
* Copyright (C) 2014-2016, 2018-2022 by Stephen Lyons *
* Copyright (C) 2014-2016, 2018-2022, 2023 by Stephen Lyons *
* - slysven@virginmedia.com *
* Copyright (C) 2016 by Ian Adkins - ieadkins@gmail.com *
* *
Expand Down Expand Up @@ -133,9 +133,6 @@ public slots:
// class, second argument is true for a lower priority indication when
// locally produced information is painted into main console
void signal_newDataAlert(const QString&, bool isLowerPriorityChange = false);
// Signal to update the status display of these flags if the preferences
// dialog is open - actaully emitted from the TBuffer class:
void signal_sgrFlagsChanged();


private:
Expand Down
2 changes: 1 addition & 1 deletion src/TTextEdit.cpp
@@ -1,7 +1,7 @@
/***************************************************************************
* Copyright (C) 2008-2012 by Heiko Koehn - KoehnHeiko@googlemail.com *
* Copyright (C) 2014 by Ahmed Charles - acharles@outlook.com *
* Copyright (C) 2014-2016, 2018-2023 by Stephen Lyons *
* Copyright (C) 2014-2016, 2018-2024 by Stephen Lyons *
* - slysven@virginmedia.com *
* Copyright (C) 2016-2017 by Ian Adkins - ieadkins@gmail.com *
* Copyright (C) 2017 by Chris Reid - WackyWormer@hotmail.com *
Expand Down
2 changes: 1 addition & 1 deletion src/XMLexport.cpp
Expand Up @@ -2,7 +2,7 @@
* Copyright (C) 2008-2013 by Heiko Koehn - KoehnHeiko@googlemail.com *
* Copyright (C) 2014 by Ahmed Charles - acharles@outlook.com *
* Copyright (C) 2016-2017 by Ian Adkins - ieadkins@gmail.com *
* Copyright (C) 2017-2023 by Stephen Lyons - slysven@virginmedia.com *
* Copyright (C) 2017-2024 by Stephen Lyons - slysven@virginmedia.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
Expand Down
2 changes: 1 addition & 1 deletion src/XMLimport.cpp
@@ -1,7 +1,7 @@
/***************************************************************************
* Copyright (C) 2008-2013 by Heiko Koehn - KoehnHeiko@googlemail.com *
* Copyright (C) 2014 by Ahmed Charles - acharles@outlook.com *
* Copyright (C) 2016-2023 by Stephen Lyons - slysven@virginmedia.com *
* Copyright (C) 2016-2024 by Stephen Lyons - slysven@virginmedia.com *
* Copyright (C) 2016-2017 by Ian Adkins - ieadkins@gmail.com *
* *
* This program is free software; you can redistribute it and/or modify *
Expand Down

0 comments on commit 0611553

Please sign in to comment.