Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2436 → Rev 2435

/kernel/trunk/kernel.asm
419,7 → 419,14
cmp [SCR_MODE], word 0x13 ; EGA 320*200 256 colors
je v20ga32
jmp v20ga24
 
; mov [PUTPIXEL], dword Vesa12_putpixel24 ; Vesa 1.2
; mov [GETPIXEL], dword Vesa12_getpixel24
; cmp [ScreenBPP], byte 24
; jz ga24
; mov [PUTPIXEL], dword Vesa12_putpixel32
; mov [GETPIXEL], dword Vesa12_getpixel32
; ga24:
; jmp v20ga24
setvesa20:
mov [PUTPIXEL], dword Vesa20_putpixel24 ; Vesa 2.0
mov [GETPIXEL], dword Vesa20_getpixel24
/kernel/trunk/video/vesa20.inc
452,12 → 452,7
.finish:
add esp, putimg.stack_data
popad
cmp [SCR_MODE], dword 0x12
jne @f
call VGA__putimage
;--------------------------------------
align 4
@@:
mov [EGA_counter], 1
ret
;--------------------------------------
605,7 → 600,7
; check mouse area for putpixel
test eax, 0x04000000
jnz @f
call check_mouse_area_for_putpixel
call [_display.check_mouse]
;--------------------------------------
align 4
@@:
613,48 → 608,7
mov [LFB_BASE+ebx+edi], ax
shr eax, 16
mov [LFB_BASE+ebx+edi+2], al
ret
;-----------------------------------------------------------------------------
align 4
Vesa20_putpixel24_new:
; eax = x
; ebx = y
mov ecx, eax
shl ecx, 16
mov cx, bx
 
imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
lea edi, [eax+eax*2]; edi = x*3
mov eax, [esp+32-8+4]
;--------------------------------------
; check mouse area for putpixel
test eax, 0x04000000
jnz @f
;--------------------------------------
; check for Y
cmp cx, [Y_UNDER_subtraction_CUR_hot_y]
jb @f
 
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
jae @f
 
rol ecx, 16
;--------------------------------------
; check for X
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
jb @f
 
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
jae @f
 
call check_mouse_area_for_putpixel_new.1
;--------------------------------------
align 4
@@:
; store to real LFB
mov [LFB_BASE+ebx+edi], ax
shr eax, 16
mov [LFB_BASE+ebx+edi+2], al
ret
;-----------------------------------------------------------------------------
align 4
672,7 → 626,7
; check mouse area for putpixel
test eax, 0x04000000
jnz @f
call check_mouse_area_for_putpixel
call [_display.check_mouse]
;--------------------------------------
align 4
@@:
679,47 → 633,7
and eax, 0xffffff
; store to real LFB
mov [LFB_BASE+edi], eax
ret
;-----------------------------------------------------------------------------
align 4
Vesa20_putpixel32_new:
; eax = x
; ebx = y
mov ecx, eax
shl ecx, 16
mov cx, bx
 
imul ebx, [BytesPerScanLine] ; ebx = y * y multiplier
lea edi, [ebx+eax*4]; edi = x*4+(y*y multiplier)
mov eax, [esp+32-8+4]; eax = color
;--------------------------------------
; check mouse area for putpixel
test eax, 0x04000000
jnz @f
;--------------------------------------
; check for Y
cmp cx, [Y_UNDER_subtraction_CUR_hot_y]
jb @f
 
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
jae @f
 
rol ecx, 16
;--------------------------------------
; check for X
cmp cx, [X_UNDER_subtraction_CUR_hot_x]
jb @f
 
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
jae @f
 
call check_mouse_area_for_putpixel_new.1
;--------------------------------------
align 4
@@:
and eax, 0xffffff
; store to real LFB
mov [LFB_BASE+edi], eax
ret
;-----------------------------------------------------------------------------
align 4
1294,12 → 1208,7
.end:
add esp, drbar.stack_data
popad
cmp [SCR_MODE], dword 0x12
jne @f
call VGA_draw_bar
;--------------------------------------
align 4
@@:
xor eax, eax
mov [EGA_counter], 1
ret
1482,12 → 1391,7
jbe dp2
popad
mov [EGA_counter], 1
cmp [SCR_MODE], dword 0x12
jne @f
call VGA_drawbackground
;--------------------------------------
align 4
@@:
ret
;------------------------------------------------------------------------------
align 4
1694,12 → 1598,7
add esp, 44
popad
mov [EGA_counter], 1
cmp [SCR_MODE], dword 0x12
jne @f
call VGA_drawbackground
;--------------------------------------
align 4
@@:
ret
 
uglobal
/kernel/trunk/video/cursors.inc
1000,19 → 1000,6
mov [_display.check_mouse], check_mouse_area_for_putpixel_new
mov [_display.check_m_pixel], check_mouse_area_for_getpixel_new
 
cmp [PUTPIXEL], dword VGA_putpixel
je @f
cmp [ScreenBPP], byte 32
je .32
mov [PUTPIXEL], dword Vesa20_putpixel24_new
jmp @f
;--------------------------------------
align 4
.32:
mov [PUTPIXEL], dword Vesa20_putpixel32_new
;--------------------------------------
align 4
@@:
stdcall load_cursor, def_arrow, dword LOAD_FROM_MEM
mov [def_cursor], eax
ret
/kernel/trunk/video/vga.inc
13,8 → 13,7
 
$Revision$
 
;------------------------------------------------------------------------------
align 4
 
paletteVGA:
 
;16 colour palette
25,9 → 24,9
mov ecx, 16
mov dx, 0x3c9
xor eax, eax
;--------------------------------------
align 4
 
palvganew:
 
mov al, 0
test ah, 4
jz palvgalbl1
35,8 → 34,6
test ah, 8
jz palvgalbl1
add al, 32
;--------------------------------------
align 4
palvgalbl1:
out dx, al; red 0,31 or 63
mov al, 0
46,8 → 43,6
test ah, 8
jz palvgalbl2
add al, 32
;--------------------------------------
align 4
palvgalbl2:
out dx, al; blue 0,31 or 63
mov al, 0
57,8 → 52,6
test ah, 8
jz palvgalbl3
add al, 32
;--------------------------------------
align 4
palvgalbl3:
out dx, al; green 0,31 or 63
add ah, 1
67,9 → 60,9
; mov ax, 0005h
; out dx, ax
ret
;------------------------------------------------------------------------------
align 4
 
palette320x200:
 
mov edx, 0x3c8
xor eax, eax
out dx, al
76,21 → 69,16
mov ecx, 256
mov edx, 0x3c9
xor eax, eax
;--------------------------------------
align 4
 
palnew:
mov al, 0
test ah, 64
jz pallbl1
add al, 21
;--------------------------------------
align 4
pallbl1:
test ah, 128
jz pallbl2
add al, 42
;--------------------------------------
align 4
pallbl2:
out dx, al
mov al, 0
97,20 → 85,14
test ah, 8
jz pallbl3
add al, 8
;--------------------------------------
align 4
pallbl3:
test ah, 16
jz pallbl4
add al, 15
;--------------------------------------
align 4
pallbl4:
test ah, 32
jz pallbl5
add al, 40
;--------------------------------------
align 4
pallbl5:
out dx, al
mov al, 0
117,26 → 99,20
test ah, 1
jz pallbl6
add al, 8
;--------------------------------------
align 4
pallbl6:
test ah, 2
jz pallbl7
add al, 15
;--------------------------------------
align 4
pallbl7:
test ah, 4
jz pallbl8
add al, 40
;--------------------------------------
align 4
pallbl8:
out dx, al
add ah, 1
loop palnew
 
ret
;------------------------------------------------------------------------------
align 4
uglobal
novesachecksum dd 0x0
147,12 → 123,13
temp:
.cx dd 0
endg
;------------------------------------------------------------------------------
align 4
checkVga_N13:
 
cmp [SCR_MODE], dword 0x13
jne @f
 
; cnvl:
pushad
cmp [EGA_counter], 1
je novesal
160,12 → 137,9
cmp ecx, [novesachecksum]
jne novesal
popad
;--------------------------------------
align 4
@@:
ret
;--------------------------------------
align 4
 
novesal:
mov [novesachecksum], ecx
mov ecx, 0
173,14 → 147,10
cmp eax, 100
jge m13l3
mov eax, 100
;--------------------------------------
align 4
m13l3:
cmp eax, 480-100
jbe m13l4
mov eax, 480-100
;--------------------------------------
align 4
m13l4:
sub eax, 100
imul eax, 640*4
189,14 → 159,10
cmp eax, 160
jge m13l1
mov eax, 160
;--------------------------------------
align 4
m13l1:
cmp eax, 640-160
jbe m13l2
mov eax, 640-160
;--------------------------------------
align 4
m13l2:
sub eax, 160
shl eax, 2
207,8 → 173,6
mov edx, 200
mov ecx, 320
cld
;--------------------------------------
align 4
m13pix:
lodsd
test eax, eax
224,8 → 188,6
and ebx, (128+64)*256*256; red
shr ebx, 8+8
add eax, ebx
;--------------------------------------
align 4
.save_pixel:
stosb
loop m13pix
236,17 → 198,16
mov [EGA_counter], 0
popad
ret
;------------------------------------------------------------------------------
align 4
 
VGA_drawbackground:
; draw all
cmp [SCR_MODE], dword 0x12
jne .end
pushad
mov esi, [LFBAddress]
mov edi, VGABasePtr
mov ebx, 640/32; 640*480/(8*4)
mov edx, 480
;--------------------------------------
align 4
@@:
push ebx edx esi edi
shl edx, 9
260,9 → 221,9
jnz @r
call VGA_draw_long_line_1
popad
.end:
ret
;------------------------------------------------------------------------------
align 4
 
VGA_draw_long_line:
mov dx, 3ceh
mov ax, 0ff08h
270,8 → 231,6
out dx, ax
mov ax, 0005h
out dx, ax
;--------------------------------------
align 4
m12pix:
call VGA_draw_32_pixels
dec ebx
287,8 → 246,7
out dx, al
sti
ret
;------------------------------------------------------------------------------
align 4
 
VGA_draw_32_pixels:
xor eax, eax
mov ebp, VGA_8_pixels
297,12 → 255,8
mov [ebp+8], eax
mov [ebp+12], eax
mov ch, 4
;--------------------------------------
align 4
.main_loop:
mov cl, 8
;--------------------------------------
align 4
.convert_pixels_to_VGA:
lodsd ; eax = 24bit colour
test eax, eax
319,8 → 273,6
cmp al, 170
jbe .p13green
or [ebp+12], ch
;--------------------------------------
align 4
.p13green:
cmp ah, 85
jbe .p13red
328,8 → 280,6
cmp ah, 170
jbe .p13red
or [ebp+12], ch
;--------------------------------------
align 4
.p13red:
shr eax, 8
cmp ah, 85
338,14 → 288,10
cmp ah, 170
jbe .p13cont
or [ebp+12], ch
;--------------------------------------
align 4
.p13cont:
ror eax, 8
mov ch, ah
inc cl
;--------------------------------------
align 4
.end:
dec cl
jnz .convert_pixels_to_VGA
357,8 → 303,6
mov esi, ebp
mov dx, 3c4h
mov ah, 1h
;--------------------------------------
align 4
@@:
mov al, 02h
out dx, ax
372,25 → 316,12
add edi, 4
pop esi
ret
;------------------------------------------------------------------------------
align 4
 
VGA_putpixel:
; eax = x
; ebx = y
mov ecx, eax
mov eax, [esp+32-8+4] ; color
;--------------------------------------
push ecx
shl ecx, 16
mov cx, bx
; check mouse area for putpixel
test eax, 0x04000000
jnz @f
call [_display.check_mouse]
;--------------------------------------
align 4
@@:
pop ecx
shl ebx, 9
lea ebx, [ebx+ebx*4] ; óìíîæåíèå íà 5
lea edx, [ebx+ecx*4] ; + x*BytesPerPixel (Vesa2.0 32)
412,8 → 343,6
cmp al, 170
jbe .p13green
or dl, 0x08
;--------------------------------------
align 4
.p13green:
cmp ah, 85
jbe .p13red
421,8 → 350,6
cmp ah, 170
jbe .p13red
or dl, 0x08
;--------------------------------------
align 4
.p13red:
shr eax, 8
cmp ah, 85
431,8 → 358,6
cmp ah, 170
jbe .p13cont
or dl, 0x08
;--------------------------------------
align 4
.p13cont:
ror edx, 8
inc cl
446,12 → 371,14
rol edx, 8
mov [edi], dl
popfd
;.end:
ret
;------------------------------------------------------------------------------
align 4
 
VGA__putimage:
; ecx = size [x|y]
; edx = coordinates [x|y]
cmp [SCR_MODE], dword 0x12
jne @f
pushad
rol edx, 16
movzx eax, dx
462,14 → 389,16
movzx ecx, cx
call VGA_draw_bar_1
popad
@@:
ret
;------------------------------------------------------------------------------
align 4
 
VGA_draw_bar:
; eax cx
; ebx cy
; ecx xe
; edx ye
cmp [SCR_MODE], dword 0x12
jne @f
pushad
sub ecx, eax
sub edx, ebx
479,9 → 408,9
and edx, 0xffff
call VGA_draw_bar_1
popad
@@:
ret
;------------------------------------------------------------------------------
align 4
 
VGA_draw_bar_1:
mov [temp.cx], eax
mov eax, [TASK_BASE]
500,8 → 429,6
mov ebx, ecx
shr ebx, 5
inc ebx
;--------------------------------------
align 4
.main_loop:
call VGA_draw_long_line_1
dec edx
508,8 → 435,7
jnz .main_loop
call VGA_draw_long_line_1
ret
;------------------------------------------------------------------------------
align 4
 
VGA_draw_long_line_1:
push ebx edx esi edi
shl edx, 9
520,4 → 446,5
call VGA_draw_long_line
pop edi esi edx ebx
ret
;------------------------------------------------------------------------------
 
 
/kernel/trunk/gui/font.inc
7,7 → 7,7
 
$Revision$
 
;------------------------------------------------------------------------------
; // Alver 22.06.2008 // {
align 4
dtext_asciiz_esi: ; for skins title out
push eax
14,7 → 14,8
xor eax, eax
inc eax
jmp dtext.1
;------------------------------------------------------------------------------
; } \\ Alver \\
 
align 4
dtext: ; Text String Output (rw by Johnny_B[john@kolibrios.org])
; ebx x & y
25,11 → 26,12
; B = 1 <=> fill background with color eax
; edx start of text
; edi 1 force
 
; // Alver 22.06.2008 // {
push eax
xor eax, eax
;--------------------------------------
align 4
.1:
; } \\ Alver \\
pushad
movsx eax, bx ; eax=y
sar ebx, 16 ; ebx=x
37,8 → 39,6
cmp esi, 255
jb .loop
mov esi, 255
;--------------------------------------
align 4
.loop:
test ecx, ecx
js .test_asciiz
45,18 → 45,15
dec esi
js .end
jmp @f
;--------------------------------------
align 4
.test_asciiz:
cmp byte [edx], 0
jz .end
 
; // Alver 22.06.2008 // {
cmp byte [esp+28], 1
jne @f
dec esi
js .end
;--------------------------------------
align 4
; } \\ Alver \\
@@:
inc edx
pushad
65,13 → 62,9
jnz .font2
mov esi, 9
lea ebp, [FONT_I+8*edx+edx]
;--------------------------------------
align 4
.symloop1:
mov dl, byte [ebp]
or dl, 1 shl 6
;--------------------------------------
align 4
.pixloop1:
shr dl, 1
jz .pixloop1end
79,8 → 72,6
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
jmp .pixloop1cont
;--------------------------------------
align 4
.nopix:
test ecx, 0x40000000
jz .pixloop1cont
89,13 → 80,9
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
pop ecx
;--------------------------------------
align 4
.pixloop1cont:
inc eax
jmp .pixloop1
;--------------------------------------
align 4
.pixloop1end:
sub eax, 6
inc ebx
105,20 → 92,14
popad
add eax, 6
jmp .loop
;--------------------------------------
align 4
.font2:
add edx, edx
lea ebp, [FONT_II+4*edx+edx+1]
push 9
movzx esi, byte [ebp-1]
;--------------------------------------
align 4
.symloop2:
mov dl, byte [ebp]
push esi
;--------------------------------------
align 4
.pixloop2:
shr dl, 1
jnc .nopix2
125,8 → 106,6
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
jmp .pixloop2cont
;--------------------------------------
align 4
.nopix2:
test ecx, 0x40000000
jz .pixloop2cont
135,8 → 114,6
and ecx, 0xFBFFFFFF ;negate 0x04000000 save to mouseunder area
call [putpixel]
pop ecx
;--------------------------------------
align 4
.pixloop2cont:
inc eax
dec esi
151,10 → 128,7
add dword [esp+28], esi
popad
jmp .loop
;--------------------------------------
align 4
.end:
popad
pop eax
pop eax ; << // Alver 22.06.2008 // <<
ret
;------------------------------------------------------------------------------
/kernel/trunk/gui/window.inc
52,18 → 52,16
; type I - original style
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 sys_window_mouse
call [draw_pointer]
jmp .exit
;--------------------------------------
align 4
 
@@:
dec al
jnz @f
73,8 → 71,6
jmp window._.draw_window_caption.2
 
; type IV & V - skinned window (resizable & not)
;--------------------------------------
align 4
@@:
mov eax, [TASK_COUNT]
movzx eax, word[WIN_POS + eax * 2]
84,11 → 80,10
push eax
call drawwindow_IV
jmp window._.draw_window_caption.2
;--------------------------------------
align 4
 
.exit:
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
syscall_display_settings: ;///// system function 48 ///////////////////////////
137,11 → 132,10
cmp ebx, .sizeof.ftable / 4
ja @f
jmp [.ftable + ebx * 4]
;--------------------------------------
align 4
@@:
ret
;------------------------------------------------------------------------------
 
 
align 4
syscall_display_settings.00:
xor eax, eax
151,11 → 145,10
mov [windowtypechanged], eax
 
jmp syscall_display_settings._.redraw_whole_screen
;--------------------------------------
align 4
 
.exit:
ret
;------------------------------------------------------------------------------
 
align 4
syscall_display_settings.01:
and ecx, 1
163,11 → 156,10
je .exit
mov [buttontype], ecx
mov [windowtypechanged], ebx
;--------------------------------------
align 4
 
.exit:
ret
;------------------------------------------------------------------------------
 
align 4
syscall_display_settings.02:
dec ebx
178,7 → 170,7
rep movsb
mov [windowtypechanged], ebx
ret
;------------------------------------------------------------------------------
 
align 4
syscall_display_settings.03:
mov edi, ecx
187,13 → 179,13
mov ecx, edx
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]
203,7 → 195,7
mov ax, word[screen_workarea.bottom]
mov [esp + 20], eax
ret
;------------------------------------------------------------------------------
 
align 4
syscall_display_settings.06:
xor esi, esi
218,19 → 210,14
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, [Screen_Max_Y]
mov eax, edx
242,19 → 229,14
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 .exit
261,11 → 243,10
 
call repos_windows
jmp syscall_display_settings._.calculate_whole_screen
;--------------------------------------
align 4
 
.exit:
ret
;------------------------------------------------------------------------------
 
align 4
syscall_display_settings.07:
mov eax, [_skinmargins + 0]
273,7 → 254,7
mov eax, [_skinmargins + 4]
mov [esp + 20], eax
ret
;------------------------------------------------------------------------------
 
align 4
syscall_display_settings.08:
mov ebx, ecx
284,12 → 265,10
 
call syscall_display_settings._.calculate_whole_screen
jmp syscall_display_settings._.redraw_whole_screen
;--------------------------------------
align 4
 
.exit:
ret
;------------------------------------------------------------------------------
align 4
 
syscall_display_settings._.calculate_whole_screen:
xor eax, eax
xor ebx, ebx
296,8 → 275,7
mov ecx, [Screen_Max_X]
mov edx, [Screen_Max_Y]
jmp calculatescreen
;------------------------------------------------------------------------------
align 4
 
syscall_display_settings._.redraw_whole_screen:
xor eax, eax
mov [draw_limits.left], eax
308,7 → 286,7
mov [draw_limits.bottom], eax
mov eax, window_data
jmp redrawscreen
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
syscall_set_window_shape: ;///// system function 50 ///////////////////////////
326,17 → 304,15
test ebx, ebx
jne .shape_scale
mov [edi + APPDATA.wnd_shape], ecx
;--------------------------------------
align 4
 
.shape_scale:
dec ebx
jnz .exit
mov [edi + APPDATA.wnd_shape_scale], ecx
;--------------------------------------
align 4
 
.exit:
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
syscall_move_window: ;///// system function 67 ////////////////////////////////
356,26 → 332,19
cmp ebx, -1
jne @f
mov ebx, [edi + WDATA.box.left]
;--------------------------------------
align 4
@@:
cmp ecx, -1
jne @f
mov ecx, [edi + WDATA.box.top]
;--------------------------------------
align 4
@@:
cmp edx, -1
jne @f
mov edx, [edi + WDATA.box.width]
;--------------------------------------
align 4
@@:
cmp esi, -1
jne @f
mov esi, [edi + WDATA.box.height]
;--------------------------------------
align 4
 
@@:
push esi edx ecx ebx
mov eax, esp
390,11 → 359,10
 
; NOTE: do we really need this? to be reworked
; call [draw_pointer]
;--------------------------------------
align 4
 
.exit:
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
syscall_window_settings: ;///// system function 71 /////////////////////////////
423,13 → 391,12
; jnz .exit_fail
 
; not implemented yet
;--------------------------------------
align 4
 
.exit_fail:
xor eax, eax
inc eax ; eax = 1 (fail)
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
set_window_defaults: ;/////////////////////////////////////////////////////////
440,8 → 407,6
push eax ecx
xor eax, eax
mov ecx, WIN_STACK
;--------------------------------------
align 4
@@:
inc eax
add ecx, 2
453,7 → 418,7
jne @b
pop ecx eax
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
calculatescreen: ;/////////////////////////////////////////////////////////////
480,8 → 445,7
jbe .exit
 
push edx ecx ebx eax
;--------------------------------------
align 4
 
.next_window:
movzx edi, word[WIN_POS + esi * 2]
shl edi, 5
511,33 → 475,25
cmp eax, [esp + RECT.left]
jae @f
mov eax, [esp + RECT.left]
;--------------------------------------
align 4
@@:
cmp ebx, [esp + RECT.top]
jae @f
mov ebx, [esp + RECT.top]
;--------------------------------------
align 4
@@:
cmp ecx, [esp + RECT.right]
jbe @f
mov ecx, [esp + RECT.right]
;--------------------------------------
align 4
@@:
cmp edx, [esp + RECT.bottom]
jbe @f
mov edx, [esp + RECT.bottom]
;--------------------------------------
align 4
 
@@:
push esi
movzx esi, word[WIN_POS + esi * 2]
call window._.set_screen
pop esi
;--------------------------------------
align 4
 
.skip_window:
inc esi
dec ebp
544,14 → 500,13
jnz .next_window
 
pop eax ebx ecx edx
;--------------------------------------
align 4
 
.exit:
pop ebp
popfd
pop esi
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
repos_windows: ;///////////////////////////////////////////////////////////////
563,8 → 518,7
call force_redraw_background
dec ecx
jle .exit
;--------------------------------------
align 4
 
.next_window:
mov [edi + WDATA.fl_redraw], 1
test [edi + WDATA.fl_wstate], WSTATE_MAXIMIZED
579,13 → 533,10
sub eax, ebx
jle @f
mov [edi + WDATA.box.width], ebx
;--------------------------------------
align 4
@@:
sub ebx, [edi + WDATA.box.width]
mov [edi + WDATA.box.left], ebx
;--------------------------------------
align 4
 
.fix_vertical:
mov eax, [edi + WDATA.box.top]
add eax, [edi + WDATA.box.height]
596,23 → 547,11
sub eax, ebx
jle @f
mov [edi + WDATA.box.height], ebx
;--------------------------------------
align 4
@@:
sub ebx, [edi + WDATA.box.height]
mov [edi + WDATA.box.top], ebx
;--------------------------------------
align 4
.fix_client_box:
call window._.set_window_clientbox
add edi, sizeof.WDATA
loop .next_window
;--------------------------------------
align 4
.exit:
ret
;--------------------------------------
align 4
jmp .fix_client_box
 
.fix_maximized:
mov eax, [screen_workarea.left]
mov [edi + WDATA.box.left], eax
626,12 → 565,20
sub eax, [screen_workarea.bottom]
neg eax
mov [edi + WDATA.box.height], eax
jmp .fix_client_box
 
.fix_client_box:
call window._.set_window_clientbox
 
add edi, sizeof.WDATA
loop .next_window
 
.exit:
ret
 
align 4
;------------------------------------------------------------------------------
;align 4
sys_window_mouse: ;////////////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;sys_window_mouse: ;////////////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description>
;------------------------------------------------------------------------------
; NOTE: commented out since doesn't provide necessary functionality
649,8 → 596,8
;
; .exit:
; pop eax
; ret
;------------------------------------------------------------------------------
ret
 
align 4
;------------------------------------------------------------------------------
draw_rectangle: ;//////////////////////////////////////////////////////////////
665,13 → 612,13
push eax ebx ecx edi
 
xor edi, edi
;--------------------------------------
align 4
 
.flags_set:
push ebx
 
; set line color
mov ecx, esi
; sub esi, 1 shl 25
; draw top border
rol ebx, 16
push ebx
681,8 → 628,6
jnz @f
sub ecx, 1 shl 25
call [draw_line]
;--------------------------------------
align 4
@@:
; draw bottom border
mov ebx, [esp - 2]
706,14 → 651,13
 
pop edi ecx ebx eax
ret
;--------------------------------------
align 4
 
.forced:
push eax ebx ecx edi
xor edi, edi
inc edi
jmp .flags_set
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
drawwindow_I_caption: ;////////////////////////////////////////////////////////
732,14 → 676,11
cmp ebx, eax
jbe @f
mov ebx, eax
;--------------------------------------
align 4
@@:
push ebx
 
xor edi, edi
;--------------------------------------
align 4
 
.next_line:
mov ebx, edx
shl ebx, 16
755,8 → 696,6
jz @f
sub ecx, 0x00040404
mov [esi + WDATA.cl_titlebar], ecx
;--------------------------------------
align 4
@@:
and ecx, 0x00ffffff
call [draw_line]
767,7 → 706,7
add esp, 4
pop [esi + WDATA.cl_titlebar]
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
drawwindow_I: ;////////////////////////////////////////////////////////////////
813,12 → 752,11
mov ecx, [esi + WDATA.box.width]
mov edx, [esi + WDATA.box.height]
call [drawbar]
;--------------------------------------
align 4
 
.exit:
popad
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
drawwindow_III_caption: ;/////////////////////////////////////////////////////
838,14 → 776,11
cmp ebx, eax
jb @f
mov ebx, eax
;--------------------------------------
align 4
@@:
push ebx
 
xor edi, edi
;--------------------------------------
align 4
 
.next_line:
mov ebx, edx
shl ebx, 16
859,14 → 794,10
test ecx, 0x40000000
jz @f
add ecx, 0x00040404
;--------------------------------------
align 4
@@:
test ecx, 0x80000000
jz @f
sub ecx, 0x00040404
;--------------------------------------
align 4
@@:
mov [esi + WDATA.cl_titlebar], ecx
and ecx, 0x00ffffff
878,7 → 809,7
add esp, 4
pop [esi + WDATA.cl_titlebar]
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
drawwindow_III: ;//////////////////////////////////////////////////////////////
910,8 → 841,7
mov ecx, 3
mov esi, [edx + WDATA.cl_frames]
or esi, 1 shl 25; 0x02000000 used for draw_rectangle without top line
;--------------------------------------
align 4
 
.next_frame:
add eax, 1 * 65536 - 1
add ebx, 0 * 65536 - 1
951,12 → 881,11
sub ecx, 4
sub edx, 4
call [drawbar]
;--------------------------------------
align 4
 
.exit:
popad
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
waredraw: ;////////////////////////////////////////////////////////////////////
1004,8 → 933,7
mov [edi + WDATA.fl_redraw], 1
xor eax, eax
jmp .exit
;--------------------------------------
align 4
 
.do_not_draw:
; no it's not, just activate the window
call window._.window_activate
1012,13 → 940,13
xor eax, eax
mov byte[MOUSE_BACKGROUND], al
mov byte[DONT_DRAW_MOUSE], al
;--------------------------------------
align 4
 
 
.exit:
mov byte[MOUSE_DOWN], 0
inc eax
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
minimize_window: ;/////////////////////////////////////////////////////////////
1058,13 → 986,12
call redrawscreen
 
pop esi edx ecx ebx eax
;--------------------------------------
align 4
 
.exit:
popfd
pop edi
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
restore_minimized_window: ;////////////////////////////////////////////////////
1092,8 → 1019,6
cmp eax, [TASK_COUNT]
jz @f
mov ebp, calculatescreen
;--------------------------------------
align 4
@@:
mov eax, [edi + WDATA.box.left]
mov ebx, [edi + WDATA.box.top]
1104,13 → 1029,12
call ebp
 
mov byte[MOUSE_BACKGROUND], 0
;--------------------------------------
align 4
 
.exit:
popfd
popad
ret
;------------------------------------------------------------------------------
 
align 4
; TODO: remove this proc
;------------------------------------------------------------------------------
1130,15 → 1054,13
jnz @f
call minimize_window
jmp .exit
;--------------------------------------
align 4
 
@@:
call restore_minimized_window
;--------------------------------------
align 4
 
.exit:
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
sys_window_maximize_handler: ;/////////////////////////////////////////////////
1175,8 → 1097,7
sub [esp + BOX.height], ecx
mov eax, esp
jmp .set_box
;--------------------------------------
align 4
 
.restore_size:
mov eax, esi
shl eax, 8
1186,8 → 1107,7
[eax + BOX.top] \
[eax + BOX.left]
mov eax, esp
;--------------------------------------
align 4
 
.set_box:
test bl, WSTATE_ROLLEDUP
jz @f
1196,16 → 1116,14
call window._.get_rolledup_height
mov [ecx + BOX.height], eax
xchg eax, ecx
;--------------------------------------
align 4
 
@@:
call window._.set_window_box
add esp, sizeof.BOX
;--------------------------------------
align 4
 
.exit:
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
sys_window_rollup_handler: ;///////////////////////////////////////////////////
1233,8 → 1151,7
[edi + WDATA.box.left]
mov eax, esp
jmp .set_box
;--------------------------------------
align 4
 
.restore_size:
test bl, WSTATE_MAXIMIZED
jnz @f
1241,8 → 1158,7
add esp, -sizeof.BOX
lea eax, [edx + APPDATA.saved_box]
jmp .set_box
;--------------------------------------
align 4
 
@@:
mov eax, [screen_workarea.top]
push [screen_workarea.bottom] \
1251,13 → 1167,13
[edi + WDATA.box.left]
sub [esp + BOX.height], eax
mov eax, esp
;--------------------------------------
align 4
 
.set_box:
call window._.set_window_box
add esp, sizeof.BOX
 
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
sys_window_start_moving_handler: ;/////////////////////////////////////////////
1269,8 → 1185,9
;------------------------------------------------------------------------------
mov edi, eax
call window._.draw_negative_box
 
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
sys_window_end_moving_handler: ;///////////////////////////////////////////////
1292,7 → 1209,7
mov bl, [edi + WDATA.fl_wstate]
call window._.set_window_box
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
sys_window_moving_handler: ;///////////////////////////////////////////////////
1308,6 → 1225,7
mov edi, ebx
call window._.draw_negative_box
ret
 
;==============================================================================
;///// private functions //////////////////////////////////////////////////////
;==============================================================================
1330,7 → 1248,7
; to be reworked
; new_window_starting dd ?
;endg
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
window._.invalidate_screen: ;//////////////////////////////////////////////////
1350,8 → 1268,6
cmp ecx, edx
jle @f
mov ecx, edx
;--------------------------------------
align 4
@@:
mov [draw_limits.left], ecx
mov ecx, [eax + BOX.left]
1360,8 → 1276,6
cmp ecx, edx
jae @f
mov ecx, edx
;--------------------------------------
align 4
@@:
mov [draw_limits.right], ecx
mov ecx, [eax + BOX.top]
1369,8 → 1283,6
cmp ecx, edx
jle @f
mov ecx, edx
;--------------------------------------
align 4
@@:
mov [draw_limits.top], ecx
mov ecx, [eax + BOX.top]
1379,10 → 1291,9
cmp ecx, edx
jae @f
mov ecx, edx
;--------------------------------------
align 4
@@:
mov [draw_limits.bottom], ecx
 
; recalculate screen buffer at old position
push ebx
mov edx, [eax + BOX.height]
1393,6 → 1304,7
add edx, ebx
call calculatescreen
pop eax
 
; recalculate screen buffer at new position
mov edx, [eax + BOX.height]
mov ecx, [eax + BOX.width]
1410,7 → 1322,7
 
pop ebx eax
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
window._.set_window_box: ;/////////////////////////////////////////////////////
1435,10 → 1347,10
repz cmpsd
pop edi
jz .exit
;--------------------------------------
align 4
@@:
 
add esp, -sizeof.BOX
 
mov ebx, esp
if WDATA.box
lea esi, [edi + WDATA.box]
1487,12 → 1399,11
jnz .exit
 
mov [eax + APPDATA.saved_box.height], edx
;--------------------------------------
align 4
 
.exit:
pop esi ebx eax
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
window._.set_window_clientbox: ;///////////////////////////////////////////////
1533,8 → 1444,7
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.height], eax
add esp, 4
jmp .exit
;--------------------------------------
align 4
 
.whole_window:
xor eax, eax
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.left], eax
1543,12 → 1453,11
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.width], eax
mov eax, [ecx + WDATA.box.height]
mov [edi + SLOT_BASE + APPDATA.wnd_clientbox.height], eax
;--------------------------------------
align 4
 
.exit:
pop edi ecx eax
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
window._.sys_set_window: ;/////////////////////////////////////////////////////
1607,8 → 1516,7
je @f
 
xor eax, eax
;--------------------------------------
align 4
 
@@:
mov [edi + APPDATA.wnd_caption], eax
 
1636,8 → 1544,7
 
mov byte[KEY_COUNT], 0 ; empty keyboard buffer
mov byte[BTN_COUNT], 0 ; empty button buffer
;--------------------------------------
align 4
 
.set_client_box:
; update window client box coordinates
call window._.set_window_clientbox
1646,7 → 1553,7
mov [edi + WDATA.fl_redraw], 0
mov edx, edi
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
window._.check_window_position: ;//////////////////////////////////////////////
1665,8 → 1572,7
mov esi, [Screen_Max_X]
cmp ecx, esi
ja .fix_width_high
;--------------------------------------
align 4
 
.check_left:
or eax, eax
jl .fix_left_low
1673,14 → 1579,12
add eax, ecx
cmp eax, esi
jg .fix_left_high
;--------------------------------------
align 4
 
.check_height:
mov esi, [Screen_Max_Y]
cmp edx, esi
ja .fix_height_high
;--------------------------------------
align 4
 
.check_top:
or ebx, ebx
jl .fix_top_low
1687,50 → 1591,43
add ebx, edx
cmp ebx, esi
jg .fix_top_high
;--------------------------------------
align 4
 
.exit:
pop esi edx ecx ebx eax
ret
;--------------------------------------
align 4
 
.fix_width_high:
mov ecx, esi
mov [edi + WDATA.box.width], esi
jmp .check_left
;--------------------------------------
align 4
 
.fix_left_low:
xor eax, eax
mov [edi + WDATA.box.left], eax
jmp .check_height
;--------------------------------------
align 4
 
.fix_left_high:
mov eax, esi
sub eax, ecx
mov [edi + WDATA.box.left], eax
jmp .check_height
;--------------------------------------
align 4
 
.fix_height_high:
mov edx, esi
mov [edi + WDATA.box.height], esi
jmp .check_top
;--------------------------------------
align 4
 
.fix_top_low:
xor ebx, ebx
mov [edi + WDATA.box.top], ebx
jmp .exit
;--------------------------------------
align 4
 
.fix_top_high:
mov ebx, esi
sub ebx, edx
mov [edi + WDATA.box.top], ebx
jmp .exit
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
window._.get_titlebar_height: ;////////////////////////////////////////////////
1745,12 → 1642,10
jne @f
mov eax, [_skinh]
ret
;--------------------------------------
align 4
@@:
mov eax, 21
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
window._.get_rolledup_height: ;////////////////////////////////////////////////
1766,19 → 1661,15
mov eax, [_skinh]
add eax, 3
ret
;--------------------------------------
align 4
@@:
or al, al
jnz @f
mov eax, 21
ret
;--------------------------------------
align 4
@@:
mov eax, 21 + 2
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
window._.set_screen: ;/////////////////////////////////////////////////////////
1810,8 → 1701,7
jnz .check_for_shaped_window
cmp [window_data + edi + WDATA.box.height], 0
jz .exit
;--------------------------------------
align 4
 
.check_for_shaped_window:
mov edi, esi
shl edi, 8
1838,8 → 1728,7
push ax
shl eax, 16
pop ax
;--------------------------------------
align 4
 
.next_line:
push ecx
shr ecx, 2
1854,8 → 1743,7
jnz .next_line
 
jmp .exit
;--------------------------------------
align 4
 
.shaped_window:
; for (y=0; y <= x_size; y++)
; for (x=0; x <= x_size; x++)
1903,12 → 1791,10
add [ff_ysz], ebx
 
mov ebx, [ff_y]
;--------------------------------------
align 4
 
.ff_new_y:
mov edx, [ff_x]
;--------------------------------------
align 4
 
.ff_new_x:
; -- body --
mov ecx, [ff_scale]
1928,8 → 1814,6
mov eax, esi
mov [ebp], al
; -- end body --
;--------------------------------------
align 4
@@:
inc ebp
inc edx
1945,13 → 1829,11
jb .ff_new_y
 
add esp, 24
;--------------------------------------
align 4
 
.exit:
popad
ret
;--------------------------------------
align 4
 
.read_byte:
; eax - address
; esi - slot
1962,7 → 1844,7
call read_process_memory
pop esi edx ecx eax
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
window._.window_activate: ;////////////////////////////////////////////////////
1987,12 → 1869,10
je .set_window_redraw_flag
cmp al, 0x04
jne .move_others_down
;--------------------------------------
align 4
 
.set_window_redraw_flag:
mov [window_data + ebx + WDATA.fl_redraw], 1
;--------------------------------------
align 4
 
.move_others_down:
; ax <- process no
movzx ebx, word[esi]
2001,8 → 1881,7
 
; drop others
xor eax, eax
;--------------------------------------
align 4
 
.next_stack_window:
cmp eax, [TASK_COUNT]
jae .move_self_up
2018,8 → 1897,7
jbe .next_stack_window
dec word[WIN_STACK + eax * 2]
jmp .next_stack_window
;--------------------------------------
align 4
 
.move_self_up:
movzx ebx, word[esi]
; number of processes
2029,8 → 1907,7
 
; update on screen - window stack
xor eax, eax
;--------------------------------------
align 4
 
.next_window_pos:
cmp eax, [TASK_COUNT]
jae .reset_vars
2038,8 → 1915,7
movzx ebx, word[WIN_STACK + eax * 2]
mov [WIN_POS + ebx * 2], ax
jmp .next_window_pos
;--------------------------------------
align 4
 
.reset_vars:
mov byte[KEY_COUNT], 0
mov byte[BTN_COUNT], 0
2048,6 → 1924,7
 
pop ebx eax
ret
 
;------------------------------------------------------------------------------
window._.window_deactivate: ;////////////////////////////////////////////////////
;------------------------------------------------------------------------------
2056,8 → 1933,7
;> esi = pointer to WIN_POS+ window data
;------------------------------------------------------------------------------
push eax ebx
;--------------------------------------
align 4
;------------------------------------------------------------------------------
.move_others_up:
; ax <- process no
movzx ebx, word[esi]
2065,8 → 1941,6
movzx ebx, word[WIN_STACK + ebx * 2]
; up others
xor eax, eax
;--------------------------------------
align 4
.next_stack_window:
cmp eax, [TASK_COUNT]
jae .move_self_down
2075,8 → 1949,7
jae .next_stack_window
inc word[WIN_STACK + eax * 2]
jmp .next_stack_window
;--------------------------------------
align 4
;----------------------------------------------
.move_self_down:
movzx ebx, word[esi]
; this is the last (and the low)
2083,8 → 1956,6
mov [WIN_STACK + ebx * 2], word 1
; update on screen - window stack
xor eax, eax
;--------------------------------------
align 4
.next_window_pos:
cmp eax, [TASK_COUNT]
jae .reset_vars
2092,8 → 1963,7
movzx ebx, word[WIN_STACK + eax * 2]
mov [WIN_POS + ebx * 2], ax
jmp .next_window_pos
;--------------------------------------
align 4
;-----------------------------------------------
.reset_vars:
mov byte[KEY_COUNT], 0
mov byte[BTN_COUNT], 0
2125,8 → 1995,7
 
movzx eax, word[WIN_STACK + eax * 2] ; get value of the curr process
lea esi, [WIN_POS + eax * 2] ; get address of this process at 0xC400
;--------------------------------------
align 4
 
.next_window:
add esi, 2
 
2164,19 → 2033,17
jge .next_window
 
pop esi edx ebx eax
;--------------------------------------
align 4
 
.exit.redraw:
xor ecx, ecx
inc ecx
ret
;--------------------------------------
align 4
 
.exit.no_redraw:
pop esi edx ebx eax
xor ecx, ecx
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
window._.draw_window_caption: ;////////////////////////////////////////////////
2189,8 → 2056,6
cmp edx, [CURRENT_TASK]
jne @f
inc eax
;--------------------------------------
align 4
@@:
mov edx, [CURRENT_TASK]
shl edx, 5
2203,15 → 2068,13
je .draw_caption_style_3
 
jmp .not_style_3
;--------------------------------------
align 4
 
.draw_caption_style_3:
push edx
call drawwindow_IV_caption
add esp, 4
jmp .2
;--------------------------------------
align 4
 
.not_style_3:
cmp bl, 2
jne .not_style_2
2218,15 → 2081,13
 
call drawwindow_III_caption
jmp .2
;--------------------------------------
align 4
 
.not_style_2:
cmp bl, 0
jne .2
 
call drawwindow_I_caption
;--------------------------------------
align 4
 
.2:
mov edi, [CURRENT_TASK]
shl edi, 5
2244,8 → 2105,7
je .skinned
 
jmp .not_skinned
;--------------------------------------
align 4
 
.skinned:
mov ebp, [edi + window_data + WDATA.box.left - 2]
mov bp, word[edi + window_data + WDATA.box.top]
2272,8 → 2132,7
add bx, -3
add ebx, ebp
jmp .dodraw
;--------------------------------------
align 4
 
.not_skinned:
cmp al, 1
je .exit
2294,19 → 2153,17
mov esi, eax
mov ebx, 0x00080007
add ebx, ebp
;--------------------------------------
align 4
 
.dodraw:
mov ecx, [common_colours + 16]
or ecx, 0x80000000
xor edi, edi
call dtext_asciiz_esi
;--------------------------------------
align 4
 
.exit:
call [draw_pointer]
ret
;------------------------------------------------------------------------------
 
align 4
;------------------------------------------------------------------------------
window._.draw_negative_box: ;//////////////////////////////////////////////////
2317,8 → 2174,6
;------------------------------------------------------------------------------
push eax ebx esi
mov esi, 0x01000000
;--------------------------------------
align 4
.1:
mov eax, [edi + BOX.left - 2]
mov ax, word[edi + BOX.left]
2330,8 → 2185,6
pop esi ebx eax
ret
;------------------------------------------------------------------------------
align 4
;------------------------------------------------------------------------------
window._.end_moving__box: ;//////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? Draw positive box
2341,9 → 2194,9
push eax ebx esi
xor esi, esi
jmp window._.draw_negative_box.1
 
 
;------------------------------------------------------------------------------
align 4
;------------------------------------------------------------------------------
window._.get_rect: ;/////////////////////////////////////////////////////
;------------------------------------------------------------------------------
;? <description> void __fastcall get_window_rect(struct RECT* rc);
2363,5 → 2216,6
 
add edx, [eax-twdw + WDATA.box.height]
mov [ecx+RECT.bottom], edx
 
ret
;------------------------------------------------------------------------------
 
/kernel/trunk/gui/skincode.inc
11,8 → 11,7
include "skindata.inc"
 
;skin_data = 0x00778000
;------------------------------------------------------------------------------
align 4
 
read_skin_file:
stdcall load_file, ebx
test eax, eax
22,8 → 21,6
cmp ebx, 32*1024
jb @f
mov ebx, 32*1024
;--------------------------------------
align 4
@@:
lea ecx, [ebx+3]
shr ecx, 2
35,20 → 32,16
call parse_skin_data
xor eax, eax
ret
;--------------------------------------
align 4
.notfound:
xor eax, eax
inc eax
ret
;--------------------------------------
align 4
.noskin:
stdcall kernel_free, eax
push 2
pop eax
ret
;------------------------------------------------------------------------------
 
struct SKIN_HEADER
ident dd ?
version dd ?
88,15 → 81,13
type dw ?
data dd ?
ends
;------------------------------------------------------------------------------
align 4
 
load_default_skin:
mov [_skinh], 22
mov ebx, _skin_file_default
call read_skin_file
ret
;------------------------------------------------------------------------------
align 4
 
parse_skin_data:
mov ebp, skin_data
cmp [ebp+SKIN_HEADER.ident], 'SKIN'
136,8 → 127,6
 
mov ebx, [ebp+SKIN_HEADER.bitmaps]
add ebx, skin_data
;--------------------------------------
align 4
.lp1:
cmp dword[ebx], 0
je .end_bitmaps
150,12 → 139,8
or ecx, ecx
jnz @f
mov edx, skin_inactive.left.data
;--------------------------------------
align 4
@@:
jmp .next_bitmap
;--------------------------------------
align 4
.not_left:
dec eax
jnz .not_oper
167,12 → 152,8
or ecx, ecx
jnz @f
mov edx, skin_inactive.oper.data
;--------------------------------------
align 4
@@:
jmp .next_bitmap
;--------------------------------------
align 4
.not_oper:
dec eax
jnz .not_base
182,17 → 163,11
jnz @f
mov eax, [skin_inactive.left.width]
mov edx, skin_inactive.base.data
;--------------------------------------
align 4
@@:
jmp .next_bitmap
;--------------------------------------
align 4
.not_base:
add ebx, 8
jmp .lp1
;--------------------------------------
align 4
.next_bitmap:
mov ecx, [ebx+SKIN_BITMAPS.data]
add ecx, skin_data
203,13 → 178,10
mov [edx+0], ecx
add ebx, 8
jmp .lp1
;--------------------------------------
align 4
.end_bitmaps:
 
mov ebx, [ebp+SKIN_HEADER.buttons]
add ebx, skin_data
;--------------------------------------
align 4
.lp2:
cmp dword[ebx], 0
je .end_buttons
218,20 → 190,14
jnz .not_close
mov edx, skin_btn_close
jmp .next_button
;--------------------------------------
align 4
.not_close:
dec eax
jnz .not_minimize
mov edx, skin_btn_minimize
jmp .next_button
;--------------------------------------
align 4
.not_minimize:
add ebx, 12
jmp .lp2
;--------------------------------------
align 4
.next_button:
movsx eax, [ebx+SKIN_BUTTONS.left]
mov [edx+SKIN_BUTTON.left], eax
243,13 → 209,18
mov [edx+SKIN_BUTTON.height], eax
add ebx, 12
jmp .lp2
;--------------------------------------
align 4
.end_buttons:
 
.exit:
ret
;------------------------------------------------------------------------------
align 4
 
sys_putimage_with_check:
or ebx, ebx
jz @f
call sys_putimage.forced
@@:
ret
 
drawwindow_IV_caption:
 
mov ebp, skin_active
256,9 → 227,8
or al, al
jnz @f
mov ebp, skin_inactive
;--------------------------------------
align 4
@@:
 
mov esi, [esp+4]
mov eax, [esi+WDATA.box.width] ; window width
mov edx, [ebp+SKIN_DATA.left.left]
268,12 → 238,8
add ecx, [_skinh]
 
mov ebx, [ebp+SKIN_DATA.left.data]
or ebx, ebx
jz @f
call sys_putimage.forced
;--------------------------------------
align 4
@@:
call sys_putimage_with_check
 
mov esi, [esp+4]
mov eax, [esi+WDATA.box.width]
sub eax, [ebp+SKIN_DATA.left.width]
294,8 → 260,6
mov edx, [ebp+SKIN_DATA.base.left]
sub edx, [ebp+SKIN_DATA.base.width]
shl edx, 16
;--------------------------------------
align 4
.baseskinloop:
shr edx, 16
add edx, [ebp+SKIN_DATA.base.width]
302,19 → 266,11
shl edx, 16
 
push eax ebx ecx edx
 
or ebx, ebx
jz @f
call sys_putimage.forced
;--------------------------------------
align 4
@@:
call sys_putimage_with_check
pop edx ecx ebx eax
 
dec eax
jnz .baseskinloop
;--------------------------------------
align 4
.non_base:
 
mov esi, [esp+4]
327,18 → 283,16
mov ecx, [ebp+SKIN_DATA.oper.width]
shl ecx, 16
add ecx, [_skinh]
call sys_putimage_with_check
 
or ebx, ebx
jz @f
call sys_putimage.forced
;--------------------------------------
align 4
@@:
ret
;------------------------------------------------------------------------------
align 4
 
;//mike.dld, 2006-08-02 ]
 
 
drawwindow_IV:
;param1 - aw_yes
 
pusha
 
push edx
349,9 → 303,8
cmp byte [esp+32+4+4], 0
jne @f
mov ebp, skin_inactive
;--------------------------------------
align 4
@@:
 
mov eax, [edi+WDATA.box.left]
shl eax, 16
mov ax, word [edi+WDATA.box.left]
360,6 → 313,9
shl ebx, 16
mov bx, word [edi+WDATA.box.top]
add bx, word [edi+WDATA.box.height]
; mov esi,[edi+24]
; shr esi,1
; and esi,0x007f7f7f
mov esi, [ebp+SKIN_DATA.colors.outer]
or esi, 1 shl 25 ; 0x02000000 used for draw_rectangle without top line
ror ebx, 16
368,8 → 324,6
rol ebx, 16
call draw_rectangle
mov ecx, 3
;--------------------------------------
align 4
_dw3l:
add eax, 1*65536-1
add ebx, 0*65536-1
403,14 → 357,13
mov edi, [common_colours+4]; standard grab color
call [drawbar]
jmp draw_clientbar
;--------------------------------------
align 4
@@:
 
mov al, [esp+32+4+4]
call drawwindow_IV_caption
;--------------------------------------
align 4
 
draw_clientbar:
 
mov esi, [esp]
 
mov edx, [esi+WDATA.box.top] ; WORK AREA
429,11 → 382,11
test edi, 0x40000000
jnz _noinside2
call [drawbar]
;--------------------------------------
align 4
_noinside2:
 
cmp dword[skin_data], 'SKIN'
jne no_skin_add_button
 
;* close button
mov edi, [BTN_ADDR]
movzx eax, word [edi]
458,8 → 411,6
mov ebx, [esp]
mov ebx, [ebx+WDATA.box.width]
inc ebx
;--------------------------------------
align 4
_bCx_at_right:
add ebx, [skin_btn_close.left]
mov [eax], bx
474,6 → 425,7
mov ebx, [skin_btn_close.height]
dec ebx
mov [eax], bx
 
;* minimize button
mov edi, [BTN_ADDR]
movzx eax, word [edi]
498,8 → 450,6
mov ebx, [esp]
mov ebx, [ebx+WDATA.box.width]
inc ebx
;--------------------------------------
align 4
_bMx_at_right:
add ebx, [skin_btn_minimize.left]
mov [eax], bx
514,10 → 464,10
mov ebx, [skin_btn_minimize.height]
dec ebx
mov [eax], bx
;--------------------------------------
align 4
 
no_skin_add_button:
pop edi
popa
 
ret 4
;------------------------------------------------------------------------------