gui2: more code sharing.
This commit is contained in:
@@ -408,21 +408,12 @@ GuiApp_OnTouch:
|
||||
; @clobbers any, !Y
|
||||
|
||||
guiAppSendTimerEvents:
|
||||
push yl
|
||||
push yh
|
||||
ldd r16, Y+GUIAPP_OFFS_ROOTWINDOW_LO
|
||||
ldd yh, Y+GUIAPP_OFFS_ROOTWINDOW_HI
|
||||
mov yl, r16
|
||||
or yl, yh
|
||||
breq guiAppSendTimerEvents_done
|
||||
ldi r16, OBJECT_SIGNAL_TIMER
|
||||
clr r17
|
||||
ldi r20, OBJECT_OPTSLO_TIMER_BIT
|
||||
mov r21, r20
|
||||
bigcall OBJ_TreeHandleSignalIfMatchingOptsLo
|
||||
guiAppSendTimerEvents_done:
|
||||
pop yh
|
||||
pop yl
|
||||
ldi r20, (1<<OBJECT_OPTSLO_TIMER_BIT)
|
||||
ldi r21, (1<<OBJECT_OPTSLO_TIMER_BIT)
|
||||
rcall guiAppSendRootEventsIfOptsLo
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
@@ -489,26 +480,28 @@ guiAppSendTouchEvents:
|
||||
ldd r19, Y+GUIAPP_OFFS_TOUCHWIDGET_HI
|
||||
mov r16, r18
|
||||
or r16, r19
|
||||
breq GuiApp_OnTouch_sendToAll
|
||||
breq guiAppSendTouchEvents_sendToAll
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
ldi r16, WIDGET_SIGNAL_TOUCH
|
||||
clr r17
|
||||
bigcall OBJ_HandleSignal
|
||||
rjmp GuiApp_OnTouch_done
|
||||
GuiApp_OnTouch_sendToAll:
|
||||
rjmp guiAppSendTouchEvents_done
|
||||
guiAppSendTouchEvents_sendToAll:
|
||||
ldd r18, Y+GUIAPP_OFFS_CURRENTWINDOW_LO
|
||||
ldd r19, Y+GUIAPP_OFFS_CURRENTWINDOW_HI
|
||||
mov r16, r18
|
||||
or r16, r19
|
||||
breq GuiApp_OnTouch_done
|
||||
breq guiAppSendTouchEvents_done
|
||||
; send touch signal
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
ldi r16, WIDGET_SIGNAL_TOUCH
|
||||
clr r17
|
||||
ldi r20, (1<<WIDGET_OPTSLO_INPUT_BIT)
|
||||
ldi r21, (1<<WIDGET_OPTSLO_INPUT_BIT)
|
||||
bigcall OBJ_TreeHandleSignalIfMatchingOptsLo
|
||||
GuiApp_OnTouch_done:
|
||||
guiAppSendTouchEvents_done:
|
||||
pop yh
|
||||
pop yl
|
||||
; send keepAlive to screensaver
|
||||
@@ -519,6 +512,61 @@ GuiApp_OnTouch_done:
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine guiAppSendRootMsgEvents
|
||||
;
|
||||
; Send touch events to root window.
|
||||
;
|
||||
; @param Y ptr to GUIAPP
|
||||
; @param X pointer to message received in SDRAM
|
||||
; @clobbers any, !Y
|
||||
|
||||
guiAppSendRootMsgEvents:
|
||||
ldi r16, WIDGET_SIGNAL_TOUCH
|
||||
clr r17
|
||||
ldi r20, (1<<OBJECT_OPTSLO_MSGRECV_BIT)
|
||||
ldi r21, (1<<OBJECT_OPTSLO_MSGRECV_BIT)
|
||||
rcall guiAppSendRootEventsIfOptsLo
|
||||
sec
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine guiAppSendRootEventsIfOptsLo
|
||||
;
|
||||
; Send events to all widgets with matching OPTS_LO.
|
||||
;
|
||||
; @param Y ptr to GUIAPP
|
||||
; @param R16 signal number
|
||||
; @param R17 selector
|
||||
; @param xl param1
|
||||
; @param xh param2
|
||||
; @param r20 mask for OBJECT_OFFS_OPTS_LO
|
||||
; @param r21 value for OBJECT_OFFS_OPTS_LO to match
|
||||
; @clobbers any, !Y
|
||||
|
||||
guiAppSendRootEventsIfOptsLo:
|
||||
push yl
|
||||
push yh
|
||||
ldd r18, Y+GUIAPP_OFFS_ROOTWINDOW_LO
|
||||
ldd r19, Y+GUIAPP_OFFS_ROOTWINDOW_HI
|
||||
mov r22, r18
|
||||
or r22, r21
|
||||
breq guiAppSendRootEventsIfOptsLo_done
|
||||
; send touch signal
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
bigcall OBJ_TreeHandleSignalIfMatchingOptsLo
|
||||
guiAppSendRootEventsIfOptsLo_done:
|
||||
pop yh
|
||||
pop yl
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine guiAppCheckTouch
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user