diff --git a/.clang-format b/.clang-format
index bd3f2c430..eeb9eb929 100644
--- a/.clang-format
+++ b/.clang-format
@@ -25,6 +25,9 @@ DerivePointerBinding: false
FixNamespaceComments: true
IndentCaseLabels: true
IndentWidth: 4
+IndentWrappedFunctionNames: true
+IndentPPDirectives: AfterHash
+NamespaceIndentation: Inner
PointerBindsToType: false
SpacesBeforeTrailingComments: 2
Standard: Auto
diff --git a/BUILDING_ON_WINDOWS.md b/BUILDING_ON_WINDOWS.md
index aaa8743c3..38b48e033 100644
--- a/BUILDING_ON_WINDOWS.md
+++ b/BUILDING_ON_WINDOWS.md
@@ -10,11 +10,11 @@
### OpenSSL
#### For our websocket library, we need OpenSSL 1.1
-1. Download OpenSSL development library: https://slproweb.com/download/Win64OpenSSL-1_1_0h.exe
+1. Download OpenSSL development library: https://slproweb.com/download/Win64OpenSSL-1_1_0i.exe
2. When prompted, install openssl to C:\local\openssl
3. When prompted, copy the OpenSSL DLLs to "The OpenSSL binaries (/bin) directory"
#### For Qt SSL, we need OpenSSL 1.0
-1. Download OpenSSL light: https://slproweb.com/download/Win64OpenSSL_Light-1_0_2o.exe
+1. Download OpenSSL light: https://slproweb.com/download/Win64OpenSSL_Light-1_0_2p.exe
2. When prompted, install it anywhere
3. When prompted, copy the OpenSSL DLLS to "The OpenSSL binaries (/bin) directory"
4. Copy the OpenSSL 1.0 files from its /bin folder to C:/local/bin (You will need to create the folder)
diff --git a/Jenkinsfile b/Jenkinsfile
index 16780a908..621ef91eb 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -6,12 +6,12 @@ pipeline {
parallel {
stage('GCC') {
steps {
- sh 'mkdir -p build-linux-gcc && cd build-linux-gcc && qmake .. && make'
+ sh 'mkdir -p build-linux-gcc && cd build-linux-gcc && make distclean; qmake .. && make'
}
}
stage('Clang') {
steps {
- sh 'mkdir -p build-linux-clang && cd build-linux-clang && qmake -spec linux-clang .. && make'
+ sh 'mkdir -p build-linux-clang && cd build-linux-clang && make distclean; qmake -spec linux-clang .. && make'
}
}
}
diff --git a/chatterino.pro b/chatterino.pro
index 8003eba1a..16ba15c6b 100644
--- a/chatterino.pro
+++ b/chatterino.pro
@@ -6,7 +6,7 @@
message(----)
-QT += widgets core gui network multimedia svg
+QT += widgets core gui network multimedia svg concurrent
CONFIG += communi
COMMUNI += core model util
CONFIG += c++14
@@ -33,7 +33,7 @@ equals(QMAKE_CXX, "clang++")|equals(QMAKE_CXX, "g++") {
}
# Icons
-macx:ICON = resources/images/chatterino2.icns
+#macx:ICON = resources/images/chatterino2.icns
win32:RC_FILE = resources/windows.rc
@@ -72,6 +72,8 @@ win32 {
# OSX include directory
macx {
INCLUDEPATH += /usr/local/include
+ INCLUDEPATH += /usr/local/opt/openssl/include
+ LIBS += -L/usr/local/opt/openssl/lib
}
# Optional dependency on Windows SDK 7
@@ -106,7 +108,6 @@ SOURCES += \
src/Application.cpp \
src/common/Channel.cpp \
src/common/CompletionModel.cpp \
- src/common/Emotemap.cpp \
src/common/NetworkData.cpp \
src/common/NetworkManager.cpp \
src/common/NetworkRequest.cpp \
@@ -188,8 +189,6 @@ SOURCES += \
src/widgets/helper/NotebookButton.cpp \
src/widgets/helper/NotebookTab.cpp \
src/widgets/helper/ResizingTextEdit.cpp \
- src/widgets/helper/RippleEffectButton.cpp \
- src/widgets/helper/RippleEffectLabel.cpp \
src/widgets/helper/ScrollbarHighlight.cpp \
src/widgets/helper/SearchPopup.cpp \
src/widgets/helper/SettingsDialogTab.cpp \
@@ -239,7 +238,6 @@ SOURCES += \
src/providers/twitch/PubsubClient.cpp \
src/providers/twitch/TwitchApi.cpp \
src/messages/Emote.cpp \
- src/messages/EmoteMap.cpp \
src/messages/ImageSet.cpp \
src/providers/bttv/BttvEmotes.cpp \
src/providers/ffz/FfzEmotes.cpp \
@@ -257,16 +255,20 @@ SOURCES += \
src/controllers/notifications/NotificationModel.cpp \
src/singletons/Toasts.cpp \
src/common/DownloadManager.cpp
+ src/widgets/helper/EffectLabel.cpp \
+ src/widgets/helper/Button.cpp \
+ src/messages/MessageContainer.cpp \
+ src/debug/Benchmark.cpp \
+ src/common/UsernameSet.cpp \
+ src/widgets/settingspages/AdvancedPage.cpp
HEADERS += \
src/Application.hpp \
src/common/Channel.hpp \
src/common/Common.hpp \
src/common/CompletionModel.hpp \
- src/common/Emotemap.hpp \
src/common/FlagsEnum.hpp \
- src/common/LockedObject.hpp \
- src/common/MutexValue.hpp \
+ src/common/Atomic.hpp \
src/common/NetworkCommon.hpp \
src/common/NetworkData.hpp \
src/common/NetworkManager.hpp \
@@ -276,9 +278,8 @@ HEADERS += \
src/common/NetworkTimer.hpp \
src/common/NetworkWorker.hpp \
src/common/NullablePtr.hpp \
- src/common/Property.hpp \
src/common/ProviderId.hpp \
- src/common/SerializeCustom.hpp \
+ src/util/RapidJsonSerializeQString.hpp \
src/common/SignalVectorModel.hpp \
src/common/Version.hpp \
src/controllers/accounts/Account.hpp \
@@ -314,7 +315,6 @@ HEADERS += \
src/messages/MessageBuilder.hpp \
src/messages/MessageColor.hpp \
src/messages/MessageElement.hpp \
- src/messages/MessageParseArgs.hpp \
src/messages/Selection.hpp \
src/PrecompiledHeader.hpp \
src/providers/emoji/Emojis.hpp \
@@ -381,8 +381,6 @@ HEADERS += \
src/widgets/helper/NotebookButton.hpp \
src/widgets/helper/NotebookTab.hpp \
src/widgets/helper/ResizingTextEdit.hpp \
- src/widgets/helper/RippleEffectButton.hpp \
- src/widgets/helper/RippleEffectLabel.hpp \
src/widgets/helper/ScrollbarHighlight.hpp \
src/widgets/helper/SearchPopup.hpp \
src/widgets/helper/SettingsDialogTab.hpp \
@@ -426,7 +424,6 @@ HEADERS += \
src/singletons/Updates.hpp \
src/singletons/NativeMessaging.hpp \
src/singletons/Theme.hpp \
- src/common/SimpleSignalVector.hpp \
src/common/SignalVector.hpp \
src/widgets/dialogs/LogsPopup.hpp \
src/common/Singleton.hpp \
@@ -439,8 +436,6 @@ HEADERS += \
src/providers/twitch/PubsubClient.hpp \
src/providers/twitch/TwitchApi.hpp \
src/messages/Emote.hpp \
- src/messages/EmoteMap.hpp \
- src/messages/EmoteCache.hpp \
src/messages/ImageSet.hpp \
src/common/Outcome.hpp \
src/providers/bttv/BttvEmotes.hpp \
@@ -460,6 +455,12 @@ HEADERS += \
src/controllers/notifications/NotificationModel.hpp \
src/singletons/Toasts.hpp \
src/common/DownloadManager.hpp
+ src/widgets/helper/EffectLabel.hpp \
+ src/util/LayoutHelper.hpp \
+ src/widgets/helper/Button.hpp \
+ src/messages/MessageContainer.hpp \
+ src/common/UsernameSet.hpp \
+ src/widgets/settingspages/AdvancedPage.hpp
RESOURCES += \
resources/resources.qrc \
diff --git a/resources/licenses/emoji-data-source.txt b/resources/licenses/emoji-data-source.txt
new file mode 100644
index 000000000..85ddb3c0f
--- /dev/null
+++ b/resources/licenses/emoji-data-source.txt
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2013 Cal Henderson
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/resources/settings/emote.svg b/resources/settings/emote.svg
new file mode 100644
index 000000000..10e25c9f5
--- /dev/null
+++ b/resources/settings/emote.svg
@@ -0,0 +1,12 @@
+
+
+
diff --git a/src/Application.cpp b/src/Application.cpp
index cde5c1c09..bce4cd504 100644
--- a/src/Application.cpp
+++ b/src/Application.cpp
@@ -7,11 +7,13 @@
#include "controllers/moderationactions/ModerationActions.hpp"
#include "controllers/notifications/NotificationController.hpp"
#include "controllers/taggedusers/TaggedUsersController.hpp"
+#include "debug/Log.hpp"
#include "messages/MessageBuilder.hpp"
#include "providers/bttv/BttvEmotes.hpp"
#include "providers/ffz/FfzEmotes.hpp"
#include "providers/twitch/PubsubClient.hpp"
#include "providers/twitch/TwitchServer.hpp"
+#include "singletons/Emotes.hpp"
#include "singletons/Fonts.hpp"
#include "singletons/Logging.hpp"
#include "singletons/NativeMessaging.hpp"
@@ -23,6 +25,7 @@
#include "singletons/WindowManager.hpp"
#include "util/IsBigEndian.hpp"
#include "util/PostToThread.hpp"
+#include "widgets/Window.hpp"
#include
@@ -37,9 +40,7 @@ Application *Application::instance = nullptr;
// to each other
Application::Application(Settings &_settings, Paths &_paths)
- : settings(&_settings)
- , paths(&_paths)
- , resources(&this->emplace())
+ : resources(&this->emplace())
, themes(&this->emplace())
, fonts(&this->emplace())
@@ -103,26 +104,26 @@ void Application::save()
void Application::initNm()
{
#ifdef Q_OS_WIN
-#ifdef QT_DEBUG
-#ifdef C_DEBUG_NM
+# ifdef QT_DEBUG
+# ifdef C_DEBUG_NM
this->nativeMessaging->registerHost();
this->nativeMessaging->openGuiMessageQueue();
-#endif
-#else
+# endif
+# else
this->nativeMessaging->registerHost();
this->nativeMessaging->openGuiMessageQueue();
-#endif
+# endif
#endif
}
void Application::initPubsub()
{
this->twitch.pubsub->signals_.whisper.sent.connect([](const auto &msg) {
- Log("WHISPER SENT LOL"); //
+ log("WHISPER SENT LOL"); //
});
this->twitch.pubsub->signals_.whisper.received.connect([](const auto &msg) {
- Log("WHISPER RECEIVED LOL"); //
+ log("WHISPER RECEIVED LOL"); //
});
this->twitch.pubsub->signals_.moderation.chatCleared.connect(
diff --git a/src/Application.hpp b/src/Application.hpp
index b1dbe2406..b7df63d9d 100644
--- a/src/Application.hpp
+++ b/src/Application.hpp
@@ -1,7 +1,6 @@
#pragma once
#include "common/Singleton.hpp"
-#include "singletons/Resources.hpp"
#include
#include
@@ -27,9 +26,10 @@ class AccountManager;
class Emotes;
class Settings;
class Fonts;
-class Resources;
+class Resources2;
class Toasts;
+
class Application
{
std::vector> singletons_;
@@ -49,8 +49,6 @@ public:
friend void test();
- Settings *const settings{};
- Paths *const paths{};
Resources2 *const resources;
Theme *const themes{};
diff --git a/src/BrowserExtension.cpp b/src/BrowserExtension.cpp
index 75a6ef26f..f12d19b5e 100644
--- a/src/BrowserExtension.cpp
+++ b/src/BrowserExtension.cpp
@@ -9,33 +9,31 @@
#include
#ifdef Q_OS_WIN
-#include
-#include
-#include
+# include
+# include
+# include
#endif
namespace chatterino {
namespace {
-void initFileMode()
-{
+ void initFileMode()
+ {
#ifdef Q_OS_WIN
- _setmode(_fileno(stdin), _O_BINARY);
- _setmode(_fileno(stdout), _O_BINARY);
+ _setmode(_fileno(stdin), _O_BINARY);
+ _setmode(_fileno(stdout), _O_BINARY);
#endif
-}
+ }
-void runLoop(NativeMessagingClient &client)
-{
- while (true) {
- char size_c[4];
- std::cin.read(size_c, 4);
+ void runLoop(NativeMessagingClient &client)
+ {
+ while (true) {
+ char size_c[4];
+ std::cin.read(size_c, 4);
- if (std::cin.eof()) {
- break;
- }
+ if (std::cin.eof()) break;
- uint32_t size = *reinterpret_cast(size_c);
+ auto size = *reinterpret_cast(size_c);
#if 0
bool bigEndian = isBigEndian();
@@ -50,14 +48,14 @@ void runLoop(NativeMessagingClient &client)
}
#endif
- std::unique_ptr b(new char[size + 1]);
- std::cin.read(b.get(), size);
- *(b.get() + size) = '\0';
+ std::unique_ptr buffer(new char[size + 1]);
+ std::cin.read(buffer.get(), size);
+ *(buffer.get() + size) = '\0';
- client.sendMessage(
- QByteArray::fromRawData(b.get(), static_cast(size)));
+ client.sendMessage(QByteArray::fromRawData(
+ buffer.get(), static_cast(size)));
+ }
}
-}
} // namespace
bool shouldRunBrowserExtensionHost(const QStringList &args)
diff --git a/src/PrecompiledHeader.hpp b/src/PrecompiledHeader.hpp
index 6eec78c8e..10dfcd418 100644
--- a/src/PrecompiledHeader.hpp
+++ b/src/PrecompiledHeader.hpp
@@ -1,168 +1,168 @@
#ifdef __cplusplus
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include