Ejemplo 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);
}
Ejemplo n.º 2
0
void WorkerRunLoop::run(WorkerContext* context)
{
    RunLoopSetup setup(*this);
    ModePredicate modePredicate(defaultMode());
    MessageQueueWaitResult result;
    do {
        result = runInMode(context, modePredicate);
    } while (result != MessageQueueTerminated);
}
Ejemplo n.º 3
0
void WorkerRunLoop::run(WorkerGlobalScope* context)
{
    RunLoopSetup setup(*this);
    ModePredicate modePredicate(defaultMode());
    MessageQueueWaitResult result;
    do {
        result = runInMode(context, modePredicate, WaitForMessage);
    } while (result != MessageQueueTerminated);
    runCleanupTasks(context);
}
Ejemplo 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);
}
Ejemplo n.º 5
0
void WorkerRunLoop::postTask(PassRefPtr<ScriptExecutionContext::Task> task)
{
    postTaskForMode(task, defaultMode());
}
Ejemplo n.º 6
0
void WorkerRunLoop::postTaskAndTerminate(ScriptExecutionContext::Task task)
{
    m_messageQueue.appendAndKill(std::make_unique<Task>(WTFMove(task), defaultMode()));
}
Ejemplo n.º 7
0
void WorkerRunLoop::postTask(ScriptExecutionContext::Task task)
{
    postTaskForMode(WTFMove(task), defaultMode());
}
Ejemplo n.º 8
0
void WorkerRunLoop::postTaskAndTerminate(ScriptExecutionContext::Task task)
{
    m_messageQueue.appendAndKill(Task::create(std::move(task), defaultMode().isolatedCopy()));
}
Ejemplo n.º 9
0
void WorkerRunLoop::postTaskAndTerminate(PassOwnPtr<ScriptExecutionContext::Task> task)
{
    m_messageQueue.appendAndKill(Task::create(task, defaultMode().isolatedCopy()));
}
Ejemplo n.º 10
0
bool WorkerRunLoop::postTask(PassOwnPtr<ScriptExecutionContext::Task> task)
{
    return postTaskForMode(task, defaultMode());
}