Subversion Repositories Kolibri OS

Rev

Rev 2634 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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