27 // Static constructor, leaves pointer to cleanup-stack |
27 // Static constructor, leaves pointer to cleanup-stack |
28 CMMAItemDisplay* CMMAItemDisplay::NewLC(MMAFunctionServer* aEventSource , jobject aItemDispObj) |
28 CMMAItemDisplay* CMMAItemDisplay::NewLC(MMAFunctionServer* aEventSource , jobject aItemDispObj) |
29 { |
29 { |
30 CMMAItemDisplay* self = new(ELeave) CMMAItemDisplay(); |
30 CMMAItemDisplay* self = new(ELeave) CMMAItemDisplay(); |
31 CleanupStack::PushL(self); |
31 CleanupStack::PushL(self); |
32 self->Construct(aEventSource, aItemDispObj); |
32 self->Construct(aEventSource, NULL, aItemDispObj); |
33 return self; |
33 return self; |
34 } |
34 } |
35 |
35 |
36 |
36 |
37 // Destructor (virtual by CBase) |
37 // Destructor (virtual by CBase) |
109 { |
109 { |
110 // Java Item's location is always 0, 0 |
110 // Java Item's location is always 0, 0 |
111 return TPoint(0, 0); |
111 return TPoint(0, 0); |
112 } |
112 } |
113 |
113 |
114 /* |
114 |
115 void CMMAItemDisplay::SourceSizeChanged(const TSize& aSourceSize) |
|
116 { |
|
117 LOG1(EJavaMMAPI,EInfo,"MMA::CMMAItemDisplay::SourceSizeChanged %d", |
|
118 aSourceSize.iWidth); |
|
119 LOG1(EJavaMMAPI,EInfo,"MMA::CMMAItemDisplay::SourceSizeChanged %d", |
|
120 aSourceSize.iHeight); |
|
121 |
|
122 #ifdef RD_JAVA_NGA_ENABLED |
|
123 if ( iWindow ) |
|
124 { |
|
125 iWindow->SetVideoCropRegion( TRect( iUserRect.iTl, aSourceSize ) ); |
|
126 } |
|
127 #endif |
|
128 |
|
129 iSourceSize = aSourceSize; |
|
130 |
|
131 if (iWindow) |
|
132 { |
|
133 TRect clientRect(iUserRect.iTl, aSourceSize); |
|
134 |
|
135 iWindow->SetDrawRect(clientRect); |
|
136 // Setting initial window size if not already set, actual size will |
|
137 // be set in MdcItemContentRectChanged() |
|
138 if (iWindow->WindowSize() == TSize()) |
|
139 { |
|
140 iWindow->SetWindowRect(clientRect, MMMADisplay::EMmaThread); |
|
141 } |
|
142 } |
|
143 |
|
144 SetClippingRegion(); |
|
145 |
|
146 if (iUserRect.IsEmpty()) |
|
147 { |
|
148 // Java side hasn't set size. |
|
149 iUserRect.SetSize(iSourceSize); |
|
150 } |
|
151 } |
|
152 */ |
|
153 |
115 |
154 |
116 |
155 void CMMAItemDisplay:: SourceSizeChanged(TInt aJavaControlWidth, TInt aJavaControlHeight,TInt x, TInt y,TRect aBoundsRect) |
117 void CMMAItemDisplay:: SourceSizeChanged(TInt aJavaControlWidth, TInt aJavaControlHeight,TInt x, TInt y,TRect aBoundsRect) |
156 { |
118 { |
157 JELOG2(EJavaMMAPI); |
119 JELOG2(EJavaMMAPI); |
280 |
242 |
281 |
243 |
282 |
244 |
283 SetClippingRegion(); |
245 SetClippingRegion(); |
284 |
246 |
|
247 /* |
285 if (iUserRect.IsEmpty()) |
248 if (iUserRect.IsEmpty()) |
286 { |
249 { |
287 // Java side hasn't set size. |
250 // Java side hasn't set size. |
288 iUserRect = iWindow->DrawRect(); |
251 iUserRect = iWindow->DrawRect(); |
289 |
252 |
290 //if (!sourceIsBigger) |
253 //if (!sourceIsBigger) |
291 //{ |
254 //{ |
292 // Addjusting rect to top left corner. |
255 // Addjusting rect to top left corner. |
293 iUserRect = TRect(iUserRect.Size()); |
256 iUserRect = TRect(iUserRect.Size()); |
294 //} |
257 //} |
|
258 }*/ |
|
259 if (iUserRect.IsEmpty()) |
|
260 { |
|
261 // Java side hasn't set size. |
|
262 LOG1(EJavaMMAPI,EInfo,"CMMAItemDisplay::SourceSizeChanged()iUserRect is set to source size iSourceSize - %d",iSourceSize.iHeight); |
|
263 iUserRect.SetSize(iSourceSize); |
|
264 LOG1(EJavaMMAPI,EInfo,"CMMAItemDisplay::SourceSizeChanged()iUserRect is set to source size iUserRect - %d",iUserRect.Size().iHeight); |
295 } |
265 } |
296 LOG(EJavaMMAPI,EInfo,"CMMAItemDisplay::SourceSizeChanged(aJavaControlWidth,aJavaControlHeight)-"); |
266 LOG(EJavaMMAPI,EInfo,"CMMAItemDisplay::SourceSizeChanged(aJavaControlWidth,aJavaControlHeight)-"); |
297 } |
267 } |
298 |
268 |
299 void CMMAItemDisplay::StaticSourceSize(CMMAItemDisplay* aDisplay, |
269 void CMMAItemDisplay::StaticSourceSize(CMMAItemDisplay* aDisplay, |