os/graphics/windowing/windowserver/nonnga/CLIENT/RWS.CPP
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/graphics/windowing/windowserver/nonnga/CLIENT/RWS.CPP	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,2432 @@
     1.4 +// Copyright (c) 1995-2010 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +// IPC implementation of client side code
    1.18 +// 
    1.19 +//
    1.20 +
    1.21 +#include "../SERVER/w32cmd.h"
    1.22 +#include "w32comm.h"
    1.23 +#include <e32std.h>
    1.24 +#include <w32std.h>
    1.25 +#include "CLIENT.H"
    1.26 +#include "wstraces.h"
    1.27 +#include "graphics/windowserverconstants.h"
    1.28 +#include <wspublishandsubscribedata.h>
    1.29 +
    1.30 +const TInt KMaxWSERVMessagesSlot=-1;
    1.31 +
    1.32 +
    1.33 +GLREF_C void Assert(TW32Assert aPanic);
    1.34 +/** Panics the client. This will result in the client thread being destroyed. */
    1.35 +GLREF_C void Panic(TW32Panic aPanic);
    1.36 +
    1.37 +
    1.38 +class RWsCustomTextCursor : public RWsSpriteBase
    1.39 +	{
    1.40 +	public:
    1.41 +		RWsCustomTextCursor(RWsSession aWs, TInt aHandle) : RWsSpriteBase(aWs)
    1.42 +			{ iWsHandle = aHandle; }
    1.43 +	};
    1.44 +
    1.45 +
    1.46 +EXPORT_C RWsSession::RWsSession()
    1.47 +/** Default C++ constructor.
    1.48 +
    1.49 +Constructs an uninitialised window server session. Note that it does not establish 
    1.50 +a connection to the window server - this must be done explicitly by calling 
    1.51 +the session's Connect() function. Before Connect() is called, no corresponding 
    1.52 +session object exists in the server, and the RWsSession contains no meaningful 
    1.53 +handle. */
    1.54 +	{}
    1.55 +
    1.56 +void RWsSession::connectL()
    1.57 +	{
    1.58 +	iBuffer=new(ELeave) RWsBuffer(this);
    1.59 +	iBuffer->SetBufferSizeL(RWsBuffer::EDefBufferSize);
    1.60 +	User::LeaveIfError(CreateSession(KWSERVServerName,Version(),KMaxWSERVMessagesSlot));
    1.61 +	iWsHandle=User::LeaveIfError(SendReceive(EWservMessInit,TIpcArgs()));
    1.62 +	}
    1.63 +
    1.64 +EXPORT_C TInt RWsSession::Connect()
    1.65 +/** Connects the client session to the window server.
    1.66 +
    1.67 +Connect() should be the first function called on an RWsSession object after 
    1.68 +it is created. The function establishes a connection to the window server, 
    1.69 +creating a corresponding session object in the server. Each session has one 
    1.70 +and only one connection to the server. Attempting to call Connect() when 
    1.71 +a connection has already been made will cause a panic.
    1.72 +
    1.73 +After a connection has been successfully established, all events are delivered 
    1.74 +to the client application through the RWsSession object.
    1.75 +
    1.76 +@return KErrNone if successful, otherwise another of the system-wide error 
    1.77 +codes. */
    1.78 +	{
    1.79 +	TInt ret;
    1.80 +
    1.81 +	if (iBuffer!=NULL)
    1.82 +		Panic(EW32PanicReConnect);
    1.83 + 	if ((ret=RFbsSession::Connect())==KErrNone)
    1.84 +		{
    1.85 +		TRAP(ret,connectL());
    1.86 +		if (ret!=KErrNone)
    1.87 +			{
    1.88 +			if (!iBuffer)
    1.89 +				RFbsSession::Disconnect();
    1.90 +			Close();
    1.91 +			}
    1.92 +		else
    1.93 +			iBuffer->SetCallBack();
    1.94 +		}
    1.95 +	return(ret);
    1.96 +	}
    1.97 +
    1.98 +EXPORT_C TInt RWsSession::Connect(RFs& aFileServer)
    1.99 +/** Connects the client session to the window server using pre constructed file server
   1.100 +session.
   1.101 +
   1.102 +Connect() should be the first function called on an RWsSession object after 
   1.103 +it is created. The function establishes a connection to the window server, 
   1.104 +creating a corresponding session object in the server. Each session has one 
   1.105 +and only one connection to the server. Attempting to call Connect() when 
   1.106 +a connection has already been made will cause a panic.
   1.107 +
   1.108 +After a connection has been successfully established, all events are delivered 
   1.109 +to the client application through the RWsSession object.
   1.110 +
   1.111 +@param aFileServer A fully constructed file server session
   1.112 +@return KErrNone if successful, otherwise another of the system-wide error 
   1.113 +codes. */
   1.114 +	{
   1.115 +	TInt ret;
   1.116 +
   1.117 +	if (iBuffer!=NULL)
   1.118 +		Panic(EW32PanicReConnect);
   1.119 + 	if ((ret=RFbsSession::Connect(aFileServer))==KErrNone)
   1.120 +		{
   1.121 +		TRAP(ret,connectL());
   1.122 +		if (ret!=KErrNone)
   1.123 +			{
   1.124 +			if (!iBuffer)
   1.125 +				RFbsSession::Disconnect();
   1.126 +			Close();
   1.127 +			}
   1.128 +		else
   1.129 +			iBuffer->SetCallBack();
   1.130 +		}
   1.131 +	return(ret);
   1.132 +	}
   1.133 +
   1.134 +EXPORT_C void RWsSession::Close()
   1.135 +/** Closes the window server session. 
   1.136 +
   1.137 +This function cleans up all resources in the RWsSession and disconnects it 
   1.138 +from the server. Prior to disconnecting from the window server, the client-side 
   1.139 +window server buffer is destroyed without being flushed. This function should 
   1.140 +be called when the RWsSession is no longer needed - normally just before 
   1.141 +it is destroyed. */
   1.142 +	{
   1.143 +	if (iBuffer)
   1.144 +		{
   1.145 +		__ASSERT_ALWAYS(iBuffer->iDirectAcessCount==0,Panic(EW32PanicDirectMisuse));
   1.146 +		iBuffer->CancelCallBack();
   1.147 +		iBuffer->Destroy();
   1.148 +		iBuffer=NULL;
   1.149 +		RFbsSession::Disconnect();
   1.150 +		}
   1.151 +	RSessionBase::Close();
   1.152 +	}
   1.153 +
   1.154 +// Private function(s)
   1.155 +
   1.156 +TInt RWsSession::DoSyncMsgBuf(const TIpcArgs& aIpcArgs)
   1.157 +	{
   1.158 +	return (SendReceive(EWservMessSyncMsgBuf,aIpcArgs));
   1.159 +	}
   1.160 +	
   1.161 +TInt RWsSession::DoFlush(const TIpcArgs& aIpcArgs)
   1.162 +	{
   1.163 +	return (SendReceive(EWservMessCommandBuffer,aIpcArgs));
   1.164 +	}
   1.165 +
   1.166 +EXPORT_C TVersion RWsSession::Version() const
   1.167 +/** Gets the window server version.
   1.168 +
   1.169 +@return Window server version containing major and minor version numbers, 
   1.170 +and build number. */
   1.171 +	{
   1.172 +
   1.173 +	TVersion v(KWservMajorVersionNumber,KWservMinorVersionNumber,KWservBuildVersionNumber);
   1.174 +	return(v);
   1.175 +	}
   1.176 +
   1.177 +TInt RWsSession::doSetHotKey(TInt aOpcode, TInt aType, TUint aKeycode, TUint aModifierMask, TUint aModifiers)
   1.178 +	{
   1.179 +	TWsClCmdSetHotKey setHotKey;
   1.180 +
   1.181 +	setHotKey.type=aType;
   1.182 +	setHotKey.keycode=(TUint16)aKeycode;
   1.183 +	setHotKey.modifiers=aModifiers;
   1.184 +	setHotKey.modifierMask=aModifierMask;
   1.185 +	return(WriteReply(&setHotKey,sizeof(setHotKey),aOpcode));
   1.186 +	}
   1.187 +
   1.188 +EXPORT_C TInt RWsSession::SetHotKey(THotKey aType, TUint aKeycode, TUint aModifierMask, TUint aModifiers)
   1.189 +/** Sets the hot keys.
   1.190 +
   1.191 +Hot keys allow standard functions to be performed by application-defined key 
   1.192 +combinations. 
   1.193 +
   1.194 +This function maps any key press (with optional modifiers) to one of the hot 
   1.195 +keys defined in THotKey. More than one key combination may be mapped to each 
   1.196 +hot key: a new mapping is added each time the function is called.
   1.197 +
   1.198 +Modifier key states are defined in TEventModifier. The modifiers that you 
   1.199 +want to be in a particular state should be specified in aModifierMask and 
   1.200 +the ones of these you want to be set should be specified in aModifiers. For 
   1.201 +example, if you want to capture FN-A and you want the SHIFT modifier unset, 
   1.202 +but you don't care about the state of the other modifiers then set both the 
   1.203 +flags for SHIFT and FN in aModiferMask and only set FN in aModifiers.
   1.204 +
   1.205 +Note: default hotkey settings exist, but this function can be used for customisation. 
   1.206 +Typically it might be be used by a shell application or other application 
   1.207 +that controls system-wide settings.
   1.208 +
   1.209 +This function always causes a flush of the window server buffer.
   1.210 +
   1.211 +@param aType The hot key to be mapped
   1.212 +@param aKeyCode The keycode to be mapped to the hot key
   1.213 +@param aModifierMask Modifier keys to test for a match
   1.214 +@param aModifiers Modifier keys to be tested for "on" state 
   1.215 +@return KErrNone value if successful, otherwise another of the system-wide 
   1.216 +error codes.
   1.217 +@capability SwEvent */
   1.218 +	{
   1.219 +	return(doSetHotKey(EWsClOpSetHotKey, aType, aKeycode, aModifierMask, aModifiers));
   1.220 +	}
   1.221 +
   1.222 +EXPORT_C TInt RWsSession::ClearHotKeys(THotKey aType)
   1.223 +/** Clears all mappings for the specified hotkey, including the default mapping.
   1.224 +
   1.225 +Hotkeys allow standard functions to be performed by application-defined key 
   1.226 +combinations. 
   1.227 +
   1.228 +This function always causes a flush of the window server buffer.
   1.229 +
   1.230 +@param aType The hot key to be cleared 
   1.231 +@return KErrNone if successful, otherwise one of the system-wide error codes. 
   1.232 +@see SetHotKey()
   1.233 +@see RestoreDefaultHotKey()
   1.234 +@capability SwEvent */
   1.235 +	{
   1.236 +	return(WriteReplyInt(aType,EWsClOpClearHotKeys));
   1.237 +	}
   1.238 +
   1.239 +EXPORT_C TInt RWsSession::RestoreDefaultHotKey(THotKey aType)
   1.240 +/** Restores the default mapping for a hot key.
   1.241 +
   1.242 +The function clears current mappings for a hot key and restores the default 
   1.243 +mapping. See THotKey for the default.
   1.244 +
   1.245 +This function always causes a flush of the window server buffer.
   1.246 +
   1.247 +@param aType The hot key to restore to its default value 
   1.248 +@return KErrNone if successful, otherwise another of the system-wide error 
   1.249 +codes. 
   1.250 +@see ClearHotKeys() */
   1.251 +	{
   1.252 +	return(WriteReplyInt(aType,EWsClOpRestoreDefaultHotKey));
   1.253 +	}
   1.254 +
   1.255 +EXPORT_C void RWsSession::ComputeMode(TComputeMode aMode)
   1.256 +/** Sets the mode used to control process priorities.
   1.257 +
   1.258 +The default window server behaviour is that the application that owns the 
   1.259 +window with keyboard focus gets foreground process priority (EPriorityForeground) 
   1.260 +while all other clients get background priority (EPriorityBackground). This 
   1.261 +function can be used to over-ride this default behaviour, as discussed in 
   1.262 +TComputeMode.
   1.263 +
   1.264 +Note:
   1.265 +
   1.266 +Unlike real Symbian phones, the Emulator runs on a single process. As a result, 
   1.267 +on the Emulator this function sets the priority of individual threads rather 
   1.268 +than of processes. The values used for thread priorities are EPriorityLess 
   1.269 +instead of EPriorityBackground, and EPriorityNormal instead of EPriorityForeground.
   1.270 +
   1.271 +@param aMode The compute mode. */
   1.272 +	{
   1.273 +	WriteInt(aMode,EWsClOpComputeMode);
   1.274 +	}
   1.275 +
   1.276 +EXPORT_C void RWsSession::SetShadowVector(const TPoint &aVector)
   1.277 +/** Sets the shadow vector.
   1.278 +
   1.279 +@param aVector New shadow vector */
   1.280 +	{
   1.281 +	WritePoint(aVector,EWsClOpSetShadowVector);
   1.282 +	}
   1.283 +
   1.284 +EXPORT_C TPoint RWsSession::ShadowVector() const
   1.285 +/** Gets the current value of the shadow vector.
   1.286 +
   1.287 +This function always causes a flush of the window server buffer.
   1.288 +
   1.289 +@return Current shadow vector */
   1.290 +	{
   1.291 +	TPckgBuf<TPoint> pointPkg;
   1.292 +  	WriteReplyP(&pointPkg,EWsClOpShadowVector);
   1.293 +	return(pointPkg());
   1.294 +	}
   1.295 +
   1.296 +void RWsSession::doReadEvent(TRequestStatus *aStat, TInt aOpcode)
   1.297 +	{
   1.298 +	*aStat=KRequestPending;
   1.299 +	if (iBuffer)
   1.300 +		{
   1.301 +		iBuffer->Flush(); //ignore error since this flushing should not return any error
   1.302 +		}
   1.303 +	__ASSERT_DEBUG(EWservMessAsynchronousService>=aOpcode, Assert(EW32AssertIllegalOpcode));
   1.304 +	const TInt function=EWservMessAsynchronousService|aOpcode;
   1.305 +	SendReceive(function,TIpcArgs(),*aStat);
   1.306 +	}
   1.307 +
   1.308 +EXPORT_C void RWsSession::EventReady(TRequestStatus* aStat)
   1.309 +/** Requests standard events from the window server.
   1.310 +
   1.311 +Standard events include all events except redraws and priority key events.
   1.312 +
   1.313 +The client application will typically handle the completed request using the 
   1.314 +RunL() function of an active object, and in this case the request status aStat 
   1.315 +should be the iStatus member of that CActive object.
   1.316 +
   1.317 +Notes:
   1.318 +
   1.319 +- The active object runs when an event is waiting. You should call GetEvent() 
   1.320 +in the RunL() function to get the event.
   1.321 +
   1.322 +- You should not call this function again until you have either called GetEvent() 
   1.323 +or EventReadyCancel().
   1.324 +
   1.325 +- Because this function is asynchronous, there is no guarantee that the Window 
   1.326 +Server will process the request before the function returns. However, on single 
   1.327 +core systems it is unusual for this function to return before the Window Server 
   1.328 +has processed the request, because the client generally runs in a lower priority 
   1.329 +thread than the Window Server. You should therefore expect the use of this 
   1.330 +function to give rise to different behaviour between single and multicore systems.
   1.331 +
   1.332 +@param aStat Request status. On successful completion contains KErrNone, otherwise 
   1.333 +another of the system-wide error codes.
   1.334 +@see CActive
   1.335 +@see GetEvent() */
   1.336 +	{
   1.337 +	WS_TRACE_CLIENT_EVENTREADY();
   1.338 +	doReadEvent(aStat,EWsClOpEventReady);
   1.339 +	}
   1.340 +
   1.341 +EXPORT_C void RWsSession::RedrawReady(TRequestStatus* aStat)
   1.342 +/** Requests redraw events from the window server.
   1.343 +
   1.344 +Typically, a client will create an active object for redraw events with a 
   1.345 +lower priority than the active objects for standard events. The client will 
   1.346 +then typically handle completed redraw requests in the active object's RunL() 
   1.347 +function.
   1.348 +
   1.349 +As in EventReady(), the request status aStat should be used as the iStatus 
   1.350 +member of an active object. When a redraw event occurs the active object's 
   1.351 +RunL() function is called. The redraw event can be obtained by calling 
   1.352 +GetRedraw() in the RunL().
   1.353 +
   1.354 +Notes:
   1.355 +
   1.356 +- You should not call this function again until you have either called 
   1.357 +GetRedraw() or RedrawReadyCancel().
   1.358 +
   1.359 +- Because this function is asynchronous, there is no guarantee that the Window 
   1.360 +Server will process the request before the function returns. However, on single 
   1.361 +core systems it is unusual for this function to return before the Window Server 
   1.362 +has processed the request, because the client generally runs in a lower priority 
   1.363 +thread than the Window Server. You should therefore expect the use of this 
   1.364 +function to give rise to different behaviour between single and multicore systems.
   1.365 +
   1.366 +@param aStat The request status. On successful completion contains KErrNone, 
   1.367 +otherwise another of the system-wide error codes. 
   1.368 +@see RedrawReadyCancel()
   1.369 +@see GetRedraw()
   1.370 +@see CActive */
   1.371 +	{
   1.372 +	WS_TRACE_CLIENT_REDRAWREADY();
   1.373 +	doReadEvent(aStat,EWsClOpRedrawReady);
   1.374 +	}
   1.375 +	
   1.376 +void RWsSession::GraphicMessageReady(TRequestStatus *aStat)
   1.377 +	{
   1.378 +	doReadEvent(aStat,EWsClOpGraphicMessageReady);
   1.379 +	}
   1.380 +	
   1.381 +void RWsSession::GetGraphicMessage(TDes8& aData) const
   1.382 +	{
   1.383 +	WriteReplyP(TWriteDescriptorType(&aData),EWsClOpGetGraphicMessage);
   1.384 +	}
   1.385 +	
   1.386 +void RWsSession::GraphicMessageCancel()
   1.387 +	{
   1.388 +	WriteReply(EWsClOpGraphicMessageCancel);
   1.389 +	}
   1.390 +
   1.391 +void RWsSession::GraphicAbortMessage(TInt aError)
   1.392 +	{
   1.393 +	WriteReplyInt(aError, EWsClOpGraphicAbortMessage);
   1.394 +	}
   1.395 +
   1.396 +TInt RWsSession::GraphicFetchHeaderMessage()
   1.397 +	{
   1.398 +	return WriteReply(EWsClOpGraphicFetchHeaderMessage);
   1.399 +	}
   1.400 +	
   1.401 +EXPORT_C void RWsSession::PriorityKeyReady(TRequestStatus *aStat)
   1.402 +/** Requests priority key events from the window server. 
   1.403 +
   1.404 +Typically, an client will create an active object for priority key events 
   1.405 +with a higher priority than the active objects for standard events. The client 
   1.406 +will then normally handle completed priority key requests in the active object's 
   1.407 +RunL() function.
   1.408 +
   1.409 +As in EventReady(), the request status argument should be the set to the iStatus 
   1.410 +member of CActive. When priority key events occur, they are obtained using 
   1.411 +GetPriorityKey().
   1.412 +
   1.413 +Notes:
   1.414 +
   1.415 +- You should not call this function again until you have either called 
   1.416 +GetPriorityKey() or PriorityKeyReadyCancel().
   1.417 +
   1.418 +- Because this function is asynchronous, there is no guarantee that the Window 
   1.419 +Server will process the request before the function returns. However, on single 
   1.420 +core systems it is unusual for this function to return before the Window Server 
   1.421 +has processed the request, because the client generally runs in a lower priority 
   1.422 +thread than the Window Server. You should therefore expect the use of this 
   1.423 +function to give rise to different behaviour between single and multicore systems.
   1.424 +
   1.425 +@param aStat Request status. On successful completion contains KErrNone, otherwise 
   1.426 +another of the system-wide error codes. 
   1.427 +@see PriorityKeyReadyCancel()
   1.428 +@see GetPriorityKey()
   1.429 +@see CActive */
   1.430 +	{
   1.431 +	doReadEvent(aStat,EWsClOpPriorityKeyReady);
   1.432 +	}
   1.433 +
   1.434 +EXPORT_C void RWsSession::GetEvent(TWsEvent &aEvent) const
   1.435 +/** Gets a standard event from the session for processing.
   1.436 +
   1.437 +The type of event returned by GetEvent() may be any of those listed in TEventCode. 
   1.438 +To access the data within an event, the event should be converted to the appropriate 
   1.439 +type, using functions provided by the TWsEvent class. TWsEvent also provides 
   1.440 +a function to find out the type of the event.
   1.441 +
   1.442 +Notes:
   1.443 +
   1.444 +It is possible that the returned event is of type EEventNull. Clients should 
   1.445 +normally ignore these events.
   1.446 +
   1.447 +This function should only be called in response to notification that an event 
   1.448 +has occurred, otherwise the client will be panicked.
   1.449 +
   1.450 +This function would normally be called in the RunL() function of an active 
   1.451 +object which completes with the EventReady() function's request status.
   1.452 +
   1.453 +This function always causes a flush of the window server buffer.
   1.454 +
   1.455 +@param aEvent On return, contains the event that occurred 
   1.456 +@see TEventCode
   1.457 +@see EventReady() */
   1.458 +	{
   1.459 +	WS_TRACE_CLIENT_GETEVENT();	
   1.460 +	TPckgBuf<TWsEvent> event;
   1.461 +	WriteReplyP(&event,EWsClOpGetEvent);
   1.462 +	aEvent=event();
   1.463 +	}
   1.464 +
   1.465 +EXPORT_C void RWsSession::PurgePointerEvents()
   1.466 +/** Removes all pointer events waiting to be delivered to this session. 
   1.467 +
   1.468 +The events are removed from the event queue without being processed. This 
   1.469 +might occur, for example, at application startup. */
   1.470 +	{
   1.471 +	Write(EWsClOpPurgePointerEvents);
   1.472 +	}
   1.473 +
   1.474 +EXPORT_C void RWsSession::GetRedraw(TWsRedrawEvent &aEvent)
   1.475 +/** Gets the redraw event from the session.
   1.476 +
   1.477 +This function is similar to GetEvent(), except that the event is returned 
   1.478 +as a TWsRedrawEvent, and hence there is no need to convert it from a TWsEvent.
   1.479 +
   1.480 +The function should only be called after notification that a redraw is waiting.
   1.481 +
   1.482 +It always causes a flush of the window server buffer.
   1.483 +
   1.484 +@param aEvent On return, contains the redraw event that occurred 
   1.485 +@see RedrawReady()
   1.486 +@see GetEvent()
   1.487 +@see CActive */
   1.488 +	{
   1.489 +	WS_TRACE_CLIENT_GETREDRAW();
   1.490 +	TPckgBuf<TWsRedrawEvent> redraw;
   1.491 +	WriteReplyP(&redraw,EWsClOpGetRedraw);
   1.492 +	aEvent=redraw();
   1.493 +	}
   1.494 +
   1.495 +EXPORT_C void RWsSession::GetPriorityKey(TWsPriorityKeyEvent &aEvent) const
   1.496 +/** Gets the completed priority key event from the window server session.
   1.497 +
   1.498 +Priority key events are typically used for providing "Abort" or "Escape" keys 
   1.499 +for an application.
   1.500 +
   1.501 +This function is similar to GetEvent(), except that it returns a TWsPriorityKeyEvent 
   1.502 +instead of a TWsEvent.
   1.503 +
   1.504 +Note: this should only be called after notification that a priority key event has 
   1.505 +occurred.
   1.506 +
   1.507 +This function always causes a flush of the window server buffer.
   1.508 +
   1.509 +@param aEvent On return, contains the priority key event that occurred. 
   1.510 +@see PriorityKeyReady()
   1.511 +@see PriorityKeyReadyCancel() */
   1.512 +	{
   1.513 +	TPckgBuf<TWsPriorityKeyEvent> abortEvent;
   1.514 +	WriteReplyP(&abortEvent,EWsClOpGetPriorityKey);
   1.515 +	aEvent=abortEvent();
   1.516 +	}
   1.517 +
   1.518 +EXPORT_C void RWsSession::EventReadyCancel()
   1.519 +/** Cancels a request for standard events from the window server.
   1.520 +
   1.521 +This request was made using EventReady().
   1.522 +
   1.523 +The client application will typically use an active object to handle standard 
   1.524 +events, and this function should be called from the active object's DoCancel() 
   1.525 +function.
   1.526 +
   1.527 +This function always causes a flush of the window server buffer.
   1.528 +
   1.529 +@see EventReady() */
   1.530 +	{
   1.531 +	if (iWsHandle)
   1.532 +		WriteReply(EWsClOpEventReadyCancel);
   1.533 +	}
   1.534 +
   1.535 +EXPORT_C void RWsSession::RedrawReadyCancel()
   1.536 +/** Cancels a redraw event request. 
   1.537 +
   1.538 +If active objects are used, this function should be called from the active 
   1.539 +object's DoCancel() function.
   1.540 +
   1.541 +This function always causes a flush of the window server buffer.
   1.542 +
   1.543 +@see RedrawReady() */
   1.544 +	{
   1.545 +	if (iWsHandle)
   1.546 +		WriteReply(EWsClOpRedrawReadyCancel);
   1.547 +	}
   1.548 +
   1.549 +EXPORT_C void RWsSession::PriorityKeyReadyCancel()
   1.550 +/** Cancels a priority key event request.
   1.551 +
   1.552 +If active objects are used, this function should be called from the active 
   1.553 +object's DoCancel() function.
   1.554 +
   1.555 +This function always causes a flush of the window server buffer.
   1.556 +
   1.557 +@see PriorityKeyReady()
   1.558 +@see CActive */
   1.559 +	{
   1.560 +	if (iWsHandle)
   1.561 +		WriteReply(EWsClOpPriorityKeyReadyCancel);
   1.562 +	}
   1.563 +
   1.564 +EXPORT_C void RWsSession::Flush()
   1.565 +/** Sends all pending commands in the buffer to the window server. 
   1.566 +
   1.567 +Delivering a command to the window server requires a context switch, and so 
   1.568 +it is more efficient to deliver several commands in one go. Hence all client 
   1.569 +commands are normally first placed into a buffer for delivery to the window 
   1.570 +server. 
   1.571 +
   1.572 +The buffer is delivered when it gets full, or when a command that returns a value 
   1.573 +is called (there are a few exceptions to this), or when this function is called.
   1.574 +
   1.575 +Note: this function is called when a prompt response is required from the window 
   1.576 +server, e.g. after doing some drawing.
   1.577 +
   1.578 +@see RWsSession::SetAutoFlush()
   1.579 +@see RWsSession::SetBufferSizeL()
   1.580 +@see RWsSession::SetMaxBufferSizeL()
   1.581 +*/
   1.582 +	{
   1.583 +	if (iBuffer)
   1.584 +		iBuffer->Flush(NULL,ETrue);
   1.585 +	}
   1.586 +
   1.587 +EXPORT_C TBool RWsSession::SetAutoFlush(TBool aState)
   1.588 +/** Sets a session's auto-flush state. 
   1.589 +
   1.590 +If auto-flush is set to ETrue, the window server buffer is flushed immediately 
   1.591 +anything is put into it, instead of waiting until it becomes full. This setting 
   1.592 +is normally used only in a debugging environment. 
   1.593 +
   1.594 +If the auto-flush state is EFalse, the window server buffer is flushed normally.
   1.595 +
   1.596 +@param aState ETrue to set auto-flushing on, EFalse to disable auto-flushing. 
   1.597 +@return Previous auto-flush state
   1.598 +
   1.599 +@see RWsSession::Flush()
   1.600 +@see RWsSession::SetBufferSizeL()
   1.601 +@see RWsSession::SetMaxBufferSizeL()
   1.602 +*/
   1.603 +	{
   1.604 +	return(iBuffer->SetAutoFlush(aState));
   1.605 +	}
   1.606 +
   1.607 +EXPORT_C TInt RWsSession::NumWindowGroups() const
   1.608 +/** Gets the total number of window groups currently running in the window server. 
   1.609 +
   1.610 +This includes all the groups running in all sessions.
   1.611 +
   1.612 +This function always causes a flush of the window server buffer.
   1.613 +
   1.614 +@return Total number of window groups running in the server */
   1.615 +	{
   1.616 +	return(WriteReply(EWsClOpNumWindowGroupsAllPriorities));
   1.617 +	}
   1.618 +
   1.619 +EXPORT_C TInt RWsSession::NumWindowGroups(TInt aPriority) const
   1.620 +/** Gets the number of window groups of a given window group priority running in 
   1.621 +all sessions in the window server.
   1.622 +
   1.623 +This function always causes a flush of the window server buffer.
   1.624 +
   1.625 +@param aPriority Window group priority 
   1.626 +@return Number of window groups of priority aPriority */
   1.627 +	{
   1.628 +	return(WriteReplyInt(aPriority,EWsClOpNumWindowGroups));
   1.629 +	}
   1.630 +
   1.631 +EXPORT_C TInt RWsSession::NumWindowGroups(TInt aScreenNumber,TInt aPriority) const
   1.632 +/** Gets the number of window groups of a given window group priority running on a specified screen
   1.633 +
   1.634 +This function always causes a flush of the window server buffer.
   1.635 +
   1.636 +@param aScreenNumber specifies the screen. 
   1.637 +@param aPriority Window group priority. EAllPriorities is the enum for all priorities 
   1.638 +@return Number of window groups of priority aPriority on the specified screen */
   1.639 +	{
   1.640 +	TWsClCmdNumWindowGroups params;
   1.641 +	params.screenNumber = aScreenNumber;
   1.642 +	params.priority = aPriority;
   1.643 +	return(WriteReply(&params,sizeof(params),EWsClOpNumWindowGroupsOnScreen));	
   1.644 +	}
   1.645 +
   1.646 +TInt RWsSession::doWindowGroupList(TInt aScreenNumber, TInt aPriority,CArrayFixFlat<TInt>* aWindowList,TInt aNumOpcode,TInt aListOpcode) const
   1.647 +/** Gets the id of window groups of specified priority running on a specified screen.
   1.648 +
   1.649 +This function always causes a flush of the window server buffer.
   1.650 +
   1.651 +@param aScreenNumber specifies the screen.
   1.652 +@param aPriority Window group priority 
   1.653 +@param aWindowList List of identifiers
   1.654 +@return KErrNone if successful, otherwise another of the system-wide error 
   1.655 +codes.*/
   1.656 +	{
   1.657 +	TWsClCmdWindowGroupList params;
   1.658 +	params.priority = aPriority;		
   1.659 +	params.screenNumber = aScreenNumber;
   1.660 +	if(aScreenNumber!=KDummyScreenNumber)
   1.661 +		{
   1.662 +		TWsClCmdNumWindowGroups numWinGrp;
   1.663 +		numWinGrp.screenNumber = aScreenNumber;
   1.664 +		numWinGrp.priority = aPriority;	
   1.665 +		params.count=WriteReply(&numWinGrp,sizeof(numWinGrp),aNumOpcode);
   1.666 +		}
   1.667 +	else
   1.668 +		{
   1.669 +		params.count=WriteReplyInt(aPriority,aNumOpcode);
   1.670 +		}
   1.671 +
   1.672 +	TRAPD(err,aWindowList->ResizeL(params.count));
   1.673 +	if (err!=KErrNone || params.count==0)
   1.674 +		return(err);
   1.675 +	TPtr8 listPtr(reinterpret_cast<TUint8*>(&(*aWindowList)[0]),params.count*sizeof((*aWindowList)[0]));
   1.676 +	TInt actualCount=WriteReplyP(&params, sizeof(params), &listPtr, aListOpcode);
   1.677 +	err=KErrNone;
   1.678 +	if (actualCount<0)
   1.679 +		{
   1.680 +		err=actualCount;
   1.681 +		actualCount=0;
   1.682 +		}
   1.683 +	if (actualCount<params.count)
   1.684 +		aWindowList->ResizeL(actualCount);	// Can't fail, only shrinking it
   1.685 +	return(err);
   1.686 +	}
   1.687 +
   1.688 +TInt RWsSession::doWindowGroupList(TInt aPriority, RArray<TWindowGroupChainInfo>* aWindowListCh, TInt aNumOpcode, TInt aListOpcode) const
   1.689 +/** Gets the id of window groups and id of its parent window group of specified priority running in 
   1.690 +all sessions in the window server.
   1.691 +
   1.692 +This function always causes a flush of the window server buffer.
   1.693 +
   1.694 +@param aPriority Window group priority 
   1.695 +@param aWindowList List of identifiers
   1.696 +@return KErrNone if successful else KErrNoMemory if there is insufficient memory to create the array. 
   1.697 +This function will panic if aWindowListCh is Null.*/
   1.698 +	{
   1.699 +	__ASSERT_ALWAYS(aWindowListCh,Panic(EW32PanicNullArray));
   1.700 +	TWsClCmdWindowGroupList params;
   1.701 +	params.priority=aPriority;
   1.702 +	params.count=WriteReplyInt(aPriority,aNumOpcode);
   1.703 +	aWindowListCh->Reset();
   1.704 +	TUint8* WindowList=static_cast<TUint8*>(User::Alloc(params.count*sizeof(TWindowGroupChainInfo)));
   1.705 +	if(WindowList==NULL)
   1.706 +		{
   1.707 +		return KErrNoMemory;
   1.708 +		}	
   1.709 +	TPtr8 listPtr(WindowList,params.count*sizeof(TWindowGroupChainInfo));
   1.710 +	WriteReplyP(&params, sizeof(params), &listPtr, aListOpcode);
   1.711 +	new(aWindowListCh) RArray<TWindowGroupChainInfo>(sizeof(TWindowGroupChainInfo),(TWindowGroupChainInfo*)WindowList,params.count);
   1.712 +	return KErrNone;
   1.713 +	}
   1.714 +
   1.715 +EXPORT_C TInt RWsSession::WindowGroupList(CArrayFixFlat<TInt>* aWindowList) const
   1.716 +/** Gets a list of identifiers of all window groups in all window server sessions.
   1.717 +
   1.718 +An array buffer must be created to store the resultant list.
   1.719 +
   1.720 +This function always causes a flush of the window server buffer.
   1.721 +
   1.722 +@param aWindowList List of identifiers of all window groups in the server.
   1.723 +@return KErrNone if successful, otherwise another of the system-wide error 
   1.724 +codes. */
   1.725 +	{
   1.726 +	return(doWindowGroupList(KDummyScreenNumber,0,aWindowList,EWsClOpNumWindowGroupsAllPriorities,EWsClOpWindowGroupListAllPriorities));
   1.727 +	}
   1.728 +
   1.729 +EXPORT_C TInt RWsSession::WindowGroupList(CArrayFixFlat<TInt>* aWindowList,TInt aScreenNumber,TInt aPriority) const
   1.730 +/** Lists the number of window groups of a given window group priority running on a specified screen.
   1.731 +
   1.732 +This function is the same as WindowGroupList() described above, but allows 
   1.733 +the application to restrict the list of window groups to those of a particular 
   1.734 +window group priority.
   1.735 +
   1.736 +This function always causes a flush of the window server buffer.
   1.737 +
   1.738 +@param aScreenNumber specifies the screen
   1.739 +@param aPriority Window group priority . Enum for all priorities is EAllPriorities
   1.740 +@param aWindowList List of identifiers of all window groups on the specified screen with the given priority 
   1.741 +aPriority.
   1.742 +@return KErrNone if successful, otherwise another of the system-wide error 
   1.743 +codes. */
   1.744 +	{
   1.745 +	return(doWindowGroupList(aScreenNumber,aPriority,aWindowList,EWsClOpNumWindowGroupsOnScreen,EWsClOpWindowGroupList));	
   1.746 +	}
   1.747 +
   1.748 +EXPORT_C TInt RWsSession::WindowGroupList(RArray<TWindowGroupChainInfo>* aWindowList) const
   1.749 +/** Gets a list of identifier of window group and parent identifier of window group of
   1.750 + all window groups in all window server sessions.
   1.751 +
   1.752 +An array buffer must be created to store the resultant list.
   1.753 +
   1.754 +This function always causes a flush of the window server buffer.
   1.755 +
   1.756 +@param aWindowList List of identifiers of all window groups in the server.
   1.757 +@return KErrNone if successful otherwise KErrNoMemory if there is insufficient memory to create the array,
   1.758 +Panics if aWindowList is NULL. */
   1.759 +	{
   1.760 +	return(doWindowGroupList(0,aWindowList,EWsClOpNumWindowGroupsAllPriorities,EWsClOpWindowGroupListAndChainAllPriorities));
   1.761 +	}
   1.762 +
   1.763 +EXPORT_C TInt RWsSession::WindowGroupList(TInt aPriority,CArrayFixFlat<TInt>* aWindowList) const
   1.764 +/** Lists the number of window groups of a given window group priority running 
   1.765 +in all window server sessions.
   1.766 +
   1.767 +This function is the same as WindowGroupList() described above, but allows 
   1.768 +the application to restrict the list of window groups to those of a particular 
   1.769 +window group priority.
   1.770 +
   1.771 +This function always causes a flush of the window server buffer.
   1.772 +
   1.773 +@param aPriority Window group priority 
   1.774 +@param aWindowList List of identifiers of all window groups in the server of priority 
   1.775 +aPriority.
   1.776 +@return KErrNone if successful, otherwise another of the system-wide error 
   1.777 +codes. */
   1.778 +	{
   1.779 +	return(doWindowGroupList(KDummyScreenNumber,aPriority,aWindowList,EWsClOpNumWindowGroups,EWsClOpWindowGroupList));
   1.780 +	}
   1.781 +
   1.782 +EXPORT_C TInt RWsSession::WindowGroupList(TInt aPriority, RArray<TWindowGroupChainInfo>* aWindowList) const
   1.783 +/** Lists the number of window groups of a given window group priority running 
   1.784 +in all window server sessions.
   1.785 +
   1.786 +This function is the same as WindowGroupList() described above, but allows 
   1.787 +the application to restrict the list of window groups to those of a particular 
   1.788 +window group priority.
   1.789 +
   1.790 +This function always causes a flush of the window server buffer.
   1.791 +
   1.792 +@param aPriority Window group priority 
   1.793 +@param aWindowList List of identifiers of all window groups in the server of priority 
   1.794 +aPriority.
   1.795 +@return KErrNone if successful otherwise KErrNoMemory if there is insufficient memory to create the array, 
   1.796 +Panics if aWindowList is NULL. */	
   1.797 +	{
   1.798 +	return(doWindowGroupList(aPriority,aWindowList,EWsClOpNumWindowGroups,EWsClOpWindowGroupListAndChain));
   1.799 +	}
   1.800 +
   1.801 +EXPORT_C TInt RWsSession::GetDefaultOwningWindow() const
   1.802 +/** Gets the identifier of the current default owning window group.
   1.803 +
   1.804 +This function always causes a flush of the window server buffer.
   1.805 +
   1.806 +@return Identifier of current default owning window group. Returns 0 if there 
   1.807 +isn't one. */
   1.808 +	{
   1.809 +	return GetDefaultOwningWindow(KDummyScreenNumber);
   1.810 +	}
   1.811 +
   1.812 +EXPORT_C TInt RWsSession::GetDefaultOwningWindow(TInt aScreenNumber) const
   1.813 +/** Gets the identifier of the current default owning window group on a specified screen.
   1.814 +
   1.815 +This function always causes a flush of the window server buffer.
   1.816 +
   1.817 +@param aScreenNumber specifies the screen.
   1.818 +@return Identifier of current default owning window group on the specified screen. Returns 0 if there 
   1.819 +isn't one. */
   1.820 +	{
   1.821 +	return(WriteReplyInt(aScreenNumber,EWsClOpGetDefaultOwningWindow));	
   1.822 +	}
   1.823 +
   1.824 +EXPORT_C TInt RWsSession::GetFocusWindowGroup() const
   1.825 +/** Gets the identifier of the window group that currently has the keyboard focus.
   1.826 +
   1.827 +Note: this might not necessarily be the front-most window group, as window groups 
   1.828 +can disable keyboard focus.
   1.829 +
   1.830 +This function always causes a flush of the window server buffer.
   1.831 +
   1.832 +@return Identifier of window group with keyboard focus. */
   1.833 +	{
   1.834 +	return GetFocusWindowGroup(KDummyScreenNumber);
   1.835 +	}
   1.836 +
   1.837 +EXPORT_C TInt RWsSession::GetFocusWindowGroup(TInt aScreenNumber) const
   1.838 +/** Gets the identifier of the window group on a specified screen that currently has the keyboard focus.
   1.839 +
   1.840 +Note: this might not necessarily be the front-most window group, as window groups 
   1.841 +can disable keyboard focus.
   1.842 +
   1.843 +This function always causes a flush of the window server buffer.
   1.844 +
   1.845 +@param aScreenNumber specifies the screen.
   1.846 +@return Identifier of window group with keyboard focus. */
   1.847 +	{
   1.848 +	return WriteReplyInt(aScreenNumber,EWsClOpGetFocusWindowGroup);	
   1.849 +	}
   1.850 +
   1.851 +EXPORT_C TInt RWsSession::SetWindowGroupOrdinalPosition(TInt aIdentifier, TInt aPosition)
   1.852 +/** Sets the ordinal position of a window group.
   1.853 +
   1.854 +This function allows the caller to change the ordinal position of an existing 
   1.855 +window group. It would typically be used by a shell application.
   1.856 +
   1.857 +This function always causes a flush of the window server buffer.
   1.858 +
   1.859 +@param aIdentifier The window group. 
   1.860 +@param aPosition Ordinal position for the window group. 
   1.861 +@return KErrNone if successful, otherwise another of the system-wide error 
   1.862 +codes. */
   1.863 +	{
   1.864 +	TWsClCmdSetWindowGroupOrdinalPosition params(aIdentifier,aPosition);
   1.865 +	return(WriteReply(&params, sizeof(params),EWsClOpSetWindowGroupOrdinalPosition));
   1.866 +	}
   1.867 +
   1.868 +EXPORT_C TInt RWsSession::GetWindowGroupClientThreadId(TInt aIdentifier, TThreadId &aThreadId) const
   1.869 +/** Gets the thread ID of the client that owns the window group specified by the 
   1.870 +window group identifier.
   1.871 +
   1.872 +This function always causes a flush of the window server buffer.
   1.873 +
   1.874 +@param aIdentifier The window group identifier. 
   1.875 +@param aThreadId On return, contains the thread ID. 
   1.876 +@return KErrNone if successful, otherwise another of the system-wide error 
   1.877 +codes. */
   1.878 +	{
   1.879 +	TPtr8 ptr(reinterpret_cast<TUint8*>(&aThreadId),sizeof(aThreadId));
   1.880 +	return(WriteReplyIntP(aIdentifier,&ptr,EWsClOpGetWindowGroupClientThreadId));
   1.881 +	}
   1.882 +
   1.883 +EXPORT_C TInt RWsSession::GetWindowGroupHandle(TInt aIdentifier) const
   1.884 +/** Gets the handle of the window specified by the window group identifier. 
   1.885 +
   1.886 +This is the handle that was passed as an argument to RWindowGroup::Construct().
   1.887 +
   1.888 +This function always causes a flush of the window server buffer.
   1.889 +
   1.890 +@param aIdentifier The window group identifier.
   1.891 +@return Handle of the window group */
   1.892 +	{
   1.893 +	return(WriteReplyInt(aIdentifier,EWsClOpGetWindowGroupHandle));
   1.894 +	}
   1.895 +
   1.896 +EXPORT_C TInt RWsSession::GetWindowGroupOrdinalPriority(TInt aIdentifier) const
   1.897 +/** Gets a window group's priority.
   1.898 +
   1.899 +This function always causes a flush of the window server buffer.
   1.900 +
   1.901 +@param aIdentifier The window group identifier. 
   1.902 +@return The window group priority. */
   1.903 +	{
   1.904 +	return(WriteReplyInt(aIdentifier,EWsClOpGetWindowGroupOrdinalPriority));
   1.905 +	}
   1.906 +
   1.907 +EXPORT_C TInt RWsSession::SendEventToWindowGroup(TInt aIdentifier, const TWsEvent &aEvent)
   1.908 +/** Sends an event to a window group.
   1.909 +
   1.910 +This function always causes a flush of the window server buffer.
   1.911 +
   1.912 +@param aIdentifier Window group identifier.
   1.913 +@param aEvent Event to send to the window group.
   1.914 +@return KErrNone if successful, KErrPermissionDenied if the client does not have 
   1.915 +the required capability, KErrNoMemory if there is not enough room to add the 
   1.916 +event to the event queue and otherwise another of the system-wide error codes.
   1.917 +@capability SwEvent Required when aEvent.Type() < EEventUser unless the event 
   1.918 +is for a window group owned by this session
   1.919 +
   1.920 +@deprecated */
   1.921 +	{
   1.922 +	TWsClCmdSendEventToWindowGroup params(aIdentifier,aEvent);
   1.923 +	return(WriteReply(&params, sizeof(params),EWsClOpSendEventToWindowGroup));
   1.924 +	}
   1.925 +
   1.926 +EXPORT_C TInt RWsSession::SendEventToAllWindowGroups(const TWsEvent &aEvent)
   1.927 +/** Sends the specified event to all existing window groups.
   1.928 +
   1.929 +This function always causes a flush of the window server buffer.
   1.930 +
   1.931 +@param aEvent The event to be sent to all window groups.
   1.932 +@return KErrNone if successful, KErrPermissionDenied if the client does not have 
   1.933 +the required capability, KErrNoMemory if there is not enough room to add the 
   1.934 +event to all the required event queues (although it may have been added to some 
   1.935 +of them) and otherwise another of the system-wide error codes.
   1.936 +@capability SwEvent Required when aEvent.Type() < EEventUser
   1.937 +
   1.938 +@deprecated */
   1.939 +	{
   1.940 +	TWsClCmdSendEventToWindowGroup params(0,aEvent);
   1.941 +	return(WriteReply(&params, sizeof(params),EWsClOpSendEventToAllWindowGroup));
   1.942 +	}
   1.943 +
   1.944 +EXPORT_C TInt RWsSession::SendEventToAllWindowGroups(TInt aPriority, const TWsEvent &aEvent)
   1.945 +/** Sends the specified event to all window groups with the specified priority.
   1.946 +
   1.947 +This function always causes a flush of the window server buffer.
   1.948 +
   1.949 +@param aPriority The priority which window groups must have to be sent the 
   1.950 +message.
   1.951 +@param aEvent The event to be sent to the specified window groups.
   1.952 +@return KErrNone if successful, KErrPermissionDenied if the client does not have 
   1.953 +the required capability, KErrNoMemory if there is not enough room to add the 
   1.954 +event to all the required event queues (although it may have been added to some 
   1.955 +of them) and otherwise another of the system-wide error codes.
   1.956 +@capability SwEvent Required when aEvent.Type() < EEventUser
   1.957 +
   1.958 +@deprecated  */
   1.959 +	{
   1.960 +	TWsClCmdSendEventToWindowGroup params(aPriority,aEvent);
   1.961 +	return(WriteReply(&params, sizeof(params),EWsClOpSendEventToAllWindowGroupPriority));
   1.962 +	}
   1.963 +
   1.964 +EXPORT_C TInt RWsSession::SendEventToOneWindowGroupsPerClient(const TWsEvent &aEvent)
   1.965 +/** This function always causes a flush of the window server buffer.
   1.966 +@capability SwEvent Required when aEvent.Type() < EEventUser 
   1.967 +
   1.968 +@deprecated  */
   1.969 +	{
   1.970 +	TWsClCmdSendEventToWindowGroup params(0,aEvent);
   1.971 +	return(WriteReply(&params, sizeof(params),EWsClOpSendEventToOneWindowGroupPerClient));
   1.972 +	}
   1.973 +
   1.974 +EXPORT_C TInt RWsSession::GetWindowGroupNameFromIdentifier(TInt aIdentifier, TDes &aWindowName) const
   1.975 +/** Gets the name of a window group from its identifier. 
   1.976 +
   1.977 +Using the list of identifiers returned by WindowGroupList(), it is possible 
   1.978 +to get the names of all window groups in the system. Note that window names 
   1.979 +are a zero length string by default.
   1.980 +
   1.981 +Note that the window group name must have been previously set using RWindowGroup::SetName() 
   1.982 +to contain a meaningful value.
   1.983 +
   1.984 +This function always causes a flush of the window server buffer.
   1.985 +
   1.986 +@param aIdentifier The identifier of the window group whose name is to be 
   1.987 +inquired.
   1.988 +@param aWindowName On return, contains the window group name.
   1.989 +@return KErrNone if successful, otherwise another of the system-wide error 
   1.990 +codes. */
   1.991 +	{
   1.992 +	TWsClCmdGetWindowGroupNameFromIdentifier params(aIdentifier,aWindowName.MaxLength());
   1.993 +	return(WriteReplyP(&params,sizeof(params),&aWindowName,EWsClOpGetWindowGroupNameFromIdentifier));
   1.994 +	}
   1.995 +
   1.996 +EXPORT_C TInt RWsSession::FindWindowGroupIdentifier(TInt aPreviousIdentifier,const TDesC& aMatch,TInt aOffset) const
   1.997 +/** Gets all window groups whose names match a given string, which can contain 
   1.998 +wildcards.
   1.999 +
  1.1000 +An example use of this function might be to find all the currently 
  1.1001 +running instances of a particular application, assuming that the window group 
  1.1002 +name contains the application name. An optional argument, aOffset, specifies 
  1.1003 +the number of characters to be ignored at the beginning of the window group 
  1.1004 +name. As several window group names may match the given string, and the function 
  1.1005 +can return only one at a time, there is an argument, aPreviousIdentifier, 
  1.1006 +which gives the identifier for the previous match that was returned. In other 
  1.1007 +words, it means, "get me the next match after this one." The first time the 
  1.1008 +function is called, give 0 as the previous identifier.
  1.1009 +
  1.1010 +Matching is done using TDesC::MatchF(), which does a folded match. Wildcards 
  1.1011 +'*' and '?' can be used to denote one or more characters and exactly one character, 
  1.1012 +respectively. Windows are searched in front to back order.
  1.1013 +
  1.1014 +This function always causes a flush of the window server buffer.
  1.1015 +
  1.1016 +@param aPreviousIdentifier Identifier of the last window group returned. If 
  1.1017 +the value passed is not a valid identifier, the function returns KErrNotFound. 
  1.1018 +@param aMatch String to match window group name against: may contain wildcards 
  1.1019 +@param aOffset The first aOffset characters of the window group name are ignored 
  1.1020 +when doing the match.
  1.1021 +@return The next window group, after the one identified by aPreviousIdentifier, 
  1.1022 +whose name matches aMatch. KErrNotFound if no window group matched or aPreviousIdentifier 
  1.1023 +was not a valid identifier. */
  1.1024 +	{
  1.1025 +	TWsClCmdFindWindowGroupIdentifier params(aPreviousIdentifier,aOffset, aMatch.Length());
  1.1026 +	return(WriteReply(&params,sizeof(params),aMatch.Ptr(),aMatch.Size(),EWsClOpFindWindowGroupIdentifier));
  1.1027 +	}
  1.1028 +
  1.1029 +EXPORT_C TInt RWsSession::FindWindowGroupIdentifier(TInt aPreviousIdentifier,TThreadId aThreadId) const
  1.1030 +/** Gets the identifiers of window groups belonging to a client which is owned 
  1.1031 +by a thread with the specified thread ID.
  1.1032 +
  1.1033 +The thread may own more than one window group, so the identifier returned 
  1.1034 +is the one after aPreviousIdentifier. The first time the function is called, 
  1.1035 +use 0 for the previous identifier.
  1.1036 +
  1.1037 +This function always causes a flush of the window server buffer.
  1.1038 +
  1.1039 +@param aPreviousIdentifier Identifier returned by previous call 
  1.1040 +@param aThreadId Thread owning the window group or groups. 
  1.1041 +@return Next window group identifier after the one identified by aPreviousIdentifier */
  1.1042 +	{
  1.1043 +	TWsClCmdFindWindowGroupIdentifierThread params(aPreviousIdentifier, aThreadId);
  1.1044 +	return(WriteReply(&params,sizeof(params),EWsClOpFindWindowGroupIdentifierThread));
  1.1045 +	}
  1.1046 +
  1.1047 +EXPORT_C TInt RWsSession::SendMessageToWindowGroup(TInt aIdentifier, TUid aUid, const TDesC8 &aParams)
  1.1048 +/** Sends a message to a window group. 
  1.1049 +
  1.1050 +The window group will then receive an event of type EEventMessageReady notifying 
  1.1051 +it that a message has been received. The window group can belong to this or 
  1.1052 +another session.
  1.1053 +
  1.1054 +In order to receive messages sent using this function you will need to implement 
  1.1055 +the MCoeMessageObserver interface which is defined in the UI Control Framework API.
  1.1056 +
  1.1057 +This function always causes a flush of the window server buffer.
  1.1058 +
  1.1059 +@param aIdentifier The identifier of the window group to receive the message. 
  1.1060 +@param aUid A UID which uniquely identifies the session sending the message. 
  1.1061 +@param aParams The message data. An unlimited amount of data can be passed 
  1.1062 +in this argument. 
  1.1063 +@return KErrNone if successful, otherwise another of the system-wide error 
  1.1064 +codes. 
  1.1065 +@see MCoeMessageObserver 
  1.1066 +
  1.1067 +@deprecated  */
  1.1068 +	{
  1.1069 +	TWsClCmdSendMessageToWindowGroup params(aIdentifier, aUid, aParams.Length(),&aParams);
  1.1070 +	return(WriteReplyByProvidingRemoteReadAccess(&params,sizeof(params),&aParams,EWsClOpSendMessageToWindowGroup));
  1.1071 +	}
  1.1072 +
  1.1073 +EXPORT_C TInt RWsSession::SendMessageToAllWindowGroups(TUid aUid, const TDesC8& aParams)
  1.1074 +/** Sends a message to all window groups.
  1.1075 +
  1.1076 +In order to receive messages sent using this function you will need to implement 
  1.1077 +the MCoeMessageObserver interface which is defined in the UI Control Framework 
  1.1078 +API.
  1.1079 +
  1.1080 +This function always causes a flush of the window server buffer.
  1.1081 +
  1.1082 +@param aUid A UID which uniquely identifies the session sending the message. 
  1.1083 +@param aParams The message data. An unlimited amount of data can be passed 
  1.1084 +in this argument. 
  1.1085 +@return KErrNone if successful, otherwise another of the system-wide error 
  1.1086 +codes. 
  1.1087 +
  1.1088 +@deprecated  */
  1.1089 +	{
  1.1090 +	TWsClCmdSendMessageToWindowGroup params(0, aUid, aParams.Length(),&aParams);
  1.1091 +	return(WriteReplyByProvidingRemoteReadAccess(&params,sizeof(params),&aParams,EWsClOpSendMessageToAllWindowGroups));
  1.1092 +	}
  1.1093 +
  1.1094 +EXPORT_C TInt RWsSession::SendMessageToAllWindowGroups(TInt aPriority, TUid aUid, const TDesC8& aParams)
  1.1095 +/** Sends a message to all window groups with the specified priority.
  1.1096 +
  1.1097 +In order to receive messages sent using this function you will need to implement 
  1.1098 +the MCoeMessageObserver interface which is defined in the UI Control Framework 
  1.1099 +API.
  1.1100 +
  1.1101 +This function always causes a flush of the window server buffer.
  1.1102 +
  1.1103 +@param aPriority The priority which window groups must have to be sent the 
  1.1104 +message. 
  1.1105 +@param aUid A UID which uniquely identifies the session sending the message. 
  1.1106 +@param aParams The message data. An unlimited amount of data can be passed 
  1.1107 +in this argument. 
  1.1108 +@return KErrNone if successful, otherwise another of the system-wide error 
  1.1109 +codes. 
  1.1110 +
  1.1111 +@deprecated  */
  1.1112 +	{
  1.1113 +	TWsClCmdSendMessageToWindowGroup params(aPriority, aUid, aParams.Length(),&aParams);
  1.1114 +	return(WriteReplyByProvidingRemoteReadAccess(&params,sizeof(params),&aParams,EWsClOpSendMessageToAllWindowGroupsPriority));
  1.1115 +	}
  1.1116 +
  1.1117 +EXPORT_C TInt RWsSession::FetchMessage(TUid& aUid, TPtr8& aParams, const TWsEvent& aMessageEvent) const
  1.1118 +/** This function always causes a flush of the window server buffer. */
  1.1119 +	{
  1.1120 +	const SEventMessageReady& eventMessageReady=*(SEventMessageReady*)aMessageEvent.EventData();
  1.1121 +	TUint8* ptr=(TUint8*)User::Alloc(eventMessageReady.iMessageParametersSize);
  1.1122 +	if (ptr==NULL)
  1.1123 +		{
  1.1124 +		aParams.Set(NULL, 0, 0);
  1.1125 +		return KErrNoMemory;
  1.1126 +		}
  1.1127 +	aUid=eventMessageReady.iMessageUid;
  1.1128 +	aParams.Set(ptr, eventMessageReady.iMessageParametersSize, eventMessageReady.iMessageParametersSize);
  1.1129 +	TWsClCmdFetchMessage outGoingParams(eventMessageReady.iWindowGroupIdentifier);
  1.1130 +	const TInt error=WriteReplyP(&outGoingParams, sizeof(outGoingParams), &aParams, EWsClOpFetchMessage); // must be called even if eventMessageReady.iMessageParametersSize==0
  1.1131 +	if (error!=KErrNone)
  1.1132 +		{
  1.1133 +		delete ptr;
  1.1134 +		aParams.Set(NULL, 0, 0);
  1.1135 +		}
  1.1136 +	return error;
  1.1137 +	}
  1.1138 +
  1.1139 +EXPORT_C TInt RWsSession::SetKeyboardRepeatRate(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime)
  1.1140 +/** Sets the system-wide keyboard repeat rate. 
  1.1141 +
  1.1142 +This is the rate at which keyboard events are generated when a key is held 
  1.1143 +down.
  1.1144 +
  1.1145 +The default settings for the keyboard repeat rate are 0.3 seconds for the 
  1.1146 +initial delay, and 0.1 seconds for the interval between subsequent repeats. 
  1.1147 +However, since the settings are system-wide, these will not necessarily be 
  1.1148 +the current settings when an application is launched: the settings may have 
  1.1149 +been over-ridden by another module.
  1.1150 +
  1.1151 +This function always causes a flush of the window server buffer.
  1.1152 +
  1.1153 +@param aInitialTime Time before first repeat key event 
  1.1154 +@param aTime Time between subsequent repeat key events 
  1.1155 +@return KErrNone if successful, otherwise another of the system-wide error 
  1.1156 +codes. 
  1.1157 +@see GetKeyboardRepeatRate()
  1.1158 +@capability WriteDeviceData */
  1.1159 +	{
  1.1160 +	TWsClCmdSetKeyboardRepeatRate repeat(aInitialTime,aTime);
  1.1161 +	return(WriteReply(&repeat,sizeof(repeat),EWsClOpSetKeyboardRepeatRate));
  1.1162 +	}
  1.1163 +
  1.1164 +EXPORT_C void RWsSession::GetKeyboardRepeatRate(TTimeIntervalMicroSeconds32 &aInitialTime, TTimeIntervalMicroSeconds32 &aTime) const
  1.1165 +/** Gets the current system-wide settings for the keyboard repeat rate.
  1.1166 +
  1.1167 +This function always causes a flush of the window server buffer.
  1.1168 +
  1.1169 +@param aInitialTime Time before first repeat key event 
  1.1170 +@param aTime Time between subsequent repeat key events 
  1.1171 +@see SetKeyboardRepeatRate() */
  1.1172 +	{
  1.1173 +	TPckgBuf<SKeyRepeatSettings> settings;
  1.1174 +	WriteReplyP(&settings,EWsClOpGetKeyboardRepeatRate);
  1.1175 +	aInitialTime=settings().iInitialTime;
  1.1176 +	aTime=settings().iTime;
  1.1177 +	}
  1.1178 +
  1.1179 +EXPORT_C TInt RWsSession::SetDoubleClick(const TTimeIntervalMicroSeconds32 &aInterval, TInt aDistance)
  1.1180 +/** Sets the system-wide double click settings.
  1.1181 +
  1.1182 +Double click distance is measured, in pixels, as the sum of the X distance 
  1.1183 +moved and the Y distance moved between clicks. For example: a first click 
  1.1184 +at 10, 20 and a second click at 13,19 gives a distance of (13-10)+(21-20) = 4.
  1.1185 +
  1.1186 +This function always causes a flush of the window server buffer.
  1.1187 +
  1.1188 +@param aInterval Maximum interval between clicks that constitutes a double 
  1.1189 +click 
  1.1190 +@param aDistance Maximum distance between clicks that constitutes a double 
  1.1191 +click
  1.1192 +@return KErrNone if successful, otherwise another of the system-wide error 
  1.1193 +codes.
  1.1194 +@see GetDoubleClickSettings()
  1.1195 +@capability WriteDeviceData */
  1.1196 +	{
  1.1197 +	TWsClCmdSetDoubleClick dblClick(aInterval,aDistance);
  1.1198 +	return(WriteReply(&dblClick,sizeof(dblClick),EWsClOpSetDoubleClick));
  1.1199 +	}
  1.1200 +
  1.1201 +EXPORT_C void RWsSession::GetDoubleClickSettings(TTimeIntervalMicroSeconds32 &aInterval, TInt &aDistance) const
  1.1202 +/** Gets the current system-wide settings for pointer double clicks.
  1.1203 +
  1.1204 +Double click distances are measured in pixels as the sum of the X distance 
  1.1205 +moved and the Y distance moved between clicks. For example: a first click 
  1.1206 +at 10, 20 and a second click at 13,19 gives a distance of (13-10)+(21-20) = 4.
  1.1207 +
  1.1208 +This function always causes a flush of the window server buffer.
  1.1209 +
  1.1210 +@param aInterval Maximum interval between clicks that constitutes a double 
  1.1211 +click 
  1.1212 +@param aDistance Maximum distance between clicks that constitutes a double 
  1.1213 +click 
  1.1214 +@see SetDoubleClick() */
  1.1215 +	{
  1.1216 +	TPckgBuf<SDoubleClickSettings> settings;
  1.1217 +	WriteReplyP(&settings,EWsClOpGetDoubleClickSettings);
  1.1218 +	aInterval=settings().iInterval;
  1.1219 +	aDistance=settings().iDistance;
  1.1220 +	}
  1.1221 +
  1.1222 +EXPORT_C void RWsSession::SetBackgroundColor(TRgb aColor)
  1.1223 +/** Sets the background colour for the window server. 
  1.1224 +
  1.1225 +This background can only be seen in areas of the display that have no windows 
  1.1226 +on them: so for many applications it will never be seen. It affects no 
  1.1227 +other windows.
  1.1228 +
  1.1229 +@param aColor Background colour */
  1.1230 +	{
  1.1231 +	WriteInt(aColor.Internal(),EWsClOpSetBackgroundColor);
  1.1232 +	}
  1.1233 +
  1.1234 +EXPORT_C TRgb RWsSession::GetBackgroundColor() const
  1.1235 +/** Gets the window server's background colour.
  1.1236 +
  1.1237 +This function always causes a flush of the window server buffer.
  1.1238 +
  1.1239 +@return Background colour */
  1.1240 +	{
  1.1241 +	TRgb col;
  1.1242 +	col.SetInternal((TUint32)WriteReply(EWsClOpGetBackgroundColor));
  1.1243 +	return col;
  1.1244 +	}
  1.1245 +
  1.1246 +EXPORT_C TInt RWsSession::RegisterSurface(TInt aScreenNumber, const TSurfaceId& aSurface)
  1.1247 +/**
  1.1248 +This function registers a surface for use in composition on the screen associated 
  1.1249 +with this device within this session.
  1.1250 +
  1.1251 +A surface may be registered as a separate step before it is added as a background surface 
  1.1252 +for a window created in the same session and that is displayed on this screen. This then 
  1.1253 +allows content to be provisioned before the surface is displayed for the first time, and 
  1.1254 +to be kept "live" while not assigned to any window.
  1.1255 +
  1.1256 +A surface can be successfully registered in multiple sessions and on multiple screens, but 
  1.1257 +only once for a given combination of session and screen.
  1.1258 +
  1.1259 +The client should call UnregisterSurface when finished with the surface registered using 
  1.1260 +this method. The surface will be automatically unregistered if necessary when the session closes.
  1.1261 +
  1.1262 +@param aScreenNumber The screen to which to register.
  1.1263 +@param aSurface The surface to be registered.
  1.1264 +@return KErrNone on success or a system-wide error code
  1.1265 +	- KErrNoMemory if registration fails due to low memory.
  1.1266 +	- KErrInUse if the surface ID is already registered for this session and screen.
  1.1267 +@pre aSurface has been initialized and is compatible with being composited on this device's 
  1.1268 +screen; otherwise the client thread is panicked with code EWservPanicIncompatibleSurface.
  1.1269 +@pre aScreenNumber is an acceptable screen number. Otherwise the client thread is panicked 
  1.1270 +with code EWservPanicScreenNumber.
  1.1271 +@post The surface has been successfully registered for use in composition on this device's screen.
  1.1272 +@post The surface’s content is in an undefined state, but the surface remains initialized.
  1.1273 +@post This function always causes a flush of the WServ session buffer.
  1.1274 +@see UnregisterSurface
  1.1275 +
  1.1276 +@publishedPartner
  1.1277 +@prototype
  1.1278 +*/
  1.1279 +	{
  1.1280 +	(void) aScreenNumber;	//avoid unreferenced warning
  1.1281 +	(void) aSurface;	//avoid unreferenced warning
  1.1282 +	return KErrNotSupported;
  1.1283 +	}
  1.1284 +
  1.1285 +EXPORT_C void RWsSession::UnregisterSurface(TInt aScreenNumber, const TSurfaceId& aSurface)
  1.1286 +/**
  1.1287 +This function removes the surface from the session's register of surfaces that are used in 
  1.1288 +composition on the screen associated with this device.
  1.1289 +
  1.1290 +Calling this function with a surface that is not currently explicitly registered on this screen 
  1.1291 +in this session by RegisterSurface() will have no effect.
  1.1292 +
  1.1293 +Calling this function while the surface is still assigned to a window will have no immediate 
  1.1294 +effect. However, when the surface is unassigned from the window, and is not held by another 
  1.1295 +session it will then be automatically unregistered.
  1.1296 +
  1.1297 +An unregistered surface can be re-registered again, if necessary.
  1.1298 +
  1.1299 +This function does not explicitly force a flush of the WServ session buffer. Internal reference 
  1.1300 +counting will keep the Surface ID "live" until the client code has released any handles and 
  1.1301 +provisioners, and WServ processes the buffered remove command, and the final frame containing 
  1.1302 +this surface has finished being displayed.
  1.1303 +
  1.1304 +@param aScreenNumber The screen to which to unregister.
  1.1305 +@param aSurface The surface to be unregistered.
  1.1306 +@pre aSurface has been initialized; otherwise the client thread is panicked with 
  1.1307 +code EWservPanicIncompatibleSurface.
  1.1308 +@pre aScreenNumber is an acceptable screen number. Otherwise the client thread is 
  1.1309 +panicked with code EWservPanicScreenNumber.
  1.1310 +@post If no window is using the surface, then it is unregistered on this screen in this session.
  1.1311 +@see RegisterSurface
  1.1312 +
  1.1313 +@publishedPartner
  1.1314 +@prototype
  1.1315 +*/
  1.1316 +	{
  1.1317 +	(void) aScreenNumber;	//avoid unreferenced warning
  1.1318 +	(void) aSurface;	//avoid unreferenced warning
  1.1319 +	}
  1.1320 +
  1.1321 +EXPORT_C TInt RWsSession::PreferredSurfaceConfigurationSize() const
  1.1322 +/**
  1.1323 +Returns the window server's preferred size for the TSurfaceConfiguration object, used 
  1.1324 +for RWindow::SetBackgroundSurface.
  1.1325 +
  1.1326 +Client code is permitted to present any defined version of the TSurfaceConfiguration 
  1.1327 +class, distinguished by its size. If smaller, earlier versions are presented, the server 
  1.1328 +will substitute the stated default values. If later, larger, structures are presented to 
  1.1329 +the server then the additional data will be ignored.
  1.1330 +
  1.1331 +However, by using this method, the client can fine-tune its use of the interface, avoiding 
  1.1332 +generating attribute data that may not be supported, or reduce the options presented to users.
  1.1333 +
  1.1334 +@return The preferred size in bytes
  1.1335 +	- Should match one of the TSurfaceConfiguration classes defined in the client's header 
  1.1336 +	file, or be larger than them all, indicating a version newer that the client is compiled for.
  1.1337 +	- If the server does not support surface configuration 
  1.1338 +		- Return KErrNotSupported.
  1.1339 +
  1.1340 +@publishedPartner
  1.1341 +@prototype
  1.1342 +*/
  1.1343 +	{
  1.1344 +	return KErrNotSupported;
  1.1345 +	}
  1.1346 +
  1.1347 +EXPORT_C TInt RWsSession::SetSystemPointerCursor(const RWsPointerCursor &aPointerCursor,TInt aCursorNumber)
  1.1348 +/** Sets a cursor in the system pointer cursor list. 
  1.1349 +
  1.1350 +To gain access to the list, the client must first call ClaimSystemPointerCursorList().
  1.1351 +
  1.1352 +This function always causes a flush of the window server buffer.
  1.1353 +
  1.1354 +@param aPointerCursor Pointer cursor to set in the list 
  1.1355 +@param aCursorNumber Cursor number in the list 
  1.1356 +@return KErrNone if successful, otherwise another of the system-wide error 
  1.1357 +codes. */
  1.1358 +	{
  1.1359 +	TWsClCmdSetSystemPointerCursor setpc;
  1.1360 +	setpc.handle=aPointerCursor.WsHandle();
  1.1361 +	setpc.number=aCursorNumber;
  1.1362 +	return(WriteReply(&setpc,sizeof(setpc),EWsClOpSetSystemPointerCursor));
  1.1363 +	}
  1.1364 +
  1.1365 +EXPORT_C void RWsSession::ClearSystemPointerCursor(TInt aCursorNumber)
  1.1366 +/** Clears a system pointer cursor from the list. 
  1.1367 +
  1.1368 +Before calling this function, the client must first gain access to the list 
  1.1369 +by calling ClaimSystemPointerCursorList().
  1.1370 +
  1.1371 +@param aCursorNumber Cursor number to clear */
  1.1372 +	{
  1.1373 +	WriteInt(aCursorNumber,EWsClOpClearSystemPointerCursor);
  1.1374 +	}
  1.1375 +
  1.1376 +EXPORT_C TInt RWsSession::ClaimSystemPointerCursorList()
  1.1377 +/** Claims the system pointer cursor list.
  1.1378 +
  1.1379 +You must call this function before you can call SetSystemPointerCursor() or 
  1.1380 +ClearSystemPointerCursor().
  1.1381 +
  1.1382 +This function always causes a flush of the window server buffer.
  1.1383 +
  1.1384 +@return KErrNone if successful, KErrInUse if another client is already using 
  1.1385 +the system pointer cursor list, otherwise another of the system-wide error 
  1.1386 +codes. 
  1.1387 +@see FreeSystemPointerCursorList()
  1.1388 +@capability WriteDeviceData */
  1.1389 +	{
  1.1390 +	return(WriteReply(EWsClOpClaimSystemPointerCursorList));
  1.1391 +	}
  1.1392 +
  1.1393 +EXPORT_C void RWsSession::FreeSystemPointerCursorList()
  1.1394 +/** Releases the system pointer cursor list and deletes all the entries in it. 
  1.1395 +
  1.1396 +A client should call this function when it no longer needs the system pointer 
  1.1397 +cursor list. */
  1.1398 +	{
  1.1399 +	if (iWsHandle)
  1.1400 +		Write(EWsClOpFreeSystemPointerCursorList);
  1.1401 +	}
  1.1402 +
  1.1403 +EXPORT_C TInt RWsSession::SetCustomTextCursor(TInt aIdentifier, const TArray<TSpriteMember>& aSpriteMemberArray, TUint aSpriteFlags, TCustomTextCursorAlignment aAlignment)
  1.1404 +/** Adds a custom text cursor to the server's list of cursors.
  1.1405 +
  1.1406 +After adding a custom text cursor, it can be selected for use by calling 
  1.1407 +RWindowGroup::SetTextCursor().
  1.1408 +
  1.1409 +Note that once added, custom text cursors cannot be removed.
  1.1410 +
  1.1411 +This function always causes a flush of the window server buffer.
  1.1412 +
  1.1413 +@param aIdentifier The unique identifier for the cursor.
  1.1414 +@param aSpriteMemberArray An array defining the bitmap(s) that make up the 
  1.1415 +cursor. Typically, this array will contain a single element for a static, 
  1.1416 +non-animated cursor.
  1.1417 +@param aSpriteFlags Flags affecting the sprite behaviour. For possible values 
  1.1418 +see TSpriteFlags.
  1.1419 +@param aAlignment The vertical alignment of the cursor sprite.
  1.1420 +@return KErrNone if successful, KErrAlreadyExists if a custom cursor with the 
  1.1421 +specified identifier already exists, or another of the standard system wide 
  1.1422 +error codes. */
  1.1423 +	{
  1.1424 +	// Create the cursor
  1.1425 +	TWsClCmdCustomTextCursorData params;
  1.1426 +	params.identifier = aIdentifier;
  1.1427 +	params.flags = aSpriteFlags;
  1.1428 +	params.alignment = aAlignment;
  1.1429 +	const TInt handle = iBuffer->WriteReplyWs(&params, sizeof(params), EWsClOpStartSetCustomTextCursor);
  1.1430 +	if (handle < 0)
  1.1431 +		{
  1.1432 +		return handle; // Failed to create
  1.1433 +		}
  1.1434 +
  1.1435 +	RWsCustomTextCursor cursor(*this, handle);
  1.1436 +	TInt err = KErrNone;
  1.1437 +	for (TInt ii = 0; ii < aSpriteMemberArray.Count(); ii++)
  1.1438 +		{
  1.1439 +		err = cursor.AppendMember(aSpriteMemberArray[ii]);
  1.1440 +		if (err != KErrNone)
  1.1441 +			{
  1.1442 +			break;
  1.1443 +			}
  1.1444 +		}
  1.1445 +	cursor.Close();
  1.1446 +	err = iBuffer->WriteReplyWs(&err, sizeof(err), EWsClOpCompleteSetCustomTextCursor);
  1.1447 +	return err;
  1.1448 +	}
  1.1449 +
  1.1450 +EXPORT_C TInt RWsSession::SetModifierState(TEventModifier aModifier,TModifierState aState)
  1.1451 +/** Sets the state of the modifier keys. 
  1.1452 +
  1.1453 +This function is typically used for permanent modifier states such as Caps 
  1.1454 +Lock or Num Lock, but other possible uses include on-screen function key simulation, 
  1.1455 +or the implementation of a Shift Lock key.
  1.1456 +
  1.1457 +This function always causes a flush of the window server buffer.
  1.1458 +
  1.1459 +@param aModifier Modifier to set. 
  1.1460 +@param aState Modifier state.
  1.1461 +@return KErrNone if successful, otherwise another of the system-wide error 
  1.1462 +codes. 
  1.1463 +@see GetModifierState()
  1.1464 +@capability WriteDeviceData */
  1.1465 +	{
  1.1466 +	TWsClCmdSetModifierState params;
  1.1467 +	params.modifier=aModifier;
  1.1468 +	params.state=aState;
  1.1469 +	return(WriteReply(&params,sizeof(params),EWsClOpSetModifierState));
  1.1470 +	}
  1.1471 +
  1.1472 +EXPORT_C TInt RWsSession::GetModifierState() const
  1.1473 +/** Gets the state of the modifier keys.
  1.1474 +
  1.1475 +The state of each modifier key (defined in TEventModifier) is returned in 
  1.1476 +a bitmask.
  1.1477 +
  1.1478 +This function always causes a flush of the window server buffer.
  1.1479 +
  1.1480 +@return Modifier state 
  1.1481 +@see TEventModifier */
  1.1482 +	{
  1.1483 +	return(WriteReply(EWsClOpGetModifierState));
  1.1484 +	}
  1.1485 +
  1.1486 +EXPORT_C TInt RWsSession::HeapCount() const
  1.1487 +/** Gets the heap count.
  1.1488 +
  1.1489 +This function calls RHeap::Count() on the window server's heap, after throwing 
  1.1490 +away all the temporary objects allocated for each window.
  1.1491 +
  1.1492 +This function always causes a flush of the window server buffer.
  1.1493 +
  1.1494 +@return The window server's heap count. */
  1.1495 +	{
  1.1496 +	return(WriteReply(EWsClOpHeapCount));
  1.1497 +	}
  1.1498 +
  1.1499 +EXPORT_C TInt RWsSession::DebugInfo(TInt aFunction, TInt aParam) const
  1.1500 +	{
  1.1501 +	TWsClCmdDebugInfo params(aFunction,aParam);
  1.1502 +	return(WriteReply(&params,sizeof(params),EWsClOpDebugInfo));
  1.1503 +	}
  1.1504 +
  1.1505 +EXPORT_C TInt RWsSession::DebugInfo(TInt aFunction, TDes8& aReturnBuf, TInt aParam) const
  1.1506 +	{
  1.1507 +	TWsClCmdDebugInfo params(aFunction,aParam);
  1.1508 +	return(WriteReplyP(&params,sizeof(params),TWriteDescriptorType(&aReturnBuf),EWsClOpDebugInfoReplyBuf));
  1.1509 +	}
  1.1510 +
  1.1511 +EXPORT_C TInt RWsSession::ResourceCount() const
  1.1512 +/** Gets the number of objects that the server has allocated for that client.
  1.1513 +
  1.1514 +This function can be used to check that the client has correctly cleaned up 
  1.1515 +all of its objects.
  1.1516 +
  1.1517 +It always causes a flush of the window server buffer.
  1.1518 +
  1.1519 +@return The number of resources allocated to the client. */
  1.1520 +	{
  1.1521 +	return(iWsHandle ? WriteReply(EWsClOpResourceCount) : 0);
  1.1522 +	}
  1.1523 +
  1.1524 +EXPORT_C void RWsSession::PasswordEntered()
  1.1525 +/** Disables the window server password mode.
  1.1526 +
  1.1527 +This function must be called by the session which owns the password window 
  1.1528 +when the correct machine password has been entered. 
  1.1529 +
  1.1530 +@deprecated */
  1.1531 +	{
  1.1532 +	Write(EWsClOpPasswordEntered);
  1.1533 +	}
  1.1534 +
  1.1535 +EXPORT_C void RWsSession::HeapSetFail(TInt aTAllocFail,TInt aValue)
  1.1536 +/** Sets the heap failure mode in the window server.
  1.1537 +
  1.1538 +The release version of the base does not support simulated heap failure functionality, 
  1.1539 +and the result of this function is additional error messages. In the debug 
  1.1540 +version the clients are notified of the simulated failure and handle it. See 
  1.1541 +RHeap::__DbgSetAllocFail() for more information.
  1.1542 +
  1.1543 +Note:
  1.1544 +
  1.1545 +It is unlikely, but possible to create a ROM with a mixture of Release and 
  1.1546 +Debug versions of the Base and Window Server DLLs, which results in different 
  1.1547 +behaviour to that described above. If you run a debug Window Server with a 
  1.1548 +release version of the Base, then calling this function will result in neither 
  1.1549 +extra error messages (e.g. EDrawingRegion) nor simulated heap failures. However 
  1.1550 +if you have a release Window Server with a debug Base then you will get both 
  1.1551 +simulated heap failures and the extra error messages.
  1.1552 +
  1.1553 +This function always causes a flush of the window server buffer.
  1.1554 +
  1.1555 +@param aTAllocFail A value from the RHeap::TAllocFail enumeration which 
  1.1556 +indicates how to simulate heap allocation failure. 
  1.1557 +@param aValue The rate of failure; when aType is RHeap::EDeterministic, heap 
  1.1558 +allocation fails every aRate attempt 
  1.1559 +@see RHeap::__DbgSetAllocFail()
  1.1560 +@capability WriteDeviceData */
  1.1561 +	{
  1.1562 +	TWsClCmdHeapSetFail params;
  1.1563 +	params.type=(RHeap::TAllocFail)aTAllocFail;
  1.1564 +	params.value=aValue;
  1.1565 +	params.burst=-1;
  1.1566 +	WriteReply(&params,sizeof(params),EWsClOpHeapSetFail);
  1.1567 +	}
  1.1568 +
  1.1569 +EXPORT_C void RWsSession::HeapSetBurstFail(TInt aTAllocFail,TInt aRate,TInt aBurst)
  1.1570 +/** Sets the heap failure burst mode in the window server.
  1.1571 +
  1.1572 +The release version of the base does not support simulated heap failure functionality, 
  1.1573 +and the result of this function is additional error messages. In the debug 
  1.1574 +version the clients are notified of the simulated failure and handle it. See 
  1.1575 +RHeap::__DbgSetBurstAllocFail() for more information.
  1.1576 +
  1.1577 +Note:
  1.1578 +
  1.1579 +It is unlikely, but possible to create a ROM with a mixture of Release and 
  1.1580 +Debug versions of the Base and Window Server DLLs, which results in different 
  1.1581 +behaviour to that described above. If you run a debug Window Server with a 
  1.1582 +release version of the Base, then calling this function will result in neither 
  1.1583 +extra error messages (e.g. EDrawingRegion) nor simulated heap failures. However 
  1.1584 +if you have a release Window Server with a debug Base then you will get both 
  1.1585 +simulated heap failures and the extra error messages.
  1.1586 +
  1.1587 +This function always causes a flush of the window server buffer.
  1.1588 +
  1.1589 +@param aTAllocFail A value from the RHeap::TAllocFail enumeration which 
  1.1590 +indicates how to simulate heap allocation failure. 
  1.1591 +@param aRate The rate of failure; when aType is RHeap::EDeterministic, heap 
  1.1592 +allocation fails every aRate attempt.
  1.1593 +@param aBurst The number of consecutive allocations that should fail.
  1.1594 +@see RHeap::__DbgSetBurstAllocFail()
  1.1595 +@capability WriteDeviceData */
  1.1596 +	{
  1.1597 +	TWsClCmdHeapSetFail params;
  1.1598 +	params.type=(RHeap::TAllocFail)aTAllocFail;
  1.1599 +	params.value=aRate;
  1.1600 +	params.burst=aBurst;
  1.1601 +	WriteReply(&params,sizeof(params),EWsClOpHeapSetFail);
  1.1602 +	}
  1.1603 +
  1.1604 +EXPORT_C TInt RWsSession::RequestOffEvents(TBool aOn,RWindowTreeNode *aWin/*=NULL*/)
  1.1605 +/** Requests the window server to send OFF events to a window. 
  1.1606 +
  1.1607 +After calling this function, the window server sends OFF events to the window 
  1.1608 +when an event occurs which requires power down, rather than handling powering 
  1.1609 +down itself.
  1.1610 +
  1.1611 +Notes:
  1.1612 +
  1.1613 +Any client can ask for OFF events, but only one window in the system can be 
  1.1614 +set to receive them. If this function is called when another window is set 
  1.1615 +to receive OFF events then the client will be panicked. The exception is the 
  1.1616 +shell, which is allowed to take receipt of OFF events from other clients.
  1.1617 +
  1.1618 +The window server identifies the shell client by comparing the process name 
  1.1619 +of the client with the process name of the shell. Only the first client created 
  1.1620 +by the shell is guaranteed to have the extra shell client privileges.
  1.1621 +
  1.1622 +If the shell dies or terminates just before the action requiring power down 
  1.1623 +happens then the window server will handle it rather than passing it on to 
  1.1624 +the shell.
  1.1625 +
  1.1626 +The window server has a queue of messages that it is waiting to send to clients. 
  1.1627 +If the shell's client's queue is full and the window server cannot make room 
  1.1628 +for the OFF message then it will power down the machine itself.
  1.1629 +
  1.1630 +This function always causes a flush of the window server buffer.
  1.1631 +
  1.1632 +@param aOn ETrue to get the window server to send EEventShellSwitchOff messages 
  1.1633 +to the shell (rather than powering down). EFalse makes the window server switch 
  1.1634 +back to powering down the machine itself. 
  1.1635 +@param aWin The handle to the window or window group of the shell to which 
  1.1636 +the message is to be sent. This may be NULL only if aOn=EFalse, in other words, 
  1.1637 +the window server is handling power down itself. If aOn=ETrue then this must not 
  1.1638 +be NULL, or the Window Server will panic the shell. Note that as far as the window 
  1.1639 +server is concerned the handle must exist when this function is called.
  1.1640 +@return KErrNone if successful, otherwise one of the system-wide error codes. 
  1.1641 +@panic WSERV 51 aOn is true, but no window was specified (aWin is NULL). 
  1.1642 +@capability PowerMgmt */
  1.1643 +	{
  1.1644 +	TWsClCmdOffEventsToShell OffEventsToShell(aOn,(aWin ? aWin->WsHandle():0));
  1.1645 +	return WriteReply(&OffEventsToShell,sizeof(OffEventsToShell),EWsClOpSendOffEventsToShell);
  1.1646 +	}
  1.1647 +
  1.1648 +EXPORT_C TDisplayMode RWsSession::GetDefModeMaxNumColors(TInt& aColor,TInt& aGray) const
  1.1649 +/** Gets the number of colours available in the richest supported colour mode, the 
  1.1650 +number of greys available in the richest grey mode, and returns the default 
  1.1651 +display mode.
  1.1652 +
  1.1653 +This function always causes a flush of the window server buffer.
  1.1654 +
  1.1655 +@param aColor The number of colours in the richest supported colour mode. 
  1.1656 +@param aGray The number of greys in the richest supported grey mode. 
  1.1657 +@return The default display mode. */
  1.1658 +	{	
  1.1659 +	return GetDefModeMaxNumColors(KDummyScreenNumber,aColor,aGray);
  1.1660 +	}
  1.1661 +
  1.1662 +EXPORT_C TDisplayMode RWsSession::GetDefModeMaxNumColors(TInt aScreenNumber,TInt& aColor,TInt& aGray) const
  1.1663 +/** Gets the number of colours available in the richest supported colour mode, the 
  1.1664 +number of greys available in the richest grey mode, and returns the default 
  1.1665 +display mode, on the specified screen.
  1.1666 +
  1.1667 +This function always causes a flush of the window server buffer.
  1.1668 +
  1.1669 +@param aScreenNumber specifies the screen.
  1.1670 +@param aColor The number of colours in the richest supported colour mode. 
  1.1671 +@param aGray The number of greys in the richest supported grey mode. 
  1.1672 +@return The default display mode. */
  1.1673 +	{
  1.1674 +	TPckgBuf<SDefModeMaxNumColors> colors;	
  1.1675 +	WriteReplyIntP(aScreenNumber,&colors,EWsClOpGetDefModeMaxNumColors);
  1.1676 +	aColor=colors().iColors;
  1.1677 +	aGray=colors().iGrays;
  1.1678 +	return colors().iDisplayMode;
  1.1679 +	}
  1.1680 +
  1.1681 +#define MODE_TO_FLAG(x) 1<<(x-1)
  1.1682 +
  1.1683 +LOCAL_C void HandleColorMode(CArrayFix<TInt>* aModeList,TUint aModeBits, TInt& aNumberOfModes, TInt aMode)
  1.1684 +	{
  1.1685 +	if (aModeBits&(MODE_TO_FLAG(aMode)))
  1.1686 +		{
  1.1687 +		if (aModeList!=NULL)
  1.1688 +			{
  1.1689 +			(*aModeList)[aNumberOfModes]=aMode;
  1.1690 +			}
  1.1691 +		++aNumberOfModes;
  1.1692 +		}
  1.1693 +	}
  1.1694 +
  1.1695 +LOCAL_C TInt DoGetColorModeList(CArrayFix<TInt>* aModeList,TUint aModeBits)
  1.1696 +	{
  1.1697 +	TInt numberOfModes=0;
  1.1698 +	for (TInt mode=EGray2; mode<=EColor256; ++mode)
  1.1699 +		{
  1.1700 +		HandleColorMode(aModeList,aModeBits,numberOfModes,mode);
  1.1701 +		}
  1.1702 +	HandleColorMode(aModeList,aModeBits,numberOfModes,EColor4K);
  1.1703 +	HandleColorMode(aModeList,aModeBits,numberOfModes,EColor64K);
  1.1704 +	HandleColorMode(aModeList,aModeBits,numberOfModes,EColor16M);
  1.1705 +	HandleColorMode(aModeList,aModeBits,numberOfModes,EColor16MU);
  1.1706 +	HandleColorMode(aModeList,aModeBits,numberOfModes,EColor16MA);
  1.1707 +	HandleColorMode(aModeList,aModeBits,numberOfModes,EColor16MAP);
  1.1708 +	return numberOfModes;
  1.1709 +	}
  1.1710 +
  1.1711 +EXPORT_C TInt RWsSession::GetColorModeList(CArrayFixFlat<TInt> *aModeList) const
  1.1712 +/** Gets the list of available colour modes.
  1.1713 +
  1.1714 +Note that this function should usually be called within User::LeaveIfError(). 
  1.1715 +The only time that an error can be generated is when the array gets resized 
  1.1716 +to the number of display modes. Thus if you make the size of your array equal 
  1.1717 +to the maximum number of display modes over all hardware (this is the number 
  1.1718 +of different values in TDisplayMode) then this function will never leave.
  1.1719 +
  1.1720 +This function always causes a flush of the window server buffer.
  1.1721 +
  1.1722 +@param aModeList On return, contains a TDisplayMode entry for each of the 
  1.1723 +available display modes. Note that the array's contents are deleted prior 
  1.1724 +to filling with display mode information. 
  1.1725 +@return The number of color modes if the parameter is passed NULL. Otherwise KErrNone or KErrNoMemory. */
  1.1726 +	{
  1.1727 +	return GetColorModeList(KDummyScreenNumber,aModeList);
  1.1728 +	}
  1.1729 +
  1.1730 +EXPORT_C TInt RWsSession::GetColorModeList(TInt aScreenNumber,CArrayFixFlat<TInt>* aModeList) const
  1.1731 +/** Gets the list of available colour modes on a particular screen.
  1.1732 +
  1.1733 +Note that this function should usually be called within User::LeaveIfError(). 
  1.1734 +The only time that an error can be generated is when the array gets resized 
  1.1735 +to the number of display modes. Thus if you make the size of your array equal 
  1.1736 +to the maximum number of display modes over all hardware (this is the number 
  1.1737 +of different values in TDisplayMode) then this function will never leave.
  1.1738 +
  1.1739 +This function always causes a flush of the window server buffer.
  1.1740 +
  1.1741 +@param aModeList On return, contains a TDisplayMode entry for each of the 
  1.1742 +available display modes. Note that the array's contents are deleted prior 
  1.1743 +to filling with display mode information.
  1.1744 +@param aScreenNumber specifies the screen.  
  1.1745 +@return The number of color modes if the parameter is passed NULL. Otherwise KErrNone or KErrNoMemory. */
  1.1746 +	{
  1.1747 +	const TUint modeList=STATIC_CAST(TUint,WriteReplyInt(aScreenNumber,EWsClOpGetColorModeList));	
  1.1748 +	const TInt numberOfModes=DoGetColorModeList(NULL, modeList);
  1.1749 +	if (aModeList==NULL)
  1.1750 +		{
  1.1751 +		return numberOfModes;
  1.1752 +		}
  1.1753 +	TRAPD(error,aModeList->ResizeL(numberOfModes));
  1.1754 +	if (error!=KErrNone)
  1.1755 +		{
  1.1756 +		return error;
  1.1757 +		}
  1.1758 +	DoGetColorModeList(aModeList, modeList);
  1.1759 +	return KErrNone;
  1.1760 +	}
  1.1761 +
  1.1762 +EXPORT_C void RWsSession::SetPointerCursorArea(const TRect& aArea)
  1.1763 +/** 
  1.1764 +@publishedPartner
  1.1765 +@released
  1.1766 +
  1.1767 +Sets the area of the screen in which the virtual cursor can be used while in 
  1.1768 +relative mouse mode, for the first screen display mode. 
  1.1769 +
  1.1770 +This function sets the area for the first screen mode - the one with index 
  1.1771 +0, which in most devices will be the only screen mode. The other function 
  1.1772 +overload can be used to set the screen area for other modes. The area is set 
  1.1773 +and stored independently on each screen mode, so that it is not necessary 
  1.1774 +to call this function again when switching back to the first screen mode.
  1.1775 +
  1.1776 +The default area is the full digitiser area. When you set the area it will 
  1.1777 +come into immediate affect, i.e. if necessary the current pointer position 
  1.1778 +will be updated to be within the new area. 
  1.1779 +
  1.1780 +Notes:
  1.1781 +
  1.1782 +Relative mouse mode is where the events received from the base by window server 
  1.1783 +are deltas from the last position of the pointer, as opposed to absolute co-ordinates.
  1.1784 +
  1.1785 +This function is honoured even if there is a mouse or pen (e.g. on the emulator), 
  1.1786 +by mapping the co-ordinates of where you click into the area set using this 
  1.1787 +function. However the function does not restrict clicks outside of the 'drawing 
  1.1788 +area' on the Emulator, to allow you to select items on the fascia.
  1.1789 +
  1.1790 +@param aArea The area of the screen in which the virtual cursor can be used. 
  1.1791 +@capability WriteDeviceData */
  1.1792 +	{
  1.1793 +	SetPointerCursorArea(0,aArea);
  1.1794 +	}
  1.1795 +
  1.1796 +EXPORT_C void RWsSession::SetPointerCursorArea(TInt aScreenSizeMode,const TRect& aArea)
  1.1797 +/** Sets the area of the screen in which the virtual cursor can be used while in 
  1.1798 +relative mouse mode, for a specified screen display mode. 
  1.1799 +
  1.1800 +The default area is the full digitiser area for the given mode. When you set 
  1.1801 +the area it will come into immediate affect, i.e. if necessary the current 
  1.1802 +pointer position will be updated to be within the new area. 
  1.1803 +
  1.1804 +The area is set and stored independently on each screen mode, so that it is 
  1.1805 +not necessary to call this function again when switching back to a mode. 
  1.1806 +
  1.1807 +Notes:
  1.1808 +
  1.1809 +Relative mouse mode is where the events received from the base by window server 
  1.1810 +are deltas from the last position of the pointer, as opposed to absolute co-ordinates.
  1.1811 +
  1.1812 +The previous function overload may be used to set the screen area for only 
  1.1813 +the first mode.
  1.1814 +
  1.1815 +This function is honoured even if there is a mouse or pen (e.g. on the emulator), 
  1.1816 +by mapping the co-ordinates of where you click into the area set using this 
  1.1817 +function. However the function does not restrict clicks outside of the 'drawing 
  1.1818 +area' on the Emulator, to allow you to select items on the fascia.
  1.1819 +
  1.1820 +@param aScreenSizeMode The screen mode to which the new area applies. 
  1.1821 +@param aArea The area of the screen, in the aScreenSizeMode screen mode, within 
  1.1822 +which the virtual cursor can be used.
  1.1823 +@capability WriteDeviceData */
  1.1824 +	{
  1.1825 +	TWsClCmdSetPointerCursorArea SetPointerCursorArea(aScreenSizeMode,aArea);
  1.1826 +	Write(&SetPointerCursorArea,sizeof(SetPointerCursorArea),EWsClOpSetPointerCursorArea);
  1.1827 +	}
  1.1828 +
  1.1829 +EXPORT_C TRect RWsSession::PointerCursorArea() const
  1.1830 +/** Gets the pointer cursor area for the first screen display mode.
  1.1831 +
  1.1832 +This is the area of the screen in which the virtual cursor can be used while 
  1.1833 +in relative mouse mode. While in pen or mouse mode the event co-ordinates 
  1.1834 +are forced to be within this area unless you click outside the drawable area.
  1.1835 +
  1.1836 +This function always causes a flush of the window server buffer.
  1.1837 +
  1.1838 +@return The pointer cursor area for the first screen display mode.
  1.1839 +@see SetPointerCursorArea() */
  1.1840 +	{
  1.1841 +	return PointerCursorArea(0);
  1.1842 +	}
  1.1843 +
  1.1844 +EXPORT_C TRect RWsSession::PointerCursorArea(TInt aScreenSizeMode) const
  1.1845 +/** Gets the pointer cursor area for the specified screen display mode. 
  1.1846 +
  1.1847 +This is the area of the screen in which the virtual cursor can be used while 
  1.1848 +in relative mouse mode. While in pen or mouse mode the event co-ordinates 
  1.1849 +are forced to be within this area unless you click outside the drawable area.
  1.1850 +
  1.1851 +This function always causes a flush of the window server buffer.
  1.1852 +
  1.1853 +@param aScreenSizeMode The screen mode for which the pointer cursor area is 
  1.1854 +required. 
  1.1855 +@return The pointer cursor area for the specified screen display mode. 
  1.1856 +@see SetPointerCursorArea() */
  1.1857 +	{
  1.1858 +	TPckgBuf<TRect> rectPkg;
  1.1859 +  	WriteReplyP(&aScreenSizeMode,sizeof(aScreenSizeMode),&rectPkg,EWsClOpPointerCursorArea);
  1.1860 +	return(rectPkg());
  1.1861 +	}
  1.1862 +
  1.1863 +EXPORT_C void RWsSession::SetPointerCursorMode(TPointerCursorMode aMode)
  1.1864 +/** Sets the current mode for the pointer cursor.
  1.1865 +
  1.1866 +The mode determines which sprite is used for the pointer cursor at any point. 
  1.1867 +The request is ignored unless the calling application is the application 
  1.1868 +that currently has keyboard focus.
  1.1869 +See TPointerCursorMode for more information.
  1.1870 +
  1.1871 +@param aMode The new mode for the pointer cursor. 
  1.1872 +@see TPointerCursorMode */
  1.1873 +	{
  1.1874 +	WriteInt(aMode,EWsClOpSetPointerCursorMode);
  1.1875 +	}
  1.1876 +	
  1.1877 +EXPORT_C TInt RWsSession::SetClientCursorMode(TPointerCursorMode aMode)
  1.1878 +/** Sets the current mode for the pointer cursor.
  1.1879 +
  1.1880 +The mode determines which sprite is used for the pointer cursor at any point. 
  1.1881 +See TPointerCursorMode for more information.
  1.1882 +
  1.1883 +This function always causes a flush of the window server buffer.
  1.1884 +
  1.1885 +@param aMode The new mode for the pointer cursor. 
  1.1886 +@see TPointerCursorMode
  1.1887 +@return KErrNone if successful, otherwise returns system wide errors. Returns
  1.1888 +KErrPermissionDenied if calling thread lacks WriteDeviceData capability
  1.1889 +@capability WriteDeviceData */
  1.1890 +	{
  1.1891 +	return(WriteReplyInt(aMode,EWsClOpSetClientCursorMode));
  1.1892 +	}
  1.1893 +
  1.1894 +EXPORT_C TPointerCursorMode RWsSession::PointerCursorMode() const
  1.1895 +/** Gets the current mode for the pointer cursor.
  1.1896 +
  1.1897 +The mode determines which sprite is used for the pointer cursor at any point.
  1.1898 +
  1.1899 +This function always causes a flush of the window server buffer.
  1.1900 +
  1.1901 +@return The current mode for the pointer cursor. */
  1.1902 +	{
  1.1903 +	return(STATIC_CAST(TPointerCursorMode,WriteReply(EWsClOpPointerCursorMode)));
  1.1904 +	}
  1.1905 +
  1.1906 +EXPORT_C void RWsSession::SetDefaultSystemPointerCursor(TInt aCursorNumber)
  1.1907 +/** Sets the default system pointer cursor.
  1.1908 +
  1.1909 +This function can only be called by the owner of the system pointer cursor 
  1.1910 +list. By default the 0th entry in the pointer cursor list is assigned as the 
  1.1911 +system pointer. The function allows any cursor from the list or even no cursor 
  1.1912 +to be set as the system pointer cursor.
  1.1913 +
  1.1914 +Note: ownership of the system pointer cursor list can be obtained by calling 
  1.1915 +ClaimSystemPointerCursorList() when no-one else has ownership.
  1.1916 +
  1.1917 +@param aCursorNumber The index of the new default system pointer cursor within 
  1.1918 +the system cursor list. */
  1.1919 +	{
  1.1920 +	WriteInt(aCursorNumber,EWsClOpSetDefaultSystemPointerCursor);
  1.1921 +	}
  1.1922 +
  1.1923 +EXPORT_C void RWsSession::ClearDefaultSystemPointerCursor()
  1.1924 +/** Clears the default system pointer cursor.
  1.1925 +
  1.1926 +This sets the pointer to the current default system pointer cursor to NULL. 
  1.1927 +
  1.1928 +@panic WSERV 42 If this function is called by a client other than the owner of the 
  1.1929 +system pointer cursor list. */
  1.1930 +	{
  1.1931 +	Write(EWsClOpClearDefaultSystemPointerCursor);
  1.1932 +	}
  1.1933 +
  1.1934 +EXPORT_C TInt RWsSession::SetPointerCursorPosition(const TPoint& aPosition)
  1.1935 +/** Sets the pointer cursor position.
  1.1936 +
  1.1937 +This function allows an application to move the virtual cursor. It works in 
  1.1938 +all modes, not just relative mouse mode.
  1.1939 +
  1.1940 +Note: the function works in screen co-ordinates and honours the pointer cursor area 
  1.1941 +exactly as pen presses do, i.e. only when they are in the drawing area 
  1.1942 +on the Emulator.
  1.1943 +
  1.1944 +This function always causes a flush of the window server buffer.
  1.1945 +
  1.1946 +@param aPosition The new pointer cursor position.
  1.1947 +@return KErrNone if successful, otherwise another of the system-wide error 
  1.1948 +codes. 
  1.1949 +@capability WriteDeviceData required, if the client calling the function doesn't have keyboard focus.
  1.1950 +However, if the client have keyboard focus then he doesn't need any capability to call this function.  */
  1.1951 +	{
  1.1952 +	return(WriteReply(&aPosition,sizeof(aPosition),EWsClOpSetPointerCursorPosition));
  1.1953 +	}
  1.1954 +
  1.1955 +EXPORT_C TPoint RWsSession::PointerCursorPosition() const
  1.1956 +/** Gets the pointer cursor position.
  1.1957 +
  1.1958 +This function allows an application to determine the position of the virtual 
  1.1959 +cursor.
  1.1960 +
  1.1961 +It always causes a flush of the window server buffer.
  1.1962 +
  1.1963 +@return The position of the virtual cursor. */
  1.1964 +	{
  1.1965 +	TPckgBuf<TPoint> pointPkg;
  1.1966 +  	WriteReplyP(&pointPkg,EWsClOpPointerCursorPosition);
  1.1967 +	return(pointPkg());
  1.1968 +	}
  1.1969 +
  1.1970 +EXPORT_C void RWsSession::SetDefaultFadingParameters(TUint8 aBlackMap,TUint8 aWhiteMap)
  1.1971 +/**
  1.1972 +@publishedPartner
  1.1973 +@released
  1.1974 +
  1.1975 +Sets the default fading parameters.
  1.1976 +
  1.1977 +Fading is used to change the colour of windows to be either closer 
  1.1978 +to white or closer to black, so that another window stands out. For example, 
  1.1979 +when displaying a dialogue you could fade all visible windows, then unfade 
  1.1980 +the dialog window. This function sets whether, and the amount by which, faded 
  1.1981 +windows appear closer to white or closer to black.
  1.1982 +
  1.1983 +The white and black mapping values define the range over which colours are 
  1.1984 +re-mapped when a window is faded. If aBlackMap=0 and aWhiteMap=255 then the 
  1.1985 +colours are mapped unchanged. As the two values get closer together, all colours 
  1.1986 +in the faded window becomes more similar - creating the fading effect. When 
  1.1987 +the numbers cross over (so that the black value is greater than the white 
  1.1988 +value) the colours in the faded window start to invert - i.e. colours that 
  1.1989 +were closer to white in the unfaded window are mapped to a darker colour in 
  1.1990 +the faded window.
  1.1991 +
  1.1992 +Changing the default will automatically apply to current graphics contexts 
  1.1993 +but will not have any affect on windows that are already faded. 
  1.1994 +
  1.1995 +Note: RWindowTreeNode::SetFaded(), CWindowGc::SetFaded() and RWsSession::SetSystemFaded() 
  1.1996 +use these fading parameters, and in addition allow the default fading value 
  1.1997 +to be overridden.
  1.1998 +
  1.1999 +@param aBlackMap Black map fading parameter.
  1.2000 +@param aWhiteMap White map fading parameter. 
  1.2001 +@see RWindowTreeNode::SetFaded()
  1.2002 +@see CWindowGc::SetFadingParameters() 
  1.2003 +@capability WriteDeviceData */
  1.2004 +	{
  1.2005 +	WriteInt(WservEncoding::Encode8BitValues(aBlackMap,aWhiteMap),EWsClOpSetDefaultFadingParams);
  1.2006 +	}
  1.2007 +
  1.2008 +/**
  1.2009 +@publishedPartner
  1.2010 +@released
  1.2011 +
  1.2012 +Prepares for switch off. 
  1.2013 +
  1.2014 +This stops the window server heart beat timer if running.
  1.2015 +
  1.2016 +@capability PowerMgmt
  1.2017 +*/
  1.2018 +EXPORT_C void RWsSession::PrepareForSwitchOff()
  1.2019 +	{
  1.2020 +	Write(EWsClOpPrepareForSwitchOff);
  1.2021 +	}
  1.2022 +
  1.2023 +#if defined(__WINS__)
  1.2024 +EXPORT_C void RWsSession::SetRemoveKeyCode(TBool aRemove)
  1.2025 +/** Sets whether to remove the top 16 bits of a key code (Emulator builds only).
  1.2026 +
  1.2027 +This function allows the Emulator to use Windows to translate keypresses into 
  1.2028 +the correct key code for each locale, rather than having to do the translation 
  1.2029 +for each international keyboard itself. 
  1.2030 +
  1.2031 +The top 16 bits of a keypress code contains the keycode that Windows would 
  1.2032 +produce if the key had been pressed in a typical Windows program. If aRemove 
  1.2033 +is EFalse the client can get these top 16 bits. If the value is non-zero 
  1.2034 +the CKeyTranslator uses it rather than calculating it's own value. If aRemove 
  1.2035 +is ETrue the window server strips the top 16 bits of the scan code before 
  1.2036 +passing the value on to the client. 
  1.2037 +
  1.2038 +Note: this function is intended for Java but it will be useful to any client who 
  1.2039 +creates their own CKeyTranslator and processes keyups and downs.
  1.2040 +
  1.2041 +@param aRemove ETrue to remove the code (default), EFalse to pass it to the 
  1.2042 +client. */
  1.2043 +	{
  1.2044 +	WriteInt(aRemove,EWsClOpRemoveKeyCode);
  1.2045 +	}
  1.2046 +
  1.2047 +EXPORT_C void RWsSession::SimulateXyInputType(TInt aInputType)
  1.2048 +	{
  1.2049 +	WriteInt(aInputType,EWsClOpSimulateXyInput);
  1.2050 +	}
  1.2051 +#endif
  1.2052 +
  1.2053 +EXPORT_C void RWsSession::LogCommand(TLoggingCommand aCommand)
  1.2054 +/** Allows the window server client to enable or disable logging of window server 
  1.2055 +events.
  1.2056 +
  1.2057 +The type of logging that takes place (e.g. whether to file or to serial port) 
  1.2058 +depends on the settings specified in the wsini.ini file.
  1.2059 +
  1.2060 +Clients can also force a dump of the window tree or information about the 
  1.2061 +window server's heap size and usage. 
  1.2062 +
  1.2063 +For logging to work, the wsini.ini file has to specify the type of logging 
  1.2064 +required and the DLLs for that type of logging must have been correctly installed. 
  1.2065 +Otherwise, calling this function will have no effect.
  1.2066 +
  1.2067 +@param aCommand The logging command. */
  1.2068 +	{
  1.2069 +	WriteInt(aCommand,EWsClOpLogCommand);
  1.2070 +	}
  1.2071 +
  1.2072 +EXPORT_C void RWsSession::LogMessage(const TLogMessageText &aMessage)
  1.2073 +/** Adds a message to the window server debug log if one is currently in operation.
  1.2074 +
  1.2075 +This function always causes a flush of the window server buffer.
  1.2076 +
  1.2077 +@param aMessage The text added to the message log. */
  1.2078 +	{
  1.2079 +	TInt len=aMessage.Length();
  1.2080 +	WriteReply(&len,sizeof(len),aMessage.Ptr(),aMessage.Size(),EWsClOpLogMessage);
  1.2081 +	}
  1.2082 +
  1.2083 +EXPORT_C void RWsSession::SimulateRawEvent(TRawEvent aEvent)
  1.2084 +/** 
  1.2085 +@internalAll
  1.2086 +
  1.2087 +Simulates raw events.
  1.2088 +
  1.2089 +For most purposes, RWsSession::SimulateKeyEvent() should be used instead to 
  1.2090 +simulate key events because low-level scan-code up/down events are not meaningful 
  1.2091 +to anything other than the keyboard to which they apply.
  1.2092 +
  1.2093 +For example, the driver for an external keyboard should do its own conversion from 
  1.2094 +raw scan-codes to higher-level character code key events and pass these to the 
  1.2095 +window server using SimulateKeyEvent().
  1.2096 +
  1.2097 +@param aEvent The raw event.
  1.2098 +@capability SwEvent */
  1.2099 +	{
  1.2100 +	Write(&aEvent,sizeof(aEvent),EWsClOpRawEvent);
  1.2101 +	}
  1.2102 +
  1.2103 +EXPORT_C void RWsSession::SimulateKeyEvent(TKeyEvent aEvent)
  1.2104 +/** 
  1.2105 +@internalAll
  1.2106 +
  1.2107 +Sends a simulated key event to the window server.
  1.2108 +
  1.2109 +All the fields in TKeyEvent are honoured except iRepeats, which is overridden 
  1.2110 +with zero.
  1.2111 +
  1.2112 +@param aEvent The key event to be simulated.
  1.2113 +@capability SwEvent */
  1.2114 +	{
  1.2115 +	Write(&aEvent,sizeof(aEvent),EWsClOpKeyEvent);
  1.2116 +	}
  1.2117 +
  1.2118 +
  1.2119 +EXPORT_C void RWsSession::SystemInfo(TInt &aSystemInfoNumber, SSystemInfo &aSystemInfo)
  1.2120 +/** @internalComponent */
  1.2121 +	{
  1.2122 +	TPckgBuf<SSystemInfo> systemInfoPckg;
  1.2123 +	WriteReplyP(&aSystemInfoNumber,sizeof(aSystemInfoNumber),&systemInfoPckg,EWsClOpSystemInfo);
  1.2124 +	aSystemInfo=systemInfoPckg();
  1.2125 +	}
  1.2126 +
  1.2127 +void RWsSession::DirectAcessActivation(TBool aIsNowActive)
  1.2128 +	{
  1.2129 +	if (aIsNowActive)
  1.2130 +		++iBuffer->iDirectAcessCount;
  1.2131 +	else
  1.2132 +		{
  1.2133 +		--iBuffer->iDirectAcessCount;
  1.2134 +		__ASSERT_DEBUG(iBuffer->iDirectAcessCount>=0,Assert(EW32AssertDirectMisuse));
  1.2135 +		}
  1.2136 +	}
  1.2137 +
  1.2138 +EXPORT_C void RWsSession::TestWrite(TInt aHandle,TInt aOpcode,const TAny *pData, TInt aLength)
  1.2139 +/** @internalComponent */
  1.2140 +	{
  1.2141 +	iBuffer->Write(aHandle,aOpcode,pData,aLength);
  1.2142 +	}
  1.2143 +
  1.2144 +EXPORT_C void RWsSession::TestWriteReply(TInt aHandle,TInt aOpcode,const TAny *pData, TInt aLength)
  1.2145 +/** @internalComponent */
  1.2146 +	{
  1.2147 +	iBuffer->WriteReply(aHandle,aOpcode,pData,aLength);
  1.2148 +	}
  1.2149 +
  1.2150 +EXPORT_C void RWsSession::TestWriteReplyP(TInt aHandle,TInt aOpcode,const TAny *pData,TInt aLength,TDes8 *aReplyPackage)
  1.2151 +/** @internalComponent */
  1.2152 +	{
  1.2153 +	iBuffer->WriteReplyP(aHandle,aOpcode,pData,aLength,aReplyPackage);
  1.2154 +	}
  1.2155 +
  1.2156 +EXPORT_C TInt RWsSession::TestWriteReplyByProvidingRemoteReadAccess(TInt aHandle,TInt aOpcode,const TDesC8& aData,const TDesC8& aRemoteReadBuffer)
  1.2157 +/** @internalComponent */
  1.2158 +	{
  1.2159 +	return iBuffer->WriteReplyByProvidingRemoteReadAccess(aHandle,aOpcode,aData.Ptr(),aData.Length(),&aRemoteReadBuffer);
  1.2160 +	}
  1.2161 +
  1.2162 +EXPORT_C TInt RWsSession::TestWriteReplyByProvidingRemoteReadAccess(TInt aHandle,TInt aOpcode,const TDesC8& aData,const TDesC16& aRemoteReadBuffer)
  1.2163 +/** @internalComponent */
  1.2164 +	{
  1.2165 +	return iBuffer->WriteReplyByProvidingRemoteReadAccess(aHandle,aOpcode,aData.Ptr(),aData.Length(),&aRemoteReadBuffer);
  1.2166 +	}
  1.2167 +
  1.2168 +/** Sets both the buffer size and maximum buffer size for queuing commands to send to the Windows Server.
  1.2169 +The value should be at least the size of the largest message that will be sent, 
  1.2170 +otherwise a panic of the client may occur.
  1.2171 +
  1.2172 +The minimum possible buffer size is 640 and the maximum possible size is 16384 bytes.
  1.2173 +The default size of 640 bytes is sufficient for most uses.
  1.2174 +
  1.2175 +Larger buffers can reduce drawing flicker by allowing more drawing commands to be
  1.2176 +collected in the buffer before being sent to the server.
  1.2177 +
  1.2178 +Smaller buffers conserve system memory.
  1.2179 +
  1.2180 +Can be used to set a minimum buffer size, sufficient for largest drawing command used,
  1.2181 +before calling RWsSession::SetMaxBufferSizeL() to set a maximum buffer size for queuing commands.
  1.2182 +
  1.2183 +@param aBufSize The desired buffer size in bytes, at least the size of largest message to be sent.
  1.2184 +@leave KErrNoMemory Could not allocate the required memory.
  1.2185 +
  1.2186 +@panic TW32Panic 5 Occurs during the session if a single drawing command is too big to fit in the buffer.
  1.2187 +
  1.2188 +@see RWsSession::Flush()
  1.2189 +@see RWsSession::SetAutoFlush()
  1.2190 +@see RWsSession::SetMaxBufferSizeL()
  1.2191 +*/
  1.2192 +EXPORT_C void RWsSession::SetBufferSizeL(TInt aBufSize)
  1.2193 +	{
  1.2194 +	iBuffer->SetBufferSizeL(aBufSize);
  1.2195 +	}
  1.2196 +
  1.2197 +/** Sets the maximum size that the buffer for queuing commands to send to the Windows Server can expand to.
  1.2198 +
  1.2199 +The minimum possible buffer size is 640 and the maximum possible size is 16384 bytes.
  1.2200 +
  1.2201 +If the buffer size is larger than the new maximum it is reduced.
  1.2202 +
  1.2203 +A minimum size is calculated to be one quarter the maximum size, but in any case at least 640 bytes.
  1.2204 +If the buffer size is smaller than the calculated minimum it is expanded.
  1.2205 +
  1.2206 +RWsSession::SetBufferSizeL() can be used to set a specific minimum size >640 bytes before setting a maximum size.
  1.2207 +This is useful if you will send very large drawing commands.
  1.2208 +
  1.2209 +After calling this function the buffer size will be between the specified maximum and calculated minimum sizes.
  1.2210 +
  1.2211 +The algorithm for growing the buffer up to the maximum is chosen to balance the cost of expanding the buffer 
  1.2212 +with the waste of an excessively large buffer that is never filled.
  1.2213 +
  1.2214 +If the buffer becomes too full to add a new drawing command, and the buffer size is less than the maximum,
  1.2215 +the buffer size will be expanded.
  1.2216 +If the buffer is already at the maximum size, or the expansion fails due to low memory, 
  1.2217 +the buffer will be emptied with RWsSession::Flush().
  1.2218 +If there is not enough space now for the new command a panic occurs.
  1.2219 +
  1.2220 +@param aMaxBufSize The desired maximum buffer size in bytes.
  1.2221 +@leave KErrNoMemory Could not allocate the required minimum memory.
  1.2222 +
  1.2223 +@panic TW32Panic 5 Occurs during the session if a single drawing command is too big to fit in the buffer.
  1.2224 +
  1.2225 +@see RWsSession::Flush()
  1.2226 +@see RWsSession::SetAutoFlush()
  1.2227 +@see RWsSession::SetBufferSizeL()
  1.2228 +*/
  1.2229 +EXPORT_C void RWsSession::SetMaxBufferSizeL(TInt aMaxBufSize)
  1.2230 +	{
  1.2231 +	iBuffer->SetMaxBufferSizeL(aMaxBufSize);
  1.2232 +	}
  1.2233 +
  1.2234 +EXPORT_C TInt RWsSession::SetSystemFaded(TBool aFaded)
  1.2235 +/** Sets all windows in the system as faded or unfaded, using the default fading 
  1.2236 +parameters.
  1.2237 +
  1.2238 +This function allows all windows that currently exist, not just those in a 
  1.2239 +single window group, to be faded or unfaded.
  1.2240 +
  1.2241 +Notes: The window server generates a redraw to un-fade a window, because information 
  1.2242 +is lost during fading. Blank (RBlankWindow) and backup (RBackupWindow) windows 
  1.2243 +deal with this themselves. Areas in shadow when the window is faded will also 
  1.2244 +have redraw events generated for them by the window server. While a window 
  1.2245 +is faded, all drawing to that window will be adjusted appropriately by the 
  1.2246 +window server.
  1.2247 +
  1.2248 +This function always causes a flush of the window server buffer.
  1.2249 +
  1.2250 +@param aFaded ETrue to fade all windows, EFalse to un-fade all windows.
  1.2251 +@return KErrNone if successful, otherwise another of the system-wide error 
  1.2252 +codes. 
  1.2253 +@capability WriteDeviceData */
  1.2254 +	{
  1.2255 +	TWsClCmdSetSystemFaded params(aFaded);
  1.2256 +	return WriteReply(&params,sizeof(params),EWsClOpSetFaded);
  1.2257 +	}
  1.2258 +
  1.2259 +EXPORT_C TInt RWsSession::SetSystemFaded(TBool aFaded,TUint8 aBlackMap,TUint8 aWhiteMap)
  1.2260 +/** Sets all windows in the system as faded or unfaded, overriding the default 
  1.2261 +fading parameters (as set by SetDefaultFadingParameters()).
  1.2262 +
  1.2263 +This function allows all windows that currently exist, not just those in the 
  1.2264 +same window group, to be faded or unfaded.
  1.2265 +
  1.2266 +Notes: Fading a window for a second time (that is fading it when it is already 
  1.2267 +faded) will not change the fading map used. The window server generates a 
  1.2268 +redraw to un-fade a window, because information is lost during fading. Blank 
  1.2269 +(RBlankWindow) and backup (RBackupWindow) windows deal with this themselves. 
  1.2270 +Areas in shadow when the window is faded will also have redraw events generated 
  1.2271 +for them by the window server. While a window is faded, all drawing to that 
  1.2272 +window will be adjusted appropriately by the window server.
  1.2273 +
  1.2274 +This function always causes a flush of the window server buffer.
  1.2275 +
  1.2276 +@param aFaded ETrue to fade all windows, EFalse to un-fade all windows.
  1.2277 +@param aBlackMap Black map fading parameter.
  1.2278 +@param aWhiteMap White map fading parameter.
  1.2279 +@return KErrNone if successful, otherwise another of the system-wide error 
  1.2280 +codes. 
  1.2281 +@capability WriteDeviceData */
  1.2282 +	{
  1.2283 +	TWsClCmdSetSystemFaded params(aFaded,EFalse,aBlackMap,aWhiteMap);
  1.2284 +	return WriteReply(&params,sizeof(params),EWsClOpSetFaded);
  1.2285 +	}
  1.2286 +
  1.2287 +EXPORT_C TInt RWsSession::SetFocusScreen(TInt aScreenNumber)
  1.2288 +/** Set focus screen  
  1.2289 +@param aScreenNumber The new focus screen.
  1.2290 +@return KErrNone if successful, otherwise another of the system-wide error 
  1.2291 +codes. */
  1.2292 +	{
  1.2293 +	return WriteReplyInt(aScreenNumber,EWsClOpSetFocusScreen);
  1.2294 +	}
  1.2295 +
  1.2296 +EXPORT_C TInt RWsSession::GetFocusScreen() const
  1.2297 +/** Get focus screen
  1.2298 +@return The screen number of current focus screen */
  1.2299 +	{
  1.2300 +	return WriteReply(EWsClOpGetFocusScreen);
  1.2301 +	}
  1.2302 +
  1.2303 +EXPORT_C TInt RWsSession::NumberOfScreens() const
  1.2304 +/** Number Of Screens
  1.2305 +@return The number of screens on the phone */
  1.2306 +	{
  1.2307 +	return WriteReply(EWsClOpGetNumberOfScreens);	
  1.2308 +	}
  1.2309 +	
  1.2310 +EXPORT_C void RWsSession::ClearAllRedrawStores()
  1.2311 +/** Clear the redraw store for all windows in the system
  1.2312 +By default Windows will recorded the drawing commands used during a redraw and use them latter if the window needs to be redrawn.
  1.2313 +Calling this function will cause all these stores to be thrown away redraw will then be sent to all window, visible windows will recieve them first.
  1.2314 +
  1.2315 +This function always causes a flush of the window server buffer.*/
  1.2316 +	{
  1.2317 +	Write(EWsClOpClearAllRedrawStores);
  1.2318 +	}
  1.2319 +
  1.2320 +EXPORT_C TInt RWsSession::Finish()
  1.2321 +/** 
  1.2322 +Blocks until all outstanding window server rendering has been completed.
  1.2323 +@return KErrNone if successful 
  1.2324 +*/
  1.2325 +	{
  1.2326 +	SyncMsgBuf();
  1.2327 +	return SendReceive(EWservMessFinish);
  1.2328 +	}
  1.2329 +
  1.2330 +EXPORT_C void RWsSession::SyncMsgBuf()
  1.2331 +/** 
  1.2332 +Sends all pending commands in the buffer to the window server. 
  1.2333 +*/
  1.2334 +	{
  1.2335 +	if (iBuffer)
  1.2336 +		iBuffer->Flush();
  1.2337 +
  1.2338 +	}
  1.2339 +
  1.2340 +EXPORT_C TInt RWsSession::SetCloseProximityThresholds(TInt /*aEnterCloseProximityThreshold*/, TInt /*aExitCloseProximityThreshold*/)
  1.2341 +/** Dummy implementation in order to preserve compatibility with WSERV NGA.
  1.2342 +    @internalComponent */ 
  1.2343 +	{
  1.2344 +	ASSERT(0);
  1.2345 +	return KErrNotSupported;
  1.2346 +	}
  1.2347 +
  1.2348 +EXPORT_C TInt RWsSession::GetEnterCloseProximityThreshold() const
  1.2349 +/** Dummy implementation in order to preserve compatibility with WSERV NGA.
  1.2350 +    @internalComponent */ 
  1.2351 +	{
  1.2352 +	ASSERT(0);
  1.2353 +	return KErrNone; // return any value to prevent compilation warning
  1.2354 +	}
  1.2355 +
  1.2356 +EXPORT_C TInt RWsSession::GetExitCloseProximityThreshold() const
  1.2357 +/** Dummy implementation in order to preserve compatibility with WSERV NGA.
  1.2358 +    @internalComponent */ 
  1.2359 +	{
  1.2360 +	ASSERT(0);
  1.2361 +	return KErrNone; // return any value to prevent compilation warning
  1.2362 +	}
  1.2363 +
  1.2364 +EXPORT_C TInt RWsSession::SetHighPressureThresholds(TInt /*aEnterHighPressureThreshold*/, TInt /*aExitHighPressureThreshold*/)
  1.2365 +/** Dummy implementation in order to preserve compatibility with WSERV NGA.
  1.2366 +    @internalComponent */ 
  1.2367 +	{
  1.2368 +	ASSERT(0);
  1.2369 +	return KErrNotSupported;
  1.2370 +	}
  1.2371 +
  1.2372 +EXPORT_C TInt RWsSession::GetEnterHighPressureThreshold() const
  1.2373 +/** Dummy implementation in order to preserve compatibility with WSERV NGA.
  1.2374 +    @internalComponent */ 
  1.2375 +	{
  1.2376 +	ASSERT(0);
  1.2377 +	return KErrNone; // return any value to prevent compilation warning
  1.2378 +	}
  1.2379 +
  1.2380 +EXPORT_C TInt RWsSession::GetExitHighPressureThreshold() const
  1.2381 +/** Dummy implementation in order to preserve compatibility with WSERV NGA.
  1.2382 +    @internalComponent */ 
  1.2383 +	{
  1.2384 +	ASSERT(0);
  1.2385 +	return KErrNone; // return any value to prevent compilation warning
  1.2386 +	}
  1.2387 +
  1.2388 +EXPORT_C void RWsSession::EnableWindowSizeCacheL()
  1.2389 +/** Dummy implementation in order to preserve compatibility with WSERV NGA.
  1.2390 +    @internalComponent */ 
  1.2391 +	{
  1.2392 +	ASSERT(0);
  1.2393 +	}
  1.2394 +
  1.2395 +EXPORT_C void RWsSession::SendEffectCommand(TInt /*aTfxCmd*/,const TDesC8& /*aTfxCmdData*/)
  1.2396 +/** Dummy implementation in order to preserve compatibility with WSERV NGA.
  1.2397 +	@internalComponent */
  1.2398 +	{
  1.2399 +	ASSERT(0);
  1.2400 +	}
  1.2401 +
  1.2402 +EXPORT_C void RWsSession::RegisterEffect(TInt /*aAction*/, TInt /*aPurpose*/, const TFileName& /*aResourceDir*/, const TFileName& /*aFilenameOutgoing*/, const TFileName& /*aFilenameIncoming*/, TUint /*aAppUid*/, TBitFlags /*aFlags*/)
  1.2403 +/** Dummy implementation in order to preserve compatibility with WSERV NGA.
  1.2404 +	@internalComponent */
  1.2405 +	{
  1.2406 +	ASSERT(0);
  1.2407 +	}
  1.2408 +
  1.2409 +EXPORT_C void RWsSession::UnregisterEffect(TInt /*aAction*/, TInt /*aPurpose*/, TUint /*aAppUid*/)
  1.2410 +/** Dummy implementation in order to preserve compatibility with WSERV NGA.
  1.2411 +	@internalComponent */
  1.2412 +	{
  1.2413 +	ASSERT(0);
  1.2414 +	}
  1.2415 +
  1.2416 +EXPORT_C void RWsSession::UnregisterAllEffects()
  1.2417 +/** Dummy implementation in order to preserve compatibility with WSERV NGA.
  1.2418 +	@internalComponent */
  1.2419 +	{
  1.2420 +	ASSERT(0);
  1.2421 +	}
  1.2422 +
  1.2423 +EXPORT_C void RWsSession::OverrideEffects(TInt /*aAction*/, TInt /*aPurpose*/, const TFileName& /*aResourceDir*/, const TFileName& /*aFilenameOutgoing*/, const TFileName& /*aFilenameIncoming*/, TBitFlags /*aFlags*/)
  1.2424 +	/** Dummy implementation in order to preserve compatibility with WSERV NGA.
  1.2425 +	@internalComponent */
  1.2426 +	{
  1.2427 +	ASSERT(0);
  1.2428 +	}
  1.2429 +
  1.2430 +EXPORT_C void RWsSession::IndicateAppOrientation(TRenderOrientation /*aOrientation*/)
  1.2431 +	/** Dummy implementation in order to preserve compatibility with WSERV NGA.
  1.2432 +	@internalComponent */
  1.2433 +	{
  1.2434 +	ASSERT(0);
  1.2435 +	}