| Home · All Namespaces · All Classes |
00001 /*************************************************************************** 00002 ** 00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 00004 ** All rights reserved. 00005 ** Contact: Nokia Corporation (directui@nokia.com) 00006 ** 00007 ** This file is part of mhome. 00008 ** 00009 ** If you have questions regarding the use of this file, please contact 00010 ** Nokia at directui@nokia.com. 00011 ** 00012 ** This library is free software; you can redistribute it and/or 00013 ** modify it under the terms of the GNU Lesser General Public 00014 ** License version 2.1 as published by the Free Software Foundation 00015 ** and appearing in the file LICENSE.LGPL included in the packaging 00016 ** of this file. 00017 ** 00018 ****************************************************************************/ 00019 00020 #ifndef SWITCHERBUTTONVIEW_H 00021 #define SWITCHERBUTTONVIEW_H 00022 00023 #include <MButtonView> 00024 #include <QTimer> 00025 #include "switcherbuttonmodel.h" 00026 #include "switcherbuttonstyle.h" 00027 #include "x11wrapper.h" 00028 00029 class SwitcherButton; 00030 class XEventListener; 00031 00037 class SwitcherButtonView : public MButtonView 00038 { 00039 Q_OBJECT 00040 M_VIEW(SwitcherButtonModel, SwitcherButtonStyle) 00041 00042 public: 00048 SwitcherButtonView(SwitcherButton *controller); 00049 00053 virtual ~SwitcherButtonView(); 00054 00056 virtual void drawBackground(QPainter *painter, const QStyleOptionGraphicsItem *option) const; 00057 virtual void drawContents(QPainter *painter, const QStyleOptionGraphicsItem *option) const; 00058 virtual void applyStyle(); 00060 00066 bool windowFullyObscured(Window window); 00067 00068 protected slots: 00070 virtual void updateData(const QList<const char *>& modifications); 00072 00076 virtual void damageEvent(Qt::HANDLE &damage, short &x, short &y, unsigned short &width, unsigned short &height); 00077 00081 void setOnDisplay(); 00082 00086 void unsetOnDisplay(); 00087 00088 private slots: 00092 void updateXWindowIconGeometry(); 00093 00097 void updateXWindowPixmap(); 00098 00099 protected: 00103 void createDamage(); 00104 00108 void destroyDamage(); 00109 00111 virtual QPoint thumbnailPosition() const; 00112 00114 virtual void setupModel(); 00116 00118 SwitcherButton *controller; 00119 00120 private: 00122 void updateXWindowIconGeometryIfNecessary() const; 00123 00125 void updateViewMode(); 00126 00127 #ifdef Q_WS_X11 00128 00129 static int handleXError(Display *display, XErrorEvent *event); 00130 00132 static bool badMatchOccurred; 00133 #endif 00134 00136 Pixmap xWindowPixmap; 00137 00139 Damage xWindowPixmapDamage; 00140 00142 QPixmap qWindowPixmap; 00143 00145 QPointF dragStartPos; 00146 00148 bool onDisplay; 00149 00151 mutable QTimer updateXWindowIconGeometryTimer; 00152 00155 QTimer updateXWindowPixmapRetryTimer; 00156 00158 int updateXWindowPixmapRetryCount; 00159 00161 QPointF updatedXWindowIconPosition; 00162 00164 static Atom iconGeometryAtom; 00165 00167 QSharedPointer<XEventListener> xEventListener; 00168 00169 #ifdef UNIT_TEST 00170 friend class Ut_SwitcherButtonView; 00171 #endif 00172 00173 Q_DISABLE_COPY(SwitcherButtonView); 00174 }; 00175 00176 #endif
| Copyright © 2010 Nokia Corporation | Generated on Thu Nov 4 2010 18:20:42 Doxygen 1.7.1 |
MeeGo Touch |