Implement touch event types/procs in DOM module.
This commit is contained in:
parent
e0bb65e45c
commit
172a9c8e97
1 changed files with 30 additions and 0 deletions
|
|
@ -130,6 +130,16 @@ type
|
||||||
readOnly*: bool
|
readOnly*: bool
|
||||||
options*: seq[OptionElement]
|
options*: seq[OptionElement]
|
||||||
|
|
||||||
|
# https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
|
||||||
|
HtmlElement* = ref object of Element
|
||||||
|
contentEditable*: string
|
||||||
|
isContentEditable*: bool
|
||||||
|
dir*: string
|
||||||
|
offsetHeight*: int
|
||||||
|
offsetWidth*: int
|
||||||
|
offsetLeft*: int
|
||||||
|
offsetTop*: int
|
||||||
|
|
||||||
LinkElement* = ref LinkObj
|
LinkElement* = ref LinkObj
|
||||||
LinkObj {.importc.} = object of ElementObj
|
LinkObj {.importc.} = object of ElementObj
|
||||||
target*: cstring
|
target*: cstring
|
||||||
|
|
@ -270,6 +280,8 @@ type
|
||||||
wordSpacing*: cstring
|
wordSpacing*: cstring
|
||||||
zIndex*: int
|
zIndex*: int
|
||||||
|
|
||||||
|
# TODO: A lot of the fields in Event belong to a more specific type of event.
|
||||||
|
# TODO: Should we clean this up?
|
||||||
Event* = ref EventObj
|
Event* = ref EventObj
|
||||||
EventObj {.importc.} = object of RootObj
|
EventObj {.importc.} = object of RootObj
|
||||||
target*: Node
|
target*: Node
|
||||||
|
|
@ -310,6 +322,20 @@ type
|
||||||
SUBMIT*: int
|
SUBMIT*: int
|
||||||
UNLOAD*: int
|
UNLOAD*: int
|
||||||
|
|
||||||
|
TouchList* {.importc.} = ref object of RootObj
|
||||||
|
length*: int
|
||||||
|
|
||||||
|
TouchEvent* {.importc.} = ref object of Event
|
||||||
|
changedTouches*, targetTouches*, touches*: TouchList
|
||||||
|
|
||||||
|
Touch* {.importc.} = ref object of RootObj
|
||||||
|
identifier*: int
|
||||||
|
screenX*, screenY*, clientX*, clientY*, pageX*, pageY*: int
|
||||||
|
target*: Element
|
||||||
|
radiusX*, radiusY*: int
|
||||||
|
rotationAngle*: int
|
||||||
|
force*: float
|
||||||
|
|
||||||
Location* = ref LocationObj
|
Location* = ref LocationObj
|
||||||
LocationObj {.importc.} = object of RootObj
|
LocationObj {.importc.} = object of RootObj
|
||||||
hash*: cstring
|
hash*: cstring
|
||||||
|
|
@ -488,6 +514,10 @@ proc setAttribute*(s: Style, attr, value: cstring, caseSensitive=false)
|
||||||
# Event "methods"
|
# Event "methods"
|
||||||
proc preventDefault*(ev: Event)
|
proc preventDefault*(ev: Event)
|
||||||
|
|
||||||
|
# TouchEvent "methods"
|
||||||
|
proc identifiedTouch*(list: TouchList): Touch
|
||||||
|
proc item*(list: TouchList, i: int): Touch
|
||||||
|
|
||||||
{.pop.}
|
{.pop.}
|
||||||
|
|
||||||
var
|
var
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue