* @panel from Alver with corrections for minimize/restore button

* icon: corrected restart of all icons with 'Apply'

git-svn-id: svn://kolibrios.org@633 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2007-09-20 16:35:52 +00:00
parent c2d16441b9
commit 5504861649
7 changed files with 282 additions and 77 deletions

View File

@ -160,8 +160,13 @@ still:
cmp esi,eax cmp esi,eax
jg all_terminated jg all_terminated
cmp [I_END+10],dword '@ICO' mov eax,[I_END+10]
and eax,not 20202020h
cmp eax,'@ICO'
jz @f
cmp eax,'ICON'
jne newread jne newread
@@:
mov eax,51 mov eax,51
cmp eax,[I_END+42] cmp eax,[I_END+42]
jne newread jne newread

View File

@ -23,7 +23,7 @@ soften_up dd 1 ; 0 no ; 1 yes
soften_down dd 0 ; 0 no ; 1 yes soften_down dd 0 ; 0 no ; 1 yes
minimize_left dd 1 minimize_left dd 1
minimize_right dd 1 minimize_right dd 1
icons_position dd 95 icons_position dd 95
menu_enable dd 1 menu_enable dd 1
setup_enable dd 0 setup_enable dd 0
graph_text dd 1 graph_text dd 1
@ -93,7 +93,7 @@ begin_1:
kill_active_application: kill_active_application:
mcall 18, 7 mcall 18, 7
mov ecx,eax mov ecx,eax
;//{SPraid.simba do not kill panel and icon ;//{SPraid.simba do not kill panel and icon
push eax push eax
mov eax,9 mov eax,9
@ -361,6 +361,17 @@ START:
lea edx,[ebx-PANEL_HEIGHT-1] lea edx,[ebx-PANEL_HEIGHT-1]
mcall 48,6 mcall 48,6
; // Alver 26.08.2007 // {
mov eax, 9 ; info of process
mov ebx, process_info_buffer
mov ecx, -1
mcall
mov ecx, dword [process_info_buffer+30]
mcall 18,21
mov [this_slot], eax
mov [max_slot], 255
; } \\ Alver \\
call set_variables call set_variables
start_after_minimize: start_after_minimize:
@ -443,6 +454,15 @@ still:
cmp ah,102 ; minimize to right cmp ah,102 ; minimize to right
je right_button je right_button
; // Alver 26.08.2007 // {
cmp ah, 103
je clean_desktop ; minimize all windows
cmp ah, 104
je restore_desktop ; restore minimized windows
cmp ah, 105
je swap_minimized_desktop ; minimize normal windows, and restore minimized windows
; } \\ Alver \\
cmp ah,byte 1 ; start/terminate menu cmp ah,byte 1 ; start/terminate menu
jnz noselect jnz noselect
call menu_handler call menu_handler
@ -518,8 +538,12 @@ still:
noid20: noid20:
cmp ah,21 cmp ah,21
jnz noid21 jnz noid21
cmp [page_list],15 ; // Alver 25.08.2007 // {
je @f cmp [page_list], 99
jnc @f
; cmp [page_list],15
; je @f
; } \\ Alver \\
inc [page_list] inc [page_list]
jmp red jmp red
@@: @@:
@ -539,7 +563,68 @@ still:
jmp still jmp still
; // Alver 26.08.2007 //{
restore_desktop:
mcall 9,process_info_buffer,-1
mov [max_slot], eax
mov ecx, 2
mov edx, 2
@@:
mcall 18, 22
inc edx
cmp edx, [max_slot]
jbe @b
jmp still
swap_minimized_desktop:
xor esi, esi
inc esi
jmp min_swap_desktop
clean_desktop:
xor esi,esi
min_swap_desktop: ; input esi 0 - min, <>0 swap
mov ecx, 2 ; <20> ç «ì­ë© ­®¬¥à á«®â  ¯à®æ¥áá 
mov ebx, process_info_buffer
.loop1:
cmp ecx, [this_slot]
je .loop1xx
mcall 9
mov [max_slot], eax
mov dx, word [process_info_buffer+50]
cmp dx, 9 ; <20>஢¥àª  ᢮¡®¤¥­ «¨ ¤ ­­ë© á«®â
jz .loop1xx
mov edx, dword [ebx+10]
cmp dl, '@'
je .loop1xx
cmp dword [ebx+10], 'ICON'
jnz @f
cmp [ebx+42], dword 51
jnz @f
cmp [ebx+46], dword 51
jz .loop1xx
@@:
cmp [ebx+10], dword ' '
jz .loop1xx
pushad
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
mov ecx, 2 ; restore
@@:
mcall 18, 22
popad
.loop1xx:
inc ecx
cmp ecx, [max_slot]
jbe .loop1
jmp still
; } \\ Alver \\
draw_running_applications: draw_running_applications:
@ -610,7 +695,10 @@ redraw_window_tabs:
mov eax, 13 mov eax, 13
imul ebx, edi, 6*10*10000h imul ebx, edi, 6*10*10000h
add ebx, 6*10*10000h + 7*10000h + 54 ; // Alver 26.08.2007 // {
; add ebx, 6*10*10000h + 7*10000h + 54
add ebx, 12*10*10000h + 7*10000h + 54
; } // Alver //
mov ecx, 3*10000h + 14 mov ecx, 3*10000h + 14
xor edx, edx xor edx, edx
int 0x40 int 0x40
@ -718,23 +806,35 @@ draw_application_buttons:
shr eax,16 shr eax,16
cmp eax,639 ; // Alver 25.08.2007 // {
jne now1 ; cmp eax,639
mov [max_applications],7 ;6 ; jne now1
now1: ; mov [max_applications],7 ;6
cmp eax,799 ; now1:
jne now2 ; cmp eax,799
mov [max_applications],9 ;10 ;8 ; jne now2
now2: ; mov [max_applications],9 ;10 ;8
cmp eax,1023 ; now2:
jne now3 ; cmp eax,1023
mov [max_applications],12 ;13 ;8 ; jne now3
now3: ; mov [max_applications],12 ;13 ;8
cmp eax,1279 ; now3:
jne now4 ; cmp eax,1279
mov [max_applications],17 ;18 ;8 ; jne now4
now4: ; mov [max_applications],17 ;18 ;8
mov edi,1 ; now4:
; mov edi,1
sub eax, 281
jnc ._01
xor eax, eax
._01:
mov bl, 60
div bl
xor ah, ah ; eax - ª®«¨ç¥á⢮ 㬥é îè¨åáï ¯¨ªâ®¢
mov [max_applications], eax
mov edi,1
; } \\ Alver \\
nb: nb:
@ -742,7 +842,7 @@ draw_application_buttons:
mov ebx,edi mov ebx,edi
shl ebx,16 shl ebx,16
imul ebx,6*10 ;13 imul ebx,6*10 ;13
add ebx,15*65536+10*6-1 ;13 add ebx,75*65536+10*6-1 ; << Alver 25.08.2007 >> 15*65536+10*6-1 ;13
mov ecx,1*65536+17 mov ecx,1*65536+17
mov edx,edi mov edx,edi
add edx,51 add edx,51
@ -1135,7 +1235,7 @@ draw_window:
mov edi, [wcolor] mov edi, [wcolor]
mov [panel_x_pos], ebx mov [panel_x_pos], ebx
mov [panel_y_pos], ecx ; Ïîêà ÷òî òàê. mov [panel_y_pos], ecx ; <EFBFBD>®ª  çâ® â ª.
int 0x40 int 0x40
@ -1269,12 +1369,46 @@ draw_window:
popa popa
ret ret
; // Alver 26.08.2007 // {
dr_button_clean:
mov ecx, 3*65536+13
mcall 8
ret
; } \\ Alver \\
draw_menuet_icon: draw_menuet_icon:
pusha pusha
; // Alver 26.08.2007 // {
; Inserted code for drowing 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
xor esi, esi
inc esi
mov edx, page_clean_but
mov eax, 4
mov ebx, 71*65536+6
int 0x40
inc edx
mov ebx, 90*65536+6
int 0x40
inc edx
mov ebx, 109*65536+6
int 0x40
; } \\ Alver \\
cmp [menu_enable],1 cmp [menu_enable],1
jne no_menu jne no_menu
@ -1658,7 +1792,7 @@ draw_info: ; draw cpu usage, time, date
mov ecx,6 shl 16+10 mov ecx,6 shl 16+10
inc edx ;button 21 inc edx ;button 21
int 0x40 int 0x40
sub ebx,18 shl 16 sub ebx,24 shl 16 ; << Alver 25.08.2007 >> 18 shl 16
inc edx ;button 22 inc edx ;button 22
int 0x40 int 0x40
@ -1774,32 +1908,43 @@ dalshe:
mov bx,9 mov bx,9
mov ecx,6 shl 16+11 mov ecx,6 shl 16+11
int 0x40 int 0x40
sub ebx,18 shl 16 ; // Alver 25.08.2007 // {
; sub ebx,18 shl 16
; int 0x40
; add ebx,19 shl 16
sub ebx,24 shl 16 ; 18 shl 16
int 0x40 int 0x40
add ebx,19 shl 16 add ebx,25 shl 16 ; 19 shl 16
; } \\ Alver \\
sub bx,2 sub bx,2
mov ecx,7 shl 16+9 mov ecx,7 shl 16+9
mov edx,0xffffff mov edx,0xffffff
int 0x40 int 0x40
sub ebx,18 shl 16 ; // Alver 25.08.2007 // {
; sub ebx,18 shl 16
sub ebx,24 shl 16
; } \\ Alver \\
int 0x40 int 0x40
mov eax,4 mov eax,4
mov edx,page_a1 mov edx,page_a1
mov ebx,[maxx] mov ebx,[maxx]
sub ebx,133;150 ; // Alver 25.08.2007 // {
; sub ebx,133;150
sub ebx, 139
; } \\ Alver \\
shl ebx,16 shl ebx,16
mov bx,8 mov bx,8
mov esi,4 mov esi,5 ;4
int 0x40 int 0x40
add ebx,1 shl 16 add ebx,1 shl 16
int 0x40 int 0x40
mov eax,47 mov eax,47
mov ebx,0x10100 mov ebx,0x20000 ; 0x10100 (<Alver)
mov ecx,[page_list] mov ecx,[page_list]
mov edx,[maxx] mov edx,[maxx]
sub edx,124;141 sub edx,130 ; 124 (<Alver);141
shl edx,16 shl edx,16
mov dx,7 mov dx,7
mov esi,0xffffff mov esi,0xffffff
@ -2048,7 +2193,11 @@ small_draw dd 0x0
ptime dd 0x0 ptime dd 0x0
maxx dd 0x0 maxx dd 0x0
text db '0123456789' text db '0123456789'
page_a1 db '< >' ; // Alver 25.08.2007 // {
;page_a1 db '< >'
page_a1 db '< >'
page_clean_but db 25,24,18
; } \\ Alver \\
bte dd 0xccddee bte dd 0xccddee
wcolor dd 0x506070 wcolor dd 0x506070
@ -2114,11 +2263,14 @@ screen_size:
.height dw ? .height dw ?
.width dw ? .width dw ?
this_slot dd 0 ; Slot of this process
max_slot dd 255
system_colours rd 10 system_colours rd 10
app_list rd 50 app_list rd 50
alt_tab_list rd 256*2 alt_tab_list rd 256*2
alt_tab_list_size dd ? alt_tab_list_size dd ?
process_info_buffer rb 1024 process_info_buffer rb 1024
procinfo_for_detect rb 1024
tictable: tictable:
rd 256 rd 256

View File

@ -1,3 +1,4 @@
@erase lang.inc
@echo lang fix en >lang.inc @echo lang fix en >lang.inc
@fasm @panel.asm @panel @fasm @panel.asm @panel
@erase lang.inc @erase lang.inc

View File

@ -1,3 +1,4 @@
@erase lang.inc
@echo lang fix et >lang.inc @echo lang fix et >lang.inc
@fasm @panel.asm @panel @fasm @panel.asm @panel
@erase lang.inc @erase lang.inc

View File

@ -1,3 +1,4 @@
@erase lang.inc
@echo lang fix ru >lang.inc @echo lang fix ru >lang.inc
@fasm @panel.asm @panel @fasm @panel.asm @panel
@erase lang.inc @erase lang.inc

View File

@ -6,20 +6,21 @@
;call draw_ctx_menu ;call draw_ctx_menu
mov ebp, 2 ; 2 часто используется. mov ebp, 2 ; 2 ç áâ® ¨á¯®«ì§ã¥âáï.
; // Alver 26.08.2007 // {
xor ecx, ecx ; xor ecx, ecx
mov edx, [ctx_menu_PID] ; mov edx, [ctx_menu_PID]
find_slot: ; find_slot:
inc ecx ; inc ecx
; mov eax, 9
mov eax, 9 ; mov ebx, process_info_buffer
mov ebx, process_info_buffer ; int 0x40
int 0x40 ; cmp dword [process_info_buffer + 30], edx
; jne find_slot
cmp dword [process_info_buffer + 30], edx mov ecx, [ctx_menu_PID]
jne find_slot mcall 18,21
mov ecx, eax
; } \\ Alver \\
mov eax, 18 mov eax, 18
mov ebx, 3 mov ebx, 3
;mov ecx, ecx ; :) ;mov ecx, ecx ; :)
@ -50,11 +51,29 @@
mov eax, 17 mov eax, 17
int 0x40 int 0x40
cmp ah, 1 cmp ah, 1
jne ctx_menu_still ; // Alver 26.08.2007 // {
; jne ctx_menu_still
jne @f
; } \\ Alver \\
mov eax, 18 mov eax, 18
mov ebx, ebp ; mov eax, 2 mov ebx, ebp ; mov eax, 2
mov ecx, [n_slot] mov ecx, [n_slot]
; // Alver 26.08.2007 // {
jmp .lllxxx
@@:
cmp ah, 2
jne ctx_menu_still
mov eax, 18
mov ebx, 22
mov edx, [n_slot]
xor ecx, ecx
; \begin{diamond}[20.09.2007]
test byte [procinfo_for_detect+70], 2
setnz cl
add cl, cl
; \end{diamond}[20.09.2007]
.lllxxx:
; } \\ Alver \\
int 0x40 int 0x40
jmp ctx_menu_exit jmp ctx_menu_exit
@ -63,8 +82,8 @@
mov ebx, ebp ; mov ebx, 2 mov ebx, ebp ; mov ebx, 2
int 0x40 int 0x40
xchg eax, ecx ; cmp eax, 0 Если не одна из кнопок не нажата возвращаемся xchg eax, ecx ; cmp eax, 0 …᫨ ­¥ ®¤­  ¨§ ª­®¯®ª ­¥ ­ ¦ â  ¢®§¢à é ¥¬áï
; в главный цикл потока ; ¢ £« ¢­ë© 横« ¯®â®ª 
jecxz ctx_menu_still jecxz ctx_menu_still
mov eax, 37 mov eax, 37
@ -72,9 +91,9 @@
inc ebx inc ebx
int 0x40 int 0x40
cmp ax, 0 ; Тут проверяем произошёл-ли клик за пределами окна контекстного cmp ax, 0 ; ’ã⠯஢¥à塞 ¯à®¨§®èñ«-«¨ ª«¨ª §  ¯à¥¤¥« ¬¨ ®ª­  ª®­â¥ªáâ­®£®
jb ctx_menu_exit ; меню, если за пределами то закрываем контекстное меню jb ctx_menu_exit ; ¬¥­î, ¥á«¨ §  ¯à¥¤¥« ¬¨ â® § ªà뢠¥¬ ª®­â¥ªáâ­®¥ ¬¥­î
cmp ax, 41 cmp ax, 60 ; 41
ja ctx_menu_exit ja ctx_menu_exit
shr eax, 16 shr eax, 16
cmp ax, 0 cmp ax, 0
@ -101,9 +120,9 @@ func draw_ctx_menu
shl ebx, 16 shl ebx, 16
add ebx, 133 add ebx, 133
movzx ecx, [y_coord] movzx ecx, [y_coord]
sub ecx, 41 sub ecx, 60 ; 41
shl ecx, 16 shl ecx, 16
add ecx, 41 add ecx, 60 ; 41
mov edx, [system_colours + 20] ; sc.work mov edx, [system_colours + 20] ; sc.work
mov esi, [system_colours + 4] ; sc.grab mov esi, [system_colours + 4] ; sc.grab
or esi, 0x81000000 or esi, 0x81000000
@ -112,16 +131,23 @@ func draw_ctx_menu
mov eax, 8 mov eax, 8
mov ebx, 0 * 65536 + 133 mov ebx, 0 * 65536 + 133
mov ecx, 22 * 65536 + 18 mov ecx, 22 * 65536 + 16
mov edx, 0x40000001 mov edx, 0x40000001
int 0x40 int 0x40
mov eax, 8
mov ebx, 0 * 65536 + 133
mov ecx, 40 * 65536 + 18
mov edx, 0x40000002
int 0x40
shr eax, 1 ; mov eax, 4 shr eax, 1 ; mov eax, 4
mov ebx, 36 * 65536 + 7 mov ebx, 36 * 65536 + 7
mov ecx, [system_colours + 16] ; sc.grab_text mov ecx, [system_colours + 16] ; sc.grab_text
or ecx, 0x10000000 or ecx, 0x10000000
mov edx, ctx_menu_title mov edx, ctx_menu_title
mov esi, ctx_menu_title_end - ctx_menu_title mov esi, ctx_menu_title_end - ctx_menu_title
int 0x40 int 0x40
@ -129,11 +155,20 @@ func draw_ctx_menu
int 0x40 int 0x40
mov ebx, 4 * 65536 + 28 mov ebx, 4 * 65536 + 28
xor ecx, ecx ; mov ecx, 0x00000000 mov ecx, 0x80000000
mov edx, ctx_menu_text mov edx, ctx_menu_text
mov esi, ctx_menu_text_end - ctx_menu_text ; // Alver 26.08.2007 // {
int 0x40 int 0x40
add bx, 18
mov edx, ctx_menu_text2
; \begin{diamond}[20.09.2007]
test byte [procinfo_for_detect+70], 2
jz @f
mov edx, ctx_menu_text3
@@:
; \end{diamond}[20.09.2007]
int 0x40
; } \\ Alver \\
mov eax, 12 mov eax, 12
mov ebx, ebp ; mov ebx, 2 mov ebx, ebp ; mov ebx, 2
int 0x40 int 0x40
@ -146,11 +181,19 @@ x_coord rw 1
y_coord rw 1 y_coord rw 1
n_slot rd 1 n_slot rd 1
lsz ctx_menu_text,\ lsz ctx_menu_text,\
ru, "X ‡ Єалвм Alt + F4",\ ru, <"X ‡ ªàëâì Alt + F4",0>,\
en, "X Close Alt + F4",\ en, <"X Close Alt + F4",0>,\
et, "X Sulge Alt + F4" ; Now correct et, <"X Sulge Alt + F4",0> ; Now correct
; // Alver 26.08.2007 // {
ctx_menu_text_end: lsz ctx_menu_text2,\
ru, <25," ‘¢¥à­ãâì ",0>,\
en, <25," Minimize ",0>,\
; } \\ Alver \\
; \begin{diamond}[20.09.2007]
lsz ctx_menu_text3,\
ru, <24," ‚®ááâ ­®¢¨âì ",0>,\
en, <24," Restore ",0>
; \end{diamond}[20.09.2007]
ctx_menu_PID rd 1 ctx_menu_PID rd 1
ctx_menu_title: ctx_menu_title:

View File

@ -7,7 +7,7 @@ detect_start:
int 0x40 int 0x40
detect_still: detect_still:
;mov eax, 10 ; Работает не совсем корректно, почему хз. ;mov eax, 10 ; <EFBFBD> ¡®â ¥â ­¥ ᮢᥬ ª®à४⭮, ¯®ç¥¬ã å§.
mov eax, 23 mov eax, 23
mov ebx, 4 mov ebx, 4
int 0x40 int 0x40
@ -15,11 +15,11 @@ detect_start:
;jne detect_still ;jne detect_still
mov eax, 37 mov eax, 37
mov ebx, 2 ; Опрашиваем кнопки мыши mov ebx, 2 ; Ž¯à è¨¢ ¥¬ ª­®¯ª¨ ¬ëè¨
int 0x40 int 0x40
test eax, ebx ; test eax, 00000010b Интересует только правая кнопка test eax, ebx ; test eax, 00000010b ˆ­â¥à¥áã¥â ⮫쪮 ¯à ¢ ï ª­®¯ª 
jz detect_still ; Нет - ? Возвращаемся в главный цикл потока jz detect_still ; <EFBFBD>¥â - ? ‚®§¢à é ¥¬áï ¢ £« ¢­ë© 横« ¯®â®ª 
mouse_btn_up: mouse_btn_up:
mov eax, 37 mov eax, 37
@ -50,7 +50,10 @@ detect_start:
detect_button: detect_button:
mov ebx, edx mov ebx, edx
imul ebx, 6 * 10 imul ebx, 6 * 10
add ebx, 4 ; // Alver 26.08.2007 // {
; add ebx, 4
add ebx, 64
; } \\ Alver \\
cmp eax, ebx cmp eax, ebx
jb detect_still jb detect_still
@ -74,6 +77,10 @@ detect_start:
mov [n_slot], ecx mov [n_slot], ecx
mov eax, 9
mov ebx, procinfo_for_detect
int 0x40
mov eax, 51 mov eax, 51
mov ebx, 1 mov ebx, 1
mov ecx, context_menu_start mov ecx, context_menu_start
@ -89,8 +96,3 @@ detect_start:
jae detect_still jae detect_still
inc edx inc edx
jmp detect_button jmp detect_button