Parasol Framework
  • Gallery
  • API
  • Wiki
  • GitHub
    • Audio
    • Core
    • Display
    • Fluid
    • Font
    • Network
    • Vector
    • Audio
    • Sound
    • File
    • MetaClass
    • Module
    • StorageDevice
    • Task
    • Thread
    • Time
    • Compression
    • Config
    • Script
    • XML
    • Controller
    • BlurFX
    • ColourFX
    • CompositeFX
    • ConvolveFX
    • DisplacementFX
    • FilterEffect
    • FloodFX
    • ImageFX
    • LightingFX
    • MergeFX
    • MorphologyFX
    • OffsetFX
    • RemapFX
    • SourceFX
    • TurbulenceFX
    • WaveFunctionFX
    • Scintilla
    • ScintillaSearch
    • Bitmap
    • Clipboard
    • Display
    • Document
    • Font
    • Picture
    • Pointer
    • Surface
    • SVG
    • ClientSocket
    • HTTP
    • NetSocket
    • Proxy
    • Vector
    • VectorClip
    • VectorColour
    • VectorEllipse
    • VectorFilter
    • VectorGradient
    • VectorGroup
    • VectorImage
    • VectorPath
    • VectorPattern
    • VectorPolygon
    • VectorRectangle
    • VectorScene
    • VectorShape
    • VectorSpiral
    • VectorText
    • VectorTransition
    • VectorViewport
    • VectorWave

Surface Class

Manages the display and positioning of 2-Dimensional rendered graphics.

The Surface class is used to manage the positioning, drawing and interaction with layered display interfaces. It works in conjunction with the Bitmap class for rendering graphics, and the Pointer class for user interaction.

On a platform such as Windows or Linux, the top-level surface will typically be hosted in an application window. On Android or when a full screen display is required, a surface can cover the entire display and be window-less. The top-level surface can act as a host to additional surfaces, which are referred to as children. Placing more surface objects inside of these children will create a hierarchy of many objects that requires sophisticated management that is provisioned by the Surface class.

Although pure surface based UI's are possible, clients should always pursue the more simplistic approach of using surfaces to host VectorScene objects that describe vector based interfaces. Doing so is in keeping with our goal of proving fully scalable interfaces to users, and we optimise features with that use-case in mind.

Structure

The Surface class consists of the following fields:

Access
NameTypeComment
  AbsXINTThe absolute horizontal position of a surface object.

This field returns the absolute horizontal position of a surface object. The absolute value is calculated based on the surface object's position relative to the top most surface object in the local hierarchy.

It is possible to set this field, but only after initialisation of the surface object has occurred.

  AbsYINTThe absolute vertical position of a surface object.

This field returns the absolute vertical position of a surface object. The absolute value is calculated based on the surface object's position relative to the top most surface object in the local hierarchy.

It is possible to set this field, but only after initialisation of the surface object has occurred.

  AlignALIGNThis field allows you to align a surface area within its owner.

If you would like to set an abstract position for a surface area, you can give it an alignment. This feature is most commonly used for horizontal and vertical centring, as aligning to the the edges of a surface area is already handled by existing dimension fields. Note that setting the alignment overrides any settings in related coordinate fields. Valid alignment flags are BOTTOM, CENTER/MIDDLE, LEFT, HORIZONTAL, RIGHT, TOP, VERTICAL.

NameDescription
ALIGN::BOTTOMAlign to bottom
ALIGN::CENTERSynonym for HORIZONTAL | VERTICAL
ALIGN::HORIZONTALAlign to horizontal center
ALIGN::LEFTAlign to left
ALIGN::MIDDLESynonym for HORIZONTAL | VERTICAL
ALIGN::RIGHTAlign to right
ALIGN::TOPAlign to top
ALIGN::VERTICALAlign to vertical center
  BitsPerPixelINTDefines the number of bits per pixel for a surface.

The BitsPerPixel field may be set prior to initialisation in order to force a particular bits-per-pixel setting that may not match the display. This will result in the graphics system converting each pixel when drawing the surface to the display and as such is not recommended.

  BottomINTReturns the bottom-most coordinate of a surface object, Y + Height.
  BottomLimitINTPrevents a surface object from moving beyond a given point at the bottom of its container.

A client can prevent a surface object from moving beyond a given point at the bottom of its container by setting this field. If for example you were to set the BottomLimit to 5, then any attempt to move the surface object into or beyond the 5 units at the bottom of its container would fail.

Limits only apply to movement, as induced through the Move() action. This means that limits can be over-ridden by setting the coordinate fields directly (which can be useful in certain cases).

  BufferOBJECTIDThe ID of the bitmap that manages the surface's graphics.

Each surface is assigned a bitmap buffer that is referred to in this field. In many cases the bitmap will be shared between multiple surfaces. A client should avoid interacting with the buffer unless circumstances are such that there are no other means to get access to internal graphics information.

Please note that the bitmap object represents an off-screen, temporary buffer. Drawing to the bitmap directly will have no impact on the display.

  ColourRGB8String-based field for setting the background colour.

If the surface object should have a plain background colour, set this field to the colour value that you want to use. The colour must be specified in the standard format of #RRGGBB for hexadecimal or Red,Green,Blue for decimal components.

Surface objects that do not have a colour will not be cleared when being drawn. The background will thus consist of 'junk' graphics and the background will need to be drawn using another method. This gives your the power to choose the fastest drawing model to suit your needs.

If you set the Colour and later want to turn the background colour off, write a NULL value to the Colour field or set the Alpha component to zero. Changing the Colour field does not cause a graphics redraw.

  CursorPTCA default cursor image can be set here for changing the mouse pointer.

The Cursor field provides a convenient way of setting the pointer's cursor image in a single operation. The mouse pointer will automatically switch to the specified cursor image when it enters the surface area.

The available cursor image settings are listed in the Pointer⇒CursorID documentation.

The Cursor field may be written with valid cursor names or their ID's, as you prefer.

NameDescription
PTC::CROSSHAIRThe cross hair is used for targeting specific pixel points (common in paint programs).
PTC::CUSTOMWorks in conjunction with the SetCustomCursor() function to represent a program defined bitmap.
PTC::DEFAULTThe default cursor (usually an arrow pointing to the upper left).
PTC::DRAGGABLEUsed to indicate that a surface or object can be dragged by the user.
PTC::END
PTC::HANDThe hand cursor is often used for indicating click-able content (hyper-links, icons etc).
PTC::HAND_LEFTSimilar to the standard hand cursor, but points to the left.
PTC::HAND_RIGHTSimilar to the standard hand cursor, but points to the right.
PTC::INVISIBLEThe cursor graphic is invisible (but will continue to operate as normal in all other respects).
PTC::MAGNIFIERRepresents a magnifying glass.
PTC::NO_CHANGE
PTC::PAINTBRUSHThe paintbrush cursor is typically employed by paint programs.
PTC::SIZE_BOTTOMSizing cursor - for resizing the bottom edge of any rectangular area.
PTC::SIZE_BOTTOM_LEFTSizing cursor - for resizing the bottom left corner of any rectangular area.
PTC::SIZE_BOTTOM_RIGHTSizing cursor - for resizing the bottom right corner of any rectangular area.
PTC::SIZE_LEFTSizing cursor - for resizing the left edge of any rectangular area.
PTC::SIZE_RIGHTSizing cursor - for resizing the right edge of any rectangular area.
PTC::SIZE_TOPSizing cursor - for resizing the top edge of any rectangular area.
PTC::SIZE_TOP_LEFTSizing cursor - for resizing the top left corner of any rectangular area.
PTC::SIZE_TOP_RIGHTSizing cursor - for resizing the top right corner of any rectangular area.
PTC::SIZINGMulti-directional sizing cursor - for resizing in any direction.
PTC::SLEEPThe sleep cursor is used to inform the user that the computer is busy.
PTC::SPLIT_HORIZONTALThe horizontal split cursor is typically used for splitting rectangles in half, or dragging a horizontal split within a large rectangular space.
PTC::SPLIT_VERTICALThe vertical split cursor is typically used for splitting rectangles in half, or dragging a vertical split within a large rectangular space.
PTC::STOPThe 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::TEXTThe text cursor is popular for the precise positioning of text cursors.
  DimensionsDMFIndicates currently active dimension settings.

The dimension settings of a surface object can be read from this field. The flags indicate the dimension fields that are in use, and whether the values are fixed or relative.

It is strongly recommended that this field is never set manually, because the flags are automatically managed for the client when setting fields such as X and Width. If circumstances require manual configuration, take care to ensure that the flags do not conflict. For instance, FIXED_X and SCALED_X cannot be paired, nor could FIXED_X, FIXED_XOFFSET and FIXED_WIDTH simultaneously.

NameDescription
DMF::FIXED_CENTER_XThe CenterX field is a fixed size.
DMF::FIXED_CENTER_YThe CenterY field is a fixed size.
DMF::FIXED_DEPTHThe Depth field is a fixed size.
DMF::FIXED_HEIGHTThe Height field is a fixed size.
DMF::FIXED_RADIUS_XThe RadiusX field is a fixed size.
DMF::FIXED_RADIUS_YThe RadiusY field is a fixed size.
DMF::FIXED_WIDTHThe Width field is a fixed suze.
DMF::FIXED_XThe X field is a fixed coordinate.
DMF::FIXED_X_OFFSETThe XOffset field is a fixed coordinate.
DMF::FIXED_YThe Y field is a fixed coordinate.
DMF::FIXED_Y_OFFSETThe YOffset field is a fixed coordinate.
DMF::FIXED_ZThe Z field is a fixed coordinate.
DMF::SCALED_CENTER_XThe CenterX field is scaled to this object's parent.
DMF::SCALED_CENTER_YThe CenterY field is scaled to this object's parent.
DMF::SCALED_DEPTHThe Depth field is scaled to this object's parent.
DMF::SCALED_HEIGHTThe Height field is scaled to this object's parent.
DMF::SCALED_RADIUS_XThe RadiusX field is scaled to this object's parent.
DMF::SCALED_RADIUS_YThe RadiusY field is a scaled size to this object's parent.
DMF::SCALED_WIDTHThe Width field is scaled to this object's parent.
DMF::SCALED_XThe X field is scaled to this object's parent.
DMF::SCALED_X_OFFSETThe XOffset field is scaled to this object's parent.
DMF::SCALED_YThe Y field is scaled to this object's parent.
DMF::SCALED_Y_OFFSETThe YOffset field is scaled to this object's parent.
DMF::SCALED_ZThe Z field is a scaled coordinate to this object's parent.
DMF::STATUS_CHANGE_H
DMF::STATUS_CHANGE_V
  DisplayOBJECTIDRefers to the Display object that is managing the surface's graphics.

All surfaces belong to a Display object that manages drawing to the user's video display. This field refers to the Display object of which the surface is a member.

  DragOBJECTIDThis object-based field is used to control the dragging of objects around the display.

Click-dragging of surfaces is enabled by utilising the Drag field.

To use, write this field with reference to a Surface that is to be dragged when the user starts a click-drag operation. For instance, if you create a window with a title-bar at the top, you would set the Drag field of the title-bar to point to the object ID of the window. If necessary, you can set the Drag field to point back to your surface object (this can be useful for creating icons and other small widgets).

To turn off dragging, set the field to zero.

  DragStatusDRAGIndicates the draggable state when dragging is enabled.

If the surface is draggable, the DragStatus indicates the current state of the surface with respect to it being dragged.

NameDescription
DRAG::ANCHORThe surface is being dragged and the mouse pointer is anchored to the surface.
DRAG::NONEThe surface is not being dragged.
DRAG::NORMALThe surface is being dragged.
  FlagsRNFOptional flags.

The Flags field allows special options to be set for a surface object. Use a logical-OR operation when setting this field so that existing flags are not overwritten. To not do so can produce unexpected behaviour.

NameDescription
RNF::AFTER_COPYRead-only. Indicates that after-copy mode has been enabled.
RNF::ASPECT_RATIOWhen resizing, enforce the aspect ratio as defined by the diagonal from Surface⇒MinWidth, Surface⇒MinHeight to Surface⇒MaxWidth, Surface⇒MaxHeight.
RNF::AUTO_QUITThe 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::COMPOSITEDo not copy background information into the surface buffer - composite on the fly instead
RNF::DISABLEDThis 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_BUFFERPasses the NEVER_SHRINK option to the surface bitmap
RNF::FIXED_DEPTHThe target buffer always remains at the same depth
RNF::FULL_SCREENAllow the surface to open as a new screen display
RNF::GRAB_FOCUSHelps application windows manage the user's focus within the window
RNF::HAS_FOCUSRead-only. If set, this flag indicates that the surface object currently has the focus.
RNF::HOSTDefine host on initialisation to create a container that can host surfaces from other processes.
RNF::IGNORE_FOCUSFocus is diverted directly to the parent
RNF::INIT_ONLYSynonym for HOST | TRANSPARENT | DISABLED | PRECOPY | VIDEO | FIXED_BUFFER | PERVASIVE_COPY | FIXED_DEPTH | FULL_SCREEN | IGNORE_FOCUS
RNF::NO_FOCUSPrevents any kind of focussing on this object; no circumvention is possible
RNF::NO_HORIZONTALTurns off all horizontal movement (applies to the Move() action only).
RNF::NO_PRECOMPOSITEDo not copy background information into the surface buffer - composite on the fly instead
RNF::NO_VERTICALTurns off all vertical movement (applies to the Move() action only).
RNF::PERVASIVE_COPYThis 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_COMPOSITEDo not copy background information into the surface buffer - composite on the fly instead
RNF::PRECOPYEnables 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_ONLYSynonym for HAS_FOCUS | CURSOR | AFTER_COPY
RNF::STICKYPrevents any response to the Move action. It can be circumvented by writing to coordinate fields directly.
RNF::STICK_TO_BACKEnable if the surface object must stick to the back of its container.
RNF::STICK_TO_FRONTEnable if the surface object must stick to the front of its container.
RNF::TOTAL_REDRAWPerform a total redraw of the entire surface when drawing - no partial draws
RNF::TRANSPARENTEnables 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::VIDEOSet 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::VISIBLEIf 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::VOLATILESynonym for PRECOPY | AFTER_COPY | CURSOR
RNF::WRITE_ONLYSet 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.
  HeightINTDefines the height of a surface object.

The height of a surface object is manipulated through this field. Alternatively, use the Resize() action to adjust the Width and Height at the same time. A client can set the Height as a fixed value by default, or as a scaled value in conjunction with the FD_SCALED flag. Scaled values are multiplied by the height of their parent container.

Setting the Height while a surface object is on display causes an immediate graphical update to reflect the change. Any objects that are within the surface area will be re-drawn and resized as necessary.

If a value less than zero is passed to an initialised surface, the height will be 'turned off' - this is convenient for pairing the Y and YOffset fields together for dynamic height adjustment.

  LeftLimitINTPrevents a surface object from moving beyond a given point on the left-hand side.

A client can prevent a surface object from moving beyond a given point at the left-hand side of its container by setting this field. If for example you were to set the LeftLimit to 3, then any attempt to move the surface object into or beyond the 3 units at the left of its container would fail.

Limits only apply to movement, as induced through the Move() action. This means it is possible to override limits by setting the coordinate fields directly.

  MaxHeightINTPrevents the height of a surface object from exceeding a certain value.

A client can limit the maximum height of a surface object by setting this field. Limiting the height affects resizing, making it impossible to use the Resize() action to extend beyond the height you specify.

It is possible to circumvent the MaxHeight by setting the Height field directly.

  MaxWidthINTPrevents the width of a surface object from exceeding a certain value.

A client can limit the maximum width of a surface object by setting this field. Limiting the width affects resizing, making it impossible to use the Resize() action to extend beyond the width you specify.

It is possible to circumvent the MaxWidth by setting the Width field directly.

  MinHeightINTPrevents the height of a surface object from shrinking beyond a certain value.

A client can prevent the height of a surface object from shrinking too far by setting this field. This feature specifically affects resizing, making it impossible to use the Resize() action to shrink the height of a surface object to a value less than the one you specify.

It is possible to circumvent the MinHeight by setting the Height field directly.

  MinWidthINTPrevents the width of a surface object from shrinking beyond a certain value.

A client can prevent the width of a surface object from shrinking too far by setting this field. This feature specifically affects resizing, making it impossible to use the Resize() action to shrink the width of a surface object to a value less than the one you specify.

It is possible to circumvent the MinWidth by setting the Width field directly.

  ModalINTSets the surface as modal (prevents user interaction with other surfaces).

If true, the surface will become the modal surface for the program when it is shown. This prevents interaction with other surfaces until the modal surface is either hidden or destroyed. Children of the modal surface may be interacted with normally.

  MovementINTLimits the movement of a surface object to vertical or horizontal shifts.

The directions in which a surface object can move can be limited by setting the Movement field. By default, a surface object is capable of moving both horizontally and vertically.

This field is only effective in relation to the Move action, and it is possible to circumvent the restrictions by setting the coordinate fields directly.

NameDescription
  OpacityDOUBLEAffects the level of translucency applied to a surface object.

This field determines the translucency level of a surface area. The default setting is 100%, which means that the surface will be solid. Any other value that you set here will alter the impact of a surface over its destination area. High values will retain the boldness of the graphics, while low values can surface it close to invisible.

Note: The translucent drawing routine works by drawing the surface content to its internal buffer first, then copying the graphics that are immediately in the background straight over the top with an alpha-blending routine. This is not always ideal and better results might be obtainable with the pre-copy feature.

Please note that the use of translucency is realised at a significant cost to CPU usage.

  ParentOBJECTIDThe parent for a surface is defined here.

The parent for child surfaces is defined here. Top level surfaces will have no parent. If the Parent field is not set prior to initialisation, the surface class will attempt to discover a valid parent by checking its ownership chain for a surface object. This behaviour can be switched off by setting a Parent of zero prior to initialisation.

  PopOverOBJECTIDKeeps a surface in front of another surface in the Z order.

Setting the PopOver field to a sibling surface ID will keep the surface in front of its sibling at all times. For dialog windows, it is recommended that the popover and modal options be combined together to prevent interaction with other surfaces created by the current program.

Setting the PopOver field to zero will return the surface to its normal state.

If an object that does not belong to the Surface class is detected, an attempt will be made to read that object's Surface field, if available. If this does not yield a valid surface then ERR::InvalidObject is returned.

  RightINTReturns the right-most coordinate of a surface object, X + Width.
  RightLimitINTPrevents a surface object from moving beyond a given point on the right-hand side.

A client can prevent a surface object from moving beyond a given point at the right-hand side of its container by setting this field. If for example you were to set the RightLimit to 8, then any attempt to move the surface object into or beyond the 8 units at the right-hand side of its container would fail.

Limits only apply to movement, as induced through the Move() action. This means that limits can be over-ridden by setting the coordinate fields directly (which can be useful in certain cases).

  RootOBJECTIDSurface that is acting as a root for many surface children (useful when applying translucency)
  TopLimitINTPrevents a surface object from moving beyond a given point at the top of its container.

A client can prevent a surface object from moving beyond a given point at the top of its container by setting this field. If for example you were to set the TopLimit to 10, then any attempt to move the surface object into or beyond the 10 units at the top of its container would fail.

Limits only apply to movement, as induced through the Move() action. This means that limits can be over-ridden by setting the coordinate fields directly (which can be useful in certain cases).

  UserFocusINTRefers to the surface object that has the current focus.

Returns the surface object that has the primary user focus. Returns zero if no object has the focus.

  VisibleINTIndicates the visibility of a surface object.

If you need to know if a surface object is visible or hidden, you can read this field to find out either way. A true value is returned if the object is visible and false is returned if the object is invisible. Note that visibility is subject to the properties of the container that the surface object resides in. For example, if a surface object is visible but is contained within a surface object that is invisible, the end result is that both objects are actually invisible.

Visibility is directly affected by the Hide() and Show() actions if you wish to change the visibility of a surface object.

  VisibleHeightINTThe visible height of the surface area, relative to its parents.

To determine the visible area of a surface, read the VisibleX, VisibleY, VisibleWidth and VisibleHeight fields.

The 'visible area' is determined by the position of the surface relative to its parents. For example, if the surface is 100 pixels across and smallest parent is 50 pixels across, the number of pixels visible to the user must be 50 pixels or less, depending on the position of the surface.

If none of the surface area is visible then zero is returned. The result is never negative.

  VisibleWidthINTThe visible width of the surface area, relative to its parents.

To determine the visible area of a surface, read the VisibleX, VisibleY, VisibleWidth and VisibleHeight fields.

The 'visible area' is determined by the position of the surface relative to its parents. For example, if the surface is 100 pixels across and smallest parent is 50 pixels across, the number of pixels visible to the user must be 50 pixels or less, depending on the position of the surface.

If none of the surface area is visible then zero is returned. The result is never negative.

  VisibleXINTThe first visible X coordinate of the surface area, relative to its parents.

To determine the visible area of a surface, read the VisibleX, VisibleY, VisibleWidth and VisibleHeight fields.

The 'visible area' is determined by the position of the surface relative to its parents. For example, if the surface is 100 pixels across and smallest parent is 50 pixels across, the number of pixels visible to the user must be 50 pixels or less, depending on the position of the surface.

If none of the surface area is visible then zero is returned. The result is never negative.

  VisibleYINTThe first visible Y coordinate of the surface area, relative to its parents.

To determine the visible area of a surface, read the VisibleX, VisibleY, VisibleWidth and VisibleHeight fields.

The 'visible area' is determined by the position of the surface relative to its parents. For example, if the surface is 100 pixels across and smallest parent is 50 pixels across, the number of pixels visible to the user must be 50 pixels or less, depending on the position of the surface.

If none of the surface area is visible then zero is returned. The result is never negative.

  WidthINTDefines the width of a surface object.

The width of a surface object is manipulated through this field. Alternatively, use the Resize() action to adjust the Width and Height at the same time. A client can set the Width as a fixed value by default, or as a scaled value in conjunction with the FD_SCALED flag. Scaled values are multiplied by the width of their parent container.

Setting the Width while a surface object is on display causes an immediate graphical update to reflect the change. Any objects that are within the surface area will be re-drawn and resized as necessary.

Width values of 0 or less are illegal, and will result in an ERR::OutOfRange error-code.

  WindowHandleAPTRRefers to a surface object's window handle, if relevant.

This field refers to the window handle of a surface object, but only if such a thing is relevant to the platform that the system is running on. Currently, this field is only usable when creating a primary surface object within an X11 window manager or Microsoft Windows.

It is possible to set the WindowHandle field prior to initialisation if you want a surface object to be based on a window that already exists.

  WindowTypeINTIndicator for surfaces that represent themselves as a desktop window.

This field affects a surface's status on hosted desktops such as Windows and X11. It only affects top-level surfaces that have no parent - child surfaces ignore this field. Surfaces created in the desktop area will also ignore this field, as the desktop is treated as a parent.

It is the responsibility of the developer to provide window gadgets such as titlebars and set the resize borders for custom surfaces.

NameDescription
SWIN::HOSTDefault to the standard hosted window mode with full titlebar, borders and taskbar representation.
SWIN::ICON_TRAYCreate a borderless (custom) window with icon tray representation.
SWIN::NONECreate a borderless (custom) window with no UI representation.
SWIN::TASKBARCreate a borderless (custom) window with taskbar representation.
  XINTDetermines the horizontal position of a surface object.

The horizontal position of a surface object can be set through this field. You have the choice of setting a fixed coordinate (the default) or a scaled coordinate if you use the FD_SCALED flag.

If you set the X while the surface object is on display, the position of the surface area will be updated immediately.

  XOffsetINTDetermines the horizontal offset of a surface object.

The XOffset has a dual purpose depending on whether or not it is set in conjunction with the X or Width fields.

If set in conjunction with the X field, the width of the surface object will be from that X coordinate up to the width of the container, minus the value given in the XOffset. This means that the width of the surface object is dynamically calculated in relation to the width of its container.

If the XOffset field is set in conjunction with a fixed or scaled width then the surface object will be positioned at an X coordinate calculated from the formula X = ContainerWidth - SurfaceWidth - XOffset.

  YINTDetermines the vertical position of a surface object.

The vertical position of a surface object can be set through this field. You have the choice of setting a fixed coordinate (the default) or a scaled coordinate if you use the FD_SCALED flag.

If the value is changed while the surface is on display, its position will be updated immediately.

  YOffsetINTDetermines the vertical offset of a surface object.

The YOffset has a dual purpose depending on whether or not it is set in conjunction with the Y or Height fields.

If set in conjunction with the Y field, the height of the surface object will be from that Y coordinate up to the height of the container, minus the value given in the YOffset. This means that the height of the surface object is dynamically calculated in relation to the height of its container.

If the YOffset field is set in conjunction with a fixed or scaled height then the surface object will be positioned at a Y coordinate calculated from the formula Y = ContainerHeight - SurfaceHeight - YOffset.

Actions

The following actions are currently supported:

ActivateShows a surface object on the display.
DisableDisables a surface object.
DrawRedraws the contents of a surface object.
ERR acDraw(*Object, DOUBLE X, DOUBLE Y, DOUBLE Width, DOUBLE Height)
ParameterDescription
XThe X position of the region to be drawn.
YThe Y position of the region to be drawn.
WidthThe width of the region to be drawn.
HeightThe height of the region to be drawn.

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:

  1. If the surface object's Colour field has been set, the target bitmap will be cleared to that colour.
  2. If the surface is volatile, graphics from background surfaces will be copied to the target bitmap.
  3. Subscribers to the surface object are now called via their hooks so that they can draw to the bitmap.
  4. The bitmap is copied to the video display buffer to complete the process.

Please be aware that:

  • If the target surface contains child surfaces, they will not be redrawn unless they are volatile (using special effects such as transparency, or using the region flag will make a surface volatile).
  • If the surface object has not had its background colour set, or if the object is not volatile, the bitmap contents will not be automatically cleared (this is advantageous in situations where a particular object will clear the surface area first).
EnableEnables a disabled surface object.
FocusChanges the primary user focus to the surface object.
HideHides a surface object from the display.
LostFocusInforms a surface object that it has lost the user focus.
MoveMoves a surface object to a new display position.
ERR acMove(*Object, DOUBLE DeltaX, DOUBLE DeltaY, DOUBLE DeltaZ)
ParameterDescription
DeltaXThe number of units to move along the X axis.
DeltaYThe number of units to move along the Y axis.
DeltaZThe number of units to move along the Z axis.
MoveToBackMoves a surface object to the back of its container.
MoveToFrontMoves a surface object to the front of its container.
MoveToPointMoves a surface object to an absolute coordinate.
ERR acMoveToPoint(*Object, DOUBLE X, DOUBLE Y, DOUBLE Z, MTF Flags)
ParameterDescription
XThe new X position to move the object to.
YThe new Y position to move the object to.
ZThe new Z position to move the object to.
FlagsSet the relevant MTF flag for each provided parameter.
RedimensionMoves 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)
ParameterDescription
XThe new X position to apply to the target object.
YThe new Y position to apply to the target object.
ZThe new Z position to apply to the target object.
WidthThe new width of the target object.
HeightThe new height of the target object.
DepthThe new depth of the target object.
ResizeAlters the dimensions of a surface object.
ERR acResize(*Object, DOUBLE Width, DOUBLE Height, DOUBLE Depth)
ParameterDescription
WidthThe new width of the object.
HeightThe new height of the object.
DepthThe new depth of the object.
SaveImageSaves the graphics of a surface object.
ERR acSaveImage(*Object, OBJECTID Dest, CLASSID ClassID)
ParameterDescription
DestRefers to an object that will receive the encoded image data.
ClassIDThe Picture class to use for encoding the image data.

To store the rendered image of a surface object, use the SaveImage() action. Calling SaveImage() on a surface object will cause it to render an image of its contents and save them to the given destination object. Any child surfaces in the region will also be included in the resulting image data.

The image data will be saved in the data format that is indicated by the setting in the ClassID parameter. Options are limited to members of the Picture class, for example CLASSID::JPEG and CLASSID::PICTURE (PNG). If no ClassID is specified, the user's preferred default file format is used.

ShowShows a surface object on the display.

Methods

The following methods are currently supported:

AddCallbackInserts a function hook into the drawing process of a surface object.
ERR drw::AddCallback(OBJECTPTR Object, FUNCTION * Callback)
ParameterDescription
CallbackPointer to the callback routine or NULL to remove callbacks for the given Object.

The AddCallback() method provides a hook for custom functions to draw directly to a surface. Whenever a surface object performs a redraw event, all functions inserted by this method will be called in their original subscription order with a direct reference to the Surface's target bitmap. The C/C++ prototype is Function(APTR Context, *Surface, *Bitmap, APTR Meta).

The Fluid prototype is function draw(Surface, Bitmap)

The subscriber can draw to the bitmap surface as it would with any freshly allocated bitmap object (refer to the Bitmap class). To get the width and height of the available drawing space, please read the Width and Height fields from the Surface object. If writing to the bitmap directly, please observe the bitmap's clipping region and the XOffset and YOffset values.

Error Codes
OkayOperation successful.
AllocMemoryA call to AllocMemory() failed to create a new memory block.
NullArgsFunction call missing argument value(s)
ExecViolationThe call was not made from the process that owns the object.
ExposeToDisplayRedraws 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)
ParameterDescription
XX coordinate of the expose area.
YY coordinate of the expose area.
WidthWidth of the expose area.
HeightHeight of the expose area.
FlagsOptional 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
OkayOperation successful.
InvalidateRegionRedraws all of the content in a surface object.
ERR drw::InvalidateRegion(OBJECTPTR Object, INT X, INT Y, INT Width, INT Height)
ParameterDescription
XX coordinate of the region to invalidate.
YY coordinate of the region to invalidate.
WidthWidth of the region to invalidate.
HeightHeight of the region to invalidate.

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
OkayOperation successful.
AccessMemoryFailed to access the internal surface list.
MinimiseFor 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 the Minimise() method will perform the default minimise action on that window. On a platform such as Microsoft Windows, this would normally result in the window being minimised to the task bar.

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.

RemoveCallbackRemoves a callback previously inserted by AddCallback().
ERR drw::RemoveCallback(OBJECTPTR Object, FUNCTION * Callback)
ParameterDescription
CallbackPointer to the callback routine to remove, or NULL to remove all assoicated callback routines.

The RemoveCallback() method is used to remove any callback that has been previously inserted by AddCallback().

This method is scope restricted, meaning that callbacks added by other objects will not be affected irrespective of the parameters that are passed to it.

Error Codes
OkayOperation successful.
SearchA search routine in this function failed.
ResetDimensionsChanges the dimensions of a surface.
ERR drw::ResetDimensions(OBJECTPTR Object, DOUBLE X, DOUBLE Y, DOUBLE XOffset, DOUBLE YOffset, DOUBLE Width, DOUBLE Height, DMF Dimensions)
ParameterDescription
XNew X coordinate.
YNew Y coordinate.
XOffsetNew X offset.
YOffsetNew Y offset.
WidthNew width.
HeightNew height.
DimensionsDimension flags.

The ResetDimensions() method provides a simple way of re-declaring the dimensions of a surface object. This is sometimes necessary when a surface needs to make a significant alteration to its display configuration. For instance if the width of the surface is declared through a combination of X and XOffset settings and the width needs to change to a fixed setting, then ResetDimensions() will have to be used.

It is not necessary to define a value for every parameter - only the ones that are relevant to the new dimension settings. For instance if X and Width are set, XOffset is ignored and the Dimensions value must include DMF::FIXED_X and DMF::FIXED_WIDTH (or the relative equivalents). Please refer to the Dimensions field for a full list of dimension flags that can be specified.

Error Codes
OkayOperation successful.
AccessMemoryUnable to access internal surface list.
NullArgsFunction call missing argument value(s)
ScheduleRedrawSchedules a redraw operation for the next frame.
ERR drw::ScheduleRedraw(OBJECTPTR Object)

Use ScheduleRedraw to indicate that a surface needs to be drawn to the display. The surface and all child surfaces will be drawn on the next frame cycle (typically 1/60th of a second). All manual draw operations for the target surface are ignored until the scheduled operation is completed.

Scheduling is ideal in situations where 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.

Note that redraw schedules do not 'see each other', meaning if a surface and a child are both scheduled, this will trigger two redraw operations when one would suffice. It is the client's responsibility to target the most relevant top-level surface for scheduling.

Error Codes
OkayOperation successful.
SetDisplayChanges 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)
ParameterDescription
XThe horizontal coordinate/offset for the display.
YThe vertical coordinate/offset for the display.
WidthThe width of the display.
HeightThe height of the display.
InsideWidthThe page width of the display must be the same as Width or greater.
InsideHeightThe page height of the display must be the same as Height or greater.
BitsPerPixelBits per pixel - 15, 16, 24 or 32.
RefreshRateRefresh rate.
FlagsOptional 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
OkayOperation successful.
FailedGeneral failure.
ArgsInvalid arguments passed to function.
SetOpacityAlters the opacity of a surface object.
ERR drw::SetOpacity(OBJECTPTR Object, DOUBLE Value, DOUBLE Adjustment)
ParameterDescription
ValueThe new opacity value between 0 and 100% (ignored if you have set the Adjustment parameter).
AdjustmentAdjustment value to add or subtract from the existing opacity (set to zero if you want to set a fixed Value instead).

This method will change the opacity of the surface and execute a redraw to make the changes to the display.

Error Codes
OkayThe opacity of the surface object was changed.
NullArgsFunction call missing argument value(s)
Surface class documentation © Paul Manias 2003-2025

ALIGN Type

Universal values for alignment of graphics and text

NameDescription
ALIGN::BOTTOMAlign to bottom
ALIGN::CENTERSynonym for HORIZONTAL | VERTICAL
ALIGN::HORIZONTALAlign to horizontal center
ALIGN::LEFTAlign to left
ALIGN::MIDDLESynonym for HORIZONTAL | VERTICAL
ALIGN::RIGHTAlign to right
ALIGN::TOPAlign to top
ALIGN::VERTICALAlign to vertical center
Surface module documentation © Paul Manias 2003-2025

BAF Type

Instructions for basic graphics operations.

NameDescription
BAF::BLENDEnable alpha blending to the destination if the source supports an alpha channel.
BAF::COPYSpecial CopyArea() option that avoids blending when the destination pixel is empty.
BAF::DITHERPerform dithering if the colour formats differ between the source and destination.
BAF::FILLFor primitive operations such as DrawRectangle(), this will fill the shape with a solid colour or texture.
BAF::LINEARUse linear interpolation to improve the quality of alpha blending.
Surface module documentation © Paul Manias 2003-2025

BDF Type

CopySurface() flags

NameDescription
BDF::DITHERAllow the use of dithering to improve image quality at a cost of speed.
BDF::REDRAWRedraw the surface before performing the copy operation.
Surface module documentation © Paul Manias 2003-2025

CRF Type

Flags for the SetCursor() function.

NameDescription
CRF::BUFFERUse of the BUFFER option allows the cursor request to be buffered in the event that the cursor is locked at the time of calling the SetCursor() function. Use of this flag is highly recommended in most circumstances, but may not be used in conjunction with the ANCHOR option.
CRF::LMBRelease the cursor after the left mouse button is held and released.
CRF::MMBRelease the cursor after the middle mouse button is held and released.
CRF::NO_BUTTONSSet the cursor only on the condition that the user is not holding down any buttons. ERR::NothingDone is returned if the user has a button held down.
CRF::RESTRICTSimilar to the anchor option, but allows the pointer to move within the surface referred to by ObjectID.
CRF::RMBRelease the cursor after the right mouse button is held and released.
Surface module documentation © Paul Manias 2003-2025

CSRF Type

Flags for CopySurface().

NameDescription
CSRF::ALPHAEnable alpha blending if the source is in 32-bit colour format with an alpha channel.
CSRF::CLIPEnable clipping of the source coordinates.
CSRF::DEFAULT_FORMATIgnore the colour format defined in the source surface (if any) and generate a default format based on the BitsPerPixel value.
CSRF::OFFSETAdjust X and Y coordinates by the offset values defined in the Surface⇒XOffset and Surface⇒YOffset fields.
CSRF::TRANSLUCENTPerform a translucent copy operation, using the strength value specified in the Surface⇒Opacity field.
CSRF::TRANSPARENTEnable transparent copying, whereby colours matching the source's Colour field will be ignored.
Surface module documentation © Paul Manias 2003-2025

DMF Type

NameDescription
DMF::FIXED_CENTER_XThe CenterX field is a fixed size.
DMF::FIXED_CENTER_YThe CenterY field is a fixed size.
DMF::FIXED_DEPTHThe Depth field is a fixed size.
DMF::FIXED_HEIGHTThe Height field is a fixed size.
DMF::FIXED_RADIUS_XThe RadiusX field is a fixed size.
DMF::FIXED_RADIUS_YThe RadiusY field is a fixed size.
DMF::FIXED_WIDTHThe Width field is a fixed suze.
DMF::FIXED_XThe X field is a fixed coordinate.
DMF::FIXED_X_OFFSETThe XOffset field is a fixed coordinate.
DMF::FIXED_YThe Y field is a fixed coordinate.
DMF::FIXED_Y_OFFSETThe YOffset field is a fixed coordinate.
DMF::FIXED_ZThe Z field is a fixed coordinate.
DMF::SCALED_CENTER_XThe CenterX field is scaled to this object's parent.
DMF::SCALED_CENTER_YThe CenterY field is scaled to this object's parent.
DMF::SCALED_DEPTHThe Depth field is scaled to this object's parent.
DMF::SCALED_HEIGHTThe Height field is scaled to this object's parent.
DMF::SCALED_RADIUS_XThe RadiusX field is scaled to this object's parent.
DMF::SCALED_RADIUS_YThe RadiusY field is a scaled size to this object's parent.
DMF::SCALED_WIDTHThe Width field is scaled to this object's parent.
DMF::SCALED_XThe X field is scaled to this object's parent.
DMF::SCALED_X_OFFSETThe XOffset field is scaled to this object's parent.
DMF::SCALED_YThe Y field is scaled to this object's parent.
DMF::SCALED_Y_OFFSETThe YOffset field is scaled to this object's parent.
DMF::SCALED_ZThe Z field is a scaled coordinate to this object's parent.
DMF::STATUS_CHANGE_H
DMF::STATUS_CHANGE_V
Surface module documentation © Paul Manias 2003-2025

DRAG Type

NameDescription
DRAG::ANCHORThe surface is being dragged and the mouse pointer is anchored to the surface.
DRAG::NONEThe surface is not being dragged.
DRAG::NORMALThe surface is being dragged.
Surface module documentation © Paul Manias 2003-2025

DT Type

Flags for GetDisplayType().

NameDescription
DT::GLESThe display is driven by OpenGLES.
DT::NATIVEThe display is native (supported by internal drivers).
DT::WINGDIThe display is driven by Microsoft Windows drivers.
DT::X11The display is driven by the X Window System (X11, X.Org, XFree86)
Surface module documentation © Paul Manias 2003-2025

EXF Type

Optional flags for the ExposeSurface() function.

NameDescription
EXF::ABSOLUTEThe supplied coordinates for exposure are absolute (relative to the display).
EXF::ABSOLUTE_COORDSThe supplied coordinates for exposure are absolute (relative to the display).
EXF::CHILDRENIf set, all child surfaces that intersect with exposed region will be included in the expose operation.
EXF::REDRAW_VOLATILERedraw every volatile object that intersects with the expose region, including internal volatile children.
EXF::REDRAW_VOLATILE_OVERLAPOnly 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.
Surface module documentation © Paul Manias 2003-2025

HOST Type

NameDescription
HOST::STICK_TO_FRONTThe hosted display sticks to the front.
HOST::TASKBARThe hosted display is given a taskbar button.
HOST::TRANSLUCENCEChange the alpha channel level for the entire window.
HOST::TRANSPARENTDefines an RGB colour that is to be used as transparent.
HOST::TRAY_ICONAll new displays are represented in the system tray when this option is active.
Surface module documentation © Paul Manias 2003-2025

JET Type

JET constants are documented in GetInputEvent()

NameDescription
JET::ABS_XYThe X, Y values are defined as absolute coordinates, relative to the top-left of the display.
JET::BUTTON_1Left 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_10Non-specific button assignment.
JET::BUTTON_2Right mouse button; XBox X button, PS cross button.
JET::BUTTON_3Middle mouse button; XBox Y button, PS triangle.
JET::BUTTON_4Alt. mouse button 1; XBox B button, PS circle.
JET::BUTTON_5Alt. mouse button 2.
JET::BUTTON_6Non-specific button assignment.
JET::BUTTON_7Non-specific button assignment.
JET::BUTTON_8Non-specific button assignment.
JET::BUTTON_9Non-specific button assignment.
JET::CROSSED_INThis 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_OUTThis 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_XYController tilted on the X/Y axis. Value indicates angle, -ve = left, +ve = right
JET::DEVICE_TILT_ZController is rising or falling. Value expressed as 'speed',
JET::DISPLAY_EDGERecently supplied input occurred at the edge of the display.
JET::PEN_TILT_XYFor pen-based input, this type indicates the vertical tilt of the pen device. A value of 0 indicates that the pen is laid flat with nib at the bottom, 0.5 is 90 degrees, 1.0 is laid flat with nib at the top.
JET::PRESSUREAmount of pressure applied, ranges from 0 (none) to 1.0 (normal) and possibly higher if user presses hard enough
JET::WHEELMouse wheel rotation - the value generally reflects the number of 'clicks' rotated on the wheel.
JET::WHEEL_TILTSome mouse wheels can be tilted to the left or right. Ranges from -1.0 to +1.0
Surface module documentation © Paul Manias 2003-2025

JTYPE Type

JTYPE flags are used to categorise input types.

NameDescription
JTYPE::ANALOGAnalog movement (ranging from -1.0 to 1.0)
JTYPE::ANCHOREDCursor has been anchored with LockCursor()
JTYPE::BUTTONInput is a physical button or switch
JTYPE::CROSSINGCrossing events manage the entering and leaving of an area.
JTYPE::DBL_CLICKSet 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::DIGITALD-Pad or digital joystick source (restricted to +/- 1)
JTYPE::DRAGGEDSet if sufficient movement occurred between the original click and its point of release (usually requires a 3 or more pixel difference).
JTYPE::DRAG_ITEMThis special flag is set by the input system if the pointer is click-dragging an object at the time of the event.
JTYPE::EXT_MOVEMENTExtended 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::MOVEMENTX/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::REPEATEDInput is a repeated entry (i.e. user is holding down a button and a repetition timer is being triggered)
JTYPE::SECONDARYIndicates to the receiver of this message that it is not the primary/original recipient
Surface module documentation © Paul Manias 2003-2025

PTC Type

Predefined cursor styles

NameDescription
PTC::CROSSHAIRThe cross hair is used for targeting specific pixel points (common in paint programs).
PTC::CUSTOMWorks in conjunction with the SetCustomCursor() function to represent a program defined bitmap.
PTC::DEFAULTThe default cursor (usually an arrow pointing to the upper left).
PTC::DRAGGABLEUsed to indicate that a surface or object can be dragged by the user.
PTC::END
PTC::HANDThe hand cursor is often used for indicating click-able content (hyper-links, icons etc).
PTC::HAND_LEFTSimilar to the standard hand cursor, but points to the left.
PTC::HAND_RIGHTSimilar to the standard hand cursor, but points to the right.
PTC::INVISIBLEThe cursor graphic is invisible (but will continue to operate as normal in all other respects).
PTC::MAGNIFIERRepresents a magnifying glass.
PTC::NO_CHANGE
PTC::PAINTBRUSHThe paintbrush cursor is typically employed by paint programs.
PTC::SIZE_BOTTOMSizing cursor - for resizing the bottom edge of any rectangular area.
PTC::SIZE_BOTTOM_LEFTSizing cursor - for resizing the bottom left corner of any rectangular area.
PTC::SIZE_BOTTOM_RIGHTSizing cursor - for resizing the bottom right corner of any rectangular area.
PTC::SIZE_LEFTSizing cursor - for resizing the left edge of any rectangular area.
PTC::SIZE_RIGHTSizing cursor - for resizing the right edge of any rectangular area.
PTC::SIZE_TOPSizing cursor - for resizing the top edge of any rectangular area.
PTC::SIZE_TOP_LEFTSizing cursor - for resizing the top left corner of any rectangular area.
PTC::SIZE_TOP_RIGHTSizing cursor - for resizing the top right corner of any rectangular area.
PTC::SIZINGMulti-directional sizing cursor - for resizing in any direction.
PTC::SLEEPThe sleep cursor is used to inform the user that the computer is busy.
PTC::SPLIT_HORIZONTALThe horizontal split cursor is typically used for splitting rectangles in half, or dragging a horizontal split within a large rectangular space.
PTC::SPLIT_VERTICALThe vertical split cursor is typically used for splitting rectangles in half, or dragging a vertical split within a large rectangular space.
PTC::STOPThe 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::TEXTThe text cursor is popular for the precise positioning of text cursors.
Surface module documentation © Paul Manias 2003-2025

RNF Type

Switches for the Surface class' Flags field.

NameDescription
RNF::AFTER_COPYRead-only. Indicates that after-copy mode has been enabled.
RNF::ASPECT_RATIOWhen resizing, enforce the aspect ratio as defined by the diagonal from Surface⇒MinWidth, Surface⇒MinHeight to Surface⇒MaxWidth, Surface⇒MaxHeight.
RNF::AUTO_QUITThe 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::COMPOSITEDo not copy background information into the surface buffer - composite on the fly instead
RNF::DISABLEDThis 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_BUFFERPasses the NEVER_SHRINK option to the surface bitmap
RNF::FIXED_DEPTHThe target buffer always remains at the same depth
RNF::FULL_SCREENAllow the surface to open as a new screen display
RNF::GRAB_FOCUSHelps application windows manage the user's focus within the window
RNF::HAS_FOCUSRead-only. If set, this flag indicates that the surface object currently has the focus.
RNF::HOSTDefine host on initialisation to create a container that can host surfaces from other processes.
RNF::IGNORE_FOCUSFocus is diverted directly to the parent
RNF::INIT_ONLYSynonym for HOST | TRANSPARENT | DISABLED | PRECOPY | VIDEO | FIXED_BUFFER | PERVASIVE_COPY | FIXED_DEPTH | FULL_SCREEN | IGNORE_FOCUS
RNF::NO_FOCUSPrevents any kind of focussing on this object; no circumvention is possible
RNF::NO_HORIZONTALTurns off all horizontal movement (applies to the Move() action only).
RNF::NO_PRECOMPOSITEDo not copy background information into the surface buffer - composite on the fly instead
RNF::NO_VERTICALTurns off all vertical movement (applies to the Move() action only).
RNF::PERVASIVE_COPYThis 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_COMPOSITEDo not copy background information into the surface buffer - composite on the fly instead
RNF::PRECOPYEnables 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_ONLYSynonym for HAS_FOCUS | CURSOR | AFTER_COPY
RNF::STICKYPrevents any response to the Move action. It can be circumvented by writing to coordinate fields directly.
RNF::STICK_TO_BACKEnable if the surface object must stick to the back of its container.
RNF::STICK_TO_FRONTEnable if the surface object must stick to the front of its container.
RNF::TOTAL_REDRAWPerform a total redraw of the entire surface when drawing - no partial draws
RNF::TRANSPARENTEnables 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::VIDEOSet 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::VISIBLEIf 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::VOLATILESynonym for PRECOPY | AFTER_COPY | CURSOR
RNF::WRITE_ONLYSet 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.
Surface module documentation © Paul Manias 2003-2025

RT Type

NameDescription
RT::ROOTCan be used by window surfaces to identify themselves as a root layer.
Surface module documentation © Paul Manias 2003-2025

SWIN Type

Options for the Surface WindowType field.

NameDescription
SWIN::HOSTDefault to the standard hosted window mode with full titlebar, borders and taskbar representation.
SWIN::ICON_TRAYCreate a borderless (custom) window with icon tray representation.
SWIN::NONECreate a borderless (custom) window with no UI representation.
SWIN::TASKBARCreate a borderless (custom) window with taskbar representation.
Surface module documentation © Paul Manias 2003-2025

WH Type

Events for WindowHook()

NameDescription
WH::CLOSE
Surface module documentation © Paul Manias 2003-2025

BitmapSurface Structure

FieldTypeDescription
DataAPTRPointer to the bitmap graphics data.
WidthINT16Pixel width of the bitmap.
HeightINT16Pixel height of the bitmap.
LineWidthINTThe distance between bitmap lines, measured in bytes.
BitsPerPixelUBYTEThe number of bits per pixel (8, 15, 16, 24, 32).
BytesPerPixelUBYTEThe number of bytes per pixel (1, 2, 3, 4).
OpacityUBYTEOpacity level of the source if CSRF::TRANSLUCENT is used.
VersionUBYTEVersion of this structure.
ColourINTColour index to use if CSRF::TRANSPARENT is used.
Clipstruct ClipRectangleA clipping rectangle will restrict drawing operations to this region if CSRF::CLIP is used.
XOffsetINT16Offset all X coordinate references by the given value.
YOffsetINT16Offset all Y coordinate references by the given value.
Formatstruct ColourFormatThe colour format of this bitmap's pixels, or alternatively use CSRF::DEFAULT_FORMAT.
Surface class documentation © Paul Manias 2003-2025

ColourFormat Structure

FieldTypeDescription
RedShiftUBYTERight shift value for red (15/16 bit formats only)
GreenShiftUBYTERight shift value for green
BlueShiftUBYTERight shift value for blue
AlphaShiftUBYTERight shift value for alpha
RedMaskUBYTEUnshifted mask value for red (ranges from 0x00 to 0xff)
GreenMaskUBYTEUnshifted mask value for green
BlueMaskUBYTEUnshifted mask value for blue
AlphaMaskUBYTEUnshifted mask value for alpha
RedPosUBYTELeft shift/positional value for red
GreenPosUBYTELeft shift/positional value for green
BluePosUBYTELeft shift/positional value for blue
AlphaPosUBYTELeft shift/positional value for alpha
BitsPerPixelUBYTENumber of bits per pixel for this format.
Surface class documentation © Paul Manias 2003-2025

CursorInfo Structure

FieldTypeDescription
WidthINTMaximum cursor width for custom cursors
HeightINTMaximum cursor height for custom cursors
FlagsINTCurrently unused
BitsPerPixelINT16Preferred bits-per-pixel setting for custom cursors
Surface class documentation © Paul Manias 2003-2025

DisplayInfo Structure

FieldTypeDescription
DisplayOBJECTIDObject ID related to the display
FlagsSCRDisplay flags
WidthINT16Pixel width of the display
HeightINT16Pixel height of the display
BitsPerPixelINT16Bits per pixel
BytesPerPixelINT16Bytes per pixel
AccelFlagsACFFlags describing supported hardware features.
AmtColoursINTTotal number of supported colours.
PixelFormatstruct PixelFormatThe colour format to use for each pixel.
MinRefreshFLOATMinimum refresh rate
MaxRefreshFLOATMaximum refresh rate
RefreshRateFLOATRecommended refresh rate
IndexINTDisplay mode ID (internal)
HDensityINTHorizontal pixel density per inch.
VDensityINTVertical pixel density per inch.
Surface class documentation © Paul Manias 2003-2025

InputEvent Structure

FieldTypeDescription
Nextconst struct InputEvent *Next event in the chain
ValueDOUBLEThe value associated with the Type
TimestampINT64PreciseTime() of the recorded input
RecipientIDOBJECTIDSurface that the input message is being conveyed to
OverIDOBJECTIDSurface that is directly under the mouse pointer at the time of the event
AbsXDOUBLEAbsolute horizontal position of mouse cursor (relative to the top left of the display)
AbsYDOUBLEAbsolute vertical position of mouse cursor (relative to the top left of the display)
XDOUBLEHorizontal 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
YDOUBLEVertical 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
DeviceIDOBJECTIDThe hardware device that this event originated from
TypeJETJET constant that describes the event
FlagsJTYPEBroad descriptors for the given Type (see JTYPE flags). Automatically defined when delivered to the pointer object
MaskJTYPEMask to use for checking against subscribers
Surface class documentation © Paul Manias 2003-2025

SurfaceInfo Structure

FieldTypeDescription
DataAPTRBitmap data memory ID
ParentIDOBJECTIDObject that contains the surface area
BitmapIDOBJECTIDSurface bitmap buffer
DisplayIDOBJECTIDRefers to the display if this object is at root level
FlagsRNFSurface flags
XINTHorizontal coordinate
YINTVertical coordinate
WidthINTWidth of the surface area
HeightINTHeight of the surface area
AbsXINTAbsolute X coordinate
AbsYINTAbsolute Y coordinate
LevelINT16Branch level within the tree
BitsPerPixelBYTEBits per pixel of the bitmap
BytesPerPixelBYTEBytes per pixel of the bitmap
LineWidthINTLine width of the bitmap, in bytes
Surface class documentation © Paul Manias 2003-2025