diff --git a/kernel/trunk/docs/sysfuncr.txt b/kernel/trunk/docs/sysfuncr.txt index 2767c639b1..c3ca4f5c84 100644 --- a/kernel/trunk/docs/sysfuncr.txt +++ b/kernel/trunk/docs/sysfuncr.txt @@ -1108,6 +1108,18 @@ dd 1675 * Восстановление окна с одновременной активизацией осуществляется подфункции 3 (принимающей номер слота). +====================================================================== +======= Функция 18, подфункция 23 - минимизировать все окна. ========= +====================================================================== +Параметры: + * eax = 18 - номер функции + * ebx = 23 - номер подфункции +Возвращаемое значение: + * eax = 0 - все окна были минимизированы до вызова функции + * eax = N - количество окон свернутых функцией +Замечания: + * Окна спец. потоков (имя начинается с символа @) не сворачиваются. + ====================================================================== ==================== Функция 20 - интерфейс MIDI. ==================== ====================================================================== diff --git a/kernel/trunk/docs/sysfuncs.txt b/kernel/trunk/docs/sysfuncs.txt index 69456c2431..804a2a6012 100644 --- a/kernel/trunk/docs/sysfuncs.txt +++ b/kernel/trunk/docs/sysfuncs.txt @@ -1108,6 +1108,18 @@ Remarks: * One can restore and activate window simultaneously with subfunction 3 (which requires slot number). +====================================================================== +======== Function 18, subfunction 23 - minimize all windows. ========== +====================================================================== +Parameters: + * eax = 18 - function number + * ebx = 23 - subfunction number +Returned value: + * eax = 0 - all windows have been minimized before a function call + * eax = N - number of windows minimized from function +Remarks: + * Window of special thread (name begin to symbol @) is not minimize. + ====================================================================== ==================== Function 20 - MIDI interface. =================== ====================================================================== diff --git a/kernel/trunk/gui/window.inc b/kernel/trunk/gui/window.inc index 51d30ad677..f9ad6e846d 100644 --- a/kernel/trunk/gui/window.inc +++ b/kernel/trunk/gui/window.inc @@ -1026,6 +1026,55 @@ align 4 ;------------------------------------------------------------------------------ align 4 ;------------------------------------------------------------------------------ +minimize_all_window: + push ebx ecx edx esi edi + pushfd + cli + xor edx, edx + mov eax, 2 ; we do not minimize the kernel thread N1 + mov ebx, [TASK_COUNT] +;-------------------------------------- +align 4 +.loop: + movzx edi, word[WIN_POS + eax * 2] + shl edi, 5 +; it is a unused slot? + cmp dword [edi+CURRENT_TASK+TASKDATA.state], 9 + je @f +; it is a hidden thread? + lea esi, [edi*8+SLOT_BASE+APPDATA.app_name] + cmp [esi], byte '@' + je @f +; is it already minimized? + test [edi + window_data+WDATA.fl_wstate], WSTATE_MINIMIZED + jnz @f +; no it's not, let's do that + or [edi + window_data+WDATA.fl_wstate], WSTATE_MINIMIZED + inc edx +;-------------------------------------- +align 4 +@@: + inc eax + cmp eax, ebx + jbe .loop +; If nothing has changed + test edx, edx + jz @f + + push edx + call syscall_display_settings._.calculate_whole_screen + call syscall_display_settings._.redraw_whole_screen + pop edx +;-------------------------------------- +align 4 +@@: + mov eax, edx + popfd + pop edi esi edx ecx ebx + ret +;------------------------------------------------------------------------------ +align 4 +;------------------------------------------------------------------------------ minimize_window: ;///////////////////////////////////////////////////////////// ;------------------------------------------------------------------------------ ;> eax = window number on screen diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index a808427f8c..5af852a9de 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -2054,6 +2054,7 @@ sys_system_table: dd sysfn_meminfo ; 20 = get extended memory info dd sysfn_pid_to_slot ; 21 = get slot number for pid dd sysfn_min_rest_window ; 22 = minimize and restore any window + dd sysfn_min_windows ; 23 = minimize all windows sysfn_num = ($ - sys_system_table)/4 endg ;------------------------------------------------------------------------------ @@ -2359,20 +2360,19 @@ sysfn_getfreemem: shl eax, 2 mov [esp+32], eax ret - +;------------------------------------------------------------------------------ sysfn_getallmem: mov eax, [MEM_AMOUNT] shr eax, 10 mov [esp+32], eax ret - -; // Alver, 2007-22-08 // { +;------------------------------------------------------------------------------ sysfn_pid_to_slot: mov eax, ecx call pid_to_slot mov [esp+32], eax ret - +;------------------------------------------------------------------------------ sysfn_min_rest_window: pushad mov eax, edx ; ebx - operating @@ -2403,12 +2403,15 @@ sysfn_min_rest_window: dec eax mov [esp+32], eax ret -; } \\ Alver, 2007-22-08 \\ - +;------------------------------------------------------------------------------ +sysfn_min_windows: + call minimize_all_window + mov [esp+32], eax + call change_task + ret +;------------------------------------------------------------------------------ uglobal -;// mike.dld, 2006-29-01 [ screen_workarea RECT -;// mike.dld, 2006-29-01 ] window_minimize db 0 sound_flag db 0 endg