Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 2630 → Rev 2629

/programs/system/panel/trunk/@PANEL.ASM
4,16 → 4,6
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;------------------------------------------------------------------------------
; 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
157,11 → 147,11
cmp al, 62 ; Alt+F4
jz kill_active_application
 
cmp al, 205
jz page_list_next
; cmp al, 71
; jz page_list_next
 
cmp al, 203
jz page_list_prev
; cmp al, 72
; jz page_list_prev
 
cmp al, 69 ; Alt+Shift+NumLock
jz start_mousemul_application
171,9 → 161,6
 
cmp al, 32 ; Win+D
jz minimize_all_windows
cmp al, 55 ; PrintScreen DOWN
jz start_PrintScreen_application
;--------------------------------------
align 4
prod:
234,15 → 221,6
;------------------------------------------------------------------------------
align 4
start_end_application:
mov esi,end_name
call algorithm_anti_duplication
test eax,eax
jz @f
ret
;--------------------------------------
align 4
@@:
mov ebx, exec_fileinfo
mov dword [ebx+21],end_name
mcall 70
ret
249,15 → 227,6
;------------------------------------------------------------------------------
align 4
start_mousemul_application:
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
270,6 → 239,7
 
align 4
start_menu_application:
mov [draw_window_1], 1
call menu_handler
jmp begin_1.ret
;------------------------------------------------------------------------------
282,37 → 252,12
align 4
@@:
mov [start_menu_flag],1
mov esi,run_name
call algorithm_anti_duplication
test eax,eax
jz @f
ret
;--------------------------------------
align 4
@@:
mov ebx, exec_fileinfo
mov [draw_window_1], 1
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
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
;------------------------------------------------------------------------------
align 4
minimize_all_windows:
cmp [win_key_flag],1
je @f
324,100 → 269,27
call clean_desktop
ret
;------------------------------------------------------------------------------
align 4
algorithm_anti_duplication:
cld
;--------------------------------------
align 4
@@:
lodsb
test al,al
jnz @r
;--------------------------------------
align 4
@@:
std
lodsb
cmp al,'/'
jnz @r
add esi,2
mov edx,esi
mov edi,1
;--------------------------------------
align 4
@@:
inc edi
mov ecx,edi
mcall 9,procinfo_window_tabs
 
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
cld
;--------------------------------------
align 4
.loop:
lodsb
inc ebx
cmp al,[ebx]
jne @r
 
loop .loop
 
mov eax,1
ret
;--------------------------------------
align 4
.apply_changes:
xor eax,eax
ret
;align 4
;page_list_next:
; cmp [page_list],15
; je @f
;
; inc [page_list]
; mov [draw_window_1],1
;@@:
; jmp begin_1.ret
;------------------------------------------------------------------------------
align 4
page_list_next:
cmp [page_list],50
je @f
 
xor eax,eax
cmp [page_list_enable],eax
je @f
 
inc [page_list]
mov [redraw_window_flag],1
;--------------------------------------
align 4
@@:
jmp begin_1.ret
;align 4
;page_list_prev:
; cmp [page_list],0
; je @f
;
; dec [page_list]
; mov [draw_window_1],1
;@@:
; jmp begin_1.ret
;------------------------------------------------------------------------------
align 4
page_list_prev:
xor eax,eax
cmp [page_list],eax
je @f
 
cmp [page_list_enable],eax
je @f
 
dec [page_list]
mov [redraw_window_flag],1
;--------------------------------------
align 4
@@:
jmp begin_1.ret
;------------------------------------------------------------------------------
align 4
alt_tab_pressed:
; handle Alt+Tab and Alt+Shift+Tab
mov ebp, eax
547,6 → 419,7
xor edx, edx
div [max_applications]
mov [page_list], eax
mov [draw_window_1], 1
mov edi, app_list
push edi
mov ecx, 20
605,11 → 478,6
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
623,15 → 491,13
mcall 66,,32,0h ; Win+D DOWN
; mcall 66,,160,0h ; Win+D UP
 
mcall 66,,55,0h ; PrintScreen DOWN
; mcall 66,,183,0h ; PrintScreen UP
 
 
; mcall 66,,91,100h ; Alt+LWin
; mcall 66,,92 ; Alt+RWin
mcall 66,,62,100h ; Alt+F4
; mcall 66,,71 ; Alt+Home
; mcall 66,,72 ; Alt+Up
mcall 66,,15 ; Alt+Tab
mcall 66,,2 ; Alt+1
mcall 66,,3 ; Alt+2
mcall 66,,4 ; Alt+3
639,8 → 505,7
mcall 66,,6 ; Alt+5
mcall 66,,7 ; Alt+6
mcall 66,,8 ; Alt+7
mcall 66,,15 ; Alt+Tab DOWN
mcall 66,,15,101h ; Alt+Shift+Tab DOWN
mcall 66,,,101h ; Alt+Shift+Tab
mcall 66,,69 ; Alt+Shift+NumLock
 
if caps_lock_check
728,10 → 593,7
mcall 18,7
cmp [my_active_slot],eax
je @f
 
mov [current_active_slot],eax
;--------------------------------------
align 4
@@:
pop eax
742,10 → 604,7
mov eax,[redraw_window_flag]
test eax,eax
jz @f
 
call draw_window
;--------------------------------------
align 4
@@:
pop eax
753,15 → 612,11
jnz @f
call handle_key
jmp .key
;--------------------------------------
align 4
@@:
cmp eax,3 ; button ?
jz button
 
; call handle_key
;--------------------------------------
align 4
.key:
cmp dword [active_window_changed], 0
jnz red_active
784,10 → 639,7
rol eax,16
cmp [screen_size.width],ax
je .lp1
 
rol eax,16
;--------------------------------------
align 4
@@:
mov [screen_size],eax
sub ecx,[height]
826,8 → 678,6
 
cmp ecx,[current_active_slot]
je .turn_off
;--------------------------------------
align 4
@@:
mcall 18,3,
jmp .task_switching
836,8 → 686,6
.turn_off:
mov edx,ecx
mcall 18,22,0
;--------------------------------------
align 4
.task_switching:
mcall 68,1
jmp still
899,7 → 747,11
;--------------------------------------
align 4
clean_desktop_1:
 
 
call clean_desktop
jmp still
;--------------------------------------
align 4
908,12 → 760,6
cmp ah,byte 2 ; start calendar
jnz noid15 ;noclock
 
mov esi,calendar_name
call algorithm_anti_duplication
test eax,eax
jnz still
 
mov ebx, exec_fileinfo
mov dword [ebx+21], calendar_name
mcall 70
jmp still
945,12 → 791,6
cmp ah,18
jne noid18
 
mov esi,sysmeter_name
call algorithm_anti_duplication
test eax,eax
jnz still
 
mov ebx, exec_fileinfo
mov dword [ebx+21], sysmeter_name
mcall 70
jmp still
979,7 → 819,7
cmp ah,21
jnz noid21
 
cmp [page_list],50
cmp [page_list], 99
jnc still
inc [page_list]
jmp red
1083,8 → 923,6
cmp [clean_desktop_minimize],1
je @f
call restore_desktop
;--------------------------------------
align 4
@@:
ret
; jmp still
1277,6 → 1115,21
call menu_handler
jmp small_wait
;------------------------------------------------------------------------------
;align 4
;set_variables:
; pusha
; mov [button_frames],0x0
; cmp [buttons],0
; jne no_frames
 
; mov [button_frames],0x40000000
;--------------------------------------
;align 4
;no_frames:
; mcall 48,1,1 ; 3d button look
; popa
; ret
;------------------------------------------------------------------------------
include 'libini.inc'
;------------------------------------------------------------------------------
include 'dll.inc'
/programs/system/panel/trunk/drawappl.inc
144,6 → 144,8
shl ebx,16
add ebx,TAB_SIZE-2 ;54
 
call calculate_button_y_coordinate_and_size
 
push edi
mov edx,[system_colours.work_button]
xor edi,edi
163,12 → 165,10
cmp ecx,[alt_tab_list+esi*8]
jnz @f
 
mov edx,[AltTab_color] ;0xFF8000 ; current select for ALT+Tab
mov edx,0xFF8000 ; current select for ALT+Tab
;--------------------------------------
align 4
@@:
call calculate_button_y_coordinate_and_size
 
mov esi,[wcolor]
call draw_appl_button
pop edi
/programs/system/panel/trunk/drawtray.inc
2,6 → 2,8
align 4
draw_tray: ; draw cpu usage, time, date etc.
pusha
; cmp [tray_enable],dword 1
; jne no_setup
 
call draw_tray_buttons
call draw_time_skin
11,7 → 13,9
call draw_flag ; language
 
call draw_list_button
 
;--------------------------------------
;align 4
;no_setup:
popa
ret
;------------------------------------------------------------------------------
93,7 → 97,6
@@:
ret
;------------------------------------------------------------------------------
align 4
draw_time_skin:
cmp [clock_enable],dword 0
je .exit
110,7 → 113,6
.exit:
ret
;------------------------------------------------------------------------------
align 4
draw_time:
cmp [clock_enable],dword 0
je .exit
266,8 → 268,6
mov edx,ebx
add edx,9 shl 16
mcall 47,0x20000,[page_list],,[system_colours.work_button_text]
;--------------------------------------
align 4
.exit:
ret
;------------------------------------------------------------------------------
330,8 → 330,6
mcall 13,,,[CpuUsage_color] ;0x44aa44
 
popad
;--------------------------------------
align 4
.exit:
ret
;------------------------------------------------------------------------------
407,8 → 405,6
mcall 4,,,,2
popa
mov [draw_flag_certainly],0
;--------------------------------------
align 4
.exit:
ret
;------------------------------------------------------------------------------
/programs/system/panel/trunk/drawwind.inc
116,8 → 116,6
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
350,6 → 348,14
shr eax,16
 
sub eax,[offset_X]
; check for tray enabled
; cmp [tray_enable],dword 0
; je @f
 
; sub eax, TRAY_SIZE
;--------------------------------------
;align 4
;@@:
; check for left minimize button enabled
cmp [minimize_right],dword 0
je @f
/programs/system/panel/trunk/i_data.inc
54,6 → 54,7
 
page_list dd 0
draw_start_position dd 0
draw_window_1 db 0
 
;b_size_y: dd 0x0
ysi dd 0
95,10 → 96,38
db 0
.name dd 0
 
bootparam_printscreen db 'DIRECT',0
end_name db '/sys/END',0
menu_name db '/sys/@MENU',0
run_name db '/sys/RUN',0
calendar_name db '/sys/CALENDAR',0
sysmeter_name db '/sys/GMON',0
mousemul_name db '/sys/MOUSEMUL',0
 
Path_def_val db 'NONE',0
;dat_fileinfo:
; dd 0
; dd 0
; dd 0
; dd 1024
; dd panel_ini_data_area ;I_END
; db '/sys/PANEL.DAT',0
 
;m_bmp_fileinfo:
; dd 0
; dd 0
; dd 0
; dd 8192
; dd image
; db '/sys/MENUET.BMP',0
 
;iconf_fileinfo:
; dd 0
; dd 0
; dd 0
; dd 8192
; dd image
; db '/sys/'
;iconf db 'MBAR_IX.BMP',0
 
this_slot dd 0 ; Slot of this process
max_slot dd 255
 
150,7 → 179,6
ChangeLang_color dd 0x66cc ; Blue
PageList_color dd 0xffffff ; White
PanelText_color dd 0xffffff ; White
AltTab_color dd 0xff8000 ; Orange
;------------------------------------------------------------------------------
aVariables db 'Variables',0
aPanelHeight db 'PanelHeight',0
177,15 → 205,7
aColors db 'Colors',0
aCpuUsageBckgr db 'CpuUsageBckgr',0
aPanelText db 'Text',0
aAltTab db 'AltTab',0
;------------------------------------------------------------------------------
aApplicationsPaths db 'ApplicationsPaths',0
aEnd db 'End',0
aMenu db 'Menu',0
aRun db 'Run',0
aPrnScr db 'PrnScr',0
aMouseEmul db 'MouseEmul',0
;------------------------------------------------------------------------------
plugins_directory db 0
 
ini_file_name db 'panel.ini',0
/programs/system/panel/trunk/libini.inc
183,22 → 183,7
invoke ini_get_color,library_path,aColors,aPanelText,0xffffff
mov [PanelText_color],eax
;--------------------------------------
invoke ini_get_color,library_path,aColors,aAltTab,0xff8000
mov [AltTab_color],eax
;--------------------------------------
invoke ini_get_str,library_path,aApplicationsPaths,aEnd,end_name,63,Path_def_val
;--------------------------------------
invoke ini_get_str,library_path,aApplicationsPaths,aMenu,menu_name,63,Path_def_val
;--------------------------------------
invoke ini_get_str,library_path,aApplicationsPaths,aRun,run_name,63,Path_def_val
;--------------------------------------
invoke ini_get_str,library_path,aApplicationsPaths,aPrnScr,printscreen_name,63,Path_def_val
;--------------------------------------
invoke ini_get_str,library_path,aApplicationsPaths,aClock,calendar_name,63,Path_def_val
;--------------------------------------
invoke ini_get_str,library_path,aApplicationsPaths,aCpuUsage,sysmeter_name,63,Path_def_val
;--------------------------------------
invoke ini_get_str,library_path,aApplicationsPaths,aMouseEmul,mousemul_name,63,Path_def_val
; invoke ini_get_str,library_path,aConvertPlugins,aCP0,plugin_0_name,127,ConvertPlugins_no_key
ret
;-----------------------------------------------------------------------------
/programs/system/panel/trunk/panel.ini
28,13 → 28,3
ChangeLang=0,128,255
PageList=255,255,255
Text=255,255,255
AltTab=255,128,0
 
[ApplicationsPaths]
End=/sys/END
Menu=/sys/@MENU
Run=/sys/RUN
PrnScr=/sys/SCRSHOOT
Clock=/sys/CALENDAR
CpuUsage=/sys/GMON
MouseEmul=/sys/MOUSEMUL
/programs/system/panel/trunk/drawbutt.inc
128,28 → 128,19
; edx = processed color
sub dl,al
jae @f
 
xor dl,dl
;--------------------------------------
align 4
@@:
ror edx,8
ror eax,8
sub dl,al
jae @f
 
xor dl,dl
;--------------------------------------
align 4
@@:
ror edx,8
ror eax,8
sub dl,al
jae @f
 
xor dl,dl
;--------------------------------------
align 4
@@:
rol edx,16
ret
163,33 → 154,23
; edx = processed color
add dl,al
jae @f
 
mov dl,0xff
;--------------------------------------
align 4
@@:
ror edx,8
ror eax,8
add dl,al
jae @f
 
mov dl,0xff
;--------------------------------------
align 4
@@:
ror edx,8
ror eax,8
add dl,al
jae @f
 
mov dl,0xff
;--------------------------------------
align 4
@@:
rol edx,16
ret
;------------------------------------------------------------------------------
align 4
calculate_button_y_coordinate_and_size:
mov ecx,[button_top_offset]
shl ecx,16
196,5 → 177,4
add ecx,[height]
sub ecx,[button_top_offset]
sub ecx,[button_bottom_offset]
ret
;------------------------------------------------------------------------------
ret
/programs/system/panel/trunk/u_data.inc
68,35 → 68,11
tictable:
rd 256
;------------------------------------------------------------------------------
align 4
end_name:
rb 64
;align 4
;panel_ini_data_area:
; rb 61
;------------------------------------------------------------------------------
align 4
menu_name:
rb 64
;------------------------------------------------------------------------------
align 4
run_name:
rb 64
;------------------------------------------------------------------------------
align 4
printscreen_name:
rb 64
;------------------------------------------------------------------------------
align 4
calendar_name:
rb 64
;------------------------------------------------------------------------------
align 4
sysmeter_name:
rb 64
;------------------------------------------------------------------------------
align 4
mousemul_name:
rb 64
;------------------------------------------------------------------------------
align 4
rb 256
detect_stack:
;------------------------------------------------------------------------------
/programs/system/panel/trunk/ctx_menu.asm
100,7 → 100,7
add ecx, 60 ; 41
mov esi, [system_colours + 4] ; sc.grab
or esi, 0x81000000
mcall ,,,[system_colours + 20],,[system_colours]
mcall ,,,[system_colours + 20],[system_colours]
 
mcall 8,<0,133>,<22,17>,0x40000001