Rev 4423 | Rev 5565 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4423 | Rev 5201 | ||
---|---|---|---|
Line 4... | Line 4... | ||
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: 4423 $ |
9 | $Revision: 5201 $ |
10 | 10 | ||
11 | ;============================================================================== |
11 | ;============================================================================== |
Line 24... | Line 24... | ||
24 | common |
24 | common |
25 | name#.sizeof.#table_name = $ - name#.#table_name |
25 | name#.sizeof.#table_name = $ - name#.#table_name |
26 | } |
26 | } |
Line 27... | Line 27... | ||
27 | 27 | ||
28 | uglobal |
28 | uglobal |
29 | common_colours rd 32 |
29 | common_colours rd 48 |
30 | draw_limits RECT |
30 | draw_limits RECT |
Line 31... | Line 31... | ||
31 | endg |
31 | endg |
32 | 32 | ||
33 | align 4 |
33 | align 4 |
34 | ;------------------------------------------------------------------------------ |
34 | ;------------------------------------------------------------------------------ |
35 | syscall_draw_window: ;///// system function 0 ///////////////////////////////// |
35 | syscall_draw_window: ;///// system function 0 ///////////////////////////////// |
36 | ;------------------------------------------------------------------------------ |
36 | ;------------------------------------------------------------------------------ |
37 | ;? |
37 | ;? |
38 | ;------------------------------------------------------------------------------ |
38 | ;------------------------------------------------------------------------------ |
39 | mov eax, edx |
39 | mov eax, edx |
40 | shr eax, 24 |
40 | shr eax, 24 |
Line 171... | Line 171... | ||
171 | ;------------------------------------------------------------------------------ |
171 | ;------------------------------------------------------------------------------ |
172 | align 4 |
172 | align 4 |
173 | syscall_display_settings.02: |
173 | syscall_display_settings.02: |
174 | dec ebx |
174 | dec ebx |
175 | mov esi, ecx |
175 | mov esi, ecx |
176 | and edx, 127 |
176 | cmp edx, 192 |
- | 177 | jnae @f |
|
- | 178 | mov edx, 192 ; max size |
|
- | 179 | @@: |
|
177 | mov edi, common_colours |
180 | mov edi, common_colours |
178 | mov ecx, edx |
181 | mov ecx, edx |
179 | rep movsb |
182 | rep movsb |
180 | mov [windowtypechanged], ebx |
183 | mov [windowtypechanged], ebx |
181 | ret |
184 | ret |
182 | ;------------------------------------------------------------------------------ |
185 | ;------------------------------------------------------------------------------ |
183 | align 4 |
186 | align 4 |
184 | syscall_display_settings.03: |
187 | syscall_display_settings.03: |
185 | mov edi, ecx |
188 | mov edi, ecx |
186 | and edx, 127 |
189 | cmp edx, 192 |
- | 190 | jnae @f |
|
- | 191 | mov edx, 192 ; max size |
|
- | 192 | @@: |
|
187 | mov esi, common_colours |
193 | mov esi, common_colours |
188 | mov ecx, edx |
194 | mov ecx, edx |
189 | rep movsb |
195 | rep movsb |
190 | ret |
196 | ret |
191 | ;------------------------------------------------------------------------------ |
197 | ;------------------------------------------------------------------------------ |
Line 207... | Line 213... | ||
207 | ;------------------------------------------------------------------------------ |
213 | ;------------------------------------------------------------------------------ |
208 | align 4 |
214 | align 4 |
209 | syscall_display_settings.06: |
215 | syscall_display_settings.06: |
210 | xor esi, esi |
216 | xor esi, esi |
Line 211... | Line 217... | ||
211 | 217 | ||
212 | mov edi, [_display.width] |
218 | mov edi, [Screen_Max_X] |
213 | mov eax, ecx |
219 | mov eax, ecx |
214 | movsx ebx, ax |
220 | movsx ebx, ax |
215 | sar eax, 16 |
221 | sar eax, 16 |
216 | cmp eax, ebx |
222 | cmp eax, ebx |
Line 231... | Line 237... | ||
231 | @@: |
237 | @@: |
232 | mov [screen_workarea.right], ebx |
238 | mov [screen_workarea.right], ebx |
233 | ;-------------------------------------- |
239 | ;-------------------------------------- |
234 | align 4 |
240 | align 4 |
235 | .check_horizontal: |
241 | .check_horizontal: |
236 | mov edi, [_display.height] |
242 | mov edi, [Screen_Max_Y] |
237 | mov eax, edx |
243 | mov eax, edx |
238 | movsx ebx, ax |
244 | movsx ebx, ax |
239 | sar eax, 16 |
245 | sar eax, 16 |
240 | cmp eax, ebx |
246 | cmp eax, ebx |
241 | jge .check_if_redraw_needed |
247 | jge .check_if_redraw_needed |
Line 292... | Line 298... | ||
292 | ;------------------------------------------------------------------------------ |
298 | ;------------------------------------------------------------------------------ |
293 | align 4 |
299 | align 4 |
294 | syscall_display_settings._.calculate_whole_screen: |
300 | syscall_display_settings._.calculate_whole_screen: |
295 | xor eax, eax |
301 | xor eax, eax |
296 | xor ebx, ebx |
302 | xor ebx, ebx |
297 | mov ecx, [_display.width] |
303 | mov ecx, [Screen_Max_X] |
298 | mov edx, [_display.height] |
304 | mov edx, [Screen_Max_Y] |
299 | jmp calculatescreen |
305 | jmp calculatescreen |
300 | ;------------------------------------------------------------------------------ |
306 | ;------------------------------------------------------------------------------ |
301 | align 4 |
307 | align 4 |
302 | syscall_display_settings._.redraw_whole_screen: |
308 | syscall_display_settings._.redraw_whole_screen: |
303 | xor eax, eax |
309 | xor eax, eax |
304 | mov [draw_limits.left], eax |
310 | mov [draw_limits.left], eax |
305 | mov [draw_limits.top], eax |
311 | mov [draw_limits.top], eax |
306 | mov eax, [_display.width] |
312 | mov eax, [Screen_Max_X] |
307 | dec eax |
- | |
308 | mov [draw_limits.right], eax |
313 | mov [draw_limits.right], eax |
309 | mov eax, [_display.height] |
314 | mov eax, [Screen_Max_Y] |
310 | dec eax |
- | |
311 | mov [draw_limits.bottom], eax |
315 | mov [draw_limits.bottom], eax |
312 | mov eax, window_data |
316 | mov eax, window_data |
313 | jmp redrawscreen |
317 | jmp redrawscreen |
314 | ;------------------------------------------------------------------------------ |
318 | ;------------------------------------------------------------------------------ |
315 | align 4 |
319 | align 4 |
Line 584... | Line 588... | ||
584 | test [edi + WDATA.fl_wstate], WSTATE_MAXIMIZED |
588 | test [edi + WDATA.fl_wstate], WSTATE_MAXIMIZED |
585 | jnz .fix_maximized |
589 | jnz .fix_maximized |
Line 586... | Line 590... | ||
586 | 590 | ||
587 | mov eax, [edi + WDATA.box.left] |
591 | mov eax, [edi + WDATA.box.left] |
588 | add eax, [edi + WDATA.box.width] |
592 | add eax, [edi + WDATA.box.width] |
589 | mov ebx, [_display.width] |
593 | mov ebx, [Screen_Max_X] |
590 | cmp eax, ebx |
594 | cmp eax, ebx |
591 | jl .fix_vertical |
595 | jle .fix_vertical |
592 | mov eax, [edi + WDATA.box.width] |
596 | mov eax, [edi + WDATA.box.width] |
593 | sub eax, ebx |
597 | sub eax, ebx |
594 | jle @f |
598 | jle @f |
595 | mov [edi + WDATA.box.width], ebx |
599 | mov [edi + WDATA.box.width], ebx |
Line 601... | Line 605... | ||
601 | ;-------------------------------------- |
605 | ;-------------------------------------- |
602 | align 4 |
606 | align 4 |
603 | .fix_vertical: |
607 | .fix_vertical: |
604 | mov eax, [edi + WDATA.box.top] |
608 | mov eax, [edi + WDATA.box.top] |
605 | add eax, [edi + WDATA.box.height] |
609 | add eax, [edi + WDATA.box.height] |
606 | mov ebx, [_display.height] |
610 | mov ebx, [Screen_Max_Y] |
607 | cmp eax, ebx |
611 | cmp eax, ebx |
608 | jl .fix_client_box |
612 | jle .fix_client_box |
609 | mov eax, [edi + WDATA.box.height] |
613 | mov eax, [edi + WDATA.box.height] |
610 | sub eax, ebx |
614 | sub eax, ebx |
611 | jle @f |
615 | jle @f |
612 | mov [edi + WDATA.box.height], ebx |
616 | mov [edi + WDATA.box.height], ebx |
613 | ;-------------------------------------- |
617 | ;-------------------------------------- |
Line 817... | Line 821... | ||
817 | mov edi, [esi + WDATA.cl_workarea] |
821 | mov edi, [esi + WDATA.cl_workarea] |
818 | test edi, 0x40000000 |
822 | test edi, 0x40000000 |
819 | jnz .exit |
823 | jnz .exit |
Line 820... | Line 824... | ||
820 | 824 | ||
821 | ; does client area have a positive size on screen? |
- | |
822 | mov edx, [esi + WDATA.box.top] |
- | |
823 | add edx, 21 + 5 |
- | |
824 | mov ebx, [esi + WDATA.box.top] |
825 | ; does client area have a positive size on screen? |
825 | add ebx, [esi + WDATA.box.height] |
- | |
826 | cmp edx, ebx |
826 | cmp [esi + WDATA.box.height], 21 |
Line 827... | Line 827... | ||
827 | jg .exit |
827 | jle .exit |
828 | 828 | ||
829 | ; okay, let's draw it |
829 | ; okay, let's draw it |
830 | mov eax, 1 |
830 | mov eax, 1 |
Line 1716... | Line 1716... | ||
1716 | mov eax, [edi + WDATA.box.left] |
1716 | mov eax, [edi + WDATA.box.left] |
1717 | mov ebx, [edi + WDATA.box.top] |
1717 | mov ebx, [edi + WDATA.box.top] |
1718 | mov ecx, [edi + WDATA.box.width] |
1718 | mov ecx, [edi + WDATA.box.width] |
1719 | mov edx, [edi + WDATA.box.height] |
1719 | mov edx, [edi + WDATA.box.height] |
Line 1720... | Line 1720... | ||
1720 | 1720 | ||
1721 | mov esi, [_display.width] |
1721 | mov esi, [Screen_Max_X] |
1722 | cmp ecx, esi |
1722 | cmp ecx, esi |
1723 | jae .fix_width_high |
1723 | ja .fix_width_high |
1724 | ;-------------------------------------- |
1724 | ;-------------------------------------- |
1725 | align 4 |
1725 | align 4 |
1726 | .check_left: |
1726 | .check_left: |
1727 | or eax, eax |
1727 | or eax, eax |
Line 1730... | Line 1730... | ||
1730 | cmp eax, esi |
1730 | cmp eax, esi |
1731 | jg .fix_left_high |
1731 | jg .fix_left_high |
1732 | ;-------------------------------------- |
1732 | ;-------------------------------------- |
1733 | align 4 |
1733 | align 4 |
1734 | .check_height: |
1734 | .check_height: |
1735 | mov esi, [_display.height] |
1735 | mov esi, [Screen_Max_Y] |
1736 | cmp edx, esi |
1736 | cmp edx, esi |
1737 | jae .fix_height_high |
1737 | ja .fix_height_high |
1738 | ;-------------------------------------- |
1738 | ;-------------------------------------- |
1739 | align 4 |
1739 | align 4 |
1740 | .check_top: |
1740 | .check_top: |
1741 | or ebx, ebx |
1741 | or ebx, ebx |
1742 | jl .fix_top_low |
1742 | jl .fix_top_low |
Line 1990... | Line 1990... | ||
1990 | cmp edx, [ff_xsz] |
1990 | cmp edx, [ff_xsz] |
1991 | jb .ff_new_x |
1991 | jb .ff_new_x |
Line 1992... | Line 1992... | ||
1992 | 1992 | ||
1993 | sub ebp, [ff_xsz] |
1993 | sub ebp, [ff_xsz] |
1994 | add ebp, [ff_x] |
1994 | add ebp, [ff_x] |
1995 | add ebp, [_display.width] ; screen.x |
1995 | add ebp, [Screen_Max_X] ; screen.x |
1996 | inc ebp |
1996 | inc ebp |
1997 | inc ebx |
1997 | inc ebx |
1998 | cmp ebx, [ff_ysz] |
1998 | cmp ebx, [ff_ysz] |