1 /* Copyright (c) 2009 The Khronos Group Inc. |
1 /* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * |
2 * |
3 * Permission is hereby granted, free of charge, to any person obtaining a |
3 * Permission is hereby granted, free of charge, to any person obtaining a |
4 * copy of this software and/or associated documentation files (the |
4 * copy of this software and/or associated documentation files (the |
5 * "Materials"), to deal in the Materials without restriction, including |
5 * "Materials"), to deal in the Materials without restriction, including |
6 * without limitation the rights to use, copy, modify, merge, publish, |
6 * without limitation the rights to use, copy, modify, merge, publish, |
7 * distribute, sublicense, and/or sell copies of the Materials, and to |
7 * distribute, sublicense, and/or sell copies of the Materials, and to |
8 * permit persons to whom the Materials are furnished to do so, subject to |
8 * permit persons to whom the Materials are furnished to do so, subject to |
9 * the following conditions: |
9 * the following conditions: |
10 * |
10 * |
11 * The above copyright notice and this permission notice shall be included |
11 * The above copyright notice and this permission notice shall be included |
12 * in all copies or substantial portions of the Materials. |
12 * in all copies or substantial portions of the Materials. |
13 * |
13 * |
14 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
14 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
18 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
18 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
22 |
22 |
23 #ifndef OWFDISPLAYCONTEXT_H |
23 #ifndef OWFDISPLAYCONTEXT_H |
24 #define OWFDISPLAYCONTEXT_H |
24 #define OWFDISPLAYCONTEXT_H |
25 |
25 |
26 #include <e32base.h> |
26 #include <e32base.h> |
|
27 #include <e32cmn.h> |
27 |
28 |
28 #include <dispchannel.h> |
29 #include <dispchannel.h> |
29 #include "owfmemory.h" |
30 #include "owfmemory.h" |
30 #include "owfscreen.h" |
31 #include "owfscreen.h" |
31 #include "owfdisplaycontextgeneral.h" |
32 #include "owfdisplaycontextgeneral.h" |
|
33 #include <WF\openwfc_ri_display.h> |
32 |
34 |
33 #define _OWF_DISPLAYCONTEXT(x) (static_cast<OWFDisplayContext *>(x)) |
35 #define _OWF_DISPLAYCONTEXT(x) (static_cast<OWFDisplayContext *>(x)) |
34 |
36 |
35 struct TBufferAddress |
37 struct TBufferAddress |
36 { |
38 { |
50 ~COwfScratchBuffers(); |
52 ~COwfScratchBuffers(); |
51 private: |
53 private: |
52 RArray <TBufferAddress> iBuffers; |
54 RArray <TBufferAddress> iBuffers; |
53 }; |
55 }; |
54 |
56 |
55 class COWFScreenDisplayInfo : public CBase |
|
56 { |
|
57 public: |
|
58 ~COWFScreenDisplayInfo(); |
|
59 static COWFScreenDisplayInfo* NewL(TInt aScreen); |
|
60 TInt ScreenNumber() const; |
|
61 void GetScreenInfo(OWF_SCREEN *header) const; |
|
62 OWFboolean Blit(void* buffer, OWF_ROTATION rotation); |
|
63 |
|
64 private: |
|
65 COWFScreenDisplayInfo(TInt aScreen); |
|
66 void ConstructL(); |
|
67 private: |
|
68 OWF_SCREEN iScreenInfo; |
|
69 mutable RDisplayChannel iDispChan; |
|
70 TInt iScreenNumber; |
|
71 RArray <TBufferAddress*> iCompositionBuffer; |
|
72 RDisplayChannel::TDisplayRotation iDefaultRotation; |
|
73 TInt iRotationOffset; |
|
74 }; |
|
75 |
|
76 class COwfcDisplayDevice : public CBase |
|
77 { |
|
78 private: |
|
79 static COwfcDisplayDevice* gDisplayDeviceInstancePtr; |
|
80 public: |
|
81 static COwfcDisplayDevice* SingletonInstance(); |
|
82 TInt OpenScreen(TInt aScreen); |
|
83 TInt CloseScreen(TInt aScreen, OWFboolean *aCanDelete); |
|
84 ~COwfcDisplayDevice(); |
|
85 public: |
|
86 static TBool ScreenCompare(const TInt* k, COWFScreenDisplayInfo* const & t) |
|
87 {return (*k == t->ScreenNumber());} |
|
88 RArray <COWFScreenDisplayInfo*> iScreenDisplayInfo; |
|
89 }; |
|
90 |
|
91 typedef struct OWFDisplayContext_ |
57 typedef struct OWFDisplayContext_ |
92 { |
58 { |
93 public: |
59 public: |
94 COwfcDisplayDevice *iDisplayContext; |
60 COpenWFC_RI_Display *iScreenContext; |
95 COwfScratchBuffers iBuffers; |
61 COwfScratchBuffers iBuffers; |
96 WFCint iEventServerUpdate; |
62 WFCint iEventServerUpdate; |
97 WFCboolean iCompositionOngoing; |
63 WFCboolean iCompositionOngoing; |
98 WFCint iPreviousCommit; |
64 WFCint iPreviousCommit; |
99 WFCint iSerialNumber; |
65 WFCint iSerialNumber; |
|
66 OWF_SEMAPHORE iRendezvous; |
|
67 OWFNativeStreamType fastpathStream; |
|
68 WFCboolean fastpathChecked; |
|
69 WFCboolean iInternalStreamAccessed; |
100 public: |
70 public: |
101 virtual ~OWFDisplayContext_(); |
71 virtual ~OWFDisplayContext_(); |
102 } OWFDisplayContext; |
72 } OWFDisplayContext; |
103 |
73 |
104 #endif //OWFDISPLAYCONTEXT_H |
74 #endif //OWFDISPLAYCONTEXT_H |