Subversion Repositories Kolibri OS

Rev

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