• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KWinLibraries

kwinxrenderutils.h

Go to the documentation of this file.
00001 /********************************************************************
00002  KWin - the KDE window manager
00003  This file is part of the KDE project.
00004 
00005 Copyright (C) 2008 Lubos Lunak <l.lunak@kde.org>
00006 
00007 This program is free software; you can redistribute it and/or modify
00008 it under the terms of the GNU General Public License as published by
00009 the Free Software Foundation; either version 2 of the License, or
00010 (at your option) any later version.
00011 
00012 This program is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with this program.  If not, see <http://www.gnu.org/licenses/>.
00019 *********************************************************************/
00020 
00021 #ifndef KWIN_XRENDERUTILS_H
00022 #define KWIN_XRENDERUTILS_H
00023 
00024 #include <kwinconfig.h>
00025 
00026 #ifdef KWIN_HAVE_XRENDER_COMPOSITING
00027 
00028 #include <QtCore/QSharedData>
00029 #include <QtGui/QColor>
00030 #include <ksharedptr.h>
00031 
00032 #include <kwinglobals.h>
00033 
00034 #include <X11/extensions/Xfixes.h>
00035 #include <X11/extensions/Xrender.h>
00036 
00040 namespace KWin
00041 {
00042 
00046 KWIN_EXPORT XserverRegion toXserverRegion( QRegion region );
00050 KWIN_EXPORT void xRenderRoundBox( Picture pict, const QRect &rect, int round, const QColor &c );
00054 KWIN_EXPORT XRenderColor preMultiply(const QColor &c, float opacity = 1.0);
00055 
00057 class KWIN_EXPORT XRenderPictureData
00058     : public QSharedData
00059     {
00060     public:
00061         XRenderPictureData( Picture pic = None );
00062         ~XRenderPictureData();
00063         Picture value();
00064     private:
00065         Picture picture;
00066         Q_DISABLE_COPY( XRenderPictureData )
00067     };
00068 
00076 class KWIN_EXPORT XRenderPicture
00077     {
00078     public:
00079         XRenderPicture( Picture pic = None );
00080         XRenderPicture( QPixmap pix );
00081         XRenderPicture( Pixmap pix, int depth );
00082         operator Picture();
00083     private:
00084         KSharedPtr< XRenderPictureData > d;
00085     };
00086 
00087 inline
00088 XRenderPictureData::XRenderPictureData( Picture pic )
00089     : picture( pic )
00090     {
00091     }
00092 
00093 inline
00094 XRenderPictureData::~XRenderPictureData()
00095     {
00096     if( picture != None )
00097         XRenderFreePicture( display(), picture );
00098     }
00099 
00100 inline
00101 Picture XRenderPictureData::value()
00102     {
00103     return picture;
00104     }
00105 
00106 inline
00107 XRenderPicture::XRenderPicture( Picture pic )
00108     : d( new XRenderPictureData( pic ))
00109     {
00110     }
00111 
00112 inline
00113 XRenderPicture::operator Picture()
00114     {
00115     return d->value();
00116     }
00117 
00121 KWIN_EXPORT XRenderPicture xRenderFill( const XRenderColor *c );
00122 KWIN_EXPORT XRenderPicture xRenderFill( const QColor &c );
00123 
00124 } // namespace
00125 
00126 #endif
00127 
00130 #endif

KWinLibraries

Skip menu "KWinLibraries"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • KWin
  •   KWin Libraries
  • Libraries
  •   libkworkspace
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal