A2osX/LIB/LIBGUI.S.WND.txt
2020-09-08 17:31:41 +02:00

253 lines
4.2 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
AUTO 3,1
*--------------------------------------
WND.Init >PUSHBI 0
>LDYA L.DEVNAME.GFX
>SYSCALL2 open
bcs .9
sta WND.Screen+S.OBJ.hPARENT
>LDYA L.DCB.GFX
>STYA IOCTL+S.IOCTL.BUFPTR
lda #S.IOCTL.STATCODE.GETDCB
sta IOCTL+S.IOCTL.STATCODE
>PUSHB WND.Screen+S.OBJ.hPARENT
>PUSHBI IOCTL.STATUS
>PUSHW L.IOCTL
>SYSCALL2 IOCTL
.9 rts
*--------------------------------------
WND.Setup >LDYA DCB.GFX+S.DCB.GFX.W
>STYA WND.Screen+S.OBJ.W
>STYA WND.Desktop+S.OBJ.W
>STYA WND.SysBar+S.OBJ.W
lda SYSFON.H
clc
adc #6
sta WND.SysBar+S.OBJ.H
lda DCB.GFX+S.DCB.GFX.H
sta WND.Screen+S.OBJ.H
sec
sbc WND.SysBar+S.OBJ.H
sta WND.Desktop+S.OBJ.H
sta WND.SysBar+S.OBJ.X1
lda DCB.GFX+S.DCB.GFX.H+1
sta WND.SysBar+S.OBJ.H+1
sbc #0
sta WND.Desktop+S.OBJ.H+1
sta WND.SysBar+S.OBJ.X1+1
>LDYA L.WND.Screen
jsr OBJ.SetX2Y2
>LDYA L.WND.Desktop
>STYA WND.Screen.Childs
jsr OBJ.SetX2Y2
>LDYA L.WND.SysBar
>STYA WND.Screen.Childs+2
jsr OBJ.SetX2Y2
lda #CUR.T.ARROW
sta WND.Desktop+S.WND.hCUR
sta WND.SysBar+S.WND.hCUR
rts
*--------------------------------------
WND.Quit lda WND.Screen+S.OBJ.hPARENT
beq .8
pha
>PUSHBI IOCTL.CLOSE
>PUSHWZ
pla
>SYSCALL2 IOCTL
.8 clc
rts
*--------------------------------------
* F8, X116, Y116, W16, H16
*--------------------------------------
WND.Create >LDYAI S.WND
>SYSCALL2 getmem
bcs .9
>STYA ZPPtr1
lda #S.OBJ.T.WND
sta (ZPPtr1) S.OBJ.T
ldy #S.WND-1
lda #0
.1 sta (ZPPtr1),y
dey
bne .1
>PULLA
ldy #S.OBJ.H
sta (ZPPtr1),y
>PULLA
iny
sta (ZPPtr1),y
>PULLA
ldy #S.OBJ.W
sta (ZPPtr1),y
>PULLA
iny
sta (ZPPtr1),y
>PULLA
ldy #S.OBJ.Y1
sta (ZPPtr1),y
>PULLA
iny
sta (ZPPtr1),y
>PULLA
ldy #S.OBJ.X1
sta (ZPPtr1),y
>PULLA
iny
sta (ZPPtr1),y
>PULLA
ldy #S.OBJ.F
sta (ZPPtr1),y
ldy #S.PS.PID
lda (pPs),y
ldy #S.OBJ.hOWNER
sta (ZPPtr1),y
txa ID
* clc
rts
.9 >RET 9
*--------------------------------------
* hWND8, Prop8, Value16
*--------------------------------------
WND.SetProp ldy #3
lda (pStack),y hWND
>SYSCALL2 GetMemPtr
>STYA ZPPtr1
ldy #2
lda (pStack),y
tay
>PULLA
sta (ZPPtr1),y
iny
>PULLA
sta (ZPPtr1),y
>RET 2
*--------------------------------------
* hWND8, Prop8
*--------------------------------------
WND.GetProp >PULLA
pha
>PULLA
>SYSCALL2 GetMemPtr
>STYA ZPPtr1
ply
lda (ZPPtr1),y
pha
iny
lda (ZPPtr1),y
ply
rts
*--------------------------------------
* A = hWND
*--------------------------------------
WND.Show >SYSCALL2 GetMemPtr
>STYA ZPPtr1
jsr OBJ.SetX2Y2
jsr GetCBBuf
bcs .9
stz Counter X
stz Counter+1 Y
ldy #S.OBJ.F
lda (ZPPtr1),y
and #S.WND.F.RESIZE+S.WND.F.BORDER
beq .10
inc Counter 1 pixel L
inc Counter 1 pixel R
inc Counter+1 1 top
inc Counter+1 1 bottom
lda #S.CB.CMD.HLINE
jsr PutCBBuf
lda #S.CB.OP.SET
jsr PutCBBuf
lda #S.CB.M.MONO
jsr PutCBBuf
lda PREFS.BORDERCOLOR
jsr PutCBBuf
ldy #S.OBJ.X1
.1 lda (ZPPtr1),y
jsr PutCBBuf
iny
cpy #S.OBJ.Y2+2
bne .1
.10
lda #0
jsr PutCBBuf
>LDYA L.WND.Screen
jsr DrawToYA
lda hCBBuf
>SYSCALL FreeMem
clc
.9 rts
*--------------------------------------
WND.New clc
rts
*--------------------------------------
WND.Paint >STYA ZPPtr1
clc
rts
*--------------------------------------
WND.Close clc
rts
*--------------------------------------
MAN
SAVE usr/src/lib/libgui.s.wnd
LOAD usr/src/lib/libgui.s
ASM