Update contrib.
1 // Copyright (c) 1994-2010 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Standard window server header file
21 #ifndef __FNTSTORE_H__
31 #include <textcursor.h>
32 #include <pointerevent.h>
33 #include <advancedpointerevent.h>
35 #include <babitflags.h>
36 #include <wspublishandsubscribedata.h>
38 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
39 #include <graphics/windowserverconstants.h>
40 #include <graphics/pointereventdata.h>
41 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
43 _LIT(KWSERVThreadName,"Wserv");
48 class MWsObjectProvider;
49 class RWsDrawableSource;
52 /** Screen mode enforcement flags.
54 Screen mode enforcement ensures that windows must meet certain requirements
55 if they are to be displayed. When the screen mode changes, window groups that
56 are incorrectly set up, according to these requirements, are locked out. The
57 windows are notified of the change, and will be displayed if they are updated
58 (according to the current enforcement requirement) to match the new screen
63 @see CWsScreenDevice::ScreenModeEnforcement()
64 @see CWsScreenDevice::SetScreenModeEnforcement() */
65 enum TScreenModeEnforcement
69 All windows that are the children of window groups will be displayed, irrespective
72 This is not properly supported and is provided for testing purposes. */
74 /** Pixels and rotation enforcement.
76 Group windows must be set up for the correct rotation and be working in the
77 correct size in pixels to be displayed. */
78 ESizeEnforcementPixelsAndRotation,
79 /** Pixels and Twips enforcement.
81 Group windows must have the correct rotation and be working in the correct
82 size in pixels and twips to be displayed.
84 This setting might be used if the display pixels are not square, and would
85 distort fonts when rotated. */
86 ESizeEnforcementPixelsTwipsAndRotation,
89 struct TPixelsAndRotation
90 /** Pixels and rotation struct.
92 This is used to define a particular screen mode's screen size in pixels,
97 @see CWsScreenDevice::GetScreenModeSizeAndRotation() */
99 /** The screen size, for a given screen mode, in pixels. */
101 /** The current screen orientation. */
102 CFbsBitGc::TGraphicsOrientation iRotation;
105 struct TPixelsTwipsAndRotation
106 /** Pixels, twips and rotation struct.
108 This is used to define a particular screen mode's screen size in twips
109 and pixels, and its rotation.
113 @see CWsScreenDevice::GetScreenModeSizeAndRotation() */
115 /** The screen size, for a given screen mode, in pixels. */
117 /** The screen size, for a given screen mode, in twips. */
119 /** The screen rotation. */
120 CFbsBitGc::TGraphicsOrientation iRotation;
123 /** Log message text length.
125 This defines the length of the log text message buffer TLogMessageText,
126 which is used in RWsSession::LogMessage().
131 /** The length of the log message text buffer in characters. */
132 KLogMessageLength=0x80
135 /** Log message text buffer.
137 This is used in RWsSession::LogMessage().
141 typedef TBuf<KLogMessageLength> TLogMessageText;
143 /** Password window group priority.
145 This priority is assigned to the password window group when the window server is displaying the password window.
146 This is the highest priority, which ensures that the machine password window is in front of all other windows -
147 hence password tests cannot be bypassed.
153 /** Password window group priority. */
154 KPasswordWindowGroupPriority=1000
157 /** Switch ordinal position to owning window.
159 This enum can be specified as the 2nd parameter to RWsSession::SetWindowGroupOrdinalPosition()
160 or as the 1st parameter to RWindowTreeNode::SetOrdinalPosition() (if this is being called on an
163 When called with this value, the functions don't change the ordinal position of the group window
164 in question, but rather bring to the front the window that would come to the front if that group
165 window were to die with keyboard focus.
169 @see RWsSession::SetWindowGroupOrdinalPosition()
170 @see RWindowTreeNode::SetOrdinalPosition() */
172 /** Switch ordinal position to owning window. */
173 KOrdinalPositionSwitchToOwningWindow=0x80000000
176 /** Window corner types.
178 Corners may be specified square or stepped, with varying numbers of pixels
179 removed to make the stepping. Picturing a corner as the top left corner of
180 a window, the numbers denote the number of pixels removed from the top row
186 @see RWindowBase::SetCornerType() */
188 // Bottom 16 bits available for corner type
190 /** Square corner. */
192 /** Corner pixel removed. */
196 3 pixels are removed: the corner pixel and a single pixel from each side. */
198 /** Three pixel step.
200 5 pixels are removed: the corner pixel, the two pixels next to it and the
201 2 pixels above or below it. */
205 12 pixels are removed: the corner pixel, the four pixels next to it, the
206 four pixels above or below it, the pixel which was diagonal to the corner
207 pixel, and the pixels to both sides of that pixel. */
209 EWindowCornerRegion, // Private
210 /** Corner type mask.
212 This value is used by the window server, and may be used by developers, to
213 separate TCornerType and TCornerFlags values from a TInt which contains both
215 ECornerTypeMask=0xFFFF
220 These are used by RWindowBase::SetCornerType() to set which corners of a window
221 are not to have corner types applied to them.
227 // Top 16 bits available for corner flags
229 /** Do not apply corner shape to top left corner. */
230 EWindowCornerNotTL=0x10000,
231 /** Do not apply corner shape to top right corner. */
232 EWindowCornerNotTR=0x20000,
233 /** Do not apply corner shape to bottom left corner. */
234 EWindowCornerNotBL=0x40000,
235 /** Do not apply corner shape to bottom right corner. */
236 EWindowCornerNotBR=0x80000,
239 /** Window backup type flags.
243 @see RWindowBase::EnableBackup() */
244 enum TWindowBackupType
246 /** Backup the area behind the current window only.
248 This is the default behaviour for the RWindowBase::EnableBackup() function. */
249 EWindowBackupAreaBehind=0x0001,
250 /** Backup the entire screen.
252 This is provided for windows that require the rest
253 of the screen to fade when they are displayed. When the rest of the screen
254 should become unfaded, the window server redraws the whole screen from the
256 EWindowBackupFullScreen=0x0002,
259 /** Types of standard events.
261 These are events that the window server passes to its clients, as opposed
262 to events that the base passes to the window server.
271 This can be sent, but should be ignored by clients. */
275 This is the event that is sent when a character has been received from the
278 If an EEventKey event is associated with an EEventKeyDown or EEventKeyUp
279 event (typically EEventKeyDown), the EEventKey event occurs after the
280 EEventKeyDown/EEventKeyUp event.
282 In practice, the only keys potentially likely to have their EEventKey event
283 generated on the up rather than the down are modifier keys. */
287 If an EEventKey event is associated with an EEventKeyUp event (which is
288 rarely the case), the EEventKey event occurs after the EEventKeyUp event. */
292 If an EEventKey event is associated with an EEventKeyDown event (which
293 is typically the case), the EEventKey event occurs after the EEventKeyDown event. */
295 /** Modifier changed event.
297 This is an event generated by the window server when
298 the state of one of the modifier keys changes.
299 It is not reported unless explicitly requested by a window.
301 @see RWindowTreeNode::EnableModifierChangedEvents(). */
302 EEventModifiersChanged,
305 This event is sent when the user presses or releases a pointer button (or
306 the equivalent action, depending on the type of pointing device), drags the
307 pointer, moves it or uses the pointer to switch on the device. */
309 /** Pointer enter event.
311 This occurs when the user moves the pointer into a window with a pointer button
312 pressed (or equivalent action depending on the type of pointing device). If
313 move events are being generated, this event also occurs when the user moves
314 the pointer into the window. */
316 /** Pointer exit event.
318 Occurs when the user moves the pointer out of a window with a pointer button
319 pressed (or equivalent action depending on the type of pointing device). If
320 move events are being generated, this event also occurs when the user moves
321 the pointer out of the window. */
323 /** Pointer move buffer ready event.
325 Occurs when the pointer move buffer is ready to be retrieved by the client. */
326 EEventPointerBufferReady,
327 /** Occurs as a duplicate of each pointer event if a window sets pointer capture
328 with the TCaptureFlagDragDrop flag set. */
330 /** Focus lost event.
332 Occurs when a window group loses keyboard focus. */
333 EEventFocusLost, //10
334 /** Focus gained event.
336 Occurs when a window group gains keyboard focus. */
340 This event type is not reported unless explicitly requested by a window.
342 @see RWindowTreeNode::EnableOnEvents(). */
346 Occurs when the window server enters password mode. It is sent to the group
347 window of the currently active password window.
349 This is the window server mode where the user is required to enter a password
350 before any further actions can be performed.
354 /** Window group changed event. This occurs whenever a window group is destroyed,
355 and whenever a window group's name changes
357 This event type is not reported unless explicitly requested by a window.
359 @see RWindowTreeNode::EnableGroupChangeEvents(). */
360 EEventWindowGroupsChanged,
363 Occurs when an error occurs. See TWsErrorMessage::TErrorCategory for the types
366 This event type is not reported unless explicitly requested by a window.
368 @see RWindowTreeNode::EnableErrorMessages(). */
369 EEventErrorMessage, //15
370 /** Message ready event.
372 Occurs when a session sends a message to this window group using RWsSession::SendMessageToWindowGroup(). */
374 EEventMarkInvalid, // For internal use only
377 This is issued when an off event is received by the window server from the
380 If for some reason the event can't be delivered, or there is no-one to deliver
381 it to, then a call to the base is made to power down the processor.
383 This event is only delivered if explicitly requested using RWsSession:RequestOffEvent(). */
385 /** Event issued to off-event requesting windows when the off key is pressed. */
387 /** Screen size mode change event.
389 This is issued when the screen size mode has changed, for instance when
390 the cover on a phone that supports screen flipping is opened or closed. */
391 EEventScreenDeviceChanged, //20
392 /** Event sent whenever the window group with focus changes.
394 Requested by RWindowTreeNode::EnableFocusChangeEvents(). */
395 EEventFocusGroupChanged,
396 /** Case opened event.
398 This event is sent to those windows that have requested EEventSwitchOn
399 events. Unlike with EEventSwitchOn events, the screen will not be switched
402 /** Case closed event.
404 This event is sent to those windows that have requested EEventSwitchOff
407 Unlike EEventSwitchOff events, which make a call to the base to power down
408 the processor if for some reason the event can't be delivered (or there is
409 no-one to deliver it to), failure to deliver case closed events has no repercussions. */
411 /** Window group list change event.
413 The window group list is a list of all window groups and their z-order. This
414 event indicates any change in the window group list: additions, removals and
417 Notification of this event is requested by calling RWindowTreeNode::EnableGroupListChangeEvents(). */
418 EEventWindowGroupListChanged,
419 /** The visibility of a window has changed
421 This is sent to windows when they change from visible to invisible, or visa versa, usually due
422 to another window obscuring them.
424 Notification of this event is requested by calling RWindowTreeNode::EnableVisibilityChangeEvents(). */
425 EEventWindowVisibilityChanged,
426 #ifdef SYMBIAN_PROCESS_MONITORING_AND_STARTUP
429 This is issued when an restart event is received by the window server from the
430 base. This event is also an off event, because it might power-cycle the device.
432 If for some reason the event can't be delivered, or there is no-one to deliver
433 it to, then a call to the base is made to power down the processor.
435 This event is only delivered if explicitly requested using RWsSession:RequestOffEvent(). */
438 /** The display state or configuration has changed
440 Either change of the current resolution list (state change) or current resolution/background
441 (mode change) will trigger this event.
443 Notification of this event is requested by calling MDisplayControl::EnableDisplayChangeEvents()
445 EEventDisplayChanged = EEventWindowVisibilityChanged+2,
446 //Codes for events only passed into Key Click DLL's
447 /** Repeating key event.
449 This is only sent to a key click plug-in DLL (if one is present) to indicate
450 a repeating key event.
454 EEventGroupWindowOpen,
455 EEventGroupWindowClose,
457 //Codes for events only passed into anim dlls
458 /** Direct screen access begin
459 This is only sent to anim dlls (if they register to be notified). It indicates that
460 the number of direct screen access sessions has increased from zero to one.*/
461 EEventDirectScreenAccessBegin=200,
462 /** Direct screen access end
463 This is only sent to anim dlls (if they register to be notified). It indicates that
464 the number of direct screen access sessions has decreased from one to zero.*/
465 EEventDirectScreenAccessEnd,
466 /** Event to signal the starting or stopping of the wserv heartbeat timer
467 This is only sent to anim dlls (if they register to be notified). */
468 EEventHeartbeatTimerStateChange,
470 //The range 900-999 is reserved for UI Framework events
471 /** 900-909 WSERV protects with PowerMgmt */
472 EEventPowerMgmt = 900,
473 EEventReserved = 910,
475 //Event codes from EEventUser upwards may be used for non-wserv events.
476 //No event codes below this should be defined except by the window server
478 /** User defined event.
480 The client can use this and all higher values to define their own
481 events. These events can be sent between windows of the same client or windows
482 of different clients.
484 @see RWs::SendEventToWindowGroup(). */
490 /** Window server hot keys.
494 @see RWsSession::SetHotKey() */
497 /** Enables logging of all messages to and from the window server.
499 Note that the required type of logging must have been specified in the wsini.ini
500 file (using the LOG keyword), and the appropriate logging DLL must be available.
502 Default key mapping: \<Ctrl\>\<Alt\>\<Shift\>E */
503 EHotKeyEnableLogging,
504 /** Always disables window server logging, if active. Does nothing otherwise.
506 Default key mapping: \<Ctrl\>\<Alt\>\<Shift\>D */
507 EHotKeyDisableLogging,
508 /** Dumps a list of all windows to the log. (If logging is disabled, it is temporarily
509 enabled in order to do this.)
511 Default key mapping: \<Ctrl\>\<Alt\>\<Shift\>W */
513 /** Kills the foreground application.
515 Default key mapping: \<Ctrl\>\<Alt\>\<Shift\>K */
517 /** Shuts down the window server.
519 Be cautious! This may mean resetting the machine to re-start the window server.
521 Default key mapping: release (not available), debug (\<Ctrl\>\<Alt\>\<Shift\>X). */
523 /** Dumps a list of cells allocated on the window server's heap to the log. (If
524 logging is disabled, it is temporarily enabled in order to do this.)
526 Note that logging requires that the type of logging has been set up in the
527 wsini.ini file, and that the appropriate logging DLL is available.
529 Default key mapping: \<Ctrl\>\<Alt\>\<Shift\>H */
531 /** Increases the LCD contrast.
533 Default key mapping: EKeyIncContrast. Note that this value is from an enum
534 in e32keys.h. The contrast wraps around when it reaches the maximum. */
536 /** Decreases the LCD contrast.
538 Default key mapping: EKeyDecContrast. Note that this value is from an enum
539 in e32keys.h. The contrast wraps around when it reaches the minimum. */
541 /** Switches the machine off.
543 Default key mapping: EKeyOff. Note that this value is from an enum in e32keys.h. */
545 /** Switches the backlight on.
547 Default key mapping: EKeyBacklightOn. Note that this value is from an enum
550 /** Switches the backlight off.
552 Default key mapping: EKeyBacklightOff. Note that this value is from an enum
555 /** Toggles the backlight.
557 Default key mapping: EKeyBacklightToggle. Note that this value is from an
558 enum in e32keys.h. */
559 EHotKeyBacklightToggle,
560 /** Switches to screen size 0.
562 This, and the following 3 keys are used to switch screen sizes on real hardware,
563 for instance when the cover is closed on a phone that supports screen flipping. */
564 EHotKeyScreenDimension0,
565 /** Switches to screen size 1.
567 This might be generated when the cover is opened on a phone that supports screen
569 EHotKeyScreenDimension1,
570 /** Switches to screen size 2. */
571 EHotKeyScreenDimension2,
572 /** Switches to screen size 3. */
573 EHotKeyScreenDimension3,
574 /** Cycles the display though its possible sizes.
576 This is used only for debugging.
578 A device may have several screen sizes, each with a default orientation. For
579 example a phone that supports screen flipping will have different display
580 sizes when the cover is opened and closed.
582 Default key mapping: debug : \<Ctrl\>\<Alt\>\<Shift\> U. Release : none. */
583 EHotKeyCycleDisplaySize,
584 /** Cycles the screen orientation through the specified rotations for the particular
585 size mode you are in.
587 For example, phones that support screen flipping may
588 use this feature for changing between right and left handed use.
590 For rectangular display modes you can only specify 2 orientations, 180 degrees
591 apart. For square modes you can specify 4 rotations (90 degrees) or however
594 Specification of the list of rotations takes place in the WSINI.INI file.
596 Default key mapping: debug : \<Ctrl\>\<Alt\>\<Shift\> O. Release : none. */
597 EHotKeyCycleOrientation,
598 /** Increases the screen's brightness.
600 The brightness wraps around to the minimum
601 value after it has reached the maximum. */
602 EHotKeyIncBrightness,
603 /** Decreases the screen's brightness.
605 The brightness wraps around to the maximum value after it has reached the minimum. */
606 EHotKeyDecBrightness,
608 /** Cycle focus screen from one to another in multiple screen environment. Start
609 from current focused screen, switch to next the screen, and wraps around when it
610 reaches the last screen.
612 Default key mapping: \<Ctrl\>\<Alt\>\<Shift\> I. */
613 EHotKeyCycleFocusScreen,
615 /** Value for first hot key.
617 Used with EHotKeyLastKeyType to make it easy to write a for loop that steps
618 through all the different key values. */
619 EHotKeyFirstKeyType=EHotKeyEnableLogging, //Must always be set to the first one
620 /** Value for last hot key.
622 Used with EHotKeyFirstKeyType to make it easy to write a for loop that steps
623 through all the different key values. */
624 EHotKeyLastKeyType=EHotKeyCycleFocusScreen, //Must always be set to the last one
628 /** Password mode flags.
634 /** Releases ownership of password handling.
636 This allows another window to become the password window. A client will be
637 panicked with code 46 if it sets this mode when it is not the current password
640 /** No password handling is performed by this window, but no other window
641 can become the password window. */
643 /** Password mode is enabled only once a day.
645 When enabled, password mode requires the user to enter a password
646 before any further actions can be performed. */
648 /** Password mode is enabled every time the machine is switched on. */
650 /** Equivalent to setting the password mode to EPasswordAlways and triggering an
651 instant password check. */
652 EPasswordAlwaysTriggerNow,
653 /** Equivalent to setting the password mode to EPasswordOnceADay and triggering
654 an instant password check. */
655 EPasswordOnceADayTriggerNow,
659 Defines the value EAllPriorities.
661 EAllPriorities=KMinTInt,
666 These can be combined using a bit-wise OR operation.
670 @see RWsPointerCursor::Construct()
671 @see RWsSprite::Construct() */
674 /** Flash sprite on and off.
676 All flashing is done on the same timer, including the text cursor. */
678 /** This flag no longer has any effect.
680 If you want a sprite to appear on top of all windows, you can create a floating sprite
681 by specifying a RWindowGroup as parent to the sprite. */
682 ESpriteNoChildClip=0x2,
683 /** The sprite's appearance will not change when it is on a shadowed part of the
686 (Typically this is used for sprites attached to window groups so that
687 they are perceived to be floating above the windows). */
694 This structure is used to define the parameters of a sprite member, which
695 can be added to a sprite or pointer cursor.
699 /** The bitmap to be displayed in the sprite or pointer cursor during the time
700 interval specified by iInterval.
702 If NULL, the sprite or pointer cursor will be invisible for the time specified
707 This defines which areas of iBitmap are drawn to the screen.
708 It enables the bitmap to have a non-rectangular shape on the screen. Areas
709 which are not drawn to, retain the appearance of the window underneath the
712 The bits in iBitmap are AND'ed with those in iMaskBitmap before being drawn
713 to the screen. In practice, the mask bitmap is normally white in those areas
714 drawn to by iBitmap, and black in all other areas.
718 This bitmap should be in the same mode as iBitmap, otherwise the masking
719 out operation becomes inefficient. */
720 CFbsBitmap *iMaskBitmap;
721 /** EFalse if the mask bitmap is not to be inverted (the default) or ETrue if it
722 is to be inverted. */
724 /** Specifies the drawing mode to use when drawing iBitmap if the mask is NULL. */
725 CGraphicsContext::TDrawMode iDrawMode;
726 /** Offset from the sprite's central position.
728 Specifies an offset between the origin of iBitmap and the sprite or pointer
729 cursor's origin. (The origin is the top left corner of the bitmap.) */
731 /** Time interval for which iBitmap is displayed.
733 Note that if only one sprite member is added to a sprite or pointer cursor,
734 it will be displayed continuously, regardless of the value of iInterval. */
735 TTimeIntervalMicroSeconds32 iInterval;
738 /** Event reporting control.
740 This enumeration defines flags which can be used to control how events are
745 @see RWindowTreeNode::EnableOnEvents()
746 @see RWindowTreeNode::EnableModifierChangedEvents()
747 @see RWindowTreeNode::EnableErrorMessages() */
750 /** Requested events are sent in all circumstances. */
752 /** Events are delivered only when the requesting window's window group has keyboard
754 EEventControlOnlyWithKeyboardFocus,
755 /** Events are delivered only when the requesting window or any of its children
756 are visible on the screen. */
757 EEventControlOnlyWhenVisible
760 /** Pointer event filter types.
762 These flags are used by RWindowBase::PointerFilter() to define which pointer
763 events are filtered out by the window server and not sent to the client session.
764 They also allow the window server to simulate a move event prior to each pen
769 @see RWindowBase::PointerFilter() */
773 /** Filters out both pointer enter and pointer exit events for this window. */
774 EPointerFilterEnterExit=0x1,
775 /** Filters out pointer-move events for this window. */
776 EPointerFilterMove=0x2,
777 /** Filters out pointer-drag events for this window. */
778 EPointerFilterDrag=0x4,
779 /** Simulates a pointer move event before each pen down event.
781 This makes the pen appear more like a mouse, with simulated movement between
782 two pointer events. You can only get these events while you are in pen mode. */
783 EPointerGenerateSimulatedMove=0x8,
784 //Combinations of the above
785 /** Filters move and drag-pointer events from the event stream and simulates the
786 move event before each pen down event.
788 This enum is useful when you want to get simulated move events. Use it as shown
789 below to turn on simulated moves:
792 win->PointerFilter(EPointerMoveEvents, EPointerGenerateSimulateMoves)
794 @see RWindowBase::PointerFilter() */
795 EPointerMoveEvents=EPointerFilterMove|EPointerGenerateSimulatedMove,
799 /** Key event details.
801 When processing a TKeyEvent, the TStdScanCode in iScanCode should usually
802 be ignored in favour of the TKeyCode in iCode. Using iScanCode would bypass
803 the keyboard mapping and any FEP that happens to be installed. The exceptions
804 to this general rule are games where the positions of the keys are more important
805 than their translations, and FEPs that are implementing keyboard maps themselves.
806 In these cases, if the iCode is used rather than iScanCode to determine the
807 key pressed, there will be two unfortunate consequences. Firstly, the low-level
808 keyboard mapping might re-arrange the mapping that you are trying to impose.
809 Secondly, you will subvert the CTRL+number method of entering Unicode literals.
814 /** The character code generated for an EEventKey, or 0 for a down or up event.
816 Key codes for special keys are defined in TKeyCode. */
818 /** The scan code of the key that caused the event.
820 Standard scan codes are defined in TStdScanCode. */
822 /** State of modifier keys and pointing device. Modifier keys are defined in TEventModifier. */
824 /** Count of auto repeats generated.
826 0 means an event without repeats. 1 or more means "this many auto repeat events".
827 It is normal to ignore this value and treat it as a single event. */
831 struct TModifiersChangedEvent
832 /** Details of changed modifier keys.
836 @see TWsEvent::ModifiersChanged() */
838 /** Contains a set bit for any modifier which has changed. Modifiers are defined
839 in TEventModifier. */
840 TUint iChangedModifiers;
841 /** Current state of all modifiers, combined using a bitwise-OR. Modifiers are
842 defined in TEventModifier. */
846 struct TWsVisibilityChangedEvent
847 /** Visibility changed events.
849 These events are generated in response to a window being obscured, or being fully or partially
850 revealed after being obscured.
853 @see RWindowTreeNode::EnableVisibilityChangeEvents() */
857 /** Some or all of the window is visible, either directly or through a transparent window.
858 @deprecated Use EPartiallyVisible instead. */
860 /** None of the window is visible, either directly or through a transparent window.
861 @deprecated Use ENotVisible instead. */
866 /** Some (or all) of the window is visible, either directly or through a transparent window. */
867 EPartiallyVisible = 0x01,
868 /** None of the window is visible, either directly or through a transparent window. */
870 /** All of the window is directly visible. */
871 EFullyVisible = 0x04,
873 /** A combination of one or more visibility event flags. */
877 struct TWsDisplayChangedEvent
878 /** Display changed events.
880 These events are generated by attaching, detaching the display device, changing the resolution list or change
881 current resolution or backgound (change the current configuration).
884 @see MDisplayControl::EnableDisplayChangeEvents() */
887 Number of display that has changed, causing this event. This is
888 also known as the screen number, and is zero-based.
890 @see CWsScreenDevice::Construct(TInt)
894 Opaque value that changes when the current display configuration
897 Compare values in subsequent events to determine whether the
898 current resolution has changed since the last event.
900 TInt iConfigurationChangeId;
902 Opaque value that changes when the resolution list has changed.
904 Compare values in subsequent events to determine whether the list
905 of available resolutions has changed since the last event.
907 @see MDisplayControlBase::GetResolutions
909 TInt iResolutionListChangeId;
912 struct TWsErrorMessage
913 /** Error event details.
917 @see RWindowTreeNode::EnableErrorMessages() */
919 /** Error event types */
922 /** An error that occurs while the window server is calculating a drawing region
923 for a particular window.
925 When the window server can't calculate a drawing region due to lack of memory
926 it goes into a mode where it draws the whole of a window. Any window that
927 is covering this window is also told to redraw. */
929 /** An error occured while trying to turn the backlight on or off.
931 This would usually only happen when the batteries are low. */
933 /** An error occured while trying to enable logging. */
935 /** An error that occured while trying to change the contrast. */
938 /** The error category. */
939 TErrorCategory iErrorCategory;
940 /** The error code */
945 /** Window server redraw event.
947 All redraw events generated by the window server are delivered to the client
948 in an object of this type. The class provides a handle to the window which
949 generated the redraw event, and the rectangle which should be redrawn.
953 @see RWsSession::GetRedraw() */
956 inline TUint Handle() const;
957 inline TRect Rect() const;
959 void SetHandle(TUint aHandle);
960 void SetRect(TRect aRect);
962 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. */
963 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. */
966 class TWsPriorityKeyEvent
967 /** Priority key events.
969 These events are configured using RWindowGroup::AddPriorityKey(), and obtained
970 by the client using the functions RWsSession::PriorityKeyReady() and RWsSession::GetPriorityKey().
976 inline TKeyEvent *Key() const;
977 inline TUint Handle() const;
978 inline void SetHandle(TUint aHandle);
980 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. */
981 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. */
985 /** Window server event.
987 All events generated by the window server, except redraw events and priority
988 key events, are delivered to the client in a TWsEvent. The client obtains
989 the TWsEvent by calling RWsSession::GetEvent(). The type of data contained
990 in the TWsEvent depends on the type of event. The client can inquire the event
991 type using Type(), and then retrieve the appropriate type of data.
997 /** Event data size. */
1001 This is the maximum number of bytes of data that can be returned by EventData().
1002 Note: this value is 32 bytes.*/
1003 EWsEventDataSize=sizeof(TAdvancedPointerEvent)
1007 inline TAdvancedPointerEvent* Pointer() const;
1008 inline TKeyEvent* Key() const;
1009 inline TModifiersChangedEvent* ModifiersChanged() const;
1010 inline TWsVisibilityChangedEvent* VisibilityChanged();
1011 inline const TWsVisibilityChangedEvent* VisibilityChanged() const;
1012 inline TWsDisplayChangedEvent* DisplayChanged();
1013 inline const TWsDisplayChangedEvent* DisplayChanged() const;
1014 inline TWsErrorMessage* ErrorMessage() const;
1015 inline TUint8* EventData() const;
1016 inline TInt Type() const;
1017 inline TUint Handle() const;
1018 inline TTime Time() const;
1019 inline void SetType(TInt aType);
1020 inline void SetHandle(TUint aHandle);
1021 inline void SetTimeNow();
1022 inline TInt* Int() const;
1023 IMPORT_C void InitAdvancedPointerEvent(TPointerEvent::TType aType, TUint aModifiers, const TPoint3D &aPoint3D, TUint8 aPointerNumber);
1024 IMPORT_C void SetPointerNumber(TUint8 aPointerNumber);
1025 IMPORT_C void SetPointerZ(TInt aZ);
1027 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. */
1028 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. */
1029 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. */
1030 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. */
1034 class RWsPointerCursor;
1036 /** Pointer cursor mode flags.
1038 These flags define the current cursor mode, and hence which sprite to use
1039 for the pointer cursor.
1043 @see RWsSession::SetPointerCursorMode()
1044 @see RWsSession::PointerCursorMode() */
1045 enum TPointerCursorMode
1047 /** Don't have a pointer cursor. */
1049 /** The default system pointer cursor is used whenever there is a pointer cursor. */
1050 EPointerCursorFixed,
1051 /** The default system pointer cursor is used unless the window the pointer cursor
1052 is above specifies one, in which case that cursor is used. */
1053 EPointerCursorNormal,
1054 /** There is no pointer cursor unless the pointer is above a window that has specified
1056 EPointerCursorWindow,
1057 /** First pointer cursor mode.
1059 This is used in test code for iterating though available modes. */
1060 EPointerCursorFirstMode=EPointerCursorNone,
1061 /** The final pointer cursor mode.
1063 This is used in test code for iterating though available modes. It will be
1064 updated if more modes are added. */
1065 EPointerCursorLastMode=EPointerCursorWindow,
1068 /** Flags which customise a long key press capture request made by a window group.
1070 These flags are passed to RWindowGroup::CaptureLongKey().
1072 Two things can be configured using this enum: the normal key event that is
1073 generated immediately, and the long key event that is generated after a short
1074 time interval. The normal key event can be sent immediately (on key down)
1075 to the application with keyboard focus, or, if the key is not held down long
1076 enough to generate a long key event, when the key is released. The long key
1077 event can be customised to generate a single key event only, or to auto repeat.
1081 @see RWindowGroup::CaptureLongKey() */
1082 enum TLongCaptureFlags
1084 /** If specified, the normal ("short") key event is sent immediately (on key down)
1085 to the application with keyboard focus. If not specified, the normal key event
1086 is sent when the key is released (if the key is not held down long enough
1087 to generate a long key event). */
1088 ELongCaptureShortEventImmediately=0x01,
1089 /** If specified, causes the long key press to automatically repeat. If not specified,
1090 the long key press will generate a single key event only. */
1091 ELongCaptureRepeatEvents=0x02,
1092 /** Equivalent to ELongCaptureShortEventImmediately being set and the other flags
1094 ELongCaptureNormal=ELongCaptureShortEventImmediately,
1095 /** Equivalent to the first two values being unset. */
1096 ELongCaptureWaitShort=0,
1101 class TReadDescriptorType;
1102 class TWriteDescriptorType;
1107 /** Identifies an abstract artwork
1109 This is a piece of artwork that might be owned and authored by another process.
1110 A client can draw a piece of artwork, but that doesn't confer the ability to
1111 access the pixel representation of that artwork directly.
1121 TWsGraphicId(TUninitialized): iFlags(0) {}
1122 IMPORT_C TWsGraphicId(TUid aUid);
1123 IMPORT_C TWsGraphicId(TInt aId);
1124 IMPORT_C TWsGraphicId(const TWsGraphicId& aCopy);
1125 IMPORT_C TUid Uid() const;
1126 IMPORT_C TBool IsUid() const;
1127 IMPORT_C void Set(TUid aUid);
1128 IMPORT_C TInt Id() const;
1129 IMPORT_C TBool IsId() const;
1130 IMPORT_C void Set(TInt aId);
1131 IMPORT_C TInt Compare(const TWsGraphicId& aOther) const;
1133 friend class CWsGraphic;
1136 TInt iWsGraphicIdSpare[2];
1139 class CWsGraphic: public CBase
1140 /** Client representation of a window-server-side piece of artwork owned by this Client
1147 IMPORT_C CWsGraphic();
1149 IMPORT_C ~CWsGraphic();
1151 // 2nd phase construction
1152 IMPORT_C void BaseConstructL(TUid aUid,TUid aType,const TDesC8& aData);
1153 IMPORT_C void BaseConstructL(TUid aType,const TDesC8& aData);
1154 IMPORT_C void BaseConstructL(const TWsGraphicId& aReplace,TUid aType,const TDesC8& aData);
1155 // sharing between clients
1156 IMPORT_C virtual TInt ShareGlobally();
1157 IMPORT_C virtual TInt Share(TSecureId aClientId);
1158 IMPORT_C virtual TInt UnShare(TSecureId aClientId);
1159 IMPORT_C virtual TInt UnShareGlobally();
1161 IMPORT_C const TWsGraphicId& Id() const;
1162 IMPORT_C TBool IsActive() const;
1163 IMPORT_C void Destroy();
1165 IMPORT_C void SendMessage(const TDesC8& aData) const;
1166 IMPORT_C TInt SendSynchronMessage(const TDesC8& aData) const;
1167 IMPORT_C TInt Flush() const;
1168 IMPORT_C void SetGraphicExtension(MWsObjectProvider* aExt);
1169 IMPORT_C RWsSession& Session();
1172 // events from wserv, to be implemented by derived classes
1174 Handles message from this graphic artwork peer on the server.
1175 @param aData Message from peer CWsGraphicDrawer.
1177 virtual void HandleMessage(const TDesC8& aData) = 0;
1180 Handles custom operation when this graphic artwork is replaced. When this method
1181 is invoked, the replaced peer CWsGraphicDrawer on the server has been destroyed.
1183 virtual void OnReplace() = 0;
1184 IMPORT_C virtual void OnClientClose();
1186 void BaseConstructL();
1187 IMPORT_C virtual TInt CWsGraphic_Reserved1();
1188 IMPORT_C virtual TInt CWsGraphic_Reserved2();
1189 IMPORT_C virtual TInt CWsGraphic_Reserved3();
1193 friend class CManager;
1195 friend class CPimpl;
1197 TInt iWsGraphicSpare[2];
1200 class MWsClientClass
1201 /** Base class for all classes whose objects are clients of the window server.
1206 friend class RTFXEffect;
1209 MWsClientClass(RWsBuffer *aBuffer);
1210 inline TInt WsHandle() const;
1212 void Write(const TAny *aData1,TInt aLength1,TInt aLength2,TUint aOpcode) const;
1213 void Write(const TAny *aData, TInt aLength,const TAny *aData2, TInt aLength2,TUint aOpcode,const TIpcArgs* aIpcArgs=NULL) const;
1214 void Write(const TAny *aBuf, TInt aBufLen,TUint aOpcode,const TIpcArgs* aIpcArgs=NULL) const;
1215 void Write(TUint aOpcode) const;
1216 void WriteInt(TInt aInt, TUint aOpcode) const;
1217 void WriteRect(const TRect &aRect, TUint aOpcode) const;
1218 void WritePoint(const TPoint &aPoint, TUint aOpcode) const;
1219 void WriteSize(const TSize &aSize, TUint aOpcode) const;
1220 TInt WriteReply(TUint aOpcode,const TIpcArgs* aIpcArgs=NULL) const;
1221 TInt WriteReplyInt(TInt aInt, TUint aOpcode,const TIpcArgs* aIpcArgs=NULL) const;
1222 TInt WriteReply(const TAny *aBuf, TInt aBufLen,TUint aOpcode,const TIpcArgs* aIpcArgs=NULL) const;
1223 TInt WriteReply(const TAny *aBuf, TInt aBufLen,const TAny *aBuf2, TInt aBuflen2,TUint aOpcode,const TIpcArgs* aIpcArgs=NULL) const;
1224 TInt WriteReplyP(const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
1225 TInt WriteReplyIntP(TInt aInt, const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
1226 TInt WriteReplyP(const TAny *aBuf, TInt aBufLen, const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
1227 TInt WriteReplyP(const TAny *aBuf, TInt aBufLen,const TAny *aBuf2, TInt aBuflen2, const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
1228 TInt WriteReplyByProvidingRemoteReadAccess(const TAny* aBuf, TInt aBufLen,const TReadDescriptorType& aRemoteReadBuffer,TUint aOpcode) const;
1229 void AddToBitmapArray(const TInt aBitmapHandle)const;
1230 void AsyncRequest(TRequestStatus& aStatus, TUint aOpcode) const;
1232 TBool WindowSizeCacheEnabled() const;
1233 void MarkWindowSizeCacheDirty();
1234 void RefreshWindowSizeCache(const TSize& aNewSize) const;
1235 TInt CachedWindowSize(TSize& aSize) const;
1236 void DestroyWindowSizeCacheEntry();
1239 void AppendData(const TAny *aData,TInt aLength,TBool aFinished);
1242 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. */
1243 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. */
1247 class RWindowTreeNode;
1248 class CWsScreenDevice;
1251 class RWsSpriteBase;
1252 class RDirectScreenAccess;
1256 class RWsSession : public MWsClientClass, public RSessionBase
1257 /** Window server session.
1259 The session between the client and the window server can be used to mediate
1260 asynchronous events, for client interface control and for system control.
1261 A description of each of these capabilities is given below.
1263 Mediating asynchronous events:
1265 Primarily, the session mediates asynchronous events to the user. Three event
1266 streams are available: the standard event stream which all applications must
1267 use; the redraw event stream which must be used by all applications except
1268 those which exclusively use backed-up windows; and the priority key event
1269 stream which may be used for abort keys and the like for specialist applications.
1271 All these events are mediated as standard asynchronous services. Typical window
1272 server client programs encapsulate each service they require in an active
1273 object whose RunL() identifies the event and calls the appropriate member
1274 function of a class associated with an application framework, or a window.
1276 Client interface control:
1278 The client's interface with the window server has several aspects, each of
1279 which is controlled through the window server session.
1281 Flushing defines how requests to the window server are handled.
1285 Many system-wide settings may be controlled through the window server session.
1286 Typically, these functions are only used by the system shell and its associated
1287 sessions/applications. They include: auto-repeat and double-click, querying
1288 all window groups in the system, setting the default shadow vector, setting
1289 the system pointer cursors, counting resources used by the window server
1290 (this is only useful for debugging checks), getting and setting the state of
1291 the modifier keys (for instance Shift and Ctrl), setting the window server
1292 background colour, getting and setting thresholds for window server generated
1298 friend class RWsBuffer;
1299 friend class RWindowTreeNode;
1300 friend class CWsScreenDevice;
1301 friend class CWsBitmap;
1302 friend class RAnimDll;
1303 friend class RWsSpriteBase;
1304 friend class RDirectScreenAccess;
1305 friend class RSoundPlugIn;
1306 friend class CWsGraphic;
1307 friend class RWsDrawableSource;
1309 /** Compute mode flags.
1311 When a window group takes focus or loses it, the window server can boost its
1312 client's thread or process priority to provide a better response to the user.
1313 How it alters the priority is determined by the current compute mode of the
1316 @see ComputeMode() */
1319 /** Client priority is permanently set to its current level. It is not altered
1320 or set by the windowing system if the focus changes.
1322 Thus if ComputeMode() is called with this flag when a client is in the foreground,
1323 it will subsequently have foreground priority even if it is in the background. */
1324 EPriorityControlDisabled,
1325 /** Client process's priority is always set to EPriorityBackground. */
1326 EPriorityControlComputeOn,
1327 /** Client process's priority is set to EPriorityForeground when the window group
1328 takes focus, and set to EPriorityBackground when it loses focus.
1330 This is the default behaviour. */
1331 EPriorityControlComputeOff
1333 enum {ESystemInfoArraySize=16};
1334 /** Window server logging commands passed to LogCommand().
1336 @see RWsSession::LogCommand() */
1337 enum TLoggingCommand
1339 /** Enables logging. */
1341 /** Disables logging. */
1343 /** Logs the current status of all the windows in the tree, even if logging is
1344 not currently enabled. */
1345 ELoggingStatusDump, //Window Tree Dump
1346 /** Logs information about the window server's heap size and usage, even if logging
1347 is not currently enabled. */
1351 struct TWindowGroupChainInfo
1353 /*Stores id and Parent id window group
1355 This is used to define chained window groups's id and it's parent id.
1356 An array of these structures is returned by some of the varients of the function WindowGroupList.
1364 /** WARNING: Struct for internal use ONLY. Compatibility is not guaranteed in future releases. */
1366 TInt iInfo[ESystemInfoArraySize];
1368 /** The vertical alignment of a custom text cursor sprite.
1370 One of these values must be set, see SetCustomTextCursor(). This value also
1371 determines which part of each sprite member bitmap is clipped when the cursor's
1372 TTextCursor::EFlagClipVertical flag is set. */
1373 enum TCustomTextCursorAlignment
1375 /** The y-origin of each sprite member bitmap is aligned with the top of the line. */
1376 ECustomTextCursorAlignTop,
1377 /** The y-origin of each sprite member bitmap is aligned with the baseline of the
1379 ECustomTextCursorAlignBaseline,
1380 /** The y-origin of each sprite member bitmap is aligned with the bottom of the
1382 ECustomTextCursorAlignBottom
1387 IMPORT_C RWsSession();
1388 IMPORT_C TInt Connect();
1389 IMPORT_C TInt Connect(RFs& aFileServer);
1390 IMPORT_C void Close();
1391 IMPORT_C TVersion Version() const;
1393 IMPORT_C TInt SetHotKey(THotKey aType, TUint aKeyCode, TUint aModifierMask, TUint aModifier);
1394 IMPORT_C TInt ClearHotKeys(THotKey aType);
1395 IMPORT_C TInt RestoreDefaultHotKey(THotKey aType);
1397 IMPORT_C void EventReady(TRequestStatus *aStat);
1398 IMPORT_C void EventReadyCancel();
1399 IMPORT_C void GetEvent(TWsEvent &aEvent) const;
1400 IMPORT_C void PurgePointerEvents();
1402 IMPORT_C void RedrawReady(TRequestStatus *aStat);
1403 IMPORT_C void RedrawReadyCancel();
1404 IMPORT_C void GetRedraw(TWsRedrawEvent &aEvent);
1406 IMPORT_C void PriorityKeyReady(TRequestStatus *aStat);
1407 IMPORT_C void PriorityKeyReadyCancel();
1408 IMPORT_C void GetPriorityKey(TWsPriorityKeyEvent &aEvent) const;
1410 IMPORT_C void Flush();
1411 IMPORT_C TBool SetAutoFlush(TBool aState);
1412 IMPORT_C TInt SetKeyboardRepeatRate(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime);
1413 IMPORT_C void GetKeyboardRepeatRate(TTimeIntervalMicroSeconds32 &aInitialTime, TTimeIntervalMicroSeconds32 &aTime) const;
1414 IMPORT_C void GetDoubleClickSettings(TTimeIntervalMicroSeconds32 &aInterval, TInt &aDistance) const;
1415 IMPORT_C TInt SetDoubleClick(const TTimeIntervalMicroSeconds32 &aInterval, TInt aDistance);
1417 IMPORT_C TInt NumWindowGroups() const;
1418 IMPORT_C TInt WindowGroupList(CArrayFixFlat<TInt> *aWindowList) const;
1419 IMPORT_C TInt WindowGroupList(RArray<TWindowGroupChainInfo>* aWindowList) const;
1420 IMPORT_C TInt NumWindowGroups(TInt aPriority) const;
1421 IMPORT_C TInt WindowGroupList(TInt aPriority, CArrayFixFlat<TInt> *aWindowList) const;
1422 IMPORT_C TInt WindowGroupList(TInt aPriority, RArray<TWindowGroupChainInfo>* aWindowList) const;
1423 IMPORT_C TInt GetFocusWindowGroup() const;
1424 IMPORT_C TInt GetDefaultOwningWindow() const;
1425 IMPORT_C TInt SetWindowGroupOrdinalPosition(TInt aIdentifier, TInt aPosition);
1426 IMPORT_C TInt GetWindowGroupClientThreadId(TInt aIdentifier, TThreadId &aThreadId) const;
1427 IMPORT_C TInt GetWindowGroupHandle(TInt aIdentifier) const;
1428 IMPORT_C TInt GetWindowGroupOrdinalPriority(TInt aIdentifier) const;
1429 IMPORT_C TInt SendEventToWindowGroup(TInt aIdentifier, const TWsEvent &aEvent);
1430 IMPORT_C TInt SendEventToAllWindowGroups(const TWsEvent &aEvent);
1431 IMPORT_C TInt SendEventToAllWindowGroups(TInt aPriority, const TWsEvent &aEvent);
1432 IMPORT_C TInt SendEventToOneWindowGroupsPerClient(const TWsEvent &aEvent);
1433 IMPORT_C TInt GetWindowGroupNameFromIdentifier(TInt aIdentifier, TDes &aWindowName) const;
1434 IMPORT_C TInt FindWindowGroupIdentifier(TInt aPreviousIdentifier,const TDesC& aMatch,TInt aOffset=0) const;
1435 IMPORT_C TInt FindWindowGroupIdentifier(TInt aPreviousIdentifier,TThreadId aThreadId) const;
1436 IMPORT_C TInt SendMessageToWindowGroup(TInt aIdentifier, TUid aUid, const TDesC8 &aParams);
1437 IMPORT_C TInt SendMessageToAllWindowGroups(TUid aUid, const TDesC8& aParams);
1438 IMPORT_C TInt SendMessageToAllWindowGroups(TInt aPriority, TUid aUid, const TDesC8& aParams);
1439 IMPORT_C TInt FetchMessage(TUid &aUid, TPtr8 &aParams, const TWsEvent& aMessageEvent) const;
1441 IMPORT_C void SetShadowVector(const TPoint &aVector);
1442 IMPORT_C TPoint ShadowVector() const;
1444 IMPORT_C void SetBackgroundColor(TRgb aColor);
1445 IMPORT_C TRgb GetBackgroundColor() const;
1447 IMPORT_C TInt RegisterSurface(TInt aScreenNumber, const TSurfaceId& aSurface);
1448 IMPORT_C void UnregisterSurface(TInt aScreenNumber, const TSurfaceId& aSurface);
1449 IMPORT_C TInt PreferredSurfaceConfigurationSize() const;
1451 IMPORT_C TInt SetSystemPointerCursor(const RWsPointerCursor &aPointerCursor,TInt aCursorNumber);
1452 IMPORT_C void ClearSystemPointerCursor(TInt aCursorNumber);
1453 IMPORT_C TInt ClaimSystemPointerCursorList();
1454 IMPORT_C void FreeSystemPointerCursorList();
1456 IMPORT_C TInt SetCustomTextCursor(TInt aIdentifier, const TArray<TSpriteMember>& aSpriteMemberArray, TUint aSpriteFlags, TCustomTextCursorAlignment aAlignment);
1458 IMPORT_C TInt ResourceCount() const;
1459 IMPORT_C void PasswordEntered();
1460 IMPORT_C void ComputeMode(TComputeMode aMode);
1462 IMPORT_C TInt HeapCount() const;
1463 IMPORT_C TInt DebugInfo(TInt aFunction, TInt aParam=0) const;
1464 IMPORT_C TInt DebugInfo(TInt aFunction, TDes8& aReturnBuf, TInt aParam=0) const;
1465 IMPORT_C void HeapSetFail(TInt aTAllocFail,TInt aValue);
1466 IMPORT_C void HeapSetBurstFail(TInt aTAllocFail,TInt aRate,TInt aBurst);
1467 IMPORT_C TInt SetModifierState(TEventModifier aModifier,TModifierState aState);
1468 IMPORT_C TInt GetModifierState() const;
1470 IMPORT_C TInt RequestOffEvents(TBool aOn,RWindowTreeNode *aWin=NULL);
1471 IMPORT_C TDisplayMode GetDefModeMaxNumColors(TInt& aColor,TInt& aGray) const;
1472 IMPORT_C TInt GetColorModeList(CArrayFixFlat<TInt> *aModeList) const;
1474 IMPORT_C void SetPointerCursorArea(const TRect& aArea);
1475 IMPORT_C void SetPointerCursorArea(TInt aScreenSizeMode,const TRect& aArea);
1476 IMPORT_C TRect PointerCursorArea() const;
1477 IMPORT_C TRect PointerCursorArea(TInt aScreenSizeMode) const;
1478 IMPORT_C void SetPointerCursorMode(TPointerCursorMode aMode);
1479 IMPORT_C TInt SetClientCursorMode(TPointerCursorMode aMode);
1480 IMPORT_C TPointerCursorMode PointerCursorMode() const;
1481 IMPORT_C void SetDefaultSystemPointerCursor(TInt aCursorNumber);
1482 IMPORT_C void ClearDefaultSystemPointerCursor();
1483 IMPORT_C TInt SetPointerCursorPosition(const TPoint& aPosition);
1484 IMPORT_C TPoint PointerCursorPosition() const;
1486 IMPORT_C void SetDefaultFadingParameters(TUint8 aBlackMap,TUint8 aWhiteMap);
1487 IMPORT_C void PrepareForSwitchOff();
1488 IMPORT_C void SetBufferSizeL(TInt aBufSize);
1489 IMPORT_C void SetMaxBufferSizeL(TInt aMaxBufSize);
1490 IMPORT_C TInt SetSystemFaded(TBool aFaded);
1491 IMPORT_C TInt SetSystemFaded(TBool aFaded,TUint8 aBlackMap,TUint8 aWhiteMap);
1493 // Functions for multiple screens
1494 IMPORT_C TInt SetFocusScreen(TInt aScreenNumber);
1495 IMPORT_C TInt GetFocusScreen() const;
1496 IMPORT_C void ClearAllRedrawStores();
1497 IMPORT_C TInt NumWindowGroups(TInt aScreenNumber,TInt aPriority) const;
1498 IMPORT_C TInt NumberOfScreens() const;
1499 IMPORT_C TInt WindowGroupList(CArrayFixFlat<TInt>* aWindowList,TInt aScreenNumber,TInt aPriority=EAllPriorities) const;
1500 IMPORT_C TInt GetFocusWindowGroup(TInt aScreenNumber) const;
1501 IMPORT_C TInt GetDefaultOwningWindow(TInt aScreenNumber) const;
1502 IMPORT_C TDisplayMode GetDefModeMaxNumColors(TInt aScreenNumber,TInt& aColor,TInt& aGray) const;
1503 IMPORT_C TInt GetColorModeList(TInt aScreenNumber,CArrayFixFlat<TInt>* aModeList) const;
1504 #if defined(__WINS__)
1505 // Function for WINS behaviour only
1506 IMPORT_C void SetRemoveKeyCode(TBool aRemove);
1507 IMPORT_C void SimulateXyInputType(TInt aInputType); //Only for testing WSERV
1510 IMPORT_C void SimulateRawEvent(TRawEvent aEvent);
1511 IMPORT_C void SimulateKeyEvent(TKeyEvent aEvent);
1512 IMPORT_C void LogCommand(TLoggingCommand aCommand);
1513 IMPORT_C void LogMessage(const TLogMessageText &aMessage);
1515 // Functions for test code use only
1516 IMPORT_C void SystemInfo(TInt &aSystemInfoNumber, SSystemInfo &aSystemInfo);
1517 IMPORT_C void TestWrite(TInt aHandle,TInt aOpcode,const TAny *aData, TInt aLength);
1518 IMPORT_C void TestWriteReply(TInt aHandle,TInt aOpcode,const TAny *aData, TInt aLength);
1519 IMPORT_C void TestWriteReplyP(TInt aHandle,TInt aOpcode,const TAny *aData,TInt aLength,TDes8 *aReplyPackage);
1520 IMPORT_C TInt TestWriteReplyByProvidingRemoteReadAccess(TInt aHandle,TInt aOpcode,const TDesC8& aData,const TDesC8& aRemoteReadBuffer);
1521 IMPORT_C TInt TestWriteReplyByProvidingRemoteReadAccess(TInt aHandle,TInt aOpcode,const TDesC8& aData,const TDesC16& aRemoteReadBuffer);
1523 IMPORT_C TInt Finish();
1524 IMPORT_C void SyncMsgBuf();
1526 // Getters and setters for pointer event's thresholds
1527 IMPORT_C TInt SetCloseProximityThresholds(TInt aEnterCloseProximityThreshold, TInt aExitCloseProximityThreshold);
1528 IMPORT_C TInt GetEnterCloseProximityThreshold() const;
1529 IMPORT_C TInt GetExitCloseProximityThreshold() const;
1530 IMPORT_C TInt SetHighPressureThresholds(TInt aEnterHighPressureThreshold, TInt aExitHighPressureThreshold);
1531 IMPORT_C TInt GetEnterHighPressureThreshold() const;
1532 IMPORT_C TInt GetExitHighPressureThreshold() const;
1534 IMPORT_C void EnableWindowSizeCacheL();
1535 IMPORT_C void SendEffectCommand(TInt aTfxCmd, const TDesC8& aTfxCmdData=KNullDesC8);
1537 // Registering/Unregistering of TFX effect, to allow animations to be associated with each transition
1538 IMPORT_C void RegisterEffect(TInt aAction, TInt aPurpose, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TUint aAppUid=0, TBitFlags aFlags=0);
1539 IMPORT_C void UnregisterEffect(TInt aAction, TInt aPurpose, TUint aAppUid=0);
1540 IMPORT_C void UnregisterAllEffects();
1541 IMPORT_C void OverrideEffects(TInt aAction, TInt aPurpose, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TBitFlags aFlags=0);
1543 //Application tells the window server the orientation of rendering it intends to use
1544 IMPORT_C void IndicateAppOrientation(TRenderOrientation aOrientation);
1546 // functions not exported, used by CWsGraphic
1547 void GraphicMessageReady(TRequestStatus *aStat);
1548 void GetGraphicMessage(TDes8& aData) const;
1549 void GraphicMessageCancel();
1550 void GraphicAbortMessage(TInt aError);
1551 TInt GraphicFetchHeaderMessage();
1553 TInt doWindowGroupList(TInt aPriority, RArray<TWindowGroupChainInfo>* aWindowListCh, TInt aNumOpcode, TInt aListOpcode) const;
1554 TInt doWindowGroupList(TInt aScreenNumber, TInt aPriority, CArrayFixFlat<TInt>* aWindowListId, TInt aNumOpcode, TInt aListOpcode) const;
1555 TInt doSetHotKey(TInt aOpcode, TInt aType, TUint aKeycode, TUint aModifierMask, TUint aModifiers);
1556 void doReadEvent(TRequestStatus *aStat, TInt aOpcode);
1560 TInt DoFlush(const TIpcArgs& aIpcArgs);
1561 TInt DoSyncMsgBuf(const TIpcArgs& aIpcArgs);
1562 void DirectAcessActivation(TBool aIsNowActive);
1569 class RWindowTreeNode : public MWsClientClass
1570 /** A handle to a node in the server-side window tree.
1572 This handle class is used as the base for both window groups and the windows
1573 within them; it is not intended for user derivation, and may not be directly
1574 constructed: use one of the standard derived classes instead.
1579 friend class RWindowGroup;
1580 friend class RWindowBase;
1581 friend class CWindowGc;
1582 friend class RAnimDll;
1583 friend class RWsSprite;
1585 /** Fade control flags.
1587 These flags define whether fading is applied to all child windows when SetFaded()
1588 is called on a window. */
1591 /** Include all child windows when fading/un-fading. */
1592 EFadeIncludeChildren=ETrue,
1593 /** Fade only the parent window.
1595 Note that a panic will occur if this value is used when SetFaded() is called
1596 on a window group. */
1597 EFadeWindowOnly=EFalse,
1601 RWindowTreeNode(RWsSession &aWs);
1603 IMPORT_C void Close();
1604 IMPORT_C void Destroy();
1605 IMPORT_C TUint32 ClientHandle() const;
1606 IMPORT_C TUint32 Parent() const;
1607 IMPORT_C TUint32 PrevSibling() const;
1608 IMPORT_C TUint32 NextSibling() const;
1609 IMPORT_C TUint32 Child() const;
1610 IMPORT_C TInt OrdinalPriority() const;
1611 IMPORT_C TInt OrdinalPosition() const;
1612 IMPORT_C TInt FullOrdinalPosition() const;
1613 IMPORT_C void SetOrdinalPosition(TInt aPos);
1614 IMPORT_C void SetOrdinalPosition(TInt aPos,TInt aOrdinalPriority);
1615 IMPORT_C TInt ScreenNumber() const;
1616 IMPORT_C TInt WindowGroupId() const;
1617 IMPORT_C TInt SetPointerCursor(TInt aCursorNumber);
1618 IMPORT_C void SetCustomPointerCursor(const RWsPointerCursor &aPointerCursor);
1619 IMPORT_C TInt EnableOnEvents(TEventControl aCircumstances=EEventControlOnlyWithKeyboardFocus);
1620 IMPORT_C void DisableOnEvents();
1621 IMPORT_C TInt EnableGroupChangeEvents();
1622 IMPORT_C void DisableGroupChangeEvents();
1623 IMPORT_C TInt EnableFocusChangeEvents();
1624 IMPORT_C void DisableFocusChangeEvents();
1625 IMPORT_C TInt EnableGroupListChangeEvents();
1626 IMPORT_C void DisableGroupListChangeEvents();
1627 IMPORT_C TInt EnableVisibilityChangeEvents();
1628 IMPORT_C void DisableVisibilityChangeEvents();
1629 IMPORT_C TInt EnableErrorMessages(TEventControl aCircumstances);
1630 IMPORT_C void DisableErrorMessages();
1631 IMPORT_C TInt EnableModifierChangedEvents(TUint aModifierMask, TEventControl aCircumstances);
1632 IMPORT_C void DisableModifierChangedEvents();
1633 IMPORT_C void SetNonFading(TBool aNonFading);
1634 IMPORT_C void SetFaded(TBool aFaded,TFadeControl aIncludeChildren);
1635 IMPORT_C void SetFaded(TBool aFaded,TFadeControl aIncludeChildren,TUint8 aBlackMap,TUint8 aWhiteMap);
1636 IMPORT_C void ClearPointerCursor();
1637 IMPORT_C RWsSession* Session() const;
1644 class TSurfaceConfiguration;
1646 class RWindowBase : public RWindowTreeNode
1647 /** Client-side handle to a server-side window.
1649 The server-side windows of handles derived from this class can be displayed
1650 on the device's screen, and associated with pointer events.
1652 This class is not for user derivation; however derived classes form part of
1653 the Window Server API.
1659 /** Capture behaviour flags.
1661 @see SetPointerCapture()
1662 @see EEventDragDrop */
1665 // Flags, these can be combined to customise pointer capture
1666 /** If set, capture is enabled, disabled otherwise. */
1667 TCaptureFlagEnabled=0x01,
1668 /** If set, drag-drop events are sent to the window in which the pointer was lifted.
1669 Drag-drop is a tap-drag-lift sequence. */
1670 TCaptureFlagDragDrop=0x02,
1671 /** Capture events from windows belonging to any group, not just the group of the
1672 window on which the flag was set */
1673 TCaptureFlagAllGroups=0x04,
1674 // States, made up of a set of flags
1675 /** Equivalent to disabling all the above flags. */
1677 /** Equivalent to TCaptureFlagEnabled. */
1678 TCaptureEnabled=TCaptureFlagEnabled,
1679 /** Equivalent to the OR of the first three flags. */
1680 TCaptureDragDrop=TCaptureFlagEnabled|TCaptureFlagDragDrop|TCaptureFlagAllGroups,
1684 RWindowBase(RWsSession &aWs);
1686 IMPORT_C void Activate();
1687 IMPORT_C void SetPosition(const TPoint &point);
1688 IMPORT_C TInt SetSizeErr(const TSize &size);
1689 IMPORT_C TInt SetExtentErr(const TPoint &point,const TSize &size);
1690 IMPORT_C TSize Size() const;
1691 IMPORT_C TPoint InquireOffset(const RWindowTreeNode &aWindow) const;
1692 IMPORT_C void PointerFilter(TUint32 aFilterMask, TUint32 aFilter);
1693 IMPORT_C void SetPointerGrab(TBool aState);
1694 IMPORT_C void ClaimPointerGrab(TBool aSendUpEvent=ETrue);
1695 IMPORT_C TInt ClaimPointerGrab(const TUint8 aPointerNumber, const TBool aSendUpEvent=ETrue);
1696 IMPORT_C void SetPointerCapture(TInt aFlags);
1697 IMPORT_C void SetPointerCapturePriority(TInt aPriority);
1698 IMPORT_C TInt GetPointerCapturePriority() const;
1699 IMPORT_C void SetVisible(TBool aState);
1700 IMPORT_C void SetShadowHeight(TInt aHeight);
1701 IMPORT_C void SetShadowDisabled(TBool aState);
1702 IMPORT_C TPoint Position() const;
1703 IMPORT_C TPoint AbsPosition() const;
1704 IMPORT_C TInt SetCornerType(TCornerType aCornerType, TInt aCornerFlags=0);
1705 IMPORT_C TInt SetShape(const TRegion &aRegion);
1706 IMPORT_C TInt SetRequiredDisplayMode(TDisplayMode aMode);
1707 IMPORT_C TDisplayMode DisplayMode() const;
1708 IMPORT_C void EnableBackup(TUint aBackupType=EWindowBackupAreaBehind);
1709 IMPORT_C void RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32 aTime,const TRect &aRect);
1710 IMPORT_C void CancelPointerRepeatEventRequest();
1711 IMPORT_C TInt RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32 aTime,const TRect &aRect, const TUint8 aPointerNumber); //< @prototype
1712 IMPORT_C TInt CancelPointerRepeatEventRequest(const TUint8 aPointerNumber); //< @prototype
1713 IMPORT_C TInt AllocPointerMoveBuffer(TInt aMaxPoints, TUint aFlags);
1714 IMPORT_C void FreePointerMoveBuffer();
1715 IMPORT_C void EnablePointerMoveBuffer();
1716 IMPORT_C void DisablePointerMoveBuffer();
1717 IMPORT_C TInt RetrievePointerMoveBuffer(TDes8 &aBuf) const;
1718 IMPORT_C void DiscardPointerMoveBuffer();
1719 IMPORT_C TInt AddKeyRect(const TRect &aRect, TInt aScanCode, TBool aActivatedByPointerSwitchOn);
1720 IMPORT_C void RemoveAllKeyRects();
1721 IMPORT_C TInt PasswordWindow(TPasswordMode aPasswordMode);
1722 IMPORT_C void FadeBehind(TBool aFade);
1723 IMPORT_C TBool IsFaded() const;
1724 IMPORT_C TBool IsNonFading() const;
1725 IMPORT_C TInt MoveToGroup(TInt aIdentifier);
1726 IMPORT_C TInt SetBackgroundSurface(const TSurfaceId& aSurface);
1727 IMPORT_C TInt SetBackgroundSurface(const TSurfaceConfiguration& aConfiguration, TBool aTriggerRedraw);
1728 IMPORT_C void RemoveBackgroundSurface(TBool aTriggerRedraw);
1729 IMPORT_C TInt GetBackgroundSurface(TSurfaceConfiguration& aConfiguration) const;
1730 IMPORT_C void SetSurfaceTransparency(TBool aSurfaceTransparency);
1731 IMPORT_C TRgb KeyColor() const;
1732 IMPORT_C void EnableAdvancedPointers();
1733 IMPORT_C void SetPurpose(TInt aPurpose);
1734 IMPORT_C void SendEffectCommand(TInt aTfxCmd, const TDesC8& aTfxCmdData=KNullDesC8);
1735 IMPORT_C void OverrideEffects(TInt aAction, const TFileName& aResourceDir, const TFileName& aFilenameOutgoing, const TFileName& aFilenameIncoming, TBitFlags aFlags=0);
1736 IMPORT_C TInt FixNativeOrientation();
1737 IMPORT_C TSize SizeForEgl() const;
1739 TInt construct(const RWindowTreeNode &parent,TUint32 aHandle, TInt aType, TDisplayMode aDisplayMode);
1743 class RBlankWindow : public RWindowBase
1746 A blank window may have its extent and colour changed, but nothing else may
1747 be drawn to it. Blank windows provide no functionality that is not provided
1748 by the RWindow class. However, they are useful when the application requires
1749 a window that cannot be drawn to, for example a container window.
1755 IMPORT_C RBlankWindow();
1756 IMPORT_C RBlankWindow(RWsSession &aWs);
1757 IMPORT_C TInt Construct(const RWindowTreeNode &parent, TUint32 aHandle);
1758 IMPORT_C void SetColor(TRgb aColor);
1759 IMPORT_C void SetColor();
1760 IMPORT_C void SetSize(const TSize &size);
1761 IMPORT_C void SetExtent(const TPoint &point,const TSize &size);
1765 class RDrawableWindow : public RWindowBase
1766 /** Handle to a drawable window.
1768 This class cannot be constructed directly.
1769 The two concrete derived classes, RWindow and RBackedUpWindow, allow
1770 drawing but use different protocols because RWindow relies on the client to
1771 redraw invalid areas.
1778 RDrawableWindow(RWsSession &aWs);
1780 IMPORT_C void Scroll(const TPoint &aOffset);
1781 IMPORT_C void Scroll(const TRect &aClipRect, const TPoint &aOffset);
1782 IMPORT_C void Scroll(const TPoint &aOffset, const TRect &aRect);
1783 IMPORT_C void Scroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
1784 IMPORT_C TRect GetDrawRect() const;
1786 void SetDrawRect(const TRect &aRect);
1788 void doScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect, TInt aOpcode);
1793 /** Transparency policies
1795 These policies are to control the behaviour of a transparent window.
1798 @see RWindow::SetTransparencyPolicy() */
1799 enum TWsTransparencyPolicy {
1800 /** Default behaviour. */
1801 ETransparencyDefault,
1802 /** Freeze the content of underneath the transparent window to prevent redraw everytime
1803 the overlying window changes. */
1804 ETransparencyFreezeUnder,
1807 class RWindow : public RDrawableWindow
1808 /** Handle to a standard window.
1810 An RWindow is a handle to a server-side window which can be displayed and
1811 drawn to, and whose redraws are performed by the application.
1818 IMPORT_C RWindow(RWsSession &aWs);
1819 IMPORT_C TInt Construct(const RWindowTreeNode &parent,TUint32 aHandle);
1820 IMPORT_C void BeginRedraw();
1821 IMPORT_C void BeginRedraw(const TRect &aRect);
1822 IMPORT_C void EndRedraw();
1823 IMPORT_C void Invalidate();
1824 IMPORT_C void Invalidate(const TRect &aRect);
1825 IMPORT_C void GetInvalidRegion(RRegion &aRegion) const;
1826 IMPORT_C void SetBackgroundColor(TRgb aColor);
1827 IMPORT_C void SetBackgroundColor();
1828 IMPORT_C void SetSize(const TSize &size);
1829 IMPORT_C void SetExtent(const TPoint &point,const TSize &size);
1830 IMPORT_C void HandleTransparencyUpdate();
1831 IMPORT_C TInt SetTransparencyFactor(const TRgb& aTransparencyFactor);
1832 IMPORT_C TInt SetTransparencyBitmap(const CFbsBitmap& aTransparencyBitmap);
1833 IMPORT_C TInt SetTransparencyWsBitmap(const CWsBitmap& aTransparencyBitmap);
1834 IMPORT_C void SetNonTransparent();
1835 IMPORT_C void EnableRedrawStore(TBool aEnabled);
1836 IMPORT_C TInt SetTransparencyAlphaChannel();
1837 IMPORT_C TInt SetTransparentRegion(const TRegion& aRegion);
1838 IMPORT_C TInt SetTransparencyPolicy(TWsTransparencyPolicy aPolicy);
1839 IMPORT_C TBool IsRedrawStoreEnabled() const;
1840 IMPORT_C void EnableOSB(TBool);
1841 IMPORT_C void ClearRedrawStore();
1845 class RBackedUpWindow : public RDrawableWindow
1846 /** Client-side handle to a drawable window with a backup bitmap.
1848 A backed-up window is associated with a backup bitmap which retains the contents
1849 of the window. When an area of the window is invalidated, the window server
1850 uses the bitmap directly to update the window without requiring an application
1851 redraw. The backup bitmap is owned by the font and bitmap server and resides
1852 on the font and bitmap server's shared heap, which is accessible to all client
1853 programs: functions are provided to allow the client application to access
1854 this bitmap directly and perform updates to the window under application control.
1861 IMPORT_C RBackedUpWindow();
1862 IMPORT_C RBackedUpWindow(RWsSession &aWs);
1863 IMPORT_C TInt Construct(const RWindowTreeNode &parent,TDisplayMode aDisplayMode, TUint32 aHandle);
1864 IMPORT_C TInt BitmapHandle() const;
1865 IMPORT_C void UpdateScreen();
1866 IMPORT_C void UpdateScreen(const TRegion &aRegion);
1867 IMPORT_C void UpdateBackupBitmap();
1868 IMPORT_C void MaintainBackup();
1872 class RWindowGroup : public RWindowTreeNode
1873 /** Client-side handle to a server-side window group.
1879 IMPORT_C RWindowGroup();
1880 IMPORT_C RWindowGroup(RWsSession &aWs);
1881 IMPORT_C TInt Construct(TUint32 aClientHandle);
1882 IMPORT_C TInt Construct(TUint32 aClientHandle,CWsScreenDevice* aScreenDevice);
1883 IMPORT_C TInt Construct(TUint32 aClientHandle,TBool aIsFocusable,CWsScreenDevice* aScreenDevice);
1884 IMPORT_C TInt Construct(TUint32 aClientHandle,TBool aIsFocusable);
1885 IMPORT_C TInt ConstructChildApp(TInt aIdOfParentWindowGroup,TUint32 aClientHandle);
1886 IMPORT_C TInt ConstructChildApp(TInt aIdOfParentWindowGroup,TUint32 aClientHandle,TBool aIsFocusable);
1887 IMPORT_C void AllowProcessToCreateChildWindowGroups(TUid aProcessSID);
1888 IMPORT_C void EnableReceiptOfFocus(TBool aState);
1889 IMPORT_C void AutoForeground(TBool aState);
1890 IMPORT_C void SetOrdinalPriorityAdjust(TInt aAdjust);
1891 IMPORT_C TInt SetOrdinalPositionErr(TInt aPos,TInt aOrdinalPriority);
1892 IMPORT_C TInt32 CaptureKey(TUint aKeycode, TUint aModifierMask, TUint aModifier);
1893 IMPORT_C TInt32 CaptureKey(TUint aKeycode, TUint aModifierMask, TUint aModifier, TInt aPriority);
1894 IMPORT_C void CancelCaptureKey(TInt32 aCaptureKey);
1895 IMPORT_C TInt32 CaptureKeyUpAndDowns(TUint aScanCode, TUint aModifierMask, TUint aModifier);
1896 IMPORT_C TInt32 CaptureKeyUpAndDowns(TUint aScanCode, TUint aModifierMask, TUint aModifier, TInt aPriority);
1897 IMPORT_C void CancelCaptureKeyUpAndDowns(TInt32 aCaptureKey);
1898 IMPORT_C TInt32 CaptureLongKey(TUint aInputKeyCode,TUint aOutputKeyCode,TUint aModifierMask,TUint aModifier
1899 ,TInt aPriority,TUint aFlags);
1900 IMPORT_C TInt32 CaptureLongKey(TTimeIntervalMicroSeconds32 aRepeatTime,TUint aInputKeyCode,TUint aOutputKeyCode
1901 ,TUint aModifierMask,TUint aModifier,TInt aPriority,TUint aFlags);
1902 IMPORT_C void CancelCaptureLongKey(TInt32 aCaptureKey);
1903 IMPORT_C TInt AddPriorityKey(TUint aKeycode, TUint aModifierMask, TUint aModifier);
1904 IMPORT_C void RemovePriorityKey(TUint aKeycode, TUint aModifierMask, TUint aModifier);
1905 IMPORT_C void SetTextCursor(RWindowBase &aWin, const TPoint &aPos, const TTextCursor &aCursor);
1906 IMPORT_C void SetTextCursor(RWindowBase &aWin, const TPoint &aPos, const TTextCursor &aCursor, const TRect &aClipRect);
1907 IMPORT_C void CancelTextCursor();
1908 IMPORT_C void SetOwningWindowGroup(TInt aIdentifier);
1909 IMPORT_C void DefaultOwningWindow();
1910 IMPORT_C TInt SetName(const TDesC &aName);
1911 IMPORT_C TInt Name(TDes &aWindowName) const;
1912 IMPORT_C TInt Identifier() const;
1913 IMPORT_C void DisableKeyClick(TBool aState);
1914 IMPORT_C TInt EnableScreenChangeEvents();
1915 IMPORT_C void DisableScreenChangeEvents();
1916 IMPORT_C void SimulatePointerEvent(TRawEvent aEvent);
1917 IMPORT_C void SimulateAdvancedPointerEvent(TRawEvent aEvent);
1918 IMPORT_C TInt ClearChildGroup();
1919 IMPORT_C TInt SetChildGroup(TInt aId);
1921 TInt32 doCaptureKey(TUint aKey, TUint aModifierMask, TUint aModifiers, TInt aPriority, TInt aOpcode);
1922 void doCancelCaptureKey(TInt32 aCaptureKeyHandle, TInt aOpcode);
1923 TInt Construct(TInt aIdOfParentWindowGroup, TUint32 aClientHandle, TBool aIsFocusable, CWsScreenDevice* aScreenDevice);
1927 class CWsBitmap : public CFbsBitmap, public MWsClientClass
1928 /** Window server bitmap.
1930 This is a bitmap to which the window server already has a handle. Functions
1931 which take a window server bitmap are faster than equivalent functions which
1938 IMPORT_C CWsBitmap();
1939 IMPORT_C CWsBitmap(RWsSession &aWs);
1940 IMPORT_C ~CWsBitmap();
1941 IMPORT_C TInt Create(const TSize& aSizeInPixels,TDisplayMode aDispMode);
1942 IMPORT_C TInt Duplicate(TInt aHandle);
1943 IMPORT_C TInt Load(const TDesC& aFileName,TInt32 aId,TBool aShareIfLoaded=ETrue);
1944 IMPORT_C void InternalizeL(RReadStream& aStream);
1945 IMPORT_C void Reset();
1947 TInt createWsBitmap(TInt aErr);
1950 class RWsGraphicMsgBuf;
1952 class TWsGraphicMsgFixedBase
1953 /** Base class for fixed-size messages to be attached to CWindowGc::DrawWsGraphic commands
1958 IMPORT_C TPtrC8 Pckg() const;
1959 IMPORT_C TUid TypeId() const;
1960 IMPORT_C TInt Size() const;
1962 IMPORT_C TWsGraphicMsgFixedBase(TUid aTypeId,TInt aSizeOfDerived);
1968 class RWsGraphicMsgBuf: private RBuf8
1969 /** Utility class for building data buffers to be attached to CWindowGc::DrawWsGraphic commands
1970 Useful when there is more than one piece of data to be attached to the draw command
1975 IMPORT_C RWsGraphicMsgBuf();
1977 using RBuf8::CleanupClosePushL;
1978 IMPORT_C TInt Append(TUid aTypeId,const TDesC8& aData);
1979 IMPORT_C TInt Append(TUid aTypeId,const TDesC16& aData);
1980 IMPORT_C TInt Append(TUid aTypeId,TInt aLen,TPtr8& aPtr);
1981 IMPORT_C TInt Append(const TWsGraphicMsgFixedBase& aMsg);
1982 IMPORT_C void Remove(TInt aIndex);
1983 IMPORT_C TInt Count() const;
1984 IMPORT_C TUid TypeId(TInt aIndex) const;
1985 IMPORT_C TPtrC8 Data(TInt aIndex) const;
1986 IMPORT_C TPtr8 Data(TInt aIndex);
1987 IMPORT_C void GetFixedMsg(TWsGraphicMsgFixedBase& aMsg,TInt aIndex) const;
1988 IMPORT_C const TDesC8& Pckg() const;
1990 TInt ExpandForAppend(TInt aDataLen);
1991 void WriteHeader(TUid aUid,TInt aLen);
1992 TInt IntAt(TInt aOfs) const;
1994 TInt iRMsgBufSpare[2];
1998 class CWindowGc : public CBitmapContext, public MWsClientClass
1999 /** Window graphics context.
2001 Most window graphics context drawing functions map to equivalent CFbsBitGc
2002 functions. They are implemented on the screen with any co-ordinates being
2003 relative to the top left corner of the window. However extra clipping is applied.
2004 The drawing will always be clipped to the visible part of the window. In addition
2005 it will be clipped to the non-invalid part if you are not doing a redraw and
2006 to the region being validated if you are doing a redraw.
2010 In general, server side functions which encounter conditions which would normally
2011 cause a leave, do not leave but instead return an error value indicating the
2012 leave condition. In this way the leave can be handled on the appropriate side
2013 of the client/server boundary. For example, a client can choose to wrap server
2014 calls with User::LeaveIfError(), which causes a leave with the specified
2017 The above advice is true of many functions in this class, and in its derived
2022 @see CGraphicsContext */
2024 friend class CWsScreenDevice;
2026 /** Defines possible clockwise rotation values.
2028 WARNING: Enum for internal and partner use ONLY. Compatibility is not guaranteed in future releases.
2032 enum TGraphicsRotation
2035 EGraphicsRotationNone,
2036 /** A 90 degree rotation. */
2037 EGraphicsRotation90,
2038 /** A 180 degree rotation. */
2039 EGraphicsRotation180,
2040 /** A 270 degree rotation. */
2041 EGraphicsRotation270
2044 IMPORT_C CWindowGc(CWsScreenDevice *aDevice);
2045 IMPORT_C virtual ~CWindowGc();
2046 IMPORT_C virtual TInt Construct();
2047 IMPORT_C virtual void Activate(RDrawableWindow &aDevice);
2048 IMPORT_C virtual void Deactivate();
2049 //====================FROM CGraphicsContext.H===============================
2050 IMPORT_C virtual CGraphicsDevice* Device() const;
2051 IMPORT_C virtual void SetOrigin(const TPoint &aPoint=TPoint(0,0));
2052 IMPORT_C virtual void SetDrawMode(TDrawMode aDrawingMode);
2053 IMPORT_C virtual void SetClippingRect(const TRect& aRect);
2054 IMPORT_C virtual void CancelClippingRect();
2055 IMPORT_C virtual void Reset();
2057 IMPORT_C virtual void UseFont(const CFont *aFont);
2058 IMPORT_C virtual void DiscardFont();
2059 IMPORT_C virtual void SetUnderlineStyle(TFontUnderline aUnderlineStyle);
2060 IMPORT_C virtual void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle);
2061 // Used to do justified text properly
2062 IMPORT_C virtual void SetWordJustification(TInt aExcessWidth,TInt aNumGaps);
2063 // Used primarily to get accurate WYSIWYG
2064 IMPORT_C virtual void SetCharJustification(TInt aExcessWidth,TInt aNumChars);
2066 IMPORT_C virtual void SetPenColor(const TRgb &aColor);
2067 IMPORT_C virtual void SetPenStyle(TPenStyle aPenStyle);
2068 IMPORT_C virtual void SetPenSize(const TSize& aSize);
2070 IMPORT_C virtual void SetBrushColor(const TRgb &aColor);
2071 IMPORT_C virtual void SetBrushStyle(TBrushStyle aBrushStyle);
2072 IMPORT_C virtual void SetBrushOrigin(const TPoint &aOrigin);
2073 IMPORT_C virtual void UseBrushPattern(const CFbsBitmap *aDevice);
2074 IMPORT_C virtual void DiscardBrushPattern();
2076 // Move the internal position, as used by DrawLineTo & DrawLineBy, and set by MoveTo,
2077 // MoveBy, DrawLine, DrawLineTo, DrawLineBy and DrawPolyline
2078 IMPORT_C virtual void MoveTo(const TPoint &aPoint);
2079 IMPORT_C virtual void MoveBy(const TPoint &aPoint);
2080 IMPORT_C virtual void Plot(const TPoint &aPoint);
2082 // Line drawing subject to pen color, width and style and draw mode
2083 IMPORT_C virtual void DrawArc(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd);
2084 IMPORT_C virtual void DrawLine(const TPoint &aPoint1,const TPoint &aPoint2);
2085 IMPORT_C virtual void DrawLineTo(const TPoint &aPoint);
2086 IMPORT_C virtual void DrawLineBy(const TPoint &aPoint);
2087 IMPORT_C virtual void DrawPolyLine(const CArrayFix<TPoint> *aPointList);
2088 IMPORT_C virtual void DrawPolyLine(const TPoint* aPointList,TInt aNumPoints);
2091 // Outlines subject to pen color, width and style and draw mode
2092 // (set pen to ENullPen for no outline)
2093 // Fill subject to brush style (color, hash or pattern) and origin and
2094 // drawing mode (set brush to ENullBrush for no fill)
2095 IMPORT_C virtual void DrawPie(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd);
2096 IMPORT_C virtual void DrawEllipse(const TRect &aRect);
2097 IMPORT_C virtual void DrawRect(const TRect &aRect);
2098 IMPORT_C virtual void DrawRoundRect(const TRect &aRect,const TSize &aEllipse);
2099 IMPORT_C virtual TInt DrawPolygon(const CArrayFix<TPoint> *aPointList,TFillRule aFillRule=EAlternate);
2100 IMPORT_C virtual TInt DrawPolygon(const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule=EAlternate);
2102 // Uses the bitmap's Twips size and does a "stretch" blit in general
2103 IMPORT_C virtual void DrawBitmap(const TPoint &aTopLeft, const CFbsBitmap *aDevice);
2104 IMPORT_C virtual void DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aDevice);
2105 IMPORT_C virtual void DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aDevice, const TRect &aSourceRect);
2106 IMPORT_C virtual void DrawBitmapMasked(const TRect& aDestRect, const CFbsBitmap* aBitmap, const TRect& aSourceRect, const CFbsBitmap* aMaskBitmap, TBool aInvertMask);
2107 IMPORT_C virtual void DrawBitmapMasked(const TRect& aDestRect, const CWsBitmap* aBitmap, const TRect& aSourceRect, const CWsBitmap* aMaskBitmap, TBool aInvertMask);
2109 // Required as not all DrawText and DrawTextVertical functions are implemented in CWindowGc
2110 using CBitmapContext::DrawText;
2111 using CBitmapContext::DrawTextVertical;
2113 // Text drawing subject to drawing mode
2114 // Subject to used font, pen color, drawing mode,
2115 // word and char justification
2116 IMPORT_C virtual void DrawText(const TDesC &aBuf,const TPoint &aPos);
2118 // Subject to same as above plus brush for background
2119 // (set brush to ENullBrush for no effect on background)
2120 IMPORT_C virtual void DrawText(const TDesC &aBuf,const TRect &aBox,TInt aBaselineOffset,TTextAlign aHoriz=ELeft,TInt aLeftMrg=0);
2121 //================Extra functions from CBitmapContext==============
2122 IMPORT_C virtual void Clear();
2123 IMPORT_C virtual void Clear(const TRect &aRect);
2124 IMPORT_C virtual void CopyRect(const TPoint &anOffset,const TRect &aRect);
2125 IMPORT_C virtual void BitBlt(const TPoint &aPos, const CFbsBitmap *aBitmap);
2126 IMPORT_C virtual void BitBlt(const TPoint &aDestination, const CFbsBitmap *aBitmap, const TRect &aSource);
2127 IMPORT_C virtual void BitBltMasked(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask);
2128 IMPORT_C virtual void BitBlt(const TPoint &aPoint, const CWsBitmap *aBitmap);
2129 IMPORT_C virtual void BitBlt(const TPoint &aDestination, const CWsBitmap *aBitmap, const TRect &aSource);
2130 IMPORT_C virtual void BitBltMasked(const TPoint& aPoint,const CWsBitmap *aBitmap,const TRect& aSourceRect,const CWsBitmap *aMaskBitmap,TBool aInvertMask);
2131 IMPORT_C virtual void MapColors(const TRect& aRect,const TRgb* aColors,TInt aNumPairs=2,TBool aMapForwards=ETrue);
2133 IMPORT_C virtual void DrawTextVertical(const TDesC& aText,const TPoint& aPos,TBool aUp);
2134 IMPORT_C virtual void DrawTextVertical(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
2135 //=================Extra functions specific to wserv GDI==============
2136 IMPORT_C virtual void SetDitherOrigin(const TPoint& aPoint);
2137 IMPORT_C virtual TInt SetClippingRegion(const TRegion &aRegion);
2138 IMPORT_C virtual void CancelClippingRegion();
2139 IMPORT_C virtual void SetOpaque(TBool aDrawOpaque=ETrue);
2140 //=================Functions also supplied by CFbsBitGc==============
2141 IMPORT_C virtual void SetFaded(TBool aFaded);
2142 IMPORT_C virtual void SetFadingParameters(TUint8 aBlackMap,TUint8 aWhiteMap);
2143 IMPORT_C virtual TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CFbsBitmap* aSrcBmp, const TRect& aSrcRect, const CFbsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
2144 IMPORT_C virtual TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CWsBitmap* aSrcBmp, const TRect& aSrcRect, const CWsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
2146 IMPORT_C TAny* Interface(TUid aInterfaceId);
2147 IMPORT_C const TAny* Interface(TUid aInterfaceId) const;
2150 IMPORT_C TInt APIExtension(TUid aUid, TAny*& aOutput, TAny* aInput);
2154 IMPORT_C void Reserved_CGraphicsContext_2();
2156 IMPORT_C void Reserved_CBitmapContext_1();
2157 IMPORT_C void Reserved_CBitmapContext_2();
2158 IMPORT_C void Reserved_CBitmapContext_3();
2161 IMPORT_C virtual void DrawWsGraphic(const TWsGraphicId& aId,const TRect& aDestRect);
2162 IMPORT_C virtual void DrawWsGraphic(const TWsGraphicId& aId,const TRect& aDestRect,const TDesC8& aData);
2164 IMPORT_C virtual void Reserved_CWindowGc_3();
2165 IMPORT_C virtual void Reserved_CWindowGc_4();
2166 IMPORT_C virtual void Reserved_CWindowGc_5();
2168 //=============================================================
2169 private: // Private code
2170 TRgb Color(TInt aOpcode)const;
2171 void SetJustification(TInt aExcessWidth,TInt aNumGaps, TInt aOpcode);
2172 void DrawArcOrPie(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd, TInt aOpcode);
2173 void doDrawPolyLine(const CArrayFix<TPoint> *aPointArray, const TPoint* aPointList,TInt aNumPoints);
2174 TInt doDrawPolygon(const CArrayFix<TPoint> *aPointArray,const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule);
2175 void WriteTextPos(TInt aOpcode,TInt aOpcodePtr,const TPoint &aPos,const TDesC &aBuf) const;
2176 void WriteTextCommand(TAny *aCmd, TInt aLen,const TDesC &aBuf,TInt aOpcode,TInt aOpcodePtr) const;
2177 void WriteTextCommand(TAny *aCmd, TInt aLen,const TDesC8 &aBuf,TInt aOpcode,TInt aOpcodePtr) const;
2178 TInt APIExGetUnderlineMetrics(TAny*& aOutput);
2179 TInt APIExSetShadowColor(TAny* aShadowColor);
2180 TInt APIExGetShadowColor(TAny*& aOutput);
2181 // New DrawText API's that take in context
2182 TInt APIExDrawText(const TDesC &aBuf,const TTextParameters* aParam,const TPoint &aPos);
2183 TInt APIExDrawText(const TDesC &aBuf,const TTextParameters* aParam,const TRect &aBox,TInt aBaselineOffset,TTextAlign aHoriz=ELeft,TInt aLeftMrg=0);
2184 TInt APIExDrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TPoint& aPos,TBool aUp);
2185 TInt APIExDrawTextVertical(const TDesC& aText,const TTextParameters* aParam,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
2186 TInt APIExInterface(TAny*& aInterface, TUid aInterfaceId);
2188 void DrawResource(const TPoint& aPos, const RWsDrawableSource& aSource, TGraphicsRotation aRotation=EGraphicsRotationNone);
2189 void DrawResource(const TRect& aDestRect, const RWsDrawableSource& aSource, TGraphicsRotation aRotation=EGraphicsRotationNone);
2190 void DrawResource(const TRect& aDestRect, const RWsDrawableSource& aSource, const TRect& aSrcRect, TGraphicsRotation aRotation=EGraphicsRotationNone);
2191 void DrawResource(const TRect& aDestRect, const RWsDrawableSource& aSource, const TDesC8& aParam);
2193 private: // Private data
2196 CWsScreenDevice *iDevice;
2200 class CWsScreenDevice : public CBitmapDevice, public MWsClientClass
2201 /** Software device screen.
2203 An object of this class can be used to enquire or set parameters of the software
2204 screen, and determine the physical limits of the device.
2206 CWsScreenDevice gives access to the list of screen modes. These are the combinations
2207 of screen rotation and screen size supported by the device. One of them is
2208 selected as the current screen mode. The possible screen modes are initialised
2213 @see CFbsScreenDevice */
2216 /** Whether or not to include sprites when comparing areas of the screen*/
2217 enum TSpriteInCompare
2219 /** This enum can be specified as the 3rd parameter to CWsScreenDevice::RectCompare(const TRect &aRect1,
2220 const TRect &aRect2,TUint aFlags).
2221 When called with the value ERemoveSprite if there are any sprites visible in the areas of the screen being compared then these
2222 will not be included in the comparison.
2223 The function CWsScreenDevice::RectCompare(const TRect &aRect1,const TRect &aRect2) will not include
2224 sprites in the comparison.
2227 /** This enum can be specified as the 3rd parameter to CWsScreenDevice::RectCompare(const TRect &aRect1,
2228 const TRect &aRect2,TUint aFlags).
2229 When called with the value EIncludeSprite if there are any sprites visible in the areas of the screen being compared then these
2230 will be included in the comparison.*/
2232 /** This enum can be specified as the 3rd parameter to CWsScreenDevice::RectCompare(const TRect &aRect1,
2233 const TRect &aRect2,TUint aFlags).
2234 When called with the value EIncludeTextCursor if there are any text cursors visible in the areas of the screen being compared then these
2235 will be included in the comparison.*/
2236 EIncludeTextCursor=2
2239 IMPORT_C CWsScreenDevice();
2240 IMPORT_C CWsScreenDevice(RWsSession &aWs);
2241 IMPORT_C ~CWsScreenDevice();
2242 IMPORT_C TInt Construct();
2243 IMPORT_C TInt Construct( TInt aDefaultScreenNumber ) ;
2244 IMPORT_C TAny* GetInterface(TUint aInterfaceId);
2245 inline const TAny* GetInterface(TUint aInterfaceId) const;
2246 IMPORT_C TBool IsModeDynamic(TInt aSizeMode) const;
2247 IMPORT_C TBool IsCurrentModeDynamic() const;
2248 //==== From CGraphicsDevice ====//
2249 IMPORT_C TDisplayMode DisplayMode() const;
2250 IMPORT_C TSize SizeInPixels() const;
2251 IMPORT_C TSize SizeInTwips() const;
2252 IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const;
2253 IMPORT_C TInt VerticalTwipsToPixels(TInt aTwips) const;
2254 IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixels) const;
2255 IMPORT_C TInt VerticalPixelsToTwips(TInt aPixels) const;
2256 IMPORT_C TRect PointerRect() const;
2257 IMPORT_C TInt CreateContext(CGraphicsContext *&aGc);
2258 inline TInt CreateContext(CWindowGc*& aGc);
2259 IMPORT_C virtual TInt GetNearestFontInTwips(CFont*& aFont,const TFontSpec& aFontSpec);
2260 IMPORT_C virtual TInt GetNearestFontToDesignHeightInTwips(CFont*& aFont,const TFontSpec& aFontSpec);
2261 IMPORT_C virtual TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont,const TFontSpec& aFontSpec,TInt aMaxHeight);
2262 IMPORT_C TInt NumTypefaces() const;
2263 IMPORT_C void TypefaceSupport(TTypefaceSupport& aTypefaceSupport,TInt aTypefaceIndex) const;
2264 IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex,TInt aHeightIndex) const;
2265 // ==== From CBitmapDevice ====//
2266 IMPORT_C void GetPixel(TRgb& aColor,const TPoint& aPixel) const;
2267 IMPORT_C void GetScanLine(TDes8& aScanLine,const TPoint& aStartPixel,TInt aPixelLength, TDisplayMode aDispMode) const;
2268 IMPORT_C TInt AddFile(const TDesC& aName,TInt& aId);
2269 IMPORT_C void RemoveFile(TInt aId=0);
2270 IMPORT_C virtual TInt GetNearestFontInPixels(CFont*& aFont,const TFontSpec& aFontSpec);
2271 IMPORT_C virtual TInt GetNearestFontToDesignHeightInPixels(CFont*& aFont,const TFontSpec& aFontSpec);
2272 IMPORT_C virtual TInt GetNearestFontToMaxHeightInPixels(CFont*& aFont,const TFontSpec& aFontSpec,TInt aMaxHeight);
2273 IMPORT_C TInt FontHeightInPixels(TInt aTypefaceIndex,TInt aHeightIndex) const;
2274 IMPORT_C void ReleaseFont(CFont* aFont);
2275 //===== From CFbsScreenDevice ====//
2276 IMPORT_C void PaletteAttributes(TBool& aModifiable,TInt& aNumEntries) const;
2277 IMPORT_C void SetPalette(CPalette* aPalette);
2278 IMPORT_C TInt GetPalette(CPalette*& aPalette) const;
2279 //===== Extra functions ====//
2280 IMPORT_C TInt SetCustomPalette(const CPalette* aPalette);
2281 IMPORT_C TInt GetFontById(CFont*& aFont,TUid aUid,const TAlgStyle& aAlgStyle);
2282 IMPORT_C TBool RectCompare(const TRect &aRect1,const TRect &aRect2) const;
2283 IMPORT_C TBool RectCompare(const TRect& aRect1,const TRect &aRect2,TUint aFlags) const;
2284 IMPORT_C TInt CopyScreenToBitmap(const CFbsBitmap *aBitmap) const;
2285 IMPORT_C TInt CopyScreenToBitmap(const CFbsBitmap *aBitmap, const TRect &aRect) const;
2286 IMPORT_C TInt SetBackLight(TBool aBackLight);
2287 //===== Screen Rotation functions ====//
2288 IMPORT_C void SetScreenSizeAndRotation(const TPixelsTwipsAndRotation &aSizeAndRotation);
2289 IMPORT_C void GetDefaultScreenSizeAndRotation(TPixelsTwipsAndRotation &aSizeAndRotation) const;
2290 IMPORT_C void SetScreenSizeAndRotation(const TPixelsAndRotation &aSizeAndRotation);
2291 IMPORT_C void GetDefaultScreenSizeAndRotation(TPixelsAndRotation &aSizeAndRotation) const;
2292 IMPORT_C TScreenModeEnforcement ScreenModeEnforcement() const;
2293 IMPORT_C void SetScreenModeEnforcement(TScreenModeEnforcement aMode) const;
2294 IMPORT_C void GetScreenModeSizeAndRotation(TInt aMode, TPixelsTwipsAndRotation &aSizeAndRotation) const;
2295 IMPORT_C void GetScreenModeSizeAndRotation(TInt aMode, TPixelsAndRotation &aSizeAndRotation) const;
2296 IMPORT_C void SetCurrentRotations(TInt aMode, CFbsBitGc::TGraphicsOrientation aRotation) const;
2297 IMPORT_C TInt GetRotationsList(TInt aMode, CArrayFixFlat<TInt> *aRotationList) const;
2298 IMPORT_C TInt NumScreenModes() const;
2299 IMPORT_C void SetScreenMode(TInt aMode);
2300 IMPORT_C TInt CurrentScreenMode() const;
2301 IMPORT_C void SetAppScreenMode(TInt aMode);
2302 IMPORT_C TPoint GetDefaultScreenModeOrigin() const;
2303 IMPORT_C TPoint GetScreenModeOrigin(TInt aMode) const;
2304 IMPORT_C TSize GetCurrentScreenModeScale() const;
2305 IMPORT_C TSize GetScreenModeScale(TInt aMode) const;
2306 IMPORT_C TPoint GetCurrentScreenModeScaledOrigin() const;
2307 IMPORT_C TPoint GetScreenModeScaledOrigin(TInt aMode) const;
2308 IMPORT_C TInt GetScreenSizeModeList(RArray<TInt>* aModeList) const;
2309 IMPORT_C TDisplayMode GetScreenModeDisplayMode(const TInt &aMode) const;
2310 //===== Used for testing purpose only ====//
2311 IMPORT_C TSizeMode GetCurrentScreenModeAttributes() const;
2312 IMPORT_C void SetCurrentScreenModeAttributes(const TSizeMode &aModeAtt);
2313 IMPORT_C TInt GetScreenNumber() const;
2315 CFbsTypefaceStore* TypeFaceStore()const;
2316 TSize DisplaySizeInPixels()const;
2317 TSize PhysicalScreenSizeInTwips()const;
2318 private: // Private data
2319 class CScrDevExtension; //Implements extension interfaces, including and replacing typeface store
2320 CScrDevExtension* iExtension;
2321 TSize iPhysicalScreenSizeInTwips;
2322 TSize iDisplaySizeInPixels;
2323 friend class CWindowGc;
2327 class RWsSpriteBase : public MWsClientClass
2328 // Client side class base class for sprites and pointer cursors
2329 /** Sprite base class.
2331 Unless stated otherwise, references to sprites in the documentation for this class also
2332 apply to pointer cursors.
2337 @see RWsPointerCursor */
2340 IMPORT_C RWsSpriteBase();
2341 IMPORT_C RWsSpriteBase(RWsSession &aWs);
2343 IMPORT_C TInt Activate();
2344 IMPORT_C TInt AppendMember(const TSpriteMember &aMemberData);
2345 IMPORT_C void UpdateMember(TInt aIndex);
2346 IMPORT_C TInt UpdateMember(TInt aIndex, const TSpriteMember &aMemberData);
2347 IMPORT_C void Close();
2351 class RWsSprite : public RWsSpriteBase
2354 This class defines functions to create and initialise a sprite, and to set
2361 IMPORT_C RWsSprite();
2362 IMPORT_C RWsSprite(RWsSession &aWs);
2363 IMPORT_C TInt Construct(RWindowTreeNode &aWindow, const TPoint &aPos, TInt aFlags);
2364 IMPORT_C void SetPosition(const TPoint &aPos);
2368 class RWsPointerCursor : public RWsSpriteBase
2371 The pointer cursor is created in a similar way to a sprite. After creating it,
2372 one or more sprite members containing the bitmaps to be displayed are added.
2374 After a pointer cursor has been created and activated, it does not become
2375 visible until the application calls RWindowTreeNode::SetPointerCursor() or
2376 RWindowTreeNode::SetCustomPointerCursor(). The pointer cursor's origin automatically
2377 tracks the position of the pointing device, or position of emulated single pointer if there
2378 are more pointers in the system (see documentation of RWindowBase::EnableAdvancedPointers()
2379 for more details), and the origin forms the pointer cursor's "hot spot", i.e., the point
2380 whose co-ordinates are sent to the client if a pointer event occurs.
2381 If the pointer cursor's bitmap needs to extend to the left or upwards from the pointer
2382 position, its sprite member should be given a negative offset in TSpriteMember::iOffset.
2386 Pointer cursors are rarely used in pure pen architectures, but they are supported
2387 for mouse or tablet use.
2389 @see RWindowBase::EnableAdvancedPointers()
2395 IMPORT_C RWsPointerCursor();
2396 IMPORT_C RWsPointerCursor(RWsSession &aWs);
2397 IMPORT_C TInt Construct(TInt aFlags);
2404 class RAnimDll : public MWsClientClass
2405 /** Client-side interface to the server-side animation DLL.
2407 This is the client side class matching the server side CAnimDLL class. It
2408 provides functions to create, load, close and destroy a server-side CAnimDll
2413 @see CreateCAnimDllL()
2417 IMPORT_C RAnimDll();
2418 IMPORT_C virtual ~RAnimDll();
2419 IMPORT_C RAnimDll(RWsSession &aWs);
2420 IMPORT_C TInt Load(const TDesC &aFileName);
2421 IMPORT_C void Destroy();
2422 IMPORT_C virtual void Close();
2424 TInt CommandReply(TInt aHandle, TInt aOpcode, const TIpcArgs* aIpcArgs=NULL);
2425 TInt CommandReply(TInt aHandle, TInt aOpcode, const TDesC8& aArgs, const TIpcArgs* aIpcArgs=NULL);
2426 void Command(TInt aHandle, TInt aOpcode, const TPtrC8 &aArgs);
2427 void Command(TInt aHandle, TInt aOpcode);
2428 void AsyncCommandReply(TRequestStatus& aStatus, TInt aOpcode, TIpcArgs& aIpcArgs);
2429 TInt CreateInstance(TInt32& aHandle, const MWsClientClass &aDevice, TInt aType, const TDesC8 &aArgs, TInt aOpcode, const TIpcArgs* aIpcArgs);
2430 void DestroyInstance(TInt aHandle);
2437 /** Client-side handle to a server-side animation class.
2439 This class should be sub-classed to provide a client side interface to the
2440 server side animation DLL. The server side animation DLL is derived from CAnim.
2446 IMPORT_C virtual ~RAnim();
2447 IMPORT_C virtual void Close();
2448 IMPORT_C void Destroy();
2451 IMPORT_C RAnim(RAnimDll &aDll);
2452 IMPORT_C TInt Construct(const RWindowBase &aDevice, TInt aType, const TDesC8 &aParams);
2453 IMPORT_C TInt Construct(const RWindowBase &aDevice, TInt aType, const TDesC8 &aParams, const TIpcArgs& aIpcArgs);
2454 IMPORT_C TInt Construct(const RWsSprite &aDevice, TInt aType, const TDesC8 &aParams);
2455 IMPORT_C TInt Construct(const RWsSprite &aDevice, TInt aType, const TDesC8 &aParams, const TIpcArgs& aIpcArgs);
2456 IMPORT_C TInt CommandReply(TInt aOpcode);
2457 IMPORT_C TInt CommandReply(TInt aOpcode, const TPtrC8 &aArgs);
2458 IMPORT_C TInt CommandReply(TInt aOpcode, const TDesC8& aArgs, const TIpcArgs& aIpcArgs);
2459 IMPORT_C void Command(TInt aOpcode, const TPtrC8 &aArgs);
2460 IMPORT_C void Command(TInt aOpcode);
2461 IMPORT_C void AsyncCommandReply(TRequestStatus& aRequestStatus,TInt aOpcode, const TIpcArgs& aIpcArgs);
2469 class RDirectScreenAccess : public MWsClientClass
2470 /** The interface between an application that directly accesses the screen and
2473 Note that most applications that need to access the screen directly should
2474 use CDirectScreenAccess instead. RDirectScreenAccess only needs to be used
2475 directly by applications without access to an active scheduler.
2481 /** Provides the reason why direct screen access must terminate. This enum is used
2482 in the MAbortDirectScreenAccess::AbortNow() and MDirectScreenAccess::Restart()
2485 The first value (ETerminateCancel) indicates that direct screen access is
2486 being terminated by the application. The final three values indicate that
2487 direct screen access is being terminated by the window server. Note that
2488 for users of CDirectScreenAccess, the termination code is not important
2489 because these issues are dealt with by CDirectScreenAccess::StartL(). */
2490 enum TTerminationReasons
2492 /** The application has finished direct screen access. */
2494 /** A window is about to come in front of a part of the area that is being used
2495 for direct screen access. */
2497 /** The screen's color depth (as enumerated by TDisplayMode) is about to change. */
2498 ETerminateScreenMode,
2499 /** The current screen mode (the combination of screen rotation and screen size)
2500 is about to change. */
2503 /** The priority of the active object that responds to notification that direct
2504 screen access must stop. */
2507 /** A suggested value for the priority of the active object that responds to notification
2508 from the window server that direct screen access must stop. This is also the
2509 value used by CDirectScreenAccess for this purpose. */
2510 EPriorityVeryHigh=2000,
2513 IMPORT_C RDirectScreenAccess();
2514 IMPORT_C RDirectScreenAccess(RWsSession& aWs);
2515 IMPORT_C TInt Construct();
2516 IMPORT_C TInt Construct(TBool aRegionTrackingOnly);
2517 IMPORT_C TInt Request(RRegion*& aRegion,TRequestStatus& aStatus,const RWindowBase& aWindow);
2518 IMPORT_C void Completed();
2519 IMPORT_C void Cancel();
2520 IMPORT_C void Close();
2523 CDsaMsgQueue* iMsgQueue;
2524 // To maintain BC we need the following
2526 TRequestStatus* iDummyRequest;
2530 class MAbortDirectScreenAccess
2531 /** The interface for terminating direct screen access.
2533 An object of a class which implements this interface should be passed to CDirectScreenAccess::NewL().
2537 @see MDirectScreenAccess */
2540 /** This function is called by the window server when direct screen access must
2541 stop (for example because a dialogue is moved in front of the area where direct
2542 screen access is taking place).
2544 In response to this, direct screen access must stop immediately. In simple cases,
2545 this will involve cancelling the active object that is driving the drawing to the
2548 No attempt to call a Window Server API function can be made from
2549 AbortNow(), because then a temporary deadlock will occur. This is because WSERV
2550 is waiting to receive the client's acknowledgment that it has aborted, and so will
2551 not be able to service the call. As soon as the restriction no longer applies,
2552 the function Restart() will be called.
2554 @param aReason The reason why direct screen access was terminated. */
2555 virtual void AbortNow(RDirectScreenAccess::TTerminationReasons aReason)=0;
2559 class MDirectScreenAccess : public MAbortDirectScreenAccess
2560 /** The interface for restarting direct screen access.
2562 The Restart() function is called by the window server as soon as direct screen
2563 access can resume. It is called after the window server has called AbortNow().
2565 An object of the derived class is passed to CDirectScreenAccess::NewL().
2569 @see CDirectScreenAccess::NewL() */
2572 /** This function is called by the window server as soon as direct screen access
2575 This function should call CDirectScreenAccess::StartL() within a trap harness.
2576 If this leaves, e.g. through lack of memory, direct screen access cannot be
2577 restarted. StartL() re-calculates the clipping region, so that if direct screen
2578 access was aborted because another window appeared in front of it, that window
2579 will not be overwritten when direct screen access resumes.
2581 In this function, you can resume calls to Window Server Client Side API functions.
2583 @param aReason Provides the reason why direct screen access was terminated. */
2584 virtual void Restart(RDirectScreenAccess::TTerminationReasons aReason)=0;
2588 class CDirectScreenAccess : public CActive
2589 /** An active object used to start direct screen access.
2591 Direct screen access is a way of drawing to the screen without using the window
2592 server. As this avoids client-server communication, it is much faster, and
2593 may be useful for games and video. Note that some interaction with the window
2594 server is needed in order to prevent the application from drawing over other
2597 The object's (private) RunL() function is called by the window server in order
2598 to abort direct screen access. This might occur when another window needs
2599 to be displayed in front or when the window with direct screen access is moved.
2600 The active object's priority is RDirectScreenAccess::EPriorityVeryHigh so
2601 that direct screen access will be aborted as quickly as possible.
2607 IMPORT_C static CDirectScreenAccess* NewL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWin,MDirectScreenAccess& aAbort);
2608 IMPORT_C static CDirectScreenAccess* NewL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWin,MDirectScreenAccess& aAbort,TBool aRegionTrackingOnly);
2609 ~CDirectScreenAccess();
2610 IMPORT_C void StartL();
2611 inline CFbsBitGc* Gc();
2612 inline CFbsScreenDevice*& ScreenDevice();
2613 inline RRegion* DrawingRegion();
2617 EDirectCheckModeChange = 0x01,
2618 EDirectCheckSizeModeChange = 0x02,
2619 EDirectRegionTrackingOnly = 0x04,
2622 inline CDirectScreenAccess(RWsSession& aWs,CWsScreenDevice* aScreenDevice,RWindowBase& aWindow,MDirectScreenAccess& aAbort);
2623 void ConstructL(RWsSession& aWs,TBool aRegionTrackingOnly);
2624 void CreateScreenObjectsL(TDisplayMode aCurrentMode);
2625 void UpdateSizeAndRotation(CFbsBitGc* aGc);
2626 static TInt Restart(TAny* aDirect);
2628 //Pure virtual functions from CActive
2633 CFbsScreenDevice* iScreenDevice;
2634 RRegion* iDrawingRegion;
2635 RWindowBase& iWindow;
2636 CWsScreenDevice* iWsScreenDevice;
2637 MDirectScreenAccess& iAbort;
2638 RDirectScreenAccess iDirectAccess;
2639 RDirectScreenAccess::TTerminationReasons iReason;
2648 class RSoundPlugIn : public MWsClientClass
2649 /** Client interface to the key or pointer click plug-in DLL.
2651 The plug-in DLL implements the CClickMaker class.
2658 /** A possible return value for CommandReply(). */
2661 /** The value returned by CommandReply() if no plug-in is loaded,
2662 or if the plug-in identified by the aUid parameter in Construct() is not loaded.
2663 Its value is set to KMinTInt so that it should not clash with any other expected
2664 return value from this function. */
2665 ESoundWrongPlugIn=KMinTInt
2668 IMPORT_C RSoundPlugIn();
2669 IMPORT_C RSoundPlugIn(RWsSession &aWs);
2670 IMPORT_C TInt Construct(TUid aUid=KNullUid);
2671 IMPORT_C void Close();
2672 IMPORT_C void Destroy();
2673 IMPORT_C TBool IsLoaded(TBool& aIsChangeable) const;
2674 IMPORT_C TInt Unload();
2675 IMPORT_C TInt Load(const TDesC &aFileName);
2676 IMPORT_C void SetKeyClick(TBool aEnabled);
2677 IMPORT_C void SetPenClick(TBool aEnabled);
2678 IMPORT_C TBool KeyClickEnabled() const;
2679 IMPORT_C TBool PenClickEnabled() const;
2680 IMPORT_C TInt CommandReply(TInt aOpcode, const TPtrC8 &aArgs);
2683 inline TInt MWsClientClass::WsHandle() const
2684 /** Gets the server side handle for the object.
2686 @return The server-side handle for the object. */
2687 {return(iWsHandle);}
2689 inline const TAny* CWsScreenDevice::GetInterface(TUint aInterfaceId) const
2691 return const_cast<CWsScreenDevice*>(this)->GetInterface(aInterfaceId);
2694 inline TInt CWsScreenDevice::CreateContext(CWindowGc *&aGc)
2695 /** Creates a graphics context for this device.
2697 This function always causes a flush of the window server buffer.
2699 @param aGc On successful return, contains a new graphics context referring
2700 to this screen device.
2701 @return KErrNone if successful, otherwise one of the system-wide error codes.
2702 @see CGraphicsDevice::CreateContext() */
2703 {return(CreateContext((CGraphicsContext *&)aGc));}
2705 inline TUint TWsRedrawEvent::Handle() const
2706 /** Gets the handle of the window which is the target of the redraw event.
2708 This is the handle that was passed to the window's Construct() function: typically
2709 it will be a pointer to the object owning the window, providing access to
2710 its member functions.
2712 @return The window's handle. */
2715 inline TRect TWsRedrawEvent::Rect() const
2716 /** Gets the rectangle to redraw.
2718 @return The rectangle that needs redrawing. Co-ordinates are relative to
2719 the window whose handle is given by Handle(). */
2722 inline TWsEvent::TWsEvent()
2723 /** Constructor. Zero Initialise Data
2730 Mem::FillZ(iEventData,EWsEventDataSize);
2733 inline TAdvancedPointerEvent* TWsEvent::Pointer() const
2734 /** Gets the pointer event.
2736 This method can be used to get information about the pointer event if Type()
2737 returns an event of type EEventPointer or EEventDragDrop.
2739 If the event has been received by the window without advanced pointer events enabled,
2740 this method will return a pointer to TPointerEvent with additional fields of
2741 TAdvancedPointerEvent being cleared to 0.
2743 @return Structure containing advanced pointer event data.
2744 @see TPointerEvent::AdvancedPointerEvent()
2745 @see RWindowBase::EnableAdvancedPointers() */
2746 {return((TAdvancedPointerEvent *)&iEventData);}
2748 inline TInt TAdvancedPointerEvent::PointerNumber() const
2749 /** Gets the pointer number of the pointer whose state change is described by this event.
2751 As soon as the pointer (for example a finger) is detected by the device's sensors,
2752 it is assigned a pointer number. Then all events related to this pointer always
2753 use the same pointer number. When the device loses track of the pointer,
2754 TPointerEvent::EOutOfRange is sent with its pointer number and the number is released
2755 - from this time it may be re-used to identify another pointer coming into range.
2757 On a particular device, the pointer number is always an integer in the range 0 to
2758 HALData::EPointerNumberOfPointers - 1. If the device doesn't provide value for
2759 this attribute, it is assumed to be 1.
2761 Please note that in order to receive events from multiple pointers in a window, the method
2762 RWindowBase::EnableAdvancedPointers() has to be called for this window's instance
2763 before it is activated. Otherwise this window will only receive TPointerEvents from one
2764 emulated pointer, which will always have pointer number 0.
2766 @return Pointer number of the pointer whose state change is described by this event.
2767 @see RWindowBase::EnableAdvancedPointers()
2768 @see HALData::EPointerNumberOfPointers */
2770 return IsAdvancedPointerEvent() ? DoGetPointerNumber() : ENonAdvancedPointerPointerNumber;
2773 inline TInt TAdvancedPointerEvent::Proximity() const
2774 /** Gets the proximity of the pointer to the screen's surface.
2775 Proximity units may vary between devices and may be non-linear.
2776 Returned value will be a negative integer as the maximum supported proximity
2777 range in Symbian OS is from KMinTInt to 0, where KMinTInt means the highest
2778 proximity that Symbian OS can support and 0 means touching the screen.
2779 HALData attributes provide more information about proximity support on particular
2782 On platforms without pointer proximity support, proximity is always assumed to be 0.
2784 @return Proximity of the pointer to the screen's surface.
2785 @see TAdvancedPointerEvent::Position3D()
2786 @see TAdvancedPointerEvent::ProximityAndPressure()
2787 @see HALData::EPointer3DMaxProximity
2788 @see HALData::EPointer3DProximityStep */
2790 return IsAdvancedPointerEvent() ? DoGetProximity() : ENonAdvancedPointerZCoordinate;
2793 inline TInt TAdvancedPointerEvent::Pressure() const
2794 /** Gets the pressure applied by the pointer to the screen.
2795 Pressure units may vary between devices and may be non-linear.
2796 Returned value will be a positive integer as the maximum supported pressure range
2797 in Symbian OS is from 0 to KMaxTInt. HALData attributes provide more information
2798 about pressure support on particular device.
2800 On platforms without pointer pressure support, pressure is always assumed to be 0.
2802 @return Pressure applied by the pointer to the screen.
2803 @see TAdvancedPointerEvent::Pressure3D()
2804 @see TAdvancedPointerEvent::ProximityAndPressure()
2805 @see HALData::EPointer3DMaxPressure
2806 @see HALData::EPointer3DPressureStep */
2808 return IsAdvancedPointerEvent() ? DoGetPressure() : ENonAdvancedPointerZCoordinate;
2811 inline TInt TAdvancedPointerEvent::ProximityAndPressure() const
2812 /** Gets pressure applied by the pointer to the screen and proximity of the pointer
2813 to the screen as one value. This is possible because the pointer is never in proximity
2814 to the screen and pressing the screen at the same time.
2816 @return The value of proximity if the pointer is in proximity to the screen; proximity
2817 is always represented as negative TInt. The value of pressure if the pointer
2818 is touching the screen; pressure is always represented as positive TInt.
2819 @see TAdvancedPointerEvent::Proximity()
2820 @see TAdvancedPointerEvent::Pressure()
2821 @see TAdvancedPointerEvent::PositionAndPressure3D() */
2822 {return IsAdvancedPointerEvent() ? DoGetProximityAndPressure() : ENonAdvancedPointerZCoordinate;}
2824 inline TPoint3D TAdvancedPointerEvent::PositionAndPressure3D() const
2826 @return Pointer's X and Y coordinates plus combined proximity and pressure as
2828 @see TAdvancedPointerEvent::ProximityAndPressure() */
2831 point3D.iX=iPosition.iX;
2832 point3D.iY=iPosition.iY;
2833 point3D.iZ=ProximityAndPressure();
2837 inline TPoint3D TAdvancedPointerEvent::Position3D() const
2839 @return Pointer's X and Y coordinates plus pointer's proximity to the screen as
2840 Z coordinate. Please note that returned Z coordinate will be always negative or 0.
2841 @see TAdvancedPointerEvent::Proximity() */
2844 point3D.iX=iPosition.iX;
2845 point3D.iY=iPosition.iY;
2846 point3D.iZ=IsAdvancedPointerEvent() ? DoGetProximity() : ENonAdvancedPointerZCoordinate;
2850 inline TPoint3D TAdvancedPointerEvent::Pressure3D() const
2852 @return Pointer's X and Y coordinates plus pressure applied by the pointer to the screen
2854 @see TAdvancedPointerEvent::Pressure() */
2857 point3D.iX=iPosition.iX;
2858 point3D.iY=iPosition.iY;
2859 point3D.iZ=IsAdvancedPointerEvent() ? DoGetPressure() : ENonAdvancedPointerZCoordinate;
2863 inline TKeyEvent *TWsEvent::Key() const
2864 /** Gets the key event.
2866 This function can be used to get information about the key event if Type()
2867 returns an event of type EEventKey, EEventKeyUp or EEventKeyDown.
2869 @return Structure containing key event data */
2870 {return((TKeyEvent *)&iEventData);}
2872 inline TWsVisibilityChangedEvent* TWsEvent::VisibilityChanged()
2873 /** Gets information about the visibility changed event.
2875 This function can be used to get information about the visibility changed event
2876 if Type() returns an event of type EEventWindowVisibilityChanged.
2878 @return Structure containing visibility changed event data */
2879 { return reinterpret_cast<TWsVisibilityChangedEvent*>(iEventData); }
2881 inline const TWsVisibilityChangedEvent* TWsEvent::VisibilityChanged() const
2882 /** Gets information about the visibility changed event.
2884 This function can be used to get information about the visibility changed event
2885 if Type() returns an event of type EEventWindowVisibilityChanged.
2887 @return Structure containing visibility changed event data */
2888 { return reinterpret_cast<const TWsVisibilityChangedEvent*>(iEventData); }
2890 inline TWsDisplayChangedEvent* TWsEvent::DisplayChanged()
2891 /** Gets information about the display changed event.
2893 This function can be used to get information about the display changed event
2894 if Type() returns an event of type EEventDisplayChanged.
2896 @return Structure containing display changed event data */
2897 { return reinterpret_cast<TWsDisplayChangedEvent*>(iEventData); }
2899 inline const TWsDisplayChangedEvent* TWsEvent::DisplayChanged() const
2900 /** Gets information about the display changed event.
2902 This function can be used to get information about the display changed event
2903 if Type() returns an event of type EEventDisplayChanged.
2905 @return Structure containing display changed event data */
2906 { return reinterpret_cast<const TWsDisplayChangedEvent*>(iEventData); }
2908 inline TModifiersChangedEvent *TWsEvent::ModifiersChanged() const
2909 /** Gets information about the modifier changed event.
2911 This function can be used to get information about the modifier changed event
2912 if Type() returns an event of type EEventModifiersChanged.
2914 @return Structure containing modifier changed event data */
2915 {return((TModifiersChangedEvent *)&iEventData);}
2917 inline TWsErrorMessage *TWsEvent::ErrorMessage() const
2918 /** Gets an error event.
2920 This function can be used to get information about the error event if Type()
2921 returns an event of type EEventErrorMessage.
2923 @return The error event. */
2924 {return((TWsErrorMessage *)&iEventData);}
2926 inline TUint8 *TWsEvent::EventData() const
2927 /** Gets information about the event.
2929 This function gives you direct access to the event data as a whole. The event
2930 can be a key or pointer event or it could be a new special event that only
2931 you and another application know about. You are limited to EWsEventDataSize
2932 bytes worth of data.
2934 @return A pointer to the event data. */
2935 {return((TUint8 *)&iEventData);}
2937 inline TInt TWsEvent::Type() const
2938 /** Gets the type of event that occurred.
2940 @return The event type. Event types are defined in TEventCode. */
2943 inline TUint TWsEvent::Handle() const
2944 /** Gets the window handle.
2946 This is the handle that was passed to the window's Construct() function: typically
2947 it will be a pointer to the client-side object owning the window, providing
2948 access to its member functions.
2950 @return The window handle. */
2953 inline TTime TWsEvent::Time() const
2954 /** Gets the time when the event occurred.
2956 @return The time when the event occurred. */
2959 inline void TWsEvent::SetType(TInt aType)
2960 /** Sets the event type.
2962 @param aType The event type. Event types are defined in TEventCode. */
2965 inline void TWsEvent::SetHandle(TUint aHandle)
2966 /** Sets the event handle.
2968 This is the client handle of the window that is being sent the event.
2970 @param aHandle The event handle. */
2973 inline void TWsEvent::SetTimeNow()
2974 /** Sets the event time to the current time. */
2975 {iTime.UniversalTime();}
2977 inline TInt *TWsEvent::Int() const
2978 /** Gets the event data as a TInt.
2980 For TWsEvents of type EEventPointerEnter and EEventPointerExit this is the pointer number
2981 of the pointer that entered/exited the window. Please note that on platforms that
2982 use the older Symbian OS, without multipointer support, pointer number is not initialized
2983 for EEventPointerEnter and EEventPointerExit and thus it is random.
2985 If the value of the attribute returned from HALData::EPointerNumberOfPointers is greater than 1,
2986 then the system has multipointer support.
2988 @see HALData::EPointerNumberOfPointers
2989 @see HAL::Get(TAttribute,TInt&)
2991 { return (TInt*)&iEventData; }
2993 inline TUint TWsPriorityKeyEvent::Handle() const
2994 /** Gets the handle for the window group which added the priority key.
2996 This is the handle that was passed to the window group's Construct() function.
2997 Since most applications have only one window group, however, this function
3000 @return The window group handle. */
3003 inline TKeyEvent *TWsPriorityKeyEvent::Key() const
3004 /** Gets the priority key event.
3006 @return Structure containing priority key event data */
3007 {return((TKeyEvent *)&iEventData);}
3009 inline void TWsPriorityKeyEvent::SetHandle(TUint aHandle)
3010 /** Sets the window group event handle.
3012 This is the client handle of the window that is being sent the event.
3014 @param aHandle The event handle. */
3017 inline CDirectScreenAccess::CDirectScreenAccess(RWsSession& aWs,CWsScreenDevice* aScreenDevice,RWindowBase& aWindow,MDirectScreenAccess& aAbort)
3018 :CActive(RDirectScreenAccess::EPriorityVeryHigh), iWindow(aWindow), iAbort(aAbort), iDirectAccess(aWs)
3019 {iWsScreenDevice=aScreenDevice;}
3021 inline CFbsBitGc* CDirectScreenAccess::Gc()
3022 /** Gets the graphics context for drawing to the screen.
3024 This is set up by calling StartL(). Its origin is set so that you should use
3025 window coordinates to specify which part of the screen to draw to and its
3026 clipping region is set to the visible part of the window.
3028 Code built to run on the Emulator must call CFbsScreenDevice::Update() in
3029 order to see the results of drawing to this graphics context, but this may
3030 not be required on all target hardware.
3032 @return The graphics context for drawing to the screen. */
3035 inline CFbsScreenDevice*& CDirectScreenAccess::ScreenDevice()
3036 /** Gets the screen device to draw to.
3038 You should not use this screen device to create fonts because the object is
3039 deleted and recreated when direct screen access is aborted and restarted.
3040 Instead, create and use your own CFbsScreenDevice object to create fonts.
3042 @return The target screen device. */
3043 { return iScreenDevice; }
3045 inline RRegion* CDirectScreenAccess::DrawingRegion()
3046 /** Gets the clipping region to draw to.
3048 You must not draw outside of this region.
3050 The clipping region is calculated when StartL() is called, and is only updated
3051 if StartL() is called again.
3053 The region is specified in screen coordinates. This can be useful if you need
3054 to reapply the clipping region to the graphics context (CFbsBitGc::SetClippingRegion()).
3056 @return The clipping region to draw to. */
3057 { return iDrawingRegion; }
3059 #endif //__W32STD_H__