33 #define AMT_FUNC(func) |
17 #define AMT_FUNC(func) |
34 #define AMT_FUNC_EXC(func) |
18 #define AMT_FUNC_EXC(func) |
35 #define AMT_FUNC_EXC_RET(ret, func) |
19 #define AMT_FUNC_EXC_RET(ret, func) |
36 #define AMT_FUNC_EXC_IF(cond, func) |
20 #define AMT_FUNC_EXC_IF(cond, func) |
37 #define AMT_FUNC_EXC_IF_RET(cond, ret, func) |
21 #define AMT_FUNC_EXC_IF_RET(cond, ret, func) |
38 #define AMT_INC_COUNTER(member) |
22 #define AMT_MAP_PTR_TO_KEY_CAST(keyPtr) |
39 #define AMT_DEC_COUNTER(member) |
23 #define AMT_MAP_CANVAS_WS_PAINTER_SELECT_GC() |
40 #define AMT_SET_VALUE(member, val) |
24 #define AMT_MAP_GCE_SET_LAYER_POSITIONS() |
41 #define AMT_GET_VALUE(x, member) |
|
42 #define AMT_INC_COUNTER_IF(cond, member) |
|
43 #define AMT_DEC_COUNTER_IF(cond, member) |
|
44 #define AMT_SET_VALUE_IF(cond, member, val) |
|
45 #define AMT_GET_VALUE_IF(cond, x, member) |
|
46 |
|
47 #define AMT_ADD_TIME(handle, member, effects) |
|
48 #define AMT_GET_TIME(x, handle, index, effects) |
|
49 #define AMT_GET_TIME_POINT_COUNT(handle, x) |
|
50 #define AMT_RESET_TIME(handle) |
|
51 |
|
52 #define AMT_MAP_PTR_TO_KEY_CAST( keyPtr ) |
|
53 #define AMT_MAP_CPTR_TO_KEY_CAST( keyCPtr ) |
|
54 #define AMT_MAP_APPEND_IF(cond, memberMap, key, defaultValue, type) |
|
55 #define AMT_MAP_APPEND(memberMap, key, defaultValue, type) |
|
56 #define AMT_MAP_APPEND_LINK_IF(cond, memberMap, linkKey, targetKey, type) |
|
57 #define AMT_MAP_APPEND_LINK(memberMap, linkKey, targetKey, type) |
|
58 #define AMT_MAP_APPEND_AND_LINK_IF(cond, memberMap, linkKey, actualKey, defaultValue, type) |
|
59 #define AMT_MAP_APPEND_AND_LINK(memberMap, linkKey, actualKey, defaultValue, type) |
|
60 #define AMT_MAP_SET_VALUE_IF(cond, memberMap, key, value, type) |
|
61 #define AMT_MAP_INC_VALUE_IF(cond, memberMap, key, type) |
|
62 #define AMT_MAP_DEC_VALUE_IF(cond, memberMap, key, type) |
|
63 #define AMT_MAP_SET_VALUE(memberMap, key, value, type) |
|
64 #define AMT_MAP_INC_VALUE(memberMap, key, type) |
|
65 #define AMT_MAP_DEC_VALUE(memberMap, key, type) |
|
66 #define AMT_MAP_APPEND_ACCEPT_IF(cond, memberMap, testType) |
|
67 #define AMT_MAP_APPEND_ACCEPT(memberMap, testType) |
|
68 #define AMT_MAP_RESET_ITEMS(memberMap, defaultValue, type) |
|
69 #define AMT_MAP_RESET(memberMap) |
|
70 |
|
71 #define AMT_PRINT_STATE() |
|
72 |
25 |
73 #else |
26 #else |
74 // Module test hook has been set. |
27 // Module test hook has been set. |
75 |
28 |
76 #ifndef AMT_CONTROL |
29 #ifndef AMT_CONTROL |
81 // #define AMT_CONTROL() iMyModuleTestDataControl |
34 // #define AMT_CONTROL() iMyModuleTestDataControl |
82 // etc. |
35 // etc. |
83 #endif // AMT_CONTROL |
36 #endif // AMT_CONTROL |
84 |
37 |
85 |
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 |
86 // *** Use these macros to access global memory chunk |
56 // *** Use these macros to access global memory chunk |
87 |
57 |
88 |
58 |
89 // 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. |
90 // 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. |
91 // 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). |
92 |
62 |
93 // 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! |
94 |
64 |
95 // Generic macros |
65 // *** Generic macros |
|
66 |
96 #define AMT_DATA() AMT_CONTROL()->iModuleTestData |
67 #define AMT_DATA() AMT_CONTROL()->iModuleTestData |
97 #define AMT_FUNC(func) if (AMT_DATA()->iIsEnabled) {func;} |
68 #define AMT_FUNC(func) if (AMT_DATA()->iIsEnabled) {func;} |
98 #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();} |
99 #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();} |
100 #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();} |
101 #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();} |
102 |
73 #define AMT_MAP_PTR_TO_KEY_CAST(keyPtr) reinterpret_cast< TInt >( keyPtr ) |
103 // Single operation macros, that will do lock/unlock. |
74 |
104 #define AMT_INC_COUNTER(member) AMT_FUNC_EXC(AMT_DATA()->member++) |
75 |
105 #define AMT_DEC_COUNTER(member) AMT_FUNC_EXC(AMT_DATA()->member--) |
76 // *** Macros to define function content |
106 #define AMT_SET_VALUE(member, val) AMT_FUNC_EXC(AMT_DATA()->member=(val)) |
77 |
107 #define AMT_GET_VALUE(x, member) AMT_FUNC_EXC((x) = AMT_DATA()->member) |
78 #define AMT_MAP_CANVAS_WS_PAINTER_SELECT_GC() \ |
108 |
79 if ( iCanvasWsGc ) \ |
109 // Conditional single operation macros, that will do lock/unlock. |
80 { \ |
110 #define AMT_INC_COUNTER_IF(cond, member) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member++) |
81 AMT_MAP_SET_VALUE( \ |
111 #define AMT_DEC_COUNTER_IF(cond, member) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member--) |
82 iIntMap, \ |
112 #define AMT_SET_VALUE_IF(cond, member, val) AMT_FUNC_EXC_IF((cond), AMT_DATA()->member=(val)) |
83 AMT_MAP_CANVAS_WS_GC_TYPE, \ |
113 #define AMT_GET_VALUE_IF(cond, x, member) AMT_FUNC_EXC_IF((cond), (x) = AMT_DATA()->member) |
84 iCanvasWsGc->Type(), \ |
114 |
85 EAlfModuleTestTypeCoreToolkitGoom ); \ |
115 #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 } \ |
116 #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 \ |
117 #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 { \ |
118 #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( \ |
119 |
90 iIntMap, \ |
120 // Map operation macros, that will do lock/unlock |
91 AMT_MAP_CANVAS_WS_GC_TYPE, \ |
121 #define AMT_MAP_PTR_TO_KEY_CAST( keyPtr ) reinterpret_cast< TInt >( keyPtr ) |
92 KErrNotFound, \ |
122 #define AMT_MAP_CPTR_TO_KEY_CAST( keyCPtr ) AMT_MAP_PTR_TO_KEY_CAST( static_cast< const CBase* >( keyCPtr ) ) |
93 EAlfModuleTestTypeCoreToolkitGoom ); \ |
123 #define AMT_MAP_APPEND_IF(cond, memberMap, key, defaultValue, type) AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.Append(type, key, defaultValue)) |
94 } |
124 #define AMT_MAP_APPEND(memberMap, key, defaultValue, type) AMT_MAP_APPEND_IF(ETrue, memberMap, key, defaultValue, type) |
95 |
125 #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. |
126 #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. |
127 #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() \ |
128 #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 ); \ |
129 #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 ); \ |
130 #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 ) \ |
131 #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 { \ |
132 #define AMT_MAP_SET_VALUE(memberMap, key, value, type) AMT_FUNC_EXC_IF(ETrue, AMT_DATA()->memberMap.SetActualValue(type, key, value)) |
103 ++gceLayerPosition; \ |
133 #define AMT_MAP_INC_VALUE(memberMap, key, type) AMT_MAP_INC_VALUE_IF(ETrue, memberMap, key, type) |
104 AMT_MAP_SET_VALUE( \ |
134 #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 ), \ |
135 #define AMT_MAP_APPEND_ACCEPT_IF(cond, memberMap, testType) AMT_FUNC_EXC_IF((cond), AMT_DATA()->memberMap.AppendAccept(testType)) |
106 gceLayerPosition, EAlfModuleTestTypeGceLayerPosition ); \ |
136 #define AMT_MAP_APPEND_ACCEPT(memberMap, testType) AMT_MAP_APPEND_ACCEPT_IF(ETrue, memberMap, testType) |
107 gceLayer = gceLayer->Above(); \ |
137 #define AMT_MAP_RESET_ITEMS(memberMap, defaultValue, type) AMT_FUNC_EXC(AMT_DATA()->memberMap.ResetItems(type, defaultValue)) |
108 } |
138 #define AMT_MAP_RESET(memberMap) AMT_FUNC_EXC(AMT_DATA()->memberMap.Reset()) |
|
139 |
|
140 #define AMT_PRINT_STATE() AMT_FUNC_EXC(AMT_DATA()->PrintState()) |
|
141 |
109 |
142 #endif // USE_MODULE_TEST_HOOKS_FOR_ALF |
110 #endif // USE_MODULE_TEST_HOOKS_FOR_ALF |
143 |
|
144 |
|
145 // General defines |
|
146 // Text cursor handle is defined as constant because correct handle is not provided |
|
147 // from the window server for render stage. |
|
148 #define AMT_MAP_TEXT_CURSOR_HANDLE 0 |
|
149 |
111 |
150 |
112 |
151 // Notice: |
113 // Notice: |
152 // 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. |
153 // 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()) |
154 |
154 |
155 |
155 |
156 // Render stage defines |
156 // Render stage defines |
157 |
157 |
158 #define AMT_MAP_RENDER_STAGE_NODE_CREATED() \ |
158 #define AMT_MAP_RENDER_STAGE_NODE_CREATED() \ |
179 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 ) |
180 |
180 |
181 #define AMT_MAP_RENDER_STAGE_ADD_LAYER() \ |
181 #define AMT_MAP_RENDER_STAGE_ADD_LAYER() \ |
182 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 ); \ |
183 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 ); \ |
184 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 ) |
185 |
186 |
186 #define AMT_MAP_RENDER_STAGE_ADD_LAYER_LINK() \ |
187 #define AMT_MAP_RENDER_STAGE_ADD_LAYER_LINK() \ |
187 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 ); \ |
188 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 ); \ |
189 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 ); \ |
190 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 ); \ |
191 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 ); \ |
192 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 ); \ |
193 \ |
201 \ |
194 AMT_MAP_SET_VALUE( iSurfaceMap, windowId, aLayer.Surface(), EAlfModuleTestTypeCreateLayer ) |
202 AMT_MAP_SET_VALUE( iSurfaceMap, windowId, aLayer.Surface(), EAlfModuleTestTypeCreateLayer ) |
195 |
203 |
196 #define AMT_MAP_RENDER_STAGE_REMOVE_LAYER() \ |
204 #define AMT_MAP_RENDER_STAGE_REMOVE_LAYER() \ |
197 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 ) |
264 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 ) |
265 |
273 |
266 #define AMT_MAP_BRIDGE_SET_ORDINAL_POSITION() \ |
274 #define AMT_MAP_BRIDGE_SET_ORDINAL_POSITION() \ |
267 AMT_MAP_SET_VALUE_IF( windowAttributes, iIntMap, windowNodeId, windowAttributes->iOrdinalPosition, EAlfModuleTestTypeLayerOrdinalPosition ) |
275 AMT_MAP_SET_VALUE_IF( windowAttributes, iIntMap, windowNodeId, windowAttributes->iOrdinalPosition, EAlfModuleTestTypeLayerOrdinalPosition ) |
268 |
276 |
|
277 #define AMT_MAP_NODE_SET_ORDINAL_POSITION() \ |
|
278 AMT_MAP_SET_VALUE( iIntMap, iId, ordinal, EAlfModuleTestTypeLayerNodeOrdinalPosition ) |
|
279 |
|
280 |
|
281 // GCE defines |
|
282 |
|
283 #define AMT_MAP_GCE_ADD_LAYER() \ |
|
284 AMT_MAP_APPEND_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TSurfaceId::CreateNullId(), EAlfModuleTestTypeGceCreateLayer ); \ |
|
285 AMT_MAP_APPEND_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TSurfaceId::CreateNullId(), EAlfModuleTestTypeGceReleaseLayer ); \ |
|
286 AMT_MAP_APPEND_IF( aLayer, iIntMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), 0, EAlfModuleTestTypeGceLayerPosition ); \ |
|
287 AMT_MAP_APPEND_IF( aLayer, iIntMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), 0, EAlfModuleTestTypeGceLayerOpacity ); \ |
|
288 AMT_MAP_APPEND_IF( aLayer, iRectMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), TRect(), EAlfModuleTestTypeGceLayerExtent ) |
|
289 |
|
290 #define AMT_MAP_GCE_SET_SURFACE() \ |
|
291 AMT_MAP_SET_VALUE( iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( static_cast< MWsLayer* >( this ) ), aSurface, EAlfModuleTestTypeGceCreateLayer ) |
|
292 |
|
293 #define AMT_MAP_GCE_REMOVE_LAYER() \ |
|
294 AMT_MAP_SET_VALUE_IF( aLayer, iSurfaceMap, AMT_MAP_PTR_TO_KEY_CAST( aLayer ), aLayer->Surface(), EAlfModuleTestTypeGceReleaseLayer ) |
|
295 |
|
296 #define AMT_MAP_GCE_SET_LAYER_OPACITY() \ |
|
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 |
|
304 |
|
305 #define AMT_MAP_CANVAS_TEXTURE_CACHE_SET_MEMORY_LEVEL() \ |
|
306 AMT_MAP_SET_VALUE( iIntMap, AMT_MAP_TEXTURE_CACHE_MEMORY_LEVEL, iMemoryLevel, EAlfModuleTestTypeCoreToolkitGoom ); \ |
|
307 AMT_MAP_SET_VALUE( iIntMap, AMT_MAP_CACHED_IMAGES_COUNT, iCachedImages.Count(), EAlfModuleTestTypeCoreToolkitGoom ); \ |
|
308 AMT_MAP_SET_VALUE( iIntMap, AMT_MAP_CACHED_TEXTS_COUNT, iCachedTexts.Count(), EAlfModuleTestTypeCoreToolkitGoom ); \ |
|
309 AMT_MAP_SET_VALUE( iIntMap, AMT_MAP_CACHED_RENDER_BUFFERS_COUNT, iCachedRenderBuffers.Count(), EAlfModuleTestTypeCoreToolkitGoom ) |
|
310 |
269 |
311 |
270 #endif // ALF_MODULE_TEST_DEFINES_H |
312 #endif // ALF_MODULE_TEST_DEFINES_H |
271 |
313 |
272 // End of File |
314 // End of File |