Esempio n. 1
0
void Compositor::create()
{
    setRetainedSelectionEnabled(true);

    QWaylandCompositor::create();

    // Add a valid mode for the output
    QWaylandOutput *output = defaultOutput();
    QWaylandOutputMode defaultMode(QSize(output->window()->size()), 25000);
    output->addMode(defaultMode, true);
    output->setCurrentMode(defaultMode);

    QWaylandXdgShell *xdgShell = new QWaylandXdgShell(this);
    //xdgShell->setFocusPolicy(QWaylandShell::ManualFocus);
//    connect(xdgShell, &QWaylandXdgShell::xdgSurfaceCreated, this, &Compositor::onXdgSurfaceCreated);
    connect(xdgShell, &QWaylandXdgShell::toplevelCreated, this, &Compositor::onXdgToplevelCreated);

    connect(this, &QWaylandCompositor::surfaceCreated, this, &Compositor::onSurfaceCreated);

    QQuickWindow *defaultOutputWindow = static_cast<QQuickWindow*>(defaultOutput()->window());
    connect(defaultOutputWindow, &QQuickWindow::afterRendering, this, &Compositor::readContent, Qt::DirectConnection);

    mSurfaceExtension = new QtWayland::SurfaceExtensionGlobal(this);
    connect(mSurfaceExtension, &QtWayland::SurfaceExtensionGlobal::extendedSurfaceReady, this, &Compositor::onExtendedSurfaceReady);

    QtWayland::QtKeyExtensionGlobal *pKeyExtension = new QtWayland::QtKeyExtensionGlobal(this);

    QWaylandXdgDecorationManagerV1 *mXdgDecorationManagerV1 = new QWaylandXdgDecorationManagerV1();
    mXdgDecorationManagerV1->setExtensionContainer(this);
    mXdgDecorationManagerV1->initialize();
    mXdgDecorationManagerV1->setPreferredMode(QWaylandXdgToplevel::ServerSideDecoration);

    mRecorder = new RecorderManager(this);
}
Esempio n. 2
0
void WorkerRunLoop::run(WorkerContext* context)
{
    RunLoopSetup setup(*this);
    ModePredicate modePredicate(defaultMode());
    MessageQueueWaitResult result;
    do {
        result = runInMode(context, modePredicate);
    } while (result != MessageQueueTerminated);
}
void WorkerRunLoop::run(WorkerGlobalScope* context)
{
    RunLoopSetup setup(*this);
    ModePredicate modePredicate(defaultMode());
    MessageQueueWaitResult result;
    do {
        result = runInMode(context, modePredicate, WaitForMessage);
    } while (result != MessageQueueTerminated);
    runCleanupTasks(context);
}
Esempio n. 4
0
void loop() {
    i++;
    switch(i) {
        case 10: slowMode(); break;
        case 15: defaultMode(); break;
        case 25: fastMode(); break;
        case 40: i=0; break;
    }

    GPIO_ToggleBits(GPIOD, LEDS);

    delay(300);
}
Esempio n. 5
0
void WorkerRunLoop::postTask(PassRefPtr<ScriptExecutionContext::Task> task)
{
    postTaskForMode(task, defaultMode());
}
void WorkerRunLoop::postTaskAndTerminate(ScriptExecutionContext::Task task)
{
    m_messageQueue.appendAndKill(std::make_unique<Task>(WTFMove(task), defaultMode()));
}
void WorkerRunLoop::postTask(ScriptExecutionContext::Task task)
{
    postTaskForMode(WTFMove(task), defaultMode());
}
Esempio n. 8
0
void WorkerRunLoop::postTaskAndTerminate(ScriptExecutionContext::Task task)
{
    m_messageQueue.appendAndKill(Task::create(std::move(task), defaultMode().isolatedCopy()));
}
void WorkerRunLoop::postTaskAndTerminate(PassOwnPtr<ScriptExecutionContext::Task> task)
{
    m_messageQueue.appendAndKill(Task::create(task, defaultMode().isolatedCopy()));
}
Esempio n. 10
0
bool WorkerRunLoop::postTask(PassOwnPtr<ScriptExecutionContext::Task> task)
{
    return postTaskForMode(task, defaultMode());
}