mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-07 03:21:38 +12:00
[Qt] Add text editor
This commit is contained in:
parent
eb23d7eab3
commit
c57f2db6c0
8 changed files with 72 additions and 6 deletions
|
@ -13,6 +13,7 @@
|
|||
#include "panda_qt/about_window.hpp"
|
||||
#include "panda_qt/config_window.hpp"
|
||||
#include "panda_qt/screen.hpp"
|
||||
#include "panda_qt/text_editor.hpp"
|
||||
#include "services/hid.hpp"
|
||||
|
||||
class MainWindow : public QMainWindow {
|
||||
|
@ -20,9 +21,7 @@ class MainWindow : public QMainWindow {
|
|||
|
||||
private:
|
||||
// Types of messages we might send from the GUI thread to the emulator thread
|
||||
enum class MessageType {
|
||||
LoadROM, Reset, Pause, Resume, TogglePause, DumpRomFS, PressKey, ReleaseKey
|
||||
};
|
||||
enum class MessageType { LoadROM, Reset, Pause, Resume, TogglePause, DumpRomFS, PressKey, ReleaseKey };
|
||||
|
||||
// Tagged union representing our message queue messages
|
||||
struct EmulatorMessage {
|
||||
|
@ -43,7 +42,7 @@ class MainWindow : public QMainWindow {
|
|||
Emulator* emu = nullptr;
|
||||
std::thread emuThread;
|
||||
|
||||
std::atomic<bool> appRunning = true; // Is the application itself running?
|
||||
std::atomic<bool> appRunning = true; // Is the application itself running?
|
||||
// Used for synchronizing messages between the emulator and UI
|
||||
std::mutex messageQueueMutex;
|
||||
std::vector<EmulatorMessage> messageQueue;
|
||||
|
@ -51,12 +50,14 @@ class MainWindow : public QMainWindow {
|
|||
ScreenWidget screen;
|
||||
AboutWindow* aboutWindow;
|
||||
ConfigWindow* configWindow;
|
||||
TextEditorWindow* luaEditor;
|
||||
QMenuBar* menuBar = nullptr;
|
||||
|
||||
void swapEmuBuffer();
|
||||
void emuThreadMainLoop();
|
||||
void selectROM();
|
||||
void dumpRomFS();
|
||||
void openLuaEditor();
|
||||
void showAboutMenu();
|
||||
void sendMessage(const EmulatorMessage& message);
|
||||
void dispatchMessage(const EmulatorMessage& message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue