Manages display regions for two-dimensional rendered graphics.
The Surface class represents a rectangular region in the display hierarchy. It manages positioning, visibility, redraws, backing storage and focus for layered user interfaces. Surfaces work with Bitmap objects for rendered pixel data and with the Pointer class for pointer interaction.
A top-level surface is normally backed by an application window on hosted platforms such as Windows and Linux. For full screen displays and Android, a top-level surface can cover the display without a separate host window. Child surfaces are attached to a parent surface, creating a hierarchy whose ordering, clipping, redraw and input behaviour is managed by this class.
Building nested surface-only interfaces is supported, but most applications should use surfaces as hosts for VectorScene objects. This keeps interfaces resolution independent and matches the rendering path that Kōtuku optimises most heavily.
Surface content is preserved with a backing store where required. Surfaces that share a backing store are composited through their parent, while surfaces that need independent redraw, opacity, video memory or cursor behaviour can own a separate bitmap buffer.
The Surface class consists of the following fields:
Access | Name | Type | Comment | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| AbsX | INT | The absolute horizontal position of a surface object. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This field returns the surface's horizontal position relative to the top-level surface in its local hierarchy. Writing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| AbsY | INT | The absolute vertical position of a surface object. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This field returns the surface's vertical position relative to the top-level surface in its local hierarchy. Writing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| BitsPerPixel | INT | Defines the pixel depth used by the surface buffer. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set Reading this field returns the active tracked depth for the surface. A value of zero is returned if the surface is not available in the display surface list. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Bottom | INT | Returns the bottom-most coordinate of a surface object, Y + Height. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Buffer | OBJECTID | Refers to the Bitmap that stores the surface's graphics. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Each surface is assigned a bitmap buffer for drawing. In many cases this buffer is shared between multiple surfaces, so clients should treat it as an implementation detail unless no public drawing API provides the required access. The bitmap is an off-screen buffer. Direct changes to it are not exposed to the display automatically. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Colour | RGB8 | Defines the background colour used when clearing the surface. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set this field when a surface should be cleared to a solid background colour before drawing. String values may use A surface that does not define a colour is not cleared during redraw. In that case, draw the full background manually to avoid stale or uninitialised graphics appearing in exposed areas. A preset colour can be disabled by writing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Cursor | PTC | Sets the pointer image used while the mouse is over the surface. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The pointer automatically switches to the selected cursor image when it enters the surface area. The available cursor image settings are listed in the Pointer⇒CursorID documentation. The
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Display | OBJECTID | Refers to the Display object that manages the surface's graphics. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
All surfaces belong to a Display object that manages drawing to the user's video display. This field identifies the display that owns the surface. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Drag | OBJECTID | Defines the Surface that moves when this surface is dragged. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set this field to the Surface that should move when the user starts a click-drag operation over the current surface. For example, a window title bar would set Set | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DragStatus | DRAG | Reports the current drag state when dragging is enabled. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Read this field to determine whether the surface is idle, anchored for dragging or actively being moved.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Flags | RNF | Controls optional surface behaviour. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Use Read-only flags cannot be changed by writing this field. Initialisation-only flags can be set before the surface is initialised, but are preserved once the surface is active.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Height | UNIT | Defines the height of a surface object. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set By default the value is a fixed coordinate unit. With the A plain read returns the height resolved to a fixed pixel count, even when Changing Before initialisation, setting | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MaxHeight | INT | Prevents the height of a surface object from exceeding a certain value. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MaxWidth | INT | Prevents the width of a surface object from exceeding a certain value. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MinHeight | INT | Prevents the height of a surface object from shrinking beyond a certain value. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MinWidth | INT | Prevents the width of a surface object from shrinking beyond a certain value. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Modal | INT | Sets the surface as modal (prevents user interaction with other surfaces). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If set to Clearing this field restores the previous modal surface if one was recorded. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Opacity | DOUBLE | Defines the translucency applied when drawing a surface. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Non-opaque surfaces are drawn by rendering the surface content to its internal buffer and blending it with the background graphics. This can be costly, and the pre-copy feature may give better results for some compositions. Translucency can significantly increase CPU usage. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Parent | OBJECTID | Identifies the parent Surface. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Child surfaces use this field to identify their parent. Top-level surfaces have no parent. If | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PopOver | OBJECTID | Keeps a surface in front of another surface in the Z order. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set Set This field cannot be changed after initialisation. The value must identify a Surface; otherwise | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Right | INT | Returns the right-most coordinate of a surface object, X + Width. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Root | OBJECTID | Surface that is acting as a root for many surface children (useful when applying translucency) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| UserFocus | INT | Refers to the surface object that has the current user focus. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the object ID of the surface that has the primary user focus. Returns zero if no surface has focus. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Visible | INT | Indicates the visibility of a surface object. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Read this field to determine whether the surface itself is marked visible. A Effective on-screen visibility also depends on the parent chain. A visible child of a hidden parent is not displayed. Set this field, or call Hide() and Show(), to change the surface visibility. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Width | UNIT | Defines the width of a surface object. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set By default the value is a fixed coordinate unit. With the A plain read returns the width resolved to a fixed pixel count, even when Changing Before initialisation, setting | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WindowHandle | APTR | Refers to the surface's window handle (host dependent). | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This field exposes the host window handle for platforms that provide one. It is currently relevant when creating a primary surface within an X11 window manager or Microsoft Windows. Set | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| WindowType | SWIN | Defines how a top-level surface is represented by a hosted desktop. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This field affects hosted desktops such as Windows and X11. It only applies to top-level surfaces that have no parent. Child surfaces ignore this field, and surfaces created inside the desktop area treat the desktop as their parent. Custom surfaces remain responsible for their own window controls, such as title bars and resize borders.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| X | UNIT | Determines the horizontal position of a surface object. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set By default the value is a fixed coordinate unit. With the A plain read returns the horizontal position resolved to a fixed pixel coordinate relative to the parent, even when Changing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| XOffset | UNIT | Determines the horizontal offset of a surface object. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
When X is set and Width is not set, When Width is set, A plain read returns the offset resolved to a fixed pixel distance, even when the offset was defined as a scaled value. If no offset has been defined but both X and Width are present, the offset is derived from the parent width. Request the value with the | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Y | UNIT | Determines the vertical position of a surface object. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set By default the value is a fixed coordinate unit. With the A plain read returns the vertical position resolved to a fixed pixel coordinate relative to the parent, even when Changing | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| YOffset | UNIT | Determines the vertical offset of a surface object. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
When Y is set and Height is not set, When Height is set, A plain read returns the offset resolved to a fixed pixel distance, even when the offset was defined as a scaled value. If no offset has been defined but both Y and Height are present, the offset is derived from the parent height. Request the value with the | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The following actions are currently supported:
| Activate | Shows a surface object on the display. | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ERR acActivate(*Object) For top-level surfaces, Activate() delegates to Show() so that the hosted display window becomes visible. Child surfaces are not affected by this action. | ||||||||||||||||||||
| Disable | Disables a surface object. | |||||||||||||||||||
ERR acDisable(*Object) Disabled surfaces remain visible but cannot accept user focus through Focus(). | ||||||||||||||||||||
| Draw | Redraws the contents of a surface object. | |||||||||||||||||||
ERR acDraw(*Object, DOUBLE X, DOUBLE Y, DOUBLE Width, DOUBLE Height)
Calling the Draw action on a surface object will send redraw messages to every hook that has been attached to the surface object's drawing system. This has the effect of redrawing all graphics within the surface object. The procedure is as follows:
Please be aware that:
| ||||||||||||||||||||
| Enable | Enables a disabled surface object. | |||||||||||||||||||
ERR acEnable(*Object) Enable() clears the disabled state so that the surface can receive focus and normal interaction again. | ||||||||||||||||||||
| Focus | Changes the primary user focus to the surface object. | |||||||||||||||||||
ERR acFocus(*Object) Focus() makes the surface the primary focus target and notifies the affected focus subscribers. Focus is propagated through the surface hierarchy so that parent surfaces also record inherited focus. The request is ignored if the surface is disabled, marked with | ||||||||||||||||||||
| Hide | Hides a surface object from the display. | |||||||||||||||||||
ERR acHide(*Object) Hide() clears the visible state. For top-level surfaces it hides the hosted display window; for child surfaces it invalidates and exposes the covered parent area so that the background is redrawn. Hiding a modal surface also restores the previous modal surface, or clears modal mode if there is no previous surface. | ||||||||||||||||||||
| LostFocus | Informs a surface object that it has lost the user focus. | |||||||||||||||||||
ERR acLostFocus(*Object) LostFocus() clears the | ||||||||||||||||||||
| Move | Moves a surface object to a new display position. | |||||||||||||||||||
ERR acMove(*Object, DOUBLE DeltaX, DOUBLE DeltaY, DOUBLE DeltaZ)
Move() applies relative X and Y deltas to the surface. The request honours movement restrictions such as Queued Move() requests for the same surface may be combined before drawing occurs. After a successful move, redimension subscribers are notified with the surface's updated position and size. | ||||||||||||||||||||
| MoveToBack | Moves a surface object to the back of its container. | |||||||||||||||||||
ERR acMoveToBack(*Object) For child surfaces, MoveToBack() reorders the surface within its parent while preserving child hierarchy, bitmap ownership constraints, pop-over relationships and | ||||||||||||||||||||
| MoveToFront | Moves a surface object to the front of its container. | |||||||||||||||||||
ERR acMoveToFront(*Object) For child surfaces, MoveToFront() raises the surface within its parent while preserving child hierarchy, cursor ordering, bitmap ownership constraints, pop-over relationships and | ||||||||||||||||||||
| MoveToPoint | Moves a surface object to an absolute coordinate. | |||||||||||||||||||
ERR acMoveToPoint(*Object, DOUBLE X, DOUBLE Y, DOUBLE Z, MTF Flags)
MoveToPoint() converts the supplied absolute X and Y values into relative movement and forwards the request to Move(). Coordinates are changed only for axes enabled by the | ||||||||||||||||||||
| Redimension | Moves and resizes a surface object in a single action call. | |||||||||||||||||||
ERR acRedimension(*Object, DOUBLE X, DOUBLE Y, DOUBLE Z, DOUBLE Width, DOUBLE Height, DOUBLE Depth)
| ||||||||||||||||||||
| Resize | Alters the dimensions of a surface object. | |||||||||||||||||||
ERR acResize(*Object, DOUBLE Width, DOUBLE Height, DOUBLE Depth)
| ||||||||||||||||||||
| SaveImage | Saves the graphics of a surface object. | |||||||||||||||||||
ERR acSaveImage(*Object, OBJECTID Dest, CLASSID ClassID)
SaveImage() renders the visible content of a surface into an image and writes it to the destination object supplied in the action arguments. Visible child surfaces in the captured region are included in the resulting image. The image format is selected with the Errors returned while copying individual child surfaces can be propagated from CopySurface(). Error Codes
| ||||||||||||||||||||
| Show | Shows a surface object on the display. | |||||||||||||||||||
ERR acShow(*Object) Show() makes the surface visible. For top-level surfaces it shows the hosted display window; for child surfaces it sets the visible flag, redraws the surface and exposes the affected area. If the surface is modal, it becomes the active modal surface until it is hidden. | ||||||||||||||||||||
The following methods are currently supported:
| AddCallback | Inserts a function hook into the drawing process of a surface object. | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ERR drw::AddCallback(OBJECTPTR Object, FUNCTION Callback)
The AddCallback() method installs a draw callback for custom rendering directly into a surface. During a redraw, callbacks are invoked in subscription order and receive the target Bitmap for the surface. The C/C++ callback prototype is Callbacks may draw to the bitmap as they would to any other Bitmap. Use the Surface Width and Height fields to determine the drawable area, and respect the bitmap clipping region when writing pixels directly. Calling AddCallback() with a callback that is already registered for the same object moves that callback to the end of the callback list, making it run after the callbacks that remain before it. Error Codes
| |||||||||||||||||||||||||||
| ExposeToDisplay | Redraws a surface region to the display, preferably from its graphics buffer. | ||||||||||||||||||||||||||
ERR drw::ExposeToDisplay(OBJECTPTR Object, INT X, INT Y, INT Width, INT Height, EXF Flags)
Call the ExposeToDisplay() method to copy a surface region to the display. The functionality is identical to that of the ExposeSurface() function. Please refer to it for further documentation. Error Codes
| |||||||||||||||||||||||||||
| InvalidateRegion | Redraws all of the content in a surface object. | ||||||||||||||||||||||||||
ERR drw::InvalidateRegion(OBJECTPTR Object, INT X, INT Y, INT Width, INT Height)
Invalidating a surface object will cause everything within a specified area to be redrawn. This includes child surface objects that intersect with the area that you have specified. Parent regions that overlap are not included in the redraw. To quickly redraw an entire surface object's content, call this method directly without supplying an argument structure. If you want to redraw a surface object and ignore all of its surface children then you should use the Draw action instead of this method. If you want to refresh a surface area to the display then you should use the ExposeToDisplay() method instead. Exposing will use the graphics buffer to refresh the graphics, thus avoiding the speed loss of a complete redraw. Error Codes
| |||||||||||||||||||||||||||
| Minimise | For hosted surfaces only, this method will minimise the surface to an icon. | ||||||||||||||||||||||||||
ERR drw::Minimise(OBJECTPTR Object) If a surface is hosted in a desktop window, calling Minimise() performs the host platform's default minimise action on that window. On Microsoft Windows, this normally minimises the window to the taskbar. Calling Minimise() on a surface that is already in the minimised state may result in the host window being restored to the desktop. This behaviour is platform dependent and should be manually tested to confirm its reliability on the host platform. | |||||||||||||||||||||||||||
| RemoveCallback | Removes a callback previously inserted by AddCallback(). | ||||||||||||||||||||||||||
ERR drw::RemoveCallback(OBJECTPTR Object, FUNCTION Callback)
RemoveCallback() removes a draw callback that was previously inserted by AddCallback(). This method is scope restricted. A caller can remove only callbacks associated with its own object context, so callbacks added by other objects are not affected. Error Codes
| |||||||||||||||||||||||||||
| ScheduleRedraw | Schedules a redraw operation for the next frame. | ||||||||||||||||||||||||||
ERR drw::ScheduleRedraw(OBJECTPTR Object, INT RefreshRate)
Use ScheduleRedraw() to mark a surface for redraw on the next frame cycle. The delay is governed by the chosen RefreshRate, which is measured in frames per second. If a RefreshRate is not specified, the frame rate is derived from the display. Specifying a custom RefreshRate is recommended when processing an animation at a lower frame rate than that of the display would be acceptable. Scheduling with this method over Draw() (immediate mode) is recommended when a cluster of redraw events may occur within a tight time period, and it would be inefficient to draw those changes to the display individually. Repeated redraw requests made to the target surface are coalesced until the scheduled redraw is processed. Redraw schedules do not collapse in nested surfaces. If both a surface and one of its children are scheduled, two redraw operations may be triggered where one would otherwise suffice. Target the top-level surface only in such instances. Error Codes
| |||||||||||||||||||||||||||
| SetDisplay | Changes the screen resolution (applies to top-level surface objects only). | ||||||||||||||||||||||||||
ERR drw::SetDisplay(OBJECTPTR Object, INT X, INT Y, INT Width, INT Height, INT InsideWidth, INT InsideHeight, INT BitsPerPixel, DOUBLE RefreshRate, INT Flags)
The SetDisplay method is used to change the screen resolution of the top-level surface object (which represents the screen display). It allows you to set the size of the display and you may also change the bitmap depth and the monitor's refresh rate. If successful, the change is immediate. This method exercises some intelligence in adjusting the display to your requested settings. For instance, if the requested width and/or height is not available, the closest display setting will be chosen. This method does not work on anything other than top-level surface objects. The current top-level surface object is usually named "SystemSurface" by default and can be searched for by that name. Error Codes
| |||||||||||||||||||||||||||
| SetOpacity | Alters the opacity of a surface object. | ||||||||||||||||||||||||||
ERR drw::SetOpacity(OBJECTPTR Object, DOUBLE Value, DOUBLE Adjustment)
SetOpacity() changes the opacity multiplier for a surface that owns its bitmap buffer. The final value is clamped by the Opacity field setter. If the surface is visible, a redraw is queued so the new opacity is reflected on the display without blocking the caller. Error Codes
| |||||||||||||||||||||||||||
| Name | Description |
|---|---|
| DRAG::ANCHOR | The surface is being dragged and the mouse pointer is anchored to the surface. |
| DRAG::NONE | The surface is not being dragged. |
| DRAG::NORMAL | The surface is being dragged. |
Optional flags for the ExposeSurface() function.
| Name | Description |
|---|---|
| EXF::ABSOLUTE | The supplied coordinates for exposure are absolute (relative to the display). |
| EXF::ABSOLUTE_COORDS | The supplied coordinates for exposure are absolute (relative to the display). |
| EXF::CHILDREN | If set, all child surfaces that intersect with exposed region will be included in the expose operation. |
| EXF::REDRAW_VOLATILE | Redraw every volatile object that intersects with the expose region, including internal volatile children. |
| EXF::REDRAW_VOLATILE_OVERLAP | Only redraw volatile objects that obscure the expose region from a position outside of the target surface and its children. Useful if no redrawing has occurred in the surface, but the surface has moved to a new position and the parents need to be redrawn. |
JET constants are documented in GetInputEvent()
| Name | Description |
|---|---|
| JET::ABS_XY | The X, Y values are defined as absolute coordinates, relative to the top-left of the display |
| JET::BUTTON_1 | Left mouse button; XBox A button, PS square button. Value is pressure sensitive, ranging between 0 - 1.0 (0 is released, 1.0 is fully depressed) |
| JET::BUTTON_10 | Non-specific button assignment |
| JET::BUTTON_2 | Right mouse button; XBox X button, PS cross button |
| JET::BUTTON_3 | Middle mouse button; XBox Y button, PS triangle |
| JET::BUTTON_4 | Alt. mouse button 1; XBox B button, PS circle |
| JET::BUTTON_5 | Alt. mouse button 2 |
| JET::BUTTON_6 | Non-specific button assignment |
| JET::BUTTON_7 | Non-specific button assignment |
| JET::BUTTON_8 | Non-specific button assignment |
| JET::BUTTON_9 | Non-specific button assignment |
| JET::CROSSED_IN | This message is sent by the input system when the mouse pointer enters an area for the first time. The message value refers to the object ID of the container being monitored for movement |
| JET::CROSSED_OUT | This message is sent by the input system when the mouse pointer leaves an area. The message value refers to the object ID of the container being monitored for movement |
| JET::DEVICE_TILT_XY | Controller tilted on the X/Y axis. Value indicates angle, -ve = left, +ve = right |
| JET::DEVICE_TILT_Z | Controller is rising or falling. Value expressed as 'speed', |
| JET::DISPLAY_EDGE | Recently supplied input occurred at the edge of the display |
| JET::PEN_TILT_XY | Pen tilt angle. 0 is pointing down directly with nib at bottom, 0.5 is 90 degrees, 1.0 is inversed (eraser at bottom) |
| JET::PRESSURE | Amount of pressure applied, ranges from 0 (none) to 1.0 (normal) and possibly higher if user presses hard enough |
| JET::WHEEL | Mouse wheel rotation - the value generally reflects the number of 'clicks' rotated on the wheel |
| JET::WHEEL_TILT | Some mouse wheels can be tilted to the left or right. Ranges from -1.0 to +1.0 |
JTYPE flags are used to categorise input types
| Name | Description |
|---|---|
| JTYPE::ANALOG | Analog movement (ranging from -1.0 to 1.0) |
| JTYPE::ANCHORED | Cursor has been anchored with LockCursor() |
| JTYPE::BUTTON | Input is a physical button or switch |
| JTYPE::CROSSING | Crossing events manage the entering and leaving of an area |
| JTYPE::DBL_CLICK | Set by the input system if the Type is a button and the button has been clicked in quick succession so as to be classed as a double-click |
| JTYPE::DIGITAL | D-Pad or digital joystick source (restricted to +/- 1) |
| JTYPE::DRAGGED | Set if sufficient movement occurred between the original click and its point of release (usually requires a 3 or more pixel difference) |
| JTYPE::DRAG_ITEM | This special flag is set by the input system if the pointer is click-dragging an object at the time of the event |
| JTYPE::EXT_MOVEMENT | Extended or indirect movement information. This covers all types of movement that are unconnected to coordinate positioning - mouse wheel movement and pen tilt are two such examples |
| JTYPE::MOVEMENT | X/Y coordinate movement only. Movement such as the wheel mouse spinning is not covered by this type as it does not influence the coordinate system |
| JTYPE::REPEATED | Input is a repeated entry (i.e. user is holding down a button and a repetition timer is being triggered) |
| JTYPE::SECONDARY | Indicates to the receiver of this message that it is not the primary/original recipient |
Predefined cursor styles
| Name | Description |
|---|---|
| PTC::CROSSHAIR | The cross hair is used for targeting specific pixel points (common in paint programs). |
| PTC::CUSTOM | Works in conjunction with the SetCustomCursor() function to represent a program defined bitmap. |
| PTC::DEFAULT | The default cursor (usually an arrow pointing to the upper left). |
| PTC::DRAGGABLE | Used to indicate that a surface or object can be dragged by the user. |
| PTC::END | |
| PTC::HAND | The hand cursor is often used for indicating click-able content (hyper-links, icons etc). |
| PTC::HAND_LEFT | Similar to the standard hand cursor, but points to the left. |
| PTC::HAND_RIGHT | Similar to the standard hand cursor, but points to the right. |
| PTC::INVISIBLE | The cursor graphic is invisible (but will continue to operate as normal in all other respects). |
| PTC::MAGNIFIER | Represents a magnifying glass. |
| PTC::NO_CHANGE | |
| PTC::PAINTBRUSH | The paintbrush cursor is typically employed by paint programs. |
| PTC::SIZE_BOTTOM | Sizing cursor - for resizing the bottom edge of any rectangular area. |
| PTC::SIZE_BOTTOM_LEFT | Sizing cursor - for resizing the bottom left corner of any rectangular area. |
| PTC::SIZE_BOTTOM_RIGHT | Sizing cursor - for resizing the bottom right corner of any rectangular area. |
| PTC::SIZE_LEFT | Sizing cursor - for resizing the left edge of any rectangular area. |
| PTC::SIZE_RIGHT | Sizing cursor - for resizing the right edge of any rectangular area. |
| PTC::SIZE_TOP | Sizing cursor - for resizing the top edge of any rectangular area. |
| PTC::SIZE_TOP_LEFT | Sizing cursor - for resizing the top left corner of any rectangular area. |
| PTC::SIZE_TOP_RIGHT | Sizing cursor - for resizing the top right corner of any rectangular area. |
| PTC::SIZING | Multi-directional sizing cursor - for resizing in any direction. |
| PTC::SLEEP | The sleep cursor is used to inform the user that the computer is busy. |
| PTC::SPLIT_HORIZONTAL | The horizontal split cursor is typically used for splitting rectangles in half, or dragging a horizontal split within a large rectangular space. |
| PTC::SPLIT_VERTICAL | The vertical split cursor is typically used for splitting rectangles in half, or dragging a vertical split within a large rectangular space. |
| PTC::STOP | The stop cursor is used to inform the user that an operation is not possible (e.g. drag and drop to an unsupported object area). |
| PTC::TEXT | The text cursor is popular for the precise positioning of text cursors. |
Switches for the Surface class' Flags field.
| Name | Description |
|---|---|
| RNF::AFTER_COPY | Read-only. Indicates that after-copy mode has been enabled. |
| RNF::ASPECT_RATIO | When resizing, enforce the aspect ratio as defined by the diagonal from Surface⇒MinWidth, Surface⇒MinHeight to Surface⇒MaxWidth, Surface⇒MaxHeight. |
| RNF::AUTO_QUIT | The surface object will send a quit message to its supporting process when and if the Close method is called. This flag is typically used when a surface object represents a core window for an application. |
| RNF::COMPOSITE | Do not copy background information into the surface buffer - composite on the fly instead |
| RNF::DISABLED | This flag is set if the Disable action has been called on a surface object. Calling the Enable action will turn off the flag setting. |
| RNF::FIXED_BUFFER | Passes the NEVER_SHRINK option to the surface bitmap |
| RNF::FIXED_DEPTH | The target buffer always remains at the same depth |
| RNF::FULL_SCREEN | Allow the surface to open as a new screen display |
| RNF::GRAB_FOCUS | Helps application windows manage the user's focus within the window |
| RNF::HAS_FOCUS | Read-only. If set, this flag indicates that the surface object currently has the focus. |
| RNF::HOST | Define host on initialisation to create a container that can host surfaces from other processes. |
| RNF::IGNORE_FOCUS | Focus is diverted directly to the parent |
| RNF::INIT_ONLY | Synonym for HOST | TRANSPARENT | DISABLED | PRECOPY | VIDEO | FIXED_BUFFER | PERVASIVE_COPY | FIXED_DEPTH | FULL_SCREEN | IGNORE_FOCUS |
| RNF::NO_FOCUS | Prevents any kind of focussing on this object; no circumvention is possible |
| RNF::NO_HORIZONTAL | Turns off all horizontal movement (applies to the Move() action only). |
| RNF::NO_PRECOMPOSITE | Do not copy background information into the surface buffer - composite on the fly instead |
| RNF::NO_VERTICAL | Turns off all vertical movement (applies to the Move() action only). |
| RNF::PERVASIVE_COPY | This flag can be set in conjunction with after-copy mode. It forces the after-copy support routine to copy graphics over the entire surface area, rather than avoiding the graphics of child surfaces. |
| RNF::POST_COMPOSITE | Do not copy background information into the surface buffer - composite on the fly instead |
| RNF::PRECOPY | Enables pre-copy mode, which means that all graphics behind the surface object are copied into the bitmap buffer prior to any redraw. This mode can have a noticable impact on CPU time when drawing. |
| RNF::READ_ONLY | Synonym for HAS_FOCUS | CURSOR | AFTER_COPY |
| RNF::STICKY | Prevents any response to the Move action. It can be circumvented by writing to coordinate fields directly. |
| RNF::STICK_TO_BACK | Enable if the surface object must stick to the back of its container. |
| RNF::STICK_TO_FRONT | Enable if the surface object must stick to the front of its container. |
| RNF::TOTAL_REDRAW | Perform a total redraw of the entire surface when drawing - no partial draws |
| RNF::TRANSPARENT | Enables transparency, which means that the internal graphics routines will ignore this surface during redraws. It is typically used when creating containers that will host other surfaces. |
| RNF::VIDEO | Set this flag if you would like the surface object's data to be managed in video memory only. While this can give some speed advantages, be warned that video based surfaces are limited to write-only operations. |
| RNF::VISIBLE | If a surface object is visible to the user, the VISIBLE flag will be set. If the flag is not set, the surface object is hidden. |
| RNF::VOLATILE | Synonym for PRECOPY | AFTER_COPY | CURSOR |
| RNF::WRITE_ONLY | Set this flag if you would like the surface object's data to be managed in video memory only. While this can give some speed advantages, be warned that video based surfaces are limited to write-only operations. |
| Name | Description |
|---|---|
| RT::ROOT | Can be used by window surfaces to identify themselves as a root layer. |
Options for the Surface WindowType field.
| Name | Description |
|---|---|
| SWIN::HOST | Default to the standard hosted window mode with full titlebar, borders and taskbar representation. |
| SWIN::ICON_TRAY | Create a borderless (custom) window with icon tray representation. |
| SWIN::NONE | Create a borderless (custom) window with no UI representation. |
| SWIN::TASKBAR | Create a borderless (custom) window with taskbar representation. |
| Field | Type | Description |
|---|---|---|
| Next | const struct InputEvent * | Next event in the chain |
| Value | DOUBLE | The value associated with the Type |
| Timestamp | INT64 | PreciseTime() of the recorded input |
| RecipientID | OBJECTID | Surface that the input message is being conveyed to |
| OverID | OBJECTID | Surface that is directly under the mouse pointer at the time of the event |
| AbsX | DOUBLE | Absolute horizontal position of mouse cursor (relative to the top left of the display) |
| AbsY | DOUBLE | Absolute vertical position of mouse cursor (relative to the top left of the display) |
| X | DOUBLE | Horizontal position relative to the surface that the pointer is over - unless a mouse button is held or pointer is anchored - then the coordinates are relative to the click-held surface |
| Y | DOUBLE | Vertical position relative to the surface that the pointer is over - unless a mouse button is held or pointer is anchored - then the coordinates are relative to the click-held surface |
| DeviceID | OBJECTID | The hardware device that this event originated from |
| Type | JET | JET constant that describes the event |
| Flags | JTYPE | Broad descriptors for the given Type (see JTYPE flags). Automatically defined when delivered to the pointer object |
| Mask | JTYPE | Mask to use for checking against subscribers |