* @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
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
@@:
mov eax,51
cmp eax,[I_END+42]
jne newread

View File

@ -361,6 +361,17 @@ START:
lea edx,[ebx-PANEL_HEIGHT-1]
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
start_after_minimize:
@ -443,6 +454,15 @@ still:
cmp ah,102 ; minimize to right
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
jnz noselect
call menu_handler
@ -518,8 +538,12 @@ still:
noid20:
cmp ah,21
jnz noid21
cmp [page_list],15
je @f
; // Alver 25.08.2007 // {
cmp [page_list], 99
jnc @f
; cmp [page_list],15
; je @f
; } \\ Alver \\
inc [page_list]
jmp red
@@:
@ -539,7 +563,68 @@ 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:
@ -610,7 +695,10 @@ redraw_window_tabs:
mov eax, 13
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
xor edx, edx
int 0x40
@ -718,23 +806,35 @@ draw_application_buttons:
shr eax,16
cmp eax,639
jne now1
mov [max_applications],7 ;6
now1:
cmp eax,799
jne now2
mov [max_applications],9 ;10 ;8
now2:
cmp eax,1023
jne now3
mov [max_applications],12 ;13 ;8
now3:
cmp eax,1279
jne now4
mov [max_applications],17 ;18 ;8
now4:
; // Alver 25.08.2007 // {
; cmp eax,639
; jne now1
; mov [max_applications],7 ;6
; now1:
; cmp eax,799
; jne now2
; mov [max_applications],9 ;10 ;8
; now2:
; cmp eax,1023
; jne now3
; mov [max_applications],12 ;13 ;8
; now3:
; cmp eax,1279
; jne now4
; mov [max_applications],17 ;18 ;8
; 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:
@ -742,7 +842,7 @@ draw_application_buttons:
mov ebx,edi
shl ebx,16
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 edx,edi
add edx,51
@ -1135,7 +1235,7 @@ draw_window:
mov edi, [wcolor]
mov [panel_x_pos], ebx
mov [panel_y_pos], ecx ; Ïîêà ÷òî òàê.
mov [panel_y_pos], ecx ; <EFBFBD>®ª  çâ® â ª.
int 0x40
@ -1269,12 +1369,46 @@ draw_window:
popa
ret
; // Alver 26.08.2007 // {
dr_button_clean:
mov ecx, 3*65536+13
mcall 8
ret
; } \\ Alver \\
draw_menuet_icon:
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
jne no_menu
@ -1658,7 +1792,7 @@ draw_info: ; draw cpu usage, time, date
mov ecx,6 shl 16+10
inc edx ;button 21
int 0x40
sub ebx,18 shl 16
sub ebx,24 shl 16 ; << Alver 25.08.2007 >> 18 shl 16
inc edx ;button 22
int 0x40
@ -1774,32 +1908,43 @@ dalshe:
mov bx,9
mov ecx,6 shl 16+11
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
add ebx,19 shl 16
add ebx,25 shl 16 ; 19 shl 16
; } \\ Alver \\
sub bx,2
mov ecx,7 shl 16+9
mov edx,0xffffff
int 0x40
sub ebx,18 shl 16
; // Alver 25.08.2007 // {
; sub ebx,18 shl 16
sub ebx,24 shl 16
; } \\ Alver \\
int 0x40
mov eax,4
mov edx,page_a1
mov ebx,[maxx]
sub ebx,133;150
; // Alver 25.08.2007 // {
; sub ebx,133;150
sub ebx, 139
; } \\ Alver \\
shl ebx,16
mov bx,8
mov esi,4
mov esi,5 ;4
int 0x40
add ebx,1 shl 16
int 0x40
mov eax,47
mov ebx,0x10100
mov ebx,0x20000 ; 0x10100 (<Alver)
mov ecx,[page_list]
mov edx,[maxx]
sub edx,124;141
sub edx,130 ; 124 (<Alver);141
shl edx,16
mov dx,7
mov esi,0xffffff
@ -2048,7 +2193,11 @@ small_draw dd 0x0
ptime dd 0x0
maxx dd 0x0
text db '0123456789'
; // Alver 25.08.2007 // {
;page_a1 db '< >'
page_a1 db '< >'
page_clean_but db 25,24,18
; } \\ Alver \\
bte dd 0xccddee
wcolor dd 0x506070
@ -2114,11 +2263,14 @@ screen_size:
.height dw ?
.width dw ?
this_slot dd 0 ; Slot of this process
max_slot dd 255
system_colours rd 10
app_list rd 50
alt_tab_list rd 256*2
alt_tab_list_size dd ?
process_info_buffer rb 1024
procinfo_for_detect rb 1024
tictable:
rd 256

View File

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

View File

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

View File

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

View File

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

View File

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