; ***************************************************************************
; 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_WIN_DEFS_H
#define AQH_AVR_WIN_DEFS_H


; tree/list data
.equ OBJ_OFFS_TREE         = 0

; object data
.equ OBJ_OFFS_OBJECT       =  OBJ_OFFS_TREE+TREE_SIZE
.equ OBJ_OFFS_HANDLERFN_LO =  OBJ_OFFS_OBJECT
.equ OBJ_OFFS_HANDLERFN_HI =  OBJ_OFFS_OBJECT+1
.equ OBJ_OFFS_TARGET_LO    =  OBJ_OFFS_OBJECT+2
.equ OBJ_OFFS_TARGET_HI    =  OBJ_OFFS_OBJECT+3
.equ OBJ_OFFS_IDFORTARGET  =  OBJ_OFFS_OBJECT+4
.equ OBJ_OFFS_OPTIONS      =  OBJ_OFFS_OBJECT+5
.equ OBJ_SIZE              =  OBJ_OFFS_OBJECT+6

; widget data
.equ WID_OFFS_WIDGET       = OBJ_SIZE
.equ WID_OFFS_OPTIONS1     = WID_OFFS_WIDGET+0
.equ WID_OFFS_OPTIONS2     = WID_OFFS_WIDGET+1
.equ WID_OFFS_ABS_X_LO     = WID_OFFS_WIDGET+2
.equ WID_OFFS_ABS_X_HI     = WID_OFFS_WIDGET+3
.equ WID_OFFS_ABS_Y_LO     = WID_OFFS_WIDGET+4
.equ WID_OFFS_ABS_Y_HI     = WID_OFFS_WIDGET+5
.equ WID_OFFS_REL_X_LO     = WID_OFFS_WIDGET+6
.equ WID_OFFS_REL_X_HI     = WID_OFFS_WIDGET+7
.equ WID_OFFS_REL_Y_LO     = WID_OFFS_WIDGET+8
.equ WID_OFFS_REL_Y_HI     = WID_OFFS_WIDGET+9
.equ WID_OFFS_WIDTH_LO     = WID_OFFS_WIDGET+10
.equ WID_OFFS_WIDTH_HI     = WID_OFFS_WIDGET+11
.equ WID_OFFS_HEIGHT_LO    = WID_OFFS_WIDGET+12
.equ WID_OFFS_HEIGHT_HI    = WID_OFFS_WIDGET+13
.equ WID_OFFS_BG_COL_LO    = WID_OFFS_WIDGET+14
.equ WID_OFFS_BG_COL_HI    = WID_OFFS_WIDGET+15
.equ WID_OFFS_FG_COL_LO    = WID_OFFS_WIDGET+16
.equ WID_OFFS_FG_COL_HI    = WID_OFFS_WIDGET+17
.equ WID_OFFS_FONT_LO      = WID_OFFS_WIDGET+18
.equ WID_OFFS_FONT_HI      = WID_OFFS_WIDGET+19
.equ WID_OFFS_BORDER_TOP   = WID_OFFS_WIDGET+20
.equ WID_OFFS_BORDER_BOT   = WID_OFFS_WIDGET+21
.equ WID_OFFS_BORDER_LEFT  = WID_OFFS_WIDGET+22
.equ WID_OFFS_BORDER_RIGHT = WID_OFFS_WIDGET+23

.equ WID_SIZE              = WID_OFFS_WIDGET+24



.equ WID_OPTIONS0_BIT_VISIBLE       = 0  ; OBJ_OFFS_OPTIONS
.equ WID_OPTIONS0_BIT_DIRTY         = 1
.equ WID_OPTIONS0_BIT_LAYOUT        = 2
.equ WID_OPTIONS0_BIT_DATAINSDRAM   = 3  ; text or other data is in SDRAM, not in flash

.equ WID_OPTIONS1_BIT_STRETCH_X     = 0  ; WID_OFFS_OPTIONS1
.equ WID_OPTIONS1_BIT_STRETCH_Y     = 1

.equ WID_OPTIONS1_BIT_HALIGN0       = 2  ; 00: left, 01: right, 11: center
.equ WID_OPTIONS1_BIT_HALIGN1       = 3

.equ WID_OPTIONS1_BIT_VALIGN0       = 4  ; 00: top, 01: bottom, 11: center
.equ WID_OPTIONS1_BIT_VALIGN1       = 5

.equ WID_OPTIONS1_BIT_FIXED_WIDTH   = 6
.equ WID_OPTIONS1_BIT_FIXED_HEIGHT  = 7


.equ WID_OPTIONS2_BIT_EQUAL_WIDTH   = 0
.equ WID_OPTIONS2_BIT_EQUAL_HEIGHT  = 1


; Signals

.equ OBJ_SIGNAL_DESTROY   = 0
.equ OBJ_SIGNAL_GETVALUE  = 1
.equ OBJ_SIGNAL_SETVALUE  = 2
.equ OBJ_SIGNAL_TIMER     = 3
.equ OBJ_SIGNAL_NEXTFREE  = 4

.equ WID_SIGNAL_SHOW         = OBJ_SIGNAL_NEXTFREE
.equ WID_SIGNAL_HIDE         = OBJ_SIGNAL_NEXTFREE+1
.equ WID_SIGNAL_DRAW         = OBJ_SIGNAL_NEXTFREE+2
.equ WID_SIGNAL_LAYOUT       = OBJ_SIGNAL_NEXTFREE+3
.equ WID_SIGNAL_TOUCH        = OBJ_SIGNAL_NEXTFREE+4
.equ WID_SIGNAL_MOUSE        = OBJ_SIGNAL_NEXTFREE+5
.equ WID_SIGNAL_KEY          = OBJ_SIGNAL_NEXTFREE+6
.equ WID_SIGNAL_GETMINWIDTH  = OBJ_SIGNAL_NEXTFREE+7
.equ WID_SIGNAL_GETMINHEIGHT = OBJ_SIGNAL_NEXTFREE+8
.equ WID_SIGNAL_NEXTFREE     = OBJ_SIGNAL_NEXTFREE+9



.equ TIMER_OFFS_LIST      = 0
.equ TIMER_OFFS_TIMER     = LIST_SIZE
.equ TIMER_OFFS_VALUE_LO  = TIMER_OFFS_TIMER
.equ TIMER_OFFS_VALUE_HI  = TIMER_OFFS_TIMER+1
.equ TIMER_OFFS_RELOAD_LO = TIMER_OFFS_TIMER+2
.equ TIMER_OFFS_RELOAD_HI = TIMER_OFFS_TIMER+3
.equ TIMER_OFFS_OPTIONS   = TIMER_OFFS_TIMER+4
.equ TIMER_OFFS_SIGNAL    = TIMER_OFFS_TIMER+5
.equ TIMER_SIZE           = TIMER_OFFS_TIMER+6




#endif ; AQH_AVR_WIN_H

