Rev 5844 | Rev 5865 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5844 | Rev 5847 | ||
---|---|---|---|
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: 5844 $ |
9 | $Revision: 5847 $ |
10 | 10 | ||
11 | ;============================================================================== |
11 | ;============================================================================== |
Line 28... | Line 28... | ||
28 | uglobal |
28 | uglobal |
29 | common_colours rd 48 |
29 | common_colours rd 48 |
30 | draw_limits RECT |
30 | draw_limits RECT |
31 | endg |
31 | endg |
Line 32... | Line -... | ||
32 | - | ||
33 | align 4 |
32 | |
34 | ;------------------------------------------------------------------------------ |
33 | ;------------------------------------------------------------------------------ |
35 | syscall_draw_window: ;///// system function 0 ///////////////////////////////// |
34 | syscall_draw_window: ;///// system function 0 ///////////////////////////////// |
36 | ;------------------------------------------------------------------------------ |
- | |
37 | ;? |
- | |
38 | ;------------------------------------------------------------------------------ |
35 | ;------------------------------------------------------------------------------ |
39 | mov eax, edx |
36 | mov eax, edx |
40 | shr eax, 24 |
37 | shr eax, 24 |
41 | and al, 0x0f |
38 | and al, 0x0f |
42 | cmp al, 5 |
39 | cmp al, 5 |
Line 51... | Line 48... | ||
51 | 48 | ||
52 | ; type I - original style |
49 | ; type I - original style |
53 | call drawwindow_I |
50 | call drawwindow_I |
54 | jmp window._.draw_window_caption.2 |
51 | jmp window._.draw_window_caption.2 |
55 | ;-------------------------------------- |
- | |
56 | align 4 |
52 | ;-------------------------------------- |
57 | @@: |
53 | @@: |
58 | dec al |
54 | dec al |
Line 59... | Line 55... | ||
59 | jnz @f |
55 | jnz @f |
60 | - | ||
61 | ; type II - only reserve area, no draw |
- | |
62 | ; call sys_window_mouse |
56 | |
63 | ; call [draw_pointer] |
57 | ; type II - only reserve area, no draw |
64 | call __sys_draw_pointer |
58 | call __sys_draw_pointer |
65 | jmp .exit |
- | |
66 | ;-------------------------------------- |
59 | jmp .exit |
67 | align 4 |
60 | ;-------------------------------------- |
68 | @@: |
61 | @@: |
Line 69... | Line 62... | ||
69 | dec al |
62 | dec al |
70 | jnz @f |
63 | jnz @f |
71 | 64 | ||
72 | ; type III - new style |
- | |
73 | call drawwindow_III |
- | |
74 | jmp window._.draw_window_caption.2 |
65 | ; type III - new style |
75 | - | ||
76 | ; type IV & V - skinned window (resizable & not) |
66 | call drawwindow_III |
- | 67 | jmp window._.draw_window_caption.2 |
|
77 | ;-------------------------------------- |
68 | ;-------------------------------------- |
78 | align 4 |
69 | @@: |
79 | @@: |
70 | ; type IV & V - skinned window (resizable & not) |
80 | mov eax, [TASK_COUNT] |
71 | mov eax, [TASK_COUNT] |
81 | movzx eax, word[WIN_POS + eax * 2] |
72 | movzx eax, word[WIN_POS + eax * 2] |
82 | cmp eax, [CURRENT_TASK] |
73 | cmp eax, [CURRENT_TASK] |
83 | setz al |
74 | setz al |
84 | movzx eax, al |
75 | movzx eax, al |
85 | push eax |
76 | push eax |
86 | call drawwindow_IV |
- | |
87 | jmp window._.draw_window_caption.2 |
77 | call drawwindow_IV |
88 | ;-------------------------------------- |
78 | jmp window._.draw_window_caption.2 |
89 | align 4 |
79 | ;-------------------------------------- |
90 | .exit: |
- | |
91 | ret |
- | |
92 | ;------------------------------------------------------------------------------ |
80 | .exit: |
93 | align 4 |
81 | ret |
94 | ;------------------------------------------------------------------------------ |
82 | ;------------------------------------------------------------------------------ |
95 | syscall_display_settings: ;///// system function 48 /////////////////////////// |
83 | syscall_display_settings: ;///// system function 48 /////////////////////////// |
96 | ;------------------------------------------------------------------------------ |
84 | ;------------------------------------------------------------------------------ |
Line 133... | Line 121... | ||
133 | ;; Set skin: |
121 | ;; Set skin: |
134 | ;< ebx = 8 |
122 | ;< ebx = 8 |
135 | ;< ecx = pointer to FileInfoBlock struct |
123 | ;< ecx = pointer to FileInfoBlock struct |
136 | ;> eax = FS error code |
124 | ;> eax = FS error code |
137 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
125 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
138 | ;; Set font smoothing: |
126 | ;; Get font smoothing: |
139 | ;< ebx = 9 |
127 | ;< ebx = 9 |
- | 128 | ;> eax = 0 — off, 1 — on, 2 — subpixel |
|
- | 129 | ; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|
- | 130 | ;; Set font smoothing: |
|
- | 131 | ;< ebx = 10 |
|
140 | ;< ecx = 0 (off) or !0 (on) |
132 | ;< ecx = 0 — off, 1 — on, 2 — subpixel |
141 | ;------------------------------------------------------------------------------ |
133 | ;------------------------------------------------------------------------------ |
142 | cmp ebx, .sizeof.ftable / 4 |
134 | cmp ebx, .sizeof.ftable / 4 |
143 | ja @f |
135 | ja @f |
144 | jmp [.ftable + ebx * 4] |
136 | jmp [.ftable + ebx * 4] |
145 | ;-------------------------------------- |
- | |
146 | align 4 |
- | |
147 | @@: |
- | |
148 | ret |
- | |
149 | ;------------------------------------------------------------------------------ |
137 | ;------------------------------------------------------------------------------ |
150 | align 4 |
- | |
151 | syscall_display_settings.00: |
138 | syscall_display_settings.00: |
152 | xor eax, eax |
139 | xor eax, eax |
153 | inc ebx |
140 | inc ebx |
154 | cmp [windowtypechanged], ebx |
141 | cmp [windowtypechanged], ebx |
155 | jne .exit |
142 | jne @f |
156 | mov [windowtypechanged], eax |
143 | mov [windowtypechanged], eax |
157 | - | ||
158 | jmp syscall_display_settings._.redraw_whole_screen |
144 | jmp syscall_display_settings._.redraw_whole_screen |
159 | ;-------------------------------------- |
- | |
160 | align 4 |
- | |
161 | .exit: |
- | |
162 | ret |
- | |
163 | ;------------------------------------------------------------------------------ |
145 | ;------------------------------------------------------------------------------ |
164 | align 4 |
- | |
165 | syscall_display_settings.01: |
146 | syscall_display_settings.01: |
166 | and ecx, 1 |
147 | and ecx, 1 |
167 | cmp ecx, [buttontype] |
148 | cmp ecx, [buttontype] |
168 | je .exit |
149 | je @f |
169 | mov [buttontype], ecx |
150 | mov [buttontype], ecx |
170 | mov [windowtypechanged], ebx |
151 | mov [windowtypechanged], ebx |
171 | ;-------------------------------------- |
- | |
172 | align 4 |
- | |
173 | .exit: |
152 | @@: |
174 | ret |
153 | ret |
175 | ;------------------------------------------------------------------------------ |
154 | ;------------------------------------------------------------------------------ |
176 | align 4 |
- | |
177 | syscall_display_settings.02: |
155 | syscall_display_settings.02: |
178 | dec ebx |
156 | dec ebx |
179 | mov esi, ecx |
157 | mov esi, ecx |
180 | cmp edx, 192 |
158 | cmp edx, 192 |
181 | jnae @f |
159 | jnae @f |
Line 185... | Line 163... | ||
185 | mov ecx, edx |
163 | mov ecx, edx |
186 | rep movsb |
164 | rep movsb |
187 | mov [windowtypechanged], ebx |
165 | mov [windowtypechanged], ebx |
188 | ret |
166 | ret |
189 | ;------------------------------------------------------------------------------ |
167 | ;------------------------------------------------------------------------------ |
190 | align 4 |
- | |
191 | syscall_display_settings.03: |
168 | syscall_display_settings.03: |
192 | mov edi, ecx |
169 | mov edi, ecx |
193 | cmp edx, 192 |
170 | cmp edx, 192 |
194 | jnae @f |
171 | jnae @f |
195 | mov edx, 192 ; max size |
172 | mov edx, 192 ; max size |
Line 197... | Line 174... | ||
197 | mov esi, common_colours |
174 | mov esi, common_colours |
198 | mov ecx, edx |
175 | mov ecx, edx |
199 | rep movsb |
176 | rep movsb |
200 | ret |
177 | ret |
201 | ;------------------------------------------------------------------------------ |
178 | ;------------------------------------------------------------------------------ |
202 | align 4 |
- | |
203 | syscall_display_settings.04: |
179 | syscall_display_settings.04: |
204 | mov eax, [_skinh] |
180 | mov eax, [_skinh] |
205 | mov [esp + 32], eax |
181 | mov [esp + 32], eax |
206 | ret |
182 | ret |
207 | ;------------------------------------------------------------------------------ |
183 | ;------------------------------------------------------------------------------ |
208 | align 4 |
- | |
209 | syscall_display_settings.05: |
184 | syscall_display_settings.05: |
210 | mov eax, [screen_workarea.left - 2] |
185 | mov eax, [screen_workarea.left - 2] |
211 | mov ax, word[screen_workarea.right] |
186 | mov ax, word[screen_workarea.right] |
212 | mov [esp + 32], eax |
187 | mov [esp + 32], eax |
213 | mov eax, [screen_workarea.top - 2] |
188 | mov eax, [screen_workarea.top - 2] |
214 | mov ax, word[screen_workarea.bottom] |
189 | mov ax, word[screen_workarea.bottom] |
215 | mov [esp + 20], eax |
190 | mov [esp + 20], eax |
216 | ret |
191 | ret |
217 | ;------------------------------------------------------------------------------ |
192 | ;------------------------------------------------------------------------------ |
218 | align 4 |
- | |
219 | syscall_display_settings.06: |
193 | syscall_display_settings.06: |
220 | xor esi, esi |
194 | xor esi, esi |
221 | - | ||
222 | mov edi, [_display.width] |
195 | mov edi, [_display.width] |
223 | dec edi |
196 | dec edi |
224 | mov eax, ecx |
197 | mov eax, ecx |
225 | movsx ebx, ax |
198 | movsx ebx, ax |
226 | sar eax, 16 |
199 | sar eax, 16 |
Line 228... | Line 201... | ||
228 | jge .check_horizontal |
201 | jge .check_horizontal |
229 | inc esi |
202 | inc esi |
230 | or eax, eax |
203 | or eax, eax |
231 | jge @f |
204 | jge @f |
232 | xor eax, eax |
205 | xor eax, eax |
233 | ;-------------------------------------- |
- | |
234 | align 4 |
- | |
235 | @@: |
206 | @@: |
236 | mov [screen_workarea.left], eax |
207 | mov [screen_workarea.left], eax |
237 | cmp ebx, edi |
208 | cmp ebx, edi |
238 | jle @f |
209 | jle @f |
239 | mov ebx, edi |
210 | mov ebx, edi |
240 | ;-------------------------------------- |
- | |
241 | align 4 |
- | |
242 | @@: |
211 | @@: |
243 | mov [screen_workarea.right], ebx |
212 | mov [screen_workarea.right], ebx |
244 | ;-------------------------------------- |
- | |
245 | align 4 |
- | |
246 | .check_horizontal: |
213 | .check_horizontal: |
247 | mov edi, [_display.height] |
214 | mov edi, [_display.height] |
248 | dec edi |
215 | dec edi |
249 | mov eax, edx |
216 | mov eax, edx |
250 | movsx ebx, ax |
217 | movsx ebx, ax |
Line 253... | Line 220... | ||
253 | jge .check_if_redraw_needed |
220 | jge .check_if_redraw_needed |
254 | inc esi |
221 | inc esi |
255 | or eax, eax |
222 | or eax, eax |
256 | jge @f |
223 | jge @f |
257 | xor eax, eax |
224 | xor eax, eax |
258 | ;-------------------------------------- |
- | |
259 | align 4 |
- | |
260 | @@: |
225 | @@: |
261 | mov [screen_workarea.top], eax |
226 | mov [screen_workarea.top], eax |
262 | cmp ebx, edi |
227 | cmp ebx, edi |
263 | jle @f |
228 | jle @f |
264 | mov ebx, edi |
229 | mov ebx, edi |
265 | ;-------------------------------------- |
- | |
266 | align 4 |
- | |
267 | @@: |
230 | @@: |
268 | mov [screen_workarea.bottom], ebx |
231 | mov [screen_workarea.bottom], ebx |
269 | ;-------------------------------------- |
- | |
270 | align 4 |
- | |
271 | .check_if_redraw_needed: |
232 | .check_if_redraw_needed: |
272 | or esi, esi |
233 | or esi, esi |
273 | jz .exit |
234 | jz @f |
Line 274... | Line 235... | ||
274 | 235 | ||
275 | call repos_windows |
236 | call repos_windows |
276 | jmp syscall_display_settings._.calculate_whole_screen |
- | |
277 | ;-------------------------------------- |
- | |
278 | align 4 |
- | |
279 | .exit: |
- | |
280 | ret |
237 | jmp syscall_display_settings._.calculate_whole_screen |
281 | ;------------------------------------------------------------------------------ |
- | |
282 | align 4 |
238 | ;------------------------------------------------------------------------------ |
283 | syscall_display_settings.07: |
239 | syscall_display_settings.07: |
284 | mov eax, [_skinmargins + 0] |
240 | mov eax, [_skinmargins + 0] |
285 | mov [esp + 32], eax |
241 | mov [esp + 32], eax |
286 | mov eax, [_skinmargins + 4] |
242 | mov eax, [_skinmargins + 4] |
- | 243 | mov [esp + 20], eax |
|
287 | mov [esp + 20], eax |
244 | @@: |
288 | ret |
245 | ret |
289 | ;------------------------------------------------------------------------------ |
- | |
290 | align 4 |
246 | ;------------------------------------------------------------------------------ |
291 | syscall_display_settings.08: |
247 | syscall_display_settings.08: |
292 | mov ebx, ecx |
248 | mov ebx, ecx |
293 | call read_skin_file |
249 | call read_skin_file |
294 | mov [esp + 32], eax |
250 | mov [esp + 32], eax |
295 | test eax, eax |
251 | test eax, eax |
Line 296... | Line 252... | ||
296 | jnz .exit |
252 | jnz @b |
297 | 253 | ||
298 | call syscall_display_settings._.calculate_whole_screen |
- | |
299 | jmp syscall_display_settings._.redraw_whole_screen |
- | |
300 | ;-------------------------------------- |
- | |
301 | align 4 |
- | |
302 | .exit: |
254 | call syscall_display_settings._.calculate_whole_screen |
303 | ret |
- | |
304 | ;------------------------------------------------------------------------------ |
255 | jmp syscall_display_settings._.redraw_whole_screen |
- | 256 | ;------------------------------------------------------------------------------ |
|
- | 257 | syscall_display_settings.09: |
|
- | 258 | xor eax, eax |
|
- | 259 | mov al, [fontSmoothing] |
|
- | 260 | mov [esp + 32], eax |
|
- | 261 | ret |
|
305 | align 4 |
262 | ;------------------------------------------------------------------------------ |
306 | syscall_display_settings.09: |
263 | syscall_display_settings.10: |
307 | mov [fontSmoothing], cl |
264 | mov [fontSmoothing], cl |
308 | ret |
- | |
309 | ;------------------------------------------------------------------------------ |
265 | ret |
310 | align 4 |
266 | ;------------------------------------------------------------------------------ |
311 | syscall_display_settings._.calculate_whole_screen: |
267 | syscall_display_settings._.calculate_whole_screen: |
312 | xor eax, eax |
268 | xor eax, eax |
313 | xor ebx, ebx |
269 | xor ebx, ebx |
314 | mov ecx, [_display.width] |
270 | mov ecx, [_display.width] |
315 | mov edx, [_display.height] |
271 | mov edx, [_display.height] |
316 | dec ecx |
272 | dec ecx |
317 | dec edx |
273 | dec edx |
318 | jmp calculatescreen |
- | |
319 | ;------------------------------------------------------------------------------ |
274 | jmp calculatescreen |
320 | align 4 |
275 | ;------------------------------------------------------------------------------ |
321 | syscall_display_settings._.redraw_whole_screen: |
276 | syscall_display_settings._.redraw_whole_screen: |
322 | xor eax, eax |
277 | xor eax, eax |
323 | mov [draw_limits.left], eax |
278 | mov [draw_limits.left], eax |
Line 329... | Line 284... | ||
329 | dec eax |
284 | dec eax |
330 | mov [draw_limits.bottom], eax |
285 | mov [draw_limits.bottom], eax |
331 | mov eax, window_data |
286 | mov eax, window_data |
332 | jmp redrawscreen |
287 | jmp redrawscreen |
333 | ;------------------------------------------------------------------------------ |
288 | ;------------------------------------------------------------------------------ |
334 | align 4 |
- | |
335 | ;------------------------------------------------------------------------------ |
- | |
336 | syscall_set_window_shape: ;///// system function 50 /////////////////////////// |
289 | syscall_set_window_shape: ;///// system function 50 /////////////////////////// |
337 | ;------------------------------------------------------------------------------ |
290 | ;------------------------------------------------------------------------------ |
338 | ;; Set window shape address: |
291 | ;; Set window shape address: |
339 | ;> ebx = 0 |
292 | ;> ebx = 0 |
340 | ;> ecx = shape data address |
293 | ;> ecx = shape data address |
Line 1445... | Line 1398... | ||
1445 | ;///// private functions ////////////////////////////////////////////////////// |
1398 | ;///// private functions ////////////////////////////////////////////////////// |
1446 | ;============================================================================== |
1399 | ;============================================================================== |
Line 1447... | Line 1400... | ||
1447 | 1400 | ||
1448 | iglobal |
1401 | iglobal |
1449 | FuncTable syscall_display_settings, ftable, \ |
1402 | FuncTable syscall_display_settings, ftable, \ |
Line 1450... | Line 1403... | ||
1450 | 00, 01, 02, 03, 04, 05, 06, 07, 08, 09 |
1403 | 00, 01, 02, 03, 04, 05, 06, 07, 08, 09, 10 |
1451 | 1404 | ||
1452 | align 4 |
1405 | align 4 |
1453 | window_topleft dd \ |
1406 | window_topleft dd \ |