Textractor_test/GUI/mainwindow.h

59 lines
1.6 KiB
C
Raw Normal View History

2018-12-02 08:12:45 +08:00
#pragma once
2018-07-22 06:40:16 +08:00
2018-08-23 00:24:55 +08:00
#include "qtcommon.h"
2019-02-09 13:30:38 +08:00
#include "extenwindow.h"
#include "host/host.h"
2018-07-22 06:40:16 +08:00
2018-07-24 03:25:02 +08:00
namespace Ui
{
2018-07-26 01:46:59 +08:00
class MainWindow;
2018-07-22 06:40:16 +08:00
}
class MainWindow : public QMainWindow
{
public:
2018-07-26 01:46:59 +08:00
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
2018-07-22 06:40:16 +08:00
private:
2019-02-19 12:12:12 +08:00
inline static constexpr auto HOOK_SAVE_FILE = u8"SavedHooks.txt";
inline static constexpr auto GAME_SAVE_FILE = u8"SavedGames.txt";
inline static thread_local bool ok = false;
2018-12-19 01:14:54 +08:00
void closeEvent(QCloseEvent*) override;
void ProcessConnected(DWORD processId);
void ProcessDisconnected(DWORD processId);
2019-02-05 04:18:47 +08:00
void ThreadAdded(TextThread& thread);
void ThreadRemoved(TextThread& thread);
bool SentenceReceived(TextThread& thread, std::wstring& sentence);
void OutputContextMenu(QPoint point);
2019-02-05 04:18:47 +08:00
QString TextThreadString(TextThread& thread);
ThreadParam ParseTextThreadString(QString ttString);
2018-08-23 03:11:40 +08:00
DWORD GetSelectedProcessId();
2019-09-05 00:29:48 +08:00
std::array<InfoForExtension, 10> GetSentenceInfo(TextThread& thread);
std::optional<std::wstring> UserSelectedProcess();
2018-12-19 01:14:54 +08:00
void AttachProcess();
void LaunchProcess();
2018-12-19 01:14:54 +08:00
void DetachProcess();
void ForgetProcess();
2018-12-19 01:14:54 +08:00
void AddHook();
2019-08-06 23:51:17 +08:00
void AddHook(QString hook);
2019-06-10 13:49:11 +08:00
void RemoveHooks();
2018-12-19 01:14:54 +08:00
void SaveHooks();
2019-06-02 14:09:17 +08:00
void FindHooks();
2018-12-19 01:14:54 +08:00
void Settings();
void Extensions();
void ViewThread(int index);
void SetOutputFont(QString font);
2018-07-26 12:48:18 +08:00
2018-09-02 01:56:45 +08:00
Ui::MainWindow* ui;
ExtenWindow* extenWindow;
std::unordered_set<DWORD> alreadyAttached;
bool autoAttach = false, autoAttachSavedOnly = true;
2019-08-10 16:18:30 +08:00
bool showSystemProcesses = false;
uint64_t savedThreadCtx = 0, savedThreadCtx2 = 0;
wchar_t savedThreadCode[1000] = {};
TextThread* current = nullptr;
2018-07-22 06:40:16 +08:00
};