1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0"" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef HBTHEMECOMMON_P_H |
|
19 #define HBTHEMECOMMON_P_H |
|
20 |
|
21 #include <QImage> |
|
22 #include <QSize> |
|
23 #include <QStringList> |
|
24 #include <QColor> |
|
25 |
|
26 #define THEME_SERVER_NAME "hbthemeserver" |
|
27 #define HB_THEME_SHARED_PIXMAP_CHUNK "themeserver_chunk" |
|
28 #define ORGANIZATION "Nokia" |
|
29 #define THEME_COMPONENT "ThemeFramework" |
|
30 |
|
31 // To enable/disable debug messages for theme server functionality |
|
32 #undef THEME_SERVER_TRACES |
|
33 |
|
34 // To enable fute testing for cache |
|
35 //#define HB_ICON_CACHE_DEBUG |
|
36 struct MultiPartSizeData |
|
37 { |
|
38 // Indexing order is: |
|
39 |
|
40 // 'NinePieces' -> tl, t, tr, l, c, r, bl, b, br |
|
41 // 'ThreePiecesHorizontal' -> l, c, r |
|
42 // 'ThreePiecesVertical' -> t, c, b |
|
43 QString multiPartIconId; |
|
44 QRect sources[9]; // rects used from the rasterized frame part pixmaps |
|
45 QRect targets[9]; // frame part target rects inside the bounding rectangle of the frame |
|
46 QSize pixmapSizes[9]; // frame part pixmaps are rasterized to these sizes |
|
47 }; |
|
48 |
|
49 |
|
50 struct HbMultiIconParams |
|
51 { |
|
52 QString multiPartIconId; |
|
53 QStringList multiPartIconList; |
|
54 MultiPartSizeData multiPartIconData; |
|
55 QSizeF size; |
|
56 int aspectRatioMode; |
|
57 int mode; |
|
58 int options; |
|
59 bool mirrored; |
|
60 QColor color; |
|
61 int rgba; |
|
62 bool colorflag; |
|
63 }; |
|
64 |
|
65 |
|
66 enum IconFormatType { |
|
67 INVALID_FORMAT = -1, |
|
68 NVG, |
|
69 PIC, |
|
70 SVG, |
|
71 BLOB, |
|
72 OTHER_SUPPORTED_FORMATS |
|
73 }; |
|
74 |
|
75 struct HbSharedPixmapInfo |
|
76 { |
|
77 int offset; |
|
78 int width; |
|
79 int height; |
|
80 int defaultWidth; |
|
81 int defaultHeight; |
|
82 QImage::Format format; |
|
83 }; |
|
84 |
|
85 struct HbSharedNVGInfo |
|
86 { |
|
87 int offset; |
|
88 int dataSize; |
|
89 int width; |
|
90 int height; |
|
91 int defaultWidth; |
|
92 int defaultHeight; |
|
93 |
|
94 }; |
|
95 |
|
96 struct HbSharedPICInfo |
|
97 { |
|
98 int offset; |
|
99 int dataSize; |
|
100 int width; |
|
101 int height; |
|
102 int defaultWidth; |
|
103 int defaultHeight; |
|
104 }; |
|
105 |
|
106 struct HbSharedBLOBInfo |
|
107 { |
|
108 int offset; |
|
109 int dataSize; |
|
110 }; |
|
111 |
|
112 struct HbSharedIconInfo |
|
113 { |
|
114 IconFormatType type; |
|
115 |
|
116 union |
|
117 { |
|
118 HbSharedPixmapInfo pixmapData; |
|
119 HbSharedNVGInfo nvgData; |
|
120 HbSharedPICInfo picData; |
|
121 HbSharedBLOBInfo blobData; |
|
122 }; |
|
123 |
|
124 }; |
|
125 |
|
126 struct HbSharedStyleSheetInfo |
|
127 { |
|
128 int offset; |
|
129 int refCount; |
|
130 HbSharedStyleSheetInfo(): |
|
131 offset(-1), |
|
132 refCount(0) |
|
133 {} |
|
134 }; |
|
135 |
|
136 struct HbSharedEffectInfo |
|
137 { |
|
138 int offset; |
|
139 HbSharedEffectInfo(): offset(-1){} |
|
140 }; |
|
141 |
|
142 struct HbSharedWMLInfo |
|
143 { |
|
144 int offset; |
|
145 HbSharedWMLInfo() : offset(-1) {} |
|
146 }; |
|
147 |
|
148 struct HbDeviceProfileInfo |
|
149 { |
|
150 int offset; |
|
151 HbDeviceProfileInfo() : offset(-1) {} |
|
152 }; |
|
153 |
|
154 // Function codes (opcodes) used in message passing between client and server |
|
155 enum ThemeServerRequest |
|
156 { |
|
157 EIconLookup = 1, |
|
158 EIconDefaultSize, |
|
159 EStyleSheetLookup, |
|
160 EThemeSelection, |
|
161 EMultiPieceIcon, |
|
162 EWidgetMLLookup, |
|
163 EDeviceProfileOffset, |
|
164 #ifdef HB_ICON_CACHE_DEBUG |
|
165 EIconCleanUp, |
|
166 ECacheIconCount, |
|
167 ERasterMemLimit, |
|
168 EVectorMemLimit, |
|
169 EFreeRasterMem, |
|
170 EFreeVectorMem, |
|
171 ELastAddedItemMem, |
|
172 ELastAddedItemRefCount, |
|
173 ELastRemovedItemMem, |
|
174 ELastRemovedItemRefCount, |
|
175 EEnableCache, |
|
176 ECacheHit, |
|
177 ECacheMiss, |
|
178 ECleanRasterLRUList, |
|
179 ECleanVectorLRUList, |
|
180 EServerHeap, |
|
181 EGpuLruCount, |
|
182 ECpuLruCount, |
|
183 EServerStat, |
|
184 EServerHeapMarkStart, |
|
185 EServerHeapMarkEnd, |
|
186 EServerAllocFail, |
|
187 EServerAllocReset, |
|
188 #endif |
|
189 EThemeContentUpdate, |
|
190 EEffectLookupFilePath, |
|
191 EEffectAdd, |
|
192 EUnloadIcon, |
|
193 EThemeServerStop |
|
194 }; |
|
195 |
|
196 #endif /* HBTHEMECOMMON_P_H */ |
|