Subversion Repositories Kolibri OS

Rev

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

Rev 928 Rev 996
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;;
4
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa      ;;
4
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa      ;;
5
;; Distributed under terms of the GNU General Public License    ;;
5
;; Distributed under terms of the GNU General Public License    ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 928 $
8
$Revision: 996 $
9
 
9
 
10
 
10
 
Line 496... Line 496...
496
     ret
496
     ret
Line 497... Line 497...
497
 
497
 
498
 
498
 
499
repos_windows:
499
repos_windows:
500
	mov	ecx,[TASK_COUNT]
500
	mov	ecx,[TASK_COUNT]
501
	mov	edi, OS_BASE+0x20*2
501
    mov edi, window_data+0x20*2
502
	call    force_redraw_background
502
	call    force_redraw_background
503
	dec	ecx
503
	dec	ecx
504
	jge    @f
504
	jge    @f
Line 614... Line 614...
614
    popad
614
    popad
Line 615... Line 615...
615
 
615
 
Line 616... Line -...
616
    ret
-
 
617
 
-
 
618
 
-
 
619
uglobal
-
 
620
  new_window_starting dd 0
-
 
621
endg
-
 
622
 
-
 
623
 
-
 
624
sys_window_mouse:
-
 
625
 
-
 
626
    push  eax
-
 
627
 
-
 
628
    mov   eax,[timer_ticks]
-
 
629
    cmp   [new_window_starting],eax
-
 
630
    jb	  swml1
-
 
631
 
-
 
632
    mov   [mouse_background], 0  ; no mouse background
-
 
633
    mov   [dont_draw_mouse],  0  ; draw mouse
-
 
634
 
-
 
635
    mov   [new_window_starting],eax
-
 
636
 
-
 
637
  swml1:
-
 
638
 
-
 
639
    pop   eax
-
 
640
 
-
 
641
    ret
-
 
642
 
-
 
643
 
616
    ret
Line 644... Line 617...
644
 
617
 
645
 
618
 
646
drawwindow_I_caption:
619
drawwindow_I_caption:
Line 1043... Line 1016...
1043
 
1016
 
1044
	xor   ecx, ecx	     ; passed all windows to top
1017
	xor   ecx, ecx	     ; passed all windows to top
Line 1045... Line -...
1045
	ret
-
 
1046
 
-
 
1047
 
1018
	ret
Line 1048... Line 1019...
1048
 
1019
 
Line 1049... Line 1020...
1049
 
1020
 
Line 1086... Line 1057...
1086
     .do_not_draw:
1057
.do_not_draw:
Line 1087... Line 1058...
1087
 
1058
 
Line 1088... Line 1059...
1088
	popad
1059
	popad
1089
 
-
 
1090
	call  windowactivate
-
 
1091
    mov   [mouse_background], 0  ; no mouse background
1060
 
Line 1092... Line 1061...
1092
    mov   [dont_draw_mouse],  0  ; draw mouse
1061
	call  windowactivate
1093
	ret
1062
    ret
Line 1154... Line 1123...
1154
	mov   edx, ebx
1123
	mov   edx, ebx
1155
	add   ecx, [edi+WDATA.box.width]
1124
	add   ecx, [edi+WDATA.box.width]
1156
	add   edx, [edi+WDATA.box.height]
1125
	add   edx, [edi+WDATA.box.height]
1157
	call  calculatescreen
1126
	call  calculatescreen
1158
.done:
1127
.done:
1159
    mov   [mouse_background], 0 ; no mouse under
-
 
1160
.skip_redrawings:
1128
.skip_redrawings:
1161
	popfd
1129
	popfd
1162
	ret
1130
	ret
Line 1163... Line 1131...
1163
 
1131
 
1164
 
1132
 
1165
iglobal
1133
iglobal
1166
  window_moving   db 'K : Window - move/resize',13,10,0
1134
  window_moving   db 'K : Window - move/resize',13,10,0
Line -... Line 1135...
-
 
1135
  window_moved	  db 'K : Window - done',13,10,0
-
 
1136
endg
1167
  window_moved	  db 'K : Window - done',13,10,0
1137
 
1168
endg
1138
bPressedMouseXY_W db 0x0
1169
 
1139
 
1170
; check window touch
1140
; check window touch
Line 1192... Line 1162...
1192
	mov [bPressedMouseXY_W],0
1162
	mov [bPressedMouseXY_W],0
1193
;..................................... end 1/4 : modified by vhanla ...................
1163
;..................................... end 1/4 : modified by vhanla ...................
1194
	popad
1164
	popad
1195
	ret
1165
	ret
1196
    .mouse_buttons_pressed:
1166
.mouse_buttons_pressed:
1197
;..................................... start 2/4 : modified by vhanla .................
-
 
1198
	jmp @f
-
 
1199
	bPressedMouseXY_W db 0x0
-
 
1200
	@@:
-
 
1201
;..................................... end 2/4 : modified by vhanla ...................
-
 
1202
	mov   esi,[TASK_COUNT]
1167
	mov   esi,[TASK_COUNT]
1203
	inc   esi
1168
	inc   esi
Line 1204... Line 1169...
1204
 
1169
 
1205
;..................................... start 3/4 : modified by vhanla .................
-
 
1206
	push eax
1170
;..................................... start 3/4 : modified by vhanla .................
1207
	cmp [bPressedMouseXY_W],0
1171
	cmp [bPressedMouseXY_W],0
1208
	jnz @f
1172
	jnz @f
1209
	mov [bPressedMouseXY_W],1
-
 
1210
	mov ax,[MOUSE_X]
-
 
1211
	mov [mx],ax
-
 
1212
	mov ax,[MOUSE_Y]
-
 
1213
	mov [my],ax
1173
	mov [bPressedMouseXY_W],1
1214
	@@:
-
 
1215
	pop eax
1174
@@:
Line -... Line 1175...
-
 
1175
;..................................... end 3/4 : modified by vhanla ...................
-
 
1176
 
-
 
1177
    movzx  eax,word [MOUSE_Y]
-
 
1178
    movzx  ebx,word [MOUSE_X]
-
 
1179
    mov ecx, [Screen_Max_X]
-
 
1180
    add ebx, [_display_data]
-
 
1181
    inc ecx
-
 
1182
    mul ecx
1216
;..................................... end 3/4 : modified by vhanla ...................
1183
    movzx edi, byte [ebx+eax]
1217
 
-
 
1218
      cwloop:
-
 
Line 1219... Line -...
1219
	cmp   esi,2
-
 
1220
	jb   .exit
1184
 
-
 
1185
cwloop:
1221
 
1186
 
1222
	dec   esi
1187
    movzx esi, word [WIN_STACK + edi * 2]
1223
	movzx edi, word [WIN_POS + esi * 2] ; ebx
-
 
1224
	shl   edi, 5
-
 
1225
	add   edi, window_data
-
 
Line 1226... Line -...
1226
;        mov   edi, ebx
-
 
1227
    mov   ecx, [edi + WDATA.box.left]
-
 
1228
    mov   edx, [edi + WDATA.box.top]
-
 
1229
 
-
 
1230
	mov   eax,ecx
-
 
1231
	mov   ebx,edx
-
 
1232
	test	[edi+WDATA.fl_wstate],WSTATE_MINIMIZED
1188
 
1233
	jnz	cwloop
1189
	shl   edi, 5
1234
 
-
 
1235
;..................................... start 4/4 : modified by vhanla .................
-
 
1236
       movzx  eax, word [mx]; movzx eax,word[mouse_x]
-
 
1237
       movzx  ebx, word [my]; movzx ebx,word[MOUSE_Y]
-
 
1238
;..................................... endt 4/4 : modified by vhanla ..................
-
 
1239
	cmp   ecx, eax
-
 
1240
	jae   cwloop
-
 
1241
	cmp   edx, ebx
-
 
1242
	jae   cwloop
-
 
1243
    add   ecx, [edi + WDATA.box.width]
-
 
1244
    add   edx, [edi + WDATA.box.height]
-
 
Line 1245... Line 1190...
1245
	cmp   eax, ecx
1190
	add   edi, window_data
1246
	jae   cwloop
1191
 
1247
	cmp   ebx, edx
1192
    movzx  eax,word [MOUSE_X]
1248
	jae   cwloop
1193
    movzx  ebx,word [MOUSE_Y]
Line 1369... Line 1314...
1369
 
1314
 
Line 1370... Line 1315...
1370
	; move window
1315
	; move window
Line 1371... Line -...
1371
 
-
 
1372
      newchm:
-
 
1373
 
1316
 
Line 1374... Line 1317...
1374
    mov   [dont_draw_mouse],  1
1317
newchm:
Line 1375... Line -...
1375
 
-
 
Line 1376... Line 1318...
1376
	call  checkidle
1318
 
Line 1377... Line 1319...
1377
 
1319
	call  checkidle
1378
	call  checkVga_N13
1320
 
Line 1478... Line 1420...
1478
 
1420
 
1479
      cwb:
1421
      cwb:
1480
    cmp  byte [btn_down], 0
1422
    cmp  byte [btn_down], 0
1481
	jne   newchm
1423
	jne   newchm
1482
				     ; new position done
-
 
1483
    mov [dont_draw_mouse], 1
1424
				     ; new position done
1484
	mov	cl,0
1425
    mov cl,0
1485
	test	[edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1426
	test	[edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
1486
	jnz	@f
1427
	jnz	@f
1487
	mov	cl,[reposition]
1428
	mov	cl,[reposition]
Line 1505... Line 1446...
1505
	mov   esi,edi
1446
	mov   esi,edi
1506
	mov   ecx,2
1447
	mov   ecx,2
1507
	test  [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP or WSTATE_MAXIMIZED
1448
	test  [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP or WSTATE_MAXIMIZED
1508
	jnz   @f
1449
	jnz   @f
1509
	add   ecx,2
1450
	add   ecx,2
-
 
1451
@@:
1510
    @@: sub   edi,window_data
1452
    sub   edi,window_data
1511
	shr   edi,5
1453
	shr   edi,5
1512
	shl   edi,8
1454
	shl   edi,8
1513
	add   edi,SLOT_BASE+APPDATA.saved_box
1455
	add   edi,SLOT_BASE+APPDATA.saved_box
1514
	cld
1456
	cld
1515
	rep   movsd
1457
	rep   movsd
Line 1631... Line 1573...
1631
	popad
1573
	popad
Line 1632... Line 1574...
1632
 
1574
 
1633
	cmp   [reposition],0
1575
	cmp   [reposition],0
Line 1634... Line -...
1634
	je    retwm
-
 
1635
 
-
 
1636
    mov   [dont_draw_mouse], 1 ; no mouse
-
 
1637
 
1576
	je    retwm
1638
 
1577
 
1639
	push  eax ebx ecx edx
1578
	push  eax ebx ecx edx
1640
	mov   eax,[edi+WDATA.box.left]
1579
	mov   eax,[edi+WDATA.box.left]
1641
	mov   ebx,[edi+WDATA.box.top]
1580
	mov   ebx,[edi+WDATA.box.top]
Line 1660... Line 1599...
1660
 
1599
 
Line 1661... Line 1600...
1661
	mov	[edi+WDATA.fl_redraw],1
1600
	mov	[edi+WDATA.fl_redraw],1
1662
 
1601
 
1663
	mov   ecx,100	      ; wait to avoid mouse residuals
-
 
1664
      waitre2:
1602
	mov   ecx,100	      ; wait to avoid mouse residuals
1665
    mov   [dont_draw_mouse], 1
1603
waitre2:
1666
	call  checkidle
1604
    call  checkidle
1667
	cmp	[edi+WDATA.fl_redraw],0
1605
	cmp	[edi+WDATA.fl_redraw],0
Line 1668... Line 1606...
1668
	jz    retwm
1606
	jz    retwm
Line 1669... Line -...
1669
	loop  waitre2
-
 
1670
 
-
 
1671
      retwm:
-
 
1672
 
1607
	loop  waitre2
1673
    mov   [dont_draw_mouse],  0 ; mouse pointer
1608
 
Line 1674... Line 1609...
1674
    mov   [mouse_background], 0 ; no mouse under
1609
retwm: