Subversion Repositories Kolibri OS

Rev

Rev 5241 | Rev 5845 | 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)
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
 
5241 punk_joker 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)
55
LINEH = 10   ; line height (pixels)
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
;-----------------------------------------------------------------------------
66
section @CODE ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
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
	mov	[tab_bar.Style],al
987 mikedld 185
 
1624 mario79 186
;---------------------------------------------------------------------
5241 punk_joker 187
	mov	edi,filename_area
188
	mov	esi,s_example+5
189
	call	copy_str_1
1624 mario79 190
 
5241 punk_joker 191
	mov	esi,tb_opensave.text
192
	mov	edi,fname_Info
193
	call	copy_str_1
194
	xor	eax,eax
195
	mov	[edi],al
1624 mario79 196
;---------------------------------------------------------------------
4274 tserj 197
;OpenDialog     initialisation
5241 punk_joker 198
	push	dword OpenDialog_data
199
	call	[OpenDialog_Init]
1624 mario79 200
;---------------------------------------------------------------------
201
 
202
 
5241 punk_joker 203
	mcall	66,1,1
204
	mcall	40,00100111b
178 heavyiron 205
red:
5241 punk_joker 206
	call	drawwindow
31 halyavin 207
 
122 diamond 208
;-----------------------------------------------------------------------------
31 halyavin 209
 
122 diamond 210
still:
5241 punk_joker 211
	call	draw_statusbar ; write current position & number of strings
31 halyavin 212
 
122 diamond 213
  .skip_write:
5241 punk_joker 214
	cmp	[open_dialog],1
215
	je	.open_dialog
216
	mcall	10	; wait here until event
3265 mario79 217
 
5241 punk_joker 218
	cmp	[main_closed],0
219
	jne	key.alt_x
220
	dec	eax	; redraw ?
221
	jz	red
222
	dec	eax	; key ?
223
	jz	key
224
	dec	eax	; button ?
225
	jz	button
226
	sub	eax,3	; mouse ?
227
	jz	mouse
31 halyavin 228
 
5241 punk_joker 229
	jmp	still.skip_write
1624 mario79 230
;---------------------------------------------------------------------
231
.open_dialog:
5241 punk_joker 232
	pusha
31 halyavin 233
 
5241 punk_joker 234
	call	btn.bot.cancel
1624 mario79 235
 
5241 punk_joker 236
	mov	esi,tb_opensave.text
237
	mov	edi,[OpenDialog_data.openfile_pach]
238
	movzx	ecx,[tb_opensave.length]
239
	mov	edx,[OpenDialog_data.filename_area]
240
	mov	ebx,[OpenDialog_data.opendir_pach]
241
	call	copy_str_2
242
	movzx	eax,byte [bot_mode2]
243
	mov	[OpenDialog_data.type],eax
244
	popa
1624 mario79 245
; invoke OpenDialog
5241 punk_joker 246
	push	dword OpenDialog_data
247
	call	[OpenDialog_Start]
1624 mario79 248
 
5241 punk_joker 249
	cmp	[OpenDialog_data.status],1
250
	jne	.3
1624 mario79 251
 
5241 punk_joker 252
	pusha
253
	mov	edi,tb_opensave.text
254
	mov	esi,[OpenDialog_data.openfile_pach]
255
	call	copy_str_1
256
	sub	edi,tb_opensave.text
257
	dec	edi
258
	mov	eax,edi
259
	mov	[tb_opensave.length],al
260
	popa
4274 tserj 261
 
5241 punk_joker 262
	cmp	[bot_mode2],0
263
	je	.2
264
	call	save_file
265
	jmp	.3
1624 mario79 266
.2:
5241 punk_joker 267
	call	load_file
1624 mario79 268
.3:
5241 punk_joker 269
	mov	[open_dialog],0
270
	jmp	red
122 diamond 271
;-----------------------------------------------------------------------------
1624 mario79 272
draw_window_for_OD:
5241 punk_joker 273
	call	drawwindow
274
	call	draw_statusbar
275
	ret
1624 mario79 276
;-----------------------------------------------------------------------------
277
copy_str_2:
5241 punk_joker 278
	cld
279
	push	esi ecx
280
	rep	movsb	; edi  openfile_pach
281
	xor	eax,eax
282
	mov	[edi],al
283
	pop	ecx esi
284
	mov	edi,ebx
285
	rep	movsb	; edi opendir_pach
286
	mov	[edi],al
287
	mov	esi,edi
288
	std
1624 mario79 289
@@:
5241 punk_joker 290
	lodsb
291
	cmp	al,byte '/'
292
	jne	@b
293
	inc	esi
294
	xor	eax,eax
295
	mov	[esi],al
296
	inc	esi
297
	mov	edi,edx ; edi filename_area
298
	call	copy_str_1
299
	ret
1624 mario79 300
;-----------------------------------------------------------------------------
301
copy_str_1:
5241 punk_joker 302
	xor	eax,eax
303
	cld
1624 mario79 304
@@:
5241 punk_joker 305
	lodsb
306
	stosb
307
	test	eax,eax
308
	jnz	@b
309
	ret
1624 mario79 310
;-----------------------------------------------------------------------------
617 mikedld 311
proc get_event ctx ;//////////////////////////////////////////////////////////
122 diamond 312
;-----------------------------------------------------------------------------
5241 punk_joker 313
	mcall	10
314
	dec	eax	; redraw ?
315
	jz	.redraw
316
	dec	eax	; key ?
317
	jz	.key
318
	dec	eax	; button ?
319
	jz	.button
320
	sub	eax,2	; background ?
321
	jz	.background
322
	dec	eax	; mouse ?
323
	jz	.mouse
324
	dec	eax	; ipc ?
325
	jz	.ipc
326
	dec	eax	; network ?
327
	jz	.network
328
	dec	eax	; debug ?
329
	jz	.debug
330
	sub	eax,7	; irq ?
331
	js	.nothing
332
	cmp	eax,15
333
	jg	.nothing
334
	jmp	.irq
617 mikedld 335
 
336
  .nothing:
5241 punk_joker 337
	mov	eax,EV_IDLE
338
	ret
617 mikedld 339
 
340
  .redraw:
5241 punk_joker 341
	mov	eax,EV_REDRAW
342
	ret
617 mikedld 343
 
344
  .key:
5241 punk_joker 345
	mov	eax,EV_KEY
346
	ret
617 mikedld 347
 
348
  .button:
5241 punk_joker 349
	mov	eax,EV_BUTTON
350
	ret
617 mikedld 351
 
352
  .background:
5241 punk_joker 353
	mov	eax,EV_BACKGROUND
354
	ret
617 mikedld 355
 
356
  .mouse:
5241 punk_joker 357
	mov	eax,EV_MOUSE
358
	ret
617 mikedld 359
 
360
  .ipc:
5241 punk_joker 361
	mov	eax,EV_IPC
362
	ret
617 mikedld 363
 
364
  .network:
5241 punk_joker 365
	mov	eax,EV_NETWORK
366
	ret
617 mikedld 367
 
368
  .debug:
5241 punk_joker 369
	mov	eax,EV_DEBUG
370
	ret
617 mikedld 371
endp
372
 
373
;-----------------------------------------------------------------------------
987 mikedld 374
proc load_settings ;//////////////////////////////////////////////////////////
375
;-----------------------------------------------------------------------------
5241 punk_joker 376
	pushad
987 mikedld 377
 
5241 punk_joker 378
	invoke	ini.get_int,ini_path,ini_sec_options,ini_options_tabs_pos,2
379
	mov	[tabs_pos],al
380
	invoke	ini.get_int,ini_path,ini_sec_options,ini_options_secure_sel,0
381
	mov	[secure_sel],al
382
	invoke	ini.get_int,ini_path,ini_sec_options,ini_options_auto_braces,0
383
	mov	[auto_braces],al
384
	invoke	ini.get_int,ini_path,ini_sec_options,ini_options_auto_indent,1
385
	mov	[auto_indent],al
386
	invoke	ini.get_int,ini_path,ini_sec_options,ini_options_smart_tab,1
387
	mov	[smart_tab],al
388
	invoke	ini.get_int,ini_path,ini_sec_options,ini_options_optim_save,1
389
	mov	[optim_save],al
390
	invoke	ini.get_int,ini_path,ini_sec_options,ini_options_line_nums,0
391
	mov	[line_nums],al
987 mikedld 392
 
5241 punk_joker 393
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_text,0x00000000
394
	mov	[color_tbl.text],eax
395
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_back,0x00ffffff
396
	mov	[color_tbl.back],eax
397
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_text_sel,0x00ffffff
398
	mov	[color_tbl.text.sel],eax
399
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_back_sel,0x000a246a
400
	mov	[color_tbl.back.sel],eax
401
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_symbol,0x003030f0
402
	mov	[color_tbl.symbol],eax
403
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_number,0x00009000
404
	mov	[color_tbl.number],eax
405
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_string,0x00b00000
406
	mov	[color_tbl.string],eax
407
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_comment,0x00808080
408
	mov	[color_tbl.comment],eax
409
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_line_moded,0x00ffee62
410
	mov	[color_tbl.line.moded],eax
411
	invoke	ini.get_color,ini_path,ini_sec_colors,ini_colors_line_saved,0x006ce26c
412
	mov	[color_tbl.line.saved],eax
987 mikedld 413
 
5241 punk_joker 414
	invoke	ini.get_int,ini_path,ini_sec_window,ini_window_left,250
415
	mov	[mainwnd_pos.x],eax
416
	invoke	ini.get_int,ini_path,ini_sec_window,ini_window_top,75
417
	mov	[mainwnd_pos.y],eax
418
	invoke	ini.get_int,ini_path,ini_sec_window,ini_window_width,6*80+6+SCRLW+5
419
	mov	[mainwnd_pos.w],eax
420
	invoke	ini.get_int,ini_path,ini_sec_window,ini_window_height,402
421
	mov	[mainwnd_pos.h],eax
987 mikedld 422
 
5241 punk_joker 423
	popad
424
	ret
987 mikedld 425
endp
426
 
427
;-----------------------------------------------------------------------------
428
proc save_settings ;//////////////////////////////////////////////////////////
429
;-----------------------------------------------------------------------------
5241 punk_joker 430
	pushad
987 mikedld 431
 
5241 punk_joker 432
	movzx	eax,[tabs_pos]
433
	invoke	ini.set_int,ini_path,ini_sec_options,ini_options_tabs_pos,eax
434
	movzx	eax,[secure_sel]
435
	invoke	ini.set_int,ini_path,ini_sec_options,ini_options_secure_sel,eax
436
	movzx	eax,[auto_braces]
437
	invoke	ini.set_int,ini_path,ini_sec_options,ini_options_auto_braces,eax
438
	movzx	eax,[auto_indent]
439
	invoke	ini.set_int,ini_path,ini_sec_options,ini_options_auto_indent,eax
440
	movzx	eax,[smart_tab]
441
	invoke	ini.set_int,ini_path,ini_sec_options,ini_options_smart_tab,eax
442
	movzx	eax,[optim_save]
443
	invoke	ini.set_int,ini_path,ini_sec_options,ini_options_optim_save,eax
444
	movzx	eax,[line_nums]
445
	invoke	ini.set_int,ini_path,ini_sec_options,ini_options_line_nums,eax
987 mikedld 446
 
5241 punk_joker 447
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_text,[color_tbl.text]
448
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_back,[color_tbl.back]
449
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_text_sel,[color_tbl.text.sel]
450
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_back_sel,[color_tbl.back.sel]
451
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_symbol,[color_tbl.symbol]
452
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_number,[color_tbl.number]
453
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_string,[color_tbl.string]
454
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_comment,[color_tbl.comment]
455
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_line_moded,[color_tbl.line.moded]
456
	invoke	ini.set_color,ini_path,ini_sec_colors,ini_colors_line_saved,[color_tbl.line.saved]
987 mikedld 457
 
5241 punk_joker 458
	invoke	ini.set_int,ini_path,ini_sec_window,ini_window_left,[mainwnd_pos.x]
459
	invoke	ini.set_int,ini_path,ini_sec_window,ini_window_top,[mainwnd_pos.y]
460
	invoke	ini.set_int,ini_path,ini_sec_window,ini_window_width,[mainwnd_pos.w]
461
	invoke	ini.set_int,ini_path,ini_sec_window,ini_window_height,[mainwnd_pos.h]
987 mikedld 462
 
5241 punk_joker 463
	popad
464
	ret
987 mikedld 465
endp
466
 
467
;-----------------------------------------------------------------------------
617 mikedld 468
proc start_fasm ;/////////////////////////////////////////////////////////////
469
;-----------------------------------------------------------------------------
4274 tserj 470
; BL = 0 - compile
471
; BL = 1 - run after compile
472
; BL = 2 - run under mtdbg after compile
122 diamond 473
;-----------------------------------------------------------------------------
297 mikedld 474
; FASM infile,outfile,/path/to/files[,run]
475
;-----------------------------------------------------------------------------
5241 punk_joker 476
	cmp	[cur_editor.AsmMode],0
477
	jne	@f
478
	ret
297 mikedld 479
    @@:
5241 punk_joker 480
	mov	eax,[tab_bar.Default.Ptr]
481
	or	eax,eax
482
	jnz	@f
483
	mov	eax,[tab_bar.Current.Ptr]
484
    @@: cmp	byte[eax+TABITEM.Editor.FilePath],'/'
485
	je	@f
486
	ret
297 mikedld 487
    @@:
5241 punk_joker 488
	mov	edi,fasm_parameters
489
	push	eax
31 halyavin 490
 
5241 punk_joker 491
	cld
31 halyavin 492
 
5241 punk_joker 493
	lea	esi,[eax+TABITEM.Editor.FilePath]
494
	add	esi,[eax+TABITEM.Editor.FileName]
495
	push	esi esi
297 mikedld 496
    @@: lodsb
5241 punk_joker 497
	cmp	al,0
498
	je	@f
499
	stosb
500
	cmp	al,'.'
501
	jne	@b
502
	mov	ecx,esi
503
	jmp	@b
297 mikedld 504
    @@:
5241 punk_joker 505
	mov	al,','
506
	stosb
31 halyavin 507
 
5241 punk_joker 508
	pop	esi
509
	sub	ecx,esi
510
	dec	ecx
511
	jz	@f
512
	rep	movsb
297 mikedld 513
    @@:
5241 punk_joker 514
	mov	al,','
515
	stosb
31 halyavin 516
 
5241 punk_joker 517
	pop	ecx esi
518
	add	esi,TABITEM.Editor.FilePath
519
	sub	ecx,esi
520
	rep	movsb
31 halyavin 521
 
5241 punk_joker 522
	cmp	bl,0 ; compile outfile ?
523
	je	@f
524
	mov	dword[edi],',run'
525
	cmp	bl,1 ; run outfile ?
526
	je	do_run
527
	mov	dword[edi],',dbg'
4274 tserj 528
do_run:
5241 punk_joker 529
	add	edi,4
530
		@@:
531
	mov	al,0
532
	stosb
31 halyavin 533
 
5241 punk_joker 534
	mov	[app_start.filename],app_fasm
535
	mov	[app_start.params],fasm_parameters
178 heavyiron 536
start_ret:
5241 punk_joker 537
	mcall	70,app_start
538
	ret
617 mikedld 539
endp
31 halyavin 540
 
122 diamond 541
;-----------------------------------------------------------------------------
617 mikedld 542
proc open_debug_board ;///////////////////////////////////////////////////////
122 diamond 543
;-----------------------------------------------------------------------------
5241 punk_joker 544
	mov	[app_start.filename],app_board
545
	mov	[app_start.params],0
546
	jmp	start_ret
617 mikedld 547
endp
31 halyavin 548
 
122 diamond 549
;-----------------------------------------------------------------------------
617 mikedld 550
proc open_sysfuncs_txt ;//////////////////////////////////////////////////////
122 diamond 551
;-----------------------------------------------------------------------------
5241 punk_joker 552
	mov	[app_start.filename],app_docpak
553
	mov	[app_start.params],sysfuncs_param
554
	call	start_ret
555
	cmp	eax,0xfffffff0
556
	jb	@f
557
	mov	[app_start.filename],app_tinypad
558
	mov	[app_start.params],sysfuncs_filename
559
	call	start_ret
122 diamond 560
    @@: ret
617 mikedld 561
endp
31 halyavin 562
 
297 mikedld 563
set_opt:
178 heavyiron 564
 
297 mikedld 565
  .dialog:
5241 punk_joker 566
	mov	[bot_mode],1
567
	mov	[bot_dlg_height],128
568
	mov	[bot_dlg_handler],optsdlg_handler
569
	mov	[focused_tb],tb_color
570
	mov	al,[tb_color.length]
571
	mov	[tb_color.pos.x],al
572
	mov	[tb_color.sel.x],0
573
	mov	[tb_casesen],1
574
	mov	[cur_part],0
575
	m2m	[cur_color],dword[color_tbl.text]
576
	mov	esi,color_tbl
577
	mov	edi,cur_colors
578
	mov	ecx,10
579
	cld
580
	rep	movsd
581
	call	drawwindow
582
	ret
31 halyavin 583
 
259 mikedld 584
  .line_numbers:
5241 punk_joker 585
	xor	[line_nums],1
586
	ret
259 mikedld 587
  .optimal_fill:
5241 punk_joker 588
	xor	[optim_save],1
589
	ret
259 mikedld 590
  .auto_indents:
5241 punk_joker 591
	xor	[auto_indent],1
592
	ret
259 mikedld 593
  .auto_braces:
5241 punk_joker 594
	xor	[auto_braces],1
595
	ret
259 mikedld 596
  .secure_sel:
5241 punk_joker 597
	xor	[secure_sel],1
598
	ret
31 halyavin 599
 
122 diamond 600
;-----------------------------------------------------------------------------
31 halyavin 601
 
617 mikedld 602
include 'data/tp-defines.inc'
259 mikedld 603
 
122 diamond 604
include 'tp-draw.asm'
605
include 'tp-key.asm'
258 mikedld 606
include 'tp-button.asm'
122 diamond 607
include 'tp-mouse.asm'
608
include 'tp-files.asm'
258 mikedld 609
include 'tp-common.asm'
610
include 'tp-dialog.asm'
122 diamond 611
include 'tp-popup.asm'
612
include 'tp-tbox.asm'
259 mikedld 613
include 'tp-tabctl.asm'
614
include 'tp-editor.asm'
258 mikedld 615
include 'tp-recode.asm'
4487 mario79 616
include 'tp-clipboard.asm'
31 halyavin 617
 
3014 dunkaist 618
include '../../../dll.inc'
178 heavyiron 619
 
31 halyavin 620
;-----------------------------------------------------------------------------
122 diamond 621
section @DATA ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
31 halyavin 622
;-----------------------------------------------------------------------------
623
 
827 mikedld 624
;include_debug_strings
625
 
617 mikedld 626
include 'data/tp-idata.inc'
31 halyavin 627
 
617 mikedld 628
;-----------------------------------------------------------------------------
629
section @IMPORT ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
630
;-----------------------------------------------------------------------------
31 halyavin 631
 
617 mikedld 632
library \
5241 punk_joker 633
	libini,'libini.obj',\
634
	libio,'libio.obj',\
635
	libgfx,'libgfx.obj',\
636
	proc_lib,'proc_lib.obj'
31 halyavin 637
 
5241 punk_joker 638
import	libini, \
639
	ini.get_str  ,'ini_get_str',\
640
	ini.set_str  ,'ini_set_str',\
641
	ini.get_int  ,'ini_get_int',\
642
	ini.set_int  ,'ini_set_int',\
643
	ini.get_color,'ini_get_color',\
644
	ini.set_color,'ini_set_color'
31 halyavin 645
 
5241 punk_joker 646
import	libio, \
647
	file.find_first,'file_find_first',\
648
	file.find_next ,'file_find_next',\
649
	file.find_close,'file_find_close',\
650
	file.size      ,'file_size',\
651
	file.open      ,'file_open',\
652
	file.read      ,'file_read',\
653
	file.write     ,'file_write',\
654
	file.seek      ,'file_seek',\
655
	file.tell      ,'file_tell',\
656
	file.eof?      ,'file_iseof',\
657
	file.truncate  ,'file_truncate',\
658
	file.close     ,'file_close'
31 halyavin 659
 
5241 punk_joker 660
import	libgfx, \
661
	gfx.open	,'gfx_open',\
662
	gfx.close	,'gfx_close',\
663
	gfx.pen.color	,'gfx_pen_color',\
664
	gfx.brush.color ,'gfx_brush_color',\
665
	gfx.pixel	,'gfx_pixel',\
666
	gfx.move.to	,'gfx_move_to',\
667
	gfx.line.to	,'gfx_line_to',\
668
	gfx.line	,'gfx_line',\
669
	gfx.polyline	,'gfx_polyline',\
670
	gfx.polyline.to ,'gfx_polyline_to',\
671
	gfx.fillrect	,'gfx_fillrect',\
672
	gfx.fillrect.ex ,'gfx_fillrect_ex',\
673
	gfx.framerect	,'gfx_framerect',\
674
	gfx.framerect.ex,'gfx_framerect_ex',\
675
	gfx.rectangle	,'gfx_rectangle',\
676
	gfx.rectangle.ex,'gfx_rectangle_ex'
31 halyavin 677
 
5241 punk_joker 678
import	proc_lib, \
679
	OpenDialog_Init  ,'OpenDialog_init',\
680
	OpenDialog_Start  ,'OpenDialog_start'
1624 mario79 681
 
5241 punk_joker 682
TINYPAD_END:	 ; end of file
122 diamond 683
 
31 halyavin 684
;-----------------------------------------------------------------------------
122 diamond 685
section @UDATA ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
31 halyavin 686
;-----------------------------------------------------------------------------
687
 
617 mikedld 688
include 'data/tp-udata.inc'
297 mikedld 689
 
31 halyavin 690
;-----------------------------------------------------------------------------
122 diamond 691
section @PARAMS ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
31 halyavin 692
;-----------------------------------------------------------------------------
693
 
694
fasm_parameters:
695
 
5241 punk_joker 696
p_info	process_information
122 diamond 697
p_info2 process_information
5241 punk_joker 698
sc	system_colors
122 diamond 699
 
5241 punk_joker 700
ini_path rb PATHL
987 mikedld 701
 
1624 mario79 702
;---------------------------------------------------------------------
703
temp_dir_pach:
5241 punk_joker 704
	rb 4096
1624 mario79 705
;---------------------------------------------------------------------
706
fname_Info:
5241 punk_joker 707
	rb 4096 	   ; filename
1624 mario79 708
;---------------------------------------------------------------------
709
filename_area:
5241 punk_joker 710
	rb 256
1624 mario79 711
;---------------------------------------------------------------------
259 mikedld 712
rb 1024*4
713
MAIN_STACK:
714
rb 1024*4
715
POPUP_STACK:
716
 
717
STATIC_MEM_END:
718
 
719
diff10 'Main memory size',0,$