MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / PiuApplicationTouchBegan

Function PiuApplicationTouchBegan

modules/piu/All/piuApplication.c:318–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316}
317
318void PiuApplicationTouchBegan(PiuApplication* self, xsIntegerValue index, PiuCoordinate x, PiuCoordinate y, xsNumberValue ticks)
319{
320 if (index < (*self)->touchLinkCount) {
321 PiuFlags touchFlag = 1 << index;
322 PiuTouchLink* link;
323 PiuContent* content;
324 link = (*self)->touchLinks[index];
325 (*link)->content = content = (*(*self)->dispatch->hit)(self, x, y);
326 if (content) {
327 if (((*content)->touches == 0) || ((*content)->flags & piuMultipleTouch))
328 (*content)->touches |= touchFlag;
329 content = (PiuContent*)((*content)->container);
330 while (content) {
331 if (((*content)->flags & piuActive) && ((*content)->flags & piuBackgroundTouch)) {
332 if (((*content)->touches == 0) || ((*content)->flags & piuMultipleTouch))
333 (*content)->touches |= touchFlag;
334 }
335 content = (PiuContent*)((*content)->container);
336 }
337 }
338 link = (*self)->touchLinks[index];
339 content = (*link)->content;
340 if (content) {
341 PiuTouchLinkAppendSample(link, x, y, ticks);
342 while (content) {
343 if ((*content)->touches & touchFlag)
344 PiuBehaviorOnTouchBegan(content, index, x, y, ticks, link);
345 content = (PiuContent*)((*content)->container);
346 }
347 }
348 }
349 PiuViewReschedule((*self)->view);
350}
351
352void PiuApplicationTouchEnded(PiuApplication* self, xsIntegerValue index, PiuCoordinate x, PiuCoordinate y, xsNumberValue ticks)
353{

Callers 4

PiuView_onTouchBeganFunction · 0.85
PiuView_onTouchBeganFunction · 0.85
PiuWindowProcFunction · 0.85

Calls 2

PiuTouchLinkAppendSampleFunction · 0.85
PiuViewRescheduleFunction · 0.50

Tested by

no test coverage detected