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

KWin

scene_xrender.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) 2006 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_SCENE_XRENDER_H
00022 #define KWIN_SCENE_XRENDER_H
00023 
00024 #include <config-workspace.h>
00025 
00026 #include "scene.h"
00027 
00028 #ifdef KWIN_HAVE_XRENDER_COMPOSITING
00029 #include <X11/extensions/Xrender.h>
00030 #include <X11/extensions/Xfixes.h>
00031 
00032 namespace KWin
00033 {
00034 
00035 
00036 class SceneXrender
00037     : public Scene
00038     {
00039     public:
00040         SceneXrender( Workspace* ws );
00041         virtual ~SceneXrender();
00042         virtual bool initFailed() const;
00043         virtual CompositingType compositingType() const { return XRenderCompositing; }
00044         virtual void paint( QRegion damage, ToplevelList windows );
00045         virtual void windowGeometryShapeChanged( Toplevel* );
00046         virtual void windowOpacityChanged( Toplevel* );
00047         virtual void windowAdded( Toplevel* );
00048         virtual void windowClosed( Toplevel*, Deleted* );
00049         virtual void windowDeleted( Deleted* );
00050         Picture bufferPicture();
00051     protected:
00052         virtual void paintBackground( QRegion region );
00053         virtual void paintGenericScreen( int mask, ScreenPaintData data );
00054     private:
00055         void paintTransformedScreen( int mask );
00056         void createBuffer();
00057         XRenderPictFormat* format;
00058         Picture front;
00059         static Picture buffer;
00060         static ScreenPaintData screen_paint;
00061         class Window;
00062         QHash< Toplevel*, Window* > windows;
00063         bool init_ok;
00064     };
00065 
00066 class SceneXrender::Window
00067     : public Scene::Window
00068     {
00069     public:
00070         Window( Toplevel* c );
00071         virtual ~Window();
00072         virtual void performPaint( int mask, QRegion region, WindowPaintData data );
00073         void discardPicture();
00074         void discardAlpha();
00075         QRegion transformedShape() const;
00076         void setTransformedShape( const QRegion& shape );
00077     private:
00078         Picture picture();
00079         Picture alphaMask( double opacity );
00080         Picture _picture;
00081         XRenderPictFormat* format;
00082         Picture alpha;
00083         double alpha_cached_opacity;
00084         QRegion transformed_shape;
00085     };
00086 
00087 inline
00088 Picture SceneXrender::bufferPicture()
00089     {
00090     return buffer;
00091     }
00092 
00093 inline
00094 QRegion SceneXrender::Window::transformedShape() const
00095     {
00096     return transformed_shape;
00097     }
00098 
00099 inline
00100 void SceneXrender::Window::setTransformedShape( const QRegion& shape )
00101     {
00102     transformed_shape = shape;
00103     }
00104 
00105 } // namespace
00106 
00107 #endif
00108 
00109 #endif

KWin

Skip menu "KWin"
  • Main Page
  • 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
  •   libplasma
  •   libsolidcontrol
  •   libtaskmanager
  • Plasma
  •   Animators
  •   Applets
  •   Engines
  • Solid Modules
Generated for API Reference by doxygen 1.5.4
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