1 /* 2 ============================================================================ 3 Name : BenchmarkAppView.cpp 4 Author : Konstantin Knizhnik 5 Copyright : GigaBASE is freeware 6 Description : Application view implementation 7 ============================================================================ 8 */ 9 10 // INCLUDE FILES 11 #include <coemain.h> 12 #include "BenchmarkAppView.h" 13 14 // ============================ MEMBER FUNCTIONS =============================== 15 16 // ----------------------------------------------------------------------------- 17 // CBenchmarkAppView::NewL() 18 // Two-phased constructor. 19 // ----------------------------------------------------------------------------- 20 // NewL(const TRect & aRect)21CBenchmarkAppView* CBenchmarkAppView::NewL(const TRect& aRect) 22 { 23 CBenchmarkAppView* self = CBenchmarkAppView::NewLC(aRect); 24 CleanupStack::Pop(self); 25 return self; 26 } 27 28 // ----------------------------------------------------------------------------- 29 // CBenchmarkAppView::NewLC() 30 // Two-phased constructor. 31 // ----------------------------------------------------------------------------- 32 // NewLC(const TRect & aRect)33CBenchmarkAppView* CBenchmarkAppView::NewLC(const TRect& aRect) 34 { 35 CBenchmarkAppView* self = new (ELeave) CBenchmarkAppView; 36 CleanupStack::PushL(self); 37 self->ConstructL(aRect); 38 return self; 39 } 40 41 // ----------------------------------------------------------------------------- 42 // CBenchmarkAppView::ConstructL() 43 // Symbian 2nd phase constructor can leave. 44 // ----------------------------------------------------------------------------- 45 // ConstructL(const TRect & aRect)46void CBenchmarkAppView::ConstructL(const TRect& aRect) 47 { 48 // Create a window for this application view 49 CreateWindowL(); 50 51 // Set the windows size 52 SetRect(aRect); 53 54 // Activate the window, which makes it ready to be drawn 55 ActivateL(); 56 } 57 58 // ----------------------------------------------------------------------------- 59 // CBenchmarkAppView::CBenchmarkAppView() 60 // C++ default constructor can NOT contain any code, that might leave. 61 // ----------------------------------------------------------------------------- 62 // CBenchmarkAppView()63CBenchmarkAppView::CBenchmarkAppView() 64 { 65 // No implementation required 66 } 67 68 // ----------------------------------------------------------------------------- 69 // CBenchmarkAppView::~CBenchmarkAppView() 70 // Destructor. 71 // ----------------------------------------------------------------------------- 72 // ~CBenchmarkAppView()73CBenchmarkAppView::~CBenchmarkAppView() 74 { 75 // No implementation required 76 } 77 78 // ----------------------------------------------------------------------------- 79 // CBenchmarkAppView::Draw() 80 // Draws the display. 81 // ----------------------------------------------------------------------------- 82 // Draw(const TRect &) const83void CBenchmarkAppView::Draw(const TRect& /*aRect*/) const 84 { 85 // Get the standard graphics context 86 CWindowGc& gc = SystemGc(); 87 88 // Gets the control's extent 89 TRect drawRect(Rect()); 90 91 // Clears the screen 92 gc.Clear(drawRect); 93 94 } 95 96 // ----------------------------------------------------------------------------- 97 // CBenchmarkAppView::SizeChanged() 98 // Called by framework when the view size is changed. 99 // ----------------------------------------------------------------------------- 100 // SizeChanged()101void CBenchmarkAppView::SizeChanged() 102 { 103 DrawNow(); 104 } 105 106 // ----------------------------------------------------------------------------- 107 // CBenchmarkAppView::HandlePointerEventL() 108 // Called by framework to handle pointer touch events. 109 // Note: although this method is compatible with earlier SDKs, 110 // it will not be called in SDKs without Touch support. 111 // ----------------------------------------------------------------------------- 112 // HandlePointerEventL(const TPointerEvent & aPointerEvent)113void CBenchmarkAppView::HandlePointerEventL(const TPointerEvent& aPointerEvent) 114 { 115 116 // Call base class HandlePointerEventL() 117 CCoeControl::HandlePointerEventL(aPointerEvent); 118 } 119 120 // End of File 121