GreatSex SEXML 1.0 Specification

Introduction

GreatSex is the SEXML file-format for specifying the widget layout in the Rococo GUI system. It's name was taken from the letters of Gui-retained S-Expression. Unfortunately, despite its name, it is unlikely to solve the world's demographic collapse problem - but it may make user-interfaces easier to author.

Familiarity with the SEXML specification is required. Widgets exist in a tree, with a root widget that has no parent. The root is always a Frame widget. Frame widgets have two sub-widgets, a toolbar, which is usually collapsed, but can be used to create a regular OS style UI toolbar for fullscreen mode, and a client-area where children widgets are placed. In GreatSex SEXML, top-level Widget directives append new children to the frame's client-area. The client-area matches the area of the frame less the area of the toolbar. So without a toolbar, the default for GreatSEX SEXML, client-area spans the entire frame.

Every widget has a number of colours used in its rendering (see the Colour Table at the bottom of this document), and if they are not explicitly defined, then the rendering algorithm will search ancestors for a definition, so this means you can set such colours in a parent widget, and have all the children use the scheme. If no widget explicitly defines a particular colour, then the rendering algorithm will look at the frame's scheme, which is set with the top-level Scheme directives. The particular scheme that will be that which matches the control state of the UI. The control state consists of 3 flags - Hovered, Focused and Pressed. Hovered means the UI cursor is within the bounds of the widget, while Focused means the keyboard sends default input to the widget and Pressed means the the widget is in some pressed state, such as with a button.

Top Level Directives

Widget Directives

Widgets serve as parent containers to child widgets, and thus all widget directives are allowed an arbitrary number of widget directives in their subdirective list, with each such defining a child widget.

Any widget may have any widget type as a child, the exception is the frame widget, which hosts the widget-tree. The frame widget's client area, may have children, but no widget may have a frame as a child. Frames are root widgets only.

All widgets also have an arbirary list of panel and colour attributes. Panel attribute names begin with the subspace 'Panel'. Colour attribute names begin with the subspace 'Colour'.

Colour attributes are all name-value pairs with the second argument being the colour id. The id must match the id of top-level-directive (Colour ...) defined in the SEXML or at an insert point.

A list of all legal 'Colour' names is in the table at the bottom of this HTML document

Widget Factories

A widget directive other than Frame or Frame.ClientArea creates widgets. In addition to the panels and colours every widget can specify, every widget factory has its own custom set of attributes and subdirective types, so, for example, a Slider widget will have attributes and subdirectives that control the mapping between the slider and the underlying property bound to the slider. Here follows a comprehensive set of widget factories and their custom attributes and subdirectives.

Panel Attributes

Attribute Format Definition and Commentary
#Vec2i Panel.Offset [dx] [dy] The delta offset [dx,dy] from the parent's top left position to the panel's top left position
#Vec2i Panel.Span [dx] [dy] The constant span [dx,dy] of the widget panel
Panel.FixedWidth [width] [width] is an integer. If it ends with a % sign, specifies with as the fraction of the parent's x-span, otherwise specifies widget co-ordinate x-span
Panel.FixedHeight [height] [height] is an integer. If it ends with a % sign, specifies with as the fraction of the parent's y-span, otherwise specifies widget co-ordinate y-span
Panel.Description [text] At a minimum provides a debugging string for the widget, but also gives a key for navigation and other logic to identify a purpose for the widget
Panel.TabsCycle [boolValue] Pass true for [boolValue] to mark a panel to cycle tabs endlessly
#Reci Panel.Padding [left] [top] [right] [bottom] Set's the panel's padding on all four of its bounds. If any end with % symbol, the value specifies the faction of the parent's span across the appropriate axis. See ExpandH and ExpandV.
Panel.Layout [layout] Where layout is one of LeftToRight|RightToLeft|TopToBottom|BottomToTop|None. This determines the direction across which child widgets are laid out. 'None' is used when children geometries are micromanaged elsewhere
Panel.ExpandH An existential attribute that specifies that a widget to expand horizontally to match its parent geometry, and then shrink according to the Padding for the panel. See Panel.Padding
Panel.ExpandV An existential attribute that specifies that a widget to expand vertically to match its parent geometry, and then shrink according to the Padding for the panel. See Panel.Padding.
#Recti Panel.ChildPadding [top] [left] [right] [bottom] Behaviour dependendent on the layout algorithm - but specifies gaps between children when laid out by their parent
#List Panel.Fit ... Arguments can be any of H|Horizontal|V|Vertical. Prescence of H|Horizontal specifies a widget shrinks to fit its children horizontally; ditto - V|Vertical specifies vertically.
Panel.RectStyle [style] Where style is one of SHARP|ROUNDED|BLUR. Specifies the rectangle perimeter used to render the widget background. See Panel.CornerRadius
Panel.CornerRadius In the case of a ROUNDED rectangle style, specifies the radius of the corner arcs. Typically 1-10. See Panel.RectStyle
Panel.AcceptFocus An existential attribute that marks a panel as having the potential for keyboard focus
#List Panel.Navigate ... The items form a string list of Panel.Description text that is used to define a tabbed navigation sequence for the panel. The argument order specifies the navigation order.
Panel.Hint [hint] Specifies the [hint] that is registered when keyboard focus applies to the panel. The [hint] may appear in a hint widget.
Panel.Collapsed An existential attribute that marks a panel as being collapsed - invisible, disabled and taking up no span. All descendants are also invisible, disabled and take no span.
Panel.NavLeft [desc] Specifies the panel description for the panel that takes the next focus when a left action is taken (gamepad or cursor left). See Panel.Description
Panel.NavRight Specifies the panel description for the panel that takes the next focus when a right action is taken (gamepad or cursor right). See Panel.Description
Panel.NavUp Specifies the panel description for the panel that takes the next focus when an up action is taken (gamepad or cursor up). See Panel.Description
Panel.NavDown Specifies the panel description for the panel that takes the next focus when an up action is taken (gamepad or cursor down). See Panel.Description
Panel.OcclusionSurface [boolValue] The boolean value true|false determines whether a panel should be painted over with an occlusion surface in the rendering of an occluding GUI object (such as a popup menu). This creates a visual cue for the modality of a popup.

Colour Attribute Names & Commentary

Attribute Name EGRSchemeColourSurface Comment
Colour.Background BACKGROUND Background for the root frame widget and viewport widget
Colour.Button BUTTON Background colour for buttons and slider bulbs
Colour.Button.Edge.Top.Left BUTTON_EDGE_TOP_LEFT Edge colour for left and top of button rectangles
Colour.Button.Edge.Bottom.Right BUTTON_EDGE_BOTTOM_RIGHT Edge colour for right and buttom of button rectangles
Colour.Button.Image.Fog BUTTON_IMAGE_FOG For buttons with images, this is the translucent overlay colour
Colour.Button.Shadow BUTTON_SHADOW Provides the shadow colour behind button text
Colour.Button.Text BUTTON_TEXT Provides the colour of button text
Colour.Menu.Button MENU_BUTTON In a menu item, determines the background colour
Colour.Menu.Button.Edge.Top.Left MENU_BUTTON_EDGE_TOP_LEFT Edge colour for left and top of menu item rectangles
Colour.Menu.Button.Edge.Bottom.Right MENU_BUTTON_EDGE_BOTTOM_RIGHT Edge colour for right and bottom of menu item rectangles
Colour.Container.Background CONTAINER_BACKGROUND Background colour of control-prompts, divisions, hintboxes, radio-button groups, toolbars and vertical lists
Colour.Container.Top.Left CONTAINER_TOP_LEFT Top-left edge colour of control-prompts, game option controls, property editors, divisions, hintboxes, labels, radio-button groups, viewports, toolbars and vertical lists
Colour.Container.Bottom.Right CONTAINER_BOTTOM_RIGHT Bottom-right edge colour of control-prompts, game option controls, property editors, divisions, hintboxes, labels, radio-button groups, viewports, toolbars and vertical lists
Colour.Scroller.Button.Background SCROLLER_BUTTON_BACKGROUND Background colour of vertical scroller buttons
Colour.Scroller.Button.Top.Left SCROLLER_BUTTON_TOP_LEFT Top-left edge colour of vertical scroller buttons
Colour.Scroller.Button.Bottom.Right SCROLLER_BUTTON_BOTTOM_RIGHT Bottom-right edge colour of vertical scroller buttons
Colour.Scroller.Bar.Background SCROLLER_BAR_BACKGROUND Background colour of scroller bars
Colour.Scroller.Bar.Top.Left SCROLLER_BAR_TOP_LEFT Top-left edge colour of vertical scroller bar
Colour.Scroller.Bar.Bottom.Right SCROLLER_BAR_BOTTOM_RIGHT Bottom-right edge colour of vertical scroller bar
Colour.Scroller.Slider.Background SCROLLER_SLIDER_BACKGROUND Background colour of scroller slider
Colour.Scroller.Slider.Top.Left" SCROLLER_SLIDER_TOP_LEFT Top-left edge colour of vertical scroller slider
Colour.Scroller.Slider.Bottom.Right SCROLLER_SLIDER_BOTTOM_RIGHT Bottom-right edge colour of vertical scroller slider
Colour.Editor EDITOR Background colour of an editor widget in edit mode
Colour.Text TEXT Text colour for an editor in edit mode, a label, a game option control title, or property editor name-value widgets
Colour.Focus FOCUS_RECTANGLE Comment
Colour.EditText FOCUS_RECTANGLE Focus widget highlight colour
Colour.Label LABEL_BACKGROUND Background colour for editor widgets in read-only mode, labels, game option titles, and property editor titles
Colour.Label.Shadow LABEL_SHADOW Text shadow colour for labels
Colour.Splitter.Background SPLITTER_BACKGROUND Background colour for splitter widget
Colour.Splitter.Edge SPLITTER_EDGE Edge colour for splitter widget
Colour.Carousel.Text CAROUSEL_TEXT Text colour for carousel when not disabled
Colour.Carousel.Background CAROUSEL_BACKGROUND Background colour for carousel when not disabled
Colour.Carousel.Top.Left CAROUSEL_TOP_LEFT Top-left edge colour of carousel control
Colour.Carousel.Bottom.Right CAROUSEL_BOTTOM_RIGHT Bottom-right edge colour of carousel control
Colour.GameOption.Background GAME_OPTION_BACKGROUND Background colour for game option container if not disabled
Colour.GameOption.Disabled.Background GAME_OPTION_DISABLED_BACKGROUND Background colour for game option container if disabled
Colour.GameOption.Disabled.Text GAME_OPTION_DISABLED_TEXT Text colour for disabled option
Colour.GameOption.Top.Left GAME_OPTION_TOP_LEFT Top-left edge colour of game option container
Colour.GameOption.Bottom.Right GAME_OPTION_BOTTOM_RIGHT Bottom-right edge colour of game option container
Colour.GameOption.ChildSpacer GAME_OPTION_CHILD_SPACER Colour of the line below a game option
Colour.Carousel.DropDown CAROUSEL_DROP_DOWN_BACKGROUND Scrollable menu background colour for a carousel drop-down
Colour.Carousel.DropDown.Text CAROUSEL_DROP_DOWN_TEXT Scrollable menu text colour for a carousel drop-down
Colour.Portrait.Band PORTRAIT_BAND_COLOUR The colour of the bands that appear to the sides of the portrait widget when the aspect ratio of the panel does not match the image
Colour.Slider.Guage SLIDER_GUAGE Game option scalar background colour for slider guage
Colour.Slider SLIDER_BACKGROUND Slider background colour
Colour.Slider.Slot SLIDER_SLOT_BACKGROUND Slider slot background colour
Colour.Slider.Slot.Edge.1 SLIDER_SLOT_EDGE_1 1st edge colour for the slider slot. Results depends on the slider rendering algorithm
Colour.Slider.Slot.Edge.2 SLIDER_SLOT_EDGE_2 2nd edge colour for the slider slot. Results depends on the slider rendering algorithm
Colour.Occlusion.Surface OCCLUSION_SURFACE The colour a scrollable menu uses to mask off the background panels