src/sigui/properties

Source   Edit  

Types

AnyProperty[T] = concept avar v
    a[] is T
    v[] = T
    a.changed is Event[void]
    `{}`(a) is T
    `{}=`(v, T)
Source   Edit  
CustomProperty[T] = object
  get*: proc (): T
  set*: proc (v: T)
  changed*: Event[void]
Source   Edit  
Property[T] = object
  unsafeVal*: T
  changed*: Event[void]
Source   Edit  

Procs

proc `=copy`[T](p: var CustomProperty[T]; v: CustomProperty[T]) {.error.}
Source   Edit  
proc `=copy`[T](p: var Property[T]; v: Property[T]) {.error.}
Source   Edit  
proc `[]`[T](p: CustomProperty[T]): T {.inline.}
Source   Edit  
proc `[]`[T](p: Property[T]): T {.inline.}
Source   Edit  
proc `[]=`[T](p: CustomProperty[T]; v: T) {.inline.}
Source   Edit  
proc `[]=`[T](p: var Property[T]; v: T) {.inline.}
Source   Edit  
proc property[T](v: T): Property[T]
Source   Edit  
proc unsafeVal[T](p: CustomProperty[T]): T {.inline.}
note: can't get var T due to nature of CustomProperty Source   Edit  
proc unsafeVal=[T](p: CustomProperty[T]; v: T) {.inline.}
same as val=, but always call setter and does not emit p.changed Source   Edit  
proc val[T](p: CustomProperty[T]): T {.inline.}
Source   Edit  
proc val[T](p: Property[T]): T {.inline.}
Source   Edit  
proc val=[T](p: CustomProperty[T]; v: T)
note: p.changed will not be emitted if new value is same as previous value Source   Edit  
proc val=[T](p: var Property[T]; v: T)
note: p.changed will not be emitted if new value is same as previous value Source   Edit  
proc `{}`[T](p: CustomProperty[T]): T {.inline.}
Source   Edit  
proc `{}`[T](p: var Property[T]): var T {.inline.}
Source   Edit  
proc `{}=`[T](p: CustomProperty[T]; v: T) {.inline.}
Source   Edit  
proc `{}=`[T](p: var Property[T]; v: T) {.inline.}
same as []=, but does not emit p.changed Source   Edit  

Converters

converter toValue[T](p: CustomProperty[T]): T
? should this converter be removed? Source   Edit  
converter toValue[T](p: Property[T]): T
? should this converter be removed? Source   Edit