Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2971 → Rev 996

/kernel/branches/kolibri_pe/gui/win.c
File deleted
/kernel/branches/kolibri_pe/gui/button.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
;; Distributed under terms of the GNU General Public License ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
/kernel/branches/kolibri_pe/gui/window.inc
22,7 → 22,7
mov al,[edi+WDATA.fl_wstyle]
and al,0x0F
cmp al,0x03
jb @f
jne @f
mov eax,[_skinh]
add eax,3
ret
557,6 → 557,7
 
 
 
 
check_window_position:
 
pushad ; window inside screen ?
861,6 → 862,7
jnz noinside2
call [drawbar]
noinside2:
 
popad
 
ret
1128,11 → 1130,13
ret
 
 
;iglobal
; window_moving db 'K : Window - move/resize',13,10,0
; window_moved db 'K : Window - done',13,10,0
;endg
iglobal
window_moving db 'K : Window - move/resize',13,10,0
window_moved db 'K : Window - done',13,10,0
endg
 
bPressedMouseXY_W db 0x0
 
; check window touch
align 4
checkwindows:
1160,60 → 1164,34
popad
ret
.mouse_buttons_pressed:
;..................................... start 2/4 : modified by vhanla .................
uglobal
bPressedMouseXY_W db 0x0
endg
;..................................... end 2/4 : modified by vhanla ...................
mov esi,[TASK_COUNT]
inc esi
 
;..................................... start 3/4 : modified by vhanla .................
cmp [bPressedMouseXY_W],1
ja @f
inc [bPressedMouseXY_W]
jnc @f
;mov ax,[MOUSE_X]
;mov [mx],ax
;mov ax,[MOUSE_Y]
;mov [my],ax
mov eax,dword[MOUSE_X]
mov dword[mx],eax
cmp [bPressedMouseXY_W],0
jnz @f
mov [bPressedMouseXY_W],1
@@:
;..................................... end 3/4 : modified by vhanla ...................
 
movzx eax,word [MOUSE_Y]
movzx ebx,word [MOUSE_X]
mov ecx, [Screen_Max_X]
add ebx, [_display_data]
inc ecx
mul ecx
movzx edi, byte [ebx+eax]
 
cwloop:
cmp esi,2
jb .exit
 
dec esi
movzx edi, word [WIN_POS + esi * 2] ; ebx
movzx esi, word [WIN_STACK + edi * 2]
 
shl edi, 5
add edi, window_data
; mov edi, ebx
mov ecx, [edi + WDATA.box.left]
mov edx, [edi + WDATA.box.top]
 
mov eax,ecx
mov ebx,edx
test [edi+WDATA.fl_wstate],WSTATE_MINIMIZED
jnz cwloop
movzx eax,word [MOUSE_X]
movzx ebx,word [MOUSE_Y]
 
;..................................... start 4/4 : modified by vhanla .................
movzx eax, word [mx]; movzx eax,word[MOUSE_X]
movzx ebx, word [my]; movzx ebx,word[MOUSE_Y]
;..................................... endt 4/4 : modified by vhanla ..................
cmp ecx, eax
jae cwloop
cmp edx, ebx
jae cwloop
add ecx, [edi + WDATA.box.width]
add edx, [edi + WDATA.box.height]
cmp eax, ecx
jae cwloop
cmp ebx, edx
jae cwloop
 
pushad
mov eax, esi
mov ebx, [TASK_COUNT]
1220,14 → 1198,10
cmp eax, ebx ; is this window active?
jz .move_resize_window
 
cmp [bPressedMouseXY_W], 1
ja .exit_popa
 
; eax = position in windowing stack
; redraw must ?
lea esi, [WIN_POS + esi * 2]
call waredraw
.exit_popa:
add esp, 32
 
.exit:
1278,10 → 1252,10
 
.continue:
 
; push esi
; mov esi, window_moving
; call sys_msg_board_str
; pop esi
push esi
mov esi, window_moving
call sys_msg_board_str
pop esi
 
mov ecx, [timer_ticks] ; double-click ?
mov edx, ecx
1337,7 → 1311,6
call drawwindowframes
 
mov [reposition],0
mov [MOUSE_DOWN],byte 1 ; no reaction to mouse up/down
 
; move window
 
1347,7 → 1320,6
 
call checkVga_N13
 
mov [MOUSE_BACKGROUND],byte 0
 
call [draw_pointer]
 
1356,7 → 1328,7
popad
 
mov esi,[WIN_TEMP_XY]
cmp esi,[MOUSE_X]
cmp esi, dword [MOUSE_X]
je cwb
 
mov cx,[MOUSE_X]
1636,8 → 1608,8
 
retwm:
 
; mov esi,window_moved
; call sys_msg_board_str
mov esi,window_moved
call sys_msg_board_str
 
popad
 
1773,405 → 1745,3
ret
 
 
;ebx x
;eax y
;ecx width
;edx height
;esi slot
 
align 4
_set_screen:
push edx
add ebx, [_display_data]
mul [_screen_width]
lea ebx, [eax+ebx]
 
mov eax, esi
mov ah, al
mov esi, eax
shl eax, 16
or eax, esi
 
pop edx
mov esi, ecx
.row:
 
mov edi, ebx
add ebx, [_screen_width]
 
mov ecx, esi
 
dec edx
js .done
.16:
cmp ecx, 16
jb .8
 
mov [edi], eax
mov [edi+4], eax
mov [edi+8], eax
mov [edi+12], eax
add edi, 16
sub ecx, 16
jmp .16
.8:
shr ecx, 2
rep stosd
mov ecx, esi
and ecx, 3
rep stosb
jmp .row
.done:
ret
 
;[esp+4] ebp
;[esp+8] x
;[esp+12] y
;[esp+16] w
;[esp+20] h
;[esp+24] color
 
;ebx disp data
;edx dest
 
public _int_draw_bar
align 4
_int_draw_bar:
 
lea ecx, [esp+4]
call lock_cursor
 
sub esp, 4
mov [esp], ebp
 
mov ebx, [esp+8]
mov eax, [esp+12]
mul [_screen_width]
add ebx, [_display_data]
lea ebx, [eax+ebx]
 
mov edi, [esp+8]
mov eax, [esp+12]
mul [BytesPerScanLine]
 
cmp byte [ScreenBPP], 24
je .24
 
lea ecx, [LFB_BASE+eax+edi*4]
 
mov eax, [esp+24]
mov edx, [CURRENT_TASK]
.row32:
mov edi, ecx
mov esi, ebx
 
add ecx, [BytesPerScanLine]
add ebx, [_screen_width]
 
dec dword [esp+20]
js .done
 
mov ebp, [esp+16]
 
align 16
.draw32:
cmp dl, byte [esi]
jne @f
 
stosd
@@:
inc esi
dec ebp
jnz .draw32
jmp .row32
.done:
call unlock_cursor
 
mov ebp, [esp]
add esp, 4
ret
 
.24:
lea ecx, [LFB_BASE+edi*3]
add ecx, eax
 
mov eax, [esp+24]
mov edx, eax
shr edx, 8
mov dl, [CURRENT_TASK]
.row24:
mov edi, ecx
mov esi, ebx
 
add ecx, [BytesPerScanLine]
add ebx, [_screen_width]
 
dec dword [esp+20]
js .done
 
mov ebp, [esp+16]
 
align 16
.draw24:
cmp dl, byte [esi]
jne @f
 
mov [edi], ax
mov [edi+2], dh
@@:
add edi, 3
inc esi
dec ebp
jnz .draw24
jmp .row24
 
 
 
;[esp+4] x
;[esp+8] y
;[esp+12] w
;[esp+16] color
 
;esi disp data
;edi dest
 
 
public _int_hline
align 4
_int_hline:
 
mov esi, [esp+4]
mov eax, [esp+8]
mov ecx, [esp+12]
 
mul [_screen_width]
add esi, [_display_data]
add esi, eax
 
mov edi, [esp+4]
mov eax, [esp+8]
mul [BytesPerScanLine]
 
cmp byte [ScreenBPP], 24
je .24
 
lea edi, [LFB_BASE+eax+edi*4]
 
mov eax, [esp+16]
 
.32_kernel:
mov edx, [CURRENT_TASK]
 
align 16
.draw32:
cmp dl, byte [esi]
jne @f
 
stosd
@@:
inc esi
dec ecx
jnz .draw32
 
ret
.24:
lea edi, [LFB_BASE+edi*3]
add edi, eax
 
mov eax, [esp+16]
 
.24_kernel:
mov edx, eax
shr edx, 8
mov dl, [CURRENT_TASK]
 
align 16
.draw24:
cmp dl, byte [esi]
jne @f
 
mov [edi], ax
mov [edi+2], dh
@@:
add edi, 3
inc esi
dec ecx
jnz .draw24
 
ret
 
 
;[esp+4] x
;[esp+8] y
;[esp+12] h
;[esp+16] color
 
;esi disp data
;edi dest
 
public _int_vline
align 4
_int_vline:
 
mov esi, [esp+4]
mov eax, [esp+8]
mov ecx, [esp+12]
 
mul [_screen_width]
add esi, [_display_data]
add esi, eax
 
mov edi, [esp+4]
mov eax, [esp+8]
mul [BytesPerScanLine]
 
cmp byte [ScreenBPP], 24
je .24
 
lea edi, [LFB_BASE+eax+edi*4]
 
mov eax, [esp+16]
 
.32_kernel:
mov edx, [CURRENT_TASK]
 
align 16
.draw32:
cmp dl, byte [esi]
jne @f
 
mov [edi], eax
@@:
add esi, [_screen_width]
add edi, [BytesPerScanLine]
dec ecx
jnz .draw32
 
ret
.24:
lea edi, [LFB_BASE+edi*3]
add edi, eax
 
mov eax, [esp+16]
 
.24_kernel:
mov edx, eax
shr edx, 8
mov dl, [CURRENT_TASK]
 
align 16
.draw24:
cmp dl, byte [esi]
jne @f
 
mov [edi], ax
mov [edi+2], dh
@@:
add esi, [_screen_width]
add edi, [BytesPerScanLine]
dec ecx
jnz .draw24
 
ret
 
;[esp] dst
;[esp+4] mask
 
;[esp+12] x
;[esp+16] y
;[esp+20] w
;[esp+24] h
;[esp+32] color
 
public _int_rectangle
align 4
_int_rectangle:
 
.dst equ (esp)
.mask equ (esp+4)
 
.x equ (esp+12)
.y equ (esp+16)
.w equ (esp+20)
.h equ (esp+24)
.color equ (esp+28)
 
sub esp, 8
 
mov esi, [.x]
mov eax, [.y]
mul [_screen_width]
add esi, [_display_data]
add esi, eax
mov [.mask], esi
 
mov edi, [.x]
mov eax, [.y]
mul [BytesPerScanLine]
 
cmp byte [ScreenBPP], 24
je .24
 
lea edi, [LFB_BASE+eax+edi*4]
 
mov [.dst], edi
 
mov ecx, [.w]
mov eax, [.color]
call _int_hline.32_kernel
 
sub edi, 4
dec esi
 
mov ecx, [.h]
call _int_vline.32_kernel
 
mov edi, [.dst]
mov esi, [.mask]
mov ecx, [.h]
call _int_vline.32_kernel
 
mov ecx, [.w]
sub esi, [_screen_width]
sub edi, [BytesPerScanLine]
call _int_hline.32_kernel
 
add esp, 8
ret
.24:
lea edi, [LFB_BASE+edi*3]
add edi, eax
 
mov [.dst], edi
 
mov ecx, [.w]
mov eax, [.color]
call _int_hline.24_kernel
 
sub edi, 3
dec esi
 
mov ecx, [.h]
call _int_vline.24_kernel
 
mov edi, [.dst]
mov esi, [.mask]
mov ecx, [.h]
call _int_vline.24_kernel
 
mov ecx, [.w]
sub esi, [_screen_width]
sub edi, [BytesPerScanLine]
call _int_hline.24_kernel
 
restore .dst
restore .mask
 
restore .x
restore .y
restore .w
restore .h
restore .color
 
add esp, 8
ret
/kernel/branches/kolibri_pe/gui/font.inc
1,6 → 1,6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;