some minor work on gui/win modules.

This commit is contained in:
Martin Preuss
2025-06-12 23:30:36 +02:00
parent c51043d72a
commit ffcc5c0d9f
7 changed files with 82 additions and 8 deletions

View File

@@ -179,6 +179,7 @@
.include "modules/lcd2/win/defs.asm"
.include "modules/lcd2/win/object.asm"
.include "modules/lcd2/win/widget.asm"
.include "modules/lcd2/win/gui.asm"
#endif

13
avr/modules/lcd2/gui/TODO Normal file
View File

@@ -0,0 +1,13 @@
- Screen
- functions:
- show
- unshow
- touch
- key
- activeAreas:
- x, y, w, h (in FLASH)
- only small variable data in SRAM, no need for heap!

View File

@@ -0,0 +1,37 @@
; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss
; email : martin@libchipcard.de
;
; ***************************************************************************
; * This file is part of the project "AqHome". *
; * Please see toplevel file COPYING of that project for license details. *
; ***************************************************************************
#ifndef AQH_AVR_GUI_H
#define AQH_AVR_GUI_H
.equ SCR_OFFS_HANDLER_LO = 0
.equ SCR_OFFS_HANDLER_HI = 1
.equ SCR_OFFS_X_LO = 2
.equ SCR_OFFS_X_HI = 3
.equ SCR_OFFS_Y_LO = 4
.equ SCR_OFFS_Y_HI = 5
.equ SCR_OFFS_WIDTH_LO = 6
.equ SCR_OFFS_WIDTH_HI = 7
.equ SCR_OFFS_HEIGHT_LO = 8
.equ SCR_OFFS_HEIGHT_HI = 9
.equ SCR_OFFS_BG_COL_LO = 10
.equ SCR_OFFS_BG_COL_HI = 11
.equ SCR_OFFS_FG_COL_LO = 12
.equ SCR_OFFS_FG_COL_HI = 13
.equ SCR_OFFS_FONT_LO = 14
.equ SCR_OFFS_FONT_HI = 15
.equ SCR_SIZE = 16
#endif

View File

@@ -69,9 +69,6 @@
.equ WID_OPTIONS1_BIT_VALIGN0 = 4 ; 00: top, 01: bottom, 11: center
.equ WID_OPTIONS1_BIT_VALIGN1 = 5
.equ WID_OPTIONS1_BIT_ALIGN_HCENTER = 4
.equ WID_OPTIONS1_BIT_ALIGN_VCENTER = 5
.equ WID_OPTIONS1_BIT_FIXED_WIDTH = 6
.equ WID_OPTIONS1_BIT_FIXED_HEIGHT = 7

View File

@@ -0,0 +1,22 @@
; ***************************************************************************
; copyright : (C) 2025 by Martin Preuss
; email : martin@libchipcard.de
;
; ***************************************************************************
; * This file is part of the project "AqHome". *
; * Please see toplevel file COPYING of that project for license details. *
; ***************************************************************************
.dseg
guiRootWidget: .byte 2
.cseg
GUI_Init:
ret
; @end

View File

@@ -8,6 +8,10 @@
; ***************************************************************************
.cseg
; ---------------------------------------------------------------------------
; @routine OBJ_Init @global
;

View File

@@ -160,11 +160,11 @@ wVLayout:
rcall wSetChildrenHeightsFromMinHeights
; count number of expandable children
ldi r16, WID_OPTIONS1_BIT_STRETCH_Y
ldi r17, WID_OPTIONS1_BIT_STRETCH_Y
rcall widgetCountVisibleChildrenWithOptions1 ; (r18, r24, r25, X)
ldi r16, (1<<WID_OPTIONS1_BIT_STRETCH_Y) ; value
ldi r17, (1<<WID_OPTIONS1_BIT_STRETCH_Y) ; mask
rcall widgetCountVisibleChildrenWithOptions1 ; r18=number of matching visible children (r24, r25, X)
tst r18
breq wVLayout_Ydone ; no expandable children, nothing to distribute
breq wVLayout_Ydone ; no expandable children, nothing to distribute
; determine full height needed by all children
push r18 ; number of visible expandable child widgets
clr r17 ; mask=0 -> count all visible children
@@ -187,7 +187,7 @@ wVLayout:
sub r20, r18 ; r21:r20 = HEIGHT-SUM_OF_VIS_CHILDREN_HEIGHTS
sbc r21, r19
brcc wVLayout_heightTooSmall
breq wVLayout_yDone ; nothing to distribute
breq wVLayout_yDone ; nothing to distribute
bigcall Utils_Divu16_16_16 ; r17:r16 = r21:r20 / r23:r22
; add additional pixel to heights of expandable child widgets
rcall wAddToHeightsOfExpandableVisibleChildren