Subversion Repositories Kolibri OS

Compare Revisions

Ignore whitespace Rev 178 → Rev 177

/programs/develop/tinypad/trunk/tp-butto.asm
File deleted
\ No newline at end of file
/programs/develop/tinypad/trunk/tp-key.asm
File deleted
\ No newline at end of file
/programs/develop/tinypad/trunk/tinypad.inc
File deleted
\ No newline at end of file
/programs/develop/tinypad/trunk/tp-tbox.asm
File deleted
/programs/develop/tinypad/trunk/tp-files.asm
File deleted
\ No newline at end of file
/programs/develop/tinypad/trunk/tp-dialo.asm
File deleted
/programs/develop/tinypad/trunk/tp-commo.asm
File deleted
/programs/develop/tinypad/trunk/tp-draw.asm
File deleted
\ No newline at end of file
/programs/develop/tinypad/trunk/tp-mouse.asm
File deleted
\ No newline at end of file
/programs/develop/tinypad/trunk/tp-popup.asm
File deleted
\ No newline at end of file
/programs/develop/tinypad/trunk/macros.inc
1,3 → 1,6
; language for programs
lang fix en ; ru en fr ge fi
 
@^ fix macro comment {
^@ fix }
 
328,34 → 331,21
; structure definition helper
include 'struct.inc'
 
struct RECT
left dd ?
top dd ?
right dd ?
bottom dd ?
ends
 
struct BOX
left dd ?
top dd ?
width dd ?
height dd ?
ends
 
; structures used in MeOS
struct process_information
cpu_usage dd ? ; +0
window_stack_position dw ? ; +4
window_stack_value dw ? ; +6
dw ? ; +8
not_used1 dw ? ; +8
process_name rb 12 ; +10
memory_start dd ? ; +22
used_memory dd ? ; +26
PID dd ? ; +30
box BOX ; +34
x_start dd ? ; +34
y_start dd ? ; +38
x_size dd ? ; +42
y_size dd ? ; +46
slot_state dw ? ; +50
dw ? ; +52
client_box BOX ; +54
rb (1024-52)
ends
 
/programs/develop/tinypad/trunk/tinypad.asm
1,10 → 1,9
;-----------------------------------------------------------------------------
; project name: TINYPAD
; compiler: flat assembler 1.67.1
; memory to compile: 2.0/7.0 MBytes (without/with size optimizations)
; version: 4.0.3
; last update: 2006-08-28 (Aug 28, 2006)
; minimal kernel: revision #138 (svn://kolibrios.org/kernel)
; compiler: flat assembler 1.64
; memory to compile: 3.0/11.5 MBytes (without/with size optimizations)
; version: 4.0
; last update: 2006-04-13 (Apr 13, 2006)
;-----------------------------------------------------------------------------
; originally by: Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi
; maintained by: Ivan Poddubny >> ivan-yar@bk.ru
11,36 → 10,13
; Mike Semenyako >> mike.dld@gmail.com
;-----------------------------------------------------------------------------
; TODO:
; - optimize drawing (reduce flickering)
; - optimize memory usage (allocate only needed amount, not static 3 Mbytes)
; - add block selection ability, undo action, goto position
; - working with multiple files (add tabs)
; - improve window drawing with small dimensions
; - other bugfixes and speed/size optimizations
; optimize drawing (reduce flickering);
; optimize memory usage (allocate only needed amount, not static 3 Mbytes);
; add block selection ability, undo action;
; working with multiple files (add tabs);
; other bugfixes and speed/size optimizations
;
; HISTORY:
; 4.0.3 (mike.dld)
; bug-fixes:
; - 1-char selection if pressing <BS> out of real line length
; - fault in `writepos`, added call to function 9
; - main menu items weren't highlighted if popup opened and cursor
; isn't in menu item's area
; - statusbar and textboxes drawing fixes (wrong colors)
; - perform no redraw while pressing Shift, Ctrl, Alt keys
; - data length from DOCPAK in string representation (fix by diamond)
; changes:
; - function 70 instead of 58 for files loading/saving
; - clientarea-relative drawing (less code)
; - every line's dword is now splitted into 2 words;
; low word - line block length, so max line length is 65535 now
; high word - various flags. for now, only 2 of 16 bits are used:
; if bit #0 is set, line was modified since file open
; if bit #1 is set, line was saved after last modification
; high word could also be further used for code collapsing and different
; line marking features (breakpoints, errors, bookmarks, etc.)
; new features:
; - line markers for modified and saved lines
; - status messages for various actions
; 4.0.2 (mike.dld)
; bug-fixes:
; - program terminates if started with parameters (fine for DOCPAK)
92,7 → 68,7
; 3.77 (mike.dld)
; changed save_string to collapse SPACEs into TABs;
; rewrote drawfile from scratch (speed++)
; through some drawing improvements needed
; through some drawing improvements still needed
; (some checkups to reduce flickering);
; writepos (size--);
; fixed drawing window while height < 100px, and for non-asm files;
134,11 → 110,9
; copy/paste area 0x2f0000 +
;-----------------------------------------------------------------------------
 
include 'lang.inc'
include 'macros.inc' ; useful stuff
;include 'proc32.inc'
include 'tinypad.inc'
;purge mov,add,sub ;  SPEED
purge mov,add,sub ;  SPEED
 
header '01',1,@CODE,TINYPAD_END,AREA_ENDMEM,MAIN_STACK,@PARAMS,self_path
 
152,7 → 126,6
LINEH = 10 ; line height (pixels)
PATHL = 255 ; maximum path length (chars) !!! don't change !!!
AMINS = 8 ; minimal scroll thumb size (pixels)
LCHGW = 2 ; changed/saved marker width
 
STATH = 14 ; status bar height
 
175,8 → 148,6
RGB(255,255,255) ; RGB(224,224,224) ; RGB(255,255,255) ; background
RGB(255,255,255) ; RGB(255,255,255) ; RGB(255,255,255) ; selection text
RGB( 10, 36,106) ; RGB( 0, 0,128) ; RGB( 0, 64,128) ; selection background
RGB( 0,255, 0) ; modified line marker
RGB(255,255, 0) ; saved line marker
 
ins_mode db 1
 
194,17 → 165,6
 
; fninit
 
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_left,50
; mov [mainwnd_pos.x],eax
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_top,50
; mov [mainwnd_pos.y],eax
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_right,350
; sub eax,[mainwnd_pos.x]
; mov [mainwnd_pos.w],eax
; stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_bottom,450
; sub eax,[mainwnd_pos.y]
; mov [mainwnd_pos.h],eax
 
cld
mov edi,@UDATA
mov ecx,@PARAMS-@UDATA
211,13 → 171,16
mov al,0
rep stosb
 
inc [do_not_draw]
 
mov [left_ofs],40+1
mov [f_info+4],0
mov [f_info+12],AREA_TEMP
mov [f_info+16],AREA_EDIT-AREA_TEMP
 
; mov esi,s_example
; mov edi,s_fname
; mov ecx,s_example.size
; mov [s_fname.size],ecx
; rep movsb
mov esi,s_example
mov edi,tb_opensave.text
mov ecx,s_example.size
237,21 → 200,18
 
cmp byte[@PARAMS],'*'
jne .noipc
 
;// diamond [ (convert size from decimal representation to dword)
;-- mov edx,dword[@PARAMS+1]
mov esi,@PARAMS+1
xor edx,edx
xor eax,eax
@@: lodsb
test al,al
; convert size from decimal representation to dword
mov esi, @PARAMS+1
xor edx, edx
xor eax, eax
@@:
lodsb
test al, al
jz @f
lea edx,[edx*4+edx]
lea edx,[edx*2+eax-'0']
lea edx, [edx*4+edx]
lea edx, [edx*2+eax]
jmp @b
@@:
;// diamond ]
 
@@:
add edx,20
mcall 60,1,AREA_TEMP-16 ; 0x10000-16
mov dword[AREA_TEMP-16+4],8 ; [0x10000-16+4],8
265,6 → 225,8
inc eax
call load_file.file_found
jmp @f
; call file_found ; çàãðóçêà ôàéëà
; jmp do_load_file.restorecursor ; îòîáðàæåíèå
.noipc:
 
;// Willow's code to support DOCPAK ]
288,12 → 250,9
call new_file
 
@@:
dec [do_not_draw]
call drawwindow
mcall 66,1,1
mcall 40,00100111b
red:
call drawwindow
call check_inv_all.skip_check
 
;-----------------------------------------------------------------------------
 
316,6 → 275,14
jmp still.skip_write
 
;-----------------------------------------------------------------------------
func red ;///// window redraw ////////////////////////////////////////////////
;-----------------------------------------------------------------------------
call drawwindow
call check_inv_all.skip_check
jmp still
endf
 
;-----------------------------------------------------------------------------
func start_fasm ;/////////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
; BL = run after compile
395,11 → 362,7
je @f
mov dword[edi-1],',run'
mov byte[edi+3],0
@@:
mov ebx, fasm_start
start_ret:
mov eax, 70
int 0x40
@@: mcall 19,fasm_filename,fasm_parameters
ret
endf
 
406,49 → 369,46
;-----------------------------------------------------------------------------
func open_debug_board ;///////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
mov ebx, board_start
jmp start_ret
mcall 19,debug_filename,0
ret
endf
 
;-----------------------------------------------------------------------------
func open_sysfuncs_txt ;//////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
mov ebx, docpak_start
call start_ret
mcall 19,docpak_filename,sysfuncs_param
cmp eax,0xfffffff0
jb @f
mov ebx, tinypad_start
mov dword [ebx+8], sysfuncs_filename
call start_ret
mcall 19,tinypad_filename,sysfuncs_filename
@@: ret
endf
 
;-----------------------------------------------------------------------------
;func layout ;///// change keyboard layout ///////////////////////////////////
func layout ;///// change keyboard layout ///////////////////////////////////
;-----------------------------------------------------------------------------
; mcall 19,setup,param_setup
; mcall 5,eax
;; call activate_me
;; ret
;;endf
 
;;func activate_me
; mcall 9,p_info,-1
; inc eax
; inc eax
; mov ecx,eax
; mov edi,[p_info.PID]
; mov ebx,p_info
; @@: dec ecx
; jz @f ; counter=0 => not found? => return
; mcall 9
; cmp edi,[p_info.PID]
; jne @b
; mcall 18,3
; mcall 5,eax
; @@: ret
mcall 19,setup,param_setup
mcall 5,eax
; call activate_me
; ret
;endf
 
;func activate_me
mcall 9,p_info,-1
inc eax
inc eax
mov ecx,eax
mov edi,[p_info.PID]
mov ebx,p_info
@@: dec ecx
jz @f ; counter=0 => not found? => return
mcall 9
cmp edi,[p_info.PID]
jne @b
mcall 18,3
mcall 5,eax
@@: ret
endf
 
func set_opt
test [options],al
je @f
493,16 → 453,16
 
include 'tp-draw.asm'
include 'tp-key.asm'
;include 'tp-key2.asm'
include 'tp-butto.asm'
include 'tp-mouse.asm'
include 'tp-files.asm'
include 'tp-commo.asm'
include 'tp-dialo.asm'
;include 'tp-find.asm'
include 'tp-popup.asm'
include 'tp-tbox.asm'
 
;include 'lib-ini.asm'
 
;-----------------------------------------------------------------------------
section @DATA ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;-----------------------------------------------------------------------------
633,42 → 593,15
 
;error_beep db 0xA0,0x30,0
 
s_status dd 0
 
sz s_example,'EXAMPLE.ASM'
sz s_still ,'still'
 
;sz param_setup,'LANG',0 ; parameter for SETUP
 
fasm_start:
dd 7
dd 0
dd fasm_parameters
dd 0
dd 0
db '/RD/1/FASM',0
board_start:
dd 7
dd 0
dd 0
dd 0
dd 0
db '/RD/1/BOARD',0
tinypad_start:
dd 7
dd 0
dd ?
dd 0
dd 0
db '/RD/1/TINYPAD',0
docpak_start:
dd 7
dd 0
dd sysfuncs_param
dd 0
dd 0
db '/RD/1/DOCPAK',0
 
sz fasm_filename ,'FASM '
sz debug_filename ,'BOARD '
sz tinypad_filename,'TINYPAD '
sz docpak_filename ,'DOCPAK '
;sz setup ,'SETUP ' ; to change keyboard layout
 
sz sysfuncs_param,'g',0
677,7 → 610,7
ru,<'SYSFUNCR.TXT',0>,\
en,<'SYSFUNCS.TXT',0>
 
sz htext,'TINYPAD 4.0.3'
sz htext,'TINYPAD'
 
lszc help_text,b,\
ru,'ŠŽŒ€„›:',\
729,19 → 662,19
en,'Options',popup_options,onshow.options
 
popup_res popup_file,\
ru,'®¢ë©' ,'Ctrl+N' ,key.ctrl_n ,\
ru,'Žâªàëâì...' ,'Ctrl+O' ,key.ctrl_o ,\
ru,'‘®åà ­¨âì' ,'Ctrl+S' ,key.ctrl_s ,\
ru,'‘®åà ­¨âì ª ª...','Ctrl+Shift+S',key.shift_ctrl_s,\
ru,'-' ,'' ,0 ,\
ru,'‚ë室' ,'Alt+X' ,key.alt_x ,\
ru,'®¢ë©' ,'Ctrl+N',key.ctrl_n ,\
ru,'Žâªàëâì...' ,'Ctrl+O',key.ctrl_o ,\
ru,'‘®åà ­¨âì' ,'Ctrl+S',key.ctrl_s ,\
ru,'‘®åà ­¨âì ª ª...','' ,key.shift_ctrl_s,\
ru,'-' ,'' ,0 ,\
ru,'‚ë室' ,'Alt+X' ,key.alt_x ,\
\
en,'New' ,'Ctrl+N' ,key.ctrl_n ,\
en,'Open...' ,'Ctrl+O' ,key.ctrl_o ,\
en,'Save' ,'Ctrl+S' ,key.ctrl_s ,\
en,'Save as...','Ctrl+Shift+S',key.shift_ctrl_s,\
en,'-' ,'' ,0 ,\
en,'Exit' ,'Alt+X' ,key.alt_x
en,'New' ,'Ctrl+N',key.ctrl_n ,\
en,'Open...' ,'Ctrl+O',key.ctrl_o ,\
en,'Save' ,'Ctrl+S',key.ctrl_s ,\
en,'Save as...','' ,key.shift_ctrl_s,\
en,'-' ,'' ,0 ,\
en,'Exit' ,'Alt+X' ,key.alt_x
 
popup_res popup_edit,\
ru,'‚ë१ âì' ,'Ctrl+X',key.ctrl_x,\
750,8 → 683,6
ru,'“¤ «¨âì' ,'' ,key.del ,\
ru,'-' ,'' ,0 ,\
ru,'‚뤥«¨âì ¢áñ','Ctrl+A',key.ctrl_a,\
\; ru,'-' ,'' ,0 ,\
\; ru,'‚¥à⨪ «ì­®¥ ¢ë¤¥«¥­¨¥','Alt+Ins',0 ,\
\
en,'Cut' ,'Ctrl+X',key.ctrl_x,\
en,'Copy' ,'Ctrl+C',key.ctrl_c,\
758,9 → 689,7
en,'Paste' ,'Ctrl+V',key.ctrl_v,\
en,'Delete' ,'' ,key.del ,\
en,'-' ,'' ,0 ,\
en,'Select all','Ctrl+A',key.ctrl_a;,\
; en,'-' ,'' ,0 ,\
; en,'Vertical selection','Alt+Ins',0
en,'Select all','Ctrl+A',key.ctrl_a
 
popup_res popup_search,\
ru,'¥à¥©â¨...' ,'Ctrl+G',key.ctrl_g,\
834,61 → 763,9
ru,'Žâ¬¥­ ',\
en,'Cancel'
 
lsz s_enter_filename,\
ru,<'‚¢¥¤¨â¥ ¨¬ï ä ©« ',0>,\
en,<'Enter filename',0>
 
lsz s_enter_text_to_find,\
ru,<'‚¢¥¤¨â¥ ⥪áâ ¤«ï ¯®¨áª ',0>,\
en,<'Enter text to find',0>
 
lsz s_enter_text_to_replace,\
ru,<'‚¢¥¤¨â¥ ⥪áâ ¤«ï § ¬¥­ë',0>,\
en,<'Enter text to replace',0>
 
lsz s_text_not_found,\
ru,<'„®á⨣­ãâ ª®­¥æ ä ©« , ⥪áâ ­¥ ­ ©¤¥­',0>,\
en,<'Reached end of file, text not found',0>
 
lszc s_fs_error,b,\
ru,<'Ž¯¥à æ¨ï § ¢¥à襭  ãᯥ譮 (0)',0>,\
ru,<'',0>,\
ru,<'”ã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥âáï ¤«ï ¤ ­­®© ä ©«®¢®© á¨á⥬ë (2)',0>,\
ru,<'¥¨§¢¥áâ­ ï ä ©«®¢ ï á¨á⥬  (3)',0>,\
ru,<'',0>,\
ru,<'¥¢®§¬®¦­® ®âªàëâì ä ©« (5)',0>,\
ru,<'Ž¯¥à æ¨ï § ¢¥à襭  ãᯥ譮 (6)',0>,\
ru,<'€¤à¥á ­ å®¤¨âáï §  £à ­¨æ ¬¨ ¯ ¬ï⨠¯à®£à ¬¬ë (7)',0>,\
ru,<'  ¤¨áª¥ ­¥â ᢮¡®¤­®£® ¬¥áâ  (8)',0>,\
ru,<'’ ¡«¨æ  FAT ã­¨ç⮦¥­  (9)',0>,\
ru,<'„®áâ㯠§ ¯à¥éñ­ (10)',0>,\
ru,<'Žè¨¡ª  ãáâனá⢠ (11)',0>,\
\
en,<'Operation executed successfully (0)',0>,\
en,<'',0>,\
en,<'Function is not supported for the given filesystem (2)',0>,\
en,<'Unknown filesystem (3)',0>,\
en,<'',0>,\
en,<'Unable to open file (5)',0>,\
en,<'Operation executed successfully (6)',0>,\
en,<'Pointer lies outside of application memory (7)',0>,\
en,<'Disk is full (8)',0>,\
en,<'FAT table is destroyed (9)',0>,\
en,<'Access denied (10)',0>,\
en,<'Device error (11)',0>
 
sz symbols_ex,';?.%"',"'"
sz symbols ,'#&*\:/<>|{}()[]=+-, '
 
ini_sec_window db 'Window',0
ini_window_top db 'Top',0
ini_window_left db 'Left',0
ini_window_right db 'Right',0
ini_window_bottom db 'Bottom',0
 
finfo_ini dd ?,?,?,AREA_TEMP,AREA_EDIT-AREA_TEMP
db '/rd/1/tinypad.ini',0
 
TINYPAD_END: ; end of file
 
self_path rb PATHL
897,8 → 774,6
section @UDATA ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;-----------------------------------------------------------------------------
 
f_info70 rd 7
 
f_info.length dd ?
f_info dd ?,?,?,?,?;?,0,?,AREA_TEMP,AREA_EDIT-AREA_TEMP
 
923,7 → 798,7
vscrl_size dd ?
hscrl_top dd ?
hscrl_size dd ?
;skinh dd ? ; skin height
skinh dd ? ; skin height
__rc dd ?,?,?,?
;filelen dd ? ; file size (on save) ???
filesize dd ? ; file size (on load) ???
/programs/develop/tinypad/trunk/build_en.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix en >lang.inc
@fasm tinypad.asm tinypad
@erase lang.inc
@pause
/programs/develop/tinypad/trunk/build_ru.bat
1,5 → 1,4
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm tinypad.asm tinypad
@erase lang.inc
@pause