Subversion Repositories Kolibri OS

Rev

Rev 7996 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
122 diamond 1
;-----------------------------------------------------------------------------
31 halyavin 2
; project name:      TINYPAD
5241 punk_joker 3
; compiler:          flat assembler 1.67.21
297 mikedld 4
; memory to compile: 3.0/9.0 MBytes (without/with size optimizations)
5636 leency 5
; version:           SVN (4.1)
6
; last update:       2015-07-17 (Jul 17, 2015)
4505 mario79 7
; minimal kernel:    revision #4199 (svn://kolibrios.org/kernel/trunk)
122 diamond 8
;-----------------------------------------------------------------------------
9
; originally by:     Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi
258 mikedld 10
; maintained by:     Mike Semenyako          >> mike.dld@gmail.com
11
;                    Ivan Poddubny           >> ivan-yar@bk.ru
4505 mario79 12
;                    Marat Zakiyanov aka Mario79
5636 leency 13
;                    Pathoswithin
122 diamond 14
;-----------------------------------------------------------------------------
5636 leency 15
; TODO:
617 mikedld 16
;   - add vertical selection, undo, goto position, overwrite mode, smart tabulation
178 heavyiron 17
;   - improve window drawing with small dimensions
617 mikedld 18
;   - save/load settings to/from ini file, not executable
19
;   - path autocompletion for open/save dialogs
259 mikedld 20
;   - other bug-fixes and speed/size optimizations
122 diamond 21
;-----------------------------------------------------------------------------
617 mikedld 22
; See history.txt for complete changelog
23
;-----------------------------------------------------------------------------
31 halyavin 24
 
178 heavyiron 25
include 'lang.inc'
617 mikedld 26
 
5241 punk_joker 27
include '../../../config.inc'		;for nightbuild
28
include '../../../macros.inc'		; useful stuff
617 mikedld 29
include '../../../struct.inc'
30
include '../../../proc32.inc'
31
 
32
include 'external/libio.inc'
33
 
122 diamond 34
include 'tinypad.inc'
617 mikedld 35
 
297 mikedld 36
;purge mov,add,sub            ;  SPEED
31 halyavin 37
 
7134 dunkaist 38
__header '01',1,@CODE,TINYPAD_END,STATIC_MEM_END,MAIN_STACK,@PARAMS,ini_path
31 halyavin 39
 
5636 leency 40
APP_VERSION equ '4.1'
258 mikedld 41
 
617 mikedld 42
TRUE = 1
43
FALSE = 0
44
 
280 mikedld 45
;define __DEBUG__ 1
46
;define __DEBUG_LEVEL__ 1
4487 mario79 47
;include '../../../debug-fdo.inc'
31 halyavin 48
 
987 mikedld 49
; compiled-in options
50
 
280 mikedld 51
ASEPC = '-'  ; separator character (char)
52
ATOPH = 19   ; menu bar height (pixels)
53
SCRLW = 16   ; scrollbar widht/height (pixels)
54
ATABW = 8    ; tab key indent width (chars)
7996 leency 55
LINEH = 16+1 ; line height (pixels)
280 mikedld 56
PATHL = 256  ; maximum path length (chars) !!! don't change !!!
57
AMINS = 8    ; minimal scroll thumb size (pixels)
58
LCHGW = 3    ; changed/saved marker width (pixels)
31 halyavin 59
 
280 mikedld 60
STATH = 16   ; status bar height (pixels)
61
TBARH = 18   ; tab bar height (pixels)
31 halyavin 62
 
987 mikedld 63
INI_SEC_PREFIX equ ''
31 halyavin 64
 
122 diamond 65
;-----------------------------------------------------------------------------
7134 dunkaist 66
__section @CODE ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
122 diamond 67
;-----------------------------------------------------------------------------
5241 punk_joker 68
	cld
69
	mov	edi,@UDATA
70
	mov	ecx,@PARAMS-@UDATA
71
	mov	al,0
72
	rep	stosb
31 halyavin 73
 
5241 punk_joker 74
	mcall	68,11
75
	or	eax,eax
76
	jz	key.alt_x.close
259 mikedld 77
 
5241 punk_joker 78
	stdcall dll.Load,@IMPORT
79
	or	eax,eax
80
	jnz	key.alt_x.close
617 mikedld 81
 
5241 punk_joker 82
	mov	edi,ini_path
83
	xor	al,al
84
	mov	ecx,PATHL
85
	repne	scasb
86
	mov	dword[edi-1],'.ini'
87
	mov	byte[edi+3],0
987 mikedld 88
 
5241 punk_joker 89
	stdcall load_settings
987 mikedld 90
 
5241 punk_joker 91
	stdcall mem.Alloc,65536
92
	mov	[temp_buf],eax
259 mikedld 93
 
5241 punk_joker 94
	inc	[do_not_draw]
178 heavyiron 95
 
5241 punk_joker 96
	mov	dword[app_start],7
297 mikedld 97
 
5241 punk_joker 98
	mov	esi,s_example
99
	mov	edi,tb_opensave.text
100
	mov	ecx,s_example.size
101
	mov	[tb_opensave.length],cl
102
	rep	movsb
31 halyavin 103
 
5241 punk_joker 104
	mov	esi,s_still
105
	mov	edi,s_search
106
	mov	ecx,s_still.size
107
	mov	[s_search.size],ecx
108
	rep	movsb
31 halyavin 109
 
5241 punk_joker 110
	cmp	byte[@PARAMS],0
111
	jz	no_params
31 halyavin 112
 
122 diamond 113
;// Willow's code to support DOCPAK [
31 halyavin 114
 
5241 punk_joker 115
	cmp	byte[@PARAMS],'*'
116
	jne	.noipc
178 heavyiron 117
 
118
;// diamond [ (convert size from decimal representation to dword)
119
;--     mov     edx,dword[@PARAMS+1]
5241 punk_joker 120
	mov	esi,@PARAMS+1
121
	xor	edx,edx
122
	xor	eax,eax
178 heavyiron 123
    @@: lodsb
5241 punk_joker 124
	test	al,al
125
	jz	@f
126
	lea	edx,[edx*4+edx]
127
	lea	edx,[edx*2+eax-'0']
128
	jmp	@b
178 heavyiron 129
    @@:
130
;// diamond ]
131
 
5241 punk_joker 132
	add	edx,20
259 mikedld 133
 
5241 punk_joker 134
	stdcall mem.Alloc,edx
135
	mov	ebp,eax
136
	push	eax
259 mikedld 137
 
5241 punk_joker 138
	mov	dword[ebp+0],0
139
	mov	dword[ebp+4],8
140
	mcall	60,1,ebp
141
	mcall	40,1000000b
280 mikedld 142
 
5241 punk_joker 143
	mcall	23,200
280 mikedld 144
 
5241 punk_joker 145
	cmp	eax,7
146
	jne	key.alt_x.close
147
	mov	byte[ebp],1
259 mikedld 148
 
5241 punk_joker 149
	mov	ecx,[ebp+12]
150
	lea	esi,[ebp+16]
151
	call	create_tab
152
	call	load_from_memory
259 mikedld 153
 
5241 punk_joker 154
	pop	ebp
155
	stdcall mem.Free,ebp
259 mikedld 156
 
5241 punk_joker 157
	jmp	@f
122 diamond 158
  .noipc:
31 halyavin 159
 
122 diamond 160
;// Willow's code to support DOCPAK ]
31 halyavin 161
 
5241 punk_joker 162
	mov	esi,@PARAMS
163
	mov	edi,tb_opensave.text
164
	mov	ecx,PATHL
165
	rep	movsb
166
	mov	edi,tb_opensave.text
167
	mov	ecx,PATHL
168
	xor	al,al
169
	repne	scasb
170
	jne	key.alt_x.close
171
	lea	eax,[edi-tb_opensave.text-1]
172
	mov	[tb_opensave.length],al
173
	call	load_file
174
	jnc	@f
31 halyavin 175
 
122 diamond 176
  no_params:
5241 punk_joker 177
	call	create_tab
31 halyavin 178
 
179
    @@:
5241 punk_joker 180
	mov	[s_status],0
181
	dec	[do_not_draw]
987 mikedld 182
 
5241 punk_joker 183
	mov	al,[tabs_pos]
184