From 3bf4784c0d81d2f1c917a8cd253a4b3d37ff7331 Mon Sep 17 00:00:00 2001 From: Stepan Usatiuk Date: Tue, 24 Jun 2025 16:59:32 +0200 Subject: [PATCH] dump --- launcher/.gitignore | 80 ++++++ launcher/CMakeLists.txt | 32 +++ launcher/backend/CMakeLists.txt | 7 + .../backend/include_public/DhfsInstance.hpp | 16 ++ launcher/backend/src/DhfsInstance.cpp | 5 + launcher/gui/CMakeLists.txt | 13 + launcher/gui/src/GLauncherApp.cpp | 53 ++++ launcher/gui/src/GLauncherApp.h | 50 ++++ launcher/gui/src/LauncherApp.cpp | 33 +++ launcher/gui/src/LauncherApp.h | 17 ++ launcher/gui/src/LauncherAppMainFrame.cpp | 5 + launcher/gui/src/LauncherAppMainFrame.h | 23 ++ launcher/gui/src/launcher.fbp | 271 ++++++++++++++++++ 13 files changed, 605 insertions(+) create mode 100644 launcher/.gitignore create mode 100644 launcher/CMakeLists.txt create mode 100644 launcher/backend/CMakeLists.txt create mode 100644 launcher/backend/include_public/DhfsInstance.hpp create mode 100644 launcher/backend/src/DhfsInstance.cpp create mode 100644 launcher/gui/CMakeLists.txt create mode 100644 launcher/gui/src/GLauncherApp.cpp create mode 100644 launcher/gui/src/GLauncherApp.h create mode 100644 launcher/gui/src/LauncherApp.cpp create mode 100644 launcher/gui/src/LauncherApp.h create mode 100644 launcher/gui/src/LauncherAppMainFrame.cpp create mode 100644 launcher/gui/src/LauncherAppMainFrame.h create mode 100644 launcher/gui/src/launcher.fbp diff --git a/launcher/.gitignore b/launcher/.gitignore new file mode 100644 index 00000000..2863a0bd --- /dev/null +++ b/launcher/.gitignore @@ -0,0 +1,80 @@ +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# AWS User-specific +.idea/**/aws.xml + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ +build/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# SonarLint plugin +.idea/sonarlint/ + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + +Testing diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt new file mode 100644 index 00000000..853a2ff2 --- /dev/null +++ b/launcher/CMakeLists.txt @@ -0,0 +1,32 @@ +cmake_minimum_required(VERSION 3.10) +project(launcher) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED YES) + +if (CMAKE_BUILD_TYPE STREQUAL "Debug") +# if (NOT DEFINED SANITIZE) +# set(SANITIZE YES) +# endif () +endif () + +if (SANITIZE STREQUAL "YES") + message(STATUS "Enabling sanitizers!") + add_compile_options(-Werror -O0 -Wall -Wextra -pedantic -Wno-unused-parameter -Wno-unused-variable + -Wno-error=unused-function + -Wshadow -Wformat=2 -Wfloat-equal -D_GLIBCXX_DEBUG -Wconversion) + add_compile_options(-fsanitize=address -fno-sanitize-recover) + add_link_options(-fsanitize=address -fno-sanitize-recover) +endif () + +if (CMAKE_BUILD_TYPE STREQUAL "Release") + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) +endif () + +if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + add_compile_options(-O3) + add_link_options(-O3) +endif () + +add_subdirectory(gui) +add_subdirectory(backend) \ No newline at end of file diff --git a/launcher/backend/CMakeLists.txt b/launcher/backend/CMakeLists.txt new file mode 100644 index 00000000..b30de832 --- /dev/null +++ b/launcher/backend/CMakeLists.txt @@ -0,0 +1,7 @@ +add_library(backend + src/DhfsInstance.cpp + include_public/DhfsInstance.hpp +) + +target_include_directories(backend PRIVATE include) +target_include_directories(backend PUBLIC include_public) diff --git a/launcher/backend/include_public/DhfsInstance.hpp b/launcher/backend/include_public/DhfsInstance.hpp new file mode 100644 index 00000000..f06082ed --- /dev/null +++ b/launcher/backend/include_public/DhfsInstance.hpp @@ -0,0 +1,16 @@ +// +// Created by stepus53 on 24.6.25. +// + +#ifndef DHFSINSTANCE_HPP +#define DHFSINSTANCE_HPP + + + +class DhfsInstance { + +}; + + + +#endif //DHFSINSTANCE_HPP diff --git a/launcher/backend/src/DhfsInstance.cpp b/launcher/backend/src/DhfsInstance.cpp new file mode 100644 index 00000000..b3f12939 --- /dev/null +++ b/launcher/backend/src/DhfsInstance.cpp @@ -0,0 +1,5 @@ +// +// Created by stepus53 on 24.6.25. +// + +#include "DhfsInstance.hpp" diff --git a/launcher/gui/CMakeLists.txt b/launcher/gui/CMakeLists.txt new file mode 100644 index 00000000..615bd98e --- /dev/null +++ b/launcher/gui/CMakeLists.txt @@ -0,0 +1,13 @@ + +find_package(wxWidgets REQUIRED COMPONENTS net core base) +if (wxWidgets_USE_FILE) # not defined in CONFIG mode + include(${wxWidgets_USE_FILE}) +endif () + +add_executable(launcher + src/LauncherApp.cpp + src/GLauncherApp.cpp + src/LauncherAppMainFrame.cpp +) + +target_link_libraries(launcher ${wxWidgets_LIBRARIES}) diff --git a/launcher/gui/src/GLauncherApp.cpp b/launcher/gui/src/GLauncherApp.cpp new file mode 100644 index 00000000..b13cdf32 --- /dev/null +++ b/launcher/gui/src/GLauncherApp.cpp @@ -0,0 +1,53 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "GLauncherApp.h" + +/////////////////////////////////////////////////////////////////////////// + +MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxFrame( parent, id, title, pos, size, style, name ) +{ + this->SetSizeHints( wxSize( 100,50 ), wxDefaultSize ); + + m_statusBar1 = this->CreateStatusBar( 1, wxSTB_SIZEGRIP, wxID_ANY ); + wxBoxSizer* bSizer3; + bSizer3 = new wxBoxSizer( wxVERTICAL ); + + m_notebook1 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_panel1 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer4; + bSizer4 = new wxBoxSizer( wxVERTICAL ); + + + bSizer4->Add( 0, 8, 1, wxEXPAND, 5 ); + + wxStaticBoxSizer* sbSizer3; + sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_panel1, wxID_ANY, _("Status") ), wxVERTICAL ); + + + bSizer4->Add( sbSizer3, 1, wxEXPAND, 5 ); + + + m_panel1->SetSizer( bSizer4 ); + m_panel1->Layout(); + bSizer4->Fit( m_panel1 ); + m_notebook1->AddPage( m_panel1, _("Info"), true ); + m_panel2 = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_notebook1->AddPage( m_panel2, _("Settings"), false ); + + bSizer3->Add( m_notebook1, 1, wxEXPAND | wxALL, 5 ); + + + this->SetSizer( bSizer3 ); + this->Layout(); + + this->Centre( wxBOTH ); +} + +MainFrame::~MainFrame() +{ +} diff --git a/launcher/gui/src/GLauncherApp.h b/launcher/gui/src/GLauncherApp.h new file mode 100644 index 00000000..ce5641a4 --- /dev/null +++ b/launcher/gui/src/GLauncherApp.h @@ -0,0 +1,50 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) +// http://www.wxformbuilder.org/ +// +// PLEASE DO *NOT* EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +/// Class MainFrame +/////////////////////////////////////////////////////////////////////////////// +class MainFrame : public wxFrame +{ + private: + + protected: + wxStatusBar* m_statusBar1; + wxNotebook* m_notebook1; + wxPanel* m_panel1; + wxPanel* m_panel2; + + public: + + MainFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("DHFS"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL, const wxString& name = wxT("DHFS") ); + + ~MainFrame(); + +}; + diff --git a/launcher/gui/src/LauncherApp.cpp b/launcher/gui/src/LauncherApp.cpp new file mode 100644 index 00000000..68ab7a09 --- /dev/null +++ b/launcher/gui/src/LauncherApp.cpp @@ -0,0 +1,33 @@ +// +// Created by Stepan Usatiuk on 11.07.2024. +// + +// For compilers that don't support precompilation, include "wx/wx.h" +#include "wx/wxprec.h" + +#ifndef WX_PRECOMP +# include "wx/wx.h" +#endif + +#include "wx/notebook.h" + +#include "LauncherApp.h" + +#include "LauncherAppMainFrame.h" +#include "wx/taskbar.h" + +IMPLEMENT_APP(LauncherApp) + +// This is executed upon startup, like 'main()' in non-wxWidgets programs. +bool LauncherApp::OnInit() { + wxFrame* frame = new LauncherAppMainFrame(NULL); + frame->Show(true); + SetTopWindow(frame); + + // wxTaskBarIcon* tb = new wxTaskBarIcon(); + // auto img = new wxImage(32, 32, false); + // img->Clear(128); + // tb->SetIcon(*(new wxBitmapBundle(*(new wxBitmap(*img)))), "e"); + + return true; +} diff --git a/launcher/gui/src/LauncherApp.h b/launcher/gui/src/LauncherApp.h new file mode 100644 index 00000000..1600383c --- /dev/null +++ b/launcher/gui/src/LauncherApp.h @@ -0,0 +1,17 @@ +// +// Created by Stepan Usatiuk on 11.07.2024. +// + +#ifndef HELLOWORLDAPP_H +#define HELLOWORLDAPP_H + +// The HelloWorldApp class. This class shows a window +// containing a statusbar with the text "Hello World" +class LauncherApp : public wxApp { +public: + virtual bool OnInit(); +}; + +DECLARE_APP(LauncherApp) + +#endif //HELLOWORLDAPP_H diff --git a/launcher/gui/src/LauncherAppMainFrame.cpp b/launcher/gui/src/LauncherAppMainFrame.cpp new file mode 100644 index 00000000..8ca3d9ff --- /dev/null +++ b/launcher/gui/src/LauncherAppMainFrame.cpp @@ -0,0 +1,5 @@ +#include "LauncherAppMainFrame.h" + +LauncherAppMainFrame::LauncherAppMainFrame(wxWindow* parent) + : MainFrame(parent) { +} diff --git a/launcher/gui/src/LauncherAppMainFrame.h b/launcher/gui/src/LauncherAppMainFrame.h new file mode 100644 index 00000000..5165519e --- /dev/null +++ b/launcher/gui/src/LauncherAppMainFrame.h @@ -0,0 +1,23 @@ +#ifndef __LauncherAppMainFrame__ +#define __LauncherAppMainFrame__ + +/** +@file +Subclass of MainFrame, which is generated by wxFormBuilder. +*/ + +#include "GLauncherApp.h" + +//// end generated include + +/** Implementing MainFrame */ +class LauncherAppMainFrame : public MainFrame +{ + public: + /** Constructor */ + LauncherAppMainFrame( wxWindow* parent ); + //// end generated class members + +}; + +#endif // __LauncherAppMainFrame__ diff --git a/launcher/gui/src/launcher.fbp b/launcher/gui/src/launcher.fbp new file mode 100644 index 00000000..89db50f9 --- /dev/null +++ b/launcher/gui/src/launcher.fbp @@ -0,0 +1,271 @@ + + + + + C++ + ; + 0 + connect + none + + + 0 + 1 + res + UTF-8 + GLauncherApp + 6000 + 1 + 1 + UI + LauncherApp + . + 0 + source_name + 1 + 0 + source_name + + 1 + 1 + 1 + 0 + 0 + + 0 + wxAUI_MGR_DEFAULT + + wxBOTH + + 1 + 0 + 1 + impl_virtual + + + + 0 + wxID_ANY + + 100,50 + MainFrame + + 500,300 + wxDEFAULT_FRAME_STYLE + ; ; forward_declare + DHFS + + 0 + + DHFS + wxTAB_TRAVERSAL + 1 + + + + 1 + 0 + 1 + + 1 + + 0 + wxID_ANY + + + m_statusBar1 + protected + + + wxSTB_SIZEGRIP + ; ; forward_declare + + + + + + + + bSizer3 + wxVERTICAL + none + + 5 + wxEXPAND | wxALL + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_notebook1 + 1 + + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + + + Info + 0 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_panel1 + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + + + + Settings + 1 + + 1 + 1 + 1 + 1 + 0 + + 0 + 0 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 0 + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_panel2 + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + + + + + + +