2006-07-04 20:51:01 +00:00
|
|
|
/*****************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
|
|
|
|
You can Freely distribute this program under the GNU General Public
|
|
|
|
License. See the file "COPYING" for the exact licensing terms.
|
|
|
|
******************************************************************/
|
|
|
|
|
|
|
|
#include "effects.h"
|
|
|
|
|
2007-03-30 16:12:07 +00:00
|
|
|
#include "deleted.h"
|
2007-04-10 13:02:08 +00:00
|
|
|
#include "client.h"
|
2007-04-10 14:48:55 +00:00
|
|
|
#include "group.h"
|
2007-04-10 15:38:36 +00:00
|
|
|
#include "scene_xrender.h"
|
2007-04-11 15:46:46 +00:00
|
|
|
#include "scene_opengl.h"
|
2007-04-10 13:02:08 +00:00
|
|
|
#include "workspace.h"
|
2006-07-06 13:17:44 +00:00
|
|
|
|
2007-04-10 18:47:13 +00:00
|
|
|
#include <QFile>
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
#include "kdebug.h"
|
2007-04-10 18:47:13 +00:00
|
|
|
#include "klibloader.h"
|
|
|
|
#include "kdesktopfile.h"
|
|
|
|
#include "kconfiggroup.h"
|
|
|
|
#include "kstandarddirs.h"
|
2006-10-16 18:46:07 +00:00
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
#include <assert.h>
|
2006-10-29 19:07:10 +00:00
|
|
|
|
2007-03-07 17:50:33 +00:00
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
namespace KWin
|
|
|
|
{
|
2007-03-07 17:50:33 +00:00
|
|
|
|
2006-07-06 13:17:44 +00:00
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
EffectsHandlerImpl::EffectsHandlerImpl(CompositingType type) : EffectsHandler(type)
|
2006-07-06 09:55:10 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
foreach( const QString& effect, options->defaultEffects )
|
|
|
|
loadEffect( effect );
|
2006-07-06 09:55:10 +00:00
|
|
|
}
|
2006-10-21 18:07:00 +00:00
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
EffectsHandlerImpl::~EffectsHandlerImpl()
|
2006-07-10 18:34:57 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
// Can't be done in EffectsHandler since it would result in pure virtuals
|
|
|
|
// being called
|
2007-02-04 22:19:17 +00:00
|
|
|
foreach( EffectPair ep, loaded_effects )
|
2007-04-10 13:02:08 +00:00
|
|
|
unloadEffect( ep.first );
|
|
|
|
|
2007-01-05 16:45:56 +00:00
|
|
|
foreach( InputWindowPair pos, input_windows )
|
|
|
|
XDestroyWindow( display(), pos.second );
|
2006-07-10 18:34:57 +00:00
|
|
|
}
|
2006-07-06 09:55:10 +00:00
|
|
|
|
2006-10-16 18:46:07 +00:00
|
|
|
// the idea is that effects call this function again which calls the next one
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectsHandlerImpl::prePaintScreen( int* mask, QRegion* region, int time )
|
2006-10-16 18:46:07 +00:00
|
|
|
{
|
2007-02-04 22:19:17 +00:00
|
|
|
if( current_paint_screen < loaded_effects.size())
|
2006-10-29 19:06:32 +00:00
|
|
|
{
|
2007-02-04 22:19:17 +00:00
|
|
|
loaded_effects[current_paint_screen++].second->prePaintScreen( mask, region, time );
|
2006-10-29 19:06:32 +00:00
|
|
|
--current_paint_screen;
|
|
|
|
}
|
|
|
|
// no special final code
|
2006-10-16 10:12:48 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectsHandlerImpl::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
2006-07-04 20:51:01 +00:00
|
|
|
{
|
2007-02-04 22:19:17 +00:00
|
|
|
if( current_paint_screen < loaded_effects.size())
|
2006-10-29 19:06:32 +00:00
|
|
|
{
|
2007-02-04 22:19:17 +00:00
|
|
|
loaded_effects[current_paint_screen++].second->paintScreen( mask, region, data );
|
2006-10-29 19:06:32 +00:00
|
|
|
--current_paint_screen;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
scene->finalPaintScreen( mask, region, data );
|
2006-07-04 20:51:01 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectsHandlerImpl::postPaintScreen()
|
2006-10-29 19:07:10 +00:00
|
|
|
{
|
2007-02-04 22:19:17 +00:00
|
|
|
if( current_paint_screen < loaded_effects.size())
|
2006-10-29 19:07:10 +00:00
|
|
|
{
|
2007-02-04 22:19:17 +00:00
|
|
|
loaded_effects[current_paint_screen++].second->postPaintScreen();
|
2006-10-29 19:07:10 +00:00
|
|
|
--current_paint_screen;
|
|
|
|
}
|
|
|
|
// no special final code
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectsHandlerImpl::prePaintWindow( EffectWindow* w, int* mask, QRegion* paint, QRegion* clip, int time )
|
2006-10-16 18:46:07 +00:00
|
|
|
{
|
2007-02-04 22:19:17 +00:00
|
|
|
if( current_paint_window < loaded_effects.size())
|
2006-10-29 19:06:32 +00:00
|
|
|
{
|
2007-03-25 10:48:07 +00:00
|
|
|
loaded_effects[current_paint_window++].second->prePaintWindow( w, mask, paint, clip, time );
|
2006-10-29 19:06:32 +00:00
|
|
|
--current_paint_window;
|
|
|
|
}
|
|
|
|
// no special final code
|
2006-10-16 18:46:07 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectsHandlerImpl::paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data )
|
2006-10-16 18:46:07 +00:00
|
|
|
{
|
2007-02-04 22:19:17 +00:00
|
|
|
if( current_paint_window < loaded_effects.size())
|
2006-10-29 19:06:32 +00:00
|
|
|
{
|
2007-02-04 22:19:17 +00:00
|
|
|
loaded_effects[current_paint_window++].second->paintWindow( w, mask, region, data );
|
2006-10-29 19:06:32 +00:00
|
|
|
--current_paint_window;
|
|
|
|
}
|
|
|
|
else
|
2007-04-10 13:02:08 +00:00
|
|
|
scene->finalPaintWindow( static_cast<EffectWindowImpl*>( w ), mask, region, data );
|
2006-10-16 18:46:07 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectsHandlerImpl::postPaintWindow( EffectWindow* w )
|
2006-10-29 19:07:10 +00:00
|
|
|
{
|
2007-02-04 22:19:17 +00:00
|
|
|
if( current_paint_window < loaded_effects.size())
|
2006-10-29 19:07:10 +00:00
|
|
|
{
|
2007-02-04 22:19:17 +00:00
|
|
|
loaded_effects[current_paint_window++].second->postPaintWindow( w );
|
2006-10-29 19:07:10 +00:00
|
|
|
--current_paint_window;
|
|
|
|
}
|
|
|
|
// no special final code
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectsHandlerImpl::drawWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data )
|
2007-03-07 17:50:33 +00:00
|
|
|
{
|
|
|
|
if( current_draw_window < loaded_effects.size())
|
|
|
|
{
|
|
|
|
loaded_effects[current_draw_window++].second->drawWindow( w, mask, region, data );
|
|
|
|
--current_draw_window;
|
|
|
|
}
|
|
|
|
else
|
2007-04-10 13:02:08 +00:00
|
|
|
scene->finalDrawWindow( static_cast<EffectWindowImpl*>( w ), mask, region, data );
|
2007-03-07 17:50:33 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 18:47:13 +00:00
|
|
|
// start another painting pass
|
|
|
|
void EffectsHandlerImpl::startPaint()
|
|
|
|
{
|
|
|
|
assert( current_paint_screen == 0 );
|
|
|
|
assert( current_paint_window == 0 );
|
|
|
|
assert( current_draw_window == 0 );
|
|
|
|
assert( current_transform == 0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::windowUserMovedResized( EffectWindow* c, bool first, bool last )
|
|
|
|
{
|
|
|
|
foreach( EffectPair ep, loaded_effects )
|
|
|
|
ep.second->windowUserMovedResized( c, first, last );
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectsHandlerImpl::windowOpacityChanged( EffectWindow* c, double old_opacity )
|
2007-03-25 10:48:07 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
if( static_cast<EffectWindowImpl*>(c)->window()->opacity() == old_opacity )
|
|
|
|
return;
|
2007-04-10 18:47:13 +00:00
|
|
|
foreach( EffectPair ep, loaded_effects )
|
|
|
|
ep.second->windowOpacityChanged( c, old_opacity );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::windowAdded( EffectWindow* c )
|
|
|
|
{
|
|
|
|
foreach( EffectPair ep, loaded_effects )
|
|
|
|
ep.second->windowAdded( c );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::windowDeleted( EffectWindow* c )
|
|
|
|
{
|
|
|
|
foreach( EffectPair ep, loaded_effects )
|
|
|
|
ep.second->windowDeleted( c );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::windowClosed( EffectWindow* c )
|
|
|
|
{
|
|
|
|
foreach( EffectPair ep, loaded_effects )
|
|
|
|
ep.second->windowClosed( c );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::windowActivated( EffectWindow* c )
|
|
|
|
{
|
|
|
|
foreach( EffectPair ep, loaded_effects )
|
|
|
|
ep.second->windowActivated( c );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::windowMinimized( EffectWindow* c )
|
|
|
|
{
|
|
|
|
foreach( EffectPair ep, loaded_effects )
|
|
|
|
ep.second->windowMinimized( c );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::windowUnminimized( EffectWindow* c )
|
|
|
|
{
|
|
|
|
foreach( EffectPair ep, loaded_effects )
|
|
|
|
ep.second->windowUnminimized( c );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::desktopChanged( int old )
|
|
|
|
{
|
|
|
|
foreach( EffectPair ep, loaded_effects )
|
|
|
|
ep.second->desktopChanged( old );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::windowDamaged( EffectWindow* w, const QRect& r )
|
|
|
|
{
|
|
|
|
if( w == NULL )
|
|
|
|
return;
|
|
|
|
foreach( EffectPair ep, loaded_effects )
|
|
|
|
ep.second->windowDamaged( w, r );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::windowGeometryShapeChanged( EffectWindow* w, const QRect& old )
|
|
|
|
{
|
|
|
|
if( w == NULL ) // during late cleanup effectWindow() may be already NULL
|
|
|
|
return; // in some functions that may still call this
|
|
|
|
foreach( EffectPair ep, loaded_effects )
|
|
|
|
ep.second->windowGeometryShapeChanged( w, old );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::tabBoxAdded( int mode )
|
|
|
|
{
|
|
|
|
foreach( EffectPair ep, loaded_effects )
|
|
|
|
ep.second->tabBoxAdded( mode );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::tabBoxClosed()
|
|
|
|
{
|
|
|
|
foreach( EffectPair ep, loaded_effects )
|
|
|
|
ep.second->tabBoxClosed();
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::tabBoxUpdated()
|
|
|
|
{
|
|
|
|
foreach( EffectPair ep, loaded_effects )
|
|
|
|
ep.second->tabBoxUpdated();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectsHandlerImpl::borderActivated( ElectricBorder border )
|
|
|
|
{
|
|
|
|
bool ret = false;
|
|
|
|
foreach( EffectPair ep, loaded_effects )
|
|
|
|
if( ep.second->borderActivated( border ))
|
|
|
|
ret = true; // bail out or tell all?
|
|
|
|
return ret;
|
2007-03-25 10:48:07 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectsHandlerImpl::activateWindow( EffectWindow* c )
|
2007-04-04 19:08:03 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
if( Client* cl = dynamic_cast< Client* >( static_cast<EffectWindowImpl*>(c)->window()))
|
|
|
|
Workspace::self()->activateClient( cl, true );
|
2007-04-04 19:08:03 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
int EffectsHandlerImpl::currentDesktop() const
|
|
|
|
{
|
|
|
|
return Workspace::self()->currentDesktop();
|
|
|
|
}
|
|
|
|
|
2007-04-12 13:12:37 +00:00
|
|
|
int EffectsHandlerImpl::numberOfDesktops() const
|
|
|
|
{
|
|
|
|
return Workspace::self()->numberOfDesktops();
|
|
|
|
}
|
|
|
|
|
2007-04-12 14:12:34 +00:00
|
|
|
QString EffectsHandlerImpl::desktopName( int desktop ) const
|
|
|
|
{
|
|
|
|
return Workspace::self()->desktopName( desktop );
|
|
|
|
}
|
|
|
|
|
2007-04-12 13:12:37 +00:00
|
|
|
void EffectsHandlerImpl::calcDesktopLayout(int* x, int* y, Qt::Orientation* orientation) const
|
|
|
|
{
|
|
|
|
Workspace::self()->calcDesktopLayout( x, y, orientation );
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectsHandlerImpl::optionRollOverDesktops() const
|
|
|
|
{
|
|
|
|
return options->rollOverDesktops;
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
int EffectsHandlerImpl::displayWidth() const
|
2007-04-10 15:38:36 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
return KWin::displayWidth();
|
2007-04-10 15:38:36 +00:00
|
|
|
}
|
2007-04-10 13:02:08 +00:00
|
|
|
|
|
|
|
int EffectsHandlerImpl::displayHeight() const
|
2007-04-10 15:38:36 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
return KWin::displayWidth();
|
2007-04-10 15:38:36 +00:00
|
|
|
}
|
2007-04-10 13:02:08 +00:00
|
|
|
|
|
|
|
QPoint EffectsHandlerImpl::cursorPos() const
|
2007-04-10 15:38:36 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
return KWin::cursorPos();
|
2007-04-10 15:38:36 +00:00
|
|
|
}
|
2007-04-10 13:02:08 +00:00
|
|
|
|
|
|
|
EffectWindowList EffectsHandlerImpl::stackingOrder() const
|
2007-04-10 15:38:36 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
ClientList list = Workspace::self()->stackingOrder();
|
|
|
|
EffectWindowList ret;
|
|
|
|
foreach( Client* c, list )
|
|
|
|
ret.append( effectWindow( c ));
|
|
|
|
return ret;
|
2007-04-10 15:38:36 +00:00
|
|
|
}
|
2007-04-10 13:02:08 +00:00
|
|
|
|
2007-04-12 14:12:34 +00:00
|
|
|
void EffectsHandlerImpl::setTabBoxWindow(EffectWindow* w)
|
|
|
|
{
|
|
|
|
if( Client* c = dynamic_cast< Client* >( static_cast< EffectWindowImpl* >( w )->window()))
|
|
|
|
Workspace::self()->setTabBoxClient( c );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::setTabBoxDesktop(int desktop)
|
|
|
|
{
|
|
|
|
Workspace::self()->setTabBoxDesktop( desktop );
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectWindowList EffectsHandlerImpl::currentTabBoxWindowList() const
|
|
|
|
{
|
|
|
|
EffectWindowList ret;
|
|
|
|
ClientList clients = Workspace::self()->currentTabBoxClientList();
|
|
|
|
foreach( Client* c, clients )
|
|
|
|
ret.append( c->effectWindow());
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::refTabBox()
|
|
|
|
{
|
|
|
|
Workspace::self()->refTabBox();
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::unrefTabBox()
|
|
|
|
{
|
|
|
|
Workspace::self()->unrefTabBox();
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::closeTabBox()
|
|
|
|
{
|
|
|
|
Workspace::self()->closeTabBox();
|
|
|
|
}
|
|
|
|
|
|
|
|
QList< int > EffectsHandlerImpl::currentTabBoxDesktopList() const
|
|
|
|
{
|
|
|
|
return Workspace::self()->currentTabBoxDesktopList();
|
|
|
|
}
|
|
|
|
|
|
|
|
int EffectsHandlerImpl::currentTabBoxDesktop() const
|
|
|
|
{
|
|
|
|
return Workspace::self()->currentTabBoxDesktop();
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectWindow* EffectsHandlerImpl::currentTabBoxWindow() const
|
|
|
|
{
|
|
|
|
if( Client* c = Workspace::self()->currentTabBoxClient())
|
|
|
|
return c->effectWindow();
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectsHandlerImpl::addRepaintFull()
|
2007-04-10 15:38:36 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
Workspace::self()->addRepaintFull();
|
2007-04-10 15:38:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::addRepaint( const QRect& r )
|
|
|
|
{
|
|
|
|
Workspace::self()->addRepaint( r );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::addRepaint( int x, int y, int w, int h )
|
|
|
|
{
|
|
|
|
Workspace::self()->addRepaint( x, y, w, h );
|
|
|
|
}
|
2007-04-10 13:02:08 +00:00
|
|
|
|
|
|
|
QRect EffectsHandlerImpl::clientArea( clientAreaOption opt, const QPoint& p, int desktop ) const
|
2007-04-10 15:38:36 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
return Workspace::self()->clientArea( opt, p, desktop );
|
2007-04-10 15:38:36 +00:00
|
|
|
}
|
2007-04-10 13:02:08 +00:00
|
|
|
|
|
|
|
Window EffectsHandlerImpl::createInputWindow( Effect* e, int x, int y, int w, int h, const QCursor& cursor )
|
2007-01-05 16:45:56 +00:00
|
|
|
{
|
|
|
|
XSetWindowAttributes attrs;
|
|
|
|
attrs.override_redirect = True;
|
|
|
|
Window win = XCreateWindow( display(), rootWindow(), x, y, w, h, 0, 0, InputOnly, CopyFromParent,
|
|
|
|
CWOverrideRedirect, &attrs );
|
2007-04-10 13:02:08 +00:00
|
|
|
// TODO keeping on top?
|
|
|
|
// TODO enter/leave notify?
|
2007-01-05 16:45:56 +00:00
|
|
|
XSelectInput( display(), win, ButtonPressMask | ButtonReleaseMask | PointerMotionMask );
|
|
|
|
XDefineCursor( display(), win, cursor.handle());
|
|
|
|
XMapWindow( display(), win );
|
|
|
|
input_windows.append( qMakePair( e, win ));
|
|
|
|
return win;
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectsHandlerImpl::destroyInputWindow( Window w )
|
2007-01-05 16:45:56 +00:00
|
|
|
{
|
|
|
|
foreach( InputWindowPair pos, input_windows )
|
|
|
|
{
|
|
|
|
if( pos.second == w )
|
|
|
|
{
|
|
|
|
input_windows.removeAll( pos );
|
|
|
|
XDestroyWindow( display(), w );
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
assert( false );
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
bool EffectsHandlerImpl::checkInputWindowEvent( XEvent* e )
|
2007-01-05 16:45:56 +00:00
|
|
|
{
|
|
|
|
if( e->type != ButtonPress && e->type != ButtonRelease && e->type != MotionNotify )
|
|
|
|
return false;
|
|
|
|
foreach( InputWindowPair pos, input_windows )
|
|
|
|
{
|
|
|
|
if( pos.second == e->xany.window )
|
|
|
|
{
|
|
|
|
switch( e->type )
|
|
|
|
{
|
|
|
|
case ButtonPress:
|
|
|
|
case ButtonRelease:
|
|
|
|
{
|
|
|
|
XButtonEvent* e2 = &e->xbutton;
|
|
|
|
QMouseEvent ev( e->type == ButtonPress ? QEvent::MouseButtonPress : QEvent::MouseButtonRelease,
|
|
|
|
QPoint( e2->x, e2->y ), QPoint( e2->x_root, e2->y_root ), x11ToQtMouseButton( e2->button ),
|
|
|
|
x11ToQtMouseButtons( e2->state ), x11ToQtKeyboardModifiers( e2->state ));
|
|
|
|
pos.first->windowInputMouseEvent( pos.second, &ev );
|
|
|
|
break; // --->
|
|
|
|
}
|
|
|
|
case MotionNotify:
|
|
|
|
{
|
|
|
|
XMotionEvent* e2 = &e->xmotion;
|
|
|
|
QMouseEvent ev( QEvent::MouseMove, QPoint( e2->x, e2->y ), QPoint( e2->x_root, e2->y_root ),
|
|
|
|
Qt::NoButton, x11ToQtMouseButtons( e2->state ), x11ToQtKeyboardModifiers( e2->state ));
|
|
|
|
pos.first->windowInputMouseEvent( pos.second, &ev );
|
|
|
|
break; // --->
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true; // eat event
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectsHandlerImpl::checkInputWindowStacking()
|
2007-01-05 16:45:56 +00:00
|
|
|
{
|
|
|
|
if( input_windows.count() == 0 )
|
|
|
|
return;
|
|
|
|
Window* wins = new Window[ input_windows.count() ];
|
|
|
|
int pos = 0;
|
|
|
|
foreach( InputWindowPair it, input_windows )
|
|
|
|
wins[ pos++ ] = it.second;
|
|
|
|
XRaiseWindow( display(), wins[ 0 ] );
|
|
|
|
XRestackWindows( display(), wins, pos );
|
|
|
|
delete[] wins;
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectsHandlerImpl::checkElectricBorder(const QPoint &pos, Time time)
|
2007-04-10 15:38:36 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
Workspace::self()->checkElectricBorder( pos, time );
|
2007-04-10 15:38:36 +00:00
|
|
|
}
|
2007-04-10 13:02:08 +00:00
|
|
|
|
|
|
|
void EffectsHandlerImpl::reserveElectricBorder( ElectricBorder border )
|
2007-04-10 15:38:36 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
Workspace::self()->reserveElectricBorder( border );
|
2007-04-10 15:38:36 +00:00
|
|
|
}
|
2007-04-10 13:02:08 +00:00
|
|
|
|
|
|
|
void EffectsHandlerImpl::unreserveElectricBorder( ElectricBorder border )
|
2007-04-10 15:38:36 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
Workspace::self()->unreserveElectricBorder( border );
|
2007-04-10 15:38:36 +00:00
|
|
|
}
|
2007-04-10 13:02:08 +00:00
|
|
|
|
|
|
|
void EffectsHandlerImpl::reserveElectricBorderSwitching( bool reserve )
|
2007-04-10 15:38:36 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
Workspace::self()->reserveElectricBorderSwitching( reserve );
|
2007-04-10 15:38:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned long EffectsHandlerImpl::xrenderBufferPicture()
|
|
|
|
{
|
|
|
|
#ifdef HAVE_XRENDER
|
|
|
|
if( SceneXrender* s = dynamic_cast< SceneXrender* >( scene ))
|
|
|
|
return s->bufferPicture();
|
|
|
|
#endif
|
|
|
|
return None;
|
|
|
|
}
|
2007-04-10 13:02:08 +00:00
|
|
|
|
2007-04-10 18:47:13 +00:00
|
|
|
KLibrary* EffectsHandlerImpl::findEffectLibrary( const QString& effectname )
|
|
|
|
{
|
|
|
|
QString libname = "kwin4_effect_" + effectname.toLower();
|
|
|
|
|
|
|
|
QString desktopfile = KStandardDirs::locate("appdata",
|
|
|
|
"effects/" + effectname.toLower() + ".desktop");
|
|
|
|
if( !desktopfile.isEmpty() )
|
|
|
|
{
|
|
|
|
KDesktopFile desktopconf( desktopfile );
|
|
|
|
KConfigGroup conf = desktopconf.desktopGroup();
|
|
|
|
libname = conf.readEntry( "X-KDE-Library", libname );
|
|
|
|
}
|
|
|
|
|
|
|
|
KLibrary* library = KLibLoader::self()->library(QFile::encodeName(libname));
|
|
|
|
if( !library )
|
|
|
|
{
|
|
|
|
kError( 1212 ) << k_funcinfo << "couldn't open library for effect '" <<
|
|
|
|
effectname << "'" << endl;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return library;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::loadEffect( const QString& name )
|
|
|
|
{
|
|
|
|
assert( current_paint_screen == 0 );
|
|
|
|
assert( current_paint_window == 0 );
|
|
|
|
assert( current_draw_window == 0 );
|
|
|
|
assert( current_transform == 0 );
|
|
|
|
|
|
|
|
// Make sure a single effect won't be loaded multiple times
|
|
|
|
for(QVector< EffectPair >::const_iterator it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); it++)
|
|
|
|
{
|
|
|
|
if( (*it).first == name )
|
|
|
|
{
|
|
|
|
kDebug( 1212 ) << "EffectsHandler::loadEffect : Effect already loaded : " << name << endl;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
kDebug( 1212 ) << k_funcinfo << "Trying to load " << name << endl;
|
|
|
|
KLibrary* library = findEffectLibrary( name );
|
|
|
|
if( !library )
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString supported_symbol = "effect_supported_" + name;
|
|
|
|
KLibrary::void_function_ptr supported_func = library->resolveFunction(supported_symbol.toAscii().data());
|
|
|
|
QString create_symbol = "effect_create_" + name;
|
|
|
|
KLibrary::void_function_ptr create_func = library->resolveFunction(create_symbol.toAscii().data());
|
|
|
|
if( supported_func )
|
|
|
|
{
|
|
|
|
typedef bool (*t_supportedfunc)();
|
|
|
|
t_supportedfunc supported = reinterpret_cast<t_supportedfunc>(supported_func);
|
|
|
|
if(!supported())
|
|
|
|
{
|
|
|
|
kWarning( 1212 ) << "EffectsHandler::loadEffect : Effect " << name << " is not supported" << endl;
|
|
|
|
library->unload();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(!create_func)
|
|
|
|
{
|
|
|
|
kError( 1212 ) << "EffectsHandler::loadEffect : effect_create function not found" << endl;
|
|
|
|
library->unload();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
typedef Effect* (*t_createfunc)();
|
|
|
|
t_createfunc create = reinterpret_cast<t_createfunc>(create_func);
|
|
|
|
|
|
|
|
Effect* e = create();
|
|
|
|
|
|
|
|
loaded_effects.append( EffectPair( name, e ) );
|
|
|
|
effect_libraries[ name ] = library;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::unloadEffect( const QString& name )
|
|
|
|
{
|
|
|
|
assert( current_paint_screen == 0 );
|
|
|
|
assert( current_paint_window == 0 );
|
|
|
|
assert( current_draw_window == 0 );
|
|
|
|
assert( current_transform == 0 );
|
|
|
|
|
|
|
|
for( QVector< EffectPair >::iterator it = loaded_effects.begin(); it != loaded_effects.end(); it++)
|
|
|
|
{
|
|
|
|
if ( (*it).first == name )
|
|
|
|
{
|
|
|
|
kDebug( 1212 ) << "EffectsHandler::unloadEffect : Unloading Effect : " << name << endl;
|
|
|
|
delete (*it).second;
|
|
|
|
loaded_effects.erase(it);
|
|
|
|
effect_libraries[ name ]->unload();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
kDebug( 1212 ) << "EffectsHandler::unloadEffect : Effect not loaded : " << name << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
//****************************************
|
|
|
|
// EffectWindowImpl
|
|
|
|
//****************************************
|
|
|
|
|
|
|
|
EffectWindowImpl::EffectWindowImpl() : EffectWindow()
|
|
|
|
, toplevel( NULL )
|
|
|
|
, sw( NULL )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectWindowImpl::~EffectWindowImpl()
|
2007-01-05 16:45:56 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectWindowImpl::enablePainting( int reason )
|
2007-02-04 22:19:17 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
sceneWindow()->enablePainting( reason );
|
2007-02-04 22:19:17 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectWindowImpl::disablePainting( int reason )
|
2007-02-04 22:19:17 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
sceneWindow()->disablePainting( reason );
|
|
|
|
}
|
2007-02-04 22:19:17 +00:00
|
|
|
|
2007-04-10 14:48:55 +00:00
|
|
|
void EffectWindowImpl::addRepaint( const QRect& r )
|
|
|
|
{
|
|
|
|
toplevel->addRepaint( r );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectWindowImpl::addRepaint( int x, int y, int w, int h )
|
|
|
|
{
|
|
|
|
toplevel->addRepaint( x, y, w, h );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectWindowImpl::addRepaintFull()
|
|
|
|
{
|
|
|
|
toplevel->addRepaintFull();
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
int EffectWindowImpl::desktop() const
|
|
|
|
{
|
|
|
|
return toplevel->desktop();
|
|
|
|
}
|
2007-02-04 22:19:17 +00:00
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
bool EffectWindowImpl::isOnAllDesktops() const
|
|
|
|
{
|
|
|
|
return desktop() == NET::OnAllDesktops;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString EffectWindowImpl::caption() const
|
|
|
|
{
|
|
|
|
if( Client* c = dynamic_cast<Client*>( toplevel ))
|
|
|
|
return c->caption();
|
2007-02-04 22:19:17 +00:00
|
|
|
else
|
2007-04-10 13:02:08 +00:00
|
|
|
return "";
|
2007-02-04 22:19:17 +00:00
|
|
|
}
|
|
|
|
|
2007-04-12 14:12:34 +00:00
|
|
|
QPixmap EffectWindowImpl::icon() const
|
|
|
|
{
|
|
|
|
if( Client* c = dynamic_cast<Client*>( toplevel ))
|
|
|
|
return c->icon();
|
|
|
|
return QPixmap(); // TODO
|
|
|
|
}
|
|
|
|
|
2007-04-10 14:48:55 +00:00
|
|
|
const EffectWindowGroup* EffectWindowImpl::group() const
|
|
|
|
{
|
|
|
|
if( Client* c = dynamic_cast< Client* >( toplevel ))
|
|
|
|
return c->group()->effectGroup();
|
|
|
|
return NULL; // TODO
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
bool EffectWindowImpl::isMinimized() const
|
2007-02-04 22:19:17 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
if( Client* c = dynamic_cast<Client*>( toplevel ))
|
|
|
|
return c->isMinimized();
|
|
|
|
else
|
|
|
|
return false;
|
|
|
|
}
|
2007-02-04 22:19:17 +00:00
|
|
|
|
2007-04-12 13:12:37 +00:00
|
|
|
double EffectWindowImpl::opacity() const
|
|
|
|
{
|
|
|
|
return toplevel->opacity();
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
bool EffectWindowImpl::isDeleted() const
|
|
|
|
{
|
|
|
|
return (dynamic_cast<Deleted*>( toplevel ) != 0);
|
|
|
|
}
|
2007-02-04 22:19:17 +00:00
|
|
|
|
2007-04-12 11:55:07 +00:00
|
|
|
void EffectWindowImpl::refWindow()
|
|
|
|
{
|
|
|
|
if( Deleted* d = dynamic_cast< Deleted* >( toplevel ))
|
|
|
|
return d->refWindow();
|
|
|
|
abort(); // TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectWindowImpl::unrefWindow()
|
|
|
|
{
|
|
|
|
if( Deleted* d = dynamic_cast< Deleted* >( toplevel ))
|
|
|
|
return d->unrefWindow();
|
|
|
|
abort(); // TODO
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
const Toplevel* EffectWindowImpl::window() const
|
|
|
|
{
|
|
|
|
return toplevel;
|
2007-02-04 22:19:17 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
Toplevel* EffectWindowImpl::window()
|
2007-02-04 22:19:17 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
return toplevel;
|
2007-02-04 22:19:17 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectWindowImpl::setWindow( Toplevel* w )
|
2007-02-01 17:20:48 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
toplevel = w;
|
2007-02-01 17:20:48 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
void EffectWindowImpl::setSceneWindow( Scene::Window* w )
|
|
|
|
{
|
|
|
|
sw = w;
|
|
|
|
}
|
2006-07-04 20:51:01 +00:00
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
Scene::Window* EffectWindowImpl::sceneWindow()
|
|
|
|
{
|
|
|
|
return sw;
|
|
|
|
}
|
2007-02-01 17:20:48 +00:00
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
int EffectWindowImpl::x() const
|
|
|
|
{
|
|
|
|
return toplevel->x();
|
|
|
|
}
|
2007-02-01 17:20:48 +00:00
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
int EffectWindowImpl::y() const
|
2007-02-01 17:20:48 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
return toplevel->y();
|
2007-02-01 17:20:48 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
int EffectWindowImpl::width() const
|
2007-02-11 17:36:32 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
return toplevel->width();
|
2007-02-11 17:36:32 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
int EffectWindowImpl::height() const
|
2007-02-11 17:36:32 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
return toplevel->height();
|
2007-02-11 17:36:32 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
QRect EffectWindowImpl::geometry() const
|
2007-02-01 17:20:48 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
return toplevel->geometry();
|
2007-02-01 17:20:48 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
QSize EffectWindowImpl::size() const
|
2007-02-01 17:20:48 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
return toplevel->size();
|
2007-02-01 17:20:48 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
QPoint EffectWindowImpl::pos() const
|
2007-02-01 17:20:48 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
return toplevel->pos();
|
2007-02-01 17:20:48 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
QRect EffectWindowImpl::rect() const
|
2007-02-01 17:20:48 +00:00
|
|
|
{
|
2007-04-10 13:02:08 +00:00
|
|
|
return toplevel->rect();
|
|
|
|
}
|
|
|
|
|
2007-04-12 11:55:07 +00:00
|
|
|
bool EffectWindowImpl::isUserMove() const
|
|
|
|
{
|
|
|
|
if( Client* c = dynamic_cast< Client* >( toplevel ))
|
|
|
|
return c->isMove();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isUserResize() const
|
|
|
|
{
|
|
|
|
if( Client* c = dynamic_cast< Client* >( toplevel ))
|
|
|
|
return c->isResize();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
QRect EffectWindowImpl::iconGeometry() const
|
|
|
|
{
|
|
|
|
if( Client* c = dynamic_cast< Client* >( toplevel ))
|
|
|
|
return c->iconGeometry();
|
|
|
|
return QRect();
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
bool EffectWindowImpl::isDesktop() const
|
|
|
|
{
|
|
|
|
return toplevel->isDesktop();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isDock() const
|
|
|
|
{
|
|
|
|
return toplevel->isDock();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isToolbar() const
|
|
|
|
{
|
|
|
|
return toplevel->isToolbar();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isTopMenu() const
|
|
|
|
{
|
|
|
|
return toplevel->isTopMenu();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isMenu() const
|
|
|
|
{
|
|
|
|
return toplevel->isMenu();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isNormalWindow() const
|
|
|
|
{
|
|
|
|
return toplevel->isNormalWindow();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isSpecialWindow() const
|
|
|
|
{
|
|
|
|
if( Client* c = dynamic_cast<Client*>( toplevel ))
|
|
|
|
return c->isSpecialWindow();
|
|
|
|
else
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isDialog() const
|
|
|
|
{
|
|
|
|
return toplevel->isDialog();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isSplash() const
|
|
|
|
{
|
|
|
|
return toplevel->isSplash();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isUtility() const
|
|
|
|
{
|
|
|
|
return toplevel->isUtility();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isDropdownMenu() const
|
|
|
|
{
|
|
|
|
return toplevel->isDropdownMenu();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isPopupMenu() const
|
|
|
|
{
|
|
|
|
return toplevel->isPopupMenu();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isTooltip() const
|
|
|
|
{
|
|
|
|
return toplevel->isTooltip();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isNotification() const
|
|
|
|
{
|
|
|
|
return toplevel->isNotification();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isComboBox() const
|
|
|
|
{
|
|
|
|
return toplevel->isComboBox();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool EffectWindowImpl::isDNDIcon() const
|
|
|
|
{
|
|
|
|
return toplevel->isDNDIcon();
|
|
|
|
}
|
|
|
|
|
2007-04-12 13:12:37 +00:00
|
|
|
bool EffectWindowImpl::isModal() const
|
|
|
|
{
|
|
|
|
if( Client* c = dynamic_cast< Client* >( toplevel ))
|
|
|
|
return c->isModal();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectWindow* EffectWindowImpl::findModal()
|
|
|
|
{
|
|
|
|
if( Client* c = dynamic_cast< Client* >( toplevel ))
|
|
|
|
{
|
|
|
|
if( Client* c2 = c->findModal())
|
|
|
|
return c2->effectWindow();
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectWindowList EffectWindowImpl::mainWindows() const
|
|
|
|
{
|
|
|
|
if( Client* c = dynamic_cast< Client* >( toplevel ))
|
|
|
|
{
|
|
|
|
EffectWindowList ret;
|
|
|
|
ClientList mainclients = c->mainClients();
|
|
|
|
foreach( Client* tmp, mainclients )
|
|
|
|
ret.append( tmp->effectWindow());
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
return EffectWindowList();
|
|
|
|
}
|
|
|
|
|
2007-04-11 15:46:46 +00:00
|
|
|
QVector<Vertex>& EffectWindowImpl::vertices()
|
|
|
|
{
|
|
|
|
if( SceneOpenGL::Window* w = dynamic_cast< SceneOpenGL::Window* >( sceneWindow()))
|
|
|
|
return w->vertices();
|
|
|
|
abort(); // TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectWindowImpl::requestVertexGrid(int maxquadsize)
|
|
|
|
{
|
|
|
|
if( SceneOpenGL::Window* w = dynamic_cast< SceneOpenGL::Window* >( sceneWindow()))
|
|
|
|
return w->requestVertexGrid( maxquadsize );
|
|
|
|
abort(); // TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectWindowImpl::markVerticesDirty()
|
|
|
|
{
|
|
|
|
if( SceneOpenGL::Window* w = dynamic_cast< SceneOpenGL::Window* >( sceneWindow()))
|
|
|
|
return w->markVerticesDirty();
|
|
|
|
abort(); // TODO
|
|
|
|
}
|
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
EffectWindow* effectWindow( Toplevel* w )
|
|
|
|
{
|
|
|
|
EffectWindowImpl* ret = w->effectWindow();
|
|
|
|
ret->setSceneWindow( NULL ); // just in case
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectWindow* effectWindow( Scene::Window* w )
|
|
|
|
{
|
|
|
|
EffectWindowImpl* ret = w->window()->effectWindow();
|
|
|
|
ret->setSceneWindow( w );
|
|
|
|
return ret;
|
2007-02-01 17:20:48 +00:00
|
|
|
}
|
|
|
|
|
2007-04-10 14:48:55 +00:00
|
|
|
//****************************************
|
|
|
|
// EffectWindowGroupImpl
|
|
|
|
//****************************************
|
|
|
|
|
|
|
|
|
|
|
|
EffectWindowList EffectWindowGroupImpl::members() const
|
|
|
|
{
|
|
|
|
EffectWindowList ret;
|
|
|
|
foreach( Toplevel* c, group->members())
|
|
|
|
ret.append( c->effectWindow());
|
|
|
|
return ret;
|
|
|
|
}
|
2007-03-30 16:12:07 +00:00
|
|
|
|
2006-07-04 20:51:01 +00:00
|
|
|
} // namespace
|