gui2: more work on preparing code sharing for all layout modules.
This commit is contained in:
@@ -97,27 +97,15 @@ HLayout2_Init:
|
|||||||
; @clobbers any, !Y
|
; @clobbers any, !Y
|
||||||
|
|
||||||
HLayout2_OnLayout:
|
HLayout2_OnLayout:
|
||||||
; create layout context
|
; create and preset context
|
||||||
bigcall OBJ_CountDirectChildren ; r16=num of children (r18, r19)
|
rcall LayoutCtx_CreateContextFor1D
|
||||||
tst r16
|
|
||||||
breq HLayout2_OnLayout_ret
|
|
||||||
push r16
|
|
||||||
bigcall LayoutCtx_new ; X=new ctx (r16, r17, r18, r19, r24, r25)
|
|
||||||
pop r16
|
|
||||||
brcc HLayout2_OnLayout_ret
|
brcc HLayout2_OnLayout_ret
|
||||||
; set borders and spacing in layout context
|
|
||||||
bigcall Widget_GetBorderAndSpacing ; (none)
|
|
||||||
adiw xh:xl, LAYOUT_CTX_OFFS_BORDERS
|
|
||||||
st X+, r23 ; store border
|
|
||||||
st X, r22 ; store spacing
|
|
||||||
sbiw xh:xl, (LAYOUT_CTX_OFFS_BORDERS+1)
|
|
||||||
; do layout
|
; do layout
|
||||||
mov r25, r16
|
mov r25, r16
|
||||||
rcall hLayout2Horizontally
|
rcall hLayout2Horizontally
|
||||||
rcall hLayout2Vertically
|
rcall hLayout2Vertically
|
||||||
; release layout context
|
; release layout context
|
||||||
bigcall LayoutCtx_free
|
bigcall LayoutCtx_free
|
||||||
|
|
||||||
; force re-drawing of this widget, clear layout bit
|
; force re-drawing of this widget, clear layout bit
|
||||||
ldd r16, Y+OBJECT_OFFS_FLAGS
|
ldd r16, Y+OBJECT_OFFS_FLAGS
|
||||||
sbr r16, (1<<WIDGET_FLAGS_DIRTY_BIT)
|
sbr r16, (1<<WIDGET_FLAGS_DIRTY_BIT)
|
||||||
@@ -173,19 +161,61 @@ HLayout2_OnGetDefaultWidth:
|
|||||||
; @clobbers any, !X, !Y
|
; @clobbers any, !X, !Y
|
||||||
|
|
||||||
hLayout2Vertically:
|
hLayout2Vertically:
|
||||||
|
rcall hLayout2PrepareVertical ; (any, !R25, !X, !Y)
|
||||||
|
rcall hLayout2ReadLayoutWriteVertical ; (r16-r24)
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine hLayout2PrepareVertical
|
||||||
|
;
|
||||||
|
; @param Y pointer to widget
|
||||||
|
; @param X layout context
|
||||||
|
; @param r25 number of children
|
||||||
|
; @clobbers any, !R25, !X, !Y,
|
||||||
|
|
||||||
|
hLayout2PrepareVertical:
|
||||||
|
push xl
|
||||||
|
push xh
|
||||||
|
push yl
|
||||||
|
push yh
|
||||||
|
push r25
|
||||||
|
rcall Layout2_SetDefaultHeights
|
||||||
|
pop r25
|
||||||
|
pop yh
|
||||||
|
pop yl
|
||||||
|
pop xh
|
||||||
|
pop xl
|
||||||
|
|
||||||
ldd r20, Y+WIDGET_OFFS_HEIGHT_LO
|
ldd r20, Y+WIDGET_OFFS_HEIGHT_LO
|
||||||
ldd r21, Y+WIDGET_OFFS_HEIGHT_HI
|
ldd r21, Y+WIDGET_OFFS_HEIGHT_HI
|
||||||
adiw xh:xl, LAYOUT_CTX_OFFS_TOTALSIZE_LO
|
adiw xh:xl, LAYOUT_CTX_OFFS_TOTALSIZE_LO
|
||||||
st X+, r20
|
st X+, r20
|
||||||
st X, r21
|
st X, r21
|
||||||
sbiw xh:xl, (LAYOUT_CTX_OFFS_TOTALSIZE_LO+1)
|
sbiw xh:xl, (LAYOUT_CTX_OFFS_TOTALSIZE_LO+1)
|
||||||
; layout
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine hLayout2ReadLayoutWriteHorizontal
|
||||||
|
;
|
||||||
|
; @param Y pointer to widget
|
||||||
|
; @param X layout context
|
||||||
|
; @param r25 number of children
|
||||||
|
; @clobbers r16-r24
|
||||||
|
|
||||||
|
hLayout2ReadLayoutWriteVertical:
|
||||||
push yl
|
push yl
|
||||||
push yh
|
push yh
|
||||||
push r24
|
push r24
|
||||||
bigcall OBJ_GetFirstChild
|
bigcall OBJ_GetFirstChild
|
||||||
mov yl, r18
|
mov yl, r18
|
||||||
mov yh, r19
|
mov yh, r19
|
||||||
|
|
||||||
; read positions and flags into new layout context
|
; read positions and flags into new layout context
|
||||||
push r25
|
push r25
|
||||||
push yl
|
push yl
|
||||||
@@ -194,21 +224,24 @@ hLayout2Vertically:
|
|||||||
pop yh
|
pop yh
|
||||||
pop yl
|
pop yl
|
||||||
pop r25
|
pop r25
|
||||||
; get default heights
|
|
||||||
push r25
|
|
||||||
push yl
|
|
||||||
push yh
|
|
||||||
bigcall LayoutCtx_SetDefaultHeightContiguous
|
|
||||||
pop yh
|
|
||||||
pop yl
|
|
||||||
pop r25
|
|
||||||
pop r24
|
pop r24
|
||||||
|
|
||||||
; layout
|
; layout
|
||||||
bigcall LayoutCtx_GetMaxDefaultSize ; r19:r18=max default size (r18, r19, r20, r21, r24)
|
bigcall LayoutCtx_GetMaxSize ; r19:r18=max default size (r18, r19, r20, r21, r24)
|
||||||
bigcall LayoutCtx_SetFixedSize ; (r24)
|
bigcall LayoutCtx_SetFixedSize ; (r24)
|
||||||
push r25
|
push r25
|
||||||
bigcall LayoutCtxSetPos ; (r16-r25)
|
bigcall LayoutCtxSetPos ; (r16-r25)
|
||||||
pop r25
|
pop r25
|
||||||
|
|
||||||
|
; pack
|
||||||
|
push r25
|
||||||
|
push yl
|
||||||
|
push yh
|
||||||
|
bigcall LayoutCtx_PackYContiguous
|
||||||
|
pop yh
|
||||||
|
pop yl
|
||||||
|
pop r25
|
||||||
|
|
||||||
; write back dims
|
; write back dims
|
||||||
push r25
|
push r25
|
||||||
push yl
|
push yl
|
||||||
@@ -224,6 +257,9 @@ hLayout2Vertically:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine hLayout2Horizontally
|
; @routine hLayout2Horizontally
|
||||||
;
|
;
|
||||||
@@ -233,6 +269,36 @@ hLayout2Vertically:
|
|||||||
; @clobbers any, !Y
|
; @clobbers any, !Y
|
||||||
|
|
||||||
hLayout2Horizontally:
|
hLayout2Horizontally:
|
||||||
|
rcall hLayout2PrepareHorizontal ; (any, !R25, !X, !Y)
|
||||||
|
rcall hLayout2ReadLayoutWriteHorizontal ; (r16-r24)
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine hLayout2PrepareHorizontal
|
||||||
|
;
|
||||||
|
; @param Y pointer to widget
|
||||||
|
; @param X layout context
|
||||||
|
; @param r25 number of children
|
||||||
|
; @clobbers any, !R25, !X, !Y,
|
||||||
|
|
||||||
|
hLayout2PrepareHorizontal:
|
||||||
|
push xl
|
||||||
|
push xh
|
||||||
|
push yl
|
||||||
|
push yh
|
||||||
|
push r25
|
||||||
|
rcall Layout2_SetDefaultWidths ; (any, !Y)
|
||||||
|
pop r25
|
||||||
|
pop yh
|
||||||
|
pop yl
|
||||||
|
pop xh
|
||||||
|
pop xl
|
||||||
|
|
||||||
; setup layout context for horizontal operations
|
; setup layout context for horizontal operations
|
||||||
ldd r20, Y+WIDGET_OFFS_WIDTH_LO
|
ldd r20, Y+WIDGET_OFFS_WIDTH_LO
|
||||||
ldd r21, Y+WIDGET_OFFS_WIDTH_HI
|
ldd r21, Y+WIDGET_OFFS_WIDTH_HI
|
||||||
@@ -240,27 +306,33 @@ hLayout2Horizontally:
|
|||||||
st X+, r20
|
st X+, r20
|
||||||
st X, r21
|
st X, r21
|
||||||
sbiw xh:xl, (LAYOUT_CTX_OFFS_TOTALSIZE_LO+1)
|
sbiw xh:xl, (LAYOUT_CTX_OFFS_TOTALSIZE_LO+1)
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine hLayout2ReadLayoutWriteHorizontal
|
||||||
|
;
|
||||||
|
; @param Y pointer to widget
|
||||||
|
; @param X layout context
|
||||||
|
; @param r25 number of children
|
||||||
|
; @clobbers r16-r24
|
||||||
|
|
||||||
|
hLayout2ReadLayoutWriteHorizontal:
|
||||||
; layout
|
; layout
|
||||||
ldd r24, Y+HLAYOUT2_OFFS_MODE
|
ldd r24, Y+HLAYOUT2_OFFS_MODE
|
||||||
push yl
|
push yl
|
||||||
push yh
|
push yh
|
||||||
push r24
|
push r24
|
||||||
bigcall OBJ_GetFirstChild
|
bigcall OBJ_GetFirstChild ; (none)
|
||||||
mov yl, r18
|
mov yl, r18
|
||||||
mov yh, r19
|
mov yh, r19
|
||||||
; read X positions and flags into new layout context
|
; read X positions and flags into new layout context
|
||||||
push r25
|
push r25
|
||||||
push yl
|
push yl
|
||||||
push yh
|
push yh
|
||||||
bigcall LayoutCtx_ReadXDimsContiguous
|
bigcall LayoutCtx_ReadXDimsContiguous ; (r16, r18, r19, r24, Y)
|
||||||
pop yh
|
|
||||||
pop yl
|
|
||||||
pop r25
|
|
||||||
; get default widths
|
|
||||||
push r25
|
|
||||||
push yl
|
|
||||||
push yh
|
|
||||||
bigcall LayoutCtx_SetDefaultWidthContiguous
|
|
||||||
pop yh
|
pop yh
|
||||||
pop yl
|
pop yl
|
||||||
pop r25
|
pop r25
|
||||||
@@ -268,21 +340,31 @@ hLayout2Horizontally:
|
|||||||
; layout
|
; layout
|
||||||
push r25
|
push r25
|
||||||
cpi r24, HLAYOUT_MODE_SPREAD
|
cpi r24, HLAYOUT_MODE_SPREAD
|
||||||
breq hLayout2Horizontally_spread
|
breq hLayout2ReadLayoutWriteHorizontal_spread
|
||||||
bigcall LayoutCtx_LayoutExpand ; (r16-r25)
|
bigcall LayoutCtx_LayoutExpand ; (r16-r25)
|
||||||
rjmp hLayout2Horizontally_writeBack
|
rjmp hLayout2ReadLayoutWriteHorizontal_pack
|
||||||
hLayout2Horizontally_spread:
|
hLayout2ReadLayoutWriteHorizontal_spread:
|
||||||
bigcall LayoutCtx_LayoutSpread ; (r16-r25)
|
bigcall LayoutCtx_LayoutSpread ; (r16-r25)
|
||||||
hLayout2Horizontally_writeBack:
|
hLayout2ReadLayoutWriteHorizontal_pack:
|
||||||
pop r25
|
pop r25
|
||||||
|
; pack
|
||||||
|
push r25
|
||||||
|
push yl
|
||||||
|
push yh
|
||||||
|
bigcall LayoutCtx_PackXContiguous ; (r16-r21, r24, r25, Y)
|
||||||
|
pop yh
|
||||||
|
pop yl
|
||||||
|
pop r25
|
||||||
|
|
||||||
; write back dims
|
; write back dims
|
||||||
push r25
|
push r25
|
||||||
push yl
|
push yl
|
||||||
push yh
|
push yh
|
||||||
bigcall LayoutCtx_WriteXDimsContiguous
|
bigcall LayoutCtx_WriteXDimsContiguous ; (r16, r18, r19, r24, Y)
|
||||||
pop yh
|
pop yh
|
||||||
pop yl
|
pop yl
|
||||||
pop r25
|
pop r25
|
||||||
|
|
||||||
pop yh
|
pop yh
|
||||||
pop yl
|
pop yl
|
||||||
ret
|
ret
|
||||||
@@ -294,6 +376,7 @@ hLayout2Horizontally_writeBack:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ***************************************************************************
|
; ***************************************************************************
|
||||||
; data in FLASH
|
; data in FLASH
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,8 @@
|
|||||||
.equ LAYOUT_CTX_ITEM_OFFS_POS_HI = 1
|
.equ LAYOUT_CTX_ITEM_OFFS_POS_HI = 1
|
||||||
.equ LAYOUT_CTX_ITEM_OFFS_SIZE_LO = 2
|
.equ LAYOUT_CTX_ITEM_OFFS_SIZE_LO = 2
|
||||||
.equ LAYOUT_CTX_ITEM_OFFS_SIZE_HI = 3
|
.equ LAYOUT_CTX_ITEM_OFFS_SIZE_HI = 3
|
||||||
.equ LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_LO = 4
|
.equ LAYOUT_CTX_ITEM_OFFS_FLAGS = 4
|
||||||
.equ LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_HI = 5
|
.equ LAYOUT_CTX_ITEM_SIZE = 5 ; CAVEAT: change code in LayoutCtx_new if size changed!
|
||||||
.equ LAYOUT_CTX_ITEM_OFFS_FLAGS = 6
|
|
||||||
.equ LAYOUT_CTX_ITEM_SIZE = 7 ; CAVEAT: change code in LayoutCtx_new if size changed!
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -82,12 +80,10 @@ LayoutCtx_new:
|
|||||||
mov r25, r17
|
mov r25, r17
|
||||||
lsl r24 ; x2
|
lsl r24 ; x2
|
||||||
rol r25
|
rol r25
|
||||||
add r24, r16
|
lsl r24 ; x4
|
||||||
adc r25, r17 ; x3
|
|
||||||
lsl r24 ; x6
|
|
||||||
rol r25
|
rol r25
|
||||||
add r24, r16
|
add r24, r16
|
||||||
adc r25, r17 ; x7
|
adc r25, r17 ; x5
|
||||||
ldi r16, LOW(LAYOUT_CTX_OFFS_ITEMS)
|
ldi r16, LOW(LAYOUT_CTX_OFFS_ITEMS)
|
||||||
ldi r17, HIGH(LAYOUT_CTX_OFFS_ITEMS)
|
ldi r17, HIGH(LAYOUT_CTX_OFFS_ITEMS)
|
||||||
add r24, r16
|
add r24, r16
|
||||||
@@ -132,6 +128,37 @@ LayoutCtx_free:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine LayoutCtx_CreateContextFor1D @global
|
||||||
|
;
|
||||||
|
; @param Y pointer to widget
|
||||||
|
; @return CFLAG set if context created, cleared on error
|
||||||
|
; @return X pointer to newly created context
|
||||||
|
; @clobbers any, !Y
|
||||||
|
|
||||||
|
LayoutCtx_CreateContextFor1D:
|
||||||
|
; create layout context
|
||||||
|
bigcall OBJ_CountDirectChildren ; r16=num of children (r18, r19)
|
||||||
|
tst r16
|
||||||
|
clc
|
||||||
|
breq LayoutCtx_CreateContextFor1D_ret
|
||||||
|
push r16
|
||||||
|
bigcall LayoutCtx_new ; X=new ctx (r16, r17, r18, r19, r24, r25)
|
||||||
|
pop r16
|
||||||
|
brcc LayoutCtx_CreateContextFor1D_ret
|
||||||
|
; set borders and spacing in layout context
|
||||||
|
bigcall Widget_GetBorderAndSpacing ; (none)
|
||||||
|
adiw xh:xl, LAYOUT_CTX_OFFS_BORDERS
|
||||||
|
st X+, r23 ; store border
|
||||||
|
st X, r22 ; store spacing
|
||||||
|
sbiw xh:xl, (LAYOUT_CTX_OFFS_BORDERS+1)
|
||||||
|
sec
|
||||||
|
LayoutCtx_CreateContextFor1D_ret:
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine LayoutCtx_LayoutExpand
|
; @routine LayoutCtx_LayoutExpand
|
||||||
;
|
;
|
||||||
@@ -167,31 +194,32 @@ LayoutCtx_LayoutSpread:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine LayoutCtx_GetMaxDefaultSize
|
; @routine LayoutCtx_GetMaxSize
|
||||||
;
|
;
|
||||||
; @param X pointer to ctx
|
; @param X pointer to ctx
|
||||||
; @return r19:r18 maximum default size
|
; @return r19:r18 maximum default size
|
||||||
; @clobbers r18, r19, r20, r21, r24
|
; @clobbers r18, r19, r20, r21, r24
|
||||||
|
|
||||||
LayoutCtx_GetMaxDefaultSize:
|
LayoutCtx_GetMaxSize:
|
||||||
push xl
|
push xl
|
||||||
push xh
|
push xh
|
||||||
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
|
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
|
||||||
ld r24, X+ ; X now points to first item
|
ld r24, X+ ; X now points to first item
|
||||||
clr r18
|
clr r18
|
||||||
clr r19
|
clr r19
|
||||||
LayoutCtx_GetMaxDefaultSize_loop:
|
LayoutCtx_GetMaxSize_loop:
|
||||||
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_LO
|
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_SIZE_LO
|
||||||
ld r20, X+
|
ld r20, X+
|
||||||
ld r21, X
|
ld r21, X
|
||||||
sbiw xh:xl, (LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_LO+1)
|
sbiw xh:xl, (LAYOUT_CTX_ITEM_OFFS_SIZE_LO+1)
|
||||||
cp r18, r20
|
cp r18, r20
|
||||||
cpc r19, r21
|
cpc r19, r21
|
||||||
brcc LayoutCtx_GetMaxDefaultSize_next
|
brcc LayoutCtx_GetMaxSize_next
|
||||||
mov r18, r20
|
mov r18, r20
|
||||||
mov r19, r21
|
mov r19, r21
|
||||||
LayoutCtx_GetMaxDefaultSize_next:
|
LayoutCtx_GetMaxSize_next:
|
||||||
adiw xh:xl, LAYOUT_CTX_ITEM_SIZE
|
adiw xh:xl, LAYOUT_CTX_ITEM_SIZE
|
||||||
dec r24
|
dec r24
|
||||||
pop xh
|
pop xh
|
||||||
@@ -244,10 +272,10 @@ layoutCtxSetSizeWithExtra:
|
|||||||
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
|
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
|
||||||
ld r24, X+ ; number of items (X now points to first item)
|
ld r24, X+ ; number of items (X now points to first item)
|
||||||
layoutCtxSetSizeWithExtra_loop:
|
layoutCtxSetSizeWithExtra_loop:
|
||||||
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_LO
|
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_SIZE_LO
|
||||||
ld r20, X+
|
ld r20, X+
|
||||||
ld r21, X
|
ld r21, X
|
||||||
sbiw xh:xl, (LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_LO+1)
|
sbiw xh:xl, (LAYOUT_CTX_ITEM_OFFS_SIZE_LO+1)
|
||||||
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_FLAGS
|
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_FLAGS
|
||||||
ld r22, X
|
ld r22, X
|
||||||
sbiw xh:xl, LAYOUT_CTX_ITEM_OFFS_FLAGS
|
sbiw xh:xl, LAYOUT_CTX_ITEM_OFFS_FLAGS
|
||||||
@@ -288,11 +316,10 @@ LayoutCtxSetPos:
|
|||||||
clr r23
|
clr r23
|
||||||
ld r24, X+ ; number of items (X now points to first item)
|
ld r24, X+ ; number of items (X now points to first item)
|
||||||
LayoutCtxSetPos_loop: ; r19:r18=current pos, r22=spacing, r23=border, X=1st item
|
LayoutCtxSetPos_loop: ; r19:r18=current pos, r22=spacing, r23=border, X=1st item
|
||||||
push r18
|
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_POS_LO ; store pos
|
||||||
push r19
|
st X+, r18
|
||||||
rcall layoutCtxPack ; (r16-r21, r25)
|
st X, r19
|
||||||
pop r19
|
sbiw xh:xl, (LAYOUT_CTX_ITEM_OFFS_POS_LO+1)
|
||||||
pop r18
|
|
||||||
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_SIZE_LO
|
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_SIZE_LO
|
||||||
ld r20, X+
|
ld r20, X+
|
||||||
ld r21, X
|
ld r21, X
|
||||||
@@ -334,11 +361,10 @@ layoutCtxSetPosWithExtra:
|
|||||||
add r18, r16 ; add space to border
|
add r18, r16 ; add space to border
|
||||||
adc r19, r17
|
adc r19, r17
|
||||||
layoutCtxSetPosWithExtra_loop: ; r19:r18=current pos, r22=spacing, r23=border, X=1st item
|
layoutCtxSetPosWithExtra_loop: ; r19:r18=current pos, r22=spacing, r23=border, X=1st item
|
||||||
push r18
|
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_POS_LO
|
||||||
push r19
|
st X+, r18
|
||||||
rcall layoutCtxPack ; (r16-r21, r25)
|
st X, r19
|
||||||
pop r19
|
sbiw xh:xl, (LAYOUT_CTX_ITEM_OFFS_POS_LO+1)
|
||||||
pop r18
|
|
||||||
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_SIZE_LO
|
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_SIZE_LO
|
||||||
ld r20, X+
|
ld r20, X+
|
||||||
ld r21, X
|
ld r21, X
|
||||||
@@ -361,20 +387,22 @@ layoutCtxSetPosWithExtra_loop: ; r19:r18=current pos, r22=spac
|
|||||||
; @routine layoutCtxPack
|
; @routine layoutCtxPack
|
||||||
;
|
;
|
||||||
; @param X pointer to current item
|
; @param X pointer to current item
|
||||||
; @param r19:r18 current pos
|
; @param r21:r20 default size of the widget
|
||||||
; @clobbers r16-r21, r25
|
; @return r19:r18 calculated pos
|
||||||
|
; @return r21:r20 calculated size
|
||||||
|
; @clobbers r16-r19, r25
|
||||||
|
|
||||||
layoutCtxPack:
|
layoutCtxPack:
|
||||||
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_SIZE_LO
|
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_POS_LO
|
||||||
|
ld r18, X+ ; pos lo
|
||||||
|
ld r19, X+ ; pos hi
|
||||||
ld r16, X+ ; size lo
|
ld r16, X+ ; size lo
|
||||||
ld r17, X+ ; size hi
|
ld r17, X+ ; size hi
|
||||||
ld r20, X+ ; default size lo
|
|
||||||
ld r21, X+ ; default size lo
|
|
||||||
ld r25, X ; flags
|
ld r25, X ; flags
|
||||||
sbiw xh:xl, LAYOUT_CTX_ITEM_OFFS_FLAGS
|
sbiw xh:xl, LAYOUT_CTX_ITEM_OFFS_FLAGS
|
||||||
sub r16, r20 ; r17:r16=(size-defaultSize)
|
sub r16, r20 ; r17:r16=(size-defaultSize)
|
||||||
sbc r17, r21
|
sbc r17, r21
|
||||||
brcs layoutCtxPack_store
|
brcs layoutCtxPack_done
|
||||||
andi r25, 3
|
andi r25, 3
|
||||||
cpi r25, WIDGET_PACK_END
|
cpi r25, WIDGET_PACK_END
|
||||||
breq layoutCtxPack_end
|
breq layoutCtxPack_end
|
||||||
@@ -382,29 +410,27 @@ layoutCtxPack:
|
|||||||
breq layoutCtxPack_center
|
breq layoutCtxPack_center
|
||||||
cpi r25, WIDGET_PACK_FILLED
|
cpi r25, WIDGET_PACK_FILLED
|
||||||
breq layoutCtxPack_filled
|
breq layoutCtxPack_filled
|
||||||
rjmp layoutCtxPack_store
|
rjmp layoutCtxPack_done
|
||||||
layoutCtxPack_end:
|
layoutCtxPack_end:
|
||||||
add r18, r16 ; just add difference to pos
|
add r18, r16 ; just add difference to pos
|
||||||
adc r19, r17
|
adc r19, r17
|
||||||
rjmp layoutCtxPack_store
|
rjmp layoutCtxPack_done
|
||||||
layoutCtxPack_center:
|
layoutCtxPack_center:
|
||||||
lsr r17
|
lsr r17
|
||||||
ror r16
|
ror r16
|
||||||
add r18, r16 ; just add half difference to pos
|
add r18, r16 ; just add half difference to pos
|
||||||
adc r19, r17
|
adc r19, r17
|
||||||
rjmp layoutCtxPack_store
|
rjmp layoutCtxPack_done
|
||||||
layoutCtxPack_filled:
|
layoutCtxPack_filled:
|
||||||
add r16, r20 ; get size back into r17:r16
|
add r16, r20 ; get total size back
|
||||||
adc r17, r21
|
adc r17, r21
|
||||||
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_SIZE_LO
|
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_SIZE_LO
|
||||||
st X+, r16 ; set item to full size
|
st X+, r16 ; set item to full size
|
||||||
st X, r17
|
st X, r17
|
||||||
sbiw xh:xl, (LAYOUT_CTX_ITEM_OFFS_SIZE_LO+1)
|
sbiw xh:xl, (LAYOUT_CTX_ITEM_OFFS_SIZE_LO+1)
|
||||||
layoutCtxPack_store:
|
mov r20, r16
|
||||||
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_POS_LO
|
mov r21, r17
|
||||||
st X+, r18
|
layoutCtxPack_done:
|
||||||
st X, r19
|
|
||||||
sbiw xh:xl, (LAYOUT_CTX_ITEM_OFFS_POS_LO+1)
|
|
||||||
ret
|
ret
|
||||||
; @end
|
; @end
|
||||||
|
|
||||||
@@ -521,10 +547,10 @@ LayoutCtx_CalcMinimumSize:
|
|||||||
lsl r18 ; add border at beginning and end
|
lsl r18 ; add border at beginning and end
|
||||||
rol r19
|
rol r19
|
||||||
LayoutCtx_CalcMinimumSize_loop:
|
LayoutCtx_CalcMinimumSize_loop:
|
||||||
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_LO
|
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_SIZE_LO
|
||||||
ld r16, X+ ; LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_LO
|
ld r16, X+ ; LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_LO
|
||||||
ld r17, X ; LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_HI
|
ld r17, X ; LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_HI
|
||||||
adiw xh:xl, (LAYOUT_CTX_ITEM_SIZE-LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_HI)
|
adiw xh:xl, (LAYOUT_CTX_ITEM_SIZE-LAYOUT_CTX_ITEM_OFFS_SIZE_HI)
|
||||||
add r18, r16 ; add size
|
add r18, r16 ; add size
|
||||||
adc r19, r17
|
adc r19, r17
|
||||||
add r18, r22 ; add spacing
|
add r18, r22 ; add spacing
|
||||||
@@ -625,13 +651,14 @@ LayoutCtx_ReadXDimsSkipped:
|
|||||||
; @param X pointer to ctx
|
; @param X pointer to ctx
|
||||||
; @param Y pointer to first widget to handle
|
; @param Y pointer to first widget to handle
|
||||||
; @param r25 number of widgets to handle
|
; @param r25 number of widgets to handle
|
||||||
|
; @clobbers r16, r18, r19, r24, Y
|
||||||
|
|
||||||
LayoutCtx_WriteXDimsContiguous:
|
LayoutCtx_WriteXDimsContiguous:
|
||||||
push xl
|
push xl
|
||||||
push xh
|
push xh
|
||||||
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
|
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
|
||||||
ld r24, X+ ; X now points to first item
|
ld r24, X+ ; X now points to first item
|
||||||
M_LAYOUT_FOREVERY_CONT layoutCtxCbCopyItemToWidgetX
|
M_LAYOUT_FOREVERY_CONT layoutCtxCbCopyItemToWidgetX ; (r16, r18, r19, Y)
|
||||||
pop xh
|
pop xh
|
||||||
pop xl
|
pop xl
|
||||||
ret
|
ret
|
||||||
@@ -740,18 +767,21 @@ LayoutCtx_WriteYDimsSkipped:
|
|||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine LayoutCtx_SetDefaultWidthContiguous
|
; @routine LayoutCtx_PackXContiguous
|
||||||
;
|
;
|
||||||
; @param X pointer to ctx
|
; @param X pointer to ctx
|
||||||
; @param Y pointer to first widget to handle
|
; @param Y pointer to first widget to handle
|
||||||
; @param r25 number of widgets to handle
|
; @param r25 number of widgets to handle
|
||||||
|
; @return CFLAG set if more widgets to handle, cleared otherwise
|
||||||
|
; @return Y pointer to next widget to handle (if CFLAG set)
|
||||||
|
; @clobbers r16-r21, r24, r25, Y
|
||||||
|
|
||||||
LayoutCtx_SetDefaultWidthContiguous:
|
LayoutCtx_PackXContiguous:
|
||||||
push xl
|
push xl
|
||||||
push xh
|
push xh
|
||||||
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
|
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
|
||||||
ld r24, X+ ; X now points to first item
|
ld r24, X+ ; X now points to first item
|
||||||
M_LAYOUT_FOREVERY_CONT layoutCtxCbsetDefaultWidth
|
M_LAYOUT_FOREVERY_CONT layoutCtxCbPackX ; (r16-r21, r25, Y)
|
||||||
pop xh
|
pop xh
|
||||||
pop xl
|
pop xl
|
||||||
ret
|
ret
|
||||||
@@ -760,18 +790,20 @@ LayoutCtx_SetDefaultWidthContiguous:
|
|||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine LayoutCtx_SetDefaultWidthSkipped
|
; @routine LayoutCtx_PackXSkipped
|
||||||
;
|
;
|
||||||
; @param X pointer to ctx
|
; @param X pointer to ctx
|
||||||
; @param Y pointer to first widget to handle
|
; @param Y pointer to first widget to handle
|
||||||
; @param r25 number of widgets to skip in each round
|
; @param r25 number of widgets to skip in each round
|
||||||
|
; @return CFLAG set if more widgets to handle, cleared otherwise
|
||||||
|
; @return Y pointer to next widget to handle (if CFLAG set)
|
||||||
|
|
||||||
LayoutCtx_SetDefaultWidthSkipped:
|
LayoutCtx_PackXSkipped:
|
||||||
push xl
|
push xl
|
||||||
push xh
|
push xh
|
||||||
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
|
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
|
||||||
ld r24, X+ ; X now points to first item
|
ld r24, X+ ; X now points to first item
|
||||||
M_LAYOUT_FOREVERY_SKIPPED layoutCtxCbsetDefaultWidth
|
M_LAYOUT_FOREVERY_SKIPPED layoutCtxCbPackX
|
||||||
pop xh
|
pop xh
|
||||||
pop xl
|
pop xl
|
||||||
ret
|
ret
|
||||||
@@ -780,18 +812,20 @@ LayoutCtx_SetDefaultWidthSkipped:
|
|||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine LayoutCtx_SetDefaultHeightContiguous
|
; @routine LayoutCtx_PackYContiguous
|
||||||
;
|
;
|
||||||
; @param X pointer to ctx
|
; @param X pointer to ctx
|
||||||
; @param Y pointer to first widget to handle
|
; @param Y pointer to first widget to handle
|
||||||
; @param r25 number of widgets to handle
|
; @param r25 number of widgets to handle
|
||||||
|
; @return CFLAG set if more widgets to handle, cleared otherwise
|
||||||
|
; @return Y pointer to next widget to handle (if CFLAG set)
|
||||||
|
|
||||||
LayoutCtx_SetDefaultHeightContiguous:
|
LayoutCtx_PackYContiguous:
|
||||||
push xl
|
push xl
|
||||||
push xh
|
push xh
|
||||||
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
|
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
|
||||||
ld r24, X+ ; X now points to first item
|
ld r24, X+ ; X now points to first item
|
||||||
M_LAYOUT_FOREVERY_CONT layoutCtxCbsetDefaultHeight
|
M_LAYOUT_FOREVERY_CONT layoutCtxCbPackY
|
||||||
pop xh
|
pop xh
|
||||||
pop xl
|
pop xl
|
||||||
ret
|
ret
|
||||||
@@ -800,18 +834,20 @@ LayoutCtx_SetDefaultHeightContiguous:
|
|||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine LayoutCtx_SetDefaultHeightSkipped
|
; @routine LayoutCtx_PackYSkipped
|
||||||
;
|
;
|
||||||
; @param X pointer to ctx
|
; @param X pointer to ctx
|
||||||
; @param Y pointer to first widget to handle
|
; @param Y pointer to first widget to handle
|
||||||
; @param r25 number of widgets to skip in each round
|
; @param r25 number of widgets to skip in each round
|
||||||
|
; @return CFLAG set if more widgets to handle, cleared otherwise
|
||||||
|
; @return Y pointer to next widget to handle (if CFLAG set)
|
||||||
|
|
||||||
LayoutCtx_SetDefaultHeightSkipped:
|
LayoutCtx_PackYSkipped:
|
||||||
push xl
|
push xl
|
||||||
push xh
|
push xh
|
||||||
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
|
adiw xh:xl, LAYOUT_CTX_OFFS_NUMITEMS
|
||||||
ld r24, X+ ; X now points to first item
|
ld r24, X+ ; X now points to first item
|
||||||
M_LAYOUT_FOREVERY_SKIPPED layoutCtxCbsetDefaultHeight
|
M_LAYOUT_FOREVERY_SKIPPED layoutCtxCbPackY
|
||||||
pop xh
|
pop xh
|
||||||
pop xl
|
pop xl
|
||||||
ret
|
ret
|
||||||
@@ -824,6 +860,7 @@ LayoutCtx_SetDefaultHeightSkipped:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine layoutCtxCbCopyWidgetXToItem
|
; @routine layoutCtxCbCopyWidgetXToItem
|
||||||
;
|
;
|
||||||
@@ -841,9 +878,9 @@ layoutCtxCbCopyWidgetXToItem:
|
|||||||
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_POS_LO
|
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_POS_LO
|
||||||
ldd r16, Y+WIDGET_OFFS_X_HI
|
ldd r16, Y+WIDGET_OFFS_X_HI
|
||||||
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_POS_HI
|
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_POS_HI
|
||||||
ldd r16, Y+WIDGET_OFFS_WIDTH_LO
|
ldd r16, Y+WIDGET_OFFS_TMP_LO
|
||||||
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_SIZE_LO
|
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_SIZE_LO
|
||||||
ldd r16, Y+WIDGET_OFFS_WIDTH_HI
|
ldd r16, Y+WIDGET_OFFS_TMP_HI
|
||||||
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_SIZE_HI
|
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_SIZE_HI
|
||||||
clr r16
|
clr r16
|
||||||
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_LO
|
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_LO
|
||||||
@@ -864,7 +901,8 @@ layoutCtxCbCopyWidgetXToItem_ret:
|
|||||||
;
|
;
|
||||||
; @param Y widget
|
; @param Y widget
|
||||||
; @param X item
|
; @param X item
|
||||||
; @param r24 number of items left in layout context
|
; @param r24 number of items left in layout context (gets decremented)
|
||||||
|
; @clobbers r16
|
||||||
|
|
||||||
layoutCtxCbCopyItemToWidgetX:
|
layoutCtxCbCopyItemToWidgetX:
|
||||||
tst r24
|
tst r24
|
||||||
@@ -903,9 +941,9 @@ layoutCtxCbCopyWidgetYToItem:
|
|||||||
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_POS_LO
|
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_POS_LO
|
||||||
ldd r16, Y+WIDGET_OFFS_Y_HI
|
ldd r16, Y+WIDGET_OFFS_Y_HI
|
||||||
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_POS_HI
|
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_POS_HI
|
||||||
ldd r16, Y+WIDGET_OFFS_HEIGHT_LO
|
ldd r16, Y+WIDGET_OFFS_TMP_LO
|
||||||
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_SIZE_LO
|
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_SIZE_LO
|
||||||
ldd r16, Y+WIDGET_OFFS_HEIGHT_HI
|
ldd r16, Y+WIDGET_OFFS_TMP_HI
|
||||||
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_SIZE_HI
|
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_SIZE_HI
|
||||||
clr r16
|
clr r16
|
||||||
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_LO
|
st X+, r16 ; LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_LO
|
||||||
@@ -952,60 +990,57 @@ layoutCtxCbCopyItemToWidgetY_ret:
|
|||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine layoutCtxCbsetDefaultWidth
|
; @routine layoutCtxCbPackX
|
||||||
;
|
;
|
||||||
; @param Y widget
|
; @param Y widget
|
||||||
; @param X item
|
; @param X item
|
||||||
; @param r24 number of items left in layout context
|
; @param r24 number of items left in layout context (gets decremented)
|
||||||
|
; @clobbers r16-r21, r25
|
||||||
|
|
||||||
layoutCtxCbsetDefaultWidth:
|
layoutCtxCbPackX:
|
||||||
tst r24
|
tst r24
|
||||||
sec
|
sec
|
||||||
breq layoutCtxCbsetDefaultWidth_ret
|
breq layoutCtxCbPackX_ret
|
||||||
push xl
|
|
||||||
push xh
|
ldd r20, Y+WIDGET_OFFS_TMP_LO
|
||||||
push r24
|
ldd r21, Y+WIDGET_OFFS_TMP_LO
|
||||||
bigcall Widget_GetDefaultWidth ; r19:r18=result
|
rcall layoutCtxPack ; (r16-r19, r25)
|
||||||
pop r24
|
std Y+WIDGET_OFFS_X_LO, r18
|
||||||
pop xh
|
std Y+WIDGET_OFFS_X_HI, r19
|
||||||
pop xl
|
std Y+WIDGET_OFFS_WIDTH_LO, r20
|
||||||
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_LO
|
std Y+WIDGET_OFFS_WIDTH_HI, r21
|
||||||
st X+, r18
|
adiw xh:xl, LAYOUT_CTX_ITEM_SIZE
|
||||||
st X, r19
|
|
||||||
adiw xh:xl, 2
|
|
||||||
dec r24
|
dec r24
|
||||||
clc
|
clc
|
||||||
layoutCtxCbsetDefaultWidth_ret:
|
layoutCtxCbPackX_ret:
|
||||||
ret
|
ret
|
||||||
; @end
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine layoutCtxCbsetDefaultHeight
|
; @routine layoutCtxCbPackY
|
||||||
;
|
;
|
||||||
; @param Y widget
|
; @param Y widget
|
||||||
; @param X item
|
; @param X item
|
||||||
; @param r24 number of items left in layout context
|
; @param r24 number of items left in layout context
|
||||||
|
|
||||||
layoutCtxCbsetDefaultHeight:
|
layoutCtxCbPackY:
|
||||||
tst r24
|
tst r24
|
||||||
sec
|
sec
|
||||||
breq layoutCtxCbsetDefaultHeight_ret
|
breq layoutCtxCbPackY_ret
|
||||||
push xl
|
|
||||||
push xh
|
ldd r20, Y+WIDGET_OFFS_TMP_LO
|
||||||
push r24
|
ldd r21, Y+WIDGET_OFFS_TMP_LO
|
||||||
bigcall Widget_GetDefaultHeight ; r19:r18=result
|
rcall layoutCtxPack
|
||||||
pop r24
|
std Y+WIDGET_OFFS_Y_LO, r18
|
||||||
pop xh
|
std Y+WIDGET_OFFS_Y_HI, r19
|
||||||
pop xl
|
std Y+WIDGET_OFFS_HEIGHT_LO, r20
|
||||||
adiw xh:xl, LAYOUT_CTX_ITEM_OFFS_DEFAULTSIZE_LO
|
std Y+WIDGET_OFFS_HEIGHT_HI, r21
|
||||||
st X+, r18
|
adiw xh:xl, LAYOUT_CTX_ITEM_SIZE
|
||||||
st X, r19
|
|
||||||
adiw xh:xl, 2
|
|
||||||
dec r24
|
dec r24
|
||||||
clc
|
clc
|
||||||
layoutCtxCbsetDefaultHeight_ret:
|
layoutCtxCbPackY_ret:
|
||||||
ret
|
ret
|
||||||
; @end
|
; @end
|
||||||
|
|
||||||
@@ -1013,6 +1048,7 @@ layoutCtxCbsetDefaultHeight_ret:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; ---------------------------------------------------------------------------
|
; ---------------------------------------------------------------------------
|
||||||
; @routine layoutForEveryObjectContiguous
|
; @routine layoutForEveryObjectContiguous
|
||||||
;
|
;
|
||||||
@@ -1115,6 +1151,62 @@ layoutForEveryObjectSkipped_ret:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine Layout2_SetDefaultWidths
|
||||||
|
;
|
||||||
|
; Set default width in WIDGET_OFFS_TMP_LO/HI of child widgets
|
||||||
|
;
|
||||||
|
; @param Y pointer to widget
|
||||||
|
; @clobbers any, !Y
|
||||||
|
|
||||||
|
Layout2_SetDefaultWidths:
|
||||||
|
push yl
|
||||||
|
push yh
|
||||||
|
bigcall OBJ_GetFirstChild
|
||||||
|
brcc Layout2_SetDefaultWidths_ret
|
||||||
|
Layout2_SetDefaultWidths_loop:
|
||||||
|
mov yl, r18
|
||||||
|
mov yh, r19
|
||||||
|
bigcall Widget_GetDefaultWidth
|
||||||
|
std Y+WIDGET_OFFS_TMP_LO, r18
|
||||||
|
std Y+WIDGET_OFFS_TMP_HI, r19
|
||||||
|
bigcall OBJ_GetNext
|
||||||
|
brcs Layout2_SetDefaultWidths_loop
|
||||||
|
Layout2_SetDefaultWidths_ret:
|
||||||
|
pop yh
|
||||||
|
pop yl
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; ---------------------------------------------------------------------------
|
||||||
|
; @routine Layout2_SetDefaultHeights
|
||||||
|
;
|
||||||
|
; Set default height in WIDGET_OFFS_TMP_LO/HI of child widgets
|
||||||
|
;
|
||||||
|
; @param Y pointer to widget
|
||||||
|
; @clobbers any, !Y
|
||||||
|
|
||||||
|
Layout2_SetDefaultHeights:
|
||||||
|
push yl
|
||||||
|
push yh
|
||||||
|
bigcall OBJ_GetFirstChild
|
||||||
|
brcc Layout2_SetDefaultHeights_ret
|
||||||
|
Layout2_SetDefaultHeights_loop:
|
||||||
|
mov yl, r18
|
||||||
|
mov yh, r19
|
||||||
|
bigcall Widget_GetDefaultHeight
|
||||||
|
std Y+WIDGET_OFFS_TMP_LO, r18
|
||||||
|
std Y+WIDGET_OFFS_TMP_HI, r19
|
||||||
|
bigcall OBJ_GetNext
|
||||||
|
brcs Layout2_SetDefaultHeights_loop
|
||||||
|
Layout2_SetDefaultHeights_ret:
|
||||||
|
pop yh
|
||||||
|
pop yl
|
||||||
|
ret
|
||||||
|
; @end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user