1
/***************************************************************************
3
** Copyright (C) 2014 Jolla Ltd.
4
** Contact: Giulio Camuffo <giulio.camuffo@jollamobile.com>
6
** This file is part of lipstick.
8
** This library is free software; you can redistribute it and/or
9
** modify it under the terms of the GNU Lesser General Public
10
** License version 2.1 as published by the Free Software Foundation
11
** and appearing in the file LICENSE.LGPL included in the packaging
14
****************************************************************************/
16
#ifndef LIPSTICKCOMPOSITORRECORDER_H
17
#define LIPSTICKCOMPOSITORRECORDER_H
22
#include <QWaylandGlobalInterface>
24
#include "qwayland-server-lipstick-recorder.h"
32
class LipstickRecorder;
34
class LipstickRecorderManager : public QWaylandGlobalInterface, public QtWaylandServer::lipstick_recorder_manager
37
LipstickRecorderManager();
39
const wl_interface* interface() const Q_DECL_OVERRIDE;
41
void recordFrame(QWindow *window);
42
void requestFrame(QWindow *window, LipstickRecorder *recorder);
43
void remove(QWindow *window, LipstickRecorder *recorder);
46
void bind(wl_client *client, quint32 version, quint32 id) Q_DECL_OVERRIDE;
47
void lipstick_recorder_manager_create_recorder(Resource *resource, uint32_t id, ::wl_resource *output) Q_DECL_OVERRIDE;
50
QMultiHash<QWindow *, LipstickRecorder *> m_requests;
54
class LipstickRecorder : public QObject, public QtWaylandServer::lipstick_recorder
57
LipstickRecorder(LipstickRecorderManager *manager, wl_client *client, quint32 id, QQuickWindow *window);
60
wl_shm_buffer *buffer() const { return m_buffer; }
61
wl_client *client() const { return m_client; }
64
bool event(QEvent *e) Q_DECL_OVERRIDE;
65
void lipstick_recorder_destroy_resource(Resource *resource) Q_DECL_OVERRIDE;
66
void lipstick_recorder_destroy(Resource *resource) Q_DECL_OVERRIDE;
67
void lipstick_recorder_record_frame(Resource *resource, ::wl_resource *buffer) Q_DECL_OVERRIDE;
68
void lipstick_recorder_repaint(Resource *resource) Q_DECL_OVERRIDE;
71
LipstickRecorderManager *m_manager;
72
wl_resource *m_bufferResource;
73
wl_shm_buffer *m_buffer;
75
QQuickWindow *m_window;