RWsSession Class Reference

#include <w32std.h>

class RWsSession : public MWsClientClass, public RSessionBase, public MWsClientClass, public RSessionBase
Public Member Enumerations
enumanonymous { ESystemInfoArraySize }
enumTComputeMode { EPriorityControlDisabled, EPriorityControlComputeOn, EPriorityControlComputeOff }
enumTCustomTextCursorAlignment { ECustomTextCursorAlignTop, ECustomTextCursorAlignBaseline, ECustomTextCursorAlignBottom }
enumTLoggingCommand { ELoggingEnable, ELoggingDisable, ELoggingStatusDump, ELoggingHeapDump }
Public Member Functions
RWsSession()
IMPORT_C TIntClaimSystemPointerCursorList()
IMPORT_C voidClearAllRedrawStores()
IMPORT_C voidClearDefaultSystemPointerCursor()
IMPORT_C TIntClearHotKeys(THotKey)
IMPORT_C voidClearSystemPointerCursor(TInt)
IMPORT_C voidClose()
IMPORT_C voidComputeMode(TComputeMode)
IMPORT_C TIntConnect()
IMPORT_C TIntConnect(RFs &)
IMPORT_C TIntDebugInfo(TInt, TInt)
IMPORT_C TIntDebugInfo(TInt, TDes8 &, TInt)
IMPORT_C voidEnableWindowSizeCacheL()
IMPORT_C voidEventReady(TRequestStatus *)
IMPORT_C TIntEventReadyCancel()
IMPORT_C TIntFetchMessage(TUid &, TPtr8 &, const TWsEvent &)
IMPORT_C TIntFindWindowGroupIdentifier(TInt, const TDesC &, TInt)
IMPORT_C TIntFindWindowGroupIdentifier(TInt, TThreadId)
IMPORT_C TIntFinish()
IMPORT_C voidFlush()
IMPORT_C voidFreeSystemPointerCursorList()
IMPORT_C TRgbGetBackgroundColor()
IMPORT_C TIntGetColorModeList(CArrayFixFlat< TInt > *)
IMPORT_C TIntGetColorModeList(TInt, CArrayFixFlat< TInt > *)
IMPORT_C TDisplayModeGetDefModeMaxNumColors(TInt &, TInt &)
IMPORT_C TDisplayModeGetDefModeMaxNumColors(TInt, TInt &, TInt &)
IMPORT_C TIntGetDefaultOwningWindow()
IMPORT_C TIntGetDefaultOwningWindow(TInt)
IMPORT_C voidGetDoubleClickSettings(TTimeIntervalMicroSeconds32 &, TInt &)
IMPORT_C TIntGetEnterCloseProximityThreshold()
IMPORT_C TIntGetEnterHighPressureThreshold()
IMPORT_C TIntGetEvent(TWsEvent &)
IMPORT_C TIntGetEvent(CWsEventWithData &)
IMPORT_C TIntGetExitCloseProximityThreshold()
IMPORT_C TIntGetExitHighPressureThreshold()
IMPORT_C TIntGetFocusScreen()
IMPORT_C TIntGetFocusWindowGroup()
IMPORT_C TIntGetFocusWindowGroup(TInt)
voidGetGraphicMessage(TDes8 &)
IMPORT_C voidGetKeyboardRepeatRate(TTimeIntervalMicroSeconds32 &, TTimeIntervalMicroSeconds32 &)
IMPORT_C TIntGetModifierState()
IMPORT_C voidGetPriorityKey(TWsPriorityKeyEvent &)
IMPORT_C voidGetRedraw(TWsRedrawEvent &)
IMPORT_C TIntGetWindowGroupClientThreadId(TInt, TThreadId &)
IMPORT_C TIntGetWindowGroupHandle(TInt)
IMPORT_C TIntGetWindowGroupNameFromIdentifier(TInt, TDes &)
IMPORT_C TIntGetWindowGroupOrdinalPriority(TInt)
voidGraphicAbortMessage(TInt)
TInt GraphicFetchHeaderMessage()
voidGraphicMessageCancel()
voidGraphicMessageReady(TRequestStatus *)
IMPORT_C TIntHeapCount()
IMPORT_C voidHeapSetBurstFail(TInt, TInt, TInt)
IMPORT_C voidHeapSetFail(TInt, TInt)
IMPORT_C voidIndicateAppOrientation(TRenderOrientation)
IMPORT_C voidLogCommand(TLoggingCommand)
IMPORT_C voidLogMessage(const TLogMessageText &)
IMPORT_C TIntNumWindowGroups()
IMPORT_C TIntNumWindowGroups(TInt)
IMPORT_C TIntNumWindowGroups(TInt, TInt)
IMPORT_C TIntNumberOfScreens()
IMPORT_C voidOverrideEffects(TInt, TInt, const TFileName &, const TFileName &, const TFileName &, TBitFlags)
IMPORT_C voidPasswordEntered()
IMPORT_C TRectPointerCursorArea()
IMPORT_C TRectPointerCursorArea(TInt)
IMPORT_C TPointerCursorModePointerCursorMode()
IMPORT_C TPointPointerCursorPosition()
IMPORT_C TIntPreferredSurfaceConfigurationSize()
IMPORT_C voidPrepareForSwitchOff()
IMPORT_C voidPriorityKeyReady(TRequestStatus *)
IMPORT_C voidPriorityKeyReadyCancel()
IMPORT_C voidPurgePointerEvents()
IMPORT_C voidRedrawReady(TRequestStatus *)
IMPORT_C voidRedrawReadyCancel()
IMPORT_C voidRegisterEffect(TInt, TInt, const TFileName &, const TFileName &, const TFileName &, TUint, TBitFlags)
IMPORT_C TIntRegisterSurface(TInt, const TSurfaceId &)
IMPORT_C TIntRequestOffEvents(TBool, RWindowTreeNode *)
IMPORT_C TIntResourceCount()
IMPORT_C TIntRestoreDefaultHotKey(THotKey)
IMPORT_C voidSendEffectCommand(TInt, const TDesC8 &)
IMPORT_C TIntSendEventToAllWindowGroups(const TWsEvent &)
IMPORT_C TIntSendEventToAllWindowGroups(TInt, const TWsEvent &)
IMPORT_C TIntSendEventToOneWindowGroupsPerClient(const TWsEvent &)
IMPORT_C TIntSendEventToWindowGroup(TInt, const TWsEvent &)
IMPORT_C TIntSendMessageToAllWindowGroups(TUid, const TDesC8 &)
IMPORT_C TIntSendMessageToAllWindowGroups(TInt, TUid, const TDesC8 &)
IMPORT_C TIntSendMessageToWindowGroup(TInt, TUid, const TDesC8 &)
IMPORT_C TBoolSetAutoFlush(TBool)
IMPORT_C voidSetBackgroundColor(TRgb)
IMPORT_C voidSetBufferSizeL(TInt)
IMPORT_C TIntSetClientCursorMode(TPointerCursorMode)
IMPORT_C TIntSetCloseProximityThresholds(TInt, TInt)
IMPORT_C TIntSetCustomTextCursor(TInt, const TArray< TSpriteMember > &, TUint, TCustomTextCursorAlignment)
IMPORT_C voidSetDefaultFadingParameters(TUint8, TUint8)
IMPORT_C voidSetDefaultSystemPointerCursor(TInt)
IMPORT_C TIntSetDoubleClick(const TTimeIntervalMicroSeconds32 &, TInt)
IMPORT_C TIntSetFocusScreen(TInt)
IMPORT_C TIntSetHighPressureThresholds(TInt, TInt)
IMPORT_C TIntSetHotKey(THotKey, TUint, TUint, TUint)
IMPORT_C TIntSetKeyboardRepeatRate(const TTimeIntervalMicroSeconds32 &, const TTimeIntervalMicroSeconds32 &)
IMPORT_C voidSetMaxBufferSizeL(TInt)
IMPORT_C TIntSetModifierState(TEventModifier, TModifierState)
IMPORT_C voidSetPointerCursorArea(const TRect &)
IMPORT_C voidSetPointerCursorArea(TInt, const TRect &)
IMPORT_C voidSetPointerCursorMode(TPointerCursorMode)
IMPORT_C TIntSetPointerCursorPosition(const TPoint &)
IMPORT_C voidSetShadowVector(const TPoint &)
IMPORT_C TIntSetSystemFaded(TBool)
IMPORT_C TIntSetSystemFaded(TBool, TUint8, TUint8)
IMPORT_C TIntSetSystemPointerCursor(const RWsPointerCursor &, TInt)
IMPORT_C TIntSetWindowGroupOrdinalPosition(TInt, TInt)
IMPORT_C TPointShadowVector()
IMPORT_C voidSimulateKeyEvent(TKeyEvent)
IMPORT_C voidSimulateRawEvent(TRawEvent)
IMPORT_C voidSyncMsgBuf()
IMPORT_C voidSystemInfo(TInt &, SSystemInfo &)
IMPORT_C voidTestWrite(TInt, TInt, const TAny *, TInt)
IMPORT_C voidTestWriteReply(TInt, TInt, const TAny *, TInt)
IMPORT_C TIntTestWriteReplyByProvidingRemoteReadAccess(TInt, TInt, const TDesC8 &, const TDesC8 &)
IMPORT_C TIntTestWriteReplyByProvidingRemoteReadAccess(TInt, TInt, const TDesC8 &, const TDesC16 &)
IMPORT_C voidTestWriteReplyP(TInt, TInt, const TAny *, TInt, TDes8 *)
IMPORT_C voidUnregisterAllEffects()
IMPORT_C voidUnregisterSurface(TInt, const TSurfaceId &)
IMPORT_C TVersionVersion()
IMPORT_C TIntWindowGroupList(CArrayFixFlat< TInt > *)
IMPORT_C TIntWindowGroupList(RArray< TWindowGroupChainInfo > *)
IMPORT_C TIntWindowGroupList(TInt, CArrayFixFlat< TInt > *)
IMPORT_C TIntWindowGroupList(TInt, RArray< TWindowGroupChainInfo > *)
IMPORT_C TIntWindowGroupList(CArrayFixFlat< TInt > *, TInt, TInt)
Inherited Attributes
MWsClientClass::iBuffer
MWsClientClass::iWsHandle
RHandleBase::iHandle
Inherited Enumerations
RHandleBase:TAttributes
RSessionBase:TAttachMode
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
RHandleBase::Attributes()const
RHandleBase::BTraceId()const
RHandleBase::DoExtendedClose()
RHandleBase::Duplicate(const RThread &,TOwnerType)
RHandleBase::FullName()const
RHandleBase::FullName(TDes &)const
RHandleBase::Handle()const
RHandleBase::HandleInfo(THandleInfo *)
RHandleBase::Name()const
RHandleBase::NotifyDestruction(TRequestStatus &)
RHandleBase::Open(const TFindHandleBase &,TOwnerType)
RHandleBase::OpenByName(const TDesC &,TOwnerType,TInt)
RHandleBase::RHandleBase()
RHandleBase::RHandleBase(TInt)
RHandleBase::SetHandle(TInt)
RHandleBase::SetHandleNC(TInt)
RSessionBase::CreateSession(RServer2,const TVersion &)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TRequestStatus *)
RSessionBase::Open(RMessagePtr2,TInt,TOwnerType)
RSessionBase::Open(RMessagePtr2,TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Open(TInt,TOwnerType)
RSessionBase::Open(TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Send(TInt)const
RSessionBase::Send(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt)const
RSessionBase::SendReceive(TInt,TRequestStatus &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSessionBase::SetReturnedHandle(TInt)
RSessionBase::SetReturnedHandle(TInt,RHandleBase &)
RSessionBase::SetReturnedHandle(TInt,const TSecurityPolicy &)
RSessionBase::ShareAuto()
RSessionBase::ShareProtected()

Detailed Description

Window server session.

The session between the client and the window server can be used to mediate asynchronous events, for client interface control and for system control. A description of each of these capabilities is given below.

Mediating asynchronous events:

Primarily, the session mediates asynchronous events to the user. Three event streams are available: the standard event stream which all applications must use; the redraw event stream which must be used by all applications except those which exclusively use backed-up windows; and the priority key event stream which may be used for abort keys and the like for specialist applications.

All these events are mediated as standard asynchronous services. Typical window server client programs encapsulate each service they require in an active object whose RunL() identifies the event and calls the appropriate member function of a class associated with an application framework, or a window.

Client interface control:

The client's interface with the window server has several aspects, each of which is controlled through the window server session.

Flushing defines how requests to the window server are handled.

System control:

Many system-wide settings may be controlled through the window server session. Typically, these functions are only used by the system shell and its associated sessions/applications. They include: auto-repeat and double-click, querying all window groups in the system, setting the default shadow vector, setting the system pointer cursors, counting resources used by the window server (this is only useful for debugging checks), getting and setting the state of the modifier keys (for instance Shift and Ctrl), setting the window server background colour, getting and setting thresholds for window server generated pointer events.

Member Enumeration Documentation

Enum anonymous

EnumeratorValueDescription
ESystemInfoArraySize16

Enum TComputeMode

Compute mode flags.

When a window group takes focus or loses it, the window server can boost its client's thread or process priority to provide a better response to the user. How it alters the priority is determined by the current compute mode of the client.

See also: ComputeMode()

EnumeratorValueDescription
EPriorityControlDisabled

Client priority is permanently set to its current level. It is not altered or set by the windowing system if the focus changes.

Thus if ComputeMode() is called with this flag when a client is in the foreground, it will subsequently have foreground priority even if it is in the background.

EPriorityControlComputeOn

Client process's priority is always set to EPriorityBackground.

EPriorityControlComputeOff

Client process's priority is set to EPriorityForeground when the window group takes focus, and set to EPriorityBackground when it loses focus.

This is the default behaviour.

Enum TCustomTextCursorAlignment

The vertical alignment of a custom text cursor sprite.

One of these values must be set, see SetCustomTextCursor(). This value also determines which part of each sprite member bitmap is clipped when the cursor's TTextCursor::EFlagClipVertical flag is set.

EnumeratorValueDescription
ECustomTextCursorAlignTop

The y-origin of each sprite member bitmap is aligned with the top of the line.

ECustomTextCursorAlignBaseline

The y-origin of each sprite member bitmap is aligned with the baseline of the line.

ECustomTextCursorAlignBottom

The y-origin of each sprite member bitmap is aligned with the bottom of the line.

Enum TLoggingCommand

Window server logging commands passed to LogCommand().

See also: RWsSession::LogCommand()

EnumeratorValueDescription
ELoggingEnable

Enables logging.

ELoggingDisable

Disables logging.

ELoggingStatusDump

Logs the current status of all the windows in the tree, even if logging is not currently enabled.

ELoggingHeapDump

Logs information about the window server's heap size and usage, even if logging is not currently enabled.

Constructor & Destructor Documentation

RWsSession ( )

IMPORT_CRWsSession()

Default C++ constructor.

Constructs an uninitialised window server session. Note that it does not establish a connection to the window server - this must be done explicitly by calling the session's Connect() function. Before Connect() is called, no corresponding session object exists in the server, and the RWsSession contains no meaningful handle.

Member Function Documentation

ClaimSystemPointerCursorList ( )

IMPORT_C TIntClaimSystemPointerCursorList()

Claims the system pointer cursor list.

You must call this function before you can call SetSystemPointerCursor() or ClearSystemPointerCursor().

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

See also: FreeSystemPointerCursorList()

Return Value
KErrNone if successful, KErrInUse if another client is already using the system pointer cursor list, otherwise another of the system-wide error codes.
Capability
WriteDeviceData

ClearAllRedrawStores ( )

IMPORT_C voidClearAllRedrawStores()

Clear the redraw store for all windows in the system. By default Windows will record the drawing commands used during a redraw and re-use them later if the window needs to be redrawn. Calling this function will cause all these server-side stores to be thrown away, redraw requests will then be sent to all client-side windows. Visible windows will receive them first.

In most cases you should be using RWindow::ClearRedrawStore instead of this function.

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

ClearDefaultSystemPointerCursor ( )

IMPORT_C voidClearDefaultSystemPointerCursor()

Clears the default system pointer cursor.

This sets the pointer to the current default system pointer cursor to NULL.

Panic Codes
WSERV42 If this function is called by a client other than the owner of the system pointer cursor list.

ClearHotKeys ( THotKey )

IMPORT_C TIntClearHotKeys(THotKeyaType)

Clears all mappings for the specified hotkey, including the default mapping.

Hotkeys allow standard functions to be performed by application-defined key combinations.

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

See also: SetHotKey() RestoreDefaultHotKey()

Parameters
aTypeThe hot key to be cleared
Return Value
KErrNone if successful, otherwise one of the system-wide error codes.
Capability
SwEvent

ClearSystemPointerCursor ( TInt )

IMPORT_C voidClearSystemPointerCursor(TIntaCursorNumber)

Clears a system pointer cursor from the list.

Before calling this function, the client must first gain access to the list by calling ClaimSystemPointerCursorList().

Parameters
aCursorNumberCursor number to clear

Close ( )

IMPORT_C voidClose()

Reimplemented from RHandleBase::Close()

Closes the window server session.

This function cleans up all resources in the RWsSession and disconnects it from the server. Prior to disconnecting from the window server, the client-side window server buffer is destroyed without being flushed. This function should be called when the RWsSession is no longer needed - normally just before it is destroyed.

ComputeMode ( TComputeMode )

IMPORT_C voidComputeMode(TComputeModeaMode)

Sets the mode used to control process priorities.

The default window server behaviour is that the application that owns the window with keyboard focus gets foreground process priority (EPriorityForeground) while all other clients get background priority (EPriorityBackground). This function can be used to over-ride this default behaviour, as discussed in TComputeMode.

Note:

Unlike real Symbian phones, the Emulator runs on a single process. As a result, on the Emulator this function sets the priority of individual threads rather than of processes. The values used for thread priorities are EPriorityLess instead of EPriorityBackground, and EPriorityNormal instead of EPriorityForeground.

Parameters
aModeThe compute mode.

Connect ( )

IMPORT_C TIntConnect()

Connects the client session to the window server.

Connect() should be the first function called on an RWsSession object after it is created. The function establishes a connection to the window server, creating a corresponding session object in the server. Each session has one and only one connection to the server. Attempting to call Connect() when a connection has already been made will cause a panic.

After a connection has been successfully established, all events are delivered to the client application through the RWsSession object.

Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

Connect ( RFs & )

IMPORT_C TIntConnect(RFs &aFileServer)

Connects the client session to the window server using pre constructed file server session.

Connect() should be the first function called on an RWsSession object after it is created. The function establishes a connection to the window server, creating a corresponding session object in the server. Each session has one and only one connection to the server. Attempting to call Connect() when a connection has already been made will cause a panic.

After a connection has been successfully established, all events are delivered to the client application through the RWsSession object.

Parameters
aFileServerA fully constructed file server session
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

DebugInfo ( TInt, TInt )

IMPORT_C TIntDebugInfo(TIntaFunction,
TIntaParam = 0
)const

DebugInfo ( TInt, TDes8 &, TInt )

IMPORT_C TIntDebugInfo(TIntaFunction,
TDes8 &aReturnBuf,
TIntaParam = 0
)const

EnableWindowSizeCacheL ( )

IMPORT_C voidEnableWindowSizeCacheL()
Enables client side cache of window size to reduce client-server activity triggered by calls to RWindowBase::Size()
Leave Codes
KErrNoMemoryCould not allocate the required memory.

EventReady ( TRequestStatus * )

IMPORT_C voidEventReady(TRequestStatus *aStat)

Requests standard events from the window server.

Standard events include all events except redraws and priority key events.

The client application will typically handle the completed request using the RunL() function of an active object, and in this case the request status aStat should be the iStatus member of that CActive object.

Notes:

  • The active object runs when an event is waiting. You should call GetEvent() in the RunL() function to get the event.

  • Because this function is asynchronous, there is no guarantee that the Window Server will process the request before the function returns. However, on single core systems it is unusual for this function to return before the Window Server has processed the request, because the client generally runs in a lower priority thread than the Window Server. You should therefore expect the use of this function to give rise to different behaviour between single and multicore systems.

See also: CActive GetEvent()

Parameters
aStatRequest status. On successful completion contains KErrNone, otherwise another of the system-wide error codes.

EventReadyCancel ( )

IMPORT_C TIntEventReadyCancel()

Cancels a request for standard events from the window server.

This request was made using EventReady().

The client application will typically use an active object to handle standard events, and this function should be called from the active object's DoCancel() function.

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

See also: EventReady()

Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

FetchMessage ( TUid &, TPtr8 &, const TWsEvent & )

IMPORT_C TIntFetchMessage(TUid &aUid,
TPtr8 &aParams,
const TWsEvent &aMessageEvent
)const

Called by the client in response to an EEventMessageReady event to receive the message data.

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

Parameters
aUidA UID which uniquely identifies the session sending the message.
aParamsThe message data. An unlimited amount of data can be passed in this argument.
aMessageEventThe event sent from the server to the client to identify the message.
Return Value
KErrNone if successful, KErrNoMemory if there is insufficient memory for the message data, otherwise another of the system-wide error codes.

FindWindowGroupIdentifier ( TInt, const TDesC &, TInt )

IMPORT_C TIntFindWindowGroupIdentifier(TIntaPreviousIdentifier,
const TDesC &aMatch,
TIntaOffset = 0
)const

Gets all window groups whose names match a given string, which can contain wildcards.

An example use of this function might be to find all the currently running instances of a particular application, assuming that the window group name contains the application name. An optional argument, aOffset, specifies the number of characters to be ignored at the beginning of the window group name. As several window group names may match the given string, and the function can return only one at a time, there is an argument, aPreviousIdentifier, which gives the identifier for the previous match that was returned. In other words, it means, "get me the next match after this one." The first time the function is called, give 0 as the previous identifier.

Matching is done using TDesC::MatchF(), which does a folded match. Wildcards '*' and '?' can be used to denote one or more characters and exactly one character, respectively. Windows are searched in front to back order.

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

Parameters
aPreviousIdentifierIdentifier of the last window group returned. If the value passed is not a valid identifier, the function returns KErrNotFound.
aMatchString to match window group name against: may contain wildcards
aOffsetThe first aOffset characters of the window group name are ignored when doing the match.
Return Value
The next window group, after the one identified by aPreviousIdentifier, whose name matches aMatch. KErrNotFound if no window group matched or aPreviousIdentifier was not a valid identifier.

FindWindowGroupIdentifier ( TInt, TThreadId )

IMPORT_C TIntFindWindowGroupIdentifier(TIntaPreviousIdentifier,
TThreadIdaThreadId
)const

Gets the identifiers of window groups belonging to a client which is owned by a thread with the specified thread ID.

The thread may own more than one window group, so the identifier returned is the one after aPreviousIdentifier. The first time the function is called, use 0 for the previous identifier.

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

Parameters
aPreviousIdentifierIdentifier returned by previous call
aThreadIdThread owning the window group or groups.
Return Value
Next window group identifier after the one identified by aPreviousIdentifier

Finish ( )

IMPORT_C TIntFinish()

Blocks until the rendering pipeline signals completion.

Return Value
KErrNone if successful

Flush ( )

IMPORT_C voidFlush()

Sends all pending commands in the buffer to the window server.

Delivering a command to the window server requires a context switch, and so it is more efficient to deliver several commands in one go. Hence all client commands are normally first placed into a buffer for delivery to the window server.

The buffer is delivered when it gets full, or when a command that returns a value is called (there are a few exceptions to this), or when this function is called.

Note: this function is called when a prompt response is required from the window server, e.g. after doing some drawing.

See also: RWsSession::SetAutoFlush() RWsSession::SetBufferSizeL() RWsSession::SetMaxBufferSizeL()

FreeSystemPointerCursorList ( )

IMPORT_C voidFreeSystemPointerCursorList()

Releases the system pointer cursor list and deletes all the entries in it.

A client should call this function when it no longer needs the system pointer cursor list.

GetBackgroundColor ( )

IMPORT_C TRgbGetBackgroundColor()const

Gets the window server's background colour.

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

Return Value
Background colour

GetColorModeList ( CArrayFixFlat< TInt > * )

IMPORT_C TIntGetColorModeList(CArrayFixFlat< TInt > *aModeList)const

Gets the list of available colour modes.

Note that this function should usually be called within User::LeaveIfError(). The only time that an error can be generated is when the array gets resized to the number of display modes. Thus if you make the size of your array equal to the maximum number of display modes over all hardware (this is the number of different values in TDisplayMode) then this function will never leave.

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

Parameters
aModeListOn return, contains a TDisplayMode entry for each of the available display modes. Note that the array's contents are deleted prior to filling with display mode information.
Return Value
The number of color modes if the parameter is passed NULL. Otherwise KErrNone or KErrNoMemory.

GetColorModeList ( TInt, CArrayFixFlat< TInt > * )

IMPORT_C TIntGetColorModeList(TIntaScreenNumber,
CArrayFixFlat< TInt > *aModeList
)const

Gets the list of available colour modes on a particular screen.

Note that this function should usually be called within User::LeaveIfError(). The only time that an error can be generated is when the array gets resized to the number of display modes. Thus if you make the size of your array equal to the maximum number of display modes over all hardware (this is the number of different values in TDisplayMode) then this function will never leave.

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

Parameters
aScreenNumberspecifies the screen.
aModeListOn return, contains a TDisplayMode entry for each of the available display modes. Note that the array's contents are deleted prior to filling with display mode information.
Return Value
The number of color modes if the parameter is passed NULL. Otherwise KErrNone or KErrNoMemory.

GetDefModeMaxNumColors ( TInt &, TInt & )

IMPORT_C TDisplayModeGetDefModeMaxNumColors(TInt &aColor,
TInt &aGray
)const

Gets the number of colours available in the richest supported colour mode, the number of greys available in the richest grey mode, and returns the default display mode.

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

Parameters
aColorThe number of colours in the richest supported colour mode.
aGrayThe number of greys in the richest supported grey mode.
Return Value
The default display mode.

GetDefModeMaxNumColors ( TInt, TInt &, TInt & )

IMPORT_C TDisplayModeGetDefModeMaxNumColors(TIntaScreenNumber,
TInt &aColor,
TInt &aGray
)const

Gets the number of colours available in the richest supported colour mode, the number of greys available in the richest grey mode, and returns the default display mode, on the specified screen.

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

Parameters
aScreenNumberspecifies the screen.
aColorThe number of colours in the richest supported colour mode.
aGrayThe number of greys in the richest supported grey mode.
Return Value
The default display mode.

GetDefaultOwningWindow ( )

IMPORT_C TIntGetDefaultOwningWindow()const

Gets the identifier of the current default owning window group.

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

Return Value
Identifier of current default owning window group. Returns 0 if there isn't one.

GetDefaultOwningWindow ( TInt )

IMPORT_C TIntGetDefaultOwningWindow(TIntaScreenNumber)const

Gets the identifier of the current default owning window group on a specified screen.

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

Parameters
aScreenNumberspecifies the screen.
Return Value
Identifier of current default owning window group on the specified screen. Returns 0 if there isn't one.

GetDoubleClickSettings ( TTimeIntervalMicroSeconds32 &, TInt & )

IMPORT_C voidGetDoubleClickSettings(TTimeIntervalMicroSeconds32 &aInterval,
TInt &aDistance
)const

Gets the current system-wide settings for pointer double clicks.

Double click distances are measured in pixels as the sum of the X distance moved and the Y distance moved between clicks. For example: a first click at 10, 20 and a second click at 13,19 gives a distance of (13-10)+(21-20) = 4.

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

See also: SetDoubleClick()

Parameters
aIntervalMaximum interval between clicks that constitutes a double click
aDistanceMaximum distance between clicks that constitutes a double click

GetEnterCloseProximityThreshold ( )

IMPORT_C TIntGetEnterCloseProximityThreshold()const

See also: TPointerEvent::EEnterCloseProximity To become publishedAll with WSERV NGA APIs To become released with WSERV NGA APIs

Return Value
Z coordinate threshold value for TPointerEvent::EEnterCloseProximity events.

GetEnterHighPressureThreshold ( )

IMPORT_C TIntGetEnterHighPressureThreshold()const

See also: TPointerEvent::EEnterHighPressure To become publishedAll with WSERV NGA APIs To become released with WSERV NGA APIs

Return Value
Z coordinate threshold value for TPointerEvent::EEnterHighPressure events

GetEvent ( TWsEvent & )

IMPORT_C TIntGetEvent(TWsEvent &aEvent)const

Gets a standard event from the session for processing.

The type of event returned by GetEvent() may be any of those listed in TEventCode. To access the data within an event, the event should be converted to the appropriate type, using functions provided by the TWsEvent class. TWsEvent also provides a function to find out the type of the event.

Notes:

It is possible that the returned event is of type EEventNull. Clients should normally ignore these events.

This function should only be called in response to notification that an event has occurred, otherwise the client will be panicked.

This function would normally be called in the RunL() function of an active object which completes with the EventReady() function's request status.

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

See also: TEventCode EventReady()

Parameters
aEventOn return, contains the event that occurred.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes. Note: KErrNoMemory - means that a null event will be returned, because it is impossible to get an event from the Wserv message queue. KErrEof - means that a null event will be returned, because there is no events in the Wserv message queue.

GetEvent ( CWsEventWithData & )

IMPORT_C TIntGetEvent(CWsEventWithData &aEventWithData)const

Called instead of the previous GetEvent(TWsEvent) API if the client needs/wants to take advantage of increased event size.

All events can be read from this API so there is no need to also call GetEvent(TWsEvent). One example of usage of the increased event size is for grouped multiple pointer events i.e. sending multiple point events to the client in one API call.

Parameters
aEventWithDataThe event and it's data.
Return Value
KErrNone if successful, KErrNoMemory if there is insufficient memory for the message data, otherwise another of the system-wide error codes.

GetExitCloseProximityThreshold ( )

IMPORT_C TIntGetExitCloseProximityThreshold()const

See also: TPointerEvent::EExitCloseProximity To become publishedAll with WSERV NGA APIs To become released with WSERV NGA APIs

Return Value
Z coordinate threshold value for TPointerEvent::EExitCloseProximity events

GetExitHighPressureThreshold ( )

IMPORT_C TIntGetExitHighPressureThreshold()const

See also: TPointerEvent::EExitHighPressure To become publishedAll with WSERV NGA APIs To become released with WSERV NGA APIs

Return Value
Z coordinate threshold value for TPointerEvent::EExitHighPressure events

GetFocusScreen ( )

IMPORT_C TIntGetFocusScreen()const

Get focus screen

Return Value
The screen number of current focus screen

GetFocusWindowGroup ( )

IMPORT_C TIntGetFocusWindowGroup()const

Gets the identifier of the window group that currently has the keyboard focus.

Note: this might not necessarily be the front-most window group, as window groups can disable keyboard focus.

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

Return Value
Identifier of window group with keyboard focus.

GetFocusWindowGroup ( TInt )

IMPORT_C TIntGetFocusWindowGroup(TIntaScreenNumber)const

Gets the identifier of the window group on a specified screen that currently has the keyboard focus.

Note: this might not necessarily be the front-most window group, as window groups can disable keyboard focus.

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

Parameters
aScreenNumberspecifies the screen.
Return Value
Identifier of window group with keyboard focus.

GetGraphicMessage ( TDes8 & )

voidGetGraphicMessage(TDes8 &aData)const

GetKeyboardRepeatRate ( TTimeIntervalMicroSeconds32 &, TTimeIntervalMicroSeconds32 & )

IMPORT_C voidGetKeyboardRepeatRate(TTimeIntervalMicroSeconds32 &aInitialTime,
TTimeIntervalMicroSeconds32 &aTime
)const

Gets the current system-wide settings for the keyboard repeat rate.

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

See also: SetKeyboardRepeatRate()

Parameters
aInitialTimeTime before first repeat key event
aTimeTime between subsequent repeat key events

GetModifierState ( )

IMPORT_C TIntGetModifierState()const

Gets the state of the modifier keys.

The state of each modifier key (defined in TEventModifier) is returned in a bitmask.

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

See also: TEventModifier

Return Value
Modifier state

GetPriorityKey ( TWsPriorityKeyEvent & )

IMPORT_C voidGetPriorityKey(TWsPriorityKeyEvent &aEvent)const

Gets the completed priority key event from the window server session.

Priority key events are typically used for providing "Abort" or "Escape" keys for an application.

This function is similar to GetEvent(), except that it returns a TWsPriorityKeyEvent instead of a TWsEvent.

Note: this should only be called after notification that a priority key event has occurred.

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

See also: PriorityKeyReady() PriorityKeyReadyCancel()

Parameters
aEventOn return, contains the priority key event that occurred.

GetRedraw ( TWsRedrawEvent & )

IMPORT_C voidGetRedraw(TWsRedrawEvent &aEvent)

Gets the redraw event from the session.

This function is similar to GetEvent(), except that the event is returned as a TWsRedrawEvent, and hence there is no need to convert it from a TWsEvent.

The function should only be called after notification that a redraw is waiting.

It always causes a flush of the window server buffer.

See also: RedrawReady() GetEvent() CActive

Parameters
aEventOn return, contains the redraw event that occurred

GetWindowGroupClientThreadId ( TInt, TThreadId & )

IMPORT_C TIntGetWindowGroupClientThreadId(TIntaIdentifier,
TThreadId &aThreadId
)const

Gets the thread ID of the client that owns the window group specified by the window group identifier.

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

Parameters
aIdentifierThe window group identifier.
aThreadIdOn return, contains the thread ID.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

GetWindowGroupHandle ( TInt )

IMPORT_C TIntGetWindowGroupHandle(TIntaIdentifier)const

Gets the handle of the window specified by the window group identifier.

This is the handle that was passed as an argument to RWindowGroup::Construct().

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

Parameters
aIdentifierThe window group identifier.
Return Value
Handle of the window group

GetWindowGroupNameFromIdentifier ( TInt, TDes & )

IMPORT_C TIntGetWindowGroupNameFromIdentifier(TIntaIdentifier,
TDes &aWindowName
)const

Gets the name of a window group from its identifier.

Using the list of identifiers returned by WindowGroupList(), it is possible to get the names of all window groups in the system. Note that window names are a zero length string by default.

Note that the window group name must have been previously set using RWindowGroup::SetName() to contain a meaningful value.

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

Parameters
aIdentifierThe identifier of the window group whose name is to be inquired.
aWindowNameOn return, contains the window group name.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

GetWindowGroupOrdinalPriority ( TInt )

IMPORT_C TIntGetWindowGroupOrdinalPriority(TIntaIdentifier)const

Gets a window group's priority.

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

Parameters
aIdentifierThe window group identifier.
Return Value
The window group priority.

GraphicAbortMessage ( TInt )

voidGraphicAbortMessage(TIntaError)

GraphicFetchHeaderMessage ( )

TInt GraphicFetchHeaderMessage()

GraphicMessageCancel ( )

voidGraphicMessageCancel()

GraphicMessageReady ( TRequestStatus * )

voidGraphicMessageReady(TRequestStatus *aStat)

HeapCount ( )

IMPORT_C TIntHeapCount()const

Gets the heap count.

This function calls RHeap::Count() on the window server's heap, after throwing away all the temporary objects allocated for each window.

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

Return Value
The window server's heap count.

HeapSetBurstFail ( TInt, TInt, TInt )

IMPORT_C voidHeapSetBurstFail(TIntaTAllocFail,
TIntaRate,
TIntaBurst
)

Sets the heap failure burst mode in the window server.

The release version of the base does not support simulated heap failure functionality, and the result of this function is additional error messages. In the debug version the clients are notified of the simulated failure and handle it. See RHeap::__DbgSetBurstAllocFail() for more information.

Note:

It is unlikely, but possible to create a ROM with a mixture of Release and Debug versions of the Base and Window Server DLLs, which results in different behaviour to that described above. If you run a debug Window Server with a release version of the Base, then calling this function will result in neither extra error messages (e.g. EDrawingRegion) nor simulated heap failures. However if you have a release Window Server with a debug Base then you will get both simulated heap failures and the extra error messages.

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

See also: RHeap::__DbgSetBurstAllocFail()

Parameters
aTAllocFailA value from the RHeap::TAllocFail enumeration which indicates how to simulate heap allocation failure.
aRateThe rate of failure; when aType is RHeap::EDeterministic, heap allocation fails every aRate attempt.
aBurstThe number of consecutive allocations that should fail.
Capability
WriteDeviceData

HeapSetFail ( TInt, TInt )

IMPORT_C voidHeapSetFail(TIntaTAllocFail,
TIntaValue
)

Sets the heap failure mode in the window server.

The release version of the base does not support simulated heap failure functionality, and the result of this function is additional error messages. In the debug version the clients are notified of the simulated failure and handle it. See RHeap::__DbgSetAllocFail() for more information.

Note:

It is unlikely, but possible to create a ROM with a mixture of Release and Debug versions of the Base and Window Server DLLs, which results in different behaviour to that described above. If you run a debug Window Server with a release version of the Base, then calling this function will result in neither extra error messages (e.g. EDrawingRegion) nor simulated heap failures. However if you have a release Window Server with a debug Base then you will get both simulated heap failures and the extra error messages.

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

See also: RHeap::__DbgSetAllocFail()

Parameters
aTAllocFailA value from the RHeap::TAllocFail enumeration which indicates how to simulate heap allocation failure.
aValueThe rate of failure; when aType is RHeap::EDeterministic, heap allocation fails every aRate attempt
Capability
WriteDeviceData

IndicateAppOrientation ( TRenderOrientation )

IMPORT_C voidIndicateAppOrientation(TRenderOrientationaOrientation)

Application informs window server the orientation of rendering it intends to use

Parameters
aOrientationThe orientation the application intends to use

LogCommand ( TLoggingCommand )

IMPORT_C voidLogCommand(TLoggingCommandaCommand)

Allows the window server client to enable or disable logging of window server events.

The type of logging that takes place (e.g. whether to file or to serial port) depends on the settings specified in the wsini.ini file.

Clients can also force a dump of the window tree or information about the window server's heap size and usage.

For logging to work, the wsini.ini file has to specify the type of logging required and the DLLs for that type of logging must have been correctly installed. Otherwise, calling this function will have no effect.

Parameters
aCommandThe logging command.

LogMessage ( const TLogMessageText & )

IMPORT_C voidLogMessage(const TLogMessageText &aMessage)

Adds a message to the window server debug log if one is currently in operation.

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

Parameters
aMessageThe text added to the message log.

NumWindowGroups ( )

IMPORT_C TIntNumWindowGroups()const

Gets the total number of window groups currently running in the window server.

This includes all the groups running in all sessions.

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

Return Value
Total number of window groups running in the server

NumWindowGroups ( TInt )

IMPORT_C TIntNumWindowGroups(TIntaPriority)const

Gets the number of window groups of a given window group priority running in all sessions in the window server.

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

Parameters
aPriorityWindow group priority
Return Value
Number of window groups of priority aPriority

NumWindowGroups ( TInt, TInt )

IMPORT_C TIntNumWindowGroups(TIntaScreenNumber,
TIntaPriority
)const

Gets the number of window groups of a given window group priority running on a specified screen

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

Parameters
aScreenNumberspecifies the screen.
aPriorityWindow group priority. EAllPriorities is the enum for all priorities
Return Value
Number of window groups of priority aPriority on the specified screen

NumberOfScreens ( )

IMPORT_C TIntNumberOfScreens()const

Number Of Screens

Return Value
The number of screens on the phone

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

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

Overides the default animation for given app'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.
aPurposeThis override only effects the window/layers owned by the application that have the specified purpose.
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.
Capability
WriteDeviceDataThis API does nothing if the client does not possess required Capability

PasswordEntered ( )

IMPORT_C voidPasswordEntered()

Disables the window server password mode.

This function must be called by the session which owns the password window when the correct machine password has been entered.

Deprecated

PointerCursorArea ( )

IMPORT_C TRectPointerCursorArea()const

Gets the pointer cursor area for the first screen display mode.

This is the area of the screen in which the virtual cursor can be used while in relative mouse mode. While in pen or mouse mode the event co-ordinates are forced to be within this area unless you click outside the drawable area.

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

See also: SetPointerCursorArea()

Return Value
The pointer cursor area for the first screen display mode.

PointerCursorArea ( TInt )

IMPORT_C TRectPointerCursorArea(TIntaScreenSizeMode)const

Gets the pointer cursor area for the specified screen display mode.

This is the area of the screen in which the virtual cursor can be used while in relative mouse mode. While in pen or mouse mode the event co-ordinates are forced to be within this area unless you click outside the drawable area.

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

See also: SetPointerCursorArea()

Parameters
aScreenSizeModeThe screen mode for which the pointer cursor area is required.
Return Value
The pointer cursor area for the specified screen display mode.

PointerCursorMode ( )

IMPORT_C TPointerCursorModePointerCursorMode()const

Gets the current mode for the pointer cursor.

The mode determines which sprite is used for the pointer cursor at any point.

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

Return Value
The current mode for the pointer cursor.

PointerCursorPosition ( )

IMPORT_C TPointPointerCursorPosition()const

Gets the pointer cursor position.

This function allows an application to determine the position of the virtual cursor.

It always causes a flush of the window server buffer.

Please note that on devices with multiple pointers (for example with multipointer screen) the pointer cursor's position will be equal to the last known position of the emulated pointer. More information about the emulated pointer can be found in description of method RWindowBase::EnableAdvancedPointers().

See also: RWindowBase::EnableAdvancedPointers()

Return Value
The position of the virtual cursor.

PreferredSurfaceConfigurationSize ( )

IMPORT_C TIntPreferredSurfaceConfigurationSize()const

Returns the window server's preferred size for the TSurfaceConfiguration object, used for RWindow::SetBackgroundSurface.

Client code is permitted to present any defined version of the TSurfaceConfiguration class, distinguished by its size. If smaller, earlier versions are presented, the server will substitute the stated default values. If later, larger, structures are presented to the server then the additional data will be ignored.

However, by using this method, the client can fine-tune its use of the interface, avoiding generating attribute data that may not be supported, or reduce the options presented to users.

Return Value
The preferred size in bytesShould match one of the TSurfaceConfiguration classes defined in the client's header file, or be larger than them all, indicating a version newer that the client is compiled for.If the server does not support surface configurationReturn KErrNotSupported.

PrepareForSwitchOff ( )

IMPORT_C voidPrepareForSwitchOff()

Prepares for switch off.

This stops the window server heart beat timer if running.

Capability
PowerMgmt

PriorityKeyReady ( TRequestStatus * )

IMPORT_C voidPriorityKeyReady(TRequestStatus *aStat)

Requests priority key events from the window server.

Typically, an client will create an active object for priority key events with a higher priority than the active objects for standard events. The client will then normally handle completed priority key requests in the active object's RunL() function.

As in EventReady(), the request status argument should be the set to the iStatus member of CActive. When priority key events occur, they are obtained using GetPriorityKey().

Notes:

  • Because this function is asynchronous, there is no guarantee that the Window Server will process the request before the function returns. However, on single core systems it is unusual for this function to return before the Window Server has processed the request, because the client generally runs in a lower priority thread than the Window Server. You should therefore expect the use of this function to give rise to different behaviour between single and multicore systems.

See also: PriorityKeyReadyCancel() GetPriorityKey() CActive

Parameters
aStatRequest status. On successful completion contains KErrNone, otherwise another of the system-wide error codes.

PriorityKeyReadyCancel ( )

IMPORT_C voidPriorityKeyReadyCancel()

Cancels a priority key event request.

If active objects are used, this function should be called from the active object's DoCancel() function.

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

See also: PriorityKeyReady() CActive

PurgePointerEvents ( )

IMPORT_C voidPurgePointerEvents()

Removes all pointer events waiting to be delivered to this session.

The events are removed from the event queue without being processed. This might occur, for example, at application startup.

RedrawReady ( TRequestStatus * )

IMPORT_C voidRedrawReady(TRequestStatus *aStat)

Requests redraw events from the window server.

Typically, a client will create an active object for redraw events with a lower priority than the active objects for standard events. The client will then typically handle completed redraw requests in the active object's RunL() function.

As in EventReady(), the request status aStat should be used as the iStatus member of an active object. When a redraw event occurs the active object's RunL() function is called. The redraw event can be obtained by calling GetRedraw() in the RunL().

Notes:

  • Because this function is asynchronous, there is no guarantee that the Window Server will process the request before the function returns. However, on single core systems it is unusual for this function to return before the Window Server has processed the request, because the client generally runs in a lower priority thread than the Window Server. You should therefore expect the use of this function to give rise to different behaviour between single and multicore systems.

See also: RedrawReadyCancel() GetRedraw() CActive

Parameters
aStatThe request status. On successful completion contains KErrNone, otherwise another of the system-wide error codes.

RedrawReadyCancel ( )

IMPORT_C voidRedrawReadyCancel()

Cancels a redraw event request.

If active objects are used, this function should be called from the active object's DoCancel() function.

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

See also: RedrawReady()

RegisterEffect ( TInt, TInt, const TFileName &, const TFileName &, const TFileName &, TUint, TBitFlags )

IMPORT_C voidRegisterEffect(TIntaAction,
TIntaPurpose,
const TFileName &aResourceDir,
const TFileName &aFilenameOutgoing,
const TFileName &aFilenameIncoming,
TUintaAppUid = 0,
TBitFlagsaFlags = 0
)

Sets a specific animation for a particular transition effect.

Transition effect is represented by one of the values of enum TTfxTransitionActions.

An animation is specified by a filename and directory; the file will contain a description of the animation for that transition. In fact each transition can have two animations associated with it, for example an App shut down could have one animation with the old application disappearing and then another animation for the App Launcher (or home screen) appearing.

Animation can be applied to all App's Transition effect or to a specfic App by providing its AppUid.

Parameters
aActionParticular transition to register the animation for.
aPurposeThe purpose of the window.
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.
aAppUidThe Application UID this effect applies to. Set to zero to specify that all apps will use default effect.
aFlagsFlag for the effect. Please see TTfxFlags for values this flag parameter can use.
Capability
WriteDeviceDataThis API does nothing if the client does not possess required Capability

RegisterSurface ( TInt, const TSurfaceId & )

IMPORT_C TIntRegisterSurface(TIntaScreenNumber,
const TSurfaceId &aSurface
)

This function registers a surface for use in composition on the screen associated with this device within this session.

A surface may be registered as a separate step before it is added as a background surface for a window created in the same session and that is displayed on this screen. This then allows content to be provisioned before the surface is displayed for the first time, and to be kept "live" while not assigned to any window.

A surface can be successfully registered in multiple sessions and on multiple screens, but only once for a given combination of session and screen.

The client should call UnregisterSurface when finished with the surface registered using this method. The surface will be automatically unregistered if necessary when the session closes.

Pre-condition
aSurface has been initialized and is compatible with being composited on this device's screen; otherwise the client thread is panicked with code EWservPanicIncompatibleSurface.

aScreenNumber is an acceptable screen number. Otherwise the client thread is panicked with code EWservPanicScreenNumber.

Post-condition
The surface has been successfully registered for use in composition on this device's screen.

The surfaces content is in an undefined state, but the surface remains initialized. This function always causes a flush of the WServ session buffer.

See also: UnregisterSurface

Parameters
aScreenNumberThe screen to which to register.
aSurfaceThe surface to be registered.
Return Value
KErrNone on success or a system-wide error codeKErrNoMemory if registration fails due to low memory.KErrInUse if the surface ID is already registered for this session and screen.

RequestOffEvents ( TBool, RWindowTreeNode * )

IMPORT_C TIntRequestOffEvents(TBoolaOn,
RWindowTreeNode *aWin = 0
)

Requests the window server to send OFF events to a window.

After calling this function, the window server sends OFF events to the window when an event occurs which requires power down, rather than handling powering down itself.

Notes:

Any client can ask for OFF events, but only one window in the system can be set to receive them. If this function is called when another window is set to receive OFF events then the client will be panicked. The exception is the shell, which is allowed to take receipt of OFF events from other clients.

The window server identifies the shell client by comparing the process name of the client with the process name of the shell. Only the first client created by the shell is guaranteed to have the extra shell client privileges.

If the shell dies or terminates just before the action requiring power down happens then the window server will handle it rather than passing it on to the shell.

The window server has a queue of messages that it is waiting to send to clients. If the shell's client's queue is full and the window server cannot make room for the OFF message then it will power down the machine itself.

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

Parameters
aOnETrue to get the window server to send EEventShellSwitchOff messages to the shell (rather than powering down). EFalse makes the window server switch back to powering down the machine itself.
aWinThe handle to the window or window group of the shell to which the message is to be sent. This may be NULL only if aOn=EFalse, in other words, the window server is handling power down itself. If aOn=ETrue then this must not be NULL, or the Window Server will panic the shell. Note that as far as the window server is concerned the handle must exist when this function is called.
Return Value
KErrNone if successful, otherwise one of the system-wide error codes.
Panic Codes
WSERV51 aOn is true, but no window was specified (aWin is NULL).
Capability
PowerMgmt

ResourceCount ( )

IMPORT_C TIntResourceCount()const

Gets the number of objects that the server has allocated for that client.

This function can be used to check that the client has correctly cleaned up all of its objects.

It always causes a flush of the window server buffer.

Return Value
The number of resources allocated to the client.

RestoreDefaultHotKey ( THotKey )

IMPORT_C TIntRestoreDefaultHotKey(THotKeyaType)

Restores the default mapping for a hot key.

The function clears current mappings for a hot key and restores the default mapping. See THotKey for the default.

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

See also: ClearHotKeys()

Parameters
aTypeThe hot key to restore to its default value
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

SendEffectCommand ( TInt, const TDesC8 & )

IMPORT_C voidSendEffectCommand(TIntaTfxCmd,
const TDesC8 &aTfxCmdData = KNullDesC8
)
Set the WServ session specific effect data or execute commands to TFX Render Stage. The data or command passed by the client API will be directed to MWsTfxApplication::SendEffectCommand. TFX Render Stage will accept only TFX application specific commands and data.
Parameters
aTfxCmdTFX Render Stage command.
aTfxCmdDataStructure related to the specified value of aTfxCmd, the default value is KNullDesC8.
Capability
WriteDeviceDataOnly if aTfxCmd has value ETfxCmdEnableAllTransitions or ETfxCmdDisableAllTransitions

SendEventToAllWindowGroups ( const TWsEvent & )

IMPORT_C TIntSendEventToAllWindowGroups(const TWsEvent &aEvent)

Sends the specified event to all existing window groups.

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

Deprecated
Parameters
aEventThe event to be sent to all window groups.
Return Value
KErrNone if successful, KErrPermissionDenied if the client does not have the required capability, KErrNoMemory if there is not enough room to add the event to all the required event queues (although it may have been added to some of them) and otherwise another of the system-wide error codes.
Capability
SwEventRequired when aEvent.Type() < EEventUser

SendEventToAllWindowGroups ( TInt, const TWsEvent & )

IMPORT_C TIntSendEventToAllWindowGroups(TIntaPriority,
const TWsEvent &aEvent
)

Sends the specified event to all window groups with the specified priority.

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

Deprecated
Parameters
aPriorityThe priority which window groups must have to be sent the message.
aEventThe event to be sent to the specified window groups.
Return Value
KErrNone if successful, KErrPermissionDenied if the client does not have the required capability, KErrNoMemory if there is not enough room to add the event to all the required event queues (although it may have been added to some of them) and otherwise another of the system-wide error codes.
Capability
SwEventRequired when aEvent.Type() < EEventUser

SendEventToOneWindowGroupsPerClient ( const TWsEvent & )

IMPORT_C TIntSendEventToOneWindowGroupsPerClient(const TWsEvent &aEvent)
This function always causes a flush of the window server buffer. Deprecated
Capability
SwEventRequired when aEvent.Type() < EEventUser

SendEventToWindowGroup ( TInt, const TWsEvent & )

IMPORT_C TIntSendEventToWindowGroup(TIntaIdentifier,
const TWsEvent &aEvent
)

Sends an event to a window group.

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

Deprecated
Parameters
aIdentifierWindow group identifier.
aEventEvent to send to the window group.
Return Value
KErrNone if successful, KErrPermissionDenied if the client does not have the required capability, KErrNoMemory if there is not enough room to add the event to the event queue and otherwise another of the system-wide error codes.
Capability
SwEventRequired when aEvent.Type() < EEventUser unless the event is for a window group owned by this session.

SendMessageToAllWindowGroups ( TUid, const TDesC8 & )

IMPORT_C TIntSendMessageToAllWindowGroups(TUidaUid,
const TDesC8 &aParams
)

Sends a message to all window groups.

In order to receive messages sent using this function you will need to implement the MCoeMessageObserver interface which is defined in the UI Control Framework API.

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

Deprecated

Parameters
aUidA UID which uniquely identifies the session sending the message.
aParamsThe message data. An unlimited amount of data can be passed in this argument.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

SendMessageToAllWindowGroups ( TInt, TUid, const TDesC8 & )

IMPORT_C TIntSendMessageToAllWindowGroups(TIntaPriority,
TUidaUid,
const TDesC8 &aParams
)

Sends a message to all window groups with the specified priority.

In order to receive messages sent using this function you will need to implement the MCoeMessageObserver interface which is defined in the UI Control Framework API.

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

Deprecated

Parameters
aPriorityThe priority which window groups must have to be sent the message.
aUidA UID which uniquely identifies the session sending the message.
aParamsThe message data. An unlimited amount of data can be passed in this argument.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

SendMessageToWindowGroup ( TInt, TUid, const TDesC8 & )

IMPORT_C TIntSendMessageToWindowGroup(TIntaIdentifier,
TUidaUid,
const TDesC8 &aParams
)
Deprecated

Sends a message to a window group.

The window group will then receive an event of type EEventMessageReady notifying it that a message has been received. The window group can belong to this or another session.

In order to receive messages sent using this function you will need to implement the MCoeMessageObserver interface which is defined in the UI Control Framework API.

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

See also: MCoeMessageObserver

Parameters
aIdentifierThe identifier of the window group to receive the message.
aUidA UID which uniquely identifies the session sending the message.
aParamsThe message data. An unlimited amount of data can be passed in this argument.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

SetAutoFlush ( TBool )

IMPORT_C TBoolSetAutoFlush(TBoolaState)

Sets a session's auto-flush state.

If auto-flush is set to ETrue, the window server buffer is flushed immediately anything is put into it, instead of waiting until it becomes full. This setting is normally used only in a debugging environment.

If the auto-flush state is EFalse, the window server buffer is flushed normally.

See also: RWsSession::Flush() RWsSession::SetBufferSizeL() RWsSession::SetMaxBufferSizeL()

Parameters
aStateETrue to set auto-flushing on, EFalse to disable auto-flushing.
Return Value
Previous auto-flush state

SetBackgroundColor ( TRgb )

IMPORT_C voidSetBackgroundColor(TRgbaColor)

Sets the background colour for the window server.

This background can only be seen in areas of the display that have no windows on them: so for many applications it will never be seen. It affects no other windows.

Parameters
aColorBackground colour

SetBufferSizeL ( TInt )

IMPORT_C voidSetBufferSizeL(TIntaBufSize)

Sets both the buffer size and maximum buffer size for queuing commands to send to the Windows Server. The value should be at least the size of the largest message that will be sent, otherwise a panic of the client may occur.

The minimum possible buffer size is 640 and the maximum possible size is 16384 bytes. The default size of 640 bytes is sufficient for most uses.

Larger buffers can reduce drawing flicker by allowing more drawing commands to be collected in the buffer before being sent to the server.

Smaller buffers conserve system memory.

Can be used to set a minimum buffer size, sufficient for largest drawing command used, before calling RWsSession::SetMaxBufferSizeL() to set a maximum buffer size for queuing commands.

See also: RWsSession::Flush() RWsSession::SetAutoFlush() RWsSession::SetMaxBufferSizeL()

Parameters
aBufSizeThe desired buffer size in bytes, at least the size of largest message to be sent.
Leave Codes
KErrNoMemoryCould not allocate the required memory.
Panic Codes
TW32Panic5 Occurs during the session if a single drawing command is too big to fit in the buffer.

SetClientCursorMode ( TPointerCursorMode )

IMPORT_C TIntSetClientCursorMode(TPointerCursorModeaMode)

Sets the current mode for the pointer cursor.

The mode determines which sprite is used for the pointer cursor at any point. See TPointerCursorMode for more information.

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

See also: TPointerCursorMode

Parameters
aModeThe new mode for the pointer cursor.
Return Value
KErrNone if successful, otherwise returns system wide errors. Returns KErrPermissionDenied if calling thread lacks WriteDeviceData capability
Capability
WriteDeviceData

SetCloseProximityThresholds ( TInt, TInt )

IMPORT_C TIntSetCloseProximityThresholds(TIntaEnterCloseProximityThreshold,
TIntaExitCloseProximityThreshold
)

Sets Z coordinate threshold values for TPointerEvent::EEnterCloseProximity and TPointerEvent::EExitCloseProximity events. As proximity occupies the negative range of Z coordinates, on most platforms threshold values for these events should be specified as negative.

However, all possible Z coordinate values are accepted by this method regardless of the fact that positive Z coordinate values are interpreted as pressure and only negative Z coordinate values are interpreted as proximity. This means that if a particular platform supports an Up pointer state while a pointer is touching the screen, it is possible to base the firing of EnterCloseProximity/ExitCloseProximity events on pressure readings by specifying positive threshold values.

EnterCloseProximity/ExitCloseProximity event generation can be switched off completely by specifying the following thresholds: aEnterCloseProximityThreshold = KMaxTInt, aExitCloseProximityThreshold = KMinTInt.

This method is supposed to be used only by the UI platform or device's configuration tool.

Modified thresholds will be persisted across system reboots in the following HAL attributes: HALData::EPointer3DEnterCloseProximityThreshold, HALData::EPointer3DExitCloseProximityThreshold.

If this method is never called on a particular device, the default threshold values defined by this device's manufacturer are used.

See also: TPointerEvent::EEnterCloseProximity TPointerEvent::EExitCloseProximity HALData::EPointer3DEnterCloseProximityThreshold HALData::EPointer3DExitCloseProximityThreshold To become released with WSERV NGA APIs

Parameters
aEnterCloseProximityThresholda new threshold for TPointerEvent::EEnterCloseProximity to be set, specified as Z coordinate value
aExitCloseProximityThresholda new threshold for TPointerEvent::EExitCloseProximity to be set, specified as Z coordinate value
Return Value
KErrNone if successful, KErrNotSupported if the platform doesn't support threshold values for Close Proximity events, KErrArgument if aEnterCloseProximityThreshold is less than aExitCloseProximityThreshold; when this error occurs, threshold values are not changed.
Capability
WriteDeviceData

SetCustomTextCursor ( TInt, const TArray< TSpriteMember > &, TUint, TCustomTextCursorAlignment )

IMPORT_C TIntSetCustomTextCursor(TIntaIdentifier,
const TArray< TSpriteMember > &aSpriteMemberArray,
TUintaSpriteFlags,
TCustomTextCursorAlignmentaAlignment
)

Adds a custom text cursor to the server's list of cursors.

After adding a custom text cursor, it can be selected for use by calling RWindowGroup::SetTextCursor().

Note that once added, custom text cursors cannot be removed.

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

Parameters
aIdentifierThe unique identifier for the cursor.
aSpriteMemberArrayAn array defining the bitmap(s) that make up the cursor. Typically, this array will contain a single element for a static, non-animated cursor.
aSpriteFlagsFlags affecting the sprite behaviour. For possible values see TSpriteFlags.
aAlignmentThe vertical alignment of the cursor sprite.
Return Value
KErrNone if successful, KErrAlreadyExists if a custom cursor with the specified identifier already exists, or another of the standard system wide error codes.

SetDefaultFadingParameters ( TUint8, TUint8 )

IMPORT_C voidSetDefaultFadingParameters(TUint8aBlackMap,
TUint8aWhiteMap
)

Sets the default fading parameters.

Fading is used to change the colour of windows to be either closer to white or closer to black, so that another window stands out. For example, when displaying a dialogue you could fade all visible windows, then unfade the dialog window. This function sets whether, and the amount by which, faded windows appear closer to white or closer to black.

The white and black mapping values define the range over which colours are re-mapped when a window is faded. If aBlackMap=0 and aWhiteMap=255 then the colours are mapped unchanged. As the two values get closer together, all colours in the faded window becomes more similar - creating the fading effect. When the numbers cross over (so that the black value is greater than the white value) the colours in the faded window start to invert - i.e. colours that were closer to white in the unfaded window are mapped to a darker colour in the faded window.

Changing the default will automatically apply to current graphics contexts but will not have any affect on windows that are already faded.

Note: RWindowTreeNode::SetFaded(), CWindowGc::SetFaded() and RWsSession::SetSystemFaded() use these fading parameters, and in addition allow the default fading value to be overridden.

See also: RWindowTreeNode::SetFaded() CWindowGc::SetFadingParameters()

Parameters
aBlackMapBlack map fading parameter.
aWhiteMapWhite map fading parameter.
Capability
WriteDeviceData

SetDefaultSystemPointerCursor ( TInt )

IMPORT_C voidSetDefaultSystemPointerCursor(TIntaCursorNumber)

Sets the default system pointer cursor.

This function can only be called by the owner of the system pointer cursor list. By default the 0th entry in the pointer cursor list is assigned as the system pointer. The function allows any cursor from the list or even no cursor to be set as the system pointer cursor.

Note: ownership of the system pointer cursor list can be obtained by calling ClaimSystemPointerCursorList() when no-one else has ownership.

Parameters
aCursorNumberThe index of the new default system pointer cursor within the system cursor list.

SetDoubleClick ( const TTimeIntervalMicroSeconds32 &, TInt )

IMPORT_C TIntSetDoubleClick(const TTimeIntervalMicroSeconds32 &aInterval,
TIntaDistance
)

Sets the system-wide double click settings.

Double click distance is measured, in pixels, as the sum of the X distance moved and the Y distance moved between clicks. For example: a first click at 10, 20 and a second click at 13,19 gives a distance of (13-10)+(21-20) = 4.

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

See also: GetDoubleClickSettings()

Parameters
aIntervalMaximum interval between clicks that constitutes a double click
aDistanceMaximum distance between clicks that constitutes a double click
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.
Capability
WriteDeviceData

SetFocusScreen ( TInt )

IMPORT_C TIntSetFocusScreen(TIntaScreenNumber)

Set focus screen

Parameters
aScreenNumberThe new focus screen.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

SetHighPressureThresholds ( TInt, TInt )

IMPORT_C TIntSetHighPressureThresholds(TIntaEnterHighPressureThreshold,
TIntaExitHighPressureThreshold
)

Sets Z coordinate threshold values for TPointerEvent::EEnterHighPressure and TPointerEvent::EExitHighPressure events. As pressure occupies the positive range of Z coordinates, on most platforms threshold values for these events should be specified as positive values.

However, all possible Z coordinate values are accepted by this method regardless of the fact that only the positive Z coordinate values are interpreted as pressure and the negative Z coordinate values are interpreted as proximity. This means that if a particular platform supports the Down pointer state while a pointer is in proximity to the screen, it is possible to base the firing of EnterHighPressure/ExitHighPressure events on proximity readings by specifying negative threshold values.

EnterHighPressure/ExitHighPressure event generation can be switched off completely by specifying the following thresholds: aEnterHighPressureThreshold = KMaxTInt, aExitHighPressureThreshold = KMinTInt.

This method is supposed to be used only by the UI platform or device's configuration tool.

Modified thresholds will be persisted across system reboots in the following HAL attributes: HALData::EPointer3DEnterHighPressureThreshold, HALData::EPointer3DExitHighPressureThreshold.

If this method is never called on a particular device, the default threshold values defined by this device's manufacturer are used.

See also: TPointerEvent::EEnterHighPressure TPointerEvent::EExitHighPressure HALData::EPointer3DEnterHighPressureThreshold HALData::EPointer3DExitHighPressureThreshold To become released with WSERV NGA APIs

Parameters
aEnterHighPressureThresholda new threshold for TPointerEvent::EEnterHighPressure to be set, specified as Z coordinate value
aExitHighPressureThresholda new threshold for TPointerEvent::EExitHighPressure to be set, specified as Z coordinate value
Return Value
KErrNone if successful, KErrNotSupported if the platform doesn't support threshold values for High Pressure events, KErrArgument if aEnterHighPressureThreshold is less than aExitHighPressureThreshold; when this error occurs, threshold values are not changed.
Capability
WriteDeviceData

SetHotKey ( THotKey, TUint, TUint, TUint )

IMPORT_C TIntSetHotKey(THotKeyaType,
TUintaKeyCode,
TUintaModifierMask,
TUintaModifier
)

Sets the hot keys.

Hot keys allow standard functions to be performed by application-defined key combinations.

This function maps any key press (with optional modifiers) to one of the hot keys defined in THotKey. More than one key combination may be mapped to each hot key: a new mapping is added each time the function is called.

Modifier key states are defined in TEventModifier. The modifiers that you want to be in a particular state should be specified in aModifierMask and the ones of these you want to be set should be specified in aModifiers. For example, if you want to capture FN-A and you want the SHIFT modifier unset, but you don't care about the state of the other modifiers then set both the flags for SHIFT and FN in aModiferMask and only set FN in aModifiers.

Note: default hotkey settings exist, but this function can be used for customisation. Typically it might be be used by a shell application or other application that controls system-wide settings.

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

Parameters
aTypeThe hot key to be mapped
aKeyCodeThe keycode to be mapped to the hot key
aModifierMaskModifier keys to test for a match
aModifierModifier keys to be tested for "on" state
Return Value
KErrNone value if successful, otherwise another of the system-wide error codes.
Capability
SwEvent

SetKeyboardRepeatRate ( const TTimeIntervalMicroSeconds32 &, const TTimeIntervalMicroSeconds32 & )

IMPORT_C TIntSetKeyboardRepeatRate(const TTimeIntervalMicroSeconds32 &aInitialTime,
const TTimeIntervalMicroSeconds32 &aTime
)

Sets the system-wide keyboard repeat rate.

This is the rate at which keyboard events are generated when a key is held down.

The default settings for the keyboard repeat rate are 0.3 seconds for the initial delay, and 0.1 seconds for the interval between subsequent repeats. However, since the settings are system-wide, these will not necessarily be the current settings when an application is launched: the settings may have been over-ridden by another module.

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

See also: GetKeyboardRepeatRate()

Parameters
aInitialTimeTime before first repeat key event
aTimeTime between subsequent repeat key events
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.
Capability
WriteDeviceData

SetMaxBufferSizeL ( TInt )

IMPORT_C voidSetMaxBufferSizeL(TIntaMaxBufSize)

Sets the maximum size that the buffer for queuing commands to send to the Windows Server can expand to.

The minimum possible buffer size is 640 and the maximum possible size is 16384 bytes.

If the buffer size is larger than the new maximum it is reduced.

A minimum size is calculated to be one quarter the maximum size, but in any case at least 640 bytes. If the buffer size is smaller than the calculated minimum it is expanded.

RWsSession::SetBufferSizeL() can be used to set a specific minimum size >640 bytes before setting a maximum size. This is useful if you will send very large drawing commands.

After calling this function the buffer size will be between the specified maximum and calculated minimum sizes.

The algorithm for growing the buffer up to the maximum is chosen to balance the cost of expanding the buffer with the waste of an excessively large buffer that is never filled.

If the buffer becomes too full to add a new drawing command, and the buffer size is less than the maximum, the buffer size will be expanded. If the buffer is already at the maximum size, or the expansion fails due to low memory, the buffer will be emptied with RWsSession::Flush(). If there is not enough space now for the new command a panic occurs.

See also: RWsSession::Flush() RWsSession::SetAutoFlush() RWsSession::SetBufferSizeL()

Parameters
aMaxBufSizeThe desired maximum buffer size in bytes.
Leave Codes
KErrNoMemoryCould not allocate the required minimum memory.
Panic Codes
TW32Panic5 Occurs during the session if a single drawing command is too big to fit in the buffer.

SetModifierState ( TEventModifier, TModifierState )

IMPORT_C TIntSetModifierState(TEventModifieraModifier,
TModifierStateaState
)

Sets the state of the modifier keys.

This function is typically used for permanent modifier states such as Caps Lock or Num Lock, but other possible uses include on-screen function key simulation, or the implementation of a Shift Lock key.

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

See also: GetModifierState()

Parameters
aModifierModifier to set.
aStateModifier state.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.
Capability
WriteDeviceData

SetPointerCursorArea ( const TRect & )

IMPORT_C voidSetPointerCursorArea(const TRect &aArea)

Sets the area of the screen in which the virtual cursor can be used while in relative mouse mode, for the first screen display mode.

This function sets the area for the first screen mode - the one with index 0, which in most devices will be the only screen mode. The other function overload can be used to set the screen area for other modes. The area is set and stored independently on each screen mode, so that it is not necessary to call this function again when switching back to the first screen mode.

The default area is the full digitiser area. When you set the area it will come into immediate affect, i.e. if necessary the current pointer position will be updated to be within the new area.

Notes:

Relative mouse mode is where the events received from the base by window server are deltas from the last position of the pointer, as opposed to absolute co-ordinates.

This function is honoured even if there is a mouse or pen (e.g. on the emulator), by mapping the co-ordinates of where you click into the area set using this function. However the function does not restrict clicks outside of the 'drawing area' on the Emulator, to allow you to select items on the fascia.

Parameters
aAreaThe area of the screen in which the virtual cursor can be used.
Capability
WriteDeviceData

SetPointerCursorArea ( TInt, const TRect & )

IMPORT_C voidSetPointerCursorArea(TIntaScreenSizeMode,
const TRect &aArea
)

Sets the area of the screen in which the virtual cursor can be used while in relative mouse mode, for a specified screen display mode.

The default area is the full digitiser area for the given mode. When you set the area it will come into immediate affect, i.e. if necessary the current pointer position will be updated to be within the new area.

The area is set and stored independently on each screen mode, so that it is not necessary to call this function again when switching back to a mode.

Notes:

Relative mouse mode is where the events received from the base by window server are deltas from the last position of the pointer, as opposed to absolute co-ordinates.

The previous function overload may be used to set the screen area for only the first mode.

This function is honoured even if there is a mouse or pen (e.g. on the emulator), by mapping the co-ordinates of where you click into the area set using this function. However the function does not restrict clicks outside of the 'drawing area' on the Emulator, to allow you to select items on the fascia.

Parameters
aScreenSizeModeThe screen mode to which the new area applies.
aAreaThe area of the screen, in the aScreenSizeMode screen mode, within which the virtual cursor can be used.
Capability
WriteDeviceData

SetPointerCursorMode ( TPointerCursorMode )

IMPORT_C voidSetPointerCursorMode(TPointerCursorModeaMode)

Sets the current mode for the pointer cursor.

The mode determines which sprite is used for the pointer cursor at any point. The request is ignored unless the calling application is the application that currently has keyboard focus. See TPointerCursorMode for more information.

See also: TPointerCursorMode

Parameters
aModeThe new mode for the pointer cursor.

SetPointerCursorPosition ( const TPoint & )

IMPORT_C TIntSetPointerCursorPosition(const TPoint &aPosition)

Sets the pointer cursor position.

This function allows an application to move the virtual cursor. It works in all modes, not just relative mouse mode.

Note: the function works in screen co-ordinates and honours the pointer cursor area exactly as pen presses do, i.e. only when they are in the drawing area on the Emulator.

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

Parameters
aPositionThe new pointer cursor position.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.
Capability
WriteDeviceDatarequired, if the client calling the function doesn't have keyboard focus. However, if the client have keyboard focus then he doesn't need any capability to call this function.

SetShadowVector ( const TPoint & )

IMPORT_C voidSetShadowVector(const TPoint &aVector)

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

Parameters
aVectorIgnored.

SetSystemFaded ( TBool )

IMPORT_C TIntSetSystemFaded(TBoolaFaded)

Sets all windows in the system as faded or unfaded, using the default fading parameters.

This function allows all windows that currently exist, not just those in a single window group, to be faded or unfaded.

Notes: The window server generates a redraw to un-fade a window, because information is lost during fading. Blank (RBlankWindow) and backup (RBackupWindow) windows deal with this themselves. Areas in shadow when the window is faded will also have redraw events generated for them by the window server. While a window is faded, all drawing to that window will be adjusted appropriately by the window server.

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

Parameters
aFadedETrue to fade all windows, EFalse to un-fade all windows.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.
Capability
WriteDeviceData

SetSystemFaded ( TBool, TUint8, TUint8 )

IMPORT_C TIntSetSystemFaded(TBoolaFaded,
TUint8aBlackMap,
TUint8aWhiteMap
)

Sets all windows in the system as faded or unfaded, overriding the default fading parameters (as set by SetDefaultFadingParameters()).

This function allows all windows that currently exist, not just those in the same window group, to be faded or unfaded.

Notes: Fading a window for a second time (that is fading it when it is already faded) will not change the fading map used. The window server generates a redraw to un-fade a window, because information is lost during fading. Blank (RBlankWindow) and backup (RBackupWindow) windows deal with this themselves. Areas in shadow when the window is faded will also have redraw events generated for them by the window server. While a window is faded, all drawing to that window will be adjusted appropriately by the window server.

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

Parameters
aFadedETrue to fade all windows, EFalse to un-fade all windows.
aBlackMapBlack map fading parameter.
aWhiteMapWhite map fading parameter.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.
Capability
WriteDeviceData

SetSystemPointerCursor ( const RWsPointerCursor &, TInt )

IMPORT_C TIntSetSystemPointerCursor(const RWsPointerCursor &aPointerCursor,
TIntaCursorNumber
)

Sets a cursor in the system pointer cursor list.

To gain access to the list, the client must first call ClaimSystemPointerCursorList().

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

Parameters
aPointerCursorPointer cursor to set in the list
aCursorNumberCursor number in the list
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

SetWindowGroupOrdinalPosition ( TInt, TInt )

IMPORT_C TIntSetWindowGroupOrdinalPosition(TIntaIdentifier,
TIntaPosition
)

Sets the ordinal position of a window group.

This function allows the caller to change the ordinal position of an existing window group. It would typically be used by a shell application.

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

Parameters
aIdentifierThe window group.
aPositionOrdinal position for the window group.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

ShadowVector ( )

IMPORT_C TPointShadowVector()const

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

Return Value
TPoint(0, 0)

SimulateKeyEvent ( TKeyEvent )

IMPORT_C voidSimulateKeyEvent(TKeyEventaEvent)

Sends a simulated key event to the window server.

All the fields in TKeyEvent are honoured except iRepeats, which is overridden with zero.

Parameters
aEventThe key event to be simulated.
Capability
SwEvent

SimulateRawEvent ( TRawEvent )

IMPORT_C voidSimulateRawEvent(TRawEventaEvent)

Simulates raw events.

For most purposes, RWsSession::SimulateKeyEvent() should be used instead to simulate key events because low-level scan-code up/down events are not meaningful to anything other than the keyboard to which they apply.

For example, the driver for an external keyboard should do its own conversion from raw scan-codes to higher-level character code key events and pass these to the window server using SimulateKeyEvent().

Parameters
aEventThe raw event.
Capability
SwEvent

SyncMsgBuf ( )

IMPORT_C voidSyncMsgBuf()

Sends all pending commands in the buffer to the window server.

SystemInfo ( TInt &, SSystemInfo & )

IMPORT_C voidSystemInfo(TInt &aSystemInfoNumber,
SSystemInfo &aSystemInfo
)

TestWrite ( TInt, TInt, const TAny *, TInt )

IMPORT_C voidTestWrite(TIntaHandle,
TIntaOpcode,
const TAny *aData,
TIntaLength
)

TestWriteReply ( TInt, TInt, const TAny *, TInt )

IMPORT_C voidTestWriteReply(TIntaHandle,
TIntaOpcode,
const TAny *aData,
TIntaLength
)

TestWriteReplyByProvidingRemoteReadAccess ( TInt, TInt, const TDesC8 &, const TDesC8 & )

IMPORT_C TIntTestWriteReplyByProvidingRemoteReadAccess(TIntaHandle,
TIntaOpcode,
const TDesC8 &aData,
const TDesC8 &aRemoteReadBuffer
)

TestWriteReplyByProvidingRemoteReadAccess ( TInt, TInt, const TDesC8 &, const TDesC16 & )

IMPORT_C TIntTestWriteReplyByProvidingRemoteReadAccess(TIntaHandle,
TIntaOpcode,
const TDesC8 &aData,
const TDesC16 &aRemoteReadBuffer
)

TestWriteReplyP ( TInt, TInt, const TAny *, TInt, TDes8 * )

IMPORT_C voidTestWriteReplyP(TIntaHandle,
TIntaOpcode,
const TAny *aData,
TIntaLength,
TDes8 *aReplyPackage
)

UnregisterAllEffects ( )

IMPORT_C voidUnregisterAllEffects()

Unregister animation for all transition effects.

Capability
WriteDeviceDataThis API does nothing if the client does not possess required Capability

UnregisterSurface ( TInt, const TSurfaceId & )

IMPORT_C voidUnregisterSurface(TIntaScreenNumber,
const TSurfaceId &aSurface
)

This function removes the surface from the session's register of surfaces that are used in composition on the screen associated with this device.

Calling this function with a surface that is not currently explicitly registered on this screen in this session by RegisterSurface() will have no effect.

Calling this function while the surface is still assigned to a window will have no immediate effect. However, when the surface is unassigned from the window, and is not held by another session it will then be automatically unregistered.

An unregistered surface can be re-registered again, if necessary.

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.

Pre-condition
aSurface has been initialized; otherwise the client thread is panicked with code EWservPanicIncompatibleSurface.

aScreenNumber is an acceptable screen number. Otherwise the client thread is panicked with code EWservPanicScreenNumber.

Post-condition
If no window is using the surface, then it is unregistered on this screen in this session.

See also: RegisterSurface

Parameters
aScreenNumberThe screen to which to unregister.
aSurfaceThe surface to be unregistered.

Version ( )

IMPORT_C TVersionVersion()const

Gets the window server version.

Return Value
Window server version containing major and minor version numbers, and build number.

WindowGroupList ( CArrayFixFlat< TInt > * )

IMPORT_C TIntWindowGroupList(CArrayFixFlat< TInt > *aWindowList)const

Gets a list of identifiers of all window groups in all window server sessions.

An array buffer must be created to store the resultant list.

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

Parameters
aWindowListList of identifiers of all window groups in the server.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

WindowGroupList ( RArray< TWindowGroupChainInfo > * )

IMPORT_C TIntWindowGroupList(RArray< TWindowGroupChainInfo > *aWindowList)const

Gets a list of identifier of window group and parent identifier of window group of all window groups in all window server sessions.

An array buffer must be created to store the resultant list.

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

Parameters
aWindowListList of identifiers of all window groups in the server.
Return Value
KErrNone if successful otherwise KErrNoMemory if there is insufficient memory to create the array, Panics if aWindowList is NULL.

WindowGroupList ( TInt, CArrayFixFlat< TInt > * )

IMPORT_C TIntWindowGroupList(TIntaPriority,
CArrayFixFlat< TInt > *aWindowList
)const

Lists the number of window groups of a given window group priority running in all window server sessions.

This function is the same as WindowGroupList() described above, but allows the application to restrict the list of window groups to those of a particular window group priority.

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

Parameters
aPriorityWindow group priority
aWindowListList of identifiers of all window groups in the server of priority aPriority.
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.

WindowGroupList ( TInt, RArray< TWindowGroupChainInfo > * )

IMPORT_C TIntWindowGroupList(TIntaPriority,
RArray< TWindowGroupChainInfo > *aWindowList
)const

Lists the number of window groups of a given window group priority running in all window server sessions.

This function is the same as WindowGroupList() described above, but allows the application to restrict the list of window groups to those of a particular window group priority.

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

Parameters
aPriorityWindow group priority
aWindowListList of identifiers of all window groups in the server of priority aPriority.
Return Value
KErrNone if successful otherwise KErrNoMemory if there is insufficient memory to create the array, Panics if aWindowList is NULL.

WindowGroupList ( CArrayFixFlat< TInt > *, TInt, TInt )

IMPORT_C TIntWindowGroupList(CArrayFixFlat< TInt > *aWindowList,
TIntaScreenNumber,
TIntaPriority = EAllPriorities
)const

Lists the number of window groups of a given window group priority running on a specified screen.

This function is the same as WindowGroupList() described above, but allows the application to restrict the list of window groups to those of a particular window group priority.

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

Parameters
aWindowListList of identifiers of all window groups on the specified screen with the given priority aPriority.
aScreenNumberspecifies the screen
aPriorityWindow group priority . Enum for all priorities is EAllPriorities
Return Value
KErrNone if successful, otherwise another of the system-wide error codes.