gui2: create root window
This commit is contained in:
@@ -88,9 +88,27 @@ GuiApp_Init:
|
||||
ldi r16, HIGH(GuiApp_DefaultSignalmap*2)
|
||||
std Y+OBJECT_OFFS_SIGNALMAP_HI, r16
|
||||
|
||||
; create root window
|
||||
push yl
|
||||
push yh
|
||||
mov xl, yl
|
||||
mov xh, yh
|
||||
ldi r16, 0 ; opts_lo
|
||||
ldi r17, 0 ; opts_hi
|
||||
bigcall RootWindow_new
|
||||
mov xl, yl
|
||||
mov xh, yh
|
||||
pop yh
|
||||
pop yl
|
||||
brcc GuiApp_Init_ret
|
||||
|
||||
std Y+GUIAPP_OFFS_ROOTWINDOW_LO, xl
|
||||
std Y+GUIAPP_OFFS_ROOTWINDOW_HI, xh
|
||||
|
||||
ldi r16, GUIAPP_DRAWTIMER
|
||||
std Y+GUIAPP_OFFS_DRAWTIMER, r16
|
||||
|
||||
|
||||
GuiApp_Init_ret:
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
@@ -35,12 +35,13 @@
|
||||
; @return Y address of newly created object
|
||||
; @param r16 value for OBJECT_OFFS_OPTS_LO
|
||||
; @param r17 value for OBJECT_OFFS_OPTS_HI
|
||||
; @param X pointer to GUIAPP
|
||||
; @clobbers any
|
||||
|
||||
RootWindow_new:
|
||||
ldi r24, LOW(ROOTWINDOW_SIZE)
|
||||
ldi r25, HIGH(ROOTWINDOW_SIZE)
|
||||
bigcall Object_Alloc ; (!r16, !r17)
|
||||
bigcall Object_Alloc ; (!r16, !r17, !X)
|
||||
brcc RootWindow_new_ret
|
||||
rcall RootWindow_Init ; (r16, r17, X)
|
||||
sec
|
||||
@@ -57,20 +58,30 @@ RootWindow_new_ret:
|
||||
; @param Y address of widget
|
||||
; @param r16 value for OBJECT_OFFS_OPTS_LO
|
||||
; @param r17 value for OBJECT_OFFS_OPTS_HI
|
||||
; @param X pointer to GUIAPP
|
||||
; @clobbers r16, r17, X
|
||||
|
||||
RootWindow_Init:
|
||||
; call base class
|
||||
bigcall MainWindow_Init ; (r16, r17, X)
|
||||
push xl
|
||||
push xh
|
||||
clr xl
|
||||
clr xh
|
||||
; call base class
|
||||
bigcall Widget_Init ; (r16, r17, X)
|
||||
|
||||
; clear widget-specific data
|
||||
mov xl, yl
|
||||
mov xh, yh
|
||||
adiw xh:xl, ROOTWINDOW_OFFS_BEGIN
|
||||
clr r16
|
||||
ldi r17, (ROOTWINDOW_SIZE-ROOTWINDOW_OFFS_BEGIN)
|
||||
bigcall Utils_FillSram ; (r17, X)
|
||||
; clear widget-specific data
|
||||
mov xl, yl
|
||||
mov xh, yh
|
||||
adiw xh:xl, ROOTWINDOW_OFFS_BEGIN
|
||||
clr r16
|
||||
ldi r17, (ROOTWINDOW_SIZE-ROOTWINDOW_OFFS_BEGIN)
|
||||
bigcall Utils_FillSram ; (r17, X)
|
||||
pop xh
|
||||
pop xl
|
||||
|
||||
std Y+ROOTWINDOW_OFFS_GUIAPP_LO, xl
|
||||
std Y+ROOTWINDOW_OFFS_GUIAPP_HI, xh
|
||||
|
||||
; set pos and size of widget to display size
|
||||
clr r16
|
||||
std Y+WIDGET_OFFS_X_LO, r16
|
||||
@@ -118,21 +129,6 @@ RootWindow_GetApp:
|
||||
|
||||
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; @routine RootWindow_SetApp @global
|
||||
;
|
||||
; @param Y address of widget
|
||||
; @return R25:R24 address pointer to GuiApp
|
||||
; @clobbers none
|
||||
|
||||
RootWindow_SetApp:
|
||||
std Y+ROOTWINDOW_OFFS_GUIAPP_LO, r24
|
||||
std Y+ROOTWINDOW_OFFS_GUIAPP_HI, r25
|
||||
ret
|
||||
; @end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; ***************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user