111 info.blobData.offset), |
111 info.blobData.offset), |
112 info.blobData.dataSize) |
112 info.blobData.dataSize) |
113 : QByteArray(); |
113 : QByteArray(); |
114 } |
114 } |
115 |
115 |
116 |
116 HbSharedIconInfo HbThemeClient::getMultiPartIconInfo(const QStringList &multiPartIconList, |
117 HbSharedIconInfo HbThemeClient::getMultiPartIconInfo(const QStringList &multiPartIconList, |
|
118 const HbMultiPartSizeData &multiPartIconData , |
117 const HbMultiPartSizeData &multiPartIconData , |
119 const QSizeF &size, |
118 const QSizeF &size, |
120 Qt::AspectRatioMode aspectRatioMode, |
119 Qt::AspectRatioMode aspectRatioMode, |
121 QIcon::Mode mode, |
120 QIcon::Mode mode, |
122 bool mirrored, |
121 bool mirrored, |
123 HbIconLoader::IconLoaderOptions options, |
122 HbIconLoader::IconLoaderOptions options, |
124 const QColor &color, |
123 const QColor &color, |
125 HbRenderingMode renderMode) |
124 HbRenderingMode renderMode) |
126 { |
125 { |
127 Q_D(HbThemeClient); |
126 Q_D(HbThemeClient); |
128 return d->getMultiPartIconInfo(multiPartIconList, multiPartIconData, size, aspectRatioMode, mode, mirrored, options, color, renderMode); |
127 return d->getMultiPartIconInfo(multiPartIconList, multiPartIconData, size, |
|
128 aspectRatioMode, mode, mirrored, options, color, renderMode); |
129 } |
129 } |
130 |
130 |
131 /** |
131 /** |
132 * HbThemeClient::getSharedStyleSheet() |
132 * HbThemeClient::getSharedStyleSheet() |
133 * |
133 * |
134 * \a fielName css filename |
134 * \a fielName css filename |
135 * \a priority layer priority |
135 * \a priority layer priority |
136 */ |
136 */ |
137 HbCss::StyleSheet *HbThemeClient::getSharedStyleSheet(const QString &fileName, HbLayeredStyleLoader::LayerPriority priority) |
137 HbCss::StyleSheet *HbThemeClient::getSharedStyleSheet(const QString &fileName, |
|
138 HbLayeredStyleLoader::LayerPriority priority) |
138 { |
139 { |
139 int offset = -1; |
140 int offset = -1; |
140 if( HbLayeredStyleLoader::Priority_Core == priority ) { |
141 if( HbLayeredStyleLoader::Priority_Core == priority ) { |
141 offset = sharedCacheItemOffset(HbSharedCache::Stylesheet, fileName); |
142 offset = sharedCacheItemOffset(HbSharedCache::Stylesheet, fileName); |
142 } |
143 } |
143 if ( -1 != offset ) { |
144 if ( -1 != offset ) { |
144 HbCss::StyleSheet *styleSheet = HbMemoryUtils::getAddress<HbCss::StyleSheet>(HbMemoryManager::SharedMemory,offset); |
145 HbCss::StyleSheet *styleSheet = |
|
146 HbMemoryUtils::getAddress<HbCss::StyleSheet>(HbMemoryManager::SharedMemory, |
|
147 offset); |
145 return styleSheet; |
148 return styleSheet; |
146 } |
149 } |
147 Q_D(HbThemeClient); |
150 Q_D(HbThemeClient); |
148 return d->getSharedStyleSheet(fileName,priority); |
151 return d->getSharedStyleSheet(fileName,priority); |
149 } |
152 } |
153 * |
156 * |
154 * \a fileName |
157 * \a fileName |
155 * \a layout |
158 * \a layout |
156 * \a section |
159 * \a section |
157 */ |
160 */ |
158 HbWidgetLoader::LayoutDefinition *HbThemeClient::getSharedLayoutDefs(const QString &fileName,const QString &layout,const QString §ion) |
161 HbWidgetLoader::LayoutDefinition *HbThemeClient::getSharedLayoutDefs(const QString &fileName, |
159 { |
162 const QString &layout, |
160 int offset = sharedCacheItemOffset(HbSharedCache::LayoutDefinition, fileName + layout + section); |
163 const QString §ion) |
|
164 { |
|
165 int offset = sharedCacheItemOffset(HbSharedCache::LayoutDefinition, |
|
166 fileName + layout + section); |
161 if ( -1 != offset ) { |
167 if ( -1 != offset ) { |
162 HbWidgetLoader::LayoutDefinition *layoutDefs = |
168 HbWidgetLoader::LayoutDefinition *layoutDefs = |
163 HbMemoryUtils::getAddress<HbWidgetLoader::LayoutDefinition>(HbMemoryManager::SharedMemory,offset); |
169 HbMemoryUtils::getAddress<HbWidgetLoader::LayoutDefinition>(HbMemoryManager::SharedMemory, |
|
170 offset); |
164 return layoutDefs; |
171 return layoutDefs; |
165 } |
172 } |
166 Q_D(HbThemeClient); |
173 Q_D(HbThemeClient); |
167 return d->getSharedLayoutDefs(fileName,layout,section); |
174 return d->getSharedLayoutDefs(fileName,layout,section); |
168 } |
175 } |
202 */ |
208 */ |
203 HbEffectFxmlData *HbThemeClient::getSharedEffect(const QString &filePath) |
209 HbEffectFxmlData *HbThemeClient::getSharedEffect(const QString &filePath) |
204 { |
210 { |
205 int offset = sharedCacheItemOffset(HbSharedCache::Effect, filePath); |
211 int offset = sharedCacheItemOffset(HbSharedCache::Effect, filePath); |
206 if ( -1 != offset ) { |
212 if ( -1 != offset ) { |
207 HbEffectFxmlData *effectFxmlData = HbMemoryUtils::getAddress<HbEffectFxmlData>(HbMemoryManager::SharedMemory,offset); |
213 HbEffectFxmlData *effectFxmlData = |
|
214 HbMemoryUtils::getAddress<HbEffectFxmlData>(HbMemoryManager::SharedMemory, offset); |
208 return effectFxmlData; |
215 return effectFxmlData; |
209 } |
216 } |
210 Q_D(HbThemeClient); |
217 Q_D(HbThemeClient); |
211 return d->getSharedEffect(filePath); |
218 return d->getSharedEffect(filePath); |
212 } |
219 } |
329 * \param key |
336 * \param key |
330 * |
337 * |
331 */ |
338 */ |
332 int HbThemeClient::sharedCacheItemOffset(HbSharedCache::ItemType type, const QString & key) |
339 int HbThemeClient::sharedCacheItemOffset(HbSharedCache::ItemType type, const QString & key) |
333 { |
340 { |
|
341 int offset = -1; |
334 HbSharedCache *cache = HbSharedCache::instance(); |
342 HbSharedCache *cache = HbSharedCache::instance(); |
335 return cache->offset(type, key); |
343 if (cache) { |
|
344 offset = cache->offset(type, key); |
|
345 } |
|
346 return offset; |
336 } |
347 } |
337 |
348 |
338 #ifdef HB_THEME_SERVER_MEMORY_REPORT |
349 #ifdef HB_THEME_SERVER_MEMORY_REPORT |
339 /** |
350 /** |
340 * createMemoryReport creates memory report from current shared memory |
351 * createMemoryReport creates memory report from current shared memory |
359 HbIconLoader::IconLoaderOptions options, |
370 HbIconLoader::IconLoaderOptions options, |
360 const QColor &color, |
371 const QColor &color, |
361 HbRenderingMode renderMode) |
372 HbRenderingMode renderMode) |
362 { |
373 { |
363 Q_D(HbThemeClient); |
374 Q_D(HbThemeClient); |
364 return d->getMultiIconInfo(multiPartIconList, sizeList,aspectRatioMode, mode, mirrored, options, color, renderMode); |
375 return d->getMultiIconInfo(multiPartIconList, sizeList,aspectRatioMode, mode, |
|
376 mirrored, options, color, renderMode); |
365 } |
377 } |
366 |
378 |
367 /** |
379 /** |
368 * freeSharedMemory gets free memory in shared chunk |
380 * freeSharedMemory gets free memory in shared chunk |
369 * |
381 * |