Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 683 → Rev 684

/kernel/trunk/gui/button.inc
76,34 → 76,34
push ecx
push edx
 
shr eax,16
shr ebx,16
mov edx,[TASK_BASE]
shr ecx,16
mov eax,[TASK_BASE]
 
add eax,[edx-twdw + WDATA.box.left]
add ebx,[edx-twdw + WDATA.box.top]
mov cx,ax
mov dx,bx
add ebx,[eax-twdw + WDATA.box.left]
add ecx,[eax-twdw + WDATA.box.top]
mov eax, ebx
shl eax,16
mov ax, bx
add ax, word [esp+8]
mov ebx, ecx
shl ebx,16
mov ax,cx
mov bx,dx
add ax,word [esp+12]
mov esi,ebx
mov edi,0
mov ecx,[esp+0]
mov bx, cx
push ebx
xor edi, edi
mov ecx, esi
call incecx
call [draw_line]
 
movzx edx,word [esp+8]
movzx edx,word [esp+4+4]
add ebx,edx
shl edx,16
add ebx,edx
mov ecx,[esp+0]
mov ecx,esi
call dececx
call [draw_line]
 
mov ebx,esi
pop ebx
push edx
mov edx,eax
shr edx,16
111,22 → 111,19
mov edx,ebx
shr edx,16
mov bx,dx
mov dx,[esp+8+4]
mov dx,[esp+4+4]
add bx,dx
pop edx
mov edi,0
mov ecx,[esp+0]
mov ecx,esi
call incecx
call [draw_line]
 
mov esi,edx
mov dx,[esp+12]
mov dx,[esp+8]
add ax,dx
shl edx,16
add eax,edx
add ebx,1*65536
mov edx,esi
mov ecx,[esp+0]
mov ecx,esi
call dececx
call [draw_line]
 
173,62 → 170,47
 
sys_button:
 
push edi
mov edi,[current_slot]
rol eax,16
add ax,word[edi+APPDATA.wnd_clientbox.left]
rol eax,16
mov eax, [current_slot]
rol ebx,16
add bx,word[edi+APPDATA.wnd_clientbox.top]
add bx, word [eax+APPDATA.wnd_clientbox.left]
rol ebx,16
pop edi
rol ecx, 16
add cx, word [eax+APPDATA.wnd_clientbox.top]
rol ecx, 16
.forced:
 
test ecx,0x80000000
test edx, 0x80000000
jnz remove_button
 
push esi
push edi
push eax ; <x,xs>
push ebx ; <y,ys>
push ecx ; <id>
push edx
 
or ax,ax
jle noaddbutt
or bx,bx
jle noaddbutt
or cx, cx
jle noaddbutt
 
test ecx,0x40000000
test edx, 0x40000000
jnz button_no_draw
 
pushad ; button body
push ebx
shr eax,16
movzx edi, cx
shr ebx,16
mov edx,[TASK_BASE]
mov esi,[edx-twdw + WDATA.box.left]
mov edi,[edx-twdw + WDATA.box.top]
add eax,esi
add ebx,edi
mov cx,ax
mov dx,bx
shr ecx, 16
mov eax, [TASK_BASE]
add ebx, [eax-twdw + WDATA.box.left]
add ecx, [eax-twdw + WDATA.box.top]
mov eax, ebx
shl eax,16
mov ax, bx
add ax, word [esp+16]
mov ebx, ecx
shl ebx,16
mov ax,cx
mov bx,dx
movzx ecx,word [4+32+esp+12]
add eax,ecx
mov ecx,[4+32+esp+0]
cmp [buttontype],dword 0
mov bx, cx
mov ecx, esi
cmp [buttontype], 0
je @f
call incecx2
@@:
movzx edi,word [esp]
mov edx, edi
 
pop edx
and edx, 0xFFFF
 
.newline:
call button_dececx
push edi
244,8 → 226,7
 
button_no_draw:
 
and ecx,0xffff
 
push edi
mov edi,[BTN_ADDR]
movzx eax,word [edi]
cmp eax,max_buttons
254,44 → 235,32
mov [edi],ax
 
shl eax,4
add eax,edi
add edi, eax
 
mov bx,[CURRENT_TASK]
mov [eax],bx
mov ax, [CURRENT_TASK]
stosw
mov ax, dx
stosw ; button id number: bits 0-15
mov eax, ebx
rol eax, 16
stosd ; x start | x size
mov eax, ecx
rol eax, 16
stosd ; y start | y size
mov eax, edx
shr eax, 16
stosw ; button id number: bits 16-31
 
add eax,2 ; save button id number
mov ebx,[esp+4]
mov [eax],bx ; bits 0-15
shr ebx,16
mov [eax-2+0xc],bx; bits 16-31
add eax,2 ; x start
mov bx,[esp+12+2]
mov [eax],bx
add eax,2 ; x size
mov bx,[esp+12+0]
mov [eax],bx
add eax,2 ; y start
mov bx,[esp+8+2]
mov [eax],bx
add eax,2 ; y size
mov bx,[esp+8+0]
mov [eax],bx
pop edi
 
noaddbutt:
 
pop edx
pop ecx
pop ebx
pop eax
pop edi
pop esi
 
ret
 
 
remove_button:
 
and ecx,0x7fffffff
and edx, 0x7fffffff
 
rnewba2:
 
298,32 → 267,27
mov edi,[BTN_ADDR]
mov eax,edi
movzx ebx,word [edi]
inc bx
inc ebx
 
rnewba:
 
dec bx
dec ebx
jz rnmba
 
add eax,0x10
 
mov dx,[CURRENT_TASK]
cmp dx,[eax]
mov cx, [CURRENT_TASK]
cmp cx, [eax]
jnz rnewba
 
cmp cx,[eax+2]
cmp dx, [eax+2]
jnz rnewba
 
pushad
mov ecx,ebx
inc ecx
lea ecx, [ebx+1]
shl ecx,4
mov ebx,eax
add eax,0x10
call memmove
dec dword [edi]
popad
 
jmp rnewba2
 
rnmba:
618,11 → 582,11
mov [DONT_DRAW_MOUSE],byte 0 ; draw mouse
;..................................... start 5/5 : modified by vhanla .............................
; check coordinates
jmp @f
iglobal
mx dw 0x0 ; keeps the x mouse's position when it was clicked
my dw 0x0 ; keeps the y mouse's position when it was clicked
bPressedMouseXY_B db 0x0
@@:
endg
 
pusha
; mouse x >= button x ?
/kernel/trunk/gui/font.inc
10,41 → 10,39
 
align 4
dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
; eax x & y
; ebx style ( 0xX0000000 ) & color ( 0x00RRGGBB )
; ebx x & y
; ecx style ( 0xX0000000 ) & color ( 0x00RRGGBB )
; X = ABnnb:
; nn = font
; A = 0 <=> output edx characters; otherwise output ASCIIZ string
; B = 1 <=> fill background with color esi
; ecx start of text
; A = 0 <=> output esi characters; otherwise output ASCIIZ string
; B = 1 <=> fill background with color eax
; edx start of text
; edi 1 force
 
pushad
call [disable_mouse]
 
mov ebp, ecx ; ebp=pointer to text
mov ecx, ebx ; ecx=color
movsx ebx, ax ; ebx=y
sar eax, 16 ; eax=x
cmp edx, 255
movsx eax, bx ; eax=y
sar ebx, 16 ; ebx=x
xchg eax, ebx ; eax=x, ebx=y
cmp esi, 255
jb .loop
mov edx, 255
mov esi, 255
.loop:
test ecx, ecx
js .test_asciiz
dec edx
dec esi
js .end
jmp @f
.test_asciiz:
cmp byte [ebp], 0
cmp byte [edx], 0
jz .end
@@:
push edx
movzx edx, byte [ebp]
inc ebp
inc edx
pushad
movzx edx, byte [edx-1]
test ecx, 0x10000000
jnz .font2
pushad
mov esi, 9
lea ebp, [FONT_I+8*edx+edx]
.symloop1:
60,7 → 58,7
test ecx, 0x40000000
jz .pixloop1cont
push ecx
mov ecx, [esp+4+4]
mov ecx, [esp+4+20h+1Ch]
call [putpixel]
pop ecx
.pixloop1cont:
74,10 → 72,8
jnz .symloop1
popad
add eax, 6
pop edx
jmp .loop
.font2:
pushad
add edx, edx
lea ebp, [FONT_II+4*edx+edx+1]
push 9
94,7 → 90,7
test ecx, 0x40000000
jz .pixloop2cont
push ecx
mov ecx, [esp+12+4]
mov ecx, [esp+12+20h+1Ch]
call [putpixel]
pop ecx
.pixloop2cont:
110,7 → 106,6
pop eax
add dword [esp+28], esi
popad
pop edx
jmp .loop
.end:
popad
/kernel/trunk/gui/window.inc
1333,7 → 1333,7
mov [WIN_TEMP_XY], esi
 
pushad ; wait for putimages to finish
; mov eax,5
; mov ebx,5
; call delay_hs
mov eax,[edi + WDATA.box.left]
mov [npx],eax