Subversion Repositories Kolibri OS

Rev

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

Rev 2011 Rev 2288
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2010. All rights reserved.      ;;
3
;; Copyright (C) KolibriOS team 2010. 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: 2011 $
8
$Revision: 2288 $
Line 9... Line 9...
9
 
9
 
10
include 'mousepointer.inc'
10
include 'mousepointer.inc'
Line 70... Line 70...
70
 
70
 
71
        and     [mouse.state.buttons], 0
71
        and     [mouse.state.buttons], 0
Line 72... Line 72...
72
        jmp     .exit
72
        jmp     .exit
-
 
73
 
73
 
74
        ; is there any system button under cursor?
74
        ; is there any system button under cursor?
75
    @@:
75
    @@: call    mouse._.find_sys_button_under_cursor
76
        call    mouse._.find_sys_button_under_cursor
Line 76... Line 77...
76
        or      eax, eax
77
        or      eax, eax
77
        jz      .check_buttons_released
78
        jz      .check_buttons_released
Line 117... Line 118...
117
        test    byte[esp], mouse.LEFT_BUTTON_FLAG
118
        test    byte[esp], mouse.LEFT_BUTTON_FLAG
118
        jz      @f
119
        jz      @f
119
        mov     eax, [esp + 4]
120
        mov     eax, [esp + 4]
120
        call    .call_left_button_handler
121
        call    .call_left_button_handler
Line -... Line 122...
-
 
122
 
121
 
123
    @@:
122
    @@: test    byte[esp], mouse.RIGHT_BUTTON_FLAG
124
        test    byte[esp], mouse.RIGHT_BUTTON_FLAG
123
        jz      @f
125
        jz      @f
124
        mov     eax, [esp + 4]
126
        mov     eax, [esp + 4]
Line -... Line 127...
-
 
127
        call    .call_right_button_handler
125
        call    .call_right_button_handler
128
 
126
 
129
    @@:
127
    @@: test    byte[esp], mouse.MIDDLE_BUTTON_FLAG
130
        test    byte[esp], mouse.MIDDLE_BUTTON_FLAG
128
        jz      .check_position
131
        jz      .check_position
Line 129... Line 132...
129
        mov     eax, [esp + 4]
132
        mov     eax, [esp + 4]
Line 220... Line 223...
220
 
223
 
221
        mov     [mouse.active_sys_window.last_ticks], 0
224
        mov     [mouse.active_sys_window.last_ticks], 0
222
        call    sys_window_maximize_handler
225
        call    sys_window_maximize_handler
Line -... Line 226...
-
 
226
        jmp     .exit
223
        jmp     .exit
227
 
224
 
228
    @@:
225
    @@: test    [edi + WDATA.fl_wstate], WSTATE_MAXIMIZED
229
        test    [edi + WDATA.fl_wstate], WSTATE_MAXIMIZED
226
        jnz     .exit
230
        jnz     .exit
227
        mov     [mouse.active_sys_window.pslot], esi
231
        mov     [mouse.active_sys_window.pslot], esi
228
        lea     eax, [edi + WDATA.box]
232
        lea     eax, [edi + WDATA.box]
Line 236... Line 240...
236
 
240
 
237
        call    .calculate_n_delta
241
        call    .calculate_n_delta
238
        call    .calculate_w_delta
242
        call    .calculate_w_delta
Line -... Line 243...
-
 
243
        jmp     .call_window_handler
239
        jmp     .call_window_handler
244
 
240
 
245
    @@:
241
    @@: test    dl, mouse.WINDOW_RESIZE_W_FLAG
246
        test    dl, mouse.WINDOW_RESIZE_W_FLAG
Line -... Line 247...
-
 
247
        jz      @f
242
        jz      @f
248
        call    .calculate_w_delta
243
        call    .calculate_w_delta
249
 
244
 
250
    @@:
Line -... Line 251...
-
 
251
        test    dl, mouse.WINDOW_RESIZE_S_FLAG
245
    @@: test    dl, mouse.WINDOW_RESIZE_S_FLAG
252
        jz      @f
246
        jz      @f
253
        call    .calculate_s_delta
247
        call    .calculate_s_delta
254
 
Line 248... Line 255...
248
 
255
    @@:
249
    @@: test    dl, mouse.WINDOW_RESIZE_E_FLAG
256
        test    dl, mouse.WINDOW_RESIZE_E_FLAG
Line 387... Line 394...
387
        mov     eax, [mouse.active_sys_window.new_box.left]
394
        mov     eax, [mouse.active_sys_window.new_box.left]
388
        or      eax, eax
395
        or      eax, eax
389
        jge     @f
396
        jge     @f
390
        xor     eax, eax
397
        xor     eax, eax
391
        mov     [mouse.active_sys_window.new_box.left], eax
398
        mov     [mouse.active_sys_window.new_box.left], eax
-
 
399
    @@:
392
    @@: add     eax, [mouse.active_sys_window.new_box.width]
400
        add     eax, [mouse.active_sys_window.new_box.width]
393
        cmp     eax, [Screen_Max_X]
401
        cmp     eax, [Screen_Max_X]
394
        jl      @f
402
        jl      @f
395
        sub     eax, [Screen_Max_X]
403
        sub     eax, [Screen_Max_X]
396
        sub     [mouse.active_sys_window.new_box.left], eax
404
        sub     [mouse.active_sys_window.new_box.left], eax
-
 
405
    @@:
397
    @@: mov     eax, [mouse.active_sys_window.new_box.top]
406
        mov     eax, [mouse.active_sys_window.new_box.top]
398
        or      eax, eax
407
        or      eax, eax
399
        jge     @f
408
        jge     @f
400
        xor     eax, eax
409
        xor     eax, eax
401
        mov     [mouse.active_sys_window.new_box.top], eax
410
        mov     [mouse.active_sys_window.new_box.top], eax
-
 
411
    @@:
402
    @@: add     eax, [mouse.active_sys_window.new_box.height]
412
        add     eax, [mouse.active_sys_window.new_box.height]
403
        cmp     eax, [Screen_Max_Y]
413
        cmp     eax, [Screen_Max_Y]
404
        jle     .call_window_handler
414
        jle     .call_window_handler
405
        sub     eax, [Screen_Max_Y]
415
        sub     eax, [Screen_Max_Y]
406
        sub     [mouse.active_sys_window.new_box.top], eax
416
        sub     [mouse.active_sys_window.new_box.top], eax
407
        jmp     .call_window_handler
417
        jmp     .call_window_handler
Line 419... Line 429...
419
        mov     eax, [mouse.active_sys_window.new_box.width]
429
        mov     eax, [mouse.active_sys_window.new_box.width]
420
        sub     eax, 127
430
        sub     eax, 127
421
        jge     @f
431
        jge     @f
422
        add     [mouse.active_sys_window.new_box.left], eax
432
        add     [mouse.active_sys_window.new_box.left], eax
423
        mov     [mouse.active_sys_window.new_box.width], 127
433
        mov     [mouse.active_sys_window.new_box.width], 127
-
 
434
    @@:
424
    @@: mov     eax, [mouse.active_sys_window.new_box.left]
435
        mov     eax, [mouse.active_sys_window.new_box.left]
425
        or      eax, eax
436
        or      eax, eax
426
        jge     .check_resize_s
437
        jge     .check_resize_s
427
        add     [mouse.active_sys_window.new_box.width], eax
438
        add     [mouse.active_sys_window.new_box.width], eax
428
        xor     eax, eax
439
        xor     eax, eax
429
        mov     [mouse.active_sys_window.new_box.left], eax
440
        mov     [mouse.active_sys_window.new_box.left], eax
Line 447... Line 458...
447
        mov     eax, [mouse.active_sys_window.new_box.height]
458
        mov     eax, [mouse.active_sys_window.new_box.height]
448
        cmp     eax, ecx
459
        cmp     eax, ecx
449
        jge     @f
460
        jge     @f
450
        mov     eax, ecx
461
        mov     eax, ecx
451
        mov     [mouse.active_sys_window.new_box.height], eax
462
        mov     [mouse.active_sys_window.new_box.height], eax
-
 
463
    @@:
452
    @@: add     eax, [mouse.active_sys_window.new_box.top]
464
        add     eax, [mouse.active_sys_window.new_box.top]
453
        cmp     eax, [Screen_Max_Y]
465
        cmp     eax, [Screen_Max_Y]
454
        jle     .check_resize_e
466
        jle     .check_resize_e
455
        sub     eax, [Screen_Max_Y]
467
        sub     eax, [Screen_Max_Y]
456
        neg     eax
468
        neg     eax
457
        add     [mouse.active_sys_window.new_box.height], eax
469
        add     [mouse.active_sys_window.new_box.height], eax
Line 472... Line 484...
472
        mov     eax, [mouse.active_sys_window.new_box.width]
484
        mov     eax, [mouse.active_sys_window.new_box.width]
473
        cmp     eax, 127
485
        cmp     eax, 127
474
        jge     @f
486
        jge     @f
475
        mov     eax, 127
487
        mov     eax, 127
476
        mov     [mouse.active_sys_window.new_box.width], eax
488
        mov     [mouse.active_sys_window.new_box.width], eax
-
 
489
    @@:
477
    @@: add     eax, [mouse.active_sys_window.new_box.left]
490
        add     eax, [mouse.active_sys_window.new_box.left]
478
        cmp     eax, [Screen_Max_X]
491
        cmp     eax, [Screen_Max_X]
479
        jle     .call_window_handler
492
        jle     .call_window_handler
480
        sub     eax, [Screen_Max_X]
493
        sub     eax, [Screen_Max_X]
481
        neg     eax
494
        neg     eax
482
        add     [mouse.active_sys_window.new_box.width], eax
495
        add     [mouse.active_sys_window.new_box.width], eax