2007-11-27 19:40:25 +00:00
|
|
|
/********************************************************************
|
2007-04-29 17:35:43 +00:00
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
|
2007-11-27 19:40:25 +00:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
#ifndef KWIN_EFFECTSIMPL_H
|
|
|
|
#define KWIN_EFFECTSIMPL_H
|
|
|
|
|
|
|
|
#include "kwineffects.h"
|
|
|
|
|
|
|
|
#include "scene.h"
|
|
|
|
|
|
|
|
#include <QStack>
|
2010-05-25 16:56:23 +00:00
|
|
|
#include <QHash>
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
|
2007-07-06 12:38:41 +00:00
|
|
|
class KService;
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
class EffectsHandlerImpl : public EffectsHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
EffectsHandlerImpl(CompositingType type);
|
|
|
|
virtual ~EffectsHandlerImpl();
|
2007-07-07 14:01:32 +00:00
|
|
|
virtual void prePaintScreen( ScreenPrePaintData& data, int time );
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual void paintScreen( int mask, QRegion region, ScreenPaintData& data );
|
|
|
|
virtual void postPaintScreen();
|
2007-07-07 14:01:32 +00:00
|
|
|
virtual void prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time );
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data );
|
|
|
|
virtual void postPaintWindow( EffectWindow* w );
|
2010-07-24 16:29:16 +00:00
|
|
|
virtual void paintEffectFrame( EffectFrame* frame, QRegion region, double opacity, double frameOpacity );
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2010-05-06 14:54:34 +00:00
|
|
|
bool providesResizeEffect();
|
2010-04-25 18:40:04 +00:00
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual void drawWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data );
|
|
|
|
|
2008-10-17 10:30:43 +00:00
|
|
|
virtual void buildQuads( EffectWindow* w, WindowQuadList& quadList );
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual void activateWindow( EffectWindow* c );
|
|
|
|
virtual EffectWindow* activeWindow() const;
|
2009-10-05 04:06:20 +00:00
|
|
|
virtual void moveWindow( EffectWindow* w, const QPoint& pos, bool snap = false, double snapAdjust = 1.0 );
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual void windowToDesktop( EffectWindow* w, int desktop );
|
2009-11-19 08:34:28 +00:00
|
|
|
virtual void windowToScreen( EffectWindow* w, int screen );
|
2009-06-28 17:17:29 +00:00
|
|
|
virtual void setShowingDesktop( bool showing );
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
virtual int currentDesktop() const;
|
|
|
|
virtual int numberOfDesktops() const;
|
|
|
|
virtual void setCurrentDesktop( int desktop );
|
2010-03-28 09:04:14 +00:00
|
|
|
virtual void setNumberOfDesktops( int desktops );
|
2009-02-14 14:49:46 +00:00
|
|
|
virtual QSize desktopGridSize() const;
|
|
|
|
virtual int desktopGridWidth() const;
|
|
|
|
virtual int desktopGridHeight() const;
|
|
|
|
virtual int workspaceWidth() const;
|
|
|
|
virtual int workspaceHeight() const;
|
|
|
|
virtual int desktopAtCoords( QPoint coords ) const;
|
|
|
|
virtual QPoint desktopGridCoords( int id ) const;
|
|
|
|
virtual QPoint desktopCoords( int id ) const;
|
|
|
|
virtual int desktopAbove( int desktop = 0, bool wrap = true ) const;
|
|
|
|
virtual int desktopToRight( int desktop = 0, bool wrap = true ) const;
|
|
|
|
virtual int desktopBelow( int desktop = 0, bool wrap = true ) const;
|
|
|
|
virtual int desktopToLeft( int desktop = 0, bool wrap = true ) const;
|
2009-02-14 15:40:52 +00:00
|
|
|
virtual bool isDesktopLayoutDynamic() const;
|
2009-02-14 14:49:46 +00:00
|
|
|
virtual int addDesktop( QPoint coords );
|
|
|
|
virtual void deleteDesktop( int id );
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual QString desktopName( int desktop ) const;
|
2009-02-14 14:49:46 +00:00
|
|
|
virtual bool optionRollOverDesktops() const;
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual int displayWidth() const;
|
|
|
|
virtual int displayHeight() const;
|
|
|
|
virtual QPoint cursorPos() const;
|
|
|
|
virtual bool grabKeyboard( Effect* effect );
|
|
|
|
virtual void ungrabKeyboard();
|
2009-09-02 02:30:22 +00:00
|
|
|
virtual void* getProxy( QString name );
|
2009-02-01 15:16:52 +00:00
|
|
|
virtual void startMousePolling();
|
|
|
|
virtual void stopMousePolling();
|
2008-01-02 15:37:46 +00:00
|
|
|
virtual EffectWindow* findWindow( WId id ) const;
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual EffectWindowList stackingOrder() const;
|
2007-05-24 14:41:56 +00:00
|
|
|
virtual void setElevatedWindow( EffectWindow* w, bool set );
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
virtual void setTabBoxWindow(EffectWindow*);
|
|
|
|
virtual void setTabBoxDesktop(int);
|
|
|
|
virtual EffectWindowList currentTabBoxWindowList() const;
|
|
|
|
virtual void refTabBox();
|
|
|
|
virtual void unrefTabBox();
|
|
|
|
virtual void closeTabBox();
|
|
|
|
virtual QList< int > currentTabBoxDesktopList() const;
|
|
|
|
virtual int currentTabBoxDesktop() const;
|
|
|
|
virtual EffectWindow* currentTabBoxWindow() const;
|
|
|
|
|
2007-11-01 17:47:41 +00:00
|
|
|
virtual void setActiveFullScreenEffect( Effect* e );
|
|
|
|
virtual Effect* activeFullScreenEffect() const;
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual void pushRenderTarget(GLRenderTarget* target);
|
|
|
|
virtual GLRenderTarget* popRenderTarget();
|
|
|
|
|
|
|
|
virtual void addRepaintFull();
|
|
|
|
virtual void addRepaint( const QRect& r );
|
2008-06-19 14:16:21 +00:00
|
|
|
virtual void addRepaint( const QRegion& r );
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual void addRepaint( int x, int y, int w, int h );
|
2007-11-20 18:58:30 +00:00
|
|
|
virtual int activeScreen() const;
|
2008-06-09 16:09:56 +00:00
|
|
|
virtual int numScreens() const;
|
2008-06-19 14:16:21 +00:00
|
|
|
virtual int screenNumber( const QPoint& pos ) const;
|
2007-11-20 18:58:30 +00:00
|
|
|
virtual QRect clientArea( clientAreaOption, int screen, int desktop ) const;
|
|
|
|
virtual QRect clientArea( clientAreaOption, const EffectWindow* c ) const;
|
|
|
|
virtual QRect clientArea( clientAreaOption, const QPoint& p, int desktop ) const;
|
2008-08-30 07:25:54 +00:00
|
|
|
virtual double animationTimeFactor() const;
|
2008-10-17 10:30:43 +00:00
|
|
|
virtual WindowQuadType newWindowQuadType();
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
virtual Window createInputWindow( Effect* e, int x, int y, int w, int h, const QCursor& cursor );
|
2007-11-20 16:19:06 +00:00
|
|
|
using EffectsHandler::createInputWindow;
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual void destroyInputWindow( Window w );
|
|
|
|
virtual bool checkInputWindowEvent( XEvent* e );
|
|
|
|
virtual void checkInputWindowStacking();
|
|
|
|
|
|
|
|
virtual void checkElectricBorder(const QPoint &pos, Time time);
|
|
|
|
virtual void reserveElectricBorder( ElectricBorder border );
|
|
|
|
virtual void unreserveElectricBorder( ElectricBorder border );
|
|
|
|
virtual void reserveElectricBorderSwitching( bool reserve );
|
|
|
|
|
|
|
|
virtual unsigned long xrenderBufferPicture();
|
2007-05-28 11:23:00 +00:00
|
|
|
virtual void reconfigure();
|
2008-01-02 15:21:33 +00:00
|
|
|
virtual void registerPropertyType( long atom, bool reg );
|
2010-02-01 07:44:27 +00:00
|
|
|
virtual QByteArray readRootProperty( long atom, long type, int format ) const;
|
|
|
|
virtual void deleteRootProperty( long atom ) const;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2008-10-17 10:30:43 +00:00
|
|
|
virtual bool hasDecorationShadows() const;
|
|
|
|
|
2010-03-05 18:21:14 +00:00
|
|
|
virtual bool decorationsHaveAlpha() const;
|
|
|
|
|
2010-07-18 16:32:37 +00:00
|
|
|
virtual EffectFrame* effectFrame( EffectFrameStyle style, bool staticSize, const QPoint& position, Qt::Alignment alignment ) const;
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
// internal (used by kwin core or compositing code)
|
|
|
|
void startPaint();
|
|
|
|
void windowUserMovedResized( EffectWindow* c, bool first, bool last );
|
2009-10-30 14:22:33 +00:00
|
|
|
void windowMoveResizeGeometryUpdate( EffectWindow* c, const QRect& geometry );
|
2007-09-03 15:00:43 +00:00
|
|
|
void windowOpacityChanged( EffectWindow* c, double old_opacity );
|
2007-04-29 17:35:43 +00:00
|
|
|
void windowAdded( EffectWindow* c );
|
|
|
|
void windowClosed( EffectWindow* c );
|
|
|
|
void windowDeleted( EffectWindow* c );
|
|
|
|
void windowActivated( EffectWindow* c );
|
|
|
|
void windowMinimized( EffectWindow* c );
|
|
|
|
void windowUnminimized( EffectWindow* c );
|
2009-11-15 03:24:04 +00:00
|
|
|
void clientGroupItemSwitched( EffectWindow* from, EffectWindow* to );
|
|
|
|
void clientGroupItemAdded( EffectWindow* from, EffectWindow* to );
|
|
|
|
void clientGroupItemRemoved( EffectWindow* c, EffectWindow* group );
|
2007-04-29 17:35:43 +00:00
|
|
|
void desktopChanged( int old );
|
|
|
|
void windowDamaged( EffectWindow* w, const QRect& r );
|
|
|
|
void windowGeometryShapeChanged( EffectWindow* w, const QRect& old );
|
|
|
|
void tabBoxAdded( int mode );
|
|
|
|
void tabBoxClosed();
|
|
|
|
void tabBoxUpdated();
|
2009-10-30 09:16:41 +00:00
|
|
|
void tabBoxKeyEvent( QKeyEvent* event );
|
2007-04-29 17:35:43 +00:00
|
|
|
bool borderActivated( ElectricBorder border );
|
2008-01-02 15:34:12 +00:00
|
|
|
void mouseChanged( const QPoint& pos, const QPoint& oldpos,
|
|
|
|
Qt::MouseButtons buttons, Qt::MouseButtons oldbuttons,
|
|
|
|
Qt::KeyboardModifiers modifiers, Qt::KeyboardModifiers oldmodifiers );
|
2007-04-29 17:35:43 +00:00
|
|
|
void grabbedKeyboardEvent( QKeyEvent* e );
|
|
|
|
bool hasKeyboardGrab() const;
|
2008-01-02 15:21:33 +00:00
|
|
|
void propertyNotify( EffectWindow* c, long atom );
|
2010-03-28 09:04:14 +00:00
|
|
|
void numberDesktopsChanged( int old );
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2007-07-20 21:13:10 +00:00
|
|
|
bool loadEffect( const QString& name );
|
2007-04-29 17:35:43 +00:00
|
|
|
void toggleEffect( const QString& name );
|
|
|
|
void unloadEffect( const QString& name );
|
2008-10-02 09:27:32 +00:00
|
|
|
void reconfigureEffect( const QString& name );
|
2007-05-29 11:42:47 +00:00
|
|
|
bool isEffectLoaded( const QString& name );
|
2008-06-10 09:32:46 +00:00
|
|
|
QStringList loadedEffects() const;
|
|
|
|
QStringList listOfEffects() const;
|
2007-05-29 11:42:47 +00:00
|
|
|
|
2008-01-13 13:00:15 +00:00
|
|
|
QList<EffectWindow*> elevatedWindows() const;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
protected:
|
2007-07-06 12:38:41 +00:00
|
|
|
KLibrary* findEffectLibrary( KService* service );
|
|
|
|
void effectsChanged();
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
Effect* keyboard_grab_effect;
|
|
|
|
QStack<GLRenderTarget*> render_targets;
|
2007-11-01 17:47:41 +00:00
|
|
|
Effect* fullscreen_effect;
|
2008-01-13 13:00:15 +00:00
|
|
|
QList<EffectWindow*> elevated_windows;
|
2007-07-06 12:38:41 +00:00
|
|
|
QMultiMap< int, EffectPair > effect_order;
|
2008-01-02 15:21:33 +00:00
|
|
|
QHash< long, int > registered_atoms;
|
2008-10-17 10:30:43 +00:00
|
|
|
int next_window_quad_type;
|
2009-02-01 15:16:52 +00:00
|
|
|
int mouse_poll_ref_count;
|
2010-07-24 16:29:16 +00:00
|
|
|
int current_paint_effectframe;
|
2007-04-29 17:35:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class EffectWindowImpl : public EffectWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
EffectWindowImpl();
|
|
|
|
virtual ~EffectWindowImpl();
|
|
|
|
|
|
|
|
virtual void enablePainting( int reason );
|
|
|
|
virtual void disablePainting( int reason );
|
|
|
|
virtual bool isPaintingEnabled();
|
|
|
|
virtual void addRepaint( const QRect& r );
|
|
|
|
virtual void addRepaint( int x, int y, int w, int h );
|
|
|
|
virtual void addRepaintFull();
|
|
|
|
|
|
|
|
virtual void refWindow();
|
|
|
|
virtual void unrefWindow();
|
|
|
|
virtual bool isDeleted() const;
|
|
|
|
|
|
|
|
virtual bool isOnAllDesktops() const;
|
|
|
|
virtual int desktop() const; // prefer isOnXXX()
|
|
|
|
virtual bool isMinimized() const;
|
2007-09-03 15:00:43 +00:00
|
|
|
virtual double opacity() const;
|
2009-02-08 15:47:37 +00:00
|
|
|
virtual bool hasAlpha() const;
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual QString caption() const;
|
|
|
|
virtual QPixmap icon() const;
|
|
|
|
virtual QString windowClass() const;
|
2007-11-13 19:59:53 +00:00
|
|
|
virtual QString windowRole() const;
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual const EffectWindowGroup* group() const;
|
|
|
|
|
|
|
|
virtual int x() const;
|
|
|
|
virtual int y() const;
|
|
|
|
virtual int width() const;
|
|
|
|
virtual int height() const;
|
|
|
|
virtual QRect geometry() const;
|
2007-12-07 18:03:24 +00:00
|
|
|
virtual QRegion shape() const;
|
2008-06-09 16:09:56 +00:00
|
|
|
virtual int screen() const;
|
2008-01-03 19:39:18 +00:00
|
|
|
virtual bool hasOwnShape() const;
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual QPoint pos() const;
|
|
|
|
virtual QSize size() const;
|
|
|
|
virtual QRect rect() const;
|
|
|
|
virtual bool isMovable() const;
|
2008-07-25 10:31:47 +00:00
|
|
|
virtual bool isMovableAcrossScreens() const;
|
2007-04-29 17:35:43 +00:00
|
|
|
virtual bool isUserMove() const;
|
|
|
|
virtual bool isUserResize() const;
|
|
|
|
virtual QRect iconGeometry() const;
|
2007-07-19 13:32:46 +00:00
|
|
|
virtual QRect contentsRect() const;
|
2010-03-12 16:33:01 +00:00
|
|
|
virtual QRect decorationInnerRect() const;
|
2008-01-02 15:21:33 +00:00
|
|
|
virtual QByteArray readProperty( long atom, long type, int format ) const;
|
2009-06-27 10:21:49 +00:00
|
|
|
virtual void deleteProperty( long atom ) const;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
virtual bool isDesktop() const;
|
|
|
|
virtual bool isDock() const;
|
|
|
|
virtual bool isToolbar() const;
|
|
|
|
virtual bool isTopMenu() const;
|
|
|
|
virtual bool isMenu() const;
|
|
|
|
virtual bool isNormalWindow() const; // normal as in 'NET::Normal or NET::Unknown non-transient'
|
|
|
|
virtual bool isSpecialWindow() const;
|
|
|
|
virtual bool isDialog() const;
|
|
|
|
virtual bool isSplash() const;
|
|
|
|
virtual bool isUtility() const;
|
|
|
|
virtual bool isDropdownMenu() const;
|
|
|
|
virtual bool isPopupMenu() const; // a context popup, not dropdown, not torn-off
|
|
|
|
virtual bool isTooltip() const;
|
|
|
|
virtual bool isNotification() const;
|
|
|
|
virtual bool isComboBox() const;
|
|
|
|
virtual bool isDNDIcon() const;
|
2008-01-02 15:17:58 +00:00
|
|
|
virtual bool isManaged() const; // managed or override-redirect
|
2009-02-08 08:45:21 +00:00
|
|
|
virtual bool acceptsFocus() const;
|
2009-05-17 18:26:49 +00:00
|
|
|
virtual bool keepAbove() const;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
virtual bool isModal() const;
|
|
|
|
virtual EffectWindow* findModal();
|
|
|
|
virtual EffectWindowList mainWindows() const;
|
|
|
|
|
2010-05-03 20:04:44 +00:00
|
|
|
virtual bool isSkipSwitcher() const;
|
|
|
|
|
2008-10-18 10:31:59 +00:00
|
|
|
virtual WindowQuadList buildQuads( bool force = false ) const;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2009-06-28 17:17:29 +00:00
|
|
|
virtual void minimize() const;
|
|
|
|
virtual void unminimize() const;
|
|
|
|
virtual void closeWindow() const;
|
|
|
|
|
2009-11-15 03:24:04 +00:00
|
|
|
virtual bool visibleInClientGroup() const;
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
const Toplevel* window() const;
|
|
|
|
Toplevel* window();
|
|
|
|
|
|
|
|
void setWindow( Toplevel* w ); // internal
|
|
|
|
void setSceneWindow( Scene::Window* w ); // internal
|
2007-08-08 14:42:06 +00:00
|
|
|
const Scene::Window* sceneWindow() const; // internal
|
2007-04-29 17:35:43 +00:00
|
|
|
Scene::Window* sceneWindow(); // internal
|
2010-01-03 17:50:38 +00:00
|
|
|
|
|
|
|
void setData( int role, const QVariant &data );
|
|
|
|
QVariant data( int role ) const;
|
2007-04-29 17:35:43 +00:00
|
|
|
private:
|
|
|
|
Toplevel* toplevel;
|
|
|
|
Scene::Window* sw; // This one is used only during paint pass.
|
2010-05-25 16:56:23 +00:00
|
|
|
QHash<int, QVariant> dataMap;
|
2007-04-29 17:35:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class EffectWindowGroupImpl
|
|
|
|
: public EffectWindowGroup
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
EffectWindowGroupImpl( Group* g );
|
|
|
|
virtual EffectWindowList members() const;
|
|
|
|
private:
|
|
|
|
Group* group;
|
|
|
|
};
|
|
|
|
|
2010-07-18 16:32:37 +00:00
|
|
|
class EffectFrameImpl
|
|
|
|
: public QObject, public EffectFrame
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit EffectFrameImpl( EffectFrameStyle style, bool staticSize = true, QPoint position = QPoint( -1, -1 ),
|
|
|
|
Qt::Alignment alignment = Qt::AlignCenter );
|
|
|
|
virtual ~EffectFrameImpl();
|
|
|
|
|
|
|
|
virtual void free();
|
|
|
|
virtual void render( QRegion region = infiniteRegion(), double opacity = 1.0, double frameOpacity = 1.0 );
|
|
|
|
virtual Qt::Alignment alignment() const;
|
|
|
|
virtual void setAlignment( Qt::Alignment alignment );
|
|
|
|
virtual const QFont& font() const;
|
|
|
|
virtual void setFont( const QFont& font );
|
|
|
|
virtual const QRect& geometry() const;
|
|
|
|
virtual void setGeometry( const QRect& geometry, bool force = false );
|
|
|
|
virtual const QPixmap& icon() const;
|
|
|
|
virtual void setIcon( const QPixmap& icon );
|
|
|
|
virtual const QSize& iconSize() const;
|
|
|
|
virtual void setIconSize( const QSize& size );
|
|
|
|
virtual void setPosition( const QPoint& point );
|
|
|
|
virtual const QString& text() const;
|
|
|
|
virtual void setText( const QString& text );
|
|
|
|
EffectFrameStyle style() const
|
|
|
|
{
|
|
|
|
return m_style;
|
|
|
|
};
|
|
|
|
Plasma::FrameSvg& frame()
|
|
|
|
{
|
|
|
|
return m_frame;
|
|
|
|
}
|
|
|
|
bool isStatic() const
|
|
|
|
{
|
|
|
|
return m_static;
|
|
|
|
};
|
2010-07-26 20:17:54 +00:00
|
|
|
void finalRender( QRegion region, double opacity, double frameOpacity ) const;
|
|
|
|
virtual void setShader( GLShader* shader )
|
|
|
|
{
|
|
|
|
m_shader = shader;
|
|
|
|
}
|
|
|
|
virtual GLShader* shader() const
|
|
|
|
{
|
|
|
|
return m_shader;
|
|
|
|
}
|
2010-07-26 20:00:04 +00:00
|
|
|
virtual void setSelection( const QRect& selection );
|
|
|
|
const QRect& selection() const
|
|
|
|
{
|
|
|
|
return m_selectionGeometry;
|
|
|
|
}
|
|
|
|
Plasma::FrameSvg& selectionFrame()
|
|
|
|
{
|
|
|
|
return m_selection;
|
|
|
|
}
|
2010-07-18 16:32:37 +00:00
|
|
|
|
|
|
|
private Q_SLOTS:
|
|
|
|
void plasmaThemeChanged();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Q_DISABLE_COPY( EffectFrameImpl ) // As we need to use Qt slots we cannot copy this class
|
|
|
|
|
|
|
|
void autoResize(); // Auto-resize if not a static size
|
|
|
|
|
|
|
|
EffectFrameStyle m_style;
|
|
|
|
Plasma::FrameSvg m_frame; // TODO: share between all EffectFrames
|
2010-07-26 20:00:04 +00:00
|
|
|
Plasma::FrameSvg m_selection;
|
2010-07-18 16:32:37 +00:00
|
|
|
|
|
|
|
// Position
|
|
|
|
bool m_static;
|
|
|
|
QPoint m_point;
|
|
|
|
Qt::Alignment m_alignment;
|
|
|
|
QRect m_geometry;
|
|
|
|
|
|
|
|
// Contents
|
|
|
|
QString m_text;
|
|
|
|
QFont m_font;
|
|
|
|
QPixmap m_icon;
|
|
|
|
QSize m_iconSize;
|
2010-07-26 20:00:04 +00:00
|
|
|
QRect m_selectionGeometry;
|
2010-07-18 16:32:37 +00:00
|
|
|
|
|
|
|
Scene::EffectFrame* m_sceneFrame;
|
2010-07-24 16:29:16 +00:00
|
|
|
GLShader* m_shader;
|
2010-07-18 16:32:37 +00:00
|
|
|
};
|
2007-05-24 14:41:56 +00:00
|
|
|
|
|
|
|
inline
|
2008-01-13 13:00:15 +00:00
|
|
|
QList<EffectWindow*> EffectsHandlerImpl::elevatedWindows() const
|
2007-05-24 14:41:56 +00:00
|
|
|
{
|
|
|
|
return elevated_windows;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
inline
|
|
|
|
EffectWindowGroupImpl::EffectWindowGroupImpl( Group* g )
|
|
|
|
: group( g )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
EffectWindow* effectWindow( Toplevel* w );
|
|
|
|
EffectWindow* effectWindow( Scene::Window* w );
|
|
|
|
|
2007-08-08 14:42:06 +00:00
|
|
|
inline
|
|
|
|
const Scene::Window* EffectWindowImpl::sceneWindow() const
|
|
|
|
{
|
|
|
|
return sw;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
|
|
|
Scene::Window* EffectWindowImpl::sceneWindow()
|
|
|
|
{
|
|
|
|
return sw;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
|
|
|
const Toplevel* EffectWindowImpl::window() const
|
|
|
|
{
|
|
|
|
return toplevel;
|
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
|
|
|
Toplevel* EffectWindowImpl::window()
|
|
|
|
{
|
|
|
|
return toplevel;
|
|
|
|
}
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|