#include "idescriptor_rust_codebase/src/screenshot.cxxqt.h"


// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust::cxxqt1 {
template <>
SignalHandler<::CXX::rust::cxxqtgen1::ScreenshotBackendCxxQtSignalParamsscreenshot_captured *>::~SignalHandler() noexcept
{
    if (data[0] == nullptr && data[1] == nullptr)
    {
        return;
    }

    drop_ScreenshotBackend_signal_handler_screenshot_captured(::std::move(*this));
}

template <>
template <>
void SignalHandler<::CXX::rust::cxxqtgen1::ScreenshotBackendCxxQtSignalParamsscreenshot_captured *>::operator()<CXX::ScreenshotBackend&, QByteArray>(CXX::ScreenshotBackend& self, QByteArray data)
{
    call_ScreenshotBackend_signal_handler_screenshot_captured(*this, self, ::std::move(data));
}

static_assert(alignof(SignalHandler<::CXX::rust::cxxqtgen1::ScreenshotBackendCxxQtSignalParamsscreenshot_captured *>) <= alignof(::std::size_t), "unexpected aligment");
static_assert(sizeof(SignalHandler<::CXX::rust::cxxqtgen1::ScreenshotBackendCxxQtSignalParamsscreenshot_captured *>) == sizeof(::std::size_t[2]), "unexpected size");
} // namespace rust::cxxqt1

namespace CXX::rust::cxxqtgen1 {
::QMetaObject::Connection
ScreenshotBackend_screenshot_capturedConnect(CXX::ScreenshotBackend& self, ::CXX::rust::cxxqtgen1::ScreenshotBackendCxxQtSignalHandlerscreenshot_captured closure, ::Qt::ConnectionType type)
{
    return ::QObject::connect(
        &self,
        &CXX::ScreenshotBackend::screenshot_captured,
        &self,
        [&, closure = ::std::move(closure)](QByteArray data) mutable {
            closure.template operator()<CXX::ScreenshotBackend&, QByteArray>(self, ::std::move(data));
        },
        type);
}
} // namespace CXX::rust::cxxqtgen1

// Define namespace otherwise we hit a GCC bug
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
namespace rust::cxxqt1 {
template <>
SignalHandler<::CXX::rust::cxxqtgen1::ScreenshotBackendCxxQtSignalParamsinit_failed *>::~SignalHandler() noexcept
{
    if (data[0] == nullptr && data[1] == nullptr)
    {
        return;
    }

    drop_ScreenshotBackend_signal_handler_init_failed(::std::move(*this));
}

template <>
template <>
void SignalHandler<::CXX::rust::cxxqtgen1::ScreenshotBackendCxxQtSignalParamsinit_failed *>::operator()<CXX::ScreenshotBackend&, QString>(CXX::ScreenshotBackend& self, QString reason)
{
    call_ScreenshotBackend_signal_handler_init_failed(*this, self, ::std::move(reason));
}

static_assert(alignof(SignalHandler<::CXX::rust::cxxqtgen1::ScreenshotBackendCxxQtSignalParamsinit_failed *>) <= alignof(::std::size_t), "unexpected aligment");
static_assert(sizeof(SignalHandler<::CXX::rust::cxxqtgen1::ScreenshotBackendCxxQtSignalParamsinit_failed *>) == sizeof(::std::size_t[2]), "unexpected size");
} // namespace rust::cxxqt1

namespace CXX::rust::cxxqtgen1 {
::QMetaObject::Connection
ScreenshotBackend_init_failedConnect(CXX::ScreenshotBackend& self, ::CXX::rust::cxxqtgen1::ScreenshotBackendCxxQtSignalHandlerinit_failed closure, ::Qt::ConnectionType type)
{
    return ::QObject::connect(
        &self,
        &CXX::ScreenshotBackend::init_failed,
        &self,
        [&, closure = ::std::move(closure)](QString reason) mutable {
            closure.template operator()<CXX::ScreenshotBackend&, QString>(self, ::std::move(reason));
        },
        type);
}
} // namespace CXX::rust::cxxqtgen1

namespace CXX {
static_assert(alignof(ScreenshotBackendCxxQtThread) <= alignof(::std::size_t), "unexpected aligment");
static_assert(sizeof(ScreenshotBackendCxxQtThread) == sizeof(::std::size_t[2]), "unexpected size");

ScreenshotBackend::ScreenshotBackend(QString arg0, ::std::uint32_t arg1)
  : ScreenshotBackend(::CXX::cxx_qt_ScreenshotBackend::routeArguments0(::std::move(arg0), ::std::move(arg1)))
{ }

ScreenshotBackend::ScreenshotBackend(::CXX::cxx_qt_ScreenshotBackend::CxxQtConstructorArguments0&& args)
  : QObject()
  , ::rust::cxxqt1::CxxQtType<RScreenshotBackend>(::CXX::cxx_qt_ScreenshotBackend::newRs0(::std::move(args.new_)))
  , ::rust::cxxqt1::CxxQtThreading<ScreenshotBackend>(this)
{
  ::CXX::cxx_qt_ScreenshotBackend::initialize0(*this, ::std::move(args.initialize));
}

} // namespace CXX

