Subversion Repositories Kolibri OS

Rev

Rev 5452 | Rev 6218 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2619 mario79 1
;------------------------------------------------------------------------------
2
; ***************************************************
3
; ********* WINDOW DEFINITIONS AND DRAW *************
4
; ***************************************************
5
align 4
6
draw_window:
7
	pusha
8
	mov	[running_applications],-1
9
	mcall	12,1
10
 
11
	mcall	48,3,system_colours,10*4
12
 
13
	mov	eax, [system_colours+4*6]
2634 mario79 14
	mov	edx,[system_colours+4*6]
15
	mov	eax,COLOR_CHANGE_MAGNITUDE
16
	call	subtract_color_change_magnitude
17
	mov	[wcolor], edx
18
 
2619 mario79 19
	mcall	14	; get screen max x & max y
20
 
21
	cmp	[width],dword 0
22
	je	no_def_width
23
 
24
	and	eax,0xffff
25
	mov	ebx,[width]
26
	shl	ebx,16
27
	add	eax,ebx
28
;--------------------------------------
29
align 4
30
no_def_width:
31
	mov	ebx,eax
32
	mov	[screenxy],ebx
33
	shr	ebx,16
34
	mov	ecx,eax
35
 
36
	cmp	[place_attachment],1
37
	je	@f
38
 
39
	xor	ecx,ecx
40
	mov	cx,[height]
41
	dec	cx
42
	jmp	.attachment_selected
43
;--------------------------------------
44
align 4
45
@@:
46
	sub	ecx,[height]
47
	inc	ecx
48
	shl	ecx,16
49
	mov	cx,[height]
50
	dec	cx
51
;--------------------------------------
52
align 4
53
.attachment_selected:
54
	xor	eax,eax 		    ; DEFINE AND DRAW WINDOW
55
	mov 	edx, [wcolor]
56
	or	edx, 0x01000000 ; do not draw the window
57
	mov	esi, [wcolor]
58
	or	esi, 0x01000000 ; unmovable window
59
	mov 	edi, [wcolor]
60
	mov	[panel_x_pos], ebx
61
	mov	[panel_y_pos], ecx	 ; Пока что так.
62
	mcall
63
 
64
	movzx	eax,word [screenxy+2]
65
	mov	[max_x],eax
66
 
67
	call	fill_window
68
	call	minimize_left_button
69
	call	minimize_right_button
70
	call	draw_menu_and_clean_desktop
71
	mov	[ptime],0
72
	call	draw_tray
73
	call	draw_application_buttons
74
 
2626 mario79 75
	mov	[redraw_window_flag],0
2619 mario79 76
	mcall	12,2
77
	popa
78
	ret
79
;------------------------------------------------------------------------------
80
align 4
81
fill_window:
82
	movzx	ebx,word [screenxy+2]
83
	xor	ecx,ecx
84
	mov	edx,[wcolor]
85
	mov	eax,COLOR_CHANGE_MAGNITUDE_0
86
	imul	eax,dword [soften_height]
87
	call	subtract_color_change_magnitude
88
	cmp	[soften_up],dword 0
89
	je	no_su
90
;--------------------------------------
91
align 4
5872 pathoswith 92
@@:
2619 mario79 93
	mov	eax,COLOR_CHANGE_MAGNITUDE_0
94
	call	add_color_change_magnitude
95
; draw soften_up - the width of 5 pixels
96
	and	edx,0x00FFFFFF
97
	mcall	38
98
 
99
	add	ecx,1*65536+1
100
	cmp	cx,[soften_height]	;5
101
	jb	@r
102
;--------------------------------------
103
align 4
104
no_su:
105
	cmp	[soften_down],dword 0
106
	je	no_sd
107
; draw soften_down - the width of 5 pixels
108
	pusha
109
	mov	esi,[soften_height]
110
	mov	ecx,[height]
111
	dec	ecx
112
	shl	ecx,16
113
	add	ecx,[height]
114
	dec	ecx
115
	mov	edx,[wcolor]
116
	mov	eax,COLOR_CHANGE_MAGNITUDE_0
117
	imul	eax,dword [soften_height]
118
	call	subtract_color_change_magnitude
2630 mario79 119
;--------------------------------------
120
align 4
2619 mario79 121
@@:
122
	mov	eax,COLOR_CHANGE_MAGNITUDE_0
123
	call	add_color_change_magnitude
124
	and	edx,0x00FFFFFF
125
	mcall	38
126
	sub	ecx,1*65536+1
127
	dec	esi
128
	jnz	@r
129
	popa
130
;--------------------------------------
131
align 4
132
no_sd:
133
	movzx	ebx,word [screenxy+2]
134
	xor	ecx,ecx
135
	cmp	[soften_up],dword 0
136
	je	@f
137
 
138
	add	ecx,[soften_height]
139
	rol	ecx,16
140
	add	ecx,[soften_height]
141
;--------------------------------------
142
align 4
143
@@:
144
	mov	edx,[wcolor]
145
;--------------------------------------
146
align 4
147
newline3:
148
	and	edx,0x00FFFFFF
149
	mov	eax,[height]
150
	cmp	[soften_up],dword 0
151
	je	@f
152
 
153
	sub	eax,[soften_height]
154
;--------------------------------------
155
align 4
156
@@:
157
	cmp	[soften_down],dword 0
158
	je	@f
159
 
160
	sub	eax,[soften_height]
161
;--------------------------------------
162
align 4
163
@@:
164
	mov	cx,ax
165
	inc	ebx
166
	mcall	13
167
	ret
168
;------------------------------------------------------------------------------
169
align 4
170
minimize_left_button:
171
	cmp	[minimize_left],dword 0
172
	je	.exit
173
 
174
	mov	ecx,1 *65536
175
	add	ecx,[height]
176
	dec	ecx
177
	mov	edx,101
178
	or	edx,0x40000000
179
	mcall	8,<0,9>,,,[wcolor]	; ABS LEFT
180
 
181
	mov	ebx,2*65536	;+6
182
	mov	bx,[height]
183
	shr	bx,1
184
	sub	bx,3
2626 mario79 185
	mov	edx,[wcolor]
186
	mov	eax,COLOR_CHANGE_MAGNITUDE_2
187
	call	add_color_change_magnitude
188
	mov	ecx,edx
2619 mario79 189
	mcall	4,,,hidetext,1	; HIDE TEXT
190
;--------------------------------------
191
align 4
192
.exit:
193
	ret
194
;------------------------------------------------------------------------------
195
align 4
196
minimize_right_button:
197
	cmp	[minimize_right],dword 0
198
	je	.exit
199
	mov	eax,[max_x]
200
	sub	eax,77
201
	shl	eax,16
202
	mov	ebx,eax
203
	add	ebx,67
204
 
205
	mov	ecx,1 *65536
206
	add	ecx,[height]
207
	dec	ecx
208
	add	ebx,68*65536
5872 pathoswith 209
	mov	bx,10	;9
2619 mario79 210
	mov	edx,102
211
	or	edx,0x40000000
212
	mcall	8,,,,[wcolor]	; ABS RIGHT
213
 
214
	mov	ebx,[max_x]
215
	sub	ebx,6
216
	shl	ebx,16
217
	mov	bx,[height]
218
	shr	bx,1
219
	sub	bx,3
2626 mario79 220
	mov	edx,[wcolor]
221
	mov	eax,COLOR_CHANGE_MAGNITUDE_2
222
	call	add_color_change_magnitude
223
	mov	ecx,edx
2619 mario79 224
	mov	esi,1
225
	mcall	4,,,hidetext+1
226
;--------------------------------------
227
align 4
228
.exit:
229
	ret
230
;------------------------------------------------------------------------------
231
align 4
232
draw_menu_and_clean_desktop:
233
	pusha
234
; check draw for menu
235
	cmp	[menu_enable],dword  0
236
	je	no_menu
237
; calculate and draw menu
238
	mov	ebx, (0 shl 16) + MENU_SIZE-3
239
; check for left minimize button enabled
240
	cmp	[minimize_left],dword 0
241
	je	@f
242
 
243
	add	ebx, ML_SIZE shl 16
244
;--------------------------------------
245
align 4
246
@@:
4031 heavyiron 247
        mov     ecx, [height]
4033 heavyiron 248
	mov	edx, 0x60d1ff01
2619 mario79 249
	mcall	8,,,,[wcolor]	; MENU BUTTON
250
 
251
	mov	eax,ebx
252
	shr	eax,16
253
	mov	[menu_button_x.start],eax
254
 
255
	mov	eax,ebx
256
	and	eax,0xffff
257
	mov	[menu_button_x.size],eax
258
 
259
	mov	eax,ecx
260
	shr	eax,16
261
	mov	[menu_button_y.start],eax
262
 
263
	mov	eax,ecx
264
	and	eax,0xffff
265
	mov	[menu_button_y.size],eax
266
 
4031 heavyiron 267
	call	calculate_button_y_coordinate_and_size
2619 mario79 268
	mov	edx,[MenuButton_color]	;0x44aa44
269
	mov	esi,[wcolor]
4031 heavyiron 270
        add     ebx,3 shl 16 - 5
2619 mario79 271
	call	draw_appl_button
272
 
5872 pathoswith 273
	add	ebx, 4*65536
2619 mario79 274
	mov	bx,[height]
275
	shr	bx,1
5872 pathoswith 276
	sub	bx,7
2626 mario79 277
	mov	ecx,[PanelText_color]
278
	or	ecx,0x10000000
3927 kaitz 279
	if lang eq et
280
	mcall	4,,,m_text,5
281
	else
2626 mario79 282
	mcall	4,,,m_text,4
3927 kaitz 283
	end if
2619 mario79 284
;--------------------------------------
285
align 4
286
no_menu:
287
; check draw for clean desktop button
288
	cmp	[clean_desktop_enable],dword 0
289
	je	.exit
290
; calculate and draw clean desktop button
291
	mov	ebx, (0 shl 16) + CLD_SIZE-5
292
; check for left minimize button enabled
293
	cmp	[minimize_left],dword 0
294
	je	@f
295
 
296
	add	ebx, ML_SIZE shl 16
297
;--------------------------------------
298
align 4
299
@@:
300
; check for menu button enabled
301
	cmp	[menu_enable],dword 0
302
	je	@f
303
 
304
	add	ebx, MENU_SIZE shl 16
305
;--------------------------------------
306
align 4
307
@@:
308
; Inserted code for drawing buttons 103, 104, 105 (Clean, Restore, Exchange windows)
309
	mov	esi, dword [system_colours+24]    ; drawing buttons
310
	and	esi, 0x00ffffff
4031 heavyiron 311
	mov	edx, 0x60000000 + 103
312
        mov     ecx, [height]
2619 mario79 313
	mcall	8	;,,<3,13>
314
 
4031 heavyiron 315
	call	calculate_button_y_coordinate_and_size
2619 mario79 316
	mov	edx,[CleanDesktopButton_color]	;time_bgr_color
317
	mov	esi,[wcolor]
318
	call	draw_appl_button
5872 pathoswith 319
 
2626 mario79 320
	mov	ecx,[PanelText_color]
2619 mario79 321
	add	ebx,5 shl 16
322
	mov	bx,[height]
323
	shr	bx,1
324
	sub	bx,2
325
	mcall	4,,,page_clean_but,1
326
	sub	bx,2
327
	mcall	,,,page_clean_but+1
328
;--------------------------------------
329
align 4
330
.exit:
331
	popa
332
	ret
333
;------------------------------------------------------------------------------
334
align 4
335
draw_application_buttons:
336
	pusha
337
 
338
	cmp	[run_appl],dword 0	; do not draw application buttons
339
	je	.exit
340
 
341
	call	calculate_offset_X
342
 
343
	mov	eax,[screenxy]
344
	shr	eax,16
345
 
346
	sub	eax,[offset_X]
347
; check for left minimize button enabled
348
	cmp	[minimize_right],dword 0
349
	je	@f
350
 
351
	sub	eax, MR_SIZE
352
;--------------------------------------
353
align 4
354
@@:
355
	cmp	[clock_enable],dword 0
356
	je	@f
357
 
358
	sub	eax,CLOCK_SIZE
359
;--------------------------------------
360
align 4
361
@@:
362
	cmp	[cpu_usage_enable],dword 0
363
	je	@f
364
 
365
	sub	eax,CPU_USAGE_SIZE
366
;--------------------------------------
367
align 4
368
@@:
369
	cmp	[chlang_enable],dword 0
370
	je	@f
371
 
372
	sub	eax,CHLANG_SIZE
373
;--------------------------------------
374
align 4
375
@@:
376
	cmp	[page_list_enable],dword 0
377
	je	@f
378
 
379
	sub	eax,PAGE_LIST_SIZE
380
;--------------------------------------
381
align 4
382
@@:
383
	mov	ebx, TAB_SIZE
384
	xor	edx,edx
385
	div	ebx
386
	mov	[max_applications], eax
387
	xor	edi,edi
388
;--------------------------------------
389
align 4
390
.nb:
391
	mov	ebx,edi
392
	imul	ebx,TAB_SIZE
393
	add	ebx,[offset_X]
394
	shl	ebx,16
395
	mov	bx, TAB_SIZE-1
396
	mov	edx,edi
397
	add	edx,52
398
	or	edx,0x60000000
4031 heavyiron 399
	mov	ecx, [height]
2619 mario79 400
	mcall	8,,,,[wcolor]
401
 
402
	inc	edi
403
	cmp	edi,[max_applications]
404
	jb	.nb
405
;--------------------------------------
406
align 4
407
.exit:
408
	popa
409
	ret
410
;------------------------------------------------------------------------------
411
align 4
412
calculate_offset_X:
413
	push	eax
414
	xor	eax,eax
415
; check for left minimize button enabled
416
	cmp	[minimize_left],dword 0
417
	je	@f
418
 
419
	add	eax, ML_SIZE
420
;--------------------------------------
421
align 4
422
@@:
423
; check for menu button enabled
424
	cmp	[menu_enable],dword 0
425
	je	@f
426
 
427
	add	eax, MENU_SIZE
428
;--------------------------------------
429
align 4
430
@@:
431
; check for clean desktop button enabled
432
	cmp	[clean_desktop_enable],dword 0
433
	je	@f
434
 
435
	add	eax, CLD_SIZE
436
;--------------------------------------
437
align 4
438
@@:
439
	mov	[offset_X],eax
440
	pop	eax
441
	ret
442
;------------------------------------------------------------------------------