RWindowBase Class Reference

#include <w32std.h>

class RWindowBase : public RWindowTreeNode, public RWindowTreeNode
Public Member Enumerations
enumTCaptureFlags { TCaptureFlagEnabled, TCaptureFlagDragDrop, TCaptureFlagAllGroups, TCaptureDisabled, ..., TCaptureDragDrop }
Public Member Functions
IMPORT_C TPointAbsPosition()
IMPORT_C voidActivate()
IMPORT_C TIntAddKeyRect(const TRect &, TInt, TBool)
IMPORT_C TIntAllocPointerMoveBuffer(TInt, TUint)
IMPORT_C voidCancelPointerRepeatEventRequest()
IMPORT_C TIntCancelPointerRepeatEventRequest(const TUint8)
IMPORT_C voidClaimPointerGrab(TBool)
IMPORT_C TIntClaimPointerGrab(const TUint8, const TBool)
IMPORT_C voidDisablePointerMoveBuffer()
IMPORT_C voidDiscardPointerMoveBuffer()
IMPORT_C TDisplayModeDisplayMode()
IMPORT_C voidEnableAdvancedPointers()
IMPORT_C voidEnableBackup(TUint)
IMPORT_C voidEnablePointerMoveBuffer()
IMPORT_C voidFadeBehind(TBool)
IMPORT_C TIntFixNativeOrientation()
IMPORT_C voidFreePointerMoveBuffer()
IMPORT_C TIntGetBackgroundSurface(TSurfaceConfiguration &)
IMPORT_C TIntGetPointerCapturePriority()
IMPORT_C TPointInquireOffset(const RWindowTreeNode &)
IMPORT_C TBoolIsFaded()
IMPORT_C TBoolIsNonFading()
IMPORT_C TRgbKeyColor()
IMPORT_C TIntMoveToGroup(TInt)
IMPORT_C voidOverrideEffects(TInt, const TFileName &, const TFileName &, const TFileName &, TBitFlags)
IMPORT_C TIntPasswordWindow(TPasswordMode)
IMPORT_C voidPointerFilter(TUint32, TUint32)
IMPORT_C TPointPosition()
IMPORT_C voidRemoveAllKeyRects()
IMPORT_C voidRemoveBackgroundSurface(TBool)
IMPORT_C voidRequestPointerRepeatEvent(TTimeIntervalMicroSeconds32, const TRect &)
IMPORT_C TIntRequestPointerRepeatEvent(TTimeIntervalMicroSeconds32, const TRect &, const TUint8)
IMPORT_C TIntRetrievePointerMoveBuffer(TDes8 &)
IMPORT_C voidSendEffectCommand(TInt, const TDesC8 &)
IMPORT_C TIntSetBackgroundSurface(const TSurfaceId &)
IMPORT_C TIntSetBackgroundSurface(const TSurfaceConfiguration &, TBool)
IMPORT_C TIntSetCornerType(TCornerType, TInt)
IMPORT_C TIntSetExtentErr(const TPoint &, const TSize &)
IMPORT_C TIntSetPointerAcceptanceRegion(const TRegion &)
IMPORT_C voidSetPointerCapture(TInt)
IMPORT_C voidSetPointerCapturePriority(TInt)
IMPORT_C voidSetPointerGrab(TBool)
IMPORT_C voidSetPosition(const TPoint &)
IMPORT_C voidSetPurpose(TInt)
IMPORT_C TIntSetRequiredDisplayMode(TDisplayMode)
IMPORT_C voidSetShadowDisabled(TBool)
IMPORT_C voidSetShadowHeight(TInt)
IMPORT_C TIntSetShape(const TRegion &)
IMPORT_C TIntSetSizeErr(const TSize &)
IMPORT_C voidSetSurfaceTransparency(TBool)
IMPORT_C voidSetVisible(TBool)
IMPORT_C TSizeSize()
IMPORT_C TSizeSizeForEgl()
Protected Member Functions
RWindowBase()
RWindowBase(RWsSession &)
TInt construct(const RWindowTreeNode &, TUint32, TInt, TDisplayMode)
Inherited Attributes
MWsClientClass::iBuffer
MWsClientClass::iWsHandle
Inherited Enumerations
RWindowTreeNode:TFadeControl
Inherited Functions
MWsClientClass::AddToBitmapArray(const TInt)const
MWsClientClass::AsyncRequest(TRequestStatus &,TUint)const
MWsClientClass::CachedWindowSize(TSize &)const
MWsClientClass::DestroyWindowSizeCacheEntry()
MWsClientClass::MWsClientClass()
MWsClientClass::MWsClientClass(RWsBuffer *)
MWsClientClass::MarkWindowSizeCacheDirty()
MWsClientClass::RefreshWindowSizeCache(const TSize &)const
MWsClientClass::WindowSizeCacheEnabled()const
MWsClientClass::Write(TUint)const
MWsClientClass::Write(const TAny *,TInt,TInt,TUint)const
MWsClientClass::Write(const TAny *,TInt,TUint,const TIpcArgs *)const
MWsClientClass::Write(const TAny *,TInt,const TAny *,TInt,TUint,const TIpcArgs *)const
MWsClientClass::WriteInt(TInt,TUint)const
MWsClientClass::WritePoint(const TPoint &,TUint)const
MWsClientClass::WriteRect(const TRect &,TUint)const
MWsClientClass::WriteReply(TUint,const TIpcArgs *)const
MWsClientClass::WriteReply(const TAny *,TInt,TUint,const TIpcArgs *)const
MWsClientClass::WriteReply(const TAny *,TInt,const TAny *,TInt,TUint,const TIpcArgs *)const
MWsClientClass::WriteReplyByProvidingRemoteReadAccess(const TAny *,TInt,const TReadDescriptorType &,TUint)const
MWsClientClass::WriteReplyInt(TInt,TUint,const TIpcArgs *)const
MWsClientClass::WriteReplyIntP(TInt,const TWriteDescriptorType &,TUint)const
MWsClientClass::WriteReplyP(const TAny *,TInt,const TAny *,TInt,const TWriteDescriptorType &,TUint)const
MWsClientClass::WriteReplyP(const TAny *,TInt,const TWriteDescriptorType &,TUint)const
MWsClientClass::WriteReplyP(const TWriteDescriptorType &,TUint)const
MWsClientClass::WriteSize(const TSize &,TUint)const
MWsClientClass::WsHandle()const
RWindowTreeNode::Child()const
RWindowTreeNode::ClearPointerCursor()
RWindowTreeNode::ClientHandle()const
RWindowTreeNode::Close()
RWindowTreeNode::Destroy()
RWindowTreeNode::DisableErrorMessages()
RWindowTreeNode::DisableFocusChangeEvents()
RWindowTreeNode::DisableGroupChangeEvents()
RWindowTreeNode::DisableGroupListChangeEvents()
RWindowTreeNode::DisableModifierChangedEvents()
RWindowTreeNode::DisableOnEvents()
RWindowTreeNode::DisableVisibilityChangeEvents()
RWindowTreeNode::EnableErrorMessages(TEventControl)
RWindowTreeNode::EnableFocusChangeEvents()
RWindowTreeNode::EnableGroupChangeEvents()
RWindowTreeNode::EnableGroupListChangeEvents()
RWindowTreeNode::EnableModifierChangedEvents(TUint,TEventControl)
RWindowTreeNode::EnableOnEvents(TEventControl)
RWindowTreeNode::EnableVisibilityChangeEvents()
RWindowTreeNode::FullOrdinalPosition()const
RWindowTreeNode::NextSibling()const
RWindowTreeNode::OrdinalPosition()const
RWindowTreeNode::OrdinalPriority()const
RWindowTreeNode::Parent()const
RWindowTreeNode::PrevSibling()const
RWindowTreeNode::RWindowTreeNode()
RWindowTreeNode::RWindowTreeNode(RWsSession &)
RWindowTreeNode::ScreenNumber()const
RWindowTreeNode::Session()const
RWindowTreeNode::SetCustomPointerCursor(const RWsPointerCursor &)
RWindowTreeNode::SetFaded(TBool,TFadeControl)
RWindowTreeNode::SetFaded(TBool,TFadeControl,TUint8,TUint8)
RWindowTreeNode::SetNonFading(TBool)
RWindowTreeNode::SetOrdinalPosition(TInt)
RWindowTreeNode::SetOrdinalPosition(TInt,TInt)
RWindowTreeNode::SetPointerCursor(TInt)
RWindowTreeNode::WindowGroupId()const
RWindowTreeNode::__DbgTest(TAny *)const
RWindowTreeNode::__DbgTestInvariant()const

Detailed Description

Client-side handle to a server-side window.

The server-side windows of handles derived from this class can be displayed on the device's screen, and associated with pointer events.

This class is not for user derivation; however derived classes form part of the Window Server API.

Member Enumeration Documentation

Enum TCaptureFlags

Capture behaviour flags.

See also: SetPointerCapture() EEventDragDrop

EnumeratorValueDescription
TCaptureFlagEnabled0x01

If set, capture is enabled, disabled otherwise.

TCaptureFlagDragDrop0x02

If set, drag-drop events are sent to the window in which the pointer was lifted. Drag-drop is a tap-drag-lift sequence.

TCaptureFlagAllGroups0x04

Capture events from windows belonging to any group, not just the group of the window on which the flag was set

TCaptureDisabled0

Equivalent to disabling all the above flags.

TCaptureEnabledTCaptureFlagEnabled

Equivalent to TCaptureFlagEnabled.

TCaptureDragDropTCaptureFlagEnabled|TCaptureFlagDragDrop|TCaptureFlagAllGroups

Equivalent to the OR of the first three flags.

Constructor & Destructor Documentation

RWindowBase ( )

RWindowBase()[protected]

Protected default constructor; creates an uninitialised, sessionless window handle.

Handles to server-side objects must be created in a session in order to be operational; this constructor is merely a convenience to allow the handle to be stored as a data member. See RWindowTreeNode::RWindowTreeNode() for details of how the complete setup of a handle field may be deferred until the window server session is known.

RWindowBase ( RWsSession & )

RWindowBase(RWsSession &aWs)[protected]

Protected constructor; creates an uninitialised window handle within a session.

Parameters
aWsWindow server session.

Member Function Documentation

AbsPosition ( )

IMPORT_C TPointAbsPosition()const

Gets a window's absolute position - ie the windows position relative to the current screen size mode.

This function always causes a flush of the window server buffer.

Return Value
Position of this window's origin relative to the screen.

Activate ( )

IMPORT_C voidActivate()

Displays the window and enables it to receive events.

Calling this method on a window causes it to receive a redraw event if it is a non-backed-up window, and should be called after a window has been constructed and initialised.

Windows are not displayed automatically when they are constructed. This allows them to be customised using SetPosition(), SetOrdinalPosition(), SetExtent(), etc., before they are displayed.

AddKeyRect ( const TRect &, TInt, TBool )

IMPORT_C TIntAddKeyRect(const TRect &aRect,
TIntaScanCode,
TBoolaActivatedByPointerSwitchOn
)

Adds an on-screen key rectangle.

This function configures an area of the screen, given by aRect, to act as an on-screen key. Any subsequent pointer events within this area will be translated by the window server into key events with a scan code of aScanCode.

aActivatedByPointerSwitchOn indicates whether or not to generate a key event as a result of a pointer event that acts to switch the machine on.

Before v7.0, calling this function stopped the window from receiving pointer events (they were received as key events) and pointer events outside the specified key rectangle were discarded. From v7.0, pointer events outside the key rectangles are not discarded and may be handled.

This function always causes a flush of the window server buffer.

See also: RemoveAllKeyRects()

Parameters
aRectRectangle to act as an on-screen key, relative to the window origin
aScanCodeScan code of key events generated by this on-screen key
aActivatedByPointerSwitchOnIf ETrue, a switch-on pointer event will produce a key event. If EFalse, a switch-on pointer event will not produce a key event.
Return Value
KErrNone if successful, otherwise one of the system-wide error codes.

AllocPointerMoveBuffer ( TInt, TUint )

IMPORT_C TIntAllocPointerMoveBuffer(TIntaMaxPoints,
TUintaFlags
)

Allocates a buffer for storing pointer movements.

The pointer move buffer is used by applications that need to process every single pointer move or drag event: for example, a freehand drawing application.

Normally, multiple drag events which the window server receives from the pointer device driver are translated into a single drag event. The single drag event incorporates all pointer events that occurred while the client was processing the previous pointer event. If the pointer move buffer is used, the window server stores all pointer events coming from a single pointer in a pointer buffer, and then delivers the entire buffer when it is full.

If there are multiple pointers available in the system (for example there is a multipointer screen present), for compatibility reasons only events coming from the single emulated pointer will be stored in a pointer buffer. For more information about emulated pointer please refer to the comment of RWindowBase::EnableAdvancedPointers() method.

AllocPointerMoveBuffer() must be called before the pointer move buffer can be used. It would typically be called during window construction.

After the pointer move buffer has been allocated, the window server does not start putting pointer events into it until EnablePointerMoveBuffer() is called.

Note: move events are not available on all hardware.

This function always causes a flush of the window server buffer.

See also: RWindowBase::EnableAdvancedPointers()

Parameters
aMaxPointsMaximum number of pointer events the buffer can hold. This affects the frequency at which the buffer is flushed.
aFlagsObsolete argument: set to zero always.
Return Value
KErrNone if successful, otherwise one of the system-wide error codes.

CancelPointerRepeatEventRequest ( )

IMPORT_C voidCancelPointerRepeatEventRequest()

Cancels a request for a pointer repeat event.

If using multiple pointers then this method will issue the cancel to whichever pointer is currently deemed to be the primary pointer. The primary pointer is only known internally. It is advised to use only this method for windows which do not have multiple pointers enabled.

See also: RequestPointerRepeatEvent() CancelPointerRepeatEventRequest(const TUint8 aPointerNumber)

CancelPointerRepeatEventRequest ( const TUint8 )

IMPORT_C TIntCancelPointerRepeatEventRequest(const TUint8aPointerNumber)

Cancels a request for a pointer repeat event.

Flushes the WServ command buffer.

See also: RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32 aTime,const TRect &aRect, const TUint8 aPointerNumber) To become publishedAll with WSERV NGA APIs To become released with WSERV NGA APIs

Parameters
aPointerNumberPointer the repeat event is requested for
Return Value
KErrNone if successful, KErrNotReady if construction not complete, KErrArgument if aPointerNumber is not a valid pointer number

ClaimPointerGrab ( TBool )

IMPORT_C voidClaimPointerGrab(TBoolaSendUpEvent = ETrue)

Claims any/all pointer grabs from another windows.

For any pointer grabs already in effect in other windows, a window can claim the pointer grabs from those windows by calling this function. All subsequent events will be delivered to this window, up to and including the next "up" event for each pointer. This next up event terminates the pointer grab for that pointer, for that window (other pointers will continue being grabbed until their up event).

This function would typically be used where clicking in a window pops up another window, and where the popped-up window wishes to grab the pointers as though the original click had been in that window.

Note:

If aSendUpEvent is set to ETrue, the window losing the grab is immediately sent an up event, signalling the end of its pointer grab.

See also: RWindowBase::SetPointerGrab() RWindowBase::ClaimPointerGrab(const TUint8 aPointerNumber, const TBool aSendUpEvent)

Parameters
aSendUpEventWhether to deliver an up event to the window that previously had the grab.

ClaimPointerGrab ( const TUint8, const TBool )

IMPORT_C TIntClaimPointerGrab(const TUint8aPointerNumber,
const TBoolaSendUpEvent = ETrue
)

Claims the pointer grab from another window for a specified pointer.

If the pointer grab for a given pointer is already in effect in another window, a window can claim the pointer grab from that window by calling this function. All subsequent events related to this pointer will be delivered to this window, up to and including the next "up" event. This next up event terminates the pointer grab.

Flushes the WServ command buffer.

SwEvent capability is required only for grabbing between windows belonging to different RWsSessions. Grabbing between windows from the same session does not require this capability.

Note: If aSendUpEvent is set to ETrue, the window losing the grab is immediately sent an up event, signalling the end of its pointer grab.

See also: RWindowBase::SetPointerGrab() RWindowBase::ClaimPointerGrab(TBool aSendUpEvent)

Parameters
aPointerNumbera pointer number of the pointer for which the grab will be claimed
aSendUpEventWhether to deliver an up event to the window that previously had the grab.
Return Value
KErrNone if successful, KErrNotFound if aPointerNumber is out of range, KErrNotSupported if pointer grab for pointer other than TAdvancedPointerEvent::EDefaultPointerNumber claimed for window in single pointer emulation mode, KErrPermissionDenied if trying to grab from a different window owner without the required capability.
Capability
SwEventTo become publishedAll with WSERV NGA APIs To become released with WSERV NGA APIs

DisablePointerMoveBuffer ( )

IMPORT_C voidDisablePointerMoveBuffer()

Instructs the window server to stop adding pointer events to the pointer move buffer.

DiscardPointerMoveBuffer ( )

IMPORT_C voidDiscardPointerMoveBuffer()

Discards all events in the pointer move buffer.

The window server subsequently continues to put new pointer events into the pointer move buffer as usual (if the buffer is enabled).

DisplayMode ( )

IMPORT_C TDisplayModeDisplayMode()const

Gets the window's current display mode.

This function always causes a flush of the window server buffer.

Return Value
The window's current display mode.

EnableAdvancedPointers ( )

IMPORT_C voidEnableAdvancedPointers()

After calling this method all pointer events delivered to this window will be instances of TAdvancedPointerEvent class which in addition to TPointerEvent provides pointer number, proximity and pressure information.

If the device is able to handle more than one pointer at the same time (for example a touch screen that is able to determine coordinates of more than one finger touching it at the same time), then this method will enable delivering events from all detected pointers to this window.

This method must be called before the window is activated by calling RWindowBase::Activate(). Otherwise the client is panicked with the code EWservPanicUnableToEnableAdvPointer in a DEBUG mode.

If this method is not called for the window, it is assumed that the window is not able to receive events from multiple pointers, and thus only events from a single emulated pointer are sent to it. Emulated pointer ensures that code written for a single pointer environment works properly in a multiple pointer environment: there is only one global emulated pointer in the whole system and at each point in time its state is equal to state of one of the physical pointers detected by the device. WSERV switches emulated pointer between these physical pointers in a way that maximizes usability.

This method also affects any Animation working in this window. If it has been called, such an Animation will receive pointer events from all pointers. Otherwise it will receive only events from the emulated pointer.

See also: TAdvancedPointerEvent TPointerEvent::AdvancedPointerEvent() MAnimGeneralFunctions::GetRawEvents() RWindowBase::Activate() To become publishedAll with WSERV NGA APIs To become released with WSERV NGA APIs

EnableBackup ( TUint )

IMPORT_C voidEnableBackup(TUintaBackupType = EWindowBackupAreaBehind)

Requests that this window backs up all or part of the screen's contents. There are two backup possibilities:- just the area behind this window (the default), or the whole screen. Backing up the whole screen is useful for windows that require the rest of the screen to fade when they are displayed. In this case, the full screen backup is of the unfaded content of the screen.

It is possible to specify both types of backup at the same time. This may be used by fade behind windows that can be dragged across the screen, e.g. a dialog. This is done by calling this function with the parameter EWindowBackupAreaBehind|EWindowBackupFullScreen.

When backing up the whole screen, this function should be called before the window is activated, and before you call fade behind on it (RWindowBase::FadeBehind()).

Backing up a window is an optimisation feature that is honoured only if there is enough memory to do so, (it requires bitmaps and a region to be created and maintained). If there is not enough memory, all or part of the backup will be lost. In this case, a redraw will be issued at the relevant point just as if the window had not been backed up.

The backup bitmap is made and is claimed by the window not when EnableBackup() is called, but when the window becomes visible (this is normally when the window is activated).

Only one backed up window of the same type can exist at any one time (although the same window can have both types of backup at the same time). If a window requests a backup of type EWindowBackupAreaBehind, any window that has already claimed a backup of this type will lose it. If a window requests a backup of type EWindowBackupFullScreen, this request will fail if another window has already claimed a backup of this type.

See also: TWindowBackupType

Parameters
aBackupTypeThe type of backed up window. See the TWindowBackupType enum for possible values.

EnablePointerMoveBuffer ( )

IMPORT_C voidEnablePointerMoveBuffer()

Enables the pointer move buffer for receiving pointer move events.

This function instructs the window server to begin putting pointer events into the pointer move buffer. AllocPointerMoveBuffer() must have previously been called, or a panic will occur.

As soon as the pointer buffer has at least one point in it, the window server sends an event of type EEventPointerBufferReady to the client, and the events can be retrieved from the pointer move buffer using RetrievePointerMoveBuffer().

Note: pointer move, drag and enter/exit events are not delivered to a window by default. An application using the pointer move buffer should use PointerFilter() to request that these events be delivered.

See also: DisablePointerMoveBuffer()

FadeBehind ( TBool )

IMPORT_C voidFadeBehind(TBoolaFade)

Sets whether or not all windows behind the current window, in the same window group, should be faded or unfaded.

This function can be used to fade all windows used by an application when a dialogue is displayed.

Fading works on a count basis. Fading increases the fade count, while unfading decreases it. If the fade count is greater than zero the window will be drawn faded. Only when it drops back to zero will it stop being faded.

This functionality is used to support nested dialogues. When bringing up a dialogue the rest of the application windows are faded. If an option is selected to launch another dialogue, the original dialogue is faded (fade count 1) and the remaining windows have their fade count increased to 2. When the dialogue is closed the fade count is reduced by one, which displays the original dialogue, but the remaining windows remain faded. They are only displayed when the other dialogue is closed and their fade count is reduced to zero.

Note:

Information is lost when a window is faded, so a redraw is required to restore the window content when it is unfaded (blank and backup windows deal with this themselves). A redraw is also required for the areas that were in shadow when the window was faded, since the shadowing also causes information loss. While a window is faded all drawing to that window will be adjusted appropriately by the window server.

See also: RWindowTreeNode::SetFaded() RWindowTreeNode::SetNonFading()

Parameters
aFadeETrue to increase the fade count of all windows behind the current window (within the current window group), EFalse to reduce the fade count.

FixNativeOrientation ( )

IMPORT_C TIntFixNativeOrientation()

Enables orientation independent egl rendering for a full screen instance of an eglWindowSurface created from this window.

When enabled, an instance of an eglWindowSurface created from a full screen window will behave as a full screen surface in the native orientation.

Clients using this feature take over responsibility for rotating the content of egl rendering to match the actual device orientation.

Potential candidates for using this feature are applications using a full screen eglWindowSurface in a non-native orientation, when running on devices where a rotation cost in the compositor may result in a reduced frame rate and possibly an increase in graphics memory usage.

Pointer events for this window are delivered to the client in the current device orientation. The client should express the window extent in the current device orientation, which can be obtained from CWsScreenDevice.

When using this feature, a number of constraints must be met:
  • When the pre-conditions are satisfied, FixNativeOrientation() may be called.
    • The error return code should be checked.

    • On return of an error the window should be closed and a new window instance not using FixNativeOrientation() should be used.

  • Once FixNativeOrientation() has been called, Activate() may be called.

  • Once activated, an eglWindowSurface may be created from this window.

  • The CWsScreenDevice must be kept alive for the lifetime of this window.

  • FixNativeOrientation may only be called once on an instance of a window.

Note: EGraphicsOrientationNormal denotes the native orientation of the device.

Pre-condition
The client must have a CWsScreenDevice with the current device orientation.

The window must have a full screen extent, positioned at the origin. The definition of full screen is obtained by interrogating the CWsScreenDevice. The window must not have been activated. FixNativeOrientation() must not have been called previously on this window.

Post-condition
An eglWindowSurface created from this window will
  • always be displayed in the native orientation

  • always be positioned at the native origin

  • always have dimensions matching the native screen size

Pointer event handling and other aspects of behaviour remain unchanged.

See also: Optimizing Non-Native Orientation Windows in Symbian^3

Return Value
KErrNone if successful, KErrNotSupported if feature is not present, otherwise one of the system wide error codes.
Panic Codes
WSERV85 One or more of the preconditions has been violated.

FreePointerMoveBuffer ( )

IMPORT_C voidFreePointerMoveBuffer()

Frees the pointer move buffer.

This function should be called on a window which calls AllocPointerMoveBuffer().

GetBackgroundSurface ( TSurfaceConfiguration & )

IMPORT_C TIntGetBackgroundSurface(TSurfaceConfiguration &aConfiguration)const

Retrieves a copy of the current configuration for background surface attached to the window.

The client must present a properly initialized TSurfaceConfiguration on entry in particular the size field must be valid before the call. The server will then fill the object with the available data.

If the server supports more fields it will truncate the returned data to the size the client has requested. If the server has fewer fields it will set the returned size field to the lower value.

Note that the returned attribute values will only be guaranteed equivalent to the input values, not exact copies, as the values may be calculated from internal flags rather than reported from a cached exact copy.

Pre-condition
The window is either a RWindow or an RBlankWindow, or the client is panicked with the code EWservPanicDrawable.

The window has not been set as transparent, or the client is panicked with the code EWservPanicTransparencyMisuse. The Size member of the configuration must be an acceptable value. The size must match the Size() member of a defined TSurfaceConfiguration variant, or be larger than all variants known to the server. If not, the client is panicked with code EWservPanicInvalidSurfaceConfiguration.

Post-condition
aConfiguration object filled to specified size.

This function always causes a flush of the WServ session buffer.

See also: SetBackgroundSurface RemoveBackgroundSurface

Parameters
aConfigurationOn entry the Size field specifies the maximum size of the object.On return fields up to this size are filled in.
Return Value
KErrNone on success or any system-wide error codeKErrNotFound The window does not have a background surface attached.KErrNoMemory If a memory allocation fault occurs.

GetPointerCapturePriority ( )

IMPORT_C TIntGetPointerCapturePriority()const

Gets the windows's pointer capture priority

See also: SetPointerCapturePriority()

Return Value
Window's pointer capture priority

InquireOffset ( const RWindowTreeNode & )

IMPORT_C TPointInquireOffset(const RWindowTreeNode &aWindow)const

Enquires the offset between this and another window.

A positive value indicates a position to the right and down from aWindow, a negative value indicates a position to the left and up.

This function always causes a flush of the window server buffer.

Parameters
aWindowAnother window tree node.
Return Value
The offset of this window relative to aWindow.

IsFaded ( )

IMPORT_C TBoolIsFaded()const

Tests whether the current window is faded.

This function always causes a flush of the window server buffer.

Return Value
ETrue if the current window is faded, otherwise EFalse.

IsNonFading ( )

IMPORT_C TBoolIsNonFading()const

Tests whether the current window is non-fading.

This function always causes a flush of the window server buffer.

See also: RWindowTreeNode::SetNonFading()

Return Value
ETrue if the current window is non-fading, otherwise EFalse.

KeyColor ( )

IMPORT_C TRgbKeyColor()const

This function returns the key color for the window, if used.

Deprecated

Return Value
Transparent black.

MoveToGroup ( TInt )

IMPORT_C TIntMoveToGroup(TIntaIdentifier)

Moves this window to another window group.

This function allows a window with a window group as its immediate parent to be moved from one window group to another one. The two window groups must be owned by the same client. The new parent window group is specified by its identifier.

This function always causes a flush of the window server buffer.

Parameters
aIdentifierThe identifier of the target window group. This is the value returned by RWindowGroup::Identifier().
Return Value
KErrNone if successful, otherwise another of the system-wide error codes. An error is returned if an attempt is made to move the window between window groups in different clients.

OverrideEffects ( TInt, const TFileName &, const TFileName &, const TFileName &, TBitFlags )

IMPORT_C voidOverrideEffects(TIntaAction,
const TFileName &aResourceDir,
const TFileName &aFilenameOutgoing,
const TFileName &aFilenameIncoming,
TBitFlagsaFlags = 0
)

Overides the default animation for current window's transition effect by sent animation description. Please refer RWsSession::RegisterEffect() comments for more information on animation description.

Parameters
aActionThe particular transition to set the animation for.
aResourceDirThe name of the directory that contains the animation description files.
aFilenameOutgoingThe file containing the description of the animation for the outgoing phase of the transition. Specify KNullDesC for no outgoing phase effect.
aFilenameIncomingThe file containing the description of the animation for the incoming phase of the transition. Specify KNullDesC for no incoming phase effect.
aFlagsFlag for the effect. Please see TTfxFlags for values this flag parameter can use.

PasswordWindow ( TPasswordMode )

IMPORT_C TIntPasswordWindow(TPasswordModeaPasswordMode)

Makes this window the password window.

Only one password window can exist concurrently. Another window may take over as the password window if either (a) the current password window calls this function with aPasswordMode=EPasswordCancel, or (b) the current password window is destroyed.

This function always causes a flush of the window server buffer.

Deprecated

Parameters
aPasswordModeThe type of password handling required.
Return Value
KErrNone if successful, KErrInUse if this function is called when another password window already exists, otherwise another of the system-wide error codes.

PointerFilter ( TUint32, TUint32 )

IMPORT_C voidPointerFilter(TUint32aFilterMask,
TUint32aFilter
)

Sets the filter which controls which pointer events are sent to the client session.

A pointer filter can be defined for each window separately, and changed dynamically. The default behaviour when a window is created is that move, drag, enter and exit events are filtered out and not delivered to the client.

See also: TPointerFilter

Parameters
aFilterMaskBitwise OR of values from TPointerFilter masking event types which will be updated.
aFilterBits containing new values for the masked event types. A 1 bit causes the corresponding event to be filtered out, a 0 bit lets through the corresponding event.

Position ( )

IMPORT_C TPointPosition()const

Gets a window's position relative to its parent.

This function always causes a flush of the window server buffer.

Return Value
Position of this window's origin relative to the origin of its parent.

RemoveAllKeyRects ( )

IMPORT_C voidRemoveAllKeyRects()

Removes all the on-screen keys that have been added to this window.

After this function has been called, all pointer events are delivered to the window, reversing the effect of AddKeyRect().

See also: AddKeyRect()

RemoveBackgroundSurface ( TBool )

IMPORT_C voidRemoveBackgroundSurface(TBoolaTriggerRedraw)

This removes any background surface that has been set to the window.

The surface ID registration associated with the window will be released. This is independent of any outstanding calls to RWsSession::RegisterSurface, which should be completed with a corresponding call to UnregisterSurface.

The aTriggerRedraw parameter triggers a redraw of at least the affected areas of the window at the end of this method.

Post-condition
Any background surface associated with this window has been removed. The appearance on screen may not change until the window is redrawn and the next refresh occurs. The aTriggerRedraw parameter can be set to trigger this redrawing.

This function does not explicitly force a flush of the WServ session buffer. Internal reference counting will keep the Surface ID "live" until the client code has released any handles and provisioners, and WServ processes the buffered remove command, and the final frame containing this surface has finished being displayed.

See also: SetBackgroundSurface GetBackgroundSurface

Parameters
aTriggerRedrawIf set causes WServ to repaint any affected portions of the display.

RequestPointerRepeatEvent ( TTimeIntervalMicroSeconds32, const TRect & )

IMPORT_C voidRequestPointerRepeatEvent(TTimeIntervalMicroSeconds32aTime,
const TRect &aRect
)

Requests a pointer repeat event.

This function instructs the window server to send a single pointer repeat event if the pointer state that caused the last event (e.g. EButton1Down) for the pointer has not changed within aTime and the pointer has not moved outside aRect. Pointer repeat events are pointer events of type TPointerEvent::EButtonRepeat.

While the repeat is in operation all move and drag events within the rectangle are filtered out. The repeat is cancelled if the pointer moves outside the rectangle or generates any other pointer event.

A typical use of this function would be for a scrollbar, so that holding down the pointer results in a continuous scroll.

If using multiple pointers then this method will issue the repeat to the emulated single pointer. It is advised to use only this method for windows which do not have multiple pointers enabled.

See also: CancelPointerRepeatEventRequest() RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32 aTime,const TRect &aRect, const TUint8 aPointerNumber)

Parameters
aTimeTime interval before pointer repeat event should be sent.
aRectRepeat event occurs only if pointer is within this rectangle.

RequestPointerRepeatEvent ( TTimeIntervalMicroSeconds32, const TRect &, const TUint8 )

IMPORT_C TIntRequestPointerRepeatEvent(TTimeIntervalMicroSeconds32aTime,
const TRect &aRect,
const TUint8aPointerNumber
)

Requests a pointer repeat event.

This function instructs the window server to send a single pointer repeat event if the pointer state that caused the last event (e.g. EButton1Down) has not changed within aTime and the pointer has not moved outside aRect. Pointer repeat events are pointer events of type TPointerEvent::EButtonRepeat.

While the repeat is in operation all move and drag events within the rectangle are filtered out. The repeat is cancelled if the pointer moves outside the rectangle or generates any other pointer event.

A typical use of this function would be for a scrollbar, so that holding down the pointer results in a continuous scroll.

Flushes the WServ command buffer.

See also: CancelPointerRepeatEventRequest(const TUint8 aPointerNumber) To become publishedAll with WSERV NGA APIs To become released with WSERV NGA APIs

Parameters
aTimeTime interval before pointer repeat event should be sent.
aRectRepeat event occurs only if pointer is within this rectangle.
aPointerNumberPointer the repeat event is requested for
Return Value
KErrNone if successful, KErrArgument if aPointerNumber is not a valid pointer number

RetrievePointerMoveBuffer ( TDes8 & )

IMPORT_C TIntRetrievePointerMoveBuffer(TDes8 &aBuf)const

Retrieves events from the pointer move buffer.

Use this function to get pointer events from the pointer move buffer. This function should be called when an event has occurred of type EEventPointerBufferReady (defined in TEventCode).

This function always causes a flush of the window server buffer.

Parameters
aBufBuffer to store events retrieved from pointer move buffer
Return Value
KErrNone if successful, otherwise one of the system-wide error codes.

SendEffectCommand ( TInt, const TDesC8 & )

IMPORT_C voidSendEffectCommand(TIntaTfxCmd,
const TDesC8 &aTfxCmdData = KNullDesC8
)

Sets specific effect data or execute commands to the TFX layer. The data or command passed by the client API will be directed to MWsTfxLayer::SendEffectCommand. MWsTfxLayer will accept only window specific commands and data.

Parameters
aTfxCmdTFX layer command.
aTfxCmdDataData structure related to the specified value of aTfxCmd. The default value is KNullDesC8.

SetBackgroundSurface ( const TSurfaceId & )

IMPORT_C TIntSetBackgroundSurface(const TSurfaceId &aSurface)

This sets the background of the window to be the given surface.

The surface will be stretched or compressed to fill the extent of the window. The background is updated on screen when the window is next redrawn.

When the window is moved, the surface will move with it. If the window is resized, the surface will be similarly scaled. If a 1-1 pixel mapping is required and the window size changes, the function will need to be called again with a different TSurfaceId for a surface with the new size of the window.

Pre-condition
aSurface has been initialized.

The window is either an RWindow or an RBlankWindow, or the client is panicked with the code EWservPanicDrawable. The surface must be compatible with being composited on the screen this window appears on; otherwise the client thread is panicked with code EWservPanicIncompatibleSurface.

Post-condition
The window has its background set to be the surface.

The window is opaque. The base area of the window is the full extent of the window. A GCE surface layer has been created to associate the surface with a location on screen. The surface's content is in an undefined state, but the surface remains initialized. This function always causes a flush of the window server buffer.

Parameters
aSurfaceThe surface to act as the background of the window
Return Value
KErrNone on success or a system-wide error code.

SetBackgroundSurface ( const TSurfaceConfiguration &, TBool )

IMPORT_C TIntSetBackgroundSurface(const TSurfaceConfiguration &aConfiguration,
TBoolaTriggerRedraw
)

This sets a surface to appear in front of the window's background within a given area of that window.

Any rendering performed by CWindowGc operations will appear in front of surface for the window. The TSurfaceConfiguration object contains the Surface ID and allows various surface presentation attributes to be specified. This describes the mapping from surface co-ordinates to screen co-ordinates, allowing for scaling, cropping, and rotation.

For details on the attributes see TSurfaceConfiguration.

If the same surface ID is already set as the window background surface, then only the configuration parameters will be updated.

If the window already has a background surface (that is not same as the new surface) then that surface will be removed and the new background surface will be set. The Surface ID will be registered while attached to this window. This is in addition to any call to RWsSession::RegisterSurface.

Pre-condition
The window is either a RWindow or an RBlankWindow, or the client is panicked with the code EWservPanicDrawable.

The surface is opaque; otherwise results are not defined. All members of the TSurfaceConfiguration recognised by the server must have valid values. If not, the client is panicked with code EWservPanicInvalidSurfaceConfiguration. The surface must not be the UI surface; otherwise the client thread is panicked with code EWservPanicInvalidSurface. The surface must not be the null surface ID; otherwise the client thread is panicked with code EWservPanicInvalidSurface.

Post-condition
The window has a new background surface set to be within the given area. Outside the area, the windows background color will be visible.

The window must be redrawn before the surface becomes visible, and the surface's content will be visible after the composition and refresh. Composition of the surface will be automatically triggered if required. The aTriggerRedraw flush parameter will cause this redraw, or the client should cause a redraw after this call. This function always causes a flush of the WServ session buffer.

See also: RemoveBackgroundSurface GetBackgroundSurface

Parameters
aConfigurationThe set of configuration that applies to the surface.
aTriggerRedrawIf set causes WServ to repaint any affected portions of the display.
Return Value
KErrNone on success or any system-wide error codeKErrNotSupported if surface support is not availableKErrNoMemory If a memory allocation fault occursKErrArgument If the surface ID is not accepted by the GCE

SetCornerType ( TCornerType, TInt )

IMPORT_C TIntSetCornerType(TCornerTypeaCornerType,
TIntaCornerFlags = 0
)
Deprecated

Sets the shape of a window's corners.

This function always causes a flush of the window server buffer.

See also: TCornerFlags

Parameters
aCornerTypeCorner type to apply.
aCornerFlagsBitwise OR of flags indicating corners to exclude.
Return Value
KErrNone if successful, otherwise one of the system-wide error codes.

SetExtentErr ( const TPoint &, const TSize & )

IMPORT_C TIntSetExtentErr(const TPoint &point,
const TSize &size
)

Sets a backed-up window's extent, relative to its parent, and returns an error code from the server.

See SetPosition() and SetSizeErr() for a description of the rules applying to aPoint and aSize respectively.

Avoid using this function for a window of type RBlankWindow or RWindow (in other words, not a backed-up window). Instead, use SetExtent(), which is more efficient as it does not return a value. However, if the window is a backed-up window, or of unknown type, SetExtentErr() should be used, because setting the extent of a backed-up window may cause an out-of-memory error.

This function may be called at any time after the window's Construct() function: the window's extent will change dynamically.

This function always causes a flush of the window server buffer.

Parameters
pointThe position of the window's origin, relative to its parent.
sizeWindow size.
Return Value
KErrNone if successful, otherwise one of the system-wide error codes.

SetPointerAcceptanceRegion ( const TRegion & )

IMPORT_C TIntSetPointerAcceptanceRegion(const TRegion &aRegion)

Sets a region of a window that can receive pointer events.

Once this region is set, pointer events must be within both this region and the window's base area to be received. If an empty pointer acceptance region is set, then no pointer events will be received by this window. Pointer events that fall outside of this region will be processed for any windows underneath. Prior to calling this API the whole base area of the window can receive pointer events.

If a window is moved, the pointer acceptance region will move with it.

If a window is re-sized, the pointer region will NOT change shape/size automatically ( though it will still be clipped by the window's base area ). The new size/shape must be set explicitly from the client/application side using this API.

This function always causes a flush of the window server buffer.

Parameters
aRegionRegion defining the pointer acceptance region shape in window relative coordinates.
Return Value
KErrNone if successful, otherwise one of the system-wide error codes.

SetPointerCapture ( TInt )

IMPORT_C voidSetPointerCapture(TIntaFlags)

Sets the pointer capture state.

A window which has called this function can capture events that would otherwise go to other windows. Normally, pointer events are sent to the window at the co-ordinates where the event occurs. Capturing only works on windows which are behind the capturing window in the z order.

Capture can be enabled or disabled. If capturing is enabled a window will, by default, capture events only from windows in the same window group. A flag can be specified to allow it to capture events across all window groups.

Another flag can be used to specify drag-drop capture. This causes a drag-drop message to be sent to the window within which the pen was lifted. Drag-drop with a pen is a tap-drag-lift sequence.

Capture functionality is useful in situations where only the foreground window should receive events, e.g. in a modal dialogue.

See also: TCaptureFlags

Parameters
aFlagsBitwise OR of flag values from TCaptureFlags.

SetPointerCapturePriority ( TInt )

IMPORT_C voidSetPointerCapturePriority(TIntaPriority)

Sets the window's pointer capture priority.

To allow window gain a property that allows them to be clicked on even when they are behind a modal window. The priority will be 0 by default. Windows that need to stop modal window in front of them, should set this value to positive. Window can only capture pointer events from another window of same group, if it has at least the same pointer capture priority.

Parameters
aPriorityPointer capture priority

SetPointerGrab ( TBool )

IMPORT_C voidSetPointerGrab(TBoolaState)

Allows or disallows pointer grabs in a window.

If the pointer grab is set, any down event of a given pointer in this window will cause a pointer grab of this pointer, terminated by the next corresponding up event for this pointer. All pointer events, for the grabbed pointer, up to and including the next up event will be sent to that window.

Please note that the pointer grab works separately for each pointer present in the system (for example, separately for each finger touching the multipointer screen).

Pointer grab can be used for drag-and-drop or other situations when you want the events delivered to the same window even though the pen will be dragged outside that window. This function is typically called during window construction so that pointer grab is enabled for the lifetime of the window.

Pointer grab is disabled by default.

See also: ClaimPointerGrab()

Parameters
aStateNew state for the pointer grab setting.

SetPosition ( const TPoint & )

IMPORT_C voidSetPosition(const TPoint &point)

Sets the position of a window relative to its parent.

The co-ordinates given in aPos specify the position of the top left-hand corner of the window, relative to the top left-hand corner of its parent. A positive value indicates a direction to the right and down. Negative values are valid but will cause part of the window to be outside its parent's extent, and therefore clipped.

This function may be called at any time after the window's Construct() function: the window's position will change dynamically.

A window's position can also be set using the RWindow::SetExtent() and RWindowBase::SetExtentErr() functions.

Note: upon creation, a window's extent is the same as its parents. In other words it has the same origin and size. If the windows parent is a group window, it is initialised to be full screen.

Parameters
pointThe position of the window's origin, relative to its parent

SetPurpose ( TInt )

IMPORT_C voidSetPurpose(TIntaPurpose)

Sets specific window purpose to the TFX layer. The purpose passed by the client API will be directed to MWsTfxLayer::SetPurpose.

See also: MWsTfxLayer

Parameters
aPurposeThe window purpose information.

SetRequiredDisplayMode ( TDisplayMode )

IMPORT_C TIntSetRequiredDisplayMode(TDisplayModeaMode)

This method has been deprecated. Windows can no longer be associated with a display mode other than the system display mode. This method no longer has any effect and will always return the system display mode.

This function always causes a flush of the window server buffer.

Deprecated

Parameters
aModeIgnored.
Return Value
The system display mode.

SetShadowDisabled ( TBool )

IMPORT_C voidSetShadowDisabled(TBoolaState)

This method has been deprecated. Shadowing is no longer supported. Calling it has no effect. Deprecated

Parameters
aStateIgnored.

SetShadowHeight ( TInt )

IMPORT_C voidSetShadowHeight(TIntaHeight)

This method has been deprecated. Shadowing of a window is no longer supported. Calling it has no effect. Deprecated

Parameters
aHeightIgnored.

SetShape ( const TRegion & )

IMPORT_C TIntSetShape(const TRegion &aRegion)

Sets a window's shape arbitrarily, if rectangular windows are not required.

This function always causes a flush of the window server buffer.

Deprecated

Parameters
aRegionRegion defining window shape.
Return Value
KErrNone if successful, otherwise one of the system-wide error codes.

SetSizeErr ( const TSize & )

IMPORT_C TIntSetSizeErr(const TSize &size)

Sets the size of a backed-up window.

A window's size is not constrained by the size of its parent. However, its visible region is, and the child window's visible region will always be clipped to the parent's visible region.

Avoid using this function for a window known to be of type RBlankWindow or RWindow (i.e. not a backed-up window). Instead, use SetSize(), which is more efficient as it does not return a value. However, if the window is a backed-up window, or of unknown type, SetSizeErr() should be used, because setting the size of a backed-up window may cause an out-of-memory error.

This function may be called at any time after the window's Construct() function: the window's size will change dynamically.

This function always causes a flush of the window server buffer.

See also: RWindow::SetSize() RWindow::SetExtent() RWindowBase::SetExtentErr()

Parameters
sizeWindow size.
Return Value
KErrNone if successful, otherwise one of the system-wide error codes.

SetSurfaceTransparency ( TBool )

IMPORT_C voidSetSurfaceTransparency(TBoolaSurfaceTransparency)

This enables clients to specify on a per-window basis whether a background surface for that window is opaque or semi-transparent. By default, a surface associated with a window via RWindowBase::SetBackgroundSurface() is taken to be opaque. This API enables a client to indicate that the surface has alpha and is to be blended into the display output rather than blitted. If this feature is disabled, and the user creates an EGL surface containing an alpha channel, then colorbuffer pixels that do not have an alpha of 1.0 will have an undefined visual appearance when composited on-screen.

The surface transparency setting is persistent, even if the background surface is removed from the window and then replaced later.

Semi-transparent surfaces will be interpreted by the composition system as using pre-multiplied alpha. For this reason, if you intend to render using OpenVG, then you must use the EGL_VG_ALPHA_FORMAT_PRE attribute when calling eglCreateWindowSurface, otherwise on-screen blending results are undefined.

See also: SetBackgroundSurface RemoveBackgroundSurface

Parameters
aSurfaceTransparencyIf set, indicates that the backgound surface associated with this window is semi-transparent.

SetVisible ( TBool )

IMPORT_C voidSetVisible(TBoolaState)

Sets the window's visibility.

This function can be called after the window has been created to dynamically change its visibility.

Notes:

When a window is invisible, it receives no events from the window server.

A window is invisible before it is activated, irrespective of the state of its visibility flag.

Parameters
aStateNew value for the visibility.

Size ( )

IMPORT_C TSizeSize()const

Gets the window's current size.

This function always causes a flush of the window server buffer.

Return Value
Current size of window.

SizeForEgl ( )

IMPORT_C TSizeSizeForEgl()const

Disclaimer - this API is internal and is subject to change

construct ( const RWindowTreeNode &, TUint32, TInt, TDisplayMode )

TInt construct(const RWindowTreeNode &parent,
TUint32aHandle,
TIntaType,
TDisplayModeaDisplayMode
)[protected]
Panic Codes
TW32Panic17 in debug builds if called on an already constructed object.