19 // Include Files |
19 // Include Files |
20 #include <jdebug.h> |
20 #include <jdebug.h> |
21 |
21 |
22 #include "cmmadisplay.h" |
22 #include "cmmadisplay.h" |
23 #include "mmmadisplaywindow.h" |
23 #include "mmmadisplaywindow.h" |
|
24 // below include is added to get the enumerated player's state |
|
25 #include "cmmaplayer.h" |
24 |
26 |
25 // Destructor (virtual by CBase) |
27 // Destructor (virtual by CBase) |
26 CMMADisplay::~CMMADisplay() |
28 CMMADisplay::~CMMADisplay() |
27 { |
29 { |
28 |
30 |
29 if (iDirectContainer) |
31 if (iDirectContainer) |
30 { |
32 { |
31 // Remove clip rect if set |
33 // Remove clip rect if set |
32 if (!iClipRect.IsEmpty()) |
34 if (!iClipRect.IsEmpty()) |
33 { |
35 { |
34 DEBUG("CMMADisplay::~CMMADisplay(): Removing clip rect"); |
36 DEBUG_INT2("CMMADisplay::~CMMADisplay(): Removing clip rect iTL = %d X %d", |
|
37 iClipRect.iTl.iX,iClipRect.iTl.iY); |
|
38 DEBUG_INT2("CMMADisplay::~CMMADisplay(): Removing clip rect iBr = %d X %d", |
|
39 iClipRect.iBr.iX,iClipRect.iBr.iY); |
35 iDirectContainer->MdcRemoveContentBounds(iClipRect); |
40 iDirectContainer->MdcRemoveContentBounds(iClipRect); |
36 } |
41 } |
37 |
42 |
38 // Remove this object from MDirectContainer |
43 // Remove this object from MDirectContainer |
39 iDirectContainer->MdcRemoveContent(this); |
44 iDirectContainer->MdcRemoveContent(this); |
|
45 DEBUG("~CMMADisplay() is done"); |
40 } |
46 } |
41 } |
47 } |
42 |
48 |
43 |
49 |
44 CMMADisplay::CMMADisplay(): |
50 CMMADisplay::CMMADisplay(): |
45 iVisible(EFalse), |
51 iVisible(EFalse), |
46 iFullScreen(EFalse), |
52 iFullScreen(EFalse), |
47 iContainerVisible(EFalse), |
53 iContainerVisible(EFalse), |
|
54 iUserRectSet(EFalse), |
48 iIsForeground(ETrue), |
55 iIsForeground(ETrue), |
49 iResetDrawRect(EFalse) |
56 iResetDrawRect(EFalse) |
50 { |
57 { |
51 } |
58 } |
52 |
59 |
136 (iWindow->GetDisplayWindowType() == MMMADisplayWindow::EDisplayWindowTypeIsBitmap) || |
143 (iWindow->GetDisplayWindowType() == MMMADisplayWindow::EDisplayWindowTypeIsBitmap) || |
137 iClipRect == iWindow->DrawRect() && iContainerVisible && iVisible) |
144 iClipRect == iWindow->DrawRect() && iContainerVisible && iVisible) |
138 { |
145 { |
139 return; |
146 return; |
140 } |
147 } |
141 |
148 |
|
149 #ifdef RD_JAVA_NGA_ENABLED |
|
150 |
|
151 if(iWindow->IsVideoPlayer() && iWindow->PlayerState() < CMMAPlayer::EPrefetched) |
|
152 { |
|
153 // dont snatch window from UI too early. wait till its PREFETCHED or STARTED |
|
154 // because UI could be showing some progressive indicator for playback start and that should continue |
|
155 // at the last possible moment |
|
156 |
|
157 return; |
|
158 } |
|
159 #endif |
142 TBool refreshScreen(EFalse); |
160 TBool refreshScreen(EFalse); |
143 // Remove first the current clip rect if set |
161 // Remove first the current clip rect if set |
144 if (!iClipRect.IsEmpty()) |
162 if (!iClipRect.IsEmpty()) |
145 { |
163 { |
146 DEBUG("CMMADisplay::SetClippingRegion: Removing old rect"); |
164 DEBUG("CMMADisplay::SetClippingRegion: Removing old rect"); |
153 { |
171 { |
154 iClipRect = iWindow->DrawRect(); |
172 iClipRect = iWindow->DrawRect(); |
155 |
173 |
156 if (!iClipRect.IsEmpty()) |
174 if (!iClipRect.IsEmpty()) |
157 { |
175 { |
158 DEBUG("CMMADisplay::SetClippingRegion: Adding new rect"); |
176 DEBUG_INT2("CMMADisplay::SetClippingRegion: Adding new rect iTL = %d X %d", |
|
177 iClipRect.iTl.iX,iClipRect.iTl.iY); |
|
178 DEBUG_INT2("CMMADisplay::SetClippingRegion: Adding new rect iBr = %d X %d", |
|
179 iClipRect.iBr.iX,iClipRect.iBr.iY); |
159 // Add new clipping rect |
180 // Add new clipping rect |
160 iDirectContainer->MdcAddContentBounds(iClipRect); |
181 iDirectContainer->MdcAddContentBounds(iClipRect); |
161 refreshScreen = ETrue; |
182 refreshScreen = ETrue; |
162 } |
183 } |
163 } |
184 } |
200 MMMADisplayWindow::EDisplayWindowTypeIsBitmap) || |
221 MMMADisplayWindow::EDisplayWindowTypeIsBitmap) || |
201 iClipRect == iWindow->DrawRect()) |
222 iClipRect == iWindow->DrawRect()) |
202 { |
223 { |
203 return; |
224 return; |
204 } |
225 } |
|
226 |
|
227 #ifdef RD_JAVA_NGA_ENABLED |
|
228 |
|
229 if(iWindow->IsVideoPlayer() && iWindow->PlayerState() < CMMAPlayer::EPrefetched) |
|
230 { |
|
231 // dont snatch window from UI too early. wait till its PREFETCHED or STARTED |
|
232 // because UI could be showing some progressive indicator for playback start and that should continue |
|
233 // at the last possible moment |
|
234 return; |
|
235 } |
|
236 #endif |
205 // If visible then set a new clip rect |
237 // If visible then set a new clip rect |
206 if (iVisible) |
238 if (iVisible) |
207 { |
239 { |
208 iClipRect = iWindow->DrawRect(); |
240 iClipRect = iWindow->DrawRect(); |
209 |
241 |
210 if (!iClipRect.IsEmpty()) |
242 if (!iClipRect.IsEmpty()) |
211 { |
243 { |
212 DEBUG("CMMADisplay::AddClippingRegion: Adding new rect"); |
244 DEBUG_INT2("CMMADisplay::AddClippingRegion: Adding new rect iTL = %d X %d", |
|
245 iClipRect.iTl.iX,iClipRect.iTl.iY); |
|
246 DEBUG_INT2("CMMADisplay::AddClippingRegion: Adding new rect iBr = %d X %d", |
|
247 iClipRect.iBr.iX,iClipRect.iBr.iY); |
213 // Add new clipping rect |
248 // Add new clipping rect |
214 iDirectContainer->MdcAddContentBounds(iClipRect); |
249 iDirectContainer->MdcAddContentBounds(iClipRect); |
215 // refresh screen |
250 // refresh screen |
216 iDirectContainer->MdcFlushContainer( |
251 iDirectContainer->MdcFlushContainer( |
217 iWindow->WindowRect()); |
252 iWindow->WindowRect()); |
235 // from MMMADisplay |
270 // from MMMADisplay |
236 void CMMADisplay::SetDisplaySizeL(const TSize& aSize) |
271 void CMMADisplay::SetDisplaySizeL(const TSize& aSize) |
237 { |
272 { |
238 // user rect contains size set from java. |
273 // user rect contains size set from java. |
239 iUserRect.SetSize(aSize); |
274 iUserRect.SetSize(aSize); |
240 |
275 UserRectSet(); |
241 // Size change has no effect if fullscreen mode is on. |
276 // Size change has no effect if fullscreen mode is on. |
242 // New size could be used when fullscreen is turned off. |
277 // New size could be used when fullscreen is turned off. |
243 if (iContainerVisible && !iFullScreen && iWindow) |
278 if (iContainerVisible && !iFullScreen && iWindow) |
244 { |
279 { |
245 RemoveClippingRegion(); |
280 RemoveClippingRegion(); |