Added more comments for the constants which represent UI element's properties and events

This commit is contained in:
Mikalai Turankou 2024-09-18 13:50:06 +03:00
parent f9822a22f2
commit f239af2324
38 changed files with 6213 additions and 1097 deletions

View File

@ -9,47 +9,114 @@ import (
// Constants which related to view's animation
const (
// AnimationTag is the constant for the "animation" property tag.
// The "animation" property sets and starts animations.
// Valid types of value are []Animation and Animation
// AnimationTag is the constant for "animation" property tag.
//
// Used by `View`.
// Sets and starts animations.
//
// Supported types: `Animation`, `[]Animation`.
//
// Internal type is `[]Animation`, other types converted to it during assignment.
// See `Animation` description for more details.
AnimationTag = "animation"
// AnimationPause is the constant for the "animation-pause" property tag.
// The "animation-pause" property sets whether an animation is running or paused.
// AnimationPaused is the constant for "animation-paused" property tag.
//
// Used by `Animation`.
// Controls whether the animation is running or paused.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - Animation is paused.
// `false` or `0` or "false", "no", "off", "0" - Animation is playing.
AnimationPaused = "animation-paused"
// TransitionTag is the constant for the "transition" property tag.
// The "transition" property sets transition animation of view properties.
// Valid type of "transition" property value is Params. Valid type of Params value is Animation.
// Transition is the constant for "transition" property tag.
//
// Used by `View`.
// Sets transition animation of view properties. Each provided property must contain `Animation` which describe how
// particular property will be animated on property value change. Transition animation can be applied to properties of the
// type `SizeUnit`, `Color`, `AngleUnit`, `float64` and composite properties that contain elements of the listed types(for
// example, "shadow", "border", etc.). If we'll try to animate other properties with internal type like `bool` or
// `string` no error will occur, simply there will be no animation.
//
// Supported types: `Params`.
//
// See `Params` description for more details.
Transition = "transition"
// PropertyTag is the constant for the "property" animation property tag.
// The "property" property describes a scenario for changing a View property.
// Valid types of value are []AnimatedProperty and AnimatedProperty
// PropertyTag is the constant for "property" property tag.
//
// Used by `Animation`.
// Describes a scenario for changing a `View`'s property. Used only for animation script.
//
// Supported types: `[]AnimatedProperty`, `AnimatedProperty`.
//
// Internal type is `[]AnimatedProperty`, other types converted to it during assignment.
// See `AnimatedProperty` description for more details.
PropertyTag = "property"
// Duration is the constant for the "duration" animation property tag.
// The "duration" float property sets the length of time in seconds that an animation takes to complete one cycle.
// Duration is the constant for "duration" property tag.
//
// Used by `Animation`.
// Sets the length of time in seconds that an animation takes to complete one cycle.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
Duration = "duration"
// Delay is the constant for the "delay" animation property tag.
// The "delay" float property specifies the amount of time in seconds to wait from applying
// the animation to an element before beginning to perform the animation. The animation can start later,
// immediately from its beginning, or immediately and partway through the animation.
// Delay is the constant for "delay" property tag.
//
// Used by `Animation`.
// Specifies the amount of time in seconds to wait from applying the animation to an element before beginning to perform
// the animation. The animation can start later, immediately from its beginning or immediately and partway through the
// animation.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
Delay = "delay"
// TimingFunction is the constant for the "timing-function" animation property tag.
// The "timing-function" property sets how an animation progresses through the duration of each cycle.
// TimingFunction is the constant for "timing-function" property tag.
//
// Used by `Animation`.
// Set how an animation progresses through the duration of each cycle.
//
// Supported types: `string`.
//
// Values:
// "ease"(`EaseTiming`) - Speed increases towards the middle and slows down at the end.
// "ease-in"(`EaseInTiming`) - Speed is slow at first, but increases in the end.
// "ease-out"(`EaseOutTiming`) - Speed is fast at first, but decreases in the end.
// "ease-in-out"(`EaseInOutTiming`) - Speed is slow at first, but quickly increases and at the end it decreases again.
// "linear"(`LinearTiming`) - Constant speed.
TimingFunction = "timing-function"
// IterationCount is the constant for the "iteration-count" animation property tag.
// The "iteration-count" int property sets the number of times an animation sequence
// should be played before stopping.
// IterationCount is the constant for "iteration-count" property tag.
//
// Used by `Animation`.
// Sets the number of times an animation sequence should be played before stopping. Used only for animation script.
//
// Supported types: `int`, `string`.
//
// Internal type is `int`, other types converted to it during assignment.
IterationCount = "iteration-count"
// AnimationDirection is the constant for the "animation-direction" animation property tag.
//The "animation-direction" property sets whether an animation should play forward, backward,
// or alternate back and forth between playing the sequence forward and backward.
// AnimationDirection is the constant for "animation-direction" property tag.
//
// Used by `Animation`.
// Whether an animation should play forward, backward, or alternate back and forth between playing the sequence forward
// and backward. Used only for animation script.
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`NormalAnimation`) or "normal" - The animation plays forward every iteration, that is, when the animation ends, it is immediately reset to its starting position and played again.
// `1`(`ReverseAnimation`) or "reverse" - The animation plays backwards, from the last position to the first, and then resets to the final position and plays again.
// `2`(`AlternateAnimation`) or "alternate" - The animation changes direction in each cycle, that is, in the first cycle, it starts from the start position, reaches the end position, and in the second cycle, it continues from the end position and reaches the start position, and so on.
// `3`(`AlternateReverseAnimation`) or "alternate-reverse" - The animation starts playing from the end position and reaches the start position, and in the next cycle, continuing from the start position, it goes to the end position.
AnimationDirection = "animation-direction"
// NormalAnimation is value of the "animation-direction" property.
@ -76,12 +143,16 @@ const (
// EaseTiming - a timing function which increases in velocity towards the middle of the transition, slowing back down at the end
EaseTiming = "ease"
// EaseInTiming - a timing function which starts off slowly, with the transition speed increasing until complete
EaseInTiming = "ease-in"
// EaseOutTiming - a timing function which starts transitioning quickly, slowing down the transition continues.
EaseOutTiming = "ease-out"
// EaseInOutTiming - a timing function which starts transitioning slowly, speeds up, and then slows down again.
EaseInOutTiming = "ease-in-out"
// LinearTiming - a timing function at an even speed
LinearTiming = "linear"
)

View File

@ -5,50 +5,155 @@ import "strings"
// Constants which describe values for view's animation events properties
const (
// TransitionRunEvent is the constant for "transition-run-event" property tag.
// The "transition-run-event" is fired when a transition is first created,
// i.e. before any transition delay has begun.
//
// Used by `View`.
// Is fired when a transition is first created, i.e. before any transition delay has begun.
//
// General listener format:
// `func(view rui.View, propertyName string)`.
//
// where:
// view - Interface of a view which generated this event,
// propertyName - Name of the property.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(propertyName string)`,
// `func()`.
TransitionRunEvent = "transition-run-event"
// TransitionStartEvent is the constant for "transition-end-event" property tag.
// The "transition-start-event" is fired when a transition has actually started,
// i.e., after "delay" has ended.
// TransitionStartEvent is the constant for "transition-start-event" property tag.
//
// Used by `View`.
// Is fired when a transition has actually started, i.e., after "delay" has ended.
//
// General listener format:
// `func(view rui.View, propertyName string)`.
//
// where:
// view - Interface of a view which generated this event,
// propertyName - Name of the property.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(propertyName string)`,
// `func()`.
TransitionStartEvent = "transition-start-event"
// TransitionEndEvent is the constant for "transition-end-event" property tag.
// The "transition-end-event" is fired when a transition has completed.
//
// Used by `View`.
// Is fired when a transition has completed.
//
// General listener format:
// `func(view rui.View, propertyName string)`.
//
// where:
// view - Interface of a view which generated this event,
// propertyName - Name of the property.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(propertyName string)`,
// `func()`.
TransitionEndEvent = "transition-end-event"
// TransitionCancelEvent is the constant for "transition-cancel-event" property tag.
// The "transition-cancel-event" is fired when a transition is cancelled. The transition is cancelled when:
// * A new property transition has begun.
// * The "visibility" property is set to "gone".
// * The transition is stopped before it has run to completion, e.g. by moving the mouse off a hover-transitioning view.
//
// Used by `View`.
// Is fired when a transition is cancelled. The transition is cancelled when: * A new property transition has begun. * The
// "visibility" property is set to "gone". * The transition is stopped before it has run to completion, e.g. by moving the
// mouse off a hover-transitioning view.
//
// General listener format:
// `func(view rui.View, propertyName string)`.
//
// where:
// view - Interface of a view which generated this event,
// propertyName - Name of the property.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(propertyName string)`,
// `func()`.
TransitionCancelEvent = "transition-cancel-event"
// AnimationStartEvent is the constant for "animation-start-event" property tag.
// The "animation-start-event" is fired when an animation has started.
// If there is an animation-delay, this event will fire once the delay period has expired.
//
// Used by `View`.
// Fired when an animation has started. If there is an "animation-delay", this event will fire once the delay period has
// expired.
//
// General listener format:
// `func(view rui.View, animationId string)`.
//
// where:
// view - Interface of a view which generated this event,
// animationId - Id of the animation.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(animationId string)`,
// `func()`.
AnimationStartEvent = "animation-start-event"
// AnimationEndEvent is the constant for "animation-end-event" property tag.
// The "animation-end-event" is fired when an animation has completed.
// If the animation aborts before reaching completion, such as if the element is removed
// or the animation is removed from the element, the "animation-end-event" is not fired.
//
// Used by `View`.
// Fired when an animation has completed. If the animation aborts before reaching completion, such as if the element is
// removed or the animation is removed from the element, the "animation-end-event" is not fired.
//
// General listener format:
// `func(view rui.View, animationId string)`.
//
// where:
// view - Interface of a view which generated this event,
// animationId - Id of the animation.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(animationId string)`,
// `func()`.
AnimationEndEvent = "animation-end-event"
// AnimationCancelEvent is the constant for "animation-cancel-event" property tag.
// The "animation-cancel-event" is fired when an animation unexpectedly aborts.
// In other words, any time it stops running without sending the "animation-end-event".
// This might happen when the animation-name is changed such that the animation is removed,
// or when the animating view is hidden. Therefore, either directly or because any of its
// containing views are hidden.
// The event is not supported by all browsers.
//
// Used by `View`.
// Fired when an animation unexpectedly aborts. In other words, any time it stops running without sending the
// "animation-end-event". This might happen when the animation-name is changed such that the animation is removed, or when
// the animating view is hidden. Therefore, either directly or because any of its containing views are hidden. The event
// is not supported by all browsers.
//
// General listener format:
// `func(view rui.View, animationId string)`.
//
// where:
// view - Interface of a view which generated this event,
// animationId - Id of the animation.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(animationId string)`,
// `func()`.
AnimationCancelEvent = "animation-cancel-event"
// AnimationIterationEvent is the constant for "animation-iteration-event" property tag.
// The "animation-iteration-event" is fired when an iteration of an animation ends,
// and another one begins. This event does not occur at the same time as the animation end event,
// and therefore does not occur for animations with an "iteration-count" of one.
//
// Used by `View`.
// Fired when an iteration of an animation ends, and another one begins. This event does not occur at the same time as the
// animation end event, and therefore does not occur for animations with an "iteration-count" of one.
//
// General listener format:
// `func(view rui.View, animationId string)`.
//
// where:
// view - Interface of a view which generated this event,
// animationId - Id of the animation.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(animationId string)`,
// `func()`.
AnimationIterationEvent = "animation-iteration-event"
)

134
border.go
View File

@ -9,40 +9,168 @@ import (
const (
// NoneLine constant specifies that there is no border
NoneLine = 0
// SolidLine constant specifies the border/line as a solid line
SolidLine = 1
// DashedLine constant specifies the border/line as a dashed line
DashedLine = 2
// DottedLine constant specifies the border/line as a dotted line
DottedLine = 3
// DoubleLine constant specifies the border/line as a double solid line
DoubleLine = 4
// DoubleLine constant specifies the border/line as a double solid line
WavyLine = 5
// LeftStyle is the constant for "left-style" property tag.
//
// Used by `BorderProperty`.
// Left border line style.
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`NoneLine`) or "none" - The border will not be drawn.
// `1`(`SolidLine`) or "solid" - Solid line as a border.
// `2`(`DashedLine`) or "dashed" - Dashed line as a border.
// `3`(`DottedLine`) or "dotted" - Dotted line as a border.
// `4`(`DoubleLine`) or "double" - Double line as a border.
LeftStyle = "left-style"
// RightStyle is the constant for "-right-style" property tag.
// RightStyle is the constant for "right-style" property tag.
//
// Used by `BorderProperty`.
// Right border line style.
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`NoneLine`) or "none" - The border will not be drawn.
// `1`(`SolidLine`) or "solid" - Solid line as a border.
// `2`(`DashedLine`) or "dashed" - Dashed line as a border.
// `3`(`DottedLine`) or "dotted" - Dotted line as a border.
// `4`(`DoubleLine`) or "double" - Double line as a border.
RightStyle = "right-style"
// TopStyle is the constant for "top-style" property tag.
//
// Used by `BorderProperty`.
// Top border line style.
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`NoneLine`) or "none" - The border will not be drawn.
// `1`(`SolidLine`) or "solid" - Solid line as a border.
// `2`(`DashedLine`) or "dashed" - Dashed line as a border.
// `3`(`DottedLine`) or "dotted" - Dotted line as a border.
// `4`(`DoubleLine`) or "double" - Double line as a border.
TopStyle = "top-style"
// BottomStyle is the constant for "bottom-style" property tag.
//
// Used by `BorderProperty`.
// Bottom border line style.
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`NoneLine`) or "none" - The border will not be drawn.
// `1`(`SolidLine`) or "solid" - Solid line as a border.
// `2`(`DashedLine`) or "dashed" - Dashed line as a border.
// `3`(`DottedLine`) or "dotted" - Dotted line as a border.
// `4`(`DoubleLine`) or "double" - Double line as a border.
BottomStyle = "bottom-style"
// LeftWidth is the constant for "left-width" property tag.
//
// Used by `BorderProperty`.
// Left border line width.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
LeftWidth = "left-width"
// RightWidth is the constant for "-right-width" property tag.
// RightWidth is the constant for "right-width" property tag.
//
// Used by `BorderProperty`.
// Right border line width.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
RightWidth = "right-width"
// TopWidth is the constant for "top-width" property tag.
//
// Used by `BorderProperty`.
// Top border line width.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
TopWidth = "top-width"
// BottomWidth is the constant for "bottom-width" property tag.
//
// Used by `BorderProperty`.
// Bottom border line width.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
BottomWidth = "bottom-width"
// LeftColor is the constant for "left-color" property tag.
//
// Used by `BorderProperty`.
// Left border line color.
//
// Supported types: `Color`, `string`.
//
// Internal type is `Color`, other types converted to it during assignment.
// See `Color` description for more details.
LeftColor = "left-color"
// RightColor is the constant for "-right-color" property tag.
// RightColor is the constant for "right-color" property tag.
//
// Used by `BorderProperty`.
// Right border line color.
//
// Supported types: `Color`, `string`.
//
// Internal type is `Color`, other types converted to it during assignment.
// See `Color` description for more details.
RightColor = "right-color"
// TopColor is the constant for "top-color" property tag.
//
// Used by `BorderProperty`.
// Top border line color.
//
// Supported types: `Color`, `string`.
//
// Internal type is `Color`, other types converted to it during assignment.
// See `Color` description for more details.
TopColor = "top-color"
// BottomColor is the constant for "bottom-color" property tag.
//
// Used by `BorderProperty`.
// Bottom border line color.
//
// Supported types: `Color`, `string`.
//
// Internal type is `Color`, other types converted to it during assignment.
// See `Color` description for more details.
BottomColor = "bottom-color"
)

View File

@ -2,9 +2,12 @@ package rui
import "strings"
// DrawFunction is the constant for the "draw-function" property tag.
// The "draw-function" property sets the draw function of CanvasView.
// The function should have the following format: func(Canvas)
// DrawFunction is the constant for "draw-function" property tag.
//
// Used by `CanvasView`.
// Property sets the draw function of `CanvasView`.
//
// Supported types: `func(Canvas)`.
const DrawFunction = "draw-function"
// CanvasView interface of a custom draw view

View File

@ -5,8 +5,21 @@ import (
)
// CheckboxChangedEvent is the constant for "checkbox-event" property tag.
// The "checkbox-event" event occurs when the checkbox becomes checked/unchecked.
// The main listener format: func(Checkbox, bool), where the second argument is the checkbox state.
//
// Used by `Checkbox`.
// Event occurs when the checkbox becomes checked/unchecked.
//
// General listener format:
// `func(checkbox rui.Checkbox, checked bool)`.
//
// where:
// checkbox - Interface of a checkbox which generated this event,
// checked - Checkbox state.
//
// Allowed listener formats:
// `func(checkbox rui.Checkbox)`,
// `func(checked bool)`,
// `func()`.
const CheckboxChangedEvent = "checkbox-event"
// Checkbox represent a Checkbox view

View File

@ -7,12 +7,35 @@ import (
// Constants for [ColorPicker] specific properties and events.
const (
// ColorChangedEvent is the constant for "color-changed" property tag.
// The "color-changed" event occurs when [ColorPicker] value has been changed.
// The main listener format: func(picker ColorPicker, newColor, oldColor Color).
//
// Used by `ColorPicker`.
// Event generated when color picker value has been changed.
//
// General listener format:
// `func(picker rui.ColorPicker, newColor, oldColor rui.Color)`.
//
// where:
// picker - Interface of a color picker which generated this event,
// newColor - New color value,
// oldColor - Old color value.
//
// Allowed listener formats:
// `func(picker rui.ColorPicker, newColor rui.Color)`,
// `func(newColor, oldColor rui.Color)`,
// `func(newColor rui.Color)`,
// `func(picker rui.ColorPicker)`,
// `func()`.
ColorChangedEvent = "color-changed"
// ColorPickerValue is the constant for "color-picker-value" property tag.
// The "color-picker-value" define current color picker value.
//
// Used by `ColorPicker`.
// Define current color picker value.
//
// Supported types: `Color`, `string`.
//
// Internal type is `Color`, other types converted to it during assignment.
// See `Color` description for more details.
ColorPickerValue = "color-picker-value"
)

View File

@ -7,49 +7,112 @@ import (
// Constants for [ColumnLayout] specific properties and events
const (
// ColumnCount is the constant for the "column-count" property tag.
// The "column-count" int property specifies number of columns into which the content is break
// Values less than zero are not valid. if the "column-count" property value is 0 then
// the number of columns is calculated based on the "column-width" property
// ColumnCount is the constant for "column-count" property tag.
//
// Used by `ColumnLayout`.
// Specifies number of columns into which the content is break. Values less than zero are not valid. If this property
// value is 0 then the number of columns is calculated based on the "column-width" property.
//
// Supported types: `int`, `string`.
//
// Values:
// `0` or "0" - Use "column-width" to control how many columns will be created.
// >= `0` or >= "0" - Тhe number of columns into which the content is divided.
ColumnCount = "column-count"
// ColumnWidth is the constant for the "column-width" property tag.
// The "column-width" SizeUnit property specifies the width of each column.
// ColumnWidth is the constant for "column-width" property tag.
//
// Used by `ColumnLayout`.
// Specifies the width of each column.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
ColumnWidth = "column-width"
// ColumnGap is the constant for the "column-gap" property tag.
// The "column-width" SizeUnit property sets the size of the gap (gutter) between columns.
// ColumnGap is the constant for "column-gap" property tag.
//
// Used by `ColumnLayout`.
// Set the size of the gap (gutter) between columns.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
ColumnGap = "column-gap"
// ColumnSeparator is the constant for the "column-separator" property tag.
// The "column-separator" property specifies the line drawn between columns in a multi-column layout.
// ColumnSeparator is the constant for "column-separator" property tag.
//
// Used by `ColumnLayout`.
// Specifies the line drawn between columns in a multi-column layout.
//
// Supported types: `ColumnSeparatorProperty`, `ViewBorder`.
//
// Internal type is `ColumnSeparatorProperty`, other types converted to it during assignment.
// See `ColumnSeparatorProperty` and `ViewBorder` description for more details.
ColumnSeparator = "column-separator"
// ColumnSeparatorStyle is the constant for the "column-separator-style" property tag.
// The "column-separator-style" int property sets the style of the line drawn between
// columns in a multi-column layout.
// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
// ColumnSeparatorStyle is the constant for "column-separator-style" property tag.
//
// Used by `ColumnLayout`.
// Controls the style of the line drawn between columns in a multi-column layout.
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`NoneLine`) or "none" - The separator will not be drawn.
// `1`(`SolidLine`) or "solid" - Solid line as a separator.
// `2`(`DashedLine`) or "dashed" - Dashed line as a separator.
// `3`(`DottedLine`) or "dotted" - Dotted line as a separator.
// `4`(`DoubleLine`) or "double" - Double line as a separator.
ColumnSeparatorStyle = "column-separator-style"
// ColumnSeparatorWidth is the constant for the "column-separator-width" property tag.
// The "column-separator-width" SizeUnit property sets the width of the line drawn between
// columns in a multi-column layout.
// ColumnSeparatorWidth is the constant for "column-separator-width" property tag.
//
// Used by `ColumnLayout`.
// Set the width of the line drawn between columns in a multi-column layout.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
ColumnSeparatorWidth = "column-separator-width"
// ColumnSeparatorColor is the constant for the "column-separator-color" property tag.
// The "column-separator-color" Color property sets the color of the line drawn between
// columns in a multi-column layout.
// ColumnSeparatorColor is the constant for "column-separator-color" property tag.
//
// Used by `ColumnLayout`.
// Set the color of the line drawn between columns in a multi-column layout.
//
// Supported types: `Color`, `string`.
//
// Internal type is `Color`, other types converted to it during assignment.
// See `Color` description for more details.
ColumnSeparatorColor = "column-separator-color"
// ColumnFill is the constant for the "column-fill" property tag.
// The "column-fill" int property controls how an ColumnLayout's contents are balanced when broken into columns.
// Valid values are
// * ColumnFillBalance (0) - Content is equally divided between columns (default value);
// * ColumnFillAuto (1) - Columns are filled sequentially. Content takes up only the room it needs, possibly resulting in some columns remaining empty.
// ColumnFill is the constant for "column-fill" property tag.
//
// Used by `ColumnLayout`.
// Controls how a `ColumnLayout`'s content is balanced when broken into columns. Default value is "balance".
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`ColumnFillBalance`) or "balance" - Content is equally divided between columns.
// `1`(`ColumnFillAuto`) or "auto" - Columns are filled sequentially. Content takes up only the room it needs, possibly resulting in some columns remaining empty.
ColumnFill = "column-fill"
// ColumnSpanAll is the constant for the "column-span-all" property tag.
// The "column-span-all" bool property makes it possible for a view to span across all columns when its value is set to true.
// ColumnSpanAll is the constant for "column-span-all" property tag.
//
// Used by `ColumnLayout`.
// Property used in views placed inside the column layout container. Makes it possible for a view to span across all
// columns. Default value is `false`.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - View will span across all columns.
// `false` or `0` or "false", "no", "off", "0" - View will be a part of a column.
ColumnSpanAll = "column-span-all"
)

View File

@ -3,7 +3,101 @@ package rui
import "strings"
const (
// DataList is the constant for the "data-list" property tag.
// DataList is the constant for "data-list" property tag.
//
// Used by `ColorPicker`, `DatePicker`, `EditView`, `NumberPicker`, `TimePicker`.
//
// Usage in `ColorPicker`:
// List of pre-defined colors.
//
// Supported types: `[]string`, `string`, `[]fmt.Stringer`, `[]Color`, `[]SizeUnit`, `[]AngleUnit`, `[]any` containing
// elements of `string`, `fmt.Stringer`, `bool`, `rune`, `float32`, `float64`, `int`, `int8` … `int64`, `uint`, `uint8` …
// `uint64`.
//
// Internal type is `[]string`, other types converted to it during assignment.
//
// Conversion rules:
// `string` - contain single item.
// `[]string` - an array of items.
// `[]fmt.Stringer` - an array of objects convertible to a string.
// `[]Color` - An array of color values which will be converted to a string array.
// `[]SizeUnit` - an array of size unit values which will be converted to a string array.
// `[]any` - this array must contain only types which were listed in Types section.
//
// Usage in `DatePicker`:
// List of predefined dates. If we set this property, date picker may have a drop-down menu with a list of these values.
// Some browsers may ignore this property, such as Safari for macOS. The value of this property must be an array of
// strings in the format "YYYY-MM-DD".
//
// Supported types: `[]string`, `string`, `[]fmt.Stringer`, `[]Color`, `[]SizeUnit`, `[]AngleUnit`, `[]any` containing
// elements of `string`, `fmt.Stringer`, `bool`, `rune`, `float32`, `float64`, `int`, `int8` … `int64`, `uint`, `uint8` …
// `uint64`.
//
// Internal type is `[]string`, other types converted to it during assignment.
//
// Conversion rules:
// `string` - contain single item.
// `[]string` - an array of items.
// `[]fmt.Stringer` - an array of objects convertible to a string.
// `[]Color` - An array of color values which will be converted to a string array.
// `[]SizeUnit` - an array of size unit values which will be converted to a string array.
// `[]any` - this array must contain only types which were listed in Types section.
//
// Usage in `EditView`:
// Array of recommended values.
//
// Supported types: `[]string`, `string`, `[]fmt.Stringer`, `[]Color`, `[]SizeUnit`, `[]AngleUnit`, `[]any` containing
// elements of `string`, `fmt.Stringer`, `bool`, `rune`, `float32`, `float64`, `int`, `int8` … `int64`, `uint`, `uint8` …
// `uint64`.
//
// Internal type is `[]string`, other types converted to it during assignment.
//
// Conversion rules:
// `string` - contain single item.
// `[]string` - an array of items.
// `[]fmt.Stringer` - an array of objects convertible to a string.
// `[]Color` - An array of color values which will be converted to a string array.
// `[]SizeUnit` - an array of size unit values which will be converted to a string array.
// `[]any` - this array must contain only types which were listed in Types section.
//
// Usage in `NumberPicker`:
// Specify an array of recommended values.
//
// Supported types: `[]string`, `string`, `[]fmt.Stringer`, `[]Color`, `[]SizeUnit`, `[]AngleUnit`, `[]float`, `[]int`,
// `[]bool`, `[]any` containing elements of `string`, `fmt.Stringer`, `bool`, `rune`, `float32`, `float64`, `int`, `int8`
// … `int64`, `uint`, `uint8` … `uint64`.
//
// Internal type is `[]string`, other types converted to it during assignment.
//
// Conversion rules:
// `string` - must contain integer or floating point number, converted to `[]string`.
// `[]string` - an array of strings which must contain integer or floating point numbers, stored as is.
// `[]fmt.Stringer` - object which implement this interface must contain integer or floating point numbers, converted to a `[]string`.
// `[]Color` - an array of color values, converted to `[]string`.
// `[]SizeUnit` - an array of size unit, converted to `[]string`.
// `[]AngleUnit` - an array of angle unit, converted to `[]string`.
// `[]float` - converted to `[]string`.
// `[]int` - converted to `[]string`.
// `[]bool` - converted to `[]string`.
// `[]any` - an array which may contain types listed in Types section above, each value will be converted to a `string` and wrapped to array.
//
// Usage in `TimePicker`:
// An array of recommended values. The value of this property must be an array of strings in the format "HH:MM:SS" or
// "HH:MM".
//
// Supported types: `[]string`, `string`, `[]fmt.Stringer`, `[]Color`, `[]SizeUnit`, `[]AngleUnit`, `[]any` containing
// elements of `string`, `fmt.Stringer`, `bool`, `rune`, `float32`, `float64`, `int`, `int8` … `int64`, `uint`, `uint8` …
// `uint64`.
//
// Internal type is `[]string`, other types converted to it during assignment.
//
// Conversion rules:
// `string` - contain single item.
// `[]string` - an array of items.
// `[]fmt.Stringer` - an array of objects convertible to a string.
// `[]Color` - An array of color values which will be converted to a string array.
// `[]SizeUnit` - an array of size unit values which will be converted to a string array.
// `[]any` - this array must contain only types which were listed in Types section.
DataList = "data-list"
)

View File

@ -9,24 +9,104 @@ import (
// Constants for [DatePicker] specific properties and events.
const (
// DateChangedEvent is the constant for "date-changed" property tag.
// The "date-changed" event occur when [DatePicker] value has been changed.
// The main listener format: func(picker DatePicker, newDate, oldDate time.Time).
//
// Used by `DatePicker`.
// Occur when date picker value has been changed.
//
// General listener format:
// `func(picker rui.DatePicker, newDate, oldDate time.Time)`.
//
// where:
// picker - Interface of a date picker which generated this event,
// newDate - New date value,
// oldDate - Old date value.
//
// Allowed listener formats:
// `func(picker rui.DatePicker, newDate time.Time)`,
// `func(newDate, oldDate time.Time)`,
// `func(newDate time.Time)`,
// `func(picker rui.DatePicker)`,
// `func()`.
DateChangedEvent = "date-changed"
// DatePickerMin is the constant for "date-picker-min" property tag.
// The "date-picker-min" define minimum date value.
//
// Used by `DatePicker`.
// Minimum date value.
//
// Supported types: `time.Time`, `string`.
//
// Internal type is `time.Time`, other types converted to it during assignment.
//
// Conversion rules:
// `string` - values of this type parsed and converted to `time.Time`. The following formats are supported:
// "YYYYMMDD" - "20240102".
// "Mon-DD-YYYY" - "Jan-02-24".
// "Mon-DD-YY" - "Jan-02-2024".
// "DD-Mon-YYYY" - "02-Jan-2024".
// "YYYY-MM-DD" - "2024-01-02".
// "Month DD, YYYY" - "January 02, 2024".
// "DD Month YYYY" - "02 January 2024".
// "MM/DD/YYYY" - "01/02/2024".
// "MM/DD/YY" - "01/02/24".
// "MMDDYY" - "010224".
DatePickerMin = "date-picker-min"
// DatePickerMax is the constant for "date-picker-max" property tag.
// The "date-picker-max" define maximum date value.
//
// Used by `DatePicker`.
// Maximum date value.
//
// Supported types: `time.Time`, `string`.
//
// Internal type is `time.Time`, other types converted to it during assignment.
//
// Conversion rules:
// `string` - values of this type parsed and converted to `time.Time`. The following formats are supported:
// "YYYYMMDD" - "20240102".
// "Mon-DD-YYYY" - "Jan-02-24".
// "Mon-DD-YY" - "Jan-02-2024".
// "DD-Mon-YYYY" - "02-Jan-2024".
// "YYYY-MM-DD" - "2024-01-02".
// "Month DD, YYYY" - "January 02, 2024".
// "DD Month YYYY" - "02 January 2024".
// "MM/DD/YYYY" - "01/02/2024".
// "MM/DD/YY" - "01/02/24".
// "MMDDYY" - "010224".
DatePickerMax = "date-picker-max"
// DatePickerStep is the constant for "date-picker-step" property tag.
// The "date-picker-step" define date step value in days.
//
// Used by `DatePicker`.
// Date change step in days.
//
// Supported types: `int`, `string`.
//
// Values:
// >= `0` or >= "0" - Step value in days used to increment or decrement date.
DatePickerStep = "date-picker-step"
// DatePickerValue is the constant for "date-picker-value" property tag.
// The "date-picker-value" define current date value.
//
// Used by `DatePicker`.
// Current value.
//
// Supported types: `time.Time`, `string`.
//
// Internal type is `time.Time`, other types converted to it during assignment.
//
// Conversion rules:
// `string` - values of this type parsed and converted to `time.Time`. The following formats are supported:
// "YYYYMMDD" - "20240102".
// "Mon-DD-YYYY" - "Jan-02-24".
// "Mon-DD-YY" - "Jan-02-2024".
// "DD-Mon-YYYY" - "02-Jan-2024".
// "YYYY-MM-DD" - "2024-01-02".
// "Month DD, YYYY" - "January 02, 2024".
// "DD Month YYYY" - "02 January 2024".
// "MM/DD/YYYY" - "01/02/2024".
// "MM/DD/YY" - "01/02/24".
// "MMDDYY" - "010224".
DatePickerValue = "date-picker-value"
dateFormat = "2006-01-02"

View File

@ -4,12 +4,27 @@ import "strings"
// Constants for [DetailsView] specific properties and events
const (
// Summary is the constant for the "summary" property tag.
// The contents of the "summary" property are used as the label for the disclosure widget.
// Summary is the constant for "summary" property tag.
//
// Used by `DetailsView`.
// The content of this property is used as the label for the disclosure widget.
//
// Supported types: `string`, `View`.
//
// `string` - Summary as a text.
// `View` - Summary as a view, in this case it can be quite complex if needed.
Summary = "summary"
// Expanded is the constant for the "expanded" property tag.
// If the "expanded" boolean property is "true", then the content of view is visible.
// If the value is "false" then the content is collapsed.
// Expanded is the constant for "expanded" property tag.
//
// Used by `DetailsView`.
// Controls the content expanded state of the details view. Default value is `false`.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - Content is visible.
// `false` or `0` or "false", "no", "off", "0" - Content is collapsed(hidden).
Expanded = "expanded"
)

View File

@ -7,8 +7,18 @@ import (
)
// DropDownEvent is the constant for "drop-down-event" property tag.
// The "drop-down-event" event occurs when a list item becomes selected.
// The main listener format: func(DropDownList, int), where the second argument is the item index.
//
// Used by `DropDownList`.
// Occur when a list item becomes selected.
//
// General listener format:
// `func(list rui.DropDownList, index int)`.
//
// where:
// list - Interface of a drop down list which generated this event,
// index - Index of a newly selected item.
//
// Allowed listener formats:
const DropDownEvent = "drop-down-event"
// DropDownList represent a DropDownList view

View File

@ -7,16 +7,63 @@ import (
// Constants for [EditView] specific properties and events
const (
// EditTextChangedEvent is the constant for the "edit-text-changed" property tag.
// EditTextChangedEvent is the constant for "edit-text-changed" property tag.
//
// Used by `EditView`.
// Occur when edit view text has been changed.
//
// General listener format:
// `func(editView rui.EditView, newText, oldText string)`.
//
// where:
// editView - Interface of an edit view which generated this event,
// newText - New edit view text,
// oldText - Previous edit view text.
//
// Allowed listener formats:
// `func(editView rui.EditView, newText string)`,
// `func(newText, oldText string)`,
// `func(newText string)`,
// `func(editView rui.EditView)`,
// `func()`.
EditTextChangedEvent = "edit-text-changed"
// EditViewType is the constant for the "edit-view-type" property tag.
// EditViewType is the constant for "edit-view-type" property tag.
//
// Used by `EditView`.
// Type of the text input. Default value is "text".
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`SingleLineText`) or "text" - One-line text editor.
// `1`(`PasswordText`) or "password" - Password editor. The text is hidden by asterisks.
// `2`(`EmailText`) or "email" - Single e-mail editor.
// `3`(`EmailsText`) or "emails" - Multiple e-mail editor.
// `4`(`URLText`) or "url" - Internet address input editor.
// `5`(`PhoneText`) or "phone" - Phone number editor.
// `6`(`MultiLineText`) or "multiline" - Multi-line text editor.
EditViewType = "edit-view-type"
// EditViewPattern is the constant for the "edit-view-pattern" property tag.
// EditViewPattern is the constant for "edit-view-pattern" property tag.
//
// Used by `EditView`.
// Regular expression to limit editing of a text.
//
// Supported types: `string`.
EditViewPattern = "edit-view-pattern"
// Spellcheck is the constant for the "spellcheck" property tag.
// Spellcheck is the constant for "spellcheck" property tag.
//
// Used by `EditView`.
// Enable or disable spell checker. Available in `SingleLineText` and `MultiLineText` types of edit view. Default value is
// `false`.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - Enable spell checker for text.
// `false` or `0` or "false", "no", "off", "0" - Disable spell checker for text.
Spellcheck = "spellcheck"
)
@ -24,16 +71,22 @@ const (
const (
// SingleLineText - single-line text type of EditView
SingleLineText = 0
// PasswordText - password type of EditView
PasswordText = 1
// EmailText - e-mail type of EditView. Allows to enter one email
EmailText = 2
// EmailsText - e-mail type of EditView. Allows to enter multiple emails separated by comma
EmailsText = 3
// URLText - url type of EditView. Allows to enter one url
URLText = 4
// PhoneText - telephone type of EditView. Allows to enter one phone number
PhoneText = 5
// MultiLineText - multi-line text type of EditView
MultiLineText = 6
)

View File

@ -10,13 +10,47 @@ import (
// Constants for [FilePicker] specific properties and events
const (
// FileSelectedEvent is the constant for "file-selected-event" property tag.
// The "file-selected-event" is fired when user selects file(s) in the FilePicker.
//
// Used by `FilePicker`.
// Fired when user selects file(s).
//
// General listener format:
// `func(picker rui.FilePicker, files []rui.FileInfo)`.
//
// where:
// picker - Interface of a file picker which generated this event,
// files - Array of description of selected files.
//
// Allowed listener formats:
// `func(picker rui.FilePicker)`,
// `func(files []rui.FileInfo)`,
// `func()`.
FileSelectedEvent = "file-selected-event"
// Accept is the constant for "accept" property tag.
// The "accept" property of the FilePicker sets the list of allowed file extensions or MIME types.
//
// Used by `FilePicker`.
// Set the list of allowed file extensions or MIME types.
//
// Supported types: `string`, `[]string`.
//
// Internal type is `string`, other types converted to it during assignment.
//
// Conversion rules:
// `string` - may contain single value of multiple separated by comma(`,`).
// `[]string` - an array of acceptable file extensions or MIME types.
Accept = "accept"
// Multiple is the constant for "multiple" property tag.
// The "multiple" bool property of the FilePicker sets whether multiple files can be selected
//
// Used by `FilePicker`.
// Controls whether multiple files can be selected.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - Several files can be selected.
// `false` or `0` or "false", "no", "off", "0" - Only one file can be selected.
Multiple = "multiple"
)
@ -24,10 +58,13 @@ const (
type FileInfo struct {
// Name - the file's name.
Name string
// LastModified specifying the date and time at which the file was last modified
LastModified time.Time
// Size - the size of the file in bytes.
Size int64
// MimeType - the file's MIME type.
MimeType string
}

View File

@ -5,19 +5,33 @@ import "strings"
// Constants which represent [View] specific focus events properties
const (
// FocusEvent is the constant for "focus-event" property tag.
// The "focus-event" event occurs when the View takes input focus.
// The main listener format:
// func(View).
// The additional listener format:
// func().
//
// Used by `View`.
// Occur when the view takes input focus.
//
// General listener format:
// `func(View)`.
//
// where:
// view - Interface of a view which generated this event.
//
// Allowed listener formats:
// `func()`.
FocusEvent = "focus-event"
// LostFocusEvent is the constant for "lost-focus-event" property tag.
// The "lost-focus-event" event occurs when the View lost input focus.
// The main listener format:
// func(View).
// The additional listener format:
// func().
//
// Used by `View`.
// Occur when the View lost input focus.
//
// General listener format:
// `func(view rui.View)`.
//
// where:
// view - Interface of a view which generated this event.
//
// Allowed listener formats:
// `func()`.
LostFocusEvent = "lost-focus-event"
)

View File

@ -7,40 +7,72 @@ import (
// Constants related to [GridLayout] specific properties and events
const (
// CellVerticalAlign is the constant for the "cell-vertical-align" property tag.
// The "cell-vertical-align" int property sets the default vertical alignment
// of GridLayout children within the cell they are occupying. Valid values:
// * TopAlign (0) / "top"
// * BottomAlign (1) / "bottom"
// * CenterAlign (2) / "center", and
// * StretchAlign (2) / "stretch"
// CellVerticalAlign is the constant for "cell-vertical-align" property tag.
//
// Used by `GridLayout`, `SvgImageView`.
//
// Usage in `GridLayout`:
// Sets the default vertical alignment of `GridLayout` children within the cell they are occupying.
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`TopAlign`) or "top" - Top alignment.
// `1`(`BottomAlign`) or "bottom" - Bottom alignment.
// `2`(`CenterAlign`) or "center" - Center alignment.
// `3`(`StretchAlign`) or "stretch" - Full height stretch.
//
// Usage in `SvgImageView`:
// Same as "vertical-align".
CellVerticalAlign = "cell-vertical-align"
// CellHorizontalAlign is the constant for the "cell-horizontal-align" property tag.
// The "cell-horizontal-align" int property sets the default horizontal alignment
// of GridLayout children within the occupied cell. Valid values:
// * LeftAlign (0) / "left"
// * RightAlign (1) / "right"
// * CenterAlign (2) / "center"
// * StretchAlign (3) / "stretch"
// CellHorizontalAlign is the constant for "cell-horizontal-align" property tag.
//
// Used by `GridLayout`, `SvgImageView`.
//
// Usage in `GridLayout`:
// Sets the default horizontal alignment of `GridLayout` children within the occupied cell.
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`LeftAlign`) or "left" - Left alignment.
// `1`(`RightAlign`) or "right" - Right alignment.
// `2`(`CenterAlign`) or "center" - Center alignment.
// `3`(`StretchAlign`) or "stretch" - Full width stretch.
//
// Usage in `SvgImageView`:
// Same as "horizontal-align".
CellHorizontalAlign = "cell-horizontal-align"
// CellVerticalSelfAlign is the constant for the "cell-vertical-self-align" property tag.
// The "cell-vertical-align" int property sets the vertical alignment of GridLayout children
// within the cell they are occupying. The property is set for the child view of GridLayout. Valid values:
// * TopAlign (0) / "top"
// * BottomAlign (1) / "bottom"
// * CenterAlign (2) / "center", and
// * StretchAlign (2) / "stretch"
// CellVerticalSelfAlign is the constant for "cell-vertical-self-align" property tag.
//
// Used by `GridLayout`.
// Sets the vertical alignment of `GridLayout` children within the cell they are occupying. The property is set for the
// child view of `GridLayout`.
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`TopAlign`) or "top" - Top alignment.
// `1`(`BottomAlign`) or "bottom" - Bottom alignment.
// `2`(`CenterAlign`) or "center" - Center alignment.
// `3`(`StretchAlign`) or "stretch" - Full height stretch.
CellVerticalSelfAlign = "cell-vertical-self-align"
// CellHorizontalSelfAlign is the constant for the "cell-horizontal-self-align" property tag.
// The "cell-horizontal-self align" int property sets the horizontal alignment of GridLayout children
// within the occupied cell. The property is set for the child view of GridLayout. Valid values:
// * LeftAlign (0) / "left"
// * RightAlign (1) / "right"
// * CenterAlign (2) / "center"
// * StretchAlign (3) / "stretch"
// CellHorizontalSelfAlign is the constant for "cell-horizontal-self-align" property tag.
//
// Used by `GridLayout`.
// Sets the horizontal alignment of `GridLayout` children within the occupied cell. The property is set for the child view
// of `GridLayout`.
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`LeftAlign`) or "left" - Left alignment.
// `1`(`RightAlign`) or "right" - Right alignment.
// `2`(`CenterAlign`) or "center" - Center alignment.
// `3`(`StretchAlign`) or "stretch" - Full width stretch.
CellHorizontalSelfAlign = "cell-horizontal-self-align"
)

View File

@ -7,28 +7,55 @@ import (
// Constants which represent [ImageView] specific properties and events
const (
// LoadedEvent is the constant for the "loaded-event" property tag.
// The "loaded-event" event occurs event occurs when the image has been loaded.
// LoadedEvent is the constant for "loaded-event" property tag.
//
// Used by `ImageView`.
// Occur when the image has been loaded.
//
// General listener format:
// `func(image rui.ImageView)`.
//
// where:
// image - Interface of an image view which generated this event.
//
// Allowed listener formats:
// `func()`.
LoadedEvent = "loaded-event"
// ErrorEvent is the constant for the "error-event" property tag.
// The "error-event" event occurs event occurs when the image loading failed.
// ErrorEvent is the constant for "error-event" property tag.
//
// Used by `ImageView`.
// Occur when the image loading has been failed.
//
// General listener format:
// `func(image rui.ImageView)`.
//
// where:
// image - Interface of an image view which generated this event.
//
// Allowed listener formats:
// `func()`.
ErrorEvent = "error-event"
// NoneFit - value of the "object-fit" property of an ImageView. The replaced content is not resized
NoneFit = 0
// ContainFit - value of the "object-fit" property of an ImageView. The replaced content
// is scaled to maintain its aspect ratio while fitting within the elements content box.
// The entire object is made to fill the box, while preserving its aspect ratio, so the object
// will be "letterboxed" if its aspect ratio does not match the aspect ratio of the box.
ContainFit = 1
// CoverFit - value of the "object-fit" property of an ImageView. The replaced content
// is sized to maintain its aspect ratio while filling the elements entire content box.
// If the object's aspect ratio does not match the aspect ratio of its box, then the object will be clipped to fit.
CoverFit = 2
// FillFit - value of the "object-fit" property of an ImageView. The replaced content is sized
// to fill the elements content box. The entire object will completely fill the box.
// If the object's aspect ratio does not match the aspect ratio of its box, then the object will be stretched to fit.
FillFit = 3
// ScaleDownFit - value of the "object-fit" property of an ImageView. The content is sized as
// if NoneFit or ContainFit were specified, whichever would result in a smaller concrete object size.
ScaleDownFit = 4

View File

@ -4,20 +4,40 @@ import "strings"
// Constants which represent [View] specific keyboard events properties
const (
// KeyDown is the constant for "key-down-event" property tag.
// The "key-down-event" event is fired when a key is pressed.
// The main listener format:
// func(View, KeyEvent).
// The additional listener formats:
// func(KeyEvent), func(View), and func().
// KeyDownEvent is the constant for "key-down-event" property tag.
//
// Used by `View`.
// Is fired when a key is pressed.
//
// General listener format:
// `func(view rui.View, event rui.KeyEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Key event.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(event rui.KeyEvent)`,
// `func()`.
KeyDownEvent = "key-down-event"
// KeyPp is the constant for "key-up-event" property tag.
// The "key-up-event" event is fired when a key is released.
// The main listener format:
// func(View, KeyEvent).
// The additional listener formats:
// func(KeyEvent), func(View), and func().
// KeyUpEvent is the constant for "key-up-event" property tag.
//
// Used by `View`.
// Is fired when a key is released.
//
// General listener format:
// `func(view rui.View, event rui.KeyEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Key event.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(event rui.KeyEvent)`,
// `func()`.
KeyUpEvent = "key-up-event"
)

View File

@ -9,30 +9,78 @@ import (
// Constants which represent [ListView] specific properties and events
const (
// ListItemClickedEvent is the constant for "list-item-clicked" property tag.
// The "list-item-clicked" event occurs when the user clicks on an item in the list.
// The main listener format: func(ListView, int), where the second argument is the item index.
//
// Used by `ListView`.
// Occur when the user clicks on an item in the list.
//
// General listener format:
// `func(list rui.ListView, item int)`.
//
// where:
// list - Interface of a list which generated this event,
// item - An index of an item clicked.
//
// Allowed listener formats:
// `func(item int)`,
// `func(list rui.ListView)`,
// `func()`.
ListItemClickedEvent = "list-item-clicked"
// ListItemSelectedEvent is the constant for "list-item-selected" property tag.
// The "list-item-selected" event occurs when a list item becomes selected.
// The main listener format: func(ListView, int), where the second argument is the item index.
//
// Used by `ListView`.
// Occur when a list item becomes selected.
//
// General listener format:
// `func(list rui.ListView, item int)`.
//
// where:
// list - Interface of a list which generated this event,
// item - An index of an item selected.
//
// Allowed listener formats:
ListItemSelectedEvent = "list-item-selected"
// ListItemCheckedEvent is the constant for "list-item-checked" property tag.
// The "list-item-checked" event occurs when a list item checkbox becomes checked/unchecked.
// The main listener format: func(ListView, []int), where the second argument is the array of checked item indexes.
//
// Used by `ListView`.
// Occur when a list item checkbox becomes checked or unchecked.
//
// General listener format:
// `func(list rui.ListView, checkedItems []int)`.
//
// where:
// list - Interface of a list which generated this event,
// checkedItems - Array of indices of marked elements.
//
// Allowed listener formats:
// `func(checkedItems []int)`,
// `func(list rui.ListView)`,
// `func()`.
ListItemCheckedEvent = "list-item-checked"
// ListItemStyle is the constant for "list-item-style" property tag.
// The "list-item-style" string property defines the style of an unselected item
//
// Used by `ListView`.
// Defines the style of an unselected item.
//
// Supported types: `string`.
ListItemStyle = "list-item-style"
// CurrentStyle is the constant for "current-style" property tag.
// The "current-style" string property defines the style of the selected item when the ListView is focused.
//
// Used by `ListView`.
// Defines the style of the selected item when the `ListView` is focused.
//
// Supported types: `string`.
CurrentStyle = "current-style"
// CurrentInactiveStyle is the constant for "current-inactive-style" property tag.
// The "current-inactive-style" string property defines the style of the selected item when the ListView is unfocused.
//
// Used by `ListView`.
// Defines the style of the selected item when the `ListView` is unfocused.
//
// Supported types: `string`.
CurrentInactiveStyle = "current-inactive-style"
)
@ -41,6 +89,7 @@ const (
const (
// VerticalOrientation is the vertical ListView orientation
VerticalOrientation = 0
// HorizontalOrientation is the horizontal ListView orientation
HorizontalOrientation = 1
)
@ -49,8 +98,10 @@ const (
const (
// NoneCheckbox is value of "checkbox" property: no checkbox
NoneCheckbox = 0
// SingleCheckbox is value of "checkbox" property: only one item can be checked
SingleCheckbox = 1
// MultipleCheckbox is value of "checkbox" property: several items can be checked
MultipleCheckbox = 2
)

View File

@ -9,124 +9,817 @@ import (
// Constants which related to media player properties and events
const (
// Controls is the constant for the "autoplay" controls tag.
// If the "controls" bool property is "true", the browser will offer controls to allow the user
// to control audio/video playback, including volume, seeking, and pause/resume playback.
// Its default value is false.
// Controls is the constant for "controls" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Controls whether the browser need to provide controls to allow user to control audio playback, volume, seeking and
// pause/resume playback. Default value is `false`.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - The browser will offer controls to allow the user to control audio playback, volume, seeking and pause/resume playback.
// `false` or `0` or "false", "no", "off", "0" - No controls will be visible to the end user.
//
// Usage in `VideoPlayer`:
// Whether the browser need to provide controls to allow user to control video playback, volume, seeking and pause/resume
// playback. Default value is `false`.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - The browser will offer controls to allow the user to control video playback, volume, seeking and pause/resume playback.
// `false` or `0` or "false", "no", "off", "0" - No controls will be visible to the end user.
Controls = "controls"
// Loop is the constant for the "loop" property tag.
// If the "loop" bool property is "true", the audio/video player will automatically seek back
// to the start upon reaching the end of the audio/video.
// Its default value is false.
// Loop is the constant for "loop" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Controls whether the audio player will play media in a loop. Default value is `false`.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - The audio player will automatically seek back to the start upon reaching the end of the audio.
// `false` or `0` or "false", "no", "off", "0" - Audio player will stop playing when the end of the media file has been reached.
//
// Usage in `VideoPlayer`:
// Controls whether the video player will play media in a loop. Default value is `false`.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - The video player will automatically seek back to the start upon reaching the end of the video.
// `false` or `0` or "false", "no", "off", "0" - Video player will stop playing when the end of the media file has been reached.
Loop = "loop"
// Muted is the constant for the "muted" property tag.
// The "muted" bool property indicates whether the audio/video will be initially silenced.
// Its default value is false.
// Muted is the constant for "muted" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Controls whether the audio will be initially silenced. Default value is `false`.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - Audio will be muted.
// `false` or `0` or "false", "no", "off", "0" - Audio playing normally.
//
// Usage in `VideoPlayer`:
// Controls whether the video will be initially silenced. Default value is `false`.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - Video will be muted.
// `false` or `0` or "false", "no", "off", "0" - Video playing normally.
Muted = "muted"
// Preload is the constant for the "preload" property tag.
// The "preload" int property is intended to provide a hint to the browser about what
// the author thinks will lead to the best user experience. It may have one of the following values:
// PreloadNone (0), PreloadMetadata (1), and PreloadAuto (2)
// The default value is different for each browser.
// Preload is the constant for "preload" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Property is intended to provide a hint to the browser about what the author thinks will lead to the best user
// experience. Default value is different for each browser.
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`PreloadNone`) or "none" - Media file must not be pre-loaded.
// `1`(`PreloadMetadata`) or "metadata" - Only metadata is preloaded.
// `2`(`PreloadAuto`) or "auto" - The entire media file can be downloaded even if the user doesn't have to use it.
//
// Usage in `VideoPlayer`:
// Property is intended to provide a hint to the browser about what the author thinks will lead to the best user
// experience. Default value is different for each browser.
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`PreloadNone`) or "none" - Media file must not be pre-loaded.
// `1`(`PreloadMetadata`) or "metadata" - Only metadata is preloaded.
// `2`(`PreloadAuto`) or "auto" - The entire media file can be downloaded even if the user doesn't have to use it.
Preload = "preload"
// AbortEvent is the constant for the "abort-event" property tag.
// The "abort-event" event fired when the resource was not fully loaded, but not as the result of an error.
// AbortEvent is the constant for "abort-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Fired when the resource was not fully loaded, but not as the result of an error.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Fired when the resource was not fully loaded, but not as the result of an error.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
AbortEvent = "abort-event"
// CanPlayEvent is the constant for the "can-play-event" property tag.
// The "can-play-event" event occurs when the browser can play the media, but estimates that not enough data has been
// loaded to play the media up to its end without having to stop for further buffering of content.
// CanPlayEvent is the constant for "can-play-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the browser can play the media, but estimates that not enough data has been loaded to play the media up to
// its end without having to stop for further buffering of content.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the browser can play the media, but estimates that not enough data has been loaded to play the media up to
// its end without having to stop for further buffering of content.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
CanPlayEvent = "can-play-event"
// CanPlayThroughEvent is the constant for the "can-play-through-event" property tag.
// The "can-play-through-event" event occurs when the browser estimates it can play the media up
// to its end without stopping for content buffering.
// CanPlayThroughEvent is the constant for "can-play-through-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the browser estimates it can play the media up to its end without stopping for content buffering.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the browser estimates it can play the media up to its end without stopping for content buffering.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
CanPlayThroughEvent = "can-play-through-event"
// CompleteEvent is the constant for the "complete-event" property tag.
// The "complete-event" event occurs when the rendering of an OfflineAudioContext is terminated.
// CompleteEvent is the constant for "complete-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the rendering of an OfflineAudioContext has been terminated.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the rendering of an OfflineAudioContext has been terminated.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
CompleteEvent = "complete-event"
// DurationChangedEvent is the constant for the "duration-changed-event" property tag.
// The "duration-changed-event" event occurs when the duration attribute has been updated.
// DurationChangedEvent is the constant for "duration-changed-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the duration attribute has been updated.
//
// General listener format:
// `func(player rui.MediaPlayer, duration float64)`.
//
// where:
// player - Interface of a player which generated this event,
// duration - Current duration.
//
// Allowed listener formats:
// `func(player rui.MediaPlayer)`,
// `func(duration float64)`,
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the duration attribute has been updated.
//
// General listener format:
// `func(player rui.MediaPlayer, duration float64)`.
//
// where:
// player - Interface of a player which generated this event,
// duration - Current duration.
//
// Allowed listener formats:
// `func(player rui.MediaPlayer)`,
// `func(duration float64)`,
// `func()`.
DurationChangedEvent = "duration-changed-event"
// EmptiedEvent is the constant for the "emptied-event" property tag.
// The "emptied-event" event occurs when the media has become empty; for example, this event is sent if the media has already been loaded
// (or partially loaded), and the HTMLMediaElement.load method is called to reload it.
// EmptiedEvent is the constant for "emptied-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the media has become empty; for example, this event is sent if the media has already been loaded(or
// partially loaded), and the HTMLMediaElement.load method is called to reload it.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the media has become empty; for example, this event is sent if the media has already been loaded(or
// partially loaded), and the HTMLMediaElement.load method is called to reload it.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
EmptiedEvent = "emptied-event"
// EndedEvent is the constant for the "ended-event" property tag.
// The "ended-event" event occurs when the playback has stopped because the end of the media was reached.
// EndedEvent is the constant for "ended-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the playback has stopped because the end of the media was reached.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the playback has stopped because the end of the media was reached.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
EndedEvent = "ended-event"
// LoadedDataEvent is the constant for the "loaded-data-event" property tag.
// The "loaded-data-event" event occurs when the first frame of the media has finished loading.
// LoadedDataEvent is the constant for "loaded-data-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the first frame of the media has finished loading.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the first frame of the media has finished loading.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
LoadedDataEvent = "loaded-data-event"
// LoadedMetadataEvent is the constant for the "loaded-metadata-event" property tag.
// The "loaded-metadata-event" event occurs when the metadata has been loaded.
// LoadedMetadataEvent is the constant for "loaded-metadata-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the metadata has been loaded.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the metadata has been loaded.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
LoadedMetadataEvent = "loaded-metadata-event"
// LoadStartEvent is the constant for the "load-start-event" property tag.
// The "load-start-event" event is fired when the browser has started to load a resource.
// LoadStartEvent is the constant for "load-start-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Fired when the browser has started to load a resource.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Fired when the browser has started to load a resource.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
LoadStartEvent = "load-start-event"
// PauseEvent is the constant for the "pause-event" property tag.
// The "pause-event" event occurs when the playback has been paused.
// PauseEvent is the constant for "pause-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the playback has been paused.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the playback has been paused.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
PauseEvent = "pause-event"
// PlayEvent is the constant for the "play-event" property tag.
// The "play-event" event occurs when the playback has begun.
// PlayEvent is the constant for "play-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the playback has begun.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the playback has begun.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
PlayEvent = "play-event"
// PlayingEvent is the constant for the "playing-event" property tag.
// The "playing-event" event occurs when the playback is ready to start after having been paused or delayed due to lack of data.
// PlayingEvent is the constant for "playing-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the playback is ready to start after having been paused or delayed due to lack of data.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the playback is ready to start after having been paused or delayed due to lack of data.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
PlayingEvent = "playing-event"
// ProgressEvent is the constant for the "progress-event" property tag.
// The "progress-event" event is fired periodically as the browser loads a resource.
// ProgressEvent is the constant for "progress-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Fired periodically as the browser loads a resource.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Fired periodically as the browser loads a resource.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
ProgressEvent = "progress-event"
// RateChangeEvent is the constant for the "rate-change-event" property tag.
// The "rate-change-event" event occurs when the playback rate has changed.
// RateChangedEvent is the constant for "rate-changed-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the playback rate has changed.
//
// General listener format:
// `func(player rui.MediaPlayer, rate float64)`.
//
// where:
// player - Interface of a player which generated this event,
// rate - Playback rate.
//
// Allowed listener formats:
// `func(player rui.MediaPlayer)`,
// `func(rate float64)`,
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the playback rate has changed.
//
// General listener format:
// `func(player rui.MediaPlayer, rate float64)`.
//
// where:
// player - Interface of a player which generated this event,
// rate - Playback rate.
//
// Allowed listener formats:
// `func(player rui.MediaPlayer)`,
// `func(rate float64)`,
// `func()`.
RateChangedEvent = "rate-changed-event"
// SeekedEvent is the constant for the "seeked-event" property tag.
// The "seeked-event" event occurs when a seek operation completed.
// SeekedEvent is the constant for "seeked-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when a seek operation completed.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when a seek operation completed.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
SeekedEvent = "seeked-event"
// SeekingEvent is the constant for the "seeking-event" property tag.
// The "seeking-event" event occurs when a seek operation began.
// SeekingEvent is the constant for "seeking-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when a seek operation has began.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when a seek operation has began.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
SeekingEvent = "seeking-event"
// StalledEvent is the constant for the "stalled-event" property tag.
// The "stalled-event" event occurs when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming.
// StalledEvent is the constant for "stalled-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
StalledEvent = "stalled-event"
// SuspendEvent is the constant for the "suspend-event" property tag.
// The "suspend-event" event occurs when the media data loading has been suspended.
// SuspendEvent is the constant for "suspend-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the media data loading has been suspended.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the media data loading has been suspended.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
SuspendEvent = "suspend-event"
// TimeUpdateEvent is the constant for the "time-update-event" property tag.
// The "time-update-event" event occurs when the time indicated by the currentTime attribute has been updated.
// TimeUpdateEvent is the constant for "time-update-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the time indicated by the currentTime attribute has been updated.
//
// General listener format:
// `func(player rui.MediaPlayer, time float64)`.
//
// where:
// player - Interface of a player which generated this event,
// time - Current time.
//
// Allowed listener formats:
// `func(player rui.MediaPlayer)`,
// `func(time float64)`,
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the time indicated by the currentTime attribute has been updated.
//
// General listener format:
// `func(player rui.MediaPlayer, time float64)`.
//
// where:
// player - Interface of a player which generated this event,
// time - Current time.
//
// Allowed listener formats:
// `func(player rui.MediaPlayer)`,
// `func(time float64)`,
// `func()`.
TimeUpdateEvent = "time-update-event"
// VolumeChangedEvent is the constant for the "volume-change-event" property tag.
// The "volume-change-event" event occurs when the volume has changed.
// VolumeChangedEvent is the constant for "volume-changed-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the volume has changed.
//
// General listener format:
// `func(player rui.MediaPlayer, volume float64)`.
//
// where:
// player - Interface of a player which generated this event,
// volume - New volume level.
//
// Allowed listener formats:
// `func(player rui.MediaPlayer)`,
// `func(volume float64)`,
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the volume has changed.
//
// General listener format:
// `func(player rui.MediaPlayer, volume float64)`.
//
// where:
// player - Interface of a player which generated this event,
// volume - New volume level.
//
// Allowed listener formats:
// `func(player rui.MediaPlayer)`,
// `func(volume float64)`,
// `func()`.
VolumeChangedEvent = "volume-changed-event"
// WaitingEvent is the constant for the "waiting-event" property tag.
// The "waiting-event" event occurs when the playback has stopped because of a temporary lack of data
// WaitingEvent is the constant for "waiting-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Occur when the playback has stopped because of a temporary lack of data.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
//
// Usage in `VideoPlayer`:
// Occur when the playback has stopped because of a temporary lack of data.
//
// General listener format:
// `func(player rui.MediaPlayer)`.
//
// where:
// player - Interface of a player which generated this event.
//
// Allowed listener formats:
// `func()`.
WaitingEvent = "waiting-event"
// PlayerErrorEvent is the constant for the "player-error-event" property tag.
// The "player-error-event" event is fired when the resource could not be loaded due to an error
// (for example, a network connectivity problem).
// PlayerErrorEvent is the constant for "player-error-event" property tag.
//
// Used by `AudioPlayer`, `VideoPlayer`.
//
// Usage in `AudioPlayer`:
// Fired when the resource could not be loaded due to an error(for example, a network connectivity problem).
//
// General listener format:
// `func(player rui.MediaPlayer, code int, message string)`.
//
// where:
// player - Interface of a player which generated this event,
// code - Error code. See below,
// message - Error message,
// Error codes:
// `0`(`PlayerErrorUnknown`) - Unknown error,
// `1`(`PlayerErrorAborted`) - Fetching the associated resource was interrupted by a user request,
// `2`(`PlayerErrorNetwork`) - Some kind of network error has occurred that prevented the media from successfully ejecting, even though it was previously available,
// `3`(`PlayerErrorDecode`) - Although the resource was previously identified as being used, an error occurred while trying to decode the media resource,
// `4`(`PlayerErrorSourceNotSupported`) - The associated resource object or media provider was found to be invalid.
//
// Allowed listener formats:
// `func(code int, message string)`,
// `func(player rui.MediaPlayer)`,
// `func()`.
//
// Usage in `VideoPlayer`:
// Fired when the resource could not be loaded due to an error(for example, a network connectivity problem).
//
// General listener format:
// `func(player rui.MediaPlayer, code int, message string)`.
//
// where:
// player - Interface of a player which generated this event,
// code - Error code. See below,
// message - Error message,
// Error codes:
// `0`(`PlayerErrorUnknown`) - Unknown error,
// `1`(`PlayerErrorAborted`) - Fetching the associated resource was interrupted by a user request,
// `2`(`PlayerErrorNetwork`) - Some kind of network error has occurred that prevented the media from successfully ejecting, even though it was previously available,
// `3`(`PlayerErrorDecode`) - Although the resource was previously identified as being used, an error occurred while trying to decode the media resource,
// `4`(`PlayerErrorSourceNotSupported`) - The associated resource object or media provider was found to be invalid.
//
// Allowed listener formats:
// `func(code int, message string)`,
// `func(player rui.MediaPlayer)`,
// `func()`.
PlayerErrorEvent = "player-error-event"
// PreloadNone - value of the view "preload" property: indicates that the audio/video should not be preloaded.

View File

@ -8,77 +8,151 @@ import (
// Constants related to [View] mouse events properties
const (
// ClickEvent is the constant for "click-event" property tag.
// The "click-event" event occurs when the user clicks on the View.
// The main listener format:
// func(View, MouseEvent).
// The additional listener formats:
// func(MouseEvent), func(View), and func().
//
// Used by `View`.
// Occur when the user clicks on the view.
//
// General listener format:
// `func(view rui.View, event rui.MouseEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Mouse event.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(event rui.MouseEvent)`,
// `func()`.
ClickEvent = "click-event"
// DoubleClickEvent is the constant for "double-click-event" property tag.
// The "double-click-event" event occurs when the user double clicks on the View.
// The main listener format:
// func(View, MouseEvent).
// The additional listener formats:
// func(MouseEvent), func(View), and func().
//
// Used by `View`.
// Occur when the user double clicks on the view.
//
// General listener format:
// `func(view rui.View, event rui.MouseEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Mouse event.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(event rui.MouseEvent)`,
// `func()`.
DoubleClickEvent = "double-click-event"
// MouseDown is the constant for "mouse-down" property tag.
// The "mouse-down" event is fired at a View when a pointing device button is pressed
// while the pointer is inside the view.
// The main listener format:
// func(View, MouseEvent).
// The additional listener formats:
// func(MouseEvent), func(View), and func().
//
// Used by `View`.
// Is fired at a View when a pointing device button is pressed while the pointer is inside the view.
//
// General listener format:
// `func(view rui.View, event rui.MouseEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Mouse event.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(event rui.MouseEvent)`,
// `func()`.
MouseDown = "mouse-down"
// MouseUp is the constant for "mouse-up" property tag.
// The "mouse-up" event is fired at a View when a button on a pointing device (such as a mouse
// or trackpad) is released while the pointer is located inside it.
// "mouse-up" events are the counterpoint to "mouse-down" events.
// The main listener format:
// func(View, MouseEvent).
// The additional listener formats:
// func(MouseEvent), func(View), and func().
//
// Used by `View`.
// Is fired at a View when a button on a pointing device (such as a mouse or trackpad) is released while the pointer is
// located inside it. "mouse-up" events are the counterpoint to "mouse-down" events.
//
// General listener format:
// `func(view rui.View, event rui.MouseEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Mouse event.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(event rui.MouseEvent)`,
// `func()`.
MouseUp = "mouse-up"
// MouseMove is the constant for "mouse-move" property tag.
// The "mouse-move" event is fired at a view when a pointing device (usually a mouse) is moved
// while the cursor's hotspot is inside it.
// The main listener format:
// func(View, MouseEvent).
// The additional listener formats:
// func(MouseEvent), func(View), and func().
//
// Used by `View`.
// Is fired at a view when a pointing device(usually a mouse) is moved while the cursor's hotspot is inside it.
//
// General listener format:
// `func(view rui.View, event rui.MouseEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Mouse event.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(event rui.MouseEvent)`,
// `func()`.
MouseMove = "mouse-move"
// MouseOut is the constant for "mouse-out" property tag.
// The "mouse-out" event is fired at a View when a pointing device (usually a mouse) is used to move
// the cursor so that it is no longer contained within the view or one of its children.
// "mouse-out" is also delivered to a view if the cursor enters a child view,
// because the child view obscures the visible area of the view.
// The main listener format:
// func(View, MouseEvent).
// The additional listener formats:
// func(MouseEvent), func(View), and func().
// The additional listener formats:
// func(MouseEvent), func(View), and func().
//
// Used by `View`.
// Is fired at a View when a pointing device (usually a mouse) is used to move the cursor so that it is no longer
// contained within the view or one of its children. "mouse-out" is also delivered to a view if the cursor enters a child
// view, because the child view obscures the visible area of the view.
//
// General listener format:
// `func(view rui.View, event rui.MouseEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Mouse event.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(event rui.MouseEvent)`,
// `func()`.
MouseOut = "mouse-out"
// MouseOver is the constant for "mouse-over" property tag.
// The "mouse-over" event is fired at a View when a pointing device (such as a mouse or trackpad)
// is used to move the cursor onto the view or one of its child views.
// The main listener formats:
// func(View, MouseEvent).
// The additional listener formats:
// func(MouseEvent), func(View), and func().
//
// Used by `View`.
// Is fired at a View when a pointing device (such as a mouse or trackpad) is used to move the cursor onto the view or one
// of its child views.
//
// General listener format:
// `func(view rui.View, event rui.MouseEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Mouse event.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(event rui.MouseEvent)`,
// `func()`.
MouseOver = "mouse-over"
// ContextMenuEvent is the constant for "context-menu-event" property tag.
// The "context-menu-event" event occurs when the user calls the context menu by the right mouse clicking.
// The main listener format:
// func(View, MouseEvent).
// The additional listener formats:
// func(MouseEvent), func(View), and func().
//
// Used by `View`.
// Occur when the user calls the context menu by the right mouse clicking.
//
// General listener format:
// `func(view rui.View, event rui.MouseEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Mouse event.
//
// Allowed listener formats:
// `func(view rui.View)`,
// `func(event rui.MouseEvent)`,
// `func()`.
ContextMenuEvent = "context-menu-event"
// PrimaryMouseButton is a number of the main pressed button, usually the left button or the un-initialized state

View File

@ -8,30 +8,76 @@ import (
// Constants related to [NumberPicker] specific properties and events
const (
// NumberChangedEvent is the constant for the "" property tag.
// The "number-changed" property sets listener(s) that track the change in the entered value.
// NumberChangedEvent is the constant for "number-changed" property tag.
//
// Used by `NumberPicker`.
// Set listener(s) that track the change in the entered value.
//
// General listener format:
// `func(picker rui.NumberPicker, newValue, oldValue float64)`.
//
// where:
// picker - Interface of a number picker which generated this event,
// newValue - New value,
// oldValue - Old Value.
//
// Allowed listener formats:
// `func(picker rui.NumberPicker, newValue float64)`,
// `func(newValue, oldValue float64)`,
// `func(newValue float64)`,
// `func()`.
NumberChangedEvent = "number-changed"
// NumberPickerType is the constant for the "number-picker-type" property tag.
// The "number-picker-type" int property sets the mode of NumberPicker. It can take the following values:
// * NumberEditor (0) - NumberPicker is presented by editor. Default value;
// * NumberSlider (1) - NumberPicker is presented by slider. |
// NumberPickerType is the constant for "number-picker-type" property tag.
//
// Used by `NumberPicker`.
// Sets the visual representation.
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`NumberEditor`) or "editor" - Displayed as an editor.
// `1`(`NumberSlider`) or "slider" - Displayed as a slider.
NumberPickerType = "number-picker-type"
// NumberPickerMin is the constant for the "number-picker-min" property tag.
// The "number-picker-min" int property sets the minimum value of NumberPicker. The default value is 0.
// NumberPickerMin is the constant for "number-picker-min" property tag.
//
// Used by `NumberPicker`.
// Set the minimum value. The default value is 0.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
NumberPickerMin = "number-picker-min"
// NumberPickerMax is the constant for the "number-picker-max" property tag.
// The "number-picker-max" int property sets the maximum value of NumberPicker. The default value is 1.
// NumberPickerMax is the constant for "number-picker-max" property tag.
//
// Used by `NumberPicker`.
// Set the maximum value. The default value is 1.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
NumberPickerMax = "number-picker-max"
// NumberPickerStep is the constant for the "number-picker-step" property tag.
// The "number-picker-step" int property sets the value change step of NumberPicker
// NumberPickerStep is the constant for "number-picker-step" property tag.
//
// Used by `NumberPicker`.
// Set the value change step.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
NumberPickerStep = "number-picker-step"
// NumberPickerValue is the constant for the "number-picker-value" property tag.
// The "number-picker-value" int property sets the current value of NumberPicker. The default value is 0.
// NumberPickerValue is the constant for "number-picker-value" property tag.
//
// Used by `NumberPicker`.
// Current value. The default value is 0.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
NumberPickerValue = "number-picker-value"
)

View File

@ -7,46 +7,115 @@ import (
// Constants for [View] specific pointer events properties
const (
// PointerDown is the constant for "pointer-down" property tag.
// The "pointer-down" event is fired when a pointer becomes active. For mouse, it is fired when
// the device transitions from no buttons depressed to at least one button depressed.
// For touch, it is fired when physical contact is made with the digitizer.
// For pen, it is fired when the stylus makes physical contact with the digitizer.
// The main listener format: func(View, PointerEvent).
// The additional listener formats: func(PointerEvent), func(View), and func().
//
// Used by `View`.
// Fired when a pointer becomes active. For mouse, it is fired when the device transitions from no buttons depressed to at
// least one button depressed. For touch, it is fired when physical contact is made with the digitizer. For pen, it is
// fired when the stylus makes physical contact with the digitizer.
//
// General listener format:
// `func(view rui.View, event rui.PointerEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Pointer event.
//
// Allowed listener formats:
// `func(event rui.PointerEvent)`,
// `func(view rui.View)`,
// `func()`.
PointerDown = "pointer-down"
// PointerUp is the constant for "pointer-up" property tag.
// The "pointer-up" event is fired when a pointer is no longer active.
// The main listener format: func(View, PointerEvent).
// The additional listener formats: func(PointerEvent), func(View), and func().
//
// Used by `View`.
// Is fired when a pointer is no longer active.
//
// General listener format:
// `func(view rui.View, event rui.PointerEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Pointer event.
//
// Allowed listener formats:
// `func(event rui.PointerEvent)`,
// `func(view rui.View)`,
// `func()`.
PointerUp = "pointer-up"
// PointerMove is the constant for "pointer-move" property tag.
// The "pointer-move" event is fired when a pointer changes coordinates.
// The main listener format: func(View, PointerEvent).
// The additional listener formats: func(PointerEvent), func(View), and func().
//
// Used by `View`.
// Is fired when a pointer changes coordinates.
//
// General listener format:
// `func(view rui.View, event rui.PointerEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Pointer event.
//
// Allowed listener formats:
// `func(event rui.PointerEvent)`,
// `func(view rui.View)`,
// `func()`.
PointerMove = "pointer-move"
// PointerCancel is the constant for "pointer-cancel" property tag.
// The "pointer-cancel" event is fired if the pointer will no longer be able to generate events
// (for example the related device is deactivated).
// The main listener format: func(View, PointerEvent).
// The additional listener formats: func(PointerEvent), func(View), and func().
//
// Used by `View`.
// Is fired if the pointer will no longer be able to generate events (for example the related device is deactivated).
//
// General listener format:
// `func(view rui.View, event rui.PointerEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Pointer event.
//
// Allowed listener formats:
// `func(event rui.PointerEvent)`,
// `func(view rui.View)`,
// `func()`.
PointerCancel = "pointer-cancel"
// PointerOut is the constant for "pointer-out" property tag.
// The "pointer-out" event is fired for several reasons including: pointing device is moved out
// of the hit test boundaries of an element; firing the pointerup event for a device
// that does not support hover (see "pointer-up"); after firing the pointercancel event (see "pointer-cancel");
// when a pen stylus leaves the hover range detectable by the digitizer.
// The main listener format: func(View, PointerEvent).
// The additional listener formats: func(PointerEvent), func(View), and func().
//
// Used by `View`.
// Is fired for several reasons including: pointing device is moved out of the hit test boundaries of an element; firing
// the "pointer-up" event for a device that does not support hover (see "pointer-up"); after firing the "pointer-cancel"
// event (see "pointer-cancel"); when a pen stylus leaves the hover range detectable by the digitizer.
//
// General listener format:
// `func(view rui.View, event rui.PointerEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Pointer event.
//
// Allowed listener formats:
// `func(event rui.PointerEvent)`,
// `func(view rui.View)`,
// `func()`.
PointerOut = "pointer-out"
// PointerOver is the constant for "pointer-over" property tag.
// The "pointer-over" event is fired when a pointing device is moved into an view's hit test boundaries.
// The main listener format: func(View, PointerEvent).
// The additional listener formats: func(PointerEvent), func(View), and func().
//
// Used by `View`.
// Is fired when a pointing device is moved into an view's hit test boundaries.
//
// General listener format:
// `func(view rui.View, event rui.PointerEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Pointer event.
//
// Allowed listener formats:
// `func(event rui.PointerEvent)`,
// `func(view rui.View)`,
// `func()`.
PointerOver = "pointer-over"
)

157
popup.go
View File

@ -6,59 +6,152 @@ import (
// Constants for [Popup] specific properties and events
const (
// Title is the constant for the "title" property tag.
// The "title" property is defined the Popup/Tabs title
// Title is the constant for "title" property tag.
//
// Used by `Popup`, `TabsLayout`.
//
// Usage in `Popup`:
// Define the title.
//
// Supported types: `string`.
//
// Usage in `TabsLayout`:
// Set the title of the tab. The property is set for the child view of `TabsLayout`.
//
// Supported types: `string`.
Title = "title"
// TitleStyle is the constant for the "title-style" property tag.
// The "title-style" string property is used to set the title style of the Popup.
// TitleStyle is the constant for "title-style" property tag.
//
// Used by `Popup`.
// Set popup title style. Default title style is "ruiPopupTitle".
//
// Supported types: `string`.
TitleStyle = "title-style"
// CloseButton is the constant for the "close-button" property tag.
// The "close-button" bool property allow to add the close button to the Popup.
// Setting this property to "true" adds a window close button to the title bar (the default value is "false").
// CloseButton is the constant for "close-button" property tag.
//
// Used by `Popup`.
// Controls whether a close button can be added to the popup. Default value is `false`.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - Close button will be added to a title bar of a window.
// `false` or `0` or "false", "no", "off", "0" - Popup without a close button.
CloseButton = "close-button"
// OutsideClose is the constant for the "outside-close" property tag.
// The "outside-close" is a bool property. If it is set to "true",
// then clicking outside the popup window automatically calls the Dismiss() method.
// OutsideClose is the constant for "outside-close" property tag.
//
// Used by `Popup`.
// Controls whether popup can be closed by clicking outside of the window. Default value is `false`.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - Clicking outside the popup window will automatically call the `Dismiss()` method.
// `false` or `0` or "false", "no", "off", "0" - Clicking outside the popup window has no effect.
OutsideClose = "outside-close"
// Buttons is the constant for the "buttons" property tag.
// Using the "buttons" property you can add buttons that will be placed at the bottom of the Popup.
// The "buttons" property can be assigned the following data types: PopupButton and []PopupButton
// Buttons is the constant for "buttons" property tag.
//
// Used by `Popup`.
// Buttons that will be placed at the bottom of the popup.
//
// Supported types: `PopupButton`, `[]PopupButton`.
//
// Internal type is `[]PopupButton`, other types converted to it during assignment.
// See `PopupButton` description for more details.
Buttons = "buttons"
// ButtonsAlign is the constant for the "buttons-align" property tag.
// The "buttons-align" int property is used for set the horizontal alignment of Popup buttons.
// Valid values: LeftAlign (0), RightAlign (1), CenterAlign (2), and StretchAlign (3)
// ButtonsAlign is the constant for "buttons-align" property tag.
//
// Used by `Popup`.
// Set the horizontal alignment of popup buttons.
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`LeftAlign`) or "left" - Left alignment.
// `1`(`RightAlign`) or "right" - Right alignment.
// `2`(`CenterAlign`) or "center" - Center alignment.
// `3`(`StretchAlign`) or "stretch" - Width alignment.
ButtonsAlign = "buttons-align"
// DismissEvent is the constant for the "dismiss-event" property tag.
// The "dismiss-event" event is used to track the closing of the Popup.
// It occurs after the Popup disappears from the screen.
// The main listener for this event has the following format: func(Popup)
// DismissEvent is the constant for "dismiss-event" property tag.
//
// Used by `Popup`.
// Used to track the closing state of the `Popup`. It occurs after the `Popup` disappears from the screen.
//
// General listener format:
// `func(popup rui.Popup)`.
//
// where:
// popup - Interface of a popup which generated this event.
//
// Allowed listener formats:
// `func()`.
DismissEvent = "dismiss-event"
// Arrow is the constant for the "arrow" property tag.
// Using the "popup-arrow" int property you can add ...
// Arrow is the constant for "arrow" property tag.
//
// Used by `Popup`.
// Add an arrow to popup. Default value is "none".
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`NoneArrow`) or "none" - No arrow.
// `1`(`TopArrow`) or "top" - Arrow at the top side of the pop-up window.
// `2`(`RightArrow`) or "right" - Arrow on the right side of the pop-up window.
// `3`(`BottomArrow`) or "bottom" - Arrow at the bottom of the pop-up window.
// `4`(`LeftArrow`) or "left" - Arrow on the left side of the pop-up window.
Arrow = "arrow"
// ArrowAlign is the constant for the "arrow-align" property tag.
// The "arrow-align" int property is used for set the horizontal alignment of the Popup arrow.
// Valid values: LeftAlign (0), RightAlign (1), TopAlign (0), BottomAlign (1), CenterAlign (2)
// ArrowAlign is the constant for "arrow-align" property tag.
//
// Used by `Popup`.
// Set the horizontal alignment of the popup arrow. Default value is "center".
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`TopAlign`/`LeftAlign`) or "top" - Top/left alignment.
// `1`(`BottomAlign`/`RightAlign`) or "bottom" - Bottom/right alignment.
// `2`(`CenterAlign`) or "center" - Center alignment.
ArrowAlign = "arrow-align"
// ArrowSize is the constant for the "arrow-size" property tag.
// The "arrow-size" SizeUnit property is used for set the size (length) of the Popup arrow.
// ArrowSize is the constant for "arrow-size" property tag.
//
// Used by `Popup`.
// Set the size(length) of the popup arrow. Default value is 16px defined by @ruiArrowSize constant.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
ArrowSize = "arrow-size"
// ArrowWidth is the constant for the "arrow-width" property tag.
// The "arrow-width" SizeUnit property is used for set the width of the Popup arrow.
// ArrowWidth is the constant for "arrow-width" property tag.
//
// Used by `Popup`.
// Set the width of the popup arrow. Default value is 16px defined by @ruiArrowWidth constant.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
ArrowWidth = "arrow-width"
// ArrowOffset is the constant for the "arrow-offset" property tag.
// The "arrow-offset" SizeUnit property is used for set the offset of the Popup arrow.
// ArrowOffset is the constant for "arrow-offset" property tag.
//
// Used by `Popup`.
// Set the offset of the popup arrow.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
ArrowOffset = "arrow-offset"
// NoneArrow is value of the popup "arrow" property: no arrow
@ -85,8 +178,10 @@ const (
const (
// NormalButton is the constant of the popup button type: the normal button
NormalButton PopupButtonType = 0
// DefaultButton is the constant of the popup button type: button that fires when the "Enter" key is pressed
DefaultButton PopupButtonType = 1
// CancelButton is the constant of the popup button type: button that fires when the "Escape" key is pressed
CancelButton PopupButtonType = 2
)

View File

@ -152,9 +152,12 @@ func (popup *popupMenuData) IsListItemEnabled(index int) bool {
return true
}
// PopupMenuResult is the constant for the "popup-menu-result" property tag.
// The "popup-menu-result" property sets the function (format: func(int)) to be called when
// a menu item of popup menu is selected.
// PopupMenuResult is the constant for "popup-menu-result" property tag.
//
// Used by `Popup`.
// Set the function to be called when the menu item of popup menu is selected.
//
// Supported types: `func(index int)`.
const PopupMenuResult = "popup-menu-result"
// ShowMenu displays the menu. Menu items are set using the Items property.

View File

@ -8,11 +8,23 @@ import (
// Constants for [ProgressBar] specific properties and events
const (
// ProgressBarMax is the constant for "progress-max" property tag.
// The "progress-max" define maximum value of the ProgressBar, default is 1.
//
// Used by `ProgressBar`.
// Maximum value, default is 1.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
ProgressBarMax = "progress-max"
// ProgressBarValue is the constant for "progress-value" property tag.
// The "progress-value" define current value of the ProgressBar, default is 0.
//
// Used by `ProgressBar`.
// Current value, default is 0.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
ProgressBarValue = "progress-value"
)

File diff suppressed because it is too large Load Diff

408
radius.go
View File

@ -7,92 +7,384 @@ import (
// Constants for [RadiusProperty] specific properties
const (
// Radius is the SizeUnit view property that determines the corners rounding radius
// of an element's outer border edge.
// Radius is the constant for "radius" property tag.
//
// Used by `View`, `BackgroundElement`, `ClipShape`.
//
// Usage in `View`:
// Specifies the corners rounding radius of an element's outer border edge.
//
// Supported types: `RadiusProperty`, `SizeUnit`, `SizeFunc`, `BoxRadius`, `string`, `float`, `int`.
//
// Internal type is either `RadiusProperty` or `SizeUnit`, other types converted to them during assignment.
// See `RadiusProperty`, `SizeUnit`, `SizeFunc` and `BoxRadius` description for more details.
//
// Conversion rules:
// `RadiusProperty` - stored as is, no conversion performed.
// `SizeUnit` - stored as is and set all corners to have the same value.
// `BoxRadius` - a new `RadiusProperty` will be created and all corresponding elliptical radius values will be set.
// `string` - if one value will be provided then it will be set as a radius for all corners. If two values will be provided divided by (`/`) then x and y radius will be set for all corners. Examples: "1em", "1em/0.5em", "2/4". Values which doesn't have size prefix will use size in pixels by default.
// `float` - values of this type will set radius for all corners in pixels.
// `int` - values of this type will set radius for all corners in pixels.
//
// Usage in `BackgroundElement`:
// Same as "radial-gradient-radius".
//
// Usage in `ClipShape`:
// Specifies the radius of the corners or the radius of the cropping area.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
Radius = "radius"
// RadiusX is the SizeUnit view property that determines the x-axis corners elliptic rounding
// radius of an element's outer border edge.
// RadiusX is the constant for "radius-x" property tag.
//
// Used by `View`, `ClipShape`.
//
// Usage in `View`:
// Specifies the x-axis corners elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
//
// Usage in `ClipShape`:
// Specifies the x-axis corners elliptic rounding radius of the elliptic clip shape.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
RadiusX = "radius-x"
// RadiusY is the SizeUnit view property that determines the y-axis corners elliptic rounding
// radius of an element's outer border edge.
// RadiusY is the constant for "radius-y" property tag.
//
// Used by `View`, `ClipShape`.
//
// Usage in `View`:
// Specifies the y-axis corners elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
//
// Usage in `ClipShape`:
// Specifies the y-axis corners elliptic rounding radius of of the elliptic clip shape.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
RadiusY = "radius-y"
// RadiusTopLeft is the SizeUnit view property that determines the top-left corner rounding radius
// of an element's outer border edge.
// RadiusTopLeft is the constant for "radius-top-left" property tag.
//
// Used by `View`.
// Specifies the top-left corner rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
RadiusTopLeft = "radius-top-left"
// RadiusTopLeftX is the SizeUnit view property that determines the x-axis top-left corner elliptic
// rounding radius of an element's outer border edge.
// RadiusTopLeftX is the constant for "radius-top-left-x" property tag.
//
// Used by `View`.
// Specifies the x-axis top-left corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
RadiusTopLeftX = "radius-top-left-x"
// RadiusTopLeftY is the SizeUnit view property that determines the y-axis top-left corner elliptic
// rounding radius of an element's outer border edge.
// RadiusTopLeftY is the constant for "radius-top-left-y" property tag.
//
// Used by `View`.
// Specifies the y-axis top-left corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
RadiusTopLeftY = "radius-top-left-y"
// RadiusTopRight is the SizeUnit view property that determines the top-right corner rounding radius
// of an element's outer border edge.
// RadiusTopRight is the constant for "radius-top-right" property tag.
//
// Used by `View`.
// Specifies the top-right corner rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
RadiusTopRight = "radius-top-right"
// RadiusTopRightX is the SizeUnit view property that determines the x-axis top-right corner elliptic
// rounding radius of an element's outer border edge.
// RadiusTopRightX is the constant for "radius-top-right-x" property tag.
//
// Used by `View`.
// Specifies the x-axis top-right corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
RadiusTopRightX = "radius-top-right-x"
// RadiusTopRightY is the SizeUnit view property that determines the y-axis top-right corner elliptic
// rounding radius of an element's outer border edge.
// RadiusTopRightY is the constant for "radius-top-right-y" property tag.
//
// Used by `View`.
// Specifies the y-axis top-right corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
RadiusTopRightY = "radius-top-right-y"
// RadiusBottomLeft is the SizeUnit view property that determines the bottom-left corner rounding radius
// of an element's outer border edge.
// RadiusBottomLeft is the constant for "radius-bottom-left" property tag.
//
// Used by `View`.
// Specifies the bottom-left corner rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
RadiusBottomLeft = "radius-bottom-left"
// RadiusBottomLeftX is the SizeUnit view property that determines the x-axis bottom-left corner elliptic
// rounding radius of an element's outer border edge.
// RadiusBottomLeftX is the constant for "radius-bottom-left-x" property tag.
//
// Used by `View`.
// Specifies the x-axis bottom-left corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
RadiusBottomLeftX = "radius-bottom-left-x"
// RadiusBottomLeftY is the SizeUnit view property that determines the y-axis bottom-left corner elliptic
// rounding radius of an element's outer border edge.
// RadiusBottomLeftY is the constant for "radius-bottom-left-y" property tag.
//
// Used by `View`.
// Specifies the y-axis bottom-left corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
RadiusBottomLeftY = "radius-bottom-left-y"
// RadiusBottomRight is the SizeUnit view property that determines the bottom-right corner rounding radius
// of an element's outer border edge.
// RadiusBottomRight is the constant for "radius-bottom-right" property tag.
//
// Used by `View`.
// Specifies the bottom-right corner rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
RadiusBottomRight = "radius-bottom-right"
// RadiusBottomRightX is the SizeUnit view property that determines the x-axis bottom-right corner elliptic
// rounding radius of an element's outer border edge.
// RadiusBottomRightX is the constant for "radius-bottom-right-x" property tag.
//
// Used by `View`.
// Specifies the x-axis bottom-right corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
RadiusBottomRightX = "radius-bottom-right-x"
// RadiusBottomRightY is the SizeUnit view property that determines the y-axis bottom-right corner elliptic
// rounding radius of an element's outer border edge.
// RadiusBottomRightY is the constant for "radius-bottom-right-y" property tag.
//
// Used by `View`.
// Specifies the y-axis bottom-right corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
RadiusBottomRightY = "radius-bottom-right-y"
// X is the SizeUnit property of the ShadowProperty that determines the x-axis corners elliptic rounding
// radius of an element's outer border edge.
// X is the constant for "x" property tag.
//
// Used by `ClipShape`, `RadiusProperty`.
//
// Usage in `ClipShape`:
// Specifies x-axis position of the clip shape.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
//
// Usage in `RadiusProperty`:
// Determines the x-axis top-right corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
X = "x"
// Y is the SizeUnit property of the ShadowProperty that determines the y-axis corners elliptic rounding
// radius of an element's outer border edge.
// Y is the constant for "y" property tag.
//
// Used by `ClipShape`, `RadiusProperty`.
//
// Usage in `ClipShape`:
// Specifies y-axis position of the clip shape.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
//
// Usage in `RadiusProperty`:
// Determines the y-axis top-right corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
Y = "y"
// TopLeft is the SizeUnit property of the ShadowProperty that determines the top-left corner rounding radius
// of an element's outer border edge.
// TopLeft is the constant for "top-left" property tag.
//
// Used by `RadiusProperty`.
// Determines the top-left corner rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
TopLeft = "top-left"
// TopLeftX is the SizeUnit property of the ShadowProperty that determines the x-axis top-left corner elliptic
// rounding radius of an element's outer border edge.
// TopLeftX is the constant for "top-left-x" property tag.
//
// Used by `RadiusProperty`.
// Determines the x-axis top-left corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
TopLeftX = "top-left-x"
// TopLeftY is the SizeUnit property of the ShadowProperty that determines the y-axis top-left corner elliptic
// rounding radius of an element's outer border edge.
// TopLeftY is the constant for "top-left-y" property tag.
//
// Used by `RadiusProperty`.
// Determines the y-axis top-left corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
TopLeftY = "top-left-y"
// TopRight is the SizeUnit property of the ShadowProperty that determines the top-right corner rounding radius
// of an element's outer border edge.
// TopRight is the constant for "top-right" property tag.
//
// Used by `RadiusProperty`.
// Determines the top-right corner rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
TopRight = "top-right"
// TopRightX is the SizeUnit property of the ShadowProperty that determines the x-axis top-right corner elliptic
// rounding radius of an element's outer border edge.
// TopRightX is the constant for "top-right-x" property tag.
//
// Used by `RadiusProperty`.
// Determines the x-axis top-right corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
TopRightX = "top-right-x"
// TopRightY is the SizeUnit property of the ShadowProperty that determines the y-axis top-right corner elliptic
// rounding radius of an element's outer border edge.
// TopRightY is the constant for "top-right-y" property tag.
//
// Used by `RadiusProperty`.
// Determines the y-axis top-right corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
TopRightY = "top-right-y"
// BottomLeft is the SizeUnit property of the ShadowProperty that determines the bottom-left corner rounding radius
// of an element's outer border edge.
// BottomLeft is the constant for "bottom-left" property tag.
//
// Used by `RadiusProperty`.
// Determines the bottom-left corner rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
BottomLeft = "bottom-left"
// BottomLeftX is the SizeUnit property of the ShadowProperty that determines the x-axis bottom-left corner elliptic
// rounding radius of an element's outer border edge.
// BottomLeftX is the constant for "bottom-left-x" property tag.
//
// Used by `RadiusProperty`.
// Determines the x-axis bottom-left corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
BottomLeftX = "bottom-left-x"
// BottomLeftY is the SizeUnit property of the ShadowProperty that determines the y-axis bottom-left corner elliptic
// rounding radius of an element's outer border edge.
// BottomLeftY is the constant for "bottom-left-y" property tag.
//
// Used by `RadiusProperty`.
// Determines the y-axis bottom-left corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
BottomLeftY = "bottom-left-y"
// BottomRight is the SizeUnit property of the ShadowProperty that determines the bottom-right corner rounding radius
// of an element's outer border edge.
// BottomRight is the constant for "bottom-right" property tag.
//
// Used by `RadiusProperty`.
// Determines the bottom-right corner rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
BottomRight = "bottom-right"
// BottomRightX is the SizeUnit property of the ShadowProperty that determines the x-axis bottom-right corner elliptic
// rounding radius of an element's outer border edge.
// BottomRightX is the constant for "bottom-right-x" property tag.
//
// Used by `RadiusProperty`.
// Determines the x-axis bottom-right corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
BottomRightX = "bottom-right-x"
// BottomRightY is the SizeUnit property of the ShadowProperty that determines the y-axis bottom-right corner elliptic
// rounding radius of an element's outer border edge.
// BottomRightY is the constant for "bottom-right-y" property tag.
//
// Used by `RadiusProperty`.
// Determines the y-axis bottom-right corner elliptic rounding radius of an element's outer border edge.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
BottomRightY = "bottom-right-y"
)

View File

@ -8,13 +8,31 @@ import (
// Constants for [Resizable] specific properties and events
const (
// Side is the constant for the "side" property tag.
// The "side" int property determines which side of the container is used to resize.
// The value of property is or-combination of TopSide (1), RightSide (2), BottomSide (4), and LeftSide (8)
// Side is the constant for "side" property tag.
//
// Used by `Resizable`.
// Determines which side of the container is used to resize. The value of property is an or-combination of values listed.
// Default value is "all".
//
// Supported types: `int`, `string`.
//
// Values:
// `1`(`TopSide`) or "top" - Top frame side.
// `2`(`RightSide`) or "right" - Right frame side.
// `4`(`BottomSide`) or "bottom" - Bottom frame side.
// `8`(`LeftSide`) or "left" - Left frame side.
// `15`(`AllSides`) or "all" - All frame sides.
Side = "side"
// ResizeBorderWidth is the constant for the "resize-border-width" property tag.
// The "ResizeBorderWidth" SizeUnit property determines the width of the resizing border
// ResizeBorderWidth is the constant for "resize-border-width" property tag.
//
// Used by `Resizable`.
// Specifies the width of the resizing border.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
ResizeBorderWidth = "resize-border-width"
)

View File

@ -1,14 +1,21 @@
package rui
// ResizeEvent is the constant for "resize-event" property tag.
// The "resize-event" is fired when the view changes its size.
// The main listener format:
//
// func(View, Frame).
// Used by `View`.
// Is fired when the view changes its size.
//
// The additional listener formats:
// General listener format:
// `func(view rui.View, frame rui.Frame)`.
//
// func(Frame), func(View), and func().
// where:
// view - Interface of a view which generated this event,
// frame - New offset and size of the view's visible area.
//
// Allowed listener formats:
// `func(frame rui.Frame)`,
// `func(view rui.View)`,
// `func()`.
const ResizeEvent = "resize-event"
func (view *viewData) onResize(self View, x, y, width, height float64) {

View File

@ -1,14 +1,21 @@
package rui
// ScrollEvent is the constant for "scroll-event" property tag.
// The "scroll-event" is fired when the content of the view is scrolled.
// The main listener format:
//
// func(View, Frame).
// Used by `View`.
// Is fired when the content of the view is scrolled.
//
// The additional listener formats:
// General listener format:
// `func(view rui.View, frame rui.Frame)`.
//
// func(Frame), func(View), and func().
// where:
// view - Interface of a view which generated this event,
// frame - New offset and size of the view's visible area.
//
// Allowed listener formats:
// `func(frame rui.Frame)`,
// `func(view rui.View)`,
// `func()`.
const ScrollEvent = "scroll-event"
func (view *viewData) onScroll(self View, x, y, width, height float64) {

101
shadow.go
View File

@ -7,24 +7,99 @@ import (
// Constants for [ViewShadow] specific properties
const (
// ColorTag is the name of the color property of the shadow.
// ColorTag is the constant for "color" property tag.
//
// Used by `ColumnSeparatorProperty`, `BorderProperty`, `OutlineProperty`, `ViewShadow`.
//
// Usage in `ColumnSeparatorProperty`:
// Line color.
//
// Supported types: `Color`, `string`.
//
// Internal type is `Color`, other types converted to it during assignment.
// See `Color` description for more details.
//
// Usage in `BorderProperty`:
// Border line color.
//
// Supported types: `Color`, `string`.
//
// Internal type is `Color`, other types converted to it during assignment.
// See `Color` description for more details.
//
// Usage in `OutlineProperty`:
// Outline line color.
//
// Supported types: `Color`, `string`.
//
// Internal type is `Color`, other types converted to it during assignment.
// See `Color` description for more details.
//
// Usage in `ViewShadow`:
// Color property of the shadow.
//
// Supported types: `Color`, `string`.
//
// Internal type is `Color`, other types converted to it during assignment.
// See `Color` description for more details.
ColorTag = "color"
// Inset is the name of bool property of the shadow. If it is set to "false" (default) then the shadow
// is assumed to be a drop shadow (as if the box were raised above the content).
// If it is set to "true" then the shadow to one inside the frame (as if the content was depressed inside the box).
// Inset shadows are drawn inside the border (even transparent ones), above the background, but below content.
// Inset is the constant for "inset" property tag.
//
// Used by `ViewShadow`.
// Controls whether to draw shadow inside the frame or outside. Inset shadows are drawn inside the border(even transparent
// ones), above the background, but below content.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - Drop shadow inside the frame(as if the content was depressed inside the box).
// `false` or `0` or "false", "no", "off", "0" - Shadow is assumed to be a drop shadow(as if the box were raised above the content).
Inset = "inset"
// XOffset is the name of the SizeUnit property of the shadow that determines the shadow horizontal offset.
// Negative values place the shadow to the left of the element.
// XOffset is the constant for "x-offset" property tag.
//
// Used by `ViewShadow`.
// Determines the shadow horizontal offset. Negative values place the shadow to the left of the element.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
XOffset = "x-offset"
// YOffset is the name of the SizeUnit property of the shadow that determines the shadow vertical offset.
// Negative values place the shadow above the element.
// YOffset is the constant for "y-offset" property tag.
//
// Used by `ViewShadow`.
// Determines the shadow vertical offset. Negative values place the shadow above the element.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
YOffset = "y-offset"
// BlurRadius is the name of the SizeUnit property of the shadow that determines the radius of the blur effect.
// The larger this value, the bigger the blur, so the shadow becomes bigger and lighter. Negative values are not allowed.
// BlurRadius is the constant for "blur" property tag.
//
// Used by `ViewShadow`.
// Determines the radius of the blur effect. The larger this value, the bigger the blur, so the shadow becomes bigger and
// lighter. Negative values are not allowed.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
BlurRadius = "blur"
// SpreadRadius is the name of the SizeUnit property of the shadow. Positive values will cause the shadow to expand
// and grow bigger, negative values will cause the shadow to shrink.
// SpreadRadius is the constant for "spread-radius" property tag.
//
// Used by `ViewShadow`.
// Positive values will cause the shadow to expand and grow bigger, negative values will cause the shadow to shrink.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
SpreadRadius = "spread-radius"
)

View File

@ -8,199 +8,521 @@ import (
// Constants for [TableView] specific properties and events
const (
// TableVerticalAlign is the constant for the "table-vertical-align" property tag.
// The "table-vertical-align" int property sets the vertical alignment of the content inside a table cell.
// Valid values are TopAlign (0), BottomAlign (1), CenterAlign (2), and BaselineAlign (3, 4)
// TableVerticalAlign is the constant for "table-vertical-align" property tag.
//
// Used by `TableView`.
// Set the vertical alignment of the content inside a table cell.
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`TopAlign`) or "top" - Top alignment.
// `1`(`BottomAlign`) or "bottom" - Bottom alignment.
// `2`(`CenterAlign`) or "center" - Center alignment.
// `3`(`StretchAlign`) or "stretch" - Work as baseline alignment, see below.
// `4`(`BaselineAlign`) or "baseline" - Baseline alignment.
TableVerticalAlign = "table-vertical-align"
// HeadHeight is the constant for the "head-height" property tag.
// The "head-height" int property sets the number of rows in the table header.
// The default value is 0 (no header)
// HeadHeight is the constant for "head-height" property tag.
//
// Used by `TableView`.
// Sets the number of rows in the table header. The default value is `0` (no header).
//
// Supported types: `int`, `string`.
//
// Values:
// `0` or "0" - No header.
// > `0` or > "0" - Number of rows act as a header.
HeadHeight = "head-height"
// HeadStyle is the constant for the "head-style" property tag.
// The "head-style" string property sets the header style name
// HeadStyle is the constant for "head-style" property tag.
//
// Used by `TableView`.
// Set the header style name or description of style properties.
//
// Supported types: `string`, `Params`.
//
// Internal type is either `string` or `Params`.
//
// Conversion rules:
// `string` - must contain style name defined in resources.
// `Params` - must contain style properties.
HeadStyle = "head-style"
// FootHeight is the constant for the "foot-height" property tag.
// The "foot-height" int property sets the number of rows in the table footer.
// The default value is 0 (no footer)
// FootHeight is the constant for "foot-height" property tag.
//
// Used by `TableView`.
// Sets the number of rows in the table footer. The default value is `0` (no footer).
//
// Supported types: `int`, `string`.
//
// Values:
// `0` or "0" - No footer.
// > `0` or > "0" - Number of rows act as a footer.
FootHeight = "foot-height"
// FootStyle is the constant for the "foot-style" property tag.
// The "foot-style" string property sets the footer style name
// FootStyle is the constant for "foot-style" property tag.
//
// Used by `TableView`.
// Set the footer style name or description of style properties.
//
// Supported types: `string`, `Params`.
//
// Internal type is either `string` or `Params`.
//
// Conversion rules:
// `string` - must contain style name defined in resources.
// `Params` - must contain style properties.
FootStyle = "foot-style"
// RowSpan is the constant for the "row-span" property tag.
// The "row-span" int property sets the number of table row to span.
// Used only when specifying cell parameters in the implementation of TableCellStyle
// RowSpan is the constant for "row-span" property tag.
//
// Used by `TableView`.
// Set the number of table row to span. Used only when specifying cell parameters in the implementation of
// `TableCellStyle`.
//
// Supported types: `int`, `string`.
//
// Values:
// `0` or "0" - No merging will be applied.
// > `0` or > "0" - Number of rows including current one to be merged together.
RowSpan = "row-span"
// ColumnSpan is the constant for the "column-span" property tag.
// The "column-span" int property sets the number of table column to span.
// Used only when specifying cell parameters in the implementation of TableCellStyle
// ColumnSpan is the constant for "column-span" property tag.
//
// Used by `TableView`.
// Sets the number of table column cells to be merged together. Used only when specifying cell parameters in the
// implementation of `TableCellStyle`.
//
// Supported types: `int`, `string`.
//
// Values:
// `0` or "0" - No merging will be applied.
// > `0` or > "0" - Number of columns including current one to be merged together.
ColumnSpan = "column-span"
// RowStyle is the constant for the "row-style" property tag.
// The "row-style" property sets the adapter which specifies styles of each table row.
// This property can be assigned or by an implementation of TableRowStyle interface, or by an array of Params.
// RowStyle is the constant for "row-style" property tag.
//
// Used by `TableView`.
// Set the adapter which specifies styles of each table row.
//
// Supported types: `TableRowStyle`, `[]Params`.
//
// Internal type is `TableRowStyle`, other types converted to it during assignment.
// See `TableRowStyle` description for more details.
RowStyle = "row-style"
// ColumnStyle is the constant for the "column-style" property tag.
// The "column-style" property sets the adapter which specifies styles of each table column.
// This property can be assigned or by an implementation of TableColumnStyle interface, or by an array of Params.
// ColumnStyle is the constant for "column-style" property tag.
//
// Used by `TableView`.
// Set the adapter which specifies styles of each table column.
//
// Supported types: `TableColumnStyle`, `[]Params`.
//
// Internal type is `TableColumnStyle`, other types converted to it during assignment.
// See `TableColumnStyle` description for more details.
ColumnStyle = "column-style"
// CellStyle is the constant for the "cell-style" property tag.
// The "cell-style" property sets the adapter which specifies styles of each table cell.
// This property can be assigned only by an implementation of TableCellStyle interface.
// CellStyle is the constant for "cell-style" property tag.
//
// Used by `TableView`.
// Set the adapter which specifies styles of each table cell. This property can be assigned only by an implementation of
// `TableCellStyle` interface.
//
// Supported types: `TableCellStyle`.
CellStyle = "cell-style"
// CellPadding is the constant for the "cell-padding" property tag.
// The "cell-padding" Bounds property sets the padding area on all four sides of a table call at once.
// An element's padding area is the space between its content and its border.
// CellPadding is the constant for "cell-padding" property tag.
//
// Used by `TableView`.
// Sets the padding area on all four sides of a table cell at once. An element's padding area is the space between its
// content and its border.
//
// Supported types: `BoundsProperty`, `Bounds`, `SizeUnit`, `float32`, `float64`, `int`.
//
// Internal type is `BoundsProperty`, other types converted to it during assignment.
// See `BoundsProperty`, `Bounds` and `SizeUnit` description for more details.
CellPadding = "cell-padding"
// CellPaddingLeft is the constant for the "cell-padding-left" property tag.
// The "cell-padding-left" SizeUnit property sets the width of the padding area to the left of a cell content.
// An element's padding area is the space between its content and its border.
// CellPaddingLeft is the constant for "cell-padding-left" property tag.
//
// Used by `TableView`.
// Set the width of the padding area to the left of a cell content. An element's padding area is the space between its
// content and its border.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
CellPaddingLeft = "cell-padding-left"
// CellPaddingRight is the constant for the "cell-padding-right" property tag.
// The "cell-padding-right" SizeUnit property sets the width of the padding area to the left of a cell content.
// An element's padding area is the space between its content and its border.
// CellPaddingRight is the constant for "cell-padding-right" property tag.
//
// Used by `TableView`.
// Set the width of the padding area to the left of a cell content. An element's padding area is the space between its
// content and its border.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
CellPaddingRight = "cell-padding-right"
// CellPaddingTop is the constant for the "cell-padding-top" property tag.
// The "cell-padding-top" SizeUnit property sets the height of the padding area to the top of a cell content.
// An element's padding area is the space between its content and its border.
// CellPaddingTop is the constant for "cell-padding-top" property tag.
//
// Used by `TableView`.
// Set the height of the padding area to the top of a cell content. An element's padding area is the space between its
// content and its border.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
CellPaddingTop = "cell-padding-top"
// CellPaddingBottom is the constant for the "cell-padding-bottom" property tag.
// The "cell-padding-bottom" SizeUnit property sets the height of the padding area to the bottom of a cell content.
// CellPaddingBottom is the constant for "cell-padding-bottom" property tag.
//
// Used by `TableView`.
// Set the height of the padding area to the bottom of a cell content.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
CellPaddingBottom = "cell-padding-bottom"
// CellBorder is the constant for the "cell-border" property tag.
// The "cell-border" property sets a table cell's border. It sets the values of a border width, style, and color.
// This property can be assigned a value of BorderProperty type, or ViewBorder type, or BorderProperty text representation.
// CellBorder is the constant for "cell-border" property tag.
//
// Used by `TableView`.
// Set a table cell's border. It sets the values of a border width, style, and color. Can also be used when setting
// parameters in properties "row-style", "column-style", "foot-style" and "head-style".
//
// Supported types: `BorderProperty`, `ViewBorder`, `ViewBorders`.
//
// Internal type is `BorderProperty`, other types converted to it during assignment.
// See `BorderProperty`, `ViewBorder` and `ViewBorders` description for more details.
CellBorder = "cell-border"
// CellBorderLeft is the constant for the "cell-border-left" property tag.
// The "cell-border-left" property sets a view's left border. It sets the values of a border width, style, and color.
// This property can be assigned a value of BorderProperty type, or ViewBorder type, or BorderProperty text representation.
// CellBorderLeft is the constant for "cell-border-left" property tag.
//
// Used by `TableView`.
// Set a view's left border. It sets the values of a border width, style, and color. This property can be assigned a value
// of `BorderProperty`, `ViewBorder` types or `BorderProperty` text representation.
//
// Supported types: `ViewBorder`, `BorderProperty`, `string`.
//
// Internal type is `BorderProperty`, other types converted to it during assignment.
// See `ViewBorder` and `BorderProperty` description for more details.
CellBorderLeft = "cell-border-left"
// CellBorderRight is the constant for the "cell-border-right" property tag.
// The "cell-border-right" property sets a view's right border. It sets the values of a border width, style, and color.
// This property can be assigned a value of BorderProperty type, or ViewBorder type, or BorderProperty text representation.
// CellBorderRight is the constant for "cell-border-right" property tag.
//
// Used by `TableView`.
// Set a view's right border. It sets the values of a border width, style, and color. This property can be assigned a
// value of `BorderProperty`, `ViewBorder` types or `BorderProperty` text representation.
//
// Supported types: `ViewBorder`, `BorderProperty`, `string`.
//
// Internal type is `BorderProperty`, other types converted to it during assignment.
// See `ViewBorder` and `BorderProperty` description for more details.
CellBorderRight = "cell-border-right"
// CellBorderTop is the constant for the "cell-border-top" property tag.
// The "cell-border-top" property sets a view's top border. It sets the values of a border width, style, and color.
// This property can be assigned a value of BorderProperty type, or ViewBorder type, or BorderProperty text representation.
// CellBorderTop is the constant for "cell-border-top" property tag.
//
// Used by `TableView`.
// Set a view's top border. It sets the values of a border width, style, and color. This property can be assigned a value
// of `BorderProperty`, `ViewBorder` types or `BorderProperty` text representation.
//
// Supported types: `ViewBorder`, `BorderProperty`, `string`.
//
// Internal type is `BorderProperty`, other types converted to it during assignment.
// See `ViewBorder` and `BorderProperty` description for more details.
CellBorderTop = "cell-border-top"
// CellBorderBottom is the constant for the "cell-border-bottom" property tag.
// The "cell-border-bottom" property sets a view's bottom border. It sets the values of a border width, style, and color.
// This property can be assigned a value of BorderProperty type, or ViewBorder type, or BorderProperty text representation.
// CellBorderBottom is the constant for "cell-border-bottom" property tag.
//
// Used by `TableView`.
// Set a view's bottom border. It sets the values of a border width, style, and color.
//
// Supported types: `ViewBorder`, `BorderProperty`, `string`.
//
// Internal type is `BorderProperty`, other types converted to it during assignment.
// See `ViewBorder` and `BorderProperty` description for more details.
CellBorderBottom = "cell-border-bottom"
// CellBorderStyle is the constant for the "cell-border-style" property tag.
// The "cell-border-style" int property sets the line style for all four sides of a table cell's border.
// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
// CellBorderStyle is the constant for "cell-border-style" property tag.
//
// Used by `TableView`.
// Set the line style for all four sides of a table cell's border. Default value is "none".
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`NoneLine`) or "none" - The border will not be drawn.
// `1`(`SolidLine`) or "solid" - Solid line as a border.
// `2`(`DashedLine`) or "dashed" - Dashed line as a border.
// `3`(`DottedLine`) or "dotted" - Dotted line as a border.
// `4`(`DoubleLine`) or "double" - Double line as a border.
CellBorderStyle = "cell-border-style"
// CellBorderLeftStyle is the constant for the "cell-border-left-style" property tag.
// The "cell-border-left-style" int property sets the line style of a table cell's left border.
// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
// CellBorderLeftStyle is the constant for "cell-border-left-style" property tag.
//
// Used by `TableView`.
// Set the line style of a table cell's left border. Default value is "none".
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`NoneLine`) or "none" - The border will not be drawn.
// `1`(`SolidLine`) or "solid" - Solid line as a border.
// `2`(`DashedLine`) or "dashed" - Dashed line as a border.
// `3`(`DottedLine`) or "dotted" - Dotted line as a border.
// `4`(`DoubleLine`) or "double" - Double line as a border.
CellBorderLeftStyle = "cell-border-left-style"
// CellBorderRightStyle is the constant for the "cell-border-right-style" property tag.
// The "cell-border-right-style" int property sets the line style of a table cell's right border.
// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
// CellBorderRightStyle is the constant for "cell-border-right-style" property tag.
//
// Used by `TableView`.
// Set the line style of a table cell's right border. Default value is "none".
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`NoneLine`) or "none" - The border will not be drawn.
// `1`(`SolidLine`) or "solid" - Solid line as a border.
// `2`(`DashedLine`) or "dashed" - Dashed line as a border.
// `3`(`DottedLine`) or "dotted" - Dotted line as a border.
// `4`(`DoubleLine`) or "double" - Double line as a border.
CellBorderRightStyle = "cell-border-right-style"
// CellBorderTopStyle is the constant for the "cell-border-top-style" property tag.
// The "cell-border-top-style" int property sets the line style of a table cell's top border.
// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
// CellBorderTopStyle is the constant for "cell-border-top-style" property tag.
//
// Used by `TableView`.
// Set the line style of a table cell's top border. Default value is "none".
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`NoneLine`) or "none" - The border will not be drawn.
// `1`(`SolidLine`) or "solid" - Solid line as a border.
// `2`(`DashedLine`) or "dashed" - Dashed line as a border.
// `3`(`DottedLine`) or "dotted" - Dotted line as a border.
// `4`(`DoubleLine`) or "double" - Double line as a border.
CellBorderTopStyle = "cell-border-top-style"
// CellBorderBottomStyle is the constant for the "cell-border-bottom-style" property tag.
// The "cell-border-bottom-style" int property sets the line style of a table cell's bottom border.
// Valid values are NoneLine (0), SolidLine (1), DashedLine (2), DottedLine (3), and DoubleLine (4).
// CellBorderBottomStyle is the constant for "cell-border-bottom-style" property tag.
//
// Used by `TableView`.
// Sets the line style of a table cell's bottom border. Default value is "none".
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`NoneLine`) or "none" - The border will not be drawn.
// `1`(`SolidLine`) or "solid" - Solid line as a border.
// `2`(`DashedLine`) or "dashed" - Dashed line as a border.
// `3`(`DottedLine`) or "dotted" - Dotted line as a border.
// `4`(`DoubleLine`) or "double" - Double line as a border.
CellBorderBottomStyle = "cell-border-bottom-style"
// CellBorderWidth is the constant for the "cell-border-width" property tag.
// The "cell-border-width" property sets the line width for all four sides of a table cell's border.
// CellBorderWidth is the constant for "cell-border-width" property tag.
//
// Used by `TableView`.
// Set the line width for all four sides of a table cell's border.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
CellBorderWidth = "cell-border-width"
// CellBorderLeftWidth is the constant for the "cell-border-left-width" property tag.
// The "cell-border-left-width" SizeUnit property sets the line width of a table cell's left border.
// CellBorderLeftWidth is the constant for "cell-border-left-width" property tag.
//
// Used by `TableView`.
// Set the line width of a table cell's left border.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
CellBorderLeftWidth = "cell-border-left-width"
// CellBorderRightWidth is the constant for the "cell-border-right-width" property tag.
// The "cell-border-right-width" SizeUnit property sets the line width of a table cell's right border.
// CellBorderRightWidth is the constant for "cell-border-right-width" property tag.
//
// Used by `TableView`.
// Set the line width of a table cell's right border.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
CellBorderRightWidth = "cell-border-right-width"
// CellBorderTopWidth is the constant for the "cell-border-top-width" property tag.
// The "cell-border-top-width" SizeUnit property sets the line width of a table cell's top border.
// CellBorderTopWidth is the constant for "cell-border-top-width" property tag.
//
// Used by `TableView`.
// Set the line width of a table cell's top border.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
CellBorderTopWidth = "cell-border-top-width"
// CellBorderBottomWidth is the constant for the "cell-border-bottom-width" property tag.
// The "cell-border-bottom-width" SizeUnit property sets the line width of a table cell's bottom border.
// CellBorderBottomWidth is the constant for "cell-border-bottom-width" property tag.
//
// Used by `TableView`.
// Set the line width of a table cell's bottom border.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
CellBorderBottomWidth = "cell-border-bottom-width"
// CellBorderColor is the constant for the "cell-border-color" property tag.
// The "cell-border-color" property sets the line color for all four sides of a table cell's border.
// CellBorderColor is the constant for "cell-border-color" property tag.
//
// Used by `TableView`.
// Set the line color for all four sides of a table cell's border.
//
// Supported types: `Color`, `string`.
//
// Internal type is `Color`, other types converted to it during assignment.
// See `Color` description for more details.
CellBorderColor = "cell-border-color"
// CellBorderLeftColor is the constant for the "cell-border-left-color" property tag.
// The "cell-border-left-color" property sets the line color of a table cell's left border.
// CellBorderLeftColor is the constant for "cell-border-left-color" property tag.
//
// Used by `TableView`.
// Set the line color of a table cell's left border.
//
// Supported types: `Color`, `string`.
//
// Internal type is `Color`, other types converted to it during assignment.
// See `Color` description for more details.
CellBorderLeftColor = "cell-border-left-color"
// CellBorderRightColor is the constant for the "cell-border-right-color" property tag.
// The "cell-border-right-color" property sets the line color of a table cell's right border.
// CellBorderRightColor is the constant for "cell-border-right-color" property tag.
//
// Used by `TableView`.
// Set the line color of a table cell's right border.
//
// Supported types: `Color`, `string`.
//
// Internal type is `Color`, other types converted to it during assignment.
// See `Color` description for more details.
CellBorderRightColor = "cell-border-right-color"
// CellBorderTopColor is the constant for the "cell-border-top-color" property tag.
// The "cell-border-top-color" property sets the line color of a table cell's top border.
// CellBorderTopColor is the constant for "cell-border-top-color" property tag.
//
// Used by `TableView`.
// Set the line color of a table cell's top border.
//
// Supported types: `Color`, `string`.
//
// Internal type is `Color`, other types converted to it during assignment.
// See `Color` description for more details.
CellBorderTopColor = "cell-border-top-color"
// CellBorderBottomColor is the constant for the "cell-border-bottom-color" property tag.
// The "cell-border-bottom-color" property sets the line color of a table cell's bottom border.
// CellBorderBottomColor is the constant for "cell-border-bottom-color" property tag.
//
// Used by `TableView`.
// Set the line color of a table cell's bottom border.
//
// Supported types: `Color`, `string`.
//
// Internal type is `Color`, other types converted to it during assignment.
// See `Color` description for more details.
CellBorderBottomColor = "cell-border-bottom-color"
// SelectionMode is the constant for the "selection-mode" property tag.
// The "selection-mode" int property sets the mode of the table elements selection.
// Valid values are NoneSelection (0), CellSelection (1), and RowSelection (2)
// SelectionMode is the constant for "selection-mode" property tag.
//
// Used by `TableView`.
// Sets the mode of the table elements selection. Default value is "none".
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`NoneSelection`) or "none" - Table elements are not selectable. The table cannot receive input focus.
// `1`(`CellSelection`) or "cell" - One table cell can be selected(highlighted). The cell is selected interactively using the mouse or keyboard(using the cursor keys).
// `2`(`RowSelection`) or "row" - The entire table row can be selected (highlighted). The row is selected interactively using the mouse or keyboard (using the cursor keys).
SelectionMode = "selection-mode"
// TableCellClickedEvent is the constant for "table-cell-clicked" property tag.
// The "table-cell-clicked" event occurs when the user clicks on a table cell.
// The main listener format: func(TableView, int, int), where the second argument is the row number,
// and third argument is the column number.
//
// Used by `TableView`.
// Occur when the user clicks on a table cell.
//
// General listener format:
// `func(table rui.TableView, row, col int)`.
//
// where:
// table - Interface of a table view which generated this event,
// row - Row of the clicked cell,
// col - Column of the clicked cell.
//
// Allowed listener formats:
// `func(row, col int)`.
TableCellClickedEvent = "table-cell-clicked"
// TableCellSelectedEvent is the constant for "table-cell-selected" property tag.
// The "table-cell-selected" event occurs when a table cell becomes selected.
// The main listener format: func(TableView, int, int), where the second argument is the row number,
// and third argument is the column number.
//
// Used by `TableView`.
// Occur when a table cell becomes selected.
//
// General listener format:
// `func(table rui.TableView, row, col int)`.
//
// where:
// table - Interface of a table view which generated this event,
// row - Row of the selected cell,
// col - Column of the selected cell.
//
// Allowed listener formats:
// `func(row, col int)`.
TableCellSelectedEvent = "table-cell-selected"
// TableRowClickedEvent is the constant for "table-row-clicked" property tag.
// The "table-row-clicked" event occurs when the user clicks on a table row.
// The main listener format: func(TableView, int), where the second argument is the row number.
//
// Used by `TableView`.
// Occur when the user clicks on a table row.
//
// General listener format:
// `func(table rui.TableView, row int)`.
//
// where:
// table - Interface of a table view which generated this event,
// row - Clicked row.
//
// Allowed listener formats:
// `func(row int)`.
TableRowClickedEvent = "table-row-clicked"
// TableRowSelectedEvent is the constant for "table-row-selected" property tag.
// The "table-row-selected" event occurs when a table row becomes selected.
// The main listener format: func(TableView, int), where the second argument is the row number.
//
// Used by `TableView`.
// Occur when a table row becomes selected.
//
// General listener format:
// `func(table rui.TableView, row int)`.
//
// where:
// table - Interface of a table view which generated this event,
// row - Selected row.
//
// Allowed listener formats:
// `func(row int)`.
TableRowSelectedEvent = "table-row-selected"
// AllowSelection is the constant for the "allow-selection" property tag.
// The "allow-selection" property sets the adapter which specifies styles of each table row.
// This property can be assigned or by an implementation of TableAllowCellSelection
// or TableAllowRowSelection interface.
// AllowSelection is the constant for "allow-selection" property tag.
//
// Used by `TableView`.
// Set the adapter which specifies whether cell/row selection is allowed. This property can be assigned by an
// implementation of `TableAllowCellSelection` or `TableAllowRowSelection` interface.
//
// Supported types: `TableAllowCellSelection`, `TableAllowRowSelection`.
//
// Internal type is either `TableAllowCellSelection`, `TableAllowRowSelection`, see their description for more details.
AllowSelection = "allow-selection"
)

View File

@ -8,43 +8,105 @@ import (
// Constants for [TabsLayout] specific properties and events
const (
// CurrentTabChangedEvent is the constant for "current-tab-changed" property tag.
// The "current-tab-changed" event occurs when the new tab becomes active.
// The main listener format: func(TabsLayout, int, int), where
// the second argument is the index of the new active tab,
// the third argument is the index of the old active tab.
//
// Used by `TabsLayout`.
// Occur when the new tab becomes active.
//
// General listener format:
// `func(tabsLayout rui.TabsLayout, newTab, oldTab int)`.
//
// where:
// tabsLayout - Interface of a tabs layout which generated this event,
// newTab - Index of a new active tab,
// oldTab - Index of an old active tab.
//
// Allowed listener formats:
// `func(tabsLayout rui.TabsLayout, newTab int)`,
// `func(newTab, oldTab int)`,
// `func(newTab int)`,
// `func()`.
CurrentTabChangedEvent = "current-tab-changed"
// Icon is the constant for "icon" property tag.
// The string "icon" property defines the icon name that is displayed in the tab.
//
// Used by `TabsLayout`.
// Defines the icon name that is displayed in the tab. The property is set for the child view of `TabsLayout`.
//
// Supported types: `string`.
Icon = "icon"
// TabCloseButton is the constant for "tab-close-button" property tag.
// The "tab-close-button" is the bool property. If it is "true" then a close button is displayed within the tab.
//
// Used by `TabsLayout`.
// Controls whether to add close button to a tab(s). This property can be set separately for each child view or for tabs
// layout itself. Property set for child view takes precedence over the value set for tabs layout. Default value is
// `false`.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - Tab(s) has close button.
// `false` or `0` or "false", "no", "off", "0" - No close button in tab(s).
TabCloseButton = "tab-close-button"
// TabCloseEvent is the constant for "tab-close-event" property tag.
// The "tab-close-event" occurs when when the user clicks on the tab close button.
// The main listener format: func(TabsLayout, int), where the second argument is the index of the tab.
//
// Used by `TabsLayout`.
// Occurs when the user clicks on the tab close button.
//
// General listener format:
// `func(tabsLayout rui.TabsLayout, tab int)`.
//
// where:
// tabsLayout - Interface of a tabs layout which generated this event,
// tab - Index of the tab.
//
// Allowed listener formats:
// `func(tab int)`,
// `func(tabsLayout rui.TabsLayout)`,
// `func()`.
TabCloseEvent = "tab-close-event"
// Tabs is the constant for the "tabs" property tag.
// The "tabs" is the int property that sets where the tabs are located.
// Valid values: TopTabs (0), BottomTabs (1), LeftTabs (2), RightTabs (3), LeftListTabs (4), RightListTabs (5), and HiddenTabs (6).
// Tabs is the constant for "tabs" property tag.
//
// Used by `TabsLayout`.
// Sets where the tabs are located. Default value is "top".
//
// Supported types: `int`, `string`.
//
// Values:
// `0`(`TopTabs`) or "top" - Tabs on the top.
// `1`(`BottomTabs`) or "bottom" - Tabs on the bottom.
// `2`(`LeftTabs`) or "left" - Tabs on the left. Each tab is rotated 90° counterclockwise.
// `3`(`RightTabs`) or "right" - Tabs located on the right. Each tab is rotated 90° clockwise.
// `4`(`LeftListTabs`) or "left-list" - Tabs on the left. The tabs are displayed as a list.
// `5`(`RightListTabs`) or "right-list" - Tabs on the right. The tabs are displayed as a list.
// `6`(`HiddenTabs`) or "hidden" - Tabs are hidden.
Tabs = "tabs"
// TabBarStyle is the constant for the "tab-bar-style" property tag.
// The "tab-bar-style" is the string property that sets the style for the display of the tab bar.
// The default value is "ruiTabBar".
// TabBarStyle is the constant for "tab-bar-style" property tag.
//
// Used by `TabsLayout`.
// Set the style for the display of the tab bar. The default value is "ruiTabBar".
//
// Supported types: `string`.
TabBarStyle = "tab-bar-style"
// TabStyle is the constant for the "tab-style" property tag.
// The "tab-style" is the string property that sets the style for the display of the tab.
// The default value is "ruiTab" or "ruiVerticalTab".
// TabStyle is the constant for "tab-style" property tag.
//
// Used by `TabsLayout`.
// Set the style for the display of the tab. The default value is "ruiTab" or "ruiVerticalTab".
//
// Supported types: `string`.
TabStyle = "tab-style"
// CurrentTabStyle is the constant for the "current-tab-style" property tag.
// The "current-tab-style" is the string property that sets the style for the display of the current (selected) tab.
// The default value is "ruiCurrentTab" or "ruiCurrentVerticalTab".
// CurrentTabStyle is the constant for "current-tab-style" property tag.
//
// Used by `TabsLayout`.
// Set the style for the display of the current(selected) tab. The default value is "ruiCurrentTab" or
// "ruiCurrentVerticalTab".
//
// Supported types: `string`.
CurrentTabStyle = "current-tab-style"
inactiveTabStyle = "data-inactiveTabStyle"

View File

@ -9,24 +9,86 @@ import (
// Constants for [TimePicker] specific properties and events.
const (
// TimeChangedEvent is the constant for "time-changed" property tag.
// The "time-changed" event occur when current time of the [TimePicker] has been changed.
// The main listener format: func(picker TimePicker, newTime, oldTime time.Time).
//
// Used by `TimePicker`.
// Occur when current time of the time picker has been changed.
//
// General listener format:
// `func(picker rui.TimePicker, newTime, oldTime time.Time)`.
//
// where:
// picker - Interface of a time picker which generated this event,
// newTime - New time value,
// oldTime - Old time value.
//
// Allowed listener formats:
// `func(picker rui.TimePicker, newTime time.Time)`,
// `func(newTime, oldTime time.Time)`,
// `func(newTime time.Time)`,
// `func(picker rui.TimePicker)`,
// `func()`.
TimeChangedEvent = "time-changed"
// TimePickerMin is the constant for "time-picker-min" property tag.
// The "time-picker-min" define the minimum value of the time.
//
// Used by `TimePicker`.
// The minimum value of the time.
//
// Supported types: `time.Time`, `string`.
//
// Internal type is `time.Time`, other types converted to it during assignment.
//
// Conversion rules:
// `string` - values of this type parsed and converted to `time.Time`. The following formats are supported:
// "HH:MM:SS" - "08:15:00".
// "HH:MM:SS PM" - "08:15:00 AM".
// "HH:MM" - "08:15".
// "HH:MM PM" - "08:15 AM".
TimePickerMin = "time-picker-min"
// TimePickerMax is the constant for "time-picker-max" property tag.
// The "time-picker-max" define the maximum value of the time.
//
// Used by `TimePicker`.
// The maximum value of the time.
//
// Supported types: `time.Time`, `string`.
//
// Internal type is `time.Time`, other types converted to it during assignment.
//
// Conversion rules:
// `string` - values of this type parsed and converted to `time.Time`. The following formats are supported:
// "HH:MM:SS" - "08:15:00".
// "HH:MM:SS PM" - "08:15:00 AM".
// "HH:MM" - "08:15".
// "HH:MM PM" - "08:15 AM".
TimePickerMax = "time-picker-max"
// TimePickerStep is the constant for "time-picker-step" property tag.
// The "time-picker-step" define time step in seconds.
//
// Used by `TimePicker`.
// Time step in seconds.
//
// Supported types: `int`, `string`.
//
// Values:
// >= `0` or >= "0" - Step value in seconds used to increment or decrement time.
TimePickerStep = "time-picker-step"
// TimePickerValue is the constant for "time-picker-value" property tag.
// The "time-picker-value" define current value of the TimePicker.
//
// Used by `TimePicker`.
// Current value.
//
// Supported types: `time.Time`, `string`.
//
// Internal type is `time.Time`, other types converted to it during assignment.
//
// Conversion rules:
// `string` - values of this type parsed and converted to `time.Time`. The following formats are supported:
// "HH:MM:SS" - "08:15:00".
// "HH:MM:SS PM" - "08:15:00 AM".
// "HH:MM" - "08:15".
// "HH:MM PM" - "08:15 AM".
TimePickerValue = "time-picker-value"
timeFormat = "15:04:05"

View File

@ -8,28 +8,76 @@ import (
// Constants which represent [View] specific touch events properties
const (
// TouchStart is the constant for "touch-start" property tag.
// The "touch-start" event is fired when one or more touch points are placed on the touch surface.
// The main listener format: func(View, TouchEvent).
// The additional listener formats: func(TouchEvent), func(View), and func().
//
// Used by `View`.
// Is fired when one or more touch points are placed on the touch surface.
//
// General listener format:
// `func(view rui.View, event rui.TouchEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Touch event.
//
// Allowed listener formats:
// `func(event rui.TouchEvent)`,
// `func(view rui.View)`,
// `func()`.
TouchStart = "touch-start"
// TouchEnd is the constant for "touch-end" property tag.
// The "touch-end" event fires when one or more touch points are removed from the touch surface.
// The main listener format: func(View, TouchEvent).
// The additional listener formats: func(TouchEvent), func(View), and func().
//
// Used by `View`.
// Fired when one or more touch points are removed from the touch surface.
//
// General listener format:
// `func(view rui.View, event rui.TouchEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Touch event.
//
// Allowed listener formats:
// `func(event rui.TouchEvent)`,
// `func(view rui.View)`,
// `func()`.
TouchEnd = "touch-end"
// TouchMove is the constant for "touch-move" property tag.
// The "touch-move" event is fired when one or more touch points are moved along the touch surface.
// The main listener format: func(View, TouchEvent).
// The additional listener formats: func(TouchEvent), func(View), and func().
//
// Used by `View`.
// Is fired when one or more touch points are moved along the touch surface.
//
// General listener format:
// `func(view rui.View, event rui.TouchEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Touch event.
//
// Allowed listener formats:
// `func(event rui.TouchEvent)`,
// `func(view rui.View)`,
// `func()`.
TouchMove = "touch-move"
// TouchCancel is the constant for "touch-cancel" property tag.
// The "touch-cancel" event is fired when one or more touch points have been disrupted
// in an implementation-specific manner (for example, too many touch points are created).
// The main listener format: func(View, TouchEvent).
// The additional listener formats: func(TouchEvent), func(View), and func().
//
// Used by `View`.
// Is fired when one or more touch points have been disrupted in an implementation-specific manner (for example, too many
// touch points are created).
//
// General listener format:
// `func(view rui.View, event rui.TouchEvent)`.
//
// where:
// view - Interface of a view which generated this event,
// event - Touch event.
//
// Allowed listener formats:
// `func(event rui.TouchEvent)`,
// `func(view rui.View)`,
// `func()`.
TouchCancel = "touch-cancel"
)
@ -42,22 +90,26 @@ type Touch struct {
// X provides the horizontal coordinate within the view's viewport.
X float64
// Y provides the vertical coordinate within the view's viewport.
Y float64
// ClientX provides the horizontal coordinate within the application's viewport at which the event occurred.
ClientX float64
// ClientY provides the vertical coordinate within the application's viewport at which the event occurred.
ClientY float64
// ScreenX provides the horizontal coordinate (offset) of the touch pointer in global (screen) coordinates.
ScreenX float64
// ScreenY provides the vertical coordinate (offset) of the touch pointer in global (screen) coordinates.
ScreenY float64
// RadiusX is the X radius of the ellipse that most closely circumscribes the area of contact with the screen.
// The value is in pixels of the same scale as screenX.
RadiusX float64
// RadiusY is the Y radius of the ellipse that most closely circumscribes the area of contact with the screen.
// The value is in pixels of the same scale as screenX.
RadiusY float64

View File

@ -6,18 +6,34 @@ import (
// Constants for [VideoPlayer] specific properties and events
const (
// VideoWidth is the constant for the "video-width" property tag of VideoPlayer.
// The "video-width" float property defines the width of the video's display area in pixels.
// VideoWidth is the constant for "video-width" property tag.
//
// Used by `VideoPlayer`.
// Defines the width of the video's display area in pixels.
//
// Supported types: `float`, `int`, `string`.
//
// Values:
// Internal type is `float`, other types converted to it during assignment.
VideoWidth = "video-width"
// VideoHeight is the constant for the "video-height" property tag of VideoPlayer.
// The "video-height" float property defines the height of the video's display area in pixels.
// VideoHeight is the constant for "video-height" property tag.
//
// Used by `VideoPlayer`.
// Defines the height of the video's display area in pixels.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
VideoHeight = "video-height"
// Poster is the constant for the "poster" property tag of VideoPlayer.
// The "poster" property defines an URL for an image to be shown while the video is downloading.
// If this attribute isn't specified, nothing is displayed until the first frame is available,
// then the first frame is shown as the poster frame.
// Poster is the constant for "poster" property tag.
//
// Used by `VideoPlayer`.
// Defines an URL for an image to be shown while the video is downloading. If this attribute isn't specified, nothing is
// displayed until the first frame is available, then the first frame is shown as the poster frame.
//
// Supported types: `string`.
Poster = "poster"
)

View File

@ -7,67 +7,124 @@ import (
// Constants for [ViewFilter] specific properties and events
const (
// Blur is the constant for the "blur" property tag of the ViewFilter interface.
// The "blur" float64 property applies a Gaussian blur. The value of radius defines the value
// of the standard deviation to the Gaussian function, or how many pixels on the screen blend
// into each other, so a larger value will create more blur. The lacuna value for interpolation is 0.
// The parameter is specified as a length in pixels.
// Blur is the constant for "blur" property tag.
//
// Used by `ViewFilter`.
// Applies a Gaussian blur. The value of radius defines the value of the standard deviation to the Gaussian function, or
// how many pixels on the screen blend into each other, so a larger value will create more blur. The lacuna value for
// interpolation is 0. The parameter is specified as a length in pixels.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
Blur = "blur"
// Brightness is the constant for the "brightness" property tag of the ViewFilter interface.
// The "brightness" float64 property applies a linear multiplier to input image, making it appear more
// or less bright. A value of 0% will create an image that is completely black.
// A value of 100% leaves the input unchanged. Other values are linear multipliers on the effect.
// Values of an amount over 100% are allowed, providing brighter results.
// Brightness is the constant for "brightness" property tag.
//
// Used by `ViewFilter`.
// Applies a linear multiplier to input image, making it appear more or less bright. A value of 0% will create an image
// that is completely black. A value of 100% leaves the input unchanged. Other values are linear multipliers on the
// effect. Values of an amount over 100% are allowed, providing brighter results.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
Brightness = "brightness"
// Contrast is the constant for the "contrast" property tag of the ViewFilter interface.
// The "contrast" float64 property adjusts the contrast of the input.
// A value of 0% will create an image that is completely black. A value of 100% leaves the input unchanged.
// Values of amount over 100% are allowed, providing results with less contrast.
// Contrast is the constant for "contrast" property tag.
//
// Used by `ViewFilter`.
// Adjusts the contrast of the input. A value of 0% will create an image that is completely black. A value of 100% leaves
// the input unchanged. Values of amount over 100% are allowed, providing results with less contrast.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
Contrast = "contrast"
// DropShadow is the constant for the "drop-shadow" property tag of the ViewFilter interface.
// The "drop-shadow" property applies a drop shadow effect to the input image.
// A drop shadow is effectively a blurred, offset version of the input image's alpha mask
// drawn in a particular color, composited below the image.
// Shadow parameters are set using the ViewShadow interface
// DropShadow is the constant for "drop-shadow" property tag.
//
// Used by `ViewFilter`.
// Applies a drop shadow effect to the input image. A drop shadow is effectively a blurred, offset version of the input
// image's alpha mask drawn in a particular color, composited below the image. Shadow parameters are set using the
// `ViewShadow` interface.
//
// Supported types: `[]ViewShadow`, `ViewShadow`, `string`.
//
// Internal type is `[]ViewShadow`, other types converted to it during assignment.
// See `ViewShadow` description for more details.
//
// Conversion rules:
// `[]ViewShadow` - stored as is, no conversion performed.
// `ViewShadow` - converted to `[]ViewShadow`.
// `string` - string representation of `ViewShadow`. Example: "_{blur = 1em, color = black, spread-radius = 0.5em}".
DropShadow = "drop-shadow"
// Grayscale is the constant for the "grayscale" property tag of the ViewFilter interface.
// The "grayscale" float64 property converts the input image to grayscale.
// The value of amount defines the proportion of the conversion.
// A value of 100% is completely grayscale. A value of 0% leaves the input unchanged.
// Values between 0% and 100% are linear multipliers on the effect.
// Grayscale is the constant for "grayscale" property tag.
//
// Used by `ViewFilter`.
// Converts the input image to grayscale. The value of amount defines the proportion of the conversion. A value of 100%
// is completely grayscale. A value of 0% leaves the input unchanged. Values between 0% and 100% are linear multipliers on
// the effect.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
Grayscale = "grayscale"
// HueRotate is the constant for the "hue-rotate" property tag of the ViewFilter interface.
// The "hue-rotate" AngleUnit property applies a hue rotation on the input image.
// The value of angle defines the number of degrees around the color circle the input samples will be adjusted.
// A value of 0deg leaves the input unchanged. If the angle parameter is missing, a value of 0deg is used.
// Though there is no maximum value, the effect of values above 360deg wraps around.
// HueRotate is the constant for "hue-rotate" property tag.
//
// Used by `ViewFilter`.
// Applies a hue rotation on the input image. The value of angle defines the number of degrees around the color circle
// the input samples will be adjusted. A value of 0deg leaves the input unchanged. If the angle parameter is missing, a
// value of 0deg is used. Though there is no maximum value, the effect of values above 360deg wraps around.
//
// Supported types: `AngleUnit`, `string`, `float`, `int`.
//
// Internal type is `AngleUnit`, other types will be converted to it during assignment.
// See `AngleUnit` description for more details.
//
// Conversion rules:
// `AngleUnit` - stored as is, no conversion performed.
// `string` - must contain string representation of `AngleUnit`. If numeric value will be provided without any suffix then `AngleUnit` with value and `Radian` value type will be created.
// `float` - a new `AngleUnit` value will be created with `Radian` as a type.
// `int` - a new `AngleUnit` value will be created with `Radian` as a type.
HueRotate = "hue-rotate"
// Invert is the constant for the "invert" property tag of the ViewFilter interface.
// The "invert" float64 property inverts the samples in the input image.
// The value of amount defines the proportion of the conversion.
// A value of 100% is completely inverted. A value of 0% leaves the input unchanged.
// Values between 0% and 100% are linear multipliers on the effect.
// Invert is the constant for "invert" property tag.
//
// Used by `ViewFilter`.
// Inverts the samples in the input image. The value of amount defines the proportion of the conversion. A value of 100%
// is completely inverted. A value of 0% leaves the input unchanged. Values between 0% and 100% are linear multipliers on
// the effect.
//
// Supported types: `float64`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
Invert = "invert"
// Saturate is the constant for the "saturate" property tag of the ViewFilter interface.
// The "saturate" float64 property saturates the input image.
// The value of amount defines the proportion of the conversion.
// A value of 0% is completely un-saturated. A value of 100% leaves the input unchanged.
// Other values are linear multipliers on the effect.
// Values of amount over 100% are allowed, providing super-saturated results.
// Saturate is the constant for "saturate" property tag.
//
// Used by `ViewFilter`.
// Saturates the input image. The value of amount defines the proportion of the conversion. A value of 0% is completely
// un-saturated. A value of 100% leaves the input unchanged. Other values are linear multipliers on the effect. Values of
// amount over 100% are allowed, providing super-saturated results.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
Saturate = "saturate"
// Sepia is the constant for the "sepia" property tag of the ViewFilter interface.
// The "sepia" float64 property converts the input image to sepia.
// The value of amount defines the proportion of the conversion.
// A value of 100% is completely sepia. A value of 0% leaves the input unchanged.
// Values between 0% and 100% are linear multipliers on the effect.
// Sepia is the constant for "sepia" property tag.
//
// Used by `ViewFilter`.
// Converts the input image to sepia. The value of amount defines the proportion of the conversion. A value of 100% is
// completely sepia. A value of 0% leaves the input unchanged. Values between 0% and 100% are linear multipliers on the
// effect.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
Sepia = "sepia"
//Opacity = "opacity"

View File

@ -8,94 +8,381 @@ import (
// Constants for [Transform] specific properties
const (
// Perspective is the name of the SizeUnit property that determines the distance between the z = 0 plane
// and the user in order to give a 3D-positioned element some perspective. Each 3D element
// with z > 0 becomes larger; each 3D-element with z < 0 becomes smaller.
// The default value is 0 (no 3D effects).
// Perspective is the constant for "perspective" property tag.
//
// Used by `View`.
// Distance between the z-plane and the user in order to give a 3D-positioned element some perspective. Each 3D element
// with z > 0 becomes larger, each 3D-element with z < 0 becomes smaller. The default value is 0 (no 3D effects).
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
Perspective = "perspective"
// PerspectiveOriginX is the name of the SizeUnit property that determines the x-coordinate of the position
// at which the viewer is looking. It is used as the vanishing point by the Perspective property.
// The default value is 50%.
// PerspectiveOriginX is the constant for "perspective-origin-x" property tag.
//
// Used by `View`.
// x-coordinate of the position at which the viewer is looking. It is used as the vanishing point by the "perspective"
// property. The default value is 50%.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
PerspectiveOriginX = "perspective-origin-x"
// PerspectiveOriginY is the name of the SizeUnit property that determines the y-coordinate of the position
// at which the viewer is looking. It is used as the vanishing point by the Perspective property.
// The default value is 50%.
// PerspectiveOriginY is the constant for "perspective-origin-y" property tag.
//
// Used by `View`.
// y-coordinate of the position at which the viewer is looking. It is used as the vanishing point by the "perspective"
// property. The default value is 50%.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
PerspectiveOriginY = "perspective-origin-y"
// BackfaceVisible is the name of the bool property that sets whether the back face of an element is
// visible when turned towards the user. Values:
// true - the back face is visible when turned towards the user (default value);
// false - the back face is hidden, effectively making the element invisible when turned away from the user.
// BackfaceVisible is the constant for "backface-visibility" property tag.
//
// Used by `View`.
// Controls whether the back face of a view is visible when turned towards the user. Default value is `true`.
//
// Supported types: `bool`, `int`, `string`.
//
// Values:
// `true` or `1` or "true", "yes", "on", "1" - Back face is visible when turned towards the user.
// `false` or `0` or "false", "no", "off", "0" - Back face is hidden, effectively making the view invisible when turned away from the user.
BackfaceVisible = "backface-visibility"
// OriginX is the name of the SizeUnit property that determines the x-coordinate of the point around which
// a view transformation is applied.
// The default value is 50%.
// OriginX is the constant for "origin-x" property tag.
//
// Used by `View`.
// x-coordinate of the point around which a view transformation is applied. The default value is 50%.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
OriginX = "origin-x"
// OriginY is the name of the SizeUnit property that determines the y-coordinate of the point around which
// a view transformation is applied.
// The default value is 50%.
// OriginY is the constant for "origin-y" property tag.
//
// Used by `View`.
// y-coordinate of the point around which a view transformation is applied. The default value is 50%.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
OriginY = "origin-y"
// OriginZ is the name of the SizeUnit property that determines the z-coordinate of the point around which
// a view transformation is applied.
// The default value is 50%.
// OriginZ is the constant for "origin-z" property tag.
//
// Used by `View`.
// z-coordinate of the point around which a view transformation is applied. The default value is 50%.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
OriginZ = "origin-z"
// TransformTag is the name of the Transform property that specify the x-, y-, and z-axis translation values,
// the x-, y-, and z-axis scaling values, the angle to use to distort the element along the abscissa and ordinate,
// the angle of the view rotation
// TransformTag is the constant for "transform" property tag.
//
// Used by `View`.
// Specify translation, scale and rotation over x, y and z axes as well as a distorsion of a view along x and y axes.
//
// Supported types: `Transform`, `string`.
//
// See `Transform` description for more details.
//
// Conversion rules:
// `Transform` - stored as is, no conversion performed.
// `string` - string representation of `Transform` interface. Example: "_{translate-x = 10px, scale-y = 1.1}".
TransformTag = "transform"
// TranslateX is the name of the SizeUnit property that specify the x-axis translation value
// of a 2D/3D translation
// TranslateX is the constant for "translate-x" property tag.
//
// Used by `View`, `Transform`.
//
// Usage in `View`:
// x-axis translation value of a 2D/3D translation.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
//
// Usage in `Transform`:
// x-axis translation value of a 2D/3D translation.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
TranslateX = "translate-x"
// TranslateY is the name of the SizeUnit property that specify the y-axis translation value
// of a 2D/3D translation
// TranslateY is the constant for "translate-y" property tag.
//
// Used by `View`, `Transform`.
//
// Usage in `View`:
// y-axis translation value of a 2D/3D translation.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
//
// Usage in `Transform`:
// x-axis translation value of a 2D/3D translation.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
TranslateY = "translate-y"
// TranslateZ is the name of the SizeUnit property that specify the z-axis translation value
// of a 3D translation
// TranslateZ is the constant for "translate-z" property tag.
//
// Used by `View`, `Transform`.
//
// Usage in `View`:
// z-axis translation value of a 3D translation.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
//
// Usage in `Transform`:
// z-axis translation value of a 3D translation.
//
// Supported types: `SizeUnit`, `SizeFunc`, `string`, `float`, `int`.
//
// Internal type is `SizeUnit`, other types converted to it during assignment.
// See `SizeUnit` description for more details.
TranslateZ = "translate-z"
// ScaleX is the name of the float property that specify the x-axis scaling value of a 2D/3D scale
// The default value is 1.
// ScaleX is the constant for "scale-x" property tag.
//
// Used by `View`, `Transform`.
//
// Usage in `View`:
// x-axis scaling value of a 2D/3D scale. The original scale is 1. Values between 0 and 1 are used to decrease original
// scale, more than 1 - to increase. The default value is 1.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
//
// Usage in `Transform`:
// x-axis scaling value of a 2D/3D scale. The original scale is 1. Values between 0 and 1 are used to decrease original
// scale, more than 1 - to increase. The default value is 1.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
ScaleX = "scale-x"
// ScaleY is the name of the float property that specify the y-axis scaling value of a 2D/3D scale
// The default value is 1.
// ScaleY is the constant for "scale-y" property tag.
//
// Used by `View`, `Transform`.
//
// Usage in `View`:
// y-axis scaling value of a 2D/3D scale. The original scale is 1. Values between 0 and 1 are used to decrease original
// scale, more than 1 - to increase. The default value is 1.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
//
// Usage in `Transform`:
// y-axis scaling value of a 2D/3D scale. The original scale is 1. Values between 0 and 1 are used to decrease original
// scale, more than 1 - to increase. The default value is 1.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
ScaleY = "scale-y"
// ScaleZ is the name of the float property that specify the z-axis scaling value of a 3D scale
// The default value is 1.
// ScaleZ is the constant for "scale-z" property tag.
//
// Used by `View`, `Transform`.
//
// Usage in `View`:
// z-axis scaling value of a 3D scale. The original scale is 1. Values between 0 and 1 are used to decrease original
// scale, more than 1 - to increase. The default value is 1.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
//
// Usage in `Transform`:
// z-axis scaling value of a 3D scale. The original scale is 1. Values between 0 and 1 are used to decrease original
// scale, more than 1 - to increase. The default value is 1.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
ScaleZ = "scale-z"
// Rotate is the name of the AngleUnit property that determines the angle of the view rotation.
// A positive angle denotes a clockwise rotation, a negative angle a counter-clockwise one.
// Rotate is the constant for "rotate" property tag.
//
// Used by `View`, `Transform`.
//
// Usage in `View`:
// Angle of the view rotation. A positive angle denotes a clockwise rotation, a negative angle a counter-clockwise.
//
// Supported types: `AngleUnit`, `string`, `float`, `int`.
//
// Internal type is `AngleUnit`, other types will be converted to it during assignment.
// See `AngleUnit` description for more details.
//
// Conversion rules:
// `AngleUnit` - stored as is, no conversion performed.
// `string` - must contain string representation of `AngleUnit`. If numeric value will be provided without any suffix then `AngleUnit` with value and `Radian` value type will be created.
// `float` - a new `AngleUnit` value will be created with `Radian` as a type.
// `int` - a new `AngleUnit` value will be created with `Radian` as a type.
//
// Usage in `Transform`:
// Angle of the view rotation. A positive angle denotes a clockwise rotation, a negative angle a counter-clockwise.
//
// Supported types: `AngleUnit`, `string`, `float`, `int`.
//
// Internal type is `AngleUnit`, other types will be converted to it during assignment.
// See `AngleUnit` description for more details.
//
// Conversion rules:
// `AngleUnit` - stored as is, no conversion performed.
// `string` - must contain string representation of `AngleUnit`. If numeric value will be provided without any suffix then `AngleUnit` with value and `Radian` value type will be created.
// `float` - a new `AngleUnit` value will be created with `Radian` as a type.
// `int` - a new `AngleUnit` value will be created with `Radian` as a type.
Rotate = "rotate"
// RotateX is the name of the float property that determines the x-coordinate of the vector denoting
// the axis of rotation which could between 0 and 1.
// RotateX is the constant for "rotate-x" property tag.
//
// Used by `View`, `Transform`.
//
// Usage in `View`:
// x-coordinate of the vector denoting the axis of rotation in range 0 to 1.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
//
// Usage in `Transform`:
// x-coordinate of the vector denoting the axis of rotation in range 0 to 1.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
RotateX = "rotate-x"
// RotateY is the name of the float property that determines the y-coordinate of the vector denoting
// the axis of rotation which could between 0 and 1.
// RotateY is the constant for "rotate-y" property tag.
//
// Used by `View`, `Transform`.
//
// Usage in `View`:
// y-coordinate of the vector denoting the axis of rotation in range 0 to 1.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
//
// Usage in `Transform`:
// y-coordinate of the vector denoting the axis of rotation in range 0 to 1.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
RotateY = "rotate-y"
// RotateZ is the name of the float property that determines the z-coordinate of the vector denoting
// the axis of rotation which could between 0 and 1.
// RotateZ is the constant for "rotate-z" property tag.
//
// Used by `View`, `Transform`.
//
// Usage in `View`:
// z-coordinate of the vector denoting the axis of rotation in range 0 to 1.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
//
// Usage in `Transform`:
// z-coordinate of the vector denoting the axis of rotation in range 0 to 1.
//
// Supported types: `float`, `int`, `string`.
//
// Internal type is `float`, other types converted to it during assignment.
RotateZ = "rotate-z"
// SkewX is the name of the AngleUnit property that representing the angle to use to distort
// the element along the abscissa. The default value is 0.
// SkewX is the constant for "skew-x" property tag.
//
// Used by `View`, `Transform`.
//
// Usage in `View`:
// Angle to use to distort the element along the abscissa. The default value is 0.
//
// Supported types: `AngleUnit`, `string`, `float`, `int`.
//
// Internal type is `AngleUnit`, other types will be converted to it during assignment.
// See `AngleUnit` description for more details.
//
// Conversion rules:
// `AngleUnit` - stored as is, no conversion performed.
// `string` - must contain string representation of `AngleUnit`. If numeric value will be provided without any suffix then `AngleUnit` with value and `Radian` value type will be created.
// `float` - a new `AngleUnit` value will be created with `Radian` as a type.
// `int` - a new `AngleUnit` value will be created with `Radian` as a type.
//
// Usage in `Transform`:
// Angle to use to distort the element along the abscissa. The default value is 0.
//
// Supported types: `AngleUnit`, `string`, `float`, `int`.
//
// Internal type is `AngleUnit`, other types will be converted to it during assignment.
// See `AngleUnit` description for more details.
//
// Conversion rules:
// `AngleUnit` - stored as is, no conversion performed.
// `string` - must contain string representation of `AngleUnit`. If numeric value will be provided without any suffix then `AngleUnit` with value and `Radian` value type will be created.
// `float` - a new `AngleUnit` value will be created with `Radian` as a type.
// `int` - a new `AngleUnit` value will be created with `Radian` as a type.
SkewX = "skew-x"
// SkewY is the name of the AngleUnit property that representing the angle to use to distort
// the element along the ordinate. The default value is 0.
// SkewY is the constant for "skew-y" property tag.
//
// Used by `View`, `Transform`.
//
// Usage in `View`:
// Angle to use to distort the element along the ordinate. The default value is 0.
//
// Supported types: `AngleUnit`, `string`, `float`, `int`.
//
// Internal type is `AngleUnit`, other types will be converted to it during assignment.
// See `AngleUnit` description for more details.
//
// Conversion rules:
// `AngleUnit` - stored as is, no conversion performed.
// `string` - must contain string representation of `AngleUnit`. If numeric value will be provided without any suffix then `AngleUnit` with value and `Radian` value type will be created.
// `float` - a new `AngleUnit` value will be created with `Radian` as a type.
// `int` - a new `AngleUnit` value will be created with `Radian` as a type.
//
// Usage in `Transform`:
// Angle to use to distort the element along the ordinate. The default value is 0.
//
// Supported types: `AngleUnit`, `string`, `float`, `int`.
//
// Internal type is `AngleUnit`, other types will be converted to it during assignment.
// See `AngleUnit` description for more details.
//
// Conversion rules:
// `AngleUnit` - stored as is, no conversion performed.
// `string` - must contain string representation of `AngleUnit`. If numeric value will be provided without any suffix then `AngleUnit` with value and `Radian` value type will be created.
// `float` - a new `AngleUnit` value will be created with `Radian` as a type.
// `int` - a new `AngleUnit` value will be created with `Radian` as a type.
SkewY = "skew-y"
)