epoc32/include/w32std.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     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.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    25 #include <bitdev.h>
    25 #include <bitdev.h>
    26 #endif
    26 #endif
    27 #ifndef __BITSTD_H__
    27 #ifndef __BITSTD_H__
    28 #include <bitstd.h>
    28 #include <bitstd.h>
    29 #endif
    29 #endif
       
    30 #include <e32keys.h>
       
    31 #include <textcursor.h>
       
    32 #include <pointerevent.h>
       
    33 #include <advancedpointerevent.h>
       
    34 #include <sizemode.h>
       
    35 
       
    36 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    37 #include <graphics/windowserverconstants.h>
       
    38 #include <graphics/pointereventdata.h>
       
    39 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
    30 
    40 
    31 _LIT(KWSERVThreadName,"Wserv");
    41 _LIT(KWSERVThreadName,"Wserv");
    32 
       
    33 /**
       
    34 @internalAll
       
    35 */
       
    36 _LIT(KWSERVServerName,"!Windowserver");
       
    37 
    42 
    38 class RWindowBase;
    43 class RWindowBase;
    39 class RWindow;
    44 class RWindow;
    40 class RWsBuffer;
    45 class RWsBuffer;
    41 class MWsObjectProvider;
    46 class MWsObjectProvider;
    42 
    47 class RWsDrawableSource;
    43 /** Used for testing purpose.
    48 class TSizeMode;
    44 
       
    45 @internalComponent
       
    46 @released
       
    47 */
       
    48 class TSizeMode
       
    49 	{
       
    50 public:
       
    51 	inline TSizeMode(){}
       
    52 	inline TSizeMode(TSize& aSize);
       
    53 	static inline TInt ScaledCord(TInt aOrigin,TInt aScale);
       
    54 	inline TPoint ScaledOrigin();
       
    55 public:
       
    56 	CFbsBitGc::TGraphicsOrientation iRotation;
       
    57 	TPoint iOrigin;
       
    58 	TSize iScreenSize;
       
    59 	TSize iScreenTwipsSize;
       
    60 	TUint iAlternativeRotations;
       
    61 	TRect iPointerCursorArea;
       
    62 	TSize iScreenScale;
       
    63 	TDisplayMode iDefaultDisplayMode;
       
    64 	};
       
    65 
    49 
    66 /** Screen mode enforcement flags.
    50 /** Screen mode enforcement flags.
    67 
    51 
    68 Screen mode enforcement ensures that windows must meet certain requirements
    52 Screen mode enforcement ensures that windows must meet certain requirements
    69 if they are to be displayed. When the screen mode changes, window groups that
    53 if they are to be displayed. When the screen mode changes, window groups that
   316 	EEventModifiersChanged,
   300 	EEventModifiersChanged,
   317 	/** Pointer event.
   301 	/** Pointer event.
   318 
   302 
   319 	This event is sent when the user presses or releases a pointer button (or
   303 	This event is sent when the user presses or releases a pointer button (or
   320 	the equivalent action, depending on the type of pointing device), drags the
   304 	the equivalent action, depending on the type of pointing device), drags the
   321 	pointer, or uses the pointer to switch on the device. If the current input
   305 	pointer, moves it or uses the pointer to switch on the device. */
   322 	type (see TXYInputType) is "mouse" or "relative mouse", i.e. it generates
       
   323 	pointer move events as well as drag events, then this event type is also
       
   324 	generated whenever the pointer is moved. */
       
   325 	EEventPointer,			//5
   306 	EEventPointer,			//5
   326 	/** Pointer enter event.
   307 	/** Pointer enter event.
   327 
   308 
   328 	This occurs when the user moves the pointer into a window with a pointer button
   309 	This occurs when the user moves the pointer into a window with a pointer button
   329 	pressed (or equivalent action depending on the type of pointing device). If
   310 	pressed (or equivalent action depending on the type of pointing device). If
   450 	it to, then a call to the base is made to power down the processor.
   431 	it to, then a call to the base is made to power down the processor.
   451 	
   432 	
   452 	This event is only delivered if explicitly requested using RWsSession:RequestOffEvent(). */
   433 	This event is only delivered if explicitly requested using RWsSession:RequestOffEvent(). */
   453 	EEventRestartSystem,
   434 	EEventRestartSystem,
   454 #endif
   435 #endif
       
   436 	/** The display state or configuration has changed
       
   437 	
       
   438 	Either change of the current resolution list (state change) or current resolution/background
       
   439 	(mode change) will trigger this event.
       
   440 	
       
   441 	Notification of this event is requested by calling MDisplayControl::EnableDisplayChangeEvents() 
       
   442 	 */
       
   443 	EEventDisplayChanged = EEventWindowVisibilityChanged+2,
   455 	//Codes for events only passed into Key Click DLL's
   444 	//Codes for events only passed into Key Click DLL's
   456 	/** Repeating key event.
   445 	/** Repeating key event.
   457 
   446 
   458 	This is only sent to a key click plug-in DLL (if one is present) to indicate
   447 	This is only sent to a key click plug-in DLL (if one is present) to indicate
   459 	a repeating key event.
   448 	a repeating key event.
   661 	EPasswordAlwaysTriggerNow,
   650 	EPasswordAlwaysTriggerNow,
   662 	/** Equivalent to setting the password mode to EPasswordOnceADay and triggering
   651 	/** Equivalent to setting the password mode to EPasswordOnceADay and triggering
   663 	an instant password check. */
   652 	an instant password check. */
   664 	EPasswordOnceADayTriggerNow,
   653 	EPasswordOnceADayTriggerNow,
   665 	};
   654 	};
   666 struct TTextCursor
   655 enum TPriorities {
   667 /** Text cursor parameter information.
   656            /**
   668 
   657            Defines the value EAllPriorities.
   669 A text cursor is a rectangular area which can be set to flash. It is normally
   658            */
   670 only visible when the window group which owns it has the keyboard focus. This
   659            EAllPriorities=KMinTInt,
   671 structure is used to define the parameters of a text cursor, which can be
   660            };
   672 selected for use through the window group using RWindowGroup::SetTextCursor().
       
   673 
       
   674 Custom (non-rectangular) text cursors are supported from v7.0s. They are added
       
   675 to the window server using RWsSession::SetCustomTextCursor(), after which
       
   676 they can be selected for use through the window group, in the same way as
       
   677 standard rectangular cursors. They have a unique identifier, stored in the
       
   678 iType member, which must be greater than ETypeLastBasic. Custom text cursors
       
   679 are clipped to their iHeight and iWidth values. Their iColour member is not
       
   680 used.
       
   681 
       
   682 @publishedAll
       
   683 @released */
       
   684     {
       
   685 	// The different normal text cursors
       
   686 	// A Text cursor can either be a predefined one
       
   687 	// or a general sprite. Cursors between ETypeFirst
       
   688 	// and ETypeLastBasic are predefined ones (even though
       
   689 	// the ones above ETypeLast do not exist and are
       
   690 	// for future use)
       
   691 	/** Cursor type values.
       
   692 
       
   693 	The values between ETypeFirst and ETypeLastBasic are reserved for predefined
       
   694 	cursors. Custom text cursors must have a value greater than ETypeLastBasic.
       
   695 
       
   696 	The values not listed below are for internal use only. */
       
   697 	enum ENamedCursors
       
   698 		{
       
   699 		/** @internalAll */
       
   700 		ETypeNone,
       
   701 		/** Standard filled rectangular cursor. */
       
   702 		ETypeRectangle,
       
   703 		/** Standard hollow rectangular cursor. */
       
   704 		ETypeHollowRectangle,
       
   705 		/** The first predefined cursor type.
       
   706 
       
   707 		Equivalent to ETypeRectangle. This can be used for iterating through the predefined
       
   708 		cursor types. */
       
   709 		ETypeFirst=ETypeRectangle,
       
   710 		/** The last predefined cursor type.
       
   711 
       
   712 		Equivalent to ETypeHollowRectangle. This can be used for iterating through
       
   713 		the predefined cursor types. */
       
   714 		ETypeLast=ETypeHollowRectangle,
       
   715 		/** Reserved for future use.
       
   716 
       
   717 		All custom text cursors must have a type value greater than this. */
       
   718 		ETypeLastBasic = 1000,
       
   719 		};
       
   720 	/** Added for compatibility with previous releases. */
       
   721 	typedef TInt EType;
       
   722 	/** Cursor flash and clipping flags.
       
   723 
       
   724 	The flags not listed below are for internal use only. */
       
   725 	enum EFlags
       
   726 		{
       
   727 		/** The text cursor should not flash. */
       
   728 		EFlagNoFlash		= 0x00000001,
       
   729 		/** The bitmap of each sprite member is clipped left of its x-origin and right of
       
   730 		its x-origin plus iWidth.
       
   731 
       
   732 		Used for custom text cursors only. */
       
   733 		EFlagClipHorizontal	= 0x00000002,
       
   734 		/** The bitmap of each sprite member is clipped vertically.
       
   735 
       
   736 		How it is clipped depends on the text cursor's vertical alignment, see the
       
   737 		TCustomTextCursorAlignment enum in class RWsSession.
       
   738 
       
   739 		Used for custom text cursors only. */
       
   740 		EFlagClipVertical	= 0x00000004,
       
   741 		/** @internalComponent */
       
   742 		EUserFlags			= 0x0000FFFF,
       
   743 		/** @internalComponent */
       
   744 		EFlagClipped		= 0x00010000,
       
   745 		/** @internalComponent */
       
   746 		EPrivateFlags		= 0xFFFF0000,
       
   747 		};
       
   748 	/** The cursor type.
       
   749 
       
   750 	For possible values, see the ENamedCursors enum. */
       
   751 	TInt iType;
       
   752 	/** The height of the text cursor.
       
   753 
       
   754 	This value is also used for clipping custom text cursors, if the EFlagClipVertical
       
   755 	flag is set. */
       
   756     TInt iHeight;
       
   757 	/** The ascent of the text cursor (the distance between the origin and the top). */
       
   758     TInt iAscent;
       
   759 	/** The width of the text cursor.
       
   760 
       
   761 	Custom text cursors are clipped to this value, if the EFlagClipHorizontal
       
   762 	flag is set. */
       
   763     TInt iWidth;
       
   764 	/** Cursor flash and clipping flags.
       
   765 
       
   766 	For possible values, see the EFlags enum. */
       
   767     TUint iFlags;
       
   768 	/** The colour of the text cursor.
       
   769 
       
   770 	If the cursor is flashing, this colour is XOR'd with the screen.
       
   771 
       
   772 	This value is not used for custom text cursors. */
       
   773 	TRgb iColor;
       
   774     };
       
   775 
   661 
   776 /** Sprite flags.
   662 /** Sprite flags.
   777 
   663 
   778 These can be combined using a bit-wise OR operation.
   664 These can be combined using a bit-wise OR operation.
   779 
   665 
   785 	{
   671 	{
   786 	/** Flash sprite on and off.
   672 	/** Flash sprite on and off.
   787 
   673 
   788 	All flashing is done on the same timer, including the text cursor. */
   674 	All flashing is done on the same timer, including the text cursor. */
   789 	ESpriteFlash=0x1,
   675 	ESpriteFlash=0x1,
   790 	/** With this flag set, the sprite is displayed over the window and all its children.
   676 	/** This flag no longer has any effect.
   791 
   677 	
   792 	Without the flag, the sprite is only displayed over the window's visible area.
   678 	If you want a sprite to appear on top of all windows, you can create a floating sprite
   793 
   679 	by specifying a RWindowGroup as parent to the sprite.  */
   794 	This is particularly useful when the sprite is owned by a window group, as
       
   795 	it means the sprite will be displayed over the whole screen.
       
   796 
       
   797 	Notes:
       
   798 
       
   799 	By default a sprite is clipped to the visible region of the window that owns
       
   800 	it.
       
   801 
       
   802 	Sprites with this flag set are displayed in front of sprites without this
       
   803 	flag. */
       
   804 	ESpriteNoChildClip=0x2,
   680 	ESpriteNoChildClip=0x2,
   805 	/** The sprite's appearance will not change when it is on a shadowed part of the
   681 	/** The sprite's appearance will not change when it is on a shadowed part of the
   806 	screen.
   682 	screen.
   807 
   683 
   808 	(Typically this is used for sprites attached to window groups so that
   684 	(Typically this is used for sprites attached to window groups so that
   809 	they are perceived to be floating above the windows). */
   685 	they are perceived to be floating above the windows). */
   810 	ESpriteNoShadows=0x4,
   686 	ESpriteNoShadows=0x4
   811 	/** @internalComponent */
       
   812 	ESpriteNonSystemFlags=0x0000FFFF,
       
   813 	/** @internalComponent */
       
   814 	ESpriteSystemFlags=	  0xFFFF0000,
       
   815 	/** @internalComponent */
       
   816 	ESpritePointer=0x10000,
       
   817 	/** @internalComponent */
       
   818 	ESpriteOOM=0x20000,
       
   819 	/** @internalComponent */
       
   820 	ESpriteDisabled=0x40000,
       
   821 	/** @internalComponent */
       
   822 	ESpriteActive=0x80000,
       
   823 	};
   687 	};
   824 
   688 
   825 struct TSpriteMember
   689 struct TSpriteMember
   826 /** Sprite member.
   690 /** Sprite member.
   827 
   691 
   925 	@code
   789 	@code
   926 	win->PointerFilter(EPointerMoveEvents, EPointerGenerateSimulateMoves)
   790 	win->PointerFilter(EPointerMoveEvents, EPointerGenerateSimulateMoves)
   927 	@endcode
   791 	@endcode
   928 	@see RWindowBase::PointerFilter() */
   792 	@see RWindowBase::PointerFilter() */
   929 	EPointerMoveEvents=EPointerFilterMove|EPointerGenerateSimulatedMove,
   793 	EPointerMoveEvents=EPointerFilterMove|EPointerGenerateSimulatedMove,
   930 	};
       
   931 
       
   932 struct TPointerEvent
       
   933 /** Pointer event details.
       
   934 
       
   935 The function TWsEvent::Pointer() is used to get this structure for a pointer
       
   936 event.
       
   937 
       
   938 @publishedAll
       
   939 @released */
       
   940 	{
       
   941 /** Pointer event types.
       
   942 
       
   943 Note that the user actions that cause these events will vary according to
       
   944 the type of pointing device used. */
       
   945 	enum TType
       
   946 		{
       
   947 		/** Button 1 or pen down. */
       
   948 		EButton1Down,
       
   949 		/** Button 1 or pen up. */
       
   950 		EButton1Up,
       
   951 		/** Button 2 down.
       
   952 
       
   953 		This is the middle button of a 3 button mouse. */
       
   954 		EButton2Down,
       
   955 		/** Button 2 up.
       
   956 
       
   957 		This is the middle button of a 3 button mouse. */
       
   958 		EButton2Up,
       
   959 		/** Button 3 down. */
       
   960 		EButton3Down,
       
   961 		/** Button 3 up. */
       
   962 		EButton3Up,
       
   963 		/** Drag event.
       
   964 
       
   965 		These events are only received when button 1 is down. */
       
   966 		EDrag,
       
   967 		/** Move event.
       
   968 
       
   969 		These events are only received when button 1 is up and the XY input mode is
       
   970 		not pen. */
       
   971 		EMove,
       
   972 		/** Button repeat event. */
       
   973 		EButtonRepeat,
       
   974 		/** Switch on event caused by a screen tap. */
       
   975 		ESwitchOn,
       
   976 		};
       
   977 	/** The type of pointer event. */
       
   978 	TType iType;
       
   979 	/** The state of the modifier keys, defined in TEventModifier. */
       
   980 	TUint iModifiers;	// State of pointing device and associated buttons
       
   981 	/** Co-ordinates of the pointer event relative to the origin of the window it occurred
       
   982 	in.
       
   983 
       
   984 	Positive co-ordinates indicate a position to the right of and down from
       
   985 	the window's origin, negative co-ordinates indicate a position to the left
       
   986 	and up. */
       
   987 	TPoint iPosition;
       
   988 	/** Co-ordinates of the pointer event relative to the parent window of the window
       
   989 	it occurred in.
       
   990 
       
   991 	Positive co-ordinates indicate a position to the right of and down from the window's
       
   992 	origin, negative co-ordinates indicate a position to the left and up. */
       
   993 	TPoint iParentPosition;
       
   994 	};
   794 	};
   995 
   795 
   996 struct TKeyEvent
   796 struct TKeyEvent
   997 /** Key event details.
   797 /** Key event details.
   998 
   798 
  1070 		};
   870 		};
  1071 	/** A combination of one or more visibility event flags. */
   871 	/** A combination of one or more visibility event flags. */
  1072 	TUint iFlags;
   872 	TUint iFlags;
  1073 	};
   873 	};
  1074 
   874 
       
   875 struct TWsDisplayChangedEvent
       
   876 /** Display changed events.
       
   877 
       
   878 These events are generated by attaching, detaching the display device, changing the resolution list or change
       
   879 current resolution or backgound (change the current configuration).
       
   880 @publishedAll
       
   881 @released
       
   882 @see MDisplayControl::EnableDisplayChangeEvents() */
       
   883 	{
       
   884 	/**
       
   885 	 Number of display that has changed, causing this event. This is
       
   886 	 also known as the screen number, and is zero-based.
       
   887 	
       
   888 	 @see CWsScreenDevice::Construct(TInt)
       
   889 	 */
       
   890 	TInt iDisplayNumber;
       
   891 	/**
       
   892 	 Opaque value that changes when the current display configuration
       
   893 	 has changed.
       
   894 	 
       
   895 	 Compare values in subsequent events to determine whether the
       
   896 	 current resolution has changed since the last event.
       
   897 	 */
       
   898 	TInt iConfigurationChangeId;
       
   899 	/**
       
   900 	 Opaque value that changes when the resolution list has changed.
       
   901 	 
       
   902 	 Compare values in subsequent events to determine whether the list
       
   903 	 of available resolutions has changed since the last event.
       
   904 	 
       
   905 	 @see MDisplayControlBase::GetResolutions
       
   906 	 */
       
   907 	TInt iResolutionListChangeId;	
       
   908 	};
       
   909 
  1075 struct TWsErrorMessage
   910 struct TWsErrorMessage
  1076 /** Error event details.
   911 /** Error event details.
  1077 
   912 
  1078 @publishedAll
   913 @publishedAll
  1079 @released
   914 @released
  1102 	TErrorCategory iErrorCategory;
   937 	TErrorCategory iErrorCategory;
  1103 	/** The error code */
   938 	/** The error code */
  1104 	TUint iError;
   939 	TUint iError;
  1105 	};
   940 	};
  1106 
   941 
  1107 struct TWsGraphicMessageHeaderEvent
       
  1108 /** @internalComponent @released */
       
  1109 	{
       
  1110 	TInt iClientHandle;
       
  1111 	TInt iDataLen;
       
  1112 	};
       
  1113 
       
  1114 class TWsRedrawEvent
   942 class TWsRedrawEvent
  1115 /** Window server redraw event.
   943 /** Window server redraw event.
  1116 
   944 
  1117 All redraw events generated by the window server are delivered to the client
   945 All redraw events generated by the window server are delivered to the client
  1118 in an object of this type. The class provides a handle to the window which
   946 in an object of this type. The class provides a handle to the window which
  1127 	inline TRect Rect() const;
   955 	inline TRect Rect() const;
  1128 public:
   956 public:
  1129 	void SetHandle(TUint aHandle);
   957 	void SetHandle(TUint aHandle);
  1130 	void SetRect(TRect aRect);
   958 	void SetRect(TRect aRect);
  1131 protected:
   959 protected:
  1132 	/**	@internalComponent */
   960 	TUint iHandle;	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
  1133 	TUint iHandle;
   961 	TRect iRect;	/**< Rectangle to redraw.  WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
  1134 	/** @internalComponent */
       
  1135 	TRect iRect;			// Rectangle to redraw
       
  1136 	};
   962 	};
  1137 
   963 
  1138 class TWsPriorityKeyEvent
   964 class TWsPriorityKeyEvent
  1139 /** Priority key events.
   965 /** Priority key events.
  1140 
   966 
  1147 public:
   973 public:
  1148 	inline TKeyEvent *Key() const;
   974 	inline TKeyEvent *Key() const;
  1149 	inline TUint Handle() const;
   975 	inline TUint Handle() const;
  1150 	inline void SetHandle(TUint aHandle);
   976 	inline void SetHandle(TUint aHandle);
  1151 protected:
   977 protected:
  1152 	/**	@internalComponent */
   978 	TUint iHandle;	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
  1153 	TUint iHandle;
   979 	TUint8 iEventData[sizeof(TKeyEvent)];	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
  1154 	/** @internalComponent */
       
  1155 	TUint8 iEventData[sizeof(TKeyEvent)];
       
  1156 	};
   980 	};
  1157 
   981 
  1158 class TWsEvent
   982 class TWsEvent
  1159 /** Window server event.
   983 /** Window server event.
  1160 
   984 
  1169 	{
   993 	{
  1170 public:
   994 public:
  1171 	/** Event data size. */
   995 	/** Event data size. */
  1172 	enum
   996 	enum
  1173 		{
   997 		{
  1174 		/** The size of a TPointerEvent.
   998 		/**
  1175 
       
  1176 		This is the maximum number of bytes of data that can be returned by EventData().
   999 		This is the maximum number of bytes of data that can be returned by EventData().
  1177 		Note: this value is 24 bytes.*/
  1000 		Note: this value is 32 bytes.*/
  1178 		EWsEventDataSize=sizeof(TPointerEvent)+8
  1001 		EWsEventDataSize=sizeof(TAdvancedPointerEvent)
  1179 		};
  1002 		};
  1180 public:
  1003 public:
  1181 	inline TPointerEvent* Pointer() const;
  1004 	inline TWsEvent();
       
  1005 	inline TAdvancedPointerEvent* Pointer() const;
  1182 	inline TKeyEvent* Key() const;
  1006 	inline TKeyEvent* Key() const;
  1183 	inline TModifiersChangedEvent* ModifiersChanged() const;
  1007 	inline TModifiersChangedEvent* ModifiersChanged() const;
  1184 	inline TWsVisibilityChangedEvent* VisibilityChanged();
  1008 	inline TWsVisibilityChangedEvent* VisibilityChanged();
  1185 	inline const TWsVisibilityChangedEvent* VisibilityChanged() const;
  1009 	inline const TWsVisibilityChangedEvent* VisibilityChanged() const;
       
  1010 	inline TWsDisplayChangedEvent* DisplayChanged();
       
  1011 	inline const TWsDisplayChangedEvent* DisplayChanged() const;
  1186 	inline TWsErrorMessage* ErrorMessage() const;
  1012 	inline TWsErrorMessage* ErrorMessage() const;
  1187 	inline TUint8* EventData() const;
  1013 	inline TUint8* EventData() const;
  1188 	inline TInt Type() const;
  1014 	inline TInt Type() const;
  1189 	inline TUint Handle() const;
  1015 	inline TUint Handle() const;
  1190 	inline TTime Time() const;
  1016 	inline TTime Time() const;
  1191 	inline void SetType(TInt aType);
  1017 	inline void SetType(TInt aType);
  1192 	inline void SetHandle(TUint aHandle);
  1018 	inline void SetHandle(TUint aHandle);
  1193 	inline void SetTimeNow();
  1019 	inline void SetTimeNow();
  1194 	inline TInt* Int() const;
  1020 	inline TInt* Int() const;
       
  1021 	IMPORT_C void InitAdvancedPointerEvent(TPointerEvent::TType aType, TUint aModifiers, const TPoint3D &aPoint3D, TUint8 aPointerNumber);
       
  1022 	IMPORT_C void SetPointerNumber(TUint8 aPointerNumber);
       
  1023 	IMPORT_C void SetPointerZ(TInt aZ);
  1195 protected:
  1024 protected:
  1196 	/** @internalComponent */
  1025 	TInt iType;	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
  1197 	TInt iType;
  1026 	TUint iHandle;	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
  1198 	/** @internalComponent */
  1027 	TTime iTime;	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
  1199 	TUint iHandle;
  1028 	TUint8 iEventData[EWsEventDataSize];	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */	
  1200 	/**	@internalComponent */
       
  1201 	TTime iTime;
       
  1202 	/** @internalComponent */
       
  1203 	TUint8 iEventData[EWsEventDataSize];
       
  1204 	};
  1029 	};
  1205 
  1030 
  1206 
  1031 
  1207 class RWsPointerCursor;
  1032 class RWsPointerCursor;
  1208 
  1033 
  1272 
  1097 
  1273 class TIpcArgs;
  1098 class TIpcArgs;
  1274 class TReadDescriptorType;
  1099 class TReadDescriptorType;
  1275 class TWriteDescriptorType;
  1100 class TWriteDescriptorType;
  1276 class CWindowGc;
  1101 class CWindowGc;
       
  1102 class RWsSession;
  1277 
  1103 
  1278 class TWsGraphicId
  1104 class TWsGraphicId
  1279 /** Identifies an abstract artwork
  1105 /** Identifies an abstract artwork
  1280 
  1106 
  1281 This is a piece of artwork that might be owned and authored by another process.
  1107 This is a piece of artwork that might be owned and authored by another process.
  1336 protected:
  1162 protected:
  1337 	IMPORT_C void SendMessage(const TDesC8& aData) const;
  1163 	IMPORT_C void SendMessage(const TDesC8& aData) const;
  1338 	IMPORT_C TInt SendSynchronMessage(const TDesC8& aData) const;
  1164 	IMPORT_C TInt SendSynchronMessage(const TDesC8& aData) const;
  1339 	IMPORT_C TInt Flush() const;
  1165 	IMPORT_C TInt Flush() const;
  1340 	IMPORT_C void SetGraphicExtension(MWsObjectProvider* aExt);
  1166 	IMPORT_C void SetGraphicExtension(MWsObjectProvider* aExt);
       
  1167 	IMPORT_C RWsSession& Session();
       
  1168 	
  1341 private:
  1169 private:
  1342 	// events from wserv, to be implemented by derived classes
  1170 	// events from wserv, to be implemented by derived classes
  1343 	/**
  1171 	/**
  1344 	Handles message from this graphic artwork peer on the server.
  1172 	Handles message from this graphic artwork peer on the server.
  1345 	@param aData Message from peer CWsGraphicDrawer.
  1173 	@param aData Message from peer CWsGraphicDrawer.
  1394 	TInt WriteReplyP(const TAny *aBuf, TInt aBufLen, const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
  1222 	TInt WriteReplyP(const TAny *aBuf, TInt aBufLen, const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
  1395 	TInt WriteReplyP(const TAny *aBuf, TInt aBufLen,const TAny *aBuf2, TInt aBuflen2, const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
  1223 	TInt WriteReplyP(const TAny *aBuf, TInt aBufLen,const TAny *aBuf2, TInt aBuflen2, const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
  1396 	TInt WriteReplyByProvidingRemoteReadAccess(const TAny* aBuf, TInt aBufLen,const TReadDescriptorType& aRemoteReadBuffer,TUint aOpcode) const;
  1224 	TInt WriteReplyByProvidingRemoteReadAccess(const TAny* aBuf, TInt aBufLen,const TReadDescriptorType& aRemoteReadBuffer,TUint aOpcode) const;
  1397 	void AddToBitmapArray(const TInt aBitmapHandle)const;
  1225 	void AddToBitmapArray(const TInt aBitmapHandle)const;
  1398 	void AsyncRequest(TRequestStatus& aStatus, TUint aOpcode) const;
  1226 	void AsyncRequest(TRequestStatus& aStatus, TUint aOpcode) const;
       
  1227 
       
  1228     TBool WindowSizeCacheEnabled() const;
       
  1229     void MarkWindowSizeCacheDirty();
       
  1230     void RefreshWindowSizeCache(const TSize& aNewSize) const;
       
  1231     TInt CachedWindowSize(TSize& aSize) const;
       
  1232     void DestroyWindowSizeCacheEntry();
       
  1233 	
  1399 protected:
  1234 protected:
  1400 	/** @internalComponent*/
  1235 	TInt32 iWsHandle;	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
  1401 	TInt32 iWsHandle;
  1236 	RWsBuffer *iBuffer;	/**< WARNING: Member variable for internal use ONLY. Compatibility is not guaranteed in future releases. Please access using the provided get/set APIs only. */
  1402 	/** @internalComponent*/
       
  1403 	RWsBuffer *iBuffer;
       
  1404 	};
  1237 	};
  1405 
  1238 
  1406 
  1239 
  1407 class RWindowTreeNode;
  1240 class RWindowTreeNode;
  1408 class CWsScreenDevice;
  1241 class CWsScreenDevice;
  1446 Typically, these functions are only used by the system shell and its associated
  1279 Typically, these functions are only used by the system shell and its associated
  1447 sessions/applications. They include: auto-repeat and double-click, querying
  1280 sessions/applications. They include: auto-repeat and double-click, querying
  1448 all window groups in the system, setting the default shadow vector, setting
  1281 all window groups in the system, setting the default shadow vector, setting
  1449 the system pointer cursors, counting resources used by the window server
  1282 the system pointer cursors, counting resources used by the window server
  1450 (this is only useful for debugging checks), getting and setting the state of
  1283 (this is only useful for debugging checks), getting and setting the state of
  1451 the modifier keys (for instance Shift and Ctrl), and setting the window server
  1284 the modifier keys (for instance Shift and Ctrl), setting the window server
  1452 background colour.
  1285 background colour, getting and setting thresholds for window server generated
       
  1286 pointer events.
  1453 
  1287 
  1454 @publishedAll
  1288 @publishedAll
  1455 @released */
  1289 @released */
  1456 	{
  1290 	{
  1457 	friend class RWsBuffer;
  1291 	friend class RWsBuffer;
  1461 	friend class RAnimDll;
  1295 	friend class RAnimDll;
  1462 	friend class RWsSpriteBase;
  1296 	friend class RWsSpriteBase;
  1463 	friend class RDirectScreenAccess;
  1297 	friend class RDirectScreenAccess;
  1464 	friend class RSoundPlugIn;
  1298 	friend class RSoundPlugIn;
  1465 	friend class CWsGraphic;
  1299 	friend class CWsGraphic;
       
  1300 	friend class RWsDrawableSource;
  1466 public:
  1301 public:
  1467 	/** Compute mode flags.
  1302 	/** Compute mode flags.
  1468 
  1303 
  1469 	When a window group takes focus or loses it, the window server can boost its
  1304 	When a window group takes focus or loses it, the window server can boost its
  1470 	client's thread or process priority to provide a better response to the user.
  1305 	client's thread or process priority to provide a better response to the user.
  1517 		TInt iId;
  1352 		TInt iId;
  1518 		TInt iParentId;
  1353 		TInt iParentId;
  1519 		};
  1354 		};
  1520 
  1355 
  1521 	struct SSystemInfo
  1356 	struct SSystemInfo
  1522 	/** @internalComponent */
  1357 	/** WARNING: Struct for internal use ONLY.  Compatibility is not guaranteed in future releases. */ 
  1523 		{
  1358 		{
  1524 		TInt iInfo[ESystemInfoArraySize];
  1359 		TInt iInfo[ESystemInfoArraySize];
  1525 		};
  1360 		};
  1526 	/** The vertical alignment of a custom text cursor sprite.
  1361 	/** The vertical alignment of a custom text cursor sprite.
  1527 
  1362 
  1543 public:
  1378 public:
  1544 	IMPORT_C RWsSession();
  1379 	IMPORT_C RWsSession();
  1545 	IMPORT_C TInt Connect();
  1380 	IMPORT_C TInt Connect();
  1546 	IMPORT_C TInt Connect(RFs& aFileServer);
  1381 	IMPORT_C TInt Connect(RFs& aFileServer);
  1547 	IMPORT_C void Close();
  1382 	IMPORT_C void Close();
  1548 	IMPORT_C TVersion Version();
  1383 	IMPORT_C TVersion Version() const;
  1549 
  1384 
  1550 	IMPORT_C TInt SetHotKey(THotKey aType, TUint aKeyCode, TUint aModifierMask, TUint aModifier);
  1385 	IMPORT_C TInt SetHotKey(THotKey aType, TUint aKeyCode, TUint aModifierMask, TUint aModifier);
  1551 	IMPORT_C TInt ClearHotKeys(THotKey aType);
  1386 	IMPORT_C TInt ClearHotKeys(THotKey aType);
  1552 	IMPORT_C TInt RestoreDefaultHotKey(THotKey aType);
  1387 	IMPORT_C TInt RestoreDefaultHotKey(THotKey aType);
  1553 //
  1388 //
  1554 	IMPORT_C void EventReady(TRequestStatus *aStat);
  1389 	IMPORT_C void EventReady(TRequestStatus *aStat);
  1555 	IMPORT_C void EventReadyCancel();
  1390 	IMPORT_C void EventReadyCancel();
  1556 	IMPORT_C void GetEvent(TWsEvent &aEvent);
  1391 	IMPORT_C void GetEvent(TWsEvent &aEvent) const;
  1557 	IMPORT_C void PurgePointerEvents();
  1392 	IMPORT_C void PurgePointerEvents();
  1558 //
  1393 //
  1559 	IMPORT_C void RedrawReady(TRequestStatus *aStat);
  1394 	IMPORT_C void RedrawReady(TRequestStatus *aStat);
  1560 	IMPORT_C void RedrawReadyCancel();
  1395 	IMPORT_C void RedrawReadyCancel();
  1561 	IMPORT_C void GetRedraw(TWsRedrawEvent &aEvent);
  1396 	IMPORT_C void GetRedraw(TWsRedrawEvent &aEvent);
  1562 //
  1397 //
  1563 	IMPORT_C void PriorityKeyReady(TRequestStatus *aStat);
  1398 	IMPORT_C void PriorityKeyReady(TRequestStatus *aStat);
  1564 	IMPORT_C void PriorityKeyReadyCancel();
  1399 	IMPORT_C void PriorityKeyReadyCancel();
  1565 	IMPORT_C void GetPriorityKey(TWsPriorityKeyEvent &aEvent);
  1400 	IMPORT_C void GetPriorityKey(TWsPriorityKeyEvent &aEvent) const;
  1566 //
  1401 //
  1567 	IMPORT_C void Flush();
  1402 	IMPORT_C void Flush();
  1568 	IMPORT_C TBool SetAutoFlush(TBool aState);
  1403 	IMPORT_C TBool SetAutoFlush(TBool aState);
  1569 	IMPORT_C TInt SetKeyboardRepeatRate(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime);
  1404 	IMPORT_C TInt SetKeyboardRepeatRate(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime);
  1570 	IMPORT_C void GetKeyboardRepeatRate(TTimeIntervalMicroSeconds32 &aInitialTime, TTimeIntervalMicroSeconds32 &aTime);
  1405 	IMPORT_C void GetKeyboardRepeatRate(TTimeIntervalMicroSeconds32 &aInitialTime, TTimeIntervalMicroSeconds32 &aTime) const;
  1571 	IMPORT_C void GetDoubleClickSettings(TTimeIntervalMicroSeconds32 &aInterval, TInt &aDistance);
  1406 	IMPORT_C void GetDoubleClickSettings(TTimeIntervalMicroSeconds32 &aInterval, TInt &aDistance) const;
  1572 	IMPORT_C TInt SetDoubleClick(const TTimeIntervalMicroSeconds32 &aInterval, TInt aDistance);
  1407 	IMPORT_C TInt SetDoubleClick(const TTimeIntervalMicroSeconds32 &aInterval, TInt aDistance);
  1573 //
  1408 //
  1574 	IMPORT_C TInt NumWindowGroups() const;
  1409 	IMPORT_C TInt NumWindowGroups() const;
  1575 	IMPORT_C TInt WindowGroupList(CArrayFixFlat<TInt> *aWindowList);
  1410 	IMPORT_C TInt WindowGroupList(CArrayFixFlat<TInt> *aWindowList) const;
  1576 	IMPORT_C TInt WindowGroupList(RArray<TWindowGroupChainInfo>* aWindowList);
  1411 	IMPORT_C TInt WindowGroupList(RArray<TWindowGroupChainInfo>* aWindowList) const;
  1577 	IMPORT_C TInt NumWindowGroups(TInt aPriority) const;
  1412 	IMPORT_C TInt NumWindowGroups(TInt aPriority) const;
  1578 	IMPORT_C TInt WindowGroupList(TInt aPriority, CArrayFixFlat<TInt> *aWindowList);
  1413 	IMPORT_C TInt WindowGroupList(TInt aPriority, CArrayFixFlat<TInt> *aWindowList) const;
  1579 	IMPORT_C TInt WindowGroupList(TInt aPriority, RArray<TWindowGroupChainInfo>* aWindowList);
  1414 	IMPORT_C TInt WindowGroupList(TInt aPriority, RArray<TWindowGroupChainInfo>* aWindowList) const;
  1580 	IMPORT_C TInt GetFocusWindowGroup();
  1415 	IMPORT_C TInt GetFocusWindowGroup() const;
  1581 	IMPORT_C TInt GetDefaultOwningWindow();
  1416 	IMPORT_C TInt GetDefaultOwningWindow() const;
  1582 	IMPORT_C TInt SetWindowGroupOrdinalPosition(TInt aIdentifier, TInt aPosition);
  1417 	IMPORT_C TInt SetWindowGroupOrdinalPosition(TInt aIdentifier, TInt aPosition);
  1583 	IMPORT_C TInt GetWindowGroupClientThreadId(TInt aIdentifier, TThreadId &aThreadId);
  1418 	IMPORT_C TInt GetWindowGroupClientThreadId(TInt aIdentifier, TThreadId &aThreadId) const;
  1584 	IMPORT_C TInt GetWindowGroupHandle(TInt aIdentifier);
  1419 	IMPORT_C TInt GetWindowGroupHandle(TInt aIdentifier) const;
  1585 	IMPORT_C TInt GetWindowGroupOrdinalPriority(TInt aIdentifier);
  1420 	IMPORT_C TInt GetWindowGroupOrdinalPriority(TInt aIdentifier) const;
  1586 	IMPORT_C TInt SendEventToWindowGroup(TInt aIdentifier, const TWsEvent &aEvent);
  1421 	IMPORT_C TInt SendEventToWindowGroup(TInt aIdentifier, const TWsEvent &aEvent);
  1587 	IMPORT_C TInt SendEventToAllWindowGroups(const TWsEvent &aEvent);
  1422 	IMPORT_C TInt SendEventToAllWindowGroups(const TWsEvent &aEvent);
  1588 	IMPORT_C TInt SendEventToAllWindowGroups(TInt aPriority, const TWsEvent &aEvent);
  1423 	IMPORT_C TInt SendEventToAllWindowGroups(TInt aPriority, const TWsEvent &aEvent);
  1589 	IMPORT_C TInt SendEventToOneWindowGroupsPerClient(const TWsEvent &aEvent);
  1424 	IMPORT_C TInt SendEventToOneWindowGroupsPerClient(const TWsEvent &aEvent);
  1590 	IMPORT_C TInt GetWindowGroupNameFromIdentifier(TInt aIdentifier, TDes &aWindowName);
  1425 	IMPORT_C TInt GetWindowGroupNameFromIdentifier(TInt aIdentifier, TDes &aWindowName) const;
  1591 	IMPORT_C TInt FindWindowGroupIdentifier(TInt aPreviousIdentifier,const TDesC& aMatch,TInt aOffset=0);
  1426 	IMPORT_C TInt FindWindowGroupIdentifier(TInt aPreviousIdentifier,const TDesC& aMatch,TInt aOffset=0) const;
  1592 	IMPORT_C TInt FindWindowGroupIdentifier(TInt aPreviousIdentifier,TThreadId aThreadId);
  1427 	IMPORT_C TInt FindWindowGroupIdentifier(TInt aPreviousIdentifier,TThreadId aThreadId) const;
  1593 	IMPORT_C TInt SendMessageToWindowGroup(TInt aIdentifier, TUid aUid, const TDesC8 &aParams);
  1428 	IMPORT_C TInt SendMessageToWindowGroup(TInt aIdentifier, TUid aUid, const TDesC8 &aParams);
  1594 	IMPORT_C TInt SendMessageToAllWindowGroups(TUid aUid, const TDesC8& aParams);
  1429 	IMPORT_C TInt SendMessageToAllWindowGroups(TUid aUid, const TDesC8& aParams);
  1595 	IMPORT_C TInt SendMessageToAllWindowGroups(TInt aPriority, TUid aUid, const TDesC8& aParams);
  1430 	IMPORT_C TInt SendMessageToAllWindowGroups(TInt aPriority, TUid aUid, const TDesC8& aParams);
  1596 	IMPORT_C TInt FetchMessage(TUid &aUid, TPtr8 &aParams, const TWsEvent& aMessageEvent);
  1431 	IMPORT_C TInt FetchMessage(TUid &aUid, TPtr8 &aParams, const TWsEvent& aMessageEvent) const;
  1597 //
  1432 //
  1598 	IMPORT_C void SetShadowVector(const TPoint &aVector);
  1433 	IMPORT_C void SetShadowVector(const TPoint &aVector);
  1599 	IMPORT_C TPoint ShadowVector() const;
  1434 	IMPORT_C TPoint ShadowVector() const;
  1600 //
  1435 //
  1601 	IMPORT_C void SetBackgroundColor(TRgb aColor);
  1436 	IMPORT_C void SetBackgroundColor(TRgb aColor);
  1602 	IMPORT_C TRgb GetBackgroundColor() const;
  1437 	IMPORT_C TRgb GetBackgroundColor() const;
  1603 //
  1438 //
  1604 	IMPORT_C TInt RegisterSurface(TInt aScreenNumber, const TSurfaceId& aSurface);		///< @publishedPartner
  1439 	IMPORT_C TInt RegisterSurface(TInt aScreenNumber, const TSurfaceId& aSurface);
  1605 	IMPORT_C void UnregisterSurface(TInt aScreenNumber, const TSurfaceId& aSurface);	///< @publishedPartner
  1440 	IMPORT_C void UnregisterSurface(TInt aScreenNumber, const TSurfaceId& aSurface);
  1606 	IMPORT_C TInt PreferredSurfaceConfigurationSize();		///< @publishedPartner
  1441 	IMPORT_C TInt PreferredSurfaceConfigurationSize() const;
  1607 //
  1442 //
  1608 	IMPORT_C TInt SetSystemPointerCursor(const RWsPointerCursor &aPointerCursor,TInt aCursorNumber);
  1443 	IMPORT_C TInt SetSystemPointerCursor(const RWsPointerCursor &aPointerCursor,TInt aCursorNumber);
  1609 	IMPORT_C void ClearSystemPointerCursor(TInt aCursorNumber);
  1444 	IMPORT_C void ClearSystemPointerCursor(TInt aCursorNumber);
  1610 	IMPORT_C TInt ClaimSystemPointerCursorList();
  1445 	IMPORT_C TInt ClaimSystemPointerCursorList();
  1611 	IMPORT_C void FreeSystemPointerCursorList();
  1446 	IMPORT_C void FreeSystemPointerCursorList();
  1612 //
  1447 //
  1613 	IMPORT_C TInt SetCustomTextCursor(TInt aIdentifier, const TArray<TSpriteMember>& aSpriteMemberArray, TUint aSpriteFlags, TCustomTextCursorAlignment aAlignment);
  1448 	IMPORT_C TInt SetCustomTextCursor(TInt aIdentifier, const TArray<TSpriteMember>& aSpriteMemberArray, TUint aSpriteFlags, TCustomTextCursorAlignment aAlignment);
  1614 //
  1449 //
  1615 	IMPORT_C TInt ResourceCount();
  1450 	IMPORT_C TInt ResourceCount() const;
  1616 	IMPORT_C void PasswordEntered();
  1451 	IMPORT_C void PasswordEntered();
  1617 	IMPORT_C void ComputeMode(TComputeMode aMode);
  1452 	IMPORT_C void ComputeMode(TComputeMode aMode);
  1618 //
  1453 //
  1619 	IMPORT_C TInt HeapCount() const;
  1454 	IMPORT_C TInt HeapCount() const;
  1620 	IMPORT_C TInt DebugInfo(TInt aFunction, TInt aParam=0) const;
  1455 	IMPORT_C TInt DebugInfo(TInt aFunction, TInt aParam=0) const;
  1621 	IMPORT_C TInt DebugInfo(TInt aFunction, TDes8& aReturnBuf, TInt aParam=0) const;
  1456 	IMPORT_C TInt DebugInfo(TInt aFunction, TDes8& aReturnBuf, TInt aParam=0) const;
  1622 	IMPORT_C void HeapSetFail(TInt aTAllocFail,TInt aValue);
  1457 	IMPORT_C void HeapSetFail(TInt aTAllocFail,TInt aValue);
       
  1458 	IMPORT_C void HeapSetBurstFail(TInt aTAllocFail,TInt aRate,TInt aBurst);
  1623 	IMPORT_C TInt SetModifierState(TEventModifier aModifier,TModifierState aState);
  1459 	IMPORT_C TInt SetModifierState(TEventModifier aModifier,TModifierState aState);
  1624 	IMPORT_C TInt GetModifierState() const;
  1460 	IMPORT_C TInt GetModifierState() const;
  1625 //
  1461 //
  1626 	IMPORT_C TInt RequestOffEvents(TBool aOn,RWindowTreeNode *aWin=NULL);
  1462 	IMPORT_C TInt RequestOffEvents(TBool aOn,RWindowTreeNode *aWin=NULL);
  1627 	IMPORT_C TDisplayMode GetDefModeMaxNumColors(TInt& aColor,TInt& aGray) const;
  1463 	IMPORT_C TDisplayMode GetDefModeMaxNumColors(TInt& aColor,TInt& aGray) const;
  1646 	IMPORT_C TInt SetSystemFaded(TBool aFaded);
  1482 	IMPORT_C TInt SetSystemFaded(TBool aFaded);
  1647 	IMPORT_C TInt SetSystemFaded(TBool aFaded,TUint8 aBlackMap,TUint8 aWhiteMap);
  1483 	IMPORT_C TInt SetSystemFaded(TBool aFaded,TUint8 aBlackMap,TUint8 aWhiteMap);
  1648 
  1484 
  1649 // Functions for multiple screens
  1485 // Functions for multiple screens
  1650 	IMPORT_C TInt SetFocusScreen(TInt aScreenNumber);
  1486 	IMPORT_C TInt SetFocusScreen(TInt aScreenNumber);
  1651 	IMPORT_C TInt GetFocusScreen();
  1487 	IMPORT_C TInt GetFocusScreen() const;
  1652 	IMPORT_C void ClearAllRedrawStores();
  1488 	IMPORT_C void ClearAllRedrawStores();
       
  1489 	IMPORT_C TInt NumWindowGroups(TInt aScreenNumber,TInt aPriority) const;
       
  1490 	IMPORT_C TInt NumberOfScreens() const;
       
  1491 	IMPORT_C TInt WindowGroupList(CArrayFixFlat<TInt>* aWindowList,TInt aScreenNumber,TInt aPriority=EAllPriorities) const;
       
  1492 	IMPORT_C TInt GetFocusWindowGroup(TInt aScreenNumber) const;
       
  1493 	IMPORT_C TInt GetDefaultOwningWindow(TInt aScreenNumber) const;
       
  1494 	IMPORT_C TDisplayMode GetDefModeMaxNumColors(TInt aScreenNumber,TInt& aColor,TInt& aGray) const;
       
  1495 	IMPORT_C TInt GetColorModeList(TInt aScreenNumber,CArrayFixFlat<TInt>* aModeList) const;
  1653 #if defined(__WINS__)
  1496 #if defined(__WINS__)
  1654 // Function for WINS behaviour only
  1497 // Function for WINS behaviour only
  1655 //
       
  1656 	IMPORT_C void SetRemoveKeyCode(TBool aRemove);
  1498 	IMPORT_C void SetRemoveKeyCode(TBool aRemove);
  1657 	IMPORT_C void SimulateXyInputType(TXYInputType aInputType);		//Only for testing WSERV
  1499 	IMPORT_C void SimulateXyInputType(TInt aInputType);		//Only for testing WSERV
  1658 #endif
  1500 #endif
  1659 //
  1501 //
  1660 	IMPORT_C void SimulateRawEvent(TRawEvent aEvent);
  1502 	IMPORT_C void SimulateRawEvent(TRawEvent aEvent);
  1661 	IMPORT_C void SimulateKeyEvent(TKeyEvent aEvent);
  1503 	IMPORT_C void SimulateKeyEvent(TKeyEvent aEvent);
  1662 	IMPORT_C void LogCommand(TLoggingCommand aCommand);
  1504 	IMPORT_C void LogCommand(TLoggingCommand aCommand);
  1663 	IMPORT_C void LogMessage(const TLogMessageText &aMessage);
  1505 	IMPORT_C void LogMessage(const TLogMessageText &aMessage);
  1664 //
  1506 
  1665 // Functions for test code use only
  1507 // Functions for test code use only
  1666 //
       
  1667 	IMPORT_C void SystemInfo(TInt &aSystemInfoNumber, SSystemInfo &aSystemInfo);
  1508 	IMPORT_C void SystemInfo(TInt &aSystemInfoNumber, SSystemInfo &aSystemInfo);
  1668 	IMPORT_C void TestWrite(TInt aHandle,TInt aOpcode,const TAny *aData, TInt aLength);
  1509 	IMPORT_C void TestWrite(TInt aHandle,TInt aOpcode,const TAny *aData, TInt aLength);
  1669 	IMPORT_C void TestWriteReply(TInt aHandle,TInt aOpcode,const TAny *aData, TInt aLength);
  1510 	IMPORT_C void TestWriteReply(TInt aHandle,TInt aOpcode,const TAny *aData, TInt aLength);
  1670 	IMPORT_C void TestWriteReplyP(TInt aHandle,TInt aOpcode,const TAny *aData,TInt aLength,TDes8 *aReplyPackage);
  1511 	IMPORT_C void TestWriteReplyP(TInt aHandle,TInt aOpcode,const TAny *aData,TInt aLength,TDes8 *aReplyPackage);
  1671 	IMPORT_C TInt TestWriteReplyByProvidingRemoteReadAccess(TInt aHandle,TInt aOpcode,const TDesC8& aData,const TDesC8& aRemoteReadBuffer);
  1512 	IMPORT_C TInt TestWriteReplyByProvidingRemoteReadAccess(TInt aHandle,TInt aOpcode,const TDesC8& aData,const TDesC8& aRemoteReadBuffer);
  1672 	IMPORT_C TInt TestWriteReplyByProvidingRemoteReadAccess(TInt aHandle,TInt aOpcode,const TDesC8& aData,const TDesC16& aRemoteReadBuffer);
  1513 	IMPORT_C TInt TestWriteReplyByProvidingRemoteReadAccess(TInt aHandle,TInt aOpcode,const TDesC8& aData,const TDesC16& aRemoteReadBuffer);
  1673 	
  1514 	
  1674 	IMPORT_C TInt Finish();
  1515 	IMPORT_C TInt Finish();
  1675 	IMPORT_C void SyncMsgBuf();
  1516 	IMPORT_C void SyncMsgBuf();
       
  1517 
       
  1518 // Getters and setters for pointer event's thresholds
       
  1519 	IMPORT_C TInt SetCloseProximityThresholds(TInt aEnterCloseProximityThreshold, TInt aExitCloseProximityThreshold);
       
  1520 	IMPORT_C TInt GetEnterCloseProximityThreshold() const;
       
  1521 	IMPORT_C TInt GetExitCloseProximityThreshold() const;
       
  1522 	IMPORT_C TInt SetHighPressureThresholds(TInt aEnterHighPressureThreshold, TInt aExitHighPressureThreshold);
       
  1523 	IMPORT_C TInt GetEnterHighPressureThreshold() const;
       
  1524 	IMPORT_C TInt GetExitHighPressureThreshold() const;
       
  1525 //
       
  1526     IMPORT_C void EnableWindowSizeCacheL();
       
  1527 	
  1676 // functions not exported, used by CWsGraphic
  1528 // functions not exported, used by CWsGraphic
  1677 	void GraphicMessageReady(TRequestStatus *aStat);
  1529 	void GraphicMessageReady(TRequestStatus *aStat);
  1678 	void GetGraphicMessage(TDes8& aData);
  1530 	void GetGraphicMessage(TDes8& aData) const;
  1679 	void GraphicMessageCancel();
  1531 	void GraphicMessageCancel();
  1680 	void GraphicAbortMessage(TInt aError);
  1532 	void GraphicAbortMessage(TInt aError);
  1681 	TInt GraphicFetchHeaderMessage();
  1533 	TInt GraphicFetchHeaderMessage();
  1682 private:
  1534 private:
  1683 	TInt doWindowGroupList(TInt aPriority, RArray<TWindowGroupChainInfo>* aWindowListCh, TInt aNumOpcode, TInt aListOpcode);
  1535 	TInt doWindowGroupList(TInt aPriority, RArray<TWindowGroupChainInfo>* aWindowListCh, TInt aNumOpcode, TInt aListOpcode) const;
  1684 	TInt doWindowGroupList(TInt aPriority,CArrayFixFlat<TInt>* aWindowListId,TInt aNumOpcode,TInt aListOpcode);
  1536 	TInt doWindowGroupList(TInt aScreenNumber, TInt aPriority, CArrayFixFlat<TInt>* aWindowListId, TInt aNumOpcode, TInt aListOpcode) const;
  1685 	TInt doSetHotKey(TInt aOpcode, TInt aType, TUint aKeycode, TUint aModifierMask, TUint aModifiers);
  1537 	TInt doSetHotKey(TInt aOpcode, TInt aType, TUint aKeycode, TUint aModifierMask, TUint aModifiers);
  1686 	void doReadEvent(TRequestStatus *aStat, TInt aOpcode);
  1538 	void doReadEvent(TRequestStatus *aStat, TInt aOpcode);
  1687 
  1539 
  1688 private:
  1540 private:
  1689 	void connectL();
  1541 	void connectL();
  1692 	void DirectAcessActivation(TBool aIsNowActive);
  1544 	void DirectAcessActivation(TBool aIsNowActive);
  1693 	};
  1545 	};
  1694 
  1546 
  1695 class RWindowGroup;
  1547 class RWindowGroup;
  1696 class RWsSprite;
  1548 class RWsSprite;
  1697 
       
  1698 /** @internalComponent */
       
  1699 typedef TInt (*AnimCommand)(TPtr8 *aBufPtr,TAny *aPackage);
       
  1700 
  1549 
  1701 
  1550 
  1702 class RWindowTreeNode : public MWsClientClass
  1551 class RWindowTreeNode : public MWsClientClass
  1703 /** A handle to a node in the server-side window tree.
  1552 /** A handle to a node in the server-side window tree.
  1704 
  1553 
  1743 	IMPORT_C TInt OrdinalPriority() const;
  1592 	IMPORT_C TInt OrdinalPriority() const;
  1744 	IMPORT_C TInt OrdinalPosition() const;
  1593 	IMPORT_C TInt OrdinalPosition() const;
  1745 	IMPORT_C TInt FullOrdinalPosition() const;
  1594 	IMPORT_C TInt FullOrdinalPosition() const;
  1746 	IMPORT_C void SetOrdinalPosition(TInt aPos);
  1595 	IMPORT_C void SetOrdinalPosition(TInt aPos);
  1747 	IMPORT_C void SetOrdinalPosition(TInt aPos,TInt aOrdinalPriority);
  1596 	IMPORT_C void SetOrdinalPosition(TInt aPos,TInt aOrdinalPriority);
  1748 	IMPORT_C TInt WindowGroupId();
  1597 	IMPORT_C TInt ScreenNumber() const;	
       
  1598 	IMPORT_C TInt WindowGroupId() const;
  1749 	IMPORT_C TInt SetPointerCursor(TInt aCursorNumber);
  1599 	IMPORT_C TInt SetPointerCursor(TInt aCursorNumber);
  1750 	IMPORT_C void SetCustomPointerCursor(const RWsPointerCursor &aPointerCursor);
  1600 	IMPORT_C void SetCustomPointerCursor(const RWsPointerCursor &aPointerCursor);
  1751 	IMPORT_C TInt EnableOnEvents(TEventControl aCircumstances=EEventControlOnlyWithKeyboardFocus);
  1601 	IMPORT_C TInt EnableOnEvents(TEventControl aCircumstances=EEventControlOnlyWithKeyboardFocus);
  1752 	IMPORT_C void DisableOnEvents();
  1602 	IMPORT_C void DisableOnEvents();
  1753 	IMPORT_C TInt EnableGroupChangeEvents();
  1603 	IMPORT_C TInt EnableGroupChangeEvents();
  1764 	IMPORT_C void DisableModifierChangedEvents();
  1614 	IMPORT_C void DisableModifierChangedEvents();
  1765 	IMPORT_C void SetNonFading(TBool aNonFading);
  1615 	IMPORT_C void SetNonFading(TBool aNonFading);
  1766 	IMPORT_C void SetFaded(TBool aFaded,TFadeControl aIncludeChildren);
  1616 	IMPORT_C void SetFaded(TBool aFaded,TFadeControl aIncludeChildren);
  1767 	IMPORT_C void SetFaded(TBool aFaded,TFadeControl aIncludeChildren,TUint8 aBlackMap,TUint8 aWhiteMap);
  1617 	IMPORT_C void SetFaded(TBool aFaded,TFadeControl aIncludeChildren,TUint8 aBlackMap,TUint8 aWhiteMap);
  1768 	IMPORT_C void ClearPointerCursor();
  1618 	IMPORT_C void ClearPointerCursor();
       
  1619 	IMPORT_C RWsSession* Session() const;
  1769 protected:
  1620 protected:
  1770 	__DECLARE_TEST;
  1621 	__DECLARE_TEST;
  1771 	};
  1622 	};
  1772 
  1623 
  1773 
  1624 
  1821 	IMPORT_C TSize Size() const;
  1672 	IMPORT_C TSize Size() const;
  1822 	IMPORT_C TPoint InquireOffset(const RWindowTreeNode &aWindow) const;
  1673 	IMPORT_C TPoint InquireOffset(const RWindowTreeNode &aWindow) const;
  1823 	IMPORT_C void PointerFilter(TUint32 aFilterMask, TUint32 aFilter);
  1674 	IMPORT_C void PointerFilter(TUint32 aFilterMask, TUint32 aFilter);
  1824 	IMPORT_C void SetPointerGrab(TBool aState);
  1675 	IMPORT_C void SetPointerGrab(TBool aState);
  1825 	IMPORT_C void ClaimPointerGrab(TBool aSendUpEvent=ETrue);
  1676 	IMPORT_C void ClaimPointerGrab(TBool aSendUpEvent=ETrue);
       
  1677 	IMPORT_C TInt ClaimPointerGrab(const TUint8 aPointerNumber, const TBool aSendUpEvent=ETrue);
  1826 	IMPORT_C void SetPointerCapture(TInt aFlags);
  1678 	IMPORT_C void SetPointerCapture(TInt aFlags);
  1827 	IMPORT_C void SetPointerCapturePriority(TInt aPriority);
  1679 	IMPORT_C void SetPointerCapturePriority(TInt aPriority);
  1828 	IMPORT_C TInt GetPointerCapturePriority() const;
  1680 	IMPORT_C TInt GetPointerCapturePriority() const;
  1829 	IMPORT_C void SetVisible(TBool aState);
  1681 	IMPORT_C void SetVisible(TBool aState);
  1830 	IMPORT_C void SetShadowHeight(TInt aHeight);
  1682 	IMPORT_C void SetShadowHeight(TInt aHeight);
  1832 	IMPORT_C TPoint Position() const;
  1684 	IMPORT_C TPoint Position() const;
  1833 	IMPORT_C TPoint AbsPosition() const;
  1685 	IMPORT_C TPoint AbsPosition() const;
  1834 	IMPORT_C TInt SetCornerType(TCornerType aCornerType, TInt aCornerFlags=0);
  1686 	IMPORT_C TInt SetCornerType(TCornerType aCornerType, TInt aCornerFlags=0);
  1835 	IMPORT_C TInt SetShape(const TRegion &aRegion);
  1687 	IMPORT_C TInt SetShape(const TRegion &aRegion);
  1836 	IMPORT_C TInt SetRequiredDisplayMode(TDisplayMode aMode);
  1688 	IMPORT_C TInt SetRequiredDisplayMode(TDisplayMode aMode);
  1837 	IMPORT_C TDisplayMode DisplayMode();
  1689 	IMPORT_C TDisplayMode DisplayMode() const;
  1838 	IMPORT_C void EnableBackup(TUint aBackupType=EWindowBackupAreaBehind);
  1690 	IMPORT_C void EnableBackup(TUint aBackupType=EWindowBackupAreaBehind);
  1839 	IMPORT_C void RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32 aTime,const TRect &aRect);
  1691 	IMPORT_C void RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32 aTime,const TRect &aRect);
  1840 	IMPORT_C void CancelPointerRepeatEventRequest();
  1692 	IMPORT_C void CancelPointerRepeatEventRequest();
       
  1693 	IMPORT_C TInt RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32 aTime,const TRect &aRect, const TUint8 aPointerNumber);	//< @prototype
       
  1694 	IMPORT_C TInt CancelPointerRepeatEventRequest(const TUint8 aPointerNumber);	//< @prototype
  1841 	IMPORT_C TInt AllocPointerMoveBuffer(TInt aMaxPoints, TUint aFlags);
  1695 	IMPORT_C TInt AllocPointerMoveBuffer(TInt aMaxPoints, TUint aFlags);
  1842 	IMPORT_C void FreePointerMoveBuffer();
  1696 	IMPORT_C void FreePointerMoveBuffer();
  1843 	IMPORT_C void EnablePointerMoveBuffer();
  1697 	IMPORT_C void EnablePointerMoveBuffer();
  1844 	IMPORT_C void DisablePointerMoveBuffer();
  1698 	IMPORT_C void DisablePointerMoveBuffer();
  1845 	IMPORT_C TInt RetrievePointerMoveBuffer(TDes8 &aBuf);
  1699 	IMPORT_C TInt RetrievePointerMoveBuffer(TDes8 &aBuf) const;
  1846 	IMPORT_C void DiscardPointerMoveBuffer();
  1700 	IMPORT_C void DiscardPointerMoveBuffer();
  1847 	IMPORT_C TInt AddKeyRect(const TRect &aRect, TInt aScanCode, TBool aActivatedByPointerSwitchOn);
  1701 	IMPORT_C TInt AddKeyRect(const TRect &aRect, TInt aScanCode, TBool aActivatedByPointerSwitchOn);
  1848 	IMPORT_C void RemoveAllKeyRects();
  1702 	IMPORT_C void RemoveAllKeyRects();
  1849 	IMPORT_C TInt PasswordWindow(TPasswordMode aPasswordMode);
  1703 	IMPORT_C TInt PasswordWindow(TPasswordMode aPasswordMode);
  1850 	IMPORT_C void FadeBehind(TBool aFade);
  1704 	IMPORT_C void FadeBehind(TBool aFade);
  1851 	IMPORT_C TBool IsFaded();
  1705 	IMPORT_C TBool IsFaded() const;
  1852 	IMPORT_C TBool IsNonFading();
  1706 	IMPORT_C TBool IsNonFading() const;
  1853 	IMPORT_C TInt MoveToGroup(TInt aIdentifier);
  1707 	IMPORT_C TInt MoveToGroup(TInt aIdentifier);
  1854 	IMPORT_C TInt SetBackgroundSurface(const TSurfaceId& aSurface);	///< @publishedPartner
  1708 	IMPORT_C TInt SetBackgroundSurface(const TSurfaceId& aSurface);
  1855 	IMPORT_C TInt SetBackgroundSurface(const TSurfaceConfiguration& aConfiguration, TBool aTriggerRedraw);	///< @publishedPartner
  1709 	IMPORT_C TInt SetBackgroundSurface(const TSurfaceConfiguration& aConfiguration, TBool aTriggerRedraw);
  1856 	IMPORT_C void RemoveBackgroundSurface(TBool aTriggerRedraw);	///< @publishedPartner
  1710 	IMPORT_C void RemoveBackgroundSurface(TBool aTriggerRedraw);
  1857 	IMPORT_C TInt GetBackgroundSurface(TSurfaceConfiguration& aConfiguration);	///< @publishedPartner
  1711 	IMPORT_C TInt GetBackgroundSurface(TSurfaceConfiguration& aConfiguration) const;
  1858 	IMPORT_C TRgb KeyColor();										///< @publishedPartner whilst prototype
  1712 	IMPORT_C void SetSurfaceTransparency(TBool aSurfaceTransparency);
       
  1713 	IMPORT_C TRgb KeyColor() const;
       
  1714 	IMPORT_C void EnableAdvancedPointers();
  1859 protected:
  1715 protected:
  1860 	TInt construct(const RWindowTreeNode &parent,TUint32 aHandle, TInt aType, TDisplayMode aDisplayMode);
  1716 	TInt construct(const RWindowTreeNode &parent,TUint32 aHandle, TInt aType, TDisplayMode aDisplayMode);
  1861 	};
  1717 	};
  1862 
  1718 
  1863 
  1719 
  1900 public:
  1756 public:
  1901 	IMPORT_C void Scroll(const TPoint &aOffset);
  1757 	IMPORT_C void Scroll(const TPoint &aOffset);
  1902 	IMPORT_C void Scroll(const TRect &aClipRect, const TPoint &aOffset);
  1758 	IMPORT_C void Scroll(const TRect &aClipRect, const TPoint &aOffset);
  1903 	IMPORT_C void Scroll(const TPoint &aOffset, const TRect &aRect);
  1759 	IMPORT_C void Scroll(const TPoint &aOffset, const TRect &aRect);
  1904 	IMPORT_C void Scroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
  1760 	IMPORT_C void Scroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
  1905 	IMPORT_C TRect GetDrawRect();
  1761 	IMPORT_C TRect GetDrawRect() const;
  1906 protected:
  1762 protected:
  1907 	void SetDrawRect(const TRect &aRect);
  1763 	void SetDrawRect(const TRect &aRect);
  1908 private:
  1764 private:
  1909 	void doScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect, TInt aOpcode);
  1765 	void doScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect, TInt aOpcode);
  1910 
  1766 
  1941 	IMPORT_C void BeginRedraw();
  1797 	IMPORT_C void BeginRedraw();
  1942 	IMPORT_C void BeginRedraw(const TRect &aRect);
  1798 	IMPORT_C void BeginRedraw(const TRect &aRect);
  1943 	IMPORT_C void EndRedraw();
  1799 	IMPORT_C void EndRedraw();
  1944 	IMPORT_C void Invalidate();
  1800 	IMPORT_C void Invalidate();
  1945 	IMPORT_C void Invalidate(const TRect &aRect);
  1801 	IMPORT_C void Invalidate(const TRect &aRect);
  1946 	IMPORT_C void GetInvalidRegion(RRegion &aRegion);
  1802 	IMPORT_C void GetInvalidRegion(RRegion &aRegion) const;
  1947 	IMPORT_C void SetBackgroundColor(TRgb aColor);
  1803 	IMPORT_C void SetBackgroundColor(TRgb aColor);
  1948 	IMPORT_C void SetBackgroundColor();
  1804 	IMPORT_C void SetBackgroundColor();
  1949 	IMPORT_C void SetSize(const TSize &size);
  1805 	IMPORT_C void SetSize(const TSize &size);
  1950 	IMPORT_C void SetExtent(const TPoint &point,const TSize &size);
  1806 	IMPORT_C void SetExtent(const TPoint &point,const TSize &size);
  1951 	IMPORT_C void HandleTransparencyUpdate();
  1807 	IMPORT_C void HandleTransparencyUpdate();
  1955 	IMPORT_C void SetNonTransparent();
  1811 	IMPORT_C void SetNonTransparent();
  1956 	IMPORT_C void EnableRedrawStore(TBool aEnabled);
  1812 	IMPORT_C void EnableRedrawStore(TBool aEnabled);
  1957 	IMPORT_C TInt SetTransparencyAlphaChannel();
  1813 	IMPORT_C TInt SetTransparencyAlphaChannel();
  1958 	IMPORT_C TInt SetTransparentRegion(const TRegion& aRegion);
  1814 	IMPORT_C TInt SetTransparentRegion(const TRegion& aRegion);
  1959 	IMPORT_C TInt SetTransparencyPolicy(TWsTransparencyPolicy aPolicy);
  1815 	IMPORT_C TInt SetTransparencyPolicy(TWsTransparencyPolicy aPolicy);
  1960 	IMPORT_C TBool IsRedrawStoreEnabled();
  1816 	IMPORT_C TBool IsRedrawStoreEnabled() const;
  1961 	IMPORT_C void EnableOSB(TBool);
  1817 	IMPORT_C void EnableOSB(TBool);
  1962 	IMPORT_C void ClearRedrawStore();
  1818 	IMPORT_C void ClearRedrawStore();
  1963 	};
  1819 	};
  1964 
  1820 
  1965 
  1821 
  1973 on the font and bitmap server's shared heap, which is accessible to all client
  1829 on the font and bitmap server's shared heap, which is accessible to all client
  1974 programs: functions are provided to allow the client application to access
  1830 programs: functions are provided to allow the client application to access
  1975 this bitmap directly and perform updates to the window under application control.
  1831 this bitmap directly and perform updates to the window under application control.
  1976 
  1832 
  1977 @publishedAll
  1833 @publishedAll
  1978 @released */
  1834 @deprecated
       
  1835 */
  1979 	{
  1836 	{
  1980 public:
  1837 public:
  1981 	IMPORT_C RBackedUpWindow();
  1838 	IMPORT_C RBackedUpWindow();
  1982 	IMPORT_C RBackedUpWindow(RWsSession &aWs);
  1839 	IMPORT_C RBackedUpWindow(RWsSession &aWs);
  1983 	IMPORT_C TInt Construct(const RWindowTreeNode &parent,TDisplayMode aDisplayMode, TUint32 aHandle);
  1840 	IMPORT_C TInt Construct(const RWindowTreeNode &parent,TDisplayMode aDisplayMode, TUint32 aHandle);
  1984 	IMPORT_C TInt BitmapHandle();
  1841 	IMPORT_C TInt BitmapHandle() const;
  1985 	IMPORT_C void UpdateScreen();
  1842 	IMPORT_C void UpdateScreen();
  1986 	IMPORT_C void UpdateScreen(const TRegion &aRegion);
  1843 	IMPORT_C void UpdateScreen(const TRegion &aRegion);
  1987 	IMPORT_C void UpdateBackupBitmap();
  1844 	IMPORT_C void UpdateBackupBitmap();
  1988 	IMPORT_C void MaintainBackup();
  1845 	IMPORT_C void MaintainBackup();
  1989 	};
  1846 	};
  1997 	{
  1854 	{
  1998 public:
  1855 public:
  1999 	IMPORT_C RWindowGroup();
  1856 	IMPORT_C RWindowGroup();
  2000 	IMPORT_C RWindowGroup(RWsSession &aWs);
  1857 	IMPORT_C RWindowGroup(RWsSession &aWs);
  2001 	IMPORT_C TInt Construct(TUint32 aClientHandle);
  1858 	IMPORT_C TInt Construct(TUint32 aClientHandle);
       
  1859 	IMPORT_C TInt Construct(TUint32 aClientHandle,CWsScreenDevice* aScreenDevice);
       
  1860 	IMPORT_C TInt Construct(TUint32 aClientHandle,TBool aIsFocusable,CWsScreenDevice* aScreenDevice);
  2002 	IMPORT_C TInt Construct(TUint32 aClientHandle,TBool aIsFocusable);
  1861 	IMPORT_C TInt Construct(TUint32 aClientHandle,TBool aIsFocusable);
  2003 	IMPORT_C TInt ConstructChildApp(TInt aIdOfParentWindowGroup,TUint32 aClientHandle);
  1862 	IMPORT_C TInt ConstructChildApp(TInt aIdOfParentWindowGroup,TUint32 aClientHandle);
  2004 	IMPORT_C TInt ConstructChildApp(TInt aIdOfParentWindowGroup,TUint32 aClientHandle,TBool aIsFocusable);
  1863 	IMPORT_C TInt ConstructChildApp(TInt aIdOfParentWindowGroup,TUint32 aClientHandle,TBool aIsFocusable);
  2005 	IMPORT_C void AllowProcessToCreateChildWindowGroups(TUid aProcessSID);
  1864 	IMPORT_C void AllowProcessToCreateChildWindowGroups(TUid aProcessSID);
  2006 	IMPORT_C void EnableReceiptOfFocus(TBool aState);
  1865 	IMPORT_C void EnableReceiptOfFocus(TBool aState);
  2030 	IMPORT_C TInt Identifier() const;
  1889 	IMPORT_C TInt Identifier() const;
  2031 	IMPORT_C void DisableKeyClick(TBool aState);
  1890 	IMPORT_C void DisableKeyClick(TBool aState);
  2032 	IMPORT_C TInt EnableScreenChangeEvents();
  1891 	IMPORT_C TInt EnableScreenChangeEvents();
  2033 	IMPORT_C void DisableScreenChangeEvents();
  1892 	IMPORT_C void DisableScreenChangeEvents();
  2034 	IMPORT_C void SimulatePointerEvent(TRawEvent aEvent);
  1893 	IMPORT_C void SimulatePointerEvent(TRawEvent aEvent);
       
  1894 	IMPORT_C void SimulateAdvancedPointerEvent(TRawEvent aEvent);
  2035 	IMPORT_C TInt ClearChildGroup();
  1895 	IMPORT_C TInt ClearChildGroup();
  2036 	IMPORT_C TInt SetChildGroup(TInt aId);
  1896 	IMPORT_C TInt SetChildGroup(TInt aId);
  2037 private:
  1897 private:
  2038 	TInt32 doCaptureKey(TUint aKey, TUint aModifierMask, TUint aModifiers, TInt aPriority, TInt aOpcode);
  1898 	TInt32 doCaptureKey(TUint aKey, TUint aModifierMask, TUint aModifiers, TInt aPriority, TInt aOpcode);
  2039 	void doCancelCaptureKey(TInt32 aCaptureKeyHandle, TInt aOpcode);
  1899 	void doCancelCaptureKey(TInt32 aCaptureKeyHandle, TInt aOpcode);
  2040 	TInt Construct(TInt aIdOfParentWindowGroup,TUint32 aClientHandle,TBool aIsFocusable);
  1900 	TInt Construct(TInt aIdOfParentWindowGroup, TUint32 aClientHandle, TBool aIsFocusable, CWsScreenDevice* aScreenDevice);
  2041 	};
  1901 	};
  2042 
  1902 
  2043 
  1903 
  2044 class CWsBitmap : public CFbsBitmap, public MWsClientClass
  1904 class CWsBitmap : public CFbsBitmap, public MWsClientClass
  2045 /** Window server bitmap.
  1905 /** Window server bitmap.
  2138 @released
  1998 @released
  2139 @see CGraphicsContext */
  1999 @see CGraphicsContext */
  2140 	{
  2000 	{
  2141 	friend class CWsScreenDevice;
  2001 	friend class CWsScreenDevice;
  2142 public:
  2002 public:
       
  2003 	/** Defines possible clockwise rotation values.
       
  2004 	
       
  2005 	WARNING: Enum for internal and partner use ONLY.  Compatibility is not guaranteed in future releases.
       
  2006 
       
  2007 	@prototype
       
  2008 	*/
       
  2009 	enum TGraphicsRotation
       
  2010 		{
       
  2011 		/** No rotation. */
       
  2012 		EGraphicsRotationNone,
       
  2013 		/** A 90 degree rotation. */
       
  2014 		EGraphicsRotation90,
       
  2015 		/** A 180 degree rotation. */
       
  2016 		EGraphicsRotation180,
       
  2017 		/** A 270 degree rotation. */
       
  2018 		EGraphicsRotation270
       
  2019 		};	
       
  2020 
  2143 	IMPORT_C CWindowGc(CWsScreenDevice *aDevice);
  2021 	IMPORT_C CWindowGc(CWsScreenDevice *aDevice);
  2144 	IMPORT_C virtual ~CWindowGc();
  2022 	IMPORT_C virtual ~CWindowGc();
  2145 	IMPORT_C virtual TInt Construct();
  2023 	IMPORT_C virtual TInt Construct();
  2146 	IMPORT_C virtual void Activate(RDrawableWindow &aDevice);
  2024 	IMPORT_C virtual void Activate(RDrawableWindow &aDevice);
  2147 	IMPORT_C virtual void Deactivate();
  2025 	IMPORT_C virtual void Deactivate();
  2202 	IMPORT_C virtual void DrawBitmap(const TPoint &aTopLeft, const CFbsBitmap *aDevice);
  2080 	IMPORT_C virtual void DrawBitmap(const TPoint &aTopLeft, const CFbsBitmap *aDevice);
  2203 	IMPORT_C virtual void DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aDevice);
  2081 	IMPORT_C virtual void DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aDevice);
  2204 	IMPORT_C virtual void DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aDevice, const TRect &aSourceRect);
  2082 	IMPORT_C virtual void DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aDevice, const TRect &aSourceRect);
  2205 	IMPORT_C virtual void DrawBitmapMasked(const TRect& aDestRect, const CFbsBitmap* aBitmap, const TRect& aSourceRect, const CFbsBitmap* aMaskBitmap, TBool aInvertMask);
  2083 	IMPORT_C virtual void DrawBitmapMasked(const TRect& aDestRect, const CFbsBitmap* aBitmap, const TRect& aSourceRect, const CFbsBitmap* aMaskBitmap, TBool aInvertMask);
  2206 	IMPORT_C virtual void DrawBitmapMasked(const TRect& aDestRect, const CWsBitmap* aBitmap, const TRect& aSourceRect, const CWsBitmap* aMaskBitmap, TBool aInvertMask);
  2084 	IMPORT_C virtual void DrawBitmapMasked(const TRect& aDestRect, const CWsBitmap* aBitmap, const TRect& aSourceRect, const CWsBitmap* aMaskBitmap, TBool aInvertMask);
       
  2085 
       
  2086 // Required as not all DrawText and DrawTextVertical functions are implemented in CWindowGc
       
  2087 	using CBitmapContext::DrawText;
       
  2088 	using CBitmapContext::DrawTextVertical;
  2207 //
  2089 //
  2208 // Text drawing subject to drawing mode
  2090 // Text drawing subject to drawing mode
  2209 // Subject to used font, pen color, drawing mode,
  2091 // Subject to used font, pen color, drawing mode,
  2210 // word and char justification
  2092 // word and char justification
  2211 	IMPORT_C virtual void DrawText(const TDesC &aBuf,const TPoint &aPos);
  2093 	IMPORT_C virtual void DrawText(const TDesC &aBuf,const TPoint &aPos);
  2235 //=================Functions also supplied by CFbsBitGc==============
  2117 //=================Functions also supplied by CFbsBitGc==============
  2236 	IMPORT_C virtual void SetFaded(TBool aFaded);
  2118 	IMPORT_C virtual void SetFaded(TBool aFaded);
  2237 	IMPORT_C virtual void SetFadingParameters(TUint8 aBlackMap,TUint8 aWhiteMap);
  2119 	IMPORT_C virtual void SetFadingParameters(TUint8 aBlackMap,TUint8 aWhiteMap);
  2238 	IMPORT_C virtual TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CFbsBitmap* aSrcBmp, const TRect& aSrcRect, const CFbsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
  2120 	IMPORT_C virtual TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CFbsBitmap* aSrcBmp, const TRect& aSrcRect, const CFbsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
  2239 	IMPORT_C virtual TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CWsBitmap* aSrcBmp, const TRect& aSrcRect, const CWsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
  2121 	IMPORT_C virtual TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CWsBitmap* aSrcBmp, const TRect& aSrcRect, const CWsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
       
  2122 //
       
  2123 	IMPORT_C TAny* Interface(TUid aInterfaceId);
       
  2124 	IMPORT_C const TAny* Interface(TUid aInterfaceId) const;
  2240 	
  2125 	
  2241 protected:	
  2126 protected:	
  2242 	IMPORT_C TInt APIExtension(TUid aUid, TAny*& aOutput, TAny* aInput);
  2127 	IMPORT_C TInt APIExtension(TUid aUid, TAny*& aOutput, TAny* aInput);
  2243 	
  2128 	
  2244 private:	
  2129 private:	
  2250 	IMPORT_C void Reserved_CBitmapContext_3();
  2135 	IMPORT_C void Reserved_CBitmapContext_3();
  2251 
  2136 
  2252 public:
  2137 public:
  2253 	IMPORT_C virtual void DrawWsGraphic(const TWsGraphicId& aId,const TRect& aDestRect);
  2138 	IMPORT_C virtual void DrawWsGraphic(const TWsGraphicId& aId,const TRect& aDestRect);
  2254 	IMPORT_C virtual void DrawWsGraphic(const TWsGraphicId& aId,const TRect& aDestRect,const TDesC8& aData);
  2139 	IMPORT_C virtual void DrawWsGraphic(const TWsGraphicId& aId,const TRect& aDestRect,const TDesC8& aData);
  2255 
       
  2256 private:
  2140 private:
  2257 	IMPORT_C virtual void Reserved_CWindowGc_3();
  2141 	IMPORT_C virtual void Reserved_CWindowGc_3();
  2258 	IMPORT_C virtual void Reserved_CWindowGc_4();
  2142 	IMPORT_C virtual void Reserved_CWindowGc_4();
  2259 	IMPORT_C virtual void Reserved_CWindowGc_5();
  2143 	IMPORT_C virtual void Reserved_CWindowGc_5();
  2260 
  2144 
  2261 ////=============================================================
  2145 //=============================================================
  2262 private: // Private code
  2146 private: // Private code
  2263 	TRgb Color(TInt aOpcode)const;
  2147 	TRgb Color(TInt aOpcode)const;
  2264 	void SetJustification(TInt aExcessWidth,TInt aNumGaps, TInt aOpcode);
  2148 	void SetJustification(TInt aExcessWidth,TInt aNumGaps, TInt aOpcode);
  2265 	void DrawArcOrPie(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd, TInt aOpcode);
  2149 	void DrawArcOrPie(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd, TInt aOpcode);
  2266 	void doDrawPolyLine(const CArrayFix<TPoint> *aPointArray, const TPoint* aPointList,TInt aNumPoints);
  2150 	void doDrawPolyLine(const CArrayFix<TPoint> *aPointArray, const TPoint* aPointList,TInt aNumPoints);
  2267 	TInt doDrawPolygon(const CArrayFix<TPoint> *aPointArray,const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule);
  2151 	TInt doDrawPolygon(const CArrayFix<TPoint> *aPointArray,const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule);
  2268 	void WriteTextPos(TInt aOpcode,TInt aOpcodePtr,const TPoint &aPos,const TDesC &aBuf) const;
  2152 	void WriteTextPos(TInt aOpcode,TInt aOpcodePtr,const TPoint &aPos,const TDesC &aBuf) const;
  2269 	void WriteTextCommand(TAny *aCmd, TInt aLen,const TDesC &aBuf,TInt aOpcode,TInt aOpcodePtr) const;
  2153 	void WriteTextCommand(TAny *aCmd, TInt aLen,const TDesC &aBuf,TInt aOpcode,TInt aOpcodePtr) const;
  2270 	void WriteTextCommand(TAny *aCmd, TInt aLen,const TDesC8 &aBuf,TInt aOpcode,TInt aOpcodePtr) const;
  2154 	void WriteTextCommand(TAny *aCmd, TInt aLen,const TDesC8 &aBuf,TInt aOpcode,TInt aOpcodePtr) const;
  2271 	void APIExGetUnderlineMetrics(TAny*& aOutput);
  2155 	TInt APIExGetUnderlineMetrics(TAny*& aOutput);
  2272 	TInt APIExSetShadowColor(TAny* aShadowColor);
  2156 	TInt APIExSetShadowColor(TAny* aShadowColor);
  2273 
  2157 	TInt APIExGetShadowColor(TAny*& aOutput);
       
  2158 	// New DrawText API's that take in context
       
  2159 	TInt APIExDrawText(const TDesC &aBuf,const TTextParameters* aParam,const TPoint &aPos);
       
  2160 	TInt APIExDrawText(const TDesC &aBuf,const TTextParameters* aParam,const TRect &aBox,TInt aBaselineOffset,TTextAlign aHoriz=ELeft,TInt aLeftMrg=0);
       
  2161 	TInt APIExDrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TPoint& aPos,TBool aUp);
       
  2162 	TInt APIExDrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
       
  2163 	TInt APIExInterface(TAny*& aInterface, TUid aInterfaceId);
       
  2164 
       
  2165 	void DrawResource(const TPoint& aPos, const RWsDrawableSource& aSource, TGraphicsRotation aRotation=EGraphicsRotationNone);
       
  2166 	void DrawResource(const TRect& aDestRect, const RWsDrawableSource& aSource, TGraphicsRotation aRotation=EGraphicsRotationNone);
       
  2167 	void DrawResource(const TRect& aDestRect, const RWsDrawableSource& aSource, const TRect& aSrcRect, TGraphicsRotation aRotation=EGraphicsRotationNone);
       
  2168 	void DrawResource(const TRect& aDestRect, const RWsDrawableSource& aSource, const TDesC8& aParam);
       
  2169 	
  2274 private: // Private data
  2170 private: // Private data
  2275 	CFbsFont *iFont;
  2171 	class CPimpl;
       
  2172 	CPimpl* iPimpl;
  2276 	CWsScreenDevice *iDevice;
  2173 	CWsScreenDevice *iDevice;
  2277 	};
  2174 	};
  2278 
  2175 
  2279 
  2176 
  2280 class CWsScreenDevice : public CBitmapDevice, public MWsClientClass
  2177 class CWsScreenDevice : public CBitmapDevice, public MWsClientClass
  2319 	IMPORT_C CWsScreenDevice();
  2216 	IMPORT_C CWsScreenDevice();
  2320 	IMPORT_C CWsScreenDevice(RWsSession &aWs);
  2217 	IMPORT_C CWsScreenDevice(RWsSession &aWs);
  2321 	IMPORT_C ~CWsScreenDevice();
  2218 	IMPORT_C ~CWsScreenDevice();
  2322 	IMPORT_C TInt Construct();
  2219 	IMPORT_C TInt Construct();
  2323 	IMPORT_C TInt Construct( TInt aDefaultScreenNumber ) ;
  2220 	IMPORT_C TInt Construct( TInt aDefaultScreenNumber ) ;
       
  2221 	IMPORT_C TAny* GetInterface(TUint aInterfaceId);
       
  2222 	inline const TAny* GetInterface(TUint aInterfaceId) const;
       
  2223 	IMPORT_C TBool IsModeDynamic(TInt aSizeMode) const;
       
  2224 	IMPORT_C TBool IsCurrentModeDynamic() const;
  2324 //==== From CGraphicsDevice ====//
  2225 //==== From CGraphicsDevice ====//
  2325 	IMPORT_C TDisplayMode DisplayMode() const;
  2226 	IMPORT_C TDisplayMode DisplayMode() const;
  2326 	IMPORT_C TSize SizeInPixels() const;
  2227 	IMPORT_C TSize SizeInPixels() const;
  2327 	IMPORT_C TSize SizeInTwips() const;
  2228 	IMPORT_C TSize SizeInTwips() const;
  2328 	IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const;
  2229 	IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const;
  2353 	IMPORT_C void SetPalette(CPalette* aPalette);
  2254 	IMPORT_C void SetPalette(CPalette* aPalette);
  2354 	IMPORT_C TInt GetPalette(CPalette*& aPalette) const;
  2255 	IMPORT_C TInt GetPalette(CPalette*& aPalette) const;
  2355 //===== Extra functions ====//
  2256 //===== Extra functions ====//
  2356 	IMPORT_C TInt SetCustomPalette(const CPalette* aPalette);
  2257 	IMPORT_C TInt SetCustomPalette(const CPalette* aPalette);
  2357 	IMPORT_C TInt GetFontById(CFont*& aFont,TUid aUid,const TAlgStyle& aAlgStyle);
  2258 	IMPORT_C TInt GetFontById(CFont*& aFont,TUid aUid,const TAlgStyle& aAlgStyle);
  2358 	IMPORT_C TBool RectCompare(const TRect &aRect1,const TRect &aRect2);
  2259 	IMPORT_C TBool RectCompare(const TRect &aRect1,const TRect &aRect2) const;
  2359 	IMPORT_C TBool RectCompare(const TRect& aRect1,const TRect &aRect2,TUint aFlags) const;
  2260 	IMPORT_C TBool RectCompare(const TRect& aRect1,const TRect &aRect2,TUint aFlags) const;
  2360 	IMPORT_C TInt CopyScreenToBitmap(const CFbsBitmap *aBitmap) const;
  2261 	IMPORT_C TInt CopyScreenToBitmap(const CFbsBitmap *aBitmap) const;
  2361 	IMPORT_C TInt CopyScreenToBitmap(const CFbsBitmap *aBitmap, const TRect &aRect) const;
  2262 	IMPORT_C TInt CopyScreenToBitmap(const CFbsBitmap *aBitmap, const TRect &aRect) const;
  2362 	IMPORT_C TInt SetBackLight(TBool aBackLight);
  2263 	IMPORT_C TInt SetBackLight(TBool aBackLight);
  2363 //===== Screen Rotation functions ====//
  2264 //===== Screen Rotation functions ====//
  2379 	IMPORT_C TPoint GetScreenModeOrigin(TInt aMode) const;
  2280 	IMPORT_C TPoint GetScreenModeOrigin(TInt aMode) const;
  2380 	IMPORT_C TSize GetCurrentScreenModeScale() const;
  2281 	IMPORT_C TSize GetCurrentScreenModeScale() const;
  2381 	IMPORT_C TSize GetScreenModeScale(TInt aMode) const;
  2282 	IMPORT_C TSize GetScreenModeScale(TInt aMode) const;
  2382 	IMPORT_C TPoint GetCurrentScreenModeScaledOrigin() const;
  2283 	IMPORT_C TPoint GetCurrentScreenModeScaledOrigin() const;
  2383 	IMPORT_C TPoint GetScreenModeScaledOrigin(TInt aMode) const;
  2284 	IMPORT_C TPoint GetScreenModeScaledOrigin(TInt aMode) const;
  2384 	IMPORT_C TInt GetScreenSizeModeList(RArray<TInt>* aModeList);
  2285 	IMPORT_C TInt GetScreenSizeModeList(RArray<TInt>* aModeList) const;
  2385 	IMPORT_C TDisplayMode GetScreenModeDisplayMode(const TInt &aMode) const;
  2286 	IMPORT_C TDisplayMode GetScreenModeDisplayMode(const TInt &aMode) const;
  2386 //===== Used for testing purpose only ====//
  2287 //===== Used for testing purpose only ====//
  2387 	IMPORT_C TSizeMode GetCurrentScreenModeAttributes() const;
  2288 	IMPORT_C TSizeMode GetCurrentScreenModeAttributes() const;
  2388 	IMPORT_C void SetCurrentScreenModeAttributes(const TSizeMode &aModeAtt);
  2289 	IMPORT_C void SetCurrentScreenModeAttributes(const TSizeMode &aModeAtt);
  2389 	IMPORT_C TInt GetScreenNumber() const;
  2290 	IMPORT_C TInt GetScreenNumber() const;
       
  2291 private:
       
  2292 	CFbsTypefaceStore* TypeFaceStore()const;
       
  2293 	TSize DisplaySizeInPixels()const;
       
  2294 	TSize PhysicalScreenSizeInTwips()const;
  2390 private: // Private data
  2295 private: // Private data
  2391 	CFbsTypefaceStore* iTypefaceStore;
  2296 	class CScrDevExtension;				//Implements extension interfaces, including and replacing typeface store
       
  2297 	CScrDevExtension* iExtension;
  2392 	TSize iPhysicalScreenSizeInTwips;
  2298 	TSize iPhysicalScreenSizeInTwips;
  2393 	TSize iDisplaySizeInPixels;
  2299 	TSize iDisplaySizeInPixels;
  2394 	friend class CWindowGc;
  2300 	friend class CWindowGc;
  2395 	};
  2301 	};
  2396 
  2302 
  2443 one or more sprite members containing the bitmaps to be displayed are added.
  2349 one or more sprite members containing the bitmaps to be displayed are added.
  2444 
  2350 
  2445 After a pointer cursor has been created and activated, it does not become
  2351 After a pointer cursor has been created and activated, it does not become
  2446 visible until the application calls RWindowTreeNode::SetPointerCursor() or
  2352 visible until the application calls RWindowTreeNode::SetPointerCursor() or
  2447 RWindowTreeNode::SetCustomPointerCursor(). The pointer cursor's origin automatically
  2353 RWindowTreeNode::SetCustomPointerCursor(). The pointer cursor's origin automatically
  2448 tracks the position of the pointing device, and the origin forms the pointer
  2354 tracks the position of the pointing device, or position of emulated single pointer if there
  2449 cursor's "hot spot", i.e., the point whose co-ordinates are sent to the client
  2355 are more pointers in the system (see documentation of RWindowBase::EnableAdvancedPointers()
  2450 if a pointer event occurs. If the pointer cursor's bitmap needs to extend
  2356 for more details), and the origin forms the pointer cursor's "hot spot", i.e., the point 
  2451 to the left or upwards from the pointer position, its sprite member should
  2357 whose co-ordinates are sent to the client if a pointer event occurs. 
  2452 be given a negative offset in TSpriteMember::iOffset.
  2358 If the pointer cursor's bitmap needs to extend to the left or upwards from the pointer 
       
  2359 position, its sprite member should be given a negative offset in TSpriteMember::iOffset.
  2453 
  2360 
  2454 Note:
  2361 Note:
  2455 
  2362 
  2456 Pointer cursors are rarely used in pure pen architectures, but they are supported
  2363 Pointer cursors are rarely used in pure pen architectures, but they are supported
  2457 for mouse or tablet use.
  2364 for mouse or tablet use.
       
  2365 
       
  2366 @see RWindowBase::EnableAdvancedPointers()
  2458 
  2367 
  2459 @publishedAll
  2368 @publishedAll
  2460 @released */
  2369 @released */
  2461 	{
  2370 	{
  2462 public:
  2371 public:
  2579 		};
  2488 		};
  2580 public:
  2489 public:
  2581 	IMPORT_C RDirectScreenAccess();
  2490 	IMPORT_C RDirectScreenAccess();
  2582 	IMPORT_C RDirectScreenAccess(RWsSession& aWs);
  2491 	IMPORT_C RDirectScreenAccess(RWsSession& aWs);
  2583 	IMPORT_C TInt Construct();
  2492 	IMPORT_C TInt Construct();
       
  2493 	IMPORT_C TInt Construct(TBool aRegionTrackingOnly);
  2584 	IMPORT_C TInt Request(RRegion*& aRegion,TRequestStatus& aStatus,const RWindowBase& aWindow);
  2494 	IMPORT_C TInt Request(RRegion*& aRegion,TRequestStatus& aStatus,const RWindowBase& aWindow);
  2585 	IMPORT_C void Completed();
  2495 	IMPORT_C void Completed();
  2586 	IMPORT_C void Cancel();
  2496 	IMPORT_C void Cancel();
  2587 	IMPORT_C void Close();
  2497 	IMPORT_C void Close();
  2588 private:
  2498 private:
  2670 @publishedAll
  2580 @publishedAll
  2671 @released */
  2581 @released */
  2672 	{
  2582 	{
  2673 public:
  2583 public:
  2674 	IMPORT_C static CDirectScreenAccess* NewL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWin,MDirectScreenAccess& aAbort);
  2584 	IMPORT_C static CDirectScreenAccess* NewL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWin,MDirectScreenAccess& aAbort);
       
  2585 	IMPORT_C static CDirectScreenAccess* NewL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWin,MDirectScreenAccess& aAbort,TBool aRegionTrackingOnly);
  2675 	~CDirectScreenAccess();
  2586 	~CDirectScreenAccess();
  2676 	IMPORT_C void StartL();
  2587 	IMPORT_C void StartL();
  2677 	inline CFbsBitGc* Gc();
  2588 	inline CFbsBitGc* Gc();
  2678 	inline CFbsScreenDevice*& ScreenDevice();
  2589 	inline CFbsScreenDevice*& ScreenDevice();
  2679 	inline RRegion* DrawingRegion();
  2590 	inline RRegion* DrawingRegion();
  2680 private:
  2591 private:
  2681 	enum TFlags
  2592 	enum TFlags
  2682 		{
  2593 		{
  2683 		EDirectCheckModeChange=0x1,
  2594 		EDirectCheckModeChange		=	0x01,
  2684 		EDirectCheckSizeModeChange=0x2,
  2595 		EDirectCheckSizeModeChange	=	0x02,
       
  2596 		EDirectRegionTrackingOnly	=	0x04,
  2685 		};
  2597 		};
  2686 private:
  2598 private:
  2687 	inline CDirectScreenAccess(RWsSession& aWs,CWsScreenDevice* aScreenDevice,RWindowBase& aWindow,MDirectScreenAccess& aAbort);
  2599 	inline CDirectScreenAccess(RWsSession& aWs,CWsScreenDevice* aScreenDevice,RWindowBase& aWindow,MDirectScreenAccess& aAbort);
  2688 	void ConstructL(RWsSession& aWs);
  2600 	void ConstructL(RWsSession& aWs,TBool aRegionTrackingOnly);
  2689 	void CreateScreenObjectsL(TDisplayMode aCurrentMode);
  2601 	void CreateScreenObjectsL(TDisplayMode aCurrentMode);
  2690 	void UpdateSizeAndRotation(CFbsBitGc* aGc);
  2602 	void UpdateSizeAndRotation(CFbsBitGc* aGc);
  2691 	static TInt Restart(TAny* aDirect);
  2603 	static TInt Restart(TAny* aDirect);
  2692 	void Restart();
  2604 	void Restart();
  2693 	//Pure virtual functions from CActive
  2605 	//Pure virtual functions from CActive
  2733 	IMPORT_C RSoundPlugIn();
  2645 	IMPORT_C RSoundPlugIn();
  2734 	IMPORT_C RSoundPlugIn(RWsSession &aWs);
  2646 	IMPORT_C RSoundPlugIn(RWsSession &aWs);
  2735 	IMPORT_C TInt Construct(TUid aUid=KNullUid);
  2647 	IMPORT_C TInt Construct(TUid aUid=KNullUid);
  2736 	IMPORT_C void Close();
  2648 	IMPORT_C void Close();
  2737 	IMPORT_C void Destroy();
  2649 	IMPORT_C void Destroy();
  2738 	IMPORT_C TBool IsLoaded(TBool& aIsChangeable);
  2650 	IMPORT_C TBool IsLoaded(TBool& aIsChangeable) const;
  2739 	IMPORT_C TInt Unload();
  2651 	IMPORT_C TInt Unload();
  2740 	IMPORT_C TInt Load(const TDesC &aFileName);
  2652 	IMPORT_C TInt Load(const TDesC &aFileName);
  2741 	IMPORT_C void SetKeyClick(TBool aEnabled);
  2653 	IMPORT_C void SetKeyClick(TBool aEnabled);
  2742 	IMPORT_C void SetPenClick(TBool aEnabled);
  2654 	IMPORT_C void SetPenClick(TBool aEnabled);
  2743 	IMPORT_C TBool KeyClickEnabled();
  2655 	IMPORT_C TBool KeyClickEnabled() const;
  2744 	IMPORT_C TBool PenClickEnabled();
  2656 	IMPORT_C TBool PenClickEnabled() const;
  2745 	IMPORT_C TInt CommandReply(TInt aOpcode, const TPtrC8 &aArgs);
  2657 	IMPORT_C TInt CommandReply(TInt aOpcode, const TPtrC8 &aArgs);
  2746 	};
  2658 	};
  2747 
  2659 
  2748 inline TInt MWsClientClass::WsHandle() const
  2660 inline TInt MWsClientClass::WsHandle() const
  2749 	/** Gets the server side handle for the object.
  2661 	/** Gets the server side handle for the object.
  2750 
  2662 
  2751 	@return The server-side handle for the object. */
  2663 	@return The server-side handle for the object. */
  2752 	{return(iWsHandle);}
  2664 	{return(iWsHandle);}
       
  2665 
       
  2666 inline const TAny* CWsScreenDevice::GetInterface(TUint aInterfaceId) const
       
  2667 	{
       
  2668 	return const_cast<CWsScreenDevice*>(this)->GetInterface(aInterfaceId);
       
  2669 	}
  2753 
  2670 
  2754 inline TInt CWsScreenDevice::CreateContext(CWindowGc *&aGc)
  2671 inline TInt CWsScreenDevice::CreateContext(CWindowGc *&aGc)
  2755 	/** Creates a graphics context for this device.
  2672 	/** Creates a graphics context for this device.
  2756 
  2673 
  2757 	This function always causes a flush of the window server buffer.
  2674 	This function always causes a flush of the window server buffer.
  2777 
  2694 
  2778 	@return The rectangle that needs redrawing. Co-ordinates are relative to
  2695 	@return The rectangle that needs redrawing. Co-ordinates are relative to
  2779 	the window whose handle is given by Handle(). */
  2696 	the window whose handle is given by Handle(). */
  2780 	{return(iRect);}
  2697 	{return(iRect);}
  2781 
  2698 
  2782 inline TPointerEvent *TWsEvent::Pointer() const
  2699 inline TWsEvent::TWsEvent()
       
  2700 	/** Constructor.  Zero Initialise Data
       
  2701 	@publishedAll
       
  2702 	@released */
       
  2703 	{
       
  2704 	iType=0;
       
  2705 	iHandle=0;
       
  2706 	iTime=0;
       
  2707 	Mem::FillZ(iEventData,EWsEventDataSize);
       
  2708 	}
       
  2709 
       
  2710 inline TAdvancedPointerEvent* TWsEvent::Pointer() const
  2783 	/** Gets the pointer event.
  2711 	/** Gets the pointer event.
  2784 
  2712 	
  2785 	This function can be used to get information about the pointer event if Type()
  2713 	This method can be used to get information about the pointer event if Type()
  2786 	returns an event of type EEventPointer. or EEventDragDrop.
  2714 	returns an event of type EEventPointer or EEventDragDrop.
  2787 
  2715 	
  2788 	@return Structure containing pointer event data. */
  2716 	If the event has been received by the window without advanced pointer events enabled,
  2789 	{return((TPointerEvent *)&iEventData);}
  2717 	this method will return a pointer to TPointerEvent with additional fields of
       
  2718 	TAdvancedPointerEvent being cleared to 0.
       
  2719 	
       
  2720 	@return Structure containing advanced pointer event data.
       
  2721 	@see TPointerEvent::AdvancedPointerEvent()
       
  2722 	@see RWindowBase::EnableAdvancedPointers() */
       
  2723 	{return((TAdvancedPointerEvent *)&iEventData);}
       
  2724 
       
  2725 inline TInt TAdvancedPointerEvent::PointerNumber() const
       
  2726 /** Gets the pointer number of the pointer whose state change is described by this event.
       
  2727 
       
  2728   As soon as the pointer (for example a finger) is detected by the device's sensors,
       
  2729   it is assigned a pointer number. Then all events related to this pointer always
       
  2730   use the same pointer number. When the device loses track of the pointer,
       
  2731   TPointerEvent::EOutOfRange is sent with its pointer number and the number is released
       
  2732   - from this time it may be re-used to identify another pointer coming into range.  
       
  2733   
       
  2734   On a particular device, the pointer number is always an integer in the range 0 to 
       
  2735   HALData::EPointerNumberOfPointers - 1. If the device doesn't provide value for
       
  2736   this attribute, it is assumed to be 1.
       
  2737   
       
  2738   Please note that in order to receive events from multiple pointers in a window, the method
       
  2739   RWindowBase::EnableAdvancedPointers() has to be called for this window's instance
       
  2740   before it is activated. Otherwise this window will only receive TPointerEvents from one
       
  2741   emulated pointer, which will always have pointer number 0.
       
  2742   
       
  2743   @return Pointer number of the pointer whose state change is described by this event.
       
  2744   @see RWindowBase::EnableAdvancedPointers()
       
  2745   @see HALData::EPointerNumberOfPointers */
       
  2746 	{
       
  2747 	return IsAdvancedPointerEvent() ? DoGetPointerNumber() : ENonAdvancedPointerPointerNumber;
       
  2748 	}
       
  2749 
       
  2750 inline TInt TAdvancedPointerEvent::Proximity() const
       
  2751 /** Gets the proximity of the pointer to the screen's surface.
       
  2752   Proximity units may vary between devices and may be non-linear.
       
  2753   Returned value will be a negative integer as the maximum supported proximity
       
  2754   range in Symbian OS is from KMinTInt to 0, where KMinTInt means the highest
       
  2755   proximity that Symbian OS can support and 0 means touching the screen. 
       
  2756   HALData attributes provide more information about proximity support on particular 
       
  2757   device.
       
  2758   
       
  2759   On platforms without pointer proximity support, proximity is always assumed to be 0.
       
  2760   
       
  2761   @return Proximity of the pointer to the screen's surface.
       
  2762   @see TAdvancedPointerEvent::Position3D()
       
  2763   @see TAdvancedPointerEvent::ProximityAndPressure()
       
  2764   @see HALData::EPointer3DMaxProximity
       
  2765   @see HALData::EPointer3DProximityStep */
       
  2766 	{
       
  2767 	return IsAdvancedPointerEvent() ? DoGetProximity() : ENonAdvancedPointerZCoordinate;
       
  2768 	}
       
  2769 
       
  2770 inline TInt TAdvancedPointerEvent::Pressure() const
       
  2771 /** Gets the pressure applied by the pointer to the screen. 
       
  2772   Pressure units may vary between devices and may be non-linear.
       
  2773   Returned value will be a positive integer as the maximum supported pressure range
       
  2774   in Symbian OS is from 0 to KMaxTInt. HALData attributes provide more information
       
  2775   about pressure support on particular device.
       
  2776   
       
  2777   On platforms without pointer pressure support, pressure is always assumed to be 0.
       
  2778   
       
  2779   @return Pressure applied by the pointer to the screen.
       
  2780   @see TAdvancedPointerEvent::Pressure3D()
       
  2781   @see TAdvancedPointerEvent::ProximityAndPressure()
       
  2782   @see HALData::EPointer3DMaxPressure
       
  2783   @see HALData::EPointer3DPressureStep */
       
  2784 	{
       
  2785 	return IsAdvancedPointerEvent() ? DoGetPressure() : ENonAdvancedPointerZCoordinate;
       
  2786 	}
       
  2787 
       
  2788 inline TInt TAdvancedPointerEvent::ProximityAndPressure() const
       
  2789 /** Gets pressure applied by the pointer to the screen and proximity of the pointer
       
  2790   to the screen as one value. This is possible because the pointer is never in proximity
       
  2791   to the screen and pressing the screen at the same time.
       
  2792   
       
  2793   @return The value of proximity if the pointer is in proximity to the screen; proximity
       
  2794           is always represented as negative TInt. The value of pressure if the pointer
       
  2795           is touching the screen; pressure is always represented as positive TInt.
       
  2796   @see TAdvancedPointerEvent::Proximity()
       
  2797   @see TAdvancedPointerEvent::Pressure()
       
  2798   @see TAdvancedPointerEvent::PositionAndPressure3D() */
       
  2799 	{return IsAdvancedPointerEvent() ? DoGetProximityAndPressure() : ENonAdvancedPointerZCoordinate;}
       
  2800 
       
  2801 inline TPoint3D TAdvancedPointerEvent::PositionAndPressure3D() const
       
  2802 /**
       
  2803   @return Pointer's X and Y coordinates plus combined proximity and pressure as
       
  2804           Z coordinate. 
       
  2805   @see TAdvancedPointerEvent::ProximityAndPressure() */
       
  2806 	{
       
  2807 	TPoint3D point3D;
       
  2808 	point3D.iX=iPosition.iX;
       
  2809 	point3D.iY=iPosition.iY;
       
  2810 	point3D.iZ=ProximityAndPressure();
       
  2811 	return point3D;
       
  2812 	}
       
  2813 
       
  2814 inline TPoint3D TAdvancedPointerEvent::Position3D() const
       
  2815 /**
       
  2816   @return Pointer's X and Y coordinates plus pointer's proximity to the screen as
       
  2817           Z coordinate. Please note that returned Z coordinate will be always negative or 0.
       
  2818   @see TAdvancedPointerEvent::Proximity() */
       
  2819 	{
       
  2820 	TPoint3D point3D;
       
  2821 	point3D.iX=iPosition.iX;
       
  2822 	point3D.iY=iPosition.iY;
       
  2823 	point3D.iZ=IsAdvancedPointerEvent() ? DoGetProximity() : ENonAdvancedPointerZCoordinate;
       
  2824 	return point3D;
       
  2825 	}
       
  2826 
       
  2827 inline TPoint3D TAdvancedPointerEvent::Pressure3D() const
       
  2828 /**  
       
  2829   @return Pointer's X and Y coordinates plus pressure applied by the pointer to the screen
       
  2830           as Z coordinate. 
       
  2831   @see TAdvancedPointerEvent::Pressure() */
       
  2832 	{
       
  2833 	TPoint3D point3D;
       
  2834 	point3D.iX=iPosition.iX;
       
  2835 	point3D.iY=iPosition.iY;
       
  2836 	point3D.iZ=IsAdvancedPointerEvent() ? DoGetPressure() : ENonAdvancedPointerZCoordinate;
       
  2837 	return point3D;
       
  2838 	}
  2790 
  2839 
  2791 inline TKeyEvent *TWsEvent::Key() const
  2840 inline TKeyEvent *TWsEvent::Key() const
  2792 	/** Gets the key event.
  2841 	/** Gets the key event.
  2793 
  2842 
  2794 	This function can be used to get information about the key event if Type()
  2843 	This function can be used to get information about the key event if Type()
  2812 	This function can be used to get information about the visibility changed event
  2861 	This function can be used to get information about the visibility changed event
  2813 	if Type() returns an event of type EEventWindowVisibilityChanged.
  2862 	if Type() returns an event of type EEventWindowVisibilityChanged.
  2814 
  2863 
  2815 	@return Structure containing visibility changed event data */
  2864 	@return Structure containing visibility changed event data */
  2816 	{ return reinterpret_cast<const TWsVisibilityChangedEvent*>(iEventData); }
  2865 	{ return reinterpret_cast<const TWsVisibilityChangedEvent*>(iEventData); }
       
  2866 
       
  2867 inline TWsDisplayChangedEvent* TWsEvent::DisplayChanged()
       
  2868 	/** Gets information about the display changed event.
       
  2869 
       
  2870 	This function can be used to get information about the display changed event
       
  2871 	if Type() returns an event of type EEventDisplayChanged.
       
  2872 
       
  2873 	@return Structure containing display changed event data */
       
  2874 	{ return reinterpret_cast<TWsDisplayChangedEvent*>(iEventData); }
       
  2875 
       
  2876 inline const TWsDisplayChangedEvent* TWsEvent::DisplayChanged() const
       
  2877 	/** Gets information about the display changed event.
       
  2878 
       
  2879 	This function can be used to get information about the display changed event
       
  2880 	if Type() returns an event of type EEventDisplayChanged.
       
  2881 
       
  2882 	@return Structure containing display changed event data */
       
  2883 	{ return reinterpret_cast<const TWsDisplayChangedEvent*>(iEventData); }
  2817 
  2884 
  2818 inline TModifiersChangedEvent *TWsEvent::ModifiersChanged() const
  2885 inline TModifiersChangedEvent *TWsEvent::ModifiersChanged() const
  2819 	/** Gets information about the modifier changed event.
  2886 	/** Gets information about the modifier changed event.
  2820 
  2887 
  2821 	This function can be used to get information about the modifier changed event
  2888 	This function can be used to get information about the modifier changed event
  2883 inline void TWsEvent::SetTimeNow()
  2950 inline void TWsEvent::SetTimeNow()
  2884 	/** Sets the event time to the current time. */
  2951 	/** Sets the event time to the current time. */
  2885 	{iTime.UniversalTime();}
  2952 	{iTime.UniversalTime();}
  2886 
  2953 
  2887 inline TInt *TWsEvent::Int() const
  2954 inline TInt *TWsEvent::Int() const
  2888 	/** Gets the event data as a TInt.*/
  2955 	/** Gets the event data as a TInt.
       
  2956 	 
       
  2957 	 For TWsEvents of type EEventPointerEnter and EEventPointerExit this is the pointer number
       
  2958 	 of the pointer that entered/exited the window. Please note that on platforms that 
       
  2959 	 use the older Symbian OS, without multipointer support, pointer number is not initialized 
       
  2960 	 for EEventPointerEnter and EEventPointerExit and thus it is random.
       
  2961 	 
       
  2962 	 If the value of the attribute returned from HALData::EPointerNumberOfPointers is greater than 1,
       
  2963 	 then the system has multipointer support. 
       
  2964 	 
       
  2965 	 @see HALData::EPointerNumberOfPointers
       
  2966 	 @see HAL::Get(TAttribute,TInt&)
       
  2967 	*/
  2889 	{ return (TInt*)&iEventData; }
  2968 	{ return (TInt*)&iEventData; }
  2890 
  2969 
  2891 inline TUint TWsPriorityKeyEvent::Handle() const
  2970 inline TUint TWsPriorityKeyEvent::Handle() const
  2892 	/** Gets the handle for the window group which added the priority key.
  2971 	/** Gets the handle for the window group which added the priority key.
  2893 
  2972 
  2952 	to reapply the clipping region to the graphics context (CFbsBitGc::SetClippingRegion()).
  3031 	to reapply the clipping region to the graphics context (CFbsBitGc::SetClippingRegion()).
  2953 
  3032 
  2954 	@return The clipping region to draw to. */
  3033 	@return The clipping region to draw to. */
  2955 	{ return iDrawingRegion; }
  3034 	{ return iDrawingRegion; }
  2956 
  3035 
  2957 inline TSizeMode::TSizeMode(TSize& aSize) :
  3036 #endif //__W32STD_H__
  2958 	iOrigin(0, 0), iScreenSize(aSize)
       
  2959 	{}
       
  2960 
       
  2961 inline TInt TSizeMode::ScaledCord(TInt aOrigin,TInt aScale)
       
  2962 	{return (aOrigin+aScale-1)/aScale;}
       
  2963 
       
  2964 inline TPoint TSizeMode::ScaledOrigin()
       
  2965 	{return TPoint(ScaledCord(iOrigin.iX,iScreenScale.iWidth),ScaledCord(iOrigin.iY,iScreenScale.iHeight));}
       
  2966 
       
  2967 #endif