Subversion Repositories Kolibri OS

Rev

Rev 5452 | Rev 6218 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5452 Rev 5872
Line 1... Line -...
1
;------------------------------------------------------------------------------
-
 
2
align 4
1
draw_tray:	; draw cpu usage, time, date etc.
3
draw_tray:    ; draw cpu usage, time, date etc.
2
	pusha
4
	pusha
3
	call	draw_tray_buttons
5
 
-
 
6
	call	draw_tray_buttons
4
	call	draw_time_skin
7
	call	draw_time_skin
5
	call	draw_time
8
	call	draw_time
6
	mov	[draw_flag_certainly],1
9
	
-
 
10
	mov	[draw_flag_certainly],1
7
	call	draw_flag	; language
11
   	call	draw_flag	; language
8
	call	draw_list_button
12
 
-
 
13
	call	draw_list_button
9
	popa
14
 
-
 
15
	popa
10
	ret
16
	ret
11
;---------------------------------------------------------------
17
;------------------------------------------------------------------------------
12
draw_tray_buttons:
18
draw_tray_buttons:
13
	mov	[offset_x_tray],0
19
	mov	[offset_x_tray],0
14
	cmp	[minimize_right],dword 0
20
 
-
 
21
	cmp	[minimize_right],dword 0
15
	je	@f
22
	je	@f
16
	add	[offset_x_tray],MR_SIZE
23
	
-
 
24
	add	[offset_x_tray],MR_SIZE
17
@@:
25
;--------------------------------------
-
 
26
align 4	
-
 
27
@@:
18
	mov	ecx,[height]
28
;	mov	ecx,3 shl 16
-
 
29
;	add	ecx,[height]
-
 
30
;	sub	cx,6
-
 
31
	mov	ecx,[height]
19
	mov	esi,[wcolor]
32
	mov	esi,[wcolor]
20
	mov	eax,8
33
	mov	eax,8
21
	cmp	[clock_enable],dword 0
34
;--------------------------------------
-
 
35
	cmp	[clock_enable],dword 0
22
	je	@f
36
	je	@f
23
	add	[offset_x_tray],CLOCK_SIZE
37
	
-
 
38
	add	[offset_x_tray],CLOCK_SIZE
24
	mov	ebx,[max_x]
39
 
-
 
40
	mov	ebx,[max_x]
25
	sub	ebx,[offset_x_tray]
41
	sub	ebx,[offset_x_tray]
26
	shl	ebx,16
42
	shl	ebx,16
27
	add	ebx,CLOCK_SIZE+1
43
	add	ebx,CLOCK_SIZE+1
28
	mcall	,,,0x60000000+2		; time/date button
44
	mcall	,,,0x60000000+2	; time/date button
29
	sub	ebx,3
45
        sub     ebx,3
30
	mov	[pos_x_clock],ebx
46
	mov	[pos_x_clock],ebx
31
@@:
47
;--------------------------------------
-
 
48
align 4	
-
 
49
@@:
32
	cmp	[cpu_usage_enable],dword 0
50
	cmp	[cpu_usage_enable],dword 0
33
	je	@f
51
	je	@f
34
	add	[offset_x_tray],CPU_USAGE_SIZE
52
	
-
 
53
	add	[offset_x_tray],CPU_USAGE_SIZE
35
	mov	ebx,[max_x]
54
 
-
 
55
	mov	ebx,[max_x]
36
	sub	ebx,[offset_x_tray]
56
	sub	ebx,[offset_x_tray]
37
	shl	ebx,16
57
	shl	ebx,16
38
	add	ebx,CPU_USAGE_SIZE+1
58
	add	ebx,CPU_USAGE_SIZE+1
39
	mcall	,,,0x60000000+18	;button 18 - sysmeter_name (GMON)
59
	mcall	,,,0x60000000+18	;button 18 - sysmeter_name (GMON)
40
	sub	ebx,3
60
        sub     ebx,3
41
	mov	[pos_x_cpu_usage],ebx
61
	mov	[pos_x_cpu_usage],ebx
42
@@:
62
;--------------------------------------
-
 
63
align 4	
-
 
64
@@:
43
	cmp	[chlang_enable],dword 0
65
	cmp	[chlang_enable],dword 0
44
	je	@f
66
	je	@f
45
	add	[offset_x_tray],CHLANG_SIZE
67
	
-
 
68
	add	[offset_x_tray],CHLANG_SIZE
46
	mov	ebx,[max_x]
69
 
-
 
70
	mov	ebx,[max_x]
47
	sub	ebx,[offset_x_tray]
71
	sub	ebx,[offset_x_tray]
48
	shl	ebx,16
72
	shl	ebx,16
49
	add	ebx,CHLANG_SIZE+1
73
	add	ebx,CHLANG_SIZE+1
50
	mcall	,,,0x60000000+16	;button 16 - chang language
74
	mcall	,,,0x60000000+16	;button 16 - chang language
51
	sub	ebx,3
75
        sub     ebx,3
52
	mov	[pos_x_cpu_chlang],ebx
76
	mov	[pos_x_cpu_chlang],ebx
53
@@:
77
;--------------------------------------
-
 
78
align 4	
-
 
79
@@:
54
	cmp	[page_list_enable],dword 0
80
	cmp	[page_list_enable],dword 0
55
	je	@f
81
	je	@f
56
	add	[offset_x_tray],PAGE_LIST_SIZE
82
	
-
 
83
	add	[offset_x_tray],PAGE_LIST_SIZE
57
	mov	ebx,[max_x]
84
 
-
 
85
	mov	ebx,[max_x]
58
	sub	ebx,[offset_x_tray]
86
	sub	ebx,[offset_x_tray]
59
	shl	ebx,16
87
	shl	ebx,16
60
	add	ebx,10
88
	add	ebx,10
61
	mov	[pos_x_page_list],ebx
89
	mov	[pos_x_page_list],ebx
62
	mcall	,,,0x60000000+22	;button 22 - page list decrease
90
	mcall	,,,0x60000000+22	;button 22 - page list decrease
63
 
Line 91... Line 64...
91
	
64
	add	ebx,24 shl 16
92
	add	ebx,24 shl 16
-
 
93
	
65
	mcall	,,,0x60000000+21	;button 21 - page list decrease
94
	mcall	,,,0x60000000+21	;button 21 - page list decrease
-
 
95
;--------------------------------------
-
 
96
align 4	
66
@@:
97
@@:
67
	ret
98
	ret
68
;---------------------------------------------------------------
99
;------------------------------------------------------------------------------
-
 
100
align 4
69
draw_time_skin:
101
draw_time_skin:
70
	cmp	[clock_enable],dword 0
102
	cmp	[clock_enable],dword 0
71
	je	@b
103
	je	.exit
-
 
104
	
-
 
105
 
72
	mov	ebx,[pos_x_clock]
106
	mov	ebx,[pos_x_clock]
73
	call	calculate_button_y_coordinate_and_size
Line 107... Line 74...
107
	call	calculate_button_y_coordinate_and_size
74
 
108
	
75
	mov	edx,[Clock_color]	;time_bgr_color
109
	mov	edx,[Clock_color]	;time_bgr_color
76
	mov	esi,[wcolor]
110
	mov	esi,[wcolor]
-
 
111
	call	draw_appl_button
-
 
112
;--------------------------------------
-
 
113
align 4
-
 
114
.exit:
77
	jmp	draw_appl_button
115
	ret
-
 
116
;------------------------------------------------------------------------------
78
;---------------------------------------------------------------
117
align 4
79
draw_time:
118
draw_time:
80
	cmp	[clock_enable],dword 0
119
	cmp	[clock_enable],dword 0
-
 
120
	je	.exit
81
	je	@b
121
	
82
	mcall	3
122
	mcall	3
83
	cmp	eax,[ptime]
123
	cmp	eax,[ptime]
-
 
124
	jz	.exit
84
	jz	@b
125
 
-
 
-
 
85
	mov	[ptime],eax
126
	mov	[ptime],eax
86
 
127
;--------------------------------------
87
; draw hours and minutes
128
; draw hours and minutes
88
	movzx	ebx,al
129
	movzx	ebx,al
89
	shr	eax,8
130
	shr	eax,8
90
	movzx	ecx,al
131
	movzx	ecx,al
91
	shr	eax,8
132
	shr	eax,8
-
 
133
	movzx	edx,al
92
	movzx	edx,al
134
; ebx ecx edx h m s
93
	push	ebx
Line 135... Line 94...
135
	push	ebx
94
	push	ecx
136
	push	ecx
95
 
Line 141... Line 100...
141
	shr	eax,1
100
	sub	eax,4
142
	sub	eax,4
101
	shr	ecx,16
143
	shr	ecx,16
102
	add	eax,ecx
144
	add	eax,ecx
103
	mov	bx,ax
145
	mov	bx,ax
104
	add	ebx,18 shl 16
146
	
-
 
147
	add	ebx,18 shl 16
105
	mov	ecx,[PanelText_color]
148
	
-
 
149
;	mov	ecx,[bte]
-
 
150
	mov	ecx,[PanelText_color]
106
	or	ecx,0x40000000
151
	or	ecx,0x40000000
107
	mov	edx,[esp]	; __:_X
152
	mov	edx,[esp]	       ; __:_X
108
	and	edx,15
153
	and	edx,15
109
	add	ebx,10*65536
154
	add	ebx,10*65536
110
	add	edx,text
Line 172... Line 128...
172
	shr	edx,4
128
	and	edx,15
173
	and	edx,15
129
	sub	ebx,6*65536
174
	sub	ebx,6*65536
130
	add	edx,text
175
	add	edx,text
131
	mcall
176
	mcall
132
 
177
;--------------------------------------
-
 
-
 
133
; draw seconds
178
; draw seconds
134
	mov	ebx,[pos_x_clock]
179
	mov	ebx,[pos_x_clock]
135
	call	calculate_button_y_coordinate_and_size
180
	call	calculate_button_y_coordinate_and_size
136
	movzx	eax,cx
181
	movzx	eax,cx
137
	shr	eax,1
182
	shr	eax,1
138
	sub	eax,4
183
	sub	eax,4
139
	shr	ecx,16
184
	shr	ecx,16
140
	add	eax,ecx
185
	add	eax,ecx
141
	mov	bx,ax
186
	mov	bx,ax
142
	add	ebx,17 shl 16
187
 
-
 
188
	add	ebx,17 shl 16
143
	mcall	3
189
	
-
 
190
	mcall	3
144
 
Line 191... Line 145...
191
 
145
	mov	ecx,eax
192
	mov	ecx,eax
146
	shr	ecx,16
193
	shr	ecx,16
147
	and	ecx,1
194
	and	ecx,1
-
 
195
;	mov	edx,[bte]
148
	mov	edx,[PanelText_color]
196
	mov	edx,[PanelText_color]
149
	sub	edx,[Clock_color]	;time_bgr_color;[wcolor]
197
	sub	edx,[Clock_color]	;time_bgr_color;[wcolor]
150
	imul	ecx,edx
198
	imul	ecx,edx
151
	add	ecx,[Clock_color]	;time_bgr_color;[wcolor]
199
	add	ecx,[Clock_color]	;time_bgr_color;[wcolor]
-
 
200
 
152
	mcall	4,,,sec,1
Line 201... Line 153...
201
	mcall	4,,,sec,1
153
 
202
 
-
 
203
   	call	draw_cpu_usage
-
 
204
;--------------------------------------
-
 
205
align 4
-
 
206
.exit:
154
	jmp	draw_cpu_usage
207
	ret
-
 
208
;------------------------------------------------------------------------------
155
;---------------------------------------------------------------
209
align 4
156
draw_list_button:
210
draw_list_button:
157
	cmp	[page_list_enable],dword 0
-
 
158
	je	@f
211
	cmp	[page_list_enable],dword 0
159
 
212
	je	.exit
160
; draw page list button  "skin"
213
; draw page list button  "skin"
161
	mov	ebx,[pos_x_page_list]
214
	mov	ebx,[pos_x_page_list]
-
 
215
	mov	bx,10
162
	mov	bx,10
Line 216... Line -...
216
	
-
 
217
	call	calculate_button_y_coordinate_and_size
-
 
218
 
-
 
219
;	mov	ecx,3 shl 16
-
 
220
;	add	ecx,[height]
163
	call	calculate_button_y_coordinate_and_size
221
;	sub	cx,6
-
 
222
 
-
 
223
	xor	edx,edx
164
 
224
;	mcall	13
165
	xor	edx,edx
225
 
166
	mov	edx,[PageList_color]	;0xffffff
Line 226... Line 167...
226
	mov	edx,[PageList_color]	;0xffffff
167
	mov	esi,[wcolor]
227
	mov	esi,[wcolor]
-
 
228
	call	draw_appl_button
-
 
229
	
168
	call	draw_appl_button
230
	add	ebx,24 shl 16 ; 18 shl 16
169
 
231
;	mcall
170
	add	ebx,24 shl 16 ; 18 shl 16
Line 232... Line -...
232
 
-
 
233
	mov	edx,[PageList_color]	;0xffffff
-
 
234
	mov	esi,[wcolor]
-
 
235
	call	draw_appl_button
-
 
236
	
-
 
237
;	sub	ebx,23 shl 16 ; 19 shl 16
-
 
238
;	sub	bx,2
-
 
239
 
-
 
240
;	add	ecx,1 shl 16
-
 
241
;	sub	ecx,2
-
 
242
;	mcall	,,,0xffffff
171
	mov	edx,[PageList_color]	;0xffffff
243
 
172
	mov	esi,[wcolor]
244
;	add	ebx,24 shl 16
173
	call	draw_appl_button
245
;	mcall
-
 
246
;--------------------------------------
-
 
247
; draw page list button  text <>
-
 
248
	mov	ebx,[pos_x_page_list]
-
 
249
	add	ebx,2 shl 16
-
 
250
;	mov	eax,[height]
174
 
251
;	shr	eax,1
175
; draw page list button  text <>
252
;	sub	eax,4
176
	mov	ebx,[pos_x_page_list]
253
;	mov	bx,ax
177
	add	ebx,2 shl 16
254
 
178
	call	calculate_button_y_coordinate_and_size
255
	call	calculate_button_y_coordinate_and_size
179
	movzx	eax,cx
256
	movzx	eax,cx
180
	shr	eax,1
257
	shr	eax,1
-
 
258
	sub	eax,4
181
	sub	eax,4
259
	shr	ecx,16
182
	shr	ecx,16
Line 260... Line 183...
260
	add	eax,ecx
183
	add	eax,ecx
261
	mov	bx,ax
184
	mov	bx,ax
262
 
-
 
-
 
185
	xor	ecx,ecx
263
	xor	ecx,ecx
186
	mcall	4,,,page_a1,5
264
	mcall	4,,,page_a1,5
187
 
265
 
188
	add	ebx,1 shl 16
266
	add	ebx,1 shl 16
189
	mcall
267
	mcall
-
 
268
;--------------------------------------
-
 
269
; draw page list number
190
 
270
	mov	edx,ebx
191
; draw page list number
271
	add	edx,9 shl 16
192
	mov	edx,ebx
272
	mcall	47,0x20000,[page_list],,[system_colours.work_button_text]
-
 
273
;--------------------------------------
193
	add	edx,9 shl 16
274
align 4
194
	mcall	47,0x20000,[page_list],,[system_colours.work_button_text]
275
.exit:	
195
@@:
Line 276... Line 196...
276
	ret
196
	ret
-
 
197
;---------------------------------------------------------------
277
;------------------------------------------------------------------------------
198
draw_cpu_usage:
278
align 4
199
	cmp	[cpu_usage_enable],dword 0
279
draw_cpu_usage:
200
	je	@b
280
	cmp	[cpu_usage_enable],dword 0
201
 
281
	je	.exit
-
 
282
 
202
	pushad
283
	pushad
203
 
Line 284... Line 204...
284
	mov	eax,[height]
204
	mov	eax,[height]
285
	sub	eax,[button_top_offset]
205
	sub	eax,[button_top_offset]
Line 299... Line 219...
299
	cdq
219
	pop	ebx
300
	pop	ebx
220
	inc	ebx
301
	inc	ebx
221
	div	ebx
302
	div	ebx
222
	cmp	eax,[ysi]
303
	cmp	eax,[ysi]
223
	jng	@f
304
	jng	.no_bug
224
	mov	eax,[ysi]
305
 
-
 
306
	mov	eax,[ysi]
225
@@:
307
;--------------------------------------
-
 
308
align 4
-
 
309
.no_bug:
226
	push	eax
310
	push	eax
227
	mov	ebx,[pos_x_cpu_usage]
311
 
-
 
312
	mov	ebx,[pos_x_cpu_usage]
228
	mov	ecx,[button_top_offset]
313
	mov	ecx,[button_top_offset]
229
	shl	ecx,16
314
	shl	ecx,16
230
	add	ecx,[ysi]
315
	add	ecx,[ysi]
231
	add	ecx,2
316
	add	ecx,2
232
	mov	edx,[CpuUsageBckgr_color]	;0xdd2222
317
 
-
 
318
	mov	edx,[CpuUsageBckgr_color]	;0xdd2222
233
	mov	esi,[wcolor]
319
	mov	esi,[wcolor]
234
	call	draw_appl_button
320
	call	draw_appl_button
235
	pop	eax
321
 
-
 
322
	pop	eax
236
 
Line 323... Line -...
323
 
-
 
324
;	mov	ecx,4 shl 16
237
	mov	ecx,[button_top_offset]
325
	mov	ecx,[button_top_offset]
238
	inc	ecx
326
	inc	ecx
239
	shl	ecx,16
327
	shl	ecx,16
240
	add	ecx,eax
328
	add	ecx,eax
-
 
329
	
-
 
330
	
241
	add	ebx,1 shl 16
331
	add	ebx,1 shl 16
242
	sub	ebx,2
332
	sub	ebx,2
-
 
333
	
243
	mcall	13,,,[CpuUsage_color]	;0x44aa44
Line 334... Line 244...
334
	mcall	13,,,[CpuUsage_color]	;0x44aa44
244
 
335
 
-
 
336
	popad
-
 
337
;--------------------------------------
245
	popad
338
align 4
246
@@:
339
.exit:
247
	ret
340
	ret
-
 
341
;------------------------------------------------------------------------------
248
;---------------------------------------------------------------
342
align 4
-
 
343
; eax = number (1 or 2)
249
; get and draw keyboard layout
344
; ebx = language id
250
draw_flag:
345
draw_flag:
251
	cmp	[chlang_enable],dword 0
346
	cmp	[chlang_enable],dword 0
-
 
347
	je	.exit
252
	je	@b
348
 
253
	cmp	[draw_flag_certainly],0
Line 349... Line 254...
349
	cmp	[draw_flag_certainly],0
254
	je	@b
350
	je	.exit
-
 
351
 
-
 
352
	pusha
-
 
Line 353... Line 255...
353
;--------------------------------------
255
 
354
; get and draw keyboard layout
-
 
355
	mcall	26,2,9
256
	pusha
356
 
257
 
357
	mov	ebx,eax
-
 
358
 
-
 
359
;	mov	eax,2
-
 
Line 360... Line 258...
360
	mov	[type_lang],al
258
	mcall	26,2,9
361
; eax = 2 BIG
259
	mov	edx,eax
362
; eax = 1 small
260
	mov	[type_lang],al
363
	mov	edx,ebx
-
 
364
 
-
 
365
	pushad
-
 
366
	mov	ebx,[pos_x_cpu_chlang]
-
 
367
	call	calculate_button_y_coordinate_and_size
261
 
368
 
-
 
369
;	cmp	[type_lang],1
-
 
370
;	je	.label_1
-
 
371
 
-
 
372
	mov	edx,[ChangeLang_color]	;time_bgr_color	;0xff ;[wcolor]
-
 
373
;	jmp	.label_2
-
 
374
;--------------------------------------
-
 
375
;align 4
-
 
376
;.label_1:
262
	pushad
377
;	mov	edx,0x7700
263
	mov	ebx,[pos_x_cpu_chlang]
378
;--------------------------------------
-
 
379
;align 4
264
	call	calculate_button_y_coordinate_and_size
Line 380... Line 265...
380
;.label_2:
265
	mov	edx,[ChangeLang_color]	;time_bgr_color	;0xff ;[wcolor]
381
	mov	esi,[wcolor]
266
	mov	esi,[wcolor]
382
	call	draw_appl_button
267
	call	draw_appl_button
383
 
268
	popad
384
	popad
269
 
385
 
270
	mov	ebx,[pos_x_cpu_chlang]
386
	mov	ebx,[pos_x_cpu_chlang]
-
 
387
	mov	ax,bx
271
	mov	ax,bx
388
	shr	eax,1
272
	shr	eax,1
389
	shl	eax,16
273
	shl	eax,16
390
	add	ebx,eax
274
	add	ebx,eax
391
	sub	ebx,6 shl 16
275
	sub	ebx,6 shl 16
392
 
276
	call	calculate_button_y_coordinate_and_size
393
	call	calculate_button_y_coordinate_and_size
277
	movzx	eax,cx
394
	movzx	eax,cx
-
 
395
	shr	eax,1
-
 
396
	sub	eax,4
278
	shr	eax,1
Line 397... Line 279...
397
	shr	ecx,16
279
	sub	eax,4
398
	add	eax,ecx
-
 
399
	mov	bx,ax
-
 
400
 
-
 
401
;	mov	ecx,[bte] ; color
280
	shr	ecx,16
402
	mov	ecx,[PanelText_color]
-
 
403
 
-
 
404
if caps_lock_check
-
 
405
; make flag_text 'enfigerufretua' or 'ENFIGERUFRETUA' depending on CapsLock state.
-
 
406
	call	flag_text_setup
281
	add	eax,ecx
407
end if
-
 
408
	dec	edx
-
 
409
	shl	edx,1
-
 
410
	add	edx,flag_text
-
 
411
	mcall	4,,,,2
-
 
412
	popa
-
 
413
	mov	[draw_flag_certainly],0
-
 
414
;--------------------------------------
-
 
415
align 4
-
 
416
.exit:
282
	mov	bx,ax
417
	ret
-
 
418
;------------------------------------------------------------------------------
-
 
419
align 4
283
	mov	ecx,[PanelText_color]
420
if caps_lock_check
284
 
421
flag_text_setup:
-
 
422
	pusha
285
if caps_lock_check
423
	mcall	66,3
-
 
424
	mov	edi, flag_text
-
 
425
	mov	esi, flag_text_caps_off
286
	push	ebx
426
	test	eax, 0x40
287
	mov	[flag_text],flagTextSm
427
	jz	@f
288
	mcall	66,3
Line -... Line 289...
-
 
289
	test	eax, 0x40
-
 
290
	jz	@f
-
 
291
	mov	[flag_text],flagTextBg
-
 
292
@@:
428
	
293
	pop	ebx
-
 
294
end if
429
	add	esi, 14
295
 
430
;--------------------------------------
-
 
431
align 4
-
 
432
@@:
-
 
433
	mov	ecx, 14
-
 
434
	rep	movsb
-
 
435
	
-
 
436
	popa
-