Warning, file /frameworks/kwindowsystem/src/platforms/xcb/kxutils_p.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     This file is part of the KDE libraries
0003     SPDX-FileCopyrightText: 2008 Lubos Lunak <l.lunak@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-or-later
0006 */
0007 
0008 #ifndef KXUTILS_H
0009 #define KXUTILS_H
0010 
0011 #include <QPixmap>
0012 #include <config-kwindowsystem.h>
0013 
0014 #if KWINDOWSYSTEM_HAVE_X11
0015 
0016 #include <kwindowsystem_export.h>
0017 
0018 struct xcb_connection_t;
0019 
0020 /**
0021  * Namespace with various generic X11-related functionality.
0022  */
0023 namespace KXUtils
0024 {
0025 
0026 /**
0027  * Creates a QPixmap that contains a copy of the pixmap given by the X handle @p pixmap
0028  * and optionally also mask given as another X handle @mask. This function tries to
0029  * also handle the case when the depth of the pixmap differs from the native QPixmap depth.
0030  * @since 4.0.2
0031  */
0032 QPixmap createPixmapFromHandle(WId pixmap, WId mask = 0);
0033 QPixmap createPixmapFromHandle(xcb_connection_t *c, WId pixmap, WId mask = 0);
0034 
0035 /**
0036  * Compares two X timestamps, taking into account wrapping and 64bit architectures.
0037  * Return value is like with strcmp(), 0 for equal, -1 for time1 < time2, 1 for time1 > time2.
0038  * @since 4.1.0
0039  */
0040 int timestampCompare(unsigned long time1, unsigned long time2);
0041 /**
0042  * Returns a difference of two X timestamps, time2 - time1, where time2 must be later than time1,
0043  * as returned by timestampCompare().
0044  * @since 4.1.0
0045  */
0046 int timestampDiff(unsigned long time1, unsigned long time2);
0047 
0048 } // namespace
0049 
0050 #endif // KWINDOWSYSTEM_HAVE_X11
0051 
0052 #endif