Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5847 → Rev 5846

/kernel/trunk/gui/window.inc
30,9 → 30,12
draw_limits RECT
endg
 
align 4
;------------------------------------------------------------------------------
syscall_draw_window: ;///// system function 0 /////////////////////////////////
;------------------------------------------------------------------------------
;? <description>.
;------------------------------------------------------------------------------
mov eax, edx
shr eax, 24
and al, 0x0f
50,14 → 53,18
call drawwindow_I
jmp window._.draw_window_caption.2
;--------------------------------------
align 4
@@:
dec al
jnz @f
 
; type II - only reserve area, no draw
; call sys_window_mouse
; call [draw_pointer]
call __sys_draw_pointer
jmp .exit
;--------------------------------------
align 4
@@:
dec al
jnz @f
65,9 → 72,11
; type III - new style
call drawwindow_III
jmp window._.draw_window_caption.2
 
; type IV & V - skinned window (resizable & not)
;--------------------------------------
align 4
@@:
; type IV & V - skinned window (resizable & not)
mov eax, [TASK_COUNT]
movzx eax, word[WIN_POS + eax * 2]
cmp eax, [CURRENT_TASK]
77,9 → 86,12
call drawwindow_IV
jmp window._.draw_window_caption.2
;--------------------------------------
align 4
.exit:
ret
;------------------------------------------------------------------------------
align 4
;------------------------------------------------------------------------------
syscall_display_settings: ;///// system function 48 ///////////////////////////
;------------------------------------------------------------------------------
;; Redraw screen:
123,35 → 135,45
;< ecx = pointer to FileInfoBlock struct
;> eax = FS error code
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;; Get font smoothing:
;; Set font smoothing:
;< ebx = 9
;> eax = 0 — off, 1 — on, 2 — subpixel
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;; Set font smoothing:
;< ebx = 10
;< ecx = 0 — off, 1 — on, 2 — subpixel
;< ecx = 0 (off) or !0 (on)
;------------------------------------------------------------------------------
cmp ebx, .sizeof.ftable / 4
ja @f
jmp [.ftable + ebx * 4]
;--------------------------------------
align 4
@@:
ret
;------------------------------------------------------------------------------
align 4
syscall_display_settings.00:
xor eax, eax
inc ebx
cmp [windowtypechanged], ebx
jne @f
jne .exit
mov [windowtypechanged], eax
 
jmp syscall_display_settings._.redraw_whole_screen
;--------------------------------------
align 4
.exit:
ret
;------------------------------------------------------------------------------
align 4
syscall_display_settings.01:
and ecx, 1
cmp ecx, [buttontype]
je @f
je .exit
mov [buttontype], ecx
mov [windowtypechanged], ebx
@@:
;--------------------------------------
align 4
.exit:
ret
;------------------------------------------------------------------------------
align 4
syscall_display_settings.02:
dec ebx
mov esi, ecx
165,6 → 187,7
mov [windowtypechanged], ebx
ret
;------------------------------------------------------------------------------
align 4
syscall_display_settings.03:
mov edi, ecx
cmp edx, 192
176,11 → 199,13
rep movsb
ret
;------------------------------------------------------------------------------
align 4
syscall_display_settings.04:
mov eax, [_skinh]
mov [esp + 32], eax
ret
;------------------------------------------------------------------------------
align 4
syscall_display_settings.05:
mov eax, [screen_workarea.left - 2]
mov ax, word[screen_workarea.right]
190,8 → 215,10
mov [esp + 20], eax
ret
;------------------------------------------------------------------------------
align 4
syscall_display_settings.06:
xor esi, esi
 
mov edi, [_display.width]
dec edi
mov eax, ecx
203,13 → 230,19
or eax, eax
jge @f
xor eax, eax
;--------------------------------------
align 4
@@:
mov [screen_workarea.left], eax
cmp ebx, edi
jle @f
mov ebx, edi
;--------------------------------------
align 4
@@:
mov [screen_workarea.right], ebx
;--------------------------------------
align 4
.check_horizontal:
mov edi, [_display.height]
dec edi
222,48 → 255,59
or eax, eax
jge @f
xor eax, eax
;--------------------------------------
align 4
@@:
mov [screen_workarea.top], eax
cmp ebx, edi
jle @f
mov ebx, edi
;--------------------------------------
align 4
@@:
mov [screen_workarea.bottom], ebx
;--------------------------------------
align 4
.check_if_redraw_needed:
or esi, esi
jz @f
jz .exit
 
call repos_windows
jmp syscall_display_settings._.calculate_whole_screen
;--------------------------------------
align 4
.exit:
ret
;------------------------------------------------------------------------------
align 4
syscall_display_settings.07:
mov eax, [_skinmargins + 0]
mov [esp + 32], eax
mov eax, [_skinmargins + 4]
mov [esp + 20], eax
@@:
ret
;------------------------------------------------------------------------------
align 4
syscall_display_settings.08:
mov ebx, ecx
call read_skin_file
mov [esp + 32], eax
test eax, eax
jnz @b
jnz .exit
 
call syscall_display_settings._.calculate_whole_screen
jmp syscall_display_settings._.redraw_whole_screen
;--------------------------------------
align 4
.exit:
ret
;------------------------------------------------------------------------------
align 4
syscall_display_settings.09:
xor eax, eax
mov al, [fontSmoothing]
mov [esp + 32], eax
ret
;------------------------------------------------------------------------------
syscall_display_settings.10:
mov [fontSmoothing], cl
ret
;------------------------------------------------------------------------------
align 4
syscall_display_settings._.calculate_whole_screen:
xor eax, eax
xor ebx, ebx
273,6 → 317,7
dec edx
jmp calculatescreen
;------------------------------------------------------------------------------
align 4
syscall_display_settings._.redraw_whole_screen:
xor eax, eax
mov [draw_limits.left], eax
286,6 → 331,8
mov eax, window_data
jmp redrawscreen
;------------------------------------------------------------------------------
align 4
;------------------------------------------------------------------------------
syscall_set_window_shape: ;///// system function 50 ///////////////////////////
;------------------------------------------------------------------------------
;; Set window shape address:
1400,7 → 1447,7
 
iglobal
FuncTable syscall_display_settings, ftable, \
00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10
00, 01, 02, 03, 04, 05, 06, 07, 08, 09
 
align 4
window_topleft dd \
/kernel/trunk/gui/font.inc
249,25 → 249,25
inc esi
cmp [fontSmoothing], 0
jz .nextPixel
.checkLeftSM: ; smoothing
.checkLeftSubP: ; subpixel smoothing
bsf eax, edx
dec eax
js .checkRightSM
js .checkRightSubP
bt [ebx], eax
jc .checkRightSM
jc .checkRightSubP
dec eax
js .checkLeftDownSM
js .checkLeftDownSubP
bt [ebx], eax
jc .checkRightSM
.checkLeftDownSM:
jc .checkRightSubP
.checkLeftDownSubP:
inc eax
bt [ebx+1], eax
jnc .checkLeftUpSM
jnc .checkLeftUpSubP
inc eax
bt [ebx+1], eax
jnc @f
bt [ebx-1], eax
jc .checkRightSM
jc .checkRightSubP
dec eax
dec eax
js @f
274,19 → 274,19
bt [ebx+1], eax
jnc @f
inc eax
.checkLeftUpSM:
.checkLeftUpSubP:
bt [ebx-1], eax
jnc .checkRightSM
jnc .checkRightSubP
inc eax
bt [ebx-1], eax
jnc @f
bt [ebx+1], eax
jc .checkRightSM
jc .checkRightSubP
dec eax
dec eax
js @f
bt [ebx-1], eax
jc .checkRightSM
jc .checkRightSubP
@@:
mov ecx, [esp+20+deltaToScreen]
mov eax, [edi-4]
301,11 → 301,6
push ebx edx
mov ebx, ebp
xor ecx, ecx
cmp [fontSmoothing], 1
jnz .subpixelLeft
call antiAliasing
jmp @f
.subpixelLeft:
mov cl, bl
lea edx, [ecx*8+ecx]
lea edx, [ecx*2+edx]
337,10 → 332,9
shr ecx, 3
mov al, cl
rol eax, 16
@@:
mov [edi-4], eax
pop edx ebx
.checkRightSM:
.checkRightSubP:
bsf eax, edx
inc eax
bt [ebx], eax
349,9 → 343,9
bt [ebx], eax
jc .nextPixel
dec eax
.checkRightDownSM:
.checkRightDownSubP:
bt [ebx+1], eax
jnc .checkRightUpSM
jnc .checkRightUpSubP
dec eax
bt [ebx+1], eax
jnc @f
362,7 → 356,7
bt [ebx+1], eax
jnc @f
dec eax
.checkRightUpSM:
.checkRightUpSubP:
bt [ebx-1], eax
jnc .nextPixel
dec eax
388,11 → 382,6
push ebx edx
mov ebx, ebp
xor ecx, ecx
cmp [fontSmoothing], 1
jnz .subpixelRight
call antiAliasing
jmp @f
.subpixelRight:
mov cl, al
mov edx, ecx
shl ecx, 3
424,7 → 413,6
shr edx, 4
mov al, dl
rol eax, 16
@@:
mov [edi+4], eax
pop edx ebx
jmp .nextPixel
768,25 → 756,7
jnz drawChar
ret
 
antiAliasing:
mov bp, 3
@@:
mov cl, al
mov dl, bl
lea ecx, [ecx*2+ecx]
add ecx, edx
shr ecx, 2
mov al, cl
ror eax, 8
ror ebx, 8
dec bp
jnz @b
ror eax, 8
ror ebx, 8
mov ebp, ebx
ret
 
fontSmoothing db 2
fontSmoothing db 1
font1:
if lang eq sp
file 'char_sp.mt'