Subversion Repositories Kolibri OS

Compare Revisions

Ignore whitespace Rev 9933 → Rev 9971

/programs/system/taskbar/trunk/TASKBAR.ASM
1,85 → 1,85
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; ;
; 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 ""
 
use32
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; program start
dd IM_END ; program image size
dd I_END ; reguired amount of memory - 10 Kb
dd stack_top ; esp
dd 0x0 ; boot parameters
dd path ; application pach
use32
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; program start
dd IM_END ; program image size
dd I_END ; reguired amount of memory - 10 Kb
dd stack_top ; esp
dd 0x0 ; boot parameters
dd path ; application pach
;------------------------------------------------------------------------------
include 'lang.inc'
include '../../../macros.inc'
include '../../../proc32.inc'
;include '../../../debug.inc'
include 'MOI.INC' ;à áª« ¤ª¨ ª« ¢¨ âãàë
include 'MOI.INC' ;à áª« ¤ª¨ ª« ¢¨ âãàë
include '../../../develop/libraries/box_lib/load_lib.mac'
@use_library ;use load lib macros
@use_library ;use load lib macros
;------------------------------------------------------------------------------
caps_lock_check fix 1
;------------------------------------------------------------------------------
93,7 → 93,7
MENU_SIZE = 50
end if
CLD_SIZE = 20
TAB_SIZE = 75 ;60
TAB_SIZE = 75 ;60
TRAY_SIZE = 140
 
CLOCK_SIZE = 40
103,1056 → 103,1056
;------------------------------------------------------------------------------
align 4
handle_key:
mcall 18,7
mov [active_process],eax
mcall 18,7
mov [active_process],eax
 
mcall 2
mcall 2
 
; dps "panel key: "
; dph eax
; newline
; dps "panel key: "
; dph eax
; newline
 
cmp al, 2
jnz begin_1.ret
cmp al, 2
jnz begin_1.ret
 
mov ebx, exec_fileinfo
shr eax, 8
cmp al, 0
je prod
mov ebx, exec_fileinfo
shr eax, 8
cmp al, 0
je prod
 
mov [key_r],al
sub [key_r],3
cmp [key_r],9
jc alter
mov [key_r],al
sub [key_r],3
cmp [key_r],9
jc alter
 
if caps_lock_check
cmp al,58 ;CAPS LOCK DOWN
jne @f
cmp al,58 ;CAPS LOCK DOWN
jne @f
 
pusha
mcall 26,2,9
mov ebx,eax
mov eax,2
mov [draw_flag_certainly],1
call draw_flag ; language
popa
ret
pusha
mcall 26,2,9
mov ebx,eax
mov eax,2
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, 15 ; Alt+Tab DOWN
jz alt_tab_pressed
 
cmp al, 88 ; Ctrl+Alt+F12
jz start_end_application
cmp al, 88 ; Ctrl+Alt+F12
jz start_end_application
 
cmp al, 91 ; RWin DOWN
jz set_win_key_flag
cmp al, 91 ; RWin DOWN
jz set_win_key_flag
 
cmp al, 92 ; LWin DOWN
jz set_win_key_flag
cmp al, 92 ; LWin DOWN
jz set_win_key_flag
 
cmp al, 1 ; LCtrl+Esc DOWN
jz set_win_key_flag
cmp al, 1 ; LCtrl+Esc DOWN
jz set_win_key_flag
 
cmp al, 219 ; RWin UP
jz cut_win_key_flag ;start_menu_application
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, 220 ; LWin UP
jz cut_win_key_flag ;start_menu_application
 
cmp al, 129 ; LCtrl+Esc UP
jz cut_win_key_flag ;start_menu_application
cmp al, 129 ; LCtrl+Esc UP
jz cut_win_key_flag ;start_menu_application
 
cmp al, 62 ; Alt+F4
jz kill_active_application
cmp al, 62 ; Alt+F4
jz kill_active_application
 
cmp al, 205
jz page_list_next
cmp al, 205
jz page_list_next
 
cmp al, 203
jz page_list_prev
cmp al, 203
jz page_list_prev
 
cmp al, 69 ; Alt+Shift+NumLock
jz start_mousemul_application
cmp al, 69 ; Alt+Shift+NumLock
jz start_mousemul_application
 
cmp al, 19 ; Win+R
jz start_run_application
cmp al, 19 ; Win+R
jz start_run_application
 
cmp al, 32 ; Win+D
jz minimize_all_windows
cmp al, 32 ; Win+D
jz minimize_all_windows
 
cmp al, 55 ; PrintScreen DOWN
jz start_PrintScreen_application
cmp al, 55 ; PrintScreen DOWN
jz start_PrintScreen_application
;--------------------------------------
align 4
prod:
cmp [current_alt_tab_app], -1
jz @f
cmp [current_alt_tab_app], -1
jz @f
 
test ah, 0x30 ; Alt+Tab UP
jz alt_tab_released
test ah, 0x30 ; Alt+Tab UP
jz alt_tab_released
;--------------------------------------
align 4
@@:
; this is hotkey LCtrl+LShift ;or LShift+RShift
jmp karu
jmp karu
;------------------------------------------------------------------------------
align 4
set_win_key_flag:
mov [win_key_flag],1
ret
mov [win_key_flag],1
ret
;------------------------------------------------------------------------------
align 4
cut_win_key_flag:
xor eax,eax
mov [win_key_flag],al
xchg [start_menu_flag],al
test al,al
jz start_menu_application
ret
xor eax,eax
mov [win_key_flag],al
xchg [start_menu_flag],al
test al,al
jz start_menu_application
ret
;------------------------------------------------------------------------------
align 4
change_key_lang:
mov dword [ebx+8], chlang
mcall 70
mov dword [ebx+8], chlang
mcall 70
;--------------------------------------
align 4
begin_1:
mov ecx,[active_process]
mcall 18, 3
mcall 5, 25
mov ecx,[active_process]
mcall 18, 3
mcall 5, 25
;--------------------------------------
align 4
.ret:
ret
ret
;------------------------------------------------------------------------------
align 4
start_end_application:
mov esi,end_name
call algorithm_anti_duplication
test eax,eax
jz @f
mov esi,end_name
call algorithm_anti_duplication
test eax,eax
jz @f
 
mcall 18,3,edi
ret
mcall 18,3,edi
ret
;--------------------------------------
align 4
@@:
mov ebx, exec_fileinfo
mov dword [ebx+21],end_name
mcall 70
ret
mov ebx, exec_fileinfo
mov dword [ebx + 21],end_name
mcall 70
ret
;------------------------------------------------------------------------------
align 4
start_mousemul_application:
mov esi,mousemul_name
call algorithm_anti_duplication
test eax,eax
jz @f
ret
mov esi,mousemul_name
call algorithm_anti_duplication
test eax,eax
jz @f
ret
;--------------------------------------
align 4
@@:
mov ebx, exec_fileinfo
mov dword [ebx+21],mousemul_name
mcall 70
ret
mov ebx, exec_fileinfo
mov dword [ebx + 21],mousemul_name
mcall 70
ret
;------------------------------------------------------------------------------
align 4
kill_active_application:
mcall 72,1,3,1
jmp begin_1.ret
mcall 72,1,3,1
jmp begin_1.ret
;------------------------------------------------------------------------------
 
align 4
start_menu_application:
call menu_handler
jmp begin_1.ret
call menu_handler
jmp begin_1.ret
;------------------------------------------------------------------------------
align 4
start_run_application:
cmp [win_key_flag],1
je @f
ret
cmp [win_key_flag],1
je @f
ret
;--------------------------------------
align 4
@@:
mov [start_menu_flag],1
mov [start_menu_flag],1
 
mov esi,run_name
call algorithm_anti_duplication
test eax,eax
jz @f
mov esi,run_name
call algorithm_anti_duplication
test eax,eax
jz @f
 
mcall 18,3,edi
ret
mcall 18,3,edi
ret
;--------------------------------------
align 4
@@:
mov ebx, exec_fileinfo
mov dword [ebx+21], run_name
mcall 70
jmp begin_1.ret
mov ebx, exec_fileinfo
mov dword [ebx + 21], run_name
mcall 70
jmp begin_1.ret
;------------------------------------------------------------------------------
align 4
start_PrintScreen_application:
mov esi,printscreen_name
call algorithm_anti_duplication
test eax,eax
jz @f
mcall 18,3,edi
ret
mov esi,printscreen_name
call algorithm_anti_duplication
test eax,eax
jz @f
mcall 18,3,edi
ret
;--------------------------------------
align 4
@@:
mov ebx, exec_fileinfo
mov dword [ebx+21],printscreen_name
mov [ebx+8],dword bootparam_printscreen
mcall 70
jmp begin_1.ret
mov ebx, exec_fileinfo
mov dword [ebx + 21],printscreen_name
mov [ebx+8],dword bootparam_printscreen
mcall 70
jmp begin_1.ret
;------------------------------------------------------------------------------
align 4
minimize_all_windows:
cmp [win_key_flag],1
je @f
ret
cmp [win_key_flag],1
je @f
ret
;--------------------------------------
align 4
@@:
mov [start_menu_flag],1
call clean_desktop
ret
mov [start_menu_flag],1
call clean_desktop
ret
;------------------------------------------------------------------------------
align 4
algorithm_anti_duplication:
cld
cld
;--------------------------------------
align 4
@@:
lodsb
test al,al
jnz @r
lodsb
test al,al
jnz @r
;--------------------------------------
align 4
@@:
std
lodsb
cmp al,'/'
jnz @r
add esi,2
mov edx,esi
std
lodsb
cmp al,'/'
jnz @r
add esi,2
mov edx,esi
 
mov edi,1
mov edi,1
;--------------------------------------
align 4
@@:
inc edi
mov ecx,edi
mcall 9,procinfo_window_tabs
inc edi
mov ecx,edi
mcall 9,procinfo_window_tabs
 
cmp edi,eax
jg .apply_changes
cmp edi,eax
jg .apply_changes
 
mov esi,edx
mov ecx,11
add ebx,9
cld
mov esi,edx
mov ecx,11
add ebx,9
cld
;--------------------------------------
align 4
.loop:
lodsb
inc ebx
cmp al,[ebx]
jne @r
lodsb
inc ebx
cmp al,[ebx]
jne @r
 
loop .loop
loop .loop
 
mov eax,1
ret
mov eax,1
ret
;--------------------------------------
align 4
.apply_changes:
xor eax,eax
ret
xor eax,eax
ret
;------------------------------------------------------------------------------
align 4
page_list_next:
cmp [page_list],50
je @f
cmp [page_list],50
je @f
 
xor eax,eax
cmp [page_list_enable],eax
je @f
xor eax,eax
cmp [page_list_enable],eax
je @f
 
inc [page_list]
mov [redraw_window_flag],1
inc [page_list]
mov [redraw_window_flag],1
;--------------------------------------
align 4
@@:
jmp begin_1.ret
jmp begin_1.ret
;------------------------------------------------------------------------------
align 4
page_list_prev:
xor eax,eax
cmp [page_list],eax
je @f
xor eax,eax
cmp [page_list],eax
je @f
 
cmp [page_list_enable],eax
je @f
cmp [page_list_enable],eax
je @f
 
dec [page_list]
mov [redraw_window_flag],1
dec [page_list]
mov [redraw_window_flag],1
;--------------------------------------
align 4
@@:
jmp begin_1.ret
jmp begin_1.ret
;------------------------------------------------------------------------------
align 4
alt_tab_pressed:
; handle Alt+Tab and Alt+Shift+Tab
mov ebp, eax
cmp [current_alt_tab_app], -1
jnz has_alt_tab_app
mov ebp, eax
cmp [current_alt_tab_app], -1
jnz has_alt_tab_app
; § ¯®«­ï¥¬ â ¡«¨æ㠯ਫ®¦¥­¨©, ¯®¤«¥¦ é¨å ¯¥à¥ª«î祭¨î
xor edx, edx
mov ebx, procinfo_window_tabs
mov ecx, 1
xor edx, edx
mov ebx, procinfo_window_tabs
mov ecx, 1
;--------------------------------------
align 4
.fill:
inc ecx
mcall 9
call need_window_tab
jz @f
inc ecx
mcall 9
call need_window_tab
jz @f
 
cmp edx, 256
jz @f
cmp edx, 256
jz @f
 
mov [alt_tab_list+edx*8], ecx
movzx esi, word [ebx+4]
mov [alt_tab_list+edx*8+4], esi
inc edx
mov [alt_tab_list+edx*8], ecx
movzx esi, word [ebx+4]
mov [alt_tab_list+edx*8+4], esi
inc edx
;--------------------------------------
align 4
@@:
cmp ecx,eax
jb .fill
cmp ecx,eax
jb .fill
 
mov [alt_tab_list_size], edx
test edx, edx
jz begin_1.ret
mov [alt_tab_list_size], edx
test edx, edx
jz begin_1.ret
 
mcall 66,4,0,0 ; «®¢¨¬ ¬®¬¥­â ®â¯ã᪠­¨ï ¢á¥å ã¯à ¢«ïîé¨å ª« ¢¨è
test eax, eax
jnz begin_1.ret
mcall 66,4,0,0 ; «®¢¨¬ ¬®¬¥­â ®â¯ã᪠­¨ï ¢á¥å ã¯à ¢«ïîé¨å ª« ¢¨è
test eax, eax
jnz begin_1.ret
 
xor edx, edx
mov eax, [alt_tab_list+4]
xor ecx, ecx
inc ecx
xor edx, edx
mov eax, [alt_tab_list+4]
xor ecx, ecx
inc ecx
;--------------------------------------
align 4
.findmax:
cmp [alt_tab_list+ecx*8+4], eax
jb @f
cmp [alt_tab_list+ecx*8+4], eax
jb @f
 
mov edx, ecx
mov eax, [alt_tab_list+ecx*8+4]
mov edx, ecx
mov eax, [alt_tab_list+ecx*8+4]
;--------------------------------------
align 4
@@:
inc ecx
cmp ecx, [alt_tab_list_size]
jb .findmax
inc ecx
cmp ecx, [alt_tab_list_size]
jb .findmax
 
mov [current_alt_tab_app], edx
mov [current_alt_tab_app], edx
;--------------------------------------
align 4
has_alt_tab_app:
mov eax, [current_alt_tab_app]
mov edx, [alt_tab_list+eax*8+4] ; slot
xor ecx, ecx
or eax, -1
test ebp, 300h
jz .notshift
mov eax, [current_alt_tab_app]
mov edx, [alt_tab_list+eax*8+4] ; slot
xor ecx, ecx
or eax, -1
test ebp, 300h
jz .notshift
 
or esi, -1
or esi, -1
;--------------------------------------
align 4
.loop1:
cmp [alt_tab_list+ecx*8+4], edx
jbe @f
cmp [alt_tab_list+ecx*8+4], edx
jbe @f
 
cmp [alt_tab_list+ecx*8+4], esi
jae @f
cmp [alt_tab_list+ecx*8+4], esi
jae @f
 
mov eax, ecx
mov esi, [alt_tab_list+ecx*8+4]
mov eax, ecx
mov esi, [alt_tab_list+ecx*8+4]
;--------------------------------------
align 4
@@:
inc ecx
cmp ecx, [alt_tab_list_size]
jb .loop1
inc ecx
cmp ecx, [alt_tab_list_size]
jb .loop1
 
cmp eax, -1
jnz .found
cmp eax, -1
jnz .found
 
xor edx, edx
xor ecx, ecx
jmp .loop1
xor edx, edx
xor ecx, ecx
jmp .loop1
;--------------------------------------
align 4
.notshift:
xor esi, esi
xor esi, esi
;--------------------------------------
align 4
.loop2:
cmp [alt_tab_list+ecx*8+4], edx
jae @f
cmp [alt_tab_list+ecx*8+4], edx
jae @f
 
cmp [alt_tab_list+ecx*8+4], esi
jbe @f
cmp [alt_tab_list+ecx*8+4], esi
jbe @f
 
mov eax, ecx
mov esi, [alt_tab_list+ecx*8+4]
mov eax, ecx
mov esi, [alt_tab_list+ecx*8+4]
;--------------------------------------
align 4
@@:
inc ecx
cmp ecx, [alt_tab_list_size]
jb .loop2
inc ecx
cmp ecx, [alt_tab_list_size]
jb .loop2
 
cmp eax, -1
jnz .found
cmp eax, -1
jnz .found
 
or edx, -1
xor ecx, ecx
jmp .loop2
or edx, -1
xor ecx, ecx
jmp .loop2
;--------------------------------------
align 4
.found:
mov [current_alt_tab_app], eax
push eax
xor edx, edx
div [max_applications]
mov [page_list], eax
mov edi, app_list
push edi
mov ecx, 20
or eax, -1
rep stosd
pop edi
pop ecx
sub ecx, edx
mov [current_alt_tab_app], eax
push eax
xor edx, edx
div [max_applications]
mov [page_list], eax
mov edi, app_list
push edi
mov ecx, 20
or eax, -1
rep stosd
pop edi
pop ecx
sub ecx, edx
;--------------------------------------
align 4
@@:
cmp ecx, [alt_tab_list_size]
jae redraw_window_tabs
cmp ecx, [alt_tab_list_size]
jae redraw_window_tabs
 
mov eax, [alt_tab_list+ecx*8]
stosd
inc ecx
jmp @b
mov eax, [alt_tab_list+ecx*8]
stosd
inc ecx
jmp @b
;--------------------------------------
align 4
alt_tab_released:
mcall 66,5,0,0 ; 㦥 ¯®©¬ «¨, 墠â¨â :)
mcall 66,5,0,0 ; 㦥 ¯®©¬ «¨, 墠â¨â :)
 
or eax, -1
xchg eax, [current_alt_tab_app]
mov ecx, [alt_tab_list+eax*8]
mcall 18,3
or eax, -1
xchg eax, [current_alt_tab_app]
mov ecx, [alt_tab_list+eax*8]
mcall 18,3
 
jmp redraw_window_tabs
jmp redraw_window_tabs
;------------------------------------------------------------------------------
align 4
active_process dd 0
active_process dd 0
 
exit:
mcall -1
mcall -1
;------------------------------------------------------------------------------
START:
mcall 68,11
mcall 66,1,1
mcall 68,11
mcall 66,1,1
 
mcall 9,process_info_buffer,-1
mov ecx,[ebx+30] ; PID
mcall 18,21
mov [my_active_slot],eax ; WINDOW SLOT
mcall 9,process_info_buffer,-1
mov ecx, [ebx + process_information.PID] ; PID
mcall 18,21
mov [my_active_slot],eax ; WINDOW SLOT
 
 
load_libraries l_libs_start,end_l_libs
 
test eax,eax
jnz exit
test eax,eax
jnz exit
 
call Get_ini
call Get_ini
 
mcall 66,4,0,2 ; LShift+RShift
mcall 66,,,33h ; LCtrl+LShift
mcall 66,,88,110h ; Alt+Ctrl+F12
mcall 66,,91,0h ; RWin DOWN
mcall 66,,92 ; LWin DOWN
mcall 66,,219 ; RWin UP
mcall 66,,220 ; LWin UP
mcall 66,,19,0h ; Win+R DOWN
mcall 66,,32,0h ; Win+D DOWN
mcall 66,,55,10h ; Ctrl+PrintScreen DOWN
mcall 66,,1,30h ; LCtrl+Esc DOWN
mcall 66,,129 ; LCtrl+Esc UP
mcall 66,,62,300h ; Alt+F4
mcall 66,,2 ; Alt+1
mcall 66,,3 ; Alt+2
mcall 66,,4 ; Alt+3
mcall 66,,5 ; Alt+4
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
mcall 66,4,0,2 ; LShift+RShift
mcall 66,,,33h ; LCtrl+LShift
mcall 66,,88,110h ; Alt+Ctrl+F12
mcall 66,,91,0h ; RWin DOWN
mcall 66,,92 ; LWin DOWN
mcall 66,,219 ; RWin UP
mcall 66,,220 ; LWin UP
mcall 66,,19,0h ; Win+R DOWN
mcall 66,,32,0h ; Win+D DOWN
mcall 66,,55,10h ; Ctrl+PrintScreen DOWN
mcall 66,,1,30h ; LCtrl+Esc DOWN
mcall 66,,129 ; LCtrl+Esc UP
mcall 66,,62,300h ; Alt+F4
mcall 66,,2 ; Alt+1
mcall 66,,3 ; Alt+2
mcall 66,,4 ; Alt+3
mcall 66,,5 ; Alt+4
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
 
if caps_lock_check
xor edx,edx
mcall 66,4,58
xor edx,edx
mcall 66,4,58
end if
mcall 14
mov [screen_size],eax
mcall 14
mov [screen_size],eax
 
call set_work_ares_pf_screen
call set_work_ares_pf_screen
 
mcall 9,process_info_buffer,-1
mov ecx,[process_info_buffer+30]
mcall 18,21
mov [this_slot],eax
mov [max_slot],255
mcall 9,process_info_buffer,-1
mov ecx,[process_info_buffer.PID]
mcall 18,21
mov [this_slot],eax
mov [max_slot],255
;--------------------------------------
align 4
start_after_minimize:
call draw_window
call draw_running_applications
call draw_window
call draw_running_applications
 
mcall 23,30
call load_ini
mcall 23,30
call load_ini
;------------------------------------------------------------------------------
align 4
still:
call draw_time
call draw_cpu_usage
call draw_running_applications
call draw_time
call draw_cpu_usage
call draw_running_applications
 
mcall 18,7 ; check if active window changed
cmp eax, [last_active_window]
jz @f
mcall 18,7 ; check if active window changed
cmp eax, [last_active_window]
jz @f
; need_window_tab:
; in: ebx->process info
; out: ZF set <=> do not draw
mov ebx,[last_active_window]
mov [prev_active_window], ebx
mov [last_active_window], eax
mov ebx,[last_active_window]
mov [prev_active_window], ebx
mov [last_active_window], eax
 
mov ecx, eax
mcall 9,process_info_buffer
mov ecx, eax
mcall 9,process_info_buffer
 
call need_window_tab
jnz .need_repaint
call need_window_tab
jnz .need_repaint
 
mcall 9,process_info_buffer,[prev_active_window]
call need_window_tab
jz @f
mcall 9,process_info_buffer,[prev_active_window]
call need_window_tab
jz @f
;--------------------------------------
align 4
.need_repaint:
mov dword [active_window_changed], 1
mov dword [active_window_changed], 1
;--------------------------------------
align 4
@@:
mcall 23,20
mcall 23,20
 
push eax
mcall 18,7
cmp [my_active_slot],eax
je @f
push eax
mcall 18,7
cmp [my_active_slot],eax
je @f
 
mov [current_active_slot],eax
mov [current_active_slot],eax
;--------------------------------------
align 4
@@:
pop eax
pop eax
 
cmp eax,1 ; redraw ?
jz red
cmp eax,1 ; redraw ?
jz red
 
push eax
mov eax,[redraw_window_flag]
test eax,eax
jz @f
push eax
mov eax,[redraw_window_flag]
test eax,eax
jz @f
 
call draw_window
call draw_window
;--------------------------------------
align 4
@@:
pop eax
pop eax
 
cmp eax,2
jnz @f
call handle_key
jmp .key
cmp eax,2
jnz @f
call handle_key
jmp .key
;--------------------------------------
align 4
@@:
cmp eax,3 ; button ?
jz button
cmp eax,3 ; button ?
jz button
;--------------------------------------
align 4
.key:
cmp dword [active_window_changed], 0
jnz red_active
cmp dword [active_window_changed], 0
jnz red_active
 
call draw_flag ; language
jmp still
call draw_flag ; language
jmp still
;------------------------------------------------------------------------------
align 4
set_work_ares_pf_screen:
;eax = [xsize]*65536 + [ysize]
mov ecx,eax
shr ecx,16
and eax,0xFFFF
cmp [place_attachment],1
je @f
mov ecx,eax
shr ecx,16
and eax,0xFFFF
cmp [place_attachment],1
je @f
 
ror eax,16
add eax,[height]
rol eax,16
mov edx,eax
jmp .selected
ror eax,16
add eax,[height]
rol eax,16
mov edx,eax
jmp .selected
;--------------------------------------
align 4
@@:
sub eax,[height]
mov edx, eax
sub eax,[height]
mov edx, eax
;--------------------------------------
align 4
.selected:
mcall 48,6
ret
mcall 48,6
ret
;------------------------------------------------------------------------------
align 4
red_active:
red:
mov dword [active_window_changed], 0
mov dword [active_window_changed], 0
 
mcall 14
movzx ecx,ax
mov edx,eax
shr edx,16
cmp [screen_size.height],ax
jne @f
mcall 14
movzx ecx,ax
mov edx,eax
shr edx,16
cmp [screen_size.height],ax
jne @f
 
rol eax,16
cmp [screen_size.width],ax
je .lp1
rol eax,16
cmp [screen_size.width],ax
je .lp1
 
rol eax,16
rol eax,16
;--------------------------------------
align 4
@@:
mov [screen_size],eax
mov [screen_size],eax
 
push ecx edx
call set_work_ares_pf_screen
pop edx ecx
push ecx edx
call set_work_ares_pf_screen
pop edx ecx
 
sub ecx,[height]
mcall 67,0,,,[height]
sub ecx,[height]
mcall 67,0,,,[height]
;--------------------------------------
align 4
.lp1:
call draw_window
jmp still
call draw_window
jmp still
;------------------------------------------------------------------------------
align 4
button:
mcall 17
test eax,0xfffffe00 ; is it close button? (signal from @taskbar)
jz still ; if so - wait for another event, because @taskbar shouldn't be closed
mcall 17
test eax,0xfffffe00 ; is it close button? (signal from @taskbar)
jz still ; if so - wait for another event, because @taskbar shouldn't be closed
 
cmp al, 0
jnz right_mouse
cmp al, 0
jnz right_mouse
 
cmp ah,50
jb no_activate
cmp ah,70
jg no_activate
cmp ah,50
jb no_activate
cmp ah,70
jg no_activate
 
movzx ecx,byte ah
sub ecx,52
shl ecx,2
movzx ecx,byte ah
sub ecx,52
shl ecx,2
 
mov ecx,[app_list+ecx]
mov ecx,[app_list+ecx]
 
mcall 9,process_info_buffer
mcall 9,process_info_buffer
 
test [ebx+70],dword 10b ; window is minimized to panel
jnz @f
test [ebx + process_information.wnd_state], byte 10b ; window is minimized to panel
jnz @f
 
cmp ecx,[current_active_slot]
je .turn_off
cmp ecx,[current_active_slot]
je .turn_off
;--------------------------------------
align 4
@@:
mcall 18,3,
jmp .task_switching
mcall 18,3,
jmp .task_switching
;--------------------------------------
align 4
.turn_off:
mov edx,ecx
mcall 18,22,0
mov edx,ecx
mcall 18,22,0
;--------------------------------------
align 4
.task_switching:
mcall 68,1
jmp still
mcall 68,1
jmp still
;------------------------------------------------------------------------------
align 4
right_mouse:
cmp ah,50
jb still
cmp ah,50
jb still
 
cmp ah,70
jg still
cmp ah,70
jg still
 
movzx ecx,byte ah
sub ecx,52
movzx ecx,byte ah
sub ecx,52
 
cmp ecx, [app_tab_count]
jge still
cmp ecx, [app_tab_count]
jge still
 
shl ecx,2
mcall 37,0
mov ebx, eax
shr eax, 16
mov [x_coord], ax
and ebx, 0xFFFF
mov [y_coord], bx
shl ecx,2
mcall 37,0
mov ebx, eax
shr eax, 16
mov [x_coord], ax
and ebx, 0xFFFF
mov [y_coord], bx
 
mov ecx,[app_list+ecx] ; ecx->selected app.slot
mov [n_slot], ecx
mcall 9,procinfo_for_detect
mov ecx,[app_list+ecx] ; ecx->selected app.slot
mov [n_slot], ecx
mcall 9,procinfo_for_detect
 
mcall 51,1,context_menu_start,ctx_menu_stack
mcall 51,1,context_menu_start,ctx_menu_stack
 
mov [ctx_menu_PID], eax
jmp still
mov [ctx_menu_PID], eax
jmp still
;------------------------------------------------------------------------------
align 4
no_activate:
cmp ah,101 ; minimize to left
je left_button
cmp ah,101 ; minimize to left
je left_button
 
cmp ah,102 ; minimize to right
je right_button
cmp ah,102 ; minimize to right
je right_button
 
cmp ah, 103
je clean_desktop_1 ; minimize all windows
cmp ah, 103
je clean_desktop_1 ; minimize all windows
 
cmp ah,byte 1 ; start/terminate menu
jnz noselect
cmp ah,byte 1 ; start/terminate menu
jnz noselect
 
call menu_handler
call menu_handler
 
jmp still
jmp still
;--------------------------------------
align 4
clean_desktop_1:
call clean_desktop
jmp still
call clean_desktop
jmp still
;--------------------------------------
align 4
noselect:
mov ebx, exec_fileinfo
cmp ah,byte 2 ; start calendar
jnz noid15 ;noclock
mov ebx, exec_fileinfo
cmp ah,byte 2 ; start calendar
jnz noid15 ;noclock
 
mov esi,calendar_name
call algorithm_anti_duplication
test eax,eax
jz @f
mov esi,calendar_name
call algorithm_anti_duplication
test eax,eax
jz @f
 
mcall 18,2,edi
jmp still
mcall 18,2,edi
jmp still
;--------------------------------------
align 4
@@:
mov ebx, exec_fileinfo
mov dword [ebx+21], calendar_name
mcall 70
jmp still
mov ebx, exec_fileinfo
mov dword [ebx+21], calendar_name
mcall 70
jmp still
;--------------------------------------
align 4
noid15:
cmp ah,16
jne noid16
cmp ah,16
jne noid16
 
call karu
call draw_flag ; language
jmp still
call karu
call draw_flag ; language
jmp still
;--------------------------------------
align 4
noid16:
cmp ah,18
jne noid18
cmp ah,18
jne noid18
 
mov esi,sysmeter_name
call algorithm_anti_duplication
test eax,eax
jz @f
mov esi,sysmeter_name
call algorithm_anti_duplication
test eax,eax
jz @f
 
mcall 18,2,edi
jmp still
mcall 18,2,edi
jmp still
;--------------------------------------
align 4
@@:
mov ebx, exec_fileinfo
mov dword [ebx+21], sysmeter_name
mcall 70
jmp still
mov ebx, exec_fileinfo
mov dword [ebx+21], sysmeter_name
mcall 70
jmp still
;--------------------------------------
align 4
noid18:
cmp ah,21
jnz noid21
cmp ah,21
jnz noid21
 
cmp [page_list],50
jnc still
inc [page_list]
jmp red
cmp [page_list],50
jnc still
inc [page_list]
jmp red
;--------------------------------------
align 4
noid21:
cmp ah,22
jnz still
cmp ah,22
jnz still
 
cmp [page_list],0
je still
cmp [page_list],0
je still
 
dec [page_list]
jmp red
dec [page_list]
jmp red
;------------------------------------------------------------------------------
align 4
restore_desktop:
mcall 9,process_info_buffer,-1
mov [max_slot], eax
mov ecx, 2
mov edx, 2
mcall 9,process_info_buffer,-1
mov [max_slot], eax
mov ecx, 2
mov edx, 2
;--------------------------------------
align 4
@@:
mcall 18, 22
inc edx
cmp edx, [max_slot]
jbe @b
ret
mcall 18, 22
inc edx
cmp edx, [max_slot]
jbe @b
ret
;------------------------------------------------------------------------------
align 4
clean_desktop:
mcall 18,23
test eax,eax
jnz @f
call restore_desktop
mcall 18,23
test eax,eax
jnz @f
call restore_desktop
;--------------------------------------
align 4
@@:
ret
ret
;------------------------------------------------------------------------------
align 4
conversion_HEX_to_ASCII:
ror eax,12
mov ecx,4
ror eax,12
mov ecx,4
;--------------------------------------
align 4
.loop:
mov bl,al
rol eax,4
and bl,0xf
cmp bl,0xA ; check for ABCDEF
jae @f
mov bl,al
rol eax,4
and bl,0xf
cmp bl,0xA ; check for ABCDEF
jae @f
 
add bl,0x30 ; 0-9
jmp .store
add bl,0x30 ; 0-9
jmp .store
;--------------------------------------
align 4
@@:
add bl,0x57 ; A-F
add bl,0x57 ; A-F
;--------------------------------------
align 4
.store:
; dps "param_store: "
mov [edi],bl
inc edi
dec ecx
jnz .loop
ret
; dps "param_store: "
mov [edi],bl
inc edi
dec ecx
jnz .loop
ret
;------------------------------------------------------------------------------
align 4
menu_handler:
mov edi,bootparam
mov edi,bootparam
 
mov eax,[menu_button_x.start]
call conversion_HEX_to_ASCII
mov eax,[menu_button_x.start]
call conversion_HEX_to_ASCII
 
mov eax,[menu_button_x.size]
call conversion_HEX_to_ASCII
mov eax,[menu_button_x.size]
call conversion_HEX_to_ASCII
 
mov eax,[menu_button_y.start]
call conversion_HEX_to_ASCII
mov eax,[menu_button_y.start]
call conversion_HEX_to_ASCII
 
mov eax,[menu_button_y.size]
call conversion_HEX_to_ASCII
mov eax,[menu_button_y.size]
call conversion_HEX_to_ASCII
 
mov eax,[height]
call conversion_HEX_to_ASCII
mov eax,[height]
call conversion_HEX_to_ASCII
 
mov eax,[place_attachment]
call conversion_HEX_to_ASCII
mov eax,[place_attachment]
call conversion_HEX_to_ASCII
 
xor eax,eax ; terminator for boot parameters string
stosd
xor eax,eax ; terminator for boot parameters string
stosd
 
mov ebx, exec_fileinfo
mov [ebx+21],dword menu_name
mov [ebx+8],dword bootparam
mcall 70
mov [ebx+8],dword 0
ret
mov ebx, exec_fileinfo
mov [ebx+21],dword menu_name
mov [ebx+8],dword bootparam
mcall 70
mov [ebx+8],dword 0
ret
;------------------------------------------------------------------------------
align 4
draw_small_right:
pusha
mcall 12,1
pusha
mcall 12,1
 
xor eax,eax
mov edx,[wcolor]
mov esi,edx
mov edi,edx
or edx, 0x01000000
mcall
xor eax,eax
mov edx,[wcolor]
mov esi,edx
mov edi,edx
or edx, 0x01000000
mcall
 
xor ecx,ecx
mov cx,[height]
mcall 8,<0,10>,,1,[wcolor]
xor ecx,ecx
mov cx,[height]
mcall 8,<0,10>,,1,[wcolor]
 
mov ebx,2*65536 ;+6
mov bx,[height]
shr bx,1
sub bx,3
mov edx,[wcolor]
mov eax,COLOR_CHANGE_MAGNITUDE_2
call add_color_change_magnitude
mov ecx,edx
mcall 4,,,hidetext,1
mov ebx,2*65536 ;+6
mov bx,[height]
shr bx,1
sub bx,3
mov edx,[wcolor]
mov eax,COLOR_CHANGE_MAGNITUDE_2
call add_color_change_magnitude
mov ecx,edx
mcall 4,,,hidetext,1
 
mcall 12,2
popa
ret
mcall 12,2
popa
ret
;------------------------------------------------------------------------------
align 4
draw_small_left:
pusha
mcall 12,1
pusha
mcall 12,1
 
xor eax,eax
mov edx,[wcolor]
mov esi,edx
mov edi,edx
or edx, 0x01000000
mcall
xor eax,eax
mov edx,[wcolor]
mov esi,edx
mov edi,edx
or edx, 0x01000000
mcall
 
xor ecx,ecx
mov cx,[height]
mcall 8,<0,9>,,1,[wcolor]
xor ecx,ecx
mov cx,[height]
mcall 8,<0,9>,,1,[wcolor]
 
mov ebx,3*65536 ;+6
mov bx,[height]
shr bx,1
sub bx,3
mov edx,[wcolor]
mov eax,COLOR_CHANGE_MAGNITUDE_2
call add_color_change_magnitude
mov ecx,edx
mcall 4,,,hidetext+1,1
mov ebx,3*65536 ;+6
mov bx,[height]
shr bx,1
sub bx,3
mov edx,[wcolor]
mov eax,COLOR_CHANGE_MAGNITUDE_2
call add_color_change_magnitude
mov ecx,edx
mcall 4,,,hidetext+1,1
 
mcall 12,2
popa
ret
mcall 12,2
popa
ret
;------------------------------------------------------------------------------
align 4
right_button:
mov [small_draw],dword draw_small_right
mov [small_draw],dword draw_small_right
 
mcall 14
mcall 14
 
shr eax, 16
mov ebx, eax
mov ecx, -1
mov edx, 9
sub ebx, edx
mov esi, -1
mcall 67
shr eax, 16
mov ebx, eax
mov ecx, -1
mov edx, 9
sub ebx, edx
mov esi, -1
mcall 67
 
call draw_small_right
jmp small_wait
call draw_small_right
jmp small_wait
;------------------------------------------------------------------------------
align 4
left_button:
mov [small_draw],dword draw_small_left
mov [small_draw],dword draw_small_left
 
xor ebx,ebx
mcall 67,,-1,9,-1
xor ebx,ebx
mcall 67,,-1,9,-1
 
call draw_small_left
call draw_small_left
;--------------------------------------
align 4
small_wait:
mcall 10
cmp eax,1
jne no_win
mcall 10
cmp eax,1
jne no_win
 
call [small_draw]
jmp small_wait
call [small_draw]
jmp small_wait
;--------------------------------------
align 4
no_win:
cmp eax,2
jne no_key
cmp eax,2
jne no_key
 
call handle_key
jmp small_wait
call handle_key
jmp small_wait
;--------------------------------------
align 4
no_key:
mcall 17
cmp ah,1
jne no_full
mcall 17
cmp ah,1
jne no_full
 
mcall 14 ; get screen max x & max y
mcall 14 ; get screen max x & max y
 
mov edx, eax
shr edx, 16
xor ebx, ebx
mcall 67,,-1,,-1 ; x0 y0 xs ys
mov edx, eax
shr edx, 16
xor ebx, ebx
mcall 67,,-1,,-1 ; x0 y0 xs ys
 
jmp still
jmp still
;--------------------------------------
align 4
no_full:
call menu_handler
jmp small_wait
call menu_handler
jmp small_wait
;------------------------------------------------------------------------------
include 'libini.inc'
;------------------------------------------------------------------------------
/programs/system/taskbar/trunk/ctx_menu.asm
1,164 → 1,164
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
align 4
context_menu_start:
mcall 40,00100111b
mov ecx, [ctx_menu_PID]
mcall 18,21
mov ecx, eax
mcall 18,3
call draw_ctx_menu
;------------------------------------------------------------------------------
mcall 40, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE ;00100111b
mov ecx, [ctx_menu_PID]
mcall 18,21
mov ecx, eax
mcall 18,3
call draw_ctx_menu
;------------------------------------------------------------------------------
align 4
ctx_menu_still:
mcall 10
cmp eax, 2
jz ctx_menu_key
mcall 10
cmp eax, EV_KEY
jz ctx_menu_key
 
cmp eax, 3
jz ctx_menu_button
cmp eax, EV_BUTTON
jz ctx_menu_button
 
cmp eax, 6
jz ctx_menu_mouse
cmp eax, EV_MOUSE
jz ctx_menu_mouse
 
call draw_ctx_menu
jmp ctx_menu_still
;------------------------------------------------------------------------------
call draw_ctx_menu
jmp ctx_menu_still
;------------------------------------------------------------------------------
align 4
ctx_menu_mouse:
mcall 37,2
xchg eax,ecx ; …᫨ ­¥ ®¤­  ¨§ ª­®¯®ª ­¥ ­ ¦ â  ¢®§¢à é ¥¬áï
; ¢ £« ¢­ë© 横« ¯®â®ª 
jecxz ctx_menu_still
mcall 37,2
xchg eax,ecx ; …᫨ ­¥ ®¤­  ¨§ ª­®¯®ª ­¥ ­ ¦ â  ¢®§¢à é ¥¬áï
; ¢ £« ¢­ë© 横« ¯®â®ª 
jecxz ctx_menu_still
 
mcall 37,1
mcall 37,1
 
cmp ax, 0 ; ’ã⠯஢¥à塞 ¯à®¨§®èñ«-«¨ ª«¨ª §  ¯à¥¤¥« ¬¨ ®ª­  ª®­â¥ªáâ­®£®
jb ctx_menu_exit ; ¬¥­î, ¥á«¨ §  ¯à¥¤¥« ¬¨ â® § ªà뢠¥¬ ª®­â¥ªáâ­®¥ ¬¥­î
cmp ax, 0 ; ’ã⠯஢¥à塞 ¯à®¨§®èñ«-«¨ ª«¨ª §  ¯à¥¤¥« ¬¨ ®ª­  ª®­â¥ªáâ­®£®
jb ctx_menu_exit ; ¬¥­î, ¥á«¨ §  ¯à¥¤¥« ¬¨ â® § ªà뢠¥¬ ª®­â¥ªáâ­®¥ ¬¥­î
 
cmp ax, 60 ; 41
ja ctx_menu_exit
cmp ax, 60 ; 41
ja ctx_menu_exit
 
shr eax, 16
cmp ax, 0
jb ctx_menu_exit
shr eax, 16
cmp ax, 0
jb ctx_menu_exit
 
cmp ax, 133
ja ctx_menu_exit
cmp ax, 133
ja ctx_menu_exit
 
jmp ctx_menu_still
;------------------------------------------------------------------------------
jmp ctx_menu_still
;------------------------------------------------------------------------------
align 4
ctx_menu_key:
mcall 2
mcall 2
;--------------------------------------
align 4
ctx_menu_button:
mcall 17
cmp ah, 1
jne @f
mcall 17
cmp ah, 1
jne @f
 
; mov eax, 18
; mov ebx, 2
; mov ecx, [n_slot]
; jmp .lllxxx
mcall 18,3,[n_slot]
mcall 72,1,3,1
mcall 68,1
jmp ctx_menu_exit
; mov eax, 18
; mov ebx, 2
; mov ecx, [n_slot]
; jmp .lllxxx
mcall 18,3,[n_slot]
mcall 72,1,3,1
mcall 68,1
jmp ctx_menu_exit
;--------------------------------------
align 4
@@:
cmp ah, 2
jne ctx_menu_still
mov eax, 18
mov ebx, 22
mov edx, [n_slot]
xor ecx, ecx
cmp ah, 2
jne ctx_menu_still
mov eax, 18
mov ebx, 22
mov edx, [n_slot]
xor ecx, ecx
 
test [procinfo_for_detect+70],byte 2
setnz cl
add cl, cl
test [procinfo_for_detect.wnd_state],byte 2
setnz cl
add cl, cl
;--------------------------------------
align 4
.lllxxx:
mcall
jmp ctx_menu_exit
mcall
jmp ctx_menu_exit
;--------------------------------------
align 4
ctx_menu_exit:
or eax,-1
mcall
;------------------------------------------------------------------------------
or eax,-1
mcall
;------------------------------------------------------------------------------
align 4
;func draw_ctx_menu
draw_ctx_menu:
mcall 12, 1
mcall 12, 1
 
xor eax, eax
movzx ebx, [x_coord]
shl ebx, 16
add ebx, 133
movzx ecx, [y_coord]
sub ecx, 60 ; 41
shl ecx, 16
add ecx, 60 ; 41
mov esi, [system_colours + 4] ; sc.grab
or esi, 0x81000000
mcall ,,,[system_colours + 20],,[system_colours+8]
xor eax, eax
movzx ebx, [x_coord]
shl ebx, 16
add ebx, 133
movzx ecx, [y_coord]
sub ecx, 60 ; 41
shl ecx, 16
add ecx, 60 ; 41
mov esi, [system_colours.grab] ; sc.grab
or esi, 0x81000000
mcall ,,,[system_colours.work],,[system_colours.work_dark]
 
mcall 8,<0,133>,<22,17>,0x40000001
mcall 8,<0,133>,<22,17>,0x40000001
 
inc edx
mcall ,,<40,17>
mov ecx, [system_colours + 16] ; sc.grab_text
or ecx, 0x10000000
mcall 4,<32,4>,,ctx_menu_title,ctx_menu_title_end - ctx_menu_title
inc edx
mcall ,,<40,17>
mov ecx, [system_colours.grab_text] ; sc.grab_text
or ecx, 0x10000000
mcall 4,<32,4>,,ctx_menu_title,ctx_menu_title_end - ctx_menu_title
 
add ebx, 1 * 65536
mcall
add ebx, 1 * 65536
mcall
 
mov ecx, [system_colours + 32] ; sc.work_text
or ecx, 0x80000000
mcall ,<4,28>,,ctx_menu_text
mov ecx, [system_colours.work_text] ; sc.work_text
or ecx, 0x80000000
mcall ,<4,28>,,ctx_menu_text
 
mov edx, ctx_menu_text2
mov edx, ctx_menu_text2
 
test byte [procinfo_for_detect+70], 2
jz @f
mov edx, ctx_menu_text3
test byte [procinfo_for_detect.wnd_state], 2
jz @f
mov edx, ctx_menu_text3
;--------------------------------------
align 4
@@:
add bx, 18
mcall
add bx, 18
mcall
 
mcall 12,2
ret
mcall 12,2
ret
;endf
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
align 4
x_coord rw 1
y_coord rw 1
n_slot rd 1
ctx_menu_PID rd 1
;------------------------------------------------------------------------------
x_coord rw 1
y_coord rw 1
n_slot rd 1
ctx_menu_PID rd 1
;------------------------------------------------------------------------------
lsz ctx_menu_text,\
ru, <"X ‡ ªàëâì Alt + F4",0>,\
en, <"X Close Alt + F4",0>,\
et, <"X Sulge Alt + F4",0>,\
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
lsz ctx_menu_text2,\
ru, <25," ‘¢¥à­ãâì ",0>,\
en, <25," Minimize ",0>,\
et, <25," Minimeeri ",0>,\
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
lsz ctx_menu_text3,\
ru, <24," ‚®ááâ ­®¢¨âì ",0>,\
en, <24," Restore ",0>,\
et, <24," Taasta ",0>
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
ctx_menu_title:
db 'KolibriOS'
db 'KolibriOS'
ctx_menu_title_end:
;------------------------------------------------------------------------------
;------------------------------------------------------------------------------
/programs/system/taskbar/trunk/drawappl.inc
1,229 → 1,229
;------------------------------------------------------------------------------
align 4
draw_running_applications:
pusha
pusha
 
cmp [run_appl],dword 0
je .exit
cmp [run_appl],dword 0
je .exit
 
call calculate_applications
call calculate_applications
 
cmp edi,[running_applications]
jne .noret
popa
ret
cmp edi,[running_applications]
jne .noret
popa
ret
;--------------------------------------
align 4
.noret:
call draw_window
mov [running_applications],edi
call redraw_window_tabs
call draw_window
mov [running_applications],edi
call redraw_window_tabs
;--------------------------------------
align 4
.exit:
popa
ret
popa
ret
;------------------------------------------------------------------------------
align 4
need_window_tab:
; in: ebx->process info
; out: ZF set <=> do not draw
cmp byte [ebx+10], '@'
jz .nodraw
cmp byte [ebx + process_information.process_name], '@'
jz .nodraw
; do not draw undefined (zero-sized) windows
cmp dword [ebx+42], 0
jnz @f
cmp dword [ebx+46], 0
jz .nodraw
cmp dword [ebx + process_information.box.width], 0
jnz @f
cmp dword [ebx + process_information.box.height], 0
jz .nodraw
;--------------------------------------
align 4
@@:
; do not draw OpenDialog windows
push edi
mov edi, dword [ebx+10]
or edi, 0x20202020
cmp edi, 'open'
jne @f
push edi
mov edi, dword [ebx + process_information.process_name]
or edi, 0x20202020
cmp edi, 'open'
jne @f
 
mov edi, dword [ebx+14]
or edi, 0x20202020
cmp dword [ebx+14], 'dial'
jne @f
mov edi, dword [ebx + process_information.process_name + 4]
or edi, 0x20202020
cmp edi, 'dial'
jne @f
 
pop edi
jmp .nodraw
pop edi
jmp .nodraw
;--------------------------------------
align 4
@@:
pop edi
cmp dword [ebx+10], 'ICON'
jnz @f
pop edi
cmp dword [ebx + process_information.process_name], 'ICON'
jnz @f
 
cmp [ebx+42], dword 51
jnz @f
cmp [ebx + process_information.box.width], dword 51
jnz @f
 
cmp [ebx+46], dword 51
jz .nodraw
cmp [ebx + process_information.box.height], dword 51
jz .nodraw
;--------------------------------------
align 4
@@:
cmp [ebx+10], dword ' '
cmp dword[ebx + process_information.process_name], ' '
;--------------------------------------
align 4
.nodraw:
ret
ret
;------------------------------------------------------------------------------
align 4
calculate_applications:
mov eax,[max_applications]
mul [page_list]
test eax,eax
je @f
mov eax,[max_applications]
mul [page_list]
test eax,eax
je @f
 
inc eax
inc eax
;--------------------------------------
align 4
@@:
mov [draw_start_position],eax
mov [draw_start_position],eax
 
mov edi,app_list
mov ecx,20 ; show max 20 application ???!!!
mov eax,-1
cld
rep stosd
mov edi,app_list
mov ecx,20 ; show max 20 application ???!!!
mov eax,-1
cld
rep stosd
 
mov edi,0
mov ecx,2
mov edi,0
mov ecx,2
;--------------------------------------
align 4
cnewpr:
mcall 9,procinfo_window_tabs
mcall 9,procinfo_window_tabs
 
call need_window_tab
jz cnorpl
call need_window_tab
jz cnorpl
 
sub [draw_start_position], 1
jg cnorpl
sub [draw_start_position], 1
jg cnorpl
 
mov [app_list+edi*4],ecx
inc edi
mov [app_list+edi*4],ecx
inc edi
;--------------------------------------
align 4
cnorpl:
inc ecx
cmp eax,ecx
jge cnewpr
inc ecx
cmp eax,ecx
jge cnewpr
 
mov [app_tab_count], edi
ret
mov [app_tab_count], edi
ret
;------------------------------------------------------------------------------
align 4
redraw_window_tabs:
xor edi, edi
mov [contrast], 0
xor edi, edi
mov [contrast], 0
 
push ebp
mcall 18,7
mov ebp,eax
call calculate_offset_X
push ebp
mcall 18,7
mov ebp,eax
call calculate_offset_X
;--------------------------------------
align 4
.loop:
mov ecx,[app_list+edi*4]
cmp ecx,-1
jz .done
mov ecx,[app_list+edi*4]
cmp ecx,-1
jz .done
 
mov [active_slot_number],ecx
mcall 9,procinfo_window_tabs
mov [active_slot_number],ecx
mcall 9,procinfo_window_tabs
 
imul ebx, edi, TAB_SIZE
add ebx,[offset_X]
add ebx,2
shl ebx,16
add ebx,TAB_SIZE-2 ;54
imul ebx, edi, TAB_SIZE
add ebx,[offset_X]
add ebx,2
shl ebx,16
add ebx,TAB_SIZE-2 ;54
 
push edi
mov edx,[system_colours.work_button]
xor edi,edi
push edi
mov edx,[system_colours.work_button]
xor edi,edi
 
cmp ebp,[active_slot_number] ;ecx ; ecx=active slot number
jnz @f
cmp ebp,[active_slot_number] ;ecx ; ecx=active slot number
jnz @f
 
mov edx,[wcolor]
inc edi
mov edx,[wcolor]
inc edi
;--------------------------------------
align 4
@@:
mov esi,[current_alt_tab_app]
cmp esi,-1
jz @f
mov esi,[current_alt_tab_app]
cmp esi,-1
jz @f
 
cmp ecx,[alt_tab_list+esi*8]
jnz @f
cmp ecx,[alt_tab_list+esi*8]
jnz @f
 
mov edx,[AltTab_color] ;0xFF8000 ; current select for ALT+Tab
mov edx,[AltTab_color] ;0xFF8000 ; current select for ALT+Tab
;--------------------------------------
align 4
@@:
call calculate_button_y_coordinate_and_size
call calculate_button_y_coordinate_and_size
 
mov esi,[wcolor]
call draw_appl_button
pop edi
mov esi,[wcolor]
call draw_appl_button
pop edi
;------------------------------------------------------------------------------
add ebx,4 shl 16
mov bx,cx ;[height]
shr bx,1
sub bx,4
shr ecx,16
add bx,cx
mov edx, procinfo_window_tabs+10
mcall 4,,[system_colours.work_button_text],,11
add ebx,4 shl 16
mov bx,cx ;[height]
shr bx,1
sub bx,4
shr ecx,16
add bx,cx
mov edx, procinfo_window_tabs.process_name
mcall 4,,[system_colours.work_button_text],, sizeof.process_information.process_name
;--------------------------------------
align 4
.nodraw:
inc edi
cmp edi, [max_applications]
jb .loop
inc edi
cmp edi, [max_applications]
jb .loop
 
mov ecx,[app_list+edi*4]
cmp ecx,-1
jz .done
mov ecx,[app_list+edi*4]
cmp ecx,-1
jz .done
 
xor eax,eax
cmp [page_list],eax
jne @f
inc eax
cmp [page_list_enable],eax
je @f
mov [page_list_enable],eax
mov [redraw_window_flag],eax
xor eax,eax
cmp [page_list],eax
jne @f
inc eax
cmp [page_list_enable],eax
je @f
mov [page_list_enable],eax
mov [redraw_window_flag],eax
;--------------------------------------
align 4
@@:
pop ebp
ret
pop ebp
ret
;--------------------------------------
align 4
.done:
xor eax,eax
cmp [page_list],eax
jne @f
xor eax,eax
cmp [page_list],eax
jne @f
 
cmp [page_list_enable],eax
je @f
cmp [page_list_enable],eax
je @f
 
mov [page_list_enable],eax
inc eax
mov [redraw_window_flag],eax
mov [page_list_enable],eax
inc eax
mov [redraw_window_flag],eax
;--------------------------------------
align 4
@@:
pop ebp
ret
pop ebp
ret
;------------------------------------------------------------------------------
/programs/system/taskbar/trunk/drawwind.inc
4,439 → 4,439
; ***************************************************
align 4
draw_window:
pusha
mov [running_applications],-1
mcall 12,1
pusha
mov [running_applications],-1
mcall 12,1
 
mcall 48,3,system_colours,10*4
mcall 48,3,system_colours, sizeof.system_colors
 
mov eax, [system_colours+4*6]
mov edx,[system_colours+4*6]
mov eax,COLOR_CHANGE_MAGNITUDE
call subtract_color_change_magnitude
mov [wcolor], edx
mov eax, [system_colours.work_button]
mov edx,[system_colours.work_button]
mov eax,COLOR_CHANGE_MAGNITUDE
call subtract_color_change_magnitude
mov [wcolor], edx
 
mcall 14 ; get screen max x & max y
mcall 14 ; get screen max x & max y
 
cmp [width],dword 0
je no_def_width
cmp [width],dword 0
je no_def_width
 
and eax,0xffff
mov ebx,[width]
shl ebx,16
add eax,ebx
and eax,0xffff
mov ebx,[width]
shl ebx,16
add eax,ebx
;--------------------------------------
align 4
no_def_width:
mov ebx,eax
mov [screenxy],ebx
shr ebx,16
mov ecx,eax
mov ebx,eax
mov [screenxy],ebx
shr ebx,16
mov ecx,eax
 
cmp [place_attachment],1
je @f
xor ecx,ecx
mov cx,[height]
dec cx
jmp .attachment_selected
cmp [place_attachment],1
je @f
xor ecx,ecx
mov cx,[height]
dec cx
jmp .attachment_selected
;--------------------------------------
align 4
@@:
sub ecx,[height]
inc ecx
shl ecx,16
mov cx,[height]
dec cx
sub ecx,[height]
inc ecx
shl ecx,16
mov cx,[height]
dec cx
;--------------------------------------
align 4
.attachment_selected:
xor eax,eax ; DEFINE AND DRAW WINDOW
mov edx, [wcolor]
or edx, 0x01000000 ; do not draw the window
mov esi, [wcolor]
or esi, 0x01000000 ; unmovable window
mov edi, [wcolor]
mov [panel_x_pos], ebx
mov [panel_y_pos], ecx ; Ïîêà ÷òî òàê.
mcall
xor eax,eax ; DEFINE AND DRAW WINDOW
mov edx, [wcolor]
or edx, 0x01000000 ; do not draw the window
mov esi, [wcolor]
or esi, 0x01000000 ; unmovable window
mov edi, [wcolor]
mov [panel_x_pos], ebx
mov [panel_y_pos], ecx ; Ïîêà ÷òî òàê.
mcall
 
movzx eax,word [screenxy+2]
mov [max_x],eax
call fill_window
call minimize_left_button
call minimize_right_button
call draw_menu_and_clean_desktop
mov [ptime],0
call draw_tray
call draw_application_buttons
movzx eax,word [screenxy+2]
mov [max_x],eax
call fill_window
call minimize_left_button
call minimize_right_button
call draw_menu_and_clean_desktop
mov [ptime],0
call draw_tray
call draw_application_buttons
 
mov [redraw_window_flag],0
mcall 12,2
popa
ret
mov [redraw_window_flag],0
mcall 12,2
popa
ret
;------------------------------------------------------------------------------
align 4
fill_window:
movzx ebx,word [screenxy+2]
xor ecx,ecx
mov edx,[wcolor]
mov eax,COLOR_CHANGE_MAGNITUDE_0
imul eax,dword [soften_height]
call subtract_color_change_magnitude
cmp [soften_up],dword 0
je no_su
fill_window:
movzx ebx,word [screenxy+2]
xor ecx,ecx
mov edx,[wcolor]
mov eax,COLOR_CHANGE_MAGNITUDE_0
imul eax,dword [soften_height]
call subtract_color_change_magnitude
cmp [soften_up],dword 0
je no_su
;--------------------------------------
align 4
@@:
mov eax,COLOR_CHANGE_MAGNITUDE_0
call add_color_change_magnitude
mov eax,COLOR_CHANGE_MAGNITUDE_0
call add_color_change_magnitude
; draw soften_up - the width of 5 pixels
and edx,0x00FFFFFF
mcall 38
and edx,0x00FFFFFF
mcall 38
 
add ecx,1*65536+1
cmp cx,[soften_height] ;5
jb @r
add ecx,1*65536+1
cmp cx,[soften_height] ;5
jb @r
;--------------------------------------
align 4
no_su:
cmp [soften_down],dword 0
je no_sd
cmp [soften_down],dword 0
je no_sd
; draw soften_down - the width of 5 pixels
pusha
mov esi,[soften_height]
mov ecx,[height]
dec ecx
shl ecx,16
add ecx,[height]
dec ecx
mov edx,[wcolor]
mov eax,COLOR_CHANGE_MAGNITUDE_0
imul eax,dword [soften_height]
call subtract_color_change_magnitude
pusha
mov esi,[soften_height]
mov ecx,[height]
dec ecx
shl ecx,16
add ecx,[height]
dec ecx
mov edx,[wcolor]
mov eax,COLOR_CHANGE_MAGNITUDE_0
imul eax,dword [soften_height]
call subtract_color_change_magnitude
;--------------------------------------
align 4
@@:
mov eax,COLOR_CHANGE_MAGNITUDE_0
call add_color_change_magnitude
and edx,0x00FFFFFF
mcall 38
sub ecx,1*65536+1
dec esi
jnz @r
popa
mov eax,COLOR_CHANGE_MAGNITUDE_0
call add_color_change_magnitude
and edx,0x00FFFFFF
mcall 38
sub ecx,1*65536+1
dec esi
jnz @r
popa
;--------------------------------------
align 4
no_sd:
movzx ebx,word [screenxy+2]
xor ecx,ecx
cmp [soften_up],dword 0
je @f
movzx ebx,word [screenxy+2]
xor ecx,ecx
cmp [soften_up],dword 0
je @f
 
add ecx,[soften_height]
rol ecx,16
add ecx,[soften_height]
add ecx,[soften_height]
rol ecx,16
add ecx,[soften_height]
;--------------------------------------
align 4
@@:
mov edx,[wcolor]
mov edx,[wcolor]
;--------------------------------------
align 4
newline3:
and edx,0x00FFFFFF
mov eax,[height]
cmp [soften_up],dword 0
je @f
and edx,0x00FFFFFF
mov eax,[height]
cmp [soften_up],dword 0
je @f
 
sub eax,[soften_height]
sub eax,[soften_height]
;--------------------------------------
align 4
@@:
cmp [soften_down],dword 0
je @f
cmp [soften_down],dword 0
je @f
 
sub eax,[soften_height]
sub eax,[soften_height]
;--------------------------------------
align 4
@@:
mov cx,ax
inc ebx
mcall 13
ret
mov cx,ax
inc ebx
mcall 13
ret
;------------------------------------------------------------------------------
align 4
minimize_left_button:
cmp [minimize_left],dword 0
je .exit
cmp [minimize_left],dword 0
je .exit
 
mov ecx,1 *65536
add ecx,[height]
dec ecx
mov edx,101
or edx,0x40000000
mcall 8,<0,9>,,,[wcolor] ; ABS LEFT
mov ecx,1 *65536
add ecx,[height]
dec ecx
mov edx,101
or edx,0x40000000
mcall 8,<0,9>,,,[wcolor] ; ABS LEFT
 
mov ebx,2*65536 ;+6
mov bx,[height]
shr bx,1
sub bx,3
mov edx,[wcolor]
mov eax,COLOR_CHANGE_MAGNITUDE_2
call add_color_change_magnitude
mov ecx,edx
mcall 4,,,hidetext,1 ; HIDE TEXT
mov ebx,2*65536 ;+6
mov bx,[height]
shr bx,1
sub bx,3
mov edx,[wcolor]
mov eax,COLOR_CHANGE_MAGNITUDE_2
call add_color_change_magnitude
mov ecx,edx
mcall 4,,,hidetext,1 ; HIDE TEXT
;--------------------------------------
align 4
.exit:
ret
ret
;------------------------------------------------------------------------------
align 4
align 4
minimize_right_button:
cmp [minimize_right],dword 0
je .exit
mov eax,[max_x]
sub eax,77
shl eax,16
mov ebx,eax
add ebx,67
cmp [minimize_right],dword 0
je .exit
mov eax,[max_x]
sub eax,77
shl eax,16
mov ebx,eax
add ebx,67
 
mov ecx,1 *65536
add ecx,[height]
dec ecx
add ebx,68*65536
mov bx,10 ;9
mov edx,102
or edx,0x40000000
mcall 8,,,,[wcolor] ; ABS RIGHT
mov ecx,1 *65536
add ecx,[height]
dec ecx
add ebx,68*65536
mov bx,10 ;9
mov edx,102
or edx,0x40000000
mcall 8,,,,[wcolor] ; ABS RIGHT
 
mov ebx,[max_x]
sub ebx,6
shl ebx,16
mov bx,[height]
shr bx,1
sub bx,3
mov edx,[wcolor]
mov eax,COLOR_CHANGE_MAGNITUDE_2
call add_color_change_magnitude
mov ecx,edx
mov esi,1
mcall 4,,,hidetext+1
mov ebx,[max_x]
sub ebx,6
shl ebx,16
mov bx,[height]
shr bx,1
sub bx,3
mov edx,[wcolor]
mov eax,COLOR_CHANGE_MAGNITUDE_2
call add_color_change_magnitude
mov ecx,edx
mov esi,1
mcall 4,,,hidetext+1
;--------------------------------------
align 4
.exit:
ret
ret
;------------------------------------------------------------------------------
align 4
draw_menu_and_clean_desktop:
pusha
pusha
; check draw for menu
cmp [menu_enable],dword 0
je no_menu
cmp [menu_enable],dword 0
je no_menu
; calculate and draw menu
mov ebx, (0 shl 16) + MENU_SIZE-3
mov ebx, (0 shl 16) + MENU_SIZE-3
; check for left minimize button enabled
cmp [minimize_left],dword 0
je @f
cmp [minimize_left],dword 0
je @f
 
add ebx, ML_SIZE shl 16
add ebx, ML_SIZE shl 16
;--------------------------------------
align 4
@@:
mov ecx, [height]
mov edx, 0x60d1ff01
mcall 8,,,,[wcolor] ; MENU BUTTON
mov eax,ebx
shr eax,16
mov [menu_button_x.start],eax
mov eax,ebx
and eax,0xffff
mov [menu_button_x.size],eax
mov eax,ecx
shr eax,16
mov [menu_button_y.start],eax
mov eax,ecx
and eax,0xffff
mov [menu_button_y.size],eax
mov edx, 0x60d1ff01
mcall 8,,,,[wcolor] ; MENU BUTTON
mov eax,ebx
shr eax,16
mov [menu_button_x.start],eax
mov eax,ebx
and eax,0xffff
mov [menu_button_x.size],eax
mov eax,ecx
shr eax,16
mov [menu_button_y.start],eax
mov eax,ecx
and eax,0xffff
mov [menu_button_y.size],eax
 
call calculate_button_y_coordinate_and_size
mov edx,[MenuButton_color] ;0x44aa44
mov esi,[wcolor]
call calculate_button_y_coordinate_and_size
mov edx,[MenuButton_color] ;0x44aa44
mov esi,[wcolor]
add ebx,3 shl 16 - 5
call draw_appl_button
call draw_appl_button
 
add ebx, 4*65536
mov bx,[height]
shr bx,1
sub bx,7
mov ecx,[PanelText_color]
or ecx,0x10000000
if lang eq et
mcall 4,,,m_text,5
else
mcall 4,,,m_text,4
end if
add ebx, 4*65536
mov bx,[height]
shr bx,1
sub bx,7
mov ecx,[PanelText_color]
or ecx,0x10000000
if lang eq et
mcall 4,,,m_text,5
else
mcall 4,,,m_text,4
end if
;--------------------------------------
align 4
no_menu:
; check draw for clean desktop button
cmp [clean_desktop_enable],dword 0
je .exit
cmp [clean_desktop_enable],dword 0
je .exit
; calculate and draw clean desktop button
mov ebx, (0 shl 16) + CLD_SIZE-5
; check for left minimize button enabled
cmp [minimize_left],dword 0
je @f
mov ebx, (0 shl 16) + CLD_SIZE-5
; check for left minimize button enabled
cmp [minimize_left],dword 0
je @f
 
add ebx, ML_SIZE shl 16
add ebx, ML_SIZE shl 16
;--------------------------------------
align 4
@@:
; check for menu button enabled
cmp [menu_enable],dword 0
je @f
add ebx, MENU_SIZE shl 16
cmp [menu_enable],dword 0
je @f
add ebx, MENU_SIZE shl 16
;--------------------------------------
align 4
@@:
; Inserted code for drawing buttons 103, 104, 105 (Clean, Restore, Exchange windows)
mov esi, dword [system_colours+24] ; drawing buttons
and esi, 0x00ffffff
mov edx, 0x60000000 + 103
mov esi, dword [system_colours.work_button] ; drawing buttons
and esi, 0x00ffffff
mov edx, 0x60000000 + 103
mov ecx, [height]
mcall 8 ;,,<3,13>
call calculate_button_y_coordinate_and_size
mov edx,[CleanDesktopButton_color] ;time_bgr_color
mov esi,[wcolor]
call draw_appl_button
mcall 8 ;,,<3,13>
call calculate_button_y_coordinate_and_size
mov edx,[CleanDesktopButton_color] ;time_bgr_color
mov esi,[wcolor]
call draw_appl_button
 
mov ecx,[PanelText_color]
add ebx,5 shl 16
mov bx,[height]
shr bx,1
sub bx,2
mcall 4,,,page_clean_but,1
sub bx,2
mcall ,,,page_clean_but+1
mov ecx,[PanelText_color]
add ebx,5 shl 16
mov bx,[height]
shr bx,1
sub bx,2
mcall 4,,,page_clean_but,1
sub bx,2
mcall ,,,page_clean_but+1
;--------------------------------------
align 4
.exit:
popa
ret
popa
ret
;------------------------------------------------------------------------------
align 4
draw_application_buttons:
pusha
pusha
 
cmp [run_appl],dword 0 ; do not draw application buttons
je .exit
cmp [run_appl],dword 0 ; do not draw application buttons
je .exit
 
call calculate_offset_X
call calculate_offset_X
 
mov eax,[screenxy]
shr eax,16
mov eax,[screenxy]
shr eax,16
 
sub eax,[offset_X]
sub eax,[offset_X]
; check for left minimize button enabled
cmp [minimize_right],dword 0
je @f
cmp [minimize_right],dword 0
je @f
 
sub eax, MR_SIZE
sub eax, MR_SIZE
;--------------------------------------
align 4
@@:
cmp [clock_enable],dword 0
je @f
sub eax,CLOCK_SIZE
cmp [clock_enable],dword 0
je @f
sub eax,CLOCK_SIZE
;--------------------------------------
align 4
align 4
@@:
cmp [cpu_usage_enable],dword 0
je @f
sub eax,CPU_USAGE_SIZE
cmp [cpu_usage_enable],dword 0
je @f
sub eax,CPU_USAGE_SIZE
;--------------------------------------
align 4
align 4
@@:
cmp [chlang_enable],dword 0
je @f
sub eax,CHLANG_SIZE
cmp [chlang_enable],dword 0
je @f
sub eax,CHLANG_SIZE
;--------------------------------------
align 4
align 4
@@:
cmp [page_list_enable],dword 0
je @f
sub eax,PAGE_LIST_SIZE
cmp [page_list_enable],dword 0
je @f
sub eax,PAGE_LIST_SIZE
;--------------------------------------
align 4
align 4
@@:
mov ebx, TAB_SIZE
xor edx,edx
div ebx
mov [max_applications], eax
xor edi,edi
mov ebx, TAB_SIZE
xor edx,edx
div ebx
mov [max_applications], eax
xor edi,edi
;--------------------------------------
align 4
.nb:
mov ebx,edi
imul ebx,TAB_SIZE
add ebx,[offset_X]
shl ebx,16
mov bx, TAB_SIZE-1
mov edx,edi
add edx,52
or edx,0x60000000
mov ecx, [height]
mcall 8,,,,[wcolor]
mov ebx,edi
imul ebx,TAB_SIZE
add ebx,[offset_X]
shl ebx,16
mov bx, TAB_SIZE-1
mov edx,edi
add edx,52
or edx,0x60000000
mov ecx, [height]
mcall 8,,,,[wcolor]
 
inc edi
cmp edi,[max_applications]
jb .nb
inc edi
cmp edi,[max_applications]
jb .nb
;--------------------------------------
align 4
.exit:
popa
ret
popa
ret
;------------------------------------------------------------------------------
align 4
calculate_offset_X:
push eax
xor eax,eax
push eax
xor eax,eax
; check for left minimize button enabled
cmp [minimize_left],dword 0
je @f
cmp [minimize_left],dword 0
je @f
 
add eax, ML_SIZE
add eax, ML_SIZE
;--------------------------------------
align 4
@@:
@@:
; check for menu button enabled
cmp [menu_enable],dword 0
je @f
add eax, MENU_SIZE
cmp [menu_enable],dword 0
je @f
add eax, MENU_SIZE
;--------------------------------------
align 4
@@:
; check for clean desktop button enabled
cmp [clean_desktop_enable],dword 0
je @f
cmp [clean_desktop_enable],dword 0
je @f
 
add eax, CLD_SIZE
add eax, CLD_SIZE
;--------------------------------------
align 4
@@:
mov [offset_X],eax
pop eax
ret
mov [offset_X],eax
pop eax
ret
;------------------------------------------------------------------------------
/programs/system/taskbar/trunk/u_data.inc
1,109 → 1,106
;------------------------------------------------------------------------------
align 4
last_active_window rd 1
prev_active_window rd 1
active_window_changed rd 1
app_tab_count rd 1
last_active_window rd 1
prev_active_window rd 1
active_window_changed rd 1
app_tab_count rd 1
 
alt_tab_list_size rd 1
alt_tab_list_size rd 1
 
panel_x_pos rd 1
panel_y_pos rd 1
panel_x_pos rd 1
panel_y_pos rd 1
 
offset_X rd 1
offset_x_tray rd 1
offset_X rd 1
offset_x_tray rd 1
 
pos_x_clock rd 1
pos_x_cpu_usage rd 1
pos_x_cpu_chlang rd 1
pos_x_page_list rd 1
pos_x_clock rd 1
pos_x_cpu_usage rd 1
pos_x_cpu_chlang rd 1
pos_x_page_list rd 1
 
active_slot_number rd 1
active_slot_number rd 1
 
my_active_slot rd 1
current_active_slot rd 1
my_active_slot rd 1
current_active_slot rd 1
 
screen_size:
.height rw 1
.width rw 1
.height rw 1
.width rw 1
 
draw_flag_certainly rb 1
draw_flag_certainly rb 1
 
start_menu_flag rb 1
win_key_flag rb 1
start_menu_flag rb 1
win_key_flag rb 1
 
;------------------------------------------------------------------------------
align 4
system_colours system_colors ; rd 10
system_colours system_colors
;------------------------------------------------------------------------------
align 4
app_list rd 50
app_list rd 50
;------------------------------------------------------------------------------
align 4
alt_tab_list rd 256*2
alt_tab_list rd 256*2
;------------------------------------------------------------------------------
align 4
path:
rb 1024
rb 1024
;-----------------------------------------------------------------------------
align 4
library_path:
process_info_buffer:
rb 1024
process_info_buffer process_information
;------------------------------------------------------------------------------
align 4
procinfo_for_detect:
rb 1024
procinfo_for_detect process_information
;------------------------------------------------------------------------------
align 4
procinfo_window_tabs:
rb 1024
procinfo_window_tabs process_information
;-----------------------------------------------------------------------------
align 4
bootparam:
rb 256
rb 256
;------------------------------------------------------------------------------
align 4
tictable:
rd 256
rd 256
;------------------------------------------------------------------------------
align 4
end_name:
rb 64
rb 64
;------------------------------------------------------------------------------
align 4
menu_name:
rb 64
rb 64
;------------------------------------------------------------------------------
align 4
run_name:
rb 64
rb 64
;------------------------------------------------------------------------------
align 4
printscreen_name:
rb 64
rb 64
;------------------------------------------------------------------------------
align 4
calendar_name:
rb 64
rb 64
;------------------------------------------------------------------------------
align 4
sysmeter_name:
rb 64
rb 64
;------------------------------------------------------------------------------
align 4
mousemul_name:
rb 64
rb 64
;------------------------------------------------------------------------------
align 4
rb 256
rb 256
detect_stack:
;------------------------------------------------------------------------------
align 4
rb 256
rb 256
ctx_menu_stack:
;------------------------------------------------------------------------------
align 4
rb 1024
rb 1024
stack_top:
;------------------------------------------------------------------------------