1 // Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 1994-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
18 #include <e32std.h> |
18 #include <e32std.h> |
19 #include "../SERVER/w32cmd.h" |
19 #include "../SERVER/w32cmd.h" |
20 #include "CLIENT.H" |
20 #include "CLIENT.H" |
21 #include "w32comm.h" |
21 #include "w32comm.h" |
22 #include <graphics/surface.h> |
22 #include <graphics/surface.h> |
|
23 #include "rtfxeffect.h" |
23 |
24 |
24 RWindowTreeNode::RWindowTreeNode() |
25 RWindowTreeNode::RWindowTreeNode() |
25 /** Protected default constructor. |
26 /** Protected default constructor. |
26 |
27 |
27 This creates a sessionless, uninitialised window tree node handle. This class |
28 This creates a sessionless, uninitialised window tree node handle. This class |
844 return size; |
839 return size; |
845 } |
840 } |
846 } |
841 } |
847 } |
842 } |
848 |
843 |
849 EXPORT_C TSize RWindowBase::SizeForEgl() const |
|
850 #ifdef SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION |
|
851 /** |
844 /** |
852 @internalAll |
845 @internalAll |
853 Disclaimer - this API is internal and is subject to change |
846 Disclaimer - this API is internal and is subject to change |
854 @prototype */ |
847 @deprecated */ |
855 { |
848 EXPORT_C TSize RWindowBase::SizeForEgl() const |
856 TSize size; |
|
857 if (WindowNativeSizeCacheEnabled() && WindowNativeSize(size) == KErrNone) |
|
858 { |
|
859 return size; |
|
860 } |
|
861 else |
|
862 { |
|
863 return Size(); |
|
864 } |
|
865 } |
|
866 #else |
|
867 { |
849 { |
868 // API should not be used if macro undefined. |
850 return Size(); |
869 ASSERT(0); |
|
870 return TSize(); |
|
871 } |
851 } |
872 #endif // SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION |
852 |
873 |
|
874 EXPORT_C void RWindowBase::SetPosition(const TPoint &aPos) |
853 EXPORT_C void RWindowBase::SetPosition(const TPoint &aPos) |
875 /** Sets the position of a window relative to its parent. |
854 /** Sets the position of a window relative to its parent. |
876 |
855 |
877 The co-ordinates given in aPos specify the position of the top left-hand |
856 The co-ordinates given in aPos specify the position of the top left-hand |
878 corner of the window, relative to the top left-hand corner of its parent. |
857 corner of the window, relative to the top left-hand corner of its parent. |
1382 (for example a touch screen that is able to determine coordinates of more than |
1361 (for example a touch screen that is able to determine coordinates of more than |
1383 one finger touching it at the same time), then this method will enable delivering |
1362 one finger touching it at the same time), then this method will enable delivering |
1384 events from all detected pointers to this window. |
1363 events from all detected pointers to this window. |
1385 |
1364 |
1386 This method must be called before the window is activated by calling RWindowBase::Activate(). |
1365 This method must be called before the window is activated by calling RWindowBase::Activate(). |
1387 Otherwise this will be ignored (release build), or panic (debug build). |
1366 Otherwise the client is panicked with the code EWservPanicUnableToEnableAdvPointer. |
1388 |
1367 |
1389 If this method is not called for the window, it is assumed that the window is not |
1368 If this method is not called for the window, it is assumed that the window is not |
1390 able to receive events from multiple pointers, and thus only events from a single |
1369 able to receive events from multiple pointers, and thus only events from a single |
1391 emulated pointer are sent to it. Emulated pointer ensures that code written for a single |
1370 emulated pointer are sent to it. Emulated pointer ensures that code written for a single |
1392 pointer environment works properly in a multiple pointer environment: there is only |
1371 pointer environment works properly in a multiple pointer environment: there is only |
1409 } |
1388 } |
1410 |
1389 |
1411 /** |
1390 /** |
1412 @internalAll |
1391 @internalAll |
1413 Disclaimer - this API is internal and is subject to change |
1392 Disclaimer - this API is internal and is subject to change |
1414 @prototype */ |
1393 @deprecated */ |
1415 EXPORT_C TInt RWindowBase::FixNativeOrientation() |
1394 EXPORT_C TInt RWindowBase::FixNativeOrientation() |
1416 #if !defined(SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION) || defined (SYMBIAN_GRAPHICS_BUILD_OPENWF_WSERV) || defined (__WINS__) |
|
1417 { |
1395 { |
1418 return KErrNotSupported; |
1396 return KErrNotSupported; |
1419 } |
1397 } |
1420 #else |
|
1421 { |
|
1422 TInt err = KErrNone; |
|
1423 if (!WindowNativeSizeCacheEnabled()) |
|
1424 { |
|
1425 TRAP(err, EnableWindowNativeSizeCacheL()); |
|
1426 if (err != KErrNone) |
|
1427 { |
|
1428 return err; |
|
1429 } |
|
1430 } |
|
1431 |
|
1432 const CFbsBitGc::TGraphicsOrientation orientation = static_cast<CFbsBitGc::TGraphicsOrientation>(WriteReply(EWsWinOpFixNativeOrientation)); |
|
1433 switch (orientation) |
|
1434 { |
|
1435 case CFbsBitGc::EGraphicsOrientationNormal: |
|
1436 case CFbsBitGc::EGraphicsOrientationRotated180: |
|
1437 err = SetWindowNativeSize(Size()); |
|
1438 break; |
|
1439 case CFbsBitGc::EGraphicsOrientationRotated90 : |
|
1440 case CFbsBitGc::EGraphicsOrientationRotated270: |
|
1441 { |
|
1442 TSize size = Size(); |
|
1443 err = SetWindowNativeSize(TSize(size.iHeight, size.iWidth)); |
|
1444 } |
|
1445 break; |
|
1446 default: |
|
1447 Assert(EW32AssertInvalidOrientation); |
|
1448 } |
|
1449 return err; |
|
1450 } |
|
1451 #endif // SYMBIAN_GRAPHICS_FIXNATIVEORIENTATION |
|
1452 |
1398 |
1453 EXPORT_C TInt RWindowBase::AllocPointerMoveBuffer(TInt aMaxNumPoints, TUint aFlags) |
1399 EXPORT_C TInt RWindowBase::AllocPointerMoveBuffer(TInt aMaxNumPoints, TUint aFlags) |
1454 /** Allocates a buffer for storing pointer movements. |
1400 /** Allocates a buffer for storing pointer movements. |
1455 |
1401 |
1456 The pointer move buffer is used by applications that need to process every |
1402 The pointer move buffer is used by applications that need to process every |
1930 |
1876 |
1931 argb.SetInternal(WriteReply(EWsWinOpKeyColor)); |
1877 argb.SetInternal(WriteReply(EWsWinOpKeyColor)); |
1932 return argb; |
1878 return argb; |
1933 } |
1879 } |
1934 |
1880 |
1935 // RDrawableWindow // |
1881 EXPORT_C void RWindowBase::SetPurpose(TInt aPurpose) |
|
1882 /** |
|
1883 Sets specific window purpose to the TFX layer. The purpose passed |
|
1884 by the client API will be directed to MWsTfxLayer::SetPurpose. |
|
1885 @param aPurpose The window purpose information. |
|
1886 @see MWsTfxLayer |
|
1887 @publishedPartner |
|
1888 @prototype |
|
1889 */ |
|
1890 { |
|
1891 WriteInt(aPurpose,EWsWinOpSetPurpose); |
|
1892 } |
|
1893 |
|
1894 EXPORT_C void RWindowBase::SendEffectCommand(TInt aTfxCmd,const TDesC8& aTfxCmdData) |
|
1895 /** |
|
1896 Sets specific effect data or execute commands to the TFX layer. |
|
1897 The data or command passed by the client API will be directed to MWsTfxLayer::SendEffectCommand. |
|
1898 MWsTfxLayer will accept only window specific commands and data. |
|
1899 @param aTfxCmd TFX layer command. |
|
1900 @param aTfxCmdData Data structure related to the specified value of aTfxCmd. The default value is KNullDesC8. |
|
1901 @publishedPartner |
|
1902 */ |
|
1903 { |
|
1904 __ASSERT_ALWAYS(aTfxCmdData.Length()<=KMaxWservStringSize, Panic(EW32PanicStringTooLong)); |
|
1905 TWsClCmdSendEffectCommand params(aTfxCmd,aTfxCmdData.Size(),this->iWsHandle); |
|
1906 Write(¶ms,sizeof(params),aTfxCmdData.Ptr(),aTfxCmdData.Size(),EWsWinOpSendEffectCommand); |
|
1907 } |
|
1908 |
|
1909 EXPORT_C void RWindowBase::OverrideEffects(TInt aAction, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TBitFlags aFlags) |
|
1910 /** |
|
1911 Overides the default animation for current window's transition effect by sent animation description. |
|
1912 Please refer RWsSession::RegisterEffect() comments for more information on animation description. |
|
1913 |
|
1914 @param aAction The particular transition to set the animation for. |
|
1915 @param aResourceDir The name of the directory that contains the animation description files. |
|
1916 @param aFilenameOutgoing The file containing the description of the animation for the outgoing phase of the transition. |
|
1917 Specify KNullDesC for no outgoing phase effect. |
|
1918 @param aFilenameIncoming The file containing the description of the animation for the incoming phase of the transition. |
|
1919 Specify KNullDesC for no incoming phase effect. |
|
1920 @param aFlags Flag for the effect. Please see TTfxFlags for values this flag parameter can use. |
|
1921 |
|
1922 @publishedPartner |
|
1923 */ |
|
1924 { |
|
1925 RTFXEffect tfxEffect(iWsHandle, iBuffer); |
|
1926 tfxEffect.OverrideTFXEffect(RTFXEffect::ETFXWindow, aAction, 0, aResourceDir, aFilenameOutgoing, aFilenameIncoming, aFlags); |
|
1927 } |
|
1928 //////////////////////////// RDrawableWindow //////////////////////////////// |
1936 |
1929 |
1937 void RDrawableWindow::doScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect, TInt aOpcode) |
1930 void RDrawableWindow::doScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect, TInt aOpcode) |
1938 { |
1931 { |
1939 TWsWinCmdScroll scroll(aClipRect,aOffset,aRect); |
1932 TWsWinCmdScroll scroll(aClipRect,aOffset,aRect); |
1940 Write(&scroll,sizeof(scroll),aOpcode); |
1933 Write(&scroll,sizeof(scroll),aOpcode); |
2803 @param aModifiers Bitmask that identifies which of the modifier keys in |
2796 @param aModifiers Bitmask that identifies which of the modifier keys in |
2804 aModifierMask need to be set and which need to be unset. For example, see the |
2797 aModifierMask need to be set and which need to be unset. For example, see the |
2805 description above. |
2798 description above. |
2806 @param aPriority A priority value - if more than one window group has requested |
2799 @param aPriority A priority value - if more than one window group has requested |
2807 capture for the same key event, the one with the highest priority will capture it. |
2800 capture for the same key event, the one with the highest priority will capture it. |
|
2801 The value must be greater than KMinTInt. |
2808 @return A handle identifying the capture key, or one of the system-wide error |
2802 @return A handle identifying the capture key, or one of the system-wide error |
2809 codes (if <0). KErrPermissionDenied indicates that the requested key cannot be |
2803 codes (if <0). KErrPermissionDenied indicates that the requested key cannot be |
2810 captured by this window group, because it has been protected by another window group. |
2804 captured by this window group, because it has been protected by another window group. |
2811 For more information, see the PROTECTEDKEY parameter in wsini.ini. Handles should be |
2805 For more information, see the PROTECTEDKEY parameter in wsini.ini. Handles should be |
2812 kept in order to be passed to CancelCaptureKey() later. |
2806 kept in order to be passed to CancelCaptureKey() later. |
2871 Possible values are defined in TEventModifier. |
2865 Possible values are defined in TEventModifier. |
2872 @param aModifiers Bitmask that identifies which of the modifier keys in |
2866 @param aModifiers Bitmask that identifies which of the modifier keys in |
2873 aModifierMask need to be set and which need to be unset. |
2867 aModifierMask need to be set and which need to be unset. |
2874 @param aPriority A priority value - if more than one window group has requested |
2868 @param aPriority A priority value - if more than one window group has requested |
2875 capture for the same key event, the one with the highest priority will capture it. |
2869 capture for the same key event, the one with the highest priority will capture it. |
|
2870 The value must be greater than KMinTInt. |
2876 @return A handle identifying the capture key, or one of the system-wide error |
2871 @return A handle identifying the capture key, or one of the system-wide error |
2877 codes (if < 0). KErrPermissionDenied indicates that the requested key cannot be captured by this |
2872 codes (if < 0). KErrPermissionDenied indicates that the requested key cannot be captured by this |
2878 window group, because it has been protected by another window group. For more information, see |
2873 window group, because it has been protected by another window group. For more information, see |
2879 the PROTECTEDKEY parameter in wsini.ini. Handles should be kept in order to be passed to |
2874 the PROTECTEDKEY parameter in wsini.ini. Handles should be kept in order to be passed to |
2880 CancelCaptureKeyUpAndDowns() later. |
2875 CancelCaptureKeyUpAndDowns() later. |
2942 @param aModifiers The key is captured only when the modifier keys specified |
2937 @param aModifiers The key is captured only when the modifier keys specified |
2943 in aModifierMask match these states, where 1 = modifier set, and 0 = modifier |
2938 in aModifierMask match these states, where 1 = modifier set, and 0 = modifier |
2944 not set. Modifier key states are defined in TEventModifier. |
2939 not set. Modifier key states are defined in TEventModifier. |
2945 @param aPriority If more than one window group has requested capture for the |
2940 @param aPriority If more than one window group has requested capture for the |
2946 same long key event, the one with the highest priority will capture the event. |
2941 same long key event, the one with the highest priority will capture the event. |
|
2942 The value must be greater than KMinTInt. |
2947 @param aFlags Configures the long key capture behaviour. See the TLongCaptureFlags |
2943 @param aFlags Configures the long key capture behaviour. See the TLongCaptureFlags |
2948 enum. |
2944 enum. |
2949 @return Identifying value for the long key capture. For use with the CancelCaptureLongKey() |
2945 @return Identifying value for the long key capture. For use with the CancelCaptureLongKey() |
2950 function. |
2946 function. |
2951 @see TLongCaptureFlags |
2947 @see TLongCaptureFlags |
2977 @param aModifiers The key is captured only when the modifier keys specified |
2973 @param aModifiers The key is captured only when the modifier keys specified |
2978 in aModifierMask match these states, where 1 = modifier set, and 0 = modifier |
2974 in aModifierMask match these states, where 1 = modifier set, and 0 = modifier |
2979 not set. Modifier key states are defined in TEventModifier. |
2975 not set. Modifier key states are defined in TEventModifier. |
2980 @param aPriority If more than one window group has requested capture for the |
2976 @param aPriority If more than one window group has requested capture for the |
2981 same long key event, the one with the highest priority will capture the event. |
2977 same long key event, the one with the highest priority will capture the event. |
|
2978 The value must be greater than KMinTInt. |
2982 @param aFlags Configures the long key capture behaviour. See the TLongCaptureFlags |
2979 @param aFlags Configures the long key capture behaviour. See the TLongCaptureFlags |
2983 enum. |
2980 enum. |
2984 @return Identifying value for the long key capture. For use with the CancelCaptureLongKey() |
2981 @return Identifying value for the long key capture. For use with the CancelCaptureLongKey() |
2985 function. |
2982 function. |
2986 @see TLongCaptureFlags |
2983 @see TLongCaptureFlags |