Subversion Repositories Kolibri OS

Rev

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

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