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

KWin

scene_basic.cpp

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 /*
00022  This is very simple compositing code using only plain X. It doesn't use any effects
00023  or anything like that, it merely draws everything as it would be visible without
00024  compositing. It was the first compositing code in KWin and is usable only for testing
00025  and as the very simple "this is how it works".
00026 */
00027 
00028 #include "scene_basic.h"
00029 
00030 #include "utils.h"
00031 #include "client.h"
00032 
00033 namespace KWin
00034 {
00035 
00036 SceneBasic::SceneBasic( Workspace* ws )
00037     : Scene( ws )
00038     {
00039     }
00040 
00041 SceneBasic::~SceneBasic()
00042     {
00043     }
00044     
00045 void SceneBasic::paint( QRegion, ToplevelList windows )
00046     {
00047     Pixmap composite_pixmap = XCreatePixmap( display(), rootWindow(), displayWidth(), displayHeight(), DefaultDepth( display(), DefaultScreen( display())));
00048     XGCValues val;
00049     val.foreground = WhitePixel( display(), DefaultScreen( display()));
00050     val.subwindow_mode = IncludeInferiors;
00051     GC gc = XCreateGC( display(), composite_pixmap, GCForeground | GCSubwindowMode, &val );
00052     XFillRectangle( display(), composite_pixmap, gc, 0, 0, displayWidth(), displayHeight());
00053     for( ToplevelList::ConstIterator it = windows.constBegin();
00054          it != windows.constEnd();
00055          ++it )
00056         {
00057         QRect r = (*it)->geometry().intersected( QRect( 0, 0, displayWidth(), displayHeight()));
00058         if( !r.isEmpty())
00059             {
00060             Pixmap pix = (*it)->windowPixmap();
00061             if( pix == None )
00062                 continue;
00063             XCopyArea( display(), pix, composite_pixmap, gc,
00064                 qMax( 0, -(*it)->x()), qMax( 0, -(*it)->y()), r.width(), r.height(), r.x(), r.y());
00065             }
00066         }
00067     XCopyArea( display(), composite_pixmap, rootWindow(), gc, 0, 0, displayWidth(), displayHeight(), 0, 0 );
00068     XFreeGC( display(), gc );
00069     XFreePixmap( display(), composite_pixmap );
00070     XFlush( display());
00071     }
00072 
00073 bool SceneBasic::initFailed() const
00074     {
00075     return false;
00076     }
00077 
00078 // These functions are not used at all, SceneBasic
00079 // is not using inherited functionality.
00080 
00081 void SceneBasic::paintBackground( QRegion )
00082     {
00083     }
00084 
00085 void SceneBasic::windowGeometryShapeChanged( Toplevel* )
00086     {
00087     }
00088 
00089 void SceneBasic::windowOpacityChanged( Toplevel* )
00090     {
00091     }
00092 
00093 void SceneBasic::windowAdded( Toplevel* )
00094     {
00095     }
00096 
00097 void SceneBasic::windowClosed( Toplevel*, Deleted* )
00098     {
00099     }
00100 
00101 void SceneBasic::windowDeleted( Deleted* )
00102     {
00103     }
00104 
00105 } // namespace

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
  •   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