Docky 0.4.5 - Fixed bug with focus, add lines to background

git-svn-id: svn://kolibrios.org@4134 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
eAndrew 2013-10-29 19:18:52 +00:00
parent 89f9caf0b6
commit 673fe8fcae
2 changed files with 139 additions and 40 deletions

View File

@ -6,8 +6,9 @@
location=1 location=1
bg= 225,225,225 bg= 225,225,230
frame= 144,152,176 bg_line= 217,217,222
frame= 104,112,136
framein= 194,202,224 framein= 194,202,224
text= 000,000,000 text= 000,000,000
@ -16,16 +17,33 @@ path=/sys/file managers/eolite
param= param=
icon=2 icon=2
[HTMLv]
path=/sys/htmlv
param=
icon=7
separator=1
[TinyPad] [TinyPad]
path=/sys/tinypad path=/sys/tinypad
param= param=
icon=9 icon=9
[Animage]
path=/sys/media/animage
param=
icon=15
[Shell] [Shell]
path=/sys/shell path=/sys/shell
param= param=
icon=20 icon=20
[Board]
path=/sys/board
param=
icon=19
[Calc] [Calc]
path=/sys/calc path=/sys/calc
param= param=
@ -48,12 +66,12 @@ path=/sys/games/kosilka
param= param=
icon=23 icon=23
separator=1 [Mine]
path=/sys/games/mine
[RDSave]
path=/sys/rdsave
param= param=
icon=17 icon=14
separator=1
[End] [End]
path=/sys/end path=/sys/end

View File

@ -1,5 +1,3 @@
;;; Docky v0.4.3 by eAndrew
use32 use32
org 0x0 org 0x0
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
@ -10,6 +8,7 @@
include "../../../proc32.inc" include "../../../proc32.inc"
include "../../../dll.inc" include "../../../dll.inc"
include "../../../develop/libraries/box_lib/load_lib.mac" include "../../../develop/libraries/box_lib/load_lib.mac"
;include "../../../debug.inc"
@use_library_mem \ @use_library_mem \
mem.Alloc, \ mem.Alloc, \
@ -39,6 +38,8 @@ proc main
invoke ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_bg, 0x0 invoke ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_bg, 0x0
mov [color.bg], eax mov [color.bg], eax
invoke ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_bg_line, 0x080808
mov [color.bg_line], eax
invoke ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_frame, 0xFFFFFF invoke ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_frame, 0xFFFFFF
mov [color.frame], eax mov [color.frame], eax
invoke ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_framein, 0x888888 invoke ini.get_color, ini_data.file_name, ini_data.settings_name, ini_data.color_framein, 0x888888
@ -72,12 +73,35 @@ proc main
mov edi, 0 mov edi, 0
add eax, 24 add eax, 24
mov eax, [eax] mov eax, [eax]
mov ecx, [color.bg]
.setalpha: .setalpha:
mov ebx, [eax + edi] mov ebx, [eax + edi]
shr ebx, 24 shr ebx, 24
cmp ebx, 0 cmp ebx, 0
jne .nonalpha jne .nonalpha
pushad
mov eax, edi
mov edx, 0
mov ebx, 128
div ebx
mov edx, 0
mov ebx, 2
div ebx
mov edx, 0
div ebx
cmp edx, 1
je .set_bg_line
.set_bg:
popad
mov ecx, [color.bg]
jmp .set_ecx
.set_bg_line:
popad
mov ecx, [color.bg_line]
.set_ecx:
mov [eax + edi], ecx mov [eax + edi], ecx
.nonalpha: .nonalpha:
add edi, 4 add edi, 4
@ -134,7 +158,7 @@ proc main
jmp .SETDEF jmp .SETDEF
.HORZ_WIDTH: .HORZ_WIDTH:
mov eax, 42 mov eax, 40
mov ebx, [dock_items.count] mov ebx, [dock_items.count]
imul eax, ebx imul eax, ebx
dec eax dec eax
@ -161,7 +185,7 @@ proc main
ret ret
.HORZ_HEIGHT: .HORZ_HEIGHT:
mov dword[win.height_opn], 42 mov dword[win.height_opn], 40
mov dword[win.height_hdn], 0 mov dword[win.height_hdn], 0
ret ret
@ -171,7 +195,7 @@ proc main
and eax, 0xFFFF and eax, 0xFFFF
dec eax dec eax
mov [win.y_hdn], eax mov [win.y_hdn], eax
sub eax, 42 sub eax, 40
mov [win.y_opn], eax mov [win.y_opn], eax
ret ret
@ -183,7 +207,7 @@ proc main
ret ret
.VERT_WIDTH: .VERT_WIDTH:
mov dword[win.width_opn], 42 mov dword[win.width_opn], 40
mov dword[win.width_hdn], 0 mov dword[win.width_hdn], 0
ret ret
@ -200,13 +224,13 @@ proc main
and eax, 0xFFFF0000 and eax, 0xFFFF0000
shr eax, 16 shr eax, 16
mov [win.x_hdn], eax mov [win.x_hdn], eax
sub eax, 42 sub eax, 40
mov [win.x_opn], eax mov [win.x_opn], eax
ret ret
.VERT_HEIGHT: .VERT_HEIGHT:
mov eax, 42 mov eax, 40
mov ebx, [dock_items.count] mov ebx, [dock_items.count]
imul eax, ebx imul eax, ebx
dec eax dec eax
@ -306,6 +330,20 @@ proc event_redraw
mcall , , , [color.bg] mcall , , , [color.bg]
mov edi, 2
mov eax, 13
mov ebx, 2 shl 16
add ebx, [win.width]
sub ebx, 3
mov ecx, 2 shl 16 + 2
mov edx, [color.bg_line]
@@:
mcall
add ecx, 4 shl 16
add edi, 4
cmp edi, [win.height]
jl @b
mov edi, 0 mov edi, 0
@@: @@:
cmp edi, [dock_items.count] cmp edi, [dock_items.count]
@ -315,48 +353,68 @@ proc event_redraw
mov eax, 8 mov eax, 8
mov edx, 0x60000002 mov edx, 0x60000002
mov esi, [color.bg] mov esi, [color.bg]
imul edi, 42 imul edi, 40
shl edi, 16 shl edi, 16
add edi, 41 add edi, 39
cmp byte[win.isvert], 1 cmp byte[win.isvert], 1
je .vert_btn je .vert_btn
mcall , edi, <0, 42> mcall , edi, <0, 40>
jmp .endbtn jmp .endbtn
.vert_btn: .vert_btn:
mcall , <0, 42>, edi mcall , <0, 40>, edi
.endbtn: .endbtn:
pop edi pop edi
.draw_Sseparator:
push ebx
push ecx
mov eax, 13
mov ebx, edi
imul ebx, 40
add ebx, 40
shl ebx, 16
add ebx, 1
cmp byte[win.isvert], 1
je .vert_Sdraw_sep
mcall , , <6, 29>, [color.framein]
jmp .end_Sinner_sep
.vert_Sdraw_sep:
mov ecx, ebx
mcall , <6, 29>, , [color.framein]
.end_Sinner_sep:
pop ecx
pop ebx
.end_Sseparator:
cmp byte[dock_items.separator + edi], 1 cmp byte[dock_items.separator + edi], 1
je .draw_separator jne .end_separator
jmp .end_separator
.draw_separator: .draw_separator:
push ebx push ebx
push ecx push ecx
mov eax, 13 mov eax, 13
mov ebx, edi mov ebx, edi
imul ebx, 42 imul ebx, 40
add ebx, 41 add ebx, 39
shl ebx, 16 shl ebx, 16
add ebx, 1 add ebx, 1
cmp byte[win.isvert], 1 cmp byte[win.isvert], 1
je .vert_draw_sep je .vert_draw_sep
mcall , , <0, 43>, [color.frame] mcall , , <0, 41>, [color.frame]
sub ebx, 0x00010000 sub ebx, 0x00010000
mov edx, [color.framein] mov edx, [color.framein]
mcall , , <1, 41> mcall , , <1, 39>
add ebx, 0x00020000 add ebx, 0x00020000
mcall , , <1, 41> mcall , , <1, 39>
jmp .end_inner_sep jmp .end_inner_sep
.vert_draw_sep: .vert_draw_sep:
mov ecx, ebx mov ecx, ebx
mcall , <0, 43>, , [color.frame] mcall , <0, 41>, , [color.frame]
sub ecx, 0x00010000 sub ecx, 0x00010000
mov edx, [color.framein] mov edx, [color.framein]
mcall , <1, 41> mcall , <1, 39>
add ecx, 0x00020000 add ecx, 0x00020000
mcall , <1, 41> mcall , <1, 39>
.end_inner_sep: .end_inner_sep:
pop ecx pop ecx
pop ebx pop ebx
@ -366,13 +424,13 @@ proc event_redraw
je .vert_dig je .vert_dig
mov edx, ebx mov edx, ebx
and edx, 0xFFFF0000 and edx, 0xFFFF0000
add edx, 0x00050005 add edx, 0x00040004
jmp .digend jmp .digend
.vert_dig: .vert_dig:
mov edx, ecx mov edx, ecx
and edx, 0xFFFF0000 and edx, 0xFFFF0000
shr edx, 16 shr edx, 16
add edx, 0x00050005 add edx, 0x00040004
.digend: .digend:
imul ebx, edi, 4 imul ebx, edi, 4
@ -420,6 +478,11 @@ proc event_button
mcall 70, file_exec mcall 70, file_exec
mov ecx, eax
mcall 18, 21
and eax, 0xFFFF
mov [win.psid], eax
@@: @@:
jmp main_loop jmp main_loop
endp endp
@ -454,7 +517,7 @@ proc event_mouse
.nxt: .nxt:
mov edx, 0 mov edx, 0
mov ebx, 42 mov ebx, 40
div ebx div ebx
cmp eax, [dock_items.count] cmp eax, [dock_items.count]
@ -472,15 +535,15 @@ proc event_mouse
.nxt2: .nxt2:
mov eax, [win.button_index] mov eax, [win.button_index]
imul eax, 42 imul eax, 40
cmp byte[win.isvert], 1 cmp byte[win.isvert], 1
je .vert_name je .vert_name
sub eax, 13 sub eax, 15
add eax, [win.x] add eax, [win.x]
mov [nwin.x], eax mov [nwin.x], eax
jmp .vert_end jmp .vert_end
.vert_name: .vert_name:
add eax, 13 add eax, 12
add eax, [win.y] add eax, [win.y]
mov [nwin.y], eax mov [nwin.y], eax
.vert_end: .vert_end:
@ -619,22 +682,22 @@ n_main:
jmp .left jmp .left
.top: .top:
mov eax, [win.height_opn] mov eax, [win.height_opn]
add eax, 5 add eax, 4
mov [nwin.y], eax mov [nwin.y], eax
jmp @f jmp @f
.right: .right:
mov eax, [win.x_opn] mov eax, [win.x_opn]
sub eax, 73 sub eax, 72
mov [nwin.x], eax mov [nwin.x], eax
jmp @f jmp @f
.bottom: .bottom:
mov eax, [win.y_opn] mov eax, [win.y_opn]
sub eax, 21 sub eax, 20
mov [nwin.y], eax mov [nwin.y], eax
jmp @f jmp @f
.left: .left:
mov eax, [win.width_opn] mov eax, [win.width_opn]
add eax, 5 add eax, 4
mov [nwin.x], eax mov [nwin.x], eax
@@: @@:
mov dword[nwin.width], 68 mov dword[nwin.width], 68
@ -708,6 +771,20 @@ n_event_redraw:
mcall , , , [color.bg] mcall , , , [color.bg]
mov edi, 0
mov eax, 13
mov ebx, 2 shl 16
add ebx, [nwin.width]
sub ebx, 3
mov ecx, 2 shl 16 + 2
mov edx, [color.bg_line]
@@:
mcall
add ecx, 4 shl 16
add edi, 4
cmp edi, 16
jne @b
mov edx, [win.button_index] mov edx, [win.button_index]
imul edx, 16 imul edx, 16
add edx, dock_items.name add edx, dock_items.name
@ -757,6 +834,8 @@ ini_data:
db "location", 0 db "location", 0
.color_bg: .color_bg:
db "bg", 0 db "bg", 0
.color_bg_line:
db "bg_line", 0
.color_frame: .color_frame:
db "frame", 0 db "frame", 0
.color_framein: .color_framein:
@ -853,6 +932,8 @@ __stackend:
color: color:
.bg: .bg:
rd 1 rd 1
.bg_line:
rd 1
.frame: .frame:
rd 1 rd 1
.framein: .framein: