-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSlBrowser.h
62 lines (47 loc) · 1.42 KB
/
SlBrowser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once
#include "browser-client.hpp"
#include "browser-app.hpp"
#include <QWidget>
class SlBrowser
{
public:
void run(int argc, char *argv[]);
static void CreateCefBrowser(int arg);
static const char *getDefaultUrl() { return "https://obs-plugin.streamlabs.com"; }
bool getSavedHiddenState() const;
void saveHiddenState(const bool b) const;
bool getMainPageSuccess() const { return m_mainPageSuccess; }
bool getMainLoadingInProgress() const { return m_mainLoadingInProgress; }
void setMainPageSuccess(const bool b) { m_mainPageSuccess = b; }
void setMainLoadingInProgress(const bool b) { m_mainLoadingInProgress = b; }
public:
QWidget *m_widget = nullptr;
CefRefPtr<BrowserApp> m_app = nullptr;
CefRefPtr<CefBrowser> m_browser = nullptr;
CefRefPtr<BrowserClient> browserClient = nullptr;
int32_t m_obs64_PIDt = 0;
bool m_allowHideBrowser = true;
std::atomic<bool> m_cefInit = false;
public:
static SlBrowser &instance()
{
static SlBrowser instance;
return instance;
}
private:
SlBrowser();
~SlBrowser();
void browserInit();
void browserShutdown();
void browserManagerThread();
std::wstring getCacheDir() const;
static void DebugInputThread();
static void CheckForObsThread();
bool m_mainPageSuccess = false;
bool m_mainLoadingInProgress = false;
bool m_cefCreated = false;
public:
// Disallow copying
SlBrowser(const SlBrowser &) = delete;
SlBrowser &operator=(const SlBrowser &) = delete;
};