├── .gitignore
├── src
├── GUI
│ ├── Resources
│ │ ├── qos
│ │ │ ├── qos-0.hpp
│ │ │ ├── qos-1.hpp
│ │ │ ├── qos-2.hpp
│ │ │ ├── qos-0.png
│ │ │ ├── qos-1.png
│ │ │ ├── qos-2.png
│ │ │ ├── qos-2.cpp
│ │ │ ├── qos-0.cpp
│ │ │ └── qos-1.cpp
│ │ ├── send
│ │ │ ├── send-18x14.hpp
│ │ │ ├── send-18x14.png
│ │ │ ├── send-376x376.png
│ │ │ └── send-18x14.cpp
│ │ ├── pin
│ │ │ ├── pinned-18x18.hpp
│ │ │ ├── not-pinned-18x18.hpp
│ │ │ ├── pin-217x217.png
│ │ │ ├── pinned-18x18.png
│ │ │ ├── not-pinned-18x18.png
│ │ │ ├── pinned-18x18.cpp
│ │ │ └── not-pinned-18x18.cpp
│ │ ├── history
│ │ │ ├── history-18x14.hpp
│ │ │ ├── history-18x14.png
│ │ │ ├── history-128x128.png
│ │ │ └── history-18x14.cpp
│ │ ├── preview
│ │ │ ├── preview-18x14.hpp
│ │ │ ├── preview-18x14.png
│ │ │ ├── preview-128x128.png
│ │ │ └── preview-18x14.cpp
│ │ ├── messages
│ │ │ ├── messages-18x14.hpp
│ │ │ ├── messages-18x14.png
│ │ │ ├── messages-128x128.png
│ │ │ └── messages-18x14.cpp
│ │ └── subscription
│ │ │ ├── subscription-18x14.hpp
│ │ │ ├── subscription-18x14.png
│ │ │ ├── subscription-128x128.png
│ │ │ └── subscription-18x14.cpp
│ ├── Events
│ │ ├── TopicCtrl.cpp
│ │ ├── Edit.cpp
│ │ ├── Profile.cpp
│ │ ├── Recording.cpp
│ │ ├── Subscription.cpp
│ │ ├── Layout.cpp
│ │ ├── Connection.cpp
│ │ ├── TopicCtrl.hpp
│ │ ├── Edit.hpp
│ │ ├── Profile.hpp
│ │ ├── Connection.hpp
│ │ ├── Recording.hpp
│ │ ├── Layout.hpp
│ │ └── Subscription.hpp
│ ├── Types
│ │ ├── ClientOptions.hpp
│ │ ├── ClientOptions.cpp
│ │ ├── Subscription.hpp
│ │ └── Subscription.cpp
│ ├── Notifiers
│ │ ├── Layouts.hpp
│ │ └── Layouts.cpp
│ ├── ArtProvider.hpp
│ ├── Models
│ │ ├── ProfilesWrapper.cpp
│ │ ├── ProfilesWrapper.hpp
│ │ ├── Messages.hpp
│ │ ├── KnownTopics.hpp
│ │ ├── Layouts.hpp
│ │ ├── Subscriptions.hpp
│ │ ├── History.hpp
│ │ ├── Messages.cpp
│ │ ├── Profiles.hpp
│ │ ├── FsTree.hpp
│ │ └── KnownTopics.cpp
│ ├── Widgets
│ │ ├── Layouts.hpp
│ │ ├── TopicCtrl.hpp
│ │ └── Edit.hpp
│ ├── App.hpp
│ ├── Tabs
│ │ ├── Homepage.hpp
│ │ └── Settings.hpp
│ └── ArtProvider.cpp
├── Common
│ ├── Version.hpp
│ ├── Info.hpp
│ ├── Env.hpp
│ ├── Version.in.cpp
│ ├── Env.Linux.cpp
│ ├── Url.hpp
│ ├── Info.in.cpp
│ ├── Console.hpp
│ ├── String.hpp
│ ├── Env.Windows.cpp
│ ├── Helpers.hpp
│ ├── Log.hpp
│ ├── Extract.hpp
│ ├── String.cpp
│ ├── XdgBaseDir.hpp
│ ├── Extract.cpp
│ ├── XdgBaseDir.Windows.cpp
│ ├── Log.cpp
│ ├── XdgBaseDir.cpp
│ ├── XdgBaseDir.Linux.cpp
│ ├── Console.cpp
│ ├── Filesystem.hpp
│ ├── Url.cpp
│ └── Helpers.cpp
├── MQTT
│ ├── QualityOfService.hpp
│ ├── Message.hpp
│ ├── Message.cpp
│ ├── Subscription.hpp
│ ├── Subscription.cpp
│ ├── BrokerOptions.hpp
│ └── Client.hpp
├── Arguments.hpp
├── main.cpp
├── transmitron.in.rc
├── Arguments.cpp
└── CMakeLists.txt
├── resources
├── images
│ ├── nsis
│ │ ├── header.bmp
│ │ └── welcomefinish.bmp
│ ├── transmitron.ico
│ └── CMakeLists.txt
├── debian
│ ├── postinst.in.sh
│ ├── transmitron.in.desktop
│ ├── mimetypes-transmitron.xml
│ └── CMakeLists.txt
├── icons
│ ├── add.svg
│ ├── CMakeLists.txt
│ ├── arrow_forward.svg
│ ├── clear_all.svg
│ ├── send.svg
│ ├── home.svg
│ ├── music_note.svg
│ ├── draft.svg
│ ├── folder.svg
│ ├── delete.svg
│ ├── edit.svg
│ ├── description.svg
│ ├── content_copy.svg
│ ├── note_add.svg
│ ├── create_new_folder.svg
│ ├── search.svg
│ ├── inventory_2.svg
│ ├── volume_up.svg
│ ├── save.svg
│ ├── notifications.svg
│ ├── archive.svg
│ ├── history.svg
│ ├── notification_add.svg
│ ├── task_alt.svg
│ ├── notifications_off.svg
│ ├── volume_off.svg
│ ├── cancel.svg
│ ├── hide_source.svg
│ ├── person.svg
│ ├── save_as.svg
│ ├── person_add.svg
│ ├── pending.svg
│ ├── settings.svg
│ └── palette.svg
├── cmake-installer.sh
├── update-alternatives-clang.sh
└── windows
│ └── FileAssociation.nsh
├── .github
└── FUNDING.yml
├── docker
├── windows-x86-64
│ ├── compiler
│ │ ├── default.ini
│ │ ├── build.sh
│ │ ├── windows.ini
│ │ └── Dockerfile
│ ├── debug
│ │ ├── build.sh
│ │ ├── macro-make
│ │ └── Dockerfile
│ └── release
│ │ ├── build.sh
│ │ ├── macro-make
│ │ └── Dockerfile
└── linux-x86-64
│ ├── compiler
│ ├── default.ini
│ ├── build.sh
│ └── Dockerfile
│ ├── debug
│ ├── build.sh
│ ├── macro-make
│ └── Dockerfile
│ └── release
│ ├── build.sh
│ ├── macro-make
│ └── Dockerfile
├── cmake
├── install.cmake
├── clang-tidy.cmake
└── git-version.cmake
├── conan
└── conanfile.py
├── docs
└── build.md
├── CMakeLists.txt
├── .drone.yml
├── .clang-tidy
├── README.md
├── .clang-format
└── CHANGELOG.md
/.gitignore:
--------------------------------------------------------------------------------
1 | *.sw?
2 | /compile_commands.json
3 | /build*
4 | /tags
5 | /.cache
6 | /.container
7 | /.hidden*
8 |
--------------------------------------------------------------------------------
/src/GUI/Resources/qos/qos-0.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class wxBitmap;
4 | const wxBitmap *bin2cQos0();
5 |
6 |
--------------------------------------------------------------------------------
/src/GUI/Resources/qos/qos-1.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class wxBitmap;
4 | const wxBitmap *bin2cQos1();
5 |
6 |
--------------------------------------------------------------------------------
/src/GUI/Resources/qos/qos-2.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class wxBitmap;
4 | const wxBitmap *bin2cQos2();
5 |
6 |
--------------------------------------------------------------------------------
/src/GUI/Resources/qos/qos-0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/qos/qos-0.png
--------------------------------------------------------------------------------
/src/GUI/Resources/qos/qos-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/qos/qos-1.png
--------------------------------------------------------------------------------
/src/GUI/Resources/qos/qos-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/qos/qos-2.png
--------------------------------------------------------------------------------
/resources/images/nsis/header.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/resources/images/nsis/header.bmp
--------------------------------------------------------------------------------
/resources/images/transmitron.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/resources/images/transmitron.ico
--------------------------------------------------------------------------------
/src/GUI/Resources/send/send-18x14.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class wxBitmap;
4 | const wxBitmap *bin2cSend18x14();
5 |
6 |
--------------------------------------------------------------------------------
/src/GUI/Resources/pin/pinned-18x18.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class wxBitmap;
4 | const wxBitmap *bin2cPinned18x18();
5 |
6 |
--------------------------------------------------------------------------------
/resources/images/nsis/welcomefinish.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/resources/images/nsis/welcomefinish.bmp
--------------------------------------------------------------------------------
/src/GUI/Resources/history/history-18x14.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class wxBitmap;
4 | const wxBitmap *bin2cHistory18x14();
5 |
6 |
--------------------------------------------------------------------------------
/src/GUI/Resources/pin/not-pinned-18x18.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class wxBitmap;
4 | const wxBitmap *bin2cNotPinned18x18();
5 |
6 |
--------------------------------------------------------------------------------
/src/GUI/Resources/pin/pin-217x217.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/pin/pin-217x217.png
--------------------------------------------------------------------------------
/src/GUI/Resources/pin/pinned-18x18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/pin/pinned-18x18.png
--------------------------------------------------------------------------------
/src/GUI/Resources/preview/preview-18x14.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class wxBitmap;
4 | const wxBitmap *bin2cPreview18x14();
5 |
6 |
--------------------------------------------------------------------------------
/src/GUI/Resources/send/send-18x14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/send/send-18x14.png
--------------------------------------------------------------------------------
/src/GUI/Resources/send/send-376x376.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/send/send-376x376.png
--------------------------------------------------------------------------------
/src/GUI/Resources/messages/messages-18x14.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class wxBitmap;
4 | const wxBitmap *bin2cMessages18x14();
5 |
6 |
--------------------------------------------------------------------------------
/src/GUI/Resources/history/history-18x14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/history/history-18x14.png
--------------------------------------------------------------------------------
/src/GUI/Resources/pin/not-pinned-18x18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/pin/not-pinned-18x18.png
--------------------------------------------------------------------------------
/src/GUI/Resources/preview/preview-18x14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/preview/preview-18x14.png
--------------------------------------------------------------------------------
/src/GUI/Resources/history/history-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/history/history-128x128.png
--------------------------------------------------------------------------------
/src/GUI/Resources/messages/messages-18x14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/messages/messages-18x14.png
--------------------------------------------------------------------------------
/src/GUI/Resources/preview/preview-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/preview/preview-128x128.png
--------------------------------------------------------------------------------
/src/GUI/Resources/subscription/subscription-18x14.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | class wxBitmap;
4 | const wxBitmap *bin2cSubscription18x14();
5 |
6 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github: rapatas
2 | custom: ["https://rapatas.com/monero.html", "https://www.paypal.com/donate/?hosted_button_id=UN5339YKVHB4G"]
3 |
--------------------------------------------------------------------------------
/src/GUI/Resources/messages/messages-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/messages/messages-128x128.png
--------------------------------------------------------------------------------
/src/GUI/Resources/subscription/subscription-18x14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/subscription/subscription-18x14.png
--------------------------------------------------------------------------------
/src/GUI/Resources/subscription/subscription-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rapatas/transmitron/HEAD/src/GUI/Resources/subscription/subscription-128x128.png
--------------------------------------------------------------------------------
/resources/debian/postinst.in.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | update-mime-database @CMAKE_INSTALL_PREFIX@/share/mime
4 | gtk-update-icon-cache @CMAKE_INSTALL_PREFIX@/share/icons/hicolor
5 |
--------------------------------------------------------------------------------
/resources/icons/add.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/icons/CMakeLists.txt:
--------------------------------------------------------------------------------
1 |
2 | file(GLOB svgs ${CMAKE_CURRENT_LIST_DIR}/*.svg)
3 |
4 | install(
5 | FILES ${svgs}
6 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}
7 | )
8 |
--------------------------------------------------------------------------------
/src/Common/Version.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace Rapatas::Transmitron::Common::Info {
4 |
5 | const char *getProjectVersion();
6 |
7 | } // namespace Rapatas::Transmitron::Common::Info
8 |
--------------------------------------------------------------------------------
/docker/windows-x86-64/compiler/default.ini:
--------------------------------------------------------------------------------
1 | [settings]
2 | arch=x86_64
3 | build_type=Debug
4 | compiler=gcc
5 | compiler.cppstd=gnu20
6 | compiler.libcxx=libstdc++11
7 | compiler.version=14
8 | os=Linux
9 |
--------------------------------------------------------------------------------
/resources/icons/arrow_forward.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/icons/clear_all.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/icons/send.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/Common/Info.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | namespace Rapatas::Transmitron::Common::Info {
4 |
5 | const char *getProjectName();
6 | const char *getProjectDescription();
7 |
8 | } // namespace Rapatas::Transmitron::Common::Info
9 |
--------------------------------------------------------------------------------
/src/Common/Env.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | namespace Rapatas::Transmitron::Common::Env {
6 |
7 | std::string get(const std::string &name);
8 |
9 | } // namespace Rapatas::Transmitron::Common::Env
10 |
--------------------------------------------------------------------------------
/src/Common/Version.in.cpp:
--------------------------------------------------------------------------------
1 | #include "Common/Version.hpp"
2 |
3 | constexpr const char *ProjectVersion = "@GIT_DESCRIBE@";
4 |
5 | const char *Rapatas::Transmitron::Common::Info::getProjectVersion() {
6 | return ProjectVersion;
7 | }
8 |
--------------------------------------------------------------------------------
/resources/icons/home.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/icons/music_note.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/GUI/Events/TopicCtrl.cpp:
--------------------------------------------------------------------------------
1 | #include "GUI/Events/TopicCtrl.hpp"
2 |
3 | using namespace Rapatas::Transmitron::GUI;
4 |
5 | // NOLINTBEGIN(cert-err58-cpp)
6 | wxDEFINE_EVENT(Events::TOPICCTRL_RETURN, Events::TopicCtrl);
7 | // NOLINTEND(cert-err58-cpp)
8 |
--------------------------------------------------------------------------------
/resources/icons/draft.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/MQTT/QualityOfService.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | namespace Rapatas::Transmitron::MQTT {
6 |
7 | enum class QoS : uint8_t {
8 | AtLeastOnce = 0,
9 | AtMostOnce = 1,
10 | ExactlyOnce = 2
11 | };
12 |
13 | } // namespace Rapatas::Transmitron::MQTT
14 |
--------------------------------------------------------------------------------
/src/GUI/Events/Edit.cpp:
--------------------------------------------------------------------------------
1 | #include "GUI/Events/Edit.hpp"
2 |
3 | using namespace Rapatas::Transmitron::GUI;
4 |
5 | // NOLINTBEGIN(cert-err58-cpp)
6 | wxDEFINE_EVENT(Events::EDIT_PUBLISH, Events::Edit);
7 | wxDEFINE_EVENT(Events::EDIT_SAVE_MESSAGE, Events::Edit);
8 | // NOLINTEND(cert-err58-cpp)
9 |
--------------------------------------------------------------------------------
/resources/icons/folder.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/GUI/Events/Profile.cpp:
--------------------------------------------------------------------------------
1 | #include "GUI/Events/Profile.hpp"
2 |
3 | using namespace Rapatas::Transmitron::GUI;
4 |
5 | // NOLINTBEGIN(cert-err58-cpp)
6 | wxDEFINE_EVENT(Events::PROFILE_CREATE, Events::Profile);
7 | wxDEFINE_EVENT(Events::PROFILE_EDIT, Events::Profile);
8 | // NOLINTEND(cert-err58-cpp)
9 |
--------------------------------------------------------------------------------
/src/GUI/Events/Recording.cpp:
--------------------------------------------------------------------------------
1 | #include "GUI/Events/Recording.hpp"
2 |
3 | using namespace Rapatas::Transmitron::GUI;
4 |
5 | // NOLINTBEGIN(cert-err58-cpp)
6 | wxDEFINE_EVENT(Events::RECORDING_SAVE, Events::Recording);
7 | wxDEFINE_EVENT(Events::RECORDING_OPEN, Events::Recording);
8 | // NOLINTEND(cert-err58-cpp)
9 |
--------------------------------------------------------------------------------
/resources/icons/delete.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/debian/transmitron.in.desktop:
--------------------------------------------------------------------------------
1 | [Desktop Entry]
2 | # Version=0.0.0
3 | Categories=Development;Internet;
4 | Comment=@PROGRAM_DESCRIPTION@
5 | GenericName=Transmitron MQTT Client
6 | Exec=@TRANSMITRON_BIN_NAME@
7 | Icon=@TRANSMITRON_BIN_NAME@
8 | Name=@TRANSMITRON_NAME@
9 | Terminal=false
10 | Type=Application
11 |
--------------------------------------------------------------------------------
/resources/icons/edit.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cmake/install.cmake:
--------------------------------------------------------------------------------
1 | include(GNUInstallDirs)
2 |
3 | install(
4 | TARGETS
5 | ${PROJECT_NAME}
6 | RUNTIME
7 | DESTINATION bin
8 | )
9 |
10 | add_subdirectory(${CMAKE_SOURCE_DIR}/resources/debian)
11 | add_subdirectory(${CMAKE_SOURCE_DIR}/resources/images)
12 | add_subdirectory(${CMAKE_SOURCE_DIR}/resources/icons)
13 |
--------------------------------------------------------------------------------
/resources/icons/description.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docker/linux-x86-64/compiler/default.ini:
--------------------------------------------------------------------------------
1 | [settings]
2 | arch=x86_64
3 | build_type=Debug
4 | compiler=clang
5 | compiler.cppstd=gnu20
6 | compiler.libcxx=libstdc++11
7 | compiler.version=18
8 | os=Linux
9 |
10 | [buildenv]
11 | CC=/usr/bin/clang
12 | CXX=/usr/bin/clang++
13 |
14 | [conf]
15 | tools.system.package_manager:mode=install
16 |
--------------------------------------------------------------------------------
/resources/icons/content_copy.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/icons/note_add.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docker/linux-x86-64/debug/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh -eu
2 |
3 | script_dir=$(dirname "$0")
4 | temp_dir=$(mktemp -d)
5 |
6 | echo "Using temp dir $temp_dir"
7 |
8 | cp -r "$script_dir"/* "$temp_dir"
9 | cp "$script_dir/../../../conan/conanfile.py" "$temp_dir/"
10 |
11 | docker build \
12 | -t rapatas-transmitron-linux-x86-64-debug \
13 | "$temp_dir"
14 |
--------------------------------------------------------------------------------
/resources/debian/mimetypes-transmitron.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Transmitron history recording
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/src/Common/Env.Linux.cpp:
--------------------------------------------------------------------------------
1 | #ifndef _WIN32
2 |
3 | #include "Env.hpp"
4 |
5 | using namespace Rapatas::Transmitron::Common;
6 |
7 | std::string Env::get(const std::string &name) {
8 | // NOLINTNEXTLINE
9 | char *result = ::getenv(name.c_str());
10 | if (result == nullptr) { return {}; }
11 | return result;
12 | }
13 |
14 | #endif // _WIN32
15 |
--------------------------------------------------------------------------------
/docker/linux-x86-64/release/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh -eu
2 |
3 | script_dir=$(dirname "$0")
4 | temp_dir=$(mktemp -d)
5 |
6 | echo "Using temp dir $temp_dir"
7 |
8 | cp -r "$script_dir"/* "$temp_dir"
9 | cp "$script_dir/../../../conan/conanfile.py" "$temp_dir/"
10 |
11 | docker build \
12 | -t rapatas-transmitron-linux-x86-64-release \
13 | "$temp_dir"
14 |
--------------------------------------------------------------------------------
/docker/windows-x86-64/debug/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh -eu
2 |
3 | script_dir=$(dirname "$0")
4 | temp_dir=$(mktemp -d)
5 |
6 | echo "Using temp dir $temp_dir"
7 |
8 | cp -r "$script_dir"/* "$temp_dir"
9 | cp "$script_dir/../../../conan/conanfile.py" "$temp_dir/"
10 |
11 | docker build \
12 | -t rapatas-transmitron-windows-x86-64-debug \
13 | "$temp_dir"
14 |
--------------------------------------------------------------------------------
/resources/icons/create_new_folder.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docker/windows-x86-64/compiler/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh -eu
2 |
3 | script_dir=$(dirname "$0")
4 | temp_dir=$(mktemp -d)
5 |
6 | echo "Using temp dir $temp_dir"
7 |
8 | cp -r "$script_dir"/* "$temp_dir"
9 | cp "$script_dir/../../../resources/cmake-installer.sh" "$temp_dir/"
10 |
11 | docker build \
12 | -t rapatas-transmitron-windows-x86-64 \
13 | "$temp_dir"
14 |
--------------------------------------------------------------------------------
/docker/windows-x86-64/release/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh -eu
2 |
3 | script_dir=$(dirname "$0")
4 | temp_dir=$(mktemp -d)
5 |
6 | echo "Using temp dir $temp_dir"
7 |
8 | cp -r "$script_dir"/* "$temp_dir"
9 | cp "$script_dir/../../../conan/conanfile.py" "$temp_dir/"
10 |
11 | docker build \
12 | -t rapatas-transmitron-windows-x86-64-release \
13 | "$temp_dir"
14 |
--------------------------------------------------------------------------------
/src/Common/Url.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | namespace Rapatas::Transmitron::Common::Url {
6 |
7 | std::string encode(const std::string &data);
8 | std::string decode(const std::string &data);
9 |
10 | inline bool encodable(char value);
11 | inline bool isHexChar(char value);
12 |
13 | } // namespace Rapatas::Transmitron::Common::Url
14 |
--------------------------------------------------------------------------------
/resources/icons/search.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/icons/inventory_2.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/icons/volume_up.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/icons/save.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/icons/notifications.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/Common/Info.in.cpp:
--------------------------------------------------------------------------------
1 | #include "Common/Info.hpp"
2 |
3 | constexpr const char *ProjectName = "@PROJECT_NAME@";
4 | constexpr const char *ProjectDescription = "@PROJECT_DESCRIPTION@";
5 |
6 | using namespace Rapatas::Transmitron;
7 |
8 | const char *Common::Info::getProjectName() { return ProjectName; }
9 |
10 | const char *Common::Info::getProjectDescription() { return ProjectDescription; }
11 |
--------------------------------------------------------------------------------
/src/Common/Console.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #ifdef _WIN32
4 | #include
5 |
6 | namespace Rapatas::Transmitron::Common::Console {
7 |
8 | bool redirect();
9 | bool release();
10 | void adjustBuffer(int16_t minLength);
11 | bool create(int16_t minLength);
12 | bool attachToParent(int16_t minLength);
13 |
14 | } // namespace Rapatas::Transmitron::Common::Console
15 |
16 | #endif // _WIN32
17 |
--------------------------------------------------------------------------------
/resources/icons/archive.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/Common/String.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | namespace Rapatas::Transmitron::Common::String {
7 |
8 | std::vector split(const std::string &data, char delim);
9 |
10 | std::string replace(
11 | const std::string &str,
12 | const std::string &what,
13 | const std::string &with
14 | );
15 |
16 | } // namespace Rapatas::Transmitron::Common::String
17 |
--------------------------------------------------------------------------------
/src/GUI/Events/Subscription.cpp:
--------------------------------------------------------------------------------
1 | #include "GUI/Events/Subscription.hpp"
2 |
3 | using namespace Rapatas::Transmitron::GUI;
4 |
5 | // NOLINTBEGIN(cert-err58-cpp)
6 | wxDEFINE_EVENT(Events::SUBSCRIPTION_SUBSCRIBED, Events::Subscription);
7 | wxDEFINE_EVENT(Events::SUBSCRIPTION_UNSUBSCRIBED, Events::Subscription);
8 | wxDEFINE_EVENT(Events::SUBSCRIPTION_RECEIVED, Events::Subscription);
9 | // NOLINTEND(cert-err58-cpp)
10 |
--------------------------------------------------------------------------------
/src/Arguments.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | namespace Rapatas::Transmitron {
6 |
7 | struct Arguments {
8 | bool exit = false;
9 |
10 | int argc{};
11 | char **argv = nullptr;
12 |
13 | std::string profileName;
14 | std::string recordingFile;
15 | bool verbose = false;
16 |
17 | static Arguments handleArgs(int argc, char **argv);
18 | };
19 |
20 | } // namespace Rapatas::Transmitron
21 |
--------------------------------------------------------------------------------
/resources/icons/history.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docker/linux-x86-64/compiler/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh -eu
2 |
3 | script_dir=$(dirname "$0")
4 | temp_dir=$(mktemp -d)
5 |
6 | echo "Using temp dir $temp_dir"
7 |
8 | cp -r "$script_dir"/* "$temp_dir"
9 | cp "$script_dir/../../../resources/cmake-installer.sh" "$temp_dir/"
10 | cp "$script_dir/../../../resources/update-alternatives-clang.sh" "$temp_dir/"
11 |
12 | docker build \
13 | -t rapatas-transmitron-linux-x86-64 \
14 | "$temp_dir"
15 |
--------------------------------------------------------------------------------
/cmake/clang-tidy.cmake:
--------------------------------------------------------------------------------
1 |
2 | set(BUILD_WITH_TIDY OFF CACHE BOOL "")
3 |
4 | if (BUILD_WITH_TIDY)
5 | find_program(CLANG_TIDY_COMMAND NAMES "clang-tidy" REQUIRED)
6 | set(CMAKE_CXX_CLANG_TIDY "")
7 | list(APPEND CMAKE_CXX_CLANG_TIDY "clang-tidy")
8 | list(APPEND CMAKE_CXX_CLANG_TIDY "--config-file=${CMAKE_SOURCE_DIR}/.clang-tidy")
9 | list(APPEND CMAKE_CXX_CLANG_TIDY "-header-filter=${CMAKE_SOURCE_DIR}/src/.*.hpp")
10 | endif()
11 |
12 |
--------------------------------------------------------------------------------
/docker/linux-x86-64/debug/macro-make:
--------------------------------------------------------------------------------
1 | #!/bin/sh -eu
2 |
3 | build_dir="build-$(cat /etc/compilername)"
4 |
5 | mkdir -p "/workspace/$build_dir"
6 | cd "/workspace/$build_dir"
7 |
8 | conan install \
9 | --build=missing \
10 | --profile:build=default \
11 | --profile:host=default \
12 | -of . \
13 | ../conan
14 |
15 | cmake \
16 | -DCMAKE_BUILD_TYPE=Debug \
17 | -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake \
18 | ..
19 |
20 | make -j $(nproc)
21 |
--------------------------------------------------------------------------------
/docker/linux-x86-64/release/macro-make:
--------------------------------------------------------------------------------
1 | #!/bin/sh -eu
2 |
3 | build_dir="build-$(cat /etc/compilername)"
4 |
5 | mkdir -p "/workspace/$build_dir"
6 | cd "/workspace/$build_dir"
7 |
8 | conan install \
9 | --build=missing \
10 | --profile:build=default \
11 | --profile:host=default \
12 | -of . \
13 | ../conan
14 |
15 | cmake \
16 | -DCMAKE_BUILD_TYPE=Release \
17 | -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake \
18 | ..
19 |
20 | make -j $(nproc)
21 |
--------------------------------------------------------------------------------
/resources/icons/notification_add.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/icons/task_alt.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/GUI/Events/Layout.cpp:
--------------------------------------------------------------------------------
1 | #include "GUI/Events/Layout.hpp"
2 |
3 | using namespace Rapatas::Transmitron::GUI;
4 |
5 | // NOLINTBEGIN(cert-err58-cpp)
6 | wxDEFINE_EVENT(Events::LAYOUT_SELECTED, Events::Layout);
7 | wxDEFINE_EVENT(Events::LAYOUT_ADDED, Events::Layout);
8 | wxDEFINE_EVENT(Events::LAYOUT_REMOVED, Events::Layout);
9 | wxDEFINE_EVENT(Events::LAYOUT_CHANGED, Events::Layout);
10 | wxDEFINE_EVENT(Events::LAYOUT_RESIZED, Events::Layout);
11 | // NOLINTEND(cert-err58-cpp)
12 |
--------------------------------------------------------------------------------
/resources/icons/notifications_off.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/icons/volume_off.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/icons/cancel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docker/windows-x86-64/debug/macro-make:
--------------------------------------------------------------------------------
1 | #!/bin/sh -eu
2 |
3 | build_dir="build-$(cat /etc/compilername)"
4 |
5 | mkdir -p "/workspace/$build_dir"
6 | cd "/workspace/$build_dir"
7 |
8 | conan install \
9 | --build=missing \
10 | --profile:build=default \
11 | --profile:host=windows \
12 | -of . \
13 | ../conan
14 |
15 | cmake \
16 | -DCMAKE_BUILD_TYPE=Debug \
17 | -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake \
18 | -DCMAKE_PREFIX_PATH=/usr/x86_64-w64-mingw32 \
19 | ..
20 |
21 | make -j $(nproc)
22 |
--------------------------------------------------------------------------------
/docker/windows-x86-64/release/macro-make:
--------------------------------------------------------------------------------
1 | #!/bin/sh -eu
2 |
3 | build_dir="build-$(cat /etc/compilername)"
4 |
5 | mkdir -p "/workspace/$build_dir"
6 | cd "/workspace/$build_dir"
7 |
8 | conan install \
9 | --build=missing \
10 | --profile:build=default \
11 | --profile:host=windows \
12 | -of . \
13 | ../conan
14 |
15 | cmake \
16 | -DCMAKE_BUILD_TYPE=Release \
17 | -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake \
18 | -DCMAKE_PREFIX_PATH=/usr/x86_64-w64-mingw32 \
19 | ..
20 |
21 | make -j $(nproc)
22 |
--------------------------------------------------------------------------------
/src/GUI/Events/Connection.cpp:
--------------------------------------------------------------------------------
1 | #include "GUI/Events/Connection.hpp"
2 |
3 | using namespace Rapatas::Transmitron::GUI;
4 |
5 | // NOLINTBEGIN(cert-err58-cpp)
6 | wxDEFINE_EVENT(Events::CONNECTION_REQUESTED, Events::Connection);
7 | wxDEFINE_EVENT(Events::CONNECTION_CONNECTED, Events::Connection);
8 | wxDEFINE_EVENT(Events::CONNECTION_DISCONNECTED, Events::Connection);
9 | wxDEFINE_EVENT(Events::CONNECTION_FAILURE, Events::Connection);
10 | wxDEFINE_EVENT(Events::CONNECTION_LOST, Events::Connection);
11 | // NOLINTEND(cert-err58-cpp)
12 |
--------------------------------------------------------------------------------
/resources/icons/hide_source.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/icons/person.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/icons/save_as.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/Common/Env.Windows.cpp:
--------------------------------------------------------------------------------
1 | #ifdef _WIN32
2 |
3 | #include "Env.hpp"
4 |
5 | #include
6 | #include
7 |
8 | using namespace Rapatas::Transmitron::Common;
9 |
10 | std::string Env::get(const std::string &name) {
11 | LPCSTR lpName = name.c_str();
12 | const DWORD nSize = 4096;
13 |
14 | std::string buffer;
15 | buffer.resize(nSize);
16 |
17 | const auto size = GetEnvironmentVariableA(lpName, buffer.data(), nSize);
18 | if (size == 0) { return {}; }
19 |
20 | return {buffer.begin(), buffer.begin() + size};
21 | }
22 |
23 | #endif // _WIN32
24 |
--------------------------------------------------------------------------------
/resources/icons/person_add.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/MQTT/Message.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | #include
7 |
8 | #include "QualityOfService.hpp"
9 |
10 | namespace Rapatas::Transmitron::MQTT {
11 |
12 | struct Message {
13 | std::string topic;
14 | std::string payload;
15 | MQTT::QoS qos = MQTT::QoS::AtLeastOnce;
16 | bool retained = false;
17 | std::chrono::system_clock::time_point timestamp;
18 |
19 | static Message fromJson(const nlohmann::json &data);
20 | [[nodiscard]] nlohmann::json toJson() const;
21 | };
22 |
23 | } // namespace Rapatas::Transmitron::MQTT
24 |
--------------------------------------------------------------------------------
/src/GUI/Events/TopicCtrl.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | namespace Rapatas::Transmitron::GUI::Events {
6 |
7 | class TopicCtrl;
8 | wxDECLARE_EVENT(TOPICCTRL_RETURN, TopicCtrl);
9 |
10 | // NOLINTNEXTLINE
11 | class TopicCtrl : public wxCommandEvent
12 | {
13 | public:
14 |
15 | explicit TopicCtrl(wxEventType commandType, int id = 0) :
16 | wxCommandEvent(commandType, id) //
17 | {}
18 |
19 | TopicCtrl(const TopicCtrl &event) = default;
20 |
21 | [[nodiscard]] wxEvent *Clone() const override { return new TopicCtrl(*this); }
22 | };
23 |
24 | } // namespace Rapatas::Transmitron::GUI::Events
25 |
--------------------------------------------------------------------------------
/resources/cmake-installer.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -e
4 |
5 | [ $(id -u) -ne 0 ] && SUDO=sudo
6 |
7 | version=3.28.1
8 |
9 | $SUDO apt-get install -y openssl libssl-dev build-essential wget
10 |
11 | cd /tmp/
12 |
13 | wget https://github.com/Kitware/CMake/releases/download/v$version/cmake-$version.tar.gz
14 | tar -xzf cmake-$version.tar.gz
15 |
16 | cd cmake-$version
17 | # Enable openssl
18 | sed -i 's/cmake_options="-DCMAKE_BOOTSTRAP=1"/cmake_options="-DCMAKE_BOOTSTRAP=1 -DCMAKE_USE_OPENSSL=ON"/' bootstrap
19 |
20 | mkdir build && cd build
21 | ../bootstrap --parallel=$(nproc)
22 | make -j $(nproc)
23 | $SUDO make install
24 |
--------------------------------------------------------------------------------
/src/GUI/Events/Edit.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | namespace Rapatas::Transmitron::GUI::Events {
6 |
7 | class Edit;
8 | wxDECLARE_EVENT(EDIT_PUBLISH, Edit);
9 | wxDECLARE_EVENT(EDIT_SAVE_MESSAGE, Edit);
10 |
11 | // NOLINTNEXTLINE
12 | class Edit : public wxCommandEvent
13 | {
14 | public:
15 |
16 | explicit Edit(wxEventType commandType, int id = 0) :
17 | wxCommandEvent(commandType, id) //
18 | {}
19 |
20 | Edit(const Edit &event) = default;
21 |
22 | [[nodiscard]] wxEvent *Clone() const override { return new Edit(*this); }
23 | };
24 |
25 | } // namespace Rapatas::Transmitron::GUI::Events
26 |
--------------------------------------------------------------------------------
/docker/windows-x86-64/compiler/windows.ini:
--------------------------------------------------------------------------------
1 | [settings]
2 | os=Windows
3 | arch=x86_64
4 | compiler=gcc
5 | compiler.version=10
6 | compiler.libcxx=libstdc++11
7 | build_type=Debug
8 |
9 | [buildenv]
10 | LDFLAGS=-static -static-libstdc++
11 |
12 | AR=x86_64-w64-mingw32-ar
13 | AS=x86_64-w64-mingw32-as-posix
14 | CC=x86_64-w64-mingw32-gcc-posix
15 | CHOST=x86_64-w64-mingw32
16 | CXX=x86_64-w64-mingw32-g++-posix
17 | RANLIB=x86_64-w64-mingw32-ranlib
18 | RC=x86_64-w64-mingw32-windres
19 | STRIP=x86_64-w64-mingw32-strip-posix
20 |
21 | [conf]
22 | tools.build:compiler_executables = { "cpp": "x86_64-w64-mingw32-g++-posix", "c": "x86_64-w64-mingw32-gcc-posix" }
23 |
24 |
--------------------------------------------------------------------------------
/resources/images/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | install(
2 | FILES
3 | ${CMAKE_SOURCE_DIR}/resources/images/transmitron.ico
4 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}
5 | )
6 |
7 | file(
8 | COPY ${CMAKE_SOURCE_DIR}/resources/images/transmitron.ico
9 | DESTINATION ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}
10 | )
11 |
12 | install(
13 | FILES
14 | transmitron.svg
15 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps
16 | )
17 |
18 | install(
19 | FILES
20 | transmitron.svg
21 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/mimetypes
22 | RENAME text-transmitron.svg
23 | )
24 |
--------------------------------------------------------------------------------
/src/GUI/Types/ClientOptions.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include
6 |
7 | #include "GUI/Models/Layouts.hpp"
8 |
9 | namespace Rapatas::Transmitron::GUI::Types {
10 |
11 | class ClientOptions
12 | {
13 | public:
14 |
15 | explicit ClientOptions() = default;
16 | explicit ClientOptions(std::string layout);
17 |
18 | static ClientOptions fromJson(const nlohmann::json &data);
19 | [[nodiscard]] nlohmann::json toJson() const;
20 |
21 | [[nodiscard]] std::string getLayout() const;
22 |
23 | private:
24 |
25 | std::string mLayout{Models::Layouts::DefaultName};
26 | };
27 |
28 | } // namespace Rapatas::Transmitron::GUI::Types
29 |
--------------------------------------------------------------------------------
/resources/icons/pending.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/cmake/git-version.cmake:
--------------------------------------------------------------------------------
1 | find_package(Git)
2 |
3 | if(GIT_EXECUTABLE)
4 | execute_process(
5 | COMMAND ${GIT_EXECUTABLE} describe --always --tags --dirty
6 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
7 | OUTPUT_VARIABLE GIT_DESCRIBE_VERSION
8 | RESULT_VARIABLE GIT_DESCRIBE_ERROR_CODE
9 | OUTPUT_STRIP_TRAILING_WHITESPACE
10 | )
11 | # If no error took place, save the version
12 | if(NOT GIT_DESCRIBE_ERROR_CODE)
13 | set(GIT_DESCRIBE "${GIT_DESCRIBE_VERSION}")
14 | endif()
15 | endif()
16 |
17 | if(NOT DEFINED GIT_DESCRIBE)
18 | set(GIT_DESCRIBE 0.0.0-0-unknown)
19 | message(WARNING "Failed to determine GIT_DESCRIBE from Git tags. Using default version \"${GIT_DESCRIBE}\".")
20 | endif()
21 |
--------------------------------------------------------------------------------
/src/Common/Helpers.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include
6 |
7 | namespace Rapatas::Transmitron::Common::Helpers {
8 |
9 | wxColor colorFromNumber(size_t number);
10 |
11 | std::string timeToFilename(
12 | const std::chrono::system_clock::time_point ×tamp
13 | );
14 |
15 | std::string timeToString( //
16 | const std::chrono::system_clock::time_point ×tamp
17 | );
18 |
19 | std::string durationToString(const std::chrono::milliseconds &dur);
20 |
21 | std::chrono::system_clock::time_point stringToTime(const std::string &line);
22 |
23 | std::string hexDump(const std::vector &bytes, size_t columns);
24 |
25 | } // namespace Rapatas::Transmitron::Common::Helpers
26 |
--------------------------------------------------------------------------------
/resources/icons/settings.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/Common/Log.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | #include
7 |
8 | namespace Rapatas::Transmitron::Common {
9 |
10 | class Log
11 | {
12 | public:
13 |
14 | virtual ~Log();
15 | Log(const Log &other) = delete;
16 | Log(Log &&other) = delete;
17 | Log &operator=(const Log &other) = delete;
18 | Log &operator=(Log &&other) = delete;
19 |
20 | void initialize(bool verbose);
21 |
22 | static Log &instance();
23 | static std::shared_ptr create(const std::string &name);
24 |
25 | private:
26 |
27 | Log() = default;
28 |
29 | std::vector mSinks;
30 |
31 | std::shared_ptr createPrivate(const std::string &name);
32 | };
33 |
34 | } // namespace Rapatas::Transmitron::Common
35 |
--------------------------------------------------------------------------------
/src/GUI/Types/ClientOptions.cpp:
--------------------------------------------------------------------------------
1 | #include "ClientOptions.hpp"
2 |
3 | #include "Common/Extract.hpp"
4 | #include "GUI/Models/Layouts.hpp"
5 |
6 | using namespace Rapatas::Transmitron;
7 | using namespace GUI::Types;
8 |
9 | ClientOptions::ClientOptions(std::string layout) :
10 | mLayout(std::move(layout)) //
11 | {}
12 |
13 | ClientOptions ClientOptions::fromJson(const nlohmann::json &data) {
14 | using namespace Common;
15 |
16 | const auto layoutOpt = extract(data, "layout");
17 | const auto layout = layoutOpt.value_or(
18 | std::string(Models::Layouts::DefaultName)
19 | );
20 |
21 | return ClientOptions{layout};
22 | }
23 |
24 | nlohmann::json ClientOptions::toJson() const { return {{"layout", mLayout}}; }
25 |
26 | std::string ClientOptions::getLayout() const { return mLayout; }
27 |
--------------------------------------------------------------------------------
/src/GUI/Notifiers/Layouts.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | namespace Rapatas::Transmitron::GUI::Notifiers {
6 |
7 | class Layouts : //
8 | public wxEvtHandler,
9 | public wxDataViewModelNotifier
10 | {
11 | public:
12 | private:
13 |
14 | // wxDataViewModelNotifier interface.
15 | bool Cleared() override;
16 | bool ItemChanged(const wxDataViewItem &item) override;
17 | void Resort() override;
18 | bool ValueChanged(const wxDataViewItem &item, unsigned int col) override;
19 | bool ItemAdded(
20 | const wxDataViewItem &parent,
21 | const wxDataViewItem &item //
22 | ) override;
23 | bool ItemDeleted(
24 | const wxDataViewItem &parent,
25 | const wxDataViewItem &item //
26 | ) override;
27 | };
28 |
29 | } // namespace Rapatas::Transmitron::GUI::Notifiers
30 |
--------------------------------------------------------------------------------
/resources/icons/palette.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/MQTT/Message.cpp:
--------------------------------------------------------------------------------
1 | #include "Message.hpp"
2 |
3 | #include "Common/Extract.hpp"
4 |
5 | using namespace Rapatas::Transmitron;
6 | using namespace MQTT;
7 |
8 | Message Message::fromJson(const nlohmann::json &data) {
9 | Message result;
10 |
11 | auto iqos = Common::extract(data, "qos").value_or(0);
12 | if (iqos > 2) { iqos = 0; }
13 |
14 | result.topic = Common::extract(data, "topic").value_or("");
15 | result.payload = Common::extract(data, "payload").value_or("");
16 | result.qos = static_cast(iqos);
17 | result.retained = Common::extract(data, "retained").value_or(false);
18 |
19 | return result;
20 | }
21 |
22 | nlohmann::json Message::toJson() const {
23 | return {
24 | {"topic", topic},
25 | {"payload", payload},
26 | {"qos", qos},
27 | {"retained", retained},
28 | };
29 | }
30 |
--------------------------------------------------------------------------------
/src/Common/Extract.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include
6 |
7 | namespace Rapatas::Transmitron::Common {
8 |
9 | template
10 | std::optional extract(const nlohmann::json &data, const std::string &key);
11 |
12 | template <>
13 | std::optional extract(
14 | const nlohmann::json &data,
15 | const std::string &key
16 | );
17 |
18 | template <>
19 | std::optional extract(
20 | const nlohmann::json &data,
21 | const std::string &key
22 | );
23 |
24 | template <>
25 | std::optional extract(
26 | const nlohmann::json &data,
27 | const std::string &key
28 | );
29 |
30 | template <>
31 | std::optional extract(
32 | const nlohmann::json &data,
33 | const std::string &key
34 | );
35 |
36 | } // namespace Rapatas::Transmitron::Common
37 |
--------------------------------------------------------------------------------
/src/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | #include "Arguments.hpp"
5 | #include "GUI/App.hpp"
6 |
7 | using namespace Rapatas::Transmitron;
8 |
9 | int main(int argc, char **argv) {
10 | try {
11 | const auto args = Arguments::handleArgs(argc, argv);
12 | if (args.exit) { return 0; }
13 |
14 | auto *app = new GUI::App(args.verbose);
15 | wxApp::SetInstance(app);
16 | wxEntryStart(argc, argv);
17 | app->CallOnInit();
18 |
19 | if (!args.profileName.empty()) {
20 | app->openProfile(args.profileName);
21 | } else if (!args.recordingFile.empty()) {
22 | app->openRecording(args.recordingFile);
23 | }
24 |
25 | app->OnRun();
26 | app->OnExit();
27 | wxEntryCleanup();
28 | } catch (const std::exception &error) {
29 | fmt::print("{}\n", error.what());
30 | return EXIT_FAILURE;
31 | }
32 |
33 | return EXIT_SUCCESS;
34 | }
35 |
--------------------------------------------------------------------------------
/docker/windows-x86-64/compiler/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ubuntu:24.04
2 |
3 | USER root
4 | WORKDIR /workspace
5 | ENV DEBIAN_FRONTEND=noninteractive
6 |
7 | RUN apt-get update
8 |
9 | COPY ./cmake-installer.sh /workspace
10 | RUN /workspace/cmake-installer.sh
11 |
12 | RUN true \
13 | && apt-get update \
14 | && apt-get install -y \
15 | mingw-w64 \
16 | git \
17 | nsis
18 |
19 | ENV PATH="${PATH}:/root/.local/bin"
20 | RUN true \
21 | && apt-get install -y python3 pipx \
22 | && pipx ensurepath \
23 | && pipx install conan
24 |
25 | RUN true \
26 | && apt-get update \
27 | && apt-get install -y \
28 | curl \
29 | wget \
30 | vim \
31 | tree \
32 | unzip
33 |
34 | RUN mkdir -p /root/.conan2/profiles
35 | COPY ./default.ini /root/.conan2/profiles/default
36 | COPY ./windows.ini /root/.conan2/profiles/windows
37 |
38 | RUN echo "rapatas-transmitron-windows-x86-64" > /etc/compilername
39 |
--------------------------------------------------------------------------------
/src/GUI/Events/Profile.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | namespace Rapatas::Transmitron::GUI::Events {
7 |
8 | class Profile;
9 | wxDECLARE_EVENT(PROFILE_CREATE, Profile);
10 | wxDECLARE_EVENT(PROFILE_EDIT, Profile);
11 |
12 | // NOLINTNEXTLINE
13 | class Profile : public wxCommandEvent
14 | {
15 | public:
16 |
17 | explicit Profile(wxEventType commandType, int id = 0) :
18 | wxCommandEvent(commandType, id) //
19 | {}
20 |
21 | Profile(const Profile &event) :
22 | wxCommandEvent(event) {
23 | this->setProfile(event.getProfile());
24 | }
25 |
26 | [[nodiscard]] wxEvent *Clone() const override { return new Profile(*this); }
27 |
28 | [[nodiscard]] wxDataViewItem getProfile() const { return mProfile; }
29 |
30 | void setProfile(wxDataViewItem profile) { mProfile = profile; }
31 |
32 | private:
33 |
34 | wxDataViewItem mProfile;
35 | };
36 |
37 | } // namespace Rapatas::Transmitron::GUI::Events
38 |
--------------------------------------------------------------------------------
/resources/debian/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | if (UNIX AND NOT APPLE)
2 |
3 | set(DEB_POSTINST_PRE_CONF "${CMAKE_CURRENT_SOURCE_DIR}/postinst.in.sh")
4 | set(DEB_POSTINST_POST_CONF "${CMAKE_BINARY_DIR}/postinst")
5 | set(DEB_POSTINST_POST_CONF ${DEB_POSTINST_POST_CONF} PARENT_SCOPE)
6 | configure_file(${DEB_POSTINST_PRE_CONF} ${DEB_POSTINST_POST_CONF} @ONLY)
7 |
8 | install(CODE "
9 | include(CPack)
10 | configure_file(${DEB_POSTINST_PRE_CONF} ${DEB_POSTINST_POST_CONF} @ONLY)
11 | ")
12 |
13 | install(
14 | FILES
15 | mimetypes-transmitron.xml
16 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/mime/packages/
17 | )
18 |
19 | set(DESKTOP_PRE_CONF "${CMAKE_CURRENT_SOURCE_DIR}/transmitron.in.desktop")
20 | set(DESKTOP_POST_CONF "${CMAKE_BINARY_DIR}/transmitron.desktop")
21 | configure_file(${DESKTOP_PRE_CONF} ${DESKTOP_POST_CONF} @ONLY)
22 |
23 | install(
24 | FILES
25 | ${DESKTOP_POST_CONF}
26 | DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications
27 | )
28 |
29 | endif ()
30 |
--------------------------------------------------------------------------------
/src/transmitron.in.rc:
--------------------------------------------------------------------------------
1 | APPLICATION_ICON ICON "../resources/images/transmitron.ico"
2 |
3 | 1 VERSIONINFO
4 | FILEVERSION @TRANSMITRON_VERSION_MAJOR@,@TRANSMITRON_VERSION_MINOR@,@TRANSMITRON_VERSION_PATCH@,0
5 | PRODUCTVERSION @TRANSMITRON_VERSION_MAJOR@,@TRANSMITRON_VERSION_MINOR@,@TRANSMITRON_VERSION_PATCH@,0
6 | FILEOS 0x40004
7 | FILETYPE 1
8 | BEGIN
9 | BLOCK "StringFileInfo"
10 | BEGIN
11 | BLOCK "040904b0"
12 | BEGIN
13 | VALUE "Comments", "Published under the GNU GPL-3.0"
14 | VALUE "FileDescription", "@PROGRAM_DESCRIPTION@"
15 | VALUE "FileVersion", "@TRANSMITRON_VERSION@"
16 | VALUE "InternalName", "@PROJECT_NAME@"
17 | VALUE "OriginalFilename", "@PROJECT_NAME@.exe"
18 | VALUE "ProductName", "@PROJECT_NAME@"
19 | VALUE "ProductVersion", "@TRANSMITRON_VERSION@"
20 | END
21 | END
22 | BLOCK "VarFileInfo"
23 | BEGIN
24 | VALUE "Translation", 0x409, 1200
25 | END
26 | END
27 |
28 | #include "wx/msw/wx.rc"
29 |
--------------------------------------------------------------------------------
/docker/linux-x86-64/release/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM rapatas-transmitron-linux-x86-64
2 |
3 | RUN true \
4 | && mkdir wxWidgets \
5 | && cd wxWidgets \
6 | && wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.6/wxWidgets-3.2.6.zip \
7 | && unzip *.zip \
8 | && mkdir buildgtk \
9 | && cd buildgtk \
10 | && ../configure \
11 | --with-gtk \
12 | --disable-mediactrl \
13 | --disable-webview \
14 | --without-libtiff \
15 | --disable-shared \
16 | --enable-stl \
17 | && make -j $(nproc) \
18 | && make install \
19 | && cd /workspace \
20 | && rm -rf *
21 |
22 | COPY ./conanfile.py /workspace
23 | RUN true \
24 | && sed -i '/build_type/s/=.*$/=Release/' /root/.conan2/profiles/default \
25 | && conan install . --build=missing \
26 | && rm -rf *
27 |
28 | RUN true \
29 | && apt-get install -y git \
30 | && git config --global --add safe.directory /workspace
31 |
32 | RUN echo "rapatas-transmitron-linux-x86-64-release" > /etc/compilername
33 | COPY ./macro-make /usr/local/bin
34 |
--------------------------------------------------------------------------------
/docker/linux-x86-64/debug/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM rapatas-transmitron-linux-x86-64
2 |
3 | RUN true \
4 | && mkdir wxWidgets \
5 | && cd wxWidgets \
6 | && wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.6/wxWidgets-3.2.6.zip \
7 | && unzip *.zip \
8 | && mkdir buildgtk \
9 | && cd buildgtk \
10 | && ../configure \
11 | --with-gtk \
12 | --disable-mediactrl \
13 | --disable-webview \
14 | --without-libtiff \
15 | --disable-shared \
16 | --enable-stl \
17 | --enable-debug \
18 | && make -j $(nproc) \
19 | && make install \
20 | && cd /workspace \
21 | && rm -rf *
22 |
23 | COPY ./conanfile.py /workspace
24 | RUN true \
25 | && sed -i '/build_type/s/=.*$/=Debug/' /root/.conan2/profiles/default \
26 | && conan install . --build=missing \
27 | && rm -rf *
28 |
29 | RUN true \
30 | && apt-get install -y git \
31 | && git config --global --add safe.directory /workspace
32 |
33 | RUN echo "rapatas-transmitron-linux-x86-64-debug" > /etc/compilername
34 | COPY ./macro-make /usr/local/bin
35 |
--------------------------------------------------------------------------------
/src/GUI/Resources/qos/qos-2.cpp:
--------------------------------------------------------------------------------
1 | #include "qos-2.hpp"
2 | #include
3 | #include
4 | #include
5 |
6 | const wxBitmap *bin2cQos2()
7 | {
8 | constexpr size_t Length = 285;
9 | static wxMemoryInputStream mistream("\211PNG\15\12\32\12\0\0\0\15IHDR\0\0\0\12\0\0\0\24\10\6\0\0\0\264\356\254V\0\0\0\6bKGD\0\377\0\377\0\377\240\275\247\223\0\0\0\11pHYs\0\0\13\23\0\0\13\23\1\0\232\234\30\0\0\0\7tIME\7\345\1\36\7\16;-<\373\242\0\0\0\252IDAT(\317\225\3231\12\2A\14\5\320\267\203`%\336\301^\20\354\354\4\355<\203g\20<\217g\261\23-\204\355<\202\7\260TX\233\250\213\350\356\354\20743\311\344\377\374L\341\203>\226\230\241\302\36'\334j9\306qX}\3051\356\336/\375Jz\305\5CX5$U\270c\233\202S\23z\230\244\250jE\12uMx\340\14\203P\367\217\3435\4\277\307s\11\342u\21W\214\240\250\265\30`]\233[\211]\24H:\242\265u'1\213\14g6\11\363\14g\246\351Ky\2433\207\14g\312Nk\226\265\270E\356Wx\2`\313Z\27\260\311\224A\0\0\0\0IEND\256B`\202", Length);
10 | static const wxBitmap *bitmap = new wxBitmap(wxImage(mistream, wxBITMAP_TYPE_ANY), -1);
11 | return bitmap;
12 | }
13 |
--------------------------------------------------------------------------------
/src/GUI/Resources/messages/messages-18x14.cpp:
--------------------------------------------------------------------------------
1 | #include "messages-18x14.hpp"
2 | #include
3 | #include
4 | #include
5 |
6 | const wxBitmap *bin2cMessages18x14()
7 | {
8 | constexpr size_t Length = 266;
9 | static wxMemoryInputStream mistream("\211PNG\15\12\32\12\0\0\0\15IHDR\0\0\0\22\0\0\0\16\10\6\0\0\0\"\332L\267\0\0\0\6bKGD\0\377\0\377\0\377\240\275\247\223\0\0\0\11pHYs\0\0\3\357\0\0\3\357\1\347?\364\24\0\0\0\7tIME\7\345\2\15\7)\26\267*\227\23\0\0\0\227IDAT(\317\315\320\261\11\302P\20\207\361_$8\200\301\306\306\21\34\300i\\\307%\34#\240\215\205V\331\302V\254\15\242h\363\204\370H\36\2116~\360o\356\270\217\273\343\223\12\317\236\251\232\203Y$*0\326\217\33.m\215\3j\\{\246\0163 o\210\326\230\206\265\373\220\341\34\213\226X\30\316,\234w|\27v\3\236\34g\13\243 \272\373\236GS\24\263\301\274#\233\266\201\274C\264\307)\321[\305\305\256\215\212\304)\223\324\235\345\17\317.S\33\15\346\377D/\313\27E$\23%1h\0\0\0\0IEND\256B`\202", Length);
10 | static const wxBitmap *bitmap = new wxBitmap(wxImage(mistream, wxBITMAP_TYPE_ANY), -1);
11 | return bitmap;
12 | }
13 |
--------------------------------------------------------------------------------
/docker/windows-x86-64/release/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM rapatas-transmitron-windows-x86-64
2 |
3 | RUN true \
4 | && mkdir wxWidgets \
5 | && cd wxWidgets \
6 | && wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.6/wxWidgets-3.2.6.zip \
7 | && unzip *.zip \
8 | && mkdir buildwin \
9 | && cd buildwin \
10 | && ../configure \
11 | --prefix=/usr/x86_64-w64-mingw32 \
12 | --host=x86_64-w64-mingw32 \
13 | --build=x86_64-linux \
14 | --disable-mediactrl \
15 | --disable-webview \
16 | --without-libtiff \
17 | --disable-shared \
18 | --enable-stl \
19 | && make -j $(nproc) \
20 | && make install \
21 | && cd /workspace \
22 | && rm -rf *
23 |
24 | COPY ./conanfile.py /workspace
25 | RUN true \
26 | && sed -i '/build_type/s/=.*$/=Release/' /root/.conan2/profiles/windows \
27 | && conan install /workspace --build=missing --profile:build=default --profile:host=windows
28 |
29 | RUN true \
30 | && apt-get install -y git \
31 | && git config --global --add safe.directory /workspace
32 |
33 | RUN echo "rapatas-transmitron-windows-x86-64-release" > /etc/compilername
34 | COPY ./macro-make /usr/local/bin
35 |
--------------------------------------------------------------------------------
/src/Common/String.cpp:
--------------------------------------------------------------------------------
1 | #include "String.hpp"
2 |
3 | #include
4 | #include
5 |
6 | using namespace Rapatas::Transmitron::Common;
7 |
8 | std::vector String::split(const std::string &data, char delim) {
9 | const size_t segments = 0U //
10 | + (data.empty() ? 1U : 0U)
11 | + static_cast(std::count_if(
12 | std::begin(data),
13 | std::end(data),
14 | [&](char value) { return value == delim; }
15 | ));
16 |
17 | std::vector result;
18 | result.reserve(segments);
19 |
20 | std::stringstream sstream(data);
21 | std::string segment;
22 | while (std::getline(sstream, segment, delim)) { result.push_back(segment); }
23 |
24 | return result;
25 | }
26 |
27 | std::string String::replace(
28 | const std::string &str,
29 | const std::string &what,
30 | const std::string &with
31 | ) {
32 | if (what.empty()) { return str; }
33 | auto result = str;
34 | size_t start = 0;
35 | while ((start = result.find(what, start)) != std::string::npos) {
36 | result.replace(start, what.length(), with);
37 | start += with.length();
38 | }
39 | return result;
40 | }
41 |
--------------------------------------------------------------------------------
/src/GUI/Resources/subscription/subscription-18x14.cpp:
--------------------------------------------------------------------------------
1 | #include "subscription-18x14.hpp"
2 | #include
3 | #include
4 | #include
5 |
6 | const wxBitmap *bin2cSubscription18x14()
7 | {
8 | constexpr size_t Length = 305;
9 | static wxMemoryInputStream mistream("\211PNG\15\12\32\12\0\0\0\15IHDR\0\0\0\22\0\0\0\16\10\6\0\0\0\"\332L\267\0\0\0\6bKGD\0\377\0\377\0\377\240\275\247\223\0\0\0\11pHYs\0\0\3\261\0\0\3\261\1\365\203\355I\0\0\0\7tIME\7\345\2\15\10,\5E\277e\265\0\0\0\276IDAT(\317\235\3221N\2A\24\306\361\37\13\215\24$\320\31\16\240\241\304{\320jae\247'\240\341*\326z\36\270\2\1Kc\203\311\352R\370\226LH\\v\366K\276\314\233\314\373\376o2\31\3764\303!\352\25\252\13^E\357!\262'\275\3439\352\252\245\341\5o)\350\7Wx\310\0\335c\30YE\200\12\374\342F{\335\6\244HA#|'\3736*\"3JA_\261N2@\3434{~\203y\6\350\256\351\360#\343\261\367\377A\26\31\220\332\213s\310\0e\7P\31\331\223\326\35 \2657\22\332#\246\272i\13\275\206\206k\274\326?\27}
4 |
5 | #include
6 | #include
7 |
8 | #include "Common/Filesystem.hpp"
9 |
10 | namespace Rapatas::Transmitron::GUI {
11 |
12 | enum class Icon : uint8_t {
13 | Add,
14 | Archive,
15 | Cancel,
16 | Clear,
17 | Connect,
18 | Connected,
19 | Connecting,
20 | Copy,
21 | Delete,
22 | Disconnected,
23 | Edit,
24 | File,
25 | FileFull,
26 | Folder,
27 | History,
28 | Home,
29 | Mute,
30 | NewColor,
31 | NewDir,
32 | NewFile,
33 | NewProfile,
34 | Profile,
35 | Publish,
36 | Save,
37 | SaveAs,
38 | Search,
39 | Settings,
40 | Solo,
41 | Subscribe,
42 | Subscriptions,
43 | Unmute,
44 | Unsubscribe,
45 | };
46 |
47 | class ArtProvider
48 | {
49 | public:
50 |
51 | ArtProvider();
52 |
53 | void initialize(const Common::fs::path &base, wxSize size, bool dark);
54 |
55 | [[nodiscard]] const wxBitmap &bitmap(Icon icon) const;
56 |
57 | private:
58 |
59 | std::shared_ptr mLogger;
60 | std::map mIcons;
61 | wxBitmap mPlaceholder;
62 | };
63 |
64 | } // namespace Rapatas::Transmitron::GUI
65 |
--------------------------------------------------------------------------------
/docker/windows-x86-64/debug/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM rapatas-transmitron-windows-x86-64
2 |
3 | COPY ./conanfile.py /workspace
4 | RUN true \
5 | && sed -i '/build_type/s/=.*$/=Debug/' /root/.conan2/profiles/windows \
6 | && conan install /workspace --build=missing --profile:build=default --profile:host=windows
7 |
8 | RUN true \
9 | && mkdir wxWidgets \
10 | && cd wxWidgets \
11 | && wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.6/wxWidgets-3.2.6.zip \
12 | && unzip *.zip \
13 | && mkdir buildwin \
14 | && cd buildwin \
15 | && ../configure \
16 | --prefix=/usr/x86_64-w64-mingw32 \
17 | --host=x86_64-w64-mingw32 \
18 | --build=x86_64-linux \
19 | --disable-mediactrl \
20 | --disable-webview \
21 | --without-libtiff \
22 | --disable-shared \
23 | --enable-stl \
24 | --enable-debug \
25 | && make -j $(nproc) \
26 | && make install \
27 | && cd /workspace \
28 | && rm -rf *
29 |
30 | RUN true \
31 | && apt-get install -y git \
32 | && git config --global --add safe.directory /workspace
33 |
34 | RUN echo "rapatas-transmitron-windows-x86-64-debug" > /etc/compilername
35 | COPY ./macro-make /usr/local/bin
36 |
--------------------------------------------------------------------------------
/src/GUI/Events/Connection.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | namespace Rapatas::Transmitron::GUI::Events {
7 |
8 | class Connection;
9 | wxDECLARE_EVENT(CONNECTION_REQUESTED, Connection);
10 | wxDECLARE_EVENT(CONNECTION_CONNECTED, Connection);
11 | wxDECLARE_EVENT(CONNECTION_DISCONNECTED, Connection);
12 | wxDECLARE_EVENT(CONNECTION_FAILURE, Connection);
13 | wxDECLARE_EVENT(CONNECTION_LOST, Connection);
14 |
15 | // NOLINTNEXTLINE
16 | class Connection : public wxCommandEvent
17 | {
18 | public:
19 |
20 | explicit Connection(wxEventType commandType, int id = 0) :
21 | wxCommandEvent(commandType, id) {}
22 |
23 | Connection(const Connection &event) :
24 | wxCommandEvent(event) //
25 | {
26 | this->setProfile(event.getProfile());
27 | }
28 |
29 | [[nodiscard]] wxEvent *Clone() const override {
30 | return new Connection(*this);
31 | }
32 |
33 | [[nodiscard]] wxDataViewItem getProfile() const { return mProfile; }
34 |
35 | void setProfile(wxDataViewItem profile) { mProfile = profile; }
36 |
37 | private:
38 |
39 | wxDataViewItem mProfile;
40 | };
41 |
42 | } // namespace Rapatas::Transmitron::GUI::Events
43 |
--------------------------------------------------------------------------------
/conan/conanfile.py:
--------------------------------------------------------------------------------
1 | from conan import ConanFile
2 | from conan.tools.cmake import CMakeDeps, CMake, CMakeToolchain, cmake_layout
3 |
4 | class TransmitronConan(ConanFile):
5 |
6 | name = "Transmitron"
7 | version = "0.0.4"
8 | settings = [
9 | "os",
10 | "compiler",
11 | "build_type",
12 | "arch"
13 | ]
14 | url = "https://github.com/Rapatas/transmitron"
15 | license = "GPL3"
16 | description = "MQTT client for desktop"
17 |
18 | options = {
19 | "shared": [True, False]
20 | }
21 |
22 | default_options = {
23 | "shared": False,
24 | "openssl/*:no_zlib": True,
25 | }
26 |
27 | def requirements(self):
28 | self.requires("paho-mqtt-cpp/1.4.0")
29 | self.requires("nlohmann_json/3.11.3")
30 | self.requires("tinyxml2/10.0.0")
31 | self.requires("fmt/11.0.2", force=True)
32 | self.requires("spdlog/1.14.1")
33 | self.requires("cli11/2.4.2")
34 | self.requires("date/3.0.3")
35 |
36 | def generate(self):
37 | cmake = CMakeDeps(self)
38 | cmake.generate()
39 | cmake = CMakeToolchain(self)
40 | cmake.generate()
41 |
--------------------------------------------------------------------------------
/src/GUI/Events/Recording.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 | #include
5 |
6 | namespace Rapatas::Transmitron::GUI::Events {
7 |
8 | class Recording;
9 | wxDECLARE_EVENT(RECORDING_SAVE, Recording);
10 | wxDECLARE_EVENT(RECORDING_OPEN, Recording);
11 |
12 | // NOLINTNEXTLINE
13 | class Recording : public wxCommandEvent
14 | {
15 | public:
16 |
17 | explicit Recording(wxEventType commandType, int id = 0) :
18 | wxCommandEvent(commandType, id) //
19 | {}
20 |
21 | Recording(const Recording &event) :
22 | wxCommandEvent(event) {
23 | this->setContents(event.getContents());
24 | this->setName(event.getName());
25 | }
26 |
27 | [[nodiscard]] wxEvent *Clone() const override { return new Recording(*this); }
28 |
29 | [[nodiscard]] std::string getContents() const { return mContents; }
30 |
31 | void setContents(const std::string &contents) { mContents = contents; }
32 |
33 | [[nodiscard]] wxString getName() const { return mName; }
34 |
35 | void setName(const wxString &name) { mName = name; }
36 |
37 | private:
38 |
39 | std::string mContents;
40 | wxString mName;
41 | };
42 |
43 | } // namespace Rapatas::Transmitron::GUI::Events
44 |
--------------------------------------------------------------------------------
/src/GUI/Resources/preview/preview-18x14.cpp:
--------------------------------------------------------------------------------
1 | #include "preview-18x14.hpp"
2 | #include
3 | #include
4 | #include
5 |
6 | const wxBitmap *bin2cPreview18x14()
7 | {
8 | constexpr size_t Length = 319;
9 | static wxMemoryInputStream mistream("\211PNG\15\12\32\12\0\0\0\15IHDR\0\0\0\22\0\0\0\16\10\6\0\0\0\"\332L\267\0\0\0\6bKGD\0\377\0\377\0\377\240\275\247\223\0\0\0\11pHYs\0\0\3\261\0\0\3\261\1\365\203\355I\0\0\0\7tIME\7\345\2\15\7\"1\361\324\373\263\0\0\0\314IDAT(\317\245\322\261JCA\20\5\320\23_ \6-L\227.`a\221\302\306*\275\205\340\27$\26\371\267@\364\7\202\376\202\255\205\245h\33,\254\224\210\304g\363B\226Gfy\301\13\303\262s\231;\263;\227-\306\370B\31\304\2C\34\332\201\203\344\234\241+F\211\1\236rB-\2545\303\31\236#\241&(\253\206\252'\276\244\344\206(\360\211NFh\211>\316\223\2327|\354+\4\337xL\356?\270J\277\245\300*\263\261(VU\255v\320y\216\273\200\33\343\246\236\214\204Nq\235\341\374gkYD\23\275\342>\340N0j*t\211^\300]\3543\321\3n\3n\202i=\31\371\350\275\346\334\337\312\210\307;|u\204\365\37t{2\340-di\364\0\0\0\0IEND\256B`\202", Length);
10 | static const wxBitmap *bitmap = new wxBitmap(wxImage(mistream, wxBITMAP_TYPE_ANY), -1);
11 | return bitmap;
12 | }
13 |
--------------------------------------------------------------------------------
/src/GUI/Resources/send/send-18x14.cpp:
--------------------------------------------------------------------------------
1 | #include "send-18x14.hpp"
2 | #include
3 | #include
4 | #include
5 |
6 | const wxBitmap *bin2cSend18x14()
7 | {
8 | constexpr size_t Length = 321;
9 | static wxMemoryInputStream mistream("\211PNG\15\12\32\12\0\0\0\15IHDR\0\0\0\22\0\0\0\16\10\4\0\0\0\210\323\204<\0\0\0\2bKGD\0\377\207\217\314\277\0\0\0\11pHYs\0\0\13\23\0\0\13\23\1\0\232\234\30\0\0\0\7tIME\7\345\2\15\7/\31q\317-\4\0\0\0\322IDAT(\317u\321\261.\4Q\24\6\340oY;\211Y\211\214\331b%\204R\357\0114\364\22\225\25\321\350\24\274\202\27\21\255B\241Sx\0\275l\224\250HV\245\220\25G1\273v2;{\222\333}\271\347\277\377e_\10a\340\301\236\31\223\373\34\261\20\372v$\323\250\345\272\204Bxt\254[e=\303\12\13\317.\245e\264\341e\12\205\360\345Ls\302n\375\324\262\360dW\253\0016mY\220H\245\332\243\223Z\325\265f\321Mq\335\267\206\266L.\227\313\254\310t4\315\231G\24\353\356f,\373\365\352\244 \353\336jI\337\205\345q\354\303\232\330\357\216d\223\227%\2252\207>\234W\253\354\30\2242\334;-w3\236\203\177re\333R\335\367\376\1\242~x\273v$?S\0\0\0\0IEND\256B`\202", Length);
10 | static const wxBitmap *bitmap = new wxBitmap(wxImage(mistream, wxBITMAP_TYPE_ANY), -1);
11 | return bitmap;
12 | }
13 |
--------------------------------------------------------------------------------
/src/Common/XdgBaseDir.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include "Common/Filesystem.hpp"
6 |
7 | namespace Rapatas::Transmitron::Common {
8 |
9 | class XdgBaseDir
10 | {
11 | public:
12 |
13 | static Common::fs::path configHome();
14 | static Common::fs::path cacheHome();
15 | static Common::fs::path dataHome();
16 | static Common::fs::path stateHome();
17 | static std::vector dataDirs();
18 | static std::vector configDirs();
19 |
20 | private:
21 |
22 | static XdgBaseDir &instance();
23 | XdgBaseDir();
24 |
25 | Common::fs::path mHome;
26 | Common::fs::path mConfigHome;
27 | Common::fs::path mCacheHome;
28 | Common::fs::path mDataHome;
29 | Common::fs::path mStateHome;
30 | std::vector mDataDirs;
31 | std::vector mConfigDirs;
32 |
33 | static std::string readHome();
34 | std::string readConfigHome();
35 | std::string readDataHome();
36 | std::string readCacheHome();
37 | std::string readStateHome();
38 |
39 | [[nodiscard]] std::vector readDataDirs() const;
40 | [[nodiscard]] std::vector readConfigDirs() const;
41 | };
42 |
43 | } // namespace Rapatas::Transmitron::Common
44 |
--------------------------------------------------------------------------------
/src/GUI/Resources/qos/qos-0.cpp:
--------------------------------------------------------------------------------
1 | #include "qos-0.hpp"
2 | #include
3 | #include
4 | #include
5 |
6 | const wxBitmap *bin2cQos0()
7 | {
8 | constexpr size_t Length = 333;
9 | static wxMemoryInputStream mistream("\211PNG\15\12\32\12\0\0\0\15IHDR\0\0\0\12\0\0\0\24\10\6\0\0\0\264\356\254V\0\0\0\6bKGD\0\377\0\377\0\377\240\275\247\223\0\0\0\11pHYs\0\0\13\23\0\0\13\23\1\0\232\234\30\0\0\0\7tIME\7\345\1\36\7\16\30\217[\212\320\0\0\0\332IDAT(\317\225\323\275JCA\20\305\361\337]\13\13\11\276\203\220\322\17\0041\305\255\204t>\203\357 \276\216\317b%($\220\3044\201\0246\26\351\5\33\321\330\234\304\240\27\275\231jw\347\277g\346,\263\225\357\330E\0375\226\270\303#^7\30\207\30\343-\311\207\300\203\344\326J\343\34\326\350`\17=
4 | #include
5 |
6 | namespace Rapatas::Transmitron::GUI::Events {
7 |
8 | class Layout;
9 | wxDECLARE_EVENT(LAYOUT_SELECTED, Layout);
10 | wxDECLARE_EVENT(LAYOUT_ADDED, Layout);
11 | wxDECLARE_EVENT(LAYOUT_REMOVED, Layout);
12 | wxDECLARE_EVENT(LAYOUT_CHANGED, Layout);
13 | wxDECLARE_EVENT(LAYOUT_RESIZED, Layout);
14 |
15 | // NOLINTNEXTLINE
16 | class Layout : public wxCommandEvent
17 | {
18 | public:
19 |
20 | explicit Layout(wxEventType commandType, int id = 0) :
21 | wxCommandEvent(commandType, id) //
22 | {}
23 |
24 | Layout(const Layout &event) :
25 | wxCommandEvent(event) {}
26 |
27 | [[nodiscard]] wxEvent *Clone() const override { return new Layout(*this); }
28 |
29 | void setPerspective(std::string perspective) {
30 | mPerspective = std::move(perspective);
31 | }
32 |
33 | [[nodiscard]] std::string getPerspective() const { return mPerspective; }
34 |
35 | [[nodiscard]] wxDataViewItem getItem() const { return mItem; }
36 |
37 | void setItem(wxDataViewItem item) { mItem = item; }
38 |
39 | private:
40 |
41 | wxDataViewItem mItem;
42 | std::string mPerspective;
43 | };
44 |
45 | } // namespace Rapatas::Transmitron::GUI::Events
46 |
--------------------------------------------------------------------------------
/src/GUI/Notifiers/Layouts.cpp:
--------------------------------------------------------------------------------
1 | #include "Layouts.hpp"
2 |
3 | #include "GUI/Events/Layout.hpp"
4 |
5 | using namespace Rapatas::Transmitron;
6 | using namespace GUI::Notifiers;
7 | using namespace GUI;
8 |
9 | // wxDataViewModelNotifier interface {
10 |
11 | bool Layouts::Cleared() { return true; }
12 |
13 | bool Layouts::ItemChanged(const wxDataViewItem &item) {
14 | auto *event = new Events::Layout(Events::LAYOUT_CHANGED);
15 | event->setItem(item);
16 | wxQueueEvent(this, event);
17 | return true;
18 | }
19 |
20 | void Layouts::Resort() {}
21 |
22 | bool Layouts::ValueChanged(
23 | const wxDataViewItem & /* item */,
24 | unsigned int /* col */
25 | ) {
26 | return true;
27 | }
28 |
29 | bool Layouts::ItemAdded(
30 | const wxDataViewItem & /* parent */,
31 | const wxDataViewItem &item
32 | ) {
33 | auto *event = new Events::Layout(Events::LAYOUT_ADDED);
34 | event->setItem(item);
35 | wxQueueEvent(this, event);
36 | return true;
37 | }
38 |
39 | bool Layouts::ItemDeleted(
40 | const wxDataViewItem & /* parent */,
41 | const wxDataViewItem & /* item */
42 | ) {
43 | auto *event = new Events::Layout(Events::LAYOUT_REMOVED);
44 | wxQueueEvent(this, event);
45 | return true;
46 | }
47 |
48 | // wxDataViewModelNotifier interface }
49 |
--------------------------------------------------------------------------------
/docs/build.md:
--------------------------------------------------------------------------------
1 | # Build
2 |
3 | The recommended build method is to use the provided docker images for [linux](../docker/linux-x86-64) and [windows](../docker/windows-x86-64).
4 | The debug and release variants will bake the dependencies in the docker image.
5 |
6 | ## Linux
7 |
8 | ```bash
9 | git clone https://github.com/Rapatas/transmitron.git
10 | cd transmitron
11 | ./docker/linux-x86-64/compiler/build-image.sh
12 | ./docker/linux-x86-64/release/build-image.sh
13 | docker run --rm -it -v $PWD:/workspace rapatas-transmitron-linux-x86-64-release bash
14 | ```
15 |
16 | Then, in the container:
17 |
18 | ```bash
19 | macro-make
20 | cd build-rapatas-transmitron-linux-x86-64-release
21 | cpack
22 | ```
23 |
24 | ## Windows
25 |
26 | **Transmitron is cross-compiled from Linux to windows. You will need a Linux
27 | host to run this image.**
28 |
29 | ```bash
30 | git clone https://github.com/Rapatas/transmitron.git
31 | cd transmitron
32 | ./docker/windows-x86-64/compiler/build-image.sh
33 | ./docker/windows-x86-64/release/build-image.sh
34 | docker run --rm -it -v $PWD:/workspace rapatas-transmitron-windows-x86-64-release bash
35 | ```
36 |
37 | Then, in the container:
38 |
39 | ```bash
40 | macro-make
41 | cd build-rapatas-transmitron-windows-x86-64-release
42 | cpack
43 | ```
44 |
--------------------------------------------------------------------------------
/src/GUI/Resources/pin/pinned-18x18.cpp:
--------------------------------------------------------------------------------
1 | #include "pinned-18x18.hpp"
2 | #include
3 | #include
4 | #include
5 |
6 | const wxBitmap *bin2cPinned18x18()
7 | {
8 | constexpr size_t Length = 337;
9 | static wxMemoryInputStream mistream("\211PNG\15\12\32\12\0\0\0\15IHDR\0\0\0\22\0\0\0\22\10\6\0\0\0V\316\216W\0\0\0\6bKGD\0\377\0\377\0\377\240\275\247\223\0\0\0\11pHYs\0\0\13\23\0\0\13\23\1\0\232\234\30\0\0\0\7tIME\7\345\1\21\11\4\22\307\234\266\30\0\0\0\336IDAT8\313\245\322?K\202A\34\7\360\217\231\344\330\346\324\322\356\32\15\201\21MbB.\21\265\6\275\207\206\336\220\270\204.-\22\251\203\4\265\365\32\202hh\315ly\202\207\303\347\361\36\237\37\334pw\334\347\276\367\247*\276jx\3047\336\225\2506\226X\240[\6\272K\240\377\326\333\24z\11\240\5\316\212\0;\230\6\310F\311\236s\220%~\321\255\4\213\366p\200}|\340\26\207\21\233\315\323\235\36\276\326\354\236no\270\307)\266\323\320C\1d\222\27\257\212a\4\362\204z\314\345\16r\220Y\321?\223\365\3347Y\13\266V\214u\320\304x\305\\#6\311e\362/Z\250`\24$:\217A:\370\301u0\336O\220O\354\306&9\3168\376\30\27\353\220\223$\311\225\222\365\212\243\262\310\37'\201`\310U\216(\351\0\0\0\0IEND\256B`\202", Length);
10 | static const wxBitmap *bitmap = new wxBitmap(wxImage(mistream, wxBITMAP_TYPE_ANY), -1);
11 | return bitmap;
12 | }
13 |
--------------------------------------------------------------------------------
/src/Arguments.cpp:
--------------------------------------------------------------------------------
1 | #include "Arguments.hpp"
2 |
3 | #include
4 | #include
5 |
6 | #include "Common/Info.hpp"
7 | #include "Common/Version.hpp"
8 |
9 | using namespace Rapatas::Transmitron;
10 |
11 | Arguments Arguments::handleArgs(int argc, char **argv) {
12 | const auto projectInfo = fmt::format(
13 | "{} {}",
14 | Common::Info::getProjectName(),
15 | Common::Info::getProjectVersion()
16 | );
17 |
18 | CLI::App args;
19 |
20 | Arguments result;
21 | result.argc = argc;
22 | result.argv = argv;
23 |
24 | // NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
25 | auto *versionOpt = args.set_version_flag("--version", projectInfo);
26 | (void)versionOpt;
27 |
28 | auto *verboseOpt = args.add_flag("--verbose", "Print logs");
29 |
30 | args.add_option("--profile", result.profileName, "Profile to launch");
31 |
32 | auto *recordingFileOpt = args.add_option(
33 | "recording,--recording",
34 | result.recordingFile,
35 | "History recording file to load"
36 | );
37 | recordingFileOpt->option_text(".TMRC");
38 |
39 | try {
40 | args.parse(argc, argv);
41 | } catch (const CLI::ParseError &event) {
42 | args.exit(event);
43 | result.exit = true;
44 | }
45 |
46 | result.verbose = !verboseOpt->empty();
47 |
48 | return result;
49 | }
50 |
--------------------------------------------------------------------------------
/src/GUI/Resources/qos/qos-1.cpp:
--------------------------------------------------------------------------------
1 | #include "qos-1.hpp"
2 | #include
3 | #include
4 | #include
5 |
6 | const wxBitmap *bin2cQos1()
7 | {
8 | constexpr size_t Length = 362;
9 | static wxMemoryInputStream mistream("\211PNG\15\12\32\12\0\0\0\15IHDR\0\0\0\12\0\0\0\24\10\6\0\0\0\264\356\254V\0\0\0\6bKGD\0\377\0\377\0\377\240\275\247\223\0\0\0\11pHYs\0\0\13\23\0\0\13\23\1\0\232\234\30\0\0\0\7tIME\7\345\1\36\7\16,\256\357~e\0\0\0\367IDAT(\317\205\323=J\3A\30\306\361\337.\201\24\22\274\203\2202\10\212\20d\33\301t\236\3013(^\307\263h\247\221\4\2146\11X\330\10I\37\260\211\2726\357\304\260\216\361\201awg\376\363\274\37;S\370Q\33\3T\250q\203!\226\33\214\36&x\217\305\373\200G\261\266v\232\304d\205\16v\320\307+f\330\205\263p\252\374V7\234\257\312\0\236\361\224\1_\"\332Q\31;j|\311\3533\275\14\2\354g\240\375\0/E\362\243H\274\333\200\336\260\210\202\327\355\231\205\363#\306\341\264\300\36\24\33\16\35\234\343 \276\307\270\306\12Z\231\274V\361\254s\225\3650\15(ua\205y\12\235B\0167\200\346\230\247bN\267@\311\371\242\304\211\355j\341\260lT\376\247J\334\375\303|\304\377\326\306\303\226\34\247\351\230\245\366\344\340a:\270E\346*\34\7t\33\233\227\360\15\333\240T\353M\343\351\5\0\0\0\0IEND\256B`\202", Length);
10 | static const wxBitmap *bitmap = new wxBitmap(wxImage(mistream, wxBITMAP_TYPE_ANY), -1);
11 | return bitmap;
12 | }
13 |
--------------------------------------------------------------------------------
/src/GUI/Events/Subscription.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include
4 |
5 | #include "MQTT/Message.hpp"
6 | #include "MQTT/Subscription.hpp"
7 |
8 | namespace Rapatas::Transmitron::GUI::Events {
9 |
10 | class Subscription;
11 | wxDECLARE_EVENT(SUBSCRIPTION_SUBSCRIBED, Subscription);
12 | wxDECLARE_EVENT(SUBSCRIPTION_UNSUBSCRIBED, Subscription);
13 | wxDECLARE_EVENT(SUBSCRIPTION_RECEIVED, Subscription);
14 |
15 | // NOLINTNEXTLINE
16 | class Subscription : public wxCommandEvent
17 | {
18 | public:
19 |
20 | explicit Subscription(wxEventType commandType, int id = 0) :
21 | wxCommandEvent(commandType, id) //
22 | {}
23 |
24 | Subscription(const Subscription &event) :
25 | wxCommandEvent(event) {
26 | this->setId(event.getSubscriptionId());
27 | this->setMessage(event.getMessage());
28 | }
29 |
30 | [[nodiscard]] wxEvent *Clone() const override {
31 | return new Subscription(*this);
32 | }
33 |
34 | [[nodiscard]] MQTT::Subscription::Id getSubscriptionId() const {
35 | return mId;
36 | }
37 |
38 | [[nodiscard]] MQTT::Message getMessage() const { return mMsg; }
39 |
40 | void setMessage(MQTT::Message msg) { mMsg = std::move(msg); }
41 |
42 | void setId(MQTT::Subscription::Id id) { mId = id; }
43 |
44 | private:
45 |
46 | MQTT::Message mMsg;
47 | MQTT::Subscription::Id mId = 0;
48 | };
49 |
50 | } // namespace Rapatas::Transmitron::GUI::Events
51 |
--------------------------------------------------------------------------------
/src/GUI/Types/Subscription.hpp:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include