src/hbservers/hbthemeserver/hbthemeserver_symbian_p_p.h
changeset 34 ed14f46c0e55
parent 7 923ff622b8b9
equal deleted inserted replaced
31:7516d6d86cf5 34:ed14f46c0e55
    35 #include <QChar>
    35 #include <QChar>
    36 
    36 
    37 #include "hbthemecommon_p.h"
    37 #include "hbthemecommon_p.h"
    38 #include "hbthemecommon_symbian_p.h"
    38 #include "hbthemecommon_symbian_p.h"
    39 #include "hbicondatacache_p.h"
    39 #include "hbicondatacache_p.h"
    40 #include "hbcache_p.h"
       
    41 #include "hbthemewatcher_symbian_p.h"
    40 #include "hbthemewatcher_symbian_p.h"
    42 #include <e32property.h>
    41 #include <e32property.h>
    43 #include <e32base.h>
    42 #include <e32base.h>
    44 #include <f32file.h>
    43 #include <f32file.h>
    45 
    44 
    89     void setMaxGpuCacheSize(int size);
    88     void setMaxGpuCacheSize(int size);
    90     void setMaxCpuCacheSize(int size);
    89     void setMaxCpuCacheSize(int size);
    91     void CleanupSessionIconItem(HbIconKey key);
    90     void CleanupSessionIconItem(HbIconKey key);
    92     void clearIconCache();
    91     void clearIconCache();
    93 
    92 
    94     bool insertCssCacheItem(const QString &key,  HbCacheItem *item);
       
    95     HbCacheItem * cssCacheItem(const QString &key);
       
    96     void CleanupSessionCssItem(QString key);
       
    97     void clearCssCache();
       
    98     void MemoryGood();
    93     void MemoryGood();
    99     void FreeGpuRam(int bytes, bool useSwRendering);
    94     void FreeGpuRam(int bytes, bool useSwRendering);
       
    95     void freeGpuRam();
   100     void freeUnusedGpuResources();
    96     void freeUnusedGpuResources();
   101     
    97     
   102     void doCleanup();
       
   103     static bool gpuMemoryState();
    98     static bool gpuMemoryState();
       
    99     bool isItemCacheableinGpu(int itemCost, HbIconFormatType type);
       
   100     bool isItemCacheableinCpu(int itemCost, HbIconFormatType type);
       
   101    
   104 
   102 
   105     bool openCurrentIndexFile();
   103     bool openCurrentIndexFile();
   106     HbRenderingMode currentRenderingMode() const;
   104     HbRenderingMode currentRenderingMode() const;
       
   105     HbRenderingMode expectedRenderingMode(HbRenderingMode requsetedRenderingMode) const;
   107     void setCurrentRenderingMode(HbRenderingMode currentMode);
   106     void setCurrentRenderingMode(HbRenderingMode currentMode);
   108     void HandleThemeSelection( const QString& themeName);
   107     void HandleThemeSelection( const QString& themeName);
   109 
   108 
   110     int freeSharedMemory();
   109     int freeSharedMemory();
   111     int allocatedSharedMemory();
   110     int allocatedSharedMemory();
   112     int allocatedHeapMemory();
   111     int allocatedHeapMemory();
   113     int gpuLRUSize() const;
   112     int gpuLRUSize() const;
       
   113     unsigned long freeGPUMemory();
       
   114     unsigned long totalGPUMemory();
       
   115     int cachedSgImagesCount() const;
       
   116     int totalSgImagesCost() const;
       
   117     int cachedPixmapCount() const;
   114 //Debug Code for Test Purpose
   118 //Debug Code for Test Purpose
   115 #ifdef HB_ICON_CACHE_DEBUG
   119 #ifdef HB_ICON_CACHE_DEBUG
   116     int cacheIconCount() const;
   120     int cacheIconCount() const;
   117     int memorySize(const QString &mem);
   121     int memorySize(const QString &mem);
   118     int freeVectorMemory();
   122     int freeVectorMemory();
   127     int serverHeapSize();
   131     int serverHeapSize();
   128     void cleanRasterLRUList();
   132     void cleanRasterLRUList();
   129     void cleanVectorLRUList();
   133     void cleanVectorLRUList();
   130     int rasterLruCount();
   134     int rasterLruCount();
   131     int vectorLruCount();
   135     int vectorLruCount();
   132     unsigned long freeGPUMemory();
       
   133     unsigned long totalGPUMemory();
       
   134 #if defined(Q_OS_SYMBIAN)
   136 #if defined(Q_OS_SYMBIAN)
   135     int iconRefCount(const RMessage2& aMessage);
   137     int iconRefCount(const RMessage2& aMessage);
   136 #endif
   138 #endif
   137 
   139 
   138 #endif
   140 #endif
   144 
   146 
   145 private:
   147 private:
   146     void ConstructL();
   148     void ConstructL();
   147     void UpdateThemeIndexes(bool updateBase = true);
   149     void UpdateThemeIndexes(bool updateBase = true);
   148     HbIconDataCache * cache;
   150     HbIconDataCache * cache;
   149     HbCache* cssCache;
       
   150 
   151 
   151     static bool gpuGoodMemoryState;
   152     static bool gpuGoodMemoryState;
   152     HbRenderingMode renderMode;
   153     HbRenderingMode renderMode;
   153     CHbThemeChangeNotificationListener * iListener;
   154     CHbThemeChangeNotificationListener * iListener;
   154     CHbThemeWatcher *iWatcher;
   155     HbThemeWatcher *iWatcher;
   155 };
   156 };
   156 
   157 
   157 //**********************************
   158 //**********************************
   158 //HbThemeServerSession
   159 //HbThemeServerSession
   159 //**********************************
   160 //**********************************
   168     ~HbThemeServerSession();
   169     ~HbThemeServerSession();
   169     void ServiceL(const RMessage2 & aMessage);
   170     void ServiceL(const RMessage2 & aMessage);
   170     void DispatchMessageL(const RMessage2 & aMessage);
   171     void DispatchMessageL(const RMessage2 & aMessage);
   171     void GetSharedIconInfoL(const RMessage2 & aMessage);
   172     void GetSharedIconInfoL(const RMessage2 & aMessage);
   172     void HandleStyleSheetLookupL(const RMessage2 & aMessage);
   173     void HandleStyleSheetLookupL(const RMessage2 & aMessage);
       
   174     void HandleMissedHbCssLookupL(const RMessage2 &aMessage);
   173     void HandleWidgetMLLookupL(const RMessage2& aMessage);
   175     void HandleWidgetMLLookupL(const RMessage2& aMessage);
   174     void HandleDeviceProfilesReqL(const RMessage2& aMessage);
   176     void HandleDeviceProfilesReqL(const RMessage2& aMessage);
   175     void HandleEffectAddAndFileLookupL(const RMessage2 &aMessage);
   177     void HandleEffectAddAndFileLookupL(const RMessage2 &aMessage);
   176     QColor GetColorFromRgba(TUint32 aRgba, bool aColorFlag);
   178     QColor GetColorFromRgba(TUint32 aRgba, bool aColorFlag);
       
   179     HbIconCacheItem* getCachedIcon(HbIconKey & key, const QString & format,
       
   180                                     bool isConsolidatedIcon);
   177     void GetSharedMultiIconInfoL(const RMessage2& aMessage);
   181     void GetSharedMultiIconInfoL(const RMessage2& aMessage);
   178     void GetMultiIconInfoL(const RMessage2& aMessage);
   182     void GetMultiIconInfoL(const RMessage2& aMessage);
   179     TMultiIconSymbParams ReadMessageAndRetrieveMultiIconParams(const RMessage2& aMessage);
   183     TMultiIconSymbParams ReadMessageAndRetrieveMultiIconParams(const RMessage2& aMessage);
   180     void GetDataFromCacheItem(HbIconCacheItem* cacheItem, HbSharedIconInfo &data) const;
   184     void GetDataFromCacheItem(HbIconCacheItem* cacheItem, HbSharedIconInfo &data) const;
   181     void FreeDataFromCacheItem(HbIconCacheItem* cacheItem);
   185     void FreeDataFromCacheItem(HbIconCacheItem* cacheItem);
   182     bool IconInfoFromSingleIcon(HbIconKey key, HbSharedIconInfo &stitchedData);
   186     bool IconInfoFromSingleIcon(HbIconKey key, HbSharedIconInfo &stitchedData, 
       
   187                                 const QString & format, bool isMultiPiece);
   183     bool CreateCacheItemData(HbIconKey key, int options, HbSharedIconInfo &data,
   188     bool CreateCacheItemData(HbIconKey key, int options, HbSharedIconInfo &data,
   184                              bool isMultiPiece = false);
   189                              bool isMultiPiece = false);
   185     bool CreateStichedIconInfoOfParts(QVector<HbSharedIconInfo> dataForParts,
   190     bool CreateStichedIconInfoOfParts(QVector<HbSharedIconInfo> dataForParts,
   186                                       HbMultiIconParams params,
   191                                       HbMultiIconParams params,
   187                                       HbIconKey &finalIconKey,
   192                                       HbIconKey &finalIconKey,
   194     void IconInfoL(const TIconListParams &frameItemParams,
   199     void IconInfoL(const TIconListParams &frameItemParams,
   195                    const int noOfPieces,
   200                    const int noOfPieces,
   196                    HbSharedIconInfoList &iconInfoList);
   201                    HbSharedIconInfoList &iconInfoList);
   197     void HandleTypefaceReqL(const RMessage2& aMessage);
   202     void HandleTypefaceReqL(const RMessage2& aMessage);
   198     void unLoadIcon(const RMessage2& aMessage);
   203     void unLoadIcon(const RMessage2& aMessage);
       
   204     void batchUnLoadIcon(const RMessage2& aMessage);
   199     void unloadMultiIcon(const RMessage2& aMessage);
   205     void unloadMultiIcon(const RMessage2& aMessage);
   200     void freeClientGpuResources();
   206     void freeClientGpuResources();
       
   207     void freeIconResources();
   201     void ClearSessionData();
   208     void ClearSessionData();
   202     void freeGpuResources();
   209     void freeGpuResources();
   203     void SwitchRenderingMode(HbRenderingMode aRenderMode);
   210     void SwitchRenderingMode(HbRenderingMode aRenderMode);
       
   211     HbIconFormatType getIconFormatType(const QString & format);
       
   212 
   204 protected:
   213 protected:
   205     TIconParams ReadMessageAndRetrieveParams(const RMessage2 & aMessage);
   214     TIconParams ReadMessageAndRetrieveParams(const RMessage2 & aMessage);
   206     void PanicClient(const RMessage2 & aMessage, TInt aPanic) const;
   215     void PanicClient(const RMessage2 & aMessage, TInt aPanic) const;
       
   216     void performUnload(const TIconParams &params);
   207 
   217 
   208 private:
   218 private:
   209     HbThemeServerPrivate *iServer;
   219     HbThemeServerPrivate *iServer;
   210     QList<HbIconKey> sessionData;
   220     QList<HbIconKey> sessionData;
   211     QList<QString> sessionCssData;
       
   212 };
   221 };
   213 
   222 
   214 #endif // HBTHEMESERVER_SYMBIAN_P_H
   223 #endif // HBTHEMESERVER_SYMBIAN_P_H