graphicscomposition/openwfcompositionengine/adaptation/include/owfdisplaycontext.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 13 Oct 2010 16:00:58 +0300
branchRCL_3
changeset 209 5c40347c6f16
parent 164 25ffed67c7ef
permissions -rw-r--r--
Revision: 201029 Kit: 201041
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
164
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
     1
/* Copyright (c) 2009 The Khronos Group Inc.
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
     2
 *
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
 * Permission is hereby granted, free of charge, to any person obtaining a
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
 * copy of this software and/or associated documentation files (the
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     5
 * "Materials"), to deal in the Materials without restriction, including
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     6
 * without limitation the rights to use, copy, modify, merge, publish,
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     7
 * distribute, sublicense, and/or sell copies of the Materials, and to
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     8
 * permit persons to whom the Materials are furnished to do so, subject to
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     9
 * the following conditions:
164
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    10
 *
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    11
 * The above copyright notice and this permission notice shall be included
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    12
 * in all copies or substantial portions of the Materials.
164
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    13
 *
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    14
 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    15
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    16
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
 */
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#ifndef OWFDISPLAYCONTEXT_H
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    24
#define OWFDISPLAYCONTEXT_H
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#include <e32base.h>
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    27
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
#include <dispchannel.h>
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    29
#include "owfmemory.h"
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    30
#include "owfscreen.h"
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
#include "owfdisplaycontextgeneral.h"
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    32
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
#define _OWF_DISPLAYCONTEXT(x)          (static_cast<OWFDisplayContext *>(x))
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    35
struct TBufferAddress
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    36
    {
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
    RChunk  iChunk;
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    38
    TInt    iOffset;
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
    TUint8* iAddress;
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
    };
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
/**
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
Container that allocates and destroys the chunks used by the scratch buffers.
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
*/
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
class COwfScratchBuffers : public CBase
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
    {
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
public:
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
    void* Allocate(TInt aMinSize);
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
    void Destroy(void* aAddress);
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
    ~COwfScratchBuffers();
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
private:
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    52
    RArray <TBufferAddress> iBuffers;
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    53
    };
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    54
164
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    55
class COWFScreenDisplayInfo : public CBase
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    56
    {
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    57
public:
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    58
    ~COWFScreenDisplayInfo();
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    59
    static COWFScreenDisplayInfo* NewL(TInt aScreen);
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    60
    TInt ScreenNumber() const;
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    61
    void GetScreenInfo(OWF_SCREEN *header) const;
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    62
    OWFboolean Blit(void* buffer, OWF_ROTATION rotation);
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    63
    
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    64
private:
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    65
    COWFScreenDisplayInfo(TInt aScreen);
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    66
    void ConstructL();
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    67
private:
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    68
    OWF_SCREEN iScreenInfo;
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    69
    mutable RDisplayChannel iDispChan;
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    70
    TInt iScreenNumber;
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    71
    RArray <TBufferAddress*> iCompositionBuffer;
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    72
    RDisplayChannel::TDisplayRotation iDefaultRotation;
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    73
    TInt iRotationOffset;
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    74
    };
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    75
    
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    76
class COwfcDisplayDevice : public CBase
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    77
    {
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    78
private:
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    79
    static COwfcDisplayDevice* gDisplayDeviceInstancePtr;
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    80
public:
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    81
    static COwfcDisplayDevice* SingletonInstance();
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    82
    TInt OpenScreen(TInt aScreen);
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    83
    TInt CloseScreen(TInt aScreen, OWFboolean *aCanDelete);
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    84
    ~COwfcDisplayDevice();
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    85
public:
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    86
    static TBool ScreenCompare(const TInt* k, COWFScreenDisplayInfo* const & t)
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    87
    {return (*k == t->ScreenNumber());}
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    88
    RArray <COWFScreenDisplayInfo*> iScreenDisplayInfo;
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    89
    };
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    90
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    91
typedef struct OWFDisplayContext_
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    92
    {
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    93
public:
164
25ffed67c7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents: 163
diff changeset
    94
    COwfcDisplayDevice *iDisplayContext;
0
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    95
    COwfScratchBuffers iBuffers;
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    96
    WFCint iEventServerUpdate;
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    97
    WFCboolean iCompositionOngoing;
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    98
    WFCint iPreviousCommit;
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    99
    WFCint iSerialNumber;
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   100
public:
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   101
    virtual ~OWFDisplayContext_();
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   102
    } OWFDisplayContext;
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   103
5d03bc08d59c Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
   104
#endif //OWFDISPLAYCONTEXT_H