diff options
author | David Faure <david.faure@kdab.com> | 2012-12-04 22:39:56 +0100 |
---|---|---|
committer | David Faure <david.faure@kdab.com> | 2012-12-05 11:19:23 +0100 |
commit | 5480650d050895ab184186ee3813004da494fc30 (patch) | |
tree | df7b98900fca5c099fca583fd6cc6eb8d1c34c2b /src/x11support/qx11info_x11.h | |
parent | 20422631502054cd86a7ef5b1cef6953b72f535c (diff) | |
download | qtx11extras-5480650d050895ab184186ee3813004da494fc30.tar.gz |
Initial creation of the qtx11support library.
This implements QX11Info again, for source compat with Qt4, on top of
the XCB QPA backend.
The API and the documentation are forward-ported from Qt4 (minus things that
cannot be implemented anymore).
The implementation, however, is new (by Richard Moore, in this initial commit).
Change-Id: Iff9fd16fa6aaaa54f6d3cc0843b6b6fd08d5b1fb
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/x11support/qx11info_x11.h')
-rw-r--r-- | src/x11support/qx11info_x11.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/src/x11support/qx11info_x11.h b/src/x11support/qx11info_x11.h new file mode 100644 index 0000000..68cb6a8 --- /dev/null +++ b/src/x11support/qx11info_x11.h @@ -0,0 +1,82 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtGui module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QX11INFO_X11_H +#define QX11INFO_X11_H + +#include <QtCore/qnamespace.h> +#include "QtX11Support/qtx11supportglobal.h" + +typedef struct _XDisplay Display; +struct xcb_connection_t; + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +class Q_X11SUPPORT_EXPORT QX11Info +{ +public: + static int appDpiX(int screen=-1); + static int appDpiY(int screen=-1); + + static Qt::HANDLE appRootWindow(int screen=-1); + static int appScreen(); + + static unsigned long appTime(); + static unsigned long appUserTime(); + + static void setAppTime(unsigned long time); + static void setAppUserTime(unsigned long time); + + static Display *display(); + static xcb_connection_t *connection(); + +private: + QX11Info(); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QX11INFO_X11_H + |