os/graphics/graphicscomposition/openwfcompositionengine/inc/openwfc_ri_display.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
     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 // Description:
    23 // Display Adaptation Interface
    24 // 
    25 //
    26 
    27 #ifndef OPENWFC_RI_DISPLAY_H
    28 #define OPENWFC_RI_DISPLAY_H
    29 
    30 #include <WF/openwfc_ri_display_update.h>
    31 #include <pixelformats.h>
    32 
    33 class COpenWFC_RI_Display: public CBase, public MOpenWFC_RI_Display_Update
    34     {
    35 public:    
    36     typedef enum
    37         {
    38         EScreenInvalid                = 0x0000,    // Initialisation value, don't use
    39         EScreenRotate0                = 0x0001,    // No rotation
    40         EScreenRotate90               = 0x0002,    // 90 degree
    41         EScreenRotate180              = 0x0004,    // 180 degree
    42         EScreenRotate270              = 0x0008,    // 270 degree
    43         EScreenRotateMirrorVertical   = 0x0010,    // Upside down/flip
    44         EScreenRotateMirrorHorizontal = 0x0020,    // Mirrored
    45         EScreenRotateAll              = 0x000F
    46         } TScreenRotation;
    47 
    48     typedef enum
    49         {
    50         EScreenAttributeInvalid       = 0,
    51         EScreenAttributeImplementationVersion,      // Version implementation   (TUint32)   RO
    52         // Currently the only  pixel format support is EUidPixelFormatXRGB_8888
    53         EScreenAttributePixelFormat,                // Pixel format             (TUint32)   RO
    54         // Curently, the only value supported is "4"
    55         EScreenAttributeBytesPerPixel,              // Bytes per pixel          (TUint32)   RO
    56         EScreenAttributeSupportedRotation,          // Supported rotation bitmap(TUint32)   RO
    57         EScreenAttributeDefaultRotation,            // Default rotation         (TUint32)   RO
    58         EScreenAttributeCurrentRotation,            // Current rotation         (TUint32)   RW
    59         EScreenAttributeNormalWidth,                // Width - rotaton 0        (TUint32)   RO
    60         EScreenAttributeNormalHeight,               // Height - rotaton 0       (TUint32)   RO
    61         EScreenAttributeNormalStride,               // Stride - rotaton 0       (TUint32)   RO
    62         EScreenAttributeFlippedWidth,               // Width - rotaton 90       (TUint32)   RO
    63         EScreenAttributeFlippedHeight,              // Height - rotaton 90      (TUint32)   RO
    64         EScreenAttributeFlippedStride,              // Stride - rotaton 90      (TUint32)   RO
    65         EScreenAttributeScreenGeometry              // geometry struct                      RO
    66         } TScreenAttribute;
    67         
    68     typedef struct {
    69         TInt32 iSupportedRotations;
    70         TInt32 iBytesPerPixel;
    71         TScreenRotation iDefaultRotation;
    72         TScreenRotation iCurrentRotation;
    73         TUidPixelFormat iPixelFormat;
    74         TInt32 iNormalWidth;
    75         TInt32 iNormalHeight;
    76         TInt32 iNormalStride;
    77         TInt32 iFlippedWidth;
    78         TInt32 iFlippedHeight;
    79         TInt32 iFlippedStride;
    80         } TScreenGeometryAttribute;
    81         
    82 public:
    83         /**
    84          * API version
    85          * 
    86          * @return  API version
    87          */
    88     inline TUint32 APIVersion();
    89     
    90     /**
    91      * Symbian function factory
    92      * 
    93      * @param   aStream   Screen Id
    94      * 
    95      * @return  An instance of implemented interface
    96      */
    97     IMPORT_C static COpenWFC_RI_Display* NewL(TUint aScreen);
    98     
    99     /**
   100      * retrieves the default screen number for an implementation
   101      * 
   102      * 
   103      * @return  Default Screen ID
   104      */
   105 	IMPORT_C static TUint32 DefaultScreenNumber();
   106 	
   107 public:
   108     static const TInt32 KTopMostLayer = 0;
   109     static const TUint32 KAPIVersion  = 0x00000001;
   110     
   111 protected:
   112      TInt GetAttributeSize(TUint aAttributeId);
   113     };
   114 
   115 inline TUint32 COpenWFC_RI_Display::APIVersion()
   116     {
   117     return KAPIVersion;
   118     }
   119 
   120 
   121 #endif // OPENWFC_RI_DISPLAY_H