From 4afbfbbe09ca1c2300dca0bd1890e8d7d7db0307 Mon Sep 17 00:00:00 2001 From: pathoswithin Date: Sun, 1 Nov 2015 17:59:25 +0000 Subject: [PATCH] Taskbar: some cleaning and refactoring git-svn-id: svn://kolibrios.org@5872 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/taskbar/trunk/KEYMAP.KEY | Bin 2688 -> 3456 bytes programs/system/taskbar/trunk/LANG.INI | 4 +- programs/system/taskbar/trunk/MOI.INC | 414 ++++----------------- programs/system/taskbar/trunk/TASKBAR.ASM | 231 +++--------- programs/system/taskbar/trunk/drawtray.inc | 245 +++--------- programs/system/taskbar/trunk/drawwind.inc | 33 +- programs/system/taskbar/trunk/i_data.inc | 155 +++----- 7 files changed, 238 insertions(+), 844 deletions(-) diff --git a/programs/system/taskbar/trunk/KEYMAP.KEY b/programs/system/taskbar/trunk/KEYMAP.KEY index 030abd91a74082f9bc3262dd841fd7ab140d5948..bfc6f299cc34a0b4892d603bf69ceed75943936e 100644 GIT binary patch delta 330 zcmZn=ZIIs3z%{vnkw;ryfrGQKJhiB#vNSWlKtY?gF0nWzEj=SEJ4XQsY^o}f%aZbP zb@X%}v}E delta 7 OcmZpWZV=tjzy$yb7XoVl diff --git a/programs/system/taskbar/trunk/LANG.INI b/programs/system/taskbar/trunk/LANG.INI index 354ca0740b..e32b21d037 100644 --- a/programs/system/taskbar/trunk/LANG.INI +++ b/programs/system/taskbar/trunk/LANG.INI @@ -15,8 +15,7 @@ altkey5 = 5 altkey6 = 6 altkey7 = 2 altkey8 = 8 -altkey9 = 0 -altkey0 = 0 +altkey9 = 9 [langs] 1 = En @@ -27,3 +26,4 @@ altkey0 = 0 6 = Et 7 = Ua 8 = It +9 = Be diff --git a/programs/system/taskbar/trunk/MOI.INC b/programs/system/taskbar/trunk/MOI.INC index 33c9ba7d9c..ab9a6797b8 100644 --- a/programs/system/taskbar/trunk/MOI.INC +++ b/programs/system/taskbar/trunk/MOI.INC @@ -1,406 +1,148 @@ -;------------------------------------------------------------------------------ -align 4 + load_ini: - mov [point2],16h - - mcall 70,get_ini - - mov al,[inicont] - sub al,30h - mov [firini],al mov [point2],32h - mcall 70,get_ini - mov al,[inicont] sub al,30h mov [lngcrc1],al + mov [point2],42h - mcall 70,get_ini - - mov al,[inicont] - sub al,30h - mov [lngcrc2],al - mov [point2],52h - - mcall 70,get_ini - mov al,[inicont] sub al,30h mov [lngcrc3],al + + mov [point2],52h + mcall 70,get_ini + mov al,[inicont] + sub al,30h + mov [lngcrc2],al + mov [point2],06eh - mcall 70,get_ini - mov al,[inicont] sub al,30h mov [altlng1],al + mov [point2],07eh - mcall 70,get_ini - mov al,[inicont] sub al,30h mov [altlng2],al + mov [point2],08eh - mcall 70,get_ini - mov al,[inicont] sub al,30h mov [altlng3],al + mov [point2],09eh - mcall 70,get_ini - mov al,[inicont] sub al,30h mov [altlng4],al + mov [point2],0aeh - mcall 70,get_ini - mov al,[inicont] sub al,30h mov [altlng5],al + mov [point2],0beh - mcall 70,get_ini - mov al,[inicont] sub al,30h mov [altlng6],al + mov [point2],0ceh - mcall 70,get_ini - mov al,[inicont] sub al,30h mov [altlng7],al + mov [point2],0deh - mcall 70,get_ini - mov al,[inicont] sub al,30h mov [altlng8],al + mov [point2],0eeh - mcall 70,get_ini - mov al,[inicont] sub al,30h mov [altlng9],al - mov [point2],0feh + mov [point2],16h mcall 70,get_ini - + xor eax,eax mov al,[inicont] - sub al,30h - mov [altlng0],al + sub al,31h + jns applyKeymap ret -;------------------------------------------------------------------------------ -align 4 -fir_lng: - mov al,[firini] - sub al,1 - mov dx,384 - mul dx - mov [point],eax - mcall 70,get_key - - mcall 21,2,1,current_keymap - - inc ecx - mcall 21,,,current_keymap_shift - - inc ecx - mcall 21,,,current_keymap_alt - - movzx edx,[firini] - mcall 21,,9 - ret -;------------------------------------------------------------------------------ -align 4 +;------------------------------- karu: mov [draw_flag_certainly],1 - - add [key_r2],1 - cmp [key_r2],3 - jb .altes - - mov [key_r2],0 -;-------------------------------------- -align 4 -.altes: - cmp [key_r2],0 - je .klt_1 - - cmp [key_r2],1 - je .klt_2 - - cmp [key_r2],2 - je .klt_3 - - jmp still -;-------------------------------------- -align 4 -.klt_1: - mov al,[lngcrc1] - sub al,1 - mov [key_r],al - jmp alted -;-------------------------------------- -align 4 -.klt_2: - mov al,[lngcrc2] - sub al,1 - mov [key_r],al - jmp alted -;-------------------------------------- -align 4 -.klt_3: - mov al,[lngcrc3] - sub al,1 - mov [key_r],al - jmp alted -;------------------------------------------------------------------------------ -align 4 + dec [key_r2] + jns @f + mov [key_r2],2 +@@: + xor eax,eax + mov al, [key_r2] + mov al, [lngcrc1+eax] + dec eax + js karu + jmp applyKeymap +;------------------------------- alter: mov [draw_flag_certainly],1 - - cmp [key_r],0 - je .alt_1 - - cmp [key_r],1 - je .alt_2 - - cmp [key_r],2 - je .alt_3 - - cmp [key_r],3 - je .alt_4 - - cmp [key_r],4 - je .alt_5 - - cmp [key_r],5 - je .alt_6 - - cmp [key_r],6 - je .alt_7 -;-------------------------------------- -align 4 -.alt_1: - mov al,[altlng1] - cmp al,0 - je .exit - - sub al,1 - mov [key_r],al - jmp alted -;-------------------------------------- -align 4 -.alt_2: - mov al,[altlng2] - cmp al,0 - je .exit - - sub al,1 - mov [key_r],al - jmp alted -;-------------------------------------- -align 4 -.alt_3: - mov al,[altlng3] - cmp al,0 - je .exit - - sub al,1 - mov [key_r],al - jmp alted -;-------------------------------------- -align 4 -.alt_4: - mov al,[altlng4] - cmp al,0 - je .exit - - sub al,1 - mov [key_r],al - jmp alted -;-------------------------------------- -align 4 -.alt_5: - mov al,[altlng5] - cmp al,0 - je .exit - - sub al,1 - mov [key_r],al - jmp alted -;-------------------------------------- -align 4 -.alt_6: - mov al,[altlng6] - cmp al,0 - je .exit - - sub al,1 - mov [key_r],al - jmp alted -;-------------------------------------- -align 4 -.alt_7: - mov al,[altlng7] - cmp al,0 - je .exit - - sub al,1 - mov [key_r],al - jmp alted -;-------------------------------------- -align 4 -.exit: - ret -;------------------------------------------------------------------------------ -align 4 -alted: - cmp [key_r],0 - je alt_1 - - cmp [key_r],1 - je alt_2 - - cmp [key_r],2 - je alt_3 - - cmp [key_r],3 - je alt_4 - - cmp [key_r],4 - je alt_5 - - cmp [key_r],5 - je alt_6 - - cmp [key_r],6 - je alt_7 - - ret -;------------------------------------------------------------------------------ -align 4 -alt_1: - mov [point],0 ; english + xor eax,eax + mov al, [key_r] + mov al, [altlng1+eax] + dec eax + js @f +applyKeymap: + cmp al, 9 + jnc @f + push eax + shl eax,7 + lea eax,[eax*2+eax] + mov [point],eax mcall 70,get_key - mcall 21,2,1,current_keymap - inc ecx mcall 21,,,current_keymap_shift - - mcall 21,,9,1 ; 1 - english - ret -;------------------------------------------------------------------------------ -align 4 -alt_2: - mov [point],384 ;1536 ; finnish - mcall 70,get_key - - mcall 21,2,1,current_keymap - - inc ecx - mcall 21,,,current_keymap_shift - - mcall 21,,9,2 ; 2 - finnish - ret -;------------------------------------------------------------------------------ -align 4 -alt_3: - mov [point],768 ; german - mcall 70,get_key - - mcall 21,2,1,current_keymap - - inc ecx - mcall 21,,,current_keymap_shift - - mcall 21,,9,3 ; 3 - german - ret -;------------------------------------------------------------------------------ -align 4 -alt_4: - mov [point],1152 ;384 ; russian - mcall 70,get_key - - mcall 21,2,1,current_keymap - - inc ecx - mcall 21,,,current_keymap_shift - - mcall 21,,9,4 ; 4 - russian - ret -;------------------------------------------------------------------------------ -align 4 -alt_5: - mov [point],1536 ;1152 ;french - mcall 70,get_key - - mcall 21,2,1,current_keymap - - inc ecx - mcall 21,,,current_keymap_shift - inc ecx mcall 21,,,current_keymap_alt - - mcall 21,,9,5 ; 5 - french + pop edx + inc edx + mcall 21,,9 +@@: ret -;------------------------------------------------------------------------------ +;--------------------------------------------------------------- align 4 -alt_6: - mov [point],1920 ; estonian - mcall 70,get_key +current_keymap rb 128 +current_keymap_shift rb 128 +current_keymap_alt rb 128 - mcall 21,2,1,current_keymap +get_ini: + dd 0 +point2 dd 0 + dd 0 + dd 1 + dd inicont + db '/rd/1/settings/lang.ini',0 - inc ecx - mcall 21,,,current_keymap_shift - - mcall 21,,9,6 ; 6 - estonian - ret -;------------------------------------------------------------------------------ -align 4 -alt_7: - mov [point],2304 ; ukrainian - mcall 70,get_key +get_key: + dd 0 +point dd 0 + dd 0 + dd 384 + dd current_keymap + db '/rd/1/settings/keymap.key',0 - mcall 21,2,1,current_keymap - - inc ecx - mcall 21,,,current_keymap_shift - - mcall 21,,9,7 ; 7 - ukrainian - ret -;------------------------------------------------------------------------------ -align 4 -current_keymap: - rb 128 -;------------------------------------------------------------------------------ -align 4 -current_keymap_shift: - rb 128 -;------------------------------------------------------------------------------ -align 4 -current_keymap_alt: - rb 128 -;------------------------------------------------------------------------------ key_r db 0 key_r2 db 0 -key_r3 db 0 inicont db 0 -firini db 0 lngcrc1 db 0 lngcrc2 db 0 lngcrc3 db 0 @@ -413,25 +155,3 @@ altlng6 db 0 altlng7 db 0 altlng8 db 0 altlng9 db 0 -altlng0 db 0 -;------------------------------------------------------------------------------ -align 4 -get_key: dd 0 -point dd 0 - dd 0 - dd 384 - dd current_keymap - db 0 - dd key_file -;------------------------------------------------------------------------------ -align 4 -get_ini: dd 0 -point2 dd 0 - dd 0 - dd 1 - dd inicont - db 0 - dd ini_file -;------------------------------------------------------------------------------ -key_file: db '/rd/1/settings/keymap.key',0 -ini_file: db '/rd/1/settings/lang.ini',0 \ No newline at end of file diff --git a/programs/system/taskbar/trunk/TASKBAR.ASM b/programs/system/taskbar/trunk/TASKBAR.ASM index 2894c80a4f..f54decd8e4 100644 --- a/programs/system/taskbar/trunk/TASKBAR.ASM +++ b/programs/system/taskbar/trunk/TASKBAR.ASM @@ -1,64 +1,64 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; ; +; ; ; TASK PANEL for KolibriOS - Compile with fasm ; -; ; +; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;------------------------------------------------------------------------------ -; version: 2.25 -; last update: 14/07/2013 -; changed by: Marat Zakiyanov aka Mario79, aka Mario -; changes: Reinstall screen work area after change screen resolution +; version: 2.25 +; last update: 14/07/2013 +; changed by: Marat Zakiyanov aka Mario79, aka Mario +; changes: Reinstall screen work area after change screen resolution ;------------------------------------------------------------------------------ -; version: 2.24 -; last update: 16/06/2013 -; changed by: hidnplayr -; changes: Changed keymap hotkeys to only use left alt -; (Right alt has special function on some keyboards) +; version: 2.24 +; last update: 16/06/2013 +; changed by: hidnplayr +; changes: Changed keymap hotkeys to only use left alt +; (Right alt has special function on some keyboards) ;------------------------------------------------------------------------------ -; version: 2.23 -; last update: 26/04/2012 -; changed by: Marat Zakiyanov aka Mario79, aka Mario -; changes: Using new f18.23 - minimize all windows +; version: 2.23 +; last update: 26/04/2012 +; changed by: Marat Zakiyanov aka Mario79, aka Mario +; changes: Using new f18.23 - minimize all windows ;------------------------------------------------------------------------------ -; version: 2.22 -; last update: 20/04/2012 -; changed by: Marat Zakiyanov aka Mario79, aka Mario -; changes: Activation mechanism when trying to run an existing appl. -; Forced redrawing the background after the clean desktop (Win+D) +; version: 2.22 +; last update: 20/04/2012 +; changed by: Marat Zakiyanov aka Mario79, aka Mario +; changes: Activation mechanism when trying to run an existing appl. +; Forced redrawing the background after the clean desktop (Win+D) ;------------------------------------------------------------------------------ -; version: 2.2 -; last update: 19/04/2012 -; changed by: Marat Zakiyanov aka Mario79, aka Mario -; changes: Support PrintScreen for SCRSHOOT. -; Path to run applications from the INI file. -; Algorithm anti-duplication of applications for run with hotkey. -; Added color selection for the Alt+Tab. -; Alt+Ctrl+ArrowLeft - Page list next -; Alt+Ctrl+ArrowRight - Page list previous +; version: 2.2 +; last update: 19/04/2012 +; changed by: Marat Zakiyanov aka Mario79, aka Mario +; changes: Support PrintScreen for SCRSHOOT. +; Path to run applications from the INI file. +; Algorithm anti-duplication of applications for run with hotkey. +; Added color selection for the Alt+Tab. +; Alt+Ctrl+ArrowLeft - Page list next +; Alt+Ctrl+ArrowRight - Page list previous ;------------------------------------------------------------------------------ -; version: 2.1 -; last update: 18/04/2012 -; changed by: Marat Zakiyanov aka Mario79, aka Mario -; changes: Added color selection for the text. -; Show "change page list" only if the applications -; does not fit in the panel. -; Display file names up to 11 char previously displ. only 8 char. +; version: 2.1 +; last update: 18/04/2012 +; changed by: Marat Zakiyanov aka Mario79, aka Mario +; changes: Added color selection for the text. +; Show "change page list" only if the applications +; does not fit in the panel. +; Display file names up to 11 char previously displ. only 8 char. ;------------------------------------------------------------------------------ -; version: 2.0 -; last update: 17/04/2012 -; changed by: Marat Zakiyanov aka Mario79, aka Mario -; changes: New logic of switching windows (turnoff/restore) -; New logic of button "clear desktop". -; Win+D (restore/clear desktop), Win+R (start RUN application). -; Using the library LibINI to set the parameters. -; New style of panel. Start application Menu with boot options. -; two versions of the location of the panel - -; the bottom of the desktop and on top of the desktop. +; version: 2.0 +; last update: 17/04/2012 +; changed by: Marat Zakiyanov aka Mario79, aka Mario +; changes: New logic of switching windows (turnoff/restore) +; New logic of button "clear desktop". +; Win+D (restore/clear desktop), Win+R (start RUN application). +; Using the library LibINI to set the parameters. +; New style of panel. Start application Menu with boot options. +; two versions of the location of the panel - +; the bottom of the desktop and on top of the desktop. ;------------------------------------------------------------------------------ -; last update: 31/03/2012 -; changed by: Marat Zakiyanov aka Mario79, aka Mario -; changes: The program uses only 20 Kb memory is now. -; Code optimizing and refactoring. +; last update: 31/03/2012 +; changed by: Marat Zakiyanov aka Mario79, aka Mario +; changes: The program uses only 20 Kb memory is now. +; Code optimizing and refactoring. ;------------------------------------------------------------------------------ format binary as "" @@ -108,9 +108,9 @@ handle_key: mcall 2 -; dps "panel key: " -; dph eax -; newline +; dps "panel key: " +; dph eax +; newline cmp al, 2 jnz begin_1.ret @@ -122,29 +122,9 @@ handle_key: mov [key_r],al sub [key_r],2 - cmp al, 2 - jz alter + cmp [key_r],9 + jc alter - cmp al, 3 - jz alter - - cmp al, 4 - jz alter - - cmp al, 5 - jz alter - - cmp al, 6 - jz alter - - cmp al, 7 - jz alter - - cmp al, 8 - jz alter -;-------------------------------------- -;align 4 -;prod: if caps_lock_check cmp al,58 ;CAPS LOCK DOWN jne @f @@ -153,35 +133,31 @@ if caps_lock_check mcall 26,2,9 mov ebx,eax mov eax,2 -; call draw_window ;;;??? mov [draw_flag_certainly],1 call draw_flag ; language popa ret @@: end if + cmp al, 15 ; Alt+Tab DOWN jz alt_tab_pressed cmp al, 88 ; Ctrl+Alt+F12 jz start_end_application - - cmp al, 91 ; RWin DOWN jz set_win_key_flag cmp al, 92 ; LWin DOWN jz set_win_key_flag - cmp al, 219 ; RWin UP jz cut_win_key_flag ;start_menu_application cmp al, 220 ; LWin UP jz cut_win_key_flag ;start_menu_application - cmp al, 62 ; Alt+F4 jz kill_active_application @@ -205,12 +181,6 @@ end if ;-------------------------------------- align 4 prod: -; cmp eax,0x20000 -; je start_menu_application - -; cmp eax,0x40000 -; je start_menu_application - cmp [current_alt_tab_app], -1 jz @f @@ -221,9 +191,6 @@ align 4 @@: ; this is hotkey Ctrl+Shift ;or LShift+RShift jmp karu -; mov ebx, setup_exec -; test ah, 001100b -; jz change_sys_lang ;------------------------------------------------------------------------------ align 4 set_win_key_flag: @@ -254,12 +221,6 @@ align 4 .ret: ret ;------------------------------------------------------------------------------ -;align 4 -;change_sys_lang: -; mov dword [ebx+8], syslang -; mcall 70 -; jmp begin_1 -;------------------------------------------------------------------------------ align 4 start_end_application: mov esi,end_name @@ -387,15 +348,6 @@ align 4 cmp edi,eax jg .apply_changes -; mov eax,[ebx+10] -; and eax,not 20202020h -; cmp eax,'SCRS' -; jz @f - -; mov eax,[ebx+14] -; and eax,not 20202020h -; cmp eax,'HOOT' -; jne @r mov esi,edx mov ecx,11 add ebx,9 @@ -638,33 +590,14 @@ load_libraries l_libs_start,end_l_libs mcall 66,4,0,2 ; LShift+RShift mcall 66,,,11h ; Ctrl+Shift mcall 66,,88,110h ; Alt+Ctrl+F12 -; mcall 66,,75 ; Alt+Ctrl+ArrowLeft DOWN -; mcall 66,,203 ; Alt+Ctrl+ArrowLeft UP -; mcall 66,,77 ; Alt+Ctrl+ArrowRight DOWN -; mcall 66,,205 ; Alt+Ctrl+ArrowRight UP - mcall 66,,91,0h ; RWin DOWN mcall 66,,92 ; LWin DOWN mcall 66,,219 ; RWin UP mcall 66,,220 ; LWin UP - -; mcall 66,,147,0h ; Win+R UP mcall 66,,19,0h ; Win+R DOWN - -; mcall 66,,23,0h ; Win+I DOWN - mcall 66,,32,0h ; Win+D DOWN -; mcall 66,,160,0h ; Win+D UP - mcall 66,,55,10h ; Ctrl+PrintScreen DOWN -; mcall 66,,183,10h ; Ctrl+PrintScreen UP - - -; mcall 66,,91,100h ; Alt+LWin -; mcall 66,,92 ; Alt+RWin mcall 66,,62,300h ; Alt+F4 -; mcall 66,,71 ; Alt+Home -; mcall 66,,72 ; Alt+Up mcall 66,,2 ; Alt+1 mcall 66,,3 ; Alt+2 mcall 66,,4 ; Alt+3 @@ -672,6 +605,8 @@ load_libraries l_libs_start,end_l_libs mcall 66,,6 ; Alt+5 mcall 66,,7 ; Alt+6 mcall 66,,8 ; Alt+7 + mcall 66,,9 ; Alt+8 + mcall 66,,10 ; Alt+9 mcall 66,,15 ; Alt+Tab DOWN mcall 66,,15,301h ; Alt+Shift+Tab DOWN mcall 66,,69 ; Alt+Shift+NumLock @@ -694,16 +629,13 @@ end if align 4 start_after_minimize: call draw_window -; call draw_tray call draw_running_applications mcall 23,30 call load_ini - call fir_lng ;------------------------------------------------------------------------------ align 4 still: -; call draw_tray call draw_time call draw_cpu_usage call draw_running_applications @@ -770,8 +702,6 @@ align 4 @@: cmp eax,3 ; button ? jz button - -; call handle_key ;-------------------------------------- align 4 .key: @@ -838,7 +768,6 @@ align 4 align 4 .lp1: call draw_window -; call draw_tray jmp still ;------------------------------------------------------------------------------ align 4 @@ -926,12 +855,6 @@ no_activate: cmp ah, 103 je clean_desktop_1 ; minimize all windows -; cmp ah, 104 -; je restore_desktop ; restore minimized windows - -; cmp ah, 105 -; je swap_minimized_desktop ; minimize normal windows, and restore minimized windows - cmp ah,byte 1 ; start/terminate menu jnz noselect @@ -970,25 +893,12 @@ noid15: cmp ah,16 jne noid16 -; mov ebx, setup_exec -; mov dword [ebx+8], chlang -; mcall 70 call karu call draw_flag ; language jmp still ;-------------------------------------- align 4 noid16: -; cmp ah,17 -; jne noid17 -; -; mov ebx, setup_exec -; mov dword [ebx+8], syslang -; mcall 70 -; jmp still -;-------------------------------------- -;align 4 -; noid17: cmp ah,18 jne noid18 @@ -1009,25 +919,6 @@ align 4 ;-------------------------------------- align 4 noid18: -; cmp ah,19 ; speaker -; jne noid19 - -; mcall 18,8,2 -; mcall 15,3 -; jmp red -;-------------------------------------- -;align 4 -;noid19: -; cmp ah,20 ; start system setup -; jnz noid20 -; -; mov ebx, setup_exec -; and dword [ebx+8], 0 -; mcall 70 -; jmp still -;-------------------------------------- -;align 4 -;noid20: cmp ah,21 jnz noid21 @@ -1095,7 +986,7 @@ align 4 ;-------------------------------------- align 4 .store: -; dps "param_store: " +; dps "param_store: " mov [edi],bl inc edi dec ecx @@ -1154,8 +1045,6 @@ draw_small_right: mov bx,[height] shr bx,1 sub bx,3 -; mov ecx,[wcolor] -; add ecx,0x303030 mov edx,[wcolor] mov eax,COLOR_CHANGE_MAGNITUDE_2 call add_color_change_magnitude @@ -1186,8 +1075,6 @@ draw_small_left: mov bx,[height] shr bx,1 sub bx,3 -; mov ecx,[wcolor] -; add ecx,0x303030 mov edx,[wcolor] mov eax,COLOR_CHANGE_MAGNITUDE_2 call add_color_change_magnitude diff --git a/programs/system/taskbar/trunk/drawtray.inc b/programs/system/taskbar/trunk/drawtray.inc index 4b2423c0a0..7dcf8af8b0 100644 --- a/programs/system/taskbar/trunk/drawtray.inc +++ b/programs/system/taskbar/trunk/drawtray.inc @@ -1,137 +1,96 @@ -;------------------------------------------------------------------------------ -align 4 -draw_tray: ; draw cpu usage, time, date etc. - pusha +draw_tray: ; draw cpu usage, time, date etc. + pusha call draw_tray_buttons call draw_time_skin call draw_time - mov [draw_flag_certainly],1 - call draw_flag ; language - + call draw_flag ; language call draw_list_button - popa ret -;------------------------------------------------------------------------------ +;--------------------------------------------------------------- draw_tray_buttons: mov [offset_x_tray],0 - cmp [minimize_right],dword 0 je @f - add [offset_x_tray],MR_SIZE -;-------------------------------------- -align 4 @@: -; mov ecx,3 shl 16 -; add ecx,[height] -; sub cx,6 mov ecx,[height] mov esi,[wcolor] mov eax,8 -;-------------------------------------- cmp [clock_enable],dword 0 je @f - add [offset_x_tray],CLOCK_SIZE - mov ebx,[max_x] sub ebx,[offset_x_tray] shl ebx,16 add ebx,CLOCK_SIZE+1 - mcall ,,,0x60000000+2 ; time/date button - sub ebx,3 + mcall ,,,0x60000000+2 ; time/date button + sub ebx,3 mov [pos_x_clock],ebx -;-------------------------------------- -align 4 @@: cmp [cpu_usage_enable],dword 0 je @f - add [offset_x_tray],CPU_USAGE_SIZE - mov ebx,[max_x] sub ebx,[offset_x_tray] shl ebx,16 add ebx,CPU_USAGE_SIZE+1 mcall ,,,0x60000000+18 ;button 18 - sysmeter_name (GMON) - sub ebx,3 + sub ebx,3 mov [pos_x_cpu_usage],ebx -;-------------------------------------- -align 4 @@: cmp [chlang_enable],dword 0 je @f - add [offset_x_tray],CHLANG_SIZE - mov ebx,[max_x] sub ebx,[offset_x_tray] shl ebx,16 add ebx,CHLANG_SIZE+1 mcall ,,,0x60000000+16 ;button 16 - chang language - sub ebx,3 + sub ebx,3 mov [pos_x_cpu_chlang],ebx -;-------------------------------------- -align 4 @@: cmp [page_list_enable],dword 0 je @f - add [offset_x_tray],PAGE_LIST_SIZE - mov ebx,[max_x] sub ebx,[offset_x_tray] shl ebx,16 add ebx,10 mov [pos_x_page_list],ebx mcall ,,,0x60000000+22 ;button 22 - page list decrease - + add ebx,24 shl 16 - mcall ,,,0x60000000+21 ;button 21 - page list decrease -;-------------------------------------- -align 4 @@: ret -;------------------------------------------------------------------------------ -align 4 +;--------------------------------------------------------------- draw_time_skin: cmp [clock_enable],dword 0 - je .exit - - + je @b mov ebx,[pos_x_clock] call calculate_button_y_coordinate_and_size - + mov edx,[Clock_color] ;time_bgr_color mov esi,[wcolor] - call draw_appl_button -;-------------------------------------- -align 4 -.exit: - ret -;------------------------------------------------------------------------------ -align 4 + jmp draw_appl_button +;--------------------------------------------------------------- draw_time: cmp [clock_enable],dword 0 - je .exit - + je @b mcall 3 cmp eax,[ptime] - jz .exit - + jz @b mov [ptime],eax -;-------------------------------------- + ; draw hours and minutes movzx ebx,al shr eax,8 movzx ecx,al shr eax,8 movzx edx,al -; ebx ecx edx h m s push ebx push ecx @@ -143,38 +102,35 @@ draw_time: shr ecx,16 add eax,ecx mov bx,ax - add ebx,18 shl 16 - -; mov ecx,[bte] mov ecx,[PanelText_color] or ecx,0x40000000 - mov edx,[esp] ; __:_X + mov edx,[esp] ; __:_X and edx,15 add ebx,10*65536 add edx,text mcall 4,,,,1,[Clock_color] ;time_bgr_color - pop edx ; __:X_ + pop edx ; __:X_ shr edx,4 and edx,15 sub ebx,6*65536 add edx,text - mcall + mcall - mov edx,[esp] ; _X:__ + mov edx,[esp] ; _X:__ and edx,15 sub ebx,11*65536 add edx,text mcall - pop edx ; X_:__ + pop edx ; X_:__ shr edx,4 and edx,15 sub ebx,6*65536 add edx,text mcall -;-------------------------------------- + ; draw seconds mov ebx,[pos_x_clock] call calculate_button_y_coordinate_and_size @@ -184,74 +140,42 @@ draw_time: shr ecx,16 add eax,ecx mov bx,ax - add ebx,17 shl 16 - mcall 3 mov ecx,eax shr ecx,16 and ecx,1 -; mov edx,[bte] mov edx,[PanelText_color] sub edx,[Clock_color] ;time_bgr_color;[wcolor] imul ecx,edx add ecx,[Clock_color] ;time_bgr_color;[wcolor] - mcall 4,,,sec,1 - call draw_cpu_usage -;-------------------------------------- -align 4 -.exit: - ret -;------------------------------------------------------------------------------ -align 4 + jmp draw_cpu_usage +;--------------------------------------------------------------- draw_list_button: cmp [page_list_enable],dword 0 - je .exit + je @f + ; draw page list button "skin" mov ebx,[pos_x_page_list] mov bx,10 - call calculate_button_y_coordinate_and_size -; mov ecx,3 shl 16 -; add ecx,[height] -; sub cx,6 - xor edx,edx -; mcall 13 - mov edx,[PageList_color] ;0xffffff mov esi,[wcolor] call draw_appl_button - + add ebx,24 shl 16 ; 18 shl 16 -; mcall - mov edx,[PageList_color] ;0xffffff mov esi,[wcolor] call draw_appl_button - -; sub ebx,23 shl 16 ; 19 shl 16 -; sub bx,2 -; add ecx,1 shl 16 -; sub ecx,2 -; mcall ,,,0xffffff - -; add ebx,24 shl 16 -; mcall -;-------------------------------------- ; draw page list button text <> mov ebx,[pos_x_page_list] add ebx,2 shl 16 -; mov eax,[height] -; shr eax,1 -; sub eax,4 -; mov bx,ax - call calculate_button_y_coordinate_and_size movzx eax,cx shr eax,1 @@ -259,33 +183,29 @@ draw_list_button: shr ecx,16 add eax,ecx mov bx,ax - xor ecx,ecx mcall 4,,,page_a1,5 add ebx,1 shl 16 mcall -;-------------------------------------- + ; draw page list number mov edx,ebx add edx,9 shl 16 mcall 47,0x20000,[page_list],,[system_colours.work_button_text] -;-------------------------------------- -align 4 -.exit: +@@: ret -;------------------------------------------------------------------------------ -align 4 +;--------------------------------------------------------------- draw_cpu_usage: cmp [cpu_usage_enable],dword 0 - je .exit + je @b pushad + mov eax,[height] sub eax,[button_top_offset] sub eax,[button_bottom_offset] sub eax,2 - mov [ysi],eax ;12 mcall 18,5 ; TSC / SEC @@ -301,86 +221,51 @@ draw_cpu_usage: inc ebx div ebx cmp eax,[ysi] - jng .no_bug - + jng @f mov eax,[ysi] -;-------------------------------------- -align 4 -.no_bug: +@@: push eax - mov ebx,[pos_x_cpu_usage] mov ecx,[button_top_offset] shl ecx,16 add ecx,[ysi] add ecx,2 - mov edx,[CpuUsageBckgr_color] ;0xdd2222 mov esi,[wcolor] call draw_appl_button - pop eax -; mov ecx,4 shl 16 mov ecx,[button_top_offset] inc ecx shl ecx,16 add ecx,eax - - add ebx,1 shl 16 sub ebx,2 - mcall 13,,,[CpuUsage_color] ;0x44aa44 popad -;-------------------------------------- -align 4 -.exit: +@@: ret -;------------------------------------------------------------------------------ -align 4 -; eax = number (1 or 2) -; ebx = language id +;--------------------------------------------------------------- +; get and draw keyboard layout draw_flag: cmp [chlang_enable],dword 0 - je .exit - + je @b cmp [draw_flag_certainly],0 - je .exit + je @b pusha -;-------------------------------------- -; get and draw keyboard layout + mcall 26,2,9 - - mov ebx,eax - -; mov eax,2 + mov edx,eax mov [type_lang],al -; eax = 2 BIG -; eax = 1 small - mov edx,ebx pushad mov ebx,[pos_x_cpu_chlang] call calculate_button_y_coordinate_and_size - -; cmp [type_lang],1 -; je .label_1 - mov edx,[ChangeLang_color] ;time_bgr_color ;0xff ;[wcolor] -; jmp .label_2 -;-------------------------------------- -;align 4 -;.label_1: -; mov edx,0x7700 -;-------------------------------------- -;align 4 -;.label_2: mov esi,[wcolor] call draw_appl_button - popad mov ebx,[pos_x_cpu_chlang] @@ -389,7 +274,6 @@ draw_flag: shl eax,16 add ebx,eax sub ebx,6 shl 16 - call calculate_button_y_coordinate_and_size movzx eax,cx shr eax,1 @@ -397,48 +281,23 @@ draw_flag: shr ecx,16 add eax,ecx mov bx,ax - -; mov ecx,[bte] ; color mov ecx,[PanelText_color] if caps_lock_check -; make flag_text 'enfigerufretua' or 'ENFIGERUFRETUA' depending on CapsLock state. - call flag_text_setup + push ebx + mov [flag_text],flagTextSm + mcall 66,3 + test eax, 0x40 + jz @f + mov [flag_text],flagTextBg +@@: + pop ebx end if + dec edx shl edx,1 - add edx,flag_text + add edx,[flag_text] mcall 4,,,,2 popa mov [draw_flag_certainly],0 -;-------------------------------------- -align 4 -.exit: ret -;------------------------------------------------------------------------------ -align 4 -if caps_lock_check -flag_text_setup: - pusha - mcall 66,3 - mov edi, flag_text - mov esi, flag_text_caps_off - test eax, 0x40 - jz @f - - add esi, 14 -;-------------------------------------- -align 4 -@@: - mov ecx, 14 - rep movsb - - popa - ret - -;flag_text_caps_off db 'enfigerufretua' -flag_text_caps_off: -db 'EnFiGeRuFrEtUa' -db 'ENFIGERUFRETUA' -end if -;------------------------------------------------------------------------------ diff --git a/programs/system/taskbar/trunk/drawwind.inc b/programs/system/taskbar/trunk/drawwind.inc index 5a12d54907..97915ce0ab 100644 --- a/programs/system/taskbar/trunk/drawwind.inc +++ b/programs/system/taskbar/trunk/drawwind.inc @@ -11,9 +11,6 @@ draw_window: mcall 48,3,system_colours,10*4 mov eax, [system_colours+4*6] -; sub eax, 0x101010 -; mov [wcolor], eax - mov edx,[system_colours+4*6] mov eax,COLOR_CHANGE_MAGNITUDE call subtract_color_change_magnitude @@ -85,7 +82,6 @@ fill_window: movzx ebx,word [screenxy+2] xor ecx,ecx mov edx,[wcolor] -; add edx,0x161616 mov eax,COLOR_CHANGE_MAGNITUDE_0 imul eax,dword [soften_height] call subtract_color_change_magnitude @@ -93,8 +89,7 @@ fill_window: je no_su ;-------------------------------------- align 4 -@@: ; debug.inc has macros with the same name -; sub edx,0x040404 +@@: mov eax,COLOR_CHANGE_MAGNITUDE_0 call add_color_change_magnitude ; draw soften_up - the width of 5 pixels @@ -146,7 +141,6 @@ no_sd: ;-------------------------------------- align 4 @@: -; mov esi,stripe mov edx,[wcolor] ;-------------------------------------- align 4 @@ -181,7 +175,6 @@ minimize_left_button: add ecx,[height] dec ecx mov edx,101 -; add edx,[button_frames] or edx,0x40000000 mcall 8,<0,9>,,,[wcolor] ; ABS LEFT @@ -189,8 +182,6 @@ minimize_left_button: mov bx,[height] shr bx,1 sub bx,3 -; mov ecx,[wcolor] -; add ecx,0x303030 mov edx,[wcolor] mov eax,COLOR_CHANGE_MAGNITUDE_2 call add_color_change_magnitude @@ -215,9 +206,8 @@ minimize_right_button: add ecx,[height] dec ecx add ebx,68*65536 - mov bx,10 ;9 + mov bx,10 ;9 mov edx,102 -; add edx,[button_frames] or edx,0x40000000 mcall 8,,,,[wcolor] ; ABS RIGHT @@ -227,8 +217,6 @@ minimize_right_button: mov bx,[height] shr bx,1 sub bx,3 -; mov ecx,[wcolor] -; add ecx,0x303030 mov edx,[wcolor] mov eax,COLOR_CHANGE_MAGNITUDE_2 call add_color_change_magnitude @@ -256,11 +244,8 @@ draw_menu_and_clean_desktop: ;-------------------------------------- align 4 @@: -; call calculate_button_y_coordinate_and_size mov ecx, [height] mov edx, 0x60d1ff01 -; mov edx, 0xd1ff01 -; add edx, [button_frames] mcall 8,,,,[wcolor] ; MENU BUTTON mov eax,ebx @@ -285,10 +270,10 @@ align 4 add ebx,3 shl 16 - 5 call draw_appl_button - add ebx, 6*65536 + add ebx, 4*65536 mov bx,[height] shr bx,1 - sub bx,3 + sub bx,7 mov ecx,[PanelText_color] or ecx,0x10000000 if lang eq et @@ -324,7 +309,6 @@ align 4 mov esi, dword [system_colours+24] ; drawing buttons and esi, 0x00ffffff mov edx, 0x60000000 + 103 -; call calculate_button_y_coordinate_and_size mov ecx, [height] mcall 8 ;,,<3,13> @@ -332,12 +316,9 @@ align 4 mov edx,[CleanDesktopButton_color] ;time_bgr_color mov esi,[wcolor] call draw_appl_button - -; mov ecx, dword [system_colours+28] -; and ecx, 0x00ffffff + mov ecx,[PanelText_color] add ebx,5 shl 16 -; mov bx,6 mov bx,[height] shr bx,1 sub bx,2 @@ -359,7 +340,6 @@ draw_application_buttons: call calculate_offset_X -; mcall 14 mov eax,[screenxy] shr eax,16 @@ -416,9 +396,6 @@ align 4 mov edx,edi add edx,52 or edx,0x60000000 -; mov ecx, 1*65536 -; add ecx, [height] -; sub ecx,3 mov ecx, [height] mcall 8,,,,[wcolor] diff --git a/programs/system/taskbar/trunk/i_data.inc b/programs/system/taskbar/trunk/i_data.inc index 5ec3bb1cec..bfa4c51d6c 100644 --- a/programs/system/taskbar/trunk/i_data.inc +++ b/programs/system/taskbar/trunk/i_data.inc @@ -1,27 +1,43 @@ -;------------------------------------------------------------------------------ + align 4 - - -; DATA stripe: - dd -0x010101 - dd -0x010101 - dd -0x020202 - dd -0x010101 - dd -0x000000 - - dd 0x000000 - dd 0x010101 - dd 0x020202 - dd 0x010101 - dd 0x010101 +dd -0x010101 +dd -0x010101 +dd -0x020202 +dd -0x010101 +dd -0x000000 +dd 0x000000 +dd 0x010101 +dd 0x020202 +dd 0x010101 +dd 0x010101 m_icon: - dd 0x0 - dd 0x808080 - dd 0x000000 - dd 0x000000 - dd 0xffffff +dd 0x0 +dd 0x808080 +dd 0x000000 +dd 0x000000 +dd 0xffffff + +running_applications dd 0x100 +max_applications dd 11 +current_alt_tab_app dd -1 +draw_start_position dd 0 +page_list dd 0 +small_draw dd 0x0 +flag_text dd flagTextSm +screenxy dd 0x0 +this_slot dd 0 ; Slot of this process +max_slot dd 255 +stcount dd 0x0 +ysi dd 0 +ptime dd 0x0 +max_x dd 0x0 +wcolor dd 0x506070 + +mi_text db 'WAVETETRBGRDGPL ' +flagTextSm db 'EnFiGeRuFrEtUaItBe' +flagTextBg db 'ENFIGERUFRETUAITBE' lsz m_text,\ ru, "Œ¥­î",\ @@ -29,64 +45,16 @@ lsz m_text,\ et, "MENÜÜ",\ sp, "Menu" -mi_text db 'WAVETETRBGRDGPL ' - -flag_text db 'EnFiGeRuFrEtUa' - +bootparam_printscreen db 'DIRECT',0 type_lang db 0 - -;sound_flag db 0 -;button_frames dd 0x0 - -;checks dd -1 -hidetext db 0x11,0x10,0x1e - -turn_text db '><' -gpl db 'GPL' - -chlang db 'LANG',0 -;syslang db 'SLAN',0 - contrast db 0 - -running_applications dd 0x100 -max_applications dd 11 - -current_alt_tab_app dd -1 - -page_list dd 0 -draw_start_position dd 0 - -;b_size_y: dd 0x0 -ysi dd 0 -small_draw dd 0x0 - -ptime dd 0x0 -max_x dd 0x0 -text db '0123456789' - -page_a1 db '< >' page_clean_but db 25,24,18 - -;bte dd 0x0 ;ccddee - -wcolor dd 0x506070 - +hidetext db 17,16,30 +Path_def_val db 'NONE',0 sec db ': ' -;pros db ' ' -; db ' ' - -screenxy dd 0x0 -stcount dd 0x0 - -setup_exec: - dd 7 - dd 0 -.cmdline dd 0 - dd 0 - dd 0 - db '/sys/' -file_sys db 'SETUP',0 +chlang db 'LANG',0 +page_a1 db '< >' +text db '0123456789' exec_fileinfo: dd 7 @@ -97,13 +65,6 @@ exec_fileinfo: db 0 .name dd 0 -bootparam_printscreen db 'DIRECT',0 - -Path_def_val db 'NONE',0 - -this_slot dd 0 ; Slot of this process -max_slot dd 255 - ;-------------------------------------- menu_button_x: .start dd 1234 ;0xffff @@ -112,7 +73,6 @@ menu_button_x: menu_button_y: .start dd 0xaa .size dd 0xc -;-------------------------------------- ;------------------------------------------------------------------------------ ; INI variables width: dd 0 ;305 @@ -122,16 +82,11 @@ button_top_offset: dd 0 button_bottom_offset: dd 0 ;------------------------------------------------------------------------------ ; INI flags -;buttons dd 1 ; 0 no frames ; 1 frames -soften_up: dd 1 ; 0 no ; 1 yes -soften_down: dd 0 ; 0 no ; 1 yes -minimize_left: dd 0 -minimize_right: dd 1 -;icons_position dd 95 ; not used! -menu_enable: dd 1 -;tray_enable: dd 0 ; draw cpu usage, time, date -;graph_text dd 1 ; not used! -;soften_middle dd 1 ; not used! ; 0 no ; 1 yes +soften_up: dd 1 ; 0 no ; 1 yes +soften_down: dd 0 ; 0 no ; 1 yes +minimize_left: dd 0 +minimize_right: dd 1 +menu_enable: dd 1 run_appl: dd 1 ; 0 defaults ; 1 activate clean_desktop_enable: dd 1 clock_enable: dd 1 @@ -188,17 +143,13 @@ aRun db 'Run',0 aPrnScr db 'PrnScr',0 aMouseEmul db 'MouseEmul',0 ;------------------------------------------------------------------------------ -plugins_directory db 0 - -ini_file_name db 'settings/taskbar.ini',0 - -system_dir_Libini db '/sys/lib/libini.obj',0 - -err_message_found_lib2 db 'libini.obj - Not found!',0 -err_message_import2 db 'libini.obj - Wrong import!',0 - +plugins_directory db 0 +ini_file_name db 'settings/taskbar.ini',0 +system_dir_Libini db '/sys/lib/libini.obj',0 +err_message_found_lib2 db 'libini.obj - Not found!',0 +err_message_import2 db 'libini.obj - Wrong import!',0 head_f_i: -head_f_l db 'Errors of PLugins:',0 +head_f_l db 'Errors of PLugins:',0 ;------------------------------------------------------------------------------ l_libs_start: