windowing/windowserver/nga/CLIENT/RWS.CPP
branchRCL_3
changeset 20 25ffed67c7ef
parent 19 bbf46f59e123
equal deleted inserted replaced
19:bbf46f59e123 20:25ffed67c7ef
    19 #include "w32comm.h"
    19 #include "w32comm.h"
    20 #include <e32std.h>
    20 #include <e32std.h>
    21 #include <w32std.h>
    21 #include <w32std.h>
    22 #include "CLIENT.H"
    22 #include "CLIENT.H"
    23 #include "graphics/windowserverconstants.h"
    23 #include "graphics/windowserverconstants.h"
    24 #include "rtfxeffect.h"
       
    25 #include <wspublishandsubscribedata.h>
       
    26 
    24 
    27 const TInt KMaxWSERVMessagesSlot=-1;
    25 const TInt KMaxWSERVMessagesSlot=-1;
    28 
    26 
    29 class RWsCustomTextCursor : public RWsSpriteBase
    27 class RWsCustomTextCursor : public RWsSpriteBase
    30 	{
    28 	{
  2478 /**
  2476 /**
  2479 Enables client side cache of window size to reduce client-server 
  2477 Enables client side cache of window size to reduce client-server 
  2480 activity triggered by calls to RWindowBase::Size()
  2478 activity triggered by calls to RWindowBase::Size()
  2481 @leave KErrNoMemory Could not allocate the required memory.
  2479 @leave KErrNoMemory Could not allocate the required memory.
  2482 @internalAll */
  2480 @internalAll */
  2483 	{
  2481     {
  2484 	iBuffer->EnableWindowSizeCacheL();
  2482     iBuffer->EnableWindowSizeCacheL();
  2485 	}
  2483     }
  2486 
       
  2487 EXPORT_C void RWsSession::SendEffectCommand(TInt aTfxCmd,const TDesC8& aTfxCmdData)
       
  2488 /**
       
  2489  Set the WServ session specific effect data or execute commands 
       
  2490  to TFX Render Stage. The data or command passed by the client 
       
  2491  API will be directed to MWsTfxApplication::SendEffectCommand.
       
  2492  TFX Render Stage will accept only TFX application specific commands and data.
       
  2493 @param aTfxCmd TFX Render Stage command.
       
  2494 @param aTfxCmdData Structure related to the specified value of aTfxCmd, the default value is KNullDesC8.
       
  2495 
       
  2496 @capability WriteDeviceData Only if aTfxCmd has value ETfxCmdEnableAllTransitions or ETfxCmdDisableAllTransitions
       
  2497 
       
  2498 @publishedPartner
       
  2499 */
       
  2500 	{
       
  2501 	__ASSERT_ALWAYS(aTfxCmdData.Length()<=KMaxWservStringSize, Panic(EW32PanicStringTooLong));
       
  2502 	TWsClCmdSendEffectCommand params(aTfxCmd,aTfxCmdData.Size(), NULL);
       
  2503 	Write(&params,sizeof(params),aTfxCmdData.Ptr(),aTfxCmdData.Size(),EWsClOpSendEffectCommand);
       
  2504 	}
       
  2505 
       
  2506 EXPORT_C void RWsSession::RegisterEffect(TInt aAction, TInt aPurpose, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TUint aAppUid, TBitFlags aFlags)
       
  2507 /**
       
  2508 Sets a specific animation for a particular transition effect.
       
  2509 
       
  2510 Transition effect is represented by one of the values of enum TTfxTransitionActions.
       
  2511 
       
  2512 An animation is specified by a filename and directory; the file will contain a description of the animation 
       
  2513 for that transition.  In fact each transition can have two animations associated with it, for example 
       
  2514 an App shut down could have one animation with the old application disappearing and then another animation 
       
  2515 for the App Launcher (or home screen) appearing.
       
  2516 
       
  2517 Animation can be applied to all App's Transition effect or to a specfic App by providing its AppUid.
       
  2518 
       
  2519 @param aAction Particular transition to register the animation for.
       
  2520 @param aPurpose The purpose of the window.
       
  2521 @param aResourceDir The name of the directory that contains the animation description files.
       
  2522 @param aFilenameOutgoing The file containing the description of the animation for the outgoing phase of the transition. 
       
  2523 						 Specify KNullDesC for no outgoing phase effect.
       
  2524 @param aFilenameIncoming The file containing the description of the animation for the incoming phase of the transition. 
       
  2525 						 Specify KNullDesC for no incoming phase effect.
       
  2526 @param aAppUid The Application UID this effect applies to. Set to zero to specify that all apps will use default effect.
       
  2527 @param aFlags Flag for the effect. Please see TTfxFlags for values this flag parameter can use.
       
  2528 
       
  2529 @capability WriteDeviceData This API does nothing if the client does not possess required Capability
       
  2530 
       
  2531 @publishedPartner
       
  2532 */
       
  2533 	{
       
  2534 	RTFXEffect tfxEffect(iWsHandle, iBuffer);
       
  2535 	tfxEffect.RegisterTFXEffect(aAction, aPurpose, aResourceDir, aFilenameOutgoing, aFilenameIncoming, aAppUid, aFlags);
       
  2536 	}
       
  2537 
       
  2538 EXPORT_C void RWsSession::UnregisterEffect(TInt aAction, TInt aPurpose, TUint aAppUid)
       
  2539 /**
       
  2540 Unregister already set animation for a particular transition effect
       
  2541 
       
  2542 @param aAction Particular transition to unregister the animation for.
       
  2543 @param aPurpose The purpose of the window.
       
  2544 @param aAppUid The Application UID this effect applies to. Set to 0 to specify the default effect will be unregistered.
       
  2545 
       
  2546 @capability WriteDeviceData This API does nothing if the client does not possess required Capability
       
  2547 
       
  2548 @publishedPartner
       
  2549 */
       
  2550 	{
       
  2551 	TWsClCmdUnRegisterEffect unregisterEffect(aAction, aPurpose, aAppUid);
       
  2552 	Write(&unregisterEffect, sizeof(unregisterEffect), EWsClOpUnregisterTFXEffect);
       
  2553 	}
       
  2554 
       
  2555 EXPORT_C void RWsSession::UnregisterAllEffects()
       
  2556 /**
       
  2557 Unregister animation for all transition effects.
       
  2558 
       
  2559 @capability WriteDeviceData This API does nothing if the client does not possess required Capability
       
  2560 
       
  2561 @publishedPartner
       
  2562 */
       
  2563 	{
       
  2564 	Write(EWsClOpUnregisterAllTFXEffect);
       
  2565 	}
       
  2566 	
       
  2567 EXPORT_C void RWsSession::OverrideEffects(TInt aAction, TInt aPurpose, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TBitFlags aFlags)
       
  2568 /**
       
  2569 Overides the default animation for given app's transition effect by sent animation description.
       
  2570 Please refer RWsSession::RegisterEffect() comments for more information on animation description.
       
  2571 
       
  2572 @param aAction The particular transition to set the animation for.
       
  2573 @param aPurpose This override only effects the window/layers owned by the application that have the specified purpose.
       
  2574 @param aResourceDir The name of the directory that contains the animation description files.
       
  2575 @param aFilenameOutgoing The file containing the description of the animation for the outgoing phase of the transition. 
       
  2576 						 Specify KNullDesC for no outgoing phase effect.
       
  2577 @param aFilenameIncoming The file containing the description of the animation for the incoming phase of the transition. 
       
  2578 						 Specify KNullDesC for no incoming phase effect.
       
  2579 @param aFlags Flag for the effect. Please see TTfxFlags for values this flag parameter can use.
       
  2580 
       
  2581 @capability WriteDeviceData This API does nothing if the client does not possess required Capability
       
  2582 
       
  2583 @publishedPartner
       
  2584 */
       
  2585 	{
       
  2586 	RTFXEffect tfxEffect(iWsHandle, iBuffer);
       
  2587 	tfxEffect.OverrideTFXEffect(RTFXEffect::ETFXSession, aAction, aPurpose, aResourceDir, aFilenameOutgoing, aFilenameIncoming, aFlags);
       
  2588 	}
       
  2589 
       
  2590 EXPORT_C void RWsSession::IndicateAppOrientation(TRenderOrientation aOrientation)
       
  2591 /**
       
  2592 Application informs window server the orientation of rendering it intends to use
       
  2593 
       
  2594 @param aOrientation The orientation the application intends to use
       
  2595 
       
  2596 @publishedPartner
       
  2597 */
       
  2598 	{
       
  2599 	return(WriteInt(aOrientation,EWsClOpIndicateAppOrientation));
       
  2600 	}