|
1 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CDSB_H__ |
|
17 #define __CDSB_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <bitdev.h> |
|
21 |
|
22 /** |
|
23 Direct Screen Bitmap. |
|
24 API to allow provide synchronisation of the display of images with the |
|
25 displays refresh to prevent tearing. |
|
26 |
|
27 This is an abstract base class, so must be derived from on a per-variant basis. |
|
28 |
|
29 @internalComponent |
|
30 */ |
|
31 class CDirectScreenBitmap : public CBase |
|
32 { |
|
33 public: |
|
34 enum TSettingsFlags |
|
35 { |
|
36 ENone = 0, |
|
37 EDoubleBuffer = 1, |
|
38 EIncrementalUpdate = 2 |
|
39 }; |
|
40 |
|
41 public: |
|
42 /** |
|
43 Constructs a CDirectScreenBitmap derived object. |
|
44 The default screen (with number 0) will be used. |
|
45 @return A pointer to the created CDirectScreenBitmap object |
|
46 @leave KErrNoMemory There was insufficient memory to allocate the CDirectScreenBitmap derived object |
|
47 */ |
|
48 IMPORT_C static CDirectScreenBitmap* NewL(); |
|
49 |
|
50 /** |
|
51 Constructs a CDirectScreenBitmap derived object. |
|
52 @param aScreenNo Screen number, used by the CDirectScreenBitmap object. |
|
53 @return A pointer to the created CDirectScreenBitmap object |
|
54 @leave KErrNoMemory There was insufficient memory to allocate the CDirectScreenBitmap derived object |
|
55 */ |
|
56 IMPORT_C static CDirectScreenBitmap* NewL(TInt aScreenNo); |
|
57 |
|
58 /** |
|
59 Creates a CDirectScreenBitmap object which can be used for drawing to |
|
60 a region of the screen indicated by aScreenRect. This region must have |
|
61 previously been 'claimed' via the Window Servers Direct Screen Access API. |
|
62 |
|
63 @param aScreenRect The region to be displayed |
|
64 @param aSettingsFlags The mode of operation. The upper 3 bits are used |
|
65 for the screen number value: 0..7. By default the screen |
|
66 with number 0 will be used. |
|
67 @return KErrNone if successful |
|
68 KErrNoMemory if there was insufficient memory |
|
69 KErrNotSupported if the creation failed for other reasons |
|
70 */ |
|
71 virtual TInt Create(const TRect& aScreenRect, TSettingsFlags aSettingsFlags) =0; |
|
72 |
|
73 /** |
|
74 Returns a TAcceleratedBitmapInfo referring to a bitmap which the |
|
75 applicationcan render to. |
|
76 |
|
77 @param aBitmapInfo The Bitmap |
|
78 @return KErrNone if successful, another error code otherwise |
|
79 */ |
|
80 virtual TInt BeginUpdate(TAcceleratedBitmapInfo& aBitmapInfo) =0; |
|
81 |
|
82 /** |
|
83 Indicates to the Video Driver that the bitmap corresponding to the |
|
84 update has been fully rendered. The video driver will perform |
|
85 the actions required to copy this to the frame buffer. |
|
86 |
|
87 The request status aComplete will be signalled when the copying has completed. |
|
88 |
|
89 @param aComplete Asynchronous completion status |
|
90 */ |
|
91 virtual void EndUpdate(TRequestStatus& aComplete) =0; |
|
92 |
|
93 /** |
|
94 Indicates to the Video Driver that the area indicated in aScreenRect has |
|
95 been fully rendered. The video driver will perform the actions required |
|
96 to copy this to the frame buffer. |
|
97 |
|
98 The request status aComplete will be signalled when the copying has completed. |
|
99 |
|
100 Note: aScreenRects coordinates are relative to the screen, not the update region specified |
|
101 in Create(). aScreenRect must fit entirely within the bounds of the original region passed |
|
102 to Create(). |
|
103 |
|
104 @param aScreenRect The region to update |
|
105 @param aComplete Asynchronous completion status |
|
106 */ |
|
107 virtual void EndUpdate(const TRect& aScreenRect, TRequestStatus& aComplete) =0; |
|
108 |
|
109 /** |
|
110 Deletes all resources associated with the CDirectScreenBitmap object. |
|
111 */ |
|
112 virtual void Close() =0; |
|
113 }; |
|
114 |
|
115 #endif |