uiproperties

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCSSProperty

func ParseCSSProperty(propType PropertyType, value string) (interface{}, error)

func ParseHexColor

func ParseHexColor(hexColor string) color.Color

ToRGB converts the HEXColor to and RGBColor

Types

type IPropertiesContainer

type IPropertiesContainer interface {
	AddProperty(name string, prop *Property)
	GetProperties() []*Property
	SetPropertyValue(name string, value interface{})
	PropertyValue(name string) interface{}
	Property(name string) *Property

	SetPropertyChangeNotifier(OnPropertyChangedForEditor func(prop *Property))
	NotifyChangedToContainer(prop *Property)
}

type IPropertyOwner

type IPropertyOwner interface {
	Subclass() string
}

type PropertiesChangesList

type PropertiesChangesList struct {
	// contains filtered or unexported fields
}

func NewPropertiesChangesList

func NewPropertiesChangesList() *PropertiesChangesList

func (*PropertiesChangesList) AddItem

func (c *PropertiesChangesList) AddItem(propContainer IPropertiesContainer, propName string, value interface{})

func (*PropertiesChangesList) Items

type PropertiesChangesListItem

type PropertiesChangesListItem struct {
	Name          string
	Value         interface{}
	PropContainer IPropertiesContainer
}

type PropertiesChangesStack

type PropertiesChangesStack struct {
	// contains filtered or unexported fields
}

func NewPropertiesChangesStack

func NewPropertiesChangesStack() *PropertiesChangesStack

func (*PropertiesChangesStack) AddList

func (*PropertiesChangesStack) Undo

type PropertiesContainer

type PropertiesContainer struct {
	OnPropertyChanged func(prop *Property)

	OnPropertyChangedForEditor func(prop *Property)
	// contains filtered or unexported fields
}

func (*PropertiesContainer) AddProperty

func (c *PropertiesContainer) AddProperty(name string, prop *Property)

func (*PropertiesContainer) GetProperties

func (c *PropertiesContainer) GetProperties() []*Property

func (*PropertiesContainer) InitPropertiesContainer

func (c *PropertiesContainer) InitPropertiesContainer()

func (*PropertiesContainer) NotifyChangedToContainer

func (c *PropertiesContainer) NotifyChangedToContainer(prop *Property)

func (*PropertiesContainer) Property

func (c *PropertiesContainer) Property(name string) *Property

func (*PropertiesContainer) PropertyValue

func (c *PropertiesContainer) PropertyValue(name string) interface{}

func (*PropertiesContainer) SetPropertyChangeNotifier

func (c *PropertiesContainer) SetPropertyChangeNotifier(OnPropertyChangedForEditor func(prop *Property))

func (*PropertiesContainer) SetPropertyValue

func (c *PropertiesContainer) SetPropertyValue(name string, value interface{})

type Property

type Property struct {
	Name        string
	DisplayName string
	Type        PropertyType
	SubType     string
	GroupName   string

	DefaultValue interface{}

	OnChanged func(property *Property, oldValue interface{}, newValue interface{})
	// contains filtered or unexported fields
}

func NewProperty

func NewProperty(name string, propertyType PropertyType) *Property

func (*Property) Bool

func (c *Property) Bool() bool

func (*Property) Code

func (c *Property) Code() string

func (*Property) Color

func (c *Property) Color() color.Color

func (*Property) DefaultValueForType

func (c *Property) DefaultValueForType(propertyType PropertyType) interface{}

func (*Property) Dispose

func (c *Property) Dispose()

func (*Property) Float64

func (c *Property) Float64() float64

func (*Property) Init

func (c *Property) Init(name string, w IPropertyOwner)

func (*Property) Int

func (c *Property) Int() int

func (*Property) Int32

func (c *Property) Int32() int32

func (*Property) SaveToStruct

func (c *Property) SaveToStruct() *PropertyStruct

func (*Property) SetOwnValue

func (c *Property) SetOwnValue(value interface{})

func (*Property) SetStyledValue

func (c *Property) SetStyledValue(subclass string, value string, score int)

func (*Property) SetUnstyled

func (c *Property) SetUnstyled(isUnstyled bool)

func (*Property) SetVisible

func (c *Property) SetVisible(visible bool)

func (*Property) String

func (c *Property) String() string

func (*Property) Value

func (c *Property) Value() interface{}

func (*Property) ValueOwn

func (c *Property) ValueOwn() interface{}

func (*Property) ValueStyle

func (c *Property) ValueStyle(subclass string) interface{}

func (*Property) ValueStyleScore

func (c *Property) ValueStyleScore(subclass string) int

func (*Property) Visible

func (c *Property) Visible() bool

type PropertyStruct

type PropertyStruct struct {
	Name  string `json:"name"`
	Type  string `json:"type"`
	Value string `json:"value"`
}

type PropertyType

type PropertyType string
const (
	PropertyTypeBool      PropertyType = "bool"
	PropertyTypeInt       PropertyType = "int"
	PropertyTypeInt32     PropertyType = "int32"
	PropertyTypeColor     PropertyType = "color"
	PropertyTypeDouble    PropertyType = "double"
	PropertyTypeString    PropertyType = "string"
	PropertyTypeMultiline PropertyType = "multiline"
)

type PropertyValue

type PropertyValue struct {
	Source string
	Value  interface{}
	Score  int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL