Skip to content

Commit

Permalink
Merge branch 'development' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
jmckisson authored May 19, 2024
2 parents 720d214 + f68b73d commit e2e3a4e
Show file tree
Hide file tree
Showing 24 changed files with 413 additions and 305 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/clangtidy-diff-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
--target autogen
- name: Check C++ changes against style guide
uses: ZedThree/clang-tidy-review@v0.18.0
uses: ZedThree/clang-tidy-review@v0.19.0
id: static_analysis
with:
build_dir: 'b/ninja' # path is relative to checkout directory
Expand All @@ -133,4 +133,4 @@ jobs:
split_workflow: true

- name: Upload check results
uses: ZedThree/clang-tidy-review/upload@v0.18.0
uses: ZedThree/clang-tidy-review/upload@v0.19.0
2 changes: 1 addition & 1 deletion .github/workflows/clangtidy-post-comments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: ZedThree/clang-tidy-review/post@v0.18.0
- uses: ZedThree/clang-tidy-review/post@v0.19.0
with:
# don't post any comments if the PR is fine
lgtm_comment_body: ''
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ execute_process(
# If a CI/CB build system provides an alternative Git SHA1 to identify the build
# use that instead - reporting which is being used:
if(DEFINED ENV{BUILD_COMMIT} AND NOT $ENV{BUILD_COMMIT} STREQUAL "")
set(GIT_SHA1 string(TOLOWER $ENV{BUILD_COMMIT}))
string(TOLOWER $ENV{BUILD_COMMIT} GIT_SHA1)
message(STATUS "Git SHA1 set from environemnt: ${GIT_SHA1}")
else()
message(STATUS "Git SHA1 used: ${GIT_SHA1}")
Expand Down
4 changes: 2 additions & 2 deletions src/CF-loader.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
<packageName></packageName>
<script>function downloadPkg(a,b)
echo("****Downloading package.")
downloadFile(getMudletHomeDir() .. "/CFGUI.zip", "https://github.com/Rahsael/CFGUI/releases/latest/download/CFGUI.zip")
downloadFile(getMudletHomeDir() .. "/CFGUI.zip", "https://github.com/carrionfields/CFGUI/releases/latest/download/CFGUI.zip")
end

function installReady(event, file)
if file ~= getMudletHomeDir().."/CFGUI.zip" then return end
if not io.exists(getMudletHomeDir().."/CFGUI.zip") then
cecho([[&lt;gold&gt;To download the Carrion Fields Mudlet client, please copy and paste the following code into the command line:

lua function d(a,b)if not b:find("CFGUI",1,true)then return end installPackage(b)os.remove(b)cecho("&lt;lime_green&gt;Package installed!\n")end registerAnonymousEventHandler("sysDownloadDone","d")downloadFile(getMudletHomeDir().."/CFGUI.zip","https://github.com/Rahsael/CFGUI/releases/latest/download/CFGUI.zip")
lua function d(a,b)if not b:find("CFGUI",1,true)then return end installPackage(b)os.remove(b)cecho("&lt;lime_green&gt;Package installed!\n")end registerAnonymousEventHandler("sysDownloadDone","d")downloadFile(getMudletHomeDir().."/CFGUI.zip","https://github.com/carrionfields/CFGUI/releases/latest/download/CFGUI.zip")

]])
return
Expand Down
13 changes: 12 additions & 1 deletion src/Host.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/***************************************************************************
* Copyright (C) 2008-2013 by Heiko Koehn - [email protected] *
* Copyright (C) 2014 by Ahmed Charles - [email protected] *
* Copyright (C) 2015-2020, 2022-2023 by Stephen Lyons *
* Copyright (C) 2015-2020, 2022-2024 by Stephen Lyons *
* - [email protected] *
* Copyright (C) 2016 by Ian Adkins - [email protected] *
* Copyright (C) 2018 by Huadong Qi - [email protected] *
Expand Down Expand Up @@ -706,6 +706,17 @@ class Host : public QObject
// shortcut to switch between the input line and the main window
CaretShortcut mCaretShortcut = CaretShortcut::None;

// 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:
// Tells TTextEdit instances for this profile how to draw the ambiguous
// width characters:
Expand Down
27 changes: 22 additions & 5 deletions src/TAccessibleTextEdit.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/***************************************************************************
* Copyright (C) 2008-2013 by Heiko Koehn - [email protected] *
* Copyright (C) 2014-2017 by Ahmed Charles - [email protected] *
* Copyright (C) 2014-2020 by Stephen Lyons - [email protected] *
* Copyright (C) 2014-2020, 2023-2024 by Stephen Lyons *
* - [email protected] *
* Copyright (C) 2022 by Thiago Jung Bauermann - [email protected] *
* *
* This program is free software; you can redistribute it and/or modify *
Expand Down Expand Up @@ -388,17 +389,33 @@ QString TAccessibleTextEdit::attributes(int offset, int *startOffset, int *endOf
const TChar &charStyle = textEdit()->mpBuffer->buffer.at(line).at(column);
// IAccessible2's text attributes don't support the overline attribute.
const TChar::AttributeFlags attributes = charStyle.allDisplayAttributes();
const bool isBold = (attributes & TChar::Bold) || font.weight() > QFont::Normal;
// According to
// https://wiki.linuxfoundation.org/accessibility/iaccessible2/textattributes
// only the names "normal" and "bold" are supported alongside the numeric
// values as explained in
// https://www.w3.org/TR/CSS21/fonts.html#font-boldness :
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
const int fontWeight = (attributes & TChar::Bold) ? ((attributes & TChar::Faint) ? TBuffer::csmCssFontWeight_boldAndFaint
: TBuffer::csmCssFontWeight_bold)
: ((attributes & TChar::Faint) ? TBuffer::csmCssFontWeight_faint
: TBuffer::csmCssFontWeight_normal);
#else
const int fontWeight = (attributes & TChar::Bold) ? ((attributes & TChar::Faint) ? TBuffer::csmFontWeight_boldAndFaint
: TBuffer::csmFontWeight_bold)
: ((attributes & TChar::Faint) ? TBuffer::csmFontWeight_faint
: TBuffer::csmFontWeight_normal);
#endif
const bool isItalics = (attributes & TChar::Italic) || style == QFont::StyleItalic;
const bool isStrikeOut = attributes & TChar::StrikeOut;
const bool isUnderline = attributes & TChar::Underline;
const bool isReverse = attributes & TChar::Reverse;
const bool caretIsHere = textEdit()->mpHost->caretEnabled() && textEdit()->mCaretLine == line &&
textEdit()->mCaretColumn == column;

// Different weight values are not handled.
if (isBold) {
ret += "font-weight:bold;";
if (fontWeight != 400) {
// 400 is the "normal" value however we might not have defined ours to
// be that:
ret += "font-weight:" + QString::number(fontWeight) + ";";
}
if (isItalics || style != QFont::StyleNormal) {
ret += "font-style:" + QString::fromLatin1(isItalics ? "italic;" : "oblique;");
Expand Down
Loading

0 comments on commit e2e3a4e

Please sign in to comment.