Subversion Repositories Kolibri OS

Rev

Rev 5240 | Rev 5636 | Go to most recent revision | 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)
5241 punk_joker 5
; version:           SVN (4.0.8)
6
; last update:       2014-01-22 (Jan 22, 2014)
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
122 diamond 13
;-----------------------------------------------------------------------------
297 mikedld 14
; TODO (4.1.0):
617 mikedld 15
;   - add vertical selection, undo, goto position, overwrite mode, smart tabulation
178 heavyiron 16
;   - improve window drawing with small dimensions
617 mikedld 17
;   - save/load settings to/from ini file, not executable
18
;   - path autocompletion for open/save dialogs
259 mikedld 19
;   - other bug-fixes and speed/size optimizations
122 diamond 20
;-----------------------------------------------------------------------------
617 mikedld 21
; See history.txt for complete changelog
22
;-----------------------------------------------------------------------------
31 halyavin 23
 
178 heavyiron 24
include 'lang.inc'
617 mikedld 25
 
5241 punk_joker 26
include '../../../config.inc'		;for nightbuild
27
include '../../../macros.inc'		; useful stuff
617 mikedld 28
include '../../../struct.inc'
29
include '../../../proc32.inc'
30
 
31
include 'external/libio.inc'
32
 
122 diamond 33
include 'tinypad.inc'
617 mikedld 34
 
297 mikedld 35
;purge mov,add,sub            ;  SPEED
31 halyavin 36
 
5241 punk_joker 37
header '01',1,@CODE,TINYPAD_END,STATIC_MEM_END,MAIN_STACK,@PARAMS,ini_path
31 halyavin 38
 
5241 punk_joker 39
APP_VERSION equ 'SVN (4.0.8)'
258 mikedld 40
 
617 mikedld 41
TRUE = 1
42
FALSE = 0
43
 
280 mikedld 44
;define __DEBUG__ 1
45
;define __DEBUG_LEVEL__ 1
4487 mario79 46
;include '../../../debug-fdo.inc'
31 halyavin 47
 
987 mikedld 48
; compiled-in options
49
 
280 mikedld 50
ASEPC = '-'  ; separator character (char)
51
ATOPH = 19   ; menu bar height (pixels)
52
SCRLW = 16   ; scrollbar widht/height (pixels)
53
ATABW = 8    ; tab key indent width (chars)
54
LINEH = 10   ; line height (pixels)
55
PATHL = 256  ; maximum path length (chars) !!! don't change !!!
56
AMINS = 8    ; minimal scroll thumb size (pixels)
57
LCHGW = 3    ; changed/saved marker width (pixels)
31 halyavin 58
 
280 mikedld 59
STATH = 16   ; status bar height (pixels)
60
TBARH = 18   ; tab bar height (pixels)
31 halyavin 61
 
987 mikedld 62
INI_SEC_PREFIX equ ''
31 halyavin 63
 
122 diamond 64
;-----------------------------------------------------------------------------
65
section @CODE ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
66
;-----------------------------------------------------------------------------
5241 punk_joker 67
	cld
68
	mov	edi,@UDATA
69
	mov	ecx,@PARAMS-@UDATA
70
	mov	al,0
71
	rep	stosb
31 halyavin 72
 
5241 punk_joker 73
	mcall	68,11
74
	or	eax,eax
75
	jz	key.alt_x.close
259 mikedld 76
 
5241 punk_joker 77
	stdcall dll.Load,@IMPORT
78
	or	eax,eax
79
	jnz	key.alt_x.close
617 mikedld 80
 
5241 punk_joker 81
	mov	edi,ini_path
82
	xor	al,al
83
	mov	ecx,PATHL
84
	repne	scasb
85
	mov	dword[edi-1],'.ini'
86
	mov	byte[edi+3],0
987 mikedld 87
 
5241 punk_joker 88
	stdcall load_settings
987 mikedld 89
 
5241 punk_joker 90
	stdcall mem.Alloc,65536
91
	mov	[temp_buf],eax
259 mikedld 92
 
5241 punk_joker 93
	inc	[do_not_draw]
178 heavyiron 94
 
5241 punk_joker 95
	mov	dword[app_start],7
297 mikedld 96
 
5241 punk_joker 97
	mov	esi,s_example
98
	mov	edi,tb_opensave.text
99
	mov	ecx,s_example.size
100
	mov	[tb_opensave.length],cl
101
	rep	movsb
31 halyavin 102
 
5241 punk_joker 103
	mov	esi,s_still
104
	mov	edi,s_search
105
	mov	ecx,s_still.size
106
	mov	[s_search.size],ecx
107
	rep	movsb
31 halyavin 108
 
5241 punk_joker 109
	cmp	byte[@PARAMS],0
110
	jz	no_params
31 halyavin 111
 
122 diamond 112
;// Willow's code to support DOCPAK [
31 halyavin 113
 
5241 punk_joker 114
	cmp	byte[@PARAMS],'*'
115
	jne	.noipc
178 heavyiron 116
 
117
;// diamond [ (convert size from decimal representation to dword)
118
;--     mov     edx,dword[@PARAMS+1]
5241 punk_joker 119
	mov	esi,@PARAMS+1
120
	xor	edx,edx
121
	xor	eax,eax
178 heavyiron 122
    @@: lodsb
5241 punk_joker 123
	test	al,al
124
	jz	@f
125
	lea	edx,[edx*4+edx]
126
	lea	edx,[edx*2+eax-'0']
127
	jmp	@b
178 heavyiron 128
    @@:
129
;// diamond ]
130
 
5241 punk_joker 131
	add	edx,20
259 mikedld 132
 
5241 punk_joker 133
	stdcall mem.Alloc,edx
134
	mov	ebp,eax
135
	push	eax
259 mikedld 136
 
5241 punk_joker 137
	mov	dword[ebp+0],0
138
	mov	dword[ebp+4],8
139
	mcall	60,1,ebp
140
	mcall	40,1000000b
280 mikedld 141
 
5241 punk_joker 142
	mcall	23,200
280 mikedld 143
 
5241 punk_joker 144
	cmp	eax,7
145
	jne	key.alt_x.close
146
	mov	byte[ebp],1
259 mikedld 147
 
5241 punk_joker 148
	mov	ecx,[ebp+12]
149
	lea	esi,[ebp+16]
150
	call	create_tab
151
	call	load_from_memory
259 mikedld 152
 
5241 punk_joker 153
	pop	ebp
154
	stdcall mem.Free,ebp
259 mikedld 155
 
5241 punk_joker 156
	jmp	@f
122 diamond 157
  .noipc:
31 halyavin 158
 
122 diamond 159
;// Willow's code to support DOCPAK ]
31 halyavin 160
 
5241 punk_joker 161
	mov	esi,@PARAMS
162
	mov	edi,tb_opensave.text
163
	mov	ecx,PATHL
164
	rep	movsb
165
	mov	edi,tb_opensave.text
166
	mov	ecx,PATHL
167
	xor	al,al
168
	repne	scasb
169
	jne	key.alt_x.close
170
	lea	eax,[edi-tb_opensave.text-1]
171
	mov	[tb_opensave.length],al
172
	call	load_file
173
	jnc	@f
31 halyavin 174
 
122 diamond 175
  no_params:
5241 punk_joker 176
	call	create_tab
31 halyavin 177
 
178
    @@:
5241 punk_joker 179
	mov	[s_status],0
180
	dec	[do_not_draw]
987 mikedld 181
 
5241 punk_joker 182
	mov	al,[tabs_pos]
183
	mov	[tab_bar.Style],al
987 mikedld 184
 
1624 mario79 185
;---------------------------------------------------------------------
5241 punk_joker 186
	mov	edi,filename_area
187
	mov	esi,s_example+5
188
	call	copy_str_1
1624 mario79 189
 
5241 punk_joker 190
	mov	esi,tb_opensave.text
191
	mov	edi,fname_Info
192
	call	copy_str_1
193
	xor	eax,eax
194
	mov	[edi],al
1624 mario79 195
;---------------------------------------------------------------------
4274 tserj 196
;OpenDialog     initialisation
5241 punk_joker 197
	push	dword OpenDialog_data
198
	call	[OpenDialog_Init]
1624 mario79 199
;---------------------------------------------------------------------
200
 
201
 
5241 punk_joker 202
	mcall	66,1,1
203
	mcall	40,00100111b
178 heavyiron 204
red:
5241 punk_joker 205
	call	drawwindow
31 halyavin 206
 
122 diamond 207
;-----------------------------------------------------------------------------
31 halyavin 208
 
122 diamond 209
still:
5241 punk_joker 210
	call	draw_statusbar ; write current position & number of strings
31 halyavin 211
 
122 diamond 212
  .skip_write:
5241 punk_joker 213
	cmp	[open_dialog],1
214
	je	.open_dialog
215
	mcall	10	; wait here until event
3265 mario79 216
 
5241 punk_joker 217
	cmp	[main_closed],0
218
	jne	key.alt_x
219
	dec	eax	; redraw ?
220
	jz	red
221
	dec	eax	; key ?
222
	jz	key
223
	dec	eax	; button ?
224
	jz	button
225
	sub	eax,3	; mouse ?
226
	jz	mouse
31 halyavin 227
 
5241 punk_joker 228
	jmp	still.skip_write
1624 mario79 229
;---------------------------------------------------------------------
230
.open_dialog:
5241 punk_joker 231
	pusha
31 halyavin 232
 
5241 punk_joker 233
	call	btn.bot.cancel
1624 mario79 234
 
5241 punk_joker 235
	mov	esi,tb_opensave.text
236
	mov	edi,[OpenDialog_data.openfile_pach]
237
	movzx	ecx,[tb_opensave.length]
238
	mov	edx,[OpenDialog_data.filename_area]
239
	mov	ebx,[OpenDialog_data.opendir_pach]
240
	call	copy_str_2
241
	movzx	eax,byte [bot_mode2]
242
	mov	[OpenDialog_data.type],eax
243
	popa
1624 mario79 244
; invoke OpenDialog
5241 punk_joker 245
	push	dword OpenDialog_data
246
	call	[OpenDialog_Start]
1624 mario79 247
 
5241 punk_joker 248
	cmp	[OpenDialog_data.status],1
249
	jne	.3
1624 mario79 250
 
5241 punk_joker 251
	pusha
252
	mov	edi,tb_opensave.text
253
	mov	esi,[OpenDialog_data.openfile_pach]
254
	call	copy_str_1
255
	sub	edi,tb_opensave.text
256
	dec	edi
257
	mov	eax,edi
258
	mov	[tb_opensave.length],al
259
	popa
4274 tserj 260
 
5241 punk_joker 261
	cmp	[bot_mode2],0
262
	je	.2
263
	call	save_file
264
	jmp	.3
1624 mario79 265
.2:
5241 punk_joker 266
	call	load_file
1624 mario79 267
.3:
5241 punk_joker 268
	mov	[open_dialog],0
269
	jmp	red
122 diamond 270
;-----------------------------------------------------------------------------
1624 mario79 271
draw_window_for_OD:
5241 punk_joker 272
	call	drawwindow
273
	call	draw_statusbar
274
	ret
1624 mario79 275
;-----------------------------------------------------------------------------
276
copy_str_2:
5241 punk_joker 277
	cld
278
	push	esi ecx
279
	rep	movsb	; edi  openfile_pach
280
	xor	eax,eax
281
	mov	[edi],al
282
	pop	ecx esi
283
	mov	edi,ebx
284
	rep	movsb	; edi opendir_pach
285
	mov	[edi],al
286
	mov	esi,edi
287
	std
1624 mario79 288
@@:
5241 punk_joker 289
	lodsb
290
	cmp	al,byte '/'
291
	jne	@b
292
	inc	esi
293
	xor	eax,eax
294
	mov	[esi],al
295
	inc	esi
296
	mov	edi,edx ; edi filename_area
297
	call	copy_str_1
298
	ret
1624 mario79 299
;-----------------------------------------------------------------------------
300
copy_str_1:
5241 punk_joker 301
	xor	eax,eax
302
	cld
1624 mario79 303
@@:
5241 punk_joker 304
	lodsb
305
	stosb
306
	test	eax,eax
307
	jnz	@b
308
	ret
1624 mario79 309
;-----------------------------------------------------------------------------
617 mikedld 310
proc get_event ctx ;//////////////////////////////////////////////////////////
122 diamond 311
;-----------------------------------------------------------------------------
5241 punk_joker 312
	mcall	10
313
	dec	eax	; redraw ?
314
	jz	.redraw
315
	dec	eax	; key ?
316
	jz	.key
317
	dec	eax	; button ?
318
	jz	.button
319
	sub	eax,2	; background ?
320
	jz	.background
321
	dec	eax	; mouse ?
322
	jz	.mouse
323
	dec	eax	; ipc ?
324
	jz	.ipc
325
	dec	eax	; network ?
326
	jz	.network
327
	dec	eax	; debug ?
328
	jz	.debug
329
	sub	eax,7	; irq ?
330
	js	.nothing
331
	cmp	eax,15
332
	jg	.nothing
333
	jmp	.irq
617 mikedld 334
 
335
  .nothing:
5241 punk_joker 336
	mov	eax,EV_IDLE
337
	ret
617 mikedld 338
 
339
  .redraw:
5241 punk_joker 340
	mov	eax,EV_REDRAW
341
	ret
617 mikedld 342
 
343
  .key:
5241 punk_joker 344
	mov	eax,EV_KEY
345
	ret
617 mikedld 346
 
347
  .button:
5241 punk_joker 348
	mov	eax,EV_BUTTON
349
	ret
617 mikedld 350
 
351
  .background:
5241 punk_joker 352
	mov	eax,EV_BACKGROUND
353
	ret
617 mikedld 354
 
355
  .mouse:
5241 punk_joker 356
	mov	eax,EV_MOUSE
357
	ret
617 mikedld 358
 
359
  .ipc:
5241 punk_joker 360
	mov	eax,EV_IPC
361
	ret
617 mikedld 362
 
363
  .network:
5241 punk_joker 364
	mov	eax,EV_NETWORK
365
	ret
617 mikedld 366
 
367
  .debug:
5241 punk_joker 368
	mov	eax,EV_DEBUG
369
	ret
617 mikedld 370
endp
371
 
372
;-----------------------------------------------------------------------------
987 mikedld 373
proc load_settings ;//////////////////////////////////////////////////////////
374
;-----------------------------------------------------------------------------
5241 punk_joker 375
	pushad
987 mikedld 376
 
5241 punk_joker 377
	invoke	ini.get_int,ini_path,ini_sec_options,ini_options_tabs_pos,2
378
	mov	[tabs_pos],al
379
	invoke	ini.get_int,ini_path,ini_sec_options,ini_options_secure_sel,0
380
	mov	[secure_sel],al
381
	invoke	ini.get_int,ini_path,ini_sec_options,ini_options_auto_braces,0
382
	mov	[auto_braces],al
383
	invoke	ini.get_int,ini_path,ini_sec_options,ini_options_auto_indent,1
384
	mov	[auto_indent],al
385
	invoke	ini.get_int,ini_path,ini_sec_options,ini_options_smart_tab,1
386
	mov	[smart_tab],al
387
	invoke	ini.get_int,ini_path,ini_sec_options,ini_options_optim_save,1
388
	mov	[optim_save],al
389
	invoke	ini.get_int,ini_path,ini_sec_options,ini_options_line_nums,0
390
	mov	[line_nums],al
987 mikedld 391
 
5241 punk_joker 392
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_text,0x00000000
393
	mov	[color_tbl.text],eax
394
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_back,0x00ffffff
395
	mov	[color_tbl.back],eax
396
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_text_sel,0x00ffffff
397
	mov	[color_tbl.text.sel],eax
398
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_back_sel,0x000a246a
399
	mov	[color_tbl.back.sel],eax
400
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_symbol,0x003030f0
401
	mov	[color_tbl.symbol],eax
402
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_number,0x00009000
403
	mov	[color_tbl.number],eax
404
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_string,0x00b00000
405
	mov	[color_tbl.string],eax
406
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_comment,0x00808080
407
	mov	[color_tbl.comment],eax
408
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_line_moded,0x00ffee62
409
	mov	[color_tbl.line.moded],eax
410
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_line_saved,0x006ce26c
411
	mov	[color_tbl.line.saved],eax
987 mikedld 412
 
5241 punk_joker 413
	invoke	ini.get_int,ini_path,ini_sec_window,ini_window_left,250
414
	mov	[mainwnd_pos.x],eax
415
	invoke	ini.get_int,ini_path,ini_sec_window,ini_window_top,75
416
	mov	[mainwnd_pos.y],eax
417
	invoke	ini.get_int,ini_path,ini_sec_window,ini_window_width,6*80+6+SCRLW+5
418
	mov	[mainwnd_pos.w],eax
419
	invoke	ini.get_int,ini_path,ini_sec_window,ini_window_height,402
420
	mov	[mainwnd_pos.h],eax
987 mikedld 421
 
5241 punk_joker 422
	popad
423
	ret
987 mikedld 424
endp
425
 
426
;-----------------------------------------------------------------------------
427
proc save_settings ;//////////////////////////////////////////////////////////
428
;-----------------------------------------------------------------------------
5241 punk_joker 429
	pushad
987 mikedld 430
 
5241 punk_joker 431
	movzx	eax,[tabs_pos]
432
	invoke	ini.set_int,ini_path,ini_sec_options,ini_options_tabs_pos,eax
433
	movzx	eax,[secure_sel]
434
	invoke	ini.set_int,ini_path,ini_sec_options,ini_options_secure_sel,eax
435
	movzx	eax,[auto_braces]
436
	invoke	ini.set_int,ini_path,ini_sec_options,ini_options_auto_braces,eax
437
	movzx	eax,[auto_indent]
438
	invoke	ini.set_int,ini_path,ini_sec_options,ini_options_auto_indent,eax
439
	movzx	eax,[smart_tab]
440
	invoke	ini.set_int,ini_path,ini_sec_options,ini_options_smart_tab,eax
441
	movzx	eax,[optim_save]
442
	invoke	ini.set_int,ini_path,ini_sec_options,ini_options_optim_save,eax
443
	movzx	eax,[line_nums]
444
	invoke	ini.set_int,ini_path,ini_sec_options,ini_options_line_nums,eax
987 mikedld 445
 
5241 punk_joker 446
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_text,[color_tbl.text]
447
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_back,[color_tbl.back]
448
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_text_sel,[color_tbl.text.sel]
449
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_back_sel,[color_tbl.back.sel]
450
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_symbol,[color_tbl.symbol]
451
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_number,[color_tbl.number]
452
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_string,[color_tbl.string]
453
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_comment,[color_tbl.comment]
454
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_line_moded,[color_tbl.line.moded]
455
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_line_saved,[color_tbl.line.saved]
987 mikedld 456
 
5241 punk_joker 457
	invoke	ini.set_int,ini_path,ini_sec_window,ini_window_left,[mainwnd_pos.x]
458
	invoke	ini.set_int,ini_path,ini_sec_window,ini_window_top,[mainwnd_pos.y]
459
	invoke	ini.set_int,ini_path,ini_sec_window,ini_window_width,[mainwnd_pos.w]
460
	invoke	ini.set_int,ini_path,ini_sec_window,ini_window_height,[mainwnd_pos.h]
987 mikedld 461
 
5241 punk_joker 462
	popad
463
	ret
987 mikedld 464
endp
465
 
466
;-----------------------------------------------------------------------------
617 mikedld 467
proc start_fasm ;/////////////////////////////////////////////////////////////
468
;-----------------------------------------------------------------------------
4274 tserj 469
; BL = 0 - compile
470
; BL = 1 - run after compile
471
; BL = 2 - run under mtdbg after compile
122 diamond 472
;-----------------------------------------------------------------------------
297 mikedld 473
; FASM infile,outfile,/path/to/files[,run]
474
;-----------------------------------------------------------------------------
5241 punk_joker 475
	cmp	[cur_editor.AsmMode],0
476
	jne	@f
477
	ret
297 mikedld 478
    @@:
5241 punk_joker 479
	mov	eax,[tab_bar.Default.Ptr]
480
	or	eax,eax
481
	jnz	@f
482
	mov	eax,[tab_bar.Current.Ptr]
483
    @@: cmp	byte[eax+TABITEM.Editor.FilePath],'/'
484
	je	@f
485
	ret
297 mikedld 486
    @@:
5241 punk_joker 487
	mov	edi,fasm_parameters
488
	push	eax
31 halyavin 489
 
5241 punk_joker 490
	cld
31 halyavin 491
 
5241 punk_joker 492
	lea	esi,[eax+TABITEM.Editor.FilePath]
493
	add	esi,[eax+TABITEM.Editor.FileName]
494
	push	esi esi
297 mikedld 495
    @@: lodsb
5241 punk_joker 496
	cmp	al,0
497
	je	@f
498
	stosb
499
	cmp	al,'.'
500
	jne	@b
501
	mov	ecx,esi
502
	jmp	@b
297 mikedld 503
    @@:
5241 punk_joker 504
	mov	al,','
505
	stosb
31 halyavin 506
 
5241 punk_joker 507
	pop	esi
508
	sub	ecx,esi
509
	dec	ecx
510
	jz	@f
511
	rep	movsb
297 mikedld 512
    @@:
5241 punk_joker 513
	mov	al,','
514
	stosb
31 halyavin 515
 
5241 punk_joker 516
	pop	ecx esi
517
	add	esi,TABITEM.Editor.FilePath
518
	sub	ecx,esi
519
	rep	movsb
31 halyavin 520
 
5241 punk_joker 521
	cmp	bl,0 ; compile outfile ?
522
	je	@f
523
	mov	dword[edi],',run'
524
	cmp	bl,1 ; run outfile ?
525
	je	do_run
526
	mov	dword[edi],',dbg'
4274 tserj 527
do_run:
5241 punk_joker 528
	add	edi,4
529
		@@:
530
	mov	al,0
531
	stosb
31 halyavin 532
 
5241 punk_joker 533
	mov	[app_start.filename],app_fasm
534
	mov	[app_start.params],fasm_parameters
178 heavyiron 535
start_ret:
5241 punk_joker 536
	mcall	70,app_start
537
	ret
617 mikedld 538
endp
31 halyavin 539
 
122 diamond 540
;-----------------------------------------------------------------------------
617 mikedld 541
proc open_debug_board ;///////////////////////////////////////////////////////
122 diamond 542
;-----------------------------------------------------------------------------
5241 punk_joker 543
	mov	[app_start.filename],app_board
544
	mov	[app_start.params],0
545
	jmp	start_ret
617 mikedld 546
endp
31 halyavin 547
 
122 diamond 548
;-----------------------------------------------------------------------------
617 mikedld 549
proc open_sysfuncs_txt ;//////////////////////////////////////////////////////
122 diamond 550
;-----------------------------------------------------------------------------
5241 punk_joker 551
	mov	[app_start.filename],app_docpak
552
	mov	[app_start.params],sysfuncs_param
553
	call	start_ret
554
	cmp	eax,0xfffffff0
555
	jb	@f
556
	mov	[app_start.filename],app_tinypad
557
	mov	[app_start.params],sysfuncs_filename
558
	call	start_ret
122 diamond 559
    @@: ret
617 mikedld 560
endp
31 halyavin 561
 
297 mikedld 562
set_opt:
178 heavyiron 563
 
297 mikedld 564
  .dialog:
5241 punk_joker 565
	mov	[bot_mode],1
566
	mov	[bot_dlg_height],128
567
	mov	[bot_dlg_handler],optsdlg_handler
568
	mov	[focused_tb],tb_color
569
	mov	al,[tb_color.length]
570
	mov	[tb_color.pos.x],al
571
	mov	[tb_color.sel.x],0
572
	mov	[tb_casesen],1
573
	mov	[cur_part],0
574
	m2m	[cur_color],dword[color_tbl.text]
575
	mov	esi,color_tbl
576
	mov	edi,cur_colors
577
	mov	ecx,10
578
	cld
579
	rep	movsd
580
	call	drawwindow
581
	ret
31 halyavin 582
 
259 mikedld 583
  .line_numbers:
5241 punk_joker 584
	xor	[line_nums],1
585
	ret
259 mikedld 586
  .optimal_fill:
5241 punk_joker 587
	xor	[optim_save],1
588
	ret
259 mikedld 589
  .auto_indents:
5241 punk_joker 590
	xor	[auto_indent],1
591
	ret
259 mikedld 592
  .auto_braces:
5241 punk_joker 593
	xor	[auto_braces],1
594
	ret
259 mikedld 595
  .secure_sel:
5241 punk_joker 596
	xor	[secure_sel],1
597
	ret
31 halyavin 598
 
122 diamond 599
;-----------------------------------------------------------------------------
31 halyavin 600
 
617 mikedld 601
include 'data/tp-defines.inc'
259 mikedld 602
 
122 diamond 603
include 'tp-draw.asm'
604
include 'tp-key.asm'
258 mikedld 605
include 'tp-button.asm'
122 diamond 606
include 'tp-mouse.asm'
607
include 'tp-files.asm'
258 mikedld 608
include 'tp-common.asm'
609
include 'tp-dialog.asm'
122 diamond 610
include 'tp-popup.asm'
611
include 'tp-tbox.asm'
259 mikedld 612
include 'tp-tabctl.asm'
613
include 'tp-editor.asm'
258 mikedld 614
include 'tp-recode.asm'
4487 mario79 615
include 'tp-clipboard.asm'
31 halyavin 616
 
3014 dunkaist 617
include '../../../dll.inc'
178 heavyiron 618
 
31 halyavin 619
;-----------------------------------------------------------------------------
122 diamond 620
section @DATA ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
31 halyavin 621
;-----------------------------------------------------------------------------
622
 
827 mikedld 623
;include_debug_strings
624
 
617 mikedld 625
include 'data/tp-idata.inc'
31 halyavin 626
 
617 mikedld 627
;-----------------------------------------------------------------------------
628
section @IMPORT ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
629
;-----------------------------------------------------------------------------
31 halyavin 630
 
617 mikedld 631
library \
5241 punk_joker 632
	libini,'libini.obj',\
633
	libio,'libio.obj',\
634
	libgfx,'libgfx.obj',\
635
	proc_lib,'proc_lib.obj'
31 halyavin 636
 
5241 punk_joker 637
import	libini, \
638
	ini.get_str  ,'ini_get_str',\
639
	ini.set_str  ,'ini_set_str',\
640
	ini.get_int  ,'ini_get_int',\
641
	ini.set_int  ,'ini_set_int',\
642
	ini.get_color,'ini_get_color',\
643
	ini.set_color,'ini_set_color'
31 halyavin 644
 
5241 punk_joker 645
import	libio, \
646
	file.find_first,'file_find_first',\
647
	file.find_next ,'file_find_next',\
648
	file.find_close,'file_find_close',\
649
	file.size      ,'file_size',\
650
	file.open      ,'file_open',\
651
	file.read      ,'file_read',\
652
	file.write     ,'file_write',\
653
	file.seek      ,'file_seek',\
654
	file.tell      ,'file_tell',\
655
	file.eof?      ,'file_iseof',\
656
	file.truncate  ,'file_truncate',\
657
	file.close     ,'file_close'
31 halyavin 658
 
5241 punk_joker 659
import	libgfx, \
660
	gfx.open	,'gfx_open',\
661
	gfx.close	,'gfx_close',\
662
	gfx.pen.color	,'gfx_pen_color',\
663
	gfx.brush.color ,'gfx_brush_color',\
664
	gfx.pixel	,'gfx_pixel',\
665
	gfx.move.to	,'gfx_move_to',\
666
	gfx.line.to	,'gfx_line_to',\
667
	gfx.line	,'gfx_line',\
668
	gfx.polyline	,'gfx_polyline',\
669
	gfx.polyline.to ,'gfx_polyline_to',\
670
	gfx.fillrect	,'gfx_fillrect',\
671
	gfx.fillrect.ex ,'gfx_fillrect_ex',\
672
	gfx.framerect	,'gfx_framerect',\
673
	gfx.framerect.ex,'gfx_framerect_ex',\
674
	gfx.rectangle	,'gfx_rectangle',\
675
	gfx.rectangle.ex,'gfx_rectangle_ex'
31 halyavin 676
 
5241 punk_joker 677
import	proc_lib, \
678
	OpenDialog_Init  ,'OpenDialog_init',\
679
	OpenDialog_Start  ,'OpenDialog_start'
1624 mario79 680
 
5241 punk_joker 681
TINYPAD_END:	 ; end of file
122 diamond 682
 
31 halyavin 683
;-----------------------------------------------------------------------------
122 diamond 684
section @UDATA ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
31 halyavin 685
;-----------------------------------------------------------------------------
686
 
617 mikedld 687
include 'data/tp-udata.inc'
297 mikedld 688
 
31 halyavin 689
;-----------------------------------------------------------------------------
122 diamond 690
section @PARAMS ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
31 halyavin 691
;-----------------------------------------------------------------------------
692
 
693
fasm_parameters:
694
 
5241 punk_joker 695
p_info	process_information
122 diamond 696
p_info2 process_information
5241 punk_joker 697
sc	system_colors
122 diamond 698
 
5241 punk_joker 699
ini_path rb PATHL
987 mikedld 700
 
1624 mario79 701
;---------------------------------------------------------------------
702
temp_dir_pach:
5241 punk_joker 703
	rb 4096
1624 mario79 704
;---------------------------------------------------------------------
705
fname_Info:
5241 punk_joker 706
	rb 4096 	   ; filename
1624 mario79 707
;---------------------------------------------------------------------
708
filename_area:
5241 punk_joker 709
	rb 256
1624 mario79 710
;---------------------------------------------------------------------
259 mikedld 711
rb 1024*4
712
MAIN_STACK:
713
rb 1024*4
714
POPUP_STACK:
715
 
716
STATIC_MEM_END:
717
 
718
diff10 'Main memory size',0,$