00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _BGMONITOR_H_
00026 #define _BGMONITOR_H_
00027
00028 #include <tqlabel.h>
00029 #include <tqvaluevector.h>
00030 #include <tqwidget.h>
00031
00032 class BGMonitor;
00033 class BGMonitorLabel;
00034 class KPixmap;
00035
00040 class BGMonitorArrangement : public QWidget
00041 {
00042 Q_OBJECT
00043 public:
00044 BGMonitorArrangement(TQWidget *parent, const char *name=0L);
00045
00050 void setPixmap( const KPixmap & pm );
00051 TQSize combinedPreviewSize() const { return m_combinedPreviewSize; }
00052 TQSize maxPreviewSize() const { return m_maxPreviewSize; }
00053 unsigned numMonitors() const { return m_pBGMonitor.size(); }
00054
00055 BGMonitor * monitor( unsigned screen ) const;
00056 void updateArrangement();
00057
00058 signals:
00059 void imageDropped(const TQString &);
00060
00061 protected:
00062 virtual void resizeEvent( TQResizeEvent * );
00063 TQRect expandToPreview( TQRect r ) const;
00064 TQSize expandToPreview( TQSize s ) const;
00065 TQPoint expandToPreview( TQPoint p ) const;
00066
00067 TQValueVector<BGMonitorLabel*> m_pBGMonitor;
00068 TQSize m_combinedPreviewSize;
00069 TQSize m_maxPreviewSize;
00070 };
00071
00075 class BGMonitorLabel : public QLabel
00076 {
00077 public:
00078 BGMonitorLabel(TQWidget *parent, const char *name=0L);
00079
00080 BGMonitor * monitor() const { return m_pBGMonitor; }
00081 void updateMonitorGeometry();
00082
00083 void setPreviewPosition( TQRect r ) { m_previewPosition = r; }
00084 TQRect previewPosition() const { return m_previewPosition; }
00085
00086 protected:
00087 virtual void resizeEvent( TQResizeEvent * );
00088 BGMonitor * m_pBGMonitor;
00089 TQRect m_previewPosition;
00090 };
00091
00092
00096 class BGMonitor : public QLabel
00097 {
00098 Q_OBJECT
00099 public:
00100 BGMonitor(TQWidget *parent, const char *name=0L);
00101
00102 signals:
00103 void imageDropped(const TQString &);
00104
00105 protected:
00106 virtual void dropEvent(TQDropEvent *);
00107 virtual void dragEnterEvent(TQDragEnterEvent *);
00108 };
00109
00110
00111 #endif