Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4197 → Rev 4198

/programs/system/docky/trunk/DATA.INC
1,14 → 1,4
set_img:
db 0, 0, 1, 0, 0, 0
db 0, 0, 0, 1, 0, 0
db 1, 0, 0, 1, 0, 0
db 0, 1, 1, 1, 0, 0
db 0, 0, 0, 0, 1, 0
db 0, 0, 0, 0, 0, 1
;-------------------------------------------------------------------------------
cfg_app:
db "dockycfg", 0
;-------------------------------------------------------------------------------
img_data:
.file_name:
db "/sys/iconstrp.png", 0
/programs/system/docky/trunk/MEMORY.INC
1,6 → 1,9
rb 1024
__stackend:
;-------------------------------------------------------------------------------
sel_img:
rb 32 * 32 * 3
;-------------------------------------------------------------------------------
error:
rb 0
;-------------------------------------------------------------------------------
13,6 → 16,7
rd 1
.bg:
rd 1
.bt:
rd 1
rd 1
.text:
57,6 → 61,8
rb 1
.button_index:
rd 1
.prev_index:
rd 1
 
.isvert:
rb 1
/programs/system/docky/trunk/NAME.INC
35,11 → 35,13
 
.bottom:
mov eax, [win.y_opn]
sub eax, 16
sub eax, 17
mov [nwin.y], eax
 
mov dword[nwin.bgx], 1
mov eax, [nwin.height]
 
mov eax, [nwin.height]
mov [nwin.bgy], eax
 
jmp @f
46,7 → 48,7
 
.right:
mov eax, [win.x_opn]
sub eax, 67
sub eax, 68
mov [nwin.x], eax
 
mov eax, [nwin.width]
/programs/system/docky/trunk/docky.asm
216,7 → 216,6
mov ebx, [dock_items.count]
imul eax, ebx
dec eax
add eax, 12
mov [win.height_opn], eax
mov [win.height_hdn], eax
 
281,6 → 280,10
jmp main_loop
;-------------------------------------------------------------------------------
event_redraw:
call DRAW_WINDOW
jmp main_loop
;-------------------------------------------------------------------------------
DRAW_WINDOW:
mcall 12, 1
 
mov esi, [color.bg]
324,7 → 327,7
add ebx, 12
dec ebx
shl ebx, 16
add ebx, 1
add ebx, 2
 
cmp byte[win.isvert], 1
je .vert_draw_sep
364,63 → 367,9
jmp @b
@@:
 
; ==== DRAW SETTINGS ====
cmp byte[win.isvert], 1
je .cfg_vert
 
mov ebx, [win.width]
sub ebx, 10
shl ebx, 16
add ebx, 8
mcall 8, , <2, BUTTON_SIZE - 4>, 0x60000003
jmp @f
 
.cfg_vert:
mov ecx, [win.height]
sub ecx, 10
shl ecx, 16
add ecx, 8
mcall 8, <2, BUTTON_SIZE - 4>, , 0x60000003
@@:
 
; ==== cfg image ====
mov edi, 0
@@:
cmp byte[set_img + edi], 0
je .notdraw
 
mov eax, edi
mov edx, 0
mov ebx, 6
div ebx
mov ebx, edx
mov ecx, eax
 
add ebx, [win.width]
cmp byte[win.isvert], 0
je .cfg_hoz
sub ebx, [win.width]
add ebx, [win.height]
.cfg_hoz:
sub ebx, 10
add ecx, 18
 
cmp byte[win.isvert], 0
je .cfg_draw
 
xchg ebx, ecx
 
.cfg_draw:
mcall 1, , , [color.frame]
 
.notdraw:
inc edi
cmp edi, 36
jne @b
 
mcall 12, 2
 
jmp main_loop
ret
;-------------------------------------------------------------------------------
event_button:
mcall 17
431,9 → 380,6
cmp ah, 2
je .button_dock
 
cmp ah, 3
je .button_cfg
 
jmp @f
 
.button_close:
462,22 → 408,11
 
jmp wnd_hide
 
.button_cfg:
mov dword[fi.p00], 7
mov dword[fi.p21], cfg_app
mcall 70, fi
 
mov ecx, eax
mcall 18, 21
and eax, 0xFFFF
mov [win.psid], eax
 
jmp wnd_hide
 
@@:
jmp main_loop
;-------------------------------------------------------------------------------
event_mouse:
; ==== IS MOUSE INNER ====
mcall 37, 1
mov edi, eax
mov esi, eax
495,6 → 430,8
cmp esi, [win.height]
jg wnd_hide
 
; ==== COUNT INDEX ====
 
mov eax, [dock_items.location]
and eax, 1b
cmp eax, 1
523,8 → 460,14
cmp [win.button_index], eax
je .nxt2
 
push dword[win.button_index]
pop dword[win.prev_index]
 
mov [win.button_index], eax
 
; ==== DRAW SELECTION ====
call DRAW_SELECTION
 
.nxt2:
mov eax, [win.button_index]
imul eax, BUTTON_SIZE
543,6 → 486,7
mcall 13, <[win.width], 1>, <0, [win.height]>, [color.frame]
.vert_end:
 
; ==== OPEN/CLOSE WINDOW ====
cmp byte[win.state], 1
je main_loop
 
573,7 → 517,9
 
mcall 67, [win.x], [win.y], [win.width], [win.height]
 
jmp event_redraw
call DRAW_WINDOW
call DRAW_SELECTION
jmp main_loop
 
;-------------------------------------------------------------------------------
wnd_hide:
601,8 → 547,100
 
mcall 67, [win.x], [win.y], [win.width], [win.height]
 
jmp event_redraw
call DRAW_WINDOW
jmp main_loop
;-------------------------------------------------------------------------------
DRAW_SELECTION:
mov ebx, [win.prev_index]
imul ebx, BUTTON_SIZE
add ebx, 14
shl ebx, 16
add ebx, 40
mov ecx, 0x00020028
 
cmp byte[win.isvert], 1
jne @f
xchg ebx, ecx
sub ecx, 0x000C0000
@@:
 
mcall 13, , , [color.bg]
 
mov edx, ebx
shr ecx, 16
mov dx, cx
add edx, 0x00040004
 
mov ebx, [win.prev_index]
imul ebx, 4
add ebx, dock_items.icon
mov ebx, [ebx]
imul ebx, ICON_SIZE_BGR
add ebx, [img_data.rgb_object]
 
mcall 7, , <32, 32>
 
mov ebx, [win.button_index]
imul ebx, BUTTON_SIZE
add ebx, 14
shl ebx, 16
add ebx, 40
mov ecx, 0x00020028
 
cmp byte[win.isvert], 1
jne @f
xchg ebx, ecx
sub ecx, 0x000C0000
@@:
 
mcall 13, , , [color.bt]
 
mov edx, ebx
shr ecx, 16
mov dx, cx
add edx, 0x00040004
 
mov ecx, [win.button_index]
imul ecx, 4
add ecx, dock_items.icon
mov ecx, [ecx]
imul ecx, ICON_SIZE_BGR
add ecx, [img_data.rgb_object]
 
mov ebx, sel_img
 
mov edi, 0
@@:
mov al, byte[ecx + 2]
shl eax, 8
mov al, byte[ecx + 1]
shl eax, 8
mov al, byte[ecx + 0]
 
or eax, 0x10000000
cmp eax, [color.bg]
jne .notbg
mov eax, [color.bt]
.notbg:
 
mov byte[ebx + 0], al
shr eax, 8
mov byte[ebx + 1], al
shr eax, 8
mov byte[ebx + 2], al
 
add ebx, 3
add ecx, 3
 
add edi, 3
 
cmp edi, 1024 * 3
jne @b
 
mcall 7, sel_img, <32, 32>
 
ret
;-------------------------------------------------------------------------------
proc sections_callback, _file_name, _section_name
mov eax, [_section_name]
cmp byte[eax], '@'