build
ChibiOS_*
**/.*
+gui/stmdspgui
-CXX = clang++-10
-CXXFLAGS = --std=c++20 -Wall -Wextra -pedantic
+CXX = g++-10
+CXXFLAGS = --std=c++20 \
+ -Wall -Wextra -pedantic \
+ -Wno-deprecated-copy \
+ $(shell wx-config --cxxflags)
CXXFILES = $(wildcard *.cpp)
+LIBS = $(shell wx-config --libs)
OUTELF = stmdspgui
all: $(CXXFILES)
@echo " CXX " $(CXXFILES)
- @$(CXX) $(CXXFLAGS) $(CXXFILES) -o $(OUTELF)
+ @$(CXX) $(CXXFLAGS) $(CXXFILES) $(LIBS) -o $(OUTELF)
clean:
@echo " CLEAN"
#include "stmdsp.hpp"
+#include "wxapp.hpp"
#include <iostream>
+#include <wx/app.h>
-int main()
-{
- stmdsp::scanner scanner;
+wxIMPLEMENT_APP(MainApp);
- scanner.scan();
- for (const auto& device : scanner.devices())
- std::cout << "Found stmdsp at: " << device.path() << std::endl;
-
- return 0;
-}
+//int main()
+//{
+// stmdsp::scanner scanner;
+//
+// scanner.scan();
+// for (const auto& device : scanner.devices())
+// std::cout << "Found stmdsp at: " << device.path() << std::endl;
+//
+// return 0;
+//}
-#ifndef STMDSPSCANNER_H
-#define STMDSPSCANNER_H
+#ifndef STMDSP_HPP_
+#define STMDSP_HPP_
#include <fstream>
#include <set>
};
}
-#endif // STMDSPSCANNER_H
+#endif // STMDSP_HPP_
+
--- /dev/null
+#ifndef WXAPP_HPP_
+#define WXAPP_HPP_
+
+#include "wxmain.hpp"
+
+#include <wx/app.h>
+
+class MainApp : public wxApp
+{
+public:
+ virtual bool OnInit() final {
+ auto mainFrame = new MainFrame;
+ mainFrame->Show(true);
+ SetTopWindow(mainFrame);
+ return true;
+ }
+};
+
+#endif // WXAPP_HPP_
+
--- /dev/null
+#ifndef WXMAIN_HPP_
+#define WXMAIN_HPP_
+
+#include <wx/frame.h>
+#include <wx/stattext.h>
+
+class MainFrame : public wxFrame
+{
+public:
+ MainFrame() : wxFrame(nullptr, -1, "Hello world", wxPoint(50, 50), wxSize(640, 480))
+ {
+ auto lTitle = new wxStaticText(this, wxID_ANY, "Welcome to the GUI.");
+ }
+};
+
+#endif // WXMAIN_HPP_
+