File indexing completed on 2024-05-05 14:23:15
0001 /***************************************************************************** 0002 * Copyright 2014 - 2015 Yichao Yu <yyc1992@gmail.com> * 0003 * * 0004 * This program is free software; you can redistribute it and/or modify * 0005 * it under the terms of the GNU Lesser General Public License as * 0006 * published by the Free Software Foundation; either version 2.1 of the * 0007 * License, or (at your option) version 3, or any later version accepted * 0008 * by the membership of KDE e.V. (or its successor approved by the * 0009 * membership of KDE e.V.), which shall act as a proxy defined in * 0010 * Section 6 of version 3 of the license. * 0011 * * 0012 * This program is distributed in the hope that it will be useful, * 0013 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 0015 * Lesser General Public License for more details. * 0016 * * 0017 * You should have received a copy of the GNU Lesser General Public * 0018 * License along with this library. If not, * 0019 * see <http://www.gnu.org/licenses/>. * 0020 *****************************************************************************/ 0021 0022 #ifndef __ARGBHELPER_H__ 0023 #define __ARGBHELPER_H__ 0024 0025 #include <QtGlobal> 0026 #ifdef Q_WS_X11 0027 # include <QX11Info> 0028 #else 0029 class QX11Info { 0030 }; 0031 #endif 0032 #include <qtcurve-utils/utils.h> 0033 0034 class QWidget; 0035 0036 namespace QtCurve { 0037 // TODO, turn this into a complete helper class. 0038 // The QtcX11Info struct and the <QX11Info> include are in the header file 0039 // only for QtcX11Info::creatingDummy. Should move to argbhelper.cpp once 0040 // the real helper class is done. 0041 0042 // Access protected functions. 0043 struct QtcX11Info: public QX11Info { 0044 static bool creatingDummy; 0045 private: 0046 static QtcX11Info *getInfo(const QWidget *w); 0047 QWidget *rgbaDummy(); 0048 void fixVisual(); 0049 void setRgba(); 0050 friend void fixVisual(QWidget *widget); 0051 friend void addAlphaChannel(QWidget *widget); 0052 }; 0053 0054 void fixVisual(QWidget *widget); 0055 void addAlphaChannel(QWidget *widget); 0056 0057 } 0058 0059 #endif