gui2: more code sharing.
This commit is contained in:
@@ -408,21 +408,12 @@ GuiApp_OnTouch:
|
|||||||
; @clobbers any, !Y
|
; @clobbers any, !Y
|
||||||
|
|
||||||
guiAppSendTimerEvents:
|
guiAppSendTimerEvents:
|
||||||
push yl
|
ldi r16, OBJECT_SIGNAL_TIMER
|
||||||
push yh
|
clr r17
|
||||||
ldd r16, Y+GUIAPP_OFFS_ROOTWINDOW_LO
|
ldi r20, (1<<OBJECT_OPTSLO_TIMER_BIT)
|
||||||
ldd yh, Y+GUIAPP_OFFS_ROOTWINDOW_HI
|
ldi r21, (1<<OBJECT_OPTSLO_TIMER_BIT)
|
||||||
mov yl, r16
|
rcall guiAppSendRootEventsIfOptsLo
|
||||||
or yl, yh
|
sec
|
||||||
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
|
|
||||||
ret
|
ret
|
||||||
; @end
|
; @end
|
||||||
|
|
||||||
@@ -489,26 +480,28 @@ guiAppSendTouchEvents:
|
|||||||
ldd r19, Y+GUIAPP_OFFS_TOUCHWIDGET_HI
|
ldd r19, Y+GUIAPP_OFFS_TOUCHWIDGET_HI
|
||||||
mov r16, r18
|
mov r16, r18
|
||||||
or r16, r19
|
or r16, r19
|
||||||
breq GuiApp_OnTouch_sendToAll
|
breq guiAppSendTouchEvents_sendToAll
|
||||||
mov yl, r18
|
mov yl, r18
|
||||||
mov yh, r19
|
mov yh, r19
|
||||||
ldi r16, WIDGET_SIGNAL_TOUCH
|
ldi r16, WIDGET_SIGNAL_TOUCH
|
||||||
clr r17
|
clr r17
|
||||||
bigcall OBJ_HandleSignal
|
bigcall OBJ_HandleSignal
|
||||||
rjmp GuiApp_OnTouch_done
|
rjmp guiAppSendTouchEvents_done
|
||||||
GuiApp_OnTouch_sendToAll:
|
guiAppSendTouchEvents_sendToAll:
|
||||||
ldd r18, Y+GUIAPP_OFFS_CURRENTWINDOW_LO
|
ldd r18, Y+GUIAPP_OFFS_CURRENTWINDOW_LO
|
||||||
ldd r19, Y+GUIAPP_OFFS_CURRENTWINDOW_HI
|
ldd r19, Y+GUIAPP_OFFS_CURRENTWINDOW_HI
|
||||||
mov r16, r18
|
mov r16, r18
|
||||||
or r16, r19
|
or r16, r19
|
||||||
breq GuiApp_OnTouch_done
|
breq guiAppSendTouchEvents_done
|
||||||
; send touch signal
|
; send touch signal
|
||||||
|
mov yl, r18
|
||||||
|
mov yh, r19
|
||||||
ldi r16, WIDGET_SIGNAL_TOUCH
|
ldi r16, WIDGET_SIGNAL_TOUCH
|
||||||
clr r17
|
clr r17
|
||||||
ldi r20, (1<<WIDGET_OPTSLO_INPUT_BIT)
|
ldi r20, (1<<WIDGET_OPTSLO_INPUT_BIT)
|
||||||
ldi r21, (1<<WIDGET_OPTSLO_INPUT_BIT)
|
ldi r21, (1<<WIDGET_OPTSLO_INPUT_BIT)
|
||||||
bigcall OBJ_TreeHandleSignalIfMatchingOptsLo
|
bigcall OBJ_TreeHandleSignalIfMatchingOptsLo
|
||||||
GuiApp_OnTouch_done:
|
guiAppSendTouchEvents_done:
|
||||||
pop yh
|
pop yh
|
||||||
pop yl
|
pop yl
|
||||||
; send keepAlive to screensaver
|
; 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
|
; @routine guiAppCheckTouch
|
||||||
;
|
;
|
||||||
|
|||||||
Reference in New Issue
Block a user