os/graphics/graphicscomposition/openwfcompositionengine/adaptation/include/owfscreen.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /* Copyright (c) 2009 The Khronos Group Inc.
     2  * Portions copyright (c) 2009-2010  Nokia Corporation and/or its subsidiary(-ies)
     3  *
     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:
    11  *
    12  * The above copyright notice and this permission notice shall be included
    13  * in all copies or substantial portions of the Materials.
    14  *
    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.
    22  */
    23 
    24 #ifndef _owfscreen_h
    25 #define _owfscreen_h
    26 
    27 /*
    28  * owfscreen.h
    29  *
    30  * These functions connect composition/display to physical screen devices
    31  */
    32 
    33 
    34 #include "owftypes.h"
    35 #include "owfimage.h"
    36 #include "owfextensions.h"
    37 
    38 
    39 #ifdef __cplusplus
    40 extern "C" {
    41 #endif
    42 
    43 #define OWF_INVALID_SCREEN_NUMBER   (0)
    44 
    45 /*  
    46  * On-screen context size and color format
    47  * SEE: /graphics/graphicscomposition/graphicscompositionengine/openwfcmigraion/gceopenwfclayerimpl.h
    48  * */
    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)
    55 
    56 typedef struct {
    57     OWFint width;
    58     OWFint height;
    59     OWFint stride;
    60 } OWF_ORIENTATION_INFO;
    61 
    62 typedef struct {
    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;
    69 } OWF_SCREEN;
    70 
    71 /*!
    72  * \brief Get systems's default screen
    73  *
    74  * \return The screen number of systems default screen
    75  */
    76 OWF_API_CALL OWFint
    77 OWF_Screen_GetDefaultNumber();
    78 
    79 /*!
    80  * \brief Get screen's dimensions
    81  *
    82  * \param dc display context
    83  * \param header returned screen attributes
    84  *
    85  * \return OWF_TRUE if screen exists
    86  * \return OWF_FALSE if screen does not exist
    87  */
    88 OWF_API_CALL OWFboolean
    89 OWF_Screen_GetHeader(OWF_DISPCTX dc, OWF_SCREEN* header);
    90 
    91 /*!
    92  * \brief Validate a screen number
    93  *
    94  * \param screen screen number
    95  *
    96  * \return OWF_TRUE if screen exists
    97  * \return OWF_FALSE if screen does not exist
    98  */
    99 OWF_API_CALL OWFboolean
   100 OWF_Screen_Valid(OWFint screen);
   101 
   102 /*!
   103  * \brief Checks if the screen rotation support is enabled
   104  *
   105  * \param dc display context
   106  *
   107  * \return OWF_TRUE if the screen rotation is enabled
   108  * \return OWF_FALSE if the screen rotation is enabled
   109  */
   110 OWF_API_CALL OWFboolean
   111 OWF_Screen_Rotation_Supported(OWF_DISPCTX dc);
   112 
   113 /*!
   114  * \brief Create a new screen
   115  *
   116  * \param dc display context
   117  * \param screen screen number
   118  *
   119  * \return OWF_TRUE if screen exists
   120  * \return OWF_FALSE if screen does not exist
   121  */
   122 OWF_API_CALL OWFboolean
   123 OWF_Screen_Create(OWFint screen, OWF_DISPCTX dc);
   124 
   125 /*!
   126  * \brief Destroy a screen
   127  *
   128  * \param dc display context
   129  *
   130  * \return OWF_TRUE if screen exists
   131  * \return OWF_FALSE if screen does not exist
   132  */
   133 OWF_API_CALL void
   134 OWF_Screen_Destroy(OWF_DISPCTX dc);
   135 
   136 /*!
   137  * \brief Blit image to screen
   138  *
   139  * \param dc display context
   140  * \param dc stream the stream containing the buffer to be displayed
   141  * rotation the current context rotation
   142  *
   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.
   145  */
   146 OWF_API_CALL OWFboolean
   147 OWF_Screen_Post_Topmost_Layer(OWF_DISPCTX dc, OWFNativeStreamType stream, OWF_ROTATION rotation);
   148 
   149 #ifdef __cplusplus
   150 }
   151 #endif
   152 
   153 
   154 #endif