|
1 /* Copyright (c) 2009 The Khronos Group Inc. |
|
2 * |
|
3 * Permission is hereby granted, free of charge, to any person obtaining a |
|
4 * copy of this software and/or associated documentation files (the |
|
5 * "Materials"), to deal in the Materials without restriction, including |
|
6 * without limitation the rights to use, copy, modify, merge, publish, |
|
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 |
|
9 * the following conditions: |
|
10 * |
|
11 * The above copyright notice and this permission notice shall be included |
|
12 * in all copies or substantial portions of the Materials. |
|
13 * |
|
14 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
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, |
|
19 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
|
20 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
|
21 */ |
|
22 |
|
23 #ifndef _owfscreen_h |
|
24 #define _owfscreen_h |
|
25 |
|
26 /* |
|
27 * owfscreen.h |
|
28 * |
|
29 * These functions connect composition/display to physical screen devices |
|
30 */ |
|
31 |
|
32 |
|
33 #include "owftypes.h" |
|
34 #include "owfimage.h" |
|
35 #include "owfextensions.h" |
|
36 |
|
37 |
|
38 #ifdef __cplusplus |
|
39 extern "C" { |
|
40 #endif |
|
41 |
|
42 #define OWF_INVALID_SCREEN_NUMBER (0) |
|
43 |
|
44 /* |
|
45 * On-screen context size and color format |
|
46 * SEE: /graphics/graphicscomposition/graphicscompositionengine/openwfcmigraion/gceopenwfclayerimpl.h |
|
47 * */ |
|
48 #define OWF_SURFACE_WIDTH (768) /* needs to be > 640 + 2 to allow S60 nHD config to work */ |
|
49 #define OWF_SURFACE_HEIGHT (768) /* needs to be > 640 + 2 to allow S60 nHD config to work */ |
|
50 #define OWF_SURFACE_PIXEL_FORMAT (OWF_IMAGE_XRGB8888) |
|
51 #define OWF_SURFACE_LINEAR (OWF_FALSE) |
|
52 #define OWF_SURFACE_ROWPADDING (4) |
|
53 #define OWF_SURFACE_PREMULTIPLIED (OWF_FALSE) |
|
54 |
|
55 typedef struct { |
|
56 OWFint width; |
|
57 OWFint height; |
|
58 OWFint stride; |
|
59 } OWF_ORIENTATION_INFO; |
|
60 |
|
61 typedef struct { |
|
62 OWFuint supportedRotations; |
|
63 OWF_ROTATION initialRotation; |
|
64 OWF_ROTATION currentRotation; |
|
65 OWF_PIXEL_FORMAT pixelFormat; |
|
66 OWF_ORIENTATION_INFO normal; |
|
67 OWF_ORIENTATION_INFO flipped; |
|
68 } OWF_SCREEN; |
|
69 |
|
70 typedef void (*OWF_SCREEN_CALLBACK)(void* obj, OWFint screenNumber, char event); |
|
71 |
|
72 /*! |
|
73 * \brief Get systems's default screen |
|
74 * |
|
75 * \return The screen number of systems default screen |
|
76 */ |
|
77 OWF_API_CALL OWFint |
|
78 OWF_Screen_GetDefaultNumber(); |
|
79 |
|
80 /*! |
|
81 * \brief Get screen's dimensions |
|
82 * |
|
83 * \param screen screen number |
|
84 * \param header returned screen attributes |
|
85 * |
|
86 * \return OWF_TRUE if screen exists |
|
87 * \return OWF_FALSE if screen does not exist |
|
88 */ |
|
89 OWF_API_CALL OWFboolean |
|
90 OWF_Screen_GetHeader(OWFint screen, OWF_SCREEN* header); |
|
91 |
|
92 OWF_API_CALL OWFboolean |
|
93 OWF_Number_Of_Screens(OWFint *pNumberOfScreens); |
|
94 |
|
95 OWF_API_CALL OWFboolean |
|
96 OWF_Screen_Valid(OWFint screen); |
|
97 |
|
98 OWF_API_CALL OWFboolean |
|
99 OWF_Screen_Valid_And_Available(OWFint screen); |
|
100 |
|
101 /*! |
|
102 * \brief Checks if the screen rotation support is enabled |
|
103 * |
|
104 * \param screen screen number |
|
105 * |
|
106 * \return OWF_TRUE if the screen rotation is enabled |
|
107 * \return OWF_FALSE if the screen rotation is enabled |
|
108 */ |
|
109 OWF_API_CALL OWFboolean |
|
110 OWF_Screen_Rotation_Supported(OWFint screen); |
|
111 |
|
112 /*! |
|
113 * \brief Create a new screen |
|
114 * |
|
115 * \param width |
|
116 * \param height |
|
117 * |
|
118 * \return screen number |
|
119 */ |
|
120 OWF_API_CALL OWFint |
|
121 OWF_Screen_Create(OWFint width, OWFint height, OWF_SCREEN_CALLBACK func, void* obj); |
|
122 |
|
123 /*! |
|
124 * \brief Destroy a screen |
|
125 * |
|
126 * \param screen number |
|
127 * |
|
128 * \return OWF_TRUE if screen exists |
|
129 * \return OWF_FALSE if screen does not exist |
|
130 */ |
|
131 OWF_API_CALL void |
|
132 OWF_Screen_Destroy(OWFint screenNumber); |
|
133 |
|
134 /*! |
|
135 * \brief Resize screen |
|
136 * |
|
137 * \param width |
|
138 * \param height |
|
139 * |
|
140 * \return OWF_TRUE if resize OK |
|
141 * \return OWF_FALSE if resize failed. |
|
142 */ |
|
143 OWF_API_CALL OWFboolean |
|
144 OWF_Screen_Resize(OWFint screen, OWFint width, OWFint height); |
|
145 |
|
146 /*! |
|
147 * \brief Blit image to screen |
|
148 * |
|
149 * \param screen screen number |
|
150 * \param rotation the context rotation |
|
151 * |
|
152 * \return OWF_TRUE if screen exists and blitting is OK |
|
153 * \return OWF_FALSE if screen does not exist or blitting is not allowed. |
|
154 */ |
|
155 OWF_API_CALL OWFboolean |
|
156 OWF_Screen_Blit(OWFint screen, void* buffer, OWF_ROTATION rotation); |
|
157 |
|
158 /*! |
|
159 * \brief Notify objects |
|
160 * |
|
161 * Send data to objects associated with screens |
|
162 * |
|
163 * \param data |
|
164 * |
|
165 */ |
|
166 OWF_API_CALL void |
|
167 OWF_Screen_Notify(void* data); |
|
168 |
|
169 #ifdef __cplusplus |
|
170 } |
|
171 #endif |
|
172 |
|
173 |
|
174 #endif |