Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
1373 IgorA 1
; 01.06.09 - Компоненты беруться из системной библиотеки 
205 heavyiron 2
; Автор программы Евтихов Максим (Maxxxx32)
833 Lrz 3
; 24.07.2008  обновлен editbox
307 Lrz 4
; 01.02.07 - обновлён editbox
5
; 31.01.07 - всё теперь рисуется относительно клиентской области
205 heavyiron 6
 
1228 Lrz 7
title equ 'Screenshooter v 0.92' ; Заголовок окна
1109 Lrz 8
include '../../develop/libraries/box_lib/load_lib.mac'
1373 IgorA 9
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
1098 Lrz 10
;include '../../develop/examples/editbox/trunk/editbox.inc'
11
include '../../macros.inc'
12
include 'txtbut.inc'
13
include 'label.inc'
14
include 'textwork.inc'
1228 Lrz 15
include 'scrshoot.mac'
205 heavyiron 16
 
1098 Lrz 17
;include 'macros.inc'  ; вставляем макросы
18
;        meos_header  cmdstr ; вставляем заголовок программы
1373 IgorA 19
use32
1098 Lrz 20
    org 0x0
21
    db 'MENUET01'
22
    dd 0x1
23
    dd start
24
    dd i_end
25
    dd i_end
26
    dd i_end
27
    dd cmdstr
28
    dd cur_dir_path
29
 
30
align 4
1373 IgorA 31
	@use_library
32
	use_txt_button				;  |
33
	use_label				;  |-- GUI компоненты и некоторые процедуры
34
	use_text_work				; /
1228 Lrz 35
include 'scrwin.inc'  ; вставляем код окна прдпросмотра
36
include 'scrsavef.inc'; вставляем процедуру сохранения файла
37
 
307 Lrz 38
include 'gp.inc'
39
include 'srectwin.inc'
310 heavyiron 40
include 'lang.inc'
1373 IgorA 41
 
42
macro get_sys_colors col_buf
43
{
44
	;mov     eax,48
45
	push	48
46
	pop	eax
47
	;mov     ebx,3
48
	push	3
49
	pop	ebx
50
	;mov     ecx,col_buf
51
	push	col_buf
52
	pop	ecx
53
	;mov     edx,40
54
	push	40
55
	pop	edx
56
	mcall
57
}
58
 
205 heavyiron 59
;--- начало программы ---
1098 Lrz 60
align 4
61
start:
62
sys_load_library  library_name, cur_dir_path, library_path, system_path, \
63
err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i
64
;if return code =-1 then exit, else nornary work
65
;        cmp     eax,-1
1373 IgorA 66
	inc	eax
67
	test	eax,eax
68
	jz	close
1098 Lrz 69
;;;;;;;;;;;;;;;; init memory 68/11
1373 IgorA 70
	mov	eax,68
71
	mov	ebx,11
72
	mcall
73
	test	eax,eax
74
	jz	close
1098 Lrz 75
 
1373 IgorA 76
	;mov     al,[gs:1280*4*1024]
77
		    ; устанавливаем ipc буффер
78
	push	60
79
	pop	eax
80
	;mov     ebx,1
81
	xor	ebx,ebx
82
	inc	ebx
83
	mov	ecx,app_ipc
84
	mov	edx,32
85
	mcall
205 heavyiron 86
 
1373 IgorA 87
	push	66   ; устанавливаем глобальную горячую клавишу
88
	pop	eax
89
	push	eax
90
	mov	ebx,4
91
	mov	cl,55	 ; 55 - PrintScrn
92
	xor	edx,edx
93
	mcall
205 heavyiron 94
 
1373 IgorA 95
	mov	ebx,app
96
	call	get_slot_n
97
	mov	[slot_n],ecx
205 heavyiron 98
 
1373 IgorA 99
	; устанавливаем маску событий
100
	set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse+evm_ipc)
205 heavyiron 101
 
102
; сюда прыгаем при каждой перерисовке
103
red:
1373 IgorA 104
	get_procinfo app   ; получаем информацию о процессе
105
	get_sys_colors sc  ; получаем системные цвета
205 heavyiron 106
 
1373 IgorA 107
	; устанавливаем системные цвета у GUI компонентов
108
	txt_but_set_sys_color buttons,buttons_end,sc		 ; \
109
	labels_set_sys_color labels,labels_end,sc		 ; |
110
	check_boxes_set_sys_color check_boxes,check_boxes_end,sc ; |
111
	edit_boxes_set_sys_color editboxes,editboxes_end,sc	 ; /
205 heavyiron 112
 
1373 IgorA 113
	get_screen_prop scr ; получаем информацию об экране
114
	call	draw_window ; перерисовываем окно
205 heavyiron 115
still:
1373 IgorA 116
	wait_event red,key,button,mouse,ipc,still ; ждем событий
205 heavyiron 117
 
118
key:
1373 IgorA 119
	get_key
120
	cmp	al,2
121
	jne	@f
122
	cmp	ah,55
123
	jne	@f
124
	call	shoot
125
	jmp	still
205 heavyiron 126
@@:
1098 Lrz 127
;        key_edit_boxes editboxes,editboxes_end
1373 IgorA 128
	push	dword edit1
129
	call	[edit_box_key]
1098 Lrz 130
 
1373 IgorA 131
	push	dword edit2
132
	call	[edit_box_key]
1098 Lrz 133
 
1373 IgorA 134
	push	dword edit3
135
	call	[edit_box_key]
1098 Lrz 136
 
1373 IgorA 137
	push	dword edit4
138
	call	[edit_box_key]
1098 Lrz 139
 
1373 IgorA 140
	jmp	still
205 heavyiron 141
button:
1373 IgorA 142
	get_pressed_button
143
	cmp	ah,1
144
	je	p_close
145
	txt_but_ev buttons,buttons_end
146
	jmp	still
205 heavyiron 147
mouse:
1373 IgorA 148
	get_active_window
149
	cmp	eax,[slot_n]
150
	jne	still
1098 Lrz 151
;----------------------------------
1373 IgorA 152
	push	dword edit1
153
	call	[edit_box_mouse]
154
	push	dword edit2
155
	call	[edit_box_mouse]
156
	push	dword edit3
157
	call	[edit_box_mouse]
158
	push	dword edit4
159
	call	[edit_box_mouse]
1098 Lrz 160
;----------------------------------
1373 IgorA 161
	push	dword ch1
162
	call	[check_box_mouse]
163
	push	dword ch2
164
	call	[check_box_mouse]
165
	push	dword ch3
166
	call	[check_box_mouse]
167
	push	dword ch4
168
	call	[check_box_mouse]
169
	push	dword ch5
170
	call	[check_box_mouse]
171
	push	dword ch6
172
	call	[check_box_mouse]
173
	push	dword use_rect
174
	call	[check_box_mouse]
1098 Lrz 175
;-----------------------------------
176
;        mouse_check_boxes check_boxes,check_boxes_end
177
;        mouse_edit_boxes editboxes,editboxes_end
1373 IgorA 178
	jmp	still
205 heavyiron 179
ipc:
1373 IgorA 180
	cmp	word [app_ipc+8],2
181
	jne	@f
182
	min_window
183
	jmp	.clear_ipc
205 heavyiron 184
@@:
1373 IgorA 185
	cmp	word [app_ipc+8],3
186
	jne	@f
187
	mov	ecx,[slot_n]
188
	activ_window
189
	jmp	.clear_ipc
1100 Lrz 190
@@:
1373 IgorA 191
	call	draw_number
192
	call	dr_st
205 heavyiron 193
 
194
.clear_ipc:
1373 IgorA 195
	cld
196
	xor	eax,eax
197
	mov	ecx,32/4
198
	mov	edi,app_ipc
199
	rep	stosd
200
	jmp	still
205 heavyiron 201
 
202
p_close:
1373 IgorA 203
	btr	dword [flags],1
307 Lrz 204
 
1373 IgorA 205
	bt	dword [flags],3
206
	jnc	@f
207
	mov    eax,18
208
	mov	ebx,eax
209
	mov	ecx,[set_rect_window_pid]
210
	mcall
307 Lrz 211
@@:
212
 
205 heavyiron 213
close:
1373 IgorA 214
	app_close
205 heavyiron 215
 
216
;--------------------------------------------------------------------
217
;--- прооцедура перерисовки главного окна ---------------------------
218
;--------------------------------------------------------------------
219
draw_window:
1373 IgorA 220
start_draw_window	 ; начало перерисовки
221
	; определяем окно
222
	get_skin_height
223
	mov	ebx,100*65536+320
224
	mov	ecx,100*65536+220
225
	add	cx,ax
226
	mov	edx,[sc.work]
227
	or	edx,0x34000000;0x33000000
228
	xor	esi,esi
229
	;xor     edi,edi
230
	mov	edi,grab_text
231
	xor	eax,eax
232
	mcall
205 heavyiron 233
 
1373 IgorA 234
	mov	eax,47		   ; выводим числа в окно
235
	mov	bx,4
236
	shl	ebx,16
237
	movsx	ecx,word [scr.width] ; ширина экрана
238
	mov	dx,95
239
	shl	edx,16
240
	mov	dx,[label1.top]
241
	push	dx
242
	mov	esi,[sc.work_text]
243
	mcall
244
	movsx	ecx,word [scr.height]	; высота экрана
245
	mov	dx,[label2.top]
246
	mcall
247
	mov	bx,2
248
	shl	ebx,16
249
	movsx	ecx,word [scr.bitspp]	; бит на пиксель
250
	mov	dx,240
251
	shl	edx,16
252
	pop	dx
253
	mcall
254
	mov	bx,6
255
	shl	ebx,16
256
	mov	ecx,[scr.bytesps]	; байт на строку
257
	mov	dx,[label2.top]
258
	mcall
205 heavyiron 259
 
1373 IgorA 260
	call	draw_number	 ; прорисовываем номер снимка
261
	call	dr_st
205 heavyiron 262
 
1373 IgorA 263
	draw_labels labels,labels_end		 ; метки
1098 Lrz 264
;        draw_edit_boxes editboxes,editboxes_end  ; edit_box
265
;------ show check editbox -----------
1373 IgorA 266
	push	dword edit1
267
	call	[edit_box_draw]
268
	push	dword edit2
269
	call	[edit_box_draw]
270
	push	dword edit3
271
	call	[edit_box_draw]
272
	push	dword edit4
273
	call	[edit_box_draw]
1098 Lrz 274
;------ end check all editbox -------
275
 
1373 IgorA 276
	draw_txt_buttons buttons,buttons_end	 ; кнопки
1098 Lrz 277
;        draw_check_boxes check_boxes,check_boxes_end ; флажки
278
;------ check all checkbox ---------
1373 IgorA 279
	push	dword ch1
280
	call	[check_box_draw]
281
	push	dword ch2
282
	call	[check_box_draw]
283
	push	dword ch3
284
	call	[check_box_draw]
285
	push	dword ch4
286
	call	[check_box_draw]
287
	push	dword ch5
288
	call	[check_box_draw]
289
	push	dword ch6
290
	call	[check_box_draw]
291
	push	dword use_rect
292
	call	[check_box_draw]
1098 Lrz 293
;------ end check all checkbox ------
294
 
205 heavyiron 295
stop_draw_window      ; конец перерисовки
296
ret
297
 
298
shoot:
1373 IgorA 299
	bt	dword [ch4.flags],1   ; включена ли задержка ?
300
	jnc	@f
301
	draw_status delay_now
302
	mov	edi,ed_buffer.2
303
	call	zstr_to_int
304
	mov	ebx,eax
305
	delay
205 heavyiron 306
@@:
1373 IgorA 307
	call	get_mem_for_shoot; получаем память для снимка
205 heavyiron 308
 
309
 
1373 IgorA 310
	bts	dword [flags],0       ; нулевой флаг - снимок есть в памяти
205 heavyiron 311
 
1373 IgorA 312
	; делаем снимок
313
	draw_status shooting
314
	mov	esi,scr
315
	mov	edi,[scr_buf.ptr]
316
	call	copy_screen_to_image
205 heavyiron 317
 
1373 IgorA 318
	bt	dword [use_rect.flags],1
319
	jc	.use_rect
320
	push	dword [scr]
321
	jmp	@f
307 Lrz 322
.use_rect:
1373 IgorA 323
	push	dword [rect.height]
307 Lrz 324
@@:
1373 IgorA 325
	pop	dword [scr_buf.size]
205 heavyiron 326
 
1373 IgorA 327
	bt	dword [ch5.flags],1  ; включено ли автосохранение ?
328
	jnc	@f
329
	call	save_file
205 heavyiron 330
@@:
1373 IgorA 331
	draw_status	shooted_ok
205 heavyiron 332
 
1373 IgorA 333
	bt	dword [flags],1
334
	jnc	@f
335
	ret
205 heavyiron 336
@@:
337
 
1373 IgorA 338
	bt	dword [ch2.flags],1  ; показать окно предпросмотра ?
339
	jnc	@f
1100 Lrz 340
 
1373 IgorA 341
	call	show_scr_window
1100 Lrz 342
	ret
205 heavyiron 343
@@:
1373 IgorA 344
	bt	word [ch3.flags],1   ; восстановить окно ?
345
	jnc	@f
205 heavyiron 346
 
1373 IgorA 347
	delay 100
348
	mov	ecx,[slot_n]
349
	activ_window
205 heavyiron 350
@@:
351
ret
352
 
307 Lrz 353
;--- получить память для снимка ---
205 heavyiron 354
get_mem_for_shoot:
1098 Lrz 355
;clean memory
1373 IgorA 356
	mov	ecx,dword [scr_buf.ptr]
357
	mov	ebx,13
358
	mov	eax,68
359
	mcall
1098 Lrz 360
 
1373 IgorA 361
	bt	dword [use_rect.flags],1 ; фоткать область экрана
362
	jc	.use_area
363
	movzx	ecx, word [scr.width]
364
	movzx	ebx, word [scr.height]
365
	jmp	@f
307 Lrz 366
.use_area:
1373 IgorA 367
	call	read_rect
368
	movzx	ecx, word [rect.width]
369
	movzx	ebx, word [rect.height]
307 Lrz 370
@@:
1373 IgorA 371
	imul	ecx,ebx
372
	lea	ecx,[ecx*3]
1098 Lrz 373
;        add     ecx,i_end
1373 IgorA 374
	mov	ebx,12
375
	mov	eax,68
376
	mcall
377
	mov	[scr_buf.ptr],eax
378
	add	eax,ecx
379
	mov	[scr_buf.end_ptr],ecx
205 heavyiron 380
ret
381
 
382
;--- содать окно проедпросмотра ---
383
show_scr_window:
384
pusha
1373 IgorA 385
	bt	dword [flags],0
386
	jnc	@f
387
	mov	eax,51
388
	xor	ebx,ebx
389
	inc	ebx
390
	mov	ecx,scr_window
391
	mov	edx,i_end_tread-1000
392
	mcall
205 heavyiron 393
@@:
394
popa
395
ret
396
 
397
;--- прочитать и нарисовать текущий номер ---
398
apply_number:
1373 IgorA 399
	mov	edi,ed_buffer.3
400
	call	zstr_to_int
401
	mov	[cur_number],eax
402
	call	draw_number
205 heavyiron 403
ret
404
 
405
;--- процедура прорисовки текущего номера ---
406
draw_number:
1373 IgorA 407
	mov	edi,sign_n_input
408
	call	zstr_to_int
409
	mov	[sign_n],al
410
	mov	eax,13
411
	mov	ebx,150*65536+96
412
	mov	cx,[label9.top]
413
	shl	ecx,16
414
	mov	cx,10
415
	mov	edx,[sc.work]
416
	mcall
417
	mov	eax,47
418
	movsx	bx,byte [sign_n]
419
	shl	ebx,16
420
	mov	ecx,[cur_number]
421
	mov	dx,150
422
	shl	edx,16
423
	mov	dx,[label9.top]
424
	mov	esi,[sc.work_text]
425
	mcall
205 heavyiron 426
ret
427
 
428
;--- процедура, запускающая поток автосъемки ---
429
start_autoshoot:
1373 IgorA 430
	bts	dword [flags],1
431
	jc	@f
432
	mov	eax,51
433
	;mov     ebx,1
434
	xor	ebx,ebx
435
	inc	ebx
436
	mov	ecx,autoshoot
437
	mov	edx,i_end_tread-512
438
	mcall
205 heavyiron 439
@@:
440
ret
441
 
442
;--- останавливает этот поток ---
443
stop_autoshoot:
1373 IgorA 444
	btr	dword [flags],1
205 heavyiron 445
ret
446
 
447
;--- цикл потока автосъемки ---
448
autoshoot:
1373 IgorA 449
	mov	ecx,[slot_n]
450
	activ_window
205 heavyiron 451
.next:
1373 IgorA 452
	bt	dword [flags],1
453
	jnc	close
454
	mov	eax,60
455
	mov	ebx,2
456
	mov	ecx,[app.pid]
457
	mov	edx,messages.draw_number
458
	mov	esi,2
459
	mcall
460
	call	shoot
461
	jmp	autoshoot.next
205 heavyiron 462
 
463
;--- процедура прорисовки строки состояния ---
464
; (должна вызываться потоком главного окна)
465
dr_st:
1373 IgorA 466
	mov	eax,38		    ; отрезок
467
	mov	ebx,0*65536+310
468
	mov	ecx,198*65536+198
469
	mov	edx,[sc.work_graph]
470
	mcall
205 heavyiron 471
 
1373 IgorA 472
	mov	eax,13		    ; полоска
473
	mov	bx,310
474
	mov	ecx,199*65536+15
475
	mov	edx,[sc.work]
476
	mcall
205 heavyiron 477
 
1373 IgorA 478
	mov	edi,status
479
	call	draw_label
205 heavyiron 480
ret
481
 
482
;--- процедура получения номера слота потока ---
483
; вход ebx - буффер 1024 байт
484
; выход ecx - номер слота
485
get_slot_n:
1373 IgorA 486
	mov	eax,9
487
	xor	ecx,ecx
488
	dec	ecx
489
	mcall
205 heavyiron 490
 
1373 IgorA 491
	mov	edx,[ebx+30]
492
	xor	ecx,ecx
205 heavyiron 493
@@:
1373 IgorA 494
	mov	eax,9
495
	inc	ecx
496
	mcall
497
	cmp	[ebx+30],edx
498
	je	@f
499
	jmp	@b
205 heavyiron 500
@@:
501
ret
502
 
307 Lrz 503
;--- процедура, запускающая поток, делающий 1 снимок ---
205 heavyiron 504
one_shoot:
1373 IgorA 505
	mov	ecx,one_shoot_thread
506
	mov	edx,shoot_esp
507
	jmp	@f
307 Lrz 508
;--- процедра, запускающая поток, сохраняющий снимок ---
205 heavyiron 509
save_shoot:
1373 IgorA 510
	mov	ecx,save_shoot_thread
511
	mov	edx,shoot_esp
205 heavyiron 512
@@:
1373 IgorA 513
	bts	dword [flags],2
514
	jc	.running
515
	bt	dword [flags],1
516
	jc	.running
205 heavyiron 517
 
1373 IgorA 518
	mov	eax,51
519
	;mov     ebx,1
520
	xor	ebx,ebx
521
	inc	ebx
522
	mcall
205 heavyiron 523
.running:
524
ret
525
 
307 Lrz 526
;--- поток, делающий 1 снимок ---
205 heavyiron 527
one_shoot_thread:
1373 IgorA 528
	mov	ecx,[slot_n]
529
	activ_window
530
	bt	dword [ch1.flags],1   ; минимизировать окно ?
531
	jnc	 @f
532
	mov	eax,60
533
	mov	ebx,2
534
	mov	ecx,[app.pid]
535
	mov	edx,messages.min_window
536
	mov	esi,2
537
	mcall
205 heavyiron 538
@@:
1373 IgorA 539
	call	shoot
540
	btr	dword [flags],2
541
	jmp	close
205 heavyiron 542
 
307 Lrz 543
;--- процедура, отправляющая главному окну сообщение о перерисовке
544
; строки состояния ---
205 heavyiron 545
send_draw_status:
1373 IgorA 546
	mov	eax,60
547
	mov	ebx,2
548
	mov	ecx,[app.pid]
549
	mov	edx,messages.draw_status
550
	mov	esi,2
551
	mcall
205 heavyiron 552
ret
553
 
307 Lrz 554
;--- поток, сохраняюий файл ---
205 heavyiron 555
save_shoot_thread:
1373 IgorA 556
	mov	ecx,[slot_n]
557
	activ_window
558
	call	save_file
559
	btr	dword [flags],2
560
	jmp	close
205 heavyiron 561
 
307 Lrz 562
;--- процедура, запускающая поток окна установки области съемки ---
563
show_set_rect_window:
1373 IgorA 564
	bts	dword [flags],3
565
	jc	@f
566
	mov	eax,51
567
	xor	ebx,ebx
568
	inc	ebx
569
	mov	ecx,set_rect_window
570
	mov	edx,set_rect_window_esp
571
	mcall
307 Lrz 572
 
1373 IgorA 573
	mov	[set_rect_window_pid],eax
307 Lrz 574
ret
575
 
576
@@:
1373 IgorA 577
	mov	eax,18
578
	mov	ebx,eax
579
	mov	ecx,[set_rect_window_pid]
580
	mcall
581
	btr	dword [flags],3
307 Lrz 582
ret
583
 
584
;--- получение информации об активном окне ---
585
get_active_window_info:
1373 IgorA 586
	mov    eax,18
587
	mov    ebx,7
588
	mcall
307 Lrz 589
 
1373 IgorA 590
	mov	ecx,eax
591
	mov	eax,9
592
	mov	ebx,active_app
593
	mcall
307 Lrz 594
ret
595
 
205 heavyiron 596
;====================================================================
597
;=== данные программы ===============================================
598
;====================================================================
599
messages:
600
.draw_number dw 0
601
.draw_status dw 1
602
.min_window  dw 2
1100 Lrz 603
.act_window  dw 3
205 heavyiron 604
 
605
grab_text:
1373 IgorA 606
	db	title,0
307 Lrz 607
 
205 heavyiron 608
labels:
307 Lrz 609
label1 label 5,5,0,text.1   ; ширина экрана
610
label2 label 5,15,0,text.2   ; высота экрана
611
label3 label 5,25,0,text.3   ; введите имя файла
612
label4 label 150,5,0,text.4  ; бит на пиксель
613
label5 label 150,15,0,text.5  ; байт на строку
614
label6 label 115,138,0,text.6  ; 100 = 1 сек.
205 heavyiron 615
;label7 label 10,190,0,text.7
616
;label8 label 10,225,0,text.8
307 Lrz 617
label9 label 5,52,0,text.9   ; номер текущего симка
618
label10 label 5,185,0,text.10
619
status label 5,201,0,no_shoot
205 heavyiron 620
labels_end:
621
 
622
editboxes:
1373 IgorA 623
edit1 edit_box 300,5,35,cl_white,0,0,0,0,300,ed_buffer.1,mouse_dd,ed_focus,10,10	; путь к файлу
624
edit2 edit_box 35,75,134,cl_white,0,0,0,0,9,ed_buffer.2,mouse_dd,ed_figure_only,3,3	    ; задержка
1228 Lrz 625
edit3 edit_box 35,165,164,cl_white,0,0,0,0,9,ed_buffer.3,mouse_dd,ed_figure_only    ; автонумерация
626
edit4 edit_box 16,165,181,cl_white,0,0,0,0,1,sign_n_input,mouse_dd,ed_figure_only,1
205 heavyiron 627
editboxes_end:
628
 
629
buttons:
1373 IgorA 630
but1 txt_button 150,5,15,65,2,0,0,but_text.1,one_shoot		   ; сделать снимок
631
but2 txt_button 145,160,15,65,3,0,0,but_text.2,save_shoot	   ; сохранить снимок
307 Lrz 632
but3 txt_button 140,115,12,120,4,0,0,but_text.3,show_scr_window    ; показать снимок
1373 IgorA 633
but4 txt_button 80,205,15,163,5,0,0,but_text.4,apply_number	   ; применить номер
634
but5 txt_button 150,5,15,85,6,0,0,but_text.5,start_autoshoot	   ; начать автосъёмку
635
but6 txt_button 145,160,15,85,7,0,0,but_text.6,stop_autoshoot	   ; остановить автосъёмку
307 Lrz 636
but7 txt_button 40,205,10,150,8,0,0,but_text.7,show_set_rect_window ; задать область
205 heavyiron 637
buttons_end:
638
 
639
check_boxes:
1098 Lrz 640
ch1 check_box 5,105,5,11,cl_white,0,0,ch_text.1,(ch_text.2-ch_text.1),ch_flag_en  ; свернуть окно
641
ch2 check_box 5,120,5,11,cl_white,0,0,ch_text.2,(ch_text.3-ch_text.2),ch_flag_en  ; затем сделать активным
642
ch3 check_box 145,105,5,11,cl_white,0,0,ch_text.3,(ch_text.4-ch_text.3),ch_flag_en ; показать снимок
643
ch4 check_box 5,135,5,11,cl_white,0,0,ch_text.4,(ch_text.5-ch_text.4),ch_flag_en   ; задержка
644
ch5 check_box 5,150,5,11,cl_white,0,0,ch_text.5,(ch_text.6-ch_text.5)
645
ch6 check_box 5,165,5,11,cl_white,0,0,ch_text.6,(ch_text.7-ch_text.6),ch_flag_en
646
use_rect check_box 145,150,5,11,cl_white,0,0,ch_text.7,(ch_text.8-ch_text.7) ; исп. область
205 heavyiron 647
; автонумерация
648
check_boxes_end:
649
 
650
if lang eq ru
651
text:
307 Lrz 652
.2 db 'Высота экрана:',0
653
.1 db 'Ширина экрана:',0
654
.3 db 'Введите полный путь к файлу:',0
655
.4 db 'Бит на пиксель:',0
656
.5 db 'Байт на строку:',0
657
.6 db '100 = 1 секунда',0
205 heavyiron 658
;.7: db 'Введите имя файла:',0
659
;.8: db 'Вместо "*" в имени файла будет вставляться номер.',0
307 Lrz 660
.9 db 'Номер текущего снимка:',0
661
.10 db 'Количество знаков в номере:',0
205 heavyiron 662
 
663
but_text:
307 Lrz 664
.1 db 'Сделать снимок экрана',0
665
.2 db 'Сохранить снимок экрана',0
666
.3 db 'Показать снимок сейчас',0
667
.4 db 'Применить',0
668
.5 db 'Начать автосъемку',0
669
.6 db 'Остановить автосъемку',0
670
.7 db 'задать',0
205 heavyiron 671
 
672
ch_text:
673
.1 db 'Свернуть окно';,0
674
.2 db 'Показать снимок';,0
675
.3 db 'затем сделать активным';,0
307 Lrz 676
.4 db 'Задержка:';,0
677
.5 db 'Автосохранение';,0
678
.6 db 'Автонумерация, начиная с';,0
679
.7 db 'Область'
680
.8:
205 heavyiron 681
 
682
no_shoot db 'Снимок не сделан',0
683
shooting db 'Фотографирование...',0
684
shooted_ok db 'Снимок сделан',0
685
saving db 'Сохранение...',0
686
saved_ok db 'Снимок сохранен',0
687
delay_now db 'Задержка...',0
688
bad_file_name db 'Имя файла введено неверно',0
689
disk_filled db 'Диск заполнен',0
690
bad_fat_table db 'Таблица FAT разрушена',0
691
ac_den db 'Доступ запрещен',0
692
device_er db 'Ошибка устройства',0
693
not_shooted db 'Сделайте снимок !!!',0
694
no_file_name db 'Введите имя файла !!!',0
307 Lrz 695
invalid_rect db 'Недопустимые размеры области',0
310 heavyiron 696
 
697
else
698
text:
699
.2 db 'Screen width:',0
700
.1 db 'Screen height:',0
701
.3 db 'Enter full path to the file:',0
702
.4 db 'Bits per pixel:',0
703
.5 db 'Bytes per line:',0
704
.6 db '100 = 1 second',0
705
;.7: db 'Enter name of file:',0
706
;.8: db 'Instead of "*" in filename the number will be included.',0
707
.9 db 'Current photo number:',0
708
.10 db 'Amount of digits in number:',0
709
 
710
but_text:
711
.1 db 'Make screen photo',0
712
.2 db 'Save screen photo',0
713
.3 db 'Show photo now',0
714
.4 db 'Apply',0
715
.5 db 'Start autoshooting',0
716
.6 db 'Stop autoshooting',0
717
.7 db 'Set',0
718
 
719
ch_text:
720
.1 db 'Minimize window';,0
721
.2 db 'Show photo';,0
722
.3 db 'then make active';,0
723
.4 db 'Delay:';,0
724
.5 db 'Autosave';,0
725
.6 db 'Start numeration from';,0
726
.7 db 'Area'
727
.8:
728
 
729
no_shoot db 'There is no photo',0
730
shooting db 'Photographing...',0
731
shooted_ok db 'Photo created',0
732
saving db 'Saving...',0
733
saved_ok db 'Photo saved',0
734
delay_now db 'Delay...',0
735
bad_file_name db 'File name is wrong',0
736
disk_filled db 'Disk is full',0
737
bad_fat_table db 'FAT table destroyed',0
738
ac_den db 'Access denied',0
739
device_er db 'Device error',0
1098 Lrz 740
not_shooted db 'Make a photo !!!',0
310 heavyiron 741
no_file_name db 'Enter file name !!!',0
742
invalid_rect db 'Wrong area size',0
743
 
205 heavyiron 744
end if
745
 
746
sign_n_input:
1373 IgorA 747
	db	'2',0
205 heavyiron 748
 
749
app_ipc ipc_buffer 32
1098 Lrz 750
align 4
205 heavyiron 751
 
451 heavyiron 752
mouse_flag: dd 0x0
753
structure_of_potock:
754
rb 100
755
 
1098 Lrz 756
align 4
757
 
1373 IgorA 758
cur_number	  dd	  ?
205 heavyiron 759
 
1373 IgorA 760
sign_n	      db      ?
205 heavyiron 761
 
1373 IgorA 762
slot_n	      dd ?
205 heavyiron 763
 
1373 IgorA 764
flags	     dd ?
205 heavyiron 765
 
766
scr_buf:
1373 IgorA 767
.ptr	    dd	    ?
768
.end_ptr	dd	?
205 heavyiron 769
.size:
770
.height        dw      ?
1373 IgorA 771
.width	      dw      ?
205 heavyiron 772
 
773
fs_struc:
774
.funk_n        dd      ?
1373 IgorA 775
	dd	?
776
	dd	?
777
.bytes_to_write  dd	 ?
778
.data_ptr	 dd    ?,?
205 heavyiron 779
.fn_ptr        dd      ?
780
 
781
sf_buf:
782
.bmp_header   dd      ?
783
.bmp_area     dd      ?
1373 IgorA 784
.end	      dd      ?
205 heavyiron 785
 
307 Lrz 786
set_rect_window_pid dd ?
787
set_rect_window_slot dd ?
788
 
1098 Lrz 789
align 4
790
 
791
ed_buffer:
792
.1: db '/sys/*.bmp',0
793
rb 287
794
.2: db '100',0
795
 rb 6
796
.3:  rb 10
797
 
798
 
799
align 4
307 Lrz 800
rect_input_buffer:
801
.left rb 6
802
.top  rb 6
1373 IgorA 803
.width	rb 6
307 Lrz 804
.height rb 6
805
 
205 heavyiron 806
cmdstr rb 257
807
 
1098 Lrz 808
align 4
205 heavyiron 809
 
810
file_name:
1373 IgorA 811
	rb	1058
205 heavyiron 812
 
813
scr screen_prop
307 Lrz 814
rect:
815
.left dw ?
816
.top dw ?
817
.height dw ?
818
.width dw ?
819
 
205 heavyiron 820
sc sys_color_table
1373 IgorA 821
app procinfo	    ; информация о главном окне
307 Lrz 822
active_app procinfo ; информация об активном окне
823
set_rect_window_procinfo procinfo  ; информация об окне области
1373 IgorA 824
shoot_esp rb 512		   ; стек потока фотканья
825
set_rect_window_esp rb 512	   ; стек окна области
1098 Lrz 826
;        app_end    ; конец программы
1214 Lrz 827
mouse_dd	rd 1
1098 Lrz 828
align 4
1373 IgorA 829
cur_dir_path	rb 4096
830
library_path	rb 4096
1098 Lrz 831
i_end_tread:
832
rb 1024
833
align 4
834
i_end: