Docky v 0.5.2 -> fixes, setting button, tiny changes in Docky.ini

git-svn-id: svn://kolibrios.org@4195 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
eAndrew 2013-11-08 18:38:06 +00:00
parent ceabc58f3f
commit ca04d02a70
4 changed files with 143 additions and 67 deletions

View File

@ -1,73 +1,68 @@
[@SETTINGS]
; TOP = 1
; LEFT = 2
; BOTTOM = 3
; RIGHT = 4
[@]
location=1
[Eolite]
path=/sys/file managers/eolite
path=file managers/eolite
param=
icon=2
icon=1
[KFAR]
path=/sys/file managers/kfar
path=file managers/kfar
param=
icon=16
[KFM]
path=/sys/file managers/kfm
path=file managers/kfm
param=
icon=5
separator=1
$=1
[HTMLv]
path=/sys/htmlv
path=htmlv
param=
icon=31
[IRC]
path=/SYS/NETWORK/IRCC
path=network/ircc
param=
icon=29
separator=1
$=1
[TinyPad]
path=/sys/tinypad
path=tinypad
param=
icon=9
[Animage]
path=/sys/media/animage
path=media/animage
param=
icon=15
[Calc]
path=/sys/calc
path=calc
param=
icon=4
separator=1
$=1
[Shell]
path=/sys/shell
path=shell
param=
icon=20
[Board]
path=/sys/develop/board
path=develop/board
param=
icon=19
[KGB]
path=/sys/mgb
path=mgb
param=
icon=11
[PCI DE]
path=pcidev
param=
icon=10
icon=28

View File

@ -1,10 +1,17 @@
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
.cfg_text:
db "R", 0
.ext_text:
db "X", 0
;-------------------------------------------------------------------------------
ini_data:
.file_name:
@ -16,10 +23,10 @@ ini_data:
.icon_name:
db "icon", 0
.separator_name:
db "separator", 0
db "$", 0
.settings_name:
db "@SETTINGS", 0
db "@", 0
.location_name:
db "location", 0
;-------------------------------------------------------------------------------
@ -100,8 +107,6 @@ ini:
ICON_SIZE equ 32 * 32
ICON_SIZE_BGR equ ICON_SIZE * 3
ICON_SIZE_RGB equ ICON_SIZE * 4
ICONS_SIZE_RGB equ ICON_SIZE_RGB * 29
ICONS_SIZE_FILE equ ICON_SIZE_BGR * 29
BUTTON_SIZE equ 44
;-------------------------------------------------------------------------------

View File

@ -81,6 +81,8 @@ n_event_idle:
cmp byte[nwin.close], 1
jne @f
mcall 13, <0, [win.width]>, <[win.height], 1>, [color.frame]
mov byte[nwin.close], 0
mcall -1
@ -129,4 +131,6 @@ n_event_redraw:
mcall 12, 2
mcall 18, 3, [nwin.sid]
jmp n_main_loop

View File

@ -30,16 +30,17 @@ main:
load_libraries load_lib_start, load_lib_end
; ==== Config LibINI ====
invoke ini.get_int, ini_data.file_name, ini_data.settings_name, ini_data.location_name, -1
invoke ini.get_int, ini_data.file_name, ini_data.settings_name, ini_data.location_name, 1
mov [dock_items.location], eax
invoke ini.sections, ini_data.file_name, sections_callback
; ==== Load colors ====
mcall 48, 3, color
or dword[color.bg], 0x10000000
or dword[color.frame], 0x10000000
or dword[color.text], 0x80000000
invoke ini.sections, ini_data.file_name, sections_callback
; ==== Config LibIMG ====
mov dword[fi.p00], 5
mov dword[fi.p16], buf_128
@ -67,7 +68,12 @@ main:
mov dword[img_data.object], eax
; === ALPHA ===
mov edi, 0
mov edi, eax
add edi, 8
mov edi, [edi]
imul edi, 128
sub edi, 4
add eax, 24
mov eax, [eax]
.setalpha:
@ -79,8 +85,8 @@ main:
mov ecx, [color.bg]
mov [eax + edi], ecx
.nonalpha:
add edi, 4
cmp edi, ICONS_SIZE_RGB
sub edi, 4
cmp edi, 0
jne .setalpha
; === CONVERTING TO BGR
@ -132,6 +138,7 @@ main:
call .VERT_X_LEFT
jmp .SETDEF
;-------------------------------------------------------------------------------
.HORZ_WIDTH:
mov eax, BUTTON_SIZE
mov ebx, [dock_items.count]
@ -143,29 +150,26 @@ main:
ret
;-------------------------------------------------------------------------------
.HORZ_X:
mcall 14
shr eax, 16
mov ebx, 2
mov edx, 0
div ebx
mov edx, 0
mov ecx, eax
mov eax, [win.width_opn]
div ebx
sub ecx, eax
mov [win.x_opn], ecx
mov [win.x_hdn], ecx
shr eax, 17
mov ecx, [win.width_opn]
shr ecx, 1
sub eax, ecx
mov [win.x_opn], eax
mov [win.x_hdn], eax
ret
;-------------------------------------------------------------------------------
.HORZ_HEIGHT:
mov dword[win.height_opn], BUTTON_SIZE
mov dword[win.height_hdn], 3
mov dword[win.height_opn], BUTTON_SIZE
ret
;-------------------------------------------------------------------------------
.HORZ_Y_BOTTOM:
mcall 14
and eax, 0xFFFF
@ -182,14 +186,15 @@ main:
ret
;-------------------------------------------------------------------------------
.VERT_WIDTH:
mov dword[win.width_opn], BUTTON_SIZE
mov dword[win.width_hdn], 3
ret
;-------------------------------------------------------------------------------
.VERT_X_LEFT:
mov dword[win.x_opn], 0
mov dword[win.x_hdn], 0
@ -205,35 +210,34 @@ main:
ret
;-------------------------------------------------------------------------------
.VERT_HEIGHT:
mov eax, BUTTON_SIZE
mov ebx, [dock_items.count]
imul eax, ebx
dec eax
add eax, 12
mov [win.height_opn], eax
mov [win.height_hdn], eax
ret
;-------------------------------------------------------------------------------
.VERT_Y:
mcall 14
and eax, 0xFFFF
mov edx, 0
mov ebx, 2
div ebx
mov esi, eax
shr eax, 1
mov eax, [win.height_opn]
mov edx, 0
mov ebx, 2
div ebx
sub esi, eax
mov esi, [win.height_opn]
shr esi, 1
sub eax, esi
mov [win.y_hdn], esi
mov [win.y_opn], esi
mov [win.y_hdn], eax
mov [win.y_opn], eax
ret
;-------------------------------------------------------------------------------
.SETDEF:
mov eax, [win.width_hdn]
mov [win.width], eax
@ -247,6 +251,7 @@ main:
mov eax, [win.y_hdn]
mov [win.y], eax
;-------------------------------------------------------------------------------
; ==== START ====
mcall 9, win.procinfo, -1
mov ecx, [win.procinfo + 30]
@ -261,7 +266,7 @@ exit:
mcall 18, 2, [nwin.sid]
mcall -1
;-------------------------------------------------------------------------------
proc main_loop
main_loop:
mcall 10
cmp eax, EV_REDRAW
@ -274,15 +279,13 @@ proc main_loop
je event_mouse
jmp main_loop
.end:
ret
endp
;-------------------------------------------------------------------------------
event_redraw:
mcall 12, 1
mcall 0, <[win.x], [win.width]>, <[win.y], [win.height]>, [color.bg], [color.bg], [color.frame]
mov esi, [color.bg]
or esi, 0x01000000
mcall 0, <[win.x], [win.width]>, <[win.y], [win.height]>, [color.bg], , [color.frame]
mov edi, 0
@@:
@ -361,6 +364,60 @@ event_redraw:
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
@ -374,6 +431,9 @@ event_button:
cmp ah, 2
je .button_dock
cmp ah, 3
je .button_cfg
jmp @f
.button_close:
@ -402,6 +462,18 @@ event_button:
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
;-------------------------------------------------------------------------------