diff --git a/data/Vortex86MX-eng/Makefile b/data/Vortex86MX-eng/Makefile index c08288540c..c01360f166 100644 --- a/data/Vortex86MX-eng/Makefile +++ b/data/Vortex86MX-eng/Makefile @@ -243,7 +243,7 @@ OTHER_FILES:=autorun.dat:AUTORUN.DAT \ kernel.mnt:KERNEL.MNT kerpack:KERPACK keymap.key:KEYMAP.KEY \ kuzkina.mid:KUZKINA.MID lang.inc:LANG.INC lang.ini:LANG.INI \ menu.dat:MENU.DAT \ - panel.dat:PANEL.DAT setup.dat:SETUP.DAT \ + panel.ini:PANEL.INI setup.dat:SETUP.DAT \ shell:SHELL table:TABLE \ vmode:VMODE 3d/3dsheart:3D/3DSHEART \ 3d/cubeline:3D/CUBELINE 3d/gears:3D/GEARS 3d/house.3ds:3D/HOUSE.3DS \ diff --git a/data/Vortex86MX-eng/panel.dat b/data/Vortex86MX-eng/panel.dat deleted file mode 100644 index fc97f062a7..0000000000 --- a/data/Vortex86MX-eng/panel.dat +++ /dev/null @@ -1 +0,0 @@ -0000;0000;0001;0001;0001;0001;0100;0001;0001;0001;0001;0001;x \ No newline at end of file diff --git a/data/Vortex86MX-eng/panel.ini b/data/Vortex86MX-eng/panel.ini new file mode 100644 index 0000000000..3af81a9d0d --- /dev/null +++ b/data/Vortex86MX-eng/panel.ini @@ -0,0 +1,31 @@ +[Variables] +PanelHeight=24 +PanelWidth=0 +SoftenHeight=5 +ButtonTopOffset=4 +ButtonBottOffset=2 + +[Flags] +SoftenUp=1 +SoftenDown=0 +MinLeftButton=1 +MinRightButton=1 +MenuButton=1 +RunApplButtons=1 +ClnDesktButton=1 +Clock=1 +CpuUsage=1 +ChangeLang=1 +PageList=1 +Attachment=1 +ButtonsStyle=1 + +[Colors] +MenuButton=0,100,0 +ClnDesktButton=0,128,255 +Clock=0,128,255 +CpuUsage=0,100,0 +CpuUsageBckgr=255,0,0 +ChangeLang=0,128,255 +PageList=255,255,255 + diff --git a/data/eng/Makefile b/data/eng/Makefile index a6c52d6eb1..372e603c65 100644 --- a/data/eng/Makefile +++ b/data/eng/Makefile @@ -249,7 +249,7 @@ OTHER_FILES:=autorun.dat:AUTORUN.DAT \ kernel.mnt:KERNEL.MNT kerpack:KERPACK keymap.key:KEYMAP.KEY \ kuzkina.mid:KUZKINA.MID lang.inc:LANG.INC lang.ini:LANG.INI \ menu.dat:MENU.DAT \ - panel.dat:PANEL.DAT setup.dat:SETUP.DAT \ + panel.ini:PANEL.INI setup.dat:SETUP.DAT \ shell:SHELL table:TABLE \ vmode:VMODE 3d/3dsheart:3D/3DSHEART \ 3d/cubeline:3D/CUBELINE 3d/gears:3D/GEARS 3d/house.3ds:3D/HOUSE.3DS \ diff --git a/data/eng/panel.dat b/data/eng/panel.dat deleted file mode 100644 index fc97f062a7..0000000000 --- a/data/eng/panel.dat +++ /dev/null @@ -1 +0,0 @@ -0000;0000;0001;0001;0001;0001;0100;0001;0001;0001;0001;0001;x \ No newline at end of file diff --git a/data/eng/panel.ini b/data/eng/panel.ini new file mode 100644 index 0000000000..3af81a9d0d --- /dev/null +++ b/data/eng/panel.ini @@ -0,0 +1,31 @@ +[Variables] +PanelHeight=24 +PanelWidth=0 +SoftenHeight=5 +ButtonTopOffset=4 +ButtonBottOffset=2 + +[Flags] +SoftenUp=1 +SoftenDown=0 +MinLeftButton=1 +MinRightButton=1 +MenuButton=1 +RunApplButtons=1 +ClnDesktButton=1 +Clock=1 +CpuUsage=1 +ChangeLang=1 +PageList=1 +Attachment=1 +ButtonsStyle=1 + +[Colors] +MenuButton=0,100,0 +ClnDesktButton=0,128,255 +Clock=0,128,255 +CpuUsage=0,100,0 +CpuUsageBckgr=255,0,0 +ChangeLang=0,128,255 +PageList=255,255,255 + diff --git a/data/new-stack/Makefile b/data/new-stack/Makefile index 67f45826bc..477bca3b29 100644 --- a/data/new-stack/Makefile +++ b/data/new-stack/Makefile @@ -173,7 +173,7 @@ OTHER_FILES:=autorun.dat:AUTORUN.DAT \ kernel.mnt:KERNEL.MNT kerpack:KERPACK keymap.key:KEYMAP.KEY \ lang.inc:LANG.INC lang.ini:LANG.INI \ menu.dat:MENU.DAT \ - panel.dat:PANEL.DAT setup.dat:SETUP.DAT \ + panel.ini:PANEL.INI setup.dat:SETUP.DAT \ shell:SHELL \ vmode:VMODE \ File|Managers/eolite.ini:File|Managers/EOLITE.INI \ diff --git a/data/new-stack/panel.dat b/data/new-stack/panel.dat deleted file mode 100644 index fc97f062a7..0000000000 --- a/data/new-stack/panel.dat +++ /dev/null @@ -1 +0,0 @@ -0000;0000;0001;0001;0001;0001;0100;0001;0001;0001;0001;0001;x \ No newline at end of file diff --git a/data/new-stack/panel.ini b/data/new-stack/panel.ini new file mode 100644 index 0000000000..3af81a9d0d --- /dev/null +++ b/data/new-stack/panel.ini @@ -0,0 +1,31 @@ +[Variables] +PanelHeight=24 +PanelWidth=0 +SoftenHeight=5 +ButtonTopOffset=4 +ButtonBottOffset=2 + +[Flags] +SoftenUp=1 +SoftenDown=0 +MinLeftButton=1 +MinRightButton=1 +MenuButton=1 +RunApplButtons=1 +ClnDesktButton=1 +Clock=1 +CpuUsage=1 +ChangeLang=1 +PageList=1 +Attachment=1 +ButtonsStyle=1 + +[Colors] +MenuButton=0,100,0 +ClnDesktButton=0,128,255 +Clock=0,128,255 +CpuUsage=0,100,0 +CpuUsageBckgr=255,0,0 +ChangeLang=0,128,255 +PageList=255,255,255 + diff --git a/data/rus/Makefile b/data/rus/Makefile index 9220c6e5f6..8e91dde524 100644 --- a/data/rus/Makefile +++ b/data/rus/Makefile @@ -242,7 +242,7 @@ OTHER_FILES:=autorun.dat:AUTORUN.DAT \ kernel.mnt:KERNEL.MNT kerpack:KERPACK keymap.key:KEYMAP.KEY \ kuzkina.mid:KUZKINA.MID lang.inc:LANG.INC lang.ini:LANG.INI \ menu.dat:MENU.DAT \ - panel.dat:PANEL.DAT pipetka:PIPETKA setup.dat:SETUP.DAT \ + panel.ini:PANEL.INI pipetka:PIPETKA setup.dat:SETUP.DAT \ shell:SHELL table:TABLE vmode:VMODE \ 3d/cubeline:3D/CUBELINE 3d/gears:3D/GEARS 3d/house.3ds:3D/HOUSE.3DS \ demos/ak47.lif:DEMOS/AK47.LIF \ diff --git a/data/rus/panel.dat b/data/rus/panel.dat deleted file mode 100644 index fc97f062a7..0000000000 --- a/data/rus/panel.dat +++ /dev/null @@ -1 +0,0 @@ -0000;0000;0001;0001;0001;0001;0100;0001;0001;0001;0001;0001;x \ No newline at end of file diff --git a/data/rus/panel.ini b/data/rus/panel.ini new file mode 100644 index 0000000000..3af81a9d0d --- /dev/null +++ b/data/rus/panel.ini @@ -0,0 +1,31 @@ +[Variables] +PanelHeight=24 +PanelWidth=0 +SoftenHeight=5 +ButtonTopOffset=4 +ButtonBottOffset=2 + +[Flags] +SoftenUp=1 +SoftenDown=0 +MinLeftButton=1 +MinRightButton=1 +MenuButton=1 +RunApplButtons=1 +ClnDesktButton=1 +Clock=1 +CpuUsage=1 +ChangeLang=1 +PageList=1 +Attachment=1 +ButtonsStyle=1 + +[Colors] +MenuButton=0,100,0 +ClnDesktButton=0,128,255 +Clock=0,128,255 +CpuUsage=0,100,0 +CpuUsageBckgr=255,0,0 +ChangeLang=0,128,255 +PageList=255,255,255 + diff --git a/programs/system/panel/trunk/@PANEL.ASM b/programs/system/panel/trunk/@PANEL.ASM index f812771675..8f787db211 100644 --- a/programs/system/panel/trunk/@PANEL.ASM +++ b/programs/system/panel/trunk/@PANEL.ASM @@ -1,9 +1,20 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; -; MENUBAR for KolibriOS - Compile with fasm ; +; TASK PANEL for KolibriOS - Compile with fasm ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ +; 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. @@ -14,41 +25,47 @@ db 'MENUET01' ; 8 byte id dd 0x01 ; header version dd START ; program start - dd IM_END ;I_END ; program image size - dd I_END ;0xA000 ; reguired amount of memory - 10 Kb - dd stack_top ;0xA000 ; esp + dd IM_END ; program image size + dd I_END ; reguired amount of memory - 10 Kb + dd stack_top ; esp dd 0x0 ; boot parameters - dd 0x0 ; path -;------------------------------------------------------------------------------ + dd path ; application pach +;------------------------------------------------------------------------------ include 'lang.inc' -include '..\..\..\macros.inc' +include '../../../macros.inc' +include '../../../proc32.inc' +;include 'debug.inc' include 'MOI.INC' ;раскладки клавиатуры - -caps_lock_check fix 0 - +include '../../../develop/libraries/box_lib/load_lib.mac' + @use_library ;use load lib macros +;------------------------------------------------------------------------------ +caps_lock_check fix 1 +;------------------------------------------------------------------------------ time_bgr_color = 0x66cc +;PANEL_HEIGHT = 18 +ML_SIZE = 10 +MR_SIZE = 10 +MENU_SIZE = 50 +CLD_SIZE = 20 +TAB_SIZE = 60 +TRAY_SIZE = 140 -width dd 305 -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 1 -minimize_right dd 1 -icons_position dd 95 -menu_enable dd 1 -setup_enable dd 0 -graph_text dd 1 -soften_middle dd 1 ; 0 no ; 1 yes -icons dd 1 ; 0 defaults ; 1 activate - -PANEL_HEIGHT = 18 -;------------------------------------------------------------------------------ +CLOCK_SIZE = 40 +CPU_USAGE_SIZE = 10 +CHLANG_SIZE = 20 +PAGE_LIST_SIZE = 36 +;------------------------------------------------------------------------------ align 4 handle_key: - mcall 18, 7 + mcall 18,7 mov [active_process],eax mcall 2 + +; dps "panel key: " +; dph eax +; newline + cmp al, 2 jnz begin_1.ret @@ -80,34 +97,46 @@ handle_key: cmp al, 8 jz alter ;-------------------------------------- -align 4 -prod: +;align 4 +;prod: if caps_lock_check - cmp al,58 + cmp al,58 ;CAPS LOCK DOWN jne @f pusha mcall 26,2,9 mov ebx,eax mov eax,2 - call draw_window ;;;??? +; call draw_window ;;;??? + mov [draw_flag_certainly],1 + call draw_flag ; language popa ret @@: end if - cmp al, 15 + cmp al, 15 ; Alt+Tab DOWN jz alt_tab_pressed - cmp al, 88 + cmp al, 88 ; Ctrl+Alt+F12 jz start_end_application - cmp al, 91 - jz start_menu_application + + + cmp al, 91 ; RWin DOWN + jz set_win_key_flag - cmp al, 92 - jz start_menu_application + 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, 62 + cmp al, 220 ; LWin UP + jz cut_win_key_flag ;start_menu_application + + + cmp al, 62 ; Alt+F4 jz kill_active_application ; cmp al, 71 @@ -116,13 +145,27 @@ end if ; cmp al, 72 ; jz page_list_prev - cmp al, 69 + cmp al, 69 ; Alt+Shift+NumLock jz start_mousemul_application + + cmp al, 19 ; Win+R + jz start_run_application + + cmp al, 32 ; Win+D + jz minimize_all_windows +;-------------------------------------- +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 - test ah, 0x30 + test ah, 0x30 ; Alt+Tab UP jz alt_tab_released ;-------------------------------------- align 4 @@ -132,7 +175,21 @@ align 4 ; mov ebx, setup_exec ; test ah, 001100b ; jz change_sys_lang -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ +align 4 +set_win_key_flag: + 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 +;------------------------------------------------------------------------------ align 4 change_key_lang: mov dword [ebx+8], chlang @@ -147,37 +204,59 @@ begin_1: 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 dword [ebx+21],end_name mcall 70 ret -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ align 4 start_mousemul_application: mov dword [ebx+21],mousemul_name mcall 70 ret -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ align 4 kill_active_application: mcall 72,1,3,1 jmp begin_1.ret -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ + align 4 start_menu_application: mov [draw_window_1], 1 - mov dword [ebx+21], menu_name + call menu_handler + jmp begin_1.ret +;------------------------------------------------------------------------------ +align 4 +start_run_application: + cmp [win_key_flag],1 + je @f + ret +@@: + mov [start_menu_flag],1 + mov [draw_window_1], 1 + mov dword [ebx+21], run_name mcall 70 jmp begin_1.ret -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ +align 4 +minimize_all_windows: + cmp [win_key_flag],1 + je @f + ret +@@: + mov [start_menu_flag],1 + call clean_desktop + ret +;------------------------------------------------------------------------------ ;align 4 ;page_list_next: ; cmp [page_list],15 @@ -187,7 +266,7 @@ start_menu_application: ; mov [draw_window_1],1 ;@@: ; jmp begin_1.ret -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ ;align 4 ;page_list_prev: ; cmp [page_list],0 @@ -197,7 +276,7 @@ start_menu_application: ; mov [draw_window_1],1 ;@@: ; jmp begin_1.ret -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ align 4 alt_tab_pressed: ; handle Alt+Tab and Alt+Shift+Tab @@ -206,7 +285,7 @@ alt_tab_pressed: jnz has_alt_tab_app ; заполняем таблицу приложений, подлежащих переключению xor edx, edx - mov ebx, procinfo_window_tabs ;0x8000 ; WTF???!!! + mov ebx, procinfo_window_tabs mov ecx, 1 .fill: inc ecx @@ -349,24 +428,56 @@ align 4 align 4 alt_tab_released: mcall 66,5,0,0 ; уже поймали, хватит :) + or eax, -1 xchg eax, [current_alt_tab_app] mov ecx, [alt_tab_list+eax*8] mcall 18,3 + jmp redraw_window_tabs -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ align 4 active_process dd 0 -; .exit: mcall -1 - - +exit: + mcall -1 +;------------------------------------------------------------------------------ START: + 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 + + +load_libraries l_libs_start,end_l_libs + + test eax,eax + jnz exit + + call Get_ini + + mcall 48,1,[button_style] + mcall 66,4,0,2 ; LShift+RShift mcall 66,,,11h ; Ctrl+Shift mcall 66,,88,110h ; Alt+Ctrl+F12 - mcall 66,,91,0h ; LWin - mcall 66,,92 ; RWin + 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,,91,100h ; Alt+LWin ; mcall 66,,92 ; Alt+RWin mcall 66,,62,100h ; Alt+F4 @@ -387,48 +498,30 @@ if caps_lock_check xor edx,edx mcall 66,4,58 end if - mcall 18,8,1 - test eax,eax - jne @f - mcall 18,8,2 -;-------------------------------------- -align 4 -@@: - mcall 70,dat_fileinfo - - mov edi,width - mov esi,I_END - xor eax,eax -;-------------------------------------- -align 4 -new_number: - cmp [esi],byte ';' - je number_ready - - imul eax,10 - movzx ebx,byte [esi] - sub ebx,'0' - add eax,ebx - inc esi - jmp new_number -;-------------------------------------- -align 4 -number_ready: - stosd - xor eax,eax - inc esi - cmp [esi],byte 'x' - jne new_number - mcall 14 mov [screen_size],eax + mov ecx,eax ;eax = [xsize]*65536 + [ysize], где shr ecx,16 and eax,0xFFFF - lea edx,[eax-PANEL_HEIGHT-1] - + + cmp [place_attachment],1 + je @f + ror eax,16 + add eax,[height] + rol eax,16 + mov edx,eax + jmp .selected +;-------------------------------------- +align 4 +@@: + sub eax,[height] + lea edx,[eax-1] +;-------------------------------------- +align 4 +.selected: mcall 48,6 mcall 9,process_info_buffer,-1 @@ -436,13 +529,11 @@ number_ready: mcall 18,21 mov [this_slot],eax mov [max_slot],255 - - call set_variables ;-------------------------------------- align 4 start_after_minimize: call draw_window - call draw_info +; call draw_tray call draw_running_applications mcall 23,30 @@ -451,7 +542,9 @@ start_after_minimize: ;------------------------------------------------------------------------------ align 4 still: - call draw_info +; call draw_tray + call draw_time + call draw_cpu_usage call draw_running_applications mcall 18,7 ; check if active window changed @@ -481,18 +574,34 @@ align 4 align 4 @@: mcall 23,20 + + push eax + mcall 18,7 + cmp [my_active_slot],eax + je @f + mov [current_active_slot],eax +@@: + pop eax + cmp eax,1 ; redraw ? jz red + cmp eax,2 + jnz @f + call handle_key + jmp .key +@@: cmp eax,3 ; button ? jz button - call handle_key +; call handle_key +.key: cmp dword [active_window_changed], 0 jnz red_active + call draw_flag ; language jmp still -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ align 4 red_active: red: @@ -511,15 +620,15 @@ red: rol eax,16 @@: mov [screen_size],eax - sub ecx,PANEL_HEIGHT - mcall 67,0,,,PANEL_HEIGHT + sub ecx,[height] + mcall 67,0,,,[height] ;-------------------------------------- align 4 .lp1: call draw_window - call draw_info +; call draw_tray jmp still -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ align 4 button: mcall 17 @@ -539,11 +648,26 @@ button: shl ecx,2 mov ecx,[app_list+ecx] - mcall 18,3, + + mcall 9,process_info_buffer -; mcall 55,eax,,,activatemusic - jmp still -;------------------------------------------------------------------------------ + test [ebx+70],dword 10b ; window is minimized to panel + jnz @f + + cmp ecx,[current_active_slot] + je .turn_off +@@: + mcall 18,3, + jmp .task_switching +;-------------------------------------- +align 4 +.turn_off: + mov edx,ecx + mcall 18,22,0 +.task_switching: + mcall 68,1 + jmp still +;------------------------------------------------------------------------------ align 4 right_mouse: cmp ah,50 @@ -574,7 +698,7 @@ right_mouse: mov [ctx_menu_PID], eax jmp still -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ align 4 no_activate: cmp ah,101 ; minimize to left @@ -584,19 +708,28 @@ no_activate: je right_button cmp ah, 103 - je clean_desktop ; minimize all windows + je clean_desktop_1 ; minimize all windows - cmp ah, 104 - je restore_desktop ; restore minimized 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, 105 +; je swap_minimized_desktop ; minimize normal windows, and restore minimized windows cmp ah,byte 1 ; start/terminate menu jnz noselect call menu_handler + jmp still +;-------------------------------------- +align 4 +clean_desktop_1: + + + call clean_desktop + + jmp still ;-------------------------------------- align 4 @@ -614,9 +747,11 @@ noid15: cmp ah,16 jne noid16 - mov ebx, setup_exec - mov dword [ebx+8], chlang - mcall 70 +; mov ebx, setup_exec +; mov dword [ebx+8], chlang +; mcall 70 + call karu + call draw_flag ; language jmp still ;-------------------------------------- align 4 @@ -640,25 +775,25 @@ noid16: ;-------------------------------------- align 4 noid18: - cmp ah,19 - jne noid19 +; cmp ah,19 ; speaker +; jne noid19 - mcall 18,8,2 - mcall 15,3 - jmp red +; 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 +;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: +;align 4 +;noid20: cmp ah,21 jnz noid21 @@ -677,7 +812,7 @@ noid21: dec [page_list] jmp red -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ align 4 restore_desktop: mcall 9,process_info_buffer,-1 @@ -691,20 +826,22 @@ align 4 inc edx cmp edx, [max_slot] jbe @b - jmp still -;------------------------------------------------------------------------------ -align 4 -swap_minimized_desktop: - xor esi, esi - inc esi - jmp min_swap_desktop -;------------------------------------------------------------------------------ +; jmp still + ret +;------------------------------------------------------------------------------ +;align 4 +;swap_minimized_desktop: +; xor esi, esi +; inc esi +; jmp min_swap_desktop +;------------------------------------------------------------------------------ align 4 clean_desktop: - xor esi,esi + mov [clean_desktop_minimize],0 +; xor esi,esi ;-------------------------------------- -align 4 -min_swap_desktop: ; input esi 0 - min, <>0 swap +;align 4 +;min_swap_desktop: ; input esi 0 - min, <>0 swap mov ecx, 2 ; Начальный номер слота процесса mov ebx, process_info_buffer ;-------------------------------------- @@ -737,284 +874,98 @@ align 4 cmp [ebx+10], dword ' ' jz .loop1xx - pushad - mov edx, ecx - xor ecx, ecx - or esi, esi - jz @f + pusha + mov edx, ecx + xor ecx, ecx +; or esi, esi +; jz @f - movzx eax, byte [process_info_buffer+70] - and eax, 2 ; mask minimize - jz @f + movzx eax, byte [process_info_buffer+70] + and eax, 2 ; mask minimize + jnz @f - mov ecx, 2 ; restore + mov [clean_desktop_minimize],1 +; mov ecx, 2 ; restore + mcall 18, 22 ;-------------------------------------- align 4 @@: - mcall 18, 22 - popad + popa ;-------------------------------------- align 4 .loop1xx: inc ecx cmp ecx, [max_slot] jbe .loop1 - jmp still -;------------------------------------------------------------------------------ -align 4 -draw_running_applications: - pusha - - cmp [icons],1 - jne dr_ret - - call calculate_applications - - cmp edi,[running_applications] - jne noret - popa - ret -;-------------------------------------- -align 4 -noret: - call draw_window - mov [running_applications],edi - call redraw_window_tabs -;-------------------------------------- -align 4 -dr_ret: - popa - ret -;------------------------------------------------------------------------------ -align 4 -need_window_tab: -; in: ebx->process info -; out: ZF set <=> do not draw - cmp byte [ebx+10], '@' - jz .nodraw -; do not draw undefined (zero-sized) windows - cmp dword [ebx+42], 0 - jnz @f - cmp dword [ebx+46], 0 - jz .nodraw -;-------------------------------------- -align 4 + + cmp [clean_desktop_minimize],1 + je @f + call restore_desktop @@: -; do not draw OpenDialog windows - push edi - mov edi, dword [ebx+10] - or edi, 0x20202020 - cmp edi, 'open' - jne @f - - mov edi, dword [ebx+14] - or edi, 0x20202020 - cmp dword [ebx+14], 'dial' - jne @f - - pop edi - jmp .nodraw -;-------------------------------------- -align 4 -@@: - pop edi - cmp dword [ebx+10], 'ICON' - jnz @f - - cmp [ebx+42], dword 51 - jnz @f - - cmp [ebx+46], dword 51 - jz .nodraw -;-------------------------------------- -align 4 -@@: - cmp [ebx+10], dword ' ' -;-------------------------------------- -align 4 -.nodraw: ret -;------------------------------------------------------------------------------ +; jmp still +;------------------------------------------------------------------------------ align 4 -redraw_window_tabs: - xor edi, edi - mov [contrast], 0 - - push ebp - mcall 18,7 - mov ebp,eax +conversion_HEX_to_ASCII: + ror eax,12 + mov ecx,4 ;-------------------------------------- align 4 .loop: - mov ecx,[app_list+edi*4] - cmp ecx,-1 - jz .done + mov bl,al + rol eax,4 + and bl,0xf + cmp bl,0xA ; check for ABCDEF + jae @f - push ecx - mcall 9,procinfo_window_tabs ;0x8000 ; WTF???!!! - - imul ebx, edi, 6*10*10000h - add ebx, 12*10*10000h + 7*10000h + 54 - - mcall 13,,<3,14>,0x383838 - - sub ebx, 10000h + 53 - mcall ,,<4,12> - - sub ebx, 10000h - mcall ,,<5,10> - - add ebx, 56*10000h - mcall ,,<4,12> - - add ebx, 10000h - mcall ,,<5,10> - - mov edx, [wcolor] ; barsuk - pop ecx - cmp ebp, ecx ; ecx=active slot number - jnz @f - - mov edx, [system_colours.work_button] + add bl,0x30 ; 0-9 + jmp .store ;-------------------------------------- align 4 @@: - mov esi, [current_alt_tab_app] - cmp esi, -1 - jz @f - - cmp ecx, [alt_tab_list+esi*8] - jnz @f - - mov edx, 0xFF8000 + add bl,0x57 ; A-F ;-------------------------------------- align 4 -@@: - sub ebx, 55*10000h - 53 - mcall ,,<4,12> - - sub ebx, 10000h + 53 - mcall ,,<5,10> - - add ebx, 55*10000h - mcall - - sub ebx, 51*10000h - 6 - mov edx, procinfo_window_tabs+10 ;0x8000+10 ; WTF???!!! - mcall 4,,[system_colours.work_button_text],,11 -;-------------------------------------- -align 4 -.nodraw: +.store: +; dps "param_store: " + mov [edi],bl inc edi - cmp edi, [max_applications] - jb .loop -;-------------------------------------- -align 4 -.done: - pop ebp + dec ecx + jnz .loop ret -;------------------------------------------------------------------------------ -align 4 -calculate_applications: - mov eax,[max_applications] - mul [page_list] - test eax,eax - je @f - - inc eax -;-------------------------------------- -align 4 -@@: - mov [draw_start_position],eax - - mov edi,app_list - mov ecx,20 - mov eax,-1 - cld - rep stosd - - mov edi,0 - mov ecx,2 -;-------------------------------------- -align 4 -cnewpr: - mcall 9,procinfo_window_tabs ;0x8000 ; WTF???!!! - - call need_window_tab - jz cnorpl - - sub [draw_start_position], 1 - jg cnorpl - - mov [app_list+edi*4],ecx - inc edi -;-------------------------------------- -align 4 -cnorpl: - inc ecx - cmp eax,ecx - jge cnewpr - - mov [app_tab_count], edi - ret -;------------------------------------------------------------------------------ -align 4 -draw_application_buttons: - pusha - - cmp [icons],1 - jne da_ret - - mcall 14 - shr eax,16 - - sub eax, 281 - jnc ._01 - xor eax, eax -;-------------------------------------- -align 4 -._01: - mov bl, 60 - div bl - xor ah, ah ; eax - количество умещаюшихся пиктов - mov [max_applications], eax - mov edi,1 -;-------------------------------------- -align 4 -nb: - mov ebx,edi - shl ebx,16 - imul ebx,6*10 ;13 - add ebx,75*65536+10*6-1 ; << Alver 25.08.2007 >> 15*65536+10*6-1 ;13 - mov edx,edi - add edx,51 - cmp [buttons],1 - je bufr - - or edx,0x60000000 -;-------------------------------------- -align 4 -bufr: - mov esi,[wcolor] - sub ebx,11 shl 16 - mcall 8,,<1,17> - - inc edi - cmp edi,[max_applications] - jbe nb -;-------------------------------------- -align 4 -da_ret: - popa - ret -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ align 4 menu_handler: + mov edi,bootparam + + 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_y.start] + 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,[place_attachment] + call conversion_HEX_to_ASCII + + 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 -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ align 4 draw_small_right: pusha @@ -1028,17 +979,13 @@ draw_small_right: mcall xor ecx,ecx - mov cx,[b_size_y] + mov cx,[height] mcall 8,<0,9>,,1,[wcolor] - mov ebx,2*65536+16 - cmp [graph_text],1 - jne nos3 - - mov ebx,2*65536+7 -;-------------------------------------- -align 4 -nos3: + mov ebx,2*65536 ;+6 + mov bx,[height] + shr bx,1 + sub bx,3 mov ecx,[wcolor] add ecx,0x303030 mcall 4,,,hidetext,1 @@ -1046,7 +993,7 @@ nos3: mcall 12,2 popa ret -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ align 4 draw_small_left: pusha @@ -1059,36 +1006,14 @@ draw_small_left: or edx, 0x01000000 mcall - cmp [graph_text],1 - je nos4 - - mcall 8,<0,9>,<0,12>,2,[wcolor] - - mov ecx,[wcolor] - add ecx,0x303030 - mcall 4,<2,4>,,hidetext+2,1 -;-------------------------------------- -align 4 -nos4: - mov ecx,13*65536+25 - cmp [graph_text],1 - jne nos6 - xor ecx,ecx - mov cx,word [b_size_y] -;-------------------------------------- -align 4 -nos6: + mov cx,[height] mcall 8,<0,9>,,1,[wcolor] - mov ebx,3*65536+22 - cmp [graph_text],1 - jne nos7 - - mov ebx,3*65536+7 -;-------------------------------------- -align 4 -nos7: + mov ebx,3*65536 ;+6 + mov bx,[height] + shr bx,1 + sub bx,3 mov ecx,[wcolor] add ecx,0x303030 mcall 4,,,hidetext+1,1 @@ -1096,7 +1021,7 @@ nos7: mcall 12,2 popa ret -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ align 4 right_button: mov [small_draw],dword draw_small_right @@ -1113,7 +1038,7 @@ right_button: call draw_small_right jmp small_wait -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ align 4 left_button: mov [small_draw],dword draw_small_left @@ -1159,1106 +1084,41 @@ align 4 no_full: call menu_handler jmp small_wait -;------------------------------------------------------------------------------ -align 4 -set_variables: - pusha - mov [b_size_y],dword 38 - cmp [graph_text],1 - jne noy2 - - mov [b_size_y],dword 18 -;-------------------------------------- -align 4 -noy2: - 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 - - mov eax,0x40404040 ; dividers for processes - mov edi,pros - mov ecx,10 - cld - rep stosd - - popa - ret -;------------------------------------------------------------------------------ -align 4 -; eax = number (1 or 2) -; ebx = language id -draw_flag: - pusha -; eax = 2 BIG -; eax = 1 small - mov edx,ebx - - mov ebx,[maxx] - and eax,1 - imul eax,17 ;17 - sub ebx,eax - sub ebx,76 ;79 ;28 - - pushad -; dec ebx - sub ebx,2 - shl ebx, 16 - add ebx, 15 ;25 - xor edx,edx - mcall 13,,<4,13> - - add ebx,1 shl 16 - sub ebx,2 - mov ecx, 5 shl 16+11 - cmp [type_lang],1 - je label_1 - - mov edx,0xff ;[wcolor] - jmp label_2 -;-------------------------------------- -align 4 -label_1: - mov edx,0x7700 -;-------------------------------------- -align 4 -label_2: - mcall - popad - - shl ebx,16 - add ebx,7 ;24 - - mov ecx,[bte] ; color - -if caps_lock_check -; make flag_text 'enfigerufretua' or 'ENFIGERUFRETUA' depending on CapsLock state. - call flag_text_setup -end if - dec edx - shl edx,1 - add edx,flag_text - mcall 4,,,,2 - - mov ebx,[maxx] - sub ebx,48 - shl ebx,16 - mov bx,34 - xor edx,edx - mcall 13,,<3,14> - - add ebx,1 shl 16 - sub ebx,2 - mov ecx,4 shl 16+12 - mov edx,time_bgr_color - mcall - - popa - 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' -db 'ENFIGERUFRETUA' -end if -;------------------------------------------------------------------------------ -; *************************************************** -; ********* WINDOW DEFINITIONS AND DRAW ************* -; *************************************************** -align 4 -draw_window: - pusha - mov [running_applications],-1 - mov [checks],-1 - mcall 12,1 - - mcall 48,3,system_colours,10*4 - - mov eax, [system_colours+4*6] - sub eax, 0x101010 - mov [wcolor], eax - - mcall 14 ; get screen max x & max y - - cmp [width],0 - je no_def_width - - 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 - sub ax,38 - shl eax,16 - mov ecx,eax - add ecx,0*65536+38 - cmp [graph_text],1 - jne no_text_1 - mov cx,PANEL_HEIGHT - add ecx,20*65536 -;-------------------------------------- -align 4 -no_text_1: - 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 ebx,word [screenxy+2] - mov ecx,0*65536+0 - mov edx,[wcolor] - add edx,0x161616 -;-------------------------------------- -align 4 -newline_: ; debug.inc has macros with the same name - sub edx,0x040404 - mov eax,38 - cmp [soften_up],1 - jne no_su - - and edx,0x00FFFFFF - mcall -;-------------------------------------- -align 4 -no_su: - pusha - cmp [soften_down],1 - jne no_sd - - sub edx,0x141414 - mov edi,[b_size_y] - shl edi,16 - add edi,[b_size_y] - add ecx,edi - sub ecx,3*65536+3 - and edx,0x00FFFFFF - mcall -;-------------------------------------- -align 4 -no_sd: - popa - - add ecx,1*65536+1 - cmp cx,5 - jb newline_ - - cmp [soften_middle],1 - jne no_sm - - movzx ebx,word [screenxy+2] - mov ecx,5*65536+5 - mov esi,stripe - mov edx,[wcolor] -;-------------------------------------- -align 4 -newline3: - add edx,[esi] - add esi,4 - - and edx,0x00FFFFFF - mcall 38 - add ecx,1*65536+1 - cmp cx,15 - jb newline3 -;-------------------------------------- -align 4 -no_sm: - cmp [minimize_left],1 - jne no_mleft - - mov ecx,1 *65536 - add ecx,[b_size_y] - dec ecx - mov edx,101 - add edx,[button_frames] - mcall 8,<0,9>,,,[wcolor] ; ABS LEFT - - mov ebx,2*65536+17 - cmp [graph_text],1 - jne no_y1 - - mov bx,7 -;-------------------------------------- -align 4 -no_y1: - mov ecx,[wcolor] - add ecx,0x303030 - mcall 4,,,hidetext,1 ; HIDE TEXT -;-------------------------------------- -align 4 -no_mleft: - movzx eax,word [screenxy+2] - mov [maxx],eax - cmp [minimize_right],1 - jne no_mright - mov eax,[maxx] - sub eax,77 - shl eax,16 - mov ebx,eax - add ebx,67 - - mov ecx,1 *65536 - add ecx,[b_size_y] - dec ecx - add ebx,68*65536 - mov bx,9 - mov edx,102 - add edx,[button_frames] - mcall 8,,,,[wcolor] ; ABS RIGHT - - mov edx,hidetext+1 - mov eax,4 - mov ebx,[maxx] - sub ebx,6 - shl ebx,16 - mov bx,17 - cmp [graph_text],1 - jne no_y2 - - mov bx,7 -;-------------------------------------- -align 4 -no_y2: - mov ecx,[wcolor] - add ecx,0x303030 - mov esi,1 - mcall -;-------------------------------------- -align 4 -no_mright: - call draw_menuet_icon -; call draw_program_icons - mov [ptime],0 - call draw_info - call draw_application_buttons - - mcall 12,2 - popa - ret -;------------------------------------------------------------------------------ -align 4 -dr_button_clean: - mcall 8,,<3,13> - ret -;------------------------------------------------------------------------------ -align 4 -draw_menuet_icon: - pusha -; 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, 103 - mov ebx, 67*65536+13 - call dr_button_clean - - inc edx - mov ebx, 86*65536+13 - call dr_button_clean - - inc edx - mov ebx, 105*65536+13 - call dr_button_clean - - mov ecx, dword [system_colours+28] - and ecx, 0x00ffffff - mcall 4,<71,6>,,page_clean_but,1 - - inc edx - mcall ,<90,6> - - inc edx - mcall ,<109,6> - - cmp [menu_enable],1 - jne no_menu - - mov ebx, 10*65536 + 47 - cmp [minimize_left], 0 - jne @f - - sub ebx, 10*65536 -;-------------------------------------- -align 4 -@@: - mov ecx, 1*65536 - add ecx, [b_size_y] - dec ecx - mov edx, 0x20d1ff01 - add edx, [button_frames] - mcall 8,,,,[wcolor] ; M BUTTON - -; cmp [graph_text], 1 -; jne no_mtext - - push ebx - mcall 13,<12,44>,<1,17>,0x383838 - - mcall ,<56,1>,<2,15> - - mcall ,<57,1>,<4,11> - - mcall ,<58,1>,<6,7> - - mcall ,<13,43>,<2,15>,0x7700 - - mcall ,<56,1>,<4,11> - - mcall ,<57,1>,<6,7> - pop ebx - - mov bx, 7 - add ebx, 8*65536 - - mcall 4,,0x10ffffff,m_text,4 - - popa - ret -;-------------------------------------- +;------------------------------------------------------------------------------ ;align 4 -;no_mtext: -; mov eax,[wcolor] -; mov [m_icon+4],eax -;; load & display menuet.bmp -; mcall 70,m_bmp_fileinfo - -; mov eax,40 -; mov ebx,0 -; mov edi,image+53 -;-------------------------------------- -;align 4 -;new_m_pix: -; cmp byte [edi], 10 -; jb nopix - -; cmp byte [edi+1], 10 -; jb nopix - -; cmp byte [edi+2], 10 -; jb nopix - +;set_variables: ; pusha -; cmp [minimize_left],0 -; jne no_m_s2 +; mov [button_frames],0x0 +; cmp [buttons],0 +; jne no_frames -; sub ebx,10 +; mov [button_frames],0x40000000 ;-------------------------------------- ;align 4 -;no_m_s2: -; mov edx,[edi+1] -; mov ecx,eax -; add ebx,12 -; mcall 1 ; point - WTF???!!! - -; popa -;-------------------------------------- -;align 4 -;nopix: -; add edi,3 -; add ebx,1 -; cmp ebx,40 -; jnz new_m_pix - -; mov ebx,0 -; dec eax -; jnz new_m_pix -;-------------------------------------- -align 4 -no_menu: - popa - ret -;------------------------------------------------------------------------------ -;align 4 -;draw_program_icons: -; pusha - -; cmp [icons],0 -; jne dp_ret - -; mov edi,1 -; push edi -;-------------------------------------- -;align 4 -;new_icon_file: -; pusha -; mov edx,[esp+32] -; add edx,10 - -; push edx -; mov ecx,1*65536 -; add ecx,[b_size_y] -; dec ecx -; mov eax,edi -; dec eax -; imul eax,40 -; mov ebx,eax -; add ebx,[icons_position] -; shl ebx,16 -; mov bx,39 -; pop edx - -; add edx,[button_frames] -; or edx, 0x20000000 -; mcall 8,,,,[wcolor] -; popa - -; mov ecx,[esp] -; add ecx,48 -; mov [iconf+6],cl - -; mcall 70,iconf_fileinfo - -; mov eax,0 -; mov ebx,32 -; mov edi,image+51+32*33*3 -;-------------------------------------- -;align 4 -;np2: ; new pixel of file -; mov edx,[edi] -; and edx,0xffffff - -; cmp eax,3 ; Y draw limits -; jb nopix2 - -; cmp eax,36 -; jg nopix2 - -; cmp ebx,38 ; X draw limits -; jg nopix2 - -; cmp ebx,2 -; jb nopix2 - -; cmp edx,0 -; jz nopix2 - -; cmp [graph_text],1 -; jne no_icon_text - -; pusha -; mov ebx,[esp+32] -; dec ebx -; imul ebx,40 -; add ebx,8 -; add ebx,[icons_position] -; shl ebx,16 -; mov bx,7 - -; mov edx,[esp+32] -; dec edx -; imul edx,4 -; add edx,mi_text -; mcall 4,,0xffffff,,4 -; popa -; jmp nopix2 -;-------------------------------------- -;align 4 -;no_icon_text: -; mov esi,[esp] -; pusha - -; push edx -; mov ecx,eax -; add ecx,2 -; mov eax,esi -; dec eax -; imul eax,40 -; add ebx,eax -; add ebx,3 -; add ebx,[icons_position] -; pop edx - -; mcall 1 ; WTF???!!! -; popa -;-------------------------------------- -;align 4 -;nopix2: -; sub edi,3 -; dec ebx -; jnz np2 - -; mov ebx,32 -; add eax,1 -; cmp eax,32 -; jnz np2 - -; add dword [esp],1 -; mov edi,[esp] -; cmp dword [esp],4 -; jbe new_icon_file - -; add esp,4 - -; mov ebx,40 -; imul ebx,3 -; add ebx,[icons_position] -; add ebx,10 -; shl ebx,16 -; mov bx,23 -; mcall 4,,[wcolor],gpl,3 -;-------------------------------------- -;align 4 -;dp_ret: +;no_frames: +; mcall 48,1,1 ; 3d button look ; popa ; ret -;------------------------------------------------------------------------------ -align 4 -draw_info: ; draw cpu usage, time, date - pusha - cmp [setup_enable],1 - jne no_setup - - cmp [minimize_right],0 - jne no_m_r - add [maxx],10 -;-------------------------------------- -align 4 -no_m_r: - mov eax,3 - mcall - cmp eax,[ptime] - jz _ret - - mov [ptime],eax - - call draw_cpu_usage - - mov eax,[maxx] ; blink sec - sub eax,33 - shl eax,16 - mov ebx,eax - add ebx,9 - mcall 3 - - cmp [graph_text],1 - jne no_y4 - - sub bx,2 -;-------------------------------------- -align 4 -no_y4: - mov ecx,eax - shr ecx,16 - and ecx,1 - mov edx,[bte] - sub edx,time_bgr_color;[wcolor] - imul ecx,edx - add ecx,time_bgr_color;[wcolor] - - mcall 4,,,sec,1 - - mcall 26,2,9 - - mov edx,eax - mcall 3 - - and eax,0xffff - add edx,eax - cmp edx,[checks] - je _ret - - mov [checks],edx - - mov ebx,[maxx] - sub ebx,48 ;;94 ;;74 - shl ebx,16 - add ebx,33 ;;84 ;;64 - - mov ecx,3 *65536 - add ecx,[b_size_y] - sub cx,5 - mcall 8,,,0x40000002,[wcolor] ; time/date button - - and edx,0xffff - add edx,[button_frames] - mcall - - mov ebx,[maxx] - sub ebx,77 ;80 - shl ebx,16 - add ebx,14 - - mcall ,,<4,12>,0x60000010,[wcolor] ;button 16 - - sub ebx,17 shl 16 - inc edx ;button 17 - - add ebx,33 shl 16 - mov bx,8 - inc edx ;button 18 - mcall - - sub ebx,30 shl 16 - mov bx,10 - inc edx ;button 19 - mcall - - sub ebx,14 shl 16 - inc edx ;button 20 - mcall - - sub ebx,12 shl 16 - mov bx,8 - mov ecx,6 shl 16+10 - inc edx ;button 21 - mcall - - sub ebx,24 shl 16 - inc edx ;button 22 - mcall - - mcall 26,2,9 - - mov ebx,eax - - mov eax,2 - mov [type_lang],al - call draw_flag - - mcall 18,8,1 - - mov [sound_flag],al - - mov ebx,[maxx] - sub ebx,92 ;109 ;112 ;28 - shl ebx,16 - mov bx,12 - xor edx,edx - mcall 13,,<4,13> - - add ebx,1 shl 16 - sub bx,2 - mcall ,,<5,11>,0xcc - - add ebx,1 shl 16 - mov bx,5 - mcall ,,<8,5>,0xdddd00 - - add ebx,5 shl 16 - mov bx,1 - mcall ,,<7,7> - - add ebx,1 shl 16 - mcall ,,<6,9> - - add ebx,1 shl 16 - mcall ,,<5,11> - - cmp [sound_flag],0 - je dalshe - - sub ebx,8 shl 16 - ror ebx,16 - mov cx,bx - rol ebx,16 - mov bx,cx - add bx,8 - mcall 38,,<5,15>,0xff0000 - - add ebx,1 shl 16 - inc bx - mcall - - rol ecx,16 - mcall - - sub ebx,1 shl 16 - dec bx - mcall -;-------------------------------------- -align 4 -dalshe: - mov ebx,[maxx] - sub ebx,106;123 - shl ebx,16 - mov bx,12 - xor edx,edx - mcall 13,,<4,13> - - add ebx,1 shl 16 - sub bx,2 - mcall ,,<5,11>,0xffcc00 - - mov ebx,[maxx] - sub ebx,104;121 - shl ebx,16 - mov bx,7 - - mcall 4,,0x10000000,file_sys,1 - - add ebx,1 shl 16 - mcall - - mov ebx,[maxx] - sub ebx,117;134 - shl ebx,16 - mov bx,9 - xor edx,edx - mcall 13,,<6,11> - - sub ebx,24 shl 16 ; 18 shl 16 - mcall - - add ebx,25 shl 16 ; 19 shl 16 - sub bx,2 - mcall ,,<7,9>,0xffffff - - sub ebx,24 shl 16 - mcall - - mov ebx,[maxx] - sub ebx, 139 - shl ebx,16 - mov bx,8 - mcall 4,,,page_a1,5 - - add ebx,1 shl 16 - mcall - - mov edx,[maxx] - sub edx,130 - shl edx,16 - mov dx,7 - mcall 47,0x20000,[page_list],,0xffffff - - mcall 3 ; get time - - 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 - - mov eax,[maxx] - sub eax,32 - shl eax,16 - mov ebx,eax - add ebx,9 - - mov ecx,[bte] - - cmp [graph_text],1 - jne no_y3 - - sub bx,2 -;-------------------------------------- -align 4 -no_y3: - mov edx,[esp] ; __:_X - and edx,15 - add ebx,10*65536 - add edx,text - mcall 4,,0xffffff,,1 - - pop edx ; __:X_ - shr edx,4 - and edx,15 - sub ebx,6*65536 - add edx,text - mcall - - mov edx,[esp] ; _X:__ - and edx,15 - sub ebx,11*65536 - add edx,text - mcall - - pop edx ; X_:__ - shr edx,4 - and edx,15 - sub ebx,6*65536 - add edx,text - mcall - - call draw_cpu_usage -;-------------------------------------- -align 4 -_ret: - cmp [minimize_right],0 - jne no_m_r2 - - sub [maxx],10 -;-------------------------------------- -align 4 -no_m_r2: -no_setup: - popa - ret -;------------------------------------------------------------------------------ -align 4 -draw_cpu_usage: - pushad - mov [ysi],30 - cmp [graph_text],1 - jne @f - - mov [ysi],12 -;-------------------------------------- -align 4 -@@: - mcall 18,5 ; TSC / SEC - - shr eax,20 - push eax - mcall 18,4 ; IDLE / SEC - - shr eax,20 - xor edx,edx - imul eax,[ysi] - cdq - pop ebx - inc ebx - div ebx - cmp eax,[ysi] - jng no_bug - - mov eax,[ysi] -;-------------------------------------- -align 4 -no_bug: - push eax - - mov ebx,[maxx] - sub ebx,60 - shl ebx,16 - add ebx,8 - mov ecx,5 shl 16 - add ecx,[ysi] - mcall 13,,,0xdd2222 - - pop eax - mov ecx,5 shl 16 - add ecx,eax - mov eax,13 - mcall 13,,,0x44aa44 - - popad - ret -;------------------------------------------------------------------------------ -align 4 -include 'ctx_menu.asm' -;------------------------------------------------------------------------------ -align 4 -; DATA -stripe: - 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 - - -lsz m_text,\ - ru, "МЕНЮ",\ - en, "MENU",\ - et, "MEN--" - -mi_text db 'WAVETETRBGRDGPL ' - -flag_text db 'EnFiGeRuFrEtUa' - -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 -draw_window_1 db 0 - -b_size_y: dd 0x0 -ysi dd 0 -small_draw dd 0x0 - -ptime dd 0x0 -maxx dd 0x0 -text db '0123456789' - -page_a1 db '< >' -page_clean_but db 25,24,18 - -bte dd 0xccddee - -wcolor dd 0x506070 - -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 - -exec_fileinfo: - dd 7 - dd 0 - dd 0 - dd 0 - dd 0 - db 0 -.name dd 0 - -end_name db '/sys/END',0 -menu_name db '/sys/@MENU',0 -calendar_name db '/sys/CALENDAR',0 -sysmeter_name db '/sys/GMON',0 -mousemul_name db '/sys/MOUSEMUL',0 - -dat_fileinfo: - dd 0 - dd 0 - dd 0 - dd 1024 - dd 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 -;------------------------------------------------------------------------------ -IM_END: -;------------------------------------------------------------------------------ -align 4 -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 - -panel_x_pos rd 1 -panel_y_pos rd 1 - -screen_size: -.height rw 1 -.width rw 1 -;------------------------------------------------------------------------------ -align 4 -system_colours system_colors ; rd 10 -;------------------------------------------------------------------------------ -align 4 -app_list rd 50 -;------------------------------------------------------------------------------ -align 4 -alt_tab_list rd 256*2 -;------------------------------------------------------------------------------ -align 4 -process_info_buffer: - rb 1024 -;------------------------------------------------------------------------------ -align 4 -procinfo_for_detect: - rb 1024 -;------------------------------------------------------------------------------ -align 4 -procinfo_window_tabs: - rb 1024 -;----------------------------------------------------------------------------- -align 4 -tictable: - rd 256 -;------------------------------------------------------------------------------ -align 4 - rb 256 -detect_stack: -;------------------------------------------------------------------------------ -align 4 - rb 256 -ctx_menu_stack: ;------------------------------------------------------------------------------ -align 4 - rb 0x1000 -stack_top: -;------------------------------------------------------------------------------ -;align 4 -;image: -;------------------------------------------------------------------------------ -I_END: \ No newline at end of file +include 'libini.inc' +;------------------------------------------------------------------------------ +include 'dll.inc' +;------------------------------------------------------------------------------ +include 'drawappl.inc' +;------------------------------------------------------------------------------ +include 'drawbutt.inc' +;------------------------------------------------------------------------------ +include 'drawwind.inc' +;------------------------------------------------------------------------------ +include 'drawtray.inc' +;------------------------------------------------------------------------------ +include 'ctx_menu.asm' +;------------------------------------------------------------------------------ +include 'i_data.inc' +;------------------------------------------------------------------------------ +IM_END: +;------------------------------------------------------------------------------ +include 'u_data.inc' +;------------------------------------------------------------------------------ +I_END: +;------------------------------------------------------------------------------ diff --git a/programs/system/panel/trunk/MOI.INC b/programs/system/panel/trunk/MOI.INC index 5f64cfbcda..051bfc9467 100644 --- a/programs/system/panel/trunk/MOI.INC +++ b/programs/system/panel/trunk/MOI.INC @@ -124,6 +124,8 @@ fir_lng: ;------------------------------------------------------------------------------ align 4 karu: + mov [draw_flag_certainly],1 + add [key_r2],1 cmp [key_r2],3 jb .altes @@ -166,6 +168,8 @@ align 4 ;------------------------------------------------------------------------------ align 4 alter: + mov [draw_flag_certainly],1 + cmp [key_r],0 je .alt_1 diff --git a/programs/system/panel/trunk/debug.inc b/programs/system/panel/trunk/debug.inc new file mode 100644 index 0000000000..15ea290d3b --- /dev/null +++ b/programs/system/panel/trunk/debug.inc @@ -0,0 +1,147 @@ +macro debug_print str +{ + local ..string, ..label + + jmp ..label + ..string db str,0 + ..label: + + pushf + pushad + mov edx,..string + call debug_outstr + popad + popf +} + +dps fix debug_print + +macro debug_print_dec arg +{ + pushf + pushad + if ~arg eq eax + mov eax,arg + end if + call debug_outdec + popad + popf +} + +dpd fix debug_print_dec + +;--------------------------------- +debug_outdec: ;(eax - num, edi-str) + push 10 ;2 + pop ecx ;1 + push -'0' ;2 + .l0: + xor edx,edx ;2 + div ecx ;2 + push edx ;1 + test eax,eax ;2 + jnz .l0 ;2 + .l1: + pop eax ;1 + add al,'0' ;2 + call debug_outchar ; stosb + jnz .l1 ;2 + ret ;1 +;--------------------------------- + +debug_outchar: ; al - char + pushf + pushad + mov cl,al + mov eax,63 + mov ebx,1 + int 0x40 + popad + popf +ret + +debug_outstr: + mov eax,63 + mov ebx,1 + @@: + mov cl,[edx] + test cl,cl + jz @f + int 40h + inc edx + jmp @b + @@: + ret + +_debug_crlf db 13, 10, 0 + +macro newline_1 +{ + pushf + pushad + mov edx, _debug_crlf + call debug_outstr + popad + popf +} + +macro newline +{ + pushf + pushad + mov edx, _debug_crlf + call debug_outstr + popad + popf +} + +macro print message +{ + dps message + newline +} + +macro pregs +{ + dps "EAX: " + dpd eax + dps " EBX: " + dpd ebx + newline + dps "ECX: " + dpd ecx + dps " EDX: " + dpd edx + newline +} + +macro debug_print_hex arg +{ + pushf + pushad + if ~arg eq eax + mov eax, arg + end if + call debug_outhex + popad + popf +} +dph fix debug_print_hex + +debug_outhex: + ; eax - number + mov edx, 8 + .new_char: + rol eax, 4 + movzx ecx, al + and cl, 0x0f + mov cl, [__hexdigits + ecx] + pushad + mcall 63, 1 + popad + dec edx + jnz .new_char +ret + +__hexdigits: + db '0123456789ABCDEF' \ No newline at end of file diff --git a/programs/system/panel/trunk/dll.inc b/programs/system/panel/trunk/dll.inc new file mode 100644 index 0000000000..aceef7ac97 --- /dev/null +++ b/programs/system/panel/trunk/dll.inc @@ -0,0 +1,144 @@ +;----------------------------------------------------------------------------- +proc dll.Load, import_table:dword + mov esi,[import_table] +.next_lib: + mov edx,[esi] + or edx,edx + jz .exit + push esi + mov esi,[esi+4] + mov edi,s_libdir.fname +@@: + lodsb + stosb + or al,al + jnz @b + mcall 68,19,s_libdir + or eax,eax + jz .fail + stdcall dll.Link,eax,edx + stdcall dll.Init,[eax+4] + pop esi + add esi,8 + jmp .next_lib +.exit: + xor eax,eax + ret +.fail: + add esp,4 + xor eax,eax + inc eax + ret +endp +;----------------------------------------------------------------------------- +proc dll.Link, exp:dword,imp:dword + push eax + mov esi,[imp] + test esi,esi + jz .done +.next: + lodsd + test eax,eax + jz .done + stdcall dll.GetProcAddress,[exp],eax + or eax,eax + jz @f + mov [esi-4],eax + jmp .next +@@: + mov dword[esp],0 +.done: + pop eax + ret +endp +;----------------------------------------------------------------------------- +proc dll.Init, dllentry:dword + pushad + mov eax,mem.Alloc ;libini_alloc + mov ebx,mem.Free ;libini_free + mov ecx,mem.ReAlloc ;libini_realloc + mov edx,dll.Load + stdcall [dllentry] + popad + ret +endp +;----------------------------------------------------------------------------- +proc dll.GetProcAddress, exp:dword,sz_name:dword + mov edx,[exp] + xor eax,eax +.next: + or edx,edx + jz .end + cmp dword[edx],0 + jz .end + stdcall strcmp,[edx],[sz_name] + test eax,eax + jz .ok + add edx,8 + jmp .next +.ok: + mov eax,[edx+4] + .end: + ret +endp +;----------------------------------------------------------------------------- +proc strcmp, str1:dword,str2:dword + push esi edi + mov esi,[str1] + mov edi,[str2] + xor eax,eax +@@: + lodsb + scasb + jne .fail + or al,al + jnz @b + jmp .ok +.fail: + or eax,-1 +.ok: + pop edi esi + ret +endp +;----------------------------------------------------------------------------- +s_libdir: + db '/sys/lib/' + .fname rb 32 +;----------------------------------------------------------------------------- +proc mem.Alloc,size + push ebx ecx + mov ecx,[size] + mcall 68,12 + pop ecx ebx + ret +endp +;----------------------------------------------------------------------------- +proc mem.ReAlloc,mptr,size + push ebx ecx edx + mov ecx,[size] + or ecx,ecx + jz @f +@@: + mov edx,[mptr] + or edx,edx + jz @f +@@: + mcall 68,20 + or eax,eax + jz @f +@@: + pop edx ecx ebx + ret +endp +;----------------------------------------------------------------------------- +proc mem.Free,mptr + push ebx ecx + mov ecx,[mptr] + or ecx,ecx + jz @f +@@: + mcall 68,13 + pop ecx ebx + ret +endp +;----------------------------------------------------------------------------- \ No newline at end of file diff --git a/programs/system/panel/trunk/drawappl.inc b/programs/system/panel/trunk/drawappl.inc new file mode 100644 index 0000000000..ba639f65f2 --- /dev/null +++ b/programs/system/panel/trunk/drawappl.inc @@ -0,0 +1,196 @@ +;------------------------------------------------------------------------------ +align 4 +draw_running_applications: + pusha + + cmp [run_appl],dword 0 + je .exit + + call calculate_applications + + cmp edi,[running_applications] + jne .noret + popa + ret +;-------------------------------------- +align 4 +.noret: + call draw_window + mov [running_applications],edi + call redraw_window_tabs +;-------------------------------------- +align 4 +.exit: + popa + ret +;------------------------------------------------------------------------------ +align 4 +need_window_tab: +; in: ebx->process info +; out: ZF set <=> do not draw + cmp byte [ebx+10], '@' + jz .nodraw +; do not draw undefined (zero-sized) windows + cmp dword [ebx+42], 0 + jnz @f + cmp dword [ebx+46], 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 + + mov edi, dword [ebx+14] + or edi, 0x20202020 + cmp dword [ebx+14], 'dial' + jne @f + + pop edi + jmp .nodraw +;-------------------------------------- +align 4 +@@: + pop edi + cmp dword [ebx+10], 'ICON' + jnz @f + + cmp [ebx+42], dword 51 + jnz @f + + cmp [ebx+46], dword 51 + jz .nodraw +;-------------------------------------- +align 4 +@@: + cmp [ebx+10], dword ' ' +;-------------------------------------- +align 4 +.nodraw: + ret +;------------------------------------------------------------------------------ +align 4 +calculate_applications: + mov eax,[max_applications] + mul [page_list] + test eax,eax + je @f + + inc eax +;-------------------------------------- +align 4 +@@: + mov [draw_start_position],eax + + mov edi,app_list + mov ecx,20 ; show max 20 application ???!!! + mov eax,-1 + cld + rep stosd + + mov edi,0 + mov ecx,2 +;-------------------------------------- +align 4 +cnewpr: + mcall 9,procinfo_window_tabs + + call need_window_tab + jz cnorpl + + sub [draw_start_position], 1 + jg cnorpl + + mov [app_list+edi*4],ecx + inc edi +;-------------------------------------- +align 4 +cnorpl: + inc ecx + cmp eax,ecx + jge cnewpr + + mov [app_tab_count], edi + ret +;------------------------------------------------------------------------------ +align 4 +redraw_window_tabs: + xor edi, edi + mov [contrast], 0 + + 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 [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 + + call calculate_button_y_coordinate_and_size + + push edi + mov edx,[system_colours.work_button] + xor edi,edi + + cmp ebp,[active_slot_number] ;ecx ; ecx=active slot number + jnz @f + + mov edx,[wcolor] + inc edi +;-------------------------------------- +align 4 +@@: + mov esi,[current_alt_tab_app] + cmp esi,-1 + jz @f + + cmp ecx,[alt_tab_list+esi*8] + jnz @f + + mov edx,0xFF8000 ; current select for ALT+Tab +;-------------------------------------- +align 4 +@@: + mov esi,[wcolor] + call draw_appl_button + pop edi +;------------------------------------------------------------------------------ + add ebx,5 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 +;-------------------------------------- +align 4 +.nodraw: + inc edi + cmp edi, [max_applications] + jb .loop +;-------------------------------------- +align 4 +.done: + pop ebp + ret +;------------------------------------------------------------------------------ diff --git a/programs/system/panel/trunk/drawbutt.inc b/programs/system/panel/trunk/drawbutt.inc new file mode 100644 index 0000000000..494a8a552a --- /dev/null +++ b/programs/system/panel/trunk/drawbutt.inc @@ -0,0 +1,180 @@ +;------------------------------------------------------------------------------ +align 4 +draw_appl_button: +; in: +; ebx = [x]*65536 + [size x] +; ecx = [y]*65536 + [size y] +; edx = internal color 0xRRGGBB +; esi = external color 0xRRGGBB +; edi = 0 up or 1 down +COLOR_CHANGE_MAGNITUDE_0 = 0x080808 +COLOR_CHANGE_MAGNITUDE = 0x101010 +COLOR_CHANGE_MAGNITUDE_1 = 0x202020 +COLOR_CHANGE_MAGNITUDE_2 = 0x404040 + pusha + add ebx,2 shl 16 + sub bx,4 + add ecx,2 shl 16 + sub cx,4 + mcall 13 +;------------------------------------------------------------------------------ +; mov edx,esi + test edi,edi + jnz @f + + mov eax,COLOR_CHANGE_MAGNITUDE + call add_color_change_magnitude + jmp .1 +;-------------------------------------- +align 4 +@@: + mov eax,COLOR_CHANGE_MAGNITUDE + call subtract_color_change_magnitude +;-------------------------------------- +align 4 +.1: + call draw_four_extreme_lines +;------------------------------------------------------------------------------ + mov edx,esi + mov eax,COLOR_CHANGE_MAGNITUDE_2 + call subtract_color_change_magnitude + sub ecx,1 shl 16 + add ecx,2 + sub ebx,1 shl 16 + add ebx,2 + call draw_four_extreme_lines +;------------------------------------------------------------------------------ + popa + ret +;------------------------------------------------------------------------------ +align 4 +draw_four_extreme_lines: +; top left point + push ebx ecx + shr ebx,16 + shr ecx,16 + mcall 1 + pop ecx ebx +; bottom right point + push ebx ecx + movzx eax,bx + shr ebx,16 + add ebx,eax + dec ebx + movzx eax,cx + shr ecx,16 + add ecx,eax + dec ecx + mcall 1 + pop ecx ebx +;-------------------------------------- +; bottom left point + push ebx ecx + shr ebx,16 + movzx eax,cx + shr ecx,16 + add ecx,eax + dec ecx + mcall 1 + pop ecx ebx +;-------------------------------------- +; top right point + push ebx ecx + movzx eax,bx + shr ebx,16 + add ebx,eax + dec ebx + shr ecx,16 + mcall 1 + pop ecx ebx +;-------------------------------------- +; top line + push ecx + sub ecx,1 shl 16 + mov cx,1 + mcall 13 + pop ecx +; bottom line + push ecx + mov ax,cx + shl eax,16 + add ecx,eax + mov cx,1 + mcall 13 + pop ecx +; left line + push ebx + sub ebx,1 shl 16 + mov bx,1 + mcall 13 + pop ebx +; right line + push ebx + mov ax,bx + shl eax,16 + add ebx,eax + mov bx,1 + mcall 13 + pop ebx + + ret +;------------------------------------------------------------------------------ +align 4 +subtract_color_change_magnitude: +; in: +; edx = original color +; eax = magnitude +; out: +; edx = processed color + sub dl,al + jae @f + xor dl,dl +@@: + ror edx,8 + ror eax,8 + sub dl,al + jae @f + xor dl,dl +@@: + ror edx,8 + ror eax,8 + sub dl,al + jae @f + xor dl,dl +@@: + rol edx,16 + ret +;------------------------------------------------------------------------------ +align 4 +add_color_change_magnitude: +; in: +; edx = original color +; eax = magnitude +; out: +; edx = processed color + add dl,al + jae @f + mov dl,0xff +@@: + ror edx,8 + ror eax,8 + add dl,al + jae @f + mov dl,0xff +@@: + ror edx,8 + ror eax,8 + add dl,al + jae @f + mov dl,0xff +@@: + rol edx,16 + ret +;------------------------------------------------------------------------------ +calculate_button_y_coordinate_and_size: + mov ecx,[button_top_offset] + shl ecx,16 + add ecx,[height] + sub ecx,[button_top_offset] + sub ecx,[button_bottom_offset] + ret \ No newline at end of file diff --git a/programs/system/panel/trunk/drawtray.inc b/programs/system/panel/trunk/drawtray.inc new file mode 100644 index 0000000000..51011c2944 --- /dev/null +++ b/programs/system/panel/trunk/drawtray.inc @@ -0,0 +1,421 @@ +;------------------------------------------------------------------------------ +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 + call draw_time + + mov [draw_flag_certainly],1 + call draw_flag ; language + + call draw_list_button +;-------------------------------------- +;align 4 +;no_setup: + 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 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-2 + mov [pos_x_clock],ebx + mcall ,,,0x40000000+2 ; time/date button +;-------------------------------------- +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-2 + mov [pos_x_cpu_usage],ebx + mcall ,,,0x40000000+18 ;button 18 - sysmeter_name (GMON) +;-------------------------------------- +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-2 + mov [pos_x_cpu_chlang],ebx + mcall ,,,0x40000000+16 ;button 16 - chang language +;-------------------------------------- +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 ,,,0x40000000+22 ;button 22 - page list decrease + + add ebx,24 shl 16 + + mcall ,,,0x40000000+21 ;button 21 - page list decrease +;-------------------------------------- +align 4 +@@: + ret +;------------------------------------------------------------------------------ +draw_time_skin: + cmp [clock_enable],dword 0 + je .exit + + + 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 +;------------------------------------------------------------------------------ +draw_time: + cmp [clock_enable],dword 0 + je .exit + + mcall 3 + cmp eax,[ptime] + jz .exit + + 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 + + mov ebx,[pos_x_clock] + call calculate_button_y_coordinate_and_size + movzx eax,cx + shr eax,1 + sub eax,4 + shr ecx,16 + add eax,ecx + mov bx,ax + + add ebx,18 shl 16 + + mov ecx,[bte] + mov edx,[esp] ; __:_X + and edx,15 + add ebx,10*65536 + add edx,text + mcall 4,,0x40ffffff,,1,[Clock_color] ;time_bgr_color + + pop edx ; __:X_ + shr edx,4 + and edx,15 + sub ebx,6*65536 + add edx,text + mcall + + mov edx,[esp] ; _X:__ + and edx,15 + sub ebx,11*65536 + add edx,text + mcall + + 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 + movzx eax,cx + shr eax,1 + sub eax,4 + 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] + 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 +draw_list_button: + cmp [page_list_enable],dword 0 + je .exit +; draw page list button "skin" + mov ebx,[pos_x_page_list] + mov bx,10 + + 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 + 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],,0xffffff +.exit: + ret +;------------------------------------------------------------------------------ +align 4 +draw_cpu_usage: + cmp [cpu_usage_enable],dword 0 + je .exit + + 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 + + shr eax,20 + push eax + mcall 18,4 ; IDLE / SEC + + shr eax,20 + xor edx,edx + imul eax,[ysi] + cdq + pop ebx + inc ebx + div ebx + cmp eax,[ysi] + jng .no_bug + + 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 +.exit: + ret +;------------------------------------------------------------------------------ +align 4 +; eax = number (1 or 2) +; ebx = language id +draw_flag: + cmp [chlang_enable],dword 0 + je .exit + + cmp [draw_flag_certainly],0 + je .exit + + pusha +;-------------------------------------- +; get and draw keyboard layout + mcall 26,2,9 + + mov ebx,eax + +; mov eax,2 + 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] + mov ax,bx + shr eax,1 + shl eax,16 + add ebx,eax + sub ebx,6 shl 16 + + call calculate_button_y_coordinate_and_size + movzx eax,cx + shr eax,1 + sub eax,4 + shr ecx,16 + add eax,ecx + mov bx,ax + + mov ecx,[bte] ; color + +if caps_lock_check +; make flag_text 'enfigerufretua' or 'ENFIGERUFRETUA' depending on CapsLock state. + call flag_text_setup +end if + dec edx + shl edx,1 + add edx,flag_text + mcall 4,,,,2 + popa + mov [draw_flag_certainly],0 +.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/panel/trunk/drawwind.inc b/programs/system/panel/trunk/drawwind.inc new file mode 100644 index 0000000000..68223b72c7 --- /dev/null +++ b/programs/system/panel/trunk/drawwind.inc @@ -0,0 +1,445 @@ +;------------------------------------------------------------------------------ +; *************************************************** +; ********* WINDOW DEFINITIONS AND DRAW ************* +; *************************************************** +align 4 +draw_window: + pusha + mov [running_applications],-1 + mcall 12,1 + + mcall 48,3,system_colours,10*4 + + mov eax, [system_colours+4*6] + sub eax, 0x101010 + mov [wcolor], eax + + mcall 14 ; get screen max x & max y + + cmp [width],dword 0 + je no_def_width + + 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 + + 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 +;-------------------------------------- +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 + + 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 + + mcall 12,2 + popa + ret +;------------------------------------------------------------------------------ +align 4 +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 + cmp [soften_up],dword 0 + 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 + and edx,0x00FFFFFF + mcall 38 + + add ecx,1*65536+1 + cmp cx,[soften_height] ;5 + jb @r +;-------------------------------------- +align 4 +no_su: + 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 +@@: + 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 + + add ecx,[soften_height] + rol ecx,16 + add ecx,[soften_height] +;-------------------------------------- +align 4 +@@: +; mov esi,stripe + mov edx,[wcolor] +;-------------------------------------- +align 4 +newline3: + and edx,0x00FFFFFF + mov eax,[height] + cmp [soften_up],dword 0 + je @f + + sub eax,[soften_height] +;-------------------------------------- +align 4 +@@: + cmp [soften_down],dword 0 + je @f + + sub eax,[soften_height] +;-------------------------------------- +align 4 +@@: + mov cx,ax + inc ebx + mcall 13 + ret +;------------------------------------------------------------------------------ +align 4 +minimize_left_button: + cmp [minimize_left],dword 0 + je .exit + + mov ecx,1 *65536 + add ecx,[height] + dec ecx + mov edx,101 +; add edx,[button_frames] + 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 ecx,[wcolor] + add ecx,0x303030 + mcall 4,,,hidetext,1 ; HIDE TEXT +;-------------------------------------- +align 4 +.exit: + ret +;------------------------------------------------------------------------------ +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 + + mov ecx,1 *65536 + add ecx,[height] + dec ecx + add ebx,68*65536 + mov bx,9 + mov edx,102 +; add edx,[button_frames] + 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 ecx,[wcolor] + add ecx,0x303030 + mov esi,1 + mcall 4,,,hidetext+1 +;-------------------------------------- +align 4 +.exit: + ret +;------------------------------------------------------------------------------ +align 4 +draw_menu_and_clean_desktop: + pusha +; check draw for menu + cmp [menu_enable],dword 0 + je no_menu +; calculate and draw menu + mov ebx, (0 shl 16) + MENU_SIZE-3 +; check for left minimize button enabled + cmp [minimize_left],dword 0 + je @f + + add ebx, ML_SIZE shl 16 +;-------------------------------------- +align 4 +@@: + call calculate_button_y_coordinate_and_size + mov edx, 0x40d1ff01 +; mov edx, 0xd1ff01 +; add edx, [button_frames] + 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,[MenuButton_color] ;0x44aa44 + mov esi,[wcolor] + call draw_appl_button + + add ebx, 8*65536 + mov bx,[height] + shr bx,1 + sub bx,3 + mcall 4,,0x10ffffff,m_text,4 +;-------------------------------------- +align 4 +no_menu: +; check draw for clean desktop button + 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 + + 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 +;-------------------------------------- +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, 0x40000000 + 103 + call calculate_button_y_coordinate_and_size + mcall 8 ;,,<3,13> + + 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,0xffffff + add ebx,5 shl 16 +; mov bx,6 + 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 +;------------------------------------------------------------------------------ +align 4 +draw_application_buttons: + pusha + + cmp [run_appl],dword 0 ; do not draw application buttons + je .exit + + call calculate_offset_X + +; mcall 14 + mov eax,[screenxy] + 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 + + sub eax, MR_SIZE +;-------------------------------------- +align 4 +@@: + cmp [clock_enable],dword 0 + je @f + + sub eax,CLOCK_SIZE +;-------------------------------------- +align 4 +@@: + cmp [cpu_usage_enable],dword 0 + je @f + + sub eax,CPU_USAGE_SIZE +;-------------------------------------- +align 4 +@@: + cmp [chlang_enable],dword 0 + je @f + + sub eax,CHLANG_SIZE +;-------------------------------------- +align 4 +@@: + cmp [page_list_enable],dword 0 + je @f + + sub eax,PAGE_LIST_SIZE +;-------------------------------------- +align 4 +@@: + 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, 1*65536 + add ecx, [height] + sub ecx,3 + mcall 8,,,,[wcolor] + + inc edi + cmp edi,[max_applications] + jb .nb +;-------------------------------------- +align 4 +.exit: + popa + ret +;------------------------------------------------------------------------------ +align 4 +calculate_offset_X: + push eax + xor eax,eax +; check for left minimize button enabled + cmp [minimize_left],dword 0 + je @f + + add eax, ML_SIZE +;-------------------------------------- +align 4 +@@: +; check for menu button enabled + 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 + + add eax, CLD_SIZE +;-------------------------------------- +align 4 +@@: + mov [offset_X],eax + pop eax + ret +;------------------------------------------------------------------------------ diff --git a/programs/system/panel/trunk/i_data.inc b/programs/system/panel/trunk/i_data.inc new file mode 100644 index 0000000000..1fc5084b62 --- /dev/null +++ b/programs/system/panel/trunk/i_data.inc @@ -0,0 +1,249 @@ +;------------------------------------------------------------------------------ +align 4 +; DATA +stripe: + 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 + + +lsz m_text,\ + ru, "МЕНЮ",\ + en, "MENU",\ + et, "MEN--" + +mi_text db 'WAVETETRBGRDGPL ' + +flag_text db 'EnFiGeRuFrEtUa' + +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 +draw_window_1 db 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 0xccddee + +wcolor dd 0x506070 + +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 + +exec_fileinfo: + dd 7 + dd 0 + dd 0 + dd 0 + dd 0 + db 0 +.name dd 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 + +;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 + +;-------------------------------------- +menu_button_x: +.start dd 1234 ;0xffff +.size dd 0x999 +;-------------------------------------- +menu_button_y: +.start dd 0xaa +.size dd 0xc +;-------------------------------------- +;------------------------------------------------------------------------------ +; INI variables +width: dd 0 ;305 +height: dd 30 ;18 +soften_height: dd 5 +button_top_offset: dd 3 +button_bottom_offset: dd 3 +;------------------------------------------------------------------------------ +; 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 1 +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 +run_appl: dd 1 ; 0 defaults ; 1 activate +clean_desktop_enable: dd 1 +clock_enable: dd 1 +cpu_usage_enable: dd 1 +chlang_enable: dd 1 +page_list_enable: dd 1 +place_attachment dd 1 +button_style dd 1 +;------------------------------------------------------------------------------ +; INI colors +MenuButton_color dd 0x44aa44 ; Green +CleanDesktopButton_color dd 0x66cc ; Blue +Clock_color dd 0x66cc ; Blue +CpuUsage_color dd 0x44aa44 ; Green +CpuUsageBckgr_color dd 0xdd2222 ; Red +ChangeLang_color dd 0x66cc ; Blue +PageList_color dd 0xffffff ; White +;------------------------------------------------------------------------------ +aVariables db 'Variables',0 +aPanelHeight db 'PanelHeight',0 +aPanelWidth db 'PanelWidth',0 +aSoftenHeight db 'SoftenHeight',0 +aButtonTopOffset db 'ButtonTopOffset',0 +aButtonBottomOffset db 'ButtonBottOffset',0 +;------------------------------------------------------------------------------ +aFlags db 'Flags',0 +aSoftenUp db 'SoftenUp',0 +aSoftenDown db 'SoftenDown',0 +aMinimizeLeftButton db 'MinLeftButton',0 +aMinimizeRightButton db 'MinRightButton',0 +aMenuButton db 'MenuButton',0 +aRunApplButtons db 'RunApplButtons',0 +aCleanDesktopButton db 'ClnDesktButton',0 +aClock db 'Clock',0 +aCpuUsage db 'CpuUsage',0 +aChangeLang db 'ChangeLang',0 +aPageList db 'PageList',0 +aAttachment db 'Attachment',0 +aButtonsStyle db 'ButtonsStyle',0 +;------------------------------------------------------------------------------ +aColors db 'Colors',0 +aCpuUsageBckgr db 'CpuUsageBckgr',0 +;------------------------------------------------------------------------------ +plugins_directory db 0 + +ini_file_name db 'panel.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 +;------------------------------------------------------------------------------ +l_libs_start: + +library02 l_libs system_dir_Libini+9, path, library_path, system_dir_Libini, \ +err_message_found_lib2, head_f_l, Libini_import, err_message_import2, head_f_i, plugins_directory + +end_l_libs: +;------------------------------------------------------------------------------ +align 4 +Libini_import: +lib_init dd aLib_init +version_lib_ini dd aVersion_lib_ini +ini_enum_sections dd aIni_enum_sections +ini_enum_keys dd aIni_enum_keys +ini_get_str dd aIni_get_str +ini_get_int dd aIni_get_int +ini_get_color dd aIni_get_color +ini_set_str dd aIni_set_str +ini_set_int dd aIni_set_int +ini_set_color dd aIni_set_color + dd 0 + dd 0 + +aLib_init db 'lib_init',0 +aVersion_lib_ini db 'version',0 +aIni_enum_sections db 'ini_enum_sections',0 +aIni_enum_keys db 'ini_enum_keys',0 +aIni_get_str db 'ini_get_str',0 +aIni_get_int db 'ini_get_int',0 +aIni_get_color db 'ini_get_color',0 +aIni_set_str db 'ini_set_str',0 +aIni_set_int db 'ini_set_int',0 +aIni_set_color db 'ini_set_color',0 +;------------------------------------------------------------------------------ diff --git a/programs/system/panel/trunk/libini.inc b/programs/system/panel/trunk/libini.inc new file mode 100644 index 0000000000..e171fd89ec --- /dev/null +++ b/programs/system/panel/trunk/libini.inc @@ -0,0 +1,220 @@ +;----------------------------------------------------------------------------- +Get_ini: + stdcall dll.Init,[lib_init] + + mov ebx,ini_file_name + mov esi,path + mov edi,library_path + call copy_file_path +;------------------------------------------------------------------------------ +; Get panel variables +;------------------------------------------------------------------------------ + invoke ini_get_int,library_path,aVariables,aPanelHeight,20 + cmp eax,100 + ja @f + + cmp eax,10 + ja .height +@@: + mov eax,20 +.height: + mov [height],eax +;-------------------------------------- + invoke ini_get_int,library_path,aVariables,aPanelWidth,0 + cmp eax,200 + ja @f + + mov eax,0 +@@: + mov [width],eax +;-------------------------------------- + invoke ini_get_int,library_path,aVariables,aSoftenHeight,3 + cmp eax,10 + ja @f + + cmp eax,1 + ja .soften_height +@@: + mov eax,3 +.soften_height: + mov [soften_height],eax +;-------------------------------------- + invoke ini_get_int,library_path,aVariables,aButtonTopOffset,3 + cmp eax,10 + ja @f + + cmp eax,1 + ja .button_top_offset +@@: + mov eax,3 +.button_top_offset: + mov [button_top_offset],eax +;-------------------------------------- + invoke ini_get_int,library_path,aVariables,aButtonBottomOffset,3 + cmp eax,10 + ja @f + + cmp eax,1 + ja .button_bottom_offset +@@: + mov eax,3 +.button_bottom_offset: + mov [button_bottom_offset],eax +;------------------------------------------------------------------------------ +; Get panel flags +;------------------------------------------------------------------------------ + invoke ini_get_int,library_path,aFlags,aSoftenUp,1 + cmp eax,2 + jb @f + + mov eax,1 +@@: + mov [soften_up],eax +;-------------------------------------- + invoke ini_get_int,library_path,aFlags,aSoftenDown,1 + cmp eax,2 + jb @f + + mov eax,1 +@@: + mov [soften_down],eax +;-------------------------------------- + invoke ini_get_int,library_path,aFlags,aMinimizeLeftButton,1 + cmp eax,2 + jb @f + + mov eax,1 +@@: + mov [minimize_left],eax +;-------------------------------------- + invoke ini_get_int,library_path,aFlags,aMinimizeRightButton,1 + cmp eax,2 + jb @f + + mov eax,1 +@@: + mov [minimize_right],eax +;-------------------------------------- + invoke ini_get_int,library_path,aFlags,aMenuButton,1 + cmp eax,2 + jb @f + + mov eax,1 +@@: + mov [menu_enable],eax +;-------------------------------------- + invoke ini_get_int,library_path,aFlags,aRunApplButtons,1 + cmp eax,2 + jb @f + + mov eax,1 +@@: + mov [run_appl],eax +;-------------------------------------- + invoke ini_get_int,library_path,aFlags,aCleanDesktopButton,1 + cmp eax,2 + jb @f + + mov eax,1 +@@: + mov [clean_desktop_enable],eax +;-------------------------------------- + invoke ini_get_int,library_path,aFlags,aClock,1 + cmp eax,2 + jb @f + + mov eax,1 +@@: + mov [clock_enable],eax +;-------------------------------------- + invoke ini_get_int,library_path,aFlags,aCpuUsage,1 + cmp eax,2 + jb @f + + mov eax,1 +@@: + mov [cpu_usage_enable],eax +;-------------------------------------- + invoke ini_get_int,library_path,aFlags,aChangeLang,1 + cmp eax,2 + jb @f + + mov eax,1 +@@: + mov [chlang_enable],eax +;-------------------------------------- + invoke ini_get_int,library_path,aFlags,aPageList,1 + cmp eax,2 + jb @f + + mov eax,1 +@@: + mov [page_list_enable],eax +;-------------------------------------- + invoke ini_get_int,library_path,aFlags,aAttachment,1 + cmp eax,2 + jb @f + + mov eax,1 +@@: + mov [place_attachment],eax +;-------------------------------------- + invoke ini_get_int,library_path,aFlags,aButtonsStyle,1 + cmp eax,2 + jb @f + + mov eax,1 +@@: + mov [button_style],eax +;-------------------------------------- + invoke ini_get_color,library_path,aColors,aMenuButton,0x44aa44 + mov [MenuButton_color],eax +;-------------------------------------- + invoke ini_get_color,library_path,aColors,aCleanDesktopButton,0x66cc + mov [CleanDesktopButton_color],eax +;-------------------------------------- + invoke ini_get_color,library_path,aColors,aClock,0x66cc + mov [Clock_color],eax +;-------------------------------------- + invoke ini_get_color,library_path,aColors,aCpuUsage,0x44aa44 + mov [CpuUsage_color],eax +;-------------------------------------- + invoke ini_get_color,library_path,aColors,aCpuUsageBckgr,0xdd2222 + mov [CpuUsageBckgr_color],eax +;-------------------------------------- + invoke ini_get_color,library_path,aColors,aChangeLang,0x66cc + mov [ChangeLang_color],eax +;-------------------------------------- + invoke ini_get_color,library_path,aColors,aPageList,0xffffff + mov [PageList_color],eax +;-------------------------------------- +; invoke ini_get_str,library_path,aConvertPlugins,aCP0,plugin_0_name,127,ConvertPlugins_no_key + + ret +;----------------------------------------------------------------------------- +copy_file_path: + xor eax,eax +@@: + cld + lodsb + stosb + test eax,eax + jnz @b + mov esi,edi + dec esi +@@: + std + lodsb + cmp al,'/' + jnz @b + mov edi,esi + add edi,2 + mov esi,ebx +@@: + cld + lodsb + stosb + test eax,eax + jnz @b + ret +;----------------------------------------------------------------------------- \ No newline at end of file diff --git a/programs/system/panel/trunk/panel.dat b/programs/system/panel/trunk/panel.dat deleted file mode 100644 index fc97f062a7..0000000000 --- a/programs/system/panel/trunk/panel.dat +++ /dev/null @@ -1 +0,0 @@ -0000;0000;0001;0001;0001;0001;0100;0001;0001;0001;0001;0001;x \ No newline at end of file diff --git a/programs/system/panel/trunk/panel.ini b/programs/system/panel/trunk/panel.ini new file mode 100644 index 0000000000..3af81a9d0d --- /dev/null +++ b/programs/system/panel/trunk/panel.ini @@ -0,0 +1,31 @@ +[Variables] +PanelHeight=24 +PanelWidth=0 +SoftenHeight=5 +ButtonTopOffset=4 +ButtonBottOffset=2 + +[Flags] +SoftenUp=1 +SoftenDown=0 +MinLeftButton=1 +MinRightButton=1 +MenuButton=1 +RunApplButtons=1 +ClnDesktButton=1 +Clock=1 +CpuUsage=1 +ChangeLang=1 +PageList=1 +Attachment=1 +ButtonsStyle=1 + +[Colors] +MenuButton=0,100,0 +ClnDesktButton=0,128,255 +Clock=0,128,255 +CpuUsage=0,100,0 +CpuUsageBckgr=255,0,0 +ChangeLang=0,128,255 +PageList=255,255,255 + diff --git a/programs/system/panel/trunk/u_data.inc b/programs/system/panel/trunk/u_data.inc new file mode 100644 index 0000000000..6f77660853 --- /dev/null +++ b/programs/system/panel/trunk/u_data.inc @@ -0,0 +1,86 @@ +;------------------------------------------------------------------------------ +align 4 +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 + +panel_x_pos rd 1 +panel_y_pos 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 + +active_slot_number rd 1 + +my_active_slot rd 1 +current_active_slot rd 1 + +screen_size: +.height rw 1 +.width rw 1 + +draw_flag_certainly rb 1 + +start_menu_flag rb 1 +win_key_flag rb 1 + +clean_desktop_minimize rb 1 +;------------------------------------------------------------------------------ +align 4 +system_colours system_colors ; rd 10 +;------------------------------------------------------------------------------ +align 4 +app_list rd 50 +;------------------------------------------------------------------------------ +align 4 +alt_tab_list rd 256*2 +;------------------------------------------------------------------------------ +align 4 +path: + rb 1024 +;----------------------------------------------------------------------------- +align 4 +library_path: +process_info_buffer: + rb 1024 +;------------------------------------------------------------------------------ +align 4 +procinfo_for_detect: + rb 1024 +;------------------------------------------------------------------------------ +align 4 +procinfo_window_tabs: + rb 1024 +;----------------------------------------------------------------------------- +align 4 +bootparam: + rb 256 +;------------------------------------------------------------------------------ +align 4 +tictable: + rd 256 +;------------------------------------------------------------------------------ +;align 4 +;panel_ini_data_area: +; rb 61 +;------------------------------------------------------------------------------ +align 4 + rb 256 +detect_stack: +;------------------------------------------------------------------------------ +align 4 + rb 256 +ctx_menu_stack: +;------------------------------------------------------------------------------ +align 4 + rb 1024 +stack_top: +;------------------------------------------------------------------------------