1.1 --- a/epoc32/include/w32std.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/w32std.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,2967 @@
1.4 -w32std.h
1.5 +// Copyright (c) 1994-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +// Standard window server header file
1.19 +//
1.20 +//
1.21 +
1.22 +#ifndef __W32STD_H__
1.23 +#define __W32STD_H__
1.24 +
1.25 +#ifndef __FNTSTORE_H__
1.26 +#include <fntstore.h>
1.27 +#endif
1.28 +#ifndef __BITDEV_H__
1.29 +#include <bitdev.h>
1.30 +#endif
1.31 +#ifndef __BITSTD_H__
1.32 +#include <bitstd.h>
1.33 +#endif
1.34 +
1.35 +_LIT(KWSERVThreadName,"Wserv");
1.36 +
1.37 +/**
1.38 +@internalAll
1.39 +*/
1.40 +_LIT(KWSERVServerName,"!Windowserver");
1.41 +
1.42 +class RWindowBase;
1.43 +class RWindow;
1.44 +class RWsBuffer;
1.45 +class MWsObjectProvider;
1.46 +
1.47 +/** Used for testing purpose.
1.48 +
1.49 +@internalComponent
1.50 +@released
1.51 +*/
1.52 +class TSizeMode
1.53 + {
1.54 +public:
1.55 + inline TSizeMode(){}
1.56 + inline TSizeMode(TSize& aSize);
1.57 + static inline TInt ScaledCord(TInt aOrigin,TInt aScale);
1.58 + inline TPoint ScaledOrigin();
1.59 +public:
1.60 + CFbsBitGc::TGraphicsOrientation iRotation;
1.61 + TPoint iOrigin;
1.62 + TSize iScreenSize;
1.63 + TSize iScreenTwipsSize;
1.64 + TUint iAlternativeRotations;
1.65 + TRect iPointerCursorArea;
1.66 + TSize iScreenScale;
1.67 + TDisplayMode iDefaultDisplayMode;
1.68 + };
1.69 +
1.70 +/** Screen mode enforcement flags.
1.71 +
1.72 +Screen mode enforcement ensures that windows must meet certain requirements
1.73 +if they are to be displayed. When the screen mode changes, window groups that
1.74 +are incorrectly set up, according to these requirements, are locked out. The
1.75 +windows are notified of the change, and will be displayed if they are updated
1.76 +(according to the current enforcement requirement) to match the new screen
1.77 +mode.
1.78 +
1.79 +@publishedAll
1.80 +@released
1.81 +@see CWsScreenDevice::ScreenModeEnforcement()
1.82 +@see CWsScreenDevice::SetScreenModeEnforcement() */
1.83 +enum TScreenModeEnforcement
1.84 + {
1.85 + /** No enforcement.
1.86 +
1.87 + All windows that are the children of window groups will be displayed, irrespective
1.88 + of the screen mode.
1.89 +
1.90 + This is not properly supported and is provided for testing purposes. */
1.91 + ESizeEnforcementNone,
1.92 + /** Pixels and rotation enforcement.
1.93 +
1.94 + Group windows must be set up for the correct rotation and be working in the
1.95 + correct size in pixels to be displayed. */
1.96 + ESizeEnforcementPixelsAndRotation,
1.97 + /** Pixels and Twips enforcement.
1.98 +
1.99 + Group windows must have the correct rotation and be working in the correct
1.100 + size in pixels and twips to be displayed.
1.101 +
1.102 + This setting might be used if the display pixels are not square, and would
1.103 + distort fonts when rotated. */
1.104 + ESizeEnforcementPixelsTwipsAndRotation,
1.105 + };
1.106 +
1.107 +struct TPixelsAndRotation
1.108 +/** Pixels and rotation struct.
1.109 +
1.110 +This is used to define a particular screen mode's screen size in pixels,
1.111 +and its rotation.
1.112 +
1.113 +@publishedAll
1.114 +@released
1.115 +@see CWsScreenDevice::GetScreenModeSizeAndRotation() */
1.116 + {
1.117 + /** The screen size, for a given screen mode, in pixels. */
1.118 + TSize iPixelSize;
1.119 + /** The current screen orientation. */
1.120 + CFbsBitGc::TGraphicsOrientation iRotation;
1.121 + };
1.122 +
1.123 +struct TPixelsTwipsAndRotation
1.124 +/** Pixels, twips and rotation struct.
1.125 +
1.126 +This is used to define a particular screen mode's screen size in twips
1.127 +and pixels, and its rotation.
1.128 +
1.129 +@publishedAll
1.130 +@released
1.131 +@see CWsScreenDevice::GetScreenModeSizeAndRotation() */
1.132 + {
1.133 + /** The screen size, for a given screen mode, in pixels. */
1.134 + TSize iPixelSize;
1.135 + /** The screen size, for a given screen mode, in twips. */
1.136 + TSize iTwipsSize;
1.137 + /** The screen rotation. */
1.138 + CFbsBitGc::TGraphicsOrientation iRotation;
1.139 + };
1.140 +
1.141 +/** Log message text length.
1.142 +
1.143 +This defines the length of the log text message buffer TLogMessageText,
1.144 +which is used in RWsSession::LogMessage().
1.145 +
1.146 +@publishedAll
1.147 +@released */
1.148 +enum {
1.149 + /** The length of the log message text buffer in characters. */
1.150 + KLogMessageLength=0x80
1.151 + };
1.152 +
1.153 +/** Log message text buffer.
1.154 +
1.155 +This is used in RWsSession::LogMessage().
1.156 +
1.157 +@publishedAll
1.158 +@released */
1.159 +typedef TBuf<KLogMessageLength> TLogMessageText;
1.160 +
1.161 +/** Password window group priority.
1.162 +
1.163 +This priority is assigned to the password window group when the window server is displaying the password window.
1.164 +This is the highest priority, which ensures that the machine password window is in front of all other windows -
1.165 +hence password tests cannot be bypassed.
1.166 +
1.167 +@publishedAll
1.168 +@deprecated */
1.169 +enum
1.170 + {
1.171 + /** Password window group priority. */
1.172 + KPasswordWindowGroupPriority=1000
1.173 + };
1.174 +
1.175 +/** Switch ordinal position to owning window.
1.176 +
1.177 +This enum can be specified as the 2nd parameter to RWsSession::SetWindowGroupOrdinalPosition()
1.178 +or as the 1st parameter to RWindowTreeNode::SetOrdinalPosition() (if this is being called on an
1.179 +RWindowGroup).
1.180 +
1.181 +When called with this value, the functions don't change the ordinal position of the group window
1.182 +in question, but rather bring to the front the window that would come to the front if that group
1.183 +window were to die with keyboard focus.
1.184 +
1.185 +@publishedAll
1.186 +@released
1.187 +@see RWsSession::SetWindowGroupOrdinalPosition()
1.188 +@see RWindowTreeNode::SetOrdinalPosition() */
1.189 +enum {
1.190 + /** Switch ordinal position to owning window. */
1.191 + KOrdinalPositionSwitchToOwningWindow=0x80000000
1.192 + };
1.193 +
1.194 +/** Window corner types.
1.195 +
1.196 +Corners may be specified square or stepped, with varying numbers of pixels
1.197 +removed to make the stepping. Picturing a corner as the top left corner of
1.198 +a window, the numbers denote the number of pixels removed from the top row
1.199 +to give corners.
1.200 +
1.201 +@publishedAll
1.202 +@released
1.203 +@see TCornerFlags
1.204 +@see RWindowBase::SetCornerType() */
1.205 +enum TCornerType
1.206 +// Bottom 16 bits available for corner type
1.207 + {
1.208 + /** Square corner. */
1.209 + EWindowCornerSquare,
1.210 + /** Corner pixel removed. */
1.211 + EWindowCorner1,
1.212 + /** Two pixel step.
1.213 +
1.214 + 3 pixels are removed: the corner pixel and a single pixel from each side. */
1.215 + EWindowCorner2,
1.216 + /** Three pixel step.
1.217 +
1.218 + 5 pixels are removed: the corner pixel, the two pixels next to it and the
1.219 + 2 pixels above or below it. */
1.220 + EWindowCorner3,
1.221 + /** Five pixel step.
1.222 +
1.223 + 12 pixels are removed: the corner pixel, the four pixels next to it, the
1.224 + four pixels above or below it, the pixel which was diagonal to the corner
1.225 + pixel, and the pixels to both sides of that pixel. */
1.226 + EWindowCorner5,
1.227 + EWindowCornerRegion, // Private
1.228 + /** Corner type mask.
1.229 +
1.230 + This value is used by the window server, and may be used by developers, to
1.231 + separate TCornerType and TCornerFlags values from a TInt which contains both
1.232 + types. */
1.233 + ECornerTypeMask=0xFFFF
1.234 + };
1.235 +
1.236 +/** Corner flags.
1.237 +
1.238 +These are used by RWindowBase::SetCornerType() to set which corners of a window
1.239 +are not to have corner types applied to them.
1.240 +
1.241 +@publishedAll
1.242 +@released
1.243 +@see TCornerType */
1.244 +enum TCornerFlags
1.245 +// Top 16 bits available for corner flags
1.246 + {
1.247 + /** Do not apply corner shape to top left corner. */
1.248 + EWindowCornerNotTL=0x10000,
1.249 + /** Do not apply corner shape to top right corner. */
1.250 + EWindowCornerNotTR=0x20000,
1.251 + /** Do not apply corner shape to bottom left corner. */
1.252 + EWindowCornerNotBL=0x40000,
1.253 + /** Do not apply corner shape to bottom right corner. */
1.254 + EWindowCornerNotBR=0x80000,
1.255 + };
1.256 +
1.257 +/** Window backup type flags.
1.258 +
1.259 +@publishedAll
1.260 +@released
1.261 +@see RWindowBase::EnableBackup() */
1.262 +enum TWindowBackupType
1.263 + {
1.264 + /** Backup the area behind the current window only.
1.265 +
1.266 + This is the default behaviour for the RWindowBase::EnableBackup() function. */
1.267 + EWindowBackupAreaBehind=0x0001,
1.268 + /** Backup the entire screen.
1.269 +
1.270 + This is provided for windows that require the rest
1.271 + of the screen to fade when they are displayed. When the rest of the screen
1.272 + should become unfaded, the window server redraws the whole screen from the
1.273 + backed up bitmap. */
1.274 + EWindowBackupFullScreen=0x0002,
1.275 + };
1.276 +
1.277 +/** Types of standard events.
1.278 +
1.279 +These are events that the window server passes to its clients, as opposed
1.280 +to events that the base passes to the window server.
1.281 +
1.282 +@publishedAll
1.283 +@released
1.284 +@see CClickMaker */
1.285 +enum TEventCode
1.286 + {
1.287 + /** Null event.
1.288 +
1.289 + This can be sent, but should be ignored by clients. */
1.290 + EEventNull,
1.291 + /** Key event.
1.292 +
1.293 + This is the event that is sent when a character has been received from the
1.294 + keyboard.
1.295 +
1.296 + If an EEventKey event is associated with an EEventKeyDown or EEventKeyUp
1.297 + event (typically EEventKeyDown), the EEventKey event occurs after the
1.298 + EEventKeyDown/EEventKeyUp event.
1.299 +
1.300 + In practice, the only keys potentially likely to have their EEventKey event
1.301 + generated on the up rather than the down are modifier keys. */
1.302 + EEventKey,
1.303 + /** Key up event.
1.304 +
1.305 + If an EEventKey event is associated with an EEventKeyUp event (which is
1.306 + rarely the case), the EEventKey event occurs after the EEventKeyUp event. */
1.307 + EEventKeyUp,
1.308 + /** Key down event.
1.309 +
1.310 + If an EEventKey event is associated with an EEventKeyDown event (which
1.311 + is typically the case), the EEventKey event occurs after the EEventKeyDown event. */
1.312 + EEventKeyDown,
1.313 + /** Modifier changed event.
1.314 +
1.315 + This is an event generated by the window server when
1.316 + the state of one of the modifier keys changes.
1.317 + It is not reported unless explicitly requested by a window.
1.318 +
1.319 + @see RWindowTreeNode::EnableModifierChangedEvents(). */
1.320 + EEventModifiersChanged,
1.321 + /** Pointer event.
1.322 +
1.323 + This event is sent when the user presses or releases a pointer button (or
1.324 + the equivalent action, depending on the type of pointing device), drags the
1.325 + pointer, or uses the pointer to switch on the device. If the current input
1.326 + type (see TXYInputType) is "mouse" or "relative mouse", i.e. it generates
1.327 + pointer move events as well as drag events, then this event type is also
1.328 + generated whenever the pointer is moved. */
1.329 + EEventPointer, //5
1.330 + /** Pointer enter event.
1.331 +
1.332 + This occurs when the user moves the pointer into a window with a pointer button
1.333 + pressed (or equivalent action depending on the type of pointing device). If
1.334 + move events are being generated, this event also occurs when the user moves
1.335 + the pointer into the window. */
1.336 + EEventPointerEnter,
1.337 + /** Pointer exit event.
1.338 +
1.339 + Occurs when the user moves the pointer out of a window with a pointer button
1.340 + pressed (or equivalent action depending on the type of pointing device). If
1.341 + move events are being generated, this event also occurs when the user moves
1.342 + the pointer out of the window. */
1.343 + EEventPointerExit,
1.344 + /** Pointer move buffer ready event.
1.345 +
1.346 + Occurs when the pointer move buffer is ready to be retrieved by the client. */
1.347 + EEventPointerBufferReady,
1.348 + /** Occurs as a duplicate of each pointer event if a window sets pointer capture
1.349 + with the TCaptureFlagDragDrop flag set. */
1.350 + EEventDragDrop,
1.351 + /** Focus lost event.
1.352 +
1.353 + Occurs when a window group loses keyboard focus. */
1.354 + EEventFocusLost, //10
1.355 + /** Focus gained event.
1.356 +
1.357 + Occurs when a window group gains keyboard focus. */
1.358 + EEventFocusGained,
1.359 + /** On event.
1.360 +
1.361 + This event type is not reported unless explicitly requested by a window.
1.362 +
1.363 + @see RWindowTreeNode::EnableOnEvents(). */
1.364 + EEventSwitchOn,
1.365 + /** Password event.
1.366 +
1.367 + Occurs when the window server enters password mode. It is sent to the group
1.368 + window of the currently active password window.
1.369 +
1.370 + This is the window server mode where the user is required to enter a password
1.371 + before any further actions can be performed.
1.372 +
1.373 + @deprecated */
1.374 + EEventPassword,
1.375 + /** Window group changed event. This occurs whenever a window group is destroyed,
1.376 + and whenever a window group's name changes
1.377 +
1.378 + This event type is not reported unless explicitly requested by a window.
1.379 +
1.380 + @see RWindowTreeNode::EnableGroupChangeEvents(). */
1.381 + EEventWindowGroupsChanged,
1.382 + /** Error event.
1.383 +
1.384 + Occurs when an error occurs. See TWsErrorMessage::TErrorCategory for the types
1.385 + of errors.
1.386 +
1.387 + This event type is not reported unless explicitly requested by a window.
1.388 +
1.389 + @see RWindowTreeNode::EnableErrorMessages(). */
1.390 + EEventErrorMessage, //15
1.391 + /** Message ready event.
1.392 +
1.393 + Occurs when a session sends a message to this window group using RWsSession::SendMessageToWindowGroup(). */
1.394 + EEventMessageReady,
1.395 + EEventMarkInvalid, // For internal use only
1.396 + /** Off event.
1.397 +
1.398 + This is issued when an off event is received by the window server from the
1.399 + base.
1.400 +
1.401 + If for some reason the event can't be delivered, or there is no-one to deliver
1.402 + it to, then a call to the base is made to power down the processor.
1.403 +
1.404 + This event is only delivered if explicitly requested using RWsSession:RequestOffEvent(). */
1.405 + EEventSwitchOff,
1.406 + /** Event issued to off-event requesting windows when the off key is pressed. */
1.407 + EEventKeySwitchOff,
1.408 + /** Screen size mode change event.
1.409 +
1.410 + This is issued when the screen size mode has changed, for instance when
1.411 + the cover on a phone that supports screen flipping is opened or closed. */
1.412 + EEventScreenDeviceChanged, //20
1.413 + /** Event sent whenever the window group with focus changes.
1.414 +
1.415 + Requested by RWindowTreeNode::EnableFocusChangeEvents(). */
1.416 + EEventFocusGroupChanged,
1.417 + /** Case opened event.
1.418 +
1.419 + This event is sent to those windows that have requested EEventSwitchOn
1.420 + events. Unlike with EEventSwitchOn events, the screen will not be switched
1.421 + on first. */
1.422 + EEventCaseOpened,
1.423 + /** Case closed event.
1.424 +
1.425 + This event is sent to those windows that have requested EEventSwitchOff
1.426 + events.
1.427 +
1.428 + Unlike EEventSwitchOff events, which make a call to the base to power down
1.429 + the processor if for some reason the event can't be delivered (or there is
1.430 + no-one to deliver it to), failure to deliver case closed events has no repercussions. */
1.431 + EEventCaseClosed,
1.432 + /** Window group list change event.
1.433 +
1.434 + The window group list is a list of all window groups and their z-order. This
1.435 + event indicates any change in the window group list: additions, removals and
1.436 + reorderings.
1.437 +
1.438 + Notification of this event is requested by calling RWindowTreeNode::EnableGroupListChangeEvents(). */
1.439 + EEventWindowGroupListChanged,
1.440 + /** The visibility of a window has changed
1.441 +
1.442 + This is sent to windows when they change from visible to invisible, or visa versa, usually due
1.443 + to another window obscuring them.
1.444 +
1.445 + Notification of this event is requested by calling RWindowTreeNode::EnableVisibilityChangeEvents(). */
1.446 + EEventWindowVisibilityChanged,
1.447 +#ifdef SYMBIAN_PROCESS_MONITORING_AND_STARTUP
1.448 + /** Restart event.
1.449 +
1.450 + This is issued when an restart event is received by the window server from the
1.451 + base. This event is also an off event, because it might power-cycle the device.
1.452 +
1.453 + If for some reason the event can't be delivered, or there is no-one to deliver
1.454 + it to, then a call to the base is made to power down the processor.
1.455 +
1.456 + This event is only delivered if explicitly requested using RWsSession:RequestOffEvent(). */
1.457 + EEventRestartSystem,
1.458 +#endif
1.459 + //Codes for events only passed into Key Click DLL's
1.460 + /** Repeating key event.
1.461 +
1.462 + This is only sent to a key click plug-in DLL (if one is present) to indicate
1.463 + a repeating key event.
1.464 +
1.465 + @see CClickMaker */
1.466 + EEventKeyRepeat=100,
1.467 + EEventGroupWindowOpen,
1.468 + EEventGroupWindowClose,
1.469 + EEventWindowClose,
1.470 + //Codes for events only passed into anim dlls
1.471 + /** Direct screen access begin
1.472 + This is only sent to anim dlls (if they register to be notified). It indicates that
1.473 + the number of direct screen access sessions has increased from zero to one.*/
1.474 + EEventDirectScreenAccessBegin=200,
1.475 + /** Direct screen access end
1.476 + This is only sent to anim dlls (if they register to be notified). It indicates that
1.477 + the number of direct screen access sessions has decreased from one to zero.*/
1.478 + EEventDirectScreenAccessEnd,
1.479 + /** Event to signal the starting or stopping of the wserv heartbeat timer
1.480 + This is only sent to anim dlls (if they register to be notified). */
1.481 + EEventHeartbeatTimerStateChange,
1.482 +
1.483 + //The range 900-999 is reserved for UI Framework events
1.484 + /** 900-909 WSERV protects with PowerMgmt */
1.485 + EEventPowerMgmt = 900,
1.486 + EEventReserved = 910,
1.487 +
1.488 + //Event codes from EEventUser upwards may be used for non-wserv events.
1.489 + //No event codes below this should be defined except by the window server
1.490 +
1.491 + /** User defined event.
1.492 +
1.493 + The client can use this and all higher values to define their own
1.494 + events. These events can be sent between windows of the same client or windows
1.495 + of different clients.
1.496 +
1.497 + @see RWs::SendEventToWindowGroup(). */
1.498 + EEventUser=1000,
1.499 +
1.500 + };
1.501 +
1.502 +
1.503 +/** Window server hot keys.
1.504 +
1.505 +@publishedAll
1.506 +@released
1.507 +@see RWsSession::SetHotKey() */
1.508 +enum THotKey
1.509 + {
1.510 + /** Enables logging of all messages to and from the window server.
1.511 +
1.512 + Note that the required type of logging must have been specified in the wsini.ini
1.513 + file (using the LOG keyword), and the appropriate logging DLL must be available.
1.514 +
1.515 + Default key mapping: \<Ctrl\>\<Alt\>\<Shift\>E */
1.516 + EHotKeyEnableLogging,
1.517 + /** Always disables window server logging, if active. Does nothing otherwise.
1.518 +
1.519 + Default key mapping: \<Ctrl\>\<Alt\>\<Shift\>D */
1.520 + EHotKeyDisableLogging,
1.521 + /** Dumps a list of all windows to the log. (If logging is disabled, it is temporarily
1.522 + enabled in order to do this.)
1.523 +
1.524 + Default key mapping: \<Ctrl\>\<Alt\>\<Shift\>W */
1.525 + EHotKeyStateDump,
1.526 + /** Kills the foreground application.
1.527 +
1.528 + Default key mapping: \<Ctrl\>\<Alt\>\<Shift\>K */
1.529 + EHotKeyOfDeath,
1.530 + /** Shuts down the window server.
1.531 +
1.532 + Be cautious! This may mean resetting the machine to re-start the window server.
1.533 +
1.534 + Default key mapping: release (not available), debug (\<Ctrl\>\<Alt\>\<Shift\>X). */
1.535 + EHotKeyShutDown,
1.536 + /** Dumps a list of cells allocated on the window server's heap to the log. (If
1.537 + logging is disabled, it is temporarily enabled in order to do this.)
1.538 +
1.539 + Note that logging requires that the type of logging has been set up in the
1.540 + wsini.ini file, and that the appropriate logging DLL is available.
1.541 +
1.542 + Default key mapping: \<Ctrl\>\<Alt\>\<Shift\>H */
1.543 + EHotKeyHeapDump,
1.544 + /** Increases the LCD contrast.
1.545 +
1.546 + Default key mapping: EKeyIncContrast. Note that this value is from an enum
1.547 + in e32keys.h. The contrast wraps around when it reaches the maximum. */
1.548 + EHotKeyIncContrast,
1.549 + /** Decreases the LCD contrast.
1.550 +
1.551 + Default key mapping: EKeyDecContrast. Note that this value is from an enum
1.552 + in e32keys.h. The contrast wraps around when it reaches the minimum. */
1.553 + EHotKeyDecContrast,
1.554 + /** Switches the machine off.
1.555 +
1.556 + Default key mapping: EKeyOff. Note that this value is from an enum in e32keys.h. */
1.557 + EHotKeyOff,
1.558 + /** Switches the backlight on.
1.559 +
1.560 + Default key mapping: EKeyBacklightOn. Note that this value is from an enum
1.561 + in e32keys.h. */
1.562 + EHotKeyBacklightOn,
1.563 + /** Switches the backlight off.
1.564 +
1.565 + Default key mapping: EKeyBacklightOff. Note that this value is from an enum
1.566 + in e32keys.h. */
1.567 + EHotKeyBacklightOff,
1.568 + /** Toggles the backlight.
1.569 +
1.570 + Default key mapping: EKeyBacklightToggle. Note that this value is from an
1.571 + enum in e32keys.h. */
1.572 + EHotKeyBacklightToggle,
1.573 + /** Switches to screen size 0.
1.574 +
1.575 + This, and the following 3 keys are used to switch screen sizes on real hardware,
1.576 + for instance when the cover is closed on a phone that supports screen flipping. */
1.577 + EHotKeyScreenDimension0,
1.578 + /** Switches to screen size 1.
1.579 +
1.580 + This might be generated when the cover is opened on a phone that supports screen
1.581 + flipping. */
1.582 + EHotKeyScreenDimension1,
1.583 + /** Switches to screen size 2. */
1.584 + EHotKeyScreenDimension2,
1.585 + /** Switches to screen size 3. */
1.586 + EHotKeyScreenDimension3,
1.587 + /** Cycles the display though its possible sizes.
1.588 +
1.589 + This is used only for debugging.
1.590 +
1.591 + A device may have several screen sizes, each with a default orientation. For
1.592 + example a phone that supports screen flipping will have different display
1.593 + sizes when the cover is opened and closed.
1.594 +
1.595 + Default key mapping: debug : \<Ctrl\>\<Alt\>\<Shift\> U. Release : none. */
1.596 + EHotKeyCycleDisplaySize,
1.597 + /** Cycles the screen orientation through the specified rotations for the particular
1.598 + size mode you are in.
1.599 +
1.600 + For example, phones that support screen flipping may
1.601 + use this feature for changing between right and left handed use.
1.602 +
1.603 + For rectangular display modes you can only specify 2 orientations, 180 degrees
1.604 + apart. For square modes you can specify 4 rotations (90 degrees) or however
1.605 + many you want.
1.606 +
1.607 + Specification of the list of rotations takes place in the WSINI.INI file.
1.608 +
1.609 + Default key mapping: debug : \<Ctrl\>\<Alt\>\<Shift\> O. Release : none. */
1.610 + EHotKeyCycleOrientation,
1.611 + /** Increases the screen's brightness.
1.612 +
1.613 + The brightness wraps around to the minimum
1.614 + value after it has reached the maximum. */
1.615 + EHotKeyIncBrightness,
1.616 + /** Decreases the screen's brightness.
1.617 +
1.618 + The brightness wraps around to the maximum value after it has reached the minimum. */
1.619 + EHotKeyDecBrightness,
1.620 +
1.621 + /** Cycle focus screen from one to another in multiple screen environment. Start
1.622 + from current focused screen, switch to next the screen, and wraps around when it
1.623 + reaches the last screen.
1.624 +
1.625 + Default key mapping: \<Ctrl\>\<Alt\>\<Shift\> I. */
1.626 + EHotKeyCycleFocusScreen,
1.627 +
1.628 + /** Value for first hot key.
1.629 +
1.630 + Used with EHotKeyLastKeyType to make it easy to write a for loop that steps
1.631 + through all the different key values. */
1.632 + EHotKeyFirstKeyType=EHotKeyEnableLogging, //Must always be set to the first one
1.633 + /** Value for last hot key.
1.634 +
1.635 + Used with EHotKeyFirstKeyType to make it easy to write a for loop that steps
1.636 + through all the different key values. */
1.637 + EHotKeyLastKeyType=EHotKeyCycleFocusScreen, //Must always be set to the last one
1.638 + };
1.639 +
1.640 +
1.641 +/** Password mode flags.
1.642 +
1.643 +@publishedAll
1.644 +@deprecated */
1.645 +enum TPasswordMode
1.646 + {
1.647 + /** Releases ownership of password handling.
1.648 +
1.649 + This allows another window to become the password window. A client will be
1.650 + panicked with code 46 if it sets this mode when it is not the current password
1.651 + window. */
1.652 + EPasswordCancel,
1.653 + /** No password handling is performed by this window, but no other window
1.654 + can become the password window. */
1.655 + EPasswordNone,
1.656 + /** Password mode is enabled only once a day.
1.657 +
1.658 + When enabled, password mode requires the user to enter a password
1.659 + before any further actions can be performed. */
1.660 + EPasswordOnceADay,
1.661 + /** Password mode is enabled every time the machine is switched on. */
1.662 + EPasswordAlways,
1.663 + /** Equivalent to setting the password mode to EPasswordAlways and triggering an
1.664 + instant password check. */
1.665 + EPasswordAlwaysTriggerNow,
1.666 + /** Equivalent to setting the password mode to EPasswordOnceADay and triggering
1.667 + an instant password check. */
1.668 + EPasswordOnceADayTriggerNow,
1.669 + };
1.670 +struct TTextCursor
1.671 +/** Text cursor parameter information.
1.672 +
1.673 +A text cursor is a rectangular area which can be set to flash. It is normally
1.674 +only visible when the window group which owns it has the keyboard focus. This
1.675 +structure is used to define the parameters of a text cursor, which can be
1.676 +selected for use through the window group using RWindowGroup::SetTextCursor().
1.677 +
1.678 +Custom (non-rectangular) text cursors are supported from v7.0s. They are added
1.679 +to the window server using RWsSession::SetCustomTextCursor(), after which
1.680 +they can be selected for use through the window group, in the same way as
1.681 +standard rectangular cursors. They have a unique identifier, stored in the
1.682 +iType member, which must be greater than ETypeLastBasic. Custom text cursors
1.683 +are clipped to their iHeight and iWidth values. Their iColour member is not
1.684 +used.
1.685 +
1.686 +@publishedAll
1.687 +@released */
1.688 + {
1.689 + // The different normal text cursors
1.690 + // A Text cursor can either be a predefined one
1.691 + // or a general sprite. Cursors between ETypeFirst
1.692 + // and ETypeLastBasic are predefined ones (even though
1.693 + // the ones above ETypeLast do not exist and are
1.694 + // for future use)
1.695 + /** Cursor type values.
1.696 +
1.697 + The values between ETypeFirst and ETypeLastBasic are reserved for predefined
1.698 + cursors. Custom text cursors must have a value greater than ETypeLastBasic.
1.699 +
1.700 + The values not listed below are for internal use only. */
1.701 + enum ENamedCursors
1.702 + {
1.703 + /** @internalAll */
1.704 + ETypeNone,
1.705 + /** Standard filled rectangular cursor. */
1.706 + ETypeRectangle,
1.707 + /** Standard hollow rectangular cursor. */
1.708 + ETypeHollowRectangle,
1.709 + /** The first predefined cursor type.
1.710 +
1.711 + Equivalent to ETypeRectangle. This can be used for iterating through the predefined
1.712 + cursor types. */
1.713 + ETypeFirst=ETypeRectangle,
1.714 + /** The last predefined cursor type.
1.715 +
1.716 + Equivalent to ETypeHollowRectangle. This can be used for iterating through
1.717 + the predefined cursor types. */
1.718 + ETypeLast=ETypeHollowRectangle,
1.719 + /** Reserved for future use.
1.720 +
1.721 + All custom text cursors must have a type value greater than this. */
1.722 + ETypeLastBasic = 1000,
1.723 + };
1.724 + /** Added for compatibility with previous releases. */
1.725 + typedef TInt EType;
1.726 + /** Cursor flash and clipping flags.
1.727 +
1.728 + The flags not listed below are for internal use only. */
1.729 + enum EFlags
1.730 + {
1.731 + /** The text cursor should not flash. */
1.732 + EFlagNoFlash = 0x00000001,
1.733 + /** The bitmap of each sprite member is clipped left of its x-origin and right of
1.734 + its x-origin plus iWidth.
1.735 +
1.736 + Used for custom text cursors only. */
1.737 + EFlagClipHorizontal = 0x00000002,
1.738 + /** The bitmap of each sprite member is clipped vertically.
1.739 +
1.740 + How it is clipped depends on the text cursor's vertical alignment, see the
1.741 + TCustomTextCursorAlignment enum in class RWsSession.
1.742 +
1.743 + Used for custom text cursors only. */
1.744 + EFlagClipVertical = 0x00000004,
1.745 + /** @internalComponent */
1.746 + EUserFlags = 0x0000FFFF,
1.747 + /** @internalComponent */
1.748 + EFlagClipped = 0x00010000,
1.749 + /** @internalComponent */
1.750 + EPrivateFlags = 0xFFFF0000,
1.751 + };
1.752 + /** The cursor type.
1.753 +
1.754 + For possible values, see the ENamedCursors enum. */
1.755 + TInt iType;
1.756 + /** The height of the text cursor.
1.757 +
1.758 + This value is also used for clipping custom text cursors, if the EFlagClipVertical
1.759 + flag is set. */
1.760 + TInt iHeight;
1.761 + /** The ascent of the text cursor (the distance between the origin and the top). */
1.762 + TInt iAscent;
1.763 + /** The width of the text cursor.
1.764 +
1.765 + Custom text cursors are clipped to this value, if the EFlagClipHorizontal
1.766 + flag is set. */
1.767 + TInt iWidth;
1.768 + /** Cursor flash and clipping flags.
1.769 +
1.770 + For possible values, see the EFlags enum. */
1.771 + TUint iFlags;
1.772 + /** The colour of the text cursor.
1.773 +
1.774 + If the cursor is flashing, this colour is XOR'd with the screen.
1.775 +
1.776 + This value is not used for custom text cursors. */
1.777 + TRgb iColor;
1.778 + };
1.779 +
1.780 +/** Sprite flags.
1.781 +
1.782 +These can be combined using a bit-wise OR operation.
1.783 +
1.784 +@publishedAll
1.785 +@released
1.786 +@see RWsPointerCursor::Construct()
1.787 +@see RWsSprite::Construct() */
1.788 +enum TSpriteFlags
1.789 + {
1.790 + /** Flash sprite on and off.
1.791 +
1.792 + All flashing is done on the same timer, including the text cursor. */
1.793 + ESpriteFlash=0x1,
1.794 + /** With this flag set, the sprite is displayed over the window and all its children.
1.795 +
1.796 + Without the flag, the sprite is only displayed over the window's visible area.
1.797 +
1.798 + This is particularly useful when the sprite is owned by a window group, as
1.799 + it means the sprite will be displayed over the whole screen.
1.800 +
1.801 + Notes:
1.802 +
1.803 + By default a sprite is clipped to the visible region of the window that owns
1.804 + it.
1.805 +
1.806 + Sprites with this flag set are displayed in front of sprites without this
1.807 + flag. */
1.808 + ESpriteNoChildClip=0x2,
1.809 + /** The sprite's appearance will not change when it is on a shadowed part of the
1.810 + screen.
1.811 +
1.812 + (Typically this is used for sprites attached to window groups so that
1.813 + they are perceived to be floating above the windows). */
1.814 + ESpriteNoShadows=0x4,
1.815 + /** @internalComponent */
1.816 + ESpriteNonSystemFlags=0x0000FFFF,
1.817 + /** @internalComponent */
1.818 + ESpriteSystemFlags= 0xFFFF0000,
1.819 + /** @internalComponent */
1.820 + ESpritePointer=0x10000,
1.821 + /** @internalComponent */
1.822 + ESpriteOOM=0x20000,
1.823 + /** @internalComponent */
1.824 + ESpriteDisabled=0x40000,
1.825 + /** @internalComponent */
1.826 + ESpriteActive=0x80000,
1.827 + };
1.828 +
1.829 +struct TSpriteMember
1.830 +/** Sprite member.
1.831 +
1.832 +This structure is used to define the parameters of a sprite member, which
1.833 +can be added to a sprite or pointer cursor.
1.834 +@publishedAll
1.835 +@released */
1.836 + {
1.837 + /** The bitmap to be displayed in the sprite or pointer cursor during the time
1.838 + interval specified by iInterval.
1.839 +
1.840 + If NULL, the sprite or pointer cursor will be invisible for the time specified
1.841 + by iInterval. */
1.842 + CFbsBitmap *iBitmap;
1.843 + /** The bitmap mask.
1.844 +
1.845 + This defines which areas of iBitmap are drawn to the screen.
1.846 + It enables the bitmap to have a non-rectangular shape on the screen. Areas
1.847 + which are not drawn to, retain the appearance of the window underneath the
1.848 + sprite or cursor.
1.849 +
1.850 + The bits in iBitmap are AND'ed with those in iMaskBitmap before being drawn
1.851 + to the screen. In practice, the mask bitmap is normally white in those areas
1.852 + drawn to by iBitmap, and black in all other areas.
1.853 +
1.854 + Note:
1.855 +
1.856 + This bitmap should be in the same mode as iBitmap, otherwise the masking
1.857 + out operation becomes inefficient. */
1.858 + CFbsBitmap *iMaskBitmap;
1.859 + /** EFalse if the mask bitmap is not to be inverted (the default) or ETrue if it
1.860 + is to be inverted. */
1.861 + TBool iInvertMask;
1.862 + /** Specifies the drawing mode to use when drawing iBitmap if the mask is NULL. */
1.863 + CGraphicsContext::TDrawMode iDrawMode;
1.864 + /** Offset from the sprite's central position.
1.865 +
1.866 + Specifies an offset between the origin of iBitmap and the sprite or pointer
1.867 + cursor's origin. (The origin is the top left corner of the bitmap.) */
1.868 + TPoint iOffset;
1.869 + /** Time interval for which iBitmap is displayed.
1.870 +
1.871 + Note that if only one sprite member is added to a sprite or pointer cursor,
1.872 + it will be displayed continuously, regardless of the value of iInterval. */
1.873 + TTimeIntervalMicroSeconds32 iInterval;
1.874 + };
1.875 +
1.876 +/** Event reporting control.
1.877 +
1.878 +This enumeration defines flags which can be used to control how events are
1.879 +reported.
1.880 +
1.881 +@publishedAll
1.882 +@released
1.883 +@see RWindowTreeNode::EnableOnEvents()
1.884 +@see RWindowTreeNode::EnableModifierChangedEvents()
1.885 +@see RWindowTreeNode::EnableErrorMessages() */
1.886 +enum TEventControl
1.887 + {
1.888 + /** Requested events are sent in all circumstances. */
1.889 + EEventControlAlways,
1.890 + /** Events are delivered only when the requesting window's window group has keyboard
1.891 + focus. */
1.892 + EEventControlOnlyWithKeyboardFocus,
1.893 + /** Events are delivered only when the requesting window or any of its children
1.894 + are visible on the screen. */
1.895 + EEventControlOnlyWhenVisible
1.896 + };
1.897 +
1.898 +/** Pointer event filter types.
1.899 +
1.900 +These flags are used by RWindowBase::PointerFilter() to define which pointer
1.901 +events are filtered out by the window server and not sent to the client session.
1.902 +They also allow the window server to simulate a move event prior to each pen
1.903 +down event.
1.904 +
1.905 +@publishedAll
1.906 +@released
1.907 +@see RWindowBase::PointerFilter() */
1.908 +enum TPointerFilter
1.909 + {
1.910 + //Basic Types
1.911 + /** Filters out both pointer enter and pointer exit events for this window. */
1.912 + EPointerFilterEnterExit=0x1,
1.913 + /** Filters out pointer-move events for this window. */
1.914 + EPointerFilterMove=0x2,
1.915 + /** Filters out pointer-drag events for this window. */
1.916 + EPointerFilterDrag=0x4,
1.917 + /** Simulates a pointer move event before each pen down event.
1.918 +
1.919 + This makes the pen appear more like a mouse, with simulated movement between
1.920 + two pointer events. You can only get these events while you are in pen mode. */
1.921 + EPointerGenerateSimulatedMove=0x8,
1.922 + //Combinations of the above
1.923 + /** Filters move and drag-pointer events from the event stream and simulates the
1.924 + move event before each pen down event.
1.925 +
1.926 + This enum is useful when you want to get simulated move events. Use it as shown
1.927 + below to turn on simulated moves:
1.928 +
1.929 + @code
1.930 + win->PointerFilter(EPointerMoveEvents, EPointerGenerateSimulateMoves)
1.931 + @endcode
1.932 + @see RWindowBase::PointerFilter() */
1.933 + EPointerMoveEvents=EPointerFilterMove|EPointerGenerateSimulatedMove,
1.934 + };
1.935 +
1.936 +struct TPointerEvent
1.937 +/** Pointer event details.
1.938 +
1.939 +The function TWsEvent::Pointer() is used to get this structure for a pointer
1.940 +event.
1.941 +
1.942 +@publishedAll
1.943 +@released */
1.944 + {
1.945 +/** Pointer event types.
1.946 +
1.947 +Note that the user actions that cause these events will vary according to
1.948 +the type of pointing device used. */
1.949 + enum TType
1.950 + {
1.951 + /** Button 1 or pen down. */
1.952 + EButton1Down,
1.953 + /** Button 1 or pen up. */
1.954 + EButton1Up,
1.955 + /** Button 2 down.
1.956 +
1.957 + This is the middle button of a 3 button mouse. */
1.958 + EButton2Down,
1.959 + /** Button 2 up.
1.960 +
1.961 + This is the middle button of a 3 button mouse. */
1.962 + EButton2Up,
1.963 + /** Button 3 down. */
1.964 + EButton3Down,
1.965 + /** Button 3 up. */
1.966 + EButton3Up,
1.967 + /** Drag event.
1.968 +
1.969 + These events are only received when button 1 is down. */
1.970 + EDrag,
1.971 + /** Move event.
1.972 +
1.973 + These events are only received when button 1 is up and the XY input mode is
1.974 + not pen. */
1.975 + EMove,
1.976 + /** Button repeat event. */
1.977 + EButtonRepeat,
1.978 + /** Switch on event caused by a screen tap. */
1.979 + ESwitchOn,
1.980 + };
1.981 + /** The type of pointer event. */
1.982 + TType iType;
1.983 + /** The state of the modifier keys, defined in TEventModifier. */
1.984 + TUint iModifiers; // State of pointing device and associated buttons
1.985 + /** Co-ordinates of the pointer event relative to the origin of the window it occurred
1.986 + in.
1.987 +
1.988 + Positive co-ordinates indicate a position to the right of and down from
1.989 + the window's origin, negative co-ordinates indicate a position to the left
1.990 + and up. */
1.991 + TPoint iPosition;
1.992 + /** Co-ordinates of the pointer event relative to the parent window of the window
1.993 + it occurred in.
1.994 +
1.995 + Positive co-ordinates indicate a position to the right of and down from the window's
1.996 + origin, negative co-ordinates indicate a position to the left and up. */
1.997 + TPoint iParentPosition;
1.998 + };
1.999 +
1.1000 +struct TKeyEvent
1.1001 +/** Key event details.
1.1002 +
1.1003 +When processing a TKeyEvent, the TStdScanCode in iScanCode should usually
1.1004 +be ignored in favour of the TKeyCode in iCode. Using iScanCode would bypass
1.1005 +the keyboard mapping and any FEP that happens to be installed. The exceptions
1.1006 +to this general rule are games where the positions of the keys are more important
1.1007 +than their translations, and FEPs that are implementing keyboard maps themselves.
1.1008 +In these cases, if the iCode is used rather than iScanCode to determine the
1.1009 +key pressed, there will be two unfortunate consequences. Firstly, the low-level
1.1010 +keyboard mapping might re-arrange the mapping that you are trying to impose.
1.1011 +Secondly, you will subvert the CTRL+number method of entering Unicode literals.
1.1012 +
1.1013 +@publishedAll
1.1014 +@released */
1.1015 + {
1.1016 + /** The character code generated for an EEventKey, or 0 for a down or up event.
1.1017 +
1.1018 + Key codes for special keys are defined in TKeyCode. */
1.1019 + TUint iCode;
1.1020 + /** The scan code of the key that caused the event.
1.1021 +
1.1022 + Standard scan codes are defined in TStdScanCode. */
1.1023 + TInt iScanCode;
1.1024 + /** State of modifier keys and pointing device. Modifier keys are defined in TEventModifier. */
1.1025 + TUint iModifiers;
1.1026 + /** Count of auto repeats generated.
1.1027 +
1.1028 + 0 means an event without repeats. 1 or more means "this many auto repeat events".
1.1029 + It is normal to ignore this value and treat it as a single event. */
1.1030 + TInt iRepeats;
1.1031 + };
1.1032 +
1.1033 +struct TModifiersChangedEvent
1.1034 +/** Details of changed modifier keys.
1.1035 +
1.1036 +@publishedAll
1.1037 +@released
1.1038 +@see TWsEvent::ModifiersChanged() */
1.1039 + {
1.1040 + /** Contains a set bit for any modifier which has changed. Modifiers are defined
1.1041 + in TEventModifier. */
1.1042 + TUint iChangedModifiers;
1.1043 + /** Current state of all modifiers, combined using a bitwise-OR. Modifiers are
1.1044 + defined in TEventModifier. */
1.1045 + TUint iModifiers;
1.1046 + };
1.1047 +
1.1048 +struct TWsVisibilityChangedEvent
1.1049 +/** Visibility changed events.
1.1050 +
1.1051 +These events are generated in response to a window being obscured, or being fully or partially
1.1052 +revealed after being obscured.
1.1053 +@publishedAll
1.1054 +@released
1.1055 +@see RWindowTreeNode::EnableVisibilityChangeEvents() */
1.1056 + {
1.1057 + enum
1.1058 + {
1.1059 + /** Some or all of the window is visible, either directly or through a transparent window.
1.1060 + @deprecated Use EPartiallyVisible instead. */
1.1061 + ECanBeSeen = 0x01,
1.1062 + /** None of the window is visible, either directly or through a transparent window.
1.1063 + @deprecated Use ENotVisible instead. */
1.1064 + ECantBeSeen = 0x02,
1.1065 + };
1.1066 + enum
1.1067 + {
1.1068 + /** Some (or all) of the window is visible, either directly or through a transparent window. */
1.1069 + EPartiallyVisible = 0x01,
1.1070 + /** None of the window is visible, either directly or through a transparent window. */
1.1071 + ENotVisible = 0x02,
1.1072 + /** All of the window is directly visible. */
1.1073 + EFullyVisible = 0x04,
1.1074 + };
1.1075 + /** A combination of one or more visibility event flags. */
1.1076 + TUint iFlags;
1.1077 + };
1.1078 +
1.1079 +struct TWsErrorMessage
1.1080 +/** Error event details.
1.1081 +
1.1082 +@publishedAll
1.1083 +@released
1.1084 +@see RWindowTreeNode::EnableErrorMessages() */
1.1085 + {
1.1086 + /** Error event types */
1.1087 + enum TErrorCategory
1.1088 + {
1.1089 + /** An error that occurs while the window server is calculating a drawing region
1.1090 + for a particular window.
1.1091 +
1.1092 + When the window server can't calculate a drawing region due to lack of memory
1.1093 + it goes into a mode where it draws the whole of a window. Any window that
1.1094 + is covering this window is also told to redraw. */
1.1095 + EDrawingRegion,
1.1096 + /** An error occured while trying to turn the backlight on or off.
1.1097 +
1.1098 + This would usually only happen when the batteries are low. */
1.1099 + EBackLight,
1.1100 + /** An error occured while trying to enable logging. */
1.1101 + ELogging,
1.1102 + /** An error that occured while trying to change the contrast. */
1.1103 + EContrast,
1.1104 + };
1.1105 + /** The error category. */
1.1106 + TErrorCategory iErrorCategory;
1.1107 + /** The error code */
1.1108 + TUint iError;
1.1109 + };
1.1110 +
1.1111 +struct TWsGraphicMessageHeaderEvent
1.1112 +/** @internalComponent @released */
1.1113 + {
1.1114 + TInt iClientHandle;
1.1115 + TInt iDataLen;
1.1116 + };
1.1117 +
1.1118 +class TWsRedrawEvent
1.1119 +/** Window server redraw event.
1.1120 +
1.1121 +All redraw events generated by the window server are delivered to the client
1.1122 +in an object of this type. The class provides a handle to the window which
1.1123 +generated the redraw event, and the rectangle which should be redrawn.
1.1124 +
1.1125 +@publishedAll
1.1126 +@released
1.1127 +@see RWsSession::GetRedraw() */
1.1128 + {
1.1129 +public:
1.1130 + inline TUint Handle() const;
1.1131 + inline TRect Rect() const;
1.1132 +public:
1.1133 + void SetHandle(TUint aHandle);
1.1134 + void SetRect(TRect aRect);
1.1135 +protected:
1.1136 + /** @internalComponent */
1.1137 + TUint iHandle;
1.1138 + /** @internalComponent */
1.1139 + TRect iRect; // Rectangle to redraw
1.1140 + };
1.1141 +
1.1142 +class TWsPriorityKeyEvent
1.1143 +/** Priority key events.
1.1144 +
1.1145 +These events are configured using RWindowGroup::AddPriorityKey(), and obtained
1.1146 +by the client using the functions RWsSession::PriorityKeyReady() and RWsSession::GetPriorityKey().
1.1147 +
1.1148 +@publishedAll
1.1149 +@released */
1.1150 + {
1.1151 +public:
1.1152 + inline TKeyEvent *Key() const;
1.1153 + inline TUint Handle() const;
1.1154 + inline void SetHandle(TUint aHandle);
1.1155 +protected:
1.1156 + /** @internalComponent */
1.1157 + TUint iHandle;
1.1158 + /** @internalComponent */
1.1159 + TUint8 iEventData[sizeof(TKeyEvent)];
1.1160 + };
1.1161 +
1.1162 +class TWsEvent
1.1163 +/** Window server event.
1.1164 +
1.1165 +All events generated by the window server, except redraw events and priority
1.1166 +key events, are delivered to the client in a TWsEvent. The client obtains
1.1167 +the TWsEvent by calling RWsSession::GetEvent(). The type of data contained
1.1168 +in the TWsEvent depends on the type of event. The client can inquire the event
1.1169 +type using Type(), and then retrieve the appropriate type of data.
1.1170 +
1.1171 +@publishedAll
1.1172 +@released */
1.1173 + {
1.1174 +public:
1.1175 + /** Event data size. */
1.1176 + enum
1.1177 + {
1.1178 + /** The size of a TPointerEvent.
1.1179 +
1.1180 + This is the maximum number of bytes of data that can be returned by EventData().
1.1181 + Note: this value is 24 bytes.*/
1.1182 + EWsEventDataSize=sizeof(TPointerEvent)+8
1.1183 + };
1.1184 +public:
1.1185 + inline TPointerEvent* Pointer() const;
1.1186 + inline TKeyEvent* Key() const;
1.1187 + inline TModifiersChangedEvent* ModifiersChanged() const;
1.1188 + inline TWsVisibilityChangedEvent* VisibilityChanged();
1.1189 + inline const TWsVisibilityChangedEvent* VisibilityChanged() const;
1.1190 + inline TWsErrorMessage* ErrorMessage() const;
1.1191 + inline TUint8* EventData() const;
1.1192 + inline TInt Type() const;
1.1193 + inline TUint Handle() const;
1.1194 + inline TTime Time() const;
1.1195 + inline void SetType(TInt aType);
1.1196 + inline void SetHandle(TUint aHandle);
1.1197 + inline void SetTimeNow();
1.1198 + inline TInt* Int() const;
1.1199 +protected:
1.1200 + /** @internalComponent */
1.1201 + TInt iType;
1.1202 + /** @internalComponent */
1.1203 + TUint iHandle;
1.1204 + /** @internalComponent */
1.1205 + TTime iTime;
1.1206 + /** @internalComponent */
1.1207 + TUint8 iEventData[EWsEventDataSize];
1.1208 + };
1.1209 +
1.1210 +
1.1211 +class RWsPointerCursor;
1.1212 +
1.1213 +/** Pointer cursor mode flags.
1.1214 +
1.1215 +These flags define the current cursor mode, and hence which sprite to use
1.1216 +for the pointer cursor.
1.1217 +
1.1218 +@publishedAll
1.1219 +@released
1.1220 +@see RWsSession::SetPointerCursorMode()
1.1221 +@see RWsSession::PointerCursorMode() */
1.1222 +enum TPointerCursorMode
1.1223 + {
1.1224 + /** Don't have a pointer cursor. */
1.1225 + EPointerCursorNone,
1.1226 + /** The default system pointer cursor is used whenever there is a pointer cursor. */
1.1227 + EPointerCursorFixed,
1.1228 + /** The default system pointer cursor is used unless the window the pointer cursor
1.1229 + is above specifies one, in which case that cursor is used. */
1.1230 + EPointerCursorNormal,
1.1231 + /** There is no pointer cursor unless the pointer is above a window that has specified
1.1232 + one. */
1.1233 + EPointerCursorWindow,
1.1234 + /** First pointer cursor mode.
1.1235 +
1.1236 + This is used in test code for iterating though available modes. */
1.1237 + EPointerCursorFirstMode=EPointerCursorNone,
1.1238 + /** The final pointer cursor mode.
1.1239 +
1.1240 + This is used in test code for iterating though available modes. It will be
1.1241 + updated if more modes are added. */
1.1242 + EPointerCursorLastMode=EPointerCursorWindow,
1.1243 + };
1.1244 +
1.1245 +/** Flags which customise a long key press capture request made by a window group.
1.1246 +
1.1247 +These flags are passed to RWindowGroup::CaptureLongKey().
1.1248 +
1.1249 +Two things can be configured using this enum: the normal key event that is
1.1250 +generated immediately, and the long key event that is generated after a short
1.1251 +time interval. The normal key event can be sent immediately (on key down)
1.1252 +to the application with keyboard focus, or, if the key is not held down long
1.1253 +enough to generate a long key event, when the key is released. The long key
1.1254 +event can be customised to generate a single key event only, or to auto repeat.
1.1255 +
1.1256 +@publishedAll
1.1257 +@released
1.1258 +@see RWindowGroup::CaptureLongKey() */
1.1259 +enum TLongCaptureFlags
1.1260 + {
1.1261 + /** If specified, the normal ("short") key event is sent immediately (on key down)
1.1262 + to the application with keyboard focus. If not specified, the normal key event
1.1263 + is sent when the key is released (if the key is not held down long enough
1.1264 + to generate a long key event). */
1.1265 + ELongCaptureShortEventImmediately=0x01,
1.1266 + /** If specified, causes the long key press to automatically repeat. If not specified,
1.1267 + the long key press will generate a single key event only. */
1.1268 + ELongCaptureRepeatEvents=0x02,
1.1269 + /** Equivalent to ELongCaptureShortEventImmediately being set and the other flags
1.1270 + unset. */
1.1271 + ELongCaptureNormal=ELongCaptureShortEventImmediately,
1.1272 + /** Equivalent to the first two values being unset. */
1.1273 + ELongCaptureWaitShort=0,
1.1274 + };
1.1275 +
1.1276 +
1.1277 +class TIpcArgs;
1.1278 +class TReadDescriptorType;
1.1279 +class TWriteDescriptorType;
1.1280 +class CWindowGc;
1.1281 +
1.1282 +class TWsGraphicId
1.1283 +/** Identifies an abstract artwork
1.1284 +
1.1285 +This is a piece of artwork that might be owned and authored by another process.
1.1286 +A client can draw a piece of artwork, but that doesn't confer the ability to
1.1287 +access the pixel representation of that artwork directly.
1.1288 +
1.1289 +@publishedAll
1.1290 +@released */
1.1291 + {
1.1292 +public:
1.1293 + enum TUninitialized
1.1294 + {
1.1295 + EUninitialized
1.1296 + };
1.1297 + TWsGraphicId(TUninitialized): iFlags(0) {}
1.1298 + IMPORT_C TWsGraphicId(TUid aUid);
1.1299 + IMPORT_C TWsGraphicId(TInt aId);
1.1300 + IMPORT_C TWsGraphicId(const TWsGraphicId& aCopy);
1.1301 + IMPORT_C TUid Uid() const;
1.1302 + IMPORT_C TBool IsUid() const;
1.1303 + IMPORT_C void Set(TUid aUid);
1.1304 + IMPORT_C TInt Id() const;
1.1305 + IMPORT_C TBool IsId() const;
1.1306 + IMPORT_C void Set(TInt aId);
1.1307 + IMPORT_C TInt Compare(const TWsGraphicId& aOther) const;
1.1308 +private:
1.1309 + friend class CWsGraphic;
1.1310 + TUint iFlags;
1.1311 + TInt iId;
1.1312 + TInt iWsGraphicIdSpare[2];
1.1313 + };
1.1314 +
1.1315 +class CWsGraphic: public CBase
1.1316 +/** Client representation of a window-server-side piece of artwork owned by this Client
1.1317 +
1.1318 +@publishedAll
1.1319 +@released
1.1320 +*/
1.1321 + {
1.1322 +protected:
1.1323 + IMPORT_C CWsGraphic();
1.1324 +public:
1.1325 + IMPORT_C ~CWsGraphic();
1.1326 +protected:
1.1327 + // 2nd phase construction
1.1328 + IMPORT_C void BaseConstructL(TUid aUid,TUid aType,const TDesC8& aData);
1.1329 + IMPORT_C void BaseConstructL(TUid aType,const TDesC8& aData);
1.1330 + IMPORT_C void BaseConstructL(const TWsGraphicId& aReplace,TUid aType,const TDesC8& aData);
1.1331 + // sharing between clients
1.1332 + IMPORT_C virtual TInt ShareGlobally();
1.1333 + IMPORT_C virtual TInt Share(TSecureId aClientId);
1.1334 + IMPORT_C virtual TInt UnShare(TSecureId aClientId);
1.1335 + IMPORT_C virtual TInt UnShareGlobally();
1.1336 +public:
1.1337 + IMPORT_C const TWsGraphicId& Id() const;
1.1338 + IMPORT_C TBool IsActive() const;
1.1339 + IMPORT_C void Destroy();
1.1340 +protected:
1.1341 + IMPORT_C void SendMessage(const TDesC8& aData) const;
1.1342 + IMPORT_C TInt SendSynchronMessage(const TDesC8& aData) const;
1.1343 + IMPORT_C TInt Flush() const;
1.1344 + IMPORT_C void SetGraphicExtension(MWsObjectProvider* aExt);
1.1345 +private:
1.1346 + // events from wserv, to be implemented by derived classes
1.1347 + /**
1.1348 + Handles message from this graphic artwork peer on the server.
1.1349 + @param aData Message from peer CWsGraphicDrawer.
1.1350 + */
1.1351 + virtual void HandleMessage(const TDesC8& aData) = 0;
1.1352 +
1.1353 + /**
1.1354 + Handles custom operation when this graphic artwork is replaced. When this method
1.1355 + is invoked, the replaced peer CWsGraphicDrawer on the server has been destroyed.
1.1356 + */
1.1357 + virtual void OnReplace() = 0;
1.1358 + IMPORT_C virtual void OnClientClose();
1.1359 +private:
1.1360 + void BaseConstructL();
1.1361 + IMPORT_C virtual TInt CWsGraphic_Reserved1();
1.1362 + IMPORT_C virtual TInt CWsGraphic_Reserved2();
1.1363 + IMPORT_C virtual TInt CWsGraphic_Reserved3();
1.1364 +public:
1.1365 + class CManager;
1.1366 +private:
1.1367 + friend class CManager;
1.1368 + class CPimpl;
1.1369 + friend class CPimpl;
1.1370 + CPimpl* iPimpl;
1.1371 + TInt iWsGraphicSpare[2];
1.1372 +};
1.1373 +
1.1374 +class MWsClientClass
1.1375 +/** Base class for all classes whose objects are clients of the window server.
1.1376 +
1.1377 +@publishedAll
1.1378 +@released */
1.1379 + {
1.1380 +public:
1.1381 + MWsClientClass();
1.1382 + MWsClientClass(RWsBuffer *aBuffer);
1.1383 + inline TInt WsHandle() const;
1.1384 +protected:
1.1385 + void Write(const TAny *aData, TInt aLength,const TAny *aData2, TInt aLength2,TUint aOpcode) const;
1.1386 + void Write(const TAny *aBuf, TInt aBufLen,TUint aOpcode) const;
1.1387 + void Write(TUint aOpcode) const;
1.1388 + void WriteInt(TInt aInt, TUint aOpcode) const;
1.1389 + void WriteRect(const TRect &aRect, TUint aOpcode) const;
1.1390 + void WritePoint(const TPoint &aPoint, TUint aOpcode) const;
1.1391 + void WriteSize(const TSize &aSize, TUint aOpcode) const;
1.1392 + TInt WriteReply(TUint aOpcode,const TIpcArgs* aIpcArgs=NULL) const;
1.1393 + TInt WriteReplyInt(TInt aInt, TUint aOpcode,const TIpcArgs* aIpcArgs=NULL) const;
1.1394 + TInt WriteReply(const TAny *aBuf, TInt aBufLen,TUint aOpcode,const TIpcArgs* aIpcArgs=NULL) const;
1.1395 + TInt WriteReply(const TAny *aBuf, TInt aBufLen,const TAny *aBuf2, TInt aBuflen2,TUint aOpcode,const TIpcArgs* aIpcArgs=NULL) const;
1.1396 + TInt WriteReplyP(const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
1.1397 + TInt WriteReplyIntP(TInt aInt, const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
1.1398 + TInt WriteReplyP(const TAny *aBuf, TInt aBufLen, const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
1.1399 + TInt WriteReplyP(const TAny *aBuf, TInt aBufLen,const TAny *aBuf2, TInt aBuflen2, const TWriteDescriptorType& aReplyPackage,TUint aOpcode) const;
1.1400 + TInt WriteReplyByProvidingRemoteReadAccess(const TAny* aBuf, TInt aBufLen,const TReadDescriptorType& aRemoteReadBuffer,TUint aOpcode) const;
1.1401 + void AddToBitmapArray(const TInt aBitmapHandle)const;
1.1402 + void AsyncRequest(TRequestStatus& aStatus, TUint aOpcode) const;
1.1403 +protected:
1.1404 + /** @internalComponent*/
1.1405 + TInt32 iWsHandle;
1.1406 + /** @internalComponent*/
1.1407 + RWsBuffer *iBuffer;
1.1408 + };
1.1409 +
1.1410 +
1.1411 +class RWindowTreeNode;
1.1412 +class CWsScreenDevice;
1.1413 +class CWsBitmap;
1.1414 +class RAnimDll;
1.1415 +class RWsSpriteBase;
1.1416 +class RDirectScreenAccess;
1.1417 +class RSoundPlugIn;
1.1418 +
1.1419 +
1.1420 +class RWsSession : public MWsClientClass, public RSessionBase
1.1421 +/** Window server session.
1.1422 +
1.1423 +The session between the client and the window server can be used to mediate
1.1424 +asynchronous events, for client interface control and for system control.
1.1425 +A description of each of these capabilities is given below.
1.1426 +
1.1427 +Mediating asynchronous events:
1.1428 +
1.1429 +Primarily, the session mediates asynchronous events to the user. Three event
1.1430 +streams are available: the standard event stream which all applications must
1.1431 +use; the redraw event stream which must be used by all applications except
1.1432 +those which exclusively use backed-up windows; and the priority key event
1.1433 +stream which may be used for abort keys and the like for specialist applications.
1.1434 +
1.1435 +All these events are mediated as standard asynchronous services. Typical window
1.1436 +server client programs encapsulate each service they require in an active
1.1437 +object whose RunL() identifies the event and calls the appropriate member
1.1438 +function of a class associated with an application framework, or a window.
1.1439 +
1.1440 +Client interface control:
1.1441 +
1.1442 +The client's interface with the window server has several aspects, each of
1.1443 +which is controlled through the window server session.
1.1444 +
1.1445 +Flushing defines how requests to the window server are handled.
1.1446 +
1.1447 +System control:
1.1448 +
1.1449 +Many system-wide settings may be controlled through the window server session.
1.1450 +Typically, these functions are only used by the system shell and its associated
1.1451 +sessions/applications. They include: auto-repeat and double-click, querying
1.1452 +all window groups in the system, setting the default shadow vector, setting
1.1453 +the system pointer cursors, counting resources used by the window server
1.1454 +(this is only useful for debugging checks), getting and setting the state of
1.1455 +the modifier keys (for instance Shift and Ctrl), and setting the window server
1.1456 +background colour.
1.1457 +
1.1458 +@publishedAll
1.1459 +@released */
1.1460 + {
1.1461 + friend class RWsBuffer;
1.1462 + friend class RWindowTreeNode;
1.1463 + friend class CWsScreenDevice;
1.1464 + friend class CWsBitmap;
1.1465 + friend class RAnimDll;
1.1466 + friend class RWsSpriteBase;
1.1467 + friend class RDirectScreenAccess;
1.1468 + friend class RSoundPlugIn;
1.1469 + friend class CWsGraphic;
1.1470 +public:
1.1471 + /** Compute mode flags.
1.1472 +
1.1473 + When a window group takes focus or loses it, the window server can boost its
1.1474 + client's thread or process priority to provide a better response to the user.
1.1475 + How it alters the priority is determined by the current compute mode of the
1.1476 + client.
1.1477 +
1.1478 + @see ComputeMode() */
1.1479 + enum TComputeMode
1.1480 + {
1.1481 + /** Client priority is permanently set to its current level. It is not altered
1.1482 + or set by the windowing system if the focus changes.
1.1483 +
1.1484 + Thus if ComputeMode() is called with this flag when a client is in the foreground,
1.1485 + it will subsequently have foreground priority even if it is in the background. */
1.1486 + EPriorityControlDisabled,
1.1487 + /** Client process's priority is always set to EPriorityBackground. */
1.1488 + EPriorityControlComputeOn,
1.1489 + /** Client process's priority is set to EPriorityForeground when the window group
1.1490 + takes focus, and set to EPriorityBackground when it loses focus.
1.1491 +
1.1492 + This is the default behaviour. */
1.1493 + EPriorityControlComputeOff
1.1494 + };
1.1495 + enum {ESystemInfoArraySize=16};
1.1496 + /** Window server logging commands passed to LogCommand().
1.1497 +
1.1498 + @see RWsSession::LogCommand() */
1.1499 + enum TLoggingCommand
1.1500 + {
1.1501 + /** Enables logging. */
1.1502 + ELoggingEnable,
1.1503 + /** Disables logging. */
1.1504 + ELoggingDisable,
1.1505 + /** Logs the current status of all the windows in the tree, even if logging is
1.1506 + not currently enabled. */
1.1507 + ELoggingStatusDump, //Window Tree Dump
1.1508 + /** Logs information about the window server's heap size and usage, even if logging
1.1509 + is not currently enabled. */
1.1510 + ELoggingHeapDump,
1.1511 + };
1.1512 +
1.1513 + struct TWindowGroupChainInfo
1.1514 + {
1.1515 + /*Stores id and Parent id window group
1.1516 +
1.1517 + This is used to define chained window groups's id and it's parent id.
1.1518 + An array of these structures is returned by some of the varients of the function WindowGroupList.
1.1519 + @publishedAll
1.1520 + @released */
1.1521 + TInt iId;
1.1522 + TInt iParentId;
1.1523 + };
1.1524 +
1.1525 + struct SSystemInfo
1.1526 + /** @internalComponent */
1.1527 + {
1.1528 + TInt iInfo[ESystemInfoArraySize];
1.1529 + };
1.1530 + /** The vertical alignment of a custom text cursor sprite.
1.1531 +
1.1532 + One of these values must be set, see SetCustomTextCursor(). This value also
1.1533 + determines which part of each sprite member bitmap is clipped when the cursor's
1.1534 + TTextCursor::EFlagClipVertical flag is set. */
1.1535 + enum TCustomTextCursorAlignment
1.1536 + {
1.1537 + /** The y-origin of each sprite member bitmap is aligned with the top of the line. */
1.1538 + ECustomTextCursorAlignTop,
1.1539 + /** The y-origin of each sprite member bitmap is aligned with the baseline of the
1.1540 + line. */
1.1541 + ECustomTextCursorAlignBaseline,
1.1542 + /** The y-origin of each sprite member bitmap is aligned with the bottom of the
1.1543 + line. */
1.1544 + ECustomTextCursorAlignBottom
1.1545 + };
1.1546 +//
1.1547 +public:
1.1548 + IMPORT_C RWsSession();
1.1549 + IMPORT_C TInt Connect();
1.1550 + IMPORT_C TInt Connect(RFs& aFileServer);
1.1551 + IMPORT_C void Close();
1.1552 + IMPORT_C TVersion Version();
1.1553 +
1.1554 + IMPORT_C TInt SetHotKey(THotKey aType, TUint aKeyCode, TUint aModifierMask, TUint aModifier);
1.1555 + IMPORT_C TInt ClearHotKeys(THotKey aType);
1.1556 + IMPORT_C TInt RestoreDefaultHotKey(THotKey aType);
1.1557 +//
1.1558 + IMPORT_C void EventReady(TRequestStatus *aStat);
1.1559 + IMPORT_C void EventReadyCancel();
1.1560 + IMPORT_C void GetEvent(TWsEvent &aEvent);
1.1561 + IMPORT_C void PurgePointerEvents();
1.1562 +//
1.1563 + IMPORT_C void RedrawReady(TRequestStatus *aStat);
1.1564 + IMPORT_C void RedrawReadyCancel();
1.1565 + IMPORT_C void GetRedraw(TWsRedrawEvent &aEvent);
1.1566 +//
1.1567 + IMPORT_C void PriorityKeyReady(TRequestStatus *aStat);
1.1568 + IMPORT_C void PriorityKeyReadyCancel();
1.1569 + IMPORT_C void GetPriorityKey(TWsPriorityKeyEvent &aEvent);
1.1570 +//
1.1571 + IMPORT_C void Flush();
1.1572 + IMPORT_C TBool SetAutoFlush(TBool aState);
1.1573 + IMPORT_C TInt SetKeyboardRepeatRate(const TTimeIntervalMicroSeconds32 &aInitialTime, const TTimeIntervalMicroSeconds32 &aTime);
1.1574 + IMPORT_C void GetKeyboardRepeatRate(TTimeIntervalMicroSeconds32 &aInitialTime, TTimeIntervalMicroSeconds32 &aTime);
1.1575 + IMPORT_C void GetDoubleClickSettings(TTimeIntervalMicroSeconds32 &aInterval, TInt &aDistance);
1.1576 + IMPORT_C TInt SetDoubleClick(const TTimeIntervalMicroSeconds32 &aInterval, TInt aDistance);
1.1577 +//
1.1578 + IMPORT_C TInt NumWindowGroups() const;
1.1579 + IMPORT_C TInt WindowGroupList(CArrayFixFlat<TInt> *aWindowList);
1.1580 + IMPORT_C TInt WindowGroupList(RArray<TWindowGroupChainInfo>* aWindowList);
1.1581 + IMPORT_C TInt NumWindowGroups(TInt aPriority) const;
1.1582 + IMPORT_C TInt WindowGroupList(TInt aPriority, CArrayFixFlat<TInt> *aWindowList);
1.1583 + IMPORT_C TInt WindowGroupList(TInt aPriority, RArray<TWindowGroupChainInfo>* aWindowList);
1.1584 + IMPORT_C TInt GetFocusWindowGroup();
1.1585 + IMPORT_C TInt GetDefaultOwningWindow();
1.1586 + IMPORT_C TInt SetWindowGroupOrdinalPosition(TInt aIdentifier, TInt aPosition);
1.1587 + IMPORT_C TInt GetWindowGroupClientThreadId(TInt aIdentifier, TThreadId &aThreadId);
1.1588 + IMPORT_C TInt GetWindowGroupHandle(TInt aIdentifier);
1.1589 + IMPORT_C TInt GetWindowGroupOrdinalPriority(TInt aIdentifier);
1.1590 + IMPORT_C TInt SendEventToWindowGroup(TInt aIdentifier, const TWsEvent &aEvent);
1.1591 + IMPORT_C TInt SendEventToAllWindowGroups(const TWsEvent &aEvent);
1.1592 + IMPORT_C TInt SendEventToAllWindowGroups(TInt aPriority, const TWsEvent &aEvent);
1.1593 + IMPORT_C TInt SendEventToOneWindowGroupsPerClient(const TWsEvent &aEvent);
1.1594 + IMPORT_C TInt GetWindowGroupNameFromIdentifier(TInt aIdentifier, TDes &aWindowName);
1.1595 + IMPORT_C TInt FindWindowGroupIdentifier(TInt aPreviousIdentifier,const TDesC& aMatch,TInt aOffset=0);
1.1596 + IMPORT_C TInt FindWindowGroupIdentifier(TInt aPreviousIdentifier,TThreadId aThreadId);
1.1597 + IMPORT_C TInt SendMessageToWindowGroup(TInt aIdentifier, TUid aUid, const TDesC8 &aParams);
1.1598 + IMPORT_C TInt SendMessageToAllWindowGroups(TUid aUid, const TDesC8& aParams);
1.1599 + IMPORT_C TInt SendMessageToAllWindowGroups(TInt aPriority, TUid aUid, const TDesC8& aParams);
1.1600 + IMPORT_C TInt FetchMessage(TUid &aUid, TPtr8 &aParams, const TWsEvent& aMessageEvent);
1.1601 +//
1.1602 + IMPORT_C void SetShadowVector(const TPoint &aVector);
1.1603 + IMPORT_C TPoint ShadowVector() const;
1.1604 +//
1.1605 + IMPORT_C void SetBackgroundColor(TRgb aColor);
1.1606 + IMPORT_C TRgb GetBackgroundColor() const;
1.1607 +//
1.1608 + IMPORT_C TInt RegisterSurface(TInt aScreenNumber, const TSurfaceId& aSurface); ///< @publishedPartner
1.1609 + IMPORT_C void UnregisterSurface(TInt aScreenNumber, const TSurfaceId& aSurface); ///< @publishedPartner
1.1610 + IMPORT_C TInt PreferredSurfaceConfigurationSize(); ///< @publishedPartner
1.1611 +//
1.1612 + IMPORT_C TInt SetSystemPointerCursor(const RWsPointerCursor &aPointerCursor,TInt aCursorNumber);
1.1613 + IMPORT_C void ClearSystemPointerCursor(TInt aCursorNumber);
1.1614 + IMPORT_C TInt ClaimSystemPointerCursorList();
1.1615 + IMPORT_C void FreeSystemPointerCursorList();
1.1616 +//
1.1617 + IMPORT_C TInt SetCustomTextCursor(TInt aIdentifier, const TArray<TSpriteMember>& aSpriteMemberArray, TUint aSpriteFlags, TCustomTextCursorAlignment aAlignment);
1.1618 +//
1.1619 + IMPORT_C TInt ResourceCount();
1.1620 + IMPORT_C void PasswordEntered();
1.1621 + IMPORT_C void ComputeMode(TComputeMode aMode);
1.1622 +//
1.1623 + IMPORT_C TInt HeapCount() const;
1.1624 + IMPORT_C TInt DebugInfo(TInt aFunction, TInt aParam=0) const;
1.1625 + IMPORT_C TInt DebugInfo(TInt aFunction, TDes8& aReturnBuf, TInt aParam=0) const;
1.1626 + IMPORT_C void HeapSetFail(TInt aTAllocFail,TInt aValue);
1.1627 + IMPORT_C TInt SetModifierState(TEventModifier aModifier,TModifierState aState);
1.1628 + IMPORT_C TInt GetModifierState() const;
1.1629 +//
1.1630 + IMPORT_C TInt RequestOffEvents(TBool aOn,RWindowTreeNode *aWin=NULL);
1.1631 + IMPORT_C TDisplayMode GetDefModeMaxNumColors(TInt& aColor,TInt& aGray) const;
1.1632 + IMPORT_C TInt GetColorModeList(CArrayFixFlat<TInt> *aModeList) const;
1.1633 +//
1.1634 + IMPORT_C void SetPointerCursorArea(const TRect& aArea);
1.1635 + IMPORT_C void SetPointerCursorArea(TInt aScreenSizeMode,const TRect& aArea);
1.1636 + IMPORT_C TRect PointerCursorArea() const;
1.1637 + IMPORT_C TRect PointerCursorArea(TInt aScreenSizeMode) const;
1.1638 + IMPORT_C void SetPointerCursorMode(TPointerCursorMode aMode);
1.1639 + IMPORT_C TInt SetClientCursorMode(TPointerCursorMode aMode);
1.1640 + IMPORT_C TPointerCursorMode PointerCursorMode() const;
1.1641 + IMPORT_C void SetDefaultSystemPointerCursor(TInt aCursorNumber);
1.1642 + IMPORT_C void ClearDefaultSystemPointerCursor();
1.1643 + IMPORT_C TInt SetPointerCursorPosition(const TPoint& aPosition);
1.1644 + IMPORT_C TPoint PointerCursorPosition() const;
1.1645 +
1.1646 + IMPORT_C void SetDefaultFadingParameters(TUint8 aBlackMap,TUint8 aWhiteMap);
1.1647 + IMPORT_C void PrepareForSwitchOff();
1.1648 + IMPORT_C void SetBufferSizeL(TInt aBufSize);
1.1649 + IMPORT_C void SetMaxBufferSizeL(TInt aMaxBufSize);
1.1650 + IMPORT_C TInt SetSystemFaded(TBool aFaded);
1.1651 + IMPORT_C TInt SetSystemFaded(TBool aFaded,TUint8 aBlackMap,TUint8 aWhiteMap);
1.1652 +
1.1653 +// Functions for multiple screens
1.1654 + IMPORT_C TInt SetFocusScreen(TInt aScreenNumber);
1.1655 + IMPORT_C TInt GetFocusScreen();
1.1656 + IMPORT_C void ClearAllRedrawStores();
1.1657 +#if defined(__WINS__)
1.1658 +// Function for WINS behaviour only
1.1659 +//
1.1660 + IMPORT_C void SetRemoveKeyCode(TBool aRemove);
1.1661 + IMPORT_C void SimulateXyInputType(TXYInputType aInputType); //Only for testing WSERV
1.1662 +#endif
1.1663 +//
1.1664 + IMPORT_C void SimulateRawEvent(TRawEvent aEvent);
1.1665 + IMPORT_C void SimulateKeyEvent(TKeyEvent aEvent);
1.1666 + IMPORT_C void LogCommand(TLoggingCommand aCommand);
1.1667 + IMPORT_C void LogMessage(const TLogMessageText &aMessage);
1.1668 +//
1.1669 +// Functions for test code use only
1.1670 +//
1.1671 + IMPORT_C void SystemInfo(TInt &aSystemInfoNumber, SSystemInfo &aSystemInfo);
1.1672 + IMPORT_C void TestWrite(TInt aHandle,TInt aOpcode,const TAny *aData, TInt aLength);
1.1673 + IMPORT_C void TestWriteReply(TInt aHandle,TInt aOpcode,const TAny *aData, TInt aLength);
1.1674 + IMPORT_C void TestWriteReplyP(TInt aHandle,TInt aOpcode,const TAny *aData,TInt aLength,TDes8 *aReplyPackage);
1.1675 + IMPORT_C TInt TestWriteReplyByProvidingRemoteReadAccess(TInt aHandle,TInt aOpcode,const TDesC8& aData,const TDesC8& aRemoteReadBuffer);
1.1676 + IMPORT_C TInt TestWriteReplyByProvidingRemoteReadAccess(TInt aHandle,TInt aOpcode,const TDesC8& aData,const TDesC16& aRemoteReadBuffer);
1.1677 +
1.1678 + IMPORT_C TInt Finish();
1.1679 + IMPORT_C void SyncMsgBuf();
1.1680 +// functions not exported, used by CWsGraphic
1.1681 + void GraphicMessageReady(TRequestStatus *aStat);
1.1682 + void GetGraphicMessage(TDes8& aData);
1.1683 + void GraphicMessageCancel();
1.1684 + void GraphicAbortMessage(TInt aError);
1.1685 + TInt GraphicFetchHeaderMessage();
1.1686 +private:
1.1687 + TInt doWindowGroupList(TInt aPriority, RArray<TWindowGroupChainInfo>* aWindowListCh, TInt aNumOpcode, TInt aListOpcode);
1.1688 + TInt doWindowGroupList(TInt aPriority,CArrayFixFlat<TInt>* aWindowListId,TInt aNumOpcode,TInt aListOpcode);
1.1689 + TInt doSetHotKey(TInt aOpcode, TInt aType, TUint aKeycode, TUint aModifierMask, TUint aModifiers);
1.1690 + void doReadEvent(TRequestStatus *aStat, TInt aOpcode);
1.1691 +
1.1692 +private:
1.1693 + void connectL();
1.1694 + TInt DoFlush(const TIpcArgs& aIpcArgs);
1.1695 + TInt DoSyncMsgBuf(const TIpcArgs& aIpcArgs);
1.1696 + void DirectAcessActivation(TBool aIsNowActive);
1.1697 + };
1.1698 +
1.1699 +class RWindowGroup;
1.1700 +class RWsSprite;
1.1701 +
1.1702 +/** @internalComponent */
1.1703 +typedef TInt (*AnimCommand)(TPtr8 *aBufPtr,TAny *aPackage);
1.1704 +
1.1705 +
1.1706 +class RWindowTreeNode : public MWsClientClass
1.1707 +/** A handle to a node in the server-side window tree.
1.1708 +
1.1709 +This handle class is used as the base for both window groups and the windows
1.1710 +within them; it is not intended for user derivation, and may not be directly
1.1711 +constructed: use one of the standard derived classes instead.
1.1712 +
1.1713 +@publishedAll
1.1714 +@released */
1.1715 + {
1.1716 + friend class RWindowGroup;
1.1717 + friend class RWindowBase;
1.1718 + friend class CWindowGc;
1.1719 + friend class RAnimDll;
1.1720 + friend class RWsSprite;
1.1721 +public:
1.1722 + /** Fade control flags.
1.1723 +
1.1724 + These flags define whether fading is applied to all child windows when SetFaded()
1.1725 + is called on a window. */
1.1726 + enum TFadeControl
1.1727 + {
1.1728 + /** Include all child windows when fading/un-fading. */
1.1729 + EFadeIncludeChildren=ETrue,
1.1730 + /** Fade only the parent window.
1.1731 +
1.1732 + Note that a panic will occur if this value is used when SetFaded() is called
1.1733 + on a window group. */
1.1734 + EFadeWindowOnly=EFalse,
1.1735 + };
1.1736 +protected:
1.1737 + RWindowTreeNode();
1.1738 + RWindowTreeNode(RWsSession &aWs);
1.1739 +public:
1.1740 + IMPORT_C void Close();
1.1741 + IMPORT_C void Destroy();
1.1742 + IMPORT_C TUint32 ClientHandle() const;
1.1743 + IMPORT_C TUint32 Parent() const;
1.1744 + IMPORT_C TUint32 PrevSibling() const;
1.1745 + IMPORT_C TUint32 NextSibling() const;
1.1746 + IMPORT_C TUint32 Child() const;
1.1747 + IMPORT_C TInt OrdinalPriority() const;
1.1748 + IMPORT_C TInt OrdinalPosition() const;
1.1749 + IMPORT_C TInt FullOrdinalPosition() const;
1.1750 + IMPORT_C void SetOrdinalPosition(TInt aPos);
1.1751 + IMPORT_C void SetOrdinalPosition(TInt aPos,TInt aOrdinalPriority);
1.1752 + IMPORT_C TInt WindowGroupId();
1.1753 + IMPORT_C TInt SetPointerCursor(TInt aCursorNumber);
1.1754 + IMPORT_C void SetCustomPointerCursor(const RWsPointerCursor &aPointerCursor);
1.1755 + IMPORT_C TInt EnableOnEvents(TEventControl aCircumstances=EEventControlOnlyWithKeyboardFocus);
1.1756 + IMPORT_C void DisableOnEvents();
1.1757 + IMPORT_C TInt EnableGroupChangeEvents();
1.1758 + IMPORT_C void DisableGroupChangeEvents();
1.1759 + IMPORT_C TInt EnableFocusChangeEvents();
1.1760 + IMPORT_C void DisableFocusChangeEvents();
1.1761 + IMPORT_C TInt EnableGroupListChangeEvents();
1.1762 + IMPORT_C void DisableGroupListChangeEvents();
1.1763 + IMPORT_C TInt EnableVisibilityChangeEvents();
1.1764 + IMPORT_C void DisableVisibilityChangeEvents();
1.1765 + IMPORT_C TInt EnableErrorMessages(TEventControl aCircumstances);
1.1766 + IMPORT_C void DisableErrorMessages();
1.1767 + IMPORT_C TInt EnableModifierChangedEvents(TUint aModifierMask, TEventControl aCircumstances);
1.1768 + IMPORT_C void DisableModifierChangedEvents();
1.1769 + IMPORT_C void SetNonFading(TBool aNonFading);
1.1770 + IMPORT_C void SetFaded(TBool aFaded,TFadeControl aIncludeChildren);
1.1771 + IMPORT_C void SetFaded(TBool aFaded,TFadeControl aIncludeChildren,TUint8 aBlackMap,TUint8 aWhiteMap);
1.1772 + IMPORT_C void ClearPointerCursor();
1.1773 +protected:
1.1774 + __DECLARE_TEST;
1.1775 + };
1.1776 +
1.1777 +
1.1778 +class TSurfaceId;
1.1779 +class TSurfaceConfiguration;
1.1780 +
1.1781 +class RWindowBase : public RWindowTreeNode
1.1782 +/** Client-side handle to a server-side window.
1.1783 +
1.1784 +The server-side windows of handles derived from this class can be displayed
1.1785 +on the device's screen, and associated with pointer events.
1.1786 +
1.1787 +This class is not for user derivation; however derived classes form part of
1.1788 +the Window Server API.
1.1789 +
1.1790 +@publishedAll
1.1791 +@released */
1.1792 + {
1.1793 +public:
1.1794 + /** Capture behaviour flags.
1.1795 +
1.1796 + @see SetPointerCapture()
1.1797 + @see EEventDragDrop */
1.1798 + enum TCaptureFlags
1.1799 + {
1.1800 +// Flags, these can be combined to customise pointer capture
1.1801 + /** If set, capture is enabled, disabled otherwise. */
1.1802 + TCaptureFlagEnabled=0x01,
1.1803 + /** If set, drag-drop events are sent to the window in which the pointer was lifted.
1.1804 + Drag-drop is a tap-drag-lift sequence. */
1.1805 + TCaptureFlagDragDrop=0x02,
1.1806 + /** Capture events from windows belonging to any group, not just the group of the
1.1807 + window on which the flag was set */
1.1808 + TCaptureFlagAllGroups=0x04,
1.1809 +// States, made up of a set of flags
1.1810 + /** Equivalent to disabling all the above flags. */
1.1811 + TCaptureDisabled=0,
1.1812 + /** Equivalent to TCaptureFlagEnabled. */
1.1813 + TCaptureEnabled=TCaptureFlagEnabled,
1.1814 + /** Equivalent to the OR of the first three flags. */
1.1815 + TCaptureDragDrop=TCaptureFlagEnabled|TCaptureFlagDragDrop|TCaptureFlagAllGroups,
1.1816 + };
1.1817 +protected:
1.1818 + RWindowBase();
1.1819 + RWindowBase(RWsSession &aWs);
1.1820 +public:
1.1821 + IMPORT_C void Activate();
1.1822 + IMPORT_C void SetPosition(const TPoint &point);
1.1823 + IMPORT_C TInt SetSizeErr(const TSize &size);
1.1824 + IMPORT_C TInt SetExtentErr(const TPoint &point,const TSize &size);
1.1825 + IMPORT_C TSize Size() const;
1.1826 + IMPORT_C TPoint InquireOffset(const RWindowTreeNode &aWindow) const;
1.1827 + IMPORT_C void PointerFilter(TUint32 aFilterMask, TUint32 aFilter);
1.1828 + IMPORT_C void SetPointerGrab(TBool aState);
1.1829 + IMPORT_C void ClaimPointerGrab(TBool aSendUpEvent=ETrue);
1.1830 + IMPORT_C void SetPointerCapture(TInt aFlags);
1.1831 + IMPORT_C void SetPointerCapturePriority(TInt aPriority);
1.1832 + IMPORT_C TInt GetPointerCapturePriority() const;
1.1833 + IMPORT_C void SetVisible(TBool aState);
1.1834 + IMPORT_C void SetShadowHeight(TInt aHeight);
1.1835 + IMPORT_C void SetShadowDisabled(TBool aState);
1.1836 + IMPORT_C TPoint Position() const;
1.1837 + IMPORT_C TPoint AbsPosition() const;
1.1838 + IMPORT_C TInt SetCornerType(TCornerType aCornerType, TInt aCornerFlags=0);
1.1839 + IMPORT_C TInt SetShape(const TRegion &aRegion);
1.1840 + IMPORT_C TInt SetRequiredDisplayMode(TDisplayMode aMode);
1.1841 + IMPORT_C TDisplayMode DisplayMode();
1.1842 + IMPORT_C void EnableBackup(TUint aBackupType=EWindowBackupAreaBehind);
1.1843 + IMPORT_C void RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32 aTime,const TRect &aRect);
1.1844 + IMPORT_C void CancelPointerRepeatEventRequest();
1.1845 + IMPORT_C TInt AllocPointerMoveBuffer(TInt aMaxPoints, TUint aFlags);
1.1846 + IMPORT_C void FreePointerMoveBuffer();
1.1847 + IMPORT_C void EnablePointerMoveBuffer();
1.1848 + IMPORT_C void DisablePointerMoveBuffer();
1.1849 + IMPORT_C TInt RetrievePointerMoveBuffer(TDes8 &aBuf);
1.1850 + IMPORT_C void DiscardPointerMoveBuffer();
1.1851 + IMPORT_C TInt AddKeyRect(const TRect &aRect, TInt aScanCode, TBool aActivatedByPointerSwitchOn);
1.1852 + IMPORT_C void RemoveAllKeyRects();
1.1853 + IMPORT_C TInt PasswordWindow(TPasswordMode aPasswordMode);
1.1854 + IMPORT_C void FadeBehind(TBool aFade);
1.1855 + IMPORT_C TBool IsFaded();
1.1856 + IMPORT_C TBool IsNonFading();
1.1857 + IMPORT_C TInt MoveToGroup(TInt aIdentifier);
1.1858 + IMPORT_C TInt SetBackgroundSurface(const TSurfaceId& aSurface); ///< @publishedPartner
1.1859 + IMPORT_C TInt SetBackgroundSurface(const TSurfaceConfiguration& aConfiguration, TBool aTriggerRedraw); ///< @publishedPartner
1.1860 + IMPORT_C void RemoveBackgroundSurface(TBool aTriggerRedraw); ///< @publishedPartner
1.1861 + IMPORT_C TInt GetBackgroundSurface(TSurfaceConfiguration& aConfiguration); ///< @publishedPartner
1.1862 + IMPORT_C TRgb KeyColor(); ///< @publishedPartner whilst prototype
1.1863 +protected:
1.1864 + TInt construct(const RWindowTreeNode &parent,TUint32 aHandle, TInt aType, TDisplayMode aDisplayMode);
1.1865 + };
1.1866 +
1.1867 +
1.1868 +class RBlankWindow : public RWindowBase
1.1869 +/** Blank window.
1.1870 +
1.1871 +A blank window may have its extent and colour changed, but nothing else may
1.1872 +be drawn to it. Blank windows provide no functionality that is not provided
1.1873 +by the RWindow class. However, they are useful when the application requires
1.1874 +a window that cannot be drawn to, for example a container window.
1.1875 +
1.1876 +@publishedAll
1.1877 +@released */
1.1878 + {
1.1879 +public:
1.1880 + IMPORT_C RBlankWindow();
1.1881 + IMPORT_C RBlankWindow(RWsSession &aWs);
1.1882 + IMPORT_C TInt Construct(const RWindowTreeNode &parent, TUint32 aHandle);
1.1883 + IMPORT_C void SetColor(TRgb aColor);
1.1884 + IMPORT_C void SetColor();
1.1885 + IMPORT_C void SetSize(const TSize &size);
1.1886 + IMPORT_C void SetExtent(const TPoint &point,const TSize &size);
1.1887 + };
1.1888 +
1.1889 +
1.1890 +class RDrawableWindow : public RWindowBase
1.1891 +/** Handle to a drawable window.
1.1892 +
1.1893 +This class cannot be constructed directly.
1.1894 +The two concrete derived classes, RWindow and RBackedUpWindow, allow
1.1895 +drawing but use different protocols because RWindow relies on the client to
1.1896 +redraw invalid areas.
1.1897 +
1.1898 +@publishedAll
1.1899 +@released */
1.1900 + {
1.1901 +protected:
1.1902 + RDrawableWindow();
1.1903 + RDrawableWindow(RWsSession &aWs);
1.1904 +public:
1.1905 + IMPORT_C void Scroll(const TPoint &aOffset);
1.1906 + IMPORT_C void Scroll(const TRect &aClipRect, const TPoint &aOffset);
1.1907 + IMPORT_C void Scroll(const TPoint &aOffset, const TRect &aRect);
1.1908 + IMPORT_C void Scroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect);
1.1909 + IMPORT_C TRect GetDrawRect();
1.1910 +protected:
1.1911 + void SetDrawRect(const TRect &aRect);
1.1912 +private:
1.1913 + void doScroll(const TRect &aClipRect, const TPoint &aOffset, const TRect &aRect, TInt aOpcode);
1.1914 +
1.1915 + TRect iDrawRect;
1.1916 + };
1.1917 +
1.1918 +/** Transparency policies
1.1919 +
1.1920 +These policies are to control the behaviour of a transparent window.
1.1921 +@publishedAll
1.1922 +@released
1.1923 +@see RWindow::SetTransparencyPolicy() */
1.1924 +enum TWsTransparencyPolicy {
1.1925 + /** Default behaviour. */
1.1926 + ETransparencyDefault,
1.1927 + /** Freeze the content of underneath the transparent window to prevent redraw everytime
1.1928 + the overlying window changes. */
1.1929 + ETransparencyFreezeUnder,
1.1930 + };
1.1931 +
1.1932 +class RWindow : public RDrawableWindow
1.1933 +/** Handle to a standard window.
1.1934 +
1.1935 +An RWindow is a handle to a server-side window which can be displayed and
1.1936 +drawn to, and whose redraws are performed by the application.
1.1937 +
1.1938 +@publishedAll
1.1939 +@released */
1.1940 + {
1.1941 +public:
1.1942 + IMPORT_C RWindow();
1.1943 + IMPORT_C RWindow(RWsSession &aWs);
1.1944 + IMPORT_C TInt Construct(const RWindowTreeNode &parent,TUint32 aHandle);
1.1945 + IMPORT_C void BeginRedraw();
1.1946 + IMPORT_C void BeginRedraw(const TRect &aRect);
1.1947 + IMPORT_C void EndRedraw();
1.1948 + IMPORT_C void Invalidate();
1.1949 + IMPORT_C void Invalidate(const TRect &aRect);
1.1950 + IMPORT_C void GetInvalidRegion(RRegion &aRegion);
1.1951 + IMPORT_C void SetBackgroundColor(TRgb aColor);
1.1952 + IMPORT_C void SetBackgroundColor();
1.1953 + IMPORT_C void SetSize(const TSize &size);
1.1954 + IMPORT_C void SetExtent(const TPoint &point,const TSize &size);
1.1955 + IMPORT_C void HandleTransparencyUpdate();
1.1956 + IMPORT_C TInt SetTransparencyFactor(const TRgb& aTransparencyFactor);
1.1957 + IMPORT_C TInt SetTransparencyBitmap(const CFbsBitmap& aTransparencyBitmap);
1.1958 + IMPORT_C TInt SetTransparencyWsBitmap(const CWsBitmap& aTransparencyBitmap);
1.1959 + IMPORT_C void SetNonTransparent();
1.1960 + IMPORT_C void EnableRedrawStore(TBool aEnabled);
1.1961 + IMPORT_C TInt SetTransparencyAlphaChannel();
1.1962 + IMPORT_C TInt SetTransparentRegion(const TRegion& aRegion);
1.1963 + IMPORT_C TInt SetTransparencyPolicy(TWsTransparencyPolicy aPolicy);
1.1964 + IMPORT_C TBool IsRedrawStoreEnabled();
1.1965 + IMPORT_C void EnableOSB(TBool);
1.1966 + IMPORT_C void ClearRedrawStore();
1.1967 + };
1.1968 +
1.1969 +
1.1970 +class RBackedUpWindow : public RDrawableWindow
1.1971 +/** Client-side handle to a drawable window with a backup bitmap.
1.1972 +
1.1973 +A backed-up window is associated with a backup bitmap which retains the contents
1.1974 +of the window. When an area of the window is invalidated, the window server
1.1975 +uses the bitmap directly to update the window without requiring an application
1.1976 +redraw. The backup bitmap is owned by the font and bitmap server and resides
1.1977 +on the font and bitmap server's shared heap, which is accessible to all client
1.1978 +programs: functions are provided to allow the client application to access
1.1979 +this bitmap directly and perform updates to the window under application control.
1.1980 +
1.1981 +@publishedAll
1.1982 +@released */
1.1983 + {
1.1984 +public:
1.1985 + IMPORT_C RBackedUpWindow();
1.1986 + IMPORT_C RBackedUpWindow(RWsSession &aWs);
1.1987 + IMPORT_C TInt Construct(const RWindowTreeNode &parent,TDisplayMode aDisplayMode, TUint32 aHandle);
1.1988 + IMPORT_C TInt BitmapHandle();
1.1989 + IMPORT_C void UpdateScreen();
1.1990 + IMPORT_C void UpdateScreen(const TRegion &aRegion);
1.1991 + IMPORT_C void UpdateBackupBitmap();
1.1992 + IMPORT_C void MaintainBackup();
1.1993 + };
1.1994 +
1.1995 +
1.1996 +class RWindowGroup : public RWindowTreeNode
1.1997 +/** Client-side handle to a server-side window group.
1.1998 +
1.1999 +@publishedAll
1.2000 +@released */
1.2001 + {
1.2002 +public:
1.2003 + IMPORT_C RWindowGroup();
1.2004 + IMPORT_C RWindowGroup(RWsSession &aWs);
1.2005 + IMPORT_C TInt Construct(TUint32 aClientHandle);
1.2006 + IMPORT_C TInt Construct(TUint32 aClientHandle,TBool aIsFocusable);
1.2007 + IMPORT_C TInt ConstructChildApp(TInt aIdOfParentWindowGroup,TUint32 aClientHandle);
1.2008 + IMPORT_C TInt ConstructChildApp(TInt aIdOfParentWindowGroup,TUint32 aClientHandle,TBool aIsFocusable);
1.2009 + IMPORT_C void AllowProcessToCreateChildWindowGroups(TUid aProcessSID);
1.2010 + IMPORT_C void EnableReceiptOfFocus(TBool aState);
1.2011 + IMPORT_C void AutoForeground(TBool aState);
1.2012 + IMPORT_C void SetOrdinalPriorityAdjust(TInt aAdjust);
1.2013 + IMPORT_C TInt SetOrdinalPositionErr(TInt aPos,TInt aOrdinalPriority);
1.2014 + IMPORT_C TInt32 CaptureKey(TUint aKeycode, TUint aModifierMask, TUint aModifier);
1.2015 + IMPORT_C TInt32 CaptureKey(TUint aKeycode, TUint aModifierMask, TUint aModifier, TInt aPriority);
1.2016 + IMPORT_C void CancelCaptureKey(TInt32 aCaptureKey);
1.2017 + IMPORT_C TInt32 CaptureKeyUpAndDowns(TUint aScanCode, TUint aModifierMask, TUint aModifier);
1.2018 + IMPORT_C TInt32 CaptureKeyUpAndDowns(TUint aScanCode, TUint aModifierMask, TUint aModifier, TInt aPriority);
1.2019 + IMPORT_C void CancelCaptureKeyUpAndDowns(TInt32 aCaptureKey);
1.2020 + IMPORT_C TInt32 CaptureLongKey(TUint aInputKeyCode,TUint aOutputKeyCode,TUint aModifierMask,TUint aModifier
1.2021 + ,TInt aPriority,TUint aFlags);
1.2022 + IMPORT_C TInt32 CaptureLongKey(TTimeIntervalMicroSeconds32 aRepeatTime,TUint aInputKeyCode,TUint aOutputKeyCode
1.2023 + ,TUint aModifierMask,TUint aModifier,TInt aPriority,TUint aFlags);
1.2024 + IMPORT_C void CancelCaptureLongKey(TInt32 aCaptureKey);
1.2025 + IMPORT_C TInt AddPriorityKey(TUint aKeycode, TUint aModifierMask, TUint aModifier);
1.2026 + IMPORT_C void RemovePriorityKey(TUint aKeycode, TUint aModifierMask, TUint aModifier);
1.2027 + IMPORT_C void SetTextCursor(RWindowBase &aWin, const TPoint &aPos, const TTextCursor &aCursor);
1.2028 + IMPORT_C void SetTextCursor(RWindowBase &aWin, const TPoint &aPos, const TTextCursor &aCursor, const TRect &aClipRect);
1.2029 + IMPORT_C void CancelTextCursor();
1.2030 + IMPORT_C void SetOwningWindowGroup(TInt aIdentifier);
1.2031 + IMPORT_C void DefaultOwningWindow();
1.2032 + IMPORT_C TInt SetName(const TDesC &aName);
1.2033 + IMPORT_C TInt Name(TDes &aWindowName) const;
1.2034 + IMPORT_C TInt Identifier() const;
1.2035 + IMPORT_C void DisableKeyClick(TBool aState);
1.2036 + IMPORT_C TInt EnableScreenChangeEvents();
1.2037 + IMPORT_C void DisableScreenChangeEvents();
1.2038 + IMPORT_C void SimulatePointerEvent(TRawEvent aEvent);
1.2039 + IMPORT_C TInt ClearChildGroup();
1.2040 + IMPORT_C TInt SetChildGroup(TInt aId);
1.2041 +private:
1.2042 + TInt32 doCaptureKey(TUint aKey, TUint aModifierMask, TUint aModifiers, TInt aPriority, TInt aOpcode);
1.2043 + void doCancelCaptureKey(TInt32 aCaptureKeyHandle, TInt aOpcode);
1.2044 + TInt Construct(TInt aIdOfParentWindowGroup,TUint32 aClientHandle,TBool aIsFocusable);
1.2045 + };
1.2046 +
1.2047 +
1.2048 +class CWsBitmap : public CFbsBitmap, public MWsClientClass
1.2049 +/** Window server bitmap.
1.2050 +
1.2051 +This is a bitmap to which the window server already has a handle. Functions
1.2052 +which take a window server bitmap are faster than equivalent functions which
1.2053 +take a CFbsBitmap.
1.2054 +
1.2055 +@publishedAll
1.2056 +@released */
1.2057 + {
1.2058 +public:
1.2059 + IMPORT_C CWsBitmap();
1.2060 + IMPORT_C CWsBitmap(RWsSession &aWs);
1.2061 + IMPORT_C ~CWsBitmap();
1.2062 + IMPORT_C TInt Create(const TSize& aSizeInPixels,TDisplayMode aDispMode);
1.2063 + IMPORT_C TInt Duplicate(TInt aHandle);
1.2064 + IMPORT_C TInt Load(const TDesC& aFileName,TInt32 aId,TBool aShareIfLoaded=ETrue);
1.2065 + IMPORT_C void InternalizeL(RReadStream& aStream);
1.2066 + IMPORT_C void Reset();
1.2067 +private:
1.2068 + TInt createWsBitmap(TInt aErr);
1.2069 + };
1.2070 +
1.2071 +class RWsGraphicMsgBuf;
1.2072 +
1.2073 +class TWsGraphicMsgFixedBase
1.2074 +/** Base class for fixed-size messages to be attached to CWindowGc::DrawWsGraphic commands
1.2075 +@publishedAll
1.2076 +@released
1.2077 +*/ {
1.2078 +public:
1.2079 + IMPORT_C TPtrC8 Pckg() const;
1.2080 + IMPORT_C TUid TypeId() const;
1.2081 + IMPORT_C TInt Size() const;
1.2082 +protected:
1.2083 + IMPORT_C TWsGraphicMsgFixedBase(TUid aTypeId,TInt aSizeOfDerived);
1.2084 +private:
1.2085 + const TUid iTypeId;
1.2086 + const TInt iSize;
1.2087 + };
1.2088 +
1.2089 +class RWsGraphicMsgBuf: private RBuf8
1.2090 +/** Utility class for building data buffers to be attached to CWindowGc::DrawWsGraphic commands
1.2091 +Useful when there is more than one piece of data to be attached to the draw command
1.2092 +@publishedAll
1.2093 +@released */
1.2094 + {
1.2095 +public:
1.2096 + IMPORT_C RWsGraphicMsgBuf();
1.2097 + using RBuf8::Close;
1.2098 + using RBuf8::CleanupClosePushL;
1.2099 + IMPORT_C TInt Append(TUid aTypeId,const TDesC8& aData);
1.2100 + IMPORT_C TInt Append(TUid aTypeId,const TDesC16& aData);
1.2101 + IMPORT_C TInt Append(TUid aTypeId,TInt aLen,TPtr8& aPtr);
1.2102 + IMPORT_C TInt Append(const TWsGraphicMsgFixedBase& aMsg);
1.2103 + IMPORT_C void Remove(TInt aIndex);
1.2104 + IMPORT_C TInt Count() const;
1.2105 + IMPORT_C TUid TypeId(TInt aIndex) const;
1.2106 + IMPORT_C TPtrC8 Data(TInt aIndex) const;
1.2107 + IMPORT_C TPtr8 Data(TInt aIndex);
1.2108 + IMPORT_C void GetFixedMsg(TWsGraphicMsgFixedBase& aMsg,TInt aIndex) const;
1.2109 + IMPORT_C const TDesC8& Pckg() const;
1.2110 +private:
1.2111 + TInt ExpandForAppend(TInt aDataLen);
1.2112 + void WriteHeader(TUid aUid,TInt aLen);
1.2113 + TInt IntAt(TInt aOfs) const;
1.2114 +private:
1.2115 + TInt iRMsgBufSpare[2];
1.2116 + };
1.2117 +
1.2118 +
1.2119 +class CWindowGc : public CBitmapContext, public MWsClientClass
1.2120 +/** Window graphics context.
1.2121 +
1.2122 +Most window graphics context drawing functions map to equivalent CFbsBitGc
1.2123 +functions. They are implemented on the screen with any co-ordinates being
1.2124 +relative to the top left corner of the window. However extra clipping is applied.
1.2125 +The drawing will always be clipped to the visible part of the window. In addition
1.2126 +it will be clipped to the non-invalid part if you are not doing a redraw and
1.2127 +to the region being validated if you are doing a redraw.
1.2128 +
1.2129 +Note:
1.2130 +
1.2131 +In general, server side functions which encounter conditions which would normally
1.2132 +cause a leave, do not leave but instead return an error value indicating the
1.2133 +leave condition. In this way the leave can be handled on the appropriate side
1.2134 +of the client/server boundary. For example, a client can choose to wrap server
1.2135 +calls with User::LeaveIfError(), which causes a leave with the specified
1.2136 +error.
1.2137 +
1.2138 +The above advice is true of many functions in this class, and in its derived
1.2139 +classes.
1.2140 +
1.2141 +@publishedAll
1.2142 +@released
1.2143 +@see CGraphicsContext */
1.2144 + {
1.2145 + friend class CWsScreenDevice;
1.2146 +public:
1.2147 + IMPORT_C CWindowGc(CWsScreenDevice *aDevice);
1.2148 + IMPORT_C virtual ~CWindowGc();
1.2149 + IMPORT_C virtual TInt Construct();
1.2150 + IMPORT_C virtual void Activate(RDrawableWindow &aDevice);
1.2151 + IMPORT_C virtual void Deactivate();
1.2152 +//====================FROM CGraphicsContext.H===============================
1.2153 + IMPORT_C virtual CGraphicsDevice* Device() const;
1.2154 + IMPORT_C virtual void SetOrigin(const TPoint &aPoint=TPoint(0,0));
1.2155 + IMPORT_C virtual void SetDrawMode(TDrawMode aDrawingMode);
1.2156 + IMPORT_C virtual void SetClippingRect(const TRect& aRect);
1.2157 + IMPORT_C virtual void CancelClippingRect();
1.2158 + IMPORT_C virtual void Reset();
1.2159 +
1.2160 + IMPORT_C virtual void UseFont(const CFont *aFont);
1.2161 + IMPORT_C virtual void DiscardFont();
1.2162 + IMPORT_C virtual void SetUnderlineStyle(TFontUnderline aUnderlineStyle);
1.2163 + IMPORT_C virtual void SetStrikethroughStyle(TFontStrikethrough aStrikethroughStyle);
1.2164 +// Used to do justified text properly
1.2165 + IMPORT_C virtual void SetWordJustification(TInt aExcessWidth,TInt aNumGaps);
1.2166 +// Used primarily to get accurate WYSIWYG
1.2167 + IMPORT_C virtual void SetCharJustification(TInt aExcessWidth,TInt aNumChars);
1.2168 +
1.2169 + IMPORT_C virtual void SetPenColor(const TRgb &aColor);
1.2170 + IMPORT_C virtual void SetPenStyle(TPenStyle aPenStyle);
1.2171 + IMPORT_C virtual void SetPenSize(const TSize& aSize);
1.2172 +
1.2173 + IMPORT_C virtual void SetBrushColor(const TRgb &aColor);
1.2174 + IMPORT_C virtual void SetBrushStyle(TBrushStyle aBrushStyle);
1.2175 + IMPORT_C virtual void SetBrushOrigin(const TPoint &aOrigin);
1.2176 + IMPORT_C virtual void UseBrushPattern(const CFbsBitmap *aDevice);
1.2177 + IMPORT_C virtual void DiscardBrushPattern();
1.2178 +//
1.2179 +// Move the internal position, as used by DrawLineTo & DrawLineBy, and set by MoveTo,
1.2180 +// MoveBy, DrawLine, DrawLineTo, DrawLineBy and DrawPolyline
1.2181 + IMPORT_C virtual void MoveTo(const TPoint &aPoint);
1.2182 + IMPORT_C virtual void MoveBy(const TPoint &aPoint);
1.2183 + IMPORT_C virtual void Plot(const TPoint &aPoint);
1.2184 +//
1.2185 +// Line drawing subject to pen color, width and style and draw mode
1.2186 + IMPORT_C virtual void DrawArc(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd);
1.2187 + IMPORT_C virtual void DrawLine(const TPoint &aPoint1,const TPoint &aPoint2);
1.2188 + IMPORT_C virtual void DrawLineTo(const TPoint &aPoint);
1.2189 + IMPORT_C virtual void DrawLineBy(const TPoint &aPoint);
1.2190 + IMPORT_C virtual void DrawPolyLine(const CArrayFix<TPoint> *aPointList);
1.2191 + IMPORT_C virtual void DrawPolyLine(const TPoint* aPointList,TInt aNumPoints);
1.2192 +//
1.2193 +// Filled outlines
1.2194 +// Outlines subject to pen color, width and style and draw mode
1.2195 +// (set pen to ENullPen for no outline)
1.2196 +// Fill subject to brush style (color, hash or pattern) and origin and
1.2197 +// drawing mode (set brush to ENullBrush for no fill)
1.2198 + IMPORT_C virtual void DrawPie(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd);
1.2199 + IMPORT_C virtual void DrawEllipse(const TRect &aRect);
1.2200 + IMPORT_C virtual void DrawRect(const TRect &aRect);
1.2201 + IMPORT_C virtual void DrawRoundRect(const TRect &aRect,const TSize &aEllipse);
1.2202 + IMPORT_C virtual TInt DrawPolygon(const CArrayFix<TPoint> *aPointList,TFillRule aFillRule=EAlternate);
1.2203 + IMPORT_C virtual TInt DrawPolygon(const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule=EAlternate);
1.2204 +//
1.2205 +// Uses the bitmap's Twips size and does a "stretch" blit in general
1.2206 + IMPORT_C virtual void DrawBitmap(const TPoint &aTopLeft, const CFbsBitmap *aDevice);
1.2207 + IMPORT_C virtual void DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aDevice);
1.2208 + IMPORT_C virtual void DrawBitmap(const TRect &aDestRect, const CFbsBitmap *aDevice, const TRect &aSourceRect);
1.2209 + IMPORT_C virtual void DrawBitmapMasked(const TRect& aDestRect, const CFbsBitmap* aBitmap, const TRect& aSourceRect, const CFbsBitmap* aMaskBitmap, TBool aInvertMask);
1.2210 + IMPORT_C virtual void DrawBitmapMasked(const TRect& aDestRect, const CWsBitmap* aBitmap, const TRect& aSourceRect, const CWsBitmap* aMaskBitmap, TBool aInvertMask);
1.2211 +//
1.2212 +// Text drawing subject to drawing mode
1.2213 +// Subject to used font, pen color, drawing mode,
1.2214 +// word and char justification
1.2215 + IMPORT_C virtual void DrawText(const TDesC &aBuf,const TPoint &aPos);
1.2216 +//
1.2217 +// Subject to same as above plus brush for background
1.2218 +// (set brush to ENullBrush for no effect on background)
1.2219 + IMPORT_C virtual void DrawText(const TDesC &aBuf,const TRect &aBox,TInt aBaselineOffset,TTextAlign aHoriz=ELeft,TInt aLeftMrg=0);
1.2220 +//================Extra functions from CBitmapContext==============
1.2221 + IMPORT_C virtual void Clear();
1.2222 + IMPORT_C virtual void Clear(const TRect &aRect);
1.2223 + IMPORT_C virtual void CopyRect(const TPoint &anOffset,const TRect &aRect);
1.2224 + IMPORT_C virtual void BitBlt(const TPoint &aPos, const CFbsBitmap *aBitmap);
1.2225 + IMPORT_C virtual void BitBlt(const TPoint &aDestination, const CFbsBitmap *aBitmap, const TRect &aSource);
1.2226 + IMPORT_C virtual void BitBltMasked(const TPoint& aPoint,const CFbsBitmap* aBitmap,const TRect& aSourceRect,const CFbsBitmap* aMaskBitmap,TBool aInvertMask);
1.2227 + IMPORT_C virtual void BitBlt(const TPoint &aPoint, const CWsBitmap *aBitmap);
1.2228 + IMPORT_C virtual void BitBlt(const TPoint &aDestination, const CWsBitmap *aBitmap, const TRect &aSource);
1.2229 + IMPORT_C virtual void BitBltMasked(const TPoint& aPoint,const CWsBitmap *aBitmap,const TRect& aSourceRect,const CWsBitmap *aMaskBitmap,TBool aInvertMask);
1.2230 + IMPORT_C virtual void MapColors(const TRect& aRect,const TRgb* aColors,TInt aNumPairs=2,TBool aMapForwards=ETrue);
1.2231 +
1.2232 + IMPORT_C virtual void DrawTextVertical(const TDesC& aText,const TPoint& aPos,TBool aUp);
1.2233 + IMPORT_C virtual void DrawTextVertical(const TDesC& aText,const TRect& aBox,TInt aBaselineOffset,TBool aUp,TTextAlign aVert=ELeft,TInt aMargin=0);
1.2234 +//=================Extra functions specific to wserv GDI==============
1.2235 + IMPORT_C virtual void SetDitherOrigin(const TPoint& aPoint);
1.2236 + IMPORT_C virtual TInt SetClippingRegion(const TRegion &aRegion);
1.2237 + IMPORT_C virtual void CancelClippingRegion();
1.2238 + IMPORT_C virtual void SetOpaque(TBool aDrawOpaque=ETrue);
1.2239 +//=================Functions also supplied by CFbsBitGc==============
1.2240 + IMPORT_C virtual void SetFaded(TBool aFaded);
1.2241 + IMPORT_C virtual void SetFadingParameters(TUint8 aBlackMap,TUint8 aWhiteMap);
1.2242 + IMPORT_C virtual TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CFbsBitmap* aSrcBmp, const TRect& aSrcRect, const CFbsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
1.2243 + IMPORT_C virtual TInt AlphaBlendBitmaps(const TPoint& aDestPt, const CWsBitmap* aSrcBmp, const TRect& aSrcRect, const CWsBitmap* aAlphaBmp, const TPoint& aAlphaPt);
1.2244 +
1.2245 +protected:
1.2246 + IMPORT_C TInt APIExtension(TUid aUid, TAny*& aOutput, TAny* aInput);
1.2247 +
1.2248 +private:
1.2249 +
1.2250 + IMPORT_C void Reserved_CGraphicsContext_2();
1.2251 +
1.2252 + IMPORT_C void Reserved_CBitmapContext_1();
1.2253 + IMPORT_C void Reserved_CBitmapContext_2();
1.2254 + IMPORT_C void Reserved_CBitmapContext_3();
1.2255 +
1.2256 +public:
1.2257 + IMPORT_C virtual void DrawWsGraphic(const TWsGraphicId& aId,const TRect& aDestRect);
1.2258 + IMPORT_C virtual void DrawWsGraphic(const TWsGraphicId& aId,const TRect& aDestRect,const TDesC8& aData);
1.2259 +
1.2260 +private:
1.2261 + IMPORT_C virtual void Reserved_CWindowGc_3();
1.2262 + IMPORT_C virtual void Reserved_CWindowGc_4();
1.2263 + IMPORT_C virtual void Reserved_CWindowGc_5();
1.2264 +
1.2265 +////=============================================================
1.2266 +private: // Private code
1.2267 + TRgb Color(TInt aOpcode)const;
1.2268 + void SetJustification(TInt aExcessWidth,TInt aNumGaps, TInt aOpcode);
1.2269 + void DrawArcOrPie(const TRect &aRect,const TPoint &aStart,const TPoint &aEnd, TInt aOpcode);
1.2270 + void doDrawPolyLine(const CArrayFix<TPoint> *aPointArray, const TPoint* aPointList,TInt aNumPoints);
1.2271 + TInt doDrawPolygon(const CArrayFix<TPoint> *aPointArray,const TPoint* aPointList,TInt aNumPoints,TFillRule aFillRule);
1.2272 + void WriteTextPos(TInt aOpcode,TInt aOpcodePtr,const TPoint &aPos,const TDesC &aBuf) const;
1.2273 + void WriteTextCommand(TAny *aCmd, TInt aLen,const TDesC &aBuf,TInt aOpcode,TInt aOpcodePtr) const;
1.2274 + void WriteTextCommand(TAny *aCmd, TInt aLen,const TDesC8 &aBuf,TInt aOpcode,TInt aOpcodePtr) const;
1.2275 + void APIExGetUnderlineMetrics(TAny*& aOutput);
1.2276 + TInt APIExSetShadowColor(TAny* aShadowColor);
1.2277 +
1.2278 +private: // Private data
1.2279 + CFbsFont *iFont;
1.2280 + CWsScreenDevice *iDevice;
1.2281 + };
1.2282 +
1.2283 +
1.2284 +class CWsScreenDevice : public CBitmapDevice, public MWsClientClass
1.2285 +/** Software device screen.
1.2286 +
1.2287 +An object of this class can be used to enquire or set parameters of the software
1.2288 +screen, and determine the physical limits of the device.
1.2289 +
1.2290 +CWsScreenDevice gives access to the list of screen modes. These are the combinations
1.2291 +of screen rotation and screen size supported by the device. One of them is
1.2292 +selected as the current screen mode. The possible screen modes are initialised
1.2293 +in wsini.ini.
1.2294 +
1.2295 +@publishedAll
1.2296 +@released
1.2297 +@see CFbsScreenDevice */
1.2298 + {
1.2299 +public:
1.2300 + /** Whether or not to include sprites when comparing areas of the screen*/
1.2301 + enum TSpriteInCompare
1.2302 + {
1.2303 + /** This enum can be specified as the 3rd parameter to CWsScreenDevice::RectCompare(const TRect &aRect1,
1.2304 + const TRect &aRect2,TUint aFlags).
1.2305 + When called with the value ERemoveSprite if there are any sprites visible in the areas of the screen being compared then these
1.2306 + will not be included in the comparison.
1.2307 + The function CWsScreenDevice::RectCompare(const TRect &aRect1,const TRect &aRect2) will not include
1.2308 + sprites in the comparison.
1.2309 + */
1.2310 + ERemoveSprite=0,
1.2311 + /** This enum can be specified as the 3rd parameter to CWsScreenDevice::RectCompare(const TRect &aRect1,
1.2312 + const TRect &aRect2,TUint aFlags).
1.2313 + When called with the value EIncludeSprite if there are any sprites visible in the areas of the screen being compared then these
1.2314 + will be included in the comparison.*/
1.2315 + EIncludeSprite=1,
1.2316 + /** This enum can be specified as the 3rd parameter to CWsScreenDevice::RectCompare(const TRect &aRect1,
1.2317 + const TRect &aRect2,TUint aFlags).
1.2318 + When called with the value EIncludeTextCursor if there are any text cursors visible in the areas of the screen being compared then these
1.2319 + will be included in the comparison.*/
1.2320 + EIncludeTextCursor=2
1.2321 + };
1.2322 +public:
1.2323 + IMPORT_C CWsScreenDevice();
1.2324 + IMPORT_C CWsScreenDevice(RWsSession &aWs);
1.2325 + IMPORT_C ~CWsScreenDevice();
1.2326 + IMPORT_C TInt Construct();
1.2327 + IMPORT_C TInt Construct( TInt aDefaultScreenNumber ) ;
1.2328 +//==== From CGraphicsDevice ====//
1.2329 + IMPORT_C TDisplayMode DisplayMode() const;
1.2330 + IMPORT_C TSize SizeInPixels() const;
1.2331 + IMPORT_C TSize SizeInTwips() const;
1.2332 + IMPORT_C TInt HorizontalTwipsToPixels(TInt aTwips) const;
1.2333 + IMPORT_C TInt VerticalTwipsToPixels(TInt aTwips) const;
1.2334 + IMPORT_C TInt HorizontalPixelsToTwips(TInt aPixels) const;
1.2335 + IMPORT_C TInt VerticalPixelsToTwips(TInt aPixels) const;
1.2336 + IMPORT_C TRect PointerRect() const;
1.2337 + IMPORT_C TInt CreateContext(CGraphicsContext *&aGc);
1.2338 + inline TInt CreateContext(CWindowGc*& aGc);
1.2339 + IMPORT_C virtual TInt GetNearestFontInTwips(CFont*& aFont,const TFontSpec& aFontSpec);
1.2340 + IMPORT_C virtual TInt GetNearestFontToDesignHeightInTwips(CFont*& aFont,const TFontSpec& aFontSpec);
1.2341 + IMPORT_C virtual TInt GetNearestFontToMaxHeightInTwips(CFont*& aFont,const TFontSpec& aFontSpec,TInt aMaxHeight);
1.2342 + IMPORT_C TInt NumTypefaces() const;
1.2343 + IMPORT_C void TypefaceSupport(TTypefaceSupport& aTypefaceSupport,TInt aTypefaceIndex) const;
1.2344 + IMPORT_C TInt FontHeightInTwips(TInt aTypefaceIndex,TInt aHeightIndex) const;
1.2345 +// ==== From CBitmapDevice ====//
1.2346 + IMPORT_C void GetPixel(TRgb& aColor,const TPoint& aPixel) const;
1.2347 + IMPORT_C void GetScanLine(TDes8& aScanLine,const TPoint& aStartPixel,TInt aPixelLength, TDisplayMode aDispMode) const;
1.2348 + IMPORT_C TInt AddFile(const TDesC& aName,TInt& aId);
1.2349 + IMPORT_C void RemoveFile(TInt aId=0);
1.2350 + IMPORT_C virtual TInt GetNearestFontInPixels(CFont*& aFont,const TFontSpec& aFontSpec);
1.2351 + IMPORT_C virtual TInt GetNearestFontToDesignHeightInPixels(CFont*& aFont,const TFontSpec& aFontSpec);
1.2352 + IMPORT_C virtual TInt GetNearestFontToMaxHeightInPixels(CFont*& aFont,const TFontSpec& aFontSpec,TInt aMaxHeight);
1.2353 + IMPORT_C TInt FontHeightInPixels(TInt aTypefaceIndex,TInt aHeightIndex) const;
1.2354 + IMPORT_C void ReleaseFont(CFont* aFont);
1.2355 +//===== From CFbsScreenDevice ====//
1.2356 + IMPORT_C void PaletteAttributes(TBool& aModifiable,TInt& aNumEntries) const;
1.2357 + IMPORT_C void SetPalette(CPalette* aPalette);
1.2358 + IMPORT_C TInt GetPalette(CPalette*& aPalette) const;
1.2359 +//===== Extra functions ====//
1.2360 + IMPORT_C TInt SetCustomPalette(const CPalette* aPalette);
1.2361 + IMPORT_C TInt GetFontById(CFont*& aFont,TUid aUid,const TAlgStyle& aAlgStyle);
1.2362 + IMPORT_C TBool RectCompare(const TRect &aRect1,const TRect &aRect2);
1.2363 + IMPORT_C TBool RectCompare(const TRect& aRect1,const TRect &aRect2,TUint aFlags) const;
1.2364 + IMPORT_C TInt CopyScreenToBitmap(const CFbsBitmap *aBitmap) const;
1.2365 + IMPORT_C TInt CopyScreenToBitmap(const CFbsBitmap *aBitmap, const TRect &aRect) const;
1.2366 + IMPORT_C TInt SetBackLight(TBool aBackLight);
1.2367 +//===== Screen Rotation functions ====//
1.2368 + IMPORT_C void SetScreenSizeAndRotation(const TPixelsTwipsAndRotation &aSizeAndRotation);
1.2369 + IMPORT_C void GetDefaultScreenSizeAndRotation(TPixelsTwipsAndRotation &aSizeAndRotation) const;
1.2370 + IMPORT_C void SetScreenSizeAndRotation(const TPixelsAndRotation &aSizeAndRotation);
1.2371 + IMPORT_C void GetDefaultScreenSizeAndRotation(TPixelsAndRotation &aSizeAndRotation) const;
1.2372 + IMPORT_C TScreenModeEnforcement ScreenModeEnforcement() const;
1.2373 + IMPORT_C void SetScreenModeEnforcement(TScreenModeEnforcement aMode) const;
1.2374 + IMPORT_C void GetScreenModeSizeAndRotation(TInt aMode, TPixelsTwipsAndRotation &aSizeAndRotation) const;
1.2375 + IMPORT_C void GetScreenModeSizeAndRotation(TInt aMode, TPixelsAndRotation &aSizeAndRotation) const;
1.2376 + IMPORT_C void SetCurrentRotations(TInt aMode, CFbsBitGc::TGraphicsOrientation aRotation) const;
1.2377 + IMPORT_C TInt GetRotationsList(TInt aMode, CArrayFixFlat<TInt> *aRotationList) const;
1.2378 + IMPORT_C TInt NumScreenModes() const;
1.2379 + IMPORT_C void SetScreenMode(TInt aMode);
1.2380 + IMPORT_C TInt CurrentScreenMode() const;
1.2381 + IMPORT_C void SetAppScreenMode(TInt aMode);
1.2382 + IMPORT_C TPoint GetDefaultScreenModeOrigin() const;
1.2383 + IMPORT_C TPoint GetScreenModeOrigin(TInt aMode) const;
1.2384 + IMPORT_C TSize GetCurrentScreenModeScale() const;
1.2385 + IMPORT_C TSize GetScreenModeScale(TInt aMode) const;
1.2386 + IMPORT_C TPoint GetCurrentScreenModeScaledOrigin() const;
1.2387 + IMPORT_C TPoint GetScreenModeScaledOrigin(TInt aMode) const;
1.2388 + IMPORT_C TInt GetScreenSizeModeList(RArray<TInt>* aModeList);
1.2389 + IMPORT_C TDisplayMode GetScreenModeDisplayMode(const TInt &aMode) const;
1.2390 +//===== Used for testing purpose only ====//
1.2391 + IMPORT_C TSizeMode GetCurrentScreenModeAttributes() const;
1.2392 + IMPORT_C void SetCurrentScreenModeAttributes(const TSizeMode &aModeAtt);
1.2393 + IMPORT_C TInt GetScreenNumber() const;
1.2394 +private: // Private data
1.2395 + CFbsTypefaceStore* iTypefaceStore;
1.2396 + TSize iPhysicalScreenSizeInTwips;
1.2397 + TSize iDisplaySizeInPixels;
1.2398 + friend class CWindowGc;
1.2399 + };
1.2400 +
1.2401 +
1.2402 +class RWsSpriteBase : public MWsClientClass
1.2403 +// Client side class base class for sprites and pointer cursors
1.2404 +/** Sprite base class.
1.2405 +
1.2406 +Unless stated otherwise, references to sprites in the documentation for this class also
1.2407 +apply to pointer cursors.
1.2408 +
1.2409 +@publishedAll
1.2410 +@released
1.2411 +@see RWsSprite
1.2412 +@see RWsPointerCursor */
1.2413 + {
1.2414 +protected:
1.2415 + IMPORT_C RWsSpriteBase();
1.2416 + IMPORT_C RWsSpriteBase(RWsSession &aWs);
1.2417 +public:
1.2418 + IMPORT_C TInt Activate();
1.2419 + IMPORT_C TInt AppendMember(const TSpriteMember &aMemberData);
1.2420 + IMPORT_C void UpdateMember(TInt aIndex);
1.2421 + IMPORT_C TInt UpdateMember(TInt aIndex, const TSpriteMember &aMemberData);
1.2422 + IMPORT_C void Close();
1.2423 + };
1.2424 +
1.2425 +
1.2426 +class RWsSprite : public RWsSpriteBase
1.2427 +/** Sprite.
1.2428 +
1.2429 +This class defines functions to create and initialise a sprite, and to set
1.2430 +its position.
1.2431 +
1.2432 +@publishedAll
1.2433 +@released */
1.2434 + {
1.2435 +public:
1.2436 + IMPORT_C RWsSprite();
1.2437 + IMPORT_C RWsSprite(RWsSession &aWs);
1.2438 + IMPORT_C TInt Construct(RWindowTreeNode &aWindow, const TPoint &aPos, TInt aFlags);
1.2439 + IMPORT_C void SetPosition(const TPoint &aPos);
1.2440 + };
1.2441 +
1.2442 +
1.2443 +class RWsPointerCursor : public RWsSpriteBase
1.2444 +/** Pointer cursor.
1.2445 +
1.2446 +The pointer cursor is created in a similar way to a sprite. After creating it,
1.2447 +one or more sprite members containing the bitmaps to be displayed are added.
1.2448 +
1.2449 +After a pointer cursor has been created and activated, it does not become
1.2450 +visible until the application calls RWindowTreeNode::SetPointerCursor() or
1.2451 +RWindowTreeNode::SetCustomPointerCursor(). The pointer cursor's origin automatically
1.2452 +tracks the position of the pointing device, and the origin forms the pointer
1.2453 +cursor's "hot spot", i.e., the point whose co-ordinates are sent to the client
1.2454 +if a pointer event occurs. If the pointer cursor's bitmap needs to extend
1.2455 +to the left or upwards from the pointer position, its sprite member should
1.2456 +be given a negative offset in TSpriteMember::iOffset.
1.2457 +
1.2458 +Note:
1.2459 +
1.2460 +Pointer cursors are rarely used in pure pen architectures, but they are supported
1.2461 +for mouse or tablet use.
1.2462 +
1.2463 +@publishedAll
1.2464 +@released */
1.2465 + {
1.2466 +public:
1.2467 + IMPORT_C RWsPointerCursor();
1.2468 + IMPORT_C RWsPointerCursor(RWsSession &aWs);
1.2469 + IMPORT_C TInt Construct(TInt aFlags);
1.2470 + };
1.2471 +
1.2472 +
1.2473 +class RAnim;
1.2474 +
1.2475 +
1.2476 +class RAnimDll : public MWsClientClass
1.2477 +/** Client-side interface to the server-side animation DLL.
1.2478 +
1.2479 +This is the client side class matching the server side CAnimDLL class. It
1.2480 +provides functions to create, load, close and destroy a server-side CAnimDll
1.2481 +object.
1.2482 +
1.2483 +@publishedAll
1.2484 +@released
1.2485 +@see CreateCAnimDllL()
1.2486 +@see CAnimDll */
1.2487 + {
1.2488 +public:
1.2489 + IMPORT_C RAnimDll();
1.2490 + IMPORT_C virtual ~RAnimDll();
1.2491 + IMPORT_C RAnimDll(RWsSession &aWs);
1.2492 + IMPORT_C TInt Load(const TDesC &aFileName);
1.2493 + IMPORT_C void Destroy();
1.2494 + IMPORT_C virtual void Close();
1.2495 +private:
1.2496 + TInt CommandReply(TInt aHandle, TInt aOpcode, const TIpcArgs* aIpcArgs=NULL);
1.2497 + TInt CommandReply(TInt aHandle, TInt aOpcode, const TDesC8& aArgs, const TIpcArgs* aIpcArgs=NULL);
1.2498 + void Command(TInt aHandle, TInt aOpcode, const TPtrC8 &aArgs);
1.2499 + void Command(TInt aHandle, TInt aOpcode);
1.2500 + void AsyncCommandReply(TRequestStatus& aStatus, TInt aOpcode, TIpcArgs& aIpcArgs);
1.2501 + TInt CreateInstance(TInt32& aHandle, const MWsClientClass &aDevice, TInt aType, const TDesC8 &aArgs, TInt aOpcode, const TIpcArgs* aIpcArgs);
1.2502 + void DestroyInstance(TInt aHandle);
1.2503 +private:
1.2504 + friend class RAnim;
1.2505 + };
1.2506 +
1.2507 +
1.2508 +class RAnim
1.2509 +/** Client-side handle to a server-side animation class.
1.2510 +
1.2511 +This class should be sub-classed to provide a client side interface to the
1.2512 +server side animation DLL. The server side animation DLL is derived from CAnim.
1.2513 +
1.2514 +@publishedAll
1.2515 +@released */
1.2516 + {
1.2517 +public:
1.2518 + IMPORT_C virtual ~RAnim();
1.2519 + IMPORT_C virtual void Close();
1.2520 + IMPORT_C void Destroy();
1.2521 +protected:
1.2522 + IMPORT_C RAnim();
1.2523 + IMPORT_C RAnim(RAnimDll &aDll);
1.2524 + IMPORT_C TInt Construct(const RWindowBase &aDevice, TInt aType, const TDesC8 &aParams);
1.2525 + IMPORT_C TInt Construct(const RWindowBase &aDevice, TInt aType, const TDesC8 &aParams, const TIpcArgs& aIpcArgs);
1.2526 + IMPORT_C TInt Construct(const RWsSprite &aDevice, TInt aType, const TDesC8 &aParams);
1.2527 + IMPORT_C TInt Construct(const RWsSprite &aDevice, TInt aType, const TDesC8 &aParams, const TIpcArgs& aIpcArgs);
1.2528 + IMPORT_C TInt CommandReply(TInt aOpcode);
1.2529 + IMPORT_C TInt CommandReply(TInt aOpcode, const TPtrC8 &aArgs);
1.2530 + IMPORT_C TInt CommandReply(TInt aOpcode, const TDesC8& aArgs, const TIpcArgs& aIpcArgs);
1.2531 + IMPORT_C void Command(TInt aOpcode, const TPtrC8 &aArgs);
1.2532 + IMPORT_C void Command(TInt aOpcode);
1.2533 + IMPORT_C void AsyncCommandReply(TRequestStatus& aRequestStatus,TInt aOpcode, const TIpcArgs& aIpcArgs);
1.2534 +private:
1.2535 + TInt32 iHandle;
1.2536 + RAnimDll *iAnimDll;
1.2537 + };
1.2538 +
1.2539 +class CDsaMsgQueue;
1.2540 +
1.2541 +class RDirectScreenAccess : public MWsClientClass
1.2542 +/** The interface between an application that directly accesses the screen and
1.2543 +the window server.
1.2544 +
1.2545 +Note that most applications that need to access the screen directly should
1.2546 +use CDirectScreenAccess instead. RDirectScreenAccess only needs to be used
1.2547 +directly by applications without access to an active scheduler.
1.2548 +
1.2549 +@publishedAll
1.2550 +@released */
1.2551 + {
1.2552 +public:
1.2553 + /** Provides the reason why direct screen access must terminate. This enum is used
1.2554 + in the MAbortDirectScreenAccess::AbortNow() and MDirectScreenAccess::Restart()
1.2555 + functions.
1.2556 +
1.2557 + The first value (ETerminateCancel) indicates that direct screen access is
1.2558 + being terminated by the application. The final three values indicate that
1.2559 + direct screen access is being terminated by the window server. Note that
1.2560 + for users of CDirectScreenAccess, the termination code is not important
1.2561 + because these issues are dealt with by CDirectScreenAccess::StartL(). */
1.2562 + enum TTerminationReasons
1.2563 + {
1.2564 + /** The application has finished direct screen access. */
1.2565 + ETerminateCancel,
1.2566 + /** A window is about to come in front of a part of the area that is being used
1.2567 + for direct screen access. */
1.2568 + ETerminateRegion,
1.2569 + /** The screen's color depth (as enumerated by TDisplayMode) is about to change. */
1.2570 + ETerminateScreenMode,
1.2571 + /** The current screen mode (the combination of screen rotation and screen size)
1.2572 + is about to change. */
1.2573 + ETerminateRotation,
1.2574 + };
1.2575 + /** The priority of the active object that responds to notification that direct
1.2576 + screen access must stop. */
1.2577 + enum TPriority
1.2578 + {
1.2579 + /** A suggested value for the priority of the active object that responds to notification
1.2580 + from the window server that direct screen access must stop. This is also the
1.2581 + value used by CDirectScreenAccess for this purpose. */
1.2582 + EPriorityVeryHigh=2000,
1.2583 + };
1.2584 +public:
1.2585 + IMPORT_C RDirectScreenAccess();
1.2586 + IMPORT_C RDirectScreenAccess(RWsSession& aWs);
1.2587 + IMPORT_C TInt Construct();
1.2588 + IMPORT_C TInt Request(RRegion*& aRegion,TRequestStatus& aStatus,const RWindowBase& aWindow);
1.2589 + IMPORT_C void Completed();
1.2590 + IMPORT_C void Cancel();
1.2591 + IMPORT_C void Close();
1.2592 +private:
1.2593 + RWsSession* iWs;
1.2594 + CDsaMsgQueue* iMsgQueue;
1.2595 + // To maintain BC we need the following
1.2596 + RThread iWsThread;
1.2597 + TRequestStatus* iDummyRequest;
1.2598 + };
1.2599 +
1.2600 +
1.2601 +class MAbortDirectScreenAccess
1.2602 +/** The interface for terminating direct screen access.
1.2603 +
1.2604 +An object of a class which implements this interface should be passed to CDirectScreenAccess::NewL().
1.2605 +
1.2606 +@publishedAll
1.2607 +@released
1.2608 +@see MDirectScreenAccess */
1.2609 + {
1.2610 +public:
1.2611 + /** This function is called by the window server when direct screen access must
1.2612 + stop (for example because a dialogue is moved in front of the area where direct
1.2613 + screen access is taking place).
1.2614 +
1.2615 + In response to this, direct screen access must stop immediately. In simple cases,
1.2616 + this will involve cancelling the active object that is driving the drawing to the
1.2617 + screen.
1.2618 +
1.2619 + No attempt to call a Window Server API function can be made from
1.2620 + AbortNow(), because then a temporary deadlock will occur. This is because WSERV
1.2621 + is waiting to receive the client's acknowledgment that it has aborted, and so will
1.2622 + not be able to service the call. As soon as the restriction no longer applies,
1.2623 + the function Restart() will be called.
1.2624 +
1.2625 + @param aReason The reason why direct screen access was terminated. */
1.2626 + virtual void AbortNow(RDirectScreenAccess::TTerminationReasons aReason)=0;
1.2627 + };
1.2628 +
1.2629 +
1.2630 +class MDirectScreenAccess : public MAbortDirectScreenAccess
1.2631 +/** The interface for restarting direct screen access.
1.2632 +
1.2633 +The Restart() function is called by the window server as soon as direct screen
1.2634 +access can resume. It is called after the window server has called AbortNow().
1.2635 +
1.2636 +An object of the derived class is passed to CDirectScreenAccess::NewL().
1.2637 +
1.2638 +@publishedAll
1.2639 +@released
1.2640 +@see CDirectScreenAccess::NewL() */
1.2641 + {
1.2642 +public:
1.2643 + /** This function is called by the window server as soon as direct screen access
1.2644 + can resume.
1.2645 +
1.2646 + This function should call CDirectScreenAccess::StartL() within a trap harness.
1.2647 + If this leaves, e.g. through lack of memory, direct screen access cannot be
1.2648 + restarted. StartL() re-calculates the clipping region, so that if direct screen
1.2649 + access was aborted because another window appeared in front of it, that window
1.2650 + will not be overwritten when direct screen access resumes.
1.2651 +
1.2652 + In this function, you can resume calls to Window Server Client Side API functions.
1.2653 +
1.2654 + @param aReason Provides the reason why direct screen access was terminated. */
1.2655 + virtual void Restart(RDirectScreenAccess::TTerminationReasons aReason)=0;
1.2656 + };
1.2657 +
1.2658 +
1.2659 +class CDirectScreenAccess : public CActive
1.2660 +/** An active object used to start direct screen access.
1.2661 +
1.2662 +Direct screen access is a way of drawing to the screen without using the window
1.2663 +server. As this avoids client-server communication, it is much faster, and
1.2664 +may be useful for games and video. Note that some interaction with the window
1.2665 +server is needed in order to prevent the application from drawing over other
1.2666 +application's data.
1.2667 +
1.2668 +The object's (private) RunL() function is called by the window server in order
1.2669 +to abort direct screen access. This might occur when another window needs
1.2670 +to be displayed in front or when the window with direct screen access is moved.
1.2671 +The active object's priority is RDirectScreenAccess::EPriorityVeryHigh so
1.2672 +that direct screen access will be aborted as quickly as possible.
1.2673 +
1.2674 +@publishedAll
1.2675 +@released */
1.2676 + {
1.2677 +public:
1.2678 + IMPORT_C static CDirectScreenAccess* NewL(RWsSession& aWs,CWsScreenDevice& aScreenDevice,RWindowBase& aWin,MDirectScreenAccess& aAbort);
1.2679 + ~CDirectScreenAccess();
1.2680 + IMPORT_C void StartL();
1.2681 + inline CFbsBitGc* Gc();
1.2682 + inline CFbsScreenDevice*& ScreenDevice();
1.2683 + inline RRegion* DrawingRegion();
1.2684 +private:
1.2685 + enum TFlags
1.2686 + {
1.2687 + EDirectCheckModeChange=0x1,
1.2688 + EDirectCheckSizeModeChange=0x2,
1.2689 + };
1.2690 +private:
1.2691 + inline CDirectScreenAccess(RWsSession& aWs,CWsScreenDevice* aScreenDevice,RWindowBase& aWindow,MDirectScreenAccess& aAbort);
1.2692 + void ConstructL(RWsSession& aWs);
1.2693 + void CreateScreenObjectsL(TDisplayMode aCurrentMode);
1.2694 + void UpdateSizeAndRotation(CFbsBitGc* aGc);
1.2695 + static TInt Restart(TAny* aDirect);
1.2696 + void Restart();
1.2697 + //Pure virtual functions from CActive
1.2698 + void DoCancel();
1.2699 + void RunL();
1.2700 +private:
1.2701 + CFbsBitGc* iGc;
1.2702 + CFbsScreenDevice* iScreenDevice;
1.2703 + RRegion* iDrawingRegion;
1.2704 + RWindowBase& iWindow;
1.2705 + CWsScreenDevice* iWsScreenDevice;
1.2706 + MDirectScreenAccess& iAbort;
1.2707 + RDirectScreenAccess iDirectAccess;
1.2708 + RDirectScreenAccess::TTerminationReasons iReason;
1.2709 + CIdle* iRestart;
1.2710 + TSize iScreenSize;
1.2711 + TBool iAborting;
1.2712 + TUint iFlags;
1.2713 + TInt iScreenNumber;
1.2714 + };
1.2715 +
1.2716 +
1.2717 +class RSoundPlugIn : public MWsClientClass
1.2718 +/** Client interface to the key or pointer click plug-in DLL.
1.2719 +
1.2720 +The plug-in DLL implements the CClickMaker class.
1.2721 +
1.2722 +@publishedAll
1.2723 +@released
1.2724 +@see CClickMaker */
1.2725 + {
1.2726 +public:
1.2727 + /** A possible return value for CommandReply(). */
1.2728 + enum
1.2729 + {
1.2730 + /** The value returned by CommandReply() if no plug-in is loaded,
1.2731 + or if the plug-in identified by the aUid parameter in Construct() is not loaded.
1.2732 + Its value is set to KMinTInt so that it should not clash with any other expected
1.2733 + return value from this function. */
1.2734 + ESoundWrongPlugIn=KMinTInt
1.2735 + };
1.2736 +public:
1.2737 + IMPORT_C RSoundPlugIn();
1.2738 + IMPORT_C RSoundPlugIn(RWsSession &aWs);
1.2739 + IMPORT_C TInt Construct(TUid aUid=KNullUid);
1.2740 + IMPORT_C void Close();
1.2741 + IMPORT_C void Destroy();
1.2742 + IMPORT_C TBool IsLoaded(TBool& aIsChangeable);
1.2743 + IMPORT_C TInt Unload();
1.2744 + IMPORT_C TInt Load(const TDesC &aFileName);
1.2745 + IMPORT_C void SetKeyClick(TBool aEnabled);
1.2746 + IMPORT_C void SetPenClick(TBool aEnabled);
1.2747 + IMPORT_C TBool KeyClickEnabled();
1.2748 + IMPORT_C TBool PenClickEnabled();
1.2749 + IMPORT_C TInt CommandReply(TInt aOpcode, const TPtrC8 &aArgs);
1.2750 + };
1.2751 +
1.2752 +inline TInt MWsClientClass::WsHandle() const
1.2753 + /** Gets the server side handle for the object.
1.2754 +
1.2755 + @return The server-side handle for the object. */
1.2756 + {return(iWsHandle);}
1.2757 +
1.2758 +inline TInt CWsScreenDevice::CreateContext(CWindowGc *&aGc)
1.2759 + /** Creates a graphics context for this device.
1.2760 +
1.2761 + This function always causes a flush of the window server buffer.
1.2762 +
1.2763 + @param aGc On successful return, contains a new graphics context referring
1.2764 + to this screen device.
1.2765 + @return KErrNone if successful, otherwise one of the system-wide error codes.
1.2766 + @see CGraphicsDevice::CreateContext() */
1.2767 + {return(CreateContext((CGraphicsContext *&)aGc));}
1.2768 +
1.2769 +inline TUint TWsRedrawEvent::Handle() const
1.2770 + /** Gets the handle of the window which is the target of the redraw event.
1.2771 +
1.2772 + This is the handle that was passed to the window's Construct() function: typically
1.2773 + it will be a pointer to the object owning the window, providing access to
1.2774 + its member functions.
1.2775 +
1.2776 + @return The window's handle. */
1.2777 + {return(iHandle);}
1.2778 +
1.2779 +inline TRect TWsRedrawEvent::Rect() const
1.2780 + /** Gets the rectangle to redraw.
1.2781 +
1.2782 + @return The rectangle that needs redrawing. Co-ordinates are relative to
1.2783 + the window whose handle is given by Handle(). */
1.2784 + {return(iRect);}
1.2785 +
1.2786 +inline TPointerEvent *TWsEvent::Pointer() const
1.2787 + /** Gets the pointer event.
1.2788 +
1.2789 + This function can be used to get information about the pointer event if Type()
1.2790 + returns an event of type EEventPointer. or EEventDragDrop.
1.2791 +
1.2792 + @return Structure containing pointer event data. */
1.2793 + {return((TPointerEvent *)&iEventData);}
1.2794 +
1.2795 +inline TKeyEvent *TWsEvent::Key() const
1.2796 + /** Gets the key event.
1.2797 +
1.2798 + This function can be used to get information about the key event if Type()
1.2799 + returns an event of type EEventKey, EEventKeyUp or EEventKeyDown.
1.2800 +
1.2801 + @return Structure containing key event data */
1.2802 + {return((TKeyEvent *)&iEventData);}
1.2803 +
1.2804 +inline TWsVisibilityChangedEvent* TWsEvent::VisibilityChanged()
1.2805 + /** Gets information about the visibility changed event.
1.2806 +
1.2807 + This function can be used to get information about the visibility changed event
1.2808 + if Type() returns an event of type EEventWindowVisibilityChanged.
1.2809 +
1.2810 + @return Structure containing visibility changed event data */
1.2811 + { return reinterpret_cast<TWsVisibilityChangedEvent*>(iEventData); }
1.2812 +
1.2813 +inline const TWsVisibilityChangedEvent* TWsEvent::VisibilityChanged() const
1.2814 + /** Gets information about the visibility changed event.
1.2815 +
1.2816 + This function can be used to get information about the visibility changed event
1.2817 + if Type() returns an event of type EEventWindowVisibilityChanged.
1.2818 +
1.2819 + @return Structure containing visibility changed event data */
1.2820 + { return reinterpret_cast<const TWsVisibilityChangedEvent*>(iEventData); }
1.2821 +
1.2822 +inline TModifiersChangedEvent *TWsEvent::ModifiersChanged() const
1.2823 + /** Gets information about the modifier changed event.
1.2824 +
1.2825 + This function can be used to get information about the modifier changed event
1.2826 + if Type() returns an event of type EEventModifiersChanged.
1.2827 +
1.2828 + @return Structure containing modifier changed event data */
1.2829 + {return((TModifiersChangedEvent *)&iEventData);}
1.2830 +
1.2831 +inline TWsErrorMessage *TWsEvent::ErrorMessage() const
1.2832 + /** Gets an error event.
1.2833 +
1.2834 + This function can be used to get information about the error event if Type()
1.2835 + returns an event of type EEventErrorMessage.
1.2836 +
1.2837 + @return The error event. */
1.2838 + {return((TWsErrorMessage *)&iEventData);}
1.2839 +
1.2840 +inline TUint8 *TWsEvent::EventData() const
1.2841 + /** Gets information about the event.
1.2842 +
1.2843 + This function gives you direct access to the event data as a whole. The event
1.2844 + can be a key or pointer event or it could be a new special event that only
1.2845 + you and another application know about. You are limited to EWsEventDataSize
1.2846 + bytes worth of data.
1.2847 +
1.2848 + @return A pointer to the event data. */
1.2849 + {return((TUint8 *)&iEventData);}
1.2850 +
1.2851 +inline TInt TWsEvent::Type() const
1.2852 + /** Gets the type of event that occurred.
1.2853 +
1.2854 + @return The event type. Event types are defined in TEventCode. */
1.2855 + {return(iType);}
1.2856 +
1.2857 +inline TUint TWsEvent::Handle() const
1.2858 + /** Gets the window handle.
1.2859 +
1.2860 + This is the handle that was passed to the window's Construct() function: typically
1.2861 + it will be a pointer to the client-side object owning the window, providing
1.2862 + access to its member functions.
1.2863 +
1.2864 + @return The window handle. */
1.2865 + {return(iHandle);}
1.2866 +
1.2867 +inline TTime TWsEvent::Time() const
1.2868 + /** Gets the time when the event occurred.
1.2869 +
1.2870 + @return The time when the event occurred. */
1.2871 + {return(iTime);}
1.2872 +
1.2873 +inline void TWsEvent::SetType(TInt aType)
1.2874 + /** Sets the event type.
1.2875 +
1.2876 + @param aType The event type. Event types are defined in TEventCode. */
1.2877 + {iType=aType;}
1.2878 +
1.2879 +inline void TWsEvent::SetHandle(TUint aHandle)
1.2880 + /** Sets the event handle.
1.2881 +
1.2882 + This is the client handle of the window that is being sent the event.
1.2883 +
1.2884 + @param aHandle The event handle. */
1.2885 + {iHandle=aHandle;}
1.2886 +
1.2887 +inline void TWsEvent::SetTimeNow()
1.2888 + /** Sets the event time to the current time. */
1.2889 + {iTime.UniversalTime();}
1.2890 +
1.2891 +inline TInt *TWsEvent::Int() const
1.2892 + /** Gets the event data as a TInt.*/
1.2893 + { return (TInt*)&iEventData; }
1.2894 +
1.2895 +inline TUint TWsPriorityKeyEvent::Handle() const
1.2896 + /** Gets the handle for the window group which added the priority key.
1.2897 +
1.2898 + This is the handle that was passed to the window group's Construct() function.
1.2899 + Since most applications have only one window group, however, this function
1.2900 + is rarely used.
1.2901 +
1.2902 + @return The window group handle. */
1.2903 + {return(iHandle);}
1.2904 +
1.2905 +inline TKeyEvent *TWsPriorityKeyEvent::Key() const
1.2906 + /** Gets the priority key event.
1.2907 +
1.2908 + @return Structure containing priority key event data */
1.2909 + {return((TKeyEvent *)&iEventData);}
1.2910 +
1.2911 +inline void TWsPriorityKeyEvent::SetHandle(TUint aHandle)
1.2912 + /** Sets the window group event handle.
1.2913 +
1.2914 + This is the client handle of the window that is being sent the event.
1.2915 +
1.2916 + @param aHandle The event handle. */
1.2917 + {iHandle=aHandle;}
1.2918 +
1.2919 +inline CDirectScreenAccess::CDirectScreenAccess(RWsSession& aWs,CWsScreenDevice* aScreenDevice,RWindowBase& aWindow,MDirectScreenAccess& aAbort)
1.2920 + :CActive(RDirectScreenAccess::EPriorityVeryHigh), iWindow(aWindow), iAbort(aAbort), iDirectAccess(aWs)
1.2921 + {iWsScreenDevice=aScreenDevice;}
1.2922 +
1.2923 +inline CFbsBitGc* CDirectScreenAccess::Gc()
1.2924 + /** Gets the graphics context for drawing to the screen.
1.2925 +
1.2926 + This is set up by calling StartL(). Its origin is set so that you should use
1.2927 + window coordinates to specify which part of the screen to draw to and its
1.2928 + clipping region is set to the visible part of the window.
1.2929 +
1.2930 + Code built to run on the Emulator must call CFbsScreenDevice::Update() in
1.2931 + order to see the results of drawing to this graphics context, but this may
1.2932 + not be required on all target hardware.
1.2933 +
1.2934 + @return The graphics context for drawing to the screen. */
1.2935 + { return iGc; }
1.2936 +
1.2937 +inline CFbsScreenDevice*& CDirectScreenAccess::ScreenDevice()
1.2938 + /** Gets the screen device to draw to.
1.2939 +
1.2940 + You should not use this screen device to create fonts because the object is
1.2941 + deleted and recreated when direct screen access is aborted and restarted.
1.2942 + Instead, create and use your own CFbsScreenDevice object to create fonts.
1.2943 +
1.2944 + @return The target screen device. */
1.2945 + { return iScreenDevice; }
1.2946 +
1.2947 +inline RRegion* CDirectScreenAccess::DrawingRegion()
1.2948 + /** Gets the clipping region to draw to.
1.2949 +
1.2950 + You must not draw outside of this region.
1.2951 +
1.2952 + The clipping region is calculated when StartL() is called, and is only updated
1.2953 + if StartL() is called again.
1.2954 +
1.2955 + The region is specified in screen coordinates. This can be useful if you need
1.2956 + to reapply the clipping region to the graphics context (CFbsBitGc::SetClippingRegion()).
1.2957 +
1.2958 + @return The clipping region to draw to. */
1.2959 + { return iDrawingRegion; }
1.2960 +
1.2961 +inline TSizeMode::TSizeMode(TSize& aSize) :
1.2962 + iOrigin(0, 0), iScreenSize(aSize)
1.2963 + {}
1.2964 +
1.2965 +inline TInt TSizeMode::ScaledCord(TInt aOrigin,TInt aScale)
1.2966 + {return (aOrigin+aScale-1)/aScale;}
1.2967 +
1.2968 +inline TPoint TSizeMode::ScaledOrigin()
1.2969 + {return TPoint(ScaledCord(iOrigin.iX,iScreenScale.iWidth),ScaledCord(iOrigin.iY,iScreenScale.iHeight));}
1.2970 +
1.2971 +#endif