17 #define AMT_FUNC(func) |
17 #define AMT_FUNC(func) |
18 #define AMT_FUNC_EXC(func) |
18 #define AMT_FUNC_EXC(func) |
19 #define AMT_FUNC_EXC_RET(ret, func) |
19 #define AMT_FUNC_EXC_RET(ret, func) |
20 #define AMT_FUNC_EXC_IF(cond, func) |
20 #define AMT_FUNC_EXC_IF(cond, func) |
21 #define AMT_FUNC_EXC_IF_RET(cond, ret, func) |
21 #define AMT_FUNC_EXC_IF_RET(cond, ret, func) |
22 #define AMT_INC_COUNTER(member) |
22 #define AMT_MAP_PTR_TO_KEY_CAST(keyPtr) |
23 #define AMT_DEC_COUNTER(member) |
23 #define AMT_MAP_CANVAS_WS_PAINTER_SELECT_GC() |
24 #define AMT_SET_VALUE(member, val) |
24 #define AMT_MAP_GCE_SET_LAYER_POSITIONS() |
25 #define AMT_GET_VALUE(x, member) |
|
26 #define AMT_INC_COUNTER_IF(cond, member) |
|
27 #define AMT_DEC_COUNTER_IF(cond, member) |
|
28 #define AMT_SET_VALUE_IF(cond, member, val) |
|
29 #define AMT_GET_VALUE_IF(cond, x, member) |
|
30 |
|
31 #define AMT_ADD_TIME(handle, member, effects) |
|
32 #define AMT_GET_TIME(x, handle, index, effects) |
|
33 #define AMT_GET_TIME_POINT_COUNT(handle, x) |
|
34 #define AMT_RESET_TIME(handle) |
|
35 |
|
36 #define AMT_MAP_PTR_TO_KEY_CAST( keyPtr ) |
|
37 #define AMT_MAP_CPTR_TO_KEY_CAST( keyCPtr ) |
|
38 #define AMT_MAP_APPEND_IF(cond, memberMap, key, defaultValue, type) |
|
39 #define AMT_MAP_APPEND(memberMap, key, defaultValue, type) |
|
40 #define AMT_MAP_APPEND_LINK_IF(cond, memberMap, linkKey, targetKey, type) |
|
41 #define AMT_MAP_APPEND_LINK(memberMap, linkKey, targetKey, type) |
|
42 #define AMT_MAP_APPEND_AND_LINK_IF(cond, memberMap, linkKey, actualKey, defaultValue, type) |
|
43 #define AMT_MAP_APPEND_AND_LINK(memberMap, linkKey, actualKey, defaultValue, type) |
|
44 #define AMT_MAP_SET_VALUE_IF(cond, memberMap, key, value, type) |
|
45 #define AMT_MAP_INC_VALUE_IF(cond, memberMap, key, type) |
|
46 #define AMT_MAP_DEC_VALUE_IF(cond, memberMap, key, type) |
|
47 #define AMT_MAP_SET_VALUE(memberMap, key, value, type) |
|
48 #define AMT_MAP_INC_VALUE(memberMap, key, type) |
|
49 #define AMT_MAP_DEC_VALUE(memberMap, key, type) |
|
50 #define AMT_MAP_APPEND_ACCEPT_IF(cond, memberMap, testType) |
|
51 #define AMT_MAP_APPEND_ACCEPT(memberMap, testType) |
|
52 #define AMT_MAP_RESET_ITEMS(memberMap, defaultValue, type) |
|
53 #define AMT_MAP_RESET(memberMap) |
|
54 |
|
55 #define AMT_PRINT_STATE() |
|
56 |
25 |
57 #else |
26 #else |
58 // Module test hook has been set. |
27 // Module test hook has been set. |
59 |
28 |
60 #ifndef AMT_CONTROL |
29 #ifndef AMT_CONTROL |
65 // #define AMT_CONTROL() iMyModuleTestDataControl |
34 // #define AMT_CONTROL() iMyModuleTestDataControl |
66 // etc. |
35 // etc. |
67 #endif // AMT_CONTROL |
36 #endif // AMT_CONTROL |
68 |
37 |
69 |
38 |
|
39 // *** General test variable defines |
|
40 |
|
41 // Text cursor handle is defined as constant because correct handle is not provided |
|
42 // from the window server for render stage. |
|
43 #define AMT_MAP_TEXT_CURSOR_HANDLE 0 |
|
44 |
|
45 #define AMT_MAP_FORCE_SW_HANDLE 0 |
|
46 #define AMT_MAP_SW_ENABLED_HANDLE 1 |
|
47 #define AMT_MAP_LOW_MEMORY_MODE_HANDLE 2 |
|
48 |
|
49 #define AMT_MAP_CANVAS_WS_GC_TYPE 0 |
|
50 #define AMT_MAP_TEXTURE_CACHE_MEMORY_LEVEL 1 |
|
51 #define AMT_MAP_CACHED_IMAGES_COUNT 2 |
|
52 #define AMT_MAP_CACHED_TEXTS_COUNT 3 |
|
53 #define AMT_MAP_CACHED_RENDER_BUFFERS_COUNT 4 |
|
54 |
|
55 |
70 // *** Use these macros to access global memory chunk |
56 // *** Use these macros to access global memory chunk |
71 |
57 |
72 |
58 |
73 // Note: If you read/write a large block of data members, it is advisable not use the AMT_FUNC_EXC() based macros below. |
59 // Note: If you read/write a large block of data members, it is advisable not use the AMT_FUNC_EXC() based macros below. |
74 // Use Lock() and Unlock() around the block explicitely, and use AMT_FUNC() macro. |
60 // Use Lock() and Unlock() around the block explicitely, and use AMT_FUNC() macro. |
75 // That is to avoid unnecessary nested lock-unlock sequences (even if nested locks are working ok). |
61 // That is to avoid unnecessary nested lock-unlock sequences (even if nested locks are working ok). |
76 |
62 |
77 // Note: Be careful not to lock the the mutex for a long time as it will halt other processes if they are using the lock during that time! |
63 // Note: Be careful not to lock the the mutex for a long time as it will halt other processes if they are using the lock during that time! |
78 |
64 |
79 // Generic macros |
65 // *** Generic macros |
|
66 |
80 #define AMT_DATA() AMT_CONTROL()->iModuleTestData |
67 #define AMT_DATA() AMT_CONTROL()->iModuleTestData |
81 #define AMT_FUNC(func) if (AMT_DATA()->iIsEnabled) {func;} |
68 #define AMT_FUNC(func) if (AMT_DATA()->iIsEnabled) {func;} |
82 #define AMT_FUNC_EXC(func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled) {func;} AMT_CONTROL()->Unlock();} |
69 #define AMT_FUNC_EXC(func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled) {func;} AMT_CONTROL()->Unlock();} |
83 #define AMT_FUNC_EXC_RET(ret, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled) {ret = func;} AMT_CONTROL()->Unlock();} |
70 #define AMT_FUNC_EXC_RET(ret, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled) {ret = func;} AMT_CONTROL()->Unlock();} |
84 #define AMT_FUNC_EXC_IF(cond, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled && (cond)) {func;} AMT_CONTROL()->Unlock();} |
71 #define AMT_FUNC_EXC_IF(cond, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled && (cond)) {func;} AMT_CONTROL()->Unlock();} |
85 #define AMT_FUNC_EXC_IF_RET(cond, ret, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled && (cond)) {ret = func;} AMT_CONTROL()->Unlock();} |
72 #define AMT_FUNC_EXC_IF_RET(cond, ret, func) {AMT_CONTROL()->Lock(); if (AMT_DATA()->iIsEnabled && (cond)) {ret = func;} AMT_CONTROL()->Unlock();} |
86 |
73 #define AMT_MAP_PTR_TO_KEY_CAST(keyPtr) reinterpret_cast< TInt >( keyPtr ) |
87 // Single operation macros, that will do lock/unlock. |
74 |
88 #define AMT_INC_COUNTER(member) AMT_FUNC_EXC(AMT_DATA()->member++) |
75 |
89 #define AMT_DEC_COUNTER(member) AMT_FUNC_EXC(AMT_DATA()->member--) |
76 // *** Macros to define function content |
90 #define AMT_SET_VALUE(member, val) AMT_FUNC_EXC(AMT_DATA()->member=(val)) |
77 |
91 #define AMT_GET_VALUE(x, member) AMT_FUNC_EXC((x) = AMT_DATA()->member) |
78 #define AMT_MAP_CANVAS_WS_PAINTER_SELECT_GC() \ |
92 |
79 if ( iCanvasWsGc ) \ |
93 // Conditional single operation macros, that will do lock/unlock. |
80 { \ |
94 #define AMT_INC_COUNTER_IF(cond, member) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member++) |
81 AMT_MAP_SET_VALUE( \ |
95 #define AMT_DEC_COUNTER_IF(cond, member) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member--) |
82 iIntMap, \ |
96 #define AMT_SET_VALUE_IF(cond, member, val) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member=(val)) |
83 AMT_MAP_CANVAS_WS_GC_TYPE, \ |
97 #define AMT_GET_VALUE_IF(cond, x, member) AMT_FUNC_EXC_IF((cond), (x) = AMT_DATA()->member) |
84 iCanvasWsGc->Type(), \ |
98 |
85 EAlfModuleTestTypeCoreToolkitGoom ); \ |
99 #define AMT_ADD_TIME(handle, member, effects) AMT_FUNC_EXC(TInt timemapIndex = 0; while(timemapIndex < 10){ if (AMT_DATA()->iTimeMap[timemapIndex].iHandle == handle){ TInt nextFreeIndex = AMT_DATA()->iTimeMap[timemapIndex].iCounter; AMT_DATA()->iTimeMap[timemapIndex].iTimeStamp[nextFreeIndex] = member; AMT_DATA()->iTimeMap[timemapIndex].iCounter++; timemapIndex = 100; break;} timemapIndex++; } if (timemapIndex == 10) { if (AMT_DATA()->iNextFreeMap == 10) { AMT_DATA()->iNextFreeMap = 0;} TInt nextFreeMap = AMT_DATA()->iNextFreeMap; AMT_DATA()->iTimeMap[nextFreeMap].iCounter = 1; AMT_DATA()->iTimeMap[nextFreeMap].iHandle = handle; AMT_DATA()->iTimeMap[nextFreeMap].iTimeStamp[0] = member; AMT_DATA()->iTimeMap[nextFreeMap].iEffects = effects; AMT_DATA()->iNextFreeMap++; /*RDebug::Printf("Handle: %d, %d %d %d", handle, timemapIndex, AMT_DATA()->iNextFreeMap, member)*/;}) |
86 } \ |
100 #define AMT_GET_TIME(x, handle, index, effects) AMT_FUNC_EXC(TInt timemapIndex = 0; while(timemapIndex < 10){ if (AMT_DATA()->iTimeMap[timemapIndex].iHandle == handle){ (x) = AMT_DATA()->iTimeMap[timemapIndex].iTimeStamp[index];(effects) = AMT_DATA()->iTimeMap[timemapIndex].iEffects;break;}timemapIndex++;}if(timemapIndex == 10){(x) = KErrNotFound;(effects) = EFalse;}) |
87 else \ |
101 #define AMT_GET_TIME_POINT_COUNT(handle, x) AMT_FUNC_EXC(TInt timemapIndex = 0; while(timemapIndex < 10){ if (AMT_DATA()->iTimeMap[timemapIndex].iHandle == handle){ (x) = AMT_DATA()->iTimeMap[timemapIndex].iCounter;timemapIndex = 100;}timemapIndex++;}if(timemapIndex == 10){(x) = KErrNotFound;}) |
88 { \ |
102 #define AMT_RESET_TIME(handle) AMT_FUNC_EXC(TInt timemapIndex = 0; while(timemapIndex < 10){ if (AMT_DATA()->iTimeMap[timemapIndex].iHandle == handle){ AMT_DATA()->iTimeMap[timemapIndex].iHandle = 0; AMT_DATA()->iTimeMap[timemapIndex].iCounter = 0;AMT_DATA()->iTimeMap[timemapIndex].iEffects = 0;break;}timemapIndex++;}) |
89 AMT_MAP_SET_VALUE( \ |
103 |
90 iIntMap, \ |
104 // Map operation macros, that will do lock/unlock |
91 AMT_MAP_CANVAS_WS_GC_TYPE, \ |
105 #define AMT_MAP_PTR_TO_KEY_CAST( keyPtr ) reinterpret_cast< TInt >( keyPtr ) |
92 KErrNotFound, \ |
106 #define AMT_MAP_CPTR_TO_KEY_CAST( keyCPtr ) AMT_MAP_PTR_TO_KEY_CAST( static_cast< const CBase* >( keyCPtr ) ) |
93 EAlfModuleTestTypeCoreToolkitGoom ); \ |
107 #define AMT_MAP_APPEND_IF(cond, memberMap, key, defaultValue, type) AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.Append(type, key, defaultValue)) |
94 } |
108 #define AMT_MAP_APPEND(memberMap, key, defaultValue, type) AMT_MAP_APPEND_IF(ETrue, memberMap, key, defaultValue, type) |
95 |
109 #define AMT_MAP_APPEND_LINK_IF(cond, memberMap, linkKey, targetKey, type) AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.AppendLink(type, linkKey, targetKey)) |
96 // Sets the position of the layer into the map. |
110 #define AMT_MAP_APPEND_LINK(memberMap, linkKey, targetKey, type) AMT_MAP_APPEND_LINK_IF(ETrue, memberMap, linkKey, targetKey, type) |
97 // Zero means the bottom and the top layer has the greates position value. |
111 #define AMT_MAP_APPEND_AND_LINK_IF(cond, memberMap, linkKey, actualKey, defaultValue, type) AMT_MAP_APPEND_IF(cond, memberMap, actualKey, defaultValue, type ); AMT_MAP_APPEND_LINK_IF(cond, memberMap, linkKey, actualKey, type) |
98 #define AMT_MAP_GCE_SET_LAYER_POSITIONS() \ |
112 #define AMT_MAP_APPEND_AND_LINK(memberMap, linkKey, actualKey, defaultValue, type) AMT_MAP_APPEND_AND_LINK_IF(ETrue, memberMap, linkKey, actualKey, defaultValue, type) |
99 TInt gceLayerPosition( -1 ); \ |
113 #define AMT_MAP_SET_VALUE_IF(cond, memberMap, key, value, type) AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.SetActualValue(type, key, value)) |
100 const MWsLayer* gceLayer( iBottomLayer ); \ |
114 #define AMT_MAP_INC_VALUE_IF(cond, memberMap, key, type) AMT_FUNC_EXC_IF((cond && AMT_DATA()->memberMap.FindActual(type, key)), AMT_DATA()->memberMap.SetActualValue(type, key, AMT_DATA()->memberMap.FindActual(type, key)->Value() + 1)) |
101 while( gceLayer ) \ |
115 #define AMT_MAP_DEC_VALUE_IF(cond, memberMap, key, type) AMT_FUNC_EXC_IF((cond && AMT_DATA()->memberMap.FindActual(type, key)), AMT_DATA()->memberMap.SetActualValue(type, key, AMT_DATA()->memberMap.FindActual(type, key)->Value() - 1)) |
102 { \ |
116 #define AMT_MAP_SET_VALUE(memberMap, key, value, type) AMT_FUNC_EXC_IF(ETrue, AMT_DATA()->memberMap.SetActualValue(type, key, value)) |
103 ++gceLayerPosition; \ |
117 #define AMT_MAP_INC_VALUE(memberMap, key, type) AMT_MAP_INC_VALUE_IF(ETrue, memberMap, key, type) |
104 AMT_MAP_SET_VALUE( \ |
118 #define AMT_MAP_DEC_VALUE(memberMap, key, type) AMT_MAP_DEC_VALUE_IF(ETrue, memberMap, key, type) |
105 iIntMap, AMT_MAP_PTR_TO_KEY_CAST( gceLayer ), \ |
119 #define AMT_MAP_APPEND_ACCEPT_IF(cond, memberMap, testType) AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.AppendAccept(testType)) |
106 gceLayerPosition, EAlfModuleTestTypeGceLayerPosition ); \ |
120 #define AMT_MAP_APPEND_ACCEPT(memberMap, testType) AMT_MAP_APPEND_ACCEPT_IF(ETrue, memberMap, testType) |
107 gceLayer = gceLayer->Above(); \ |
121 #define AMT_MAP_RESET_ITEMS(memberMap, defaultValue, type) AMT_FUNC_EXC(AMT_DATA()->memberMap.ResetItems(type, defaultValue)) |
108 } |
122 #define AMT_MAP_RESET(memberMap) AMT_FUNC_EXC(AMT_DATA()->memberMap.Reset()) |
|
123 |
|
124 #define AMT_PRINT_STATE() AMT_FUNC_EXC(AMT_DATA()->PrintState()) |
|
125 |
109 |
126 #endif // USE_MODULE_TEST_HOOKS_FOR_ALF |
110 #endif // USE_MODULE_TEST_HOOKS_FOR_ALF |
127 |
|
128 |
|
129 // General defines |
|
130 // Text cursor handle is defined as constant because correct handle is not provided |
|
131 // from the window server for render stage. |
|
132 #define AMT_MAP_TEXT_CURSOR_HANDLE 0 |
|
133 |
|
134 #define AMT_MAP_FORCE_SW_HANDLE 0 |
|
135 #define AMT_MAP_SW_ENABLED_HANDLE 1 |
|
136 #define AMT_MAP_LOW_MEMORY_MODE_HANDLE 2 |
|
137 |
|
138 #define AMT_MAP_CANVAS_WS_GC_TYPE 0 |
|
139 #define AMT_MAP_TEXTURE_CACHE_MEMORY_LEVEL 1 |
|
140 #define AMT_MAP_CACHED_IMAGES_COUNT 2 |
|
141 #define AMT_MAP_CACHED_TEXTS_COUNT 3 |
|
142 #define AMT_MAP_CACHED_RENDER_BUFFERS_COUNT 4 |
|
143 |
111 |
144 |
112 |
145 // Notice: |
113 // Notice: |
146 // Defines below will be empty if module test hook is not set. |
114 // Defines below will be empty if module test hook is not set. |
147 // If module test hook is set on, then these defines also use functionality defined above. |
115 // If module test hook is set on, then these defines also use functionality defined above. |
|
116 |
|
117 |
|
118 // Single operation macros, that will do lock/unlock. |
|
119 #define AMT_PRINT_STATE() AMT_FUNC_EXC(AMT_DATA()->PrintState()) |
|
120 #define AMT_INC_COUNTER(member) AMT_FUNC_EXC(AMT_DATA()->member++) |
|
121 #define AMT_DEC_COUNTER(member) AMT_FUNC_EXC(AMT_DATA()->member--) |
|
122 #define AMT_SET_VALUE(member, val) AMT_FUNC_EXC(AMT_DATA()->member=(val)) |
|
123 #define AMT_GET_VALUE(x, member) AMT_FUNC_EXC((x) = AMT_DATA()->member) |
|
124 |
|
125 // Conditional single operation macros, that will do lock/unlock. |
|
126 #define AMT_INC_COUNTER_IF(cond, member) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member++) |
|
127 #define AMT_DEC_COUNTER_IF(cond, member) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member--) |
|
128 #define AMT_SET_VALUE_IF(cond, member, val) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member=(val)) |
|
129 #define AMT_GET_VALUE_IF(cond, x, member) AMT_FUNC_EXC_IF((cond), (x) = AMT_DATA()->member) |
|
130 |
|
131 #define AMT_ADD_TIME(handle, member, effects) AMT_FUNC_EXC(TInt timemapIndex = 0; while(timemapIndex < 10){ if (AMT_DATA()->iTimeMap[timemapIndex].iHandle == handle){ TInt nextFreeIndex = AMT_DATA()->iTimeMap[timemapIndex].iCounter; AMT_DATA()->iTimeMap[timemapIndex].iTimeStamp[nextFreeIndex] = member; AMT_DATA()->iTimeMap[timemapIndex].iCounter++; timemapIndex = 100; break;} timemapIndex++; } if (timemapIndex == 10) { if (AMT_DATA()->iNextFreeMap == 10) { AMT_DATA()->iNextFreeMap = 0;} TInt nextFreeMap = AMT_DATA()->iNextFreeMap; AMT_DATA()->iTimeMap[nextFreeMap].iCounter = 1; AMT_DATA()->iTimeMap[nextFreeMap].iHandle = handle; AMT_DATA()->iTimeMap[nextFreeMap].iTimeStamp[0] = member; AMT_DATA()->iTimeMap[nextFreeMap].iEffects = effects; AMT_DATA()->iNextFreeMap++; /*RDebug::Printf("Handle: %d, %d %d %d", handle, timemapIndex, AMT_DATA()->iNextFreeMap, member)*/;}) |
|
132 #define AMT_GET_TIME(x, handle, index, effects) AMT_FUNC_EXC(TInt timemapIndex = 0; while(timemapIndex < 10){ if (AMT_DATA()->iTimeMap[timemapIndex].iHandle == handle){ (x) = AMT_DATA()->iTimeMap[timemapIndex].iTimeStamp[index];(effects) = AMT_DATA()->iTimeMap[timemapIndex].iEffects;break;}timemapIndex++;}if(timemapIndex == 10){(x) = KErrNotFound;(effects) = EFalse;}) |
|
133 #define AMT_GET_TIME_POINT_COUNT(handle, x) AMT_FUNC_EXC(TInt timemapIndex = 0; while(timemapIndex < 10){ if (AMT_DATA()->iTimeMap[timemapIndex].iHandle == handle){ (x) = AMT_DATA()->iTimeMap[timemapIndex].iCounter;timemapIndex = 100;}timemapIndex++;}if(timemapIndex == 10){(x) = KErrNotFound;}) |
|
134 #define AMT_RESET_TIME(handle) AMT_FUNC_EXC(TInt timemapIndex = 0; while(timemapIndex < 10){ if (AMT_DATA()->iTimeMap[timemapIndex].iHandle == handle){ AMT_DATA()->iTimeMap[timemapIndex].iHandle = 0; AMT_DATA()->iTimeMap[timemapIndex].iCounter = 0;AMT_DATA()->iTimeMap[timemapIndex].iEffects = 0;break;}timemapIndex++;}) |
|
135 |
|
136 // Map operation macros, that will do lock/unlock |
|
137 #define AMT_MAP_CPTR_TO_KEY_CAST(keyCPtr) AMT_MAP_PTR_TO_KEY_CAST( static_cast< const CBase* >( keyCPtr ) ) |
|
138 #define AMT_MAP_APPEND_IF(cond, memberMap, key, defaultValue, type) AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.Append(type, key, defaultValue)) |
|
139 #define AMT_MAP_APPEND(memberMap, key, defaultValue, type) AMT_MAP_APPEND_IF(ETrue, memberMap, key, defaultValue, type) |
|
140 #define AMT_MAP_APPEND_LINK_IF(cond, memberMap, linkKey, targetKey, type) AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.AppendLink(type, linkKey, targetKey)) |
|
141 #define AMT_MAP_APPEND_LINK(memberMap, linkKey, targetKey, type) AMT_MAP_APPEND_LINK_IF(ETrue, memberMap, linkKey, targetKey, type) |
|
142 #define AMT_MAP_APPEND_AND_LINK_IF(cond, memberMap, linkKey, actualKey, defaultValue, type) AMT_MAP_APPEND_IF(cond, memberMap, actualKey, defaultValue, type ); AMT_MAP_APPEND_LINK_IF(cond, memberMap, linkKey, actualKey, type) |
|
143 #define AMT_MAP_APPEND_AND_LINK(memberMap, linkKey, actualKey, defaultValue, type) AMT_MAP_APPEND_AND_LINK_IF(ETrue, memberMap, linkKey, actualKey, defaultValue, type) |
|
144 #define AMT_MAP_SET_VALUE_IF(cond, memberMap, key, value, type) AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.SetActualValue(type, key, value)) |
|
145 #define AMT_MAP_INC_VALUE_IF(cond, memberMap, key, type) AMT_FUNC_EXC_IF((cond && AMT_DATA()->memberMap.FindActual(type, key)), AMT_DATA()->memberMap.SetActualValue(type, key, AMT_DATA()->memberMap.FindActual(type, key)->Value() + 1)) |
|
146 #define AMT_MAP_DEC_VALUE_IF(cond, memberMap, key, type) AMT_FUNC_EXC_IF((cond && AMT_DATA()->memberMap.FindActual(type, key)), AMT_DATA()->memberMap.SetActualValue(type, key, AMT_DATA()->memberMap.FindActual(type, key)->Value() - 1)) |
|
147 #define AMT_MAP_SET_VALUE(memberMap, key, value, type) AMT_FUNC_EXC_IF(ETrue, AMT_DATA()->memberMap.SetActualValue(type, key, value)) |
|
148 #define AMT_MAP_INC_VALUE(memberMap, key, type) AMT_MAP_INC_VALUE_IF(ETrue, memberMap, key, type) |
|
149 #define AMT_MAP_DEC_VALUE(memberMap, key, type) AMT_MAP_DEC_VALUE_IF(ETrue, memberMap, key, type) |
|
150 #define AMT_MAP_APPEND_ACCEPT_IF(cond, memberMap, testType) AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.AppendAccept(testType)) |
|
151 #define AMT_MAP_APPEND_ACCEPT(memberMap, testType) AMT_MAP_APPEND_ACCEPT_IF(ETrue, memberMap, testType) |
|
152 #define AMT_MAP_RESET_ITEMS(memberMap, defaultValue, type) AMT_FUNC_EXC(AMT_DATA()->memberMap.ResetItems(type, defaultValue)) |
|
153 #define AMT_MAP_RESET(memberMap) AMT_FUNC_EXC(AMT_DATA()->memberMap.Reset()) |
148 |
154 |
149 |
155 |
150 // Render stage defines |
156 // Render stage defines |
151 |
157 |
152 #define AMT_MAP_RENDER_STAGE_NODE_CREATED() \ |
158 #define AMT_MAP_RENDER_STAGE_NODE_CREATED() \ |
173 AMT_MAP_INC_VALUE_IF( ( aWindowTreeNode.NodeType() == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor && aAttribute == ECursorColor ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeRenderStageChangeTextCursorColor ) |
179 AMT_MAP_INC_VALUE_IF( ( aWindowTreeNode.NodeType() == MWsWindowTreeNode::EWinTreeNodeStandardTextCursor && aAttribute == ECursorColor ), iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeRenderStageChangeTextCursorColor ) |
174 |
180 |
175 #define AMT_MAP_RENDER_STAGE_ADD_LAYER() \ |
181 #define AMT_MAP_RENDER_STAGE_ADD_LAYER() \ |
176 AMT_MAP_APPEND_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TSurfaceId::CreateNullId(), EAlfModuleTestTypeCreateLayer ); \ |
182 AMT_MAP_APPEND_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TSurfaceId::CreateNullId(), EAlfModuleTestTypeCreateLayer ); \ |
177 AMT_MAP_APPEND_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TSurfaceId::CreateNullId(), EAlfModuleTestTypeReleaseLayer ); \ |
183 AMT_MAP_APPEND_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TSurfaceId::CreateNullId(), EAlfModuleTestTypeReleaseLayer ); \ |
178 AMT_MAP_APPEND_IF( aLayer, iIntMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), 0, EAlfModuleTestTypeLayerOrdinalPosition ) |
184 AMT_MAP_APPEND_IF( aLayer, iIntMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), 0, EAlfModuleTestTypeLayerOrdinalPosition ); \ |
|
185 AMT_MAP_APPEND_IF( aLayer, iIntMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), 0, EAlfModuleTestTypeLayerNodeOrdinalPosition ) |
179 |
186 |
180 #define AMT_MAP_RENDER_STAGE_ADD_LAYER_LINK() \ |
187 #define AMT_MAP_RENDER_STAGE_ADD_LAYER_LINK() \ |
181 AMT_MAP_APPEND_LINK( iSurfaceMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeCreateLayer ); \ |
188 AMT_MAP_APPEND_LINK( iSurfaceMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeCreateLayer ); \ |
182 AMT_MAP_APPEND_LINK( iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( &aWindowTreeNode ), windowId, EAlfModuleTestTypeCreateLayer ); \ |
189 AMT_MAP_APPEND_LINK( iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( &aWindowTreeNode ), windowId, EAlfModuleTestTypeCreateLayer ); \ |
183 AMT_MAP_APPEND_LINK( iSurfaceMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeReleaseLayer ); \ |
190 AMT_MAP_APPEND_LINK( iSurfaceMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeReleaseLayer ); \ |
184 AMT_MAP_APPEND_LINK( iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( &aWindowTreeNode ), windowId, EAlfModuleTestTypeReleaseLayer ); \ |
191 AMT_MAP_APPEND_LINK( iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( &aWindowTreeNode ), windowId, EAlfModuleTestTypeReleaseLayer ); \ |
185 AMT_MAP_APPEND_LINK( iIntMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeLayerOrdinalPosition ); \ |
192 AMT_MAP_APPEND_LINK( iIntMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeLayerOrdinalPosition ); \ |
186 AMT_MAP_APPEND_LINK( iIntMap, AMT_MAP_PTR_TO_KEY_CAST( &aWindowTreeNode ), windowId, EAlfModuleTestTypeLayerOrdinalPosition ); \ |
193 AMT_MAP_APPEND_LINK( iIntMap, AMT_MAP_PTR_TO_KEY_CAST( &aWindowTreeNode ), windowId, EAlfModuleTestTypeLayerOrdinalPosition ); \ |
|
194 AMT_MAP_APPEND_LINK( iIntMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeLayerNodeOrdinalPosition ); \ |
|
195 AMT_MAP_APPEND_LINK( iIntMap, AMT_MAP_PTR_TO_KEY_CAST( &aWindowTreeNode ), windowId, EAlfModuleTestTypeLayerNodeOrdinalPosition ); \ |
|
196 AMT_MAP_APPEND_LINK( iSurfaceMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeGceCreateLayer ); \ |
|
197 AMT_MAP_APPEND_LINK( iSurfaceMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeGceReleaseLayer ); \ |
|
198 AMT_MAP_APPEND_LINK( iIntMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeGceLayerPosition ); \ |
|
199 AMT_MAP_APPEND_LINK( iIntMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeGceLayerOpacity ); \ |
|
200 AMT_MAP_APPEND_LINK( iRectMap, windowId, AMT_MAP_PTR_TO_KEY_CAST( &aLayer ), EAlfModuleTestTypeGceLayerExtent ); \ |
187 \ |
201 \ |
188 AMT_MAP_SET_VALUE( iSurfaceMap, windowId, aLayer.Surface(), EAlfModuleTestTypeCreateLayer ) |
202 AMT_MAP_SET_VALUE( iSurfaceMap, windowId, aLayer.Surface(), EAlfModuleTestTypeCreateLayer ) |
189 |
203 |
190 #define AMT_MAP_RENDER_STAGE_REMOVE_LAYER() \ |
204 #define AMT_MAP_RENDER_STAGE_REMOVE_LAYER() \ |
191 AMT_MAP_SET_VALUE_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), aLayer->Surface(), EAlfModuleTestTypeReleaseLayer ) |
205 AMT_MAP_SET_VALUE_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), aLayer->Surface(), EAlfModuleTestTypeReleaseLayer ) |
258 AMT_MAP_INC_VALUE_IF( viz, iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeBridgeChangeTextCursorColor ) |
272 AMT_MAP_INC_VALUE_IF( viz, iIntMap, AMT_MAP_TEXT_CURSOR_HANDLE, EAlfModuleTestTypeBridgeChangeTextCursorColor ) |
259 |
273 |
260 #define AMT_MAP_BRIDGE_SET_ORDINAL_POSITION() \ |
274 #define AMT_MAP_BRIDGE_SET_ORDINAL_POSITION() \ |
261 AMT_MAP_SET_VALUE_IF( windowAttributes, iIntMap, windowNodeId, windowAttributes->iOrdinalPosition, EAlfModuleTestTypeLayerOrdinalPosition ) |
275 AMT_MAP_SET_VALUE_IF( windowAttributes, iIntMap, windowNodeId, windowAttributes->iOrdinalPosition, EAlfModuleTestTypeLayerOrdinalPosition ) |
262 |
276 |
263 #ifndef USE_MODULE_TEST_HOOKS_FOR_ALF |
277 #define AMT_MAP_NODE_SET_ORDINAL_POSITION() \ |
264 #define AMT_MAP_CANVAS_WS_PAINTER_SELECT_GC() |
278 AMT_MAP_SET_VALUE( iIntMap, iId, ordinal, EAlfModuleTestTypeLayerNodeOrdinalPosition ) |
265 #else |
279 |
266 #define AMT_MAP_CANVAS_WS_PAINTER_SELECT_GC() \ |
280 |
267 if ( iCanvasWsGc ) \ |
281 // GCE defines |
268 { \ |
282 |
269 AMT_MAP_SET_VALUE( \ |
283 #define AMT_MAP_GCE_ADD_LAYER() \ |
270 iIntMap, \ |
284 AMT_MAP_APPEND_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TSurfaceId::CreateNullId(), EAlfModuleTestTypeGceCreateLayer ); \ |
271 AMT_MAP_CANVAS_WS_GC_TYPE, \ |
285 AMT_MAP_APPEND_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TSurfaceId::CreateNullId(), EAlfModuleTestTypeGceReleaseLayer ); \ |
272 iCanvasWsGc->Type(), \ |
286 AMT_MAP_APPEND_IF( aLayer, iIntMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), 0, EAlfModuleTestTypeGceLayerPosition ); \ |
273 EAlfModuleTestTypeCoreToolkitGoom ); \ |
287 AMT_MAP_APPEND_IF( aLayer, iIntMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), 0, EAlfModuleTestTypeGceLayerOpacity ); \ |
274 } \ |
288 AMT_MAP_APPEND_IF( aLayer, iRectMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TRect(), EAlfModuleTestTypeGceLayerExtent ) |
275 else \ |
289 |
276 { \ |
290 #define AMT_MAP_GCE_SET_SURFACE() \ |
277 AMT_MAP_SET_VALUE( \ |
291 AMT_MAP_SET_VALUE( iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( static_cast< MWsLayer* >( this ) ), aSurface, EAlfModuleTestTypeGceCreateLayer ) |
278 iIntMap, \ |
292 |
279 AMT_MAP_CANVAS_WS_GC_TYPE, \ |
293 #define AMT_MAP_GCE_REMOVE_LAYER() \ |
280 KErrNotFound, \ |
294 AMT_MAP_SET_VALUE_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), aLayer->Surface(), EAlfModuleTestTypeGceReleaseLayer ) |
281 EAlfModuleTestTypeCoreToolkitGoom ); \ |
295 |
282 } |
296 #define AMT_MAP_GCE_SET_LAYER_OPACITY() \ |
283 #endif // USE_MODULE_TEST_HOOKS_FOR_ALF |
297 AMT_MAP_SET_VALUE( iIntMap, AMT_MAP_PTR_TO_KEY_CAST( static_cast< MWsLayer* >( this ) ), Opacity(), EAlfModuleTestTypeGceLayerOpacity ) |
|
298 |
|
299 #define AMT_MAP_GCE_SET_LAYER_EXTENT() \ |
|
300 AMT_MAP_SET_VALUE( iRectMap, AMT_MAP_PTR_TO_KEY_CAST( static_cast< MWsLayer* >( this ) ), aExtent, EAlfModuleTestTypeGceLayerExtent ) |
|
301 |
|
302 |
|
303 // Goom defines |
284 |
304 |
285 #define AMT_MAP_CANVAS_TEXTURE_CACHE_SET_MEMORY_LEVEL() \ |
305 #define AMT_MAP_CANVAS_TEXTURE_CACHE_SET_MEMORY_LEVEL() \ |
286 AMT_MAP_SET_VALUE( iIntMap, AMT_MAP_TEXTURE_CACHE_MEMORY_LEVEL, iMemoryLevel, EAlfModuleTestTypeCoreToolkitGoom ); \ |
306 AMT_MAP_SET_VALUE( iIntMap, AMT_MAP_TEXTURE_CACHE_MEMORY_LEVEL, iMemoryLevel, EAlfModuleTestTypeCoreToolkitGoom ); \ |
287 AMT_MAP_SET_VALUE( iIntMap, AMT_MAP_CACHED_IMAGES_COUNT, iCachedImages.Count(), EAlfModuleTestTypeCoreToolkitGoom ); \ |
307 AMT_MAP_SET_VALUE( iIntMap, AMT_MAP_CACHED_IMAGES_COUNT, iCachedImages.Count(), EAlfModuleTestTypeCoreToolkitGoom ); \ |
288 AMT_MAP_SET_VALUE( iIntMap, AMT_MAP_CACHED_TEXTS_COUNT, iCachedTexts.Count(), EAlfModuleTestTypeCoreToolkitGoom ); \ |
308 AMT_MAP_SET_VALUE( iIntMap, AMT_MAP_CACHED_TEXTS_COUNT, iCachedTexts.Count(), EAlfModuleTestTypeCoreToolkitGoom ); \ |