gui2: started working on GuiApp, MainWindow, RootWindow

This commit is contained in:
Martin Preuss
2026-03-04 23:26:37 +01:00
parent afdd52eaf6
commit ae137efb26
3 changed files with 269 additions and 0 deletions

View File

@@ -0,0 +1,88 @@
; ***************************************************************************
; copyright : (C) 2026 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_GUI2_MAINWINDOW_ASM
#define AQH_AVR_GUI2_MAINWINDOW_ASM
; ***************************************************************************
; defines
.equ MAINWINDOW_OFFS_BEGIN = WIDGET_SIZE
; no data for now
.equ MAINWINDOW_SIZE = MAINWINDOW_OFFS_BEGIN+0
; ***************************************************************************
; code
.cseg
; ---------------------------------------------------------------------------
; @routine MainWindow_new @global
;
; @return CFLAG set of okay, cleared otherwise
; @return Y address of newly created object
; @param r16 value for OBJECT_OFFS_OPTS_LO
; @param r17 value for OBJECT_OFFS_OPTS_HI
; @clobbers any
MainWindow_new:
ldi r24, LOW(MAINWINDOW_SIZE)
ldi r25, HIGH(MAINWINDOW_SIZE)
bigcall Object_Alloc ; (!r16, !r17)
brcc MainWindow_new_ret
rcall MainWindow_Init ; (r16, r17, X)
sec
MainWindow_new_ret:
ret
; @end
; ---------------------------------------------------------------------------
; @routine MainWindow_Init @global
;
; @param Y address of widget
; @clobbers r16, r17, X
MainWindow_Init:
; call base class
bigcall Widget_Init ; (r16, r17, X)
; move widget
clr r4
clr r5
clr r6
clr r7
bigcall Widget_Move ; (R16)
ldi r16, LOW(DISPLAY_WIDTH)
mov r8, r16
ldi r16, HIGH(DISPLAY_WIDTH)
mov r9, r16
; resize widget
ldi r16, LOW(DISPLAY_HEIGHT)
mov r10, r16
ldi r16, HIGH(DISPLAY_HEIGHT)
mov r11, r16
bigcall Widget_Resize ; (R16)
ret
; @end
#endif