programs/system: Post-SVN tidy (part 3) (#413)

- Move source code from `trunk` into root directory for each program.
- Update build files and ASM include paths. Add SPDX license header where appropriate.
- Note: Line endings standardised from `CRLF` > `LF`, so best to view diffs with whitespace changes hidden.

(Work towards #75, point 3)

Reviewed-on: #413
Reviewed-by: Ivan B <dunkaist@noreply.localhost>
Reviewed-by: Mikhail Frolov <mixa.frolov2003@gmail.com>
Co-authored-by: Andrew <dent.ace@gmail.com>
Co-committed-by: Andrew <dent.ace@gmail.com>
This commit was merged in pull request #413.
This commit is contained in:
2026-04-10 16:30:22 +00:00
committed by Burer
parent 398dcbb13d
commit 7bcb400040
68 changed files with 5543 additions and 5485 deletions
+6 -3
View File
@@ -1,3 +1,6 @@
; SPDX-License-Identifier: NOASSERTION
;
format coff
use32 ; Tell compiler to use 32 bit instructions
@@ -8,7 +11,7 @@ include '../../../programs/macros.inc'
purge section,mov,add,sub
include '../../../programs/develop/libraries/box_lib/trunk/box_lib.mac'
include '../../../programs/system/run/trunk/txtbut.inc'
include '../../../programs/system/run/txtbut.inc'
include '../../../programs/dll.inc'
public init_boxlib as '_kolibri_boxlib_init'
@@ -159,8 +162,8 @@ public path_show_draw as '_path_show_draw'
public fb_draw_panel as '_filebrowse_draw'
public fb_mouse as '_filebrowse_mouse'
public fb_key as '_filebrowse_key'
public fb_key as '_filebrowse_key'
public ted_but_sumb_upper as '_ted_but_sumb_upper'
public ted_but_sumb_lover as '_ted_but_sumb_lover'
public ted_but_convert_by_table as '_ted_but_convert_by_table'
+7 -7
View File
@@ -59,7 +59,7 @@ img_files = {
{"SETTINGS/FB2READ.INI", "common/settings/fb2read.ini"},
{"SETTINGS/HA.CFG", SRC_PROGS .. "/other/ha/SETTINGS/HA.CFG"},
{"SETTINGS/ICON.INI", build_type .. "/settings/icon.ini"},
{"SETTINGS/KEYMAP.KEY", SRC_PROGS .. "/system/taskbar/trunk/KEYMAP.KEY"},
{"SETTINGS/KEYMAP.KEY", SRC_PROGS .. "/system/taskbar/KEYMAP.KEY"},
{"SETTINGS/KOLIBRI.LBL", build_type .. "/settings/kolibri.lbl"},
{"SETTINGS/LANG.INI", build_type .. "/settings/lang.ini"},
{"SETTINGS/MENU.DAT", build_type .. "/settings/menu.dat"},
@@ -406,8 +406,8 @@ tup.append_table(img_files, {
{"@NOTIFY", VAR_PROGS .. "/system/notify3/notify"},
{"@OPEN", VAR_PROGS .. "/system/open/open"},
{"@RESHARE", VAR_PROGS .. "/system/reshare/reshare"},
{"@SS", VAR_PROGS .. "/system/scrsaver/scrsaver"},
{"@TASKBAR", VAR_PROGS .. "/system/taskbar/trunk/TASKBAR"},
{"@SS", VAR_PROGS .. "/system/scrsaver/scrsaver"},
{"@TASKBAR", VAR_PROGS .. "/system/taskbar/TASKBAR"},
{"@VOLUME", VAR_PROGS .. "/media/volume/volume"},
{"HACONFIG", VAR_PROGS .. "/other/ha/HACONFIG"},
{"ACLOCK", VAR_PROGS .. "/demos/aclock/aclock"},
@@ -423,7 +423,7 @@ tup.append_table(img_files, {
{"DEFAULT.SKN", VAR_SKINS .. "/../skins/Leency/Shkvorka/Shkvorka.skn"},
{"DISPTEST", VAR_PROGS .. "/testing/disptest/trunk/disptest"},
{"END", VAR_PROGS .. "/system/end/light/end"},
{"ESKIN", VAR_PROGS .. "/system/eskin/trunk/eskin"},
{"ESKIN", VAR_PROGS .. "/system/eskin/eskin"},
{"FSPEED", VAR_PROGS .. "/testing/fspeed/fspeed"},
{"GMON", VAR_PROGS .. "/system/gmon/gmon"},
{"HDD_INFO", VAR_PROGS .. "/system/hdd_info/hdd_info"},
@@ -441,15 +441,15 @@ tup.append_table(img_files, {
{"RTFREAD", VAR_PROGS .. "/other/rtfread/rtfread"},
{"SEARCHAP", VAR_PROGS .. "/system/searchap/searchap"},
{"SCRSHOOT", VAR_PROGS .. "/media/scrshoot/scrshoot"},
{"SETUP", VAR_PROGS .. "/system/setup/trunk/setup"},
{"SKINCFG", VAR_PROGS .. "/system/skincfg/trunk/skincfg"},
{"SETUP", VAR_PROGS .. "/system/setup/setup"},
{"SKINCFG", VAR_PROGS .. "/system/skincfg/skincfg"},
{"TERMINAL", VAR_PROGS .. "/system/terminal/terminal"},
{"TEST", VAR_PROGS .. "/testing/protection/trunk/test"},
{"TINYPAD", VAR_PROGS .. "/develop/tinypad/trunk/tinypad"},
{"TINFO", VAR_PROGS .. "/system/tinfo/tinfo"},
{"TIMER", VAR_PROGS .. "/other/Timer/Timer"},
{"UNZ", VAR_PROGS .. "/fs/unz/unz"},
{"ZKEY", VAR_PROGS .. "/system/zkey/trunk/ZKEY"},
{"ZKEY", VAR_PROGS .. "/system/zkey/ZKEY"},
{"3D/3DWAV", VAR_PROGS .. "/demos/3dwav/3dwav"},
{"3D/CROWNSCR", VAR_PROGS .. "/demos/crownscr/crownscr"},
{"3D/3DCUBE2", VAR_PROGS .. "/demos/3dcube2/3DCUBE2"},
+10 -7
View File
@@ -1,7 +1,10 @@
@@unpack$qqspvt1 equ unpack
include "..\..\system\skincfg\trunk\kglobals.inc"
include "..\..\system\skincfg\trunk\unpacker.inc"
IncludeIGlobals
IncludeUGlobals
; SPDX-License-Identifier: NOASSERTION
;
@@unpack$qqspvt1 equ unpack
include "..\..\system\skincfg\kglobals.inc"
include "..\..\system\skincfg\unpacker.inc"
IncludeIGlobals
IncludeUGlobals
+18 -18
View File
@@ -58,30 +58,30 @@ echo Building system
echo *
fasm system\calendar\calendar.asm %BIN%\calendar
fasm system\board\board.asm %BIN%\develop\board
fasm system\commouse\trunk\commouse.asm %BIN%\commouse
rem fasm system\commouse\trunk\commouse.asm %BIN%\commouse
fasm system\cpu\cpu.asm %BIN%\cpu
fasm system\cpuid\trunk\cpuid.asm %BIN%\cpuid
fasm system\skincfg\trunk\skincfg.asm %BIN%\skincfg
rem fasm system\cpuid\trunk\cpuid.asm %BIN%\cpuid
fasm system\skincfg\skincfg.asm %BIN%\skincfg
fasm system\docpack\docpack.asm %BIN%\docpack
fasm system\end\trunk\end.asm %BIN%\end
fasm system\end\end.asm %BIN%\end
fasm system\gmon\gmon.asm %BIN%\gmon
fasm system\icon\icon.asm %BIN%\icon
fasm system\kbd\trunk\kbd.ASM %BIN%\kbd
rem fasm system\kbd\trunk\kbd.ASM %BIN%\kbd
fasm system\launcher\launcher.asm %BIN%\launcher
fasm system\menu\menu.asm %BIN%\@menu
fasm system\mgb\trunk\mgb.asm %BIN%\mgb
rem fasm system\mgb\trunk\mgb.asm %BIN%\mgb
fasm system\mousemul\mousemul.asm %BIN%\mousemul
fasm system\PANEL\trunk\@TASKBAR.ASM %BIN%\@TASKBAR
fasm system\pcidev\trunk\pcidev.asm %BIN%\pcidev
fasm system\RB\trunk\@RB.ASM %BIN%\@RB
fasm system\taskbar\TASKBAR.ASM %BIN%\@TASKBAR
rem fasm system\pcidev\trunk\pcidev.asm %BIN%\pcidev
rem fasm system\RB\trunk\@RB.ASM %BIN%\@RB
fasm system\rdsave\rdsave.asm %BIN%\rdsave
fasm system\run\trunk\run.asm %BIN%\run
fasm system\setup\trunk\setup.asm %BIN%\setup
fasm system\skinsel\skinsel.asm %BIN%\skinsel
fasm system\ss\trunk\@ss.asm %BIN%\@ss
fasm system\vrr\trunk\vrr.asm %BIN%\vrr
fasm system\vrr_m\trunk\vrr_m.asm %BIN%\vrr_m
fasm system\zkey\trunk\zkey.asm %BIN%\zkey
fasm system\run\run.asm %BIN%\run
fasm system\setup\setup.asm %BIN%\setup
rem fasm system\skinsel\skinsel.asm %BIN%\skinsel
rem fasm system\ss\trunk\@ss.asm %BIN%\@ss
rem fasm system\vrr\trunk\vrr.asm %BIN%\vrr
rem fasm system\vrr_m\trunk\vrr_m.asm %BIN%\vrr_m
fasm system\zkey\zkey.asm %BIN%\zkey
echo *
echo Building develop
@@ -237,9 +237,9 @@ fasm media\animage\animage.asm %BIN%\nightbuild\animage
fasm media\midamp\trunk\midamp.asm %BIN%\nightbuild\midamp
fasm develop\heed\trunk\heed.asm %BIN%\nightbuild\heed
fasm develop\tinypad\trunk\tinypad.asm %BIN%\nightbuild\tinypad
fasm system\skincfg\trunk\skincfg.asm %BIN%\nightbuild\skincfg
fasm system\skincfg\skincfg.asm %BIN%\nightbuild\skincfg
fasm system\hdd_info\hdd_info.asm %BIN%\nightbuild\hdd_info
fasm system\mgb\trunk\mgb.asm %BIN%\nightbuild\mgb
rem fasm system\mgb\trunk\mgb.asm %BIN%\nightbuild\mgb
fasm system\rdsave\rdsave.asm %BIN%\nightbuild\rdsave
fasm other\kpack\trunk\kpack.asm %BIN%\nightbuild\kpack
fasm other\rtfread\rtfread.asm %BIN%\nightbuild\rtfread
File diff suppressed because it is too large Load Diff
@@ -1,410 +1,416 @@
;*****************************************************************************
; Box_Lib - library of graphical components
; Copyright (C) KolibriOS team 2008-2020. All rights reserved.
;
; Authors:
; Alexey Teplov aka <Lrz>
; Marat Zakiyanov aka Mario79, aka Mario
; Evtikhov Maxim aka Maxxxx32
; Eugene Grechnikov aka Diamond
; hidnplayr
; Igor Afanasiev aka IgorA
;*****************************************************************************
format MS COFF
public EXPORTS
section '.flat' code readable align 16
include '../../../../macros.inc'
include '../../../../proc32.inc'
include '../../../../KOSfuncs.inc'
include 'box_lib.mac' ;macro which should make life easier :)
;include '../../../../debug.inc'
include 'keys.inc'
include '../../../../system/skincfg/trunk/kglobals.inc'
include '../../../../system/skincfg/trunk/unpacker.inc'
;-----------------------------------------------------------------------------
mem.alloc dd ? ;ôóíêöèÿ äëÿ âûäåëåíèÿ ïàìÿòè
mem.free dd ? ;ôóíêöèÿ äëÿ îñâîáîæäåíèÿ ïàìÿòè
mem.realloc dd ? ;ôóíêöèÿ äëÿ ïåðåðàñïðåäåëåíèÿ ïàìÿòè
dll.load dd ?
;----------------------------------------------------
include 'editbox.asm' ;editbox
include 'checkbox.asm' ;checkbox
include 'optionbox.asm' ;optionbox
include 'scrollbar.asm' ;scrollbar
include 'd_button.asm' ;dinamic_button
include 'menubar.asm' ;menubar
include 'filebrowser.asm' ;filebrowser
include 'tree_list.asm' ;tree_list, list_box
include 'pathshow.asm' ;pathshow
include 't_edit.asm' ;text_editor
include 'frame.asm' ;frame
include 'progressbar.asm' ;progressbar
include 'tooltip.asm' ;tooltip
;--------------------------------------------------
;input:
; eax = óêàçàòåëü íà ôóíêöèþ âûäåëåíèÿ ïàìÿòè
; ebx = ... îñâîáîæäåíèÿ ïàìÿòè
; ecx = ... ïåðåðàñïðåäåëåíèÿ ïàìÿòè
; edx = ... çàãðóçêè áèáëèîòåêè (ïîêà íå èñïîëüçóåòñÿ)
align 16
lib_init:
mov [mem.alloc], eax
mov [mem.free], ebx
mov [mem.realloc], ecx
mov [dll.load], edx
ret
align 4
proc draw_edge uses eax ebx ecx edx edi esi, box_l:dword, box_t:dword, box_w:dword, box_h:dword,\
col_0:dword, col_1:dword, col_2:dword
mov esi,[col_1]
and esi,111111101111111011111110b
mov eax,SF_DRAW_RECT
;bottom line
mov edx,[col_2]
mov ebx,[box_l]
shl ebx,16
add ebx,[box_w]
inc ebx ;äëÿ çàëèâêè äèàãîíàëüíûõ ïèêñåëåé
mov ecx,[box_t]
add ecx,[box_h]
shl ecx,16
inc ecx
mov edi,3 ;for cycle
@@:
;calculate colors
and edx,111111101111111011111110b
add edx,esi
shr edx,1
;line move up and ->...<-
sub ecx,1 shl 16 ;move up
add ebx,1 shl 16 ;->...
sub ebx,2 ;...<-
;draw line
int 0x40
dec edi
jnz @b
;right line
mov edx,[col_2]
mov ebx,[box_l]
add ebx,[box_w]
shl ebx,16
inc ebx
mov ecx,[box_t]
shl ecx,16
add ecx,[box_h]
mov edi,3 ;for cycle
@@:
;calculate colors
and edx,111111101111111011111110b
add edx,esi
shr edx,1
;line move left and ...
sub ebx,1 shl 16 ;move left
add ecx,1 shl 16
sub ecx,2
;draw line
int 0x40
dec edi
jnz @b
;top line
mov edx,[col_0]
mov ebx,[box_l]
shl ebx,16
add ebx,[box_w]
mov ecx,[box_t]
shl ecx,16
inc ecx
mov edi,3 ;for cycle
@@:
;calculate colors
and edx,111111101111111011111110b
add edx,esi
shr edx,1
;line move down and ->...<-
add ecx,1 shl 16 ;move down
add ebx,1 shl 16 ;->...
sub ebx,2 ;...<-
;draw line
int 0x40
dec edi
jnz @b
;left line
mov edx,[col_0]
mov ebx,[box_l]
shl ebx,16
inc ebx
mov ecx,[box_t]
shl ecx,16
add ecx,[box_h]
mov edi,3 ;for cycle
@@:
;calculate colors
and edx,111111101111111011111110b
add edx,esi
shr edx,1
;line move left and ...
add ebx,1 shl 16 ;move left
add ecx,1 shl 16
sub ecx,2
;draw line
int 0x40
dec edi
jnz @b
ret
endp
;äëÿ ðàáîòû ñ KPCK
IncludeIGlobals
IncludeUGlobals
align 16
EXPORTS:
dd sz_init, lib_init
dd sz_version, 0x00000001
dd sz_edit_box, edit_box_draw ;old function name
dd sz_edit_box_draw, edit_box_draw
dd sz_edit_box_key, edit_box_key
dd sz_edit_box_key_safe, edit_box_key_safe
dd sz_edit_box_mouse, edit_box_mouse
dd sz_edit_box_set_text, edit_box_set_text
dd szVersion_ed, 0x00000001
dd sz_init_checkbox, init_checkbox
dd sz_check_box_draw, check_box_draw
dd sz_check_box_mouse, check_box_mouse
dd szVersion_ch2, 0x00000002
dd sz_option_box_draw, option_box_draw
dd sz_option_box_mouse, option_box_mouse
dd szVersion_op, 0x00000001
dd sz_Scrollbar_ver_draw, scroll_bar_vertical.draw
dd sz_Scrollbar_ver_mouse, scroll_bar_vertical.mouse
dd sz_Scrollbar_hor_draw, scroll_bar_horizontal.draw
dd sz_Scrollbar_hor_mouse, scroll_bar_horizontal.mouse
dd szVersion_scrollbar, 0x00010001
dd sz_Dbutton_draw, dinamic_button.draw
dd sz_Dbutton_mouse, dinamic_button.mouse
dd szVersion_dbutton, 0x00010001
dd sz_Menu_bar_draw, menu_bar.draw
dd sz_Menu_bar_mouse, menu_bar.mouse
dd sz_Menu_bar_activate, menu_bar.activate
dd szVersion_menu_bar, 0x00010002
dd sz_FileBrowser_draw, fb_draw_panel
dd sz_FileBrowser_mouse, fb_mouse
dd sz_FileBrowser_key, fb_key
dd szVersion_FileBrowser, 0x00010001
dd sz_tl_data_init, tl_data_init
dd sz_tl_data_clear, tl_data_clear
dd sz_tl_info_clear, tl_info_clear
dd sz_tl_key, tl_key
dd sz_tl_mouse, tl_mouse
dd sz_tl_draw, tl_draw
dd sz_tl_info_undo, tl_info_undo
dd sz_tl_info_redo, tl_info_redo
dd sz_tl_node_add, tl_node_add
dd sz_tl_node_set_data, tl_node_set_data
dd sz_tl_node_get_data, tl_node_get_data
dd sz_tl_node_delete, tl_node_delete
dd sz_tl_cur_beg, tl_cur_beg
dd sz_tl_cur_next, tl_cur_next
dd sz_tl_cur_perv, tl_cur_perv
dd sz_tl_node_close_open, tl_node_close_open
dd sz_tl_node_lev_inc, tl_node_lev_inc
dd sz_tl_node_lev_dec, tl_node_lev_dec
dd sz_tl_node_move_up, tl_node_move_up
dd sz_tl_node_move_down, tl_node_move_down
dd sz_tl_node_poi_get_info, tl_node_poi_get_info
dd sz_tl_node_poi_get_next_info, tl_node_poi_get_next_info
dd sz_tl_node_poi_get_data, tl_node_poi_get_data
dd sz_tl_save_mem, tl_save_mem
dd sz_tl_load_mem, tl_load_mem
dd sz_tl_get_mem_size, tl_get_mem_size
dd sz_tl_version_tree_list, 0x00000001
dd sz_PathShow_prepare, path_show.prepare
dd sz_PathShow_draw, path_show.draw
dd szVersion_path_show, 0x00010001
dd sz_ted_but_sumb_upper, ted_but_sumb_upper
dd sz_ted_but_sumb_lover, ted_but_sumb_lover
dd sz_ted_but_convert_by_table, ted_but_convert_by_table
dd sz_ted_can_save, ted_can_save
dd sz_ted_clear, ted_clear
dd sz_ted_delete, ted_delete
dd sz_ted_draw, ted_draw
dd sz_ted_init, ted_init
dd sz_ted_init_scroll_bars, ted_init_scroll_bars
dd sz_ted_init_syntax_file, ted_init_syntax_file
dd sz_ted_is_select, ted_is_select
dd sz_ted_key, ted_key
dd sz_ted_mouse, ted_mouse
dd sz_ted_open_file, ted_open_file
dd sz_ted_save_file, ted_save_file
dd sz_ted_text_add, ted_text_add
dd sz_ted_but_select_word, ted_but_select_word
dd sz_ted_but_cut, ted_but_cut
dd sz_ted_but_copy, ted_but_copy
dd sz_ted_but_paste, ted_but_paste
dd sz_ted_but_undo, ted_but_undo
dd sz_ted_but_redo, ted_but_redo
dd sz_ted_but_reverse, ted_but_reverse
dd sz_ted_but_find, ted_but_find
dd sz_ted_but_replace, ted_but_replace
dd sz_ted_text_colored, ted_text_colored
dd sz_ted_go_to_position, ted_go_to_position
dd sz_ted_version, 6
dd sz_Frame_draw, frame.draw
dd szVersion_frame, 0x00010001
dd sz_progressbar_draw, progressbar_draw
dd sz_progressbar_progress, progressbar_progress
dd sz_tooltip_init, tooltip_init
dd sz_tooltip_delete, tooltip_delete
dd sz_tooltip_test_show, tooltip_test_show
dd sz_tooltip_mouse, tooltip_mouse
dd sz_get_font_size, get_font_size
dd 0,0
sz_init db 'lib_init',0
sz_version db 'version',0
sz_edit_box db 'edit_box',0
sz_edit_box_draw db 'edit_box_draw',0
sz_edit_box_key db 'edit_box_key',0
sz_edit_box_key_safe db 'edit_box_key_safe',0
sz_edit_box_mouse db 'edit_box_mouse',0
sz_edit_box_set_text db 'edit_box_set_text',0
szVersion_ed db 'version_ed',0
sz_init_checkbox db 'init_checkbox2',0
sz_check_box_draw db 'check_box_draw2',0
sz_check_box_mouse db 'check_box_mouse2',0
szVersion_ch2 db 'version_ch2',0
sz_option_box_draw db 'option_box_draw',0
sz_option_box_mouse db 'option_box_mouse',0
szVersion_op db 'version_op',0
sz_Scrollbar_ver_draw db 'scrollbar_v_draw',0
sz_Scrollbar_ver_mouse db 'scrollbar_v_mouse',0
sz_Scrollbar_hor_draw db 'scrollbar_h_draw',0
sz_Scrollbar_hor_mouse db 'scrollbar_h_mouse',0
szVersion_scrollbar db 'version_scrollbar',0
sz_Dbutton_draw db 'dbutton_draw',0
sz_Dbutton_mouse db 'dbutton_mouse',0
szVersion_dbutton db 'version_dbutton',0
sz_Menu_bar_draw db 'menu_bar_draw',0
sz_Menu_bar_mouse db 'menu_bar_mouse',0
sz_Menu_bar_activate db 'menu_bar_activate',0
szVersion_menu_bar db 'version_menu_bar',0
sz_FileBrowser_draw db 'FileBrowser_draw',0
sz_FileBrowser_mouse db 'FileBrowser_mouse',0
sz_FileBrowser_key db 'FileBrowser_key',0
szVersion_FileBrowser db 'version_FileBrowser',0
sz_tl_data_init db 'tl_data_init',0
sz_tl_data_clear db 'tl_data_clear',0
sz_tl_info_clear db 'tl_info_clear',0
sz_tl_key db 'tl_key',0
sz_tl_mouse db 'tl_mouse',0
sz_tl_draw db 'tl_draw',0
sz_tl_info_undo db 'tl_info_undo',0
sz_tl_info_redo db 'tl_info_redo',0
sz_tl_node_add db 'tl_node_add',0
sz_tl_node_set_data db 'tl_node_set_data',0
sz_tl_node_get_data db 'tl_node_get_data',0
sz_tl_node_delete db 'tl_node_delete',0
sz_tl_cur_beg db 'tl_cur_beg',0
sz_tl_cur_next db 'tl_cur_next',0
sz_tl_cur_perv db 'tl_cur_perv',0
sz_tl_node_close_open db 'tl_node_close_open',0
sz_tl_node_lev_inc db 'tl_node_lev_inc',0
sz_tl_node_lev_dec db 'tl_node_lev_dec',0
sz_tl_node_move_up db 'tl_node_move_up',0
sz_tl_node_move_down db 'tl_node_move_down',0
sz_tl_node_poi_get_info db 'tl_node_poi_get_info',0
sz_tl_node_poi_get_next_info db 'tl_node_poi_get_next_info',0
sz_tl_node_poi_get_data db 'tl_node_poi_get_data',0
sz_tl_save_mem db 'tl_save_mem',0
sz_tl_load_mem db 'tl_load_mem',0
sz_tl_get_mem_size db 'tl_get_mem_size',0
sz_tl_version_tree_list db 'version_tree_list',0
sz_PathShow_prepare db 'PathShow_prepare',0
sz_PathShow_draw db 'PathShow_draw',0
szVersion_path_show db 'version_PathShow',0
sz_ted_but_sumb_upper db 'ted_but_sumb_upper',0
sz_ted_but_sumb_lover db 'ted_but_sumb_lover',0
sz_ted_but_convert_by_table db 'ted_but_convert_by_table',0
sz_ted_can_save db 'ted_can_save',0
sz_ted_clear db 'ted_clear',0
sz_ted_delete db 'ted_delete',0
sz_ted_draw db 'ted_draw',0
sz_ted_init db 'ted_init',0
sz_ted_init_scroll_bars db 'ted_init_scroll_bars',0
sz_ted_init_syntax_file db 'ted_init_syntax_file',0
sz_ted_is_select db 'ted_is_select',0
sz_ted_key db 'ted_key',0
sz_ted_mouse db 'ted_mouse',0
sz_ted_open_file db 'ted_open_file',0
sz_ted_save_file db 'ted_save_file',0
sz_ted_text_add db 'ted_text_add',0
sz_ted_but_select_word db 'ted_but_select_word',0
sz_ted_but_cut db 'ted_but_cut',0
sz_ted_but_copy db 'ted_but_copy',0
sz_ted_but_paste db 'ted_but_paste',0
sz_ted_but_undo db 'ted_but_undo',0
sz_ted_but_redo db 'ted_but_redo',0
sz_ted_but_reverse db 'ted_but_reverse',0
sz_ted_but_find db 'ted_but_find',0
sz_ted_but_replace db 'ted_but_replace',0
sz_ted_text_colored db 'ted_text_colored',0
sz_ted_go_to_position db 'ted_go_to_position',0
sz_ted_version db 'version_text_edit',0
sz_Frame_draw db 'frame_draw',0
szVersion_frame db 'version_frame',0
sz_progressbar_draw db 'progressbar_draw', 0
sz_progressbar_progress db 'progressbar_progress', 0
sz_tooltip_init db 'tooltip_init', 0
sz_tooltip_delete db 'tooltip_delete', 0
sz_tooltip_test_show db 'tooltip_test_show', 0
sz_tooltip_mouse db 'tooltip_mouse', 0
sz_get_font_size db 'get_font_size', 0
; SPDX-License-Identifier: NOASSERTION
;
; Text encoded with Code Page Windows 1251 - Cyrillic
;*****************************************************************************
; Box_Lib - library of graphical components
; Copyright (C) KolibriOS team 2008-2020. All rights reserved.
;
; Authors:
; Alexey Teplov aka <Lrz>
; Marat Zakiyanov aka Mario79, aka Mario
; Evtikhov Maxim aka Maxxxx32
; Eugene Grechnikov aka Diamond
; hidnplayr
; Igor Afanasiev aka IgorA
;*****************************************************************************
format MS COFF
public EXPORTS
section '.flat' code readable align 16
include '../../../../macros.inc'
include '../../../../proc32.inc'
include '../../../../KOSfuncs.inc'
include 'box_lib.mac' ;macro which should make life easier :)
;include '../../../../debug.inc'
include 'keys.inc'
include '../../../../system/skincfg/kglobals.inc'
include '../../../../system/skincfg/unpacker.inc'
;-----------------------------------------------------------------------------
mem.alloc dd ? ;ôóíêöèÿ äëÿ âûäåëåíèÿ ïàìÿòè
mem.free dd ? ;ôóíêöèÿ äëÿ îñâîáîæäåíèÿ ïàìÿòè
mem.realloc dd ? ;ôóíêöèÿ äëÿ ïåðåðàñïðåäåëåíèÿ ïàìÿòè
dll.load dd ?
;----------------------------------------------------
include 'editbox.asm' ;editbox
include 'checkbox.asm' ;checkbox
include 'optionbox.asm' ;optionbox
include 'scrollbar.asm' ;scrollbar
include 'd_button.asm' ;dinamic_button
include 'menubar.asm' ;menubar
include 'filebrowser.asm' ;filebrowser
include 'tree_list.asm' ;tree_list, list_box
include 'pathshow.asm' ;pathshow
include 't_edit.asm' ;text_editor
include 'frame.asm' ;frame
include 'progressbar.asm' ;progressbar
include 'tooltip.asm' ;tooltip
;--------------------------------------------------
;input:
; eax = óêàçàòåëü íà ôóíêöèþ âûäåëåíèÿ ïàìÿòè
; ebx = ... îñâîáîæäåíèÿ ïàìÿòè
; ecx = ... ïåðåðàñïðåäåëåíèÿ ïàìÿòè
; edx = ... çàãðóçêè áèáëèîòåêè (ïîêà íå èñïîëüçóåòñÿ)
align 16
lib_init:
mov [mem.alloc], eax
mov [mem.free], ebx
mov [mem.realloc], ecx
mov [dll.load], edx
ret
align 4
proc draw_edge uses eax ebx ecx edx edi esi, box_l:dword, box_t:dword, box_w:dword, box_h:dword,\
col_0:dword, col_1:dword, col_2:dword
mov esi,[col_1]
and esi,111111101111111011111110b
mov eax,SF_DRAW_RECT
;bottom line
mov edx,[col_2]
mov ebx,[box_l]
shl ebx,16
add ebx,[box_w]
inc ebx ;äëÿ çàëèâêè äèàãîíàëüíûõ ïèêñåëåé
mov ecx,[box_t]
add ecx,[box_h]
shl ecx,16
inc ecx
mov edi,3 ;for cycle
@@:
;calculate colors
and edx,111111101111111011111110b
add edx,esi
shr edx,1
;line move up and ->...<-
sub ecx,1 shl 16 ;move up
add ebx,1 shl 16 ;->...
sub ebx,2 ;...<-
;draw line
int 0x40
dec edi
jnz @b
;right line
mov edx,[col_2]
mov ebx,[box_l]
add ebx,[box_w]
shl ebx,16
inc ebx
mov ecx,[box_t]
shl ecx,16
add ecx,[box_h]
mov edi,3 ;for cycle
@@:
;calculate colors
and edx,111111101111111011111110b
add edx,esi
shr edx,1
;line move left and ...
sub ebx,1 shl 16 ;move left
add ecx,1 shl 16
sub ecx,2
;draw line
int 0x40
dec edi
jnz @b
;top line
mov edx,[col_0]
mov ebx,[box_l]
shl ebx,16
add ebx,[box_w]
mov ecx,[box_t]
shl ecx,16
inc ecx
mov edi,3 ;for cycle
@@:
;calculate colors
and edx,111111101111111011111110b
add edx,esi
shr edx,1
;line move down and ->...<-
add ecx,1 shl 16 ;move down
add ebx,1 shl 16 ;->...
sub ebx,2 ;...<-
;draw line
int 0x40
dec edi
jnz @b
;left line
mov edx,[col_0]
mov ebx,[box_l]
shl ebx,16
inc ebx
mov ecx,[box_t]
shl ecx,16
add ecx,[box_h]
mov edi,3 ;for cycle
@@:
;calculate colors
and edx,111111101111111011111110b
add edx,esi
shr edx,1
;line move left and ...
add ebx,1 shl 16 ;move left
add ecx,1 shl 16
sub ecx,2
;draw line
int 0x40
dec edi
jnz @b
ret
endp
;äëÿ ðàáîòû ñ KPCK
IncludeIGlobals
IncludeUGlobals
align 16
EXPORTS:
dd sz_init, lib_init
dd sz_version, 0x00000001
dd sz_edit_box, edit_box_draw ;old function name
dd sz_edit_box_draw, edit_box_draw
dd sz_edit_box_key, edit_box_key
dd sz_edit_box_key_safe, edit_box_key_safe
dd sz_edit_box_mouse, edit_box_mouse
dd sz_edit_box_set_text, edit_box_set_text
dd szVersion_ed, 0x00000001
dd sz_init_checkbox, init_checkbox
dd sz_check_box_draw, check_box_draw
dd sz_check_box_mouse, check_box_mouse
dd szVersion_ch2, 0x00000002
dd sz_option_box_draw, option_box_draw
dd sz_option_box_mouse, option_box_mouse
dd szVersion_op, 0x00000001
dd sz_Scrollbar_ver_draw, scroll_bar_vertical.draw
dd sz_Scrollbar_ver_mouse, scroll_bar_vertical.mouse
dd sz_Scrollbar_hor_draw, scroll_bar_horizontal.draw
dd sz_Scrollbar_hor_mouse, scroll_bar_horizontal.mouse
dd szVersion_scrollbar, 0x00010001
dd sz_Dbutton_draw, dinamic_button.draw
dd sz_Dbutton_mouse, dinamic_button.mouse
dd szVersion_dbutton, 0x00010001
dd sz_Menu_bar_draw, menu_bar.draw
dd sz_Menu_bar_mouse, menu_bar.mouse
dd sz_Menu_bar_activate, menu_bar.activate
dd szVersion_menu_bar, 0x00010002
dd sz_FileBrowser_draw, fb_draw_panel
dd sz_FileBrowser_mouse, fb_mouse
dd sz_FileBrowser_key, fb_key
dd szVersion_FileBrowser, 0x00010001
dd sz_tl_data_init, tl_data_init
dd sz_tl_data_clear, tl_data_clear
dd sz_tl_info_clear, tl_info_clear
dd sz_tl_key, tl_key
dd sz_tl_mouse, tl_mouse
dd sz_tl_draw, tl_draw
dd sz_tl_info_undo, tl_info_undo
dd sz_tl_info_redo, tl_info_redo
dd sz_tl_node_add, tl_node_add
dd sz_tl_node_set_data, tl_node_set_data
dd sz_tl_node_get_data, tl_node_get_data
dd sz_tl_node_delete, tl_node_delete
dd sz_tl_cur_beg, tl_cur_beg
dd sz_tl_cur_next, tl_cur_next
dd sz_tl_cur_perv, tl_cur_perv
dd sz_tl_node_close_open, tl_node_close_open
dd sz_tl_node_lev_inc, tl_node_lev_inc
dd sz_tl_node_lev_dec, tl_node_lev_dec
dd sz_tl_node_move_up, tl_node_move_up
dd sz_tl_node_move_down, tl_node_move_down
dd sz_tl_node_poi_get_info, tl_node_poi_get_info
dd sz_tl_node_poi_get_next_info, tl_node_poi_get_next_info
dd sz_tl_node_poi_get_data, tl_node_poi_get_data
dd sz_tl_save_mem, tl_save_mem
dd sz_tl_load_mem, tl_load_mem
dd sz_tl_get_mem_size, tl_get_mem_size
dd sz_tl_version_tree_list, 0x00000001
dd sz_PathShow_prepare, path_show.prepare
dd sz_PathShow_draw, path_show.draw
dd szVersion_path_show, 0x00010001
dd sz_ted_but_sumb_upper, ted_but_sumb_upper
dd sz_ted_but_sumb_lover, ted_but_sumb_lover
dd sz_ted_but_convert_by_table, ted_but_convert_by_table
dd sz_ted_can_save, ted_can_save
dd sz_ted_clear, ted_clear
dd sz_ted_delete, ted_delete
dd sz_ted_draw, ted_draw
dd sz_ted_init, ted_init
dd sz_ted_init_scroll_bars, ted_init_scroll_bars
dd sz_ted_init_syntax_file, ted_init_syntax_file
dd sz_ted_is_select, ted_is_select
dd sz_ted_key, ted_key
dd sz_ted_mouse, ted_mouse
dd sz_ted_open_file, ted_open_file
dd sz_ted_save_file, ted_save_file
dd sz_ted_text_add, ted_text_add
dd sz_ted_but_select_word, ted_but_select_word
dd sz_ted_but_cut, ted_but_cut
dd sz_ted_but_copy, ted_but_copy
dd sz_ted_but_paste, ted_but_paste
dd sz_ted_but_undo, ted_but_undo
dd sz_ted_but_redo, ted_but_redo
dd sz_ted_but_reverse, ted_but_reverse
dd sz_ted_but_find, ted_but_find
dd sz_ted_but_replace, ted_but_replace
dd sz_ted_text_colored, ted_text_colored
dd sz_ted_go_to_position, ted_go_to_position
dd sz_ted_version, 6
dd sz_Frame_draw, frame.draw
dd szVersion_frame, 0x00010001
dd sz_progressbar_draw, progressbar_draw
dd sz_progressbar_progress, progressbar_progress
dd sz_tooltip_init, tooltip_init
dd sz_tooltip_delete, tooltip_delete
dd sz_tooltip_test_show, tooltip_test_show
dd sz_tooltip_mouse, tooltip_mouse
dd sz_get_font_size, get_font_size
dd 0,0
sz_init db 'lib_init',0
sz_version db 'version',0
sz_edit_box db 'edit_box',0
sz_edit_box_draw db 'edit_box_draw',0
sz_edit_box_key db 'edit_box_key',0
sz_edit_box_key_safe db 'edit_box_key_safe',0
sz_edit_box_mouse db 'edit_box_mouse',0
sz_edit_box_set_text db 'edit_box_set_text',0
szVersion_ed db 'version_ed',0
sz_init_checkbox db 'init_checkbox2',0
sz_check_box_draw db 'check_box_draw2',0
sz_check_box_mouse db 'check_box_mouse2',0
szVersion_ch2 db 'version_ch2',0
sz_option_box_draw db 'option_box_draw',0
sz_option_box_mouse db 'option_box_mouse',0
szVersion_op db 'version_op',0
sz_Scrollbar_ver_draw db 'scrollbar_v_draw',0
sz_Scrollbar_ver_mouse db 'scrollbar_v_mouse',0
sz_Scrollbar_hor_draw db 'scrollbar_h_draw',0
sz_Scrollbar_hor_mouse db 'scrollbar_h_mouse',0
szVersion_scrollbar db 'version_scrollbar',0
sz_Dbutton_draw db 'dbutton_draw',0
sz_Dbutton_mouse db 'dbutton_mouse',0
szVersion_dbutton db 'version_dbutton',0
sz_Menu_bar_draw db 'menu_bar_draw',0
sz_Menu_bar_mouse db 'menu_bar_mouse',0
sz_Menu_bar_activate db 'menu_bar_activate',0
szVersion_menu_bar db 'version_menu_bar',0
sz_FileBrowser_draw db 'FileBrowser_draw',0
sz_FileBrowser_mouse db 'FileBrowser_mouse',0
sz_FileBrowser_key db 'FileBrowser_key',0
szVersion_FileBrowser db 'version_FileBrowser',0
sz_tl_data_init db 'tl_data_init',0
sz_tl_data_clear db 'tl_data_clear',0
sz_tl_info_clear db 'tl_info_clear',0
sz_tl_key db 'tl_key',0
sz_tl_mouse db 'tl_mouse',0
sz_tl_draw db 'tl_draw',0
sz_tl_info_undo db 'tl_info_undo',0
sz_tl_info_redo db 'tl_info_redo',0
sz_tl_node_add db 'tl_node_add',0
sz_tl_node_set_data db 'tl_node_set_data',0
sz_tl_node_get_data db 'tl_node_get_data',0
sz_tl_node_delete db 'tl_node_delete',0
sz_tl_cur_beg db 'tl_cur_beg',0
sz_tl_cur_next db 'tl_cur_next',0
sz_tl_cur_perv db 'tl_cur_perv',0
sz_tl_node_close_open db 'tl_node_close_open',0
sz_tl_node_lev_inc db 'tl_node_lev_inc',0
sz_tl_node_lev_dec db 'tl_node_lev_dec',0
sz_tl_node_move_up db 'tl_node_move_up',0
sz_tl_node_move_down db 'tl_node_move_down',0
sz_tl_node_poi_get_info db 'tl_node_poi_get_info',0
sz_tl_node_poi_get_next_info db 'tl_node_poi_get_next_info',0
sz_tl_node_poi_get_data db 'tl_node_poi_get_data',0
sz_tl_save_mem db 'tl_save_mem',0
sz_tl_load_mem db 'tl_load_mem',0
sz_tl_get_mem_size db 'tl_get_mem_size',0
sz_tl_version_tree_list db 'version_tree_list',0
sz_PathShow_prepare db 'PathShow_prepare',0
sz_PathShow_draw db 'PathShow_draw',0
szVersion_path_show db 'version_PathShow',0
sz_ted_but_sumb_upper db 'ted_but_sumb_upper',0
sz_ted_but_sumb_lover db 'ted_but_sumb_lover',0
sz_ted_but_convert_by_table db 'ted_but_convert_by_table',0
sz_ted_can_save db 'ted_can_save',0
sz_ted_clear db 'ted_clear',0
sz_ted_delete db 'ted_delete',0
sz_ted_draw db 'ted_draw',0
sz_ted_init db 'ted_init',0
sz_ted_init_scroll_bars db 'ted_init_scroll_bars',0
sz_ted_init_syntax_file db 'ted_init_syntax_file',0
sz_ted_is_select db 'ted_is_select',0
sz_ted_key db 'ted_key',0
sz_ted_mouse db 'ted_mouse',0
sz_ted_open_file db 'ted_open_file',0
sz_ted_save_file db 'ted_save_file',0
sz_ted_text_add db 'ted_text_add',0
sz_ted_but_select_word db 'ted_but_select_word',0
sz_ted_but_cut db 'ted_but_cut',0
sz_ted_but_copy db 'ted_but_copy',0
sz_ted_but_paste db 'ted_but_paste',0
sz_ted_but_undo db 'ted_but_undo',0
sz_ted_but_redo db 'ted_but_redo',0
sz_ted_but_reverse db 'ted_but_reverse',0
sz_ted_but_find db 'ted_but_find',0
sz_ted_but_replace db 'ted_but_replace',0
sz_ted_text_colored db 'ted_text_colored',0
sz_ted_go_to_position db 'ted_go_to_position',0
sz_ted_version db 'version_text_edit',0
sz_Frame_draw db 'frame_draw',0
szVersion_frame db 'version_frame',0
sz_progressbar_draw db 'progressbar_draw', 0
sz_progressbar_progress db 'progressbar_progress', 0
sz_tooltip_init db 'tooltip_init', 0
sz_tooltip_delete db 'tooltip_delete', 0
sz_tooltip_test_show db 'tooltip_test_show', 0
sz_tooltip_mouse db 'tooltip_mouse', 0
sz_get_font_size db 'get_font_size', 0
@@ -27,7 +27,7 @@
;; ;;
;;================================================================================================;;
include 'xcf.inc'
;include '../../../../../system/board/trunk/debug.inc'
;include '../../../../../system/board/debug.inc'
MAX_LAYERS = 255
@@ -821,7 +821,7 @@ endl
mov [bottom_x1], 0
mov ecx, [ebx + Image.Width]
mov [bottom_length], ecx
mov [bottom_length], ecx
mov eax, [edx + Image.Extended]
movsx eax, word[eax + xcf_ext.offset_x]
@@ -858,7 +858,7 @@ endl
mov [bottom_y1], 0
mov ecx, [ebx + Image.Height]
mov [bottom_length], ecx
mov [bottom_length], ecx
mov eax, [edx + Image.Extended]
movsx eax, word[eax + xcf_ext.offset_y]
@@ -972,7 +972,7 @@ endl
add edi, edx
mov edx, [edi]
jmp .composite_found
@@:
@@:
add edi, 16
dec ecx
jnz .still
File diff suppressed because it is too large Load Diff
+435 -429
View File
@@ -1,429 +1,435 @@
;Ž£à®¬­ ï ¡« £®¤ à­®áâì ¢á¥¬, ªâ® ¯®¬®£ «: ª®¤®¬/ᮢ¥â®¬/¤¨§ ©­®¬ ...
use32
org 0
db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
dd 1, start, i_end, mem, stacktop, file_name, sys_path
MAX_COLOR_WORD_LEN equ 40
maxChars equ 100002 ;(ª®««¨ç¥á⢮ ᨬ¢®«®¢ ¢ ­®¢®¬ ¤®ªã¬¥­â¥ + 2)
BUF_SIZE equ 4096 ;buffer for copy|paste
maxSyntaxFileSize equ 410000
TOOLBAR_ICONS_SIZE equ 1200*21
include '../../proc32.inc'
include '../../macros.inc'
include '../../KOSfuncs.inc'
include '../../load_img.inc'
include '../../load_lib.mac'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../system/skincfg/trunk/kglobals.inc'
include '../../system/skincfg/trunk/unpacker.inc'
include 'lang.inc'
include 't_data.inc'
include 't_button.inc'
include 't_menu.inc'
include 'strlen.inc'
include 't_draw.inc' ;draw main window functions
include 'wnd_k_words.inc'
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
align 4
icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
run_file_70 FileInfoBlock
align 4
start:
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
mcall SF_SYS_MISC,SSF_HEAP_INIT
or eax,eax
jnz @f
call ted_Exit
@@:
mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1 ;scan code
mcall SF_SET_EVENTS_MASK,0xC0000027
mov esi,file_name
stdcall str_len,esi
mov ecx,eax
mov edi,openfile_path
cld
rep movsb ;ª®¯¨à㥬 ¨¬ï ä ©«  ¢ ¡ãä¥à openfile_path
load_libraries l_libs_start,load_lib_end
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨«¨áì ¡¨¡«¨®â¥ª¨
mov ebp,lib0
.test_lib_open:
cmp dword [ebp+ll_struc_size-4],0
jz @f
mcall SF_TERMINATE_PROCESS ;exit not correct
@@:
add ebp,ll_struc_size
cmp ebp,load_lib_end
jl .test_lib_open
;---------------------------------------------------------------------
stdcall [ted_init], tedit0
stdcall [tl_data_init], tree1
option_boxes_set_sys_color sc,opt_grlist1
init_checkboxes2 check_boxes,check_boxes_end
check_boxes_set_sys_color2 check_boxes,check_boxes_end,sc
; OpenDialog initialisation
stdcall [OpenDialog_Init],OpenDialog_data
; kmenu initialisation
call tedit_menu_init
; init toolbar file
include_image_file 'te_icon.png', bmp_icon,,,6 ;6 ¤«ï á¥àëå ª­®¯®ª
mov eax,[bmp_icon]
add eax,TOOLBAR_ICONS_SIZE
stdcall img_to_gray, [bmp_icon],eax,(TOOLBAR_ICONS_SIZE)/3
;---------------------------------------------------------------------
; ¢­¥¤à塞 ä ©« á ªãàá®à ¬¨ ¨ «¨­¨ï¬¨
include_image_file '..\..\media\log_el\trunk\tl_sys_16.png', icon_tl_sys
mov eax,dword[icon_tl_sys]
mov dword[tree1.data_img_sys],eax
; ¢­¥¤à塞 ä ©« á ¨ª®­ª ¬¨ ã§«®¢
include_image_file 'tl_nod_16.png', icon_tl_sys
mov eax,dword[icon_tl_sys]
mov dword[tree1.data_img],eax
;------------------------------------------------------------------------------
copy_path fn_syntax_dir,sys_path,file_name,0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ ᨭ⠪á¨á 
xor eax,eax
mov ecx,4096
mov edi,file_name
repnz scasb
mov byte[edi-2],al ;㡨ࠥ¬ '/' ¢ ª®­æ¥ ¨¬¥­¨ ¯ ¯ª¨ (­ã¦­® ¤«ï ç⥭¨ï á CD)
mcall SF_FILE,tree_file_struct
or ebx,ebx
jz .end_dir_init
mov eax,dir_mem+32+40
mov ecx,ebx
@@:
cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥­ ¬¨ '.' ¨ '..'
je .filter
;0x10000 ;1*2^16 - £¤¥ 1 ­®¬¥à ¨ª®­ª¨ á ª­¨£®©
stdcall [tl_node_add], tree1,0x10000,eax
stdcall [tl_cur_next], tree1
.filter:
add eax,304
loop @b
stdcall [tl_cur_beg],tree1 ;áâ ¢¨¬ ªãàá®à ­  ­ ç «® ᯨ᪠
or dword[tree1.style], tl_cursor_pos_limited ;®£à ­¨ç¨¢ ¥¬ ¤¢¨¦¥­¨¥ ªãàá®à  ¢ ¯à¥¤¥« å ᯨ᪠
.end_dir_init:
;--- load ini file ---
copy_path ini_name,sys_path,file_name,0
;window startup pozition
stdcall [ini_get_int],file_name,ini_sec_window,key_window_l,ini_def_window_l
mov word[wnd_s_pos+2],ax
stdcall [ini_get_int],file_name,ini_sec_window,key_window_w,ini_def_window_w
mov word[wnd_s_pos],ax
stdcall [ini_get_int],file_name,ini_sec_window,key_window_t,ini_def_window_t
mov word[wnd_s_pos+6],ax
stdcall [ini_get_int],file_name,ini_sec_window,key_window_h,ini_def_window_h
mov word[wnd_s_pos+4],ax
;scrool type
stdcall [ini_get_int],file_name,ini_sec_window,key_scroll_type,ini_def_scroll_type
mov [wScr.type],eax
mov [hScr.type],eax
mov [ws_dir_lbox.type],eax
mov [w_scr_t3.type],eax
;symbol size
stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_w,ini_def_symbol_w
mov dword[tedit0.rec.width],eax
stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_h,ini_def_symbol_h
mov dword[tedit0.rec.height],eax
;lea eax,[eax+eax*2]
;mov dword[tedit0.rec.top],eax
;font size
stdcall [ini_get_int],file_name,ini_sec_window,key_font_s,ini_def_font_s
shl eax,24
mov dword[tedit0.font_size],eax
;ª­®¯ª¨ ­  ¯ ­¥«¨
ini_panel key_but_new, ID_BUT_NEW
ini_panel key_but_open, ID_BUT_OPEN
ini_panel key_but_save, ID_BUT_SAVE
ini_panel key_but_save_as,ID_BUT_SAVE_AS
ini_panel key_but_select, ID_BUT_SELECT
ini_panel key_but_cut, ID_BUT_CUT
ini_panel key_but_copy, ID_BUT_COPY
ini_panel key_but_paste, ID_BUT_PASTE
ini_panel key_but_find, ID_BUT_FIND
ini_panel key_but_replace,ID_BUT_REPLACE
ini_panel key_but_key_words,ID_BUT_KEY_WORDS
ini_panel key_but_upper, ID_BUT_UPPER
ini_panel key_but_lower, ID_BUT_LOWER
ini_panel key_but_reverse,ID_BUT_REVERSE
ini_panel key_but_undo, ID_BUT_UNDO
ini_panel key_but_redo, ID_BUT_REDO
ini_panel key_but_invisible,ID_BUT_INVISIBLE
ini_panel key_but_syntax_list,ID_BUT_SYNTAX_LIST
ini_panel key_but_syntax_mode,ID_BUT_SYNTAX_MODE
ini_panel key_but_convert_1251_866,ID_BUT_CONVERT_1251_866
ini_panel key_but_convert_866_1251,ID_BUT_CONVERT_866_1251
;ä ©«®¢ë¥ à áè¨à¥­¨ï
xor edx,edx
mov ebx,synt_auto_open
@@:
;¡¥à¥¬ ¨¬ï ä ©« 
stdcall [ini_get_str],file_name,ini_sec_options,key_synt_file,ebx,32,ini_def_synt_f
cmp byte[ebx],0
je @f
inc byte[key_synt_file.numb]
add ebx,32
;¡¥à¥¬ à áè¨à¥­¨ï
stdcall [ini_get_str],file_name,ini_sec_options,key_synt_ext,ebx,32,ini_def_synt_f
inc byte[key_synt_ext.numb]
add ebx,32
inc edx
cmp edx,max_synt_auto_open
jl @b
@@:
;--- load color option file ---
stdcall open_unpac_synt_file,[fn_col_option]
;--- get cmd line ---
cmp byte[openfile_path+3],0 ;openfile_path
je @f ;if file names exist
mov esi,openfile_path
stdcall auto_open_syntax,esi
call but_no_msg_OpenFile
@@:
align 16
red_win:
call draw_window
align 16
still:
mcall SF_WAIT_EVENT
cmp dword[exit_code],1
jne @f
call ted_Exit
jmp still
@@:
cmp al,1 ;¨§¬¥­¨«®áì ¯®«®¦¥­¨¥ ®ª­ 
jz red_win
cmp al,2
jz key
cmp al,3
jz button
cmp al,6 ;¬ëèì
jne @f
call mouse
@@:
jmp still
align 16
mouse:
stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
cmp word[tedit0.wnd.top],ax
jg .no_edit
shr eax,16
cmp word[tedit0.wnd.left],ax
jg .no_edit
mcall SF_MOUSE_GET,SSF_BUTTON_EXT
bt eax,24 ;¤¢®©­®© 饫çñª «¥¢®© ª­®¯ª®©
jnc @f
stdcall [ted_but_select_word], tedit0
ret
@@:
stdcall [ted_mouse], tedit0
.no_edit:
;¯à®¢¥àª  ¡®ª®¢ëå ¯ ­¥«¥©
cmp byte[tedit0.panel_id],TED_PANEL_FIND
jne @f
stdcall [edit_box_mouse], edit_find
stdcall [option_box_mouse], opt_grlist1
stdcall [check_box_mouse], ch1
@@:
cmp byte[tedit0.panel_id],TED_PANEL_REPLACE
jne @f
stdcall [edit_box_mouse], edit_find
stdcall [edit_box_mouse], edit_replace
stdcall [option_box_mouse], opt_grlist1
@@:
cmp byte[tedit0.panel_id],TED_PANEL_SYNTAX
jne @f
stdcall [tl_mouse], tree1
@@:
cmp byte[tedit0.panel_id],TED_PANEL_GOTO
jne @f
stdcall [edit_box_mouse], edit_goto
@@:
ret
;---------------------------------------------------------------------
;output:
; ah = symbol
align 16
proc KeyConvertToASCII uses ebx, table:dword
mov ebx,dword[table] ;convert scan to ascii
shr ax,8
add bx,ax
mov ah,byte[ebx]
ret
endp
align 16
key:
mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
xor esi,esi
mov ecx,1
test al,3 ;[Shift]
jz @f
mov cl,2
or esi,KM_SHIFT
@@:
test al,0x0c ;[Ctrl]
jz @f
or esi,KM_CTRL
@@:
test al,0x30 ;[Alt]
jz @f
mov cl,3
or esi,KM_ALT
@@:
test al,0x80 ;[NumLock]
jz @f
or esi,KM_NUMLOCK
@@:
mcall SF_SYSTEM_GET,SSF_KEYBOARD_LAYOUT,,conv_tabl ;26.2 ¯®«ãç¨âì à áª« ¤ªã ª« ¢¨ âãàë
mcall SF_GET_KEY
stdcall [tl_key], tree1
test word[edit_replace.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f
cmp ah,0x80 ;if key up
ja still
cmp ah,42 ;[Shift] (left)
je still
cmp ah,54 ;[Shift] (right)
je still
cmp ah,56 ;[Alt]
je still
cmp ah,29 ;[Ctrl]
je still
cmp ah,69 ;[Pause Break]
je still
stdcall KeyConvertToASCII, conv_tabl
stdcall [edit_box_key], edit_replace
jmp still
@@:
test word[edit_find.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f
cmp ah,0x80 ;if key up
ja still
cmp ah,42 ;[Shift] (left)
je still
cmp ah,54 ;[Shift] (right)
je still
cmp ah,56 ;[Alt]
je still
cmp ah,29 ;[Ctrl]
je still
cmp ah,69 ;[Pause Break]
je still
stdcall KeyConvertToASCII, conv_tabl
stdcall [edit_box_key], edit_find
jmp still
@@:
test word[edit_goto.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f
cmp ah,0x80 ;if key up
ja still
cmp ah,42 ;[Shift] (left)
je still
cmp ah,54 ;[Shift] (right)
je still
cmp ah,56 ;[Alt]
je still
cmp ah,29 ;[Ctrl]
je still
cmp ah,69 ;[Pause Break]
je still
stdcall KeyConvertToASCII, conv_tabl
stdcall [edit_box_key], edit_goto
jmp still
@@:
stdcall [ted_key], tedit0, conv_tabl,esi
jmp still
align 4
edit_replace edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_replace, mouse_dd, 0
edit_find edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
edit_goto edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 10, buf_goto, mouse_dd, 0
unpac_mem dd 0
;library structures
l_libs_start:
lib0 l_libs lib_name_0, file_name, system_dir_0, import_box_lib
lib1 l_libs lib_name_1, file_name, system_dir_1, import_msgbox_lib
lib2 l_libs lib_name_2, file_name, system_dir_2, import_proclib
lib3 l_libs lib_name_3, file_name, system_dir_3, import_libimg
lib4 l_libs lib_name_4, file_name, system_dir_4, import_libini
lib5 l_libs lib_name_5, file_name, system_dir_5, import_libkmenu
load_lib_end:
IncludeIGlobals
hed db 'TextEdit '
i_end:
openfile_path: ;¯®«­ë© ¯ãâì ª ä ©«ã á ª®â®àë¬ ¨¤¥â à ¡®â 
rb 4096
dir_mem rb 32+304*count_of_dir_list_files
wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
rq 1
last_open_synt_file rb 32 ;¨¬ï ¯®á«¥¤­¥£® ¯®¤ª«î祭­®£® ä ©«  ᨭ⠪á¨á 
buf rb BUF_SIZE ;¡ãä¥à ¤«ï ª®¯¨à®¢ ­¨ï ¨ ¢áâ ¢ª¨
buf_find rb 302 ;¡ãä¥à ¤«ï ¯®¨áª  ⥪áâ 
buf_replace rb 302 ;¡ãä¥à ¤«ï § ¬¥­ë ⥪áâ 
buf_goto rb 12 ;¡ãä¥à ¤«ï ¯¥à室  ­  áâபã
sc system_colors
IncludeUGlobals
align 16
procinfo process_information
rb 1024
thread:
rb 4096
align 16
thread_coords:
rb 4096
align 16
stacktop:
sys_path: ;¯ãâì ®âªã¤  § ¯ãá⨫áï ¨á¯®«­ï¥¬ë© ä ©«
rb 4096
file_name: ;¯ à ¬¥âàë § ¯ã᪠
rb 4096
syntax_path: ;¨¬ï ¯®¤ª«îç ¥¬®£® ä ©«  ᨭ⠪á¨á 
rb 4096
plugin_path:
rb 4096
text_work_area: ;¯ãâì ª ä ©«ã, ª®â®àë© ¯®ª §ë¢ ¥âáï ¢ ®ª­¥
rb 4096
filename_area: ;¨¬ï ä ©«  ¤«ï ¤¨ «®£  ®âªàëâ¨ï/§ ªàëâ¨ï
rb 256
file_info:
rb 40
mem:
; SPDX-License-Identifier: NOASSERTION
;
; Text encoded with Code Page 866 - Cyrillic
;Ž£à®¬­ ï ¡« £®¤ à­®áâì ¢á¥¬, ªâ® ¯®¬®£ «: ª®¤®¬/ᮢ¥â®¬/¤¨§ ©­®¬ ...
use32
org 0
db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
dd 1, start, i_end, mem, stacktop, file_name, sys_path
MAX_COLOR_WORD_LEN equ 40
maxChars equ 100002 ;(ª®««¨ç¥á⢮ ᨬ¢®«®¢ ¢ ­®¢®¬ ¤®ªã¬¥­â¥ + 2)
BUF_SIZE equ 4096 ;buffer for copy|paste
maxSyntaxFileSize equ 410000
TOOLBAR_ICONS_SIZE equ 1200*21
include '../../proc32.inc'
include '../../macros.inc'
include '../../KOSfuncs.inc'
include '../../load_img.inc'
include '../../load_lib.mac'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../system/skincfg/kglobals.inc'
include '../../system/skincfg/unpacker.inc'
include 'lang.inc'
include 't_data.inc'
include 't_button.inc'
include 't_menu.inc'
include 'strlen.inc'
include 't_draw.inc' ;draw main window functions
include 'wnd_k_words.inc'
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
align 4
icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
run_file_70 FileInfoBlock
align 4
start:
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
mcall SF_SYS_MISC,SSF_HEAP_INIT
or eax,eax
jnz @f
call ted_Exit
@@:
mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1 ;scan code
mcall SF_SET_EVENTS_MASK,0xC0000027
mov esi,file_name
stdcall str_len,esi
mov ecx,eax
mov edi,openfile_path
cld
rep movsb ;ª®¯¨à㥬 ¨¬ï ä ©«  ¢ ¡ãä¥à openfile_path
load_libraries l_libs_start,load_lib_end
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨«¨áì ¡¨¡«¨®â¥ª¨
mov ebp,lib0
.test_lib_open:
cmp dword [ebp+ll_struc_size-4],0
jz @f
mcall SF_TERMINATE_PROCESS ;exit not correct
@@:
add ebp,ll_struc_size
cmp ebp,load_lib_end
jl .test_lib_open
;---------------------------------------------------------------------
stdcall [ted_init], tedit0
stdcall [tl_data_init], tree1
option_boxes_set_sys_color sc,opt_grlist1
init_checkboxes2 check_boxes,check_boxes_end
check_boxes_set_sys_color2 check_boxes,check_boxes_end,sc
; OpenDialog initialisation
stdcall [OpenDialog_Init],OpenDialog_data
; kmenu initialisation
call tedit_menu_init
; init toolbar file
include_image_file 'te_icon.png', bmp_icon,,,6 ;6 ¤«ï á¥àëå ª­®¯®ª
mov eax,[bmp_icon]
add eax,TOOLBAR_ICONS_SIZE
stdcall img_to_gray, [bmp_icon],eax,(TOOLBAR_ICONS_SIZE)/3
;---------------------------------------------------------------------
; ¢­¥¤à塞 ä ©« á ªãàá®à ¬¨ ¨ «¨­¨ï¬¨
include_image_file '..\..\media\log_el\trunk\tl_sys_16.png', icon_tl_sys
mov eax,dword[icon_tl_sys]
mov dword[tree1.data_img_sys],eax
; ¢­¥¤à塞 ä ©« á ¨ª®­ª ¬¨ ã§«®¢
include_image_file 'tl_nod_16.png', icon_tl_sys
mov eax,dword[icon_tl_sys]
mov dword[tree1.data_img],eax
;------------------------------------------------------------------------------
copy_path fn_syntax_dir,sys_path,file_name,0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ ᨭ⠪á¨á 
xor eax,eax
mov ecx,4096
mov edi,file_name
repnz scasb
mov byte[edi-2],al ;㡨ࠥ¬ '/' ¢ ª®­æ¥ ¨¬¥­¨ ¯ ¯ª¨ (­ã¦­® ¤«ï ç⥭¨ï á CD)
mcall SF_FILE,tree_file_struct
or ebx,ebx
jz .end_dir_init
mov eax,dir_mem+32+40
mov ecx,ebx
@@:
cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥­ ¬¨ '.' ¨ '..'
je .filter
;0x10000 ;1*2^16 - £¤¥ 1 ­®¬¥à ¨ª®­ª¨ á ª­¨£®©
stdcall [tl_node_add], tree1,0x10000,eax
stdcall [tl_cur_next], tree1
.filter:
add eax,304
loop @b
stdcall [tl_cur_beg],tree1 ;áâ ¢¨¬ ªãàá®à ­  ­ ç «® ᯨ᪠
or dword[tree1.style], tl_cursor_pos_limited ;®£à ­¨ç¨¢ ¥¬ ¤¢¨¦¥­¨¥ ªãàá®à  ¢ ¯à¥¤¥« å ᯨ᪠
.end_dir_init:
;--- load ini file ---
copy_path ini_name,sys_path,file_name,0
;window startup pozition
stdcall [ini_get_int],file_name,ini_sec_window,key_window_l,ini_def_window_l
mov word[wnd_s_pos+2],ax
stdcall [ini_get_int],file_name,ini_sec_window,key_window_w,ini_def_window_w
mov word[wnd_s_pos],ax
stdcall [ini_get_int],file_name,ini_sec_window,key_window_t,ini_def_window_t
mov word[wnd_s_pos+6],ax
stdcall [ini_get_int],file_name,ini_sec_window,key_window_h,ini_def_window_h
mov word[wnd_s_pos+4],ax
;scrool type
stdcall [ini_get_int],file_name,ini_sec_window,key_scroll_type,ini_def_scroll_type
mov [wScr.type],eax
mov [hScr.type],eax
mov [ws_dir_lbox.type],eax
mov [w_scr_t3.type],eax
;symbol size
stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_w,ini_def_symbol_w
mov dword[tedit0.rec.width],eax
stdcall [ini_get_int],file_name,ini_sec_window,key_symbol_h,ini_def_symbol_h
mov dword[tedit0.rec.height],eax
;lea eax,[eax+eax*2]
;mov dword[tedit0.rec.top],eax
;font size
stdcall [ini_get_int],file_name,ini_sec_window,key_font_s,ini_def_font_s
shl eax,24
mov dword[tedit0.font_size],eax
;ª­®¯ª¨ ­  ¯ ­¥«¨
ini_panel key_but_new, ID_BUT_NEW
ini_panel key_but_open, ID_BUT_OPEN
ini_panel key_but_save, ID_BUT_SAVE
ini_panel key_but_save_as,ID_BUT_SAVE_AS
ini_panel key_but_select, ID_BUT_SELECT
ini_panel key_but_cut, ID_BUT_CUT
ini_panel key_but_copy, ID_BUT_COPY
ini_panel key_but_paste, ID_BUT_PASTE
ini_panel key_but_find, ID_BUT_FIND
ini_panel key_but_replace,ID_BUT_REPLACE
ini_panel key_but_key_words,ID_BUT_KEY_WORDS
ini_panel key_but_upper, ID_BUT_UPPER
ini_panel key_but_lower, ID_BUT_LOWER
ini_panel key_but_reverse,ID_BUT_REVERSE
ini_panel key_but_undo, ID_BUT_UNDO
ini_panel key_but_redo, ID_BUT_REDO
ini_panel key_but_invisible,ID_BUT_INVISIBLE
ini_panel key_but_syntax_list,ID_BUT_SYNTAX_LIST
ini_panel key_but_syntax_mode,ID_BUT_SYNTAX_MODE
ini_panel key_but_convert_1251_866,ID_BUT_CONVERT_1251_866
ini_panel key_but_convert_866_1251,ID_BUT_CONVERT_866_1251
;ä ©«®¢ë¥ à áè¨à¥­¨ï
xor edx,edx
mov ebx,synt_auto_open
@@:
;¡¥à¥¬ ¨¬ï ä ©« 
stdcall [ini_get_str],file_name,ini_sec_options,key_synt_file,ebx,32,ini_def_synt_f
cmp byte[ebx],0
je @f
inc byte[key_synt_file.numb]
add ebx,32
;¡¥à¥¬ à áè¨à¥­¨ï
stdcall [ini_get_str],file_name,ini_sec_options,key_synt_ext,ebx,32,ini_def_synt_f
inc byte[key_synt_ext.numb]
add ebx,32
inc edx
cmp edx,max_synt_auto_open
jl @b
@@:
;--- load color option file ---
stdcall open_unpac_synt_file,[fn_col_option]
;--- get cmd line ---
cmp byte[openfile_path+3],0 ;openfile_path
je @f ;if file names exist
mov esi,openfile_path
stdcall auto_open_syntax,esi
call but_no_msg_OpenFile
@@:
align 16
red_win:
call draw_window
align 16
still:
mcall SF_WAIT_EVENT
cmp dword[exit_code],1
jne @f
call ted_Exit
jmp still
@@:
cmp al,1 ;¨§¬¥­¨«®áì ¯®«®¦¥­¨¥ ®ª­ 
jz red_win
cmp al,2
jz key
cmp al,3
jz button
cmp al,6 ;¬ëèì
jne @f
call mouse
@@:
jmp still
align 16
mouse:
stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
cmp word[tedit0.wnd.top],ax
jg .no_edit
shr eax,16
cmp word[tedit0.wnd.left],ax
jg .no_edit
mcall SF_MOUSE_GET,SSF_BUTTON_EXT
bt eax,24 ;¤¢®©­®© 饫çñª «¥¢®© ª­®¯ª®©
jnc @f
stdcall [ted_but_select_word], tedit0
ret
@@:
stdcall [ted_mouse], tedit0
.no_edit:
;¯à®¢¥àª  ¡®ª®¢ëå ¯ ­¥«¥©
cmp byte[tedit0.panel_id],TED_PANEL_FIND
jne @f
stdcall [edit_box_mouse], edit_find
stdcall [option_box_mouse], opt_grlist1
stdcall [check_box_mouse], ch1
@@:
cmp byte[tedit0.panel_id],TED_PANEL_REPLACE
jne @f
stdcall [edit_box_mouse], edit_find
stdcall [edit_box_mouse], edit_replace
stdcall [option_box_mouse], opt_grlist1
@@:
cmp byte[tedit0.panel_id],TED_PANEL_SYNTAX
jne @f
stdcall [tl_mouse], tree1
@@:
cmp byte[tedit0.panel_id],TED_PANEL_GOTO
jne @f
stdcall [edit_box_mouse], edit_goto
@@:
ret
;---------------------------------------------------------------------
;output:
; ah = symbol
align 16
proc KeyConvertToASCII uses ebx, table:dword
mov ebx,dword[table] ;convert scan to ascii
shr ax,8
add bx,ax
mov ah,byte[ebx]
ret
endp
align 16
key:
mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
xor esi,esi
mov ecx,1
test al,3 ;[Shift]
jz @f
mov cl,2
or esi,KM_SHIFT
@@:
test al,0x0c ;[Ctrl]
jz @f
or esi,KM_CTRL
@@:
test al,0x30 ;[Alt]
jz @f
mov cl,3
or esi,KM_ALT
@@:
test al,0x80 ;[NumLock]
jz @f
or esi,KM_NUMLOCK
@@:
mcall SF_SYSTEM_GET,SSF_KEYBOARD_LAYOUT,,conv_tabl ;26.2 ¯®«ãç¨âì à áª« ¤ªã ª« ¢¨ âãàë
mcall SF_GET_KEY
stdcall [tl_key], tree1
test word[edit_replace.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f
cmp ah,0x80 ;if key up
ja still
cmp ah,42 ;[Shift] (left)
je still
cmp ah,54 ;[Shift] (right)
je still
cmp ah,56 ;[Alt]
je still
cmp ah,29 ;[Ctrl]
je still
cmp ah,69 ;[Pause Break]
je still
stdcall KeyConvertToASCII, conv_tabl
stdcall [edit_box_key], edit_replace
jmp still
@@:
test word[edit_find.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f
cmp ah,0x80 ;if key up
ja still
cmp ah,42 ;[Shift] (left)
je still
cmp ah,54 ;[Shift] (right)
je still
cmp ah,56 ;[Alt]
je still
cmp ah,29 ;[Ctrl]
je still
cmp ah,69 ;[Pause Break]
je still
stdcall KeyConvertToASCII, conv_tabl
stdcall [edit_box_key], edit_find
jmp still
@@:
test word[edit_goto.flags],ed_focus ;¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f
cmp ah,0x80 ;if key up
ja still
cmp ah,42 ;[Shift] (left)
je still
cmp ah,54 ;[Shift] (right)
je still
cmp ah,56 ;[Alt]
je still
cmp ah,29 ;[Ctrl]
je still
cmp ah,69 ;[Pause Break]
je still
stdcall KeyConvertToASCII, conv_tabl
stdcall [edit_box_key], edit_goto
jmp still
@@:
stdcall [ted_key], tedit0, conv_tabl,esi
jmp still
align 4
edit_replace edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_replace, mouse_dd, 0
edit_find edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 300, buf_find, mouse_dd, 0
edit_goto edit_box TED_PANEL_WIDTH-1, 0, 20, 0xffffff, 0xff80, 0xff0000, 0xff, 0x4080, 10, buf_goto, mouse_dd, 0
unpac_mem dd 0
;library structures
l_libs_start:
lib0 l_libs lib_name_0, file_name, system_dir_0, import_box_lib
lib1 l_libs lib_name_1, file_name, system_dir_1, import_msgbox_lib
lib2 l_libs lib_name_2, file_name, system_dir_2, import_proclib
lib3 l_libs lib_name_3, file_name, system_dir_3, import_libimg
lib4 l_libs lib_name_4, file_name, system_dir_4, import_libini
lib5 l_libs lib_name_5, file_name, system_dir_5, import_libkmenu
load_lib_end:
IncludeIGlobals
hed db 'TextEdit '
i_end:
openfile_path: ;¯®«­ë© ¯ãâì ª ä ©«ã á ª®â®àë¬ ¨¤¥â à ¡®â 
rb 4096
dir_mem rb 32+304*count_of_dir_list_files
wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
rq 1
last_open_synt_file rb 32 ;¨¬ï ¯®á«¥¤­¥£® ¯®¤ª«î祭­®£® ä ©«  ᨭ⠪á¨á 
buf rb BUF_SIZE ;¡ãä¥à ¤«ï ª®¯¨à®¢ ­¨ï ¨ ¢áâ ¢ª¨
buf_find rb 302 ;¡ãä¥à ¤«ï ¯®¨áª  ⥪áâ 
buf_replace rb 302 ;¡ãä¥à ¤«ï § ¬¥­ë ⥪áâ 
buf_goto rb 12 ;¡ãä¥à ¤«ï ¯¥à室  ­  áâபã
sc system_colors
IncludeUGlobals
align 16
procinfo process_information
rb 1024
thread:
rb 4096
align 16
thread_coords:
rb 4096
align 16
stacktop:
sys_path: ;¯ãâì ®âªã¤  § ¯ãá⨫áï ¨á¯®«­ï¥¬ë© ä ©«
rb 4096
file_name: ;¯ à ¬¥âàë § ¯ã᪠
rb 4096
syntax_path: ;¨¬ï ¯®¤ª«îç ¥¬®£® ä ©«  ᨭ⠪á¨á 
rb 4096
plugin_path:
rb 4096
text_work_area: ;¯ãâì ª ä ©«ã, ª®â®àë© ¯®ª §ë¢ ¥âáï ¢ ®ª­¥
rb 4096
filename_area: ;¨¬ï ä ©«  ¤«ï ¤¨ «®£  ®âªàëâ¨ï/§ ªàëâ¨ï
rb 256
file_info:
rb 40
mem:
+394 -389
View File
@@ -1,389 +1,394 @@
use32
org 0
db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
dd 1, start, i_end, mem, stacktop, file_name, sys_path
MAX_COLOR_WORD_LEN equ 40
BUF_SIZE equ 4096 ;buffer for copy|paste
CAPT_PATH_WIDTH equ 50 ;è¨à¨­  ¯®¤¯¨á¨ ¯¥à¥¤ ⥪áâ®¢ë¬ ¯®«¥¬
include '../../macros.inc'
include '../../proc32.inc'
include '../../KOSfuncs.inc'
include '../../load_img.inc'
include '../../load_lib.mac'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../system/skincfg/trunk/kglobals.inc'
include '../../system/skincfg/trunk/unpacker.inc'
include 'te_data.inc'
include 'te_work.inc' ;text work functions
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
align 4
start:
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
mcall SF_SYS_MISC,SSF_HEAP_INIT
or eax,eax
jz button.exit
mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1 ;scan code
mcall SF_SET_EVENTS_MASK,0xC0000027
load_libraries l_libs_start,load_lib_end
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
cmp dword[lib0+ll_struc_size-4],0
jz @f
mcall -1 ;exit not correct
@@:
;---------------------------------------------------------------------
stdcall [tl_data_init], tree1
; ç¨â ¥¬ ä ©« á ªãàá®à ¬¨ ¨ «¨­¨ï¬¨
include_image_file '..\..\media\log_el\trunk\tl_sys_16.png', icon_tl_sys
mov eax,[icon_tl_sys]
mov [tree1.data_img_sys],eax
;---------------------------------------------------------------------
; ç¨â ¥¬ bmp ä ©« á ¨ª®­ª ¬¨ ã§«®¢
include_image_file '..\t_edit\tl_nod_16.png', icon_tl_sys
mov eax,[icon_tl_sys]
mov [tree1.data_img],eax
;------------------------------------------------------------------------------
copy_path fn_syntax_dir,sys_path,file_name,0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ ᨭ⠪á¨á 
mcall SF_FILE,tree_file_struct
cmp ebx,2
jg @f
notify_window_run file_name ;á®®¡é¥­¨¥ ¥á«¨ ­¥ 㤠«®áì ®âªàëâì ä ©«ë
jmp .end_dir_init
@@:
;cmp ebx,0
;jle .end_dir_init
mov eax,dir_mem+32+40
mov ecx,ebx
@@:
cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥­ ¬¨ '.' ¨ '..'
je .filter
stdcall [tl_node_add],tree1,0x10000,eax ;1*2^16 - £¤¥ 1 ­®¬¥à ¨ª®­ª¨ á ª­¨£®©
stdcall [tl_cur_next],tree1
.filter:
add eax,304
loop @b
stdcall [tl_cur_beg],tree1 ;áâ ¢¨¬ ªãàá®à ­  ­ ç «® ᯨ᪠
or dword[tree1.style], tl_cursor_pos_limited ;®£à ­¨ç¨¢ ¥¬ ¤¢¨¦¥­¨¥ ªãàá®à  ¢ ¯à¥¤¥« å ᯨ᪠
.end_dir_init:
xor eax,eax
inc eax
mov [scrol_w1.type],eax
mov [scrol_h1.type],eax
mov [ws_dir_lbox.type],eax
;--- load color option file ---
stdcall [ted_init], tedit0
mov byte[file_name],0
align 4
red_win:
call draw_window
align 4
still:
mcall SF_WAIT_EVENT
cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
jz red_win
cmp al,2
jz key
cmp al,3
jz button
cmp al,6
jz mouse
jmp still
align 4
draw_window:
pushad
mcall SF_REDRAW,SSF_BEGIN_DRAW
mov edx,[sc.work]
or edx,0x33000000
mov edi,hed
mcall SF_CREATE_WINDOW,<10,555>,<10,333>
mcall SF_THREAD_INFO,procinfo,-1
mov edi,tedit0 ;§­ ç¥­¨¥ edi ­ã¦­® ¤«ï EvSize ¨ ted_wnd_t
call EvSize
mov esi,[sc.work_button];0xd0
mcall SF_DEFINE_BUTTON,5*65536+90,195*65536+20,200
mov ebx,100*65536+85
mov ecx,195*65536+20
mov edx,201
mov esi,0xd00000
mcall
mov ecx,[sc.work_button_text]
or ecx,0x80000000
mcall SF_DRAW_TEXT,10*65536+200,,txt_load_f
mov ecx,0xffff00
or ecx,0x80000000
mcall ,105*65536+200,,txt_save_f
mov ecx,[sc.work_text]
or ecx,0x80000000
mcall ,195*65536+10,,txt_inp_file
add ebx,20
mov edx,txt_out_file
int 0x40
stdcall [PathShow_draw], PathShow_data_1
stdcall [edit_box_draw], edit1
stdcall [tl_draw], tree1
;scroll 1
mov [ws_dir_lbox.all_redraw],1
stdcall [scrollbar_ver_draw],ws_dir_lbox
stdcall [ted_draw], tedit0
mcall SF_REDRAW,SSF_END_DRAW
popad
ret
MIN_M_WND_H equ 100 ;¬¨­¨¬ «ì­ ï ¢ëá®â  £« ¢­®£® ®ª­ 
;input:
; edi = pointer to tedit struct
align 4
EvSize:
pushad
mov ebx,ted_scr_h
mov esi,ted_scr_w
m2m ted_wnd_w,[procinfo.client_box.width] ;áâ ¢¨¬ è¨à¨­ã ®ª­  । ªâ®à  à ¢­®© è¨à¨­¥ ¢á¥£® ®ª­ 
mov eax,ted_wnd_l
sub ted_wnd_w,eax ;®â­¨¬ ¥¬ ®âáâ㯠᫥¢ 
movzx eax,word[esi+sb_offs_size_x]
sub ted_wnd_w,eax ;®â­¨¬ ¥¬ è¨à¨­ã ¢¥àâ. áªà®««¨­£ 
m2m ted_wnd_h,[procinfo.client_box.height] ;áâ ¢¨¬ ¢ëá®âã ®ª­  । ªâ®à  à ¢­®© ¢ëá®â¥ ¢á¥£® ®ª­ 
cmp ted_wnd_h,MIN_M_WND_H
jg @f
mov ted_wnd_h,MIN_M_WND_H
@@:
movzx eax,word[ebx+sb_offs_size_y]
sub ted_wnd_h,eax ;®â­¨¬ ¥¬ ¢ëá®âã £®à¨§. áªà®««¨­£ 
mov eax,ted_wnd_t
sub ted_wnd_h,eax ;®â­¨¬ ¥¬ ®âáâ㯠ᢥàåã
stdcall [ted_init_scroll_bars], tedit0,2
popad
ret
align 4
mouse:
stdcall [tl_mouse],tree1
stdcall [edit_box_mouse],edit1
stdcall [ted_mouse], tedit0
jmp still
;output:
; ah = symbol
align 4
proc KeyConvertToASCII, table:dword
push ebx
mov ebx,dword[table] ;convert scan to ascii
shr ax,8
add bx,ax
mov ah,byte[ebx]
pop ebx
ret
endp
align 4
key:
mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
xor esi,esi
mov ecx,1
test al,3 ;[Shift]
jz @f
mov cl,2
or esi,KM_SHIFT
@@:
test al,0x0c ;[Ctrl]
jz @f
or esi,KM_CTRL
@@:
test al,0x30 ;[Alt]
jz @f
mov cl,3
or esi,KM_ALT
@@:
test al,0x80 ;[NumLock]
jz @f
or esi,KM_NUMLOCK
@@:
mcall SF_SYSTEM_GET,SSF_KEYBOARD_LAYOUT,,conv_tabl ;26.2 ¯®«ãç¨âì à áª« ¤ªã ª« ¢¨ âãàë
mcall SF_GET_KEY
stdcall [tl_key],tree1
test word [edit1.flags],10b;ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f
cmp ah,0x80 ;if key up
ja still
cmp ah,42 ;[Shift] (left)
je still
cmp ah,54 ;[Shift] (right)
je still
cmp ah,56 ;[Alt]
je still
cmp ah,29 ;[Ctrl]
je still
cmp ah,69 ;[Pause Break]
je still
stdcall KeyConvertToASCII, conv_tabl
stdcall [edit_box_key],edit1
jmp still
@@:
stdcall [ted_key], tedit0, conv_tabl,esi
jmp still
align 4
button:
mcall SF_GET_BUTTON
cmp ah,200
jne @f
call but_OpenSyntax
@@:
cmp ah,201
jne @f
call but_SaveSyntax
@@:
cmp ah,1
jne still
.exit:
stdcall mem.Free,[options_file]
stdcall mem.Free,[unpac_mem]
stdcall [tl_data_clear], tree1
stdcall [ted_delete], tedit0
mcall SF_TERMINATE_PROCESS ;¢ë室 ¨§ ¯à®£à ¬¬ë
align 4
but_OpenSyntax:
push eax
stdcall [tl_node_get_data],tree1
mov [fn_col_option],eax
call InitColText
pop eax
ret
align 4
but_SaveSyntax:
stdcall [ted_save_file], tedit0,run_file_70,[edit1.text]
ret
;description:
; äã­ªæ¨ï ¢ë§ë¢ ¥¬ãî ¯à¨ ­ ¦ â¨¨ Ctrl+N,O,F,S,H,G
align 4
proc ted_but_ctrl_all uses eax, opt_key:dword
mov eax,[opt_key]
cmp al,'N' ;Ctrl+N
jne @f
call but_ctrl_n
jmp .end0
@@:
cmp al,'O' ;Ctrl+O
jne @f
call but_ctrl_o
@@:
;cmp al,'S' ;Ctrl+S
;cmp al,'F' ;Ctrl+F
;cmp al,'G' ;Ctrl+G
;cmp al,'H' ;Ctrl+H
.end0:
ret
endp
align 4
but_ctrl_o:
push eax
call get_wnd_in_focus
or eax,eax
jz @f
stdcall [ted_open_file], eax,str_file_70,[edit1.text]
@@:
pop eax
ret
;á®§¤ ­¨¥ ­®¢®£® ä ©« 
align 4
but_ctrl_n:
push eax
call get_wnd_in_focus
or eax,eax
jz @f
stdcall [ted_clear], eax,1
stdcall [ted_draw], eax
@@:
pop eax
ret
;®¯à¥¤¥«ï¥¬ ª ª®¥ ¨§ ®ª®­ । ªâ®à  ¢ 䮪ãá¥
align 4
get_wnd_in_focus:
xor eax,eax
cmp dword[el_focus],tedit0
jne @f
mov eax,tedit0
@@:
;cmp dword[el_focus],tedit1
;jne @f
; mov eax,tedit1
;@@:
ret
hed db 'TextEditor syntax file converter 18.12.20',0 ;¯®¤¯¨áì ®ª­ 
conv_tabl rb 128 ; â ¡«¨æ  ¤«ï ª®­¢¥àâ¨à®¢ ­¨ï scan-ª®¤  ¢ ascii-ª®¤
txt_load_f db '‡ £à. ä ©«',0
txt_save_f db '‘®åà. ä ©«',0
txt_inp_file db 'ˆáå. ä ©«:',0
txt_out_file db '‚ëå. ä ©«:',0
;library structures
l_libs_start:
lib0 l_libs lib_name_0, file_name, system_dir_0, import_box_lib
lib1 l_libs lib_name_1, file_name, system_dir_1, import_libimg
load_lib_end:
IncludeIGlobals
align 16
i_end:
IncludeUGlobals
procinfo process_information
rb 1024
thread:
rb 1024
stacktop:
sys_path rb 4096
file_name rb 4096
file_name_rez rb 4096
mem:
; SPDX-License-Identifier: NOASSERTION
;
; Text encoded with Code Page 866 - Cyrillic
use32
org 0
db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
dd 1, start, i_end, mem, stacktop, file_name, sys_path
MAX_COLOR_WORD_LEN equ 40
BUF_SIZE equ 4096 ;buffer for copy|paste
CAPT_PATH_WIDTH equ 50 ;è¨à¨­  ¯®¤¯¨á¨ ¯¥à¥¤ ⥪áâ®¢ë¬ ¯®«¥¬
include '../../macros.inc'
include '../../proc32.inc'
include '../../KOSfuncs.inc'
include '../../load_img.inc'
include '../../load_lib.mac'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../system/skincfg/kglobals.inc'
include '../../system/skincfg/unpacker.inc'
include 'te_data.inc'
include 'te_work.inc' ;text work functions
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
align 4
start:
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
mcall SF_SYS_MISC,SSF_HEAP_INIT
or eax,eax
jz button.exit
mcall SF_KEYBOARD,SSF_SET_INPUT_MODE,1 ;scan code
mcall SF_SET_EVENTS_MASK,0xC0000027
load_libraries l_libs_start,load_lib_end
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
cmp dword[lib0+ll_struc_size-4],0
jz @f
mcall -1 ;exit not correct
@@:
;---------------------------------------------------------------------
stdcall [tl_data_init], tree1
; ç¨â ¥¬ ä ©« á ªãàá®à ¬¨ ¨ «¨­¨ï¬¨
include_image_file '..\..\media\log_el\trunk\tl_sys_16.png', icon_tl_sys
mov eax,[icon_tl_sys]
mov [tree1.data_img_sys],eax
;---------------------------------------------------------------------
; ç¨â ¥¬ bmp ä ©« á ¨ª®­ª ¬¨ ã§«®¢
include_image_file '..\t_edit\tl_nod_16.png', icon_tl_sys
mov eax,[icon_tl_sys]
mov [tree1.data_img],eax
;------------------------------------------------------------------------------
copy_path fn_syntax_dir,sys_path,file_name,0 ;¡¥à¥¬ ¯ãâì ª ¯ ¯ª¥ á ä ©« ¬¨ ᨭ⠪á¨á 
mcall SF_FILE,tree_file_struct
cmp ebx,2
jg @f
notify_window_run file_name ;á®®¡é¥­¨¥ ¥á«¨ ­¥ 㤠«®áì ®âªàëâì ä ©«ë
jmp .end_dir_init
@@:
;cmp ebx,0
;jle .end_dir_init
mov eax,dir_mem+32+40
mov ecx,ebx
@@:
cmp byte[eax],'.' ;䨫ìâà㥬 ä ©«ë á ¨¬¥­ ¬¨ '.' ¨ '..'
je .filter
stdcall [tl_node_add],tree1,0x10000,eax ;1*2^16 - £¤¥ 1 ­®¬¥à ¨ª®­ª¨ á ª­¨£®©
stdcall [tl_cur_next],tree1
.filter:
add eax,304
loop @b
stdcall [tl_cur_beg],tree1 ;áâ ¢¨¬ ªãàá®à ­  ­ ç «® ᯨ᪠
or dword[tree1.style], tl_cursor_pos_limited ;®£à ­¨ç¨¢ ¥¬ ¤¢¨¦¥­¨¥ ªãàá®à  ¢ ¯à¥¤¥« å ᯨ᪠
.end_dir_init:
xor eax,eax
inc eax
mov [scrol_w1.type],eax
mov [scrol_h1.type],eax
mov [ws_dir_lbox.type],eax
;--- load color option file ---
stdcall [ted_init], tedit0
mov byte[file_name],0
align 4
red_win:
call draw_window
align 4
still:
mcall SF_WAIT_EVENT
cmp al,1 ;¨§¬. ¯®«®¦¥­¨¥ ®ª­ 
jz red_win
cmp al,2
jz key
cmp al,3
jz button
cmp al,6
jz mouse
jmp still
align 4
draw_window:
pushad
mcall SF_REDRAW,SSF_BEGIN_DRAW
mov edx,[sc.work]
or edx,0x33000000
mov edi,hed
mcall SF_CREATE_WINDOW,<10,555>,<10,333>
mcall SF_THREAD_INFO,procinfo,-1
mov edi,tedit0 ;§­ ç¥­¨¥ edi ­ã¦­® ¤«ï EvSize ¨ ted_wnd_t
call EvSize
mov esi,[sc.work_button];0xd0
mcall SF_DEFINE_BUTTON,5*65536+90,195*65536+20,200
mov ebx,100*65536+85
mov ecx,195*65536+20
mov edx,201
mov esi,0xd00000
mcall
mov ecx,[sc.work_button_text]
or ecx,0x80000000
mcall SF_DRAW_TEXT,10*65536+200,,txt_load_f
mov ecx,0xffff00
or ecx,0x80000000
mcall ,105*65536+200,,txt_save_f
mov ecx,[sc.work_text]
or ecx,0x80000000
mcall ,195*65536+10,,txt_inp_file
add ebx,20
mov edx,txt_out_file
int 0x40
stdcall [PathShow_draw], PathShow_data_1
stdcall [edit_box_draw], edit1
stdcall [tl_draw], tree1
;scroll 1
mov [ws_dir_lbox.all_redraw],1
stdcall [scrollbar_ver_draw],ws_dir_lbox
stdcall [ted_draw], tedit0
mcall SF_REDRAW,SSF_END_DRAW
popad
ret
MIN_M_WND_H equ 100 ;¬¨­¨¬ «ì­ ï ¢ëá®â  £« ¢­®£® ®ª­ 
;input:
; edi = pointer to tedit struct
align 4
EvSize:
pushad
mov ebx,ted_scr_h
mov esi,ted_scr_w
m2m ted_wnd_w,[procinfo.client_box.width] ;áâ ¢¨¬ è¨à¨­ã ®ª­  । ªâ®à  à ¢­®© è¨à¨­¥ ¢á¥£® ®ª­ 
mov eax,ted_wnd_l
sub ted_wnd_w,eax ;®â­¨¬ ¥¬ ®âáâ㯠᫥¢ 
movzx eax,word[esi+sb_offs_size_x]
sub ted_wnd_w,eax ;®â­¨¬ ¥¬ è¨à¨­ã ¢¥àâ. áªà®««¨­£ 
m2m ted_wnd_h,[procinfo.client_box.height] ;áâ ¢¨¬ ¢ëá®âã ®ª­  । ªâ®à  à ¢­®© ¢ëá®â¥ ¢á¥£® ®ª­ 
cmp ted_wnd_h,MIN_M_WND_H
jg @f
mov ted_wnd_h,MIN_M_WND_H
@@:
movzx eax,word[ebx+sb_offs_size_y]
sub ted_wnd_h,eax ;®â­¨¬ ¥¬ ¢ëá®âã £®à¨§. áªà®««¨­£ 
mov eax,ted_wnd_t
sub ted_wnd_h,eax ;®â­¨¬ ¥¬ ®âáâ㯠ᢥàåã
stdcall [ted_init_scroll_bars], tedit0,2
popad
ret
align 4
mouse:
stdcall [tl_mouse],tree1
stdcall [edit_box_mouse],edit1
stdcall [ted_mouse], tedit0
jmp still
;output:
; ah = symbol
align 4
proc KeyConvertToASCII, table:dword
push ebx
mov ebx,dword[table] ;convert scan to ascii
shr ax,8
add bx,ax
mov ah,byte[ebx]
pop ebx
ret
endp
align 4
key:
mcall SF_KEYBOARD,SSF_GET_CONTROL_KEYS ;66.3 ¯®«ãç¨âì á®áâ®ï­¨¥ ã¯à ¢«ïîé¨å ª« ¢¨è
xor esi,esi
mov ecx,1
test al,3 ;[Shift]
jz @f
mov cl,2
or esi,KM_SHIFT
@@:
test al,0x0c ;[Ctrl]
jz @f
or esi,KM_CTRL
@@:
test al,0x30 ;[Alt]
jz @f
mov cl,3
or esi,KM_ALT
@@:
test al,0x80 ;[NumLock]
jz @f
or esi,KM_NUMLOCK
@@:
mcall SF_SYSTEM_GET,SSF_KEYBOARD_LAYOUT,,conv_tabl ;26.2 ¯®«ãç¨âì à áª« ¤ªã ª« ¢¨ âãàë
mcall SF_GET_KEY
stdcall [tl_key],tree1
test word [edit1.flags],10b;ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @f
cmp ah,0x80 ;if key up
ja still
cmp ah,42 ;[Shift] (left)
je still
cmp ah,54 ;[Shift] (right)
je still
cmp ah,56 ;[Alt]
je still
cmp ah,29 ;[Ctrl]
je still
cmp ah,69 ;[Pause Break]
je still
stdcall KeyConvertToASCII, conv_tabl
stdcall [edit_box_key],edit1
jmp still
@@:
stdcall [ted_key], tedit0, conv_tabl,esi
jmp still
align 4
button:
mcall SF_GET_BUTTON
cmp ah,200
jne @f
call but_OpenSyntax
@@:
cmp ah,201
jne @f
call but_SaveSyntax
@@:
cmp ah,1
jne still
.exit:
stdcall mem.Free,[options_file]
stdcall mem.Free,[unpac_mem]
stdcall [tl_data_clear], tree1
stdcall [ted_delete], tedit0
mcall SF_TERMINATE_PROCESS ;¢ë室 ¨§ ¯à®£à ¬¬ë
align 4
but_OpenSyntax:
push eax
stdcall [tl_node_get_data],tree1
mov [fn_col_option],eax
call InitColText
pop eax
ret
align 4
but_SaveSyntax:
stdcall [ted_save_file], tedit0,run_file_70,[edit1.text]
ret
;description:
; äã­ªæ¨ï ¢ë§ë¢ ¥¬ãî ¯à¨ ­ ¦ â¨¨ Ctrl+N,O,F,S,H,G
align 4
proc ted_but_ctrl_all uses eax, opt_key:dword
mov eax,[opt_key]
cmp al,'N' ;Ctrl+N
jne @f
call but_ctrl_n
jmp .end0
@@:
cmp al,'O' ;Ctrl+O
jne @f
call but_ctrl_o
@@:
;cmp al,'S' ;Ctrl+S
;cmp al,'F' ;Ctrl+F
;cmp al,'G' ;Ctrl+G
;cmp al,'H' ;Ctrl+H
.end0:
ret
endp
align 4
but_ctrl_o:
push eax
call get_wnd_in_focus
or eax,eax
jz @f
stdcall [ted_open_file], eax,str_file_70,[edit1.text]
@@:
pop eax
ret
;á®§¤ ­¨¥ ­®¢®£® ä ©« 
align 4
but_ctrl_n:
push eax
call get_wnd_in_focus
or eax,eax
jz @f
stdcall [ted_clear], eax,1
stdcall [ted_draw], eax
@@:
pop eax
ret
;®¯à¥¤¥«ï¥¬ ª ª®¥ ¨§ ®ª®­ । ªâ®à  ¢ 䮪ãá¥
align 4
get_wnd_in_focus:
xor eax,eax
cmp dword[el_focus],tedit0
jne @f
mov eax,tedit0
@@:
;cmp dword[el_focus],tedit1
;jne @f
; mov eax,tedit1
;@@:
ret
hed db 'TextEditor syntax file converter 18.12.20',0 ;¯®¤¯¨áì ®ª­ 
conv_tabl rb 128 ; â ¡«¨æ  ¤«ï ª®­¢¥àâ¨à®¢ ­¨ï scan-ª®¤  ¢ ascii-ª®¤
txt_load_f db '‡ £à. ä ©«',0
txt_save_f db '‘®åà. ä ©«',0
txt_inp_file db 'ˆáå. ä ©«:',0
txt_out_file db '‚ëå. ä ©«:',0
;library structures
l_libs_start:
lib0 l_libs lib_name_0, file_name, system_dir_0, import_box_lib
lib1 l_libs lib_name_1, file_name, system_dir_1, import_libimg
load_lib_end:
IncludeIGlobals
align 16
i_end:
IncludeUGlobals
procinfo process_information
rb 1024
thread:
rb 1024
stacktop:
sys_path rb 4096
file_name rb 4096
file_name_rez rb 4096
mem:
@@ -1,3 +1,6 @@
; SPDX-License-Identifier: NOASSERTION
;
;
; END
;
@@ -7,7 +10,7 @@
;
; 15.02.2007 merge old END with new one (fron Veliant & Leency) by Heavyiron
include "..\..\..\macros.inc"
include "..\..\macros.inc"
meos_app_start
code
@@ -43,7 +46,7 @@ draw:
xor edx, edx
mcall
mov al,8
mcall ,58 shl 16 + 32,59 shl 16 + 34, 1 shl 30 + 1
inc edx
@@ -55,7 +58,7 @@ draw:
inc edx
mcall ,144 shl 16 + 43
mov al,12 ;end of redraw
mov al,12 ;end of redraw
mov ebx,2
mcall
@@ -1,3 +1,6 @@
; SPDX-License-Identifier: NOASSERTION
;
use32
org 0x0
@@ -10,9 +13,9 @@ use32
dd 0x0
dd 0x0
include '../../../proc32.inc'
include '../../../macros.inc'
include '../../../dll.inc'
include '../../proc32.inc'
include '../../macros.inc'
include '../../dll.inc'
PATH_MAX equ 255
@@ -56,7 +59,7 @@ STARTAPP:
;----------------------------------------------------------------
; This is fix for files located at /kolibrios and /usbhd drives
; It checks is the file exists for 5 times with perioud 1 second
; It checks is the file exists for 5 times with period 1 second
check_file_exists:
mov edi, 0
@@:
@@ -1,5 +1,5 @@
if tup.getconfig("NO_FASM") ~= "" then return end
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR")
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_fasm.lua")
add_include(tup.getvariantdir())
@@ -1,11 +1,16 @@
; SPDX-License-Identifier: NOASSERTION
;
; Text encoded with Code Page 866 - Cyrillic
window_h=85
window_w=430
;--- ¤à㣨¥ ¬ ªà®áë ---
include '../../../KOSfuncs.inc'
include '../../../load_lib.mac'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../KOSfuncs.inc'
include '../../load_lib.mac'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include 'txtbut.inc'
include '../../../macros.inc'
include '../../macros.inc'
include 'run.mac'
include 'lang.inc' ; Language support for locales: ru_RU (CP866), it_IT, en_US.
use32
@@ -1,3 +1,8 @@
; SPDX-License-Identifier: NOASSERTION
;
; Text encoded with Code Page 866 - Cyrillic
;;;;;;;;;;;;;;;;;;;;;;;
;; SYSTEM SETTINGS ;;
;;;;;;;;;;;;;;;;;;;;;;;
@@ -15,9 +20,9 @@ dd I_END
dd param
dd 0
include '../../../proc32.inc'
include '../../../macros.inc'
include '../../../dll.inc'
include '../../proc32.inc'
include '../../macros.inc'
include '../../dll.inc'
;---------------------------------------------------------------
BootSettings:
; Set system language
@@ -80,7 +85,7 @@ BootSettings:
invoke ini.get_int, sz_ini, sz_mouse, sz_acceleration, 1
mov edx,eax
mcall 18,19,3
; Set mouse double click delay
invoke ini.get_int, sz_ini, sz_mouse, sz_double_click_delay, 1
mov edx,eax
@@ -1,5 +1,5 @@
if tup.getconfig("NO_FASM") ~= "" then return end
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR")
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_fasm.lua")
add_include(tup.getvariantdir())
@@ -1,3 +1,6 @@
; SPDX-License-Identifier: NOASSERTION
;
;
; UNIFORM WINDOW COLOURS & SKIN
;
@@ -28,15 +31,15 @@ M01header.params:
dd cur_dir_path ; path to file
include 'lang.inc'
include '../../../proc32.inc'
include '../../../config.inc' ;for nightbuild
include '../../../macros.inc'
include '../../../string.inc'
include '../../../dll.inc'
include '../../proc32.inc'
include '../../config.inc' ;for nightbuild
include '../../macros.inc'
include '../../string.inc'
include '../../dll.inc'
include 'kglobals.inc'
include 'unpacker.inc'
include '../../../KOSfuncs.inc'
include '../../../load_lib.mac'
include '../../KOSfuncs.inc'
include '../../load_lib.mac'
@use_library
;******************************************************************************
;--------------------------------------
@@ -1,3 +1,8 @@
; SPDX-License-Identifier: NOASSERTION
;
; Text encoded with Code Page 866 - Cyrillic
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ;
; TASK PANEL for KolibriOS - Compile with fasm ;
@@ -74,11 +79,11 @@ format binary as ""
dd path ; application pach
;------------------------------------------------------------------------------
include 'lang.inc'
include '../../../macros.inc'
include '../../../proc32.inc'
;include '../../../debug.inc'
include 'MOI.INC' ;à áª« ¤ª¨ ª« ¢¨ âãàë
include '../../../develop/libraries/box_lib/load_lib.mac'
include '../../macros.inc'
include '../../proc32.inc'
;include '../../debug.inc'
include 'MOI.INC' ; keyboard layouts
include '../../develop/libraries/box_lib/load_lib.mac'
@use_library ;use load lib macros
;------------------------------------------------------------------------------
caps_lock_check fix 1
@@ -1156,7 +1161,7 @@ no_full:
;------------------------------------------------------------------------------
include 'libini.inc'
;------------------------------------------------------------------------------
include '../../../dll.inc'
include '../../dll.inc'
;------------------------------------------------------------------------------
include 'drawappl.inc'
;------------------------------------------------------------------------------
@@ -1,5 +1,5 @@
if tup.getconfig("NO_FASM") ~= "" then return end
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../../.." or tup.getconfig("HELPERDIR")
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
tup.include(HELPERDIR .. "/use_fasm.lua")
add_include(tup.getvariantdir())
@@ -1,4 +1,4 @@
include '../../../proc32.inc'
include '../../proc32.inc'
macro start_draw_window x,y,xsize,ysize,areacolor,caption
{
@@ -125,4 +125,3 @@ macro putpixel x,y,color
mov edx, color
int 0x40
}
@@ -1,4 +1,9 @@
; SPDX-License-Identifier: NOASSERTION
;
; Text encoded with Code Page 866 - Cyrillic
; ZKEY. Version 0.51.
; Virtual keyboard for KolibriOS.
;
@@ -20,7 +25,7 @@ use32
dd 0
dd 0
include '../../../macros.inc'
include '../../macros.inc'
include "ASPAPI.INC"
N_KEYCOLOR equ 0x00677889 ; Normal button color
@@ -168,19 +173,19 @@ draw_window:
mul byte [keyboard_mode]
add eax, SwitchText
stdcall draw_button, 513,28,46,20,106,0x00700000,eax,6,TEXTCOLOR ; Scan/ASCII switch
xor al, al
xchg al, [red_type]
test al, 2
jnz .skip_end_draw_window ; if we draw switch button without redraw window then end_draw_window not need
@@:
.draw_indicators_area:
call lights_on
end_draw_window
.skip_end_draw_window:
.skip_end_draw_window:
ret
get_zkey_window_slot_number:
@@ -197,14 +202,14 @@ still:
call get_receiver_window_slot_number
call get_receiver_window_keyboard_mode ; return in ecx keyboard_mode for set_keyboard_mode
call set_keyboard_mode
; delete_switch_button
mov eax, 8
; delete_switch_button
mov eax, 8
mov edx, BT_DEL + 0x00700000
int 0x40
int 0x40
mov byte [red_type], 2
call draw_window.draw_switch_button
mov eax, 10 ; Wait for an event in the queue.
int 0x40
@@ -486,4 +491,3 @@ PROCINFO_BUFF process_information
rb 4096
STACKTOP:
MEM: