Files

38 lines
818 B
C++
Raw Permalink Normal View History

2020-12-05 13:08:24 +01:00
#pragma once
2017-06-04 09:48:33 -05:00
2019-06-18 04:02:06 +02:00
#include <QCoreApplication>
2017-06-04 09:48:33 -05:00
2019-06-21 13:33:32 +02:00
#include "main_application.h"
2022-06-24 19:58:26 +02:00
#include "util/atomic.hpp"
2019-06-21 13:33:32 +02:00
2020-12-22 11:42:57 +03:00
#include <functional>
2019-08-14 20:01:55 +02:00
/** Headless RPCS3 Application Class
2019-07-11 23:11:52 +02:00
* The main point of this class is to do application initialization and initialize callbacks.
2017-06-04 09:48:33 -05:00
*/
2019-08-14 20:01:55 +02:00
class headless_application : public QCoreApplication, public main_application
2017-06-04 09:48:33 -05:00
{
Q_OBJECT
public:
2019-08-14 20:01:55 +02:00
headless_application(int& argc, char** argv);
2018-07-23 23:55:27 +02:00
2019-06-18 04:02:06 +02:00
/** Call this method before calling app.exec */
void Init() override;
2019-06-18 04:02:06 +02:00
2017-06-04 09:48:33 -05:00
private:
void InitializeCallbacks();
2021-04-07 23:05:18 +02:00
void InitializeConnects() const;
2017-06-04 09:48:33 -05:00
2019-06-18 04:02:06 +02:00
QThread* get_thread() override
{
return thread();
2021-04-07 23:05:18 +02:00
}
2017-07-14 17:10:38 +02:00
2019-06-18 04:02:06 +02:00
Q_SIGNALS:
void RequestCallFromMainThread(std::function<void()> func, atomic_t<u32>* wake_up);
2019-06-18 04:02:06 +02:00
private Q_SLOTS:
static void CallFromMainThread(const std::function<void()>& func, atomic_t<u32>* wake_up);
2017-06-04 09:48:33 -05:00
};