Compositor memory leak fixes
[profile/ivi/qtwayland.git] / src / compositor / wayland_wrapper / wlcompositor.h
index 135228a..d8acad2 100644 (file)
@@ -1,28 +1,26 @@
 /****************************************************************************
 **
-** This file is part of QtCompositor**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
 **
-** Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-**
-** Contact:  Nokia Corporation qt-info@nokia.com
+** This file is part of the Qt Compositor.
 **
+** $QT_BEGIN_LICENSE:BSD$
 ** You may use this file under the terms of the BSD license as follows:
 **
-** Redistribution and use in source and binary forms, with or without
+** "Redistribution and use in source and binary forms, with or without
 ** modification, are permitted provided that the following conditions are
 ** met:
-**
-** Redistributions of source code must retain the above copyright
-** notice, this list of conditions and the following disclaimer.
-**
-** Redistributions in binary form must reproduce the above copyright
-** notice, this list of conditions and the following disclaimer in the
-** documentation and/or other materials provided with the distribution.
-**
-** Neither the name of Nokia Corporation and its Subsidiary(-ies) nor the
-** names of its contributors may be used to endorse or promote products
-** derived from this software without specific prior written permission.
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
 **
 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
@@ -34,7 +32,9 @@
 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
 **
 ****************************************************************************/
 
@@ -52,6 +52,7 @@
 #include <wayland-server.h>
 
 class WaylandCompositor;
+class WaylandInputDevice;
 class GraphicsHardwareIntegration;
 class WindowManagerServerIntegration;
 class QMimeData;
@@ -65,6 +66,7 @@ class OutputExtensionGlobal;
 class SurfaceExtensionGlobal;
 class SubSurfaceExtensionGlobal;
 class Shell;
+class TouchExtensionGlobal;
 
 class Q_COMPOSITOR_EXPORT Compositor : public QObject
 {
@@ -76,6 +78,7 @@ public:
 
     void frameFinished(Surface *surface = 0);
 
+    //these 3 functions will be removed if noone steps up soon.
     Surface *getSurfaceFromWinId(uint winId) const;
     struct wl_client *getClientFromWinId(uint winId) const;
     QImage image(uint winId) const;
@@ -102,7 +105,7 @@ public:
 
     QList<Surface*> surfacesForClient(wl_client* client);
 
-    WaylandCompositor *qtCompositor() const { return m_qt_compositor; }
+    WaylandCompositor *waylandCompositor() const { return m_qt_compositor; }
 
     struct wl_display *wl_display() const { return m_display->handle(); }
 
@@ -115,6 +118,11 @@ public:
     void setScreenOrientation(Qt::ScreenOrientation orientation);
     Qt::ScreenOrientation screenOrientation() const;
     void setOutputGeometry(const QRect &geometry);
+    QRect outputGeometry() const;
+
+    void enableTouchExtension();
+    TouchExtensionGlobal *touchExtension() { return m_touchExtension; }
+    void configureTouchExtension(int flags);
 
     bool isDragging() const;
     void sendDragMoveEvent(const QPoint &global, const QPoint &local, Surface *surface);
@@ -137,6 +145,7 @@ private:
     Display *m_display;
 
     /* Input */
+    WaylandInputDevice *m_default_wayland_input_device;
     InputDevice *m_default_input_device;
 
     /* Output */
@@ -173,6 +182,7 @@ private:
     OutputExtensionGlobal *m_outputExtension;
     SurfaceExtensionGlobal *m_surfaceExtension;
     SubSurfaceExtensionGlobal *m_subSurfaceExtension;
+    TouchExtensionGlobal *m_touchExtension;
 
     static void bind_func(struct wl_client *client, void *data,
                           uint32_t version, uint32_t id);