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 location=1
[Eolite] [Eolite]
path=/sys/file managers/eolite path=file managers/eolite
param= param=
icon=2 icon=1
[KFAR] [KFAR]
path=/sys/file managers/kfar path=file managers/kfar
param= param=
icon=16 icon=16
[KFM] [KFM]
path=/sys/file managers/kfm path=file managers/kfm
param= param=
icon=5 icon=5
separator=1 $=1
[HTMLv] [HTMLv]
path=/sys/htmlv path=htmlv
param= param=
icon=31 icon=31
[IRC] [IRC]
path=/SYS/NETWORK/IRCC path=network/ircc
param= param=
icon=29 icon=29
separator=1 $=1
[TinyPad] [TinyPad]
path=/sys/tinypad path=tinypad
param= param=
icon=9 icon=9
[Animage] [Animage]
path=/sys/media/animage path=media/animage
param= param=
icon=15 icon=15
[Calc] [Calc]
path=/sys/calc path=calc
param= param=
icon=4 icon=4
separator=1 $=1
[Shell] [Shell]
path=/sys/shell path=shell
param= param=
icon=20 icon=20
[Board] [Board]
path=/sys/develop/board path=develop/board
param= param=
icon=19 icon=19
[KGB] [KGB]
path=/sys/mgb path=mgb
param= param=
icon=11 icon=11
[PCI DE] [PCI DE]
path=pcidev path=pcidev
param= 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: img_data:
.file_name: .file_name:
db "/sys/iconstrp.png", 0 db "/sys/iconstrp.png", 0
.cfg_text:
db "R", 0
.ext_text:
db "X", 0
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
ini_data: ini_data:
.file_name: .file_name:
@ -16,10 +23,10 @@ ini_data:
.icon_name: .icon_name:
db "icon", 0 db "icon", 0
.separator_name: .separator_name:
db "separator", 0 db "$", 0
.settings_name: .settings_name:
db "@SETTINGS", 0 db "@", 0
.location_name: .location_name:
db "location", 0 db "location", 0
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
@ -100,8 +107,6 @@ ini:
ICON_SIZE equ 32 * 32 ICON_SIZE equ 32 * 32
ICON_SIZE_BGR equ ICON_SIZE * 3 ICON_SIZE_BGR equ ICON_SIZE * 3
ICON_SIZE_RGB equ ICON_SIZE * 4 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 BUTTON_SIZE equ 44
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------

View File

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

View File

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