2007-03-08 16:54:50 +00:00
|
|
|
/*****************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2007 Philip Falkner <philip.falkner@gmail.com>
|
|
|
|
|
|
|
|
You can Freely distribute this program under the GNU General Public
|
|
|
|
License. See the file "COPYING" for the exact licensing terms.
|
|
|
|
******************************************************************/
|
|
|
|
|
|
|
|
#ifndef KWIN_BOXSWITCH_H
|
|
|
|
#define KWIN_BOXSWITCH_H
|
|
|
|
|
2007-03-08 22:12:41 +00:00
|
|
|
#include <effects.h>
|
2007-03-28 20:29:45 +00:00
|
|
|
#include "scene_xrender.h"
|
|
|
|
#include "scene_opengl.h"
|
2007-03-08 16:54:50 +00:00
|
|
|
|
2007-03-14 16:50:19 +00:00
|
|
|
#include <QHash>
|
2007-03-08 22:12:41 +00:00
|
|
|
#include <QPixmap>
|
2007-03-08 16:54:50 +00:00
|
|
|
#include <QRect>
|
2007-03-08 22:12:41 +00:00
|
|
|
#include <QRegion>
|
|
|
|
#include <QSize>
|
2007-03-08 16:54:50 +00:00
|
|
|
|
2007-04-05 12:07:35 +00:00
|
|
|
namespace KWin
|
2007-03-08 16:54:50 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
class BoxSwitchEffect
|
|
|
|
: public Effect
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BoxSwitchEffect();
|
|
|
|
~BoxSwitchEffect();
|
|
|
|
|
|
|
|
virtual void prePaintScreen( int* mask, QRegion* region, int time );
|
|
|
|
virtual void paintScreen( int mask, QRegion region, ScreenPaintData& data );
|
2007-03-25 10:48:07 +00:00
|
|
|
virtual void prePaintWindow( EffectWindow* w, int* mask, QRegion* paint, QRegion* clip, int time );
|
2007-03-08 16:54:50 +00:00
|
|
|
virtual void paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data );
|
|
|
|
|
|
|
|
virtual void windowInputMouseEvent( Window w, QEvent* e );
|
|
|
|
virtual void windowDamaged( EffectWindow* w, const QRect& damage );
|
|
|
|
virtual void windowGeometryShapeChanged( EffectWindow* w, const QRect& old );
|
|
|
|
virtual void tabBoxAdded( int mode );
|
|
|
|
virtual void tabBoxClosed();
|
|
|
|
virtual void tabBoxUpdated();
|
|
|
|
private:
|
|
|
|
class ItemInfo;
|
|
|
|
void setActive();
|
|
|
|
void setInactive();
|
|
|
|
void moveResizeInputWindow( int x, int y, int width, int height );
|
|
|
|
void calculateFrameSize();
|
|
|
|
void calculateItemSizes();
|
|
|
|
|
|
|
|
void paintFrame();
|
|
|
|
void paintHighlight( QRect area, QString text );
|
|
|
|
void paintWindowThumbnail( EffectWindow* w );
|
2007-03-28 20:29:45 +00:00
|
|
|
void paintDesktopThumbnail( int iDesktop );
|
2007-03-08 16:54:50 +00:00
|
|
|
void paintWindowIcon( EffectWindow* w );
|
|
|
|
|
|
|
|
bool mActivated;
|
|
|
|
Window mInput;
|
|
|
|
int mMode;
|
|
|
|
|
|
|
|
QRect frame_area;
|
2007-03-28 20:29:45 +00:00
|
|
|
int frame_margin; // TODO graphical background
|
|
|
|
int highlight_margin; // TODO graphical background
|
2007-03-08 16:54:50 +00:00
|
|
|
QSize item_max_size; // maximum item display size (including highlight)
|
|
|
|
|
Add GLTexture class. This is a convenient wrapper around managing an OpenGL texture, as well as loading an image into it. Includes support for loading from QImage, QPixmap, and a file. Defaults to a GL_TEXTURE_2D target, and will scale image if necessary.
Also add SceneOpenGL::Texture class, based on GLTexture. Optimised for SceneOpenGL::Window, this adds support for loading from an X Pixmap, as well as taking advantage of texture_from_pixmap/shm when available. Automatically detects what texture target should be used, so be sure to enableUnnormalizedTexCoords() before painting.
Make SceneOpenGL::Window, BoxSwitchEffect, and ExplosionEffect use the new classes.
svn path=/branches/work/kwin_composite/; revision=645125
2007-03-21 18:14:09 +00:00
|
|
|
QHash< EffectWindow*, ItemInfo* > windows;
|
2007-03-28 20:29:45 +00:00
|
|
|
ClientList original_windows;
|
2007-03-08 16:54:50 +00:00
|
|
|
EffectWindow* selected_window;
|
2007-03-28 20:29:45 +00:00
|
|
|
QHash< int, ItemInfo* > desktops;
|
|
|
|
QList< int > original_desktops;
|
|
|
|
int selected_desktop;
|
2007-03-08 16:54:50 +00:00
|
|
|
|
|
|
|
int painting_desktop;
|
2007-03-08 22:12:41 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_XRENDER
|
|
|
|
XRenderPictFormat* alphaFormat;
|
|
|
|
#endif
|
2007-03-08 16:54:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class BoxSwitchEffect::ItemInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
QRect area; // maximal painting area, including any frames/highlights/etc.
|
|
|
|
QRegion clickable;
|
|
|
|
QRect thumbnail;
|
|
|
|
QPixmap icon;
|
2007-03-08 22:12:41 +00:00
|
|
|
#ifdef HAVE_OPENGL
|
Add GLTexture class. This is a convenient wrapper around managing an OpenGL texture, as well as loading an image into it. Includes support for loading from QImage, QPixmap, and a file. Defaults to a GL_TEXTURE_2D target, and will scale image if necessary.
Also add SceneOpenGL::Texture class, based on GLTexture. Optimised for SceneOpenGL::Window, this adds support for loading from an X Pixmap, as well as taking advantage of texture_from_pixmap/shm when available. Automatically detects what texture target should be used, so be sure to enableUnnormalizedTexCoords() before painting.
Make SceneOpenGL::Window, BoxSwitchEffect, and ExplosionEffect use the new classes.
svn path=/branches/work/kwin_composite/; revision=645125
2007-03-21 18:14:09 +00:00
|
|
|
GLTexture iconTexture;
|
2007-03-08 22:12:41 +00:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_XRENDER
|
|
|
|
Picture iconPicture;
|
|
|
|
#endif
|
2007-03-08 16:54:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|