forked from KolibriOS/kolibrios
Tinypad: fixed bug#1 (2)
Tinypad: changes in memory management git-svn-id: svn://kolibrios.org@824 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
1827396bcc
commit
c6fefc9917
@ -1,3 +1,5 @@
|
||||
diff16 'tp-button.asm',0,$
|
||||
|
||||
button:
|
||||
mcall 17
|
||||
cmp al,0
|
||||
|
@ -1,3 +1,5 @@
|
||||
diff16 'tp-common.asm',0,$
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
proc clear_selection ;////////////////////////////////////////////////////////
|
||||
;-----------------------------------------------------------------------------
|
||||
@ -421,7 +423,7 @@ proc delete_selection ;///////////////////////////////////////////////////////
|
||||
add edi,[sel.begin.x]
|
||||
lea esi,[esi+eax+4]
|
||||
mov ecx,[cur_editor.Lines]
|
||||
add ecx,[ecx-4]
|
||||
add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4]
|
||||
sub ecx,esi
|
||||
cld
|
||||
rep movsb
|
||||
@ -447,7 +449,7 @@ proc delete_selection ;///////////////////////////////////////////////////////
|
||||
add edi,[sel.begin.x]
|
||||
lea esi,[edi+ecx]
|
||||
mov ecx,[cur_editor.Lines]
|
||||
add ecx,[ecx-4]
|
||||
add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4]
|
||||
sub ecx,esi
|
||||
cld
|
||||
rep movsb
|
||||
@ -465,7 +467,7 @@ proc delete_selection ;///////////////////////////////////////////////////////
|
||||
movzx eax,word[esi]
|
||||
lea esi,[esi+eax+4]
|
||||
mov eax,[cur_editor.Lines]
|
||||
add eax,[eax-4]
|
||||
add eax,[cur_editor.Lines.Size] ;*** add eax,[eax-4]
|
||||
sub esi,eax
|
||||
lea eax,[esi+4096]
|
||||
call editor_realloc_lines
|
||||
@ -587,11 +589,11 @@ proc mem.Alloc,size ;/////////////////////////////////////////////////////////
|
||||
;-----------------------------------------------------------------------------
|
||||
push ebx ecx
|
||||
mov ecx,[size]
|
||||
add ecx,4
|
||||
;*** add ecx,4
|
||||
mcall 68,12
|
||||
add ecx,-4
|
||||
mov [eax],ecx
|
||||
add eax,4
|
||||
;*** add ecx,-4
|
||||
;*** mov [eax],ecx
|
||||
;*** add eax,4
|
||||
pop ecx ebx
|
||||
ret
|
||||
endp
|
||||
@ -603,17 +605,17 @@ proc mem.ReAlloc,mptr,size ;//////////////////////////////////////////////////
|
||||
mov ecx,[size]
|
||||
or ecx,ecx
|
||||
jz @f
|
||||
add ecx,4
|
||||
;*** add ecx,4
|
||||
@@: mov edx,[mptr]
|
||||
or edx,edx
|
||||
jz @f
|
||||
add edx,-4
|
||||
;*** add edx,-4
|
||||
@@: mcall 68,20
|
||||
or eax,eax
|
||||
jz @f
|
||||
add ecx,-4
|
||||
mov [eax],ecx
|
||||
add eax,4
|
||||
;*** add ecx,-4
|
||||
;*** mov [eax],ecx
|
||||
;*** add eax,4
|
||||
@@: pop edx ecx ebx
|
||||
ret
|
||||
endp
|
||||
@ -625,7 +627,7 @@ proc mem.Free,mptr ;//////////////////////////////////////////////////////////
|
||||
mov ecx,[mptr]
|
||||
or ecx,ecx
|
||||
jz @f
|
||||
add ecx,-4
|
||||
;*** add ecx,-4
|
||||
@@: mcall 68,13
|
||||
pop ecx ebx
|
||||
ret
|
||||
|
@ -1,3 +1,5 @@
|
||||
diff16 'tp-dialog.asm',0,$
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
proc define_3d_button ;///////////////////////////////////////////////////////
|
||||
;-----------------------------------------------------------------------------
|
||||
|
@ -1,3 +1,5 @@
|
||||
diff16 'tp-draw.asm',0,$
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
proc drawwindow ;///// DRAW WINDOW ///////////////////////////////////////////
|
||||
;-----------------------------------------------------------------------------
|
||||
|
@ -1,3 +1,4 @@
|
||||
diff16 'tp-editor.asm',0,$
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
proc draw_editor ;///// DRAW EDITOR //////////////////////////////////////////
|
||||
@ -999,6 +1000,11 @@ proc editor_check_for_changes ;///// EDITOR CHANGES CHECKER //////////////////
|
||||
.direct:
|
||||
xor edx,edx
|
||||
|
||||
mov ecx,[cur_editor.Caret.Y]
|
||||
call get_line_offset
|
||||
call get_real_length
|
||||
mov ecx,eax
|
||||
|
||||
mov eax,[cur_editor.Lines.Count]
|
||||
cmp eax,[checker_ed.Lines.Count]
|
||||
je @f
|
||||
@ -1014,12 +1020,9 @@ proc editor_check_for_changes ;///// EDITOR CHANGES CHECKER //////////////////
|
||||
@@: or dl,dl
|
||||
jnz .redraw
|
||||
|
||||
mov ecx,[cur_editor.Caret.Y]
|
||||
call get_line_offset
|
||||
call get_real_length
|
||||
cmp eax,[checker_ed_ll]
|
||||
cmp ecx,[checker_ed_ll]
|
||||
je @f
|
||||
mov [checker_ed_ll],eax
|
||||
mov [checker_ed_ll],ecx
|
||||
or dl,REDRAW_ONELINE
|
||||
@@:
|
||||
mov eax,[cur_editor.Caret.Y]
|
||||
@ -1107,6 +1110,7 @@ proc editor_check_for_changes ;///// EDITOR CHANGES CHECKER //////////////////
|
||||
jmp .exit
|
||||
|
||||
.redraw:
|
||||
mov [checker_ed_ll],ecx
|
||||
push edx
|
||||
call draw_editor_gutter
|
||||
call draw_editor_text
|
||||
|
@ -1,3 +1,5 @@
|
||||
diff16 'tp-files.asm',0,$
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
proc save_file ;//////////////////////////////////////////////////////////////
|
||||
;-----------------------------------------------------------------------------
|
||||
|
@ -1,3 +1,5 @@
|
||||
diff16 'tp-key.asm',0,$
|
||||
|
||||
key:
|
||||
mov ecx,1
|
||||
mcall 66,3
|
||||
@ -544,7 +546,7 @@ proc key.ctrl_v
|
||||
mov ecx,[copy_size]
|
||||
sub ecx,4
|
||||
mov edi,[cur_editor.Lines]
|
||||
add edi,[edi-4]
|
||||
add edi,[cur_editor.Lines.Size] ;*** add edi,[edi-4]
|
||||
dec edi
|
||||
mov eax,esi
|
||||
mov esi,edi
|
||||
@ -691,7 +693,7 @@ proc key.ctrl_y ;///// DELETE CURRENT LINE ///////////////////////////////////
|
||||
|
||||
dec [cur_editor.Lines.Count]
|
||||
mov ecx,[cur_editor.Lines]
|
||||
add ecx,[ecx-4]
|
||||
add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4]
|
||||
sub ecx,esi
|
||||
shr ecx,2
|
||||
cld
|
||||
@ -1079,7 +1081,7 @@ proc key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////////////////////
|
||||
@@:
|
||||
push ecx
|
||||
mov edi,[cur_editor.Lines]
|
||||
add edi,[edi-4]
|
||||
add edi,[cur_editor.Lines.Size] ;*** add edi,[edi-4]
|
||||
dec edi
|
||||
lea esi,[edi+8]
|
||||
sub esi,ecx
|
||||
@ -1102,7 +1104,7 @@ proc key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////////////////////
|
||||
movzx eax,word[esi-4]
|
||||
add esi,eax
|
||||
mov ecx,[cur_editor.Lines]
|
||||
add ecx,[ecx-4]
|
||||
add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4]
|
||||
sub ecx,esi
|
||||
cld
|
||||
@@: rep movsb
|
||||
@ -1127,7 +1129,7 @@ proc key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////////////////////
|
||||
movzx eax,word[esi]
|
||||
lea esi,[esi+eax+4]
|
||||
mov eax,[cur_editor.Lines]
|
||||
add eax,[eax-4]
|
||||
add eax,[cur_editor.Lines.Size] ;*** add eax,[eax-4]
|
||||
sub esi,eax
|
||||
lea eax,[esi+4096]
|
||||
call editor_realloc_lines
|
||||
@ -1249,7 +1251,7 @@ proc key.tab ;///// TABULATE /////////////////////////////////////////////////
|
||||
pop eax
|
||||
pushad
|
||||
mov ecx,[cur_editor.Lines]
|
||||
add ecx,[ecx-4]
|
||||
add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4]
|
||||
dec ecx
|
||||
mov edi,ecx
|
||||
add ecx,-10+1
|
||||
@ -1392,7 +1394,7 @@ proc key.return ;///// CARRIAGE RETURN ///////////////////////////////////////
|
||||
|
||||
push ecx
|
||||
mov edi,[cur_editor.Lines]
|
||||
add edi,[edi-4]
|
||||
add edi,[cur_editor.Lines.Size] ;*** add edi,[edi-4]
|
||||
dec edi
|
||||
lea esi,[edi+4]
|
||||
sub esi,ecx
|
||||
@ -1410,7 +1412,7 @@ proc key.return ;///// CARRIAGE RETURN ///////////////////////////////////////
|
||||
movzx ecx,word[ebp]
|
||||
add esi,ecx
|
||||
mov ecx,[cur_editor.Lines]
|
||||
add ecx,[ecx-4]
|
||||
add ecx,[cur_editor.Lines.Size] ;*** add ecx,[ecx-4]
|
||||
sub ecx,esi
|
||||
cld
|
||||
@@: rep movsb
|
||||
|
@ -1,3 +1,5 @@
|
||||
diff16 'tp-mouse.asm',0,$
|
||||
|
||||
proc check_mouse_in_edit_area
|
||||
mcall 37,1
|
||||
mov ebx,eax
|
||||
|
@ -1,3 +1,4 @@
|
||||
diff16 'tp-popup.asm',0,$
|
||||
|
||||
;POP_WIDTH = (popup_text.max_title+popup_text.max_accel+6)*6
|
||||
POP_IHEIGHT = 16
|
||||
|
@ -1,3 +1,5 @@
|
||||
diff16 'tp-recode.asm',0,$
|
||||
|
||||
recode:
|
||||
|
||||
.866.1251:
|
||||
|
@ -1,3 +1,5 @@
|
||||
diff16 'tp-tabctl.asm',0,$
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
proc flush_cur_tab ;///// SAVE CURRENT TAB DATA TO CONTROL ///////////////////
|
||||
;-----------------------------------------------------------------------------
|
||||
|
@ -1,3 +1,5 @@
|
||||
diff16 'tp-tbox.asm',0,$
|
||||
|
||||
virtual at ebp
|
||||
tbox TBOX
|
||||
end virtual
|
||||
|
Loading…
Reference in New Issue
Block a user