1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/inc/Graphics/displaymapping.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,138 @@
1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @publishedPartner
1.22 + @prototype
1.23 +*/
1.24 +
1.25 +#ifndef DISPMAP_CLIENT_H_
1.26 +#define DISPMAP_CLIENT_H_
1.27 +#include <w32std.h>
1.28 +
1.29 +/** Defines the coordinate space UID values for use with
1.30 + MDisplayMappingBase::MapCoordinates().
1.31 +*/
1.32 +enum TCoordinateSpace
1.33 + {
1.34 + /**
1.35 + Application coordinate space, possibly offset but not scaled
1.36 + relative to full-screen space.
1.37 + */
1.38 + EApplicationSpace = 0x1028656F,
1.39 + /**
1.40 + User interface coordinate space, possibly scaled but not offset
1.41 + relative to composition space.
1.42 + */
1.43 + EFullScreenSpace = 0x10286570,
1.44 + /**
1.45 + Composition coordinate space, used by composition back-end in
1.46 + compositing the display contents.
1.47 + */
1.48 + ECompositionSpace = 0x10286571,
1.49 + /**
1.50 + Coordinate space for the DSA buffer. May be offset but not scaled
1.51 + relative to both application and full-screen spaces. Identical to
1.52 + full-screen space if the DSA buffer is used for UI rendering.
1.53 + */
1.54 + EDirectScreenAccessSpace = 0x1028656E
1.55 + };
1.56 +
1.57 +/** Provides facilities to map coordinates between various coordinate
1.58 + spaces.
1.59 +
1.60 +*/
1.61 +class MDisplayMappingBase
1.62 + {
1.63 +public:
1.64 + enum
1.65 + {
1.66 + KUidDisplayMappingBase = 0x1028656D,
1.67 + ETypeId= KUidDisplayMappingBase
1.68 + };
1.69 +public:
1.70 + /** Maps the source rectangle from a source coordinate space to a
1.71 + target coordinate space. Since there may be scaling involved, the
1.72 + target rectangle may be larger or smaller than the source one, or
1.73 + even become empty.
1.74 +
1.75 + Two rectangles that abut each other before mapping, when mapped
1.76 + using the same source and target space UIDs, shall also abut each
1.77 + other after mapping.
1.78 +
1.79 + @param aSourceSpace source space
1.80 + @param aSource source rectangle
1.81 + @param aTargetSpace target space
1.82 + @param aTarget target rectangle to be filled in
1.83 + @return KErrNone if successful or KErrNotSupported if invalid TCoordinateSpace
1.84 + */
1.85 + virtual TInt MapCoordinates(TCoordinateSpace aSourceSpace, const TRect& aSource, TCoordinateSpace aTargetSpace, TRect& aTarget) const =0;
1.86 + };
1.87 +
1.88 +/** Provides the Window Server client coordinate space mapping
1.89 + functions.
1.90 +
1.91 +*/
1.92 +class MDisplayMapping : public MDisplayMappingBase
1.93 + {
1.94 +public:
1.95 + enum
1.96 + {
1.97 + KUidDisplayMapping = 0x1028656B,
1.98 + ETypeId= KUidDisplayMapping
1.99 + };
1.100 +public:
1.101 + /** Retrieves the largest window extent that is visible at the current
1.102 + display resolution. This may be larger than the size reported by
1.103 + SizeInPixels(), and have a negative top-left position, for example.
1.104 +
1.105 + @see MDisplayControl
1.106 + @see CWsScreenDevice::SizeInPixels
1.107 +
1.108 + @param aExtent extent to be filled in
1.109 + */
1.110 + virtual void GetMaximumWindowExtent(TRect& aExtent) const =0;
1.111 + /** Returns the maximum useful size for a surface to be shown on the
1.112 + display at the current resolution, in both pixels and twips.
1.113 +
1.114 + This may be larger than both the screen device SizeInPixels() and
1.115 + the size of the maximum window extent, if the user interface is
1.116 + being scaled by the display. In general, the value will be the
1.117 + native display resolution.
1.118 +
1.119 + @see MDisplayControl
1.120 + @see CWsScreenDevice::SizeInPixels
1.121 +
1.122 + @param aPixels pixels to be filled in
1.123 + @param aTwips twips to be filled in
1.124 + */
1.125 + virtual void GetMaximumSurfaceSize(TSize& aPixels, TSize& aTwips) const =0;
1.126 + /** Retrieves the extent of a window relative to the top-left corner of
1.127 + the display.
1.128 +
1.129 + This will differ from the window's AbsPosition() if the current
1.130 + screen size mode is offset from the corner of the display, or if
1.131 + the user interface is being scaled on the display.
1.132 +
1.133 + @param aWindow window in question
1.134 + @param aExtent extent to be filled in
1.135 + */
1.136 + virtual void GetDisplayExtentOfWindow(const RWindowBase& aWindow, TRect& aExtent) const =0;
1.137 + };
1.138 +
1.139 +
1.140 +
1.141 +#endif /*DISPMAP_CLIENT_H_*/