| 1 |
// Copyright (C) 2018 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 |
|
| 4 |
#ifndef QCOLORMAP_X11_H |
| 5 |
#define QCOLORMAP_X11_H |
| 6 |
|
| 7 |
#include <QColor> |
| 8 |
#include <QList> |
| 9 |
|
| 10 |
QT_BEGIN_NAMESPACE |
| 11 |
|
| 12 |
class QXcbColormapPrivate; |
| 13 |
class QXcbColormap |
| 14 |
{ |
| 15 |
public: |
| 16 |
enum Mode { Direct, Indexed, Gray }; |
| 17 |
|
| 18 |
static void initialize(); |
| 19 |
static void cleanup(); |
| 20 |
|
| 21 |
static QXcbColormap instance(int screen = -1); |
| 22 |
|
| 23 |
QXcbColormap(const QXcbColormap &colormap); |
| 24 |
~QXcbColormap(); |
| 25 |
|
| 26 |
QXcbColormap &operator=(const QXcbColormap &colormap); |
| 27 |
|
| 28 |
Mode mode() const; |
| 29 |
|
| 30 |
int depth() const; |
| 31 |
int size() const; |
| 32 |
|
| 33 |
uint pixel(const QColor &color) const; |
| 34 |
const QColor colorAt(uint pixel) const; |
| 35 |
|
| 36 |
const QList<QColor> colormap() const; |
| 37 |
|
| 38 |
private: |
| 39 |
QXcbColormap(); |
| 40 |
QXcbColormapPrivate *d; |
| 41 |
}; |
| 42 |
|
| 43 |
QT_END_NAMESPACE |
| 44 |
|
| 45 |
#endif // QCOLORMAP_X11_H |