Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
5425 leency 1
ICON_STRIP	equ '/rd/1/icons32.png'
4336 GerdtR 2
ICON_INI	equ '/rd/1/settings/icon.ini'
4945 yogev_ezra 3
ICON_SIZE	equ 68	  ;размер области для иконки с надписью
4
IMG_SIZE	equ 32	  ;размер иконок
5017 GerdtR 5
TEXT_BOTTOM_Y	equ 14	  ;отступ по Y текста от низа иконки
4945 yogev_ezra 6
IMAGE_TOP_Y	equ 10	  ;>=1 Координата Y иконки в области для данной иконки
7
ALIGN_SIZE	equ 68	  ;размер сетки выравнивания
8
NAME_LENGTH	equ 11	 ;длина имени иконки
9
MIN_NO_MOVING	equ 8	 ;через столько пикселей сдвига мыши начинается таскание иконки
4036 GerdtR 10
 
4945 yogev_ezra 11
		     ;--------для диалога создания/редактирования
4146 GerdtR 12
ICONSX		equ 20
7012 leency 13
ICONSY		equ 90
14
ICONS_DRAW_COUNTW equ 12  ;количество иконок в ширину
15
ICONS_DRAW_COUNTH equ 6   ;количество иконок в высоту
4945 yogev_ezra 16
SPCW		equ 3	  ;пробел между иконками по горизонтали
4146 GerdtR 17
SPCH		equ 3
3853 GerdtR 18
END_ICONS_AREAW equ ICONSX+(IMG_SIZE+SPCW)*ICONS_DRAW_COUNTW-SPCW
19
END_ICONS_AREAH equ ICONSY+(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH-SPCH
20
 
21
 
22
 
4146 GerdtR 23
SizeData	equ bufStdIco+32
24
BegData 	equ fiStdIco.point
3853 GerdtR 25
;------------------------------------------------------------------------------
4146 GerdtR 26
	use32
27
	org 0x0
28
	db 'MENUET01'	; 8 byte id
29
	dd 0x01 	; header version
30
	dd START	; start of code
31
	dd I_END	; size of image
32
	dd ENDMEM	; memory for app
33
	dd stack_main	; esp
34
	dd 0		; boot parameters
35
	dd 0		; path
3853 GerdtR 36
;------------------------------------------------------------------------------
37
include 'lang.inc'
38
include '../../macros.inc'
39
include '../../proc32.inc'
40
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
41
include '../../dll.inc'
4003 GerdtR 42
;include '../../debug.inc'
3853 GerdtR 43
;------------------------------------------------------------------------------
4146 GerdtR 44
START:		; start of execution
45
	mcall	68,11
46
	stdcall dll.Load,IMPORTS
47
	test	eax,eax
48
	jnz	ErrLoadLibs
3853 GerdtR 49
 
50
; unpack deflate
4146 GerdtR 51
	mov	eax,[unpack_DeflateUnpack2]
52
	mov	[deflate_unpack],eax
3853 GerdtR 53
;---------------------------------------------------------------------
5425 leency 54
; get size of file icons32.png
4146 GerdtR 55
	mcall	70,fiStdIco
56
	test	eax,eax
57
	jnz	ErrorStrp
5425 leency 58
; get memory for icons32.png
4146 GerdtR 59
	mov	ecx,dword[bufStdIco+32]
60
	mov	[fiStdIco.size],ecx
61
	mov	[img_size],ecx
62
	mcall	68,12
63
	mov	[fiStdIco.point],eax
64
	mov	[image_file],eax
5425 leency 65
; load icons32.png
4146 GerdtR 66
	mov	dword[fiStdIco],0
67
	mcall	70,fiStdIco
68
	test	eax,eax
69
	jnz	close
3853 GerdtR 70
; convert PNG to RAW
4146 GerdtR 71
	xor	eax,eax
72
	mov	[return_code],eax
3853 GerdtR 73
;int3
74
 
4146 GerdtR 75
	push	image_file
76
	call	[cnv_png_import.Start]
3853 GerdtR 77
 
4146 GerdtR 78
	mov	eax,[raw_pointer]
79
	mov	ebx,[eax+32]
80
	mov	[strip_file_size],ebx
81
	mov	eax,[eax+28]
82
	add	eax,[raw_pointer]
83
	mov	[strip_file],eax
3853 GerdtR 84
; back memory to system
4146 GerdtR 85
	mcall	68,13,[fiStdIco.point]
3853 GerdtR 86
 
4146 GerdtR 87
	mov	eax,[raw_pointer]
88
	mov	eax,[eax+8]
89
	shr	eax,5
90
	mov	[icon_count],eax
3853 GerdtR 91
 
4146 GerdtR 92
	and	eax,0x7
93
	mov	[cur_band_compensation],eax
3853 GerdtR 94
 
4945 yogev_ezra 95
;########## загружаем данные иконок в память ##########################
3853 GerdtR 96
 
4945 yogev_ezra 97
	mcall	70,fiIni		     ;выделяем память, достаточной для хранения ini файла.
98
	test	eax,eax 		;Её точно хватит для хранения данных об иконках
4146 GerdtR 99
	jnz	ErrorIni
3853 GerdtR 100
 
4146 GerdtR 101
	cmp	dword[bufIni+32],0
102
	je	ErrorIni
103
	mcall	68,12,dword[bufIni+32]
104
	mov	dword[BegData],eax
105
	jmp	NoErrIni
3853 GerdtR 106
 
107
  ErrorIni:
4146 GerdtR 108
	mcall	70,fiRunProg
109
	mcall	-1
3853 GerdtR 110
 
111
  NoErrIni:
4146 GerdtR 112
	m2m	[PIcoDB],[BegData]
3853 GerdtR 113
 
4336 GerdtR 114
 
115
 
116
	mov	edi,IconsID
117
	xor	eax,eax
118
	mov	ecx,100h/4
119
	rep stosd
120
	mov	[nLoadIcon],0
4146 GerdtR 121
	stdcall [ini_enum_sections],IconIni,LoadIconsData
3853 GerdtR 122
;int3
4146 GerdtR 123
	mov	eax,dword[PIcoDB]
124
	sub	eax,[BegData]
125
	mov	dword[SizeData],eax
126
	mov	eax,[BegData]
127
	cmp	eax,[PIcoDB]
128
	jne	@f
129
	mov	dword[eax],0
130
	mov	dword[SizeData],0
3853 GerdtR 131
   @@:
132
;######################################################################
4945 yogev_ezra 133
	call	FillIconsOffs		       ;заполняет MaxNumIcon,IconsOffs
3853 GerdtR 134
 
5017 GerdtR 135
;инициализация IPC буфера
136
	mov	dword[IPCbuffer],0
137
	mov	dword[IPCbuffer+4],8
138
	mcall	60,1,IPCbuffer,1024
3853 GerdtR 139
 
7016 leency 140
	mcall	40,EVM_MOUSE+EVM_IPC ;нужны только события мыши и IPC,
5017 GerdtR 141
					 ;перерисовка иконок будет в другом потоке
4146 GerdtR 142
	mov	eax,[icon_count]
143
	mov	bl,ICONS_DRAW_COUNTH
144
	div	bl
145
	test	ah,ah
146
	jz	@f
147
	inc	al
3853 GerdtR 148
     @@:
4146 GerdtR 149
	and	eax,0FFh
150
	mov	[sbIcons.max_area],eax
3853 GerdtR 151
 
4945 yogev_ezra 152
	mcall	51,1,BGRedrawThread,stack_bredraw	;запускаем поток перерисовки иконок
4146 GerdtR 153
	stdcall [OpenDialog_Init],OpenDialog_data
3853 GerdtR 154
 
4336 GerdtR 155
;dph [MaxNumIcon]
156
 
3853 GerdtR 157
messages:
4146 GerdtR 158
	mcall	10
159
	sub	eax,6
160
	jz	MSGMouse
5017 GerdtR 161
	dec	eax
162
	jz	MSGIPC
163
	jmp	messages
3853 GerdtR 164
 
5017 GerdtR 165
MSGIPC:
166
	call	IPCCreateIcon
4146 GerdtR 167
	jmp	messages
3853 GerdtR 168
 
169
MSGMouse:
4146 GerdtR 170
	mcall	37,0	;GetMousePos
171
	xor	ebx,ebx
172
	mov	bx,ax
173
	shr	eax,16
174
	mov	ecx,ebx
175
	mov	ebx,eax
3853 GerdtR 176
 
4146 GerdtR 177
	mcall	34
178
	cmp	eax,1
179
	jne	messages
3853 GerdtR 180
 
4146 GerdtR 181
	cmp	[RButtonActiv],1
182
	je	messages
3853 GerdtR 183
 
4146 GerdtR 184
	mov	[MouseY],ecx
185
	mov	[MouseX],ebx
3853 GerdtR 186
 
187
 
4146 GerdtR 188
	mcall	37,2
189
	test	al,001b
190
	jnz	LButtonPress
191
	test	al,010b
192
	jnz	RButtonPress
193
	jmp	messages
3853 GerdtR 194
 
195
ErrLoadLibs:
4945 yogev_ezra 196
	;dps     'Не удалось загрузить необходимые библиотеки'
4146 GerdtR 197
	;debug_newline
198
	jmp	close
3853 GerdtR 199
ErrorStrp:
5425 leency 200
	;dps     'Ошибка открытия icons32.png'
4146 GerdtR 201
	;debug_newline
3853 GerdtR 202
close:
4146 GerdtR 203
	mcall	-1
3853 GerdtR 204
 
205
LButtonPress:
4336 GerdtR 206
 
4146 GerdtR 207
	stdcall GetNumIcon,[MouseX],[MouseY],-1
3853 GerdtR 208
;int3
4146 GerdtR 209
	cmp	eax,-1
210
	jnz	@f
3853 GerdtR 211
 
212
    WaitLB1:
4146 GerdtR 213
	mcall	37,2
214
	test	al,001b
215
	jz	messages
216
	;Yield
217
	mcall	5,1
218
	jmp	WaitLB1
3853 GerdtR 219
 
220
 
221
     @@:
4146 GerdtR 222
	push	eax
223
	stdcall DrawIcon,eax,1
3853 GerdtR 224
   WaitLB:
4146 GerdtR 225
	mcall	37,2
226
	test	al,001b
227
	jz	endWaitLB
3853 GerdtR 228
 
4146 GerdtR 229
	mcall	37,0
230
	xor	ebx,ebx
231
	mov	bx,ax
232
	shr	eax,16
233
	sub	eax,[MouseX]
234
	jns	@f
235
	neg	eax
3853 GerdtR 236
      @@:
4146 GerdtR 237
	sub	ebx,[MouseY]
238
	jns	@f
239
	neg	ebx
3853 GerdtR 240
      @@:
4146 GerdtR 241
	cmp	[bFixIcons],0
242
	jne	@f
243
	cmp	eax,MIN_NO_MOVING
244
	ja	MovingIcon
245
	cmp	ebx,MIN_NO_MOVING
246
	ja	MovingIcon
3853 GerdtR 247
      @@:
4146 GerdtR 248
	;Yield
249
	mcall	5,1	;Sleep   1
3972 GerdtR 250
 
4146 GerdtR 251
	jmp	WaitLB
3853 GerdtR 252
   endWaitLB:
253
 
4146 GerdtR 254
	mcall	37,0
255
	xor	ebx,ebx
256
	mov	bx,ax
257
	shr	eax,16
258
	mov	ecx,ebx
259
	mov	ebx,eax
260
	mov	[MouseX],ebx
261
	mov	[MouseY],ecx
3853 GerdtR 262
 
4146 GerdtR 263
	stdcall GetNumIcon,[MouseX],[MouseY],-1
4945 yogev_ezra 264
	cmp	eax,[esp]	;[esp] = номер иконки
4146 GerdtR 265
	jne	@f
3853 GerdtR 266
 
4146 GerdtR 267
	mov	edi,[IconsOffs+eax*4]
268
	or	ecx,-1
269
	xor	al,al
270
	repne	scasb
271
	mov	ebx,edi
272
	repne	scasb
273
			     ;run program
274
	mov	dword[fiRunProg+8],edi
275
	mov	dword[fiRunProg+21],ebx
276
	mcall	70,fiRunProg
7087 leency 277
 
4146 GerdtR 278
	test	eax,80000000h
279
	jz	@f
3853 GerdtR 280
 
4146 GerdtR 281
	mov	dword[fiRunProg+8],ErrRunProg
282
	mov	dword[fiRunProg+21],pthNotify
283
	mcall	70,fiRunProg
3853 GerdtR 284
 
285
     @@:
4146 GerdtR 286
	pop	eax
287
	stdcall RestoreBackgrnd,eax
7087 leency 288
	mcall 5, 60
4146 GerdtR 289
	jmp	messages
3853 GerdtR 290
 
291
;-------------------------------------------------------------------------------
292
MovingIcon:
4146 GerdtR 293
	stdcall GetNumIcon,[MouseX],[MouseY],-1
294
	mov	[SelIcon],eax
295
	mov	[IconNoDraw],eax
296
	stdcall RestoreBackgrnd,[SelIcon]
3853 GerdtR 297
 
298
;        mov     ecx,[MaxNumIcon]
299
;        xor     ebx,ebx
300
;   .MI: push    ecx
301
;        cmp     ebx,[SelIcon]
302
;        je      @f
303
;        stdcall DrawIcon,ebx,0
304
;      @@:
305
;        inc     ebx
306
;        pop     ecx
307
;        loop    .MI
308
 
309
 
310
 
311
;dps 'Moving'
312
;debug_newline
313
;        mov     edi,[SelIcon]
314
;        mov     edi,[IconsOffs+edi*4]
315
;        or      ecx,-1
316
;        xor     al,al
317
;        repne scasb
318
;        repne scasb
319
;        repne scasb
320
;        repne scasb
321
;        xor     ebx,ebx
322
;        xor     esi,esi
323
;        mov     bx,word[edi+2]
324
;        mov     si,word[edi]
325
;        stdcall GetNumIcon,ebx,esi,[SelIcon]
326
;        cmp     eax,-1
327
;        je      @f
328
;  dps 'Q'
329
;        stdcall DrawIcon,eax,0
330
;     @@:
331
;
332
;        add     ebx,ICON_SIZE-1
333
;        stdcall GetNumIcon,ebx,esi,[SelIcon]
334
;        cmp     eax,-1
335
;        je      @f
336
;  dps 'Q'
337
;        stdcall DrawIcon,eax,0
338
;
339
;     @@:
340
;        add     esi,ICON_SIZE-1
341
;        stdcall GetNumIcon,ebx,esi,[SelIcon]
342
;        cmp     eax,-1
343
;        je      @f
344
;  dps 'Q'
345
;        stdcall DrawIcon,eax,0
346
;
347
;     @@:
348
;        sub     ebx,ICON_SIZE-1
349
;        stdcall GetNumIcon,ebx,esi,[SelIcon]
350
;        cmp     eax,-1
351
;        je      @f
352
;   dps 'Q'
353
;        stdcall DrawIcon,eax,0
354
;     @@:
355
 
356
 
357
; Sleep 40
358
 
359
;qweqwe:
360
 
4146 GerdtR 361
	mov    [MovingActiv],1
362
	mcall	51,1,MovingWnd,stack_mov	;CreateThread MovingWnd,stack_dlg
3853 GerdtR 363
   .WaitLB:
4146 GerdtR 364
	mcall	37,2	;GetMouseKey
365
	test	al,001b
366
	jz	.endWaitLB
3853 GerdtR 367
 
4146 GerdtR 368
	;Yield
369
	mcall	5,1	;Sleep 1
370
	jmp	.WaitLB
3853 GerdtR 371
   .endWaitLB:
372
 
4007 GerdtR 373
 
4146 GerdtR 374
	mcall	37,0		;GetMousePos
375
	xor	ebx,ebx
376
	mov	bx,ax
377
	shr	eax,16
3853 GerdtR 378
 
4146 GerdtR 379
	sub	eax,1+ICON_SIZE/2
380
	jnc	@f
381
	xor	eax,eax
382
      @@:
3853 GerdtR 383
 
4146 GerdtR 384
	sub	ebx,ICON_SIZE/2-7
385
	jnc	@f
386
	xor	ebx,ebx
3853 GerdtR 387
      @@:
4146 GerdtR 388
 
389
	cmp	ax,[wsX]
390
	jae	@f
391
	mov	ax,[wsX]
3853 GerdtR 392
      @@:
393
 
4146 GerdtR 394
	cmp	bx,[wsY]
395
	jae	@f
396
	mov	bx,[wsY]
4945 yogev_ezra 397
      @@:			    ;eax,ebx - реальная координата. Все координаты в проге относительно левого верхнего угла рабочей области
4146 GerdtR 398
 
399
	xor	edx,edx
400
	mov	dx,[wsXe]
401
	sub	edx,ICON_SIZE
402
	cmp	eax,edx
403
	jbe	@f
404
	mov	eax,edx
3853 GerdtR 405
      @@:
406
 
4146 GerdtR 407
	mov	dx,[wsYe]
408
	sub	edx,ICON_SIZE
409
	cmp	ebx,edx
410
	jbe	@f
411
	mov	ebx,edx
3853 GerdtR 412
      @@:
413
 
4945 yogev_ezra 414
	xor	edx,edx 	     ;преобразовываем в относительные
4146 GerdtR 415
	mov	dx,[wsW]
416
	shr	edx,1
417
	add	dx,[wsX]
418
	cmp	eax,edx
419
	jbe	@f
420
	sub	ax,[wsXe]
421
	inc	ax
422
	jmp	.mov1
3853 GerdtR 423
      @@:
4146 GerdtR 424
	sub	ax,[wsX]
425
    .mov1:
3853 GerdtR 426
 
4146 GerdtR 427
	xor	edx,edx
428
	mov	dx,[wsH]
429
	shr	edx,1
430
	add	dx,[wsY]
431
	cmp	ebx,edx
432
	jbe	@f
433
	sub	bx,[wsYe]
434
	inc	bx
435
	jmp	.mov2
3853 GerdtR 436
      @@:
4146 GerdtR 437
	sub	bx,[wsY]
438
    .mov2:
3853 GerdtR 439
 
4146 GerdtR 440
	stdcall SetPosition,[SelIcon],eax,ebx
3853 GerdtR 441
 
4146 GerdtR 442
	m2m	[PIcoDB],[BegData]
443
	stdcall [ini_enum_sections],IconIni,Ini_SavePos  ;in RButton.inc
3853 GerdtR 444
 
4146 GerdtR 445
	mov	[bNotSave],1
446
	mov	[IconNoDraw],-1
3853 GerdtR 447
 
4945 yogev_ezra 448
	mov    [MovingActiv],0		;только теперь отключаем окно с мышью
4007 GerdtR 449
 
4146 GerdtR 450
	jmp	messages
3853 GerdtR 451
 
452
;-------------------------------------------------------------------------------
453
 
454
RButtonPress:
4146 GerdtR 455
	mov	[RButtonActiv],1
3853 GerdtR 456
 
457
     @@:
4146 GerdtR 458
	mcall	37,2	;GetMouseKey
459
	test	al,010b
460
	jz	@f
461
	mcall	5,1	;Yield
462
	jmp	@b
3853 GerdtR 463
     @@:
464
 
4146 GerdtR 465
	mcall	51,1,RButtonWin,stack_rmenu	  ;CreateThread RButtonWin,stack_rmenu
3853 GerdtR 466
 
4146 GerdtR 467
	jmp	messages
3853 GerdtR 468
 
469
 
470
;###############################################################################
4945 yogev_ezra 471
;ret eax = 1/0 = удача/ошибка
3853 GerdtR 472
proc DrawIcon NumIcon:DWORD,Activ:DWORD ;NumIcon = 0..n
4146 GerdtR 473
local	IconData:DWORD
474
	push	ebx edi esi
3853 GerdtR 475
 
4146 GerdtR 476
	mov	ecx,ICON_SIZE*ICON_SIZE
477
	xor	eax,eax
478
	mov	edi,IconArea
479
	rep	stosd
3853 GerdtR 480
 
4146 GerdtR 481
	mov	eax,[NumIcon]
482
	cmp	eax,[MaxNumIcon]
483
	jb	@f
484
	xor	eax,eax
485
	pop	esi edi ebx
486
	ret
3853 GerdtR 487
      @@:
488
 
4146 GerdtR 489
	mov	esi,[IconsOffs+eax*4]
490
	mov	[IconData],esi
3853 GerdtR 491
 
4945 yogev_ezra 492
			      ;рисуем текст
4146 GerdtR 493
	mov	edi,esi
494
	xor	al,al
495
	or	ecx,-1
496
	repne scasb
497
	mov	edx,esi
498
	mov	eax,edi
499
	sub	eax,esi
500
	dec	eax
501
	shl	eax,1		 ;*6
502
	lea	eax,[eax*2+eax]
503
	mov	ebx,ICON_SIZE
504
	sub	ebx,eax
4945 yogev_ezra 505
	shr	ebx,1	     ;ebx = x текста
4146 GerdtR 506
	shl	ebx,16
507
	mov	bx,ICON_SIZE
508
	sub	bx,TEXT_BOTTOM_Y
509
	mov	ecx,88000000h
510
	mov	edi,IconAreaH
511
	add	ebx,-1*10000h+0
512
	mcall	4
513
	add	ebx,2*10000h+0
514
	mcall	;4
515
	add	ebx,-1*10000h-1
516
	mcall	;4
517
	add	ebx,0*10000h+2
518
	mcall	;4
519
	add	ebx,1*10000h+0
520
	mcall	;4
521
	inc	ebx;add     ebx,0*10000h+1
522
	mcall	;4
523
	add	ebx,-1*10000h+0
524
	mcall	;4
525
	add	ebx,0*10000h-2
526
	mov	ecx,88FFFFFFh
527
	mcall	;4
4945 yogev_ezra 528
				    ;рисуем картинку
3853 GerdtR 529
 
4146 GerdtR 530
	mov	edi,esi
531
	xor	al,al
532
	or	ecx,-1
533
	repne	scasb
534
	repne	scasb
535
	repne	scasb
536
	mov	al,[edi]
537
	cmp	al,'9'
538
	ja	PathToIcon
539
	cmp	al,'/'
540
	jne	GetIconInd
3853 GerdtR 541
 
542
   PathToIcon:
4945 yogev_ezra 543
	mov	al,30h		 ;заглушка!!!!!!!!!!!!!
4146 GerdtR 544
	mov	byte[edi+1],0
3853 GerdtR 545
 
4146 GerdtR 546
	jmp	CopyToMem
3853 GerdtR 547
   GetIconInd:
548
 
4146 GerdtR 549
	sub	al,30h
550
	cmp	byte[edi+1],0
551
	je	@f
552
	shl	eax,1
553
	lea	eax,[eax*4+eax]
554
	xor	edx,edx
555
	mov	dl,[edi+1]
556
	sub	dl,30h
557
	add	eax,edx
558
     @@:	     ;eax=num icon
559
	cmp	eax,[icon_count]
560
	jb	@f
561
	xor	eax,eax
3853 GerdtR 562
     @@:
4146 GerdtR 563
	test	eax,eax
564
	je	DI1
565
	mov	ecx,eax
566
	xor	eax,eax
3853 GerdtR 567
      @@:
4146 GerdtR 568
	add	eax,IMG_SIZE*IMG_SIZE*4
569
	loop	@b
3853 GerdtR 570
     DI1:
4146 GerdtR 571
	add	eax,[raw_pointer]
572
	add	eax,0+4*11
573
	mov	esi,eax
3853 GerdtR 574
 
575
  CopyToMem:
4146 GerdtR 576
	mov	edi,IconArea+((IMAGE_TOP_Y*ICON_SIZE)+((ICON_SIZE-IMG_SIZE)/2))*4
3853 GerdtR 577
 
4146 GerdtR 578
	mov	eax,IMG_SIZE
579
	mov	edx,eax
3853 GerdtR 580
      @@:
4146 GerdtR 581
	mov	ecx,eax
582
	rep	movsd
583
	add	edi,(ICON_SIZE-IMG_SIZE)*4
584
	dec	edx
585
	jnz	@b
3853 GerdtR 586
 
587
;-----------------
4945 yogev_ezra 588
				;если надо, то рисуем обводку
4146 GerdtR 589
	cmp	[Activ],0
590
	je	.NoSelect
3853 GerdtR 591
 
4146 GerdtR 592
	mov	edi,IconArea
593
	mov	eax,0FF000000h
594
	mov	ecx,ICON_SIZE
595
	rep	stosd
596
	;mov     edi,IconArea+ICON_SIZE*1
3853 GerdtR 597
 
4146 GerdtR 598
	mov	ecx,ICON_SIZE-1
599
    @@: mov	dword[edi],eax
600
	add	edi,(ICON_SIZE)*4
601
	loop	@b
3853 GerdtR 602
 
4146 GerdtR 603
	mov	edi,IconArea+ICON_SIZE*2*4-4
604
	mov	ecx,ICON_SIZE-1
605
    @@: mov	dword[edi],eax
606
	add	edi,(ICON_SIZE)*4
607
	loop	@b
3853 GerdtR 608
 
4146 GerdtR 609
	mov	edi,IconArea+ICON_SIZE*(ICON_SIZE-1)*4+4
610
	mov	ecx,ICON_SIZE-2
611
	rep	stosd
3853 GerdtR 612
 
613
 
4146 GerdtR 614
	mov	edi,IconArea+ICON_SIZE*4+4
615
	mov	eax,0FFFFFFFFh
616
	mov	ecx,ICON_SIZE-2
617
	rep	stosd
3853 GerdtR 618
 
4146 GerdtR 619
	mov	edi,IconArea+ICON_SIZE*4+4
620
	mov	ecx,ICON_SIZE-2
621
    @@: mov	dword[edi],eax
622
	add	edi,(ICON_SIZE)*4
623
	loop	@b
3853 GerdtR 624
 
4146 GerdtR 625
	mov	edi,IconArea+ICON_SIZE*2*4-4*2
626
	mov	ecx,ICON_SIZE-3
627
    @@: mov	dword[edi],eax
628
	add	edi,(ICON_SIZE)*4
629
	loop	@b
3853 GerdtR 630
 
4146 GerdtR 631
	mov	edi,IconArea+ICON_SIZE*(ICON_SIZE-2)*4+4*2
632
	mov	ecx,ICON_SIZE-3
633
	rep	stosd
3853 GerdtR 634
;--------------
635
 
636
   .NoSelect:
4146 GerdtR 637
	mov	edi,[IconData]
638
	xor	al,al
639
	or	ecx,-1
640
	repne	scasb
641
	repne	scasb
642
	repne	scasb
643
	repne	scasb
644
	mov	edx,[edi]
3853 GerdtR 645
 
4146 GerdtR 646
	test	edx,00008000h
647
	jz	@f
648
	add	dx,[wsYe]
649
	jmp	.DI11
3853 GerdtR 650
    @@:
4146 GerdtR 651
	add	dx,[wsY]
652
   .DI11:
653
 
654
	test	edx,80000000h
655
	jz	@f
656
	mov	ax,[wsXe]
657
	shl	eax,16
658
	add	edx,eax
659
	jmp	.DI12
3853 GerdtR 660
    @@:
4146 GerdtR 661
	mov	ax,[wsX]
662
	shl	eax,16
663
	add	edx,eax
664
   .DI12:
3853 GerdtR 665
 
4146 GerdtR 666
	mov	ebx,IconArea
667
	mov	ecx,ICON_SIZE*10000h+ICON_SIZE
668
	mcall	25
3853 GerdtR 669
 
670
;        mov     eax,1
4146 GerdtR 671
	pop	esi edi ebx
672
	ret
3853 GerdtR 673
endp
674
 
675
proc RestoreBackgrnd,NumIcon:DWORD
4146 GerdtR 676
	push	ebx edi
677
	mov	eax,[NumIcon]
678
	cmp	eax,[MaxNumIcon]
679
	jb	@f
680
	xor	eax,eax
681
	pop	edi ebx
682
	ret
3853 GerdtR 683
      @@:
684
 
4146 GerdtR 685
	mov	edi,[IconsOffs+eax*4]
686
	xor	al,al
687
	or	ecx,-1
688
	repne	scasb
689
	repne	scasb
690
	repne	scasb
691
	repne	scasb
3853 GerdtR 692
 
4146 GerdtR 693
	mov	ax,[edi+2]
694
	test	ax,8000h
695
	jz	@f
696
	add	ax,[wsXe]
697
	jmp	.rbg1
3853 GerdtR 698
      @@:
4146 GerdtR 699
	add	ax,[wsX]
700
     .rbg1:
3853 GerdtR 701
 
4146 GerdtR 702
	mov	bx,[edi]
703
	test	bx,8000h
704
	jz	@f
705
	add	bx,[wsYe]
706
	jmp	.rbg2
3853 GerdtR 707
      @@:
4146 GerdtR 708
	add	bx,[wsY]
709
     .rbg2:
3853 GerdtR 710
 
4146 GerdtR 711
	mov	cx,ax
712
	shl	ecx,16
713
	add	ax,ICON_SIZE
714
	mov	cx,ax
715
	mov	dx,bx
716
	shl	edx,16
717
	add	bx,ICON_SIZE
718
	mov	dx,bx
719
	dec	ecx
720
	dec	edx
721
	mcall	15,9
722
	pop	edi ebx
723
	ret
3853 GerdtR 724
endp
725
 
4945 yogev_ezra 726
				 ;заполняет MaxNumIcon,IconsOffs
3853 GerdtR 727
proc FillIconsOffs
4146 GerdtR 728
	push	ebx edi
729
	mov	edi,[BegData]
730
	mov	dword[MaxNumIcon],0
731
	cmp	dword[edi],0
732
	jne	@f
733
	mov	dword[IconsOffs],0
734
	pop	edi ebx
735
	ret
3853 GerdtR 736
    @@:
737
 
4146 GerdtR 738
	mov	[IconsOffs],edi
739
	xor	al,al
740
	xor	edx,edx
741
	mov	ebx,dword[SizeData]
742
	add	ebx,dword[BegData]
743
	or	ecx,-1
3853 GerdtR 744
 .CalcNumIc:
4336 GerdtR 745
 
4146 GerdtR 746
	repne	scasb
747
	repne	scasb
748
	repne	scasb
749
	repne	scasb
750
	add	edi,4
751
	mov	dword[IconsOffs+edx+4],edi
752
	inc	dword[MaxNumIcon]
753
	add	edx,4
3853 GerdtR 754
 
4146 GerdtR 755
	cmp	edi,ebx
756
	jae	@f
757
	jmp	.CalcNumIc
3853 GerdtR 758
   @@:
759
 
4146 GerdtR 760
	mov	dword[IconsOffs+edx],0
4336 GerdtR 761
 
4146 GerdtR 762
	pop	edi ebx
763
	ret
3853 GerdtR 764
endp
765
 
766
proc LoadIconsData stdcall,f_name,sec_name
4146 GerdtR 767
	push	ebx esi edi
3853 GerdtR 768
 
4146 GerdtR 769
	mov	edi,secRButt
770
	mov	esi,[sec_name]
3853 GerdtR 771
    @@: lodsb
4146 GerdtR 772
	scasb
773
	jnz	.lid1
774
	test	al,al
775
	jnz	@b
3853 GerdtR 776
 
4146 GerdtR 777
	mov	eax,1
778
	pop	edi esi ebx
779
	ret
3853 GerdtR 780
     .lid1:
781
 
4336 GerdtR 782
 
4945 yogev_ezra 783
	mov	ebx,[sec_name]		;копируем ID
4336 GerdtR 784
	mov	ax,[ebx]
785
	mov	edi,[nLoadIcon]
786
	mov	word[edi*4+IconsID],ax
787
	mov	word[edi*4+IconsID+2],0
788
 
4146 GerdtR 789
	mov	edi,[PIcoDB]
4336 GerdtR 790
	stdcall [ini_get_str],[f_name],[sec_name],keyName,edi,4096,0
791
	test	eax,eax
792
	jz	@f
793
	xor	eax,eax
794
	pop	edi esi ebx
795
	ret
796
     @@:
797
	xor	al,al
798
	or	ecx,-1
799
	repne	scasb
3853 GerdtR 800
 
4336 GerdtR 801
 
802
 
4146 GerdtR 803
	stdcall [ini_get_str],[f_name],[sec_name],keyPath,edi,4096,0
804
	test	eax,eax
805
	jz	@f
806
	xor	eax,eax
807
	pop	edi esi ebx
808
	ret
3853 GerdtR 809
     @@:
4146 GerdtR 810
	xor	al,al
811
	or	ecx,-1
812
	repne	scasb
3853 GerdtR 813
 
4146 GerdtR 814
	stdcall [ini_get_str],[f_name],[sec_name],keyParams,edi,4096,0
815
	test	eax,eax
816
	jz	@f
817
	xor	eax,eax
818
	pop	edi esi ebx
819
	ret
3853 GerdtR 820
     @@:
4146 GerdtR 821
	xor	al,al
822
	or	ecx,-1
823
	repne	scasb
3853 GerdtR 824
 
4146 GerdtR 825
	stdcall [ini_get_str],[f_name],[sec_name],keyIco,edi,4096,0
826
	test	eax,eax
827
	jz	@f
828
	xor	eax,eax
829
	pop	edi esi ebx
830
	ret
3853 GerdtR 831
     @@:
4146 GerdtR 832
	xor	al,al
833
	or	ecx,-1
834
	repne	scasb
3853 GerdtR 835
 
4146 GerdtR 836
	stdcall [ini_get_int],[f_name],[sec_name],keyX,80000000h
837
	cmp	eax,80000000h
838
	jne	@f
839
	xor	eax,eax
840
	pop	edi esi ebx
841
	ret
3853 GerdtR 842
     @@:
4146 GerdtR 843
	mov	word[edi+2],ax
3853 GerdtR 844
 
4146 GerdtR 845
	stdcall [ini_get_int],[f_name],[sec_name],keyY,80000000h
846
	cmp	eax,80000000h
847
	jne	@f
848
	xor	eax,eax
849
	pop	edi esi ebx
850
	ret
3853 GerdtR 851
     @@:
4146 GerdtR 852
	mov	word[edi],ax
853
	add	edi,4
854
	mov	[PIcoDB],edi
3853 GerdtR 855
 
4336 GerdtR 856
	inc	[nLoadIcon]
857
 
4146 GerdtR 858
	mov	eax,1
859
	pop	edi esi ebx
860
	ret
3853 GerdtR 861
endp
862
 
4336 GerdtR 863
proc GenerateID ;ax = ID
864
	push	ebx edi
865
	mov	ebx,[MaxNumIcon]
866
	test	ebx,ebx
867
	jnz	@f
868
	mov	eax,'00'
869
	pop	edi ebx
870
	ret
871
     @@:
872
 
873
	mov	eax,dword[IconsID+ebx*4-4]
874
  .inc:
875
	inc	ah
876
	cmp	ah,'9'+1
877
	jne	@f
878
	mov	ah,'A'
879
       @@:
880
	cmp	ah,'F'+1
881
	jne	@f
882
	mov	ah,'0'
883
	inc	al
884
       @@:
885
	cmp	al,'9'+1
886
	jne	@f
887
	mov	al,'A'
888
       @@:
889
	cmp	al,'F'+1
890
	jne	@f
891
	mov	al,'0'
892
       @@:
893
 
894
 
895
	mov	edi,IconsID
896
	;cmp     dword[edi],0
897
	;je      @f
898
	mov	ecx,100h
899
    @@: scasd
900
	je	.inc
901
	cmp	dword[edi],0
902
	je	@f
903
	loop	@b
904
     @@:
905
 
906
	pop	edi ebx
907
	ret
908
endp
909
 
5017 GerdtR 910
;-------------------------------------------------------------------------------
911
 
912
 
913
;формат IPC-сообщения
914
;dd X
915
;dd Y
916
;asciiz Icon
917
;asciiz Name
918
;asciiz Path
919
;asciiz Params
920
;-------------------------------------------------------------------------------
921
proc IPCCreateIcon
922
locals
923
	ix rd 1
924
	iy rd 1
925
endl
926
 
927
	mov	eax,IPCbuffer+8
928
	mov	dword[IPCbuffer],1
929
	;mov     edx,dword[IPCbuffer+4]
930
	lea	edx,[eax+8]
931
 
932
	m2m	dword[ix],dword[edx]
933
	m2m	dword[iy],dword[edx+4]
934
 
935
	lea	esi,[edx+8]
936
 
937
	mov	ecx,256
938
	mov	edi,DAreaIcon
939
    @@: lodsb
940
	stosb
941
	test	al,al
942
	jnz	@b
943
 
944
	mov	ecx,NAME_LENGTH+1
945
	mov	edi,DAreaName
946
    @@: lodsb
947
	stosb
948
	test	al,al
949
	jz	@f
950
	loop	@b
951
    @@:
952
 
953
	mov	edi,DAreaPath
954
    @@: lodsb
955
	stosb
956
	test	al,al
957
	jnz	@b
958
 
959
	mov	edi,DAreaParams
960
    @@: lodsb
961
	stosb
962
	test	al,al
963
	jnz	@b
964
 
965
	mov	dword[IPCbuffer+4],8
966
	mov	dword[IPCbuffer],0
967
 
968
	stdcall AddIcon,[ix],[iy],DAreaIcon,DAreaName,DAreaPath,DAreaParams
969
 
970
	mcall	15,3
971
	ret
972
endp
973
 
974
 
4336 GerdtR 975
include 'iconman.inc'
4003 GerdtR 976
include 'bgredraw.inc'
3853 GerdtR 977
include 'RButton.inc'
978
include 'DlgAdd.inc'
979
include 'Moving.inc'
980
 
981
;'Eolite',0,'/sys/File managers/eolite',0,'/hd0/3/Muzik',0,'1',0,00010001h
982
;-------------------------------------------------------------------------------
983
;##### DATA ####################################################################
984
;-------------------------------------------------------------------------------
985
; not change this section!!!
986
; start section
987
;------------------------------------------------------------------------------
988
align 4
989
image_file     dd 0 ;+0
990
raw_pointer    dd 0 ;+4
991
return_code    dd 0 ;+8
992
img_size       dd 0 ;+12
993
deflate_unpack dd 0 ;+16        ; not use for scaling
994
raw_pointer_2  dd 0 ;+20        ; not use for scaling
995
;------------------------------------------------------------------------------
996
; end section
997
;------------------------------------------------------------------------------
998
 
999
 
1000
align 4
1001
fiStdIco:
4146 GerdtR 1002
	dd 5
1003
	dd 0
1004
	dd 0
1005
.size	dd 0
1006
.point	dd bufStdIco
1007
	db ICON_STRIP,0
3853 GerdtR 1008
 
1009
 
1010
align 4
4945 yogev_ezra 1011
fiRunProg:	      ;для запуска программ
4146 GerdtR 1012
	dd 7
1013
	dd 0
1014
	dd 0
1015
	dd 0
1016
	dd ErrNotFoundIni
1017
	db 0
1018
	dd pthNotify
3853 GerdtR 1019
 
4945 yogev_ezra 1020
fiIni	dd 5	       ;для ini файла
4146 GerdtR 1021
	dd 0
1022
	dd 0
1023
	dd 0
1024
	dd bufIni
4336 GerdtR 1025
	db 0
1026
	dd IconIni
3853 GerdtR 1027
 
1028
 
4146 GerdtR 1029
IconsFile	db ICON_STRIP,0
4336 GerdtR 1030
 
3853 GerdtR 1031
align 4
4945 yogev_ezra 1032
MaxNumIcon	dd 0		;количество иконок
1033
IconNoDraw	dd -1		;-1 либо номер иконки, которую не надо рисовать( когда её таскают )
3853 GerdtR 1034
 
4146 GerdtR 1035
bFixIcons	dd 1
1036
bNotSave	dd 0
3853 GerdtR 1037
 
4146 GerdtR 1038
LButtonActiv	dd 0
1039
RButtonActiv	dd 0
1040
MovingActiv	dd 0
1041
DlgAddActiv	dd 0
3853 GerdtR 1042
 
4336 GerdtR 1043
IconIni 	db ICON_INI,0
3853 GerdtR 1044
 
4146 GerdtR 1045
pthNotify	db '/rd/1/@notify',0
3853 GerdtR 1046
 
4336 GerdtR 1047
keyName 	db 'name',0
4146 GerdtR 1048
keyPath 	db 'path',0
1049
keyParams	db 'param',0
1050
keyIco		db 'ico',0
1051
keyX		db 'x',0
1052
keyY		db 'y',0
3853 GerdtR 1053
 
1054
;-------------------------------------------------------------------------------
1055
IMPORTS:
4336 GerdtR 1056
library cnv_png ,'cnv_png.obj',\
4146 GerdtR 1057
	archiver,'archiver.obj',\
4336 GerdtR 1058
	box_lib ,'box_lib.obj',\
4146 GerdtR 1059
	proc_lib,'proc_lib.obj',\
4336 GerdtR 1060
	libini	,'libini.obj'
3853 GerdtR 1061
 
4146 GerdtR 1062
import	cnv_png,\
4336 GerdtR 1063
	cnv_png_import.Start	,'START',\
1064
	cnv_png_import.Version	,'version',\
1065
	cnv_png_import.Check	,'Check_Header',\
1066
	cnv_png_import.Assoc	,'Associations'
3853 GerdtR 1067
 
4146 GerdtR 1068
import	archiver,\
4336 GerdtR 1069
	unpack_DeflateUnpack2	,'deflate_unpack2'
3853 GerdtR 1070
 
4146 GerdtR 1071
import	box_lib,\
4336 GerdtR 1072
	edit_box_draw		,'edit_box',\
1073
	edit_box_key		,'edit_box_key',\
1074
	edit_box_mouse		,'edit_box_mouse',\
1075
	scrollbar_h_draw	,'scrollbar_h_draw',\
1076
	scrollbar_h_mouse	,'scrollbar_h_mouse'
3853 GerdtR 1077
 
4146 GerdtR 1078
import	proc_lib,\
4336 GerdtR 1079
	OpenDialog_Init 	,'OpenDialog_init',\
1080
	OpenDialog_Start	,'OpenDialog_start'
3853 GerdtR 1081
 
4146 GerdtR 1082
import	libini,\
4336 GerdtR 1083
	ini_enum_sections	,'ini_enum_sections',\
1084
	ini_enum_keys		,'ini_enum_keys',\
1085
	ini_get_str		,'ini_get_str',\
1086
	ini_set_str		,'ini_set_str',\
1087
	ini_get_color		,'ini_get_color',\
1088
	ini_get_int		,'ini_get_int',\
1089
	ini_set_int		,'ini_set_int',\
1090
	ini_del_section 	,'ini_del_section',\
1091
	ini_exist_sect		,'ini_exist_sect'
3853 GerdtR 1092
 
1093
 
1094
;ini.get_str (f_name, sec_name, key_name, buffer, buf_len, def_val)
1095
;ini.set_str (f_name, sec_name, key_name, buffer, buf_len)
1096
 
1097
 
1098
;-------------------------------------------------------------------------------
1099
;----- RButton.inc -------------------------------------------------------------
1100
;-------------------------------------------------------------------------------
4336 GerdtR 1101
 
1102
if lang eq ru
1103
 MinRMenuW	 dd 18*6+10
1104
else
1105
 MinRMenuW	 dd 15*6+10
1106
end if
1107
 
4146 GerdtR 1108
secRButt	db 'rbmenu',0
3853 GerdtR 1109
 
4146 GerdtR 1110
PredItem	dd -1
4036 GerdtR 1111
 
3853 GerdtR 1112
if lang eq ru
4945 yogev_ezra 1113
 RMenuRedrawFon db 'Перерисовать',0
1114
 RMenuAlign	db 'Выровнять по сетке',0
1115
 RMenuOffMoving db 'Закрепить иконки',0
1116
 RMenuOnMoving	db 'Открепить иконки',0
1117
 RMenuAdd	db 'Добавить',0
1118
 RMenuDel	db 'Удалить',0
1119
 RMenuProp	db 'Свойства',0
3853 GerdtR 1120
else
4336 GerdtR 1121
 RMenuRedrawFon db 'Redraw',0
1122
 RMenuAlign	db 'Snap to Grid',0
1123
 RMenuOffMoving db 'Fix the icons',0
1124
 RMenuOnMoving	db 'Unfix the icons',0
1125
 RMenuAdd	db 'Add',0
1126
 RMenuDel	db 'Delete',0
1127
 RMenuProp	db 'Properties',0
3853 GerdtR 1128
end if
1129
 
1130
if lang eq ru
5017 GerdtR 1131
 ErrRunProg	db 'Ошибка запуска программы',0
1132
 WarningSave	db 'Не забудьте сохранить изменения, запустить RDSave',0
1133
 ErrNotFoundIni db 'Не найден icon.ini',0
1134
 ErrName	db 'Имя "rbmenu" зарезервировано',0
3853 GerdtR 1135
else
5017 GerdtR 1136
 ErrRunProg	db 'Error runing program',0
1137
 WarningSave	db 'Do not forget to save the changes, run the RDSave',0
1138
 ErrNotFoundIni db 'icon.ini not found',0
1139
 ErrName	db 'The name "rbmenu" reserved',0
3853 GerdtR 1140
end if
1141
 
1142
;-------------------------------------------------------------------------------
1143
;------- AddDlg.inc ---------------------------------------------------------------
1144
;-------------------------------------------------------------------------------
1145
if lang eq ru
4945 yogev_ezra 1146
DTitleAdd	db 'Добавить иконку',0
1147
DTitleProp	db 'Изменить иконку',0
3853 GerdtR 1148
 
7012 leency 1149
DCaptName	db '      Имя',0
1150
DCaptPath	db '     Путь',0
1151
DCaptParams	db '    Ключи',0
3962 GerdtR 1152
;DCaptChange     db '.',0
4945 yogev_ezra 1153
DCaptCreate	db 'Создать',0
1154
DCaptProperties db 'Изменить',0
1155
DCaptCancel	db 'Отменить',0
3853 GerdtR 1156
 
1157
else
4146 GerdtR 1158
DTitleAdd	db 'Add icon',0
1159
DTitleProp	db 'Change icon',0
3853 GerdtR 1160
 
7012 leency 1161
DCaptName	db '      Name',0
1162
DCaptPath	db '      Path',0
1163
DCaptParams	db '    Params',0
4146 GerdtR 1164
DCaptCreate	db 'Create',0
3853 GerdtR 1165
DCaptProperties db 'Change',0
4146 GerdtR 1166
DCaptCancel	db 'Cancel',0
3853 GerdtR 1167
end if
7012 leency 1168
DCaptDots	db '...',0
3853 GerdtR 1169
 
4945 yogev_ezra 1170
;/не менять положение
7012 leency 1171
edtName    edit_box NAME_LENGTH*8+4,120+IMG_SIZE,6,0FFFFFFh,06F9480h,0FFh,0h,0x90000000,NAME_LENGTH,\
4146 GerdtR 1172
		DAreaName,mouse_dd,0,0,0
7012 leency 1173
edtExePath edit_box END_ICONS_AREAW-120-IMG_SIZE-40,120+IMG_SIZE,30,0FFFFFFh,06F9480h,\
1174
	0FFh,0h,0x90000000,255, DAreaPath,mouse_dd,0,0,0
1175
edtParams  edit_box END_ICONS_AREAW-120-IMG_SIZE,   120+IMG_SIZE,54,0FFFFFFh,06F9480h,\
1176
	0FFh,0h,0x90000000,255, DAreaParams,mouse_dd,0,0,0
1177
edtIcon    edit_box 28,24,62,0FFFFFFh,0FFFFFFh,0FFh,0h,0x90000000,3,\
5439 leency 1178
		DAreaIcon,0,0,0,0
3853 GerdtR 1179
endEdits:
1180
;\
1181
 
1182
sbIcons:
4146 GerdtR 1183
	     dw END_ICONS_AREAW-ICONSX
1184
	     dw ICONSX
1185
	     dw 15
1186
	     dw END_ICONS_AREAH+3
1187
	     dd 0
1188
	     dd 1
3853 GerdtR 1189
 .max_area   dd 0
1190
 .cur_area   dd ICONS_DRAW_COUNTW
1191
 .position   dd 0
1192
 .bckg_col   dd 0
1193
 .frnt_col   dd 0
1194
 .line_col   dd 0
1195
 .redraw     dd 0
1196
 .delta      dd 0
1197
 .delta2     dd 0
1198
 .r_size_x   dw 0
1199
 .r_start_x  dw 0
1200
 .r_size_y   dw 0
4091 GerdtR 1201
 
3853 GerdtR 1202
 .r_start_y  dw 0
1203
 .m_pos      dd 0
1204
 .m_pos2     dd 0
1205
 .m_keys     dd 0
1206
 .run_size   dd 0
1207
 .position2  dd 0
1208
 .work_size  dd 0
1209
 .all_redraw dd 0
1210
 .ar_offset  dd 0
1211
 
1212
;-------------------------------------------------------------------------------
1213
OpenDialog_data:
4146 GerdtR 1214
.type			dd 0
1215
.procinfo		dd RBProcInfo	    ;+4
1216
.com_area_name		dd communication_area_name	;+8
1217
.com_area		dd 0	;+12
1218
.opendir_pach		dd temp_dir_pach	;+16
1219
.dir_default_pach	dd communication_area_default_pach	;+20
1220
.start_path		dd open_dialog_path	;+24
1221
.draw_window		dd DRedrawWin;draw_window_for_OD   ;+28
1222
.status 		dd 0	;+32
1223
.openfile_pach		dd DAreaPath;fname_Info   ;+36
1224
.filename_area		dd 0;DAreaPath        ;+40
1225
.filter_area		dd Filter
3853 GerdtR 1226
.x:
4146 GerdtR 1227
.x_size 		dw 420 ;+48 ; Window X size
1228
.x_start		dw 100 ;+50 ; Window X position
3853 GerdtR 1229
.y:
4146 GerdtR 1230
.y_size 		dw 320 ;+52 ; Window y size
1231
.y_start		dw 100 ;+54 ; Window Y position
3853 GerdtR 1232
 
1233
communication_area_name:
4146 GerdtR 1234
	db 'FFFFFFFF_open_dialog',0
3853 GerdtR 1235
open_dialog_path:
4146 GerdtR 1236
	db '/sys/File managers/opendial',0
3853 GerdtR 1237
 
1238
communication_area_default_pach:
4146 GerdtR 1239
	db '/sys',0
3853 GerdtR 1240
 
4146 GerdtR 1241
Filter	dd 0
3853 GerdtR 1242
 
1243
;open_dialog     db 0
1244
;-------------------------------------------------------------------------------
1245
 
4945 yogev_ezra 1246
;/не разделять
3853 GerdtR 1247
align 4
4146 GerdtR 1248
IconAreaH	dd ICON_SIZE,ICON_SIZE
3853 GerdtR 1249
I_END:
1250
;##### UDATA ###################################################################
4146 GerdtR 1251
IconArea	rb 4*ICON_SIZE*ICON_SIZE
3853 GerdtR 1252
;\
1253
 
4146 GerdtR 1254
sc		system_colors
1255
sc.workL	rd 1
1256
sc.workH	rd 1
4007 GerdtR 1257
 
5017 GerdtR 1258
 
4027 GerdtR 1259
align 4
5017 GerdtR 1260
IPCbuffer	rb 1024
3853 GerdtR 1261
 
5017 GerdtR 1262
align 4
1263
 
4146 GerdtR 1264
ScreenW 	rw 1
1265
ScreenH 	rw 1
1266
wsX		rw 1
1267
wsY		rw 1
1268
wsXe		rw 1
1269
wsYe		rw 1
1270
wsW		rw 1
1271
wsH		rw 1
3853 GerdtR 1272
 
1273
 
4146 GerdtR 1274
MouseX		rd 1
1275
MouseY		rd 1
3853 GerdtR 1276
 
4146 GerdtR 1277
RBSlot		rd 1
1278
AddX		rd 1
1279
AddY		rd 1
3853 GerdtR 1280
 
4146 GerdtR 1281
SelIcon 	rd 1
1282
DlgSelIcon	rd 1
1283
slotDlgAdd	rd 1
1284
DlgBufImg	rb IMG_SIZE*IMG_SIZE*3
3853 GerdtR 1285
 
4336 GerdtR 1286
align 4
4146 GerdtR 1287
bufStdIco	rb 40
4945 yogev_ezra 1288
IconsOffs	rd 100		;таблица с указателями на конкретные иконки(для ускорения)
4146 GerdtR 1289
PIcoDB		rd 1
4945 yogev_ezra 1290
nLoadIcon	rd 1		;номер читаемой из ini иконки
1291
IconsID 	rd 100		;ID иконок - 2 байтa + байт 0 + выравнивающий байт - строка с 2мя шеснадцетиричными цифрами
4146 GerdtR 1292
 
4336 GerdtR 1293
nameSection	rb 4
4146 GerdtR 1294
 
3853 GerdtR 1295
align 4
4146 GerdtR 1296
icon_count	rd 1
1297
strip_file	rd 1
3853 GerdtR 1298
strip_file_size rd 1
1299
 
1300
cur_band_compensation rd 1
1301
 
1302
;---- RButton -----------------------------------------------------------------------
4082 GerdtR 1303
 
4146 GerdtR 1304
bufIni		rb 40
1305
NumMenuButt	rd 1
4945 yogev_ezra 1306
RBMenuCP	rd MAX_USER_BUTTONS*2	      ;указатели на подпись и путь с прогой (Caption(dd), Path(dd)) и запасной (dd) для завершающего нуля
4146 GerdtR 1307
RMenuW		rw 1
1308
RMenuH		rw 1
3853 GerdtR 1309
 
4146 GerdtR 1310
MaxPage 	rd 1
1311
mouse_dd	rd 1
3853 GerdtR 1312
 
4146 GerdtR 1313
DAreaName	rb NAME_LENGTH+1
4336 GerdtR 1314
DAreaPath	rb 255+1
1315
DAreaParams	rb 255+1
1316
DAreaIcon	rb 255+1
3853 GerdtR 1317
 
1318
align 4
4146 GerdtR 1319
RBProcInfo	rb 1024
3962 GerdtR 1320
align 4
3853 GerdtR 1321
 
4036 GerdtR 1322
 
1323
;------ OpenDialog -------------------------------
4146 GerdtR 1324
temp_dir_pach	rb 1024
1325
fname_Info	rb 1024
4036 GerdtR 1326
 
3853 GerdtR 1327
;-------------------------------------------------------------------------------
4146 GerdtR 1328
		rb 512
4945 yogev_ezra 1329
stack_mov:			;одновременно таскать и держать открытым менюшку невозможно
4036 GerdtR 1330
stack_rmenu:
4146 GerdtR 1331
		rb 512
3853 GerdtR 1332
stack_dlg:
4146 GerdtR 1333
		rb 512
3972 GerdtR 1334
stack_bredraw:
4146 GerdtR 1335
		rb 512
4036 GerdtR 1336
stack_main:
3853 GerdtR 1337
;------------------------------------------------------------------------------
1338
ENDMEM: