krootpixmap.h
00001 /* vi: ts=8 sts=4 sw=4 00002 * 00003 * $Id$ 00004 * This file is part of the KDE project, module kdesktop. 00005 * Copyright (C) 1999,2000 Geert Jansen <jansen@kde.org> 00006 * 00007 * You can Freely distribute this program under the GNU Library General 00008 * Public License. See the file "COPYING.LIB" for the exact licensing terms. 00009 */ 00010 00011 #ifndef __KRootPixmap_h_Included__ 00012 #define __KRootPixmap_h_Included__ 00013 00014 #include <tqobject.h> 00015 #include <tqcolor.h> 00016 #include <kdelibs_export.h> 00017 00018 #ifndef Q_WS_QWS //FIXME 00019 00020 class TQRect; 00021 class TQWidget; 00022 class TQTimer; 00023 class KSharedPixmap; 00024 class KRootPixmapData; 00025 00046 class KDEUI_EXPORT KRootPixmap: public TQObject 00047 { 00048 Q_OBJECT 00049 00050 public: 00060 KRootPixmap( TQWidget *target, const char *name=0 ); 00061 00066 KRootPixmap( TQWidget *target, TQObject *parent, const char *name=0 ); 00067 00071 virtual ~KRootPixmap(); 00072 00077 bool isAvailable() const; 00078 00082 bool isActive() const { return m_bActive; } 00083 00087 int currentDesktop() const; 00088 00093 bool customPainting() const { return m_bCustomPaint; } 00094 00095 #ifndef KDE_NO_COMPAT 00096 00100 KDE_DEPRECATED bool checkAvailable(bool) { return isAvailable(); } 00101 #endif 00102 00106 const TQColor &color() const { return m_FadeColor; } 00107 00111 const double &blurRadius() const { return m_BlurRadius; } 00112 00116 const double &blurSigma() const { return m_BlurSigma; } 00117 00121 double opacity() const { return m_Fade; } 00122 00123 public slots: 00127 virtual void start(); 00128 00132 virtual void stop(); 00133 00144 void setFadeEffect(double opacity, const TQColor &color); 00145 00156 void setBlurEffect(double radius, double sigma); 00157 00164 void repaint( bool force ); 00165 00171 void repaint(); 00172 00179 void setCustomPainting( bool enable ) { m_bCustomPaint = enable; } 00180 00185 void enableExports(); 00186 00190 static TQString pixmapName(int desk); 00191 signals: 00198 void backgroundUpdated( const TQPixmap &pm ); 00199 00200 protected: 00205 virtual bool eventFilter(TQObject *, TQEvent *); 00206 00212 virtual void updateBackground( KSharedPixmap * ); 00213 00214 private slots: 00215 void slotBackgroundChanged(int); 00216 void slotDone(bool); 00217 void desktopChanged(int desktop); 00218 void desktopChanged( WId window, unsigned int properties ); 00219 00220 private: 00221 bool m_bActive, m_bInit, m_bCustomPaint; 00222 int m_Desk; 00223 00224 double m_Fade; 00225 TQColor m_FadeColor; 00226 double m_BlurRadius; 00227 double m_BlurSigma; 00228 00229 TQRect m_Rect; 00230 TQWidget *m_pWidget; 00231 TQTimer *m_pTimer; 00232 KSharedPixmap *m_pPixmap; 00233 KRootPixmapData *d; 00234 00235 void init(); 00236 }; 00237 00238 #endif // ! Q_WS_QWS 00239 #endif // __KRootPixmap_h_Included__ 00240