os/graphics/graphicscomposition/openwfcompositionengine/adaptation/include/owfscreen.h
First public contribution.
1 /* Copyright (c) 2009 The Khronos Group Inc.
2 * Portions copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies)
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and/or associated documentation files (the
6 * "Materials"), to deal in the Materials without restriction, including
7 * without limitation the rights to use, copy, modify, merge, publish,
8 * distribute, sublicense, and/or sell copies of the Materials, and to
9 * permit persons to whom the Materials are furnished to do so, subject to
10 * the following conditions:
12 * The above copyright notice and this permission notice shall be included
13 * in all copies or substantial portions of the Materials.
15 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
30 * These functions connect composition/display to physical screen devices
36 #include "owfextensions.h"
43 #define OWF_INVALID_SCREEN_NUMBER (0)
46 * On-screen context size and color format
47 * SEE: /graphics/graphicscomposition/graphicscompositionengine/openwfcmigraion/gceopenwfclayerimpl.h
49 #define OWF_SURFACE_WIDTH (768) /* needs to be > 640 + 2 to allow S60 nHD config to work */
50 #define OWF_SURFACE_HEIGHT (768) /* needs to be > 640 + 2 to allow S60 nHD config to work */
51 #define OWF_SURFACE_PIXEL_FORMAT (OWF_IMAGE_XRGB8888)
52 #define OWF_SURFACE_LINEAR (OWF_FALSE)
53 #define OWF_SURFACE_ROWPADDING (4)
54 #define OWF_SURFACE_PREMULTIPLIED (OWF_FALSE)
60 } OWF_ORIENTATION_INFO;
63 OWFuint supportedRotations;
64 OWF_ROTATION initialRotation;
65 OWF_ROTATION currentRotation;
66 OWF_PIXEL_FORMAT pixelFormat;
67 OWF_ORIENTATION_INFO normal;
68 OWF_ORIENTATION_INFO flipped;
72 * \brief Get systems's default screen
74 * \return The screen number of systems default screen
77 OWF_Screen_GetDefaultNumber();
80 * \brief Get screen's dimensions
82 * \param dc display context
83 * \param header returned screen attributes
85 * \return OWF_TRUE if screen exists
86 * \return OWF_FALSE if screen does not exist
88 OWF_API_CALL OWFboolean
89 OWF_Screen_GetHeader(OWF_DISPCTX dc, OWF_SCREEN* header);
92 * \brief Validate a screen number
94 * \param screen screen number
96 * \return OWF_TRUE if screen exists
97 * \return OWF_FALSE if screen does not exist
99 OWF_API_CALL OWFboolean
100 OWF_Screen_Valid(OWFint screen);
103 * \brief Checks if the screen rotation support is enabled
105 * \param dc display context
107 * \return OWF_TRUE if the screen rotation is enabled
108 * \return OWF_FALSE if the screen rotation is enabled
110 OWF_API_CALL OWFboolean
111 OWF_Screen_Rotation_Supported(OWF_DISPCTX dc);
114 * \brief Create a new screen
116 * \param dc display context
117 * \param screen screen number
119 * \return OWF_TRUE if screen exists
120 * \return OWF_FALSE if screen does not exist
122 OWF_API_CALL OWFboolean
123 OWF_Screen_Create(OWFint screen, OWF_DISPCTX dc);
126 * \brief Destroy a screen
128 * \param dc display context
130 * \return OWF_TRUE if screen exists
131 * \return OWF_FALSE if screen does not exist
134 OWF_Screen_Destroy(OWF_DISPCTX dc);
137 * \brief Blit image to screen
139 * \param dc display context
140 * \param dc stream the stream containing the buffer to be displayed
141 * rotation the current context rotation
143 * \return OWF_TRUE if screen exists and blitting is OK
144 * \return OWF_FALSE if screen does not exist or blitting is not allowed.
146 OWF_API_CALL OWFboolean
147 OWF_Screen_Post_Topmost_Layer(OWF_DISPCTX dc, OWFNativeStreamType stream, OWF_ROTATION rotation);