2006-08-14 14:50:43 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-01-03 10:43:31 +01:00
|
|
|
|
; project name: TINYPAD
|
2007-09-18 02:41:58 +02:00
|
|
|
|
; compiler: flat assembler 1.67.21
|
2007-01-28 00:36:07 +01:00
|
|
|
|
; memory to compile: 3.0/9.0 MBytes (without/with size optimizations)
|
2008-07-18 06:52:49 +02:00
|
|
|
|
; version: SVN (4.0.5)
|
|
|
|
|
; last update: 2008-07-18 (Jul 18, 2008)
|
|
|
|
|
; minimal kernel: revision #823 (svn://kolibrios.org/kernel/trunk)
|
2006-08-14 14:50:43 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
; originally by: Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi
|
2006-12-30 18:44:05 +01:00
|
|
|
|
; maintained by: Mike Semenyako >> mike.dld@gmail.com
|
|
|
|
|
; Ivan Poddubny >> ivan-yar@bk.ru
|
2006-08-14 14:50:43 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2007-01-28 00:36:07 +01:00
|
|
|
|
; TODO (4.1.0):
|
2007-09-01 23:38:00 +02:00
|
|
|
|
; - add vertical selection, undo, goto position, overwrite mode, smart tabulation
|
2006-10-11 22:40:53 +02:00
|
|
|
|
; - improve window drawing with small dimensions
|
2007-09-01 23:38:00 +02:00
|
|
|
|
; - save/load settings to/from ini file, not executable
|
|
|
|
|
; - path autocompletion for open/save dialogs
|
2007-01-28 00:36:07 +01:00
|
|
|
|
; - other bug-fixes and speed/size optimizations
|
2007-09-01 23:38:00 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
; See history.txt for complete changelog
|
2006-08-14 14:50:43 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
|
2006-10-11 22:40:53 +02:00
|
|
|
|
include 'lang.inc'
|
2007-09-01 23:38:00 +02:00
|
|
|
|
|
2010-11-15 19:47:23 +01:00
|
|
|
|
include '../../../config.inc' ;for nightbuild
|
|
|
|
|
include '../../../macros.inc' ; useful stuff
|
2007-09-01 23:38:00 +02:00
|
|
|
|
include '../../../struct.inc'
|
|
|
|
|
include '../../../proc32.inc'
|
|
|
|
|
|
|
|
|
|
include 'external/libio.inc'
|
|
|
|
|
|
2006-08-14 14:50:43 +02:00
|
|
|
|
include 'tinypad.inc'
|
2007-09-01 23:38:00 +02:00
|
|
|
|
|
2007-01-28 00:36:07 +01:00
|
|
|
|
;purge mov,add,sub ; SPEED
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2008-12-29 20:08:59 +01:00
|
|
|
|
header '01',1,@CODE,TINYPAD_END,STATIC_MEM_END,MAIN_STACK,@PARAMS,ini_path
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2010-09-25 21:21:10 +02:00
|
|
|
|
APP_VERSION equ 'SVN (4.0.6)'
|
2006-12-30 18:44:05 +01:00
|
|
|
|
|
2007-09-01 23:38:00 +02:00
|
|
|
|
TRUE = 1
|
|
|
|
|
FALSE = 0
|
|
|
|
|
|
2006-08-14 14:50:43 +02:00
|
|
|
|
;include 'debug.inc'
|
2007-01-18 22:14:15 +01:00
|
|
|
|
;define __DEBUG__ 1
|
|
|
|
|
;define __DEBUG_LEVEL__ 1
|
|
|
|
|
;include 'debug-fdo.inc'
|
|
|
|
|
|
2008-12-29 20:08:59 +01:00
|
|
|
|
; compiled-in options
|
|
|
|
|
|
2007-01-18 22:14:15 +01:00
|
|
|
|
ASEPC = '-' ; separator character (char)
|
|
|
|
|
ATOPH = 19 ; menu bar height (pixels)
|
|
|
|
|
SCRLW = 16 ; scrollbar widht/height (pixels)
|
|
|
|
|
ATABW = 8 ; tab key indent width (chars)
|
|
|
|
|
LINEH = 10 ; line height (pixels)
|
|
|
|
|
PATHL = 256 ; maximum path length (chars) !!! don't change !!!
|
|
|
|
|
AMINS = 8 ; minimal scroll thumb size (pixels)
|
|
|
|
|
LCHGW = 3 ; changed/saved marker width (pixels)
|
|
|
|
|
|
|
|
|
|
STATH = 16 ; status bar height (pixels)
|
|
|
|
|
TBARH = 18 ; tab bar height (pixels)
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2008-12-29 20:08:59 +01:00
|
|
|
|
INI_SEC_PREFIX equ ''
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-08-14 14:50:43 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
section @CODE ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2013-02-27 07:56:31 +01:00
|
|
|
|
mcall 9,p_info2,-1
|
2013-02-24 02:24:48 +01:00
|
|
|
|
mov ecx,[ebx+30] ; PID
|
|
|
|
|
mcall 18,21
|
|
|
|
|
mov [active_process],eax ; WINDOW SLOT
|
|
|
|
|
|
2006-12-30 18:44:05 +01:00
|
|
|
|
cld
|
|
|
|
|
mov edi,@UDATA
|
|
|
|
|
mov ecx,@PARAMS-@UDATA
|
|
|
|
|
mov al,0
|
|
|
|
|
rep stosb
|
2006-08-14 14:50:43 +02:00
|
|
|
|
|
2007-01-03 19:22:05 +01:00
|
|
|
|
mcall 68,11
|
|
|
|
|
or eax,eax
|
|
|
|
|
jz key.alt_x.close
|
|
|
|
|
|
2007-09-01 23:38:00 +02:00
|
|
|
|
stdcall dll.Load,@IMPORT
|
|
|
|
|
or eax,eax
|
|
|
|
|
jnz key.alt_x.close
|
|
|
|
|
|
2008-12-29 20:08:59 +01:00
|
|
|
|
mov edi,ini_path
|
|
|
|
|
xor al,al
|
|
|
|
|
mov ecx,PATHL
|
|
|
|
|
repne scasb
|
|
|
|
|
mov dword[edi-1],'.ini'
|
|
|
|
|
mov byte[edi+3],0
|
|
|
|
|
|
|
|
|
|
stdcall load_settings
|
|
|
|
|
|
2007-09-01 23:38:00 +02:00
|
|
|
|
stdcall mem.Alloc,65536
|
2007-01-03 19:22:05 +01:00
|
|
|
|
mov [temp_buf],eax
|
|
|
|
|
|
2006-10-11 22:40:53 +02:00
|
|
|
|
inc [do_not_draw]
|
|
|
|
|
|
2007-01-28 00:36:07 +01:00
|
|
|
|
mov dword[app_start],7
|
|
|
|
|
|
2006-12-30 18:44:05 +01:00
|
|
|
|
mov esi,s_example
|
|
|
|
|
mov edi,tb_opensave.text
|
|
|
|
|
mov ecx,s_example.size
|
|
|
|
|
mov [tb_opensave.length],cl
|
|
|
|
|
rep movsb
|
2006-08-14 14:50:43 +02:00
|
|
|
|
|
2006-12-30 18:44:05 +01:00
|
|
|
|
mov esi,s_still
|
|
|
|
|
mov edi,s_search
|
|
|
|
|
mov ecx,s_still.size
|
|
|
|
|
mov [s_search.size],ecx
|
|
|
|
|
rep movsb
|
2006-08-14 14:50:43 +02:00
|
|
|
|
|
2006-12-30 18:44:05 +01:00
|
|
|
|
cmp byte[@PARAMS],0
|
|
|
|
|
jz no_params
|
2006-08-14 14:50:43 +02:00
|
|
|
|
|
|
|
|
|
;// Willow's code to support DOCPAK [
|
|
|
|
|
|
2006-12-30 18:44:05 +01:00
|
|
|
|
cmp byte[@PARAMS],'*'
|
|
|
|
|
jne .noipc
|
2006-10-11 22:40:53 +02:00
|
|
|
|
|
|
|
|
|
;// diamond [ (convert size from decimal representation to dword)
|
|
|
|
|
;-- mov edx,dword[@PARAMS+1]
|
2006-12-30 18:44:05 +01:00
|
|
|
|
mov esi,@PARAMS+1
|
|
|
|
|
xor edx,edx
|
|
|
|
|
xor eax,eax
|
2006-10-11 22:40:53 +02:00
|
|
|
|
@@: lodsb
|
2006-12-30 18:44:05 +01:00
|
|
|
|
test al,al
|
|
|
|
|
jz @f
|
|
|
|
|
lea edx,[edx*4+edx]
|
|
|
|
|
lea edx,[edx*2+eax-'0']
|
|
|
|
|
jmp @b
|
2006-10-11 22:40:53 +02:00
|
|
|
|
@@:
|
|
|
|
|
;// diamond ]
|
|
|
|
|
|
2006-12-30 18:44:05 +01:00
|
|
|
|
add edx,20
|
2007-01-03 19:22:05 +01:00
|
|
|
|
|
2007-09-01 23:38:00 +02:00
|
|
|
|
stdcall mem.Alloc,edx
|
2007-01-03 19:22:05 +01:00
|
|
|
|
mov ebp,eax
|
2007-01-18 22:14:15 +01:00
|
|
|
|
push eax
|
|
|
|
|
|
|
|
|
|
mov dword[ebp+0],0
|
2007-01-03 19:22:05 +01:00
|
|
|
|
mov dword[ebp+4],8
|
2007-01-18 22:14:15 +01:00
|
|
|
|
mcall 60,1,ebp
|
2006-12-30 18:44:05 +01:00
|
|
|
|
mcall 40,1000000b
|
2007-01-18 22:14:15 +01:00
|
|
|
|
|
2006-12-30 18:44:05 +01:00
|
|
|
|
mcall 23,200
|
2007-01-18 22:14:15 +01:00
|
|
|
|
|
2006-12-30 18:44:05 +01:00
|
|
|
|
cmp eax,7
|
2007-01-03 19:22:05 +01:00
|
|
|
|
jne key.alt_x.close
|
|
|
|
|
mov byte[ebp],1
|
2007-01-18 22:14:15 +01:00
|
|
|
|
|
2007-01-03 19:22:05 +01:00
|
|
|
|
mov ecx,[ebp+12]
|
2007-01-18 22:14:15 +01:00
|
|
|
|
lea esi,[ebp+16]
|
2007-01-03 19:22:05 +01:00
|
|
|
|
call create_tab
|
|
|
|
|
call load_from_memory
|
|
|
|
|
|
2007-01-18 22:14:15 +01:00
|
|
|
|
pop ebp
|
2007-09-01 23:38:00 +02:00
|
|
|
|
stdcall mem.Free,ebp
|
2007-01-03 19:22:05 +01:00
|
|
|
|
|
2006-12-30 18:44:05 +01:00
|
|
|
|
jmp @f
|
2006-08-14 14:50:43 +02:00
|
|
|
|
.noipc:
|
|
|
|
|
|
|
|
|
|
;// Willow's code to support DOCPAK ]
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-12-30 18:44:05 +01:00
|
|
|
|
mov esi,@PARAMS
|
|
|
|
|
mov edi,tb_opensave.text
|
|
|
|
|
mov ecx,PATHL
|
|
|
|
|
rep movsb
|
|
|
|
|
mov edi,tb_opensave.text
|
|
|
|
|
mov ecx,PATHL
|
|
|
|
|
xor al,al
|
|
|
|
|
repne scasb
|
|
|
|
|
jne key.alt_x.close
|
|
|
|
|
lea eax,[edi-tb_opensave.text-1]
|
|
|
|
|
mov [tb_opensave.length],al
|
2007-01-28 00:36:07 +01:00
|
|
|
|
call load_file
|
2007-01-18 22:14:15 +01:00
|
|
|
|
jnc @f
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-08-14 14:50:43 +02:00
|
|
|
|
no_params:
|
2007-01-03 19:22:05 +01:00
|
|
|
|
call create_tab
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
@@:
|
2007-01-18 22:14:15 +01:00
|
|
|
|
mov [s_status],0
|
2006-10-11 22:40:53 +02:00
|
|
|
|
dec [do_not_draw]
|
2008-12-29 20:08:59 +01:00
|
|
|
|
|
|
|
|
|
mov al,[tabs_pos]
|
|
|
|
|
mov [tab_bar.Style],al
|
|
|
|
|
|
2010-09-25 21:21:10 +02:00
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
mov edi,filename_area
|
|
|
|
|
mov esi,s_example+5
|
|
|
|
|
call copy_str_1
|
|
|
|
|
|
|
|
|
|
mov esi,tb_opensave.text
|
|
|
|
|
mov edi,fname_Info
|
|
|
|
|
call copy_str_1
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov [edi],al
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
;OpenDialog initialisation
|
|
|
|
|
push dword OpenDialog_data
|
|
|
|
|
call [OpenDialog_Init]
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
2006-12-30 18:44:05 +01:00
|
|
|
|
mcall 66,1,1
|
|
|
|
|
mcall 40,00100111b
|
2006-10-11 22:40:53 +02:00
|
|
|
|
red:
|
2006-12-30 18:44:05 +01:00
|
|
|
|
call drawwindow
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-08-14 14:50:43 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-08-14 14:50:43 +02:00
|
|
|
|
still:
|
2007-01-28 00:36:07 +01:00
|
|
|
|
call draw_statusbar ; write current position & number of strings
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-08-14 14:50:43 +02:00
|
|
|
|
.skip_write:
|
2010-09-25 21:21:10 +02:00
|
|
|
|
cmp [open_dialog],1
|
|
|
|
|
je .open_dialog
|
2007-01-28 00:36:07 +01:00
|
|
|
|
mcall 10 ; wait here until event
|
2013-02-24 02:24:48 +01:00
|
|
|
|
|
|
|
|
|
call check_active_process_for_clear_all_flags
|
|
|
|
|
|
2006-12-30 18:44:05 +01:00
|
|
|
|
cmp [main_closed],0
|
|
|
|
|
jne key.alt_x
|
|
|
|
|
dec eax ; redraw ?
|
|
|
|
|
jz red
|
|
|
|
|
dec eax ; key ?
|
|
|
|
|
jz key
|
|
|
|
|
dec eax ; button ?
|
|
|
|
|
jz button
|
|
|
|
|
sub eax,3 ; mouse ?
|
|
|
|
|
jz mouse
|
|
|
|
|
|
|
|
|
|
jmp still.skip_write
|
2010-09-25 21:21:10 +02:00
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
.open_dialog:
|
|
|
|
|
pusha
|
|
|
|
|
|
|
|
|
|
call btn.bot.cancel
|
|
|
|
|
|
|
|
|
|
mov esi,tb_opensave.text
|
|
|
|
|
mov edi,[OpenDialog_data.openfile_pach]
|
|
|
|
|
movzx ecx,[tb_opensave.length]
|
|
|
|
|
mov edx,[OpenDialog_data.filename_area]
|
|
|
|
|
mov ebx,[OpenDialog_data.opendir_pach]
|
|
|
|
|
call copy_str_2
|
|
|
|
|
movzx eax,byte [bot_mode2]
|
|
|
|
|
mov [OpenDialog_data.type],eax
|
|
|
|
|
popa
|
|
|
|
|
; invoke OpenDialog
|
|
|
|
|
push dword OpenDialog_data
|
|
|
|
|
call [OpenDialog_Start]
|
|
|
|
|
|
|
|
|
|
cmp [OpenDialog_data.status],1
|
|
|
|
|
jne .3
|
|
|
|
|
|
|
|
|
|
pusha
|
|
|
|
|
mov edi,tb_opensave.text
|
|
|
|
|
mov esi,[OpenDialog_data.openfile_pach]
|
|
|
|
|
call copy_str_1
|
|
|
|
|
sub edi,tb_opensave.text
|
|
|
|
|
dec edi
|
|
|
|
|
mov eax,edi
|
|
|
|
|
mov [tb_opensave.length],al
|
|
|
|
|
popa
|
|
|
|
|
|
|
|
|
|
cmp [bot_mode2],0
|
|
|
|
|
je .2
|
|
|
|
|
call save_file
|
|
|
|
|
jmp .3
|
|
|
|
|
.2:
|
|
|
|
|
call load_file
|
|
|
|
|
.3:
|
|
|
|
|
mov [open_dialog],0
|
|
|
|
|
jmp red
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
draw_window_for_OD:
|
|
|
|
|
call drawwindow
|
|
|
|
|
call draw_statusbar
|
|
|
|
|
ret
|
|
|
|
|
;-----------------------------------------------------------------------------
|
2013-02-24 02:24:48 +01:00
|
|
|
|
check_active_process_for_clear_all_flags:
|
|
|
|
|
push eax
|
|
|
|
|
mcall 18,7
|
|
|
|
|
cmp [active_process],eax
|
|
|
|
|
je .exit
|
|
|
|
|
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov [win_key_flag],al
|
|
|
|
|
;--------------------------------------
|
|
|
|
|
.exit:
|
|
|
|
|
pop eax
|
|
|
|
|
ret
|
|
|
|
|
;-----------------------------------------------------------------------------
|
2010-09-25 21:21:10 +02:00
|
|
|
|
copy_str_2:
|
|
|
|
|
cld
|
|
|
|
|
push esi ecx
|
|
|
|
|
rep movsb ; edi openfile_pach
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov [edi],al
|
|
|
|
|
pop ecx esi
|
|
|
|
|
mov edi,ebx
|
|
|
|
|
rep movsb ; edi opendir_pach
|
|
|
|
|
mov [edi],al
|
|
|
|
|
mov esi,edi
|
|
|
|
|
std
|
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
|
|
|
|
cmp al,byte '/'
|
|
|
|
|
jne @b
|
|
|
|
|
inc esi
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov [esi],al
|
|
|
|
|
inc esi
|
|
|
|
|
mov edi,edx ; edi filename_area
|
|
|
|
|
call copy_str_1
|
|
|
|
|
ret
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
copy_str_1:
|
|
|
|
|
xor eax,eax
|
|
|
|
|
cld
|
|
|
|
|
@@:
|
|
|
|
|
lodsb
|
|
|
|
|
stosb
|
|
|
|
|
test eax,eax
|
|
|
|
|
jnz @b
|
|
|
|
|
ret
|
2006-08-14 14:50:43 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2007-09-01 23:38:00 +02:00
|
|
|
|
proc get_event ctx ;//////////////////////////////////////////////////////////
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
mcall 10
|
|
|
|
|
dec eax ; redraw ?
|
|
|
|
|
jz .redraw
|
|
|
|
|
dec eax ; key ?
|
|
|
|
|
jz .key
|
|
|
|
|
dec eax ; button ?
|
|
|
|
|
jz .button
|
|
|
|
|
sub eax,2 ; background ?
|
|
|
|
|
jz .background
|
|
|
|
|
dec eax ; mouse ?
|
|
|
|
|
jz .mouse
|
|
|
|
|
dec eax ; ipc ?
|
|
|
|
|
jz .ipc
|
|
|
|
|
dec eax ; network ?
|
|
|
|
|
jz .network
|
|
|
|
|
dec eax ; debug ?
|
|
|
|
|
jz .debug
|
|
|
|
|
sub eax,7 ; irq ?
|
|
|
|
|
js .nothing
|
|
|
|
|
cmp eax,15
|
|
|
|
|
jg .nothing
|
|
|
|
|
jmp .irq
|
|
|
|
|
|
|
|
|
|
.nothing:
|
|
|
|
|
mov eax,EV_IDLE
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.redraw:
|
|
|
|
|
mov eax,EV_REDRAW
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.key:
|
|
|
|
|
mov eax,EV_KEY
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.button:
|
|
|
|
|
mov eax,EV_BUTTON
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.background:
|
|
|
|
|
mov eax,EV_BACKGROUND
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.mouse:
|
|
|
|
|
mov eax,EV_MOUSE
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.ipc:
|
|
|
|
|
mov eax,EV_IPC
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.network:
|
|
|
|
|
mov eax,EV_NETWORK
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.debug:
|
|
|
|
|
mov eax,EV_DEBUG
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
2008-12-29 20:08:59 +01:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
proc load_settings ;//////////////////////////////////////////////////////////
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
pushad
|
|
|
|
|
|
|
|
|
|
invoke ini.get_int,ini_path,ini_sec_options,ini_options_tabs_pos,2
|
|
|
|
|
mov [tabs_pos],al
|
|
|
|
|
invoke ini.get_int,ini_path,ini_sec_options,ini_options_secure_sel,0
|
|
|
|
|
mov [secure_sel],al
|
|
|
|
|
invoke ini.get_int,ini_path,ini_sec_options,ini_options_auto_braces,0
|
|
|
|
|
mov [auto_braces],al
|
|
|
|
|
invoke ini.get_int,ini_path,ini_sec_options,ini_options_auto_indent,1
|
|
|
|
|
mov [auto_indent],al
|
|
|
|
|
invoke ini.get_int,ini_path,ini_sec_options,ini_options_smart_tab,1
|
|
|
|
|
mov [smart_tab],al
|
|
|
|
|
invoke ini.get_int,ini_path,ini_sec_options,ini_options_optim_save,1
|
|
|
|
|
mov [optim_save],al
|
|
|
|
|
invoke ini.get_int,ini_path,ini_sec_options,ini_options_line_nums,0
|
|
|
|
|
mov [line_nums],al
|
|
|
|
|
|
|
|
|
|
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_text,0x00000000
|
|
|
|
|
mov [color_tbl.text],eax
|
|
|
|
|
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_back,0x00ffffff
|
|
|
|
|
mov [color_tbl.back],eax
|
|
|
|
|
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_text_sel,0x00ffffff
|
|
|
|
|
mov [color_tbl.text.sel],eax
|
|
|
|
|
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_back_sel,0x000a246a
|
|
|
|
|
mov [color_tbl.back.sel],eax
|
|
|
|
|
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_symbol,0x003030f0
|
|
|
|
|
mov [color_tbl.symbol],eax
|
|
|
|
|
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_number,0x00009000
|
|
|
|
|
mov [color_tbl.number],eax
|
|
|
|
|
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_string,0x00b00000
|
|
|
|
|
mov [color_tbl.string],eax
|
|
|
|
|
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_comment,0x00808080
|
|
|
|
|
mov [color_tbl.comment],eax
|
|
|
|
|
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_line_moded,0x00ffee62
|
|
|
|
|
mov [color_tbl.line.moded],eax
|
|
|
|
|
invoke ini.get_color,ini_path,ini_sec_colors,ini_colors_line_saved,0x006ce26c
|
|
|
|
|
mov [color_tbl.line.saved],eax
|
|
|
|
|
|
|
|
|
|
invoke ini.get_int,ini_path,ini_sec_window,ini_window_left,250
|
|
|
|
|
mov [mainwnd_pos.x],eax
|
|
|
|
|
invoke ini.get_int,ini_path,ini_sec_window,ini_window_top,75
|
|
|
|
|
mov [mainwnd_pos.y],eax
|
|
|
|
|
invoke ini.get_int,ini_path,ini_sec_window,ini_window_width,6*80+6+SCRLW+5
|
|
|
|
|
mov [mainwnd_pos.w],eax
|
|
|
|
|
invoke ini.get_int,ini_path,ini_sec_window,ini_window_height,402
|
|
|
|
|
mov [mainwnd_pos.h],eax
|
|
|
|
|
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
proc save_settings ;//////////////////////////////////////////////////////////
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
pushad
|
|
|
|
|
|
|
|
|
|
movzx eax,[tabs_pos]
|
|
|
|
|
invoke ini.set_int,ini_path,ini_sec_options,ini_options_tabs_pos,eax
|
|
|
|
|
movzx eax,[secure_sel]
|
|
|
|
|
invoke ini.set_int,ini_path,ini_sec_options,ini_options_secure_sel,eax
|
|
|
|
|
movzx eax,[auto_braces]
|
|
|
|
|
invoke ini.set_int,ini_path,ini_sec_options,ini_options_auto_braces,eax
|
|
|
|
|
movzx eax,[auto_indent]
|
|
|
|
|
invoke ini.set_int,ini_path,ini_sec_options,ini_options_auto_indent,eax
|
|
|
|
|
movzx eax,[smart_tab]
|
|
|
|
|
invoke ini.set_int,ini_path,ini_sec_options,ini_options_smart_tab,eax
|
|
|
|
|
movzx eax,[optim_save]
|
|
|
|
|
invoke ini.set_int,ini_path,ini_sec_options,ini_options_optim_save,eax
|
|
|
|
|
movzx eax,[line_nums]
|
|
|
|
|
invoke ini.set_int,ini_path,ini_sec_options,ini_options_line_nums,eax
|
|
|
|
|
|
|
|
|
|
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_text,[color_tbl.text]
|
|
|
|
|
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_back,[color_tbl.back]
|
|
|
|
|
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_text_sel,[color_tbl.text.sel]
|
|
|
|
|
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_back_sel,[color_tbl.back.sel]
|
|
|
|
|
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_symbol,[color_tbl.symbol]
|
|
|
|
|
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_number,[color_tbl.number]
|
|
|
|
|
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_string,[color_tbl.string]
|
|
|
|
|
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_comment,[color_tbl.comment]
|
|
|
|
|
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_line_moded,[color_tbl.line.moded]
|
|
|
|
|
invoke ini.set_color,ini_path,ini_sec_colors,ini_colors_line_saved,[color_tbl.line.saved]
|
|
|
|
|
|
|
|
|
|
invoke ini.set_int,ini_path,ini_sec_window,ini_window_left,[mainwnd_pos.x]
|
|
|
|
|
invoke ini.set_int,ini_path,ini_sec_window,ini_window_top,[mainwnd_pos.y]
|
|
|
|
|
invoke ini.set_int,ini_path,ini_sec_window,ini_window_width,[mainwnd_pos.w]
|
|
|
|
|
invoke ini.set_int,ini_path,ini_sec_window,ini_window_height,[mainwnd_pos.h]
|
|
|
|
|
|
|
|
|
|
popad
|
|
|
|
|
ret
|
|
|
|
|
endp
|
|
|
|
|
|
2007-09-01 23:38:00 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
proc start_fasm ;/////////////////////////////////////////////////////////////
|
2006-08-14 14:50:43 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-01-03 10:43:31 +01:00
|
|
|
|
; BL = run after compile
|
2006-08-14 14:50:43 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2007-01-28 00:36:07 +01:00
|
|
|
|
; FASM infile,outfile,/path/to/files[,run]
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
cmp [cur_editor.AsmMode],0
|
2006-12-30 18:44:05 +01:00
|
|
|
|
jne @f
|
|
|
|
|
ret
|
2007-01-28 00:36:07 +01:00
|
|
|
|
@@:
|
|
|
|
|
mov eax,[tab_bar.Default.Ptr]
|
|
|
|
|
or eax,eax
|
|
|
|
|
jnz @f
|
|
|
|
|
mov eax,[tab_bar.Current.Ptr]
|
|
|
|
|
@@: cmp byte[eax+TABITEM.Editor.FilePath],'/'
|
|
|
|
|
je @f
|
|
|
|
|
ret
|
|
|
|
|
@@:
|
2006-12-30 18:44:05 +01:00
|
|
|
|
mov edi,fasm_parameters
|
2007-01-28 00:36:07 +01:00
|
|
|
|
push eax
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2007-01-28 00:36:07 +01:00
|
|
|
|
cld
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2007-01-28 00:36:07 +01:00
|
|
|
|
lea esi,[eax+TABITEM.Editor.FilePath]
|
|
|
|
|
add esi,[eax+TABITEM.Editor.FileName]
|
|
|
|
|
push esi esi
|
|
|
|
|
@@: lodsb
|
|
|
|
|
cmp al,0
|
2006-12-30 18:44:05 +01:00
|
|
|
|
je @f
|
2007-01-28 00:36:07 +01:00
|
|
|
|
stosb
|
|
|
|
|
cmp al,'.'
|
|
|
|
|
jne @b
|
|
|
|
|
mov ecx,esi
|
2006-12-30 18:44:05 +01:00
|
|
|
|
jmp @b
|
2007-01-28 00:36:07 +01:00
|
|
|
|
@@:
|
2006-12-30 18:44:05 +01:00
|
|
|
|
mov al,','
|
|
|
|
|
stosb
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2007-01-28 00:36:07 +01:00
|
|
|
|
pop esi
|
|
|
|
|
sub ecx,esi
|
|
|
|
|
dec ecx
|
|
|
|
|
jz @f
|
2006-12-30 18:44:05 +01:00
|
|
|
|
rep movsb
|
2007-01-28 00:36:07 +01:00
|
|
|
|
@@:
|
2006-12-30 18:44:05 +01:00
|
|
|
|
mov al,','
|
|
|
|
|
stosb
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2007-01-28 00:36:07 +01:00
|
|
|
|
pop ecx esi
|
|
|
|
|
add esi,TABITEM.Editor.FilePath
|
|
|
|
|
sub ecx,esi
|
2006-12-30 18:44:05 +01:00
|
|
|
|
rep movsb
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-12-30 18:44:05 +01:00
|
|
|
|
cmp bl,0 ; run outfile ?
|
|
|
|
|
je @f
|
2007-01-28 00:36:07 +01:00
|
|
|
|
mov dword[edi],',run'
|
|
|
|
|
add edi,4
|
2006-10-11 22:40:53 +02:00
|
|
|
|
@@:
|
2007-01-28 00:36:07 +01:00
|
|
|
|
mov al,0
|
|
|
|
|
stosb
|
|
|
|
|
|
|
|
|
|
mov [app_start.filename],app_fasm
|
|
|
|
|
mov [app_start.params],fasm_parameters
|
2006-10-11 22:40:53 +02:00
|
|
|
|
start_ret:
|
2007-01-28 00:36:07 +01:00
|
|
|
|
mcall 70,app_start
|
2006-12-30 18:44:05 +01:00
|
|
|
|
ret
|
2007-09-01 23:38:00 +02:00
|
|
|
|
endp
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-08-14 14:50:43 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2007-09-01 23:38:00 +02:00
|
|
|
|
proc open_debug_board ;///////////////////////////////////////////////////////
|
2006-08-14 14:50:43 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2007-01-28 00:36:07 +01:00
|
|
|
|
mov [app_start.filename],app_board
|
|
|
|
|
mov [app_start.params],0
|
2006-12-30 18:44:05 +01:00
|
|
|
|
jmp start_ret
|
2007-09-01 23:38:00 +02:00
|
|
|
|
endp
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-08-14 14:50:43 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2007-09-01 23:38:00 +02:00
|
|
|
|
proc open_sysfuncs_txt ;//////////////////////////////////////////////////////
|
2006-08-14 14:50:43 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2007-01-28 00:36:07 +01:00
|
|
|
|
mov [app_start.filename],app_docpak
|
|
|
|
|
mov [app_start.params],sysfuncs_param
|
2006-12-30 18:44:05 +01:00
|
|
|
|
call start_ret
|
|
|
|
|
cmp eax,0xfffffff0
|
|
|
|
|
jb @f
|
2007-01-28 00:36:07 +01:00
|
|
|
|
mov [app_start.filename],app_tinypad
|
|
|
|
|
mov [app_start.params],sysfuncs_filename
|
2006-12-30 18:44:05 +01:00
|
|
|
|
call start_ret
|
2006-08-14 14:50:43 +02:00
|
|
|
|
@@: ret
|
2007-09-01 23:38:00 +02:00
|
|
|
|
endp
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2007-01-03 19:22:05 +01:00
|
|
|
|
set_opt:
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2007-01-28 00:36:07 +01:00
|
|
|
|
.dialog:
|
|
|
|
|
mov [bot_mode],1
|
|
|
|
|
mov [bot_dlg_height],128
|
|
|
|
|
mov [bot_dlg_handler],optsdlg_handler
|
|
|
|
|
mov [focused_tb],tb_color
|
|
|
|
|
mov al,[tb_color.length]
|
|
|
|
|
mov [tb_color.pos.x],al
|
|
|
|
|
mov [tb_color.sel.x],0
|
|
|
|
|
mov [tb_casesen],1
|
|
|
|
|
mov [cur_part],0
|
|
|
|
|
m2m [cur_color],dword[color_tbl.text]
|
|
|
|
|
mov esi,color_tbl
|
|
|
|
|
mov edi,cur_colors
|
|
|
|
|
mov ecx,10
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
|
|
|
|
call drawwindow
|
|
|
|
|
ret
|
|
|
|
|
|
2007-01-03 19:22:05 +01:00
|
|
|
|
.line_numbers:
|
2008-12-29 20:08:59 +01:00
|
|
|
|
xor [line_nums],1
|
|
|
|
|
ret
|
2007-01-03 19:22:05 +01:00
|
|
|
|
.optimal_fill:
|
2008-12-29 20:08:59 +01:00
|
|
|
|
xor [optim_save],1
|
|
|
|
|
ret
|
2007-01-03 19:22:05 +01:00
|
|
|
|
.auto_indents:
|
2008-12-29 20:08:59 +01:00
|
|
|
|
xor [auto_indent],1
|
|
|
|
|
ret
|
2007-01-03 19:22:05 +01:00
|
|
|
|
.auto_braces:
|
2008-12-29 20:08:59 +01:00
|
|
|
|
xor [auto_braces],1
|
|
|
|
|
ret
|
2007-01-03 19:22:05 +01:00
|
|
|
|
.secure_sel:
|
2008-12-29 20:08:59 +01:00
|
|
|
|
xor [secure_sel],1
|
2006-12-30 18:44:05 +01:00
|
|
|
|
ret
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
|
2007-09-01 23:38:00 +02:00
|
|
|
|
include 'data/tp-defines.inc'
|
2007-01-03 19:22:05 +01:00
|
|
|
|
|
2006-08-14 14:50:43 +02:00
|
|
|
|
include 'tp-draw.asm'
|
|
|
|
|
include 'tp-key.asm'
|
2006-12-30 18:44:05 +01:00
|
|
|
|
include 'tp-button.asm'
|
2006-08-14 14:50:43 +02:00
|
|
|
|
include 'tp-mouse.asm'
|
|
|
|
|
include 'tp-files.asm'
|
2006-12-30 18:44:05 +01:00
|
|
|
|
include 'tp-common.asm'
|
|
|
|
|
include 'tp-dialog.asm'
|
2006-08-14 14:50:43 +02:00
|
|
|
|
include 'tp-popup.asm'
|
|
|
|
|
include 'tp-tbox.asm'
|
2007-01-03 19:22:05 +01:00
|
|
|
|
include 'tp-tabctl.asm'
|
|
|
|
|
include 'tp-editor.asm'
|
2006-12-30 18:44:05 +01:00
|
|
|
|
include 'tp-recode.asm'
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2012-11-09 11:42:30 +01:00
|
|
|
|
include '../../../dll.inc'
|
2006-10-11 22:40:53 +02:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-08-14 14:50:43 +02:00
|
|
|
|
section @DATA ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
2006-01-03 10:43:31 +01:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
|
2008-07-18 06:52:49 +02:00
|
|
|
|
;include_debug_strings
|
|
|
|
|
|
2007-09-01 23:38:00 +02:00
|
|
|
|
include 'data/tp-idata.inc'
|
2006-10-11 22:40:53 +02:00
|
|
|
|
|
2007-09-01 23:38:00 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
section @IMPORT ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
library \
|
|
|
|
|
libini,'libini.obj',\
|
|
|
|
|
libio,'libio.obj',\
|
2010-09-25 21:21:10 +02:00
|
|
|
|
libgfx,'libgfx.obj',\
|
|
|
|
|
proc_lib,'proc_lib.obj'
|
2007-09-01 23:38:00 +02:00
|
|
|
|
|
|
|
|
|
import libini, \
|
2009-06-03 23:12:49 +02:00
|
|
|
|
ini.get_str ,'ini_get_str',\
|
|
|
|
|
ini.set_str ,'ini_set_str',\
|
|
|
|
|
ini.get_int ,'ini_get_int',\
|
|
|
|
|
ini.set_int ,'ini_set_int',\
|
|
|
|
|
ini.get_color,'ini_get_color',\
|
|
|
|
|
ini.set_color,'ini_set_color'
|
2007-09-01 23:38:00 +02:00
|
|
|
|
|
|
|
|
|
import libio, \
|
2009-06-03 23:12:49 +02:00
|
|
|
|
file.find_first,'file_find_first',\
|
|
|
|
|
file.find_next ,'file_find_next',\
|
|
|
|
|
file.find_close,'file_find_close',\
|
|
|
|
|
file.size ,'file_size',\
|
|
|
|
|
file.open ,'file_open',\
|
|
|
|
|
file.read ,'file_read',\
|
|
|
|
|
file.write ,'file_write',\
|
|
|
|
|
file.seek ,'file_seek',\
|
|
|
|
|
file.tell ,'file_tell',\
|
|
|
|
|
file.eof? ,'file_iseof',\
|
|
|
|
|
file.truncate ,'file_truncate',\
|
|
|
|
|
file.close ,'file_close'
|
2007-09-01 23:38:00 +02:00
|
|
|
|
|
|
|
|
|
import libgfx, \
|
2009-06-03 23:12:49 +02:00
|
|
|
|
gfx.open ,'gfx_open',\
|
|
|
|
|
gfx.close ,'gfx_close',\
|
|
|
|
|
gfx.pen.color ,'gfx_pen_color',\
|
|
|
|
|
gfx.brush.color ,'gfx_brush_color',\
|
|
|
|
|
gfx.pixel ,'gfx_pixel',\
|
|
|
|
|
gfx.move.to ,'gfx_move_to',\
|
|
|
|
|
gfx.line.to ,'gfx_line_to',\
|
|
|
|
|
gfx.line ,'gfx_line',\
|
|
|
|
|
gfx.polyline ,'gfx_polyline',\
|
|
|
|
|
gfx.polyline.to ,'gfx_polyline_to',\
|
|
|
|
|
gfx.fillrect ,'gfx_fillrect',\
|
|
|
|
|
gfx.fillrect.ex ,'gfx_fillrect_ex',\
|
|
|
|
|
gfx.framerect ,'gfx_framerect',\
|
|
|
|
|
gfx.framerect.ex,'gfx_framerect_ex',\
|
|
|
|
|
gfx.rectangle ,'gfx_rectangle',\
|
|
|
|
|
gfx.rectangle.ex,'gfx_rectangle_ex'
|
2006-08-14 14:50:43 +02:00
|
|
|
|
|
2010-09-25 21:21:10 +02:00
|
|
|
|
import proc_lib, \
|
|
|
|
|
OpenDialog_Init ,'OpenDialog_init',\
|
|
|
|
|
OpenDialog_Start ,'OpenDialog_start'
|
|
|
|
|
|
2007-09-01 23:38:00 +02:00
|
|
|
|
TINYPAD_END: ; end of file
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2006-08-14 14:50:43 +02:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
section @UDATA ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-01-03 10:43:31 +01:00
|
|
|
|
|
2007-09-01 23:38:00 +02:00
|
|
|
|
include 'data/tp-udata.inc'
|
2007-01-03 19:22:05 +01:00
|
|
|
|
|
2006-01-03 10:43:31 +01:00
|
|
|
|
;-----------------------------------------------------------------------------
|
2006-08-14 14:50:43 +02:00
|
|
|
|
section @PARAMS ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
2006-01-03 10:43:31 +01:00
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
fasm_parameters:
|
|
|
|
|
|
2006-12-30 18:44:05 +01:00
|
|
|
|
p_info process_information
|
2006-08-14 14:50:43 +02:00
|
|
|
|
p_info2 process_information
|
2006-12-30 18:44:05 +01:00
|
|
|
|
sc system_colors
|
2006-08-14 14:50:43 +02:00
|
|
|
|
|
2008-12-29 20:08:59 +01:00
|
|
|
|
ini_path rb PATHL
|
|
|
|
|
|
2010-09-25 21:21:10 +02:00
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
temp_dir_pach:
|
|
|
|
|
rb 4096
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
fname_Info:
|
|
|
|
|
rb 4096 ; filename
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
filename_area:
|
|
|
|
|
rb 256
|
|
|
|
|
;---------------------------------------------------------------------
|
2007-01-03 19:22:05 +01:00
|
|
|
|
rb 1024*4
|
|
|
|
|
MAIN_STACK:
|
|
|
|
|
rb 1024*4
|
|
|
|
|
POPUP_STACK:
|
|
|
|
|
|
|
|
|
|
STATIC_MEM_END:
|
|
|
|
|
|
|
|
|
|
diff10 'Main memory size',0,$
|