Rev 8712 | Rev 8869 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8712 | Rev 8866 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2 | ;; ;; |
2 | ;; ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2021. All rights reserved. ;; |
4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
4 | ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; Distributed under terms of the GNU General Public License ;; |
6 | ;; ;; |
6 | ;; ;; |
7 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
7 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 8... | Line 8... | ||
8 | 8 | ||
Line 9... | Line 9... | ||
9 | $Revision: 8712 $ |
9 | $Revision: 8866 $ |
10 | 10 | ||
11 | ;============================================================================== |
11 | ;============================================================================== |
Line 55... | Line 55... | ||
55 | call drawwindow_III |
55 | call drawwindow_III |
56 | jmp window._.draw_window_caption.2 |
56 | jmp window._.draw_window_caption.2 |
57 | ;-------------------------------------- |
57 | ;-------------------------------------- |
58 | @@: |
58 | @@: |
59 | ; type IV & V - skinned window (resizable & not) |
59 | ; type IV & V - skinned window (resizable & not) |
60 | mov eax, [TASK_COUNT] |
60 | mov eax, [thread_count] |
61 | movzx eax, word[WIN_POS + eax * 2] |
61 | movzx eax, word[WIN_POS + eax * 2] |
62 | cmp eax, [CURRENT_TASK] |
62 | cmp eax, [CURRENT_TASK] |
63 | setz al |
63 | setz al |
64 | movzx eax, al |
64 | movzx eax, al |
65 | push eax |
65 | push eax |
Line 423... | Line 423... | ||
423 | mov esi, 1 |
423 | mov esi, 1 |
424 | call window._.set_screen |
424 | call window._.set_screen |
Line 425... | Line 425... | ||
425 | 425 | ||
Line 426... | Line 426... | ||
426 | push ebp |
426 | push ebp |
427 | 427 | ||
428 | mov ebp, [TASK_COUNT] |
428 | mov ebp, [thread_count] |
Line 429... | Line 429... | ||
429 | cmp ebp, 1 |
429 | cmp ebp, 1 |
Line 436... | Line 436... | ||
436 | mov dword[esp+10h], ZPOS_DESKTOP |
436 | mov dword[esp+10h], ZPOS_DESKTOP |
437 | ;-------------------------------------- |
437 | ;-------------------------------------- |
438 | align 4 |
438 | align 4 |
439 | .layout: |
439 | .layout: |
440 | mov esi, 1 ; = num in window stack |
440 | mov esi, 1 ; = num in window stack |
441 | mov ebp, [TASK_COUNT] |
441 | mov ebp, [thread_count] |
442 | ;-------------------------------------- |
442 | ;-------------------------------------- |
443 | align 4 |
443 | align 4 |
444 | .next_window: |
444 | .next_window: |
445 | movzx edi, word[WIN_POS + esi * 2] |
445 | movzx edi, word[WIN_POS + esi * 2] |
446 | shl edi, 5 ;size of TASKDATA and WDATA = 32 bytes |
446 | shl edi, 5 ;size of TASKDATA and WDATA = 32 bytes |
Line 508... | Line 508... | ||
508 | ;--------------------------------------------- |
508 | ;--------------------------------------------- |
509 | inc dword[esp+10h] |
509 | inc dword[esp+10h] |
510 | cmp dword[esp+10h], ZPOS_ALWAYS_TOP |
510 | cmp dword[esp+10h], ZPOS_ALWAYS_TOP |
511 | jle .layout |
511 | jle .layout |
512 | ;--------------------------------------------- |
512 | ;--------------------------------------------- |
513 | mov esi, [TASK_COUNT] |
513 | mov esi, [thread_count] |
514 | movzx edi, word[WIN_POS + esi * 2] |
514 | movzx edi, word[WIN_POS + esi * 2] |
515 | shl edi, 5 |
515 | shl edi, 5 |
516 | add edi, window_data |
516 | add edi, window_data |
Line 517... | Line 517... | ||
517 | 517 | ||
Line 530... | Line 530... | ||
530 | ;------------------------------------------------------------------------------ |
530 | ;------------------------------------------------------------------------------ |
531 | repos_windows: ;/////////////////////////////////////////////////////////////// |
531 | repos_windows: ;/////////////////////////////////////////////////////////////// |
532 | ;------------------------------------------------------------------------------ |
532 | ;------------------------------------------------------------------------------ |
533 | ;? |
533 | ;? |
534 | ;------------------------------------------------------------------------------ |
534 | ;------------------------------------------------------------------------------ |
535 | mov ecx, [TASK_COUNT] |
535 | mov ecx, [thread_count] |
536 | mov edi, window_data + sizeof.WDATA * 2 |
536 | mov edi, window_data + sizeof.WDATA * 2 |
537 | call force_redraw_background |
537 | call force_redraw_background |
538 | dec ecx |
538 | dec ecx |
539 | jle .exit |
539 | jle .exit |
540 | ;-------------------------------------- |
540 | ;-------------------------------------- |
Line 911... | Line 911... | ||
911 | waredraw: ;//////////////////////////////////////////////////////////////////// |
911 | waredraw: ;//////////////////////////////////////////////////////////////////// |
912 | ;------------------------------------------------------------------------------ |
912 | ;------------------------------------------------------------------------------ |
913 | ;? Activate window, redrawing if necessary |
913 | ;? Activate window, redrawing if necessary |
914 | ;------------------------------------------------------------------------------ |
914 | ;------------------------------------------------------------------------------ |
915 | push -1 |
915 | push -1 |
916 | mov eax, [TASK_COUNT] |
916 | mov eax, [thread_count] |
917 | lea eax, [WIN_POS + eax * 2] |
917 | lea eax, [WIN_POS + eax * 2] |
918 | cmp eax, esi |
918 | cmp eax, esi |
919 | pop eax |
919 | pop eax |
920 | je .exit |
920 | je .exit |
Line 928... | Line 928... | ||
928 | 928 | ||
929 | ; yes it is, activate and update screen buffer |
929 | ; yes it is, activate and update screen buffer |
Line 930... | Line 930... | ||
930 | call window._.window_activate |
930 | call window._.window_activate |
931 | 931 | ||
932 | pushad |
932 | pushad |
933 | mov edi, [TASK_COUNT] |
933 | mov edi, [thread_count] |
934 | movzx esi, word[WIN_POS + edi * 2] |
934 | movzx esi, word[WIN_POS + edi * 2] |
Line 935... | Line 935... | ||
935 | shl esi, 5 |
935 | shl esi, 5 |
Line 941... | Line 941... | ||
941 | mov edx, [esi + WDATA.box.height] |
941 | mov edx, [esi + WDATA.box.height] |
Line 942... | Line 942... | ||
942 | 942 | ||
943 | add ecx, eax |
943 | add ecx, eax |
Line 944... | Line 944... | ||
944 | add edx, ebx |
944 | add edx, ebx |
945 | 945 | ||
946 | mov edi, [TASK_COUNT] |
946 | mov edi, [thread_count] |
Line 947... | Line 947... | ||
947 | movzx esi, word[WIN_POS + edi * 2] |
947 | movzx esi, word[WIN_POS + edi * 2] |
Line 976... | Line 976... | ||
976 | push ebx ecx edx esi edi |
976 | push ebx ecx edx esi edi |
977 | pushfd |
977 | pushfd |
978 | cli |
978 | cli |
979 | xor edx, edx |
979 | xor edx, edx |
980 | mov eax, 2 ; we do not minimize the kernel thread N1 |
980 | mov eax, 2 ; we do not minimize the kernel thread N1 |
981 | mov ebx, [TASK_COUNT] |
981 | mov ebx, [thread_count] |
982 | ;-------------------------------------- |
982 | ;-------------------------------------- |
983 | align 4 |
983 | align 4 |
984 | .loop: |
984 | .loop: |
985 | movzx edi, word[WIN_POS + eax * 2] |
985 | movzx edi, word[WIN_POS + eax * 2] |
986 | shl edi, 5 |
986 | shl edi, 5 |
Line 1103... | Line 1103... | ||
1103 | 1103 | ||
1104 | ; no it's not, let's do that |
1104 | ; no it's not, let's do that |
1105 | mov [edi + WDATA.fl_redraw], 1 |
1105 | mov [edi + WDATA.fl_redraw], 1 |
1106 | and [edi + WDATA.fl_wstate], not WSTATE_MINIMIZED |
1106 | and [edi + WDATA.fl_wstate], not WSTATE_MINIMIZED |
1107 | mov ebp, window._.set_screen |
1107 | mov ebp, window._.set_screen |
1108 | cmp eax, [TASK_COUNT] |
1108 | cmp eax, [thread_count] |
1109 | jz @f |
1109 | jz @f |
1110 | mov ebp, calculatescreen |
1110 | mov ebp, calculatescreen |
1111 | ;-------------------------------------- |
1111 | ;-------------------------------------- |
1112 | align 4 |
1112 | align 4 |
Line 1141... | Line 1141... | ||
1141 | ; do we have window minimize/restore request? |
1141 | ; do we have window minimize/restore request? |
1142 | cmp [window_minimize], 0 |
1142 | cmp [window_minimize], 0 |
1143 | je .exit |
1143 | je .exit |
Line 1144... | Line 1144... | ||
1144 | 1144 | ||
1145 | ; okay, minimize or restore top-most window and exit |
1145 | ; okay, minimize or restore top-most window and exit |
1146 | mov eax, [TASK_COUNT] |
1146 | mov eax, [thread_count] |
1147 | mov bl, 0 |
1147 | mov bl, 0 |
1148 | xchg [window_minimize], bl |
1148 | xchg [window_minimize], bl |
1149 | dec bl |
1149 | dec bl |
1150 | jnz @f |
1150 | jnz @f |
Line 1960... | Line 1960... | ||
1960 | ;> esi = pointer to WIN_POS+ window data |
1960 | ;> esi = pointer to WIN_POS+ window data |
1961 | ;------------------------------------------------------------------------------ |
1961 | ;------------------------------------------------------------------------------ |
1962 | push eax ebx |
1962 | push eax ebx |
Line 1963... | Line 1963... | ||
1963 | 1963 | ||
1964 | ; if type of current active window is 3 or 4, it must be redrawn |
1964 | ; if type of current active window is 3 or 4, it must be redrawn |
Line 1965... | Line 1965... | ||
1965 | mov ebx, [TASK_COUNT] |
1965 | mov ebx, [thread_count] |
Line 1966... | Line 1966... | ||
1966 | 1966 | ||
1967 | ; DEBUGF 1, "K : TASK_COUNT (0x%x)\n", ebx |
1967 | ; DEBUGF 1, "K : thread_count (0x%x)\n", ebx |
1968 | 1968 | ||
1969 | movzx ebx, word[WIN_POS + ebx * 2] |
1969 | movzx ebx, word[WIN_POS + ebx * 2] |
Line 1990... | Line 1990... | ||
1990 | ; drop others |
1990 | ; drop others |
1991 | xor eax, eax |
1991 | xor eax, eax |
1992 | ;-------------------------------------- |
1992 | ;-------------------------------------- |
1993 | align 4 |
1993 | align 4 |
1994 | .next_stack_window: |
1994 | .next_stack_window: |
1995 | cmp eax, [TASK_COUNT] |
1995 | cmp eax, [thread_count] |
1996 | jae .move_self_up |
1996 | jae .move_self_up |
1997 | inc eax |
1997 | inc eax |
Line 1998... | Line 1998... | ||
1998 | 1998 | ||
1999 | ; push ebx |
1999 | ; push ebx |
Line 2008... | Line 2008... | ||
2008 | jmp .next_stack_window |
2008 | jmp .next_stack_window |
2009 | ;-------------------------------------- |
2009 | ;-------------------------------------- |
2010 | align 4 |
2010 | align 4 |
2011 | .move_self_up: |
2011 | .move_self_up: |
2012 | movzx ebx, word[esi] |
2012 | movzx ebx, word[esi] |
2013 | ; number of processes |
2013 | ; number of thread |
2014 | mov ax, [TASK_COUNT] |
2014 | mov ax, word [thread_count] |
2015 | ; this is the last (and the upper) |
2015 | ; this is the last (and the upper) |
2016 | mov [WIN_STACK + ebx * 2], ax |
2016 | mov [WIN_STACK + ebx * 2], ax |
Line 2017... | Line 2017... | ||
2017 | 2017 | ||
2018 | ; update on screen - window stack |
2018 | ; update on screen - window stack |
2019 | xor eax, eax |
2019 | xor eax, eax |
2020 | ;-------------------------------------- |
2020 | ;-------------------------------------- |
2021 | align 4 |
2021 | align 4 |
2022 | .next_window_pos: |
2022 | .next_window_pos: |
2023 | cmp eax, [TASK_COUNT] |
2023 | cmp eax, [thread_count] |
2024 | jae .reset_vars |
2024 | jae .reset_vars |
2025 | inc eax |
2025 | inc eax |
2026 | movzx ebx, word[WIN_STACK + eax * 2] |
2026 | movzx ebx, word[WIN_STACK + eax * 2] |
2027 | mov [WIN_POS + ebx * 2], ax |
2027 | mov [WIN_POS + ebx * 2], ax |
Line 2054... | Line 2054... | ||
2054 | ; up others |
2054 | ; up others |
2055 | xor eax, eax |
2055 | xor eax, eax |
2056 | ;-------------------------------------- |
2056 | ;-------------------------------------- |
2057 | align 4 |
2057 | align 4 |
2058 | .next_stack_window: |
2058 | .next_stack_window: |
2059 | cmp eax, [TASK_COUNT] |
2059 | cmp eax, [thread_count] |
2060 | jae .move_self_down |
2060 | jae .move_self_down |
2061 | inc eax |
2061 | inc eax |
2062 | cmp [WIN_STACK + eax * 2], bx |
2062 | cmp [WIN_STACK + eax * 2], bx |
2063 | jae .next_stack_window |
2063 | jae .next_stack_window |
2064 | inc word[WIN_STACK + eax * 2] |
2064 | inc word[WIN_STACK + eax * 2] |
Line 2072... | Line 2072... | ||
2072 | ; update on screen - window stack |
2072 | ; update on screen - window stack |
2073 | xor eax, eax |
2073 | xor eax, eax |
2074 | ;-------------------------------------- |
2074 | ;-------------------------------------- |
2075 | align 4 |
2075 | align 4 |
2076 | .next_window_pos: |
2076 | .next_window_pos: |
2077 | cmp eax, [TASK_COUNT] |
2077 | cmp eax, [thread_count] |
2078 | jae .reset_vars |
2078 | jae .reset_vars |
2079 | inc eax |
2079 | inc eax |
2080 | movzx ebx, word[WIN_STACK + eax * 2] |
2080 | movzx ebx, word[WIN_STACK + eax * 2] |
2081 | mov [WIN_POS + ebx * 2], ax |
2081 | mov [WIN_POS + ebx * 2], ax |
2082 | jmp .next_window_pos |
2082 | jmp .next_window_pos |
Line 2116... | Line 2116... | ||
2116 | ;-------------------------------------- |
2116 | ;-------------------------------------- |
2117 | align 4 |
2117 | align 4 |
2118 | .next_window: |
2118 | .next_window: |
2119 | add esi, 2 |
2119 | add esi, 2 |
Line 2120... | Line 2120... | ||
2120 | 2120 | ||
2121 | mov eax, [TASK_COUNT] |
2121 | mov eax, [thread_count] |
Line 2122... | Line 2122... | ||
2122 | lea eax, word[WIN_POS + eax * 2] ; number of the upper window |
2122 | lea eax, word[WIN_POS + eax * 2] ; number of the upper window |
2123 | 2123 | ||
Line 2170... | Line 2170... | ||
2170 | window._.draw_window_caption: ;//////////////////////////////////////////////// |
2170 | window._.draw_window_caption: ;//////////////////////////////////////////////// |
2171 | ;------------------------------------------------------------------------------ |
2171 | ;------------------------------------------------------------------------------ |
2172 | ;? |
2172 | ;? |
2173 | ;------------------------------------------------------------------------------ |
2173 | ;------------------------------------------------------------------------------ |
2174 | xor eax, eax |
2174 | xor eax, eax |
2175 | mov edx, [TASK_COUNT] |
2175 | mov edx, [thread_count] |
2176 | movzx edx, word[WIN_POS + edx * 2] |
2176 | movzx edx, word[WIN_POS + edx * 2] |
2177 | cmp edx, [CURRENT_TASK] |
2177 | cmp edx, [CURRENT_TASK] |
2178 | jne @f |
2178 | jne @f |
2179 | inc eax |
2179 | inc eax |
2180 | ;-------------------------------------- |
2180 | ;-------------------------------------- |
Line 2375... | Line 2375... | ||
2375 | push esi |
2375 | push esi |
2376 | pushfd |
2376 | pushfd |
2377 | cli |
2377 | cli |
Line 2378... | Line 2378... | ||
2378 | 2378 | ||
2379 | push ebp |
2379 | push ebp |
2380 | mov ebp, [TASK_COUNT] |
2380 | mov ebp, [thread_count] |
2381 | cmp ebp, 1 |
2381 | cmp ebp, 1 |
Line 2382... | Line 2382... | ||
2382 | jbe .exit |
2382 | jbe .exit |
2383 | 2383 | ||
Line 2393... | Line 2393... | ||
2393 | mov dword[esp+10h], eax |
2393 | mov dword[esp+10h], eax |
2394 | ;-------------------------------------- |
2394 | ;-------------------------------------- |
2395 | align 4 |
2395 | align 4 |
2396 | .layout: |
2396 | .layout: |
2397 | mov esi, 1 ; = num in window stack |
2397 | mov esi, 1 ; = num in window stack |
2398 | mov ebp, [TASK_COUNT] |
2398 | mov ebp, [thread_count] |
2399 | ;-------------------------------------- |
2399 | ;-------------------------------------- |
2400 | align 4 |
2400 | align 4 |
2401 | .next_window: |
2401 | .next_window: |
2402 | movzx edi, word[WIN_POS + esi * 2] |
2402 | movzx edi, word[WIN_POS + esi * 2] |
2403 | shl edi, 5 ;size of TASKDATA and WDATA = 32 bytes |
2403 | shl edi, 5 ;size of TASKDATA and WDATA = 32 bytes |