os/graphics/graphicscomposition/openwfcompositionengine/adaptation/include/owfscreen.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/* Copyright (c) 2009 The Khronos Group Inc.
sl@0
     2
 * Portions copyright (c) 2009-2010  Nokia Corporation and/or its subsidiary(-ies)
sl@0
     3
 *
sl@0
     4
 * Permission is hereby granted, free of charge, to any person obtaining a
sl@0
     5
 * copy of this software and/or associated documentation files (the
sl@0
     6
 * "Materials"), to deal in the Materials without restriction, including
sl@0
     7
 * without limitation the rights to use, copy, modify, merge, publish,
sl@0
     8
 * distribute, sublicense, and/or sell copies of the Materials, and to
sl@0
     9
 * permit persons to whom the Materials are furnished to do so, subject to
sl@0
    10
 * the following conditions:
sl@0
    11
 *
sl@0
    12
 * The above copyright notice and this permission notice shall be included
sl@0
    13
 * in all copies or substantial portions of the Materials.
sl@0
    14
 *
sl@0
    15
 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
sl@0
    16
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
sl@0
    17
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
sl@0
    18
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
sl@0
    19
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
sl@0
    20
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
sl@0
    21
 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
sl@0
    22
 */
sl@0
    23
sl@0
    24
#ifndef _owfscreen_h
sl@0
    25
#define _owfscreen_h
sl@0
    26
sl@0
    27
/*
sl@0
    28
 * owfscreen.h
sl@0
    29
 *
sl@0
    30
 * These functions connect composition/display to physical screen devices
sl@0
    31
 */
sl@0
    32
sl@0
    33
sl@0
    34
#include "owftypes.h"
sl@0
    35
#include "owfimage.h"
sl@0
    36
#include "owfextensions.h"
sl@0
    37
sl@0
    38
sl@0
    39
#ifdef __cplusplus
sl@0
    40
extern "C" {
sl@0
    41
#endif
sl@0
    42
sl@0
    43
#define OWF_INVALID_SCREEN_NUMBER   (0)
sl@0
    44
sl@0
    45
/*  
sl@0
    46
 * On-screen context size and color format
sl@0
    47
 * SEE: /graphics/graphicscomposition/graphicscompositionengine/openwfcmigraion/gceopenwfclayerimpl.h
sl@0
    48
 * */
sl@0
    49
#define OWF_SURFACE_WIDTH  (768) /* needs to be > 640 + 2 to allow S60 nHD config to work */
sl@0
    50
#define OWF_SURFACE_HEIGHT (768) /* needs to be > 640 + 2 to allow S60 nHD config to work */
sl@0
    51
#define OWF_SURFACE_PIXEL_FORMAT (OWF_IMAGE_XRGB8888)
sl@0
    52
#define OWF_SURFACE_LINEAR (OWF_FALSE)
sl@0
    53
#define OWF_SURFACE_ROWPADDING (4)
sl@0
    54
#define OWF_SURFACE_PREMULTIPLIED (OWF_FALSE)
sl@0
    55
sl@0
    56
typedef struct {
sl@0
    57
    OWFint width;
sl@0
    58
    OWFint height;
sl@0
    59
    OWFint stride;
sl@0
    60
} OWF_ORIENTATION_INFO;
sl@0
    61
sl@0
    62
typedef struct {
sl@0
    63
    OWFuint supportedRotations;
sl@0
    64
    OWF_ROTATION initialRotation;
sl@0
    65
    OWF_ROTATION currentRotation;
sl@0
    66
    OWF_PIXEL_FORMAT pixelFormat;
sl@0
    67
    OWF_ORIENTATION_INFO normal;
sl@0
    68
    OWF_ORIENTATION_INFO flipped;
sl@0
    69
} OWF_SCREEN;
sl@0
    70
sl@0
    71
/*!
sl@0
    72
 * \brief Get systems's default screen
sl@0
    73
 *
sl@0
    74
 * \return The screen number of systems default screen
sl@0
    75
 */
sl@0
    76
OWF_API_CALL OWFint
sl@0
    77
OWF_Screen_GetDefaultNumber();
sl@0
    78
sl@0
    79
/*!
sl@0
    80
 * \brief Get screen's dimensions
sl@0
    81
 *
sl@0
    82
 * \param dc display context
sl@0
    83
 * \param header returned screen attributes
sl@0
    84
 *
sl@0
    85
 * \return OWF_TRUE if screen exists
sl@0
    86
 * \return OWF_FALSE if screen does not exist
sl@0
    87
 */
sl@0
    88
OWF_API_CALL OWFboolean
sl@0
    89
OWF_Screen_GetHeader(OWF_DISPCTX dc, OWF_SCREEN* header);
sl@0
    90
sl@0
    91
/*!
sl@0
    92
 * \brief Validate a screen number
sl@0
    93
 *
sl@0
    94
 * \param screen screen number
sl@0
    95
 *
sl@0
    96
 * \return OWF_TRUE if screen exists
sl@0
    97
 * \return OWF_FALSE if screen does not exist
sl@0
    98
 */
sl@0
    99
OWF_API_CALL OWFboolean
sl@0
   100
OWF_Screen_Valid(OWFint screen);
sl@0
   101
sl@0
   102
/*!
sl@0
   103
 * \brief Checks if the screen rotation support is enabled
sl@0
   104
 *
sl@0
   105
 * \param dc display context
sl@0
   106
 *
sl@0
   107
 * \return OWF_TRUE if the screen rotation is enabled
sl@0
   108
 * \return OWF_FALSE if the screen rotation is enabled
sl@0
   109
 */
sl@0
   110
OWF_API_CALL OWFboolean
sl@0
   111
OWF_Screen_Rotation_Supported(OWF_DISPCTX dc);
sl@0
   112
sl@0
   113
/*!
sl@0
   114
 * \brief Create a new screen
sl@0
   115
 *
sl@0
   116
 * \param dc display context
sl@0
   117
 * \param screen screen number
sl@0
   118
 *
sl@0
   119
 * \return OWF_TRUE if screen exists
sl@0
   120
 * \return OWF_FALSE if screen does not exist
sl@0
   121
 */
sl@0
   122
OWF_API_CALL OWFboolean
sl@0
   123
OWF_Screen_Create(OWFint screen, OWF_DISPCTX dc);
sl@0
   124
sl@0
   125
/*!
sl@0
   126
 * \brief Destroy a screen
sl@0
   127
 *
sl@0
   128
 * \param dc display context
sl@0
   129
 *
sl@0
   130
 * \return OWF_TRUE if screen exists
sl@0
   131
 * \return OWF_FALSE if screen does not exist
sl@0
   132
 */
sl@0
   133
OWF_API_CALL void
sl@0
   134
OWF_Screen_Destroy(OWF_DISPCTX dc);
sl@0
   135
sl@0
   136
/*!
sl@0
   137
 * \brief Blit image to screen
sl@0
   138
 *
sl@0
   139
 * \param dc display context
sl@0
   140
 * \param dc stream the stream containing the buffer to be displayed
sl@0
   141
 * rotation the current context rotation
sl@0
   142
 *
sl@0
   143
 * \return OWF_TRUE if screen exists and blitting is  OK
sl@0
   144
 * \return OWF_FALSE if screen does not exist or blitting is not allowed.
sl@0
   145
 */
sl@0
   146
OWF_API_CALL OWFboolean
sl@0
   147
OWF_Screen_Post_Topmost_Layer(OWF_DISPCTX dc, OWFNativeStreamType stream, OWF_ROTATION rotation);
sl@0
   148
sl@0
   149
#ifdef __cplusplus
sl@0
   150
}
sl@0
   151
#endif
sl@0
   152
sl@0
   153
sl@0
   154
#endif