equal
deleted
inserted
replaced
34 #include <QColor> |
34 #include <QColor> |
35 #include <QHash> |
35 #include <QHash> |
36 #include <QSettings> |
36 #include <QSettings> |
37 #include <QDebug> |
37 #include <QDebug> |
38 #include <QXmlStreamReader> |
38 #include <QXmlStreamReader> |
|
39 #include <QFileSystemWatcher> |
|
40 #include "hbframedrawer.h" |
39 |
41 |
40 QT_BEGIN_NAMESPACE |
42 QT_BEGIN_NAMESPACE |
41 class QTranslator; |
43 class QTranslator; |
42 QT_END_NAMESPACE |
44 QT_END_NAMESPACE |
43 |
45 |
44 class HbMainWindow; |
46 class HbMainWindow; |
|
47 class HbDocumentLoader; |
45 |
48 |
46 class HbSplashGenerator : public QObject |
49 class HbSplashGenerator : public QObject |
47 { |
50 { |
48 Q_OBJECT |
51 Q_OBJECT |
49 |
52 |
60 void regenerate(); |
63 void regenerate(); |
61 |
64 |
62 private slots: |
65 private slots: |
63 void processQueue(); |
66 void processQueue(); |
64 void processWindow(); |
67 void processWindow(); |
|
68 void onDirectoryChanged(const QString &path); |
65 |
69 |
66 public: |
70 public: |
67 struct QueueItem { |
71 struct QueueItem { |
68 QueueItem(); |
72 QueueItem(); |
69 QueueItem(const QString &themeName, Qt::Orientation orientation); |
73 QueueItem(const QString &themeName, Qt::Orientation orientation); |
70 QString mThemeName; |
74 QString mThemeName; |
71 Qt::Orientation mOrientation; |
75 Qt::Orientation mOrientation; |
72 QString mAppId; |
76 QString mAppId; |
|
77 QString mScreenId; |
73 QString mDocmlFileName; |
78 QString mDocmlFileName; |
74 QString mDocmlWidgetName; |
79 QString mDocmlWidgetName; |
75 QString mTsAppName; |
80 QString mTsAppName; |
76 QStringList mViewFlags; |
81 QStringList mViewFlags; |
77 bool mHideBackground; |
82 bool mHideBackground; |
81 QHash<QString, QString> mBackgroundImageName; |
86 QHash<QString, QString> mBackgroundImageName; |
82 QHash<QString, QString> mCondSections; |
87 QHash<QString, QString> mCondSections; |
83 QList<QString> mForcedSections; |
88 QList<QString> mForcedSections; |
84 QHash<QString, QString> mCustomWidgetSubsts; |
89 QHash<QString, QString> mCustomWidgetSubsts; |
85 QString mFixedOrientation; |
90 QString mFixedOrientation; |
|
91 struct ItemBgGraphicsRequest { |
|
92 QString mTargetWidgetName; |
|
93 HbFrameDrawer::FrameType mFrameGraphicsType; |
|
94 QString mFrameGraphicsName; |
|
95 qreal mZValue; |
|
96 QString mOrientation; |
|
97 }; |
|
98 QList<ItemBgGraphicsRequest> mItemBgGraphics; |
86 }; |
99 }; |
87 |
100 |
88 private: |
101 private: |
89 void takeScreenshot(); |
102 void takeScreenshot(); |
90 void cleanup(); |
103 void cleanup(); |
93 bool saveSpl(const QString &nameWithoutExt, const QImage &image); |
106 bool saveSpl(const QString &nameWithoutExt, const QImage &image); |
94 void addSplashmlItemToQueue(const QueueItem &item); |
107 void addSplashmlItemToQueue(const QueueItem &item); |
95 void queueAppSpecificItems(const QString &themeName, Qt::Orientation orientation); |
108 void queueAppSpecificItems(const QString &themeName, Qt::Orientation orientation); |
96 void processSplashml(QXmlStreamReader &xml, QueueItem &item); |
109 void processSplashml(QXmlStreamReader &xml, QueueItem &item); |
97 void setupAppSpecificWindow(); |
110 void setupAppSpecificWindow(); |
|
111 void setupNameBasedWidgetProps(HbDocumentLoader &loader); |
98 void finishWindow(); |
112 void finishWindow(); |
99 void addTranslator(const QString &name); |
113 void addTranslator(const QString &name); |
100 void clearTranslators(); |
114 void clearTranslators(); |
101 int updateOutputDirContents(const QString &outDir); |
115 int updateOutputDirContents(const QString &outDir); |
102 |
116 |
107 QList<QTranslator *> mTranslators; |
121 QList<QTranslator *> mTranslators; |
108 QTime mItemTime; |
122 QTime mItemTime; |
109 bool mFirstRegenerate; |
123 bool mFirstRegenerate; |
110 QHash<QString, QueueItem> mParsedSplashmls; |
124 QHash<QString, QueueItem> mParsedSplashmls; |
111 QSettings mSettings; |
125 QSettings mSettings; |
|
126 QFileSystemWatcher mFsWatcher; |
112 }; |
127 }; |
113 |
128 |
114 QDebug operator<<(QDebug dbg, const HbSplashGenerator::QueueItem& item); |
129 QDebug operator<<(QDebug dbg, const HbSplashGenerator::QueueItem& item); |
115 |
130 |
116 #endif // HBSPLASHGENERATOR_P_H |
131 #endif // HBSPLASHGENERATOR_P_H |