263 // |
265 // |
264 void HistoryView::updateDisplay() |
266 void HistoryView::updateDisplay() |
265 { |
267 { |
266 m_bitmapContext->Clear(); |
268 m_bitmapContext->Clear(); |
267 m_bitmapContext->Reset(); |
269 m_bitmapContext->Reset(); |
|
270 |
|
271 m_bitmapContext->SetPenColor(TRgb(45,44,50)); |
|
272 m_bitmapContext->SetPenStyle(CGraphicsContext::ESolidPen); |
|
273 m_bitmapContext->SetBrushColor(KRgbDarkGray); |
|
274 m_bitmapContext->SetBrushStyle(CGraphicsContext::ESolidBrush); |
|
275 m_bitmapContext->DrawRect(Rect()); |
|
276 m_bitmapContext->SetBrushStyle(CGraphicsContext::ENullBrush); |
|
277 m_bitmapContext->SetPenStyle(CGraphicsContext::ENullPen); |
|
278 |
268 |
279 |
269 // updateDisplay something to the bitmap |
280 // updateDisplay something to the bitmap |
270 m_centerEntry = m_historyController->entryByIndex( m_centerPageIndex ); |
281 m_centerEntry = m_historyController->entryByIndex( m_centerPageIndex ); |
271 HistoryEntry* leftEntry = m_historyController->entryByIndex( m_centerPageIndex-1 ); |
282 HistoryEntry* leftEntry = m_historyController->entryByIndex( m_centerPageIndex-1 ); |
272 HistoryEntry* rightEntry = m_historyController->entryByIndex( m_centerPageIndex+1 ); |
283 HistoryEntry* rightEntry = m_historyController->entryByIndex( m_centerPageIndex+1 ); |
273 if (leftEntry) { |
284 if (leftEntry) { |
274 if (!leftEntry->thumbnail()) { |
285 if (!leftEntry->thumbnail()) { |
275 TRAP_IGNORE(leftEntry->constructThumbnailL()); |
286 TRAP_IGNORE(leftEntry->constructThumbnailL()); |
276 } |
287 } |
277 if (leftEntry->thumbnail()) { |
288 if (leftEntry->thumbnail()) { |
278 m_bitmapContext->BitBlt( m_leftPlaceHolderRect.iTl, leftEntry->thumbnail(), TRect(TPoint(0,0), m_leftPlaceHolderRect.Size()) ); |
289 if(!m_maskBitmap) { |
279 } |
290 TSize maskBitmapSize(m_leftPlaceHolderRect.Size()); |
280 m_bitmapContext->SetPenColor( KSideImageBorderColor ); |
291 TRAP_IGNORE(CreateMaskBitmapForLeftRightThumbnailL(maskBitmapSize, EGray256, KSideImageMaskColor)); |
281 m_bitmapContext->DrawRect(m_leftPlaceHolderRect); |
292 } |
|
293 if(m_maskBitmap) { |
|
294 m_bitmapContext->BitBltMasked(m_leftPlaceHolderRect.iTl, leftEntry->thumbnail(), TRect(TPoint(0,0), m_leftPlaceHolderRect.Size()), m_maskBitmap, EFalse); |
|
295 } |
|
296 else { |
|
297 //if failed to create a mask, just draw the left entry thumbnail. |
|
298 m_bitmapContext->BitBlt( m_leftPlaceHolderRect.iTl, leftEntry->thumbnail(), TRect(TPoint(0,0), m_leftPlaceHolderRect.Size()) ); |
|
299 } |
|
300 } |
282 } |
301 } |
283 // updateDisplay the next thumbnail |
302 // updateDisplay the next thumbnail |
284 if (rightEntry) { |
303 if (rightEntry) { |
285 if (!rightEntry->thumbnail()) { |
304 if (!rightEntry->thumbnail()) { |
286 TRAP_IGNORE(rightEntry->constructThumbnailL()); |
305 TRAP_IGNORE(rightEntry->constructThumbnailL()); |
287 } |
306 } |
288 if (rightEntry->thumbnail()) { |
307 if (rightEntry->thumbnail()) { |
289 m_bitmapContext->BitBlt( m_rightPlaceHolderRect.iTl, rightEntry->thumbnail(), TRect(TPoint(0,0), m_rightPlaceHolderRect.Size()) ); |
308 if(!m_maskBitmap) { |
290 } |
309 TSize maskBitmapSize(m_rightPlaceHolderRect.Size()); |
291 m_bitmapContext->SetPenColor( KSideImageBorderColor ); |
310 TRAP_IGNORE(CreateMaskBitmapForLeftRightThumbnailL(maskBitmapSize, EGray256, KSideImageMaskColor)); |
292 m_bitmapContext->DrawRect(m_rightPlaceHolderRect); |
311 } |
|
312 if(m_maskBitmap) { |
|
313 m_bitmapContext->BitBltMasked(m_rightPlaceHolderRect.iTl, rightEntry->thumbnail(), TRect(TPoint(0,0), m_rightPlaceHolderRect.Size()), m_maskBitmap, EFalse); |
|
314 } |
|
315 else { |
|
316 //if failed to create a mask, just draw the right entry thumbnail. |
|
317 m_bitmapContext->BitBlt( m_rightPlaceHolderRect.iTl, rightEntry->thumbnail(), TRect(TPoint(0,0), m_rightPlaceHolderRect.Size()) ); |
|
318 } |
|
319 } |
293 } |
320 } |
294 // updateDisplay the center thumbnail |
321 // updateDisplay the center thumbnail |
295 if (m_centerEntry ) { |
322 if (m_centerEntry ) { |
296 if (!m_centerEntry->thumbnail()) { |
323 if (!m_centerEntry->thumbnail()) { |
297 TRAP_IGNORE(m_centerEntry->constructThumbnailL()); |
324 TRAP_IGNORE(m_centerEntry->constructThumbnailL()); |
298 } |
325 } |
299 if (m_centerEntry->thumbnail()) { |
326 if (m_centerEntry->thumbnail()) { |
|
327 m_bitmapContext->SetBrushColor(KRgbWhite); |
|
328 m_bitmapContext->SetBrushStyle(CGraphicsContext::ESolidBrush); |
|
329 m_bitmapContext->DrawRect(m_centerPlaceHolderRect); |
|
330 m_bitmapContext->SetBrushStyle(CGraphicsContext::ENullBrush); |
|
331 TSize bitSize = m_centerEntry->thumbnail()->SizeInPixels(); |
300 m_bitmapContext->BitBlt( m_centerPlaceHolderRect.iTl, m_centerEntry->thumbnail(), TRect(TPoint(0,0), m_centerPlaceHolderRect.Size()) ); |
332 m_bitmapContext->BitBlt( m_centerPlaceHolderRect.iTl, m_centerEntry->thumbnail(), TRect(TPoint(0,0), m_centerPlaceHolderRect.Size()) ); |
301 } |
333 } |
302 } |
334 } |
|
335 |
|
336 //Draw border for center thumbnail |
|
337 m_bitmapContext->SetPenStyle( CGraphicsContext:: ESolidPen ); |
303 m_bitmapContext->SetPenColor( KCenterImageBorderColor ); |
338 m_bitmapContext->SetPenColor( KCenterImageBorderColor ); |
304 |
|
305 m_bitmapContext->DrawRect( m_centerPlaceHolderRect ); |
339 m_bitmapContext->DrawRect( m_centerPlaceHolderRect ); |
306 |
340 |
307 // Reset Brush |
341 // Reset Brush |
308 m_bitmapContext->SetBrushColor(TRgb(255,255,255)); |
342 m_bitmapContext->SetBrushColor(TRgb(255,255,255)); |
309 m_bitmapContext->SetBrushStyle(CGraphicsContext::ENullBrush); |
343 m_bitmapContext->SetBrushStyle(CGraphicsContext::ENullBrush); |
|
344 m_bitmapContext->SetPenStyle(CGraphicsContext::ENullPen); |
310 // updateState(-1); |
345 // updateState(-1); |
311 } |
346 } |
312 |
347 |
313 // ---------------------------------------------------------------------------- |
348 // ---------------------------------------------------------------------------- |
314 // HistoryView::getCenterEntryTitle |
349 // HistoryView::getCenterEntryTitle |