KWin
scene_basic.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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
00079
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 }