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 13:02:08 +00:00
|
|
|
#include "workspace.h"
|
2006-07-06 13:17:44 +00:00
|
|
|
|
2007-04-10 13:02:08 +00:00
|
|
|
#include "kdebug.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 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;
|
|
|
|
EffectsHandler::windowOpacityChanged( c, old_opacity );
|
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();
|
|
|
|
}
|
|
|
|
|
|
|
|
int EffectsHandlerImpl::displayWidth() const
|
|
|
|
{
|
|
|
|
return KWin::displayWidth();
|
|
|
|
}
|
|
|
|
|
|
|
|
int EffectsHandlerImpl::displayHeight() const
|
|
|
|
{
|
|
|
|
return KWin::displayWidth();
|
|
|
|
}
|
|
|
|
|
|
|
|
QPoint EffectsHandlerImpl::cursorPos() const
|
|
|
|
{
|
|
|
|
return KWin::cursorPos();
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectWindowList EffectsHandlerImpl::stackingOrder() const
|
|
|
|
{
|
|
|
|
ClientList list = Workspace::self()->stackingOrder();
|
|
|
|
EffectWindowList ret;
|
|
|
|
foreach( Client* c, list )
|
|
|
|
ret.append( effectWindow( c ));
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::addRepaintFull()
|
|
|
|
{
|
|
|
|
Workspace::self()->addRepaintFull();
|
|
|
|
}
|
|
|
|
|
|
|
|
QRect EffectsHandlerImpl::clientArea( clientAreaOption opt, const QPoint& p, int desktop ) const
|
|
|
|
{
|
|
|
|
return Workspace::self()->clientArea( opt, p, desktop );
|
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
Workspace::self()->checkElectricBorder( pos, time );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::reserveElectricBorder( ElectricBorder border )
|
|
|
|
{
|
|
|
|
Workspace::self()->reserveElectricBorder( border );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::unreserveElectricBorder( ElectricBorder border )
|
|
|
|
{
|
|
|
|
Workspace::self()->unreserveElectricBorder( border );
|
|
|
|
}
|
|
|
|
|
|
|
|
void EffectsHandlerImpl::reserveElectricBorderSwitching( bool reserve )
|
|
|
|
{
|
|
|
|
Workspace::self()->reserveElectricBorderSwitching( reserve );
|
|
|
|
}
|
|
|
|
|
|
|
|
//****************************************
|
|
|
|
// 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-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-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-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();
|
|
|
|
}
|
|
|
|
|
|
|
|
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();
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|