66 * \a mode |
65 * \a mode |
67 * \a mirrored |
66 * \a mirrored |
68 * \a options |
67 * \a options |
69 * \a color |
68 * \a color |
70 * |
69 * |
71 |
70 |
72 */ |
71 */ |
73 HbSharedIconInfo HbThemeClient::getSharedIconInfo(const QString& iconPath , |
72 HbSharedIconInfo HbThemeClient::getSharedIconInfo(const QString& iconPath , |
74 const QSizeF &size, |
73 const QSizeF &size, |
75 Qt::AspectRatioMode aspectRatioMode, |
74 Qt::AspectRatioMode aspectRatioMode, |
76 QIcon::Mode mode, |
75 QIcon::Mode mode, |
77 bool mirrored, |
76 bool mirrored, |
78 HbIconLoader::IconLoaderOptions options, |
77 HbIconLoader::IconLoaderOptions options, |
79 const QColor &color) |
78 const QColor &color, |
|
79 HbRenderingMode renderMode) |
80 { |
80 { |
81 Q_D(HbThemeClient); |
81 Q_D(HbThemeClient); |
82 return d->getSharedIconInfo(iconPath, |
82 return d->getSharedIconInfo(iconPath, |
83 size, |
83 size, |
84 aspectRatioMode, |
84 aspectRatioMode, |
85 mode, |
85 mode, |
86 mirrored, |
86 mirrored, |
87 options, |
87 options, |
88 color); |
88 color, |
|
89 renderMode); |
89 } |
90 } |
90 |
91 |
91 /** |
92 /** |
92 * HbThemeClient::getSharedBlob() |
93 * HbThemeClient::getSharedBlob() |
93 * |
94 * |
94 * \a name |
95 * \a name |
95 */ |
96 */ |
96 QByteArray HbThemeClient::getSharedBlob(const QString &name) |
97 QByteArray HbThemeClient::getSharedBlob(const QString &name) |
97 { |
98 { |
98 HbSharedIconInfo info = getSharedIconInfo( |
99 HbSharedIconInfo info = getSharedIconInfo( |
99 name, |
100 name, |
100 QSizeF(), |
101 QSizeF(), |
101 Qt::KeepAspectRatio, |
102 Qt::KeepAspectRatio, |
102 QIcon::Normal, |
103 QIcon::Normal, |
103 false, |
104 false, |
104 HbIconLoader::NoOptions, |
105 HbIconLoader::NoOptions, |
105 QColor()); |
106 QColor(), |
|
107 ESWRendering); |
106 return info.type == BLOB |
108 return info.type == BLOB |
107 ? QByteArray::fromRawData(HbMemoryUtils::getAddress<char>( |
109 ? QByteArray::fromRawData(HbMemoryUtils::getAddress<char>( |
108 HbMemoryManager::SharedMemory, |
110 HbMemoryManager::SharedMemory, |
109 info.blobData.offset), |
111 info.blobData.offset), |
110 info.blobData.dataSize) |
112 info.blobData.dataSize) |
111 : QByteArray(); |
113 : QByteArray(); |
112 } |
114 } |
113 |
115 |
114 |
116 |
115 HbSharedIconInfo HbThemeClient::getMultiPartIconInfo(const QStringList &multiPartIconList, |
117 HbSharedIconInfo HbThemeClient::getMultiPartIconInfo(const QStringList &multiPartIconList, |
116 const HbMultiPartSizeData &multiPartIconData , |
118 const HbMultiPartSizeData &multiPartIconData , |
117 const QSizeF &size, |
119 const QSizeF &size, |
118 Qt::AspectRatioMode aspectRatioMode, |
120 Qt::AspectRatioMode aspectRatioMode, |
119 QIcon::Mode mode, |
121 QIcon::Mode mode, |
120 bool mirrored, |
122 bool mirrored, |
121 HbIconLoader::IconLoaderOptions options, |
123 HbIconLoader::IconLoaderOptions options, |
122 const QColor &color) |
124 const QColor &color, |
123 { |
125 HbRenderingMode renderMode) |
124 Q_D(HbThemeClient); |
126 { |
125 return d->getMultiPartIconInfo(multiPartIconList, multiPartIconData, size, aspectRatioMode, mode, mirrored, options, color); |
127 Q_D(HbThemeClient); |
126 } |
128 return d->getMultiPartIconInfo(multiPartIconList, multiPartIconData, size, aspectRatioMode, mode, mirrored, options, color, renderMode); |
127 |
|
128 void HbThemeClient::getThemeIndexTables(ThemeIndexTables &tables) |
|
129 { |
|
130 Q_D(HbThemeClient); |
|
131 d->getThemeIndexTables(tables); |
|
132 } |
129 } |
133 |
130 |
134 /** |
131 /** |
135 * HbThemeClient::getSharedStyleSheet() |
132 * HbThemeClient::getSharedStyleSheet() |
136 * |
133 * |
137 * \a fielName css filename |
134 * \a fielName css filename |
138 * \a priority layer priority |
135 * \a priority layer priority |
139 */ |
136 */ |
140 HbCss::StyleSheet *HbThemeClient::getSharedStyleSheet(const QString &fileName, HbLayeredStyleLoader::LayerPriority priority) |
137 HbCss::StyleSheet *HbThemeClient::getSharedStyleSheet(const QString &fileName, HbLayeredStyleLoader::LayerPriority priority) |
141 { |
138 { |
142 int offset = -1; |
139 int offset = -1; |
143 if( HbLayeredStyleLoader::Priority_Core == priority ) { |
140 if( HbLayeredStyleLoader::Priority_Core == priority ) { |
144 offset = sharedCacheItemOffset(fileName); |
141 offset = sharedCacheItemOffset(HbSharedCache::Stylesheet, fileName); |
145 } |
142 } |
146 if ( -1 != offset ) { |
143 if ( -1 != offset ) { |
147 HbCss::StyleSheet *styleSheet = HbMemoryUtils::getAddress<HbCss::StyleSheet>(HbMemoryManager::SharedMemory,offset); |
144 HbCss::StyleSheet *styleSheet = HbMemoryUtils::getAddress<HbCss::StyleSheet>(HbMemoryManager::SharedMemory,offset); |
148 return styleSheet; |
145 return styleSheet; |
149 } |
146 } |
155 * HbThemeClient::getSharedLayoutDefs() |
152 * HbThemeClient::getSharedLayoutDefs() |
156 * |
153 * |
157 * \a fileName |
154 * \a fileName |
158 * \a layout |
155 * \a layout |
159 * \a section |
156 * \a section |
160 */ |
157 */ |
161 HbWidgetLoader::LayoutDefinition *HbThemeClient::getSharedLayoutDefs(const QString &fileName,const QString &layout,const QString §ion) |
158 HbWidgetLoader::LayoutDefinition *HbThemeClient::getSharedLayoutDefs(const QString &fileName,const QString &layout,const QString §ion) |
162 { |
159 { |
163 int offset = sharedCacheItemOffset(fileName + layout + section); |
160 int offset = sharedCacheItemOffset(HbSharedCache::LayoutDefinition, fileName + layout + section); |
164 if ( -1 != offset ) { |
161 if ( -1 != offset ) { |
165 HbWidgetLoader::LayoutDefinition *layoutDefs = |
162 HbWidgetLoader::LayoutDefinition *layoutDefs = |
166 HbMemoryUtils::getAddress<HbWidgetLoader::LayoutDefinition>(HbMemoryManager::SharedMemory,offset); |
163 HbMemoryUtils::getAddress<HbWidgetLoader::LayoutDefinition>(HbMemoryManager::SharedMemory,offset); |
167 return layoutDefs; |
164 return layoutDefs; |
168 } |
165 } |
169 Q_D(HbThemeClient); |
166 Q_D(HbThemeClient); |
170 return d->getSharedLayoutDefs(fileName,layout,section); |
167 return d->getSharedLayoutDefs(fileName,layout,section); |
171 } |
168 } |
172 /** |
169 /** |
173 * HbThemeClient::deviceProfiles() |
170 * HbThemeClient::deviceProfiles() |
174 */ |
171 */ |
175 HbDeviceProfileList *HbThemeClient::deviceProfiles() |
172 HbDeviceProfileList *HbThemeClient::deviceProfiles() |
176 { |
173 { |
177 Q_D(HbThemeClient); |
174 Q_D(HbThemeClient); |
178 return d->deviceProfiles(); |
175 return d->deviceProfiles(); |
179 } |
176 } |
180 |
177 |
181 /** |
178 /** |
182 * HbThemeClient::globalCacheOffset() |
179 * HbThemeClient::typefaceInfo() |
183 * |
180 */ |
184 */ |
181 HbTypefaceInfoVector *HbThemeClient::typefaceInfo() |
185 int HbThemeClient::globalCacheOffset() |
182 { |
186 { |
183 Q_D(HbThemeClient); |
187 if ( -1 == sharedCacheOffset ) { |
184 return d->typefaceInfo(); |
188 Q_D(HbThemeClient); |
185 } |
189 sharedCacheOffset = d->globalCacheOffset(); |
186 |
190 } |
|
191 return sharedCacheOffset; |
|
192 } |
|
193 |
187 |
194 /** |
188 /** |
195 * HbThemeClient::notifyForegroundLostToServer() |
189 * HbThemeClient::notifyForegroundLostToServer() |
196 * |
190 * |
197 */ |
191 */ |
329 * sharedCacheItemOffset function returns the offset of the cache item |
327 * sharedCacheItemOffset function returns the offset of the cache item |
330 * for the given key |
328 * for the given key |
331 * \param key |
329 * \param key |
332 * |
330 * |
333 */ |
331 */ |
334 int HbThemeClient::sharedCacheItemOffset(const QString & key) |
332 int HbThemeClient::sharedCacheItemOffset(HbSharedCache::ItemType type, const QString & key) |
335 { |
333 { |
336 if ( -1 == sharedCacheOffset ) { |
334 HbSharedCache *cache = HbSharedCache::instance(); |
337 // No IPC call happened so far for the globalCacheOffset |
335 return cache->offset(type, key); |
338 globalCacheOffset(); |
|
339 } |
|
340 if ( -1 != sharedCacheOffset ) { |
|
341 HbSharedCache *sharedCache = HbMemoryUtils::getAddress<HbSharedCache>(HbMemoryManager::SharedMemory,sharedCacheOffset); |
|
342 int count = sharedCache->count(); |
|
343 for(int i = 0; i < count ; i++ ) { |
|
344 if (sharedCache->at(i).key == key) { |
|
345 return sharedCache->at(i).offset; |
|
346 } |
|
347 } |
|
348 } |
|
349 // item not found in the secondary cache. |
|
350 return -1; |
|
351 } |
336 } |
352 |
337 |
353 #ifdef HB_THEME_SERVER_MEMORY_REPORT |
338 #ifdef HB_THEME_SERVER_MEMORY_REPORT |
354 /** |
339 /** |
355 * createMemoryReport creates memory report from current shared memory |
340 * createMemoryReport creates memory report from current shared memory |
370 const QVector<QSizeF> &sizeList , |
355 const QVector<QSizeF> &sizeList , |
371 Qt::AspectRatioMode aspectRatioMode, |
356 Qt::AspectRatioMode aspectRatioMode, |
372 QIcon::Mode mode, |
357 QIcon::Mode mode, |
373 bool mirrored, |
358 bool mirrored, |
374 HbIconLoader::IconLoaderOptions options, |
359 HbIconLoader::IconLoaderOptions options, |
375 const QColor &color) |
360 const QColor &color, |
376 { |
361 HbRenderingMode renderMode) |
377 Q_D(HbThemeClient); |
362 { |
378 return d->getMultiIconInfo(multiPartIconList, sizeList,aspectRatioMode, mode, mirrored, options, color); |
363 Q_D(HbThemeClient); |
|
364 return d->getMultiIconInfo(multiPartIconList, sizeList,aspectRatioMode, mode, mirrored, options, color, renderMode); |
379 } |
365 } |
380 |
366 |
381 /** |
367 /** |
382 * freeSharedMemory gets free memory in shared chunk |
368 * freeSharedMemory gets free memory in shared chunk |
383 * |
369 * |