gui2: basic start works!
This commit is contained in:
@@ -106,6 +106,12 @@ GuiApp_Init:
|
||||
ldi r16, 0 ; opts_lo
|
||||
ldi r17, 0 ; opts_hi
|
||||
bigcall RootWindow_new
|
||||
|
||||
; always visible
|
||||
ldd r16, Y+OBJECT_OFFS_FLAGS
|
||||
sbr r16, (1<<WIDGET_FLAGS_VISIBLE_BIT)
|
||||
std Y+OBJECT_OFFS_FLAGS, r16
|
||||
|
||||
mov xl, yl
|
||||
mov xh, yh
|
||||
pop yh
|
||||
@@ -115,6 +121,10 @@ GuiApp_Init:
|
||||
std Y+GUIAPP_OFFS_ROOTWINDOW_LO, xl
|
||||
std Y+GUIAPP_OFFS_ROOTWINDOW_HI, xh
|
||||
|
||||
; debug
|
||||
std Y+GUIAPP_OFFS_CURRENTWINDOW_LO, xl
|
||||
std Y+GUIAPP_OFFS_CURRENTWINDOW_HI, xh
|
||||
|
||||
ldi r16, GUIAPP_GUITIMER
|
||||
std Y+GUIAPP_OFFS_GUITIMER, r16
|
||||
|
||||
@@ -235,6 +245,7 @@ GuiApp_UngrabTouchEvents_ret:
|
||||
;
|
||||
; @param Y address of object in SDRAM
|
||||
; @param CFLAG set if response is not a NULL pointer
|
||||
; @clobbers none
|
||||
|
||||
GuiApp_GetRootWindow:
|
||||
ldd r18, Y+GUIAPP_OFFS_ROOTWINDOW_LO
|
||||
@@ -430,11 +441,8 @@ guiAppSendTimerEvents:
|
||||
guiAppCheckSendGuiEvents:
|
||||
push yl
|
||||
push yh
|
||||
ldd r16, Y+GUIAPP_OFFS_CURRENTWINDOW_LO
|
||||
ldd yh, Y+GUIAPP_OFFS_CURRENTWINDOW_HI
|
||||
mov yl, r16
|
||||
or yl, yh
|
||||
breq guiAppCheckSendGuiEvents_done
|
||||
rcall GuiApp_GetCurrentWindow
|
||||
brcc guiAppCheckSendGuiEvents_done
|
||||
|
||||
ldd r16, Y+GUIAPP_OFFS_GUITIMER
|
||||
tst r16
|
||||
@@ -444,19 +452,23 @@ guiAppCheckSendGuiEvents:
|
||||
brne guiAppCheckSendGuiEvents_done
|
||||
|
||||
; timer elapsed, send layout events, draw events
|
||||
ldi r16, WIDGET_SIGNAL_LAYOUT
|
||||
clr r17
|
||||
ldi r20, (1<<WIDGET_FLAGS_VISIBLE_BIT) | (1<<WIDGET_FLAGS_LAYOUT_BIT)
|
||||
bigcall OBJ_TreeHandleSignalIfFlagsSet ; (any, !Y)
|
||||
|
||||
ldi r16, WIDGET_SIGNAL_DRAW
|
||||
clr r17
|
||||
ldi r20, (1<<WIDGET_FLAGS_VISIBLE_BIT) | (1<<WIDGET_FLAGS_DIRTY_BIT)
|
||||
bigcall OBJ_TreeHandleSignalIfFlagsSet ; (any, !Y)
|
||||
|
||||
push yl
|
||||
push yh
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
ldi r16, WIDGET_SIGNAL_LAYOUT
|
||||
clr r17
|
||||
ldi r20, (1<<WIDGET_FLAGS_VISIBLE_BIT) | (1<<WIDGET_FLAGS_LAYOUT_BIT)
|
||||
bigcall OBJ_TreeHandleSignalIfFlagsSet ; (any, !Y)
|
||||
|
||||
ldi r16, WIDGET_SIGNAL_DRAW
|
||||
clr r17
|
||||
ldi r20, (1<<WIDGET_FLAGS_VISIBLE_BIT) | (1<<WIDGET_FLAGS_DIRTY_BIT)
|
||||
bigcall OBJ_TreeHandleSignalIfFlagsSet ; (any, !Y)
|
||||
pop yh
|
||||
pop yl
|
||||
ldi r16, GUIAPP_GUITIMER
|
||||
std Y+GUIAPP_OFFS_GUITIMER, r16
|
||||
|
||||
guiAppCheckSendGuiEvents_done:
|
||||
pop yh
|
||||
pop yl
|
||||
@@ -488,11 +500,8 @@ guiAppSendTouchEvents:
|
||||
bigcall OBJ_HandleSignal
|
||||
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 guiAppSendTouchEvents_done
|
||||
rcall GuiApp_GetCurrentWindow ; r19:r18=current window (none)
|
||||
brcc guiAppSendTouchEvents_done
|
||||
; send touch signal
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
@@ -550,12 +559,9 @@ guiAppSendRootMsgEvents:
|
||||
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
|
||||
rcall GuiApp_GetRootWindow ; r19:r18=root window (none)
|
||||
brcc guiAppSendRootEventsIfOptsLo_done
|
||||
; send signal to root window and all below
|
||||
mov yl, r18
|
||||
mov yh, r19
|
||||
bigcall OBJ_TreeHandleSignalIfMatchingOptsLo
|
||||
@@ -605,6 +611,7 @@ GuiApp_DefaultSignalmap:
|
||||
; header
|
||||
.dw Object_DefaultSignalmap ; next table to use
|
||||
; entries
|
||||
.db 0, OBJECT_SIGNAL_TIMER, LOW(GuiApp_OnTimer), HIGH(GuiApp_OnTimer)
|
||||
.db 0, OBJECT_SIGNAL_DESTROY, LOW(GuiApp_OnDestroy), HIGH(GuiApp_OnDestroy)
|
||||
.db 0, 0, 0, 0 ; end of table
|
||||
|
||||
|
||||
Reference in New Issue
Block a user