Subversion Repositories Kolibri OS

Rev

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

Rev 8928 Rev 9514
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2010-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2010-2015. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 8928 $
8
$Revision: 9514 $
Line 9... Line 9...
9
 
9
 
10
include 'mousepointer.inc'
10
include 'mousepointer.inc'
Line 683... Line 683...
683
  .no_action:
683
  .no_action:
684
        xor     eax, eax
684
        xor     eax, eax
Line 685... Line 685...
685
 
685
 
686
  .exit:
686
  .exit:
-
 
687
        ret
-
 
688
;-----------------------------------------------------------------------------
-
 
689
 
-
 
690
align 4
-
 
691
readmousepos:
-
 
692
; eax=0 screen relative
-
 
693
; eax=1 window relative
-
 
694
; eax=2 buttons pressed
-
 
695
; eax=3 buttons pressed ext
-
 
696
; eax=4 load cursor
-
 
697
; eax=5 set cursor
-
 
698
; eax=6 delete cursor
-
 
699
; eax=7 get mouse_z
-
 
700
; eax=8 load cursor unicode
-
 
701
        cmp     ebx, 8
-
 
702
        ja      @f
-
 
703
        jmp     dword[.mousefn+ebx*4]
-
 
704
 
-
 
705
align 4
-
 
706
.mousefn:
-
 
707
dd  .msscreen
-
 
708
dd  .mswin
-
 
709
dd  .msbutton
-
 
710
dd  .msbuttonExt
-
 
711
dd  .app_load_cursor
-
 
712
dd  .app_set_cursor
-
 
713
dd  .app_delete_cursor
-
 
714
dd  .msz
-
 
715
dd  .loadCursorUni
-
 
716
 
-
 
717
.msscreen:
-
 
718
        mov     eax, [MOUSE_X]
-
 
719
        shl     eax, 16
-
 
720
        mov     ax, [MOUSE_Y]
-
 
721
        mov     [esp+36-4], eax
-
 
722
@@:
-
 
723
        ret
-
 
724
 
-
 
725
.mswin:
-
 
726
        mov     eax, [MOUSE_X]
-
 
727
        shl     eax, 16
-
 
728
        mov     ax, [MOUSE_Y]
-
 
729
        mov     esi, [TASK_BASE]
-
 
730
        mov     bx, word [esi-twdw+WDATA.box.left]
-
 
731
        shl     ebx, 16
-
 
732
        mov     bx, word [esi-twdw+WDATA.box.top]
-
 
733
        sub     eax, ebx
-
 
734
        mov     edi, [current_slot_idx]
-
 
735
        shl     edi, 8
-
 
736
        sub     ax, word[edi+SLOT_BASE+APPDATA.wnd_clientbox.top]
-
 
737
        rol     eax, 16
-
 
738
        sub     ax, word[edi+SLOT_BASE+APPDATA.wnd_clientbox.left]
-
 
739
        rol     eax, 16
-
 
740
        mov     [esp+36-4], eax
-
 
741
        ret
-
 
742
 
-
 
743
.msbutton:
-
 
744
        movzx   eax, byte [BTN_DOWN]
-
 
745
        mov     [esp+36-4], eax
-
 
746
        ret
-
 
747
 
-
 
748
.msbuttonExt:
-
 
749
        mov     eax, [BTN_DOWN]
-
 
750
        mov     [esp+36-4], eax
-
 
751
        ret
-
 
752
 
-
 
753
.app_load_cursor:
-
 
754
        cmp     ecx, OS_BASE
-
 
755
        jae     @f
-
 
756
        stdcall load_cursor, ecx, edx
-
 
757
        mov     [esp+36-4], eax
-
 
758
@@:
-
 
759
        ret
-
 
760
 
-
 
761
.loadCursorUni:
-
 
762
        cmp     ecx, OS_BASE
-
 
763
        jae     @b
-
 
764
        push    ecx edx
-
 
765
        stdcall kernel_alloc, maxPathLength
-
 
766
        mov     edi, eax
-
 
767
        pop     eax esi
-
 
768
        push    edi
-
 
769
        call    getFullPath
-
 
770
        pop     ebp
-
 
771
        test    eax, eax
-
 
772
        jz      @f
-
 
773
        stdcall load_cursor, ebp, LOAD_FROM_FILE
-
 
774
        mov     [esp+32], eax
-
 
775
@@:
-
 
776
        stdcall kernel_free, ebp
-
 
777
        ret
-
 
778
 
-
 
779
.app_set_cursor:
-
 
780
        stdcall set_cursor, ecx
-
 
781
        mov     [esp+36-4], eax
-
 
782
        ret
-
 
783
 
-
 
784
.app_delete_cursor:
-
 
785
        stdcall delete_cursor, ecx
-
 
786
        mov     [esp+36-4], eax
-
 
787
        ret
-
 
788
 
-
 
789
.msz:
-
 
790
        mov     edi, [thread_count]
-
 
791
        movzx   edi, word [WIN_POS + edi*2]
-
 
792
        cmp     edi, [current_slot_idx]
-
 
793
        jne     @f
-
 
794
        mov     ax, [MOUSE_SCROLL_H]
-
 
795
        shl     eax, 16
-
 
796
        mov     ax, [MOUSE_SCROLL_V]
-
 
797
        mov     [esp+36-4], eax
-
 
798
        and     [MOUSE_SCROLL_H], word 0
-
 
799
        and     [MOUSE_SCROLL_V], word 0
-
 
800
        ret
-
 
801
@@:
-
 
802
        and     [esp+36-4], dword 0
687
        ret
803
        ret