Subversion Repositories Kolibri OS

Rev

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

Rev 5872 Rev 6218
1
draw_tray:	; draw cpu usage, time, date etc.
1
draw_tray:	; draw cpu usage, time, date etc.
2
	pusha
2
	pusha
3
	call	draw_tray_buttons
3
	call	draw_tray_buttons
4
	call	draw_time_skin
4
	call	draw_time_skin
5
	call	draw_time
5
	call	draw_time
6
	mov	[draw_flag_certainly],1
6
	mov	[draw_flag_certainly],1
7
	call	draw_flag	; language
7
	call	draw_flag	; language
8
	call	draw_list_button
8
	call	draw_list_button
9
	popa
9
	popa
10
	ret
10
	ret
11
;---------------------------------------------------------------
11
;---------------------------------------------------------------
12
draw_tray_buttons:
12
draw_tray_buttons:
13
	mov	[offset_x_tray],0
13
	mov	[offset_x_tray],0
14
	cmp	[minimize_right],dword 0
14
	cmp	[minimize_right],dword 0
15
	je	@f
15
	je	@f
16
	add	[offset_x_tray],MR_SIZE
16
	add	[offset_x_tray],MR_SIZE
17
@@:
17
@@:
18
	mov	ecx,[height]
18
	mov	ecx,[height]
19
	mov	esi,[wcolor]
19
	mov	esi,[wcolor]
20
	mov	eax,8
20
	mov	eax,8
21
	cmp	[clock_enable],dword 0
21
	cmp	[clock_enable],dword 0
22
	je	@f
22
	je	@f
23
	add	[offset_x_tray],CLOCK_SIZE
23
	add	[offset_x_tray],CLOCK_SIZE
24
	mov	ebx,[max_x]
24
	mov	ebx,[max_x]
25
	sub	ebx,[offset_x_tray]
25
	sub	ebx,[offset_x_tray]
26
	shl	ebx,16
26
	shl	ebx,16
27
	add	ebx,CLOCK_SIZE+1
27
	add	ebx,CLOCK_SIZE+1
28
	mcall	,,,0x60000000+2		; time/date button
28
	mcall	,,,0x60000000+2		; time/date button
29
	sub	ebx,3
29
	sub	ebx,3
30
	mov	[pos_x_clock],ebx
30
	mov	[pos_x_clock],ebx
31
@@:
31
@@:
32
	cmp	[cpu_usage_enable],dword 0
32
	cmp	[cpu_usage_enable],dword 0
33
	je	@f
33
	je	@f
34
	add	[offset_x_tray],CPU_USAGE_SIZE
34
	add	[offset_x_tray],CPU_USAGE_SIZE
35
	mov	ebx,[max_x]
35
	mov	ebx,[max_x]
36
	sub	ebx,[offset_x_tray]
36
	sub	ebx,[offset_x_tray]
37
	shl	ebx,16
37
	shl	ebx,16
38
	add	ebx,CPU_USAGE_SIZE+1
38
	add	ebx,CPU_USAGE_SIZE+1
39
	mcall	,,,0x60000000+18	;button 18 - sysmeter_name (GMON)
39
	mcall	,,,0x60000000+18	;button 18 - sysmeter_name (GMON)
40
	sub	ebx,3
40
	sub	ebx,3
41
	mov	[pos_x_cpu_usage],ebx
41
	mov	[pos_x_cpu_usage],ebx
42
@@:
42
@@:
43
	cmp	[chlang_enable],dword 0
43
	cmp	[chlang_enable],dword 0
44
	je	@f
44
	je	@f
45
	add	[offset_x_tray],CHLANG_SIZE
45
	add	[offset_x_tray],CHLANG_SIZE
46
	mov	ebx,[max_x]
46
	mov	ebx,[max_x]
47
	sub	ebx,[offset_x_tray]
47
	sub	ebx,[offset_x_tray]
48
	shl	ebx,16
48
	shl	ebx,16
49
	add	ebx,CHLANG_SIZE+1
49
	add	ebx,CHLANG_SIZE+1
50
	mcall	,,,0x60000000+16	;button 16 - chang language
50
	mcall	,,,0x60000000+16	;button 16 - chang language
51
	sub	ebx,3
51
	sub	ebx,3
52
	mov	[pos_x_cpu_chlang],ebx
52
	mov	[pos_x_cpu_chlang],ebx
53
@@:
53
@@:
54
	cmp	[page_list_enable],dword 0
54
	cmp	[page_list_enable],dword 0
55
	je	@f
55
	je	@f
56
	add	[offset_x_tray],PAGE_LIST_SIZE
56
	add	[offset_x_tray],PAGE_LIST_SIZE
57
	mov	ebx,[max_x]
57
	mov	ebx,[max_x]
58
	sub	ebx,[offset_x_tray]
58
	sub	ebx,[offset_x_tray]
59
	shl	ebx,16
59
	shl	ebx,16
60
	add	ebx,10
60
	add	ebx,10
61
	mov	[pos_x_page_list],ebx
61
	mov	[pos_x_page_list],ebx
62
	mcall	,,,0x60000000+22	;button 22 - page list decrease
62
	mcall	,,,0x60000000+22	;button 22 - page list decrease
63
 
63
 
64
	add	ebx,24 shl 16
64
	add	ebx,24 shl 16
65
	mcall	,,,0x60000000+21	;button 21 - page list decrease
65
	mcall	,,,0x60000000+21	;button 21 - page list decrease
66
@@:
66
@@:
67
	ret
67
	ret
68
;---------------------------------------------------------------
68
;---------------------------------------------------------------
69
draw_time_skin:
69
draw_time_skin:
70
	cmp	[clock_enable],dword 0
70
	cmp	[clock_enable],dword 0
71
	je	@b
71
	je	@b
72
	mov	ebx,[pos_x_clock]
72
	mov	ebx,[pos_x_clock]
73
	call	calculate_button_y_coordinate_and_size
73
	call	calculate_button_y_coordinate_and_size
74
 
74
 
75
	mov	edx,[Clock_color]	;time_bgr_color
75
	mov	edx,[Clock_color]	;time_bgr_color
76
	mov	esi,[wcolor]
76
	mov	esi,[wcolor]
77
	jmp	draw_appl_button
77
	jmp	draw_appl_button
78
;---------------------------------------------------------------
78
;---------------------------------------------------------------
79
draw_time:
79
draw_time:
80
	cmp	[clock_enable],dword 0
80
	cmp	[clock_enable],dword 0
81
	je	@b
81
	je	@b
82
	mcall	3
82
	mcall	3
83
	cmp	eax,[ptime]
83
	cmp	eax,[ptime]
84
	jz	@b
84
	jz	@b
85
	mov	[ptime],eax
85
	mov	[ptime],eax
86
 
86
 
87
; draw hours and minutes
87
; draw hours and minutes
88
	movzx	ebx,al
88
	movzx	ebx,al
89
	shr	eax,8
89
	shr	eax,8
90
	movzx	ecx,al
90
	movzx	ecx,al
91
	shr	eax,8
91
	shr	eax,8
92
	movzx	edx,al
92
	movzx	edx,al
93
	push	ebx
93
	push	ebx
94
	push	ecx
94
	push	ecx
95
 
95
 
96
	mov	ebx,[pos_x_clock]
96
	mov	ebx,[pos_x_clock]
97
	call	calculate_button_y_coordinate_and_size
97
	call	calculate_button_y_coordinate_and_size
98
	movzx	eax,cx
98
	movzx	eax,cx
99
	shr	eax,1
99
	shr	eax,1
100
	sub	eax,4
100
	sub	eax,4
101
	shr	ecx,16
101
	shr	ecx,16
102
	add	eax,ecx
102
	add	eax,ecx
103
	mov	bx,ax
103
	mov	bx,ax
104
	add	ebx,18 shl 16
104
	add	ebx,18 shl 16
105
	mov	ecx,[PanelText_color]
105
	mov	ecx,[PanelText_color]
106
	or	ecx,0x40000000
106
	or	ecx,0x40000000
107
	mov	edx,[esp]	; __:_X
107
	mov	edx,[esp]	; __:_X
108
	and	edx,15
108
	and	edx,15
109
	add	ebx,10*65536
109
	add	ebx,10*65536
110
	add	edx,text
110
	add	edx,text
111
	mcall	4,,,,1,[Clock_color]	;time_bgr_color
111
	mcall	4,,,,1,[Clock_color]	;time_bgr_color
112
 
112
 
113
	pop	edx		; __:X_
113
	pop	edx		; __:X_
114
	shr	edx,4
114
	shr	edx,4
115
	and	edx,15
115
	and	edx,15
116
	sub	ebx,6*65536
116
	sub	ebx,6*65536
117
	add	edx,text
117
	add	edx,text
118
	mcall
118
	mcall
119
 
119
 
120
	mov	edx,[esp]	; _X:__
120
	mov	edx,[esp]	; _X:__
121
	and	edx,15
121
	and	edx,15
122
	sub	ebx,11*65536
122
	sub	ebx,11*65536
123
	add	edx,text
123
	add	edx,text
124
	mcall
124
	mcall
125
 
125
 
126
	pop	edx		; X_:__
126
	pop	edx		; X_:__
127
	shr	edx,4
127
	shr	edx,4
128
	and	edx,15
128
	and	edx,15
129
	sub	ebx,6*65536
129
	sub	ebx,6*65536
130
	add	edx,text
130
	add	edx,text
131
	mcall
131
	mcall
132
 
132
 
133
; draw seconds
133
; draw seconds
134
	mov	ebx,[pos_x_clock]
134
	mov	ebx,[pos_x_clock]
135
	call	calculate_button_y_coordinate_and_size
135
	call	calculate_button_y_coordinate_and_size
136
	movzx	eax,cx
136
	movzx	eax,cx
137
	shr	eax,1
137
	shr	eax,1
138
	sub	eax,4
138
	sub	eax,4
139
	shr	ecx,16
139
	shr	ecx,16
140
	add	eax,ecx
140
	add	eax,ecx
141
	mov	bx,ax
141
	mov	bx,ax
142
	add	ebx,17 shl 16
142
	add	ebx,17 shl 16
143
	mcall	3
143
	mcall	3
144
 
144
 
145
	mov	ecx,eax
145
	mov	ecx,eax
146
	shr	ecx,16
146
	shr	ecx,16
147
	and	ecx,1
147
	and	ecx,1
148
	mov	edx,[PanelText_color]
148
	mov	edx,[PanelText_color]
149
	sub	edx,[Clock_color]	;time_bgr_color;[wcolor]
149
	sub	edx,[Clock_color]	;time_bgr_color;[wcolor]
150
	imul	ecx,edx
150
	imul	ecx,edx
151
	add	ecx,[Clock_color]	;time_bgr_color;[wcolor]
151
	add	ecx,[Clock_color]	;time_bgr_color;[wcolor]
152
	mcall	4,,,sec,1
152
	mcall	4,,,sec,1
153
 
153
 
154
	jmp	draw_cpu_usage
154
	jmp	draw_cpu_usage
155
;---------------------------------------------------------------
155
;---------------------------------------------------------------
156
draw_list_button:
156
draw_list_button:
157
	cmp	[page_list_enable],dword 0
157
	cmp	[page_list_enable],dword 0
158
	je	@f
158
	je	@f
159
 
159
 
160
; draw page list button  "skin"
160
; draw page list button  "skin"
161
	mov	ebx,[pos_x_page_list]
161
	mov	ebx,[pos_x_page_list]
162
	mov	bx,10
162
	mov	bx,10
163
	call	calculate_button_y_coordinate_and_size
163
	call	calculate_button_y_coordinate_and_size
164
 
164
 
165
	xor	edx,edx
165
	xor	edx,edx
166
	mov	edx,[PageList_color]	;0xffffff
166
	mov	edx,[PageList_color]	;0xffffff
167
	mov	esi,[wcolor]
167
	mov	esi,[wcolor]
168
	call	draw_appl_button
168
	call	draw_appl_button
169
 
169
 
170
	add	ebx,24 shl 16 ; 18 shl 16
170
	add	ebx,24 shl 16 ; 18 shl 16
171
	mov	edx,[PageList_color]	;0xffffff
171
	mov	edx,[PageList_color]	;0xffffff
172
	mov	esi,[wcolor]
172
	mov	esi,[wcolor]
173
	call	draw_appl_button
173
	call	draw_appl_button
174
 
174
 
175
; draw page list button  text <>
175
; draw page list button  text <>
176
	mov	ebx,[pos_x_page_list]
176
	mov	ebx,[pos_x_page_list]
177
	add	ebx,2 shl 16
177
	add	ebx,2 shl 16
178
	call	calculate_button_y_coordinate_and_size
178
	call	calculate_button_y_coordinate_and_size
179
	movzx	eax,cx
179
	movzx	eax,cx
180
	shr	eax,1
180
	shr	eax,1
181
	sub	eax,4
181
	sub	eax,4
182
	shr	ecx,16
182
	shr	ecx,16
183
	add	eax,ecx
183
	add	eax,ecx
184
	mov	bx,ax
184
	mov	bx,ax
185
	xor	ecx,ecx
185
	xor	ecx,ecx
186
	mcall	4,,,page_a1,5
186
	mcall	4,,,page_a1,5
187
 
187
 
188
	add	ebx,1 shl 16
188
	add	ebx,1 shl 16
189
	mcall
189
	mcall
190
 
190
 
191
; draw page list number
191
; draw page list number
192
	mov	edx,ebx
192
	mov	edx,ebx
193
	add	edx,9 shl 16
193
	add	edx,9 shl 16
194
	mcall	47,0x20000,[page_list],,[system_colours.work_button_text]
194
	mcall	47,0x20000,[page_list],,[system_colours.taskbar_text]
195
@@:
195
@@:
196
	ret
196
	ret
197
;---------------------------------------------------------------
197
;---------------------------------------------------------------
198
draw_cpu_usage:
198
draw_cpu_usage:
199
	cmp	[cpu_usage_enable],dword 0
199
	cmp	[cpu_usage_enable],dword 0
200
	je	@b
200
	je	@b
201
 
201
 
202
	pushad
202
	pushad
203
 
203
 
204
	mov	eax,[height]
204
	mov	eax,[height]
205
	sub	eax,[button_top_offset]
205
	sub	eax,[button_top_offset]
206
	sub	eax,[button_bottom_offset]
206
	sub	eax,[button_bottom_offset]
207
	sub	eax,2
207
	sub	eax,2
208
	mov	[ysi],eax	;12
208
	mov	[ysi],eax	;12
209
	mcall	18,5	; TSC / SEC
209
	mcall	18,5	; TSC / SEC
210
 
210
 
211
	shr	eax,20
211
	shr	eax,20
212
	push	eax
212
	push	eax
213
	mcall	18,4	; IDLE / SEC
213
	mcall	18,4	; IDLE / SEC
214
 
214
 
215
	shr	eax,20
215
	shr	eax,20
216
	xor	edx,edx
216
	xor	edx,edx
217
	imul	eax,[ysi]
217
	imul	eax,[ysi]
218
	cdq
218
	cdq
219
	pop	ebx
219
	pop	ebx
220
	inc	ebx
220
	inc	ebx
221
	div	ebx
221
	div	ebx
222
	cmp	eax,[ysi]
222
	cmp	eax,[ysi]
223
	jng	@f
223
	jng	@f
224
	mov	eax,[ysi]
224
	mov	eax,[ysi]
225
@@:
225
@@:
226
	push	eax
226
	push	eax
227
	mov	ebx,[pos_x_cpu_usage]
227
	mov	ebx,[pos_x_cpu_usage]
228
	mov	ecx,[button_top_offset]
228
	mov	ecx,[button_top_offset]
229
	shl	ecx,16
229
	shl	ecx,16
230
	add	ecx,[ysi]
230
	add	ecx,[ysi]
231
	add	ecx,2
231
	add	ecx,2
232
	mov	edx,[CpuUsageBckgr_color]	;0xdd2222
232
	mov	edx,[CpuUsageBckgr_color]	;0xdd2222
233
	mov	esi,[wcolor]
233
	mov	esi,[wcolor]
234
	call	draw_appl_button
234
	call	draw_appl_button
235
	pop	eax
235
	pop	eax
236
 
236
 
237
	mov	ecx,[button_top_offset]
237
	mov	ecx,[button_top_offset]
238
	inc	ecx
238
	inc	ecx
239
	shl	ecx,16
239
	shl	ecx,16
240
	add	ecx,eax
240
	add	ecx,eax
241
	add	ebx,1 shl 16
241
	add	ebx,1 shl 16
242
	sub	ebx,2
242
	sub	ebx,2
243
	mcall	13,,,[CpuUsage_color]	;0x44aa44
243
	mcall	13,,,[CpuUsage_color]	;0x44aa44
244
 
244
 
245
	popad
245
	popad
246
@@:
246
@@:
247
	ret
247
	ret
248
;---------------------------------------------------------------
248
;---------------------------------------------------------------
249
; get and draw keyboard layout
249
; get and draw keyboard layout
250
draw_flag:
250
draw_flag:
251
	cmp	[chlang_enable],dword 0
251
	cmp	[chlang_enable],dword 0
252
	je	@b
252
	je	@b
253
	cmp	[draw_flag_certainly],0
253
	cmp	[draw_flag_certainly],0
254
	je	@b
254
	je	@b
255
 
255
 
256
	pusha
256
	pusha
257
 
257
 
258
	mcall	26,2,9
258
	mcall	26,2,9
259
	mov	edx,eax
259
	mov	edx,eax
260
	mov	[type_lang],al
260
	mov	[type_lang],al
261
 
261
 
262
	pushad
262
	pushad
263
	mov	ebx,[pos_x_cpu_chlang]
263
	mov	ebx,[pos_x_cpu_chlang]
264
	call	calculate_button_y_coordinate_and_size
264
	call	calculate_button_y_coordinate_and_size
265
	mov	edx,[ChangeLang_color]	;time_bgr_color	;0xff ;[wcolor]
265
	mov	edx,[ChangeLang_color]	;time_bgr_color	;0xff ;[wcolor]
266
	mov	esi,[wcolor]
266
	mov	esi,[wcolor]
267
	call	draw_appl_button
267
	call	draw_appl_button
268
	popad
268
	popad
269
 
269
 
270
	mov	ebx,[pos_x_cpu_chlang]
270
	mov	ebx,[pos_x_cpu_chlang]
271
	mov	ax,bx
271
	mov	ax,bx
272
	shr	eax,1
272
	shr	eax,1
273
	shl	eax,16
273
	shl	eax,16
274
	add	ebx,eax
274
	add	ebx,eax
275
	sub	ebx,6 shl 16
275
	sub	ebx,6 shl 16
276
	call	calculate_button_y_coordinate_and_size
276
	call	calculate_button_y_coordinate_and_size
277
	movzx	eax,cx
277
	movzx	eax,cx
278
	shr	eax,1
278
	shr	eax,1
279
	sub	eax,4
279
	sub	eax,4
280
	shr	ecx,16
280
	shr	ecx,16
281
	add	eax,ecx
281
	add	eax,ecx
282
	mov	bx,ax
282
	mov	bx,ax
283
	mov	ecx,[PanelText_color]
283
	mov	ecx,[PanelText_color]
284
 
284
 
285
if caps_lock_check
285
if caps_lock_check
286
	push	ebx
286
	push	ebx
287
	mov	[flag_text],flagTextSm
287
	mov	[flag_text],flagTextSm
288
	mcall	66,3
288
	mcall	66,3
289
	test	eax, 0x40
289
	test	eax, 0x40
290
	jz	@f
290
	jz	@f
291
	mov	[flag_text],flagTextBg
291
	mov	[flag_text],flagTextBg
292
@@:
292
@@:
293
	pop	ebx
293
	pop	ebx
294
end if
294
end if
295
 
295
 
296
	dec	edx
296
	dec	edx
297
	shl	edx,1
297
	shl	edx,1
298
	add	edx,[flag_text]
298
	add	edx,[flag_text]
299
	mcall	4,,,,2
299
	mcall	4,,,,2
300
	popa
300
	popa
301
	mov	[draw_flag_certainly],0
301
	mov	[draw_flag_certainly],0
302
	ret
302
	ret