Subversion Repositories Kolibri OS

Rev

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

Rev 7181 Rev 7660
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;						    ;
2
;						    ;
3
;   TASK PANEL for KolibriOS  - Compile with fasm   ;
3
;   TASK PANEL for KolibriOS  - Compile with fasm   ;
4
;						    ;
4
;						    ;
5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;------------------------------------------------------------------------------
6
;------------------------------------------------------------------------------
7
; version:	2.25
7
; version:	2.25
8
; last update:	14/07/2013
8
; last update:	14/07/2013
9
; changed by:	Marat Zakiyanov aka Mario79, aka Mario
9
; changed by:	Marat Zakiyanov aka Mario79, aka Mario
10
; changes:	Reinstall screen work area after change screen resolution
10
; changes:	Reinstall screen work area after change screen resolution
11
;------------------------------------------------------------------------------
11
;------------------------------------------------------------------------------
12
; version:	2.24
12
; version:	2.24
13
; last update:	16/06/2013
13
; last update:	16/06/2013
14
; changed by:	hidnplayr
14
; changed by:	hidnplayr
15
; changes:	Changed keymap hotkeys to only use left alt
15
; changes:	Changed keymap hotkeys to only use left alt
16
;		(Right alt has special function on some keyboards)
16
;		(Right alt has special function on some keyboards)
17
;------------------------------------------------------------------------------
17
;------------------------------------------------------------------------------
18
; version:	2.23
18
; version:	2.23
19
; last update:	26/04/2012
19
; last update:	26/04/2012
20
; changed by:	Marat Zakiyanov aka Mario79, aka Mario
20
; changed by:	Marat Zakiyanov aka Mario79, aka Mario
21
; changes:	Using new  f18.23 - minimize all windows
21
; changes:	Using new  f18.23 - minimize all windows
22
;------------------------------------------------------------------------------
22
;------------------------------------------------------------------------------
23
; version:	2.22
23
; version:	2.22
24
; last update:	20/04/2012
24
; last update:	20/04/2012
25
; changed by:	Marat Zakiyanov aka Mario79, aka Mario
25
; changed by:	Marat Zakiyanov aka Mario79, aka Mario
26
; changes:	Activation mechanism when trying to run an existing appl.
26
; changes:	Activation mechanism when trying to run an existing appl.
27
;		Forced redrawing the background after the clean desktop (Win+D)
27
;		Forced redrawing the background after the clean desktop (Win+D)
28
;------------------------------------------------------------------------------
28
;------------------------------------------------------------------------------
29
; version:	2.2
29
; version:	2.2
30
; last update:	19/04/2012
30
; last update:	19/04/2012
31
; changed by:	Marat Zakiyanov aka Mario79, aka Mario
31
; changed by:	Marat Zakiyanov aka Mario79, aka Mario
32
; changes:	Support PrintScreen for SCRSHOOT.
32
; changes:	Support PrintScreen for SCRSHOOT.
33
;		Path to run applications from the INI file.
33
;		Path to run applications from the INI file.
34
;		Algorithm anti-duplication of applications for run with hotkey.
34
;		Algorithm anti-duplication of applications for run with hotkey.
35
;		Added color selection for the Alt+Tab.
35
;		Added color selection for the Alt+Tab.
36
;		Alt+Ctrl+ArrowLeft - Page list next
36
;		Alt+Ctrl+ArrowLeft - Page list next
37
;		Alt+Ctrl+ArrowRight - Page list previous
37
;		Alt+Ctrl+ArrowRight - Page list previous
38
;------------------------------------------------------------------------------
38
;------------------------------------------------------------------------------
39
; version:	2.1
39
; version:	2.1
40
; last update:	18/04/2012
40
; last update:	18/04/2012
41
; changed by:	Marat Zakiyanov aka Mario79, aka Mario
41
; changed by:	Marat Zakiyanov aka Mario79, aka Mario
42
; changes:	Added color selection for the text.
42
; changes:	Added color selection for the text.
43
;		Show "change page list" only if the applications
43
;		Show "change page list" only if the applications
44
;		does not fit in the panel.
44
;		does not fit in the panel.
45
;		Display file names up to 11 char previously displ. only 8 char.
45
;		Display file names up to 11 char previously displ. only 8 char.
46
;------------------------------------------------------------------------------
46
;------------------------------------------------------------------------------
47
; version:	2.0
47
; version:	2.0
48
; last update:	17/04/2012
48
; last update:	17/04/2012
49
; changed by:	Marat Zakiyanov aka Mario79, aka Mario
49
; changed by:	Marat Zakiyanov aka Mario79, aka Mario
50
; changes:	New logic of switching windows (turnoff/restore)
50
; changes:	New logic of switching windows (turnoff/restore)
51
;		New logic of button "clear desktop".
51
;		New logic of button "clear desktop".
52
;		Win+D (restore/clear desktop), Win+R (start RUN application).
52
;		Win+D (restore/clear desktop), Win+R (start RUN application).
53
;		Using the library LibINI to set the parameters.
53
;		Using the library LibINI to set the parameters.
54
;		New style of panel. Start application Menu with boot options.
54
;		New style of panel. Start application Menu with boot options.
55
;		two versions of the location of the panel -
55
;		two versions of the location of the panel -
56
;		the bottom of the desktop and on top of the desktop.
56
;		the bottom of the desktop and on top of the desktop.
57
;------------------------------------------------------------------------------
57
;------------------------------------------------------------------------------
58
; last update:	31/03/2012
58
; last update:	31/03/2012
59
; changed by:	Marat Zakiyanov aka Mario79, aka Mario
59
; changed by:	Marat Zakiyanov aka Mario79, aka Mario
60
; changes:	The program uses only 20 Kb memory is now.
60
; changes:	The program uses only 20 Kb memory is now.
61
;		Code optimizing and refactoring.
61
;		Code optimizing and refactoring.
62
;------------------------------------------------------------------------------
62
;------------------------------------------------------------------------------
63
format binary as ""
63
format binary as ""
64
 
64
 
65
	use32
65
	use32
66
	org 0x0
66
	org 0x0
67
	db 'MENUET01'	; 8 byte id
67
	db 'MENUET01'	; 8 byte id
68
	dd 0x01 	; header version
68
	dd 0x01 	; header version
69
	dd START	; program start
69
	dd START	; program start
70
	dd IM_END	; program image size
70
	dd IM_END	; program image size
71
	dd I_END	; reguired amount of memory - 10 Kb
71
	dd I_END	; reguired amount of memory - 10 Kb
72
	dd stack_top	; esp
72
	dd stack_top	; esp
73
	dd 0x0		; boot parameters
73
	dd 0x0		; boot parameters
74
	dd path 	; application pach
74
	dd path 	; application pach
75
;------------------------------------------------------------------------------
75
;------------------------------------------------------------------------------
76
include 'lang.inc'
76
include 'lang.inc'
77
include '../../../macros.inc'
77
include '../../../macros.inc'
78
include '../../../proc32.inc'
78
include '../../../proc32.inc'
79
;include '../../../debug.inc'
79
;include '../../../debug.inc'
80
include 'MOI.INC'	;à áª« ¤ª¨ ª« ¢¨ âãàë
80
include 'MOI.INC'	;à áª« ¤ª¨ ª« ¢¨ âãàë
81
include '../../../develop/libraries/box_lib/load_lib.mac'
81
include '../../../develop/libraries/box_lib/load_lib.mac'
82
	@use_library	;use load lib macros
82
	@use_library	;use load lib macros
83
;------------------------------------------------------------------------------
83
;------------------------------------------------------------------------------
84
caps_lock_check fix 1
84
caps_lock_check fix 1
85
;------------------------------------------------------------------------------
85
;------------------------------------------------------------------------------
86
time_bgr_color = 0x66cc
86
time_bgr_color = 0x66cc
87
;PANEL_HEIGHT = 18
87
;PANEL_HEIGHT = 18
88
ML_SIZE = 10
88
ML_SIZE = 10
89
MR_SIZE = 10
89
MR_SIZE = 10
90
if lang eq et
90
if lang eq et
91
MENU_SIZE = 60
91
MENU_SIZE = 60
92
else
92
else
93
MENU_SIZE = 50
93
MENU_SIZE = 50
94
end if
94
end if
95
CLD_SIZE = 20
95
CLD_SIZE = 20
96
TAB_SIZE = 75	;60
96
TAB_SIZE = 75	;60
97
TRAY_SIZE = 140
97
TRAY_SIZE = 140
98
 
98
 
99
CLOCK_SIZE = 40
99
CLOCK_SIZE = 40
100
CPU_USAGE_SIZE = 10
100
CPU_USAGE_SIZE = 10
101
CHLANG_SIZE = 20
101
CHLANG_SIZE = 20
102
PAGE_LIST_SIZE = 36
102
PAGE_LIST_SIZE = 36
103
;------------------------------------------------------------------------------
103
;------------------------------------------------------------------------------
104
align 4
104
align 4
105
handle_key:
105
handle_key:
106
	mcall	18,7
106
	mcall	18,7
107
	mov	[active_process],eax
107
	mov	[active_process],eax
108
 
108
 
109
	mcall	2
109
	mcall	2
110
 
110
 
111
;	dps	"panel key: "
111
;	dps	"panel key: "
112
;	dph	eax
112
;	dph	eax
113
;	newline
113
;	newline
114
 
114
 
115
	cmp	al, 2
115
	cmp	al, 2
116
	jnz	begin_1.ret
116
	jnz	begin_1.ret
117
 
117
 
118
	mov	ebx, exec_fileinfo
118
	mov	ebx, exec_fileinfo
119
	shr	eax, 8
119
	shr	eax, 8
120
	cmp	al, 0
120
	cmp	al, 0
121
	je	prod
121
	je	prod
122
 
122
 
123
	mov	[key_r],al
123
	mov	[key_r],al
124
	sub	[key_r],2
124
	sub	[key_r],2
125
	cmp	[key_r],9
125
	cmp	[key_r],9
126
	jc	alter
126
	jc	alter
127
 
127
 
128
if caps_lock_check
128
if caps_lock_check
129
	cmp	al,58	;CAPS LOCK DOWN
129
	cmp	al,58	;CAPS LOCK DOWN
130
	jne	@f
130
	jne	@f
131
 
131
 
132
	pusha
132
	pusha
133
	mcall	26,2,9
133
	mcall	26,2,9
134
	mov	ebx,eax
134
	mov	ebx,eax
135
	mov	eax,2
135
	mov	eax,2
136
	mov	[draw_flag_certainly],1
136
	mov	[draw_flag_certainly],1
137
	call	draw_flag	; language
137
	call	draw_flag	; language
138
	popa
138
	popa
139
	ret
139
	ret
140
@@:
140
@@:
141
end if
141
end if
142
 
142
 
143
	cmp	al, 15	; Alt+Tab DOWN
143
	cmp	al, 15	; Alt+Tab DOWN
144
	jz	alt_tab_pressed
144
	jz	alt_tab_pressed
145
 
145
 
146
	cmp	al, 88	; Ctrl+Alt+F12
146
	cmp	al, 88	; Ctrl+Alt+F12
147
	jz	start_end_application
147
	jz	start_end_application
148
 
148
 
149
	cmp	al, 91	; RWin DOWN
149
	cmp	al, 91	; RWin DOWN
150
	jz	set_win_key_flag
150
	jz	set_win_key_flag
151
 
151
 
152
	cmp	al, 92	; LWin DOWN
152
	cmp	al, 92	; LWin DOWN
153
	jz	set_win_key_flag
153
	jz	set_win_key_flag
154
 
154
 
155
	cmp	al, 219 ; RWin UP
155
	cmp	al, 219 ; RWin UP
156
	jz	cut_win_key_flag	;start_menu_application
156
	jz	cut_win_key_flag	;start_menu_application
157
 
157
 
158
	cmp	al, 220 ; LWin UP
158
	cmp	al, 220 ; LWin UP
159
	jz	cut_win_key_flag	;start_menu_application
159
	jz	cut_win_key_flag	;start_menu_application
160
 
160
 
161
	cmp	al, 62	; Alt+F4
161
	cmp	al, 62	; Alt+F4
162
	jz	kill_active_application
162
	jz	kill_active_application
163
 
163
 
164
	cmp	al, 205
164
	cmp	al, 205
165
	jz	page_list_next
165
	jz	page_list_next
166
 
166
 
167
	cmp	al, 203
167
	cmp	al, 203
168
	jz	page_list_prev
168
	jz	page_list_prev
169
 
169
 
170
	cmp	al, 69	; Alt+Shift+NumLock
170
	cmp	al, 69	; Alt+Shift+NumLock
171
	jz	start_mousemul_application
171
	jz	start_mousemul_application
172
 
172
 
173
	cmp	al, 19	; Win+R
173
	cmp	al, 19	; Win+R
174
	jz	start_run_application
174
	jz	start_run_application
175
 
175
 
176
	cmp	al, 32	; Win+D
176
	cmp	al, 32	; Win+D
177
	jz	minimize_all_windows
177
	jz	minimize_all_windows
178
 
178
 
179
	cmp	al, 55	; PrintScreen DOWN
179
	cmp	al, 55	; PrintScreen DOWN
180
	jz	start_PrintScreen_application
180
	jz	start_PrintScreen_application
181
;--------------------------------------
181
;--------------------------------------
182
align 4
182
align 4
183
prod:
183
prod:
184
	cmp	[current_alt_tab_app], -1
184
	cmp	[current_alt_tab_app], -1
185
	jz	@f
185
	jz	@f
186
 
186
 
187
	test	ah, 0x30	; Alt+Tab UP
187
	test	ah, 0x30	; Alt+Tab UP
188
	jz	alt_tab_released
188
	jz	alt_tab_released
189
;--------------------------------------
189
;--------------------------------------
190
align 4
190
align 4
191
@@:
191
@@:
192
; this is hotkey LCtrl+LShift ;or LShift+RShift
192
; this is hotkey LCtrl+LShift ;or LShift+RShift
193
	jmp	karu
193
	jmp	karu
194
;------------------------------------------------------------------------------
194
;------------------------------------------------------------------------------
195
align 4
195
align 4
196
set_win_key_flag:
196
set_win_key_flag:
197
	mov	[win_key_flag],1
197
	mov	[win_key_flag],1
198
	ret
198
	ret
199
;------------------------------------------------------------------------------
199
;------------------------------------------------------------------------------
200
align 4
200
align 4
201
cut_win_key_flag:
201
cut_win_key_flag:
202
	xor	eax,eax
202
	xor	eax,eax
203
	mov	[win_key_flag],al
203
	mov	[win_key_flag],al
204
	xchg	[start_menu_flag],al
204
	xchg	[start_menu_flag],al
205
	test	al,al
205
	test	al,al
206
	jz	start_menu_application
206
	jz	start_menu_application
207
	ret
207
	ret
208
;------------------------------------------------------------------------------
208
;------------------------------------------------------------------------------
209
align 4
209
align 4
210
change_key_lang:
210
change_key_lang:
211
	mov	dword [ebx+8], chlang
211
	mov	dword [ebx+8], chlang
212
	mcall	70
212
	mcall	70
213
;--------------------------------------
213
;--------------------------------------
214
align 4
214
align 4
215
begin_1:
215
begin_1:
216
	mov	ecx,[active_process]
216
	mov	ecx,[active_process]
217
	mcall	18, 3
217
	mcall	18, 3
218
	mcall	5, 25
218
	mcall	5, 25
219
;--------------------------------------
219
;--------------------------------------
220
align 4
220
align 4
221
.ret:
221
.ret:
222
	ret
222
	ret
223
;------------------------------------------------------------------------------
223
;------------------------------------------------------------------------------
224
align 4
224
align 4
225
start_end_application:
225
start_end_application:
226
	mov	esi,end_name
226
	mov	esi,end_name
227
	call	algorithm_anti_duplication
227
	call	algorithm_anti_duplication
228
	test	eax,eax
228
	test	eax,eax
229
	jz	@f
229
	jz	@f
230
 
230
 
231
	mcall	18,3,edi
231
	mcall	18,3,edi
232
	ret
232
	ret
233
;--------------------------------------
233
;--------------------------------------
234
align 4
234
align 4
235
@@:
235
@@:
236
	mov	ebx, exec_fileinfo
236
	mov	ebx, exec_fileinfo
237
	mov	dword [ebx+21],end_name
237
	mov	dword [ebx+21],end_name
238
	mcall	70
238
	mcall	70
239
	ret
239
	ret
240
;------------------------------------------------------------------------------
240
;------------------------------------------------------------------------------
241
align 4
241
align 4
242
start_mousemul_application:
242
start_mousemul_application:
243
	mov	esi,mousemul_name
243
	mov	esi,mousemul_name
244
	call	algorithm_anti_duplication
244
	call	algorithm_anti_duplication
245
	test	eax,eax
245
	test	eax,eax
246
	jz	@f
246
	jz	@f
247
	ret
247
	ret
248
;--------------------------------------
248
;--------------------------------------
249
align 4
249
align 4
250
@@:
250
@@:
251
	mov	ebx, exec_fileinfo
251
	mov	ebx, exec_fileinfo
252
	mov	dword [ebx+21],mousemul_name
252
	mov	dword [ebx+21],mousemul_name
253
	mcall	70
253
	mcall	70
254
	ret
254
	ret
255
;------------------------------------------------------------------------------
255
;------------------------------------------------------------------------------
256
align 4
256
align 4
257
kill_active_application:
257
kill_active_application:
258
	mcall	72,1,3,1
258
	mcall	72,1,3,1
259
	jmp	begin_1.ret
259
	jmp	begin_1.ret
260
;------------------------------------------------------------------------------
260
;------------------------------------------------------------------------------
261
 
261
 
262
align 4
262
align 4
263
start_menu_application:
263
start_menu_application:
264
	call	menu_handler
264
	call	menu_handler
265
	jmp	begin_1.ret
265
	jmp	begin_1.ret
266
;------------------------------------------------------------------------------
266
;------------------------------------------------------------------------------
267
align 4
267
align 4
268
start_run_application:
268
start_run_application:
269
	cmp	[win_key_flag],1
269
	cmp	[win_key_flag],1
270
	je	@f
270
	je	@f
271
	ret
271
	ret
272
;--------------------------------------
272
;--------------------------------------
273
align 4
273
align 4
274
@@:
274
@@:
275
	mov	[start_menu_flag],1
275
	mov	[start_menu_flag],1
276
 
276
 
277
	mov	esi,run_name
277
	mov	esi,run_name
278
	call	algorithm_anti_duplication
278
	call	algorithm_anti_duplication
279
	test	eax,eax
279
	test	eax,eax
280
	jz	@f
280
	jz	@f
281
 
281
 
282
	mcall	18,3,edi
282
	mcall	18,3,edi
283
	ret
283
	ret
284
;--------------------------------------
284
;--------------------------------------
285
align 4
285
align 4
286
@@:
286
@@:
287
	mov	ebx, exec_fileinfo
287
	mov	ebx, exec_fileinfo
288
	mov	dword [ebx+21], run_name
288
	mov	dword [ebx+21], run_name
289
	mcall	70
289
	mcall	70
290
	jmp	begin_1.ret
290
	jmp	begin_1.ret
291
;------------------------------------------------------------------------------
291
;------------------------------------------------------------------------------
292
align 4
292
align 4
293
start_PrintScreen_application:
293
start_PrintScreen_application:
294
	mov	esi,printscreen_name
294
	mov	esi,printscreen_name
295
	call	algorithm_anti_duplication
295
	call	algorithm_anti_duplication
296
	test	eax,eax
296
	test	eax,eax
297
	jz	@f
297
	jz	@f
298
	mcall	18,3,edi
298
	mcall	18,3,edi
299
	ret
299
	ret
300
;--------------------------------------
300
;--------------------------------------
301
align 4
301
align 4
302
@@:
302
@@:
303
	mov	ebx, exec_fileinfo
303
	mov	ebx, exec_fileinfo
304
	mov	dword [ebx+21],printscreen_name
304
	mov	dword [ebx+21],printscreen_name
305
	mov	[ebx+8],dword bootparam_printscreen
305
	mov	[ebx+8],dword bootparam_printscreen
306
	mcall	70
306
	mcall	70
307
	jmp	begin_1.ret
307
	jmp	begin_1.ret
308
;------------------------------------------------------------------------------
308
;------------------------------------------------------------------------------
309
align 4
309
align 4
310
minimize_all_windows:
310
minimize_all_windows:
311
	cmp	[win_key_flag],1
311
	cmp	[win_key_flag],1
312
	je	@f
312
	je	@f
313
	ret
313
	ret
314
;--------------------------------------
314
;--------------------------------------
315
align 4
315
align 4
316
@@:
316
@@:
317
	mov	[start_menu_flag],1
317
	mov	[start_menu_flag],1
318
	call	clean_desktop
318
	call	clean_desktop
319
	ret
319
	ret
320
;------------------------------------------------------------------------------
320
;------------------------------------------------------------------------------
321
align 4
321
align 4
322
algorithm_anti_duplication:
322
algorithm_anti_duplication:
323
	cld
323
	cld
324
;--------------------------------------
324
;--------------------------------------
325
align 4
325
align 4
326
@@:
326
@@:
327
	lodsb
327
	lodsb
328
	test	al,al
328
	test	al,al
329
	jnz	@r
329
	jnz	@r
330
;--------------------------------------
330
;--------------------------------------
331
align 4
331
align 4
332
@@:
332
@@:
333
	std
333
	std
334
	lodsb
334
	lodsb
335
	cmp	al,'/'
335
	cmp	al,'/'
336
	jnz	@r
336
	jnz	@r
337
	add	esi,2
337
	add	esi,2
338
	mov	edx,esi
338
	mov	edx,esi
339
 
339
 
340
	mov	edi,1
340
	mov	edi,1
341
;--------------------------------------
341
;--------------------------------------
342
align 4
342
align 4
343
@@:
343
@@:
344
	inc	edi
344
	inc	edi
345
	mov	ecx,edi
345
	mov	ecx,edi
346
	mcall	9,procinfo_window_tabs
346
	mcall	9,procinfo_window_tabs
347
 
347
 
348
	cmp	edi,eax
348
	cmp	edi,eax
349
	jg	.apply_changes
349
	jg	.apply_changes
350
 
350
 
351
	mov	esi,edx
351
	mov	esi,edx
352
	mov	ecx,11
352
	mov	ecx,11
353
	add	ebx,9
353
	add	ebx,9
354
	cld
354
	cld
355
;--------------------------------------
355
;--------------------------------------
356
align 4
356
align 4
357
.loop:
357
.loop:
358
	lodsb
358
	lodsb
359
	inc	ebx
359
	inc	ebx
360
	cmp	al,[ebx]
360
	cmp	al,[ebx]
361
	jne	@r
361
	jne	@r
362
 
362
 
363
	loop	.loop
363
	loop	.loop
364
 
364
 
365
	mov	eax,1
365
	mov	eax,1
366
	ret
366
	ret
367
;--------------------------------------
367
;--------------------------------------
368
align 4
368
align 4
369
.apply_changes:
369
.apply_changes:
370
	xor	eax,eax
370
	xor	eax,eax
371
	ret
371
	ret
372
;------------------------------------------------------------------------------
372
;------------------------------------------------------------------------------
373
align 4
373
align 4
374
page_list_next:
374
page_list_next:
375
	cmp	[page_list],50
375
	cmp	[page_list],50
376
	je	@f
376
	je	@f
377
 
377
 
378
	xor	eax,eax
378
	xor	eax,eax
379
	cmp	[page_list_enable],eax
379
	cmp	[page_list_enable],eax
380
	je	@f
380
	je	@f
381
 
381
 
382
	inc	[page_list]
382
	inc	[page_list]
383
	mov	[redraw_window_flag],1
383
	mov	[redraw_window_flag],1
384
;--------------------------------------
384
;--------------------------------------
385
align 4
385
align 4
386
@@:
386
@@:
387
	jmp	begin_1.ret
387
	jmp	begin_1.ret
388
;------------------------------------------------------------------------------
388
;------------------------------------------------------------------------------
389
align 4
389
align 4
390
page_list_prev:
390
page_list_prev:
391
	xor	eax,eax
391
	xor	eax,eax
392
	cmp	[page_list],eax
392
	cmp	[page_list],eax
393
	je	@f
393
	je	@f
394
 
394
 
395
	cmp	[page_list_enable],eax
395
	cmp	[page_list_enable],eax
396
	je	@f
396
	je	@f
397
 
397
 
398
	dec	[page_list]
398
	dec	[page_list]
399
	mov	[redraw_window_flag],1
399
	mov	[redraw_window_flag],1
400
;--------------------------------------
400
;--------------------------------------
401
align 4
401
align 4
402
@@:
402
@@:
403
	jmp	begin_1.ret
403
	jmp	begin_1.ret
404
;------------------------------------------------------------------------------
404
;------------------------------------------------------------------------------
405
align 4
405
align 4
406
alt_tab_pressed:
406
alt_tab_pressed:
407
; handle Alt+Tab and Alt+Shift+Tab
407
; handle Alt+Tab and Alt+Shift+Tab
408
	mov	ebp, eax
408
	mov	ebp, eax
409
	cmp	[current_alt_tab_app], -1
409
	cmp	[current_alt_tab_app], -1
410
	jnz	has_alt_tab_app
410
	jnz	has_alt_tab_app
411
; § ¯®«­ï¥¬ â ¡«¨æ㠯ਫ®¦¥­¨©, ¯®¤«¥¦ é¨å ¯¥à¥ª«î祭¨î
411
; § ¯®«­ï¥¬ â ¡«¨æ㠯ਫ®¦¥­¨©, ¯®¤«¥¦ é¨å ¯¥à¥ª«î祭¨î
412
	xor	edx, edx
412
	xor	edx, edx
413
	mov	ebx, procinfo_window_tabs
413
	mov	ebx, procinfo_window_tabs
414
	mov	ecx, 1
414
	mov	ecx, 1
415
;--------------------------------------
415
;--------------------------------------
416
align 4
416
align 4
417
.fill:
417
.fill:
418
	inc	ecx
418
	inc	ecx
419
	mcall	9
419
	mcall	9
420
	call	need_window_tab
420
	call	need_window_tab
421
	jz	@f
421
	jz	@f
422
 
422
 
423
	cmp	edx, 256
423
	cmp	edx, 256
424
	jz	@f
424
	jz	@f
425
 
425
 
426
	mov	[alt_tab_list+edx*8], ecx
426
	mov	[alt_tab_list+edx*8], ecx
427
	movzx	esi, word [ebx+4]
427
	movzx	esi, word [ebx+4]
428
	mov	[alt_tab_list+edx*8+4], esi
428
	mov	[alt_tab_list+edx*8+4], esi
429
	inc	edx
429
	inc	edx
430
;--------------------------------------
430
;--------------------------------------
431
align 4
431
align 4
432
@@:
432
@@:
433
	cmp	ecx,eax
433
	cmp	ecx,eax
434
	jb	.fill
434
	jb	.fill
435
 
435
 
436
	mov	[alt_tab_list_size], edx
436
	mov	[alt_tab_list_size], edx
437
	test	edx, edx
437
	test	edx, edx
438
	jz	begin_1.ret
438
	jz	begin_1.ret
439
 
439
 
440
	mcall	66,4,0,0	; «®¢¨¬ ¬®¬¥­â ®â¯ã᪠­¨ï ¢á¥å ã¯à ¢«ïîé¨å ª« ¢¨è
440
	mcall	66,4,0,0	; «®¢¨¬ ¬®¬¥­â ®â¯ã᪠­¨ï ¢á¥å ã¯à ¢«ïîé¨å ª« ¢¨è
441
	test	eax, eax
441
	test	eax, eax
442
	jnz	begin_1.ret
442
	jnz	begin_1.ret
443
 
443
 
444
	xor	edx, edx
444
	xor	edx, edx
445
	mov	eax, [alt_tab_list+4]
445
	mov	eax, [alt_tab_list+4]
446
	xor	ecx, ecx
446
	xor	ecx, ecx
447
	inc	ecx
447
	inc	ecx
448
;--------------------------------------
448
;--------------------------------------
449
align 4
449
align 4
450
.findmax:
450
.findmax:
451
	cmp	[alt_tab_list+ecx*8+4], eax
451
	cmp	[alt_tab_list+ecx*8+4], eax
452
	jb	@f
452
	jb	@f
453
 
453
 
454
	mov	edx, ecx
454
	mov	edx, ecx
455
	mov	eax, [alt_tab_list+ecx*8+4]
455
	mov	eax, [alt_tab_list+ecx*8+4]
456
;--------------------------------------
456
;--------------------------------------
457
align 4
457
align 4
458
@@:
458
@@:
459
	inc	ecx
459
	inc	ecx
460
	cmp	ecx, [alt_tab_list_size]
460
	cmp	ecx, [alt_tab_list_size]
461
	jb	.findmax
461
	jb	.findmax
462
 
462
 
463
	mov	[current_alt_tab_app], edx
463
	mov	[current_alt_tab_app], edx
464
;--------------------------------------
464
;--------------------------------------
465
align 4
465
align 4
466
has_alt_tab_app:
466
has_alt_tab_app:
467
	mov	eax, [current_alt_tab_app]
467
	mov	eax, [current_alt_tab_app]
468
	mov	edx, [alt_tab_list+eax*8+4]	; slot
468
	mov	edx, [alt_tab_list+eax*8+4]	; slot
469
	xor	ecx, ecx
469
	xor	ecx, ecx
470
	or	eax, -1
470
	or	eax, -1
471
	test	ebp, 300h
471
	test	ebp, 300h
472
	jz	.notshift
472
	jz	.notshift
473
 
473
 
474
	or	esi, -1
474
	or	esi, -1
475
;--------------------------------------
475
;--------------------------------------
476
align 4
476
align 4
477
.loop1:
477
.loop1:
478
	cmp	[alt_tab_list+ecx*8+4], edx
478
	cmp	[alt_tab_list+ecx*8+4], edx
479
	jbe	@f
479
	jbe	@f
480
 
480
 
481
	cmp	[alt_tab_list+ecx*8+4], esi
481
	cmp	[alt_tab_list+ecx*8+4], esi
482
	jae	@f
482
	jae	@f
483
 
483
 
484
	mov	eax, ecx
484
	mov	eax, ecx
485
	mov	esi, [alt_tab_list+ecx*8+4]
485
	mov	esi, [alt_tab_list+ecx*8+4]
486
;--------------------------------------
486
;--------------------------------------
487
align 4
487
align 4
488
@@:
488
@@:
489
	inc	ecx
489
	inc	ecx
490
	cmp	ecx, [alt_tab_list_size]
490
	cmp	ecx, [alt_tab_list_size]
491
	jb	.loop1
491
	jb	.loop1
492
 
492
 
493
	cmp	eax, -1
493
	cmp	eax, -1
494
	jnz	.found
494
	jnz	.found
495
 
495
 
496
	xor	edx, edx
496
	xor	edx, edx
497
	xor	ecx, ecx
497
	xor	ecx, ecx
498
	jmp	.loop1
498
	jmp	.loop1
499
;--------------------------------------
499
;--------------------------------------
500
align 4
500
align 4
501
.notshift:
501
.notshift:
502
	xor	esi, esi
502
	xor	esi, esi
503
;--------------------------------------
503
;--------------------------------------
504
align 4
504
align 4
505
.loop2:
505
.loop2:
506
	cmp	[alt_tab_list+ecx*8+4], edx
506
	cmp	[alt_tab_list+ecx*8+4], edx
507
	jae	@f
507
	jae	@f
508
 
508
 
509
	cmp	[alt_tab_list+ecx*8+4], esi
509
	cmp	[alt_tab_list+ecx*8+4], esi
510
	jbe	@f
510
	jbe	@f
511
 
511
 
512
	mov	eax, ecx
512
	mov	eax, ecx
513
	mov	esi, [alt_tab_list+ecx*8+4]
513
	mov	esi, [alt_tab_list+ecx*8+4]
514
;--------------------------------------
514
;--------------------------------------
515
align 4
515
align 4
516
@@:
516
@@:
517
	inc	ecx
517
	inc	ecx
518
	cmp	ecx, [alt_tab_list_size]
518
	cmp	ecx, [alt_tab_list_size]
519
	jb	.loop2
519
	jb	.loop2
520
 
520
 
521
	cmp	eax, -1
521
	cmp	eax, -1
522
	jnz	.found
522
	jnz	.found
523
 
523
 
524
	or	edx, -1
524
	or	edx, -1
525
	xor	ecx, ecx
525
	xor	ecx, ecx
526
	jmp	.loop2
526
	jmp	.loop2
527
;--------------------------------------
527
;--------------------------------------
528
align 4
528
align 4
529
.found:
529
.found:
530
	mov	[current_alt_tab_app], eax
530
	mov	[current_alt_tab_app], eax
531
	push	eax
531
	push	eax
532
	xor	edx, edx
532
	xor	edx, edx
533
	div	[max_applications]
533
	div	[max_applications]
534
	mov	[page_list], eax
534
	mov	[page_list], eax
535
	mov	edi, app_list
535
	mov	edi, app_list
536
	push	edi
536
	push	edi
537
	mov	ecx, 20
537
	mov	ecx, 20
538
	or	eax, -1
538
	or	eax, -1
539
	rep	stosd
539
	rep	stosd
540
	pop	edi
540
	pop	edi
541
	pop	ecx
541
	pop	ecx
542
	sub	ecx, edx
542
	sub	ecx, edx
543
;--------------------------------------
543
;--------------------------------------
544
align 4
544
align 4
545
@@:
545
@@:
546
	cmp	ecx, [alt_tab_list_size]
546
	cmp	ecx, [alt_tab_list_size]
547
	jae	redraw_window_tabs
547
	jae	redraw_window_tabs
548
 
548
 
549
	mov	eax, [alt_tab_list+ecx*8]
549
	mov	eax, [alt_tab_list+ecx*8]
550
	stosd
550
	stosd
551
	inc	ecx
551
	inc	ecx
552
	jmp	@b
552
	jmp	@b
553
;--------------------------------------
553
;--------------------------------------
554
align 4
554
align 4
555
alt_tab_released:
555
alt_tab_released:
556
	mcall	66,5,0,0	; 㦥 ¯®©¬ «¨, 墠â¨â :)
556
	mcall	66,5,0,0	; 㦥 ¯®©¬ «¨, 墠â¨â :)
557
 
557
 
558
	or	eax, -1
558
	or	eax, -1
559
	xchg	eax, [current_alt_tab_app]
559
	xchg	eax, [current_alt_tab_app]
560
	mov	ecx, [alt_tab_list+eax*8]
560
	mov	ecx, [alt_tab_list+eax*8]
561
	mcall	18,3
561
	mcall	18,3
562
 
562
 
563
	jmp	redraw_window_tabs
563
	jmp	redraw_window_tabs
564
;------------------------------------------------------------------------------
564
;------------------------------------------------------------------------------
565
align 4
565
align 4
566
active_process	dd 0
566
active_process	dd 0
567
 
567
 
568
exit:
568
exit:
569
	mcall -1
569
	mcall -1
570
;------------------------------------------------------------------------------
570
;------------------------------------------------------------------------------
571
START:
571
START:
572
	mcall	68,11
572
	mcall	68,11
573
	mcall	66,1,1
573
	mcall	66,1,1
574
 
574
 
575
	mcall	9,process_info_buffer,-1
575
	mcall	9,process_info_buffer,-1
576
	mov	ecx,[ebx+30]	; PID
576
	mov	ecx,[ebx+30]	; PID
577
	mcall	18,21
577
	mcall	18,21
578
	mov	[my_active_slot],eax	; WINDOW SLOT
578
	mov	[my_active_slot],eax	; WINDOW SLOT
579
 
579
 
580
 
580
 
581
load_libraries l_libs_start,end_l_libs
581
load_libraries l_libs_start,end_l_libs
582
 
582
 
583
	test	eax,eax
583
	test	eax,eax
584
	jnz	exit
584
	jnz	exit
585
 
585
 
586
	call	Get_ini
586
	call	Get_ini
587
 
-
 
588
	mcall	48,1,[button_style]
-
 
589
 
587
 
590
	mcall	66,4,0,2	; LShift+RShift
588
	mcall	66,4,0,2	; LShift+RShift
591
	mcall	66,,,33h	; LCtrl+LShift
589
	mcall	66,,,33h	; LCtrl+LShift
592
	mcall	66,,88,110h	; Alt+Ctrl+F12
590
	mcall	66,,88,110h	; Alt+Ctrl+F12
593
	mcall	66,,91,0h	; RWin DOWN
591
	mcall	66,,91,0h	; RWin DOWN
594
	mcall	66,,92		; LWin DOWN
592
	mcall	66,,92		; LWin DOWN
595
	mcall	66,,219 	; RWin UP
593
	mcall	66,,219 	; RWin UP
596
	mcall	66,,220 	; LWin UP
594
	mcall	66,,220 	; LWin UP
597
	mcall	66,,19,0h	; Win+R DOWN
595
	mcall	66,,19,0h	; Win+R DOWN
598
	mcall	66,,32,0h	; Win+D DOWN
596
	mcall	66,,32,0h	; Win+D DOWN
599
	mcall	66,,55,10h	; Ctrl+PrintScreen DOWN
597
	mcall	66,,55,10h	; Ctrl+PrintScreen DOWN
600
	mcall	66,,62,300h	; Alt+F4
598
	mcall	66,,62,300h	; Alt+F4
601
	mcall	66,,2		; Alt+1
599
	mcall	66,,2		; Alt+1
602
	mcall	66,,3		; Alt+2
600
	mcall	66,,3		; Alt+2
603
	mcall	66,,4		; Alt+3
601
	mcall	66,,4		; Alt+3
604
	mcall	66,,5		; Alt+4
602
	mcall	66,,5		; Alt+4
605
	mcall	66,,6		; Alt+5
603
	mcall	66,,6		; Alt+5
606
	mcall	66,,7		; Alt+6
604
	mcall	66,,7		; Alt+6
607
	mcall	66,,8		; Alt+7
605
	mcall	66,,8		; Alt+7
608
	mcall	66,,9		; Alt+8
606
	mcall	66,,9		; Alt+8
609
	mcall	66,,10		; Alt+9
607
	mcall	66,,10		; Alt+9
610
	mcall	66,,15		; Alt+Tab DOWN
608
	mcall	66,,15		; Alt+Tab DOWN
611
	mcall	66,,15,301h	; Alt+Shift+Tab DOWN
609
	mcall	66,,15,301h	; Alt+Shift+Tab DOWN
612
	mcall	66,,69		; Alt+Shift+NumLock
610
	mcall	66,,69		; Alt+Shift+NumLock
613
 
611
 
614
if caps_lock_check
612
if caps_lock_check
615
	xor	edx,edx
613
	xor	edx,edx
616
	mcall	66,4,58
614
	mcall	66,4,58
617
end if
615
end if
618
	mcall	14
616
	mcall	14
619
	mov	[screen_size],eax
617
	mov	[screen_size],eax
620
 
618
 
621
	call	set_work_ares_pf_screen
619
	call	set_work_ares_pf_screen
622
 
620
 
623
	mcall	9,process_info_buffer,-1
621
	mcall	9,process_info_buffer,-1
624
	mov	ecx,[process_info_buffer+30]
622
	mov	ecx,[process_info_buffer+30]
625
	mcall	18,21
623
	mcall	18,21
626
	mov	[this_slot],eax
624
	mov	[this_slot],eax
627
	mov	[max_slot],255
625
	mov	[max_slot],255
628
;--------------------------------------
626
;--------------------------------------
629
align 4
627
align 4
630
start_after_minimize:
628
start_after_minimize:
631
	call	draw_window
629
	call	draw_window
632
	call	draw_running_applications
630
	call	draw_running_applications
633
 
631
 
634
	mcall	23,30
632
	mcall	23,30
635
	call	load_ini
633
	call	load_ini
636
;------------------------------------------------------------------------------
634
;------------------------------------------------------------------------------
637
align 4
635
align 4
638
still:
636
still:
639
	call	draw_time
637
	call	draw_time
640
	call	draw_cpu_usage
638
	call	draw_cpu_usage
641
	call	draw_running_applications
639
	call	draw_running_applications
642
 
640
 
643
	mcall	18,7	; check if active window changed
641
	mcall	18,7	; check if active window changed
644
	cmp	eax, [last_active_window]
642
	cmp	eax, [last_active_window]
645
	jz	@f
643
	jz	@f
646
; need_window_tab:
644
; need_window_tab:
647
; in: ebx->process info
645
; in: ebx->process info
648
; out: ZF set <=> do not draw
646
; out: ZF set <=> do not draw
649
	mov	ebx,[last_active_window]
647
	mov	ebx,[last_active_window]
650
	mov	[prev_active_window], ebx
648
	mov	[prev_active_window], ebx
651
	mov	[last_active_window], eax
649
	mov	[last_active_window], eax
652
 
650
 
653
	mov	ecx, eax
651
	mov	ecx, eax
654
	mcall	9,process_info_buffer
652
	mcall	9,process_info_buffer
655
 
653
 
656
	call	need_window_tab
654
	call	need_window_tab
657
	jnz	.need_repaint
655
	jnz	.need_repaint
658
 
656
 
659
	mcall	9,process_info_buffer,[prev_active_window]
657
	mcall	9,process_info_buffer,[prev_active_window]
660
	call	need_window_tab
658
	call	need_window_tab
661
	jz	@f
659
	jz	@f
662
;--------------------------------------
660
;--------------------------------------
663
align 4
661
align 4
664
.need_repaint:
662
.need_repaint:
665
	mov	dword [active_window_changed], 1
663
	mov	dword [active_window_changed], 1
666
;--------------------------------------
664
;--------------------------------------
667
align 4
665
align 4
668
@@:
666
@@:
669
	mcall	23,20
667
	mcall	23,20
670
 
668
 
671
	push	eax
669
	push	eax
672
	mcall	18,7
670
	mcall	18,7
673
	cmp	[my_active_slot],eax
671
	cmp	[my_active_slot],eax
674
	je	@f
672
	je	@f
675
 
673
 
676
	mov	[current_active_slot],eax
674
	mov	[current_active_slot],eax
677
;--------------------------------------
675
;--------------------------------------
678
align 4
676
align 4
679
@@:
677
@@:
680
	pop	eax
678
	pop	eax
681
 
679
 
682
	cmp	eax,1		; redraw ?
680
	cmp	eax,1		; redraw ?
683
	jz	red
681
	jz	red
684
 
682
 
685
	push	eax
683
	push	eax
686
	mov	eax,[redraw_window_flag]
684
	mov	eax,[redraw_window_flag]
687
	test	eax,eax
685
	test	eax,eax
688
	jz	@f
686
	jz	@f
689
 
687
 
690
	call	draw_window
688
	call	draw_window
691
;--------------------------------------
689
;--------------------------------------
692
align 4
690
align 4
693
@@:
691
@@:
694
	pop	eax
692
	pop	eax
695
 
693
 
696
	cmp	eax,2
694
	cmp	eax,2
697
	jnz	@f
695
	jnz	@f
698
	call	handle_key
696
	call	handle_key
699
	jmp	.key
697
	jmp	.key
700
;--------------------------------------
698
;--------------------------------------
701
align 4
699
align 4
702
@@:
700
@@:
703
	cmp	eax,3		; button ?
701
	cmp	eax,3		; button ?
704
	jz	button
702
	jz	button
705
;--------------------------------------
703
;--------------------------------------
706
align 4
704
align 4
707
.key:
705
.key:
708
	cmp	dword [active_window_changed], 0
706
	cmp	dword [active_window_changed], 0
709
	jnz	red_active
707
	jnz	red_active
710
 
708
 
711
	call	draw_flag	; language
709
	call	draw_flag	; language
712
	jmp	still
710
	jmp	still
713
;------------------------------------------------------------------------------
711
;------------------------------------------------------------------------------
714
align 4
712
align 4
715
set_work_ares_pf_screen:
713
set_work_ares_pf_screen:
716
;eax = [xsize]*65536 + [ysize]
714
;eax = [xsize]*65536 + [ysize]
717
	mov	ecx,eax
715
	mov	ecx,eax
718
	shr	ecx,16
716
	shr	ecx,16
719
	and	eax,0xFFFF
717
	and	eax,0xFFFF
720
	cmp	[place_attachment],1
718
	cmp	[place_attachment],1
721
	je	@f
719
	je	@f
722
 
720
 
723
	ror	eax,16
721
	ror	eax,16
724
	add	eax,[height]
722
	add	eax,[height]
725
	rol	eax,16
723
	rol	eax,16
726
	mov	edx,eax
724
	mov	edx,eax
727
	jmp	.selected
725
	jmp	.selected
728
;--------------------------------------
726
;--------------------------------------
729
align 4
727
align 4
730
@@:
728
@@:
731
	sub	eax,[height]
729
	sub	eax,[height]
732
	mov	edx, eax
730
	mov	edx, eax
733
;--------------------------------------
731
;--------------------------------------
734
align 4
732
align 4
735
.selected:
733
.selected:
736
	mcall	48,6
734
	mcall	48,6
737
	ret
735
	ret
738
;------------------------------------------------------------------------------
736
;------------------------------------------------------------------------------
739
align 4
737
align 4
740
red_active:
738
red_active:
741
red:
739
red:
742
	mov	dword [active_window_changed], 0
740
	mov	dword [active_window_changed], 0
743
 
741
 
744
	mcall	14
742
	mcall	14
745
	movzx	ecx,ax
743
	movzx	ecx,ax
746
	mov	edx,eax
744
	mov	edx,eax
747
	shr	edx,16
745
	shr	edx,16
748
	cmp	[screen_size.height],ax
746
	cmp	[screen_size.height],ax
749
	jne	@f
747
	jne	@f
750
 
748
 
751
	rol	eax,16
749
	rol	eax,16
752
	cmp	[screen_size.width],ax
750
	cmp	[screen_size.width],ax
753
	je	.lp1
751
	je	.lp1
754
 
752
 
755
	rol	eax,16
753
	rol	eax,16
756
;--------------------------------------
754
;--------------------------------------
757
align 4
755
align 4
758
@@:
756
@@:
759
	mov	[screen_size],eax
757
	mov	[screen_size],eax
760
 
758
 
761
	push	ecx edx
759
	push	ecx edx
762
	call	set_work_ares_pf_screen
760
	call	set_work_ares_pf_screen
763
	pop	edx ecx
761
	pop	edx ecx
764
 
762
 
765
	sub	ecx,[height]
763
	sub	ecx,[height]
766
	mcall	67,0,,,[height]
764
	mcall	67,0,,,[height]
767
;--------------------------------------
765
;--------------------------------------
768
align 4
766
align 4
769
.lp1:
767
.lp1:
770
	call	draw_window
768
	call	draw_window
771
	jmp	still
769
	jmp	still
772
;------------------------------------------------------------------------------
770
;------------------------------------------------------------------------------
773
align 4
771
align 4
774
button:
772
button:
775
	mcall	17
773
	mcall	17
776
	test	eax,0xfffffe00	; is it close button? (signal from @taskbar)
774
	test	eax,0xfffffe00	; is it close button? (signal from @taskbar)
777
	jz	still		; if so - wait for another event, because @taskbar shouldn't be closed
775
	jz	still		; if so - wait for another event, because @taskbar shouldn't be closed
778
 
776
 
779
	cmp	al, 0
777
	cmp	al, 0
780
	jnz	right_mouse
778
	jnz	right_mouse
781
 
779
 
782
	cmp	ah,50
780
	cmp	ah,50
783
	jb	no_activate
781
	jb	no_activate
784
	cmp	ah,70
782
	cmp	ah,70
785
	jg	no_activate
783
	jg	no_activate
786
 
784
 
787
	movzx	ecx,byte ah
785
	movzx	ecx,byte ah
788
	sub	ecx,52
786
	sub	ecx,52
789
	shl	ecx,2
787
	shl	ecx,2
790
 
788
 
791
	mov	ecx,[app_list+ecx]
789
	mov	ecx,[app_list+ecx]
792
 
790
 
793
	mcall	9,process_info_buffer
791
	mcall	9,process_info_buffer
794
 
792
 
795
	test	[ebx+70],dword 10b	; window is minimized to panel
793
	test	[ebx+70],dword 10b	; window is minimized to panel
796
	jnz	@f
794
	jnz	@f
797
 
795
 
798
	cmp	ecx,[current_active_slot]
796
	cmp	ecx,[current_active_slot]
799
	je	.turn_off
797
	je	.turn_off
800
;--------------------------------------
798
;--------------------------------------
801
align 4
799
align 4
802
@@:
800
@@:
803
	mcall	18,3,
801
	mcall	18,3,
804
	jmp	.task_switching
802
	jmp	.task_switching
805
;--------------------------------------
803
;--------------------------------------
806
align 4
804
align 4
807
.turn_off:
805
.turn_off:
808
	mov	edx,ecx
806
	mov	edx,ecx
809
	mcall	18,22,0
807
	mcall	18,22,0
810
;--------------------------------------
808
;--------------------------------------
811
align 4
809
align 4
812
.task_switching:
810
.task_switching:
813
	mcall	68,1
811
	mcall	68,1
814
	jmp	still
812
	jmp	still
815
;------------------------------------------------------------------------------
813
;------------------------------------------------------------------------------
816
align 4
814
align 4
817
right_mouse:
815
right_mouse:
818
	cmp	ah,50
816
	cmp	ah,50
819
	jb	still
817
	jb	still
820
 
818
 
821
	cmp	ah,70
819
	cmp	ah,70
822
	jg	still
820
	jg	still
823
 
821
 
824
	movzx	ecx,byte ah
822
	movzx	ecx,byte ah
825
	sub	ecx,52
823
	sub	ecx,52
826
 
824
 
827
	cmp	ecx, [app_tab_count]
825
	cmp	ecx, [app_tab_count]
828
	jge	still
826
	jge	still
829
 
827
 
830
	shl	ecx,2
828
	shl	ecx,2
831
	mcall	37,0
829
	mcall	37,0
832
	mov	ebx, eax
830
	mov	ebx, eax
833
	shr	eax, 16
831
	shr	eax, 16
834
	mov	[x_coord], ax
832
	mov	[x_coord], ax
835
	and	ebx, 0xFFFF
833
	and	ebx, 0xFFFF
836
	mov	[y_coord], bx
834
	mov	[y_coord], bx
837
 
835
 
838
	mov	ecx,[app_list+ecx]	; ecx->selected app.slot
836
	mov	ecx,[app_list+ecx]	; ecx->selected app.slot
839
	mov	[n_slot], ecx
837
	mov	[n_slot], ecx
840
	mcall	9,procinfo_for_detect
838
	mcall	9,procinfo_for_detect
841
 
839
 
842
	mcall	51,1,context_menu_start,ctx_menu_stack
840
	mcall	51,1,context_menu_start,ctx_menu_stack
843
 
841
 
844
	mov	[ctx_menu_PID], eax
842
	mov	[ctx_menu_PID], eax
845
	jmp	still
843
	jmp	still
846
;------------------------------------------------------------------------------
844
;------------------------------------------------------------------------------
847
align 4
845
align 4
848
no_activate:
846
no_activate:
849
	cmp	ah,101	  ; minimize to left
847
	cmp	ah,101	  ; minimize to left
850
	je	left_button
848
	je	left_button
851
 
849
 
852
	cmp	ah,102	  ; minimize to right
850
	cmp	ah,102	  ; minimize to right
853
	je	right_button
851
	je	right_button
854
 
852
 
855
	cmp	ah, 103
853
	cmp	ah, 103
856
	je	clean_desktop_1 	    ; minimize all windows
854
	je	clean_desktop_1 	    ; minimize all windows
857
 
855
 
858
	cmp	ah,byte 1	  ; start/terminate menu
856
	cmp	ah,byte 1	  ; start/terminate menu
859
	jnz	noselect
857
	jnz	noselect
860
 
858
 
861
	call	menu_handler
859
	call	menu_handler
862
 
860
 
863
	jmp	still
861
	jmp	still
864
;--------------------------------------
862
;--------------------------------------
865
align 4
863
align 4
866
clean_desktop_1:
864
clean_desktop_1:
867
	call	clean_desktop
865
	call	clean_desktop
868
	jmp	still
866
	jmp	still
869
;--------------------------------------
867
;--------------------------------------
870
align 4
868
align 4
871
noselect:
869
noselect:
872
	mov	ebx, exec_fileinfo
870
	mov	ebx, exec_fileinfo
873
	cmp	ah,byte 2	       ; start calendar
871
	cmp	ah,byte 2	       ; start calendar
874
	jnz	noid15	;noclock
872
	jnz	noid15	;noclock
875
 
873
 
876
	mov	esi,calendar_name
874
	mov	esi,calendar_name
877
	call	algorithm_anti_duplication
875
	call	algorithm_anti_duplication
878
	test	eax,eax
876
	test	eax,eax
879
	jz	@f
877
	jz	@f
880
 
878
 
881
	mcall	18,2,edi
879
	mcall	18,2,edi
882
	jmp	still
880
	jmp	still
883
;--------------------------------------
881
;--------------------------------------
884
align 4
882
align 4
885
@@:
883
@@:
886
	mov	ebx, exec_fileinfo
884
	mov	ebx, exec_fileinfo
887
	mov	dword [ebx+21], calendar_name
885
	mov	dword [ebx+21], calendar_name
888
	mcall	70
886
	mcall	70
889
	jmp	still
887
	jmp	still
890
;--------------------------------------
888
;--------------------------------------
891
align 4
889
align 4
892
noid15:
890
noid15:
893
	cmp	ah,16
891
	cmp	ah,16
894
	jne	noid16
892
	jne	noid16
895
 
893
 
896
	call	karu
894
	call	karu
897
	call	draw_flag	; language
895
	call	draw_flag	; language
898
	jmp	still
896
	jmp	still
899
;--------------------------------------
897
;--------------------------------------
900
align 4
898
align 4
901
noid16:
899
noid16:
902
	cmp	ah,18
900
	cmp	ah,18
903
	jne	noid18
901
	jne	noid18
904
 
902
 
905
	mov	esi,sysmeter_name
903
	mov	esi,sysmeter_name
906
	call	algorithm_anti_duplication
904
	call	algorithm_anti_duplication
907
	test	eax,eax
905
	test	eax,eax
908
	jz	@f
906
	jz	@f
909
 
907
 
910
	mcall	18,2,edi
908
	mcall	18,2,edi
911
	jmp	still
909
	jmp	still
912
;--------------------------------------
910
;--------------------------------------
913
align 4
911
align 4
914
@@:
912
@@:
915
	mov	ebx, exec_fileinfo
913
	mov	ebx, exec_fileinfo
916
	mov	dword [ebx+21], sysmeter_name
914
	mov	dword [ebx+21], sysmeter_name
917
	mcall	70
915
	mcall	70
918
	jmp	still
916
	jmp	still
919
;--------------------------------------
917
;--------------------------------------
920
align 4
918
align 4
921
noid18:
919
noid18:
922
	cmp	ah,21
920
	cmp	ah,21
923
	jnz	noid21
921
	jnz	noid21
924
 
922
 
925
	cmp	[page_list],50
923
	cmp	[page_list],50
926
	jnc	still
924
	jnc	still
927
	inc	[page_list]
925
	inc	[page_list]
928
	jmp	red
926
	jmp	red
929
;--------------------------------------
927
;--------------------------------------
930
align 4
928
align 4
931
noid21:
929
noid21:
932
	cmp	ah,22
930
	cmp	ah,22
933
	jnz	still
931
	jnz	still
934
 
932
 
935
	cmp	[page_list],0
933
	cmp	[page_list],0
936
	je	still
934
	je	still
937
 
935
 
938
	dec	[page_list]
936
	dec	[page_list]
939
	jmp	red
937
	jmp	red
940
;------------------------------------------------------------------------------
938
;------------------------------------------------------------------------------
941
align 4
939
align 4
942
restore_desktop:
940
restore_desktop:
943
	mcall	9,process_info_buffer,-1
941
	mcall	9,process_info_buffer,-1
944
	mov	[max_slot], eax
942
	mov	[max_slot], eax
945
	mov	ecx, 2
943
	mov	ecx, 2
946
	mov	edx, 2
944
	mov	edx, 2
947
;--------------------------------------
945
;--------------------------------------
948
align 4
946
align 4
949
@@:
947
@@:
950
	mcall	18, 22
948
	mcall	18, 22
951
	inc	edx
949
	inc	edx
952
	cmp	edx, [max_slot]
950
	cmp	edx, [max_slot]
953
	jbe	@b
951
	jbe	@b
954
	ret
952
	ret
955
;------------------------------------------------------------------------------
953
;------------------------------------------------------------------------------
956
align 4
954
align 4
957
clean_desktop:
955
clean_desktop:
958
	mcall	18,23
956
	mcall	18,23
959
	test	eax,eax
957
	test	eax,eax
960
	jnz	@f
958
	jnz	@f
961
	call	restore_desktop
959
	call	restore_desktop
962
;--------------------------------------
960
;--------------------------------------
963
align 4
961
align 4
964
@@:
962
@@:
965
	ret
963
	ret
966
;------------------------------------------------------------------------------
964
;------------------------------------------------------------------------------
967
align 4
965
align 4
968
conversion_HEX_to_ASCII:
966
conversion_HEX_to_ASCII:
969
	ror	eax,12
967
	ror	eax,12
970
	mov	ecx,4
968
	mov	ecx,4
971
;--------------------------------------
969
;--------------------------------------
972
align 4
970
align 4
973
.loop:
971
.loop:
974
	mov	bl,al
972
	mov	bl,al
975
	rol	eax,4
973
	rol	eax,4
976
	and	bl,0xf
974
	and	bl,0xf
977
	cmp	bl,0xA	; check for ABCDEF
975
	cmp	bl,0xA	; check for ABCDEF
978
	jae	@f
976
	jae	@f
979
 
977
 
980
	add	bl,0x30 ; 0-9
978
	add	bl,0x30 ; 0-9
981
	jmp	.store
979
	jmp	.store
982
;--------------------------------------
980
;--------------------------------------
983
align 4
981
align 4
984
@@:
982
@@:
985
	add	bl,0x57 ; A-F
983
	add	bl,0x57 ; A-F
986
;--------------------------------------
984
;--------------------------------------
987
align 4
985
align 4
988
.store:
986
.store:
989
;	dps	"param_store: "
987
;	dps	"param_store: "
990
	mov	[edi],bl
988
	mov	[edi],bl
991
	inc	edi
989
	inc	edi
992
	dec	ecx
990
	dec	ecx
993
	jnz	.loop
991
	jnz	.loop
994
	ret
992
	ret
995
;------------------------------------------------------------------------------
993
;------------------------------------------------------------------------------
996
align 4
994
align 4
997
menu_handler:
995
menu_handler:
998
	mov	edi,bootparam
996
	mov	edi,bootparam
999
 
997
 
1000
	mov	eax,[menu_button_x.start]
998
	mov	eax,[menu_button_x.start]
1001
	call	conversion_HEX_to_ASCII
999
	call	conversion_HEX_to_ASCII
1002
 
1000
 
1003
	mov	eax,[menu_button_x.size]
1001
	mov	eax,[menu_button_x.size]
1004
	call	conversion_HEX_to_ASCII
1002
	call	conversion_HEX_to_ASCII
1005
 
1003
 
1006
	mov	eax,[menu_button_y.start]
1004
	mov	eax,[menu_button_y.start]
1007
	call	conversion_HEX_to_ASCII
1005
	call	conversion_HEX_to_ASCII
1008
 
1006
 
1009
	mov	eax,[menu_button_y.size]
1007
	mov	eax,[menu_button_y.size]
1010
	call	conversion_HEX_to_ASCII
1008
	call	conversion_HEX_to_ASCII
1011
 
1009
 
1012
	mov	eax,[height]
1010
	mov	eax,[height]
1013
	call	conversion_HEX_to_ASCII
1011
	call	conversion_HEX_to_ASCII
1014
 
1012
 
1015
	mov	eax,[place_attachment]
1013
	mov	eax,[place_attachment]
1016
	call	conversion_HEX_to_ASCII
1014
	call	conversion_HEX_to_ASCII
1017
 
1015
 
1018
	xor	eax,eax ; terminator for boot parameters string
1016
	xor	eax,eax ; terminator for boot parameters string
1019
	stosd
1017
	stosd
1020
 
1018
 
1021
	mov	ebx, exec_fileinfo
1019
	mov	ebx, exec_fileinfo
1022
	mov	[ebx+21],dword menu_name
1020
	mov	[ebx+21],dword menu_name
1023
	mov	[ebx+8],dword bootparam
1021
	mov	[ebx+8],dword bootparam
1024
	mcall	70
1022
	mcall	70
1025
	mov	[ebx+8],dword 0
1023
	mov	[ebx+8],dword 0
1026
	ret
1024
	ret
1027
;------------------------------------------------------------------------------
1025
;------------------------------------------------------------------------------
1028
align 4
1026
align 4
1029
draw_small_right:
1027
draw_small_right:
1030
	pusha
1028
	pusha
1031
	mcall	12,1
1029
	mcall	12,1
1032
 
1030
 
1033
	xor	eax,eax
1031
	xor	eax,eax
1034
	mov	edx,[wcolor]
1032
	mov	edx,[wcolor]
1035
	mov	esi,edx
1033
	mov	esi,edx
1036
	mov	edi,edx
1034
	mov	edi,edx
1037
	or	edx, 0x01000000
1035
	or	edx, 0x01000000
1038
	mcall
1036
	mcall
1039
 
1037
 
1040
	xor	ecx,ecx
1038
	xor	ecx,ecx
1041
	mov	cx,[height]
1039
	mov	cx,[height]
1042
	mcall	8,<0,10>,,1,[wcolor]
1040
	mcall	8,<0,10>,,1,[wcolor]
1043
 
1041
 
1044
	mov	ebx,2*65536	;+6
1042
	mov	ebx,2*65536	;+6
1045
	mov	bx,[height]
1043
	mov	bx,[height]
1046
	shr	bx,1
1044
	shr	bx,1
1047
	sub	bx,3
1045
	sub	bx,3
1048
	mov	edx,[wcolor]
1046
	mov	edx,[wcolor]
1049
	mov	eax,COLOR_CHANGE_MAGNITUDE_2
1047
	mov	eax,COLOR_CHANGE_MAGNITUDE_2
1050
	call	add_color_change_magnitude
1048
	call	add_color_change_magnitude
1051
	mov	ecx,edx
1049
	mov	ecx,edx
1052
	mcall	4,,,hidetext,1
1050
	mcall	4,,,hidetext,1
1053
 
1051
 
1054
	mcall	12,2
1052
	mcall	12,2
1055
	popa
1053
	popa
1056
	ret
1054
	ret
1057
;------------------------------------------------------------------------------
1055
;------------------------------------------------------------------------------
1058
align 4
1056
align 4
1059
draw_small_left:
1057
draw_small_left:
1060
	pusha
1058
	pusha
1061
	mcall	12,1
1059
	mcall	12,1
1062
 
1060
 
1063
	xor	eax,eax
1061
	xor	eax,eax
1064
	mov	edx,[wcolor]
1062
	mov	edx,[wcolor]
1065
	mov	esi,edx
1063
	mov	esi,edx
1066
	mov	edi,edx
1064
	mov	edi,edx
1067
	or	edx, 0x01000000
1065
	or	edx, 0x01000000
1068
	mcall
1066
	mcall
1069
 
1067
 
1070
	xor	ecx,ecx
1068
	xor	ecx,ecx
1071
	mov	cx,[height]
1069
	mov	cx,[height]
1072
	mcall	8,<0,9>,,1,[wcolor]
1070
	mcall	8,<0,9>,,1,[wcolor]
1073
 
1071
 
1074
	mov	ebx,3*65536	;+6
1072
	mov	ebx,3*65536	;+6
1075
	mov	bx,[height]
1073
	mov	bx,[height]
1076
	shr	bx,1
1074
	shr	bx,1
1077
	sub	bx,3
1075
	sub	bx,3
1078
	mov	edx,[wcolor]
1076
	mov	edx,[wcolor]
1079
	mov	eax,COLOR_CHANGE_MAGNITUDE_2
1077
	mov	eax,COLOR_CHANGE_MAGNITUDE_2
1080
	call	add_color_change_magnitude
1078
	call	add_color_change_magnitude
1081
	mov	ecx,edx
1079
	mov	ecx,edx
1082
	mcall	4,,,hidetext+1,1
1080
	mcall	4,,,hidetext+1,1
1083
 
1081
 
1084
	mcall	12,2
1082
	mcall	12,2
1085
	popa
1083
	popa
1086
	ret
1084
	ret
1087
;------------------------------------------------------------------------------
1085
;------------------------------------------------------------------------------
1088
align 4
1086
align 4
1089
right_button:
1087
right_button:
1090
	mov	[small_draw],dword draw_small_right
1088
	mov	[small_draw],dword draw_small_right
1091
 
1089
 
1092
	mcall	14
1090
	mcall	14
1093
 
1091
 
1094
	shr	eax, 16
1092
	shr	eax, 16
1095
	mov	ebx, eax
1093
	mov	ebx, eax
1096
	mov	ecx, -1
1094
	mov	ecx, -1
1097
	mov	edx, 9
1095
	mov	edx, 9
1098
	sub	ebx, edx
1096
	sub	ebx, edx
1099
	mov	esi, -1
1097
	mov	esi, -1
1100
	mcall	67
1098
	mcall	67
1101
 
1099
 
1102
	call	draw_small_right
1100
	call	draw_small_right
1103
	jmp	small_wait
1101
	jmp	small_wait
1104
;------------------------------------------------------------------------------
1102
;------------------------------------------------------------------------------
1105
align 4
1103
align 4
1106
left_button:
1104
left_button:
1107
	mov	[small_draw],dword draw_small_left
1105
	mov	[small_draw],dword draw_small_left
1108
 
1106
 
1109
	xor	ebx,ebx
1107
	xor	ebx,ebx
1110
	mcall	67,,-1,9,-1
1108
	mcall	67,,-1,9,-1
1111
 
1109
 
1112
	call	draw_small_left
1110
	call	draw_small_left
1113
;--------------------------------------
1111
;--------------------------------------
1114
align 4
1112
align 4
1115
small_wait:
1113
small_wait:
1116
	mcall	10
1114
	mcall	10
1117
	cmp	eax,1
1115
	cmp	eax,1
1118
	jne	no_win
1116
	jne	no_win
1119
 
1117
 
1120
	call	[small_draw]
1118
	call	[small_draw]
1121
	jmp	small_wait
1119
	jmp	small_wait
1122
;--------------------------------------
1120
;--------------------------------------
1123
align 4
1121
align 4
1124
no_win:
1122
no_win:
1125
	cmp	eax,2
1123
	cmp	eax,2
1126
	jne	no_key
1124
	jne	no_key
1127
 
1125
 
1128
	call	handle_key
1126
	call	handle_key
1129
	jmp	small_wait
1127
	jmp	small_wait
1130
;--------------------------------------
1128
;--------------------------------------
1131
align 4
1129
align 4
1132
no_key:
1130
no_key:
1133
	mcall	17
1131
	mcall	17
1134
	cmp	ah,1
1132
	cmp	ah,1
1135
	jne	no_full
1133
	jne	no_full
1136
 
1134
 
1137
	mcall	14	; get screen max x & max y
1135
	mcall	14	; get screen max x & max y
1138
 
1136
 
1139
	mov	edx, eax
1137
	mov	edx, eax
1140
	shr	edx, 16
1138
	shr	edx, 16
1141
	xor	ebx, ebx
1139
	xor	ebx, ebx
1142
	mcall	67,,-1,,-1 ; x0 y0 xs ys
1140
	mcall	67,,-1,,-1 ; x0 y0 xs ys
1143
 
1141
 
1144
	jmp	still
1142
	jmp	still
1145
;--------------------------------------
1143
;--------------------------------------
1146
align 4
1144
align 4
1147
no_full:
1145
no_full:
1148
	call	menu_handler
1146
	call	menu_handler
1149
	jmp	small_wait
1147
	jmp	small_wait
1150
;------------------------------------------------------------------------------
1148
;------------------------------------------------------------------------------
1151
include 'libini.inc'
1149
include 'libini.inc'
1152
;------------------------------------------------------------------------------
1150
;------------------------------------------------------------------------------
1153
include '../../../dll.inc'
1151
include '../../../dll.inc'
1154
;------------------------------------------------------------------------------
1152
;------------------------------------------------------------------------------
1155
include 'drawappl.inc'
1153
include 'drawappl.inc'
1156
;------------------------------------------------------------------------------
1154
;------------------------------------------------------------------------------
1157
include 'drawbutt.inc'
1155
include 'drawbutt.inc'
1158
;------------------------------------------------------------------------------
1156
;------------------------------------------------------------------------------
1159
include 'drawwind.inc'
1157
include 'drawwind.inc'
1160
;------------------------------------------------------------------------------
1158
;------------------------------------------------------------------------------
1161
include 'drawtray.inc'
1159
include 'drawtray.inc'
1162
;------------------------------------------------------------------------------
1160
;------------------------------------------------------------------------------
1163
include 'ctx_menu.asm'
1161
include 'ctx_menu.asm'
1164
;------------------------------------------------------------------------------
1162
;------------------------------------------------------------------------------
1165
include 'i_data.inc'
1163
include 'i_data.inc'
1166
;------------------------------------------------------------------------------
1164
;------------------------------------------------------------------------------
1167
IM_END:
1165
IM_END:
1168
;------------------------------------------------------------------------------
1166
;------------------------------------------------------------------------------
1169
include 'u_data.inc'
1167
include 'u_data.inc'
1170
;------------------------------------------------------------------------------
1168
;------------------------------------------------------------------------------
1171
I_END:
1169
I_END:
1172
;------------------------------------------------------------------------------
1170
;------------------------------------------------------------------------------