Subversion Repositories Kolibri OS

Rev

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