src/hbcore/theme/hbthemecommon_p.h
changeset 2 06ff229162e9
parent 1 f7ac710697a9
child 3 11d3954df52a
equal deleted inserted replaced
1:f7ac710697a9 2:06ff229162e9
    36 #ifdef HB_SGIMAGE_ICON
    36 #ifdef HB_SGIMAGE_ICON
    37 #include <sgresource/sgimage.h>
    37 #include <sgresource/sgimage.h>
    38 #endif
    38 #endif
    39 
    39 
    40 #define THEME_SERVER_NAME "hbthemeserver"
    40 #define THEME_SERVER_NAME "hbthemeserver"
       
    41 #define BIN_CSS_APP "hbbincssmaker"
       
    42 #define BIN_CSS_APP_SYMBIAN "hbbincssmaker_symbian"
       
    43 #ifdef HB_BIN_CSS
       
    44 #define HB_THEME_SHARED_PIXMAP_CHUNK "themeserver_tool_chunk"
       
    45 #else
    41 #define HB_THEME_SHARED_PIXMAP_CHUNK "themeserver_chunk"
    46 #define HB_THEME_SHARED_PIXMAP_CHUNK "themeserver_chunk"
       
    47 #endif
    42 #define ORGANIZATION "Nokia"
    48 #define ORGANIZATION "Nokia"
    43 #define THEME_COMPONENT "Hb Themes"
    49 #define THEME_COMPONENT "Hb Themes"
    44 #define CURRENT_THEME_KEY "CurrentTheme"
    50 #define CURRENT_THEME_KEY "CurrentTheme"
    45 
    51 
    46 // To enable/disable debug messages for theme server functionality
    52 // To enable/disable debug messages for theme server functionality
    48 #undef THEME_SERVER_TRACES
    54 #undef THEME_SERVER_TRACES
    49 
    55 
    50 // To enable/disable debug messages for theme index functionality
    56 // To enable/disable debug messages for theme index functionality
    51 #undef THEME_INDEX_TRACES
    57 #undef THEME_INDEX_TRACES
    52 
    58 
       
    59 #undef CSSBIN_TRACES
       
    60 
    53 // To enable memory report creation (memory usage, fragmentation etc.)
    61 // To enable memory report creation (memory usage, fragmentation etc.)
    54 #undef HB_THEME_SERVER_MEMORY_REPORT
    62 #undef HB_THEME_SERVER_MEMORY_REPORT
       
    63 // To enable full memory report including all allocs, frees and reallocs
       
    64 #undef HB_THEME_SERVER_FULL_MEMORY_REPORT
       
    65 
       
    66 #ifdef HB_THEME_SERVER_FULL_MEMORY_REPORT
       
    67 #define HB_THEME_SERVER_MEMORY_REPORT
       
    68 #endif
       
    69 
    55 // If master trace macro is defined, define also other theme traces
    70 // If master trace macro is defined, define also other theme traces
    56 #ifdef THEME_SERVER_TRACES
    71 #ifdef THEME_SERVER_TRACES
    57 #define THEME_INDEX_TRACES
    72 #define THEME_INDEX_TRACES
    58 #endif
    73 #define CSSBIN_TRACES
    59 
    74 #endif
    60 
    75 
    61 // To enable fute testing for cache
    76 // To enable fute testing for cache
    62 //#define HB_ICON_CACHE_DEBUG
    77 //#define HB_ICON_CACHE_DEBUG
    63 
    78 
    64 const unsigned int INITIALIZED_CHUNK_IDENTIFIER = 0x54535256; //'TSRV'
    79 
       
    80 enum HbThemeType {
       
    81     BaseTheme   = 0,
       
    82     OperatorC   = 1,
       
    83     OperatorROM = 2,
       
    84     ActiveTheme = 3
       
    85 };
       
    86 
       
    87 const quint32 INITIALIZED_CHUNK_IDENTIFIER = 0x54535256; //'TSRV'
    65 struct HbSharedChunkHeader
    88 struct HbSharedChunkHeader
    66 {
    89 {
    67     unsigned int identifier;
    90     quint32 identifier;
    68     unsigned int mainAllocatorOffset;
    91     quint32 mainAllocatorOffset;
    69     unsigned int subAllocatorOffset;
    92     quint32 subAllocatorOffset;
       
    93     quint32 sharedCacheOffset;	
       
    94     // Base theme offsets
       
    95     quint32 baseThemePathOffset;
       
    96     quint32 baseThemeNameOffset;
       
    97     quint32 baseThemeIndexOffset;
       
    98     // Operator theme in C-drive offsets
       
    99     quint32 operatorThemeDriveCPathOffset;
       
   100     quint32 operatorThemeDriveCNameOffset;
       
   101     quint32 operatorThemeDriveCIndexOffset;
       
   102     // Operator theme in ROM offsets
       
   103     quint32 operatorThemeRomPathOffset;
       
   104     quint32 operatorThemeRomNameOffset;
       
   105     quint32 operatorThemeRomIndexOffset;
       
   106     // Active theme offsets
       
   107     quint32 activeThemePathOffset;
       
   108     quint32 activeThemeNameOffset;
       
   109     quint32 activeThemeIndexOffset;
       
   110 
    70 };
   111 };
    71 
   112 
    72 enum LayerPriority {
   113 enum LayerPriority {
    73     Priority_Core,
   114     Priority_Core,
    74     Priority_Theme,
   115     Priority_Theme,
   107     int options;
   148     int options;
   108     bool mirrored;
   149     bool mirrored;
   109     QColor color;
   150     QColor color;
   110     int rgba;
   151     int rgba;
   111     bool colorflag;
   152     bool colorflag;
       
   153     int renderMode;
   112 };
   154 };
   113 
   155 
   114 
   156 
   115 enum HbIconFormatType {
   157 enum HbIconFormatType {
   116     INVALID_FORMAT = -1,
   158     INVALID_FORMAT = -1,
   117     NVG,
   159     NVG,
   118     PIC,
   160     PIC,
   119     SVG,
   161     SVG,
   120 	SGIMAGE,
   162     SGIMAGE,
   121     BLOB,
   163     BLOB,
   122     OTHER_SUPPORTED_FORMATS
   164     OTHER_SUPPORTED_FORMATS
   123 };
   165 };
   124 
   166 
   125 struct HbSharedPixmapInfo
   167 struct HbSharedPixmapInfo
   131     int defaultHeight;
   173     int defaultHeight;
   132     QImage::Format format;
   174     QImage::Format format;
   133 };
   175 };
   134 
   176 
   135 struct HbSharedNVGInfo
   177 struct HbSharedNVGInfo
   136 {		
   178 {
   137     int offset;
   179     int offset;
   138     int dataSize;
   180     int dataSize;
   139     int width;
   181     int width;
   140     int height;
   182     int height;
   141     int defaultWidth;
   183     int defaultWidth;
   142     int defaultHeight;
   184     int defaultHeight;
   143     
   185 
   144 };
   186 };
   145 
   187 
   146 struct HbSharedPICInfo
   188 struct HbSharedPICInfo
   147 {
   189 {
   148     int offset;
   190     int offset;
   155 
   197 
   156 struct HbSharedSgimageInfo
   198 struct HbSharedSgimageInfo
   157 {
   199 {
   158     unsigned long long id;
   200     unsigned long long id;
   159     int width;
   201     int width;
   160     int height; 
   202     int height;
   161     int defaultWidth;
   203     int defaultWidth;
   162     int defaultHeight;
   204     int defaultHeight;
   163 };
   205 };
   164 
   206 
   165 struct HbSharedBLOBInfo
   207 struct HbSharedBLOBInfo
   169 };
   211 };
   170 
   212 
   171 struct HbSharedIconInfo
   213 struct HbSharedIconInfo
   172 {
   214 {
   173     HbIconFormatType type;
   215     HbIconFormatType type;
   174     
   216 
   175     union 
   217     union
   176     {
   218     {
   177     	HbSharedPixmapInfo pixmapData;
   219         HbSharedPixmapInfo pixmapData;
   178     	HbSharedNVGInfo nvgData;
   220         HbSharedNVGInfo nvgData;
   179     	HbSharedPICInfo picData;
   221         HbSharedPICInfo picData;
   180 		HbSharedSgimageInfo sgImageData;
   222         HbSharedSgimageInfo sgImageData;
   181         HbSharedBLOBInfo blobData;
   223         HbSharedBLOBInfo blobData;
   182     };	
   224     };
   183     
   225 
   184     HbSharedIconInfo():type(INVALID_FORMAT){}
   226     HbSharedIconInfo():type(INVALID_FORMAT){}
   185           
   227 
   186 };
   228 };
   187 
   229 
   188 struct HbSharedIconInfoList
   230 struct HbSharedIconInfoList
   189 {
   231 {
   190   HbSharedIconInfo icon[9];
   232   HbSharedIconInfo icon[9];
   192 
   234 
   193 struct HbSharedStyleSheetInfo
   235 struct HbSharedStyleSheetInfo
   194 {
   236 {
   195     int offset;
   237     int offset;
   196     int refCount;
   238     int refCount;
   197     HbSharedStyleSheetInfo(): 
   239     HbSharedStyleSheetInfo():
   198         offset(-1),
   240         offset(-1),
   199         refCount(0)    
   241         refCount(0)
   200     {}
   242     {}
   201 };
   243 };
   202 
   244 
   203 struct HbSharedEffectInfo
   245 struct HbSharedEffectInfo
   204 {
   246 {
   221 {
   263 {
   222     int offset;
   264     int offset;
   223     HbSecondaryCacheInfo() : offset(-1) {}
   265     HbSecondaryCacheInfo() : offset(-1) {}
   224 };
   266 };
   225 
   267 
   226 struct HbSharedCacheItem {
   268 
   227     HbString key;
   269 struct HbTypefaceDataInfo
   228     int offset;
   270 {
   229     HbSharedCacheItem():key(HbMemoryManager::SharedMemory),offset(-1)
   271     int offset;
   230     {
   272     HbTypefaceDataInfo() : offset(-1) {}
   231     }
   273 };
   232     HbSharedCacheItem(const QString &cacheKey,
       
   233                    int cacheOffset):key(cacheKey,HbMemoryManager::SharedMemory),
       
   234                                     offset(cacheOffset)
       
   235     {
       
   236     }
       
   237 };
       
   238 
       
   239 // Currently HbVector is used. This one should be replaced with the Map/Hash
       
   240 // data structure.
       
   241 typedef HbVector<HbSharedCacheItem> HbSharedCache;
       
   242 
   274 
   243 // Function codes (opcodes) used in message passing between client and server
   275 // Function codes (opcodes) used in message passing between client and server
   244 enum HbThemeServerRequest
   276 enum HbThemeServerRequest
   245     {
   277     {
   246      EInvalidServerRequest = 0,
   278      EInvalidServerRequest = 0,
   250      EThemeSelection,
   282      EThemeSelection,
   251      EMultiPieceIcon,
   283      EMultiPieceIcon,
   252      EMultiIcon,
   284      EMultiIcon,
   253      EWidgetMLLookup,
   285      EWidgetMLLookup,
   254      EDeviceProfileOffset,
   286      EDeviceProfileOffset,
   255      ESecondaryCacheOffset,
       
   256      ENotifyForegroundLost,
   287      ENotifyForegroundLost,
   257  #ifdef HB_ICON_CACHE_DEBUG
   288  #ifdef HB_ICON_CACHE_DEBUG
   258      EIconCleanUp,
   289      EIconCleanUp,
   259      ECacheIconCount,
   290      ECacheIconCount,
   260      ERasterMemLimit,
   291      ERasterMemLimit,
   282      ETotalGPUMem,
   313      ETotalGPUMem,
   283      EGPULRUSize,
   314      EGPULRUSize,
   284      ERefCount,
   315      ERefCount,
   285 #endif
   316 #endif
   286      EThemeContentUpdate,
   317      EThemeContentUpdate,
   287 	 EEffectLookupFilePath,
   318      EEffectLookupFilePath,
   288 	 EEffectAdd,
   319      EEffectAdd,
   289      EUnloadIcon,
   320      EUnloadIcon,
   290      EUnloadMultiIcon,
   321      EUnloadMultiIcon,
   291      EMemoryGood,
   322      EMemoryGood,
   292      EFreeRam,
   323      EFreeRam,
       
   324      ERenderModeSwitch,
   293      EThemeServerStop,
   325      EThemeServerStop,
   294      EThemeIndex,
       
   295      EFreeSharedMem,
   326      EFreeSharedMem,
   296      EAllocatedSharedMem,
   327      EAllocatedSharedMem,
   297      EAllocatedHeapMem
   328      EAllocatedHeapMem,
       
   329      ETypefaceOffset
   298 #ifdef HB_THEME_SERVER_MEMORY_REPORT
   330 #ifdef HB_THEME_SERVER_MEMORY_REPORT
   299      ,ECreateMemoryReport
   331      ,ECreateMemoryReport
   300 #endif
   332 #endif
   301     };
   333     };
       
   334 //Rendering Modes
       
   335 enum HbRenderingMode
       
   336 {
       
   337 	ESWRendering,
       
   338 	EHWRendering
       
   339 };
       
   340 
       
   341 struct HbFreeRamNotificationData
       
   342 {
       
   343 	int bytesToFree;
       
   344 	bool useSwRendering;
       
   345 };	
   302 
   346 
   303 #endif /* HBTHEMECOMMON_P_H */
   347 #endif /* HBTHEMECOMMON_P_H */