Subversion Repositories Kolibri OS

Rev

Rev 7823 | Rev 7957 | 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
 
7823 leency 59
	mcall   30,1,curpath
60
 
3853 GerdtR 61
; unpack deflate
4146 GerdtR 62
	mov	eax,[unpack_DeflateUnpack2]
63
	mov	[deflate_unpack],eax
3853 GerdtR 64
;---------------------------------------------------------------------
5425 leency 65
; get size of file icons32.png
4146 GerdtR 66
	mcall	70,fiStdIco
67
	test	eax,eax
68
	jnz	ErrorStrp
5425 leency 69
; get memory for icons32.png
4146 GerdtR 70
	mov	ecx,dword[bufStdIco+32]
71
	mov	[fiStdIco.size],ecx
72
	mov	[img_size],ecx
73
	mcall	68,12
74
	mov	[fiStdIco.point],eax
75
	mov	[image_file],eax
5425 leency 76
; load icons32.png
4146 GerdtR 77
	mov	dword[fiStdIco],0
78
	mcall	70,fiStdIco
79
	test	eax,eax
80
	jnz	close
3853 GerdtR 81
; convert PNG to RAW
4146 GerdtR 82
	xor	eax,eax
83
	mov	[return_code],eax
3853 GerdtR 84
;int3
85
 
4146 GerdtR 86
	push	image_file
87
	call	[cnv_png_import.Start]
3853 GerdtR 88
 
4146 GerdtR 89
	mov	eax,[raw_pointer]
90
	mov	ebx,[eax+32]
91
	mov	[strip_file_size],ebx
92
	mov	eax,[eax+28]
93
	add	eax,[raw_pointer]
94
	mov	[strip_file],eax
3853 GerdtR 95
; back memory to system
4146 GerdtR 96
	mcall	68,13,[fiStdIco.point]
3853 GerdtR 97
 
4146 GerdtR 98
	mov	eax,[raw_pointer]
99
	mov	eax,[eax+8]
100
	shr	eax,5
101
	mov	[icon_count],eax
3853 GerdtR 102
 
4146 GerdtR 103
	and	eax,0x7
104
	mov	[cur_band_compensation],eax
3853 GerdtR 105
 
4945 yogev_ezra 106
;########## загружаем данные иконок в память ##########################
3853 GerdtR 107
 
4945 yogev_ezra 108
	mcall	70,fiIni		     ;выделяем память, достаточной для хранения ini файла.
109
	test	eax,eax 		;Её точно хватит для хранения данных об иконках
4146 GerdtR 110
	jnz	ErrorIni
3853 GerdtR 111
 
4146 GerdtR 112
	cmp	dword[bufIni+32],0
113
	je	ErrorIni
114
	mcall	68,12,dword[bufIni+32]
115
	mov	dword[BegData],eax
116
	jmp	NoErrIni
3853 GerdtR 117
 
118
  ErrorIni:
4146 GerdtR 119
	mcall	70,fiRunProg
120
	mcall	-1
3853 GerdtR 121
 
122
  NoErrIni:
4146 GerdtR 123
	m2m	[PIcoDB],[BegData]
3853 GerdtR 124
 
4336 GerdtR 125
 
126
 
127
	mov	edi,IconsID
128
	xor	eax,eax
129
	mov	ecx,100h/4
130
	rep stosd
131
	mov	[nLoadIcon],0
4146 GerdtR 132
	stdcall [ini_enum_sections],IconIni,LoadIconsData
7437 leency 133
 
4146 GerdtR 134
	mov	eax,dword[PIcoDB]
135
	sub	eax,[BegData]
136
	mov	dword[SizeData],eax
137
	mov	eax,[BegData]
138
	cmp	eax,[PIcoDB]
139
	jne	@f
140
	mov	dword[eax],0
141
	mov	dword[SizeData],0
3853 GerdtR 142
   @@:
143
;######################################################################
4945 yogev_ezra 144
	call	FillIconsOffs		       ;заполняет MaxNumIcon,IconsOffs
3853 GerdtR 145
 
5017 GerdtR 146
;инициализация IPC буфера
147
	mov	dword[IPCbuffer],0
148
	mov	dword[IPCbuffer+4],8
149
	mcall	60,1,IPCbuffer,1024
3853 GerdtR 150
 
7016 leency 151
	mcall	40,EVM_MOUSE+EVM_IPC ;нужны только события мыши и IPC,
5017 GerdtR 152
					 ;перерисовка иконок будет в другом потоке
4146 GerdtR 153
	mov	eax,[icon_count]
154
	mov	bl,ICONS_DRAW_COUNTH
155
	div	bl
156
	test	ah,ah
157
	jz	@f
158
	inc	al
3853 GerdtR 159
     @@:
4146 GerdtR 160
	and	eax,0FFh
161
	mov	[sbIcons.max_area],eax
3853 GerdtR 162
 
4945 yogev_ezra 163
	mcall	51,1,BGRedrawThread,stack_bredraw	;запускаем поток перерисовки иконок
4146 GerdtR 164
	stdcall [OpenDialog_Init],OpenDialog_data
3853 GerdtR 165
 
4336 GerdtR 166
;dph [MaxNumIcon]
167
 
3853 GerdtR 168
messages:
4146 GerdtR 169
	mcall	10
170
	sub	eax,6
171
	jz	MSGMouse
5017 GerdtR 172
	dec	eax
173
	jz	MSGIPC
174
	jmp	messages
3853 GerdtR 175
 
5017 GerdtR 176
MSGIPC:
177
	call	IPCCreateIcon
4146 GerdtR 178
	jmp	messages
3853 GerdtR 179
 
180
MSGMouse:
4146 GerdtR 181
	mcall	37,0	;GetMousePos
182
	xor	ebx,ebx
183
	mov	bx,ax
184
	shr	eax,16
185
	mov	ecx,ebx
186
	mov	ebx,eax
3853 GerdtR 187
 
4146 GerdtR 188
	mcall	34
189
	cmp	eax,1
190
	jne	messages
3853 GerdtR 191
 
4146 GerdtR 192
	cmp	[RButtonActiv],1
193
	je	messages
3853 GerdtR 194
 
4146 GerdtR 195
	mov	[MouseY],ecx
196
	mov	[MouseX],ebx
3853 GerdtR 197
 
198
 
7956 leency 199
	mcall 37,3
200
	test  eax,1b ; bit 0 is set = left button is held
201
	jnz   @f
202
	jmp   CheckRB
203
@@:
204
	test  eax,100000000b ; bit 8 is set = left button is pressed
205
	jnz   @f
206
	jmp   CheckRB
207
@@:
208
	jnz   LButtonPress
209
CheckRB:
4146 GerdtR 210
	jnz	RButtonPress
211
	jmp	messages
3853 GerdtR 212
 
213
ErrLoadLibs:
4945 yogev_ezra 214
	;dps     'Не удалось загрузить необходимые библиотеки'
4146 GerdtR 215
	;debug_newline
216
	jmp	close
3853 GerdtR 217
ErrorStrp:
5425 leency 218
	;dps     'Ошибка открытия icons32.png'
4146 GerdtR 219
	;debug_newline
3853 GerdtR 220
close:
4146 GerdtR 221
	mcall	-1
3853 GerdtR 222
 
223
LButtonPress:
4336 GerdtR 224
 
4146 GerdtR 225
	stdcall GetNumIcon,[MouseX],[MouseY],-1
3853 GerdtR 226
;int3
4146 GerdtR 227
	cmp	eax,-1
228
	jnz	@f
3853 GerdtR 229
 
230
    WaitLB1:
4146 GerdtR 231
	mcall	37,2
232
	test	al,001b
233
	jz	messages
234
	;Yield
235
	mcall	5,1
236
	jmp	WaitLB1
3853 GerdtR 237
 
238
 
239
     @@:
4146 GerdtR 240
	push	eax
241
	stdcall DrawIcon,eax,1
3853 GerdtR 242
   WaitLB:
4146 GerdtR 243
	mcall	37,2
244
	test	al,001b
245
	jz	endWaitLB
3853 GerdtR 246
 
4146 GerdtR 247
	mcall	37,0
248
	xor	ebx,ebx
249
	mov	bx,ax
250
	shr	eax,16
251
	sub	eax,[MouseX]
252
	jns	@f
253
	neg	eax
3853 GerdtR 254
      @@:
4146 GerdtR 255
	sub	ebx,[MouseY]
256
	jns	@f
257
	neg	ebx
3853 GerdtR 258
      @@:
4146 GerdtR 259
	cmp	[bFixIcons],0
260
	jne	@f
261
	cmp	eax,MIN_NO_MOVING
262
	ja	MovingIcon
263
	cmp	ebx,MIN_NO_MOVING
264
	ja	MovingIcon
3853 GerdtR 265
      @@:
4146 GerdtR 266
	;Yield
267
	mcall	5,1	;Sleep   1
3972 GerdtR 268
 
4146 GerdtR 269
	jmp	WaitLB
3853 GerdtR 270
   endWaitLB:
271
 
4146 GerdtR 272
	mcall	37,0
273
	xor	ebx,ebx
274
	mov	bx,ax
275
	shr	eax,16
276
	mov	ecx,ebx
277
	mov	ebx,eax
278
	mov	[MouseX],ebx
279
	mov	[MouseY],ecx
3853 GerdtR 280
 
4146 GerdtR 281
	stdcall GetNumIcon,[MouseX],[MouseY],-1
4945 yogev_ezra 282
	cmp	eax,[esp]	;[esp] = номер иконки
4146 GerdtR 283
	jne	@f
3853 GerdtR 284
 
4146 GerdtR 285
	mov	edi,[IconsOffs+eax*4]
286
	or	ecx,-1
287
	xor	al,al
288
	repne	scasb
289
	mov	ebx,edi
290
	repne	scasb
291
			     ;run program
292
	mov	dword[fiRunProg+8],edi
293
	mov	dword[fiRunProg+21],ebx
294
	mcall	70,fiRunProg
7437 leency 295
 
4146 GerdtR 296
	test	eax,80000000h
297
	jz	@f
3853 GerdtR 298
 
4146 GerdtR 299
	mov	dword[fiRunProg+8],ErrRunProg
300
	mov	dword[fiRunProg+21],pthNotify
301
	mcall	70,fiRunProg
3853 GerdtR 302
 
303
     @@:
4146 GerdtR 304
	pop	eax
305
	stdcall RestoreBackgrnd,eax
7087 leency 306
	mcall 5, 60
4146 GerdtR 307
	jmp	messages
3853 GerdtR 308
 
309
;-------------------------------------------------------------------------------
310
MovingIcon:
4146 GerdtR 311
	stdcall GetNumIcon,[MouseX],[MouseY],-1
312
	mov	[SelIcon],eax
313
	mov	[IconNoDraw],eax
314
	stdcall RestoreBackgrnd,[SelIcon]
3853 GerdtR 315
 
316
;        mov     ecx,[MaxNumIcon]
317
;        xor     ebx,ebx
318
;   .MI: push    ecx
319
;        cmp     ebx,[SelIcon]
320
;        je      @f
321
;        stdcall DrawIcon,ebx,0
322
;      @@:
323
;        inc     ebx
324
;        pop     ecx
325
;        loop    .MI
326
 
327
 
328
 
329
;dps 'Moving'
330
;debug_newline
331
;        mov     edi,[SelIcon]
332
;        mov     edi,[IconsOffs+edi*4]
333
;        or      ecx,-1
334
;        xor     al,al
335
;        repne scasb
336
;        repne scasb
337
;        repne scasb
338
;        repne scasb
339
;        xor     ebx,ebx
340
;        xor     esi,esi
341
;        mov     bx,word[edi+2]
342
;        mov     si,word[edi]
343
;        stdcall GetNumIcon,ebx,esi,[SelIcon]
344
;        cmp     eax,-1
345
;        je      @f
346
;  dps 'Q'
347
;        stdcall DrawIcon,eax,0
348
;     @@:
349
;
350
;        add     ebx,ICON_SIZE-1
351
;        stdcall GetNumIcon,ebx,esi,[SelIcon]
352
;        cmp     eax,-1
353
;        je      @f
354
;  dps 'Q'
355
;        stdcall DrawIcon,eax,0
356
;
357
;     @@:
358
;        add     esi,ICON_SIZE-1
359
;        stdcall GetNumIcon,ebx,esi,[SelIcon]
360
;        cmp     eax,-1
361
;        je      @f
362
;  dps 'Q'
363
;        stdcall DrawIcon,eax,0
364
;
365
;     @@:
366
;        sub     ebx,ICON_SIZE-1
367
;        stdcall GetNumIcon,ebx,esi,[SelIcon]
368
;        cmp     eax,-1
369
;        je      @f
370
;   dps 'Q'
371
;        stdcall DrawIcon,eax,0
372
;     @@:
373
 
374
 
375
; Sleep 40
376
 
377
;qweqwe:
378
 
4146 GerdtR 379
	mov    [MovingActiv],1
380
	mcall	51,1,MovingWnd,stack_mov	;CreateThread MovingWnd,stack_dlg
3853 GerdtR 381
   .WaitLB:
4146 GerdtR 382
	mcall	37,2	;GetMouseKey
383
	test	al,001b
384
	jz	.endWaitLB
3853 GerdtR 385
 
4146 GerdtR 386
	;Yield
387
	mcall	5,1	;Sleep 1
388
	jmp	.WaitLB
3853 GerdtR 389
   .endWaitLB:
390
 
4007 GerdtR 391
 
4146 GerdtR 392
	mcall	37,0		;GetMousePos
393
	xor	ebx,ebx
394
	mov	bx,ax
395
	shr	eax,16
3853 GerdtR 396
 
4146 GerdtR 397
	sub	eax,1+ICON_SIZE/2
398
	jnc	@f
399
	xor	eax,eax
400
      @@:
3853 GerdtR 401
 
4146 GerdtR 402
	sub	ebx,ICON_SIZE/2-7
403
	jnc	@f
404
	xor	ebx,ebx
3853 GerdtR 405
      @@:
4146 GerdtR 406
 
407
	cmp	ax,[wsX]
408
	jae	@f
409
	mov	ax,[wsX]
3853 GerdtR 410
      @@:
411
 
4146 GerdtR 412
	cmp	bx,[wsY]
413
	jae	@f
414
	mov	bx,[wsY]
4945 yogev_ezra 415
      @@:			    ;eax,ebx - реальная координата. Все координаты в проге относительно левого верхнего угла рабочей области
4146 GerdtR 416
 
417
	xor	edx,edx
418
	mov	dx,[wsXe]
419
	sub	edx,ICON_SIZE
420
	cmp	eax,edx
421
	jbe	@f
422
	mov	eax,edx
3853 GerdtR 423
      @@:
424
 
4146 GerdtR 425
	mov	dx,[wsYe]
426
	sub	edx,ICON_SIZE
427
	cmp	ebx,edx
428
	jbe	@f
429
	mov	ebx,edx
3853 GerdtR 430
      @@:
431
 
4945 yogev_ezra 432
	xor	edx,edx 	     ;преобразовываем в относительные
4146 GerdtR 433
	mov	dx,[wsW]
434
	shr	edx,1
435
	add	dx,[wsX]
436
	cmp	eax,edx
437
	jbe	@f
438
	sub	ax,[wsXe]
439
	inc	ax
440
	jmp	.mov1
3853 GerdtR 441
      @@:
4146 GerdtR 442
	sub	ax,[wsX]
443
    .mov1:
3853 GerdtR 444
 
4146 GerdtR 445
	xor	edx,edx
446
	mov	dx,[wsH]
447
	shr	edx,1
448
	add	dx,[wsY]
449
	cmp	ebx,edx
450
	jbe	@f
451
	sub	bx,[wsYe]
452
	inc	bx
453
	jmp	.mov2
3853 GerdtR 454
      @@:
4146 GerdtR 455
	sub	bx,[wsY]
456
    .mov2:
3853 GerdtR 457
 
4146 GerdtR 458
	stdcall SetPosition,[SelIcon],eax,ebx
3853 GerdtR 459
 
4146 GerdtR 460
	m2m	[PIcoDB],[BegData]
461
	stdcall [ini_enum_sections],IconIni,Ini_SavePos  ;in RButton.inc
3853 GerdtR 462
 
4146 GerdtR 463
	mov	[bNotSave],1
464
	mov	[IconNoDraw],-1
3853 GerdtR 465
 
4945 yogev_ezra 466
	mov    [MovingActiv],0		;только теперь отключаем окно с мышью
4007 GerdtR 467
 
4146 GerdtR 468
	jmp	messages
3853 GerdtR 469
 
470
;-------------------------------------------------------------------------------
471
 
472
RButtonPress:
4146 GerdtR 473
	mov	[RButtonActiv],1
3853 GerdtR 474
 
475
     @@:
4146 GerdtR 476
	mcall	37,2	;GetMouseKey
477
	test	al,010b
478
	jz	@f
479
	mcall	5,1	;Yield
480
	jmp	@b
3853 GerdtR 481
     @@:
482
 
4146 GerdtR 483
	mcall	51,1,RButtonWin,stack_rmenu	  ;CreateThread RButtonWin,stack_rmenu
3853 GerdtR 484
 
4146 GerdtR 485
	jmp	messages
3853 GerdtR 486
 
487
 
488
;###############################################################################
4945 yogev_ezra 489
;ret eax = 1/0 = удача/ошибка
3853 GerdtR 490
proc DrawIcon NumIcon:DWORD,Activ:DWORD ;NumIcon = 0..n
4146 GerdtR 491
local	IconData:DWORD
492
	push	ebx edi esi
3853 GerdtR 493
 
4146 GerdtR 494
	mov	ecx,ICON_SIZE*ICON_SIZE
495
	xor	eax,eax
496
	mov	edi,IconArea
497
	rep	stosd
3853 GerdtR 498
 
4146 GerdtR 499
	mov	eax,[NumIcon]
500
	cmp	eax,[MaxNumIcon]
501
	jb	@f
502
	xor	eax,eax
503
	pop	esi edi ebx
504
	ret
3853 GerdtR 505
      @@:
506
 
4146 GerdtR 507
	mov	esi,[IconsOffs+eax*4]
508
	mov	[IconData],esi
3853 GerdtR 509
 
4945 yogev_ezra 510
			      ;рисуем текст
4146 GerdtR 511
	mov	edi,esi
512
	xor	al,al
513
	or	ecx,-1
514
	repne scasb
515
	mov	edx,esi
516
	mov	eax,edi
517
	sub	eax,esi
518
	dec	eax
519
	shl	eax,1		 ;*6
520
	lea	eax,[eax*2+eax]
521
	mov	ebx,ICON_SIZE
522
	sub	ebx,eax
4945 yogev_ezra 523
	shr	ebx,1	     ;ebx = x текста
4146 GerdtR 524
	shl	ebx,16
525
	mov	bx,ICON_SIZE
526
	sub	bx,TEXT_BOTTOM_Y
527
	mov	ecx,88000000h
528
	mov	edi,IconAreaH
529
	add	ebx,-1*10000h+0
530
	mcall	4
531
	add	ebx,2*10000h+0
532
	mcall	;4
533
	add	ebx,-1*10000h-1
534
	mcall	;4
535
	add	ebx,0*10000h+2
536
	mcall	;4
537
	add	ebx,1*10000h+0
538
	mcall	;4
539
	inc	ebx;add     ebx,0*10000h+1
540
	mcall	;4
541
	add	ebx,-1*10000h+0
542
	mcall	;4
543
	add	ebx,0*10000h-2
544
	mov	ecx,88FFFFFFh
545
	mcall	;4
4945 yogev_ezra 546
				    ;рисуем картинку
3853 GerdtR 547
 
4146 GerdtR 548
	mov	edi,esi
549
	xor	al,al
550
	or	ecx,-1
551
	repne	scasb
552
	repne	scasb
553
	repne	scasb
3853 GerdtR 554
 
7437 leency 555
	;stdcall hexToInt,edi
556
	stdcall strToInt,edi
4146 GerdtR 557
     @@:	     ;eax=num icon
558
	cmp	eax,[icon_count]
559
	jb	@f
560
	xor	eax,eax
3853 GerdtR 561
     @@:
4146 GerdtR 562
	test	eax,eax
563
	je	DI1
564
	mov	ecx,eax
565
	xor	eax,eax
3853 GerdtR 566
      @@:
4146 GerdtR 567
	add	eax,IMG_SIZE*IMG_SIZE*4
568
	loop	@b
3853 GerdtR 569
     DI1:
4146 GerdtR 570
	add	eax,[raw_pointer]
571
	add	eax,0+4*11
572
	mov	esi,eax
3853 GerdtR 573
 
574
  CopyToMem:
4146 GerdtR 575
	mov	edi,IconArea+((IMAGE_TOP_Y*ICON_SIZE)+((ICON_SIZE-IMG_SIZE)/2))*4
3853 GerdtR 576
 
4146 GerdtR 577
	mov	eax,IMG_SIZE
578
	mov	edx,eax
3853 GerdtR 579
      @@:
4146 GerdtR 580
	mov	ecx,eax
581
	rep	movsd
582
	add	edi,(ICON_SIZE-IMG_SIZE)*4
583
	dec	edx
584
	jnz	@b
3853 GerdtR 585
 
586
;-----------------
4945 yogev_ezra 587
				;если надо, то рисуем обводку
4146 GerdtR 588
	cmp	[Activ],0
589
	je	.NoSelect
3853 GerdtR 590
 
4146 GerdtR 591
	mov	edi,IconArea
592
	mov	eax,0FF000000h
593
	mov	ecx,ICON_SIZE
594
	rep	stosd
595
	;mov     edi,IconArea+ICON_SIZE*1
3853 GerdtR 596
 
4146 GerdtR 597
	mov	ecx,ICON_SIZE-1
598
    @@: mov	dword[edi],eax
599
	add	edi,(ICON_SIZE)*4
600
	loop	@b
3853 GerdtR 601
 
4146 GerdtR 602
	mov	edi,IconArea+ICON_SIZE*2*4-4
603
	mov	ecx,ICON_SIZE-1
604
    @@: mov	dword[edi],eax
605
	add	edi,(ICON_SIZE)*4
606
	loop	@b
3853 GerdtR 607
 
4146 GerdtR 608
	mov	edi,IconArea+ICON_SIZE*(ICON_SIZE-1)*4+4
609
	mov	ecx,ICON_SIZE-2
610
	rep	stosd
3853 GerdtR 611
 
612
 
4146 GerdtR 613
	mov	edi,IconArea+ICON_SIZE*4+4
614
	mov	eax,0FFFFFFFFh
615
	mov	ecx,ICON_SIZE-2
616
	rep	stosd
3853 GerdtR 617
 
4146 GerdtR 618
	mov	edi,IconArea+ICON_SIZE*4+4
619
	mov	ecx,ICON_SIZE-2
620
    @@: mov	dword[edi],eax
621
	add	edi,(ICON_SIZE)*4
622
	loop	@b
3853 GerdtR 623
 
4146 GerdtR 624
	mov	edi,IconArea+ICON_SIZE*2*4-4*2
625
	mov	ecx,ICON_SIZE-3
626
    @@: mov	dword[edi],eax
627
	add	edi,(ICON_SIZE)*4
628
	loop	@b
3853 GerdtR 629
 
4146 GerdtR 630
	mov	edi,IconArea+ICON_SIZE*(ICON_SIZE-2)*4+4*2
631
	mov	ecx,ICON_SIZE-3
632
	rep	stosd
3853 GerdtR 633
;--------------
634
 
635
   .NoSelect:
4146 GerdtR 636
	mov	edi,[IconData]
637
	xor	al,al
638
	or	ecx,-1
639
	repne	scasb
640
	repne	scasb
641
	repne	scasb
642
	repne	scasb
643
	mov	edx,[edi]
3853 GerdtR 644
 
4146 GerdtR 645
	test	edx,00008000h
646
	jz	@f
647
	add	dx,[wsYe]
648
	jmp	.DI11
3853 GerdtR 649
    @@:
4146 GerdtR 650
	add	dx,[wsY]
651
   .DI11:
652
 
653
	test	edx,80000000h
654
	jz	@f
655
	mov	ax,[wsXe]
656
	shl	eax,16
657
	add	edx,eax
658
	jmp	.DI12
3853 GerdtR 659
    @@:
4146 GerdtR 660
	mov	ax,[wsX]
661
	shl	eax,16
662
	add	edx,eax
663
   .DI12:
3853 GerdtR 664
 
4146 GerdtR 665
	mov	ebx,IconArea
666
	mov	ecx,ICON_SIZE*10000h+ICON_SIZE
667
	mcall	25
3853 GerdtR 668
 
669
;        mov     eax,1
4146 GerdtR 670
	pop	esi edi ebx
671
	ret
3853 GerdtR 672
endp
673
 
674
proc RestoreBackgrnd,NumIcon:DWORD
4146 GerdtR 675
	push	ebx edi
676
	mov	eax,[NumIcon]
677
	cmp	eax,[MaxNumIcon]
678
	jb	@f
679
	xor	eax,eax
680
	pop	edi ebx
681
	ret
3853 GerdtR 682
      @@:
683
 
4146 GerdtR 684
	mov	edi,[IconsOffs+eax*4]
685
	xor	al,al
686
	or	ecx,-1
687
	repne	scasb
688
	repne	scasb
689
	repne	scasb
690
	repne	scasb
3853 GerdtR 691
 
4146 GerdtR 692
	mov	ax,[edi+2]
693
	test	ax,8000h
694
	jz	@f
695
	add	ax,[wsXe]
696
	jmp	.rbg1
3853 GerdtR 697
      @@:
4146 GerdtR 698
	add	ax,[wsX]
699
     .rbg1:
3853 GerdtR 700
 
4146 GerdtR 701
	mov	bx,[edi]
702
	test	bx,8000h
703
	jz	@f
704
	add	bx,[wsYe]
705
	jmp	.rbg2
3853 GerdtR 706
      @@:
4146 GerdtR 707
	add	bx,[wsY]
708
     .rbg2:
3853 GerdtR 709
 
4146 GerdtR 710
	mov	cx,ax
711
	shl	ecx,16
712
	add	ax,ICON_SIZE
713
	mov	cx,ax
714
	mov	dx,bx
715
	shl	edx,16
716
	add	bx,ICON_SIZE
717
	mov	dx,bx
718
	dec	ecx
719
	dec	edx
720
	mcall	15,9
721
	pop	edi ebx
722
	ret
3853 GerdtR 723
endp
724
 
4945 yogev_ezra 725
				 ;заполняет MaxNumIcon,IconsOffs
3853 GerdtR 726
proc FillIconsOffs
4146 GerdtR 727
	push	ebx edi
728
	mov	edi,[BegData]
729
	mov	dword[MaxNumIcon],0
730
	cmp	dword[edi],0
731
	jne	@f
732
	mov	dword[IconsOffs],0
733
	pop	edi ebx
734
	ret
3853 GerdtR 735
    @@:
736
 
4146 GerdtR 737
	mov	[IconsOffs],edi
738
	xor	al,al
739
	xor	edx,edx
740
	mov	ebx,dword[SizeData]
741
	add	ebx,dword[BegData]
742
	or	ecx,-1
3853 GerdtR 743
 .CalcNumIc:
4336 GerdtR 744
 
4146 GerdtR 745
	repne	scasb
746
	repne	scasb
747
	repne	scasb
748
	repne	scasb
749
	add	edi,4
750
	mov	dword[IconsOffs+edx+4],edi
751
	inc	dword[MaxNumIcon]
752
	add	edx,4
3853 GerdtR 753
 
4146 GerdtR 754
	cmp	edi,ebx
755
	jae	@f
756
	jmp	.CalcNumIc
3853 GerdtR 757
   @@:
758
 
4146 GerdtR 759
	mov	dword[IconsOffs+edx],0
4336 GerdtR 760
 
4146 GerdtR 761
	pop	edi ebx
762
	ret
3853 GerdtR 763
endp
764
 
765
proc LoadIconsData stdcall,f_name,sec_name
4146 GerdtR 766
	push	ebx esi edi
3853 GerdtR 767
 
4146 GerdtR 768
	mov	edi,secRButt
769
	mov	esi,[sec_name]
3853 GerdtR 770
    @@: lodsb
4146 GerdtR 771
	scasb
772
	jnz	.lid1
773
	test	al,al
774
	jnz	@b
3853 GerdtR 775
 
4146 GerdtR 776
	mov	eax,1
777
	pop	edi esi ebx
778
	ret
3853 GerdtR 779
     .lid1:
780
 
4336 GerdtR 781
 
4945 yogev_ezra 782
	mov	ebx,[sec_name]		;копируем ID
4336 GerdtR 783
	mov	ax,[ebx]
784
	mov	edi,[nLoadIcon]
785
	mov	word[edi*4+IconsID],ax
786
	mov	word[edi*4+IconsID+2],0
787
 
4146 GerdtR 788
	mov	edi,[PIcoDB]
4336 GerdtR 789
	stdcall [ini_get_str],[f_name],[sec_name],keyName,edi,4096,0
790
	test	eax,eax
791
	jz	@f
792
	xor	eax,eax
793
	pop	edi esi ebx
794
	ret
795
     @@:
796
	xor	al,al
797
	or	ecx,-1
798
	repne	scasb
3853 GerdtR 799
 
4336 GerdtR 800
 
801
 
4146 GerdtR 802
	stdcall [ini_get_str],[f_name],[sec_name],keyPath,edi,4096,0
803
	test	eax,eax
804
	jz	@f
805
	xor	eax,eax
806
	pop	edi esi ebx
807
	ret
3853 GerdtR 808
     @@:
4146 GerdtR 809
	xor	al,al
810
	or	ecx,-1
811
	repne	scasb
3853 GerdtR 812
 
4146 GerdtR 813
	stdcall [ini_get_str],[f_name],[sec_name],keyParams,edi,4096,0
814
	test	eax,eax
815
	jz	@f
816
	xor	eax,eax
817
	pop	edi esi ebx
818
	ret
3853 GerdtR 819
     @@:
4146 GerdtR 820
	xor	al,al
821
	or	ecx,-1
822
	repne	scasb
3853 GerdtR 823
 
4146 GerdtR 824
	stdcall [ini_get_str],[f_name],[sec_name],keyIco,edi,4096,0
825
	test	eax,eax
826
	jz	@f
827
	xor	eax,eax
828
	pop	edi esi ebx
829
	ret
3853 GerdtR 830
     @@:
4146 GerdtR 831
	xor	al,al
832
	or	ecx,-1
833
	repne	scasb
3853 GerdtR 834
 
4146 GerdtR 835
	stdcall [ini_get_int],[f_name],[sec_name],keyX,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+2],ax
3853 GerdtR 843
 
4146 GerdtR 844
	stdcall [ini_get_int],[f_name],[sec_name],keyY,80000000h
845
	cmp	eax,80000000h
846
	jne	@f
847
	xor	eax,eax
848
	pop	edi esi ebx
849
	ret
3853 GerdtR 850
     @@:
4146 GerdtR 851
	mov	word[edi],ax
852
	add	edi,4
853
	mov	[PIcoDB],edi
3853 GerdtR 854
 
4336 GerdtR 855
	inc	[nLoadIcon]
856
 
4146 GerdtR 857
	mov	eax,1
858
	pop	edi esi ebx
859
	ret
3853 GerdtR 860
endp
861
 
4336 GerdtR 862
proc GenerateID ;ax = ID
863
	push	ebx edi
864
	mov	ebx,[MaxNumIcon]
865
	test	ebx,ebx
866
	jnz	@f
867
	mov	eax,'00'
868
	pop	edi ebx
869
	ret
870
     @@:
871
 
872
	mov	eax,dword[IconsID+ebx*4-4]
873
  .inc:
874
	inc	ah
875
	cmp	ah,'9'+1
876
	jne	@f
877
	mov	ah,'A'
878
       @@:
879
	cmp	ah,'F'+1
880
	jne	@f
881
	mov	ah,'0'
882
	inc	al
883
       @@:
884
	cmp	al,'9'+1
885
	jne	@f
886
	mov	al,'A'
887
       @@:
888
	cmp	al,'F'+1
889
	jne	@f
890
	mov	al,'0'
891
       @@:
892
 
893
 
894
	mov	edi,IconsID
895
	;cmp     dword[edi],0
896
	;je      @f
897
	mov	ecx,100h
898
    @@: scasd
899
	je	.inc
900
	cmp	dword[edi],0
901
	je	@f
902
	loop	@b
903
     @@:
904
 
905
	pop	edi ebx
906
	ret
907
endp
908
 
5017 GerdtR 909
;-------------------------------------------------------------------------------
910
 
911
 
912
;формат IPC-сообщения
913
;dd X
914
;dd Y
7437 leency 915
;asciiz Icon - in decimal
5017 GerdtR 916
;asciiz Name
917
;asciiz Path
918
;asciiz Params
919
;-------------------------------------------------------------------------------
920
proc IPCCreateIcon
921
locals
922
	ix rd 1
923
	iy rd 1
924
endl
925
 
926
	mov	eax,IPCbuffer+8
927
	mov	dword[IPCbuffer],1
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
 
7823 leency 1108
curpath     db '/sys',0
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
7437 leency 1288
IconsOffs	rd 100h 	;таблица с указателями на конкретные иконки(для ускорения)
1289
PIcoDB		rd 1		;указатель на буффер с инфой обо всех иконках
4945 yogev_ezra 1290
nLoadIcon	rd 1		;номер читаемой из ini иконки
7437 leency 1291
IconsID 	rd 100h 	;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
;------------------------------------------------------------------------------
7437 leency 1338
 
1339
 
1340
 
1341
 
3853 GerdtR 1342
ENDMEM: