Subversion Repositories Kolibri OS

Rev

Rev 4091 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4091 Rev 4146
Line 34... Line 34...
34
        dd stack_main   ; esp
34
	dd stack_main	; esp
35
        dd 0            ; boot parameters
35
	dd 0		; boot parameters
36
        dd 0            ; path
36
	dd 0		; path
37
;------------------------------------------------------------------------------
37
;------------------------------------------------------------------------------
38
include 'lang.inc'
38
include 'lang.inc'
39
 
-
 
40
include 'lang.inc'
-
 
41
include '../../macros.inc'
39
include '../../macros.inc'
42
include '../../proc32.inc'
40
include '../../proc32.inc'
43
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
41
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
44
include '../../dll.inc'
42
include '../../dll.inc'
45
;include '../../debug.inc'
43
;include '../../debug.inc'
Line 358... Line 356...
358
        mcall   37,0            ;GetMousePos
356
	mcall	37,0		;GetMousePos
359
        xor     ebx,ebx
357
	xor	ebx,ebx
360
        mov     bx,ax
358
	mov	bx,ax
361
        shr     eax,16
359
	shr	eax,16
Line 362... Line -...
362
 
-
 
363
        add     ebx,7
-
 
364
        dec     eax
-
 
365
 
360
 
366
        sub     eax,ICON_SIZE/2
361
	sub	eax,1+ICON_SIZE/2
367
        jns     @f
362
	jnc	@f
368
        xor     eax,eax
363
	xor	eax,eax
-
 
364
      @@:
369
      @@:
365
 
370
        sub     ebx,ICON_SIZE/2
366
	sub	ebx,ICON_SIZE/2-7
371
        jns     @f
367
	jnc	@f
372
        xor     ebx,ebx
368
	xor	ebx,ebx
Line -... Line 369...
-
 
369
      @@:
-
 
370
 
-
 
371
	cmp	ax,[wsX]
-
 
372
	jae	@f
-
 
373
	mov	ax,[wsX]
-
 
374
      @@:
-
 
375
 
-
 
376
	cmp	bx,[wsY]
-
 
377
	jae	@f
-
 
378
	mov	bx,[wsY]
-
 
379
      @@:			    ;eax,ebx - ॠ«ì­ ï ª®®à¤¨­ â . ‚ᥠª®®à¤¨­ âë ¢ ¯à®£¥ ®â­®á¨â¥«ì­® «¥¢®£® ¢¥àå­¥£® 㣫  à ¡®ç¥© ®¡« áâ¨
373
      @@:
380
 
374
 
381
	xor	edx,edx
375
        movzx   edx,[ScreenX]
382
	mov	dx,[wsXe]
376
        sub     edx,ICON_SIZE
383
	sub	edx,ICON_SIZE
377
        cmp     eax,edx
384
	cmp	eax,edx
378
        jbe     @f
385
	jbe	@f
Line 379... Line 386...
379
        mov     eax,edx
386
	mov	eax,edx
380
      @@:
387
      @@:
381
 
388
 
382
        movzx   edx,[ScreenY]
389
	mov	dx,[wsYe]
383
        sub     edx,ICON_SIZE
390
	sub	edx,ICON_SIZE
384
        cmp     ebx,edx
391
	cmp	ebx,edx
Line 385... Line 392...
385
        jbe     @f
392
	jbe	@f
386
        mov     ebx,edx
393
	mov	ebx,edx
387
      @@:
394
      @@:
-
 
395
 
388
 
396
	xor	edx,edx 	     ;¯à¥®¡à §®¢ë¢ ¥¬ ¢ ®â­®á¨â¥«ì­ë¥
389
        xor     edx,edx
397
	mov	dx,[wsW]
390
        mov     dx,[ScreenX]
398
	shr	edx,1
391
        shr     edx,1
399
	add	dx,[wsX]
-
 
400
	cmp	eax,edx
392
        cmp     eax,edx
401
	jbe	@f
-
 
402
	sub	ax,[wsXe]
-
 
403
	inc	ax
Line 393... Line 404...
393
        jbe     @f
404
	jmp	.mov1
394
        sub     ax,[ScreenX]
405
      @@:
395
        inc     ax
406
	sub	ax,[wsX]
-
 
407
    .mov1:
396
      @@:
408
 
397
 
409
	xor	edx,edx
398
        xor     edx,edx
410
	mov	dx,[wsH]
399
        mov     dx,[ScreenY]
411
	shr	edx,1
-
 
412
	add	dx,[wsY]
400
        shr     edx,1
413
	cmp	ebx,edx
-
 
414
	jbe	@f
-
 
415
	sub	bx,[wsYe]
Line 401... Line 416...
401
        cmp     ebx,edx
416
	inc	bx
Line 402... Line 417...
402
        jbe     @f
417
	jmp	.mov2
Line 439... Line 454...
439
 
454
 
440
;###############################################################################
455
;###############################################################################
441
;ret eax = 1/0 = 㤠ç /®è¨¡ª 
456
;ret eax = 1/0 = 㤠ç /®è¨¡ª 
442
proc DrawIcon NumIcon:DWORD,Activ:DWORD ;NumIcon = 0..n
457
proc DrawIcon NumIcon:DWORD,Activ:DWORD ;NumIcon = 0..n
443
local   IconData:DWORD
-
 
444
   ; int3
458
local	IconData:DWORD
Line 445... Line 459...
445
        push    ebx edi esi
459
	push	ebx edi esi
446
 
460
 
447
        mov     ecx,ICON_SIZE*ICON_SIZE
-
 
448
        xor     eax,eax
461
	mov	ecx,ICON_SIZE*ICON_SIZE
449
        ;mov     eax,0FFFFFFFh
462
	xor	eax,eax
Line 450... Line 463...
450
        mov     edi,IconArea
463
	mov	edi,IconArea
451
        rep     stosd
464
	rep	stosd
Line 481... Line 494...
481
        mov     ecx,88000000h
494
	mov	ecx,88000000h
482
        mov     edi,IconAreaH
495
	mov	edi,IconAreaH
483
        add     ebx,-1*10000h+0
496
	add	ebx,-1*10000h+0
484
        mcall   4
497
	mcall	4
485
        add     ebx,2*10000h+0
498
	add	ebx,2*10000h+0
486
        mcall   4
499
	mcall	;4
487
        add     ebx,-1*10000h-1
500
	add	ebx,-1*10000h-1
488
        mcall   4
501
	mcall	;4
489
        add     ebx,0*10000h+2
502
	add	ebx,0*10000h+2
490
        mcall   4
503
	mcall	;4
491
        add     ebx,1*10000h+0
504
	add	ebx,1*10000h+0
492
        mcall   4
505
	mcall	;4
493
        add     ebx,0*10000h+1
506
	inc	ebx;add     ebx,0*10000h+1
494
        mcall   4
507
	mcall	;4
495
        add     ebx,-1*10000h+0
508
	add	ebx,-1*10000h+0
496
        mcall   4
509
	mcall	;4
497
        add     ebx,0*10000h-2
510
	add	ebx,0*10000h-2
498
        mov     ecx,88FFFFFFh
511
	mov	ecx,88FFFFFFh
499
        mcall   4
512
	mcall	;4
500
                                    ;à¨á㥬 ª à⨭ªã
513
				    ;à¨á㥬 ª à⨭ªã
Line 501... Line 514...
501
 
514
 
502
        mov     edi,esi
515
	mov	edi,esi
503
        xor     al,al
516
	xor	al,al
Line 538... Line 551...
538
        xor     eax,eax
551
	xor	eax,eax
539
      @@:
552
      @@:
540
        add     eax,IMG_SIZE*IMG_SIZE*4
553
	add	eax,IMG_SIZE*IMG_SIZE*4
541
        loop    @b
554
	loop	@b
542
     DI1:
555
     DI1:
-
 
556
	add	eax,[raw_pointer]
-
 
557
	add	eax,0+4*11
543
        mov     esi,eax
558
	mov	esi,eax
544
        add     esi,[raw_pointer]
-
 
545
        add     esi,0+4*11
-
 
Line 546... Line 559...
546
 
559
 
547
  CopyToMem:
560
  CopyToMem:
Line 548... Line 561...
548
        mov     edi,IconArea+((IMAGE_TOP_Y*ICON_SIZE)+((ICON_SIZE-IMG_SIZE)/2))*4
561
	mov	edi,IconArea+((IMAGE_TOP_Y*ICON_SIZE)+((ICON_SIZE-IMG_SIZE)/2))*4
Line 615... Line 628...
615
        repne   scasb
628
	repne	scasb
616
        mov     edx,[edi]
629
	mov	edx,[edi]
Line 617... Line 630...
617
 
630
 
618
        test    edx,00008000h
631
	test	edx,00008000h
619
        jz      @f
632
	jz	@f
-
 
633
	add	dx,[wsYe]
620
        add     dx,[ScreenY]
634
	jmp	.DI11
-
 
635
    @@:
-
 
636
	add	dx,[wsY]
-
 
637
   .DI11:
621
    @@:
638
 
622
        test    edx,80000000h
639
	test	edx,80000000h
-
 
640
	jz	@f
623
        jz      @f
641
	mov	ax,[wsXe]
624
        rol     edx,16
642
	shl	eax,16
625
        add     dx,[ScreenX]
643
	add	edx,eax
626
        rol     edx,16
644
	jmp	.DI12
-
 
645
    @@:
-
 
646
	mov	ax,[wsX]
-
 
647
	shl	eax,16
-
 
648
	add	edx,eax
Line 627... Line 649...
627
    @@:
649
   .DI12:
628
 
650
 
629
        mov     ebx,IconArea
651
	mov	ebx,IconArea
Line 656... Line 678...
656
        repne   scasb
678
	repne	scasb
Line 657... Line 679...
657
 
679
 
658
        mov     ax,[edi+2]
680
	mov	ax,[edi+2]
659
        test    ax,8000h
681
	test	ax,8000h
660
        jz      @f
682
	jz	@f
-
 
683
	add	ax,[wsXe]
661
        add     ax,[ScreenX]
684
	jmp	.rbg1
-
 
685
      @@:
-
 
686
	add	ax,[wsX]
Line 662... Line 687...
662
      @@:
687
     .rbg1:
663
 
688
 
664
        mov     bx,[edi]
689
	mov	bx,[edi]
665
        test    bx,8000h
690
	test	bx,8000h
-
 
691
	jz	@f
666
        jz      @f
692
	add	bx,[wsYe]
-
 
693
	jmp	.rbg2
-
 
694
      @@:
Line 667... Line 695...
667
        add     bx,[ScreenY]
695
	add	bx,[wsY]
668
      @@:
696
     .rbg2:
669
 
697
 
670
        mov     cx,ax
698
	mov	cx,ax
Line 690... Line 718...
690
        mov     ebx,[y]
718
	mov	ebx,[y]
Line 691... Line 719...
691
 
719
 
692
        xor     edx,edx
720
	xor	edx,edx
693
        test    eax,8000h
721
	test	eax,8000h
694
        jnz     @f
722
	jnz	@f
695
        mov     dx,[ScreenX]    ;¥á«¨ ­ ¤®, â® ¯à¥®¡à §®¢ë¢ ¥¬ ¢
723
	mov	dx,[wsW]    ;¥á«¨ ­ ¤®, â® ¯à¥®¡à §®¢ë¢ ¥¬ ¢
-
 
724
	shr	edx,1		;®âà¨æ â¥«ì­ë¥ ª®®à¤¨­ âë
696
        shr     edx,1           ;®âà¨æ â¥«ì­ë¥ ª®®à¤¨­ âë
725
	add	dx,[wsX]
697
        cmp     eax,edx
726
	cmp	eax,edx
698
        jbe     @f
727
	jbe	@f
699
        sub     ax,[ScreenX]
728
	sub	ax,[wsW]
700
        inc     eax
729
	inc	eax
Line 701... Line 730...
701
      @@:
730
      @@:
702
 
731
 
703
        test    ebx,8000h
732
	test	ebx,8000h
704
        jnz     @f
733
	jnz	@f
-
 
734
	mov	dx,[wsY]
705
        mov     dx,[ScreenY]
735
	shr	edx,1
706
        shr     edx,1
736
	add	dx,[wsH]
707
        cmp     ebx,edx
737
	cmp	ebx,edx
708
        jbe     @f
738
	jbe	@f
709
        sub     bx,[ScreenY]
739
	sub	bx,[wsH]
710
        inc     ebx
740
	inc	ebx
Line 711... Line 741...
711
      @@:
741
      @@:
712
                                ;¯®¯à ¢ª  ­  á«ãç © ¢ë室  §  ªà © íªà ­ 
742
				;¯®¯à ¢ª  ­  á«ãç © ¢ë室  §  ªà © íªà ­ 
713
 
743
 
714
        test    eax,8000h
744
	test	eax,8000h
715
        jnz     @f
745
	jnz	@f
716
        mov     dx,[ScreenX]
746
	mov	dx,[wsXe]
717
        sub     edx,ICON_SIZE
747
	sub	edx,ICON_SIZE
718
        cmp     eax,edx
748
	cmp	eax,edx
Line 719... Line 749...
719
        jbe     @f
749
	jbe	@f
720
        mov     eax,edx
750
	mov	eax,edx
721
     @@:
751
     @@:
722
 
752
 
723
        test    ebx,8000h
753
	test	ebx,8000h
724
        jnz     @f
754
	jnz	@f
725
        mov     dx,[ScreenY]
755
	mov	dx,[wsYe]
726
        sub     edx,ICON_SIZE
756
	sub	edx,ICON_SIZE
Line 874... Line 904...
874
        repne   scasb
904
	repne	scasb
Line 875... Line 905...
875
 
905
 
876
        mov     ax,[edi+2]
906
	mov	ax,[edi+2]
877
        test    ax,8000h
907
	test	ax,8000h
878
        jz      @f
908
	jz	@f
-
 
909
	add	ax,[wsXe]
879
        add     ax,[ScreenX]
910
	jmp	.gni1
-
 
911
      @@:
-
 
912
	add	ax,[wsX]
880
      @@:
913
     .gni1:
Line 881... Line 914...
881
        mov     [posX],ax
914
	mov	[posX],ax
882
 
915
 
883
        mov     ax,[edi]
916
	mov	ax,[edi]
884
        test    ax,8000h
917
	test	ax,8000h
-
 
918
	jz	@f
885
        jz      @f
919
	add	ax,[wsYe]
-
 
920
	jmp	.gni2
-
 
921
      @@:
-
 
922
	add	ax,[wsY]
886
        add     ax,[ScreenY]
923
     .gni2:
Line 887... Line 924...
887
      @@:
924
 
888
        mov     [posY],ax
925
	mov	[posY],ax
Line 906... Line 943...
906
     @@:
943
     @@:
Line 907... Line 944...
907
 
944
 
908
        dec     ebx
945
	dec	ebx
Line 909... Line 946...
909
        pop     ecx
946
	pop	ecx
910
 
947
 
911
        loop    .TestIcon
948
	;loop    .TestIcon
912
        ;dec     ecx
949
	dec	ecx
913
        ;jnz     .TestIcon
950
	jnz	.TestIcon
914
        jmp     .NoIcon
951
	jmp	.NoIcon
915
   .OkIcon:
952
   .OkIcon:
916
        mov     eax,ebx
953
	mov	eax,ebx
Line 1367... Line 1404...
1367
sc              system_colors
1404
sc		system_colors
1368
sc.workL        rd 1
1405
sc.workL	rd 1
1369
sc.workH        rd 1
1406
sc.workH	rd 1
Line 1370... Line 1407...
1370
 
1407
 
-
 
1408
align 4
1371
align 4
1409
 
1372
ScreenX         rw 1
1410
ScreenW 	rw 1
-
 
1411
ScreenH 	rw 1
-
 
1412
wsX		rw 1
-
 
1413
wsY		rw 1
-
 
1414
wsXe		rw 1
-
 
1415
wsYe		rw 1
-
 
1416
wsW		rw 1
-
 
1417
wsH		rw 1
Line 1373... Line 1418...
1373
ScreenY         rw 1
1418
 
1374
 
1419
 
Line 1375... Line 1420...
1375
MouseX          rd 1
1420
MouseX		rd 1