obs-StreamFX/source/ui/ui-obs-browser-widget.hpp
Michael Fabian 'Xaymar' Dirks 9735e1bcec ui/obs-browser-widget: Pull in browser-panel.hpp to fix MacOS
MacOS complains that QCefWidget is an undefined type, while all other compilers are fine.
2023-04-05 19:08:31 +02:00

55 lines
1.2 KiB
C++

// AUTOGENERATED COPYRIGHT HEADER START
// Copyright (C) 2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
// AUTOGENERATED COPYRIGHT HEADER END
#pragma once
#include "warning-disable.hpp"
#include <QUrl>
#include <QWidget>
#include <memory>
#include "warning-enable.hpp"
#include "obs/browser/obs-browser-panel.hpp"
#include "util/util-library.hpp"
namespace streamfx::ui {
class obs_browser_cef {
std::shared_ptr<::streamfx::util::library> _module;
streamfx::obs::QCef* _cef;
streamfx::obs::QCefCookieManager* _cookie;
private:
obs_browser_cef();
public:
~obs_browser_cef();
streamfx::obs::QCef* cef();
streamfx::obs::QCefCookieManager* cookie_manager();
public: // Singleton
static std::shared_ptr<obs_browser_cef> instance();
};
class obs_browser_widget : public QWidget {
Q_OBJECT
private:
std::shared_ptr<obs_browser_cef> _cef;
streamfx::obs::QCefWidget* _widget;
public:
obs_browser_widget(QUrl url, QWidget* parent = nullptr);
virtual ~obs_browser_widget();
void set_url(QUrl url);
streamfx::obs::QCefWidget* cefwidget();
public:
static bool is_available();
};
} // namespace streamfx::ui