develop/libraries/box_lib: Post-SVN tidy
- Move source code from `trunk` into program root directory. - Update build files and ASM include paths. This touches *many* files. - Note: Line endings standardised from `CRLF` > `LF`, so best to view diffs with whitespace changes hidden.
@@ -1,3 +1,7 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
|
||||
format coff
|
||||
use32 ; Tell compiler to use 32 bit instructions
|
||||
|
||||
@@ -7,7 +11,7 @@ include '../../../programs/proc32.inc'
|
||||
include '../../../programs/macros.inc'
|
||||
purge section,mov,add,sub
|
||||
|
||||
include '../../../programs/develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../../programs/develop/libraries/box_lib/box_lib.mac'
|
||||
include '../../../programs/system/run/trunk/txtbut.inc'
|
||||
include '../../../programs/dll.inc'
|
||||
|
||||
@@ -159,8 +163,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'
|
||||
|
@@ -506,7 +506,7 @@ tup.append_table(img_files, {
|
||||
{"GAMES/TETRIS", VAR_PROGS .. "/games/tetris/tetris"},
|
||||
{"GAMES/C4", VAR_PROGS .. "/games/c4/c4"},
|
||||
{"LIB/ARCHIVER.OBJ", VAR_PROGS .. "/fs/kfar/trunk/kfar_arc/kfar_arc.obj"},
|
||||
{"LIB/BOX_LIB.OBJ", VAR_PROGS .. "/develop/libraries/box_lib/trunk/box_lib.obj"},
|
||||
{"LIB/BOX_LIB.OBJ", VAR_PROGS .. "/develop/libraries/box_lib/box_lib.obj"},
|
||||
{"LIB/BUF2D.OBJ", VAR_PROGS .. "/develop/libraries/buf2d/trunk/buf2d.obj"},
|
||||
{"LIB/CONSOLE.OBJ", VAR_PROGS .. "/develop/libraries/console_coff/console.obj"},
|
||||
{"LIB/CNV_PNG.OBJ", VAR_PROGS .. "/media/zsea/plugins/png/cnv_png.obj"},
|
||||
|
@@ -101,7 +101,7 @@ fasm develop\cObj\cObj.asm %BIN%\develop\cObj
|
||||
echo *
|
||||
echo Building systems libraries
|
||||
echo *
|
||||
fasm develop\libraries\box_lib\trunk\box_lib.asm %BIN%\lib\box_lib.obj
|
||||
fasm develop\libraries\box_lib\box_lib.asm %BIN%\lib\box_lib.obj
|
||||
fasm develop\libraries\console\console.asm %BIN%\lib\console.obj
|
||||
fasm develop\libraries\libs-dev\libgfx\libgfx.asm %BIN%\lib\libgfx.obj
|
||||
fasm develop\libraries\libs-dev\libimg\libimg.asm %BIN%\lib\libimg.obj
|
||||
|
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; flat assembler source ;;
|
||||
@@ -41,7 +47,7 @@ include '../../../../macros.inc'
|
||||
purge add,sub ; macros.inc does incorrect substitution
|
||||
include 'fasm.inc'
|
||||
|
||||
include '../../../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../../../develop/libraries/box_lib/box_lib.mac'
|
||||
include '../../../../KOSfuncs.inc'
|
||||
include '../../../../load_lib.mac'
|
||||
@use_library
|
||||
@@ -61,9 +67,9 @@ START: ; Start of execution
|
||||
|
||||
cmp [params],0
|
||||
jz start_1
|
||||
|
||||
|
||||
;---------GerdtR
|
||||
or ecx,-1
|
||||
or ecx,-1
|
||||
mov esi,params
|
||||
cmp byte[esi],' '
|
||||
jne @f
|
||||
@@ -118,7 +124,7 @@ NoOutDebugInfo:
|
||||
pop ecx
|
||||
mov edi,path
|
||||
rep stosd
|
||||
|
||||
|
||||
mov esi,params
|
||||
; DEBUGF "params: %s\n",esi
|
||||
mov edi,infile
|
||||
@@ -164,17 +170,17 @@ init_checkboxes2 ch1_dbg,ch1_dbg+ch_struc_size
|
||||
red: ; Redraw
|
||||
call draw_window
|
||||
|
||||
still:
|
||||
still:
|
||||
mcall 10 ; Wait here for event
|
||||
cmp al,6
|
||||
je call_mouse
|
||||
dec eax
|
||||
dec eax
|
||||
je red ; Redraw request
|
||||
dec eax
|
||||
dec eax
|
||||
jne button ; Button in buffer
|
||||
key: ; Key
|
||||
mcall 2 ; Read it and ignore
|
||||
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_key]
|
||||
push dword edit2
|
||||
@@ -194,7 +200,7 @@ button: ; Button in Window
|
||||
or eax,-1
|
||||
mcall
|
||||
;---------------------------------------------------------------------
|
||||
noclose:
|
||||
noclose:
|
||||
cmp ah,5 ;press button for OpenDialog
|
||||
jne @f
|
||||
call fun_opn_dlg
|
||||
@@ -203,7 +209,7 @@ noclose:
|
||||
je start
|
||||
cmp ah,3 ; Start compiled file
|
||||
jnz norunout
|
||||
|
||||
|
||||
mov edx,outfile
|
||||
call make_fullpaths
|
||||
mcall 70,file_info_start
|
||||
@@ -213,7 +219,7 @@ noclose:
|
||||
norunout:
|
||||
cmp ah,4
|
||||
jnz norundebug
|
||||
|
||||
|
||||
mov edx,outfile
|
||||
call make_fullpaths
|
||||
mcall 70,file_info_debug
|
||||
@@ -236,7 +242,7 @@ mouse:
|
||||
draw_window:
|
||||
pusha
|
||||
mcall 12,1 ; Start of draw
|
||||
|
||||
|
||||
get_sys_colors 1,0
|
||||
edit_boxes_set_sys_color edit1,editboxes_end,sc
|
||||
;check_boxes_set_sys_color2 ch1_dbg,ch1_dbg+ch_struc_size,sc
|
||||
@@ -275,7 +281,7 @@ draw_window:
|
||||
mcall 8,ebx,<LINE_H*0+3,LINE_H-4>,ID_COMPILE_BTN,[sc.work_button]
|
||||
mcall ,ebx,<LINE_H*1+3,LINE_H-4>,ID_EXECUTE_BTN
|
||||
mcall ,ebx,<LINE_H*2+3,LINE_H-4>,ID_EXECDBG_BTN
|
||||
|
||||
|
||||
mcall ,<5,62>,<LINE_H*2+3,LINE_H-5>,ID_OPENDLG_BTN
|
||||
|
||||
mov ecx, [sc.work_text]
|
||||
@@ -297,10 +303,10 @@ draw_window:
|
||||
mcall ,ebx,ecx,s_run
|
||||
add ebx,LINE_H
|
||||
mcall ,ebx,ecx,s_debug
|
||||
|
||||
|
||||
mpack ebx,MAGIC1+6,1+ 14/2-3+ 14*0
|
||||
mov esi,[pinfo.client_box.width]
|
||||
sub esi,MAGIC1*2+6+3
|
||||
sub esi,MAGIC1*2+6+3
|
||||
mov eax,esi
|
||||
mov cl,6
|
||||
div cl
|
||||
@@ -311,14 +317,14 @@ draw_window:
|
||||
movzx esi,al
|
||||
|
||||
call draw_messages
|
||||
|
||||
|
||||
mov eax,dword [pinfo.client_box.width]
|
||||
sub eax,[edit1.left]
|
||||
sub eax,RIGHT_BTN_W+6
|
||||
mov dword[edit1.width],eax ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov dword[edit2.width],eax
|
||||
mov dword[edit3.width],eax
|
||||
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_draw]
|
||||
push dword edit2
|
||||
@@ -327,7 +333,7 @@ draw_window:
|
||||
call [edit_box_draw]
|
||||
push dword ch1_dbg
|
||||
call [check_box_draw]
|
||||
.end:
|
||||
.end:
|
||||
mcall 12,2 ; End of Draw
|
||||
popa
|
||||
ret
|
||||
@@ -362,7 +368,7 @@ fun_opn_dlg: ;
|
||||
repne scasb
|
||||
cmp byte[edi-2],'/'
|
||||
jne .no_slash
|
||||
|
||||
|
||||
dec edi ;<3B> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <>, <20><> <20><><EFBFBD><EFBFBD> 㪮<><E3AAAE>稢<EFBFBD><E7A8A2><EFBFBD> <20><> 1 ᨬ<><E1A8AC><EFBFBD>
|
||||
.no_slash:
|
||||
mov byte[edi-1],'/' ;<3B>⠢<EFBFBD><E2A0A2> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <>
|
||||
@@ -390,7 +396,7 @@ fun_opn_dlg: ;
|
||||
sub esi,5
|
||||
cmp esi,[edit2.text]
|
||||
jle .short_fn
|
||||
|
||||
|
||||
mov byte[esi],0
|
||||
sub dword [edit2.size],4
|
||||
sub dword [edit2.pos],4
|
||||
@@ -416,20 +422,20 @@ draw_messages:
|
||||
msub [bottom_right],7,11
|
||||
add [bottom_right],7 shl 16 + 53
|
||||
mcall 13,,,0xFeFefe ; clear work area
|
||||
|
||||
|
||||
; draw top shadow
|
||||
push ecx
|
||||
mov cx,1
|
||||
mov edx,0xDADEDA
|
||||
mcall
|
||||
|
||||
|
||||
; draw left shadow
|
||||
pop ecx
|
||||
push ebx
|
||||
mov bx,1
|
||||
mcall
|
||||
pop ebx
|
||||
|
||||
|
||||
_cy = 0
|
||||
_sy = 2
|
||||
_cx = 4
|
||||
@@ -621,12 +627,12 @@ start:
|
||||
;---------------------------------------------------------------------
|
||||
mov [input_file],infile
|
||||
mov [output_file],outfile
|
||||
|
||||
|
||||
call init_memory
|
||||
|
||||
|
||||
call make_timestamp
|
||||
mov [start_time],eax
|
||||
|
||||
|
||||
call preprocessor
|
||||
call parser
|
||||
call assembler
|
||||
@@ -635,7 +641,7 @@ start:
|
||||
call symbol_dump
|
||||
@@:
|
||||
call formatter
|
||||
|
||||
|
||||
call display_user_messages
|
||||
movzx eax,[current_pass]
|
||||
inc eax
|
||||
@@ -666,7 +672,7 @@ display_bytes_count:
|
||||
mov esi,_bytes_suffix
|
||||
call display_string
|
||||
xor al,al
|
||||
|
||||
|
||||
cmp [_run_outfile],0
|
||||
je @f
|
||||
mov edx,outfile
|
||||
|
@@ -27,7 +27,7 @@ include '../../proc32.inc'
|
||||
include '../../macros.inc' ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ᥬ<EFBFBD><E1A5AC><EFBFBD><EFBFBD>騪<EFBFBD><E9A8AA>!
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../develop/libraries/box_lib/box_lib.mac'
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
@use_library
|
||||
|
@@ -69,7 +69,7 @@ include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../config.inc' ; for nightbuild
|
||||
include '../../macros.inc'
|
||||
include '../libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../libraries/box_lib/box_lib.mac'
|
||||
include '../../load_lib.mac'
|
||||
|
||||
@use_library
|
||||
|
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
||||
@@ -11,7 +17,7 @@ include '../../KOSfuncs.inc'
|
||||
include '../../develop/libraries/libs-dev/libimg/libimg.inc'
|
||||
include '../../load_img.inc'
|
||||
include '../../load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../develop/libraries/box_lib/box_lib.mac'
|
||||
include '../../develop/libraries/TinyGL/asm_fork/kosgl.inc'
|
||||
include '../../develop/libraries/TinyGL/asm_fork/opengl_const.inc'
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
||||
@@ -11,7 +17,7 @@ include '../../KOSfuncs.inc'
|
||||
include '../../develop/libraries/libs-dev/libimg/libimg.inc'
|
||||
include '../../load_img.inc'
|
||||
include '../../load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../develop/libraries/box_lib/box_lib.mac'
|
||||
include '../../develop/libraries/TinyGL/asm_fork/opengl_const.inc'
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
include 'info_fun_float.inc'
|
||||
|
@@ -1,422 +1,424 @@
|
||||
;*****************************************************************************
|
||||
; Example for Box_lib: scrollbar, menubar, dinamic_button
|
||||
; Copyright (c) 2009, Marat Zakiyanov aka Mario79, aka Mario
|
||||
; All rights reserved.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
; modification, are permitted provided that the following conditions are met:
|
||||
; * Redistributions of source code must retain the above copyright
|
||||
; notice, this list of conditions and the following disclaimer.
|
||||
; * Redistributions in binary form must reproduce the above copyright
|
||||
; notice, this list of conditions and the following disclaimer in the
|
||||
; documentation and/or other materials provided with the distribution.
|
||||
; * Neither the name of the <organization> nor the
|
||||
; names of its contributors may be used to endorse or promote products
|
||||
; derived from this software without specific prior written permission.
|
||||
;
|
||||
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
|
||||
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;******************************************************************************
|
||||
; import_boxlib procedure written by <Lrz>
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
use32
|
||||
org 0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd START
|
||||
dd IM_END
|
||||
dd I_END
|
||||
dd stacktop
|
||||
dd 0
|
||||
dd path
|
||||
|
||||
include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
@use_library
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- Start of program ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
START:
|
||||
mcall 68,11
|
||||
mcall 66,1,1
|
||||
mcall 40,0x27
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
load_libraries l_libs_start,end_l_libs
|
||||
|
||||
test eax,eax
|
||||
jnz button.exit
|
||||
|
||||
; unpack deflate
|
||||
mov eax,[unpack_DeflateUnpack2]
|
||||
mov [deflate_unpack],eax
|
||||
|
||||
; OpenDialog initialisation
|
||||
push dword OpenDialog_data
|
||||
call [OpenDialog_Init]
|
||||
|
||||
mov edi,filename_area
|
||||
mov esi,start_temp_file_name
|
||||
xor eax,eax
|
||||
cld
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test eax,eax
|
||||
jnz @b
|
||||
|
||||
|
||||
; mov ebx,icons_file_name
|
||||
; mov esi,path
|
||||
; mov edi,file_name
|
||||
|
||||
copy_path icons_file_name,path,library_path,0
|
||||
|
||||
mcall 70,fileinfo
|
||||
|
||||
mov [fileinfo+0],dword 0
|
||||
|
||||
mov ecx,[file_info+32]
|
||||
mov [fileinfo+12],ecx
|
||||
mov [img_size],ecx
|
||||
|
||||
|
||||
mcall 68,12
|
||||
|
||||
|
||||
mov [fileinfo+16],eax
|
||||
mov [image_file],eax
|
||||
|
||||
|
||||
mcall 70,fileinfo
|
||||
|
||||
xor eax,eax
|
||||
mov [return_code],eax
|
||||
; mov eax,image_file
|
||||
push image_file
|
||||
call [cnv_png_import.Start]
|
||||
|
||||
mov ecx,[image_file]
|
||||
mcall 68,13,
|
||||
|
||||
cmp [return_code],dword 0
|
||||
jne button.exit
|
||||
|
||||
mov ebx,[raw_pointer]
|
||||
mov eax,[ebx+4]
|
||||
; set of button size
|
||||
mov [dinamic_button_data_1.size_x],ax
|
||||
mov [dinamic_button_data_1.size_y],ax
|
||||
mov [dinamic_button_data_2.size_x],ax
|
||||
mov [dinamic_button_data_2.size_y],ax
|
||||
mov eax,[ebx+12]
|
||||
; set of RAW resolution to pixel
|
||||
mov [dinamic_button_data_1.resolution_raw],eax
|
||||
mov [dinamic_button_data_2.resolution_raw],eax
|
||||
mov eax,[ebx+20]
|
||||
add eax,ebx
|
||||
; set RAW palette, use else resolution 8bit or less
|
||||
mov [dinamic_button_data_1.palette_raw],eax
|
||||
mov [dinamic_button_data_2.palette_raw],eax
|
||||
mov eax,[ebx+28]
|
||||
add eax,ebx
|
||||
; set RAW area for passive button
|
||||
mov [dinamic_button_data_1.passive_raw],eax
|
||||
mov [dinamic_button_data_2.passive_raw],eax
|
||||
mov ecx,[ebx+4]
|
||||
imul ecx,[ebx+4]
|
||||
imul ecx,[ebx+12]
|
||||
shr ecx,3
|
||||
add eax,ecx
|
||||
; set RAW area for active button
|
||||
mov [dinamic_button_data_1.active_raw],eax
|
||||
mov [dinamic_button_data_2.active_raw],eax
|
||||
add eax,ecx
|
||||
; RAW area for click button
|
||||
mov [dinamic_button_data_1.click_raw],eax
|
||||
mov [dinamic_button_data_2.click_raw],eax
|
||||
;---------------------------------------------------------------------
|
||||
red:
|
||||
call draw_window
|
||||
still:
|
||||
mcall 10
|
||||
|
||||
cmp eax,1
|
||||
je red
|
||||
cmp eax,2
|
||||
je key
|
||||
cmp eax,3
|
||||
je button
|
||||
cmp eax,6
|
||||
je mouse
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
key:
|
||||
mcall 2
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
button:
|
||||
mcall 17
|
||||
cmp ah,1
|
||||
jne still
|
||||
.exit:
|
||||
mcall -1
|
||||
;---------------------------------------------------------------------
|
||||
mouse:
|
||||
;-----------------------------------------------
|
||||
cmp [scroll_bar_data_horizontal.delta2],0
|
||||
jne .horizontal
|
||||
.vertical:
|
||||
mov eax,[scroll_bar_data_vertical.max_area]
|
||||
cmp eax,[scroll_bar_data_vertical.cur_area]
|
||||
jbe .horizontal
|
||||
; mouse event for Vertical ScrollBar
|
||||
push dword scroll_bar_data_vertical
|
||||
call [scrollbar_ver_mouse]
|
||||
mov eax,scroll_bar_data_vertical.redraw
|
||||
xor ebx,ebx
|
||||
cmp [eax],ebx
|
||||
je @f
|
||||
mov [eax],ebx
|
||||
jmp .draw_cube
|
||||
@@:
|
||||
cmp [scroll_bar_data_vertical.delta2],0
|
||||
jne still
|
||||
.horizontal:
|
||||
mov eax,[scroll_bar_data_horizontal.max_area]
|
||||
cmp eax,[scroll_bar_data_horizontal.cur_area]
|
||||
jbe .other
|
||||
; mouse event for Horizontal ScrollBar
|
||||
push dword scroll_bar_data_horizontal
|
||||
call [scrollbar_hor_mouse]
|
||||
mov eax,scroll_bar_data_horizontal.redraw
|
||||
xor ebx,ebx
|
||||
cmp [eax],ebx
|
||||
je .other
|
||||
mov [eax],ebx
|
||||
.draw_cube:
|
||||
call draw_cube
|
||||
jmp still
|
||||
.other:
|
||||
cmp [scroll_bar_data_vertical.delta2],0
|
||||
jne still
|
||||
cmp [scroll_bar_data_horizontal.delta2],0
|
||||
jne still
|
||||
;-----------------------------------------------
|
||||
.menu_bar_1:
|
||||
call .set_mouse_flag
|
||||
@@:
|
||||
; mouse event for Menu 1
|
||||
push dword menu_data_1
|
||||
call [menu_bar_mouse]
|
||||
cmp [menu_data_1.click],dword 1
|
||||
jne .menu_bar_2
|
||||
cmp [menu_data_1.cursor_out],dword 0
|
||||
jne analyse_out_menu_1
|
||||
jmp .menu_bar_1
|
||||
;--------------------------------------------
|
||||
.menu_bar_2:
|
||||
; mouse event for Menu 2
|
||||
push dword menu_data_2
|
||||
call [menu_bar_mouse]
|
||||
cmp [menu_data_2.click],dword 1
|
||||
jne .mouse_dinamic_button
|
||||
cmp [menu_data_2.cursor_out],dword 0
|
||||
jne analyse_out_menu_2
|
||||
jmp .menu_bar_1
|
||||
;--------------------------------------------
|
||||
.mouse_dinamic_button:
|
||||
; mouse event for Dinamic Button 1
|
||||
push dword dinamic_button_data_1
|
||||
call [dinamic_button_mouse]
|
||||
mov eax,dinamic_button_data_1.click
|
||||
cmp [eax],dword 1
|
||||
jne @f
|
||||
mov [eax],dword 0
|
||||
jmp about
|
||||
@@:
|
||||
; mouse event for Dinamic Button 2
|
||||
push dword dinamic_button_data_2
|
||||
call [dinamic_button_mouse]
|
||||
mov eax,dinamic_button_data_2.click
|
||||
cmp [eax],dword 1
|
||||
jne still ;@f
|
||||
mov [eax],dword 0
|
||||
jmp button.exit
|
||||
;---------------------------------------------------------------------
|
||||
.set_mouse_flag:
|
||||
xor eax,eax
|
||||
inc eax
|
||||
mov [menu_data_1.get_mouse_flag],eax
|
||||
mov [menu_data_2.get_mouse_flag],eax
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
analyse_out_menu_1:
|
||||
; analyse result of Menu 1
|
||||
mov eax,[menu_data_1.cursor_out]
|
||||
cmp eax,dword 1
|
||||
je OpenDialog_start_0
|
||||
cmp eax,dword 2
|
||||
je OpenDialog_start_1
|
||||
cmp eax,dword 3
|
||||
je OpenDialog_start_2
|
||||
cmp eax,dword 4
|
||||
je button.exit
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
analyse_out_menu_2:
|
||||
; analyse result of Menu 2
|
||||
cmp [menu_data_2.cursor_out],dword 2
|
||||
je about
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
about:
|
||||
mcall 51,1,thread3,thread
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
OpenDialog_start_0:
|
||||
mov [OpenDialog_data.type],0
|
||||
jmp OpenDialog_start
|
||||
OpenDialog_start_1:
|
||||
mov [OpenDialog_data.type],1
|
||||
jmp OpenDialog_start
|
||||
OpenDialog_start_2:
|
||||
mov [OpenDialog_data.type],2
|
||||
OpenDialog_start:
|
||||
; mov ebx,open_dialog_name
|
||||
; mov esi,path
|
||||
; mov edi,library_path
|
||||
; call copy_file_path
|
||||
|
||||
; copy_path open_dialog_name,path,library_path,0
|
||||
|
||||
push dword OpenDialog_data
|
||||
call [OpenDialog_Start]
|
||||
|
||||
cmp [OpenDialog_data.status],2 ; OpenDialog does not start
|
||||
je still ; some kind of alternative, instead OpenDialog
|
||||
cmp [OpenDialog_data.status],1
|
||||
jne still ; OpenDialog user say cancel
|
||||
; copy path
|
||||
; prepare path - PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_prepare]
|
||||
|
||||
call draw_window
|
||||
jmp still ; OpenDialog user selected the target file
|
||||
; [OpenDialog_data.openfile_pach] pointer of area the target file
|
||||
;---------------------------------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
draw_window:
|
||||
mcall 12,1
|
||||
mcall 0,<0,400>,<0,400>,0x03AABBCC,0x805080D0,0x005080D0
|
||||
mcall 71,1,header_1
|
||||
;---------------------------------------------
|
||||
; draw for Menu 1
|
||||
push dword menu_data_1
|
||||
call [menu_bar_draw]
|
||||
; draw for Menu 2
|
||||
push dword menu_data_2
|
||||
call [menu_bar_draw]
|
||||
;---------------------------------------------
|
||||
; draw for Dinamic Button 1
|
||||
push dword dinamic_button_data_1
|
||||
call [dinamic_button_draw]
|
||||
; draw for Dinamic Button 2
|
||||
push dword dinamic_button_data_2
|
||||
call [dinamic_button_draw]
|
||||
;---------------------------------------------
|
||||
mcall 13,<170,200>,<25,15>,0xffffb0
|
||||
; mov bx,28
|
||||
; add ebx,2 shl 16
|
||||
; mcall 4,,0xC0000000,text_work_area,,0xffffb0
|
||||
; draw for PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_draw]
|
||||
;---------------------------------------------
|
||||
; set all_redraw flag for draw all ScrollBar
|
||||
; In some cases it is necessity to draw only the area
|
||||
; of moving of a "runner", for acceleration of output -
|
||||
; in this case the flag needs to be reset to 0 (zero).
|
||||
xor eax,eax
|
||||
inc eax
|
||||
mov [scroll_bar_data_vertical.all_redraw],eax
|
||||
mov [scroll_bar_data_horizontal.all_redraw],eax
|
||||
|
||||
; draw for Vertical ScrollBar
|
||||
push dword scroll_bar_data_vertical
|
||||
call [scrollbar_ver_draw]
|
||||
; draw for Horizontal ScrollBar
|
||||
push dword scroll_bar_data_horizontal
|
||||
call [scrollbar_hor_draw]
|
||||
; reset all_redraw flag
|
||||
xor eax,eax
|
||||
mov [scroll_bar_data_vertical.all_redraw],eax
|
||||
mov [scroll_bar_data_horizontal.all_redraw],eax
|
||||
;---------------------------------------------
|
||||
call draw_cube
|
||||
mcall 12,2
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
draw_cube:
|
||||
mcall 13,<30,301>,<50,301>,0xafafaf
|
||||
mov ecx,[scroll_bar_data_vertical.position]
|
||||
add ecx,50
|
||||
shl ecx,16
|
||||
mov cx,30
|
||||
mov ebx,[scroll_bar_data_horizontal.position]
|
||||
add ebx,30
|
||||
shl ebx,16
|
||||
mov bx,30
|
||||
mcall 13,,,0x0
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
include 'data.inc'
|
||||
include 'w_about.inc'
|
||||
;---------------------------------------------------------------------
|
||||
IM_END:
|
||||
rb 1024
|
||||
thread:
|
||||
;---------------------------------------------------------------------
|
||||
rb 1024
|
||||
stacktop:
|
||||
;---------------------------------------------------------------------
|
||||
path:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
openfile_pach:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
file_name:
|
||||
library_path:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
plugin_pach:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
text_work_area:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
filename_area:
|
||||
rb 256
|
||||
;---------------------------------------------------------------------
|
||||
file_info:
|
||||
rb 40
|
||||
;---------------------------------------------------------------------
|
||||
procinfo:
|
||||
rb 1024
|
||||
;---------------------------------------------------------------------
|
||||
I_END:
|
||||
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
;*****************************************************************************
|
||||
; Example for Box_lib: scrollbar, menubar, dinamic_button
|
||||
; Copyright (c) 2009, Marat Zakiyanov aka Mario79, aka Mario
|
||||
; All rights reserved.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
; modification, are permitted provided that the following conditions are met:
|
||||
; * Redistributions of source code must retain the above copyright
|
||||
; notice, this list of conditions and the following disclaimer.
|
||||
; * Redistributions in binary form must reproduce the above copyright
|
||||
; notice, this list of conditions and the following disclaimer in the
|
||||
; documentation and/or other materials provided with the distribution.
|
||||
; * Neither the name of the <organization> nor the
|
||||
; names of its contributors may be used to endorse or promote products
|
||||
; derived from this software without specific prior written permission.
|
||||
;
|
||||
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
|
||||
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;******************************************************************************
|
||||
; import_boxlib procedure written by <Lrz>
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
use32
|
||||
org 0
|
||||
|
||||
db 'MENUET01'
|
||||
dd 1
|
||||
dd START
|
||||
dd IM_END
|
||||
dd I_END
|
||||
dd stacktop
|
||||
dd 0
|
||||
dd path
|
||||
|
||||
include '../../../../macros.inc'
|
||||
include '../../../../KOSfuncs.inc'
|
||||
include '../../../../load_lib.mac'
|
||||
@use_library
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- Start of program ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
START:
|
||||
mcall 68,11
|
||||
mcall 66,1,1
|
||||
mcall 40,0x27
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
load_libraries l_libs_start,end_l_libs
|
||||
|
||||
test eax,eax
|
||||
jnz button.exit
|
||||
|
||||
; unpack deflate
|
||||
mov eax,[unpack_DeflateUnpack2]
|
||||
mov [deflate_unpack],eax
|
||||
|
||||
; OpenDialog initialisation
|
||||
push dword OpenDialog_data
|
||||
call [OpenDialog_Init]
|
||||
|
||||
mov edi,filename_area
|
||||
mov esi,start_temp_file_name
|
||||
xor eax,eax
|
||||
cld
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test eax,eax
|
||||
jnz @b
|
||||
|
||||
|
||||
; mov ebx,icons_file_name
|
||||
; mov esi,path
|
||||
; mov edi,file_name
|
||||
|
||||
copy_path icons_file_name,path,library_path,0
|
||||
|
||||
mcall 70,fileinfo
|
||||
|
||||
mov [fileinfo+0],dword 0
|
||||
|
||||
mov ecx,[file_info+32]
|
||||
mov [fileinfo+12],ecx
|
||||
mov [img_size],ecx
|
||||
|
||||
|
||||
mcall 68,12
|
||||
|
||||
|
||||
mov [fileinfo+16],eax
|
||||
mov [image_file],eax
|
||||
|
||||
|
||||
mcall 70,fileinfo
|
||||
|
||||
xor eax,eax
|
||||
mov [return_code],eax
|
||||
; mov eax,image_file
|
||||
push image_file
|
||||
call [cnv_png_import.Start]
|
||||
|
||||
mov ecx,[image_file]
|
||||
mcall 68,13,
|
||||
|
||||
cmp [return_code],dword 0
|
||||
jne button.exit
|
||||
|
||||
mov ebx,[raw_pointer]
|
||||
mov eax,[ebx+4]
|
||||
; set of button size
|
||||
mov [dinamic_button_data_1.size_x],ax
|
||||
mov [dinamic_button_data_1.size_y],ax
|
||||
mov [dinamic_button_data_2.size_x],ax
|
||||
mov [dinamic_button_data_2.size_y],ax
|
||||
mov eax,[ebx+12]
|
||||
; set of RAW resolution to pixel
|
||||
mov [dinamic_button_data_1.resolution_raw],eax
|
||||
mov [dinamic_button_data_2.resolution_raw],eax
|
||||
mov eax,[ebx+20]
|
||||
add eax,ebx
|
||||
; set RAW palette, use else resolution 8bit or less
|
||||
mov [dinamic_button_data_1.palette_raw],eax
|
||||
mov [dinamic_button_data_2.palette_raw],eax
|
||||
mov eax,[ebx+28]
|
||||
add eax,ebx
|
||||
; set RAW area for passive button
|
||||
mov [dinamic_button_data_1.passive_raw],eax
|
||||
mov [dinamic_button_data_2.passive_raw],eax
|
||||
mov ecx,[ebx+4]
|
||||
imul ecx,[ebx+4]
|
||||
imul ecx,[ebx+12]
|
||||
shr ecx,3
|
||||
add eax,ecx
|
||||
; set RAW area for active button
|
||||
mov [dinamic_button_data_1.active_raw],eax
|
||||
mov [dinamic_button_data_2.active_raw],eax
|
||||
add eax,ecx
|
||||
; RAW area for click button
|
||||
mov [dinamic_button_data_1.click_raw],eax
|
||||
mov [dinamic_button_data_2.click_raw],eax
|
||||
;---------------------------------------------------------------------
|
||||
red:
|
||||
call draw_window
|
||||
still:
|
||||
mcall 10
|
||||
|
||||
cmp eax,1
|
||||
je red
|
||||
cmp eax,2
|
||||
je key
|
||||
cmp eax,3
|
||||
je button
|
||||
cmp eax,6
|
||||
je mouse
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
key:
|
||||
mcall 2
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
button:
|
||||
mcall 17
|
||||
cmp ah,1
|
||||
jne still
|
||||
.exit:
|
||||
mcall -1
|
||||
;---------------------------------------------------------------------
|
||||
mouse:
|
||||
;-----------------------------------------------
|
||||
cmp [scroll_bar_data_horizontal.delta2],0
|
||||
jne .horizontal
|
||||
.vertical:
|
||||
mov eax,[scroll_bar_data_vertical.max_area]
|
||||
cmp eax,[scroll_bar_data_vertical.cur_area]
|
||||
jbe .horizontal
|
||||
; mouse event for Vertical ScrollBar
|
||||
push dword scroll_bar_data_vertical
|
||||
call [scrollbar_ver_mouse]
|
||||
mov eax,scroll_bar_data_vertical.redraw
|
||||
xor ebx,ebx
|
||||
cmp [eax],ebx
|
||||
je @f
|
||||
mov [eax],ebx
|
||||
jmp .draw_cube
|
||||
@@:
|
||||
cmp [scroll_bar_data_vertical.delta2],0
|
||||
jne still
|
||||
.horizontal:
|
||||
mov eax,[scroll_bar_data_horizontal.max_area]
|
||||
cmp eax,[scroll_bar_data_horizontal.cur_area]
|
||||
jbe .other
|
||||
; mouse event for Horizontal ScrollBar
|
||||
push dword scroll_bar_data_horizontal
|
||||
call [scrollbar_hor_mouse]
|
||||
mov eax,scroll_bar_data_horizontal.redraw
|
||||
xor ebx,ebx
|
||||
cmp [eax],ebx
|
||||
je .other
|
||||
mov [eax],ebx
|
||||
.draw_cube:
|
||||
call draw_cube
|
||||
jmp still
|
||||
.other:
|
||||
cmp [scroll_bar_data_vertical.delta2],0
|
||||
jne still
|
||||
cmp [scroll_bar_data_horizontal.delta2],0
|
||||
jne still
|
||||
;-----------------------------------------------
|
||||
.menu_bar_1:
|
||||
call .set_mouse_flag
|
||||
@@:
|
||||
; mouse event for Menu 1
|
||||
push dword menu_data_1
|
||||
call [menu_bar_mouse]
|
||||
cmp [menu_data_1.click],dword 1
|
||||
jne .menu_bar_2
|
||||
cmp [menu_data_1.cursor_out],dword 0
|
||||
jne analyse_out_menu_1
|
||||
jmp .menu_bar_1
|
||||
;--------------------------------------------
|
||||
.menu_bar_2:
|
||||
; mouse event for Menu 2
|
||||
push dword menu_data_2
|
||||
call [menu_bar_mouse]
|
||||
cmp [menu_data_2.click],dword 1
|
||||
jne .mouse_dinamic_button
|
||||
cmp [menu_data_2.cursor_out],dword 0
|
||||
jne analyse_out_menu_2
|
||||
jmp .menu_bar_1
|
||||
;--------------------------------------------
|
||||
.mouse_dinamic_button:
|
||||
; mouse event for Dinamic Button 1
|
||||
push dword dinamic_button_data_1
|
||||
call [dinamic_button_mouse]
|
||||
mov eax,dinamic_button_data_1.click
|
||||
cmp [eax],dword 1
|
||||
jne @f
|
||||
mov [eax],dword 0
|
||||
jmp about
|
||||
@@:
|
||||
; mouse event for Dinamic Button 2
|
||||
push dword dinamic_button_data_2
|
||||
call [dinamic_button_mouse]
|
||||
mov eax,dinamic_button_data_2.click
|
||||
cmp [eax],dword 1
|
||||
jne still ;@f
|
||||
mov [eax],dword 0
|
||||
jmp button.exit
|
||||
;---------------------------------------------------------------------
|
||||
.set_mouse_flag:
|
||||
xor eax,eax
|
||||
inc eax
|
||||
mov [menu_data_1.get_mouse_flag],eax
|
||||
mov [menu_data_2.get_mouse_flag],eax
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
analyse_out_menu_1:
|
||||
; analyse result of Menu 1
|
||||
mov eax,[menu_data_1.cursor_out]
|
||||
cmp eax,dword 1
|
||||
je OpenDialog_start_0
|
||||
cmp eax,dword 2
|
||||
je OpenDialog_start_1
|
||||
cmp eax,dword 3
|
||||
je OpenDialog_start_2
|
||||
cmp eax,dword 4
|
||||
je button.exit
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
analyse_out_menu_2:
|
||||
; analyse result of Menu 2
|
||||
cmp [menu_data_2.cursor_out],dword 2
|
||||
je about
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
about:
|
||||
mcall 51,1,thread3,thread
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
OpenDialog_start_0:
|
||||
mov [OpenDialog_data.type],0
|
||||
jmp OpenDialog_start
|
||||
OpenDialog_start_1:
|
||||
mov [OpenDialog_data.type],1
|
||||
jmp OpenDialog_start
|
||||
OpenDialog_start_2:
|
||||
mov [OpenDialog_data.type],2
|
||||
OpenDialog_start:
|
||||
; mov ebx,open_dialog_name
|
||||
; mov esi,path
|
||||
; mov edi,library_path
|
||||
; call copy_file_path
|
||||
|
||||
; copy_path open_dialog_name,path,library_path,0
|
||||
|
||||
push dword OpenDialog_data
|
||||
call [OpenDialog_Start]
|
||||
|
||||
cmp [OpenDialog_data.status],2 ; OpenDialog does not start
|
||||
je still ; some kind of alternative, instead OpenDialog
|
||||
cmp [OpenDialog_data.status],1
|
||||
jne still ; OpenDialog user say cancel
|
||||
; copy path
|
||||
; prepare path - PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_prepare]
|
||||
|
||||
call draw_window
|
||||
jmp still ; OpenDialog user selected the target file
|
||||
; [OpenDialog_data.openfile_pach] pointer of area the target file
|
||||
;---------------------------------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
draw_window:
|
||||
mcall 12,1
|
||||
mcall 0,<0,400>,<0,400>,0x03AABBCC,0x805080D0,0x005080D0
|
||||
mcall 71,1,header_1
|
||||
;---------------------------------------------
|
||||
; draw for Menu 1
|
||||
push dword menu_data_1
|
||||
call [menu_bar_draw]
|
||||
; draw for Menu 2
|
||||
push dword menu_data_2
|
||||
call [menu_bar_draw]
|
||||
;---------------------------------------------
|
||||
; draw for Dinamic Button 1
|
||||
push dword dinamic_button_data_1
|
||||
call [dinamic_button_draw]
|
||||
; draw for Dinamic Button 2
|
||||
push dword dinamic_button_data_2
|
||||
call [dinamic_button_draw]
|
||||
;---------------------------------------------
|
||||
mcall 13,<170,200>,<25,15>,0xffffb0
|
||||
; mov bx,28
|
||||
; add ebx,2 shl 16
|
||||
; mcall 4,,0xC0000000,text_work_area,,0xffffb0
|
||||
; draw for PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_draw]
|
||||
;---------------------------------------------
|
||||
; set all_redraw flag for draw all ScrollBar
|
||||
; In some cases it is necessity to draw only the area
|
||||
; of moving of a "runner", for acceleration of output -
|
||||
; in this case the flag needs to be reset to 0 (zero).
|
||||
xor eax,eax
|
||||
inc eax
|
||||
mov [scroll_bar_data_vertical.all_redraw],eax
|
||||
mov [scroll_bar_data_horizontal.all_redraw],eax
|
||||
|
||||
; draw for Vertical ScrollBar
|
||||
push dword scroll_bar_data_vertical
|
||||
call [scrollbar_ver_draw]
|
||||
; draw for Horizontal ScrollBar
|
||||
push dword scroll_bar_data_horizontal
|
||||
call [scrollbar_hor_draw]
|
||||
; reset all_redraw flag
|
||||
xor eax,eax
|
||||
mov [scroll_bar_data_vertical.all_redraw],eax
|
||||
mov [scroll_bar_data_horizontal.all_redraw],eax
|
||||
;---------------------------------------------
|
||||
call draw_cube
|
||||
mcall 12,2
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
draw_cube:
|
||||
mcall 13,<30,301>,<50,301>,0xafafaf
|
||||
mov ecx,[scroll_bar_data_vertical.position]
|
||||
add ecx,50
|
||||
shl ecx,16
|
||||
mov cx,30
|
||||
mov ebx,[scroll_bar_data_horizontal.position]
|
||||
add ebx,30
|
||||
shl ebx,16
|
||||
mov bx,30
|
||||
mcall 13,,,0x0
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
include 'data.inc'
|
||||
include 'w_about.inc'
|
||||
;---------------------------------------------------------------------
|
||||
IM_END:
|
||||
rb 1024
|
||||
thread:
|
||||
;---------------------------------------------------------------------
|
||||
rb 1024
|
||||
stacktop:
|
||||
;---------------------------------------------------------------------
|
||||
path:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
openfile_pach:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
file_name:
|
||||
library_path:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
plugin_pach:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
text_work_area:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
filename_area:
|
||||
rb 256
|
||||
;---------------------------------------------------------------------
|
||||
file_info:
|
||||
rb 40
|
||||
;---------------------------------------------------------------------
|
||||
procinfo:
|
||||
rb 1024
|
||||
;---------------------------------------------------------------------
|
||||
I_END:
|
@@ -1,194 +1,200 @@
|
||||
;§ £®«®¢®ª ¯à¨«®¦¥¨ï
|
||||
use32 ; âà á«ïâ®à, ¨á¯®«ì§ãî騩 32 à §àï¤ëå ª®¬ ¤ë
|
||||
org 0 ; ¡ §®¢ë© ¤à¥á ª®¤ , ¢á¥£¤ 0
|
||||
db 'MENUET01' ; ¨¤¥â¨ä¨ª â®à ¨á¯®«ï¥¬®£® ä ©« (8 ¡ ©â)
|
||||
dd 1 ; ¢¥àá¨ï ä®à¬ â § £®«®¢ª ¨á¯®«ï¥¬®£® ä ©«
|
||||
dd start ; ¤à¥á, ª®â®àë© á¨á⥬ ¯¥à¥¤ ñâ ã¯à ¢«¥¨¥
|
||||
; ¯®á«¥ § £à㧪¨ ¯à¨«®¦¥¨ï ¢ ¯ ¬ïâì
|
||||
dd i_end ; à §¬¥à ¯à¨«®¦¥¨ï
|
||||
dd mem ; Ž¡ê¥¬ ¨á¯®«ì§ã¥¬®© ¯ ¬ïâ¨, ¤«ï á⥪ ®â¢¥¤¥¬ 0å100 ¡ ©â ¨ ¢ë஢¨¬ £à¨æã 4 ¡ ©â
|
||||
dd mem ; à ᯮ«®¦¨¬ ¯®§¨æ¨î á⥪ ¢ ®¡« á⨠¯ ¬ïâ¨, áà §ã § ⥫®¬ ¯à®£à ¬¬ë. ‚¥àè¨ á⥪ ¢ ¤¨ ¯ §®¥ ¯ ¬ïâ¨, 㪠§ ®¬ ¢ëè¥
|
||||
dd 0 ; 㪠§ ⥫ì áâபã á ¯ à ¬¥âà ¬¨.
|
||||
dd cur_dir_path ; 㪠§ â¥«ì ¤à¥á, ªã¤ ¯®¬¥é ¥âáï áâப , ᮤ¥à¦ é ï ¯ãâì ¤® ¯à®£à ¬¬ë ¢ ¬®¬¥â § ¯ã᪠.
|
||||
|
||||
include '../../../../../macros.inc'
|
||||
include '../../trunk/box_lib.mac'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../load_lib.mac'
|
||||
@use_library ;use load lib macros
|
||||
start:
|
||||
;universal load library/librarys
|
||||
sys_load_library library_name, library_path, system_path, myimport
|
||||
;if return code =-1 then exit, else nornary work
|
||||
cmp eax,-1
|
||||
jz exit
|
||||
mcall SF_SET_EVENTS_MASK,0x80000027 ;ãáâ ®¢¨âì ¬ áªã ¤«ï ®¦¨¤ ¥¬ëå ᮡë⨩
|
||||
|
||||
push dword check1 ;¯®¤áçñâ ¤¨ë ⥪áâ ¤«ï Checkbox'®¢
|
||||
call [init_checkbox]
|
||||
|
||||
push dword check2
|
||||
call [init_checkbox]
|
||||
|
||||
red_win:
|
||||
call draw_window ;¯¥à¢® ç «ì® ¥®¡å®¤¨¬® à¨á®¢ âì ®ª®
|
||||
align 4
|
||||
still: ;®á®¢®© ®¡à ¡®â稪
|
||||
mcall SF_WAIT_EVENT
|
||||
dec eax
|
||||
jz red_win
|
||||
dec eax
|
||||
jz key
|
||||
dec eax
|
||||
jz button
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_mouse]
|
||||
|
||||
push dword edit2
|
||||
call [edit_box_mouse]
|
||||
|
||||
push dword check1
|
||||
call [check_box_mouse]
|
||||
|
||||
push dword check2
|
||||
call [check_box_mouse]
|
||||
|
||||
push dword Option_boxs
|
||||
call [option_box_mouse]
|
||||
|
||||
push dword Option_boxs2
|
||||
call [option_box_mouse]
|
||||
|
||||
jmp still ;¥á«¨ ¨ç¥£® ¨§ ¯¥à¥ç¨á«¥®£® ⮠ᮢ ¢ 横«
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
button:
|
||||
mcall SF_GET_BUTTON
|
||||
test ah,ah ;¥á«¨ ¢ ah 0, â® ¯¥à¥©â¨ ®¡à ¡®â稪 ᮡë⨩ still
|
||||
jz still
|
||||
exit:
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
key:
|
||||
mcall SF_GET_KEY
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_key]
|
||||
|
||||
push dword edit2
|
||||
call [edit_box_key]
|
||||
|
||||
jmp still
|
||||
|
||||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
align 4
|
||||
draw_window: ;à¨á®¢ ¨¥ ®ª ¯à¨«®¦¥¨ï
|
||||
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
||||
mcall SF_CREATE_WINDOW,(50*65536+390),(30*65536+200),0x33AABBCC,0x805080DD,hed
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_draw]
|
||||
|
||||
push dword edit2
|
||||
call [edit_box_draw]
|
||||
|
||||
push dword check1
|
||||
call [check_box_draw]
|
||||
|
||||
push dword check2
|
||||
call [check_box_draw]
|
||||
|
||||
push dword Option_boxs
|
||||
call [option_box_draw]
|
||||
|
||||
push dword Option_boxs2
|
||||
call [option_box_draw]
|
||||
|
||||
mcall SF_REDRAW, SSF_END_DRAW
|
||||
ret
|
||||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
;DATA ¤ ë¥
|
||||
;‚ᥣ¤ ᮡ«î¤ âì ¯®á«¥¤®¢ ⥫ì®áâì ¢ ¨¬¥¨.
|
||||
system_path db '/sys/lib/'
|
||||
library_name db 'box_lib.obj',0
|
||||
; …᫨ ¥áâì ¦¥« ¨¥ à §ê¥¤¨¨âì, ⮠㦮 ¨á¯®«ì§®¢ âì á«¥¤ãîé¨î ª®áâàãªæ¨î
|
||||
;system_path db '/sys/lib/box_lib.obj',0
|
||||
;... «î¡ ï ¯®á«¥¤®¢ ⥫ì®áâì ¤àã£¨å ª®¬ ¤ ¨ ®¯à¥¤¥«¥¨©.
|
||||
;library_name db 'box_lib.obj',0
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
myimport:
|
||||
|
||||
edit_box_draw dd aEdit_box_draw
|
||||
edit_box_key dd aEdit_box_key
|
||||
edit_box_mouse dd aEdit_box_mouse
|
||||
version_ed dd aVersion_ed
|
||||
|
||||
init_checkbox dd aInit_checkbox
|
||||
check_box_draw dd aCheck_box_draw
|
||||
check_box_mouse dd aCheck_box_mouse
|
||||
version_ch dd aVersion_ch
|
||||
|
||||
option_box_draw dd aOption_box_draw
|
||||
option_box_mouse dd aOption_box_mouse
|
||||
version_op dd aVersion_op
|
||||
|
||||
dd 0,0
|
||||
|
||||
aEdit_box_draw db 'edit_box_draw',0
|
||||
aEdit_box_key db 'edit_box_key',0
|
||||
aEdit_box_mouse db 'edit_box_mouse',0
|
||||
aVersion_ed db 'version_ed',0
|
||||
|
||||
aInit_checkbox db 'init_checkbox2',0
|
||||
aCheck_box_draw db 'check_box_draw2',0
|
||||
aCheck_box_mouse db 'check_box_mouse2',0
|
||||
aVersion_ch db 'version_ch2',0
|
||||
|
||||
aOption_box_draw db 'option_box_draw',0
|
||||
aOption_box_mouse db 'option_box_mouse',0
|
||||
aVersion_op db 'version_op',0
|
||||
|
||||
|
||||
check1 check_box2 (10 shl 16 + 12),(45 shl 16 + 12),5,0x80AABBCC,0,0,check_text1,ch_flag_en
|
||||
check2 check_box2 (10 shl 16 + 12),(60 shl 16 + 12),6,0x80AABBCC,0,0,check_text2
|
||||
|
||||
edit1 edit_box 350,3,5,0xffffff,0x6f9480,0,0xAABBCC,0,308,hed,mouse_dd,ed_focus,hed_end-hed-1,hed_end-hed-1
|
||||
edit2 edit_box 350,3,25,0xffffff,0x6a9480,0,0,0,99,ed_buffer,mouse_dd,ed_figure_only
|
||||
|
||||
op1 option_box option_group1,10,90,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
|
||||
op2 option_box option_group1,10,105,6,12,0xFFFFFF,0,0,op_text.2,op_text.e2-op_text.2
|
||||
op3 option_box option_group1,10,120,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
|
||||
op11 option_box option_group2,120,90,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
|
||||
op12 option_box option_group2,120,105,6,12,0xffffff,0,0,op_text.2,op_text.e2-op_text.2
|
||||
op13 option_box option_group2,120,120,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
|
||||
|
||||
option_group1 dd op1 ;㪠§ ⥫¨, ®¨ ®â®¡à ¦ îâáï ¯® 㬮«ç ¨î, ª®£¤ ¢ë¢®¤¨âáï
|
||||
option_group2 dd op12 ;¯à¨«®¦¥¨¥
|
||||
Option_boxs dd op1,op2,op3,0
|
||||
Option_boxs2 dd op11,op12,op13,0
|
||||
|
||||
hed db 'BOXs load from lib <Lrz> date 27.04.2009',0
|
||||
hed_end:
|
||||
|
||||
rb 256
|
||||
check_text1 db 'First checkbox',0
|
||||
check_text2 db 'Second checkbox',0
|
||||
|
||||
op_text: ; ‘®¯à®¢®¦¤ î騩 ⥪áâ ¤«ï Optionbox'
|
||||
.1 db 'Option_Box #1'
|
||||
.e1:
|
||||
.2 db 'Option_Box #2'
|
||||
.e2:
|
||||
.3 db 'Option_Box #3'
|
||||
.e3:
|
||||
ed_buffer rb 100
|
||||
;-----------------------
|
||||
;sc system_colors
|
||||
|
||||
mouse_dd rd 1
|
||||
p_info process_information
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
i_end:
|
||||
rb 1024
|
||||
mem:
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
;§ £®«®¢®ª ¯à¨«®¦¥¨ï
|
||||
use32 ; âà á«ïâ®à, ¨á¯®«ì§ãî騩 32 à §àï¤ëå ª®¬ ¤ë
|
||||
org 0 ; ¡ §®¢ë© ¤à¥á ª®¤ , ¢á¥£¤ 0
|
||||
db 'MENUET01' ; ¨¤¥â¨ä¨ª â®à ¨á¯®«ï¥¬®£® ä ©« (8 ¡ ©â)
|
||||
dd 1 ; ¢¥àá¨ï ä®à¬ â § £®«®¢ª ¨á¯®«ï¥¬®£® ä ©«
|
||||
dd start ; ¤à¥á, ª®â®àë© á¨á⥬ ¯¥à¥¤ ñâ ã¯à ¢«¥¨¥
|
||||
; ¯®á«¥ § £à㧪¨ ¯à¨«®¦¥¨ï ¢ ¯ ¬ïâì
|
||||
dd i_end ; à §¬¥à ¯à¨«®¦¥¨ï
|
||||
dd mem ; Ž¡ê¥¬ ¨á¯®«ì§ã¥¬®© ¯ ¬ïâ¨, ¤«ï á⥪ ®â¢¥¤¥¬ 0å100 ¡ ©â ¨ ¢ë஢¨¬ £à¨æã 4 ¡ ©â
|
||||
dd mem ; à ᯮ«®¦¨¬ ¯®§¨æ¨î á⥪ ¢ ®¡« á⨠¯ ¬ïâ¨, áà §ã § ⥫®¬ ¯à®£à ¬¬ë. ‚¥àè¨ á⥪ ¢ ¤¨ ¯ §®¥ ¯ ¬ïâ¨, 㪠§ ®¬ ¢ëè¥
|
||||
dd 0 ; 㪠§ ⥫ì áâபã á ¯ à ¬¥âà ¬¨.
|
||||
dd cur_dir_path ; 㪠§ â¥«ì ¤à¥á, ªã¤ ¯®¬¥é ¥âáï áâப , ᮤ¥à¦ é ï ¯ãâì ¤® ¯à®£à ¬¬ë ¢ ¬®¬¥â § ¯ã᪠.
|
||||
|
||||
include '../../../../macros.inc'
|
||||
include '../box_lib.mac'
|
||||
include '../../../../KOSfuncs.inc'
|
||||
include '../../../../load_lib.mac'
|
||||
@use_library ;use load lib macros
|
||||
start:
|
||||
;universal load library/librarys
|
||||
sys_load_library library_name, library_path, system_path, myimport
|
||||
;if return code =-1 then exit, else nornary work
|
||||
cmp eax,-1
|
||||
jz exit
|
||||
mcall SF_SET_EVENTS_MASK,0x80000027 ;ãáâ ®¢¨âì ¬ áªã ¤«ï ®¦¨¤ ¥¬ëå ᮡë⨩
|
||||
|
||||
push dword check1 ;¯®¤áçñâ ¤¨ë ⥪áâ ¤«ï Checkbox'®¢
|
||||
call [init_checkbox]
|
||||
|
||||
push dword check2
|
||||
call [init_checkbox]
|
||||
|
||||
red_win:
|
||||
call draw_window ;¯¥à¢® ç «ì® ¥®¡å®¤¨¬® à¨á®¢ âì ®ª®
|
||||
align 4
|
||||
still: ;®á®¢®© ®¡à ¡®â稪
|
||||
mcall SF_WAIT_EVENT
|
||||
dec eax
|
||||
jz red_win
|
||||
dec eax
|
||||
jz key
|
||||
dec eax
|
||||
jz button
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_mouse]
|
||||
|
||||
push dword edit2
|
||||
call [edit_box_mouse]
|
||||
|
||||
push dword check1
|
||||
call [check_box_mouse]
|
||||
|
||||
push dword check2
|
||||
call [check_box_mouse]
|
||||
|
||||
push dword Option_boxs
|
||||
call [option_box_mouse]
|
||||
|
||||
push dword Option_boxs2
|
||||
call [option_box_mouse]
|
||||
|
||||
jmp still ;¥á«¨ ¨ç¥£® ¨§ ¯¥à¥ç¨á«¥®£® ⮠ᮢ ¢ 横«
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
button:
|
||||
mcall SF_GET_BUTTON
|
||||
test ah,ah ;¥á«¨ ¢ ah 0, â® ¯¥à¥©â¨ ®¡à ¡®â稪 ᮡë⨩ still
|
||||
jz still
|
||||
exit:
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
key:
|
||||
mcall SF_GET_KEY
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_key]
|
||||
|
||||
push dword edit2
|
||||
call [edit_box_key]
|
||||
|
||||
jmp still
|
||||
|
||||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
align 4
|
||||
draw_window: ;à¨á®¢ ¨¥ ®ª ¯à¨«®¦¥¨ï
|
||||
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
||||
mcall SF_CREATE_WINDOW,(50*65536+390),(30*65536+200),0x33AABBCC,0x805080DD,hed
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_draw]
|
||||
|
||||
push dword edit2
|
||||
call [edit_box_draw]
|
||||
|
||||
push dword check1
|
||||
call [check_box_draw]
|
||||
|
||||
push dword check2
|
||||
call [check_box_draw]
|
||||
|
||||
push dword Option_boxs
|
||||
call [option_box_draw]
|
||||
|
||||
push dword Option_boxs2
|
||||
call [option_box_draw]
|
||||
|
||||
mcall SF_REDRAW, SSF_END_DRAW
|
||||
ret
|
||||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
;DATA ¤ ë¥
|
||||
;‚ᥣ¤ ᮡ«î¤ âì ¯®á«¥¤®¢ ⥫ì®áâì ¢ ¨¬¥¨.
|
||||
system_path db '/sys/lib/'
|
||||
library_name db 'box_lib.obj',0
|
||||
; …᫨ ¥áâì ¦¥« ¨¥ à §ê¥¤¨¨âì, ⮠㦮 ¨á¯®«ì§®¢ âì á«¥¤ãîé¨î ª®áâàãªæ¨î
|
||||
;system_path db '/sys/lib/box_lib.obj',0
|
||||
;... «î¡ ï ¯®á«¥¤®¢ ⥫ì®áâì ¤àã£¨å ª®¬ ¤ ¨ ®¯à¥¤¥«¥¨©.
|
||||
;library_name db 'box_lib.obj',0
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
myimport:
|
||||
|
||||
edit_box_draw dd aEdit_box_draw
|
||||
edit_box_key dd aEdit_box_key
|
||||
edit_box_mouse dd aEdit_box_mouse
|
||||
version_ed dd aVersion_ed
|
||||
|
||||
init_checkbox dd aInit_checkbox
|
||||
check_box_draw dd aCheck_box_draw
|
||||
check_box_mouse dd aCheck_box_mouse
|
||||
version_ch dd aVersion_ch
|
||||
|
||||
option_box_draw dd aOption_box_draw
|
||||
option_box_mouse dd aOption_box_mouse
|
||||
version_op dd aVersion_op
|
||||
|
||||
dd 0,0
|
||||
|
||||
aEdit_box_draw db 'edit_box_draw',0
|
||||
aEdit_box_key db 'edit_box_key',0
|
||||
aEdit_box_mouse db 'edit_box_mouse',0
|
||||
aVersion_ed db 'version_ed',0
|
||||
|
||||
aInit_checkbox db 'init_checkbox2',0
|
||||
aCheck_box_draw db 'check_box_draw2',0
|
||||
aCheck_box_mouse db 'check_box_mouse2',0
|
||||
aVersion_ch db 'version_ch2',0
|
||||
|
||||
aOption_box_draw db 'option_box_draw',0
|
||||
aOption_box_mouse db 'option_box_mouse',0
|
||||
aVersion_op db 'version_op',0
|
||||
|
||||
|
||||
check1 check_box2 (10 shl 16 + 12),(45 shl 16 + 12),5,0x80AABBCC,0,0,check_text1,ch_flag_en
|
||||
check2 check_box2 (10 shl 16 + 12),(60 shl 16 + 12),6,0x80AABBCC,0,0,check_text2
|
||||
|
||||
edit1 edit_box 350,3,5,0xffffff,0x6f9480,0,0xAABBCC,0,308,hed,mouse_dd,ed_focus,hed_end-hed-1,hed_end-hed-1
|
||||
edit2 edit_box 350,3,25,0xffffff,0x6a9480,0,0,0,99,ed_buffer,mouse_dd,ed_figure_only
|
||||
|
||||
op1 option_box option_group1,10,90,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
|
||||
op2 option_box option_group1,10,105,6,12,0xFFFFFF,0,0,op_text.2,op_text.e2-op_text.2
|
||||
op3 option_box option_group1,10,120,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
|
||||
op11 option_box option_group2,120,90,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_text.1
|
||||
op12 option_box option_group2,120,105,6,12,0xffffff,0,0,op_text.2,op_text.e2-op_text.2
|
||||
op13 option_box option_group2,120,120,6,12,0xffffff,0,0,op_text.3,op_text.e3-op_text.3
|
||||
|
||||
option_group1 dd op1 ;㪠§ ⥫¨, ®¨ ®â®¡à ¦ îâáï ¯® 㬮«ç ¨î, ª®£¤ ¢ë¢®¤¨âáï
|
||||
option_group2 dd op12 ;¯à¨«®¦¥¨¥
|
||||
Option_boxs dd op1,op2,op3,0
|
||||
Option_boxs2 dd op11,op12,op13,0
|
||||
|
||||
hed db 'BOXs load from lib <Lrz> date 27.04.2009',0
|
||||
hed_end:
|
||||
|
||||
rb 256
|
||||
check_text1 db 'First checkbox',0
|
||||
check_text2 db 'Second checkbox',0
|
||||
|
||||
op_text: ; ‘®¯à®¢®¦¤ î騩 ⥪áâ ¤«ï Optionbox'
|
||||
.1 db 'Option_Box #1'
|
||||
.e1:
|
||||
.2 db 'Option_Box #2'
|
||||
.e2:
|
||||
.3 db 'Option_Box #3'
|
||||
.e3:
|
||||
ed_buffer rb 100
|
||||
;-----------------------
|
||||
;sc system_colors
|
||||
|
||||
mouse_dd rd 1
|
||||
p_info process_information
|
||||
cur_dir_path rb 4096
|
||||
library_path rb 4096
|
||||
i_end:
|
||||
rb 1024
|
||||
mem:
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@@ -1,171 +1,177 @@
|
||||
; <EFBFBD>à®á⮩ ¯à¨¬¥à ¯à®£à ¬¬ë ¤«ï KolibriOS
|
||||
; ®§¢ã稢 ¥â ª®¤ ¦ ⮩ ª« ¢¨è¨
|
||||
; - ¯¥à¥¤¥« ª ª ¯à¨¬¥à ¨á¯®«ì§®¢ ¨ï tooltip
|
||||
|
||||
use32 ; ¢ª«îç¨âì 32-¡¨âë© à¥¦¨¬ áᥬ¡«¥à
|
||||
org 0 ; ¤à¥á æ¨ï á ã«ï
|
||||
|
||||
db 'MENUET01' ; 8-¡ ©âë© ¨¤¥â¨ä¨ª â®à MenuetOS
|
||||
dd 1 ; ¢¥àá¨ï § £®«®¢ª (¢á¥£¤ 1)
|
||||
dd START ; ¤à¥á ¯¥à¢®© ª®¬ ¤ë
|
||||
dd CODE_END ; à §¬¥à ¯à®£à ¬¬ë
|
||||
dd DATA_END ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
|
||||
dd STACK_END ; ¤à¥á ¢¥àè¨ë áâíª
|
||||
dd 0 ; ¤à¥á ¡ãä¥à ¤«ï ¯ à ¬¥â஢
|
||||
dd cur_dir_path ; 㪠§ â¥«ì ¤à¥á, ªã¤ ¯®¬¥é ¥âáï áâப , ᮤ¥à¦ é ï ¯ãâì ¤® ¯à®£à ¬¬ë ¢ ¬®¬¥â § ¯ã᪠.
|
||||
|
||||
include '../../../../../proc32.inc'
|
||||
include '../../../../../macros.inc'
|
||||
include '../../../../../KOSfuncs.inc'
|
||||
include '../../../../../dll.inc' ; malloc fn
|
||||
include '../../trunk/box_lib.mac'
|
||||
include '../../../../../load_lib.mac'
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- <20>€—€‹Ž <20><>Žƒ<C5BD>€ŒŒ› ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
; íâ®â ¬ ªà®á ®¡ï§ ⥫¥ ¤«ï ¢á¥å ª®¬¯®¥â®¢, ¨á¯®«ì§ãîé¨å heap
|
||||
; ªà®¬¥ ⮣®, ®¡ï§ â¥«ì® ¨¬®àâ¨à®¢ âì lib_init - ¯à¨ ¨¬¯®à⥠®¯à¥¤¥«ïîâáï
|
||||
; äãªæ¨¨ 娯 ¤«ï ¡¨¡«¨®â¥ª¨
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
START:
|
||||
;---------------------------------------------------------------------
|
||||
;--- ˆ<>ˆ–ˆ€‹ˆ‡€–ˆŸ ----------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
mcall 68, 11
|
||||
|
||||
mcall 40, $C0000027 ; ¬ ᪠ᮡë⨩ - ¬ëèì ⮫쪮 ¢ ªâ¨¢®¬ ®ª¥
|
||||
|
||||
sys_load_library lib_name, lib_path, sys_path, myimport
|
||||
test eax,eax
|
||||
jz @f
|
||||
mcall -1 ; alarm exit
|
||||
@@:
|
||||
|
||||
|
||||
invoke tooltip_init, redbox_tt ; only begin of list
|
||||
|
||||
red: ; ¯¥à¥à¨á®¢ âì ®ª®
|
||||
|
||||
call draw_window ; ¢ë§ë¢ ¥¬ ¯à®æ¥¤ãàã ®âà¨á®¢ª¨ ®ª
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- –ˆŠ‹ Ž<><C5BD>€<EFBFBD>Ž’Šˆ ‘Ž<E28098>›’ˆ‰ ----------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
still:
|
||||
mcall 23, 5 ; äãªæ¨ï 23 - ¦¤ âì ᮡëâ¨ï <20>¥ ¡®«¥¥ 祬 0.05á
|
||||
test eax, eax ; ¥â ᮡë⨩ - ¯à®¢¥à¨âì à¨á®¢ ¨¥ âã«â¨¯®¢ ¯® â ©¬¥àã
|
||||
je yield
|
||||
cmp eax,1 ; ¯¥à¥à¨á®¢ âì ®ª® ?
|
||||
je red ; ¥á«¨ ¤ - ¬¥âªã red
|
||||
cmp eax,2 ; ¦ â ª« ¢¨è ?
|
||||
je key ; ¥á«¨ ¤ - key
|
||||
cmp eax,3 ; ¦ â ª®¯ª ?
|
||||
je button ; ¥á«¨ ¤ - button
|
||||
cmp eax,6 ; ᮡë⨥ ¬ëè¨
|
||||
je mouse ; ¥á«¨ ¤ - mouse
|
||||
|
||||
jmp still ; ¥á«¨ ¤à㣮¥ ᮡë⨥ - ¢ ç «® 横«
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
yield:
|
||||
invoke tooltip_test_show, redbox_tt
|
||||
jmp still ; ¢¥àãâìáï ª ç «ã æ¨ª«
|
||||
|
||||
mouse:
|
||||
invoke tooltip_mouse, redbox_tt
|
||||
jmp still ; ¢¥àãâìáï ª ç «ã æ¨ª«
|
||||
|
||||
key: ; ¦ â ª« ¢¨è ª« ¢¨ âãà¥
|
||||
mcall 2 ; äãªæ¨ï 2 - áç¨â âì ª®¤ ᨬ¢®« (¢ ah)
|
||||
|
||||
jmp still ; ¢¥àãâìáï ª ç «ã æ¨ª«
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
button:
|
||||
mcall 17 ; 17 - ¯®«ãç¨âì ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨
|
||||
|
||||
cmp ah, 1 ; ¥á«¨ <20>… ¦ â ª®¯ª á ®¬¥à®¬ 1,
|
||||
jne still ; ¢¥àãâìáï
|
||||
|
||||
pexit:
|
||||
invoke tooltip_delete, redbox_tt ; ®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
|
||||
mcall -1 ; ¨ ç¥ ª®¥æ ¯à®£à ¬¬ë
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- Ž<><C5BD>…„…‹…<E280B9>ˆ… ˆ Ž’<C5BD>ˆ‘ނЀ ŽŠ<C5BD>€ ----------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
draw_window:
|
||||
|
||||
mcall 12, 1 ; äãªæ¨ï 12: á®®¡é¨âì Ž‘ ® ç «¥ ®âà¨á®¢ª¨
|
||||
|
||||
mcall 48, 3, sc,sizeof.system_colors
|
||||
|
||||
mov edx, [sc.work] ; 梥â ä®
|
||||
or edx, 0x33000000 ; ¨ ⨯ ®ª 3
|
||||
mcall 0, <200,300>, <200,150>, , ,title
|
||||
|
||||
; ¢ë¢®¤ ª¢ ¤à ⨪®¢
|
||||
mcall 13, <60,50>, <50,50>, $FF0000
|
||||
mcall 13, <140,50>, <50,50>, $FF
|
||||
|
||||
|
||||
mcall 12, 2 ; äãªæ¨ï 12.2, § ª®ç¨«¨ à¨á®¢ âì
|
||||
|
||||
ret ; ¢ë室¨¬ ¨§ ¯à®æ¥¤ãàë
|
||||
|
||||
|
||||
CODE_END: ; ¬¥âª ª®æ ¯à®£à ¬¬ë; --------------------------------------------;
|
||||
|
||||
; ---------------------------------------------------------------------------- ;
|
||||
;---------------------------------------------------------------------
|
||||
;--- „€<E2809E><E282AC>›… <20><>Žƒ<C5BD>€ŒŒ› ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
sys_path db '/sys/lib/'
|
||||
;sys_path db '/tmp0/1/'
|
||||
lib_name db 'box_lib.obj',0
|
||||
cur_dir_path rb 4096
|
||||
lib_path rb 4096
|
||||
|
||||
myimport:
|
||||
dd sz_lib_init ;äãªæ¨ï § ¯ã᪠¥âáï ¬ ªà®á®¬ 1 à § ¯à¨ ¯®¤ª«î票¨
|
||||
;¡¨¡«¨®â¥ª¨, ¯®â®¬ã ¢ ¯à®£à ¬¬¥ ¬¥âª ¥¥ ¥ ã¦
|
||||
tooltip_init dd sz_tooltip_init
|
||||
tooltip_delete dd sz_tooltip_delete
|
||||
tooltip_test_show dd sz_tooltip_test_show
|
||||
tooltip_mouse dd sz_tooltip_mouse
|
||||
get_font_size dd sz_get_font_size
|
||||
dd 0,0
|
||||
|
||||
sz_lib_init db 'lib_init',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
|
||||
|
||||
|
||||
;tooltip txt, next, zone_x, zone_w, zone_y, zone_h, col_txt, col_bkg, tm_wait
|
||||
redbox_tt tooltip redboxtxt, blubox_tt, 60, 50, 50, 50, 0, $FFF473, 100
|
||||
blubox_tt tooltip bluboxtxt, 0, 140, 50, 50, 50, $110000FF, $FFF473, 100
|
||||
|
||||
redboxtxt db 'Red Box Tooltip', 13, 'May be multilined', 13, 13, 'Even with empty lines', 0
|
||||
bluboxtxt db 'Blue Box Tooltip', 0
|
||||
|
||||
sc system_colors
|
||||
|
||||
title db 'Toooltip demo',0
|
||||
|
||||
; stack----------------------------------------------------------------------- ;
|
||||
rb 4096
|
||||
STACK_END dd ?
|
||||
|
||||
DATA_END: ; ¬¥âª ª®æ ¤ ëå ¯à®£à ¬¬ë; ------------------------------------ ;
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
; <20>à®á⮩ ¯à¨¬¥à ¯à®£à ¬¬ë ¤«ï KolibriOS
|
||||
; ®§¢ã稢 ¥â ª®¤ ¦ ⮩ ª« ¢¨è¨
|
||||
; - ¯¥à¥¤¥« ª ª ¯à¨¬¥à ¨á¯®«ì§®¢ ¨ï tooltip
|
||||
|
||||
use32 ; ¢ª«îç¨âì 32-¡¨âë© à¥¦¨¬ áᥬ¡«¥à
|
||||
org 0 ; ¤à¥á æ¨ï á ã«ï
|
||||
|
||||
db 'MENUET01' ; 8-¡ ©âë© ¨¤¥â¨ä¨ª â®à MenuetOS
|
||||
dd 1 ; ¢¥àá¨ï § £®«®¢ª (¢á¥£¤ 1)
|
||||
dd START ; ¤à¥á ¯¥à¢®© ª®¬ ¤ë
|
||||
dd CODE_END ; à §¬¥à ¯à®£à ¬¬ë
|
||||
dd DATA_END ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
|
||||
dd STACK_END ; ¤à¥á ¢¥àè¨ë áâíª
|
||||
dd 0 ; ¤à¥á ¡ãä¥à ¤«ï ¯ à ¬¥â஢
|
||||
dd cur_dir_path ; 㪠§ â¥«ì ¤à¥á, ªã¤ ¯®¬¥é ¥âáï áâப , ᮤ¥à¦ é ï ¯ãâì ¤® ¯à®£à ¬¬ë ¢ ¬®¬¥â § ¯ã᪠.
|
||||
|
||||
include '../../../../proc32.inc'
|
||||
include '../../../../macros.inc'
|
||||
include '../../../../KOSfuncs.inc'
|
||||
include '../../../../dll.inc' ; malloc fn
|
||||
include '../box_lib.mac'
|
||||
include '../../../../load_lib.mac'
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- <20>€—€‹Ž <20><>Žƒ<C5BD>€ŒŒ› ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
; íâ®â ¬ ªà®á ®¡ï§ ⥫¥ ¤«ï ¢á¥å ª®¬¯®¥â®¢, ¨á¯®«ì§ãîé¨å heap
|
||||
; ªà®¬¥ ⮣®, ®¡ï§ â¥«ì® ¨¬®àâ¨à®¢ âì lib_init - ¯à¨ ¨¬¯®à⥠®¯à¥¤¥«ïîâáï
|
||||
; äãªæ¨¨ 娯 ¤«ï ¡¨¡«¨®â¥ª¨
|
||||
@use_library mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
|
||||
START:
|
||||
;---------------------------------------------------------------------
|
||||
;--- ˆ<>ˆ–ˆ€‹ˆ‡€–ˆŸ ----------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
mcall 68, 11
|
||||
|
||||
mcall 40, $C0000027 ; ¬ ᪠ᮡë⨩ - ¬ëèì ⮫쪮 ¢ ªâ¨¢®¬ ®ª¥
|
||||
|
||||
sys_load_library lib_name, lib_path, sys_path, myimport
|
||||
test eax,eax
|
||||
jz @f
|
||||
mcall -1 ; alarm exit
|
||||
@@:
|
||||
|
||||
|
||||
invoke tooltip_init, redbox_tt ; only begin of list
|
||||
|
||||
red: ; ¯¥à¥à¨á®¢ âì ®ª®
|
||||
|
||||
call draw_window ; ¢ë§ë¢ ¥¬ ¯à®æ¥¤ãàã ®âà¨á®¢ª¨ ®ª
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- –ˆŠ‹ Ž<><C5BD>€<EFBFBD>Ž’Šˆ ‘Ž<E28098>›’ˆ‰ ----------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
still:
|
||||
mcall 23, 5 ; äãªæ¨ï 23 - ¦¤ âì ᮡëâ¨ï <20>¥ ¡®«¥¥ 祬 0.05á
|
||||
test eax, eax ; ¥â ᮡë⨩ - ¯à®¢¥à¨âì à¨á®¢ ¨¥ âã«â¨¯®¢ ¯® â ©¬¥àã
|
||||
je yield
|
||||
cmp eax,1 ; ¯¥à¥à¨á®¢ âì ®ª® ?
|
||||
je red ; ¥á«¨ ¤ - ¬¥âªã red
|
||||
cmp eax,2 ; ¦ â ª« ¢¨è ?
|
||||
je key ; ¥á«¨ ¤ - key
|
||||
cmp eax,3 ; ¦ â ª®¯ª ?
|
||||
je button ; ¥á«¨ ¤ - button
|
||||
cmp eax,6 ; ᮡë⨥ ¬ëè¨
|
||||
je mouse ; ¥á«¨ ¤ - mouse
|
||||
|
||||
jmp still ; ¥á«¨ ¤à㣮¥ ᮡë⨥ - ¢ ç «® 横«
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
yield:
|
||||
invoke tooltip_test_show, redbox_tt
|
||||
jmp still ; ¢¥àãâìáï ª ç «ã æ¨ª«
|
||||
|
||||
mouse:
|
||||
invoke tooltip_mouse, redbox_tt
|
||||
jmp still ; ¢¥àãâìáï ª ç «ã æ¨ª«
|
||||
|
||||
key: ; ¦ â ª« ¢¨è ª« ¢¨ âãà¥
|
||||
mcall 2 ; äãªæ¨ï 2 - áç¨â âì ª®¤ ᨬ¢®« (¢ ah)
|
||||
|
||||
jmp still ; ¢¥àãâìáï ª ç «ã æ¨ª«
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
button:
|
||||
mcall 17 ; 17 - ¯®«ãç¨âì ¨¤¥â¨ä¨ª â®à ¦ ⮩ ª®¯ª¨
|
||||
|
||||
cmp ah, 1 ; ¥á«¨ <20>… ¦ â ª®¯ª á ®¬¥à®¬ 1,
|
||||
jne still ; ¢¥àãâìáï
|
||||
|
||||
pexit:
|
||||
invoke tooltip_delete, redbox_tt ; ®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
|
||||
mcall -1 ; ¨ ç¥ ª®¥æ ¯à®£à ¬¬ë
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- Ž<><C5BD>…„…‹…<E280B9>ˆ… ˆ Ž’<C5BD>ˆ‘ނЀ ŽŠ<C5BD>€ ----------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
draw_window:
|
||||
|
||||
mcall 12, 1 ; äãªæ¨ï 12: á®®¡é¨âì Ž‘ ® ç «¥ ®âà¨á®¢ª¨
|
||||
|
||||
mcall 48, 3, sc,sizeof.system_colors
|
||||
|
||||
mov edx, [sc.work] ; 梥â ä®
|
||||
or edx, 0x33000000 ; ¨ ⨯ ®ª 3
|
||||
mcall 0, <200,300>, <200,150>, , ,title
|
||||
|
||||
; ¢ë¢®¤ ª¢ ¤à ⨪®¢
|
||||
mcall 13, <60,50>, <50,50>, $FF0000
|
||||
mcall 13, <140,50>, <50,50>, $FF
|
||||
|
||||
|
||||
mcall 12, 2 ; äãªæ¨ï 12.2, § ª®ç¨«¨ à¨á®¢ âì
|
||||
|
||||
ret ; ¢ë室¨¬ ¨§ ¯à®æ¥¤ãàë
|
||||
|
||||
|
||||
CODE_END: ; ¬¥âª ª®æ ¯à®£à ¬¬ë; --------------------------------------------;
|
||||
|
||||
; ---------------------------------------------------------------------------- ;
|
||||
;---------------------------------------------------------------------
|
||||
;--- „€<E2809E><E282AC>›… <20><>Žƒ<C5BD>€ŒŒ› ----------------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
sys_path db '/sys/lib/'
|
||||
;sys_path db '/tmp0/1/'
|
||||
lib_name db 'box_lib.obj',0
|
||||
cur_dir_path rb 4096
|
||||
lib_path rb 4096
|
||||
|
||||
myimport:
|
||||
dd sz_lib_init ;äãªæ¨ï § ¯ã᪠¥âáï ¬ ªà®á®¬ 1 à § ¯à¨ ¯®¤ª«î票¨
|
||||
;¡¨¡«¨®â¥ª¨, ¯®â®¬ã ¢ ¯à®£à ¬¬¥ ¬¥âª ¥¥ ¥ ã¦
|
||||
tooltip_init dd sz_tooltip_init
|
||||
tooltip_delete dd sz_tooltip_delete
|
||||
tooltip_test_show dd sz_tooltip_test_show
|
||||
tooltip_mouse dd sz_tooltip_mouse
|
||||
get_font_size dd sz_get_font_size
|
||||
dd 0,0
|
||||
|
||||
sz_lib_init db 'lib_init',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
|
||||
|
||||
|
||||
;tooltip txt, next, zone_x, zone_w, zone_y, zone_h, col_txt, col_bkg, tm_wait
|
||||
redbox_tt tooltip redboxtxt, blubox_tt, 60, 50, 50, 50, 0, $FFF473, 100
|
||||
blubox_tt tooltip bluboxtxt, 0, 140, 50, 50, 50, $110000FF, $FFF473, 100
|
||||
|
||||
redboxtxt db 'Red Box Tooltip', 13, 'May be multilined', 13, 13, 'Even with empty lines', 0
|
||||
bluboxtxt db 'Blue Box Tooltip', 0
|
||||
|
||||
sc system_colors
|
||||
|
||||
title db 'Toooltip demo',0
|
||||
|
||||
; stack----------------------------------------------------------------------- ;
|
||||
rb 4096
|
||||
STACK_END dd ?
|
||||
|
||||
DATA_END: ; ¬¥âª ª®æ ¤ ëå ¯à®£à ¬¬ë; ------------------------------------ ;
|
@@ -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/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
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 6.0 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
@@ -1,206 +1,212 @@
|
||||
; Copyright (c) 2009, <Lrz>
|
||||
; All rights reserved.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
; modification, are permitted provided that the following conditions are met:
|
||||
; * Redistributions of source code must retain the above copyright
|
||||
; notice, this list of conditions and the following disclaimer.
|
||||
; * Redistributions in binary form must reproduce the above copyright
|
||||
; notice, this list of conditions and the following disclaimer in the
|
||||
; documentation and/or other materials provided with the distribution.
|
||||
; * Neither the name of the <organization> nor the
|
||||
; names of its contributors may be used to endorse or promote products
|
||||
; derived from this software without specific prior written permission.
|
||||
;
|
||||
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov nickname <Lrz> ''AS IS'' AND ANY
|
||||
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;*****************************************************************************
|
||||
|
||||
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
use32 ; <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD>騩 32 ࠧ<>來<EFBFBD><EFA4AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
org 0x0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20>ᥣ<EFBFBD><E1A5A3> 0x0
|
||||
db 'MENUET01' ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> (8 <20><><EFBFBD><EFBFBD>)
|
||||
dd 0x1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ଠ<EFBFBD><E0ACA0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9>
|
||||
dd start ; <20><><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD> <20><>।<EFBFBD><E0A5A4><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD>
|
||||
; <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>㧪<EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd mem ; ࠧ<><E0A0A7><EFBFBD> <20>ਫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd mem ; <20><>ꥬ <20>ᯮ<EFBFBD><EFBFBD><EFBFBD>㥬<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20>⥪<EFBFBD> <20>⢥<EFBFBD><E2A2A5><EFBFBD> 0<>100 <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><E0AEA2><EFBFBD> <20><> <20>୨<EFBFBD><E0ADA8> 4 <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd mem ; <20><>ᯮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⥪<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>ࠧ<EFBFBD> <20><> ⥫<><E2A5AB> <20>ணࠬ<E0AEA3><E0A0AC>. <20><><EFBFBD>設<EFBFBD> <20>⥪<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 㪠<><E3AAA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
dd 0x0 ; 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <20><> <20><>ப<EFBFBD> <20> <20><>ࠬ<EFBFBD><E0A0AC>ࠬ<EFBFBD>.
|
||||
dd way_of_ini
|
||||
include '../../../../macros.inc'
|
||||
include '../../../../KOSfuncs.inc'
|
||||
include '../../../../load_lib.mac'
|
||||
include '../../box_lib/trunk/box_lib.mac'
|
||||
@use_library ;use load lib macros
|
||||
start:
|
||||
;universal load library/librarys
|
||||
sys_load_libraries l_libs_start,end_l_libs
|
||||
;if return code =-1 then exit, else nornary work
|
||||
cmp eax,-1
|
||||
jz exit
|
||||
mcall 40,0x27 ;<3B><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮡ<>⨩
|
||||
|
||||
mov eax,48
|
||||
mov ebx,3
|
||||
mov ecx,sc
|
||||
mov edx,sizeof.system_colors
|
||||
mcall
|
||||
mov eax,dword [sc.work]
|
||||
mov dword [con_colors+4],eax
|
||||
|
||||
; mcall 66,1,0
|
||||
call [initialization_font] ; <20><><EFBFBD>樠<EFBFBD><E6A8A0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᯨ᪠ <20><><EFBFBD><EFBFBD>⮢
|
||||
push dword (8 shl 16 +16) ; <20><><EFBFBD><EFBFBD><EFBFBD> <20>㦭<EFBFBD><E3A6AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⮢ (<28><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>㯥<EFBFBD> ⮫쪮 8<>16)
|
||||
call [get_font]
|
||||
test eax,eax ;<3B><>諨 ?
|
||||
jnz exit
|
||||
;;;;;;;;;;;;;;;;;;;;
|
||||
mcall 40,0x27 ;<3B><>⠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮡ<>⨩
|
||||
red_win:
|
||||
call draw_window ;<3B><>ࢮ<EFBFBD><E0A2AE>砫쭮 <20><><EFBFBD><EFBFBD>室<EFBFBD><E5AEA4><EFBFBD> <20><><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
align 4
|
||||
still: ;<3B>᭮<EFBFBD><E1ADAE><EFBFBD><EFBFBD> <20><>ࠡ<EFBFBD><E0A0A1>稪
|
||||
mcall 10 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮡ<><E1AEA1><EFBFBD><EFBFBD>
|
||||
dec eax
|
||||
jz red_win
|
||||
dec eax
|
||||
jz key
|
||||
dec eax
|
||||
jz button
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_mouse]
|
||||
|
||||
jmp still ;<3B> <20><>祣<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1ABA5><EFBFBD><EFBFBD><EFBFBD> <20><> ᭮<><E1ADAE> <20> 横<>
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
button:
|
||||
mcall 17 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⮩ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
test ah,ah ;<3B> <20> ah 0, <20><> <20><>३<EFBFBD><E0A5A9> <20><> <20><>ࠡ<EFBFBD><E0A0A1>稪 ᮡ<>⨩ still
|
||||
jz still
|
||||
exit:
|
||||
call [free_fulder_info]
|
||||
call [free_font]
|
||||
mcall -1
|
||||
key:
|
||||
mcall 2 ;<3B><><EFBFBD><EFBFBD>㧨<EFBFBD> <20><><EFBFBD>祭<EFBFBD><E7A5AD> 2 <20> ॣ<><E0A5A3><EFBFBD><EFBFBD><EFBFBD> eax <20> <20><><EFBFBD><EFBFBD>稬 <20><><EFBFBD> <20><><EFBFBD><EFBFBD>⮩ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_key]
|
||||
|
||||
|
||||
mcall 13,<20,650>,<40,16>, dword[con_colors+4]
|
||||
|
||||
|
||||
push dword 20 shl 16 + 40 ; esp+12= dd x shl 16 + y x- <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20>, y - <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> Y
|
||||
push dword con_colors ; esp+8 = dd point to color of background and font
|
||||
push dword text ; esp+4 = dd point to ASCIIZ
|
||||
; esp+0 = dd back
|
||||
call [font_draw_on_string] ; <20>뢥<EFBFBD><EBA2A5><EFBFBD> <20><> <20><><EFBFBD>䠬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
jmp still
|
||||
|
||||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
align 4
|
||||
draw_window: ;<3B><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall 12,1
|
||||
xor eax,eax ;<3B><><EFBFBD>㫨<EFBFBD><E3ABA8> eax
|
||||
mov ebx,50*65536+680 ;[<5B><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> x]*65536 + [ࠧ<><E0A0A7><EFBFBD> <20><> <20><><EFBFBD> x]
|
||||
mov ecx,30*65536+200 ;[<5B><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> y]*65536 + [ࠧ<><E0A0A7><EFBFBD> <20><> <20><><EFBFBD> y]
|
||||
mov edx,[sc.work] ; color of work area RRGGBB,8->color gl
|
||||
or edx,0x34000000
|
||||
mov edi,hed
|
||||
mcall ;<3B><><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_draw]
|
||||
;
|
||||
push dword 20 shl 16 + 40 ; esp+12= dd x shl 16 + y x- <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20>, y - <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> Y
|
||||
push dword con_colors ; esp+8 = dd point to color of background and font
|
||||
push dword text; esp+4 = dd point to ASCIIZ
|
||||
; esp+0 = dd back
|
||||
call [font_draw_on_string] ; <20>뢥<EFBFBD><EBA2A5><EFBFBD> <20><> <20><><EFBFBD>䠬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov eax,12 ;<3B>㭪<EFBFBD><E3ADAA><EFBFBD> 12 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>.
|
||||
mov ebx,2 ;<3B><><EFBFBD><EFBFBD>㭪<EFBFBD><E3ADAA><EFBFBD> 2 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
||||
mcall
|
||||
ret
|
||||
;;;;;;;;;;;;
|
||||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
;DATA <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
l_libs_start:
|
||||
library01 l_libs library_name, library_path, system_path, font_import
|
||||
library02 l_libs library_name1, library_path, system_path1, import_box_lib
|
||||
end_l_libs:
|
||||
|
||||
;
|
||||
system_path db '/sys/lib/'
|
||||
library_name db 'fonts_lib.obj',0
|
||||
|
||||
system_path1 db '/sys/lib/'
|
||||
library_name1 db 'box_lib.obj',0
|
||||
|
||||
align 4
|
||||
import_box_lib:
|
||||
|
||||
edit_box_draw dd aEdit_box_draw
|
||||
edit_box_key dd aEdit_box_key
|
||||
edit_box_mouse dd aEdit_box_mouse
|
||||
version_ed dd aVersion_ed
|
||||
|
||||
dd 0,0
|
||||
|
||||
aEdit_box_draw db 'edit_box_draw',0
|
||||
aEdit_box_key db 'edit_box_key',0
|
||||
aEdit_box_mouse db 'edit_box_mouse',0
|
||||
aVersion_ed db 'version_ed',0
|
||||
|
||||
font_import:
|
||||
initialization_font dd a_initialization_font
|
||||
get_font dd a_get_font
|
||||
free_fulder_info dd a_free_fulder_info
|
||||
free_font dd a_free_font
|
||||
font_draw_on_string dd a_font_draw_on_string
|
||||
show_all_glif dd a_show_all_glif
|
||||
Version_fn dd a_Version_fn
|
||||
dd 0,0
|
||||
|
||||
a_initialization_font db 'initialization_font',0
|
||||
a_get_font db 'get_font',0
|
||||
a_free_fulder_info db 'free_fulder_info',0
|
||||
a_free_font db 'free_font',0
|
||||
a_font_draw_on_string db 'font_draw_on_string',0
|
||||
a_show_all_glif db 'show_all_glif',0
|
||||
a_Version_fn db 'version_fn',0
|
||||
|
||||
|
||||
|
||||
edit1 edit_box 350,175,5,0xffffff,0x6f9480,0,0xAABBCC,0,test_leght,text,ed_focus,text_end-text-1,text_end-text-1
|
||||
|
||||
text db '<27>ਬ<EFBFBD><E0A8AC> <20>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> <20><><EFBFBD><EFBFBD>⮢ fonts_lib.obj',0
|
||||
text_end:
|
||||
rb 256
|
||||
test_leght = ($-text)-1
|
||||
|
||||
hed db "Font's demo <Lrz>",0
|
||||
align 4
|
||||
con_colors dd 0x1E1EFF, 0x96FFCF
|
||||
|
||||
align 4
|
||||
sc system_colors
|
||||
way_of_ini rb 4096
|
||||
library_path rb 4096
|
||||
|
||||
align 4
|
||||
i_end:
|
||||
rb 1024
|
||||
mem:
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
; Copyright (c) 2009, <Lrz>
|
||||
; All rights reserved.
|
||||
;
|
||||
; Redistribution and use in source and binary forms, with or without
|
||||
; modification, are permitted provided that the following conditions are met:
|
||||
; * Redistributions of source code must retain the above copyright
|
||||
; notice, this list of conditions and the following disclaimer.
|
||||
; * Redistributions in binary form must reproduce the above copyright
|
||||
; notice, this list of conditions and the following disclaimer in the
|
||||
; documentation and/or other materials provided with the distribution.
|
||||
; * Neither the name of the <organization> nor the
|
||||
; names of its contributors may be used to endorse or promote products
|
||||
; derived from this software without specific prior written permission.
|
||||
;
|
||||
; THIS SOFTWARE IS PROVIDED BY Alexey Teplov nickname <Lrz> ''AS IS'' AND ANY
|
||||
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
|
||||
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
;*****************************************************************************
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
use32 ; <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD>騩 32 ࠧ<>來<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
org 0x0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20>ᥣ<EFBFBD><E1A5A3> 0x0
|
||||
db 'MENUET01' ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFBFBD><EFBFBD> 䠩<EFBFBD><EFBFBD> (8 <20><><EFBFBD><EFBFBD>)
|
||||
dd 0x1 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ଠ<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9>
|
||||
dd start ; <20><><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD> <20><>।<EFBFBD><E0A5A4><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD>
|
||||
; <20><> <20><><EFBFBD><EFBFBD>㧪<EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd mem ; ࠧ<><E0A0A7><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd mem ; <20><>ꥬ <20>ᯮ<EFBFBD><E1AFAE><EFBFBD>㥬<EFBFBD><E3A5AC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20>⥪<EFBFBD> <20>⢥<EFBFBD><E2A2A5><EFBFBD> 0<>100 <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><E0AEA2><EFBFBD> <20><> <20>୨<EFBFBD><E0ADA8> 4 <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd mem ; <20><>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⥪<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>ࠧ<EFBFBD> <20><> ⥫<><E2A5AB> <20>ணࠬ<E0AEA3><E0A0AC>. <20><><EFBFBD>設<EFBFBD> <20>⥪<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 㪠<><E3AAA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
dd 0x0 ; 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><>ப<EFBFBD> <20> <20><>ࠬ<EFBFBD><E0A0AC>ࠬ<EFBFBD>.
|
||||
dd way_of_ini
|
||||
include '../../../../macros.inc'
|
||||
include '../../../../KOSfuncs.inc'
|
||||
include '../../../../load_lib.mac'
|
||||
include '../../box_lib/box_lib.mac'
|
||||
@use_library ;use load lib macros
|
||||
start:
|
||||
;universal load library/librarys
|
||||
sys_load_libraries l_libs_start,end_l_libs
|
||||
;if return code =-1 then exit, else nornary work
|
||||
cmp eax,-1
|
||||
jz exit
|
||||
mcall 40,0x27 ;<3B><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮡ<>⨩
|
||||
|
||||
mov eax,48
|
||||
mov ebx,3
|
||||
mov ecx,sc
|
||||
mov edx,sizeof.system_colors
|
||||
mcall
|
||||
mov eax,dword [sc.work]
|
||||
mov dword [con_colors+4],eax
|
||||
|
||||
; mcall 66,1,0
|
||||
call [initialization_font] ; <20><EFBFBD><EFBFBD>樠<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᯨ᪠ <20><><EFBFBD><EFBFBD>⮢
|
||||
push dword (8 shl 16 +16) ; <20><><EFBFBD><EFBFBD><EFBFBD> <20>㦭<EFBFBD><E3A6AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⮢ (<28><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>㯥<EFBFBD> ⮫쪮 8<>16)
|
||||
call [get_font]
|
||||
test eax,eax ;<3B><>諨 ?
|
||||
jnz exit
|
||||
;;;;;;;;;;;;;;;;;;;;
|
||||
mcall 40,0x27 ;<3B><>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮡ<>⨩
|
||||
red_win:
|
||||
call draw_window ;<3B><>ࢮ<EFBFBD><E0A2AE>砫쭮 <20><><EFBFBD><EFBFBD>室<EFBFBD><E5AEA4><EFBFBD> <20><><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
align 4
|
||||
still: ;<3B>᭮<EFBFBD><E1ADAE><EFBFBD><EFBFBD> <20><>ࠡ<EFBFBD><E0A0A1>稪
|
||||
mcall 10 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮡ<><E1AEA1><EFBFBD><EFBFBD>
|
||||
dec eax
|
||||
jz red_win
|
||||
dec eax
|
||||
jz key
|
||||
dec eax
|
||||
jz button
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_mouse]
|
||||
|
||||
jmp still ;<3B> <20><>祣<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1ABA5><EFBFBD><EFBFBD><EFBFBD> <20><> ᭮<><E1ADAE> <20> 横<>
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
button:
|
||||
mcall 17 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⮩ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
test ah,ah ;<3B> <20> ah 0, <20><> <20><>३<EFBFBD><E0A5A9> <20><> <20><>ࠡ<EFBFBD><E0A0A1>稪 ᮡ<>⨩ still
|
||||
jz still
|
||||
exit:
|
||||
call [free_fulder_info]
|
||||
call [free_font]
|
||||
mcall -1
|
||||
key:
|
||||
mcall 2 ;<3B><><EFBFBD><EFBFBD>㧨<EFBFBD> <20><><EFBFBD>祭<EFBFBD><E7A5AD> 2 <20> ॣ<><E0A5A3><EFBFBD><EFBFBD><EFBFBD> eax <20> <20><><EFBFBD><EFBFBD>稬 <20><><EFBFBD> <20><><EFBFBD><EFBFBD>⮩ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_key]
|
||||
|
||||
|
||||
mcall 13,<20,650>,<40,16>, dword[con_colors+4]
|
||||
|
||||
|
||||
push dword 20 shl 16 + 40 ; esp+12= dd x shl 16 + y x- <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20>, y - <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> Y
|
||||
push dword con_colors ; esp+8 = dd point to color of background and font
|
||||
push dword text ; esp+4 = dd point to ASCIIZ
|
||||
; esp+0 = dd back
|
||||
call [font_draw_on_string] ; <20>뢥<EFBFBD><EBA2A5><EFBFBD> <20><> <20><><EFBFBD>䠬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
jmp still
|
||||
|
||||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
align 4
|
||||
draw_window: ;<3B><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall 12,1
|
||||
xor eax,eax ;<3B><><EFBFBD>㫨<EFBFBD><E3ABA8> eax
|
||||
mov ebx,50*65536+680 ;[<5B><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> x]*65536 + [ࠧ<><E0A0A7><EFBFBD> <20><> <20><><EFBFBD> x]
|
||||
mov ecx,30*65536+200 ;[<5B><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> y]*65536 + [ࠧ<><E0A0A7><EFBFBD> <20><> <20><><EFBFBD> y]
|
||||
mov edx,[sc.work] ; color of work area RRGGBB,8->color gl
|
||||
or edx,0x34000000
|
||||
mov edi,hed
|
||||
mcall ;<3B><><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
push dword edit1
|
||||
call [edit_box_draw]
|
||||
;
|
||||
push dword 20 shl 16 + 40 ; esp+12= dd x shl 16 + y x- <20><><EFBFBD>न<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <20>, y - <EFBFBD><EFBFBD><EFBFBD>न<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> Y
|
||||
push dword con_colors ; esp+8 = dd point to color of background and font
|
||||
push dword text; esp+4 = dd point to ASCIIZ
|
||||
; esp+0 = dd back
|
||||
call [font_draw_on_string] ; <20>뢥<EFBFBD><EBA2A5><EFBFBD> <20><> <20><><EFBFBD>䠬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov eax,12 ;<3B>㭪<EFBFBD><E3ADAA><EFBFBD> 12 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>.
|
||||
mov ebx,2 ;<3B><><EFBFBD><EFBFBD>㭪<EFBFBD><E3ADAA><EFBFBD> 2 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>.
|
||||
mcall
|
||||
ret
|
||||
;;;;;;;;;;;;
|
||||
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||||
;DATA <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
l_libs_start:
|
||||
library01 l_libs library_name, library_path, system_path, font_import
|
||||
library02 l_libs library_name1, library_path, system_path1, import_box_lib
|
||||
end_l_libs:
|
||||
|
||||
;
|
||||
system_path db '/sys/lib/'
|
||||
library_name db 'fonts_lib.obj',0
|
||||
|
||||
system_path1 db '/sys/lib/'
|
||||
library_name1 db 'box_lib.obj',0
|
||||
|
||||
align 4
|
||||
import_box_lib:
|
||||
|
||||
edit_box_draw dd aEdit_box_draw
|
||||
edit_box_key dd aEdit_box_key
|
||||
edit_box_mouse dd aEdit_box_mouse
|
||||
version_ed dd aVersion_ed
|
||||
|
||||
dd 0,0
|
||||
|
||||
aEdit_box_draw db 'edit_box_draw',0
|
||||
aEdit_box_key db 'edit_box_key',0
|
||||
aEdit_box_mouse db 'edit_box_mouse',0
|
||||
aVersion_ed db 'version_ed',0
|
||||
|
||||
font_import:
|
||||
initialization_font dd a_initialization_font
|
||||
get_font dd a_get_font
|
||||
free_fulder_info dd a_free_fulder_info
|
||||
free_font dd a_free_font
|
||||
font_draw_on_string dd a_font_draw_on_string
|
||||
show_all_glif dd a_show_all_glif
|
||||
Version_fn dd a_Version_fn
|
||||
dd 0,0
|
||||
|
||||
a_initialization_font db 'initialization_font',0
|
||||
a_get_font db 'get_font',0
|
||||
a_free_fulder_info db 'free_fulder_info',0
|
||||
a_free_font db 'free_font',0
|
||||
a_font_draw_on_string db 'font_draw_on_string',0
|
||||
a_show_all_glif db 'show_all_glif',0
|
||||
a_Version_fn db 'version_fn',0
|
||||
|
||||
|
||||
|
||||
edit1 edit_box 350,175,5,0xffffff,0x6f9480,0,0xAABBCC,0,test_leght,text,ed_focus,text_end-text-1,text_end-text-1
|
||||
|
||||
text db '<27>ਬ<EFBFBD><E0A8AC> <20>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> <20><><EFBFBD><EFBFBD>⮢ fonts_lib.obj',0
|
||||
text_end:
|
||||
rb 256
|
||||
test_leght = ($-text)-1
|
||||
|
||||
hed db "Font's demo <Lrz>",0
|
||||
align 4
|
||||
con_colors dd 0x1E1EFF, 0x96FFCF
|
||||
|
||||
align 4
|
||||
sc system_colors
|
||||
way_of_ini rb 4096
|
||||
library_path rb 4096
|
||||
|
||||
align 4
|
||||
i_end:
|
||||
rb 1024
|
||||
mem:
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
@@ -1,467 +1,465 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2009-2015. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; downloader.asm - HTTP client for KolibriOS ;;
|
||||
;; ;;
|
||||
;; ;;
|
||||
;; GNU GENERAL PUBLIC LICENSE ;;
|
||||
;; Version 2, June 1991 ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
URLMAXLEN = 1024
|
||||
BUFFERSIZE = 4096
|
||||
|
||||
__DEBUG__ = 1
|
||||
__DEBUG_LEVEL__ = 1
|
||||
|
||||
format binary as ""
|
||||
;--------------------------------------
|
||||
frame_1:
|
||||
.x = 5
|
||||
.y = 10
|
||||
.width = 350
|
||||
.height = 55
|
||||
;--------------------------------------
|
||||
frame_2:
|
||||
.x = 5
|
||||
.y = 75
|
||||
.width = 350
|
||||
.height = 55
|
||||
;---------------------------------------------------------------------
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01' ; header
|
||||
dd 0x01 ; header version
|
||||
dd START ; entry point
|
||||
dd IM_END ; image size
|
||||
dd I_END ; required memory
|
||||
dd stacktop ; esp
|
||||
dd params ; I_PARAM
|
||||
dd 0x0 ; I_Path
|
||||
;---------------------------------------------------------------------
|
||||
include '../../../../macros.inc'
|
||||
include '../../../../proc32.inc'
|
||||
include '../../../../dll.inc'
|
||||
include '../../../../debug-fdo.inc'
|
||||
include '../../box_lib/trunk/box_lib.mac'
|
||||
include '../../http/http.inc'
|
||||
|
||||
virtual at 0
|
||||
http_msg http_msg
|
||||
end virtual
|
||||
;---------------------------------------------------------------------
|
||||
START:
|
||||
|
||||
mcall 68, 11 ; init heap so we can allocate memory dynamically
|
||||
|
||||
; load libraries
|
||||
stdcall dll.Load, @IMPORT
|
||||
test eax, eax
|
||||
jnz exit
|
||||
;---------------------------------------------------------------------
|
||||
mov edi,filename_area
|
||||
mov esi,start_temp_file_name
|
||||
call copy_file_name_path
|
||||
|
||||
mov edi,fname_buf
|
||||
mov esi,start_file_path
|
||||
call copy_file_name_path
|
||||
|
||||
;OpenDialog initialisation
|
||||
push dword OpenDialog_data
|
||||
call [OpenDialog_Init]
|
||||
|
||||
; prepare for PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_prepare]
|
||||
;---------------------------------------------------------------------
|
||||
; check parameters
|
||||
cmp byte[params], 0 ; no parameters ?
|
||||
je reset_events ; load the GUI
|
||||
|
||||
inc [silently]
|
||||
|
||||
download:
|
||||
call download_1
|
||||
|
||||
test [silently], 0xff
|
||||
jnz save
|
||||
|
||||
reset_events:
|
||||
DEBUGF 1, "resetting events\n"
|
||||
|
||||
; Report events
|
||||
; defaults + mouse
|
||||
mcall 40,EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER
|
||||
;---------------------------------------------------------------------
|
||||
redraw:
|
||||
call draw_window
|
||||
|
||||
still:
|
||||
;; DEBUGF 1, "waiting for events\n"
|
||||
|
||||
mcall 10 ; wait here for event
|
||||
|
||||
cmp eax, EV_REDRAW
|
||||
je redraw
|
||||
|
||||
cmp eax, EV_KEY
|
||||
je key
|
||||
|
||||
cmp eax, EV_BUTTON
|
||||
je button
|
||||
|
||||
cmp eax, EV_MOUSE
|
||||
je mouse
|
||||
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
key:
|
||||
mcall 2 ; read key
|
||||
|
||||
stdcall [edit_box_key], dword edit1
|
||||
|
||||
cmp ax, 13 shl 8
|
||||
je download
|
||||
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
button:
|
||||
|
||||
mcall 17 ; get id
|
||||
|
||||
cmp ah, 26
|
||||
jne @f
|
||||
; invoke OpenDialog
|
||||
push dword OpenDialog_data
|
||||
call [OpenDialog_Start]
|
||||
cmp [OpenDialog_data.status],1
|
||||
jne still
|
||||
|
||||
; prepare for PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_prepare]
|
||||
call draw_window
|
||||
jmp still
|
||||
@@:
|
||||
cmp ah, 1 ; button id=1 ?
|
||||
je exit
|
||||
|
||||
call download_1
|
||||
jmp save
|
||||
;---------------------------------------------------------------------
|
||||
mouse:
|
||||
stdcall [edit_box_mouse], edit1
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
exit:
|
||||
DEBUGF 1, "Exiting\n"
|
||||
invoke HTTP_free, [identifier] ; free buffer
|
||||
fail:
|
||||
or eax, -1 ; close this program
|
||||
mcall
|
||||
;---------------------------------------------------------------------
|
||||
download_1:
|
||||
DEBUGF 1, "Starting download\n"
|
||||
|
||||
invoke HTTP_get, 0, 0, params, sz_add_header
|
||||
test eax, eax
|
||||
jz fail
|
||||
mov [identifier], eax
|
||||
|
||||
.loop:
|
||||
invoke HTTP_receive, [identifier]
|
||||
test eax, eax
|
||||
jnz .loop
|
||||
|
||||
mov eax, [identifier]
|
||||
mov ebx, [eax + http_msg.content_length]
|
||||
mov [final_size], ebx
|
||||
mov ebx, [eax + http_msg.content_ptr]
|
||||
mov [final_buffer], ebx
|
||||
|
||||
invoke HTTP_find_header, [identifier], sz_content_enc
|
||||
test eax, eax
|
||||
jz .no_deflate
|
||||
|
||||
; TODO: check if parameter equals "deflate"
|
||||
|
||||
DEBUGF 1, "deflating\n"
|
||||
|
||||
lea eax, [final_size]
|
||||
invoke deflate_unpack, [final_buffer], eax
|
||||
push eax
|
||||
mcall 68, 13, [final_buffer] ; Free the compressed data
|
||||
pop [final_buffer]
|
||||
|
||||
DEBUGF 1, "deflated size=%u bytes\n", [final_size]
|
||||
.no_deflate:
|
||||
|
||||
invoke HTTP_free, [identifier]
|
||||
mov [identifier], 0
|
||||
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
save:
|
||||
cmp [final_buffer], 0
|
||||
je still
|
||||
|
||||
mcall 70, fileinfo
|
||||
|
||||
DEBUGF 1, "File saved\n"
|
||||
|
||||
test [silently], 0xff
|
||||
jnz exit
|
||||
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 0x80000000
|
||||
mcall 4, <10, frame_2.y+frame_2.height+7>, , download_complete
|
||||
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
copy_file_name_path:
|
||||
xor eax,eax
|
||||
cld
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test eax,eax
|
||||
jnz @r
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
; *********************************************
|
||||
; ******* WINDOW DEFINITIONS AND DRAW ********
|
||||
; *********************************************
|
||||
|
||||
draw_window:
|
||||
|
||||
mcall 12, 1 ; start window draw
|
||||
;-----------------------------------
|
||||
; get system colors
|
||||
mcall 48, 3, sc, 40
|
||||
;-----------------------------------
|
||||
; draw window
|
||||
mov edx, [sc.work]
|
||||
or edx, 0x34000000
|
||||
mcall 0, <50, 370>, <350, 170>, , 0, title
|
||||
;-----------------------------------
|
||||
; draw frames
|
||||
mov [frame_data.x],dword frame_1.x shl 16+frame_1.width
|
||||
mov [frame_data.y],dword frame_1.y shl 16+frame_1.height
|
||||
mov [frame_data.text_pointer],dword select_addr_text
|
||||
mov eax,[sc.work]
|
||||
mov [frame_data.font_backgr_color],eax
|
||||
mov eax,[sc.work_text]
|
||||
mov [frame_data.font_color],eax
|
||||
|
||||
push dword frame_data
|
||||
call [Frame_draw]
|
||||
;-----------------------------------
|
||||
mov [frame_data.x],dword frame_2.x shl 16+frame_2.width
|
||||
mov [frame_data.y],dword frame_2.y shl 16+frame_2.height
|
||||
mov [frame_data.text_pointer],dword select_path_text
|
||||
|
||||
push dword frame_data
|
||||
call [Frame_draw]
|
||||
;-----------------------------------
|
||||
; draw "url:" text
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 80000000h
|
||||
mcall 4, <frame_1.x+10, frame_1.y+15>, , type_pls
|
||||
;-----------------------------------
|
||||
; draw editbox
|
||||
edit_boxes_set_sys_color edit1, editboxes_end, sc
|
||||
stdcall [edit_box_draw], edit1
|
||||
;-----------------------------------
|
||||
; draw buttons
|
||||
mcall 8,<frame_1.x+frame_1.width-(68+15+50+15),68>,<frame_1.y+30,16>,22,[sc.work_button] ; reload
|
||||
mcall ,<frame_1.x+frame_1.width-(50+15),50>,<frame_1.y+30,16>, 24 ; stop
|
||||
|
||||
mcall , <frame_2.x+frame_2.width-(54+15),54>,<frame_2.y+30,16>,26 ; save
|
||||
;-----------------------------------
|
||||
; draw buttons text
|
||||
mov ecx, [sc.work_button_text]
|
||||
or ecx, 80000000h
|
||||
mcall 4, <frame_1.x+frame_1.width-(68+15+50+15)+10,frame_1.y+35>, , button_text.1
|
||||
mcall , <frame_1.x+frame_1.width-(50+15)+15,frame_1.y+35>, , button_text.2
|
||||
mcall , <frame_2.x+frame_2.width-(54+15)+10,frame_2.y+35>, , button_text.3
|
||||
|
||||
mcall 13,<frame_2.x+17,frame_2.width-15*2>,<frame_2.y+10,15>,0xffffff
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_draw]
|
||||
|
||||
mcall 12, 2 ; end window redraw
|
||||
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
; Data area
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
@IMPORT:
|
||||
|
||||
library lib_http, 'http.obj', \
|
||||
box_lib, 'box_lib.obj', \
|
||||
proc_lib, 'proc_lib.obj', \
|
||||
archiver, 'archiver.obj'
|
||||
|
||||
import lib_http, \
|
||||
HTTP_get, 'get' , \
|
||||
HTTP_receive, 'receive', \
|
||||
HTTP_find_header, 'find_header_field', \
|
||||
HTTP_free, 'free'
|
||||
|
||||
import box_lib, \
|
||||
edit_box_draw, 'edit_box_draw', \
|
||||
edit_box_key, 'edit_box_key', \
|
||||
edit_box_mouse, 'edit_box_mouse', \
|
||||
PathShow_prepare, 'PathShow_prepare', \
|
||||
PathShow_draw, 'PathShow_draw', \
|
||||
Frame_draw, 'frame_draw'
|
||||
|
||||
import proc_lib, \
|
||||
OpenDialog_Init, 'OpenDialog_init', \
|
||||
OpenDialog_Start, 'OpenDialog_start'
|
||||
|
||||
import archiver,\
|
||||
deflate_unpack, 'deflate_unpack'
|
||||
;---------------------------------------------------------------------
|
||||
fileinfo dd 2, 0, 0
|
||||
final_size dd 0
|
||||
final_buffer dd 0
|
||||
db 0
|
||||
dd fname_buf
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
mouse_dd dd 0
|
||||
edit1 edit_box 295, 48, (frame_1.y+10), 0xffffff, 0xff, 0x80ff, 0, 0x8000, URLMAXLEN, document_user, mouse_dd, ed_focus+ed_always_focus, 7, 7
|
||||
editboxes_end:
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
include_debug_strings
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
type_pls db 'URL:', 0
|
||||
button_text:
|
||||
.1: db 'DOWNLOAD',0
|
||||
.2: db 'STOP',0
|
||||
.3: db 'SELECT', 0
|
||||
download_complete db 'FILE SAVED!', 0
|
||||
title db 'HTTP Downloader', 0
|
||||
silently db 0
|
||||
|
||||
sz_add_header db 'Accept-Encoding: deflate', 13, 10, 0 ; archiver.obj doesnt export unpack method for gzip yet :(
|
||||
sz_content_enc db 'content-encoding', 0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
select_addr_text db ' NETWORK ADDRESS: ',0
|
||||
select_path_text db ' PATH TO SAVE FILE: ',0
|
||||
;---------------------------------------------------------------------
|
||||
frame_data:
|
||||
.type dd 0 ;+0
|
||||
.x:
|
||||
.x_size dw 0 ;+4
|
||||
.x_start dw 0 ;+6
|
||||
.y:
|
||||
.y_size dw 0 ;+8
|
||||
.y_start dw 0 ;+10
|
||||
.ext_fr_col dd 0x0 ;+12
|
||||
.int_fr_col dd 0xffffff ;+16
|
||||
.draw_text_flag dd 1 ;+20
|
||||
.text_pointer dd 0 ;+24
|
||||
.text_position dd 0 ;+28
|
||||
.font_number dd 0 ;+32
|
||||
.font_size_y dd 9 ;+36
|
||||
.font_color dd 0x0 ;+40
|
||||
.font_backgr_color dd 0xffffff ;+44
|
||||
;---------------------------------------------------------------------
|
||||
PathShow_data_1:
|
||||
.type dd 0 ;+0
|
||||
.start_y dw frame_2.y+14 ;+4
|
||||
.start_x dw frame_2.x+20 ;+6
|
||||
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
|
||||
.area_size_x dw frame_2.width-35 ;+10
|
||||
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
|
||||
.background_flag dd 0 ;+16
|
||||
.font_color dd 0 ;+20
|
||||
.background_color dd 0 ;+24
|
||||
.text_pointer dd fname_buf ;+28
|
||||
.work_area_pointer dd text_work_area ;+32
|
||||
.temp_text_length dd 0 ;+36
|
||||
;---------------------------------------------------------------------
|
||||
OpenDialog_data:
|
||||
.type dd 1 ; Save
|
||||
.procinfo dd procinfo ;+4
|
||||
.com_area_name dd communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_path dd temp_dir_path ;+16
|
||||
.dir_default_path dd communication_area_default_path ;+20
|
||||
.start_path dd open_dialog_path ;+24
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_pach dd fname_buf ;+36
|
||||
.filename_area dd filename_area ;+40
|
||||
.filter_area dd Filter
|
||||
.x:
|
||||
.x_size dw 420 ;+48 ; Window X size
|
||||
.x_start dw 200 ;+50 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ;+52 ; Window y size
|
||||
.y_start dw 120 ;+54 ; Window Y position
|
||||
|
||||
communication_area_name:
|
||||
db 'FFFFFFFF_open_dialog',0
|
||||
open_dialog_path:
|
||||
db '/sys/File Managers/opendial',0
|
||||
communication_area_default_path:
|
||||
db '/sys',0
|
||||
|
||||
Filter:
|
||||
dd Filter.end - Filter
|
||||
.1:
|
||||
db 'IMG',0
|
||||
db 'IMA',0
|
||||
.end:
|
||||
db 0
|
||||
|
||||
start_temp_file_name: db 'some.garbage',0
|
||||
|
||||
start_file_path: db '/sys/.download', 0
|
||||
;---------------------------------------------------------------------
|
||||
document_user db 'http://'
|
||||
;---------------------------------------------------------------------
|
||||
IM_END:
|
||||
;---------------------------------------------------------------------
|
||||
params rb URLMAXLEN
|
||||
;---------------------------------------------------------------------
|
||||
sc system_colors
|
||||
;---------------------------------------------------------------------
|
||||
identifier dd ?
|
||||
;---------------------------------------------------------------------
|
||||
filename_area:
|
||||
rb 256
|
||||
;---------------------------------------------------------------------
|
||||
temp_dir_path:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
procinfo:
|
||||
rb 1024
|
||||
;---------------------------------------------------------------------
|
||||
fname_buf:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
text_work_area:
|
||||
rb 1024
|
||||
;---------------------------------------------------------------------
|
||||
rb 4096
|
||||
stacktop:
|
||||
;---------------------------------------------------------------------
|
||||
I_END:
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2009-2015. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; downloader.asm - HTTP client for KolibriOS ;;
|
||||
;; ;;
|
||||
;; ;;
|
||||
;; GNU GENERAL PUBLIC LICENSE ;;
|
||||
;; Version 2, June 1991 ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
URLMAXLEN = 1024
|
||||
BUFFERSIZE = 4096
|
||||
|
||||
__DEBUG__ = 1
|
||||
__DEBUG_LEVEL__ = 1
|
||||
|
||||
format binary as ""
|
||||
;--------------------------------------
|
||||
frame_1:
|
||||
.x = 5
|
||||
.y = 10
|
||||
.width = 350
|
||||
.height = 55
|
||||
;--------------------------------------
|
||||
frame_2:
|
||||
.x = 5
|
||||
.y = 75
|
||||
.width = 350
|
||||
.height = 55
|
||||
;---------------------------------------------------------------------
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01' ; header
|
||||
dd 0x01 ; header version
|
||||
dd START ; entry point
|
||||
dd IM_END ; image size
|
||||
dd I_END ; required memory
|
||||
dd stacktop ; esp
|
||||
dd params ; I_PARAM
|
||||
dd 0x0 ; I_Path
|
||||
;---------------------------------------------------------------------
|
||||
include '../../../../macros.inc'
|
||||
include '../../../../proc32.inc'
|
||||
include '../../../../dll.inc'
|
||||
include '../../../../debug-fdo.inc'
|
||||
include '../../box_lib/box_lib.mac'
|
||||
include '../../http/http.inc'
|
||||
|
||||
virtual at 0
|
||||
http_msg http_msg
|
||||
end virtual
|
||||
;---------------------------------------------------------------------
|
||||
START:
|
||||
|
||||
mcall 68, 11 ; init heap so we can allocate memory dynamically
|
||||
|
||||
; load libraries
|
||||
stdcall dll.Load, @IMPORT
|
||||
test eax, eax
|
||||
jnz exit
|
||||
;---------------------------------------------------------------------
|
||||
mov edi,filename_area
|
||||
mov esi,start_temp_file_name
|
||||
call copy_file_name_path
|
||||
|
||||
mov edi,fname_buf
|
||||
mov esi,start_file_path
|
||||
call copy_file_name_path
|
||||
|
||||
;OpenDialog initialisation
|
||||
push dword OpenDialog_data
|
||||
call [OpenDialog_Init]
|
||||
|
||||
; prepare for PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_prepare]
|
||||
;---------------------------------------------------------------------
|
||||
; check parameters
|
||||
cmp byte[params], 0 ; no parameters ?
|
||||
je reset_events ; load the GUI
|
||||
|
||||
inc [silently]
|
||||
|
||||
download:
|
||||
call download_1
|
||||
|
||||
test [silently], 0xff
|
||||
jnz save
|
||||
|
||||
reset_events:
|
||||
DEBUGF 1, "resetting events\n"
|
||||
|
||||
; Report events
|
||||
; defaults + mouse
|
||||
mcall 40,EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER
|
||||
;---------------------------------------------------------------------
|
||||
redraw:
|
||||
call draw_window
|
||||
|
||||
still:
|
||||
;; DEBUGF 1, "waiting for events\n"
|
||||
|
||||
mcall 10 ; wait here for event
|
||||
|
||||
cmp eax, EV_REDRAW
|
||||
je redraw
|
||||
|
||||
cmp eax, EV_KEY
|
||||
je key
|
||||
|
||||
cmp eax, EV_BUTTON
|
||||
je button
|
||||
|
||||
cmp eax, EV_MOUSE
|
||||
je mouse
|
||||
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
key:
|
||||
mcall 2 ; read key
|
||||
|
||||
stdcall [edit_box_key], dword edit1
|
||||
|
||||
cmp ax, 13 shl 8
|
||||
je download
|
||||
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
button:
|
||||
|
||||
mcall 17 ; get id
|
||||
|
||||
cmp ah, 26
|
||||
jne @f
|
||||
; invoke OpenDialog
|
||||
push dword OpenDialog_data
|
||||
call [OpenDialog_Start]
|
||||
cmp [OpenDialog_data.status],1
|
||||
jne still
|
||||
|
||||
; prepare for PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_prepare]
|
||||
call draw_window
|
||||
jmp still
|
||||
@@:
|
||||
cmp ah, 1 ; button id=1 ?
|
||||
je exit
|
||||
|
||||
call download_1
|
||||
jmp save
|
||||
;---------------------------------------------------------------------
|
||||
mouse:
|
||||
stdcall [edit_box_mouse], edit1
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
exit:
|
||||
DEBUGF 1, "Exiting\n"
|
||||
invoke HTTP_free, [identifier] ; free buffer
|
||||
fail:
|
||||
or eax, -1 ; close this program
|
||||
mcall
|
||||
;---------------------------------------------------------------------
|
||||
download_1:
|
||||
DEBUGF 1, "Starting download\n"
|
||||
|
||||
invoke HTTP_get, 0, 0, params, sz_add_header
|
||||
test eax, eax
|
||||
jz fail
|
||||
mov [identifier], eax
|
||||
|
||||
.loop:
|
||||
invoke HTTP_receive, [identifier]
|
||||
test eax, eax
|
||||
jnz .loop
|
||||
|
||||
mov eax, [identifier]
|
||||
mov ebx, [eax + http_msg.content_length]
|
||||
mov [final_size], ebx
|
||||
mov ebx, [eax + http_msg.content_ptr]
|
||||
mov [final_buffer], ebx
|
||||
|
||||
invoke HTTP_find_header, [identifier], sz_content_enc
|
||||
test eax, eax
|
||||
jz .no_deflate
|
||||
|
||||
; TODO: check if parameter equals "deflate"
|
||||
|
||||
DEBUGF 1, "deflating\n"
|
||||
|
||||
lea eax, [final_size]
|
||||
invoke deflate_unpack, [final_buffer], eax
|
||||
push eax
|
||||
mcall 68, 13, [final_buffer] ; Free the compressed data
|
||||
pop [final_buffer]
|
||||
|
||||
DEBUGF 1, "deflated size=%u bytes\n", [final_size]
|
||||
.no_deflate:
|
||||
|
||||
invoke HTTP_free, [identifier]
|
||||
mov [identifier], 0
|
||||
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
save:
|
||||
cmp [final_buffer], 0
|
||||
je still
|
||||
|
||||
mcall 70, fileinfo
|
||||
|
||||
DEBUGF 1, "File saved\n"
|
||||
|
||||
test [silently], 0xff
|
||||
jnz exit
|
||||
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 0x80000000
|
||||
mcall 4, <10, frame_2.y+frame_2.height+7>, , download_complete
|
||||
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
copy_file_name_path:
|
||||
xor eax,eax
|
||||
cld
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test eax,eax
|
||||
jnz @r
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
; *********************************************
|
||||
; ******* WINDOW DEFINITIONS AND DRAW ********
|
||||
; *********************************************
|
||||
|
||||
draw_window:
|
||||
|
||||
mcall 12, 1 ; start window draw
|
||||
;-----------------------------------
|
||||
; get system colors
|
||||
mcall 48, 3, sc, 40
|
||||
;-----------------------------------
|
||||
; draw window
|
||||
mov edx, [sc.work]
|
||||
or edx, 0x34000000
|
||||
mcall 0, <50, 370>, <350, 170>, , 0, title
|
||||
;-----------------------------------
|
||||
; draw frames
|
||||
mov [frame_data.x],dword frame_1.x shl 16+frame_1.width
|
||||
mov [frame_data.y],dword frame_1.y shl 16+frame_1.height
|
||||
mov [frame_data.text_pointer],dword select_addr_text
|
||||
mov eax,[sc.work]
|
||||
mov [frame_data.font_backgr_color],eax
|
||||
mov eax,[sc.work_text]
|
||||
mov [frame_data.font_color],eax
|
||||
|
||||
push dword frame_data
|
||||
call [Frame_draw]
|
||||
;-----------------------------------
|
||||
mov [frame_data.x],dword frame_2.x shl 16+frame_2.width
|
||||
mov [frame_data.y],dword frame_2.y shl 16+frame_2.height
|
||||
mov [frame_data.text_pointer],dword select_path_text
|
||||
|
||||
push dword frame_data
|
||||
call [Frame_draw]
|
||||
;-----------------------------------
|
||||
; draw "url:" text
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 80000000h
|
||||
mcall 4, <frame_1.x+10, frame_1.y+15>, , type_pls
|
||||
;-----------------------------------
|
||||
; draw editbox
|
||||
edit_boxes_set_sys_color edit1, editboxes_end, sc
|
||||
stdcall [edit_box_draw], edit1
|
||||
;-----------------------------------
|
||||
; draw buttons
|
||||
mcall 8,<frame_1.x+frame_1.width-(68+15+50+15),68>,<frame_1.y+30,16>,22,[sc.work_button] ; reload
|
||||
mcall ,<frame_1.x+frame_1.width-(50+15),50>,<frame_1.y+30,16>, 24 ; stop
|
||||
|
||||
mcall , <frame_2.x+frame_2.width-(54+15),54>,<frame_2.y+30,16>,26 ; save
|
||||
;-----------------------------------
|
||||
; draw buttons text
|
||||
mov ecx, [sc.work_button_text]
|
||||
or ecx, 80000000h
|
||||
mcall 4, <frame_1.x+frame_1.width-(68+15+50+15)+10,frame_1.y+35>, , button_text.1
|
||||
mcall , <frame_1.x+frame_1.width-(50+15)+15,frame_1.y+35>, , button_text.2
|
||||
mcall , <frame_2.x+frame_2.width-(54+15)+10,frame_2.y+35>, , button_text.3
|
||||
|
||||
mcall 13,<frame_2.x+17,frame_2.width-15*2>,<frame_2.y+10,15>,0xffffff
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_draw]
|
||||
|
||||
mcall 12, 2 ; end window redraw
|
||||
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
; Data area
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
@IMPORT:
|
||||
|
||||
library lib_http, 'http.obj', \
|
||||
box_lib, 'box_lib.obj', \
|
||||
proc_lib, 'proc_lib.obj', \
|
||||
archiver, 'archiver.obj'
|
||||
|
||||
import lib_http, \
|
||||
HTTP_get, 'get' , \
|
||||
HTTP_receive, 'receive', \
|
||||
HTTP_find_header, 'find_header_field', \
|
||||
HTTP_free, 'free'
|
||||
|
||||
import box_lib, \
|
||||
edit_box_draw, 'edit_box_draw', \
|
||||
edit_box_key, 'edit_box_key', \
|
||||
edit_box_mouse, 'edit_box_mouse', \
|
||||
PathShow_prepare, 'PathShow_prepare', \
|
||||
PathShow_draw, 'PathShow_draw', \
|
||||
Frame_draw, 'frame_draw'
|
||||
|
||||
import proc_lib, \
|
||||
OpenDialog_Init, 'OpenDialog_init', \
|
||||
OpenDialog_Start, 'OpenDialog_start'
|
||||
|
||||
import archiver,\
|
||||
deflate_unpack, 'deflate_unpack'
|
||||
;---------------------------------------------------------------------
|
||||
fileinfo dd 2, 0, 0
|
||||
final_size dd 0
|
||||
final_buffer dd 0
|
||||
db 0
|
||||
dd fname_buf
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
mouse_dd dd 0
|
||||
edit1 edit_box 295, 48, (frame_1.y+10), 0xffffff, 0xff, 0x80ff, 0, 0x8000, URLMAXLEN, document_user, mouse_dd, ed_focus+ed_always_focus, 7, 7
|
||||
editboxes_end:
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
include_debug_strings
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
type_pls db 'URL:', 0
|
||||
button_text:
|
||||
.1: db 'DOWNLOAD',0
|
||||
.2: db 'STOP',0
|
||||
.3: db 'SELECT', 0
|
||||
download_complete db 'FILE SAVED!', 0
|
||||
title db 'HTTP Downloader', 0
|
||||
silently db 0
|
||||
|
||||
sz_add_header db 'Accept-Encoding: deflate', 13, 10, 0 ; archiver.obj doesnt export unpack method for gzip yet :(
|
||||
sz_content_enc db 'content-encoding', 0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
select_addr_text db ' NETWORK ADDRESS: ',0
|
||||
select_path_text db ' PATH TO SAVE FILE: ',0
|
||||
;---------------------------------------------------------------------
|
||||
frame_data:
|
||||
.type dd 0 ;+0
|
||||
.x:
|
||||
.x_size dw 0 ;+4
|
||||
.x_start dw 0 ;+6
|
||||
.y:
|
||||
.y_size dw 0 ;+8
|
||||
.y_start dw 0 ;+10
|
||||
.ext_fr_col dd 0x0 ;+12
|
||||
.int_fr_col dd 0xffffff ;+16
|
||||
.draw_text_flag dd 1 ;+20
|
||||
.text_pointer dd 0 ;+24
|
||||
.text_position dd 0 ;+28
|
||||
.font_number dd 0 ;+32
|
||||
.font_size_y dd 9 ;+36
|
||||
.font_color dd 0x0 ;+40
|
||||
.font_backgr_color dd 0xffffff ;+44
|
||||
;---------------------------------------------------------------------
|
||||
PathShow_data_1:
|
||||
.type dd 0 ;+0
|
||||
.start_y dw frame_2.y+14 ;+4
|
||||
.start_x dw frame_2.x+20 ;+6
|
||||
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
|
||||
.area_size_x dw frame_2.width-35 ;+10
|
||||
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
|
||||
.background_flag dd 0 ;+16
|
||||
.font_color dd 0 ;+20
|
||||
.background_color dd 0 ;+24
|
||||
.text_pointer dd fname_buf ;+28
|
||||
.work_area_pointer dd text_work_area ;+32
|
||||
.temp_text_length dd 0 ;+36
|
||||
;---------------------------------------------------------------------
|
||||
OpenDialog_data:
|
||||
.type dd 1 ; Save
|
||||
.procinfo dd procinfo ;+4
|
||||
.com_area_name dd communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_path dd temp_dir_path ;+16
|
||||
.dir_default_path dd communication_area_default_path ;+20
|
||||
.start_path dd open_dialog_path ;+24
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_pach dd fname_buf ;+36
|
||||
.filename_area dd filename_area ;+40
|
||||
.filter_area dd Filter
|
||||
.x:
|
||||
.x_size dw 420 ;+48 ; Window X size
|
||||
.x_start dw 200 ;+50 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ;+52 ; Window y size
|
||||
.y_start dw 120 ;+54 ; Window Y position
|
||||
|
||||
communication_area_name:
|
||||
db 'FFFFFFFF_open_dialog',0
|
||||
open_dialog_path:
|
||||
db '/sys/File Managers/opendial',0
|
||||
communication_area_default_path:
|
||||
db '/sys',0
|
||||
|
||||
Filter:
|
||||
dd Filter.end - Filter
|
||||
.1:
|
||||
db 'IMG',0
|
||||
db 'IMA',0
|
||||
.end:
|
||||
db 0
|
||||
|
||||
start_temp_file_name: db 'some.garbage',0
|
||||
|
||||
start_file_path: db '/sys/.download', 0
|
||||
;---------------------------------------------------------------------
|
||||
document_user db 'http://'
|
||||
;---------------------------------------------------------------------
|
||||
IM_END:
|
||||
;---------------------------------------------------------------------
|
||||
params rb URLMAXLEN
|
||||
;---------------------------------------------------------------------
|
||||
sc system_colors
|
||||
;---------------------------------------------------------------------
|
||||
identifier dd ?
|
||||
;---------------------------------------------------------------------
|
||||
filename_area:
|
||||
rb 256
|
||||
;---------------------------------------------------------------------
|
||||
temp_dir_path:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
procinfo:
|
||||
rb 1024
|
||||
;---------------------------------------------------------------------
|
||||
fname_buf:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
text_work_area:
|
||||
rb 1024
|
||||
;---------------------------------------------------------------------
|
||||
rb 4096
|
||||
stacktop:
|
||||
;---------------------------------------------------------------------
|
||||
I_END:
|
||||
;---------------------------------------------------------------------
|
||||
|
@@ -1,434 +1,432 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2009-2015. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; downloader.asm - HTTP client for KolibriOS ;;
|
||||
;; ;;
|
||||
;; ;;
|
||||
;; GNU GENERAL PUBLIC LICENSE ;;
|
||||
;; Version 2, June 1991 ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
URLMAXLEN = 1024
|
||||
BUFFERSIZE = 4096
|
||||
|
||||
__DEBUG__ = 1
|
||||
__DEBUG_LEVEL__ = 1
|
||||
|
||||
format binary as ""
|
||||
;--------------------------------------
|
||||
frame_1:
|
||||
.x = 5
|
||||
.y = 10
|
||||
.width = 350
|
||||
.height = 55
|
||||
;--------------------------------------
|
||||
frame_2:
|
||||
.x = 5
|
||||
.y = 75
|
||||
.width = 350
|
||||
.height = 55
|
||||
;---------------------------------------------------------------------
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01' ; header
|
||||
dd 0x01 ; header version
|
||||
dd START ; entry point
|
||||
dd IM_END ; image size
|
||||
dd I_END ; required memory
|
||||
dd stacktop ; esp
|
||||
dd params ; I_PARAM
|
||||
dd 0x0 ; I_Path
|
||||
;---------------------------------------------------------------------
|
||||
include '../../../../macros.inc'
|
||||
include '../../../../proc32.inc'
|
||||
include '../../../../dll.inc'
|
||||
include '../../../../debug-fdo.inc'
|
||||
include '../../box_lib/trunk/box_lib.mac'
|
||||
include '../../http/http.inc'
|
||||
|
||||
virtual at 0
|
||||
http_msg http_msg
|
||||
end virtual
|
||||
;---------------------------------------------------------------------
|
||||
START:
|
||||
|
||||
mcall 68, 11 ; init heap so we can allocate memory dynamically
|
||||
|
||||
; load libraries
|
||||
stdcall dll.Load, @IMPORT
|
||||
test eax, eax
|
||||
jnz exit
|
||||
;---------------------------------------------------------------------
|
||||
mov edi,filename_area
|
||||
mov esi,start_temp_file_name
|
||||
call copy_file_name_path
|
||||
|
||||
mov edi,fname_buf
|
||||
mov esi,start_file_path
|
||||
call copy_file_name_path
|
||||
|
||||
;OpenDialog initialisation
|
||||
push dword OpenDialog_data
|
||||
call [OpenDialog_Init]
|
||||
|
||||
; prepare for PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_prepare]
|
||||
;---------------------------------------------------------------------
|
||||
; check parameters
|
||||
cmp byte[params], 0 ; no parameters ?
|
||||
je reset_events ; load the GUI
|
||||
|
||||
inc [silently]
|
||||
|
||||
download:
|
||||
call download_1
|
||||
|
||||
test [silently], 0xff
|
||||
jnz save
|
||||
|
||||
reset_events:
|
||||
DEBUGF 1, "resetting events\n"
|
||||
|
||||
; Report events
|
||||
; defaults + mouse
|
||||
mcall 40,EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER
|
||||
;---------------------------------------------------------------------
|
||||
redraw:
|
||||
call draw_window
|
||||
|
||||
still:
|
||||
;; DEBUGF 1, "waiting for events\n"
|
||||
|
||||
mcall 10 ; wait here for event
|
||||
|
||||
cmp eax, EV_REDRAW
|
||||
je redraw
|
||||
|
||||
cmp eax, EV_KEY
|
||||
je key
|
||||
|
||||
cmp eax, EV_BUTTON
|
||||
je button
|
||||
|
||||
cmp eax, EV_MOUSE
|
||||
je mouse
|
||||
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
key:
|
||||
mcall 2 ; read key
|
||||
|
||||
stdcall [edit_box_key], dword edit1
|
||||
|
||||
cmp ax, 13 shl 8
|
||||
je download
|
||||
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
button:
|
||||
|
||||
mcall 17 ; get id
|
||||
|
||||
cmp ah, 26
|
||||
jne @f
|
||||
; invoke OpenDialog
|
||||
push dword OpenDialog_data
|
||||
call [OpenDialog_Start]
|
||||
cmp [OpenDialog_data.status],1
|
||||
jne still
|
||||
|
||||
; prepare for PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_prepare]
|
||||
call draw_window
|
||||
jmp still
|
||||
@@:
|
||||
cmp ah, 1 ; button id=1 ?
|
||||
je exit
|
||||
|
||||
call download_1
|
||||
jmp save
|
||||
;---------------------------------------------------------------------
|
||||
mouse:
|
||||
stdcall [edit_box_mouse], edit1
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
exit:
|
||||
DEBUGF 1, "Exiting\n"
|
||||
invoke HTTP_free, [identifier] ; free buffer
|
||||
fail:
|
||||
or eax, -1 ; close this program
|
||||
mcall
|
||||
;---------------------------------------------------------------------
|
||||
download_1:
|
||||
DEBUGF 1, "Starting download\n"
|
||||
|
||||
invoke HTTP_get, document_user, 0, params, 0
|
||||
test eax, eax
|
||||
jz fail
|
||||
mov [identifier], eax
|
||||
|
||||
.loop:
|
||||
invoke HTTP_receive, [identifier]
|
||||
test eax, eax
|
||||
jnz .loop
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
save:
|
||||
mov ebp, [identifier]
|
||||
mov eax, [ebp + http_msg.content_received]
|
||||
mov [final_size], eax
|
||||
mov ebx, [ebp + http_msg.content_ptr]
|
||||
mov [final_buffer], ebx
|
||||
mcall 70, fileinfo
|
||||
|
||||
DEBUGF 1, "File saved\n"
|
||||
|
||||
test [silently], 0xff
|
||||
jnz exit
|
||||
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 0x80000000
|
||||
mcall 4, <10, frame_2.y+frame_2.height+7>, , download_complete
|
||||
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
copy_file_name_path:
|
||||
xor eax,eax
|
||||
cld
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test eax,eax
|
||||
jnz @r
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
; *********************************************
|
||||
; ******* WINDOW DEFINITIONS AND DRAW ********
|
||||
; *********************************************
|
||||
|
||||
draw_window:
|
||||
|
||||
mcall 12, 1 ; start window draw
|
||||
;-----------------------------------
|
||||
; get system colors
|
||||
mcall 48, 3, sc, 40
|
||||
;-----------------------------------
|
||||
; draw window
|
||||
mov edx, [sc.work]
|
||||
or edx, 0x34000000
|
||||
mcall 0, <50, 370>, <350, 170>, , 0, title
|
||||
;-----------------------------------
|
||||
; draw frames
|
||||
mov [frame_data.x],dword frame_1.x shl 16+frame_1.width
|
||||
mov [frame_data.y],dword frame_1.y shl 16+frame_1.height
|
||||
mov [frame_data.text_pointer],dword select_addr_text
|
||||
mov eax,[sc.work]
|
||||
mov [frame_data.font_backgr_color],eax
|
||||
mov eax,[sc.work_text]
|
||||
mov [frame_data.font_color],eax
|
||||
|
||||
push dword frame_data
|
||||
call [Frame_draw]
|
||||
;-----------------------------------
|
||||
mov [frame_data.x],dword frame_2.x shl 16+frame_2.width
|
||||
mov [frame_data.y],dword frame_2.y shl 16+frame_2.height
|
||||
mov [frame_data.text_pointer],dword select_path_text
|
||||
|
||||
push dword frame_data
|
||||
call [Frame_draw]
|
||||
;-----------------------------------
|
||||
; draw "url:" text
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 80000000h
|
||||
mcall 4, <frame_1.x+10, frame_1.y+15>, , type_pls
|
||||
;-----------------------------------
|
||||
; draw editbox
|
||||
edit_boxes_set_sys_color edit1, editboxes_end, sc
|
||||
stdcall [edit_box_draw], edit1
|
||||
;-----------------------------------
|
||||
; draw buttons
|
||||
mcall 8,<frame_1.x+frame_1.width-(68+15+50+15),68>,<frame_1.y+30,16>,22,[sc.work_button] ; reload
|
||||
mcall ,<frame_1.x+frame_1.width-(50+15),50>,<frame_1.y+30,16>, 24 ; stop
|
||||
|
||||
mcall , <frame_2.x+frame_2.width-(54+15),54>,<frame_2.y+30,16>,26 ; save
|
||||
;-----------------------------------
|
||||
; draw buttons text
|
||||
mov ecx, [sc.work_button_text]
|
||||
or ecx, 80000000h
|
||||
mcall 4, <frame_1.x+frame_1.width-(68+15+50+15)+10,frame_1.y+35>, , button_text.1
|
||||
mcall , <frame_1.x+frame_1.width-(50+15)+15,frame_1.y+35>, , button_text.2
|
||||
mcall , <frame_2.x+frame_2.width-(54+15)+10,frame_2.y+35>, , button_text.3
|
||||
|
||||
mcall 13,<frame_2.x+17,frame_2.width-15*2>,<frame_2.y+10,15>,0xffffff
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_draw]
|
||||
|
||||
mcall 12, 2 ; end window redraw
|
||||
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
; Data area
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
@IMPORT:
|
||||
|
||||
library lib_http, 'http.obj', \
|
||||
box_lib, 'box_lib.obj', \
|
||||
proc_lib, 'proc_lib.obj'
|
||||
|
||||
import lib_http, \
|
||||
HTTP_get , 'get', \
|
||||
HTTP_receive , 'receive', \
|
||||
HTTP_free , 'free'
|
||||
|
||||
import box_lib, \
|
||||
edit_box_draw, 'edit_box_draw', \
|
||||
edit_box_key, 'edit_box_key', \
|
||||
edit_box_mouse, 'edit_box_mouse', \
|
||||
PathShow_prepare, 'PathShow_prepare', \
|
||||
PathShow_draw, 'PathShow_draw', \
|
||||
Frame_draw, 'frame_draw'
|
||||
|
||||
import proc_lib, \
|
||||
OpenDialog_Init, 'OpenDialog_init', \
|
||||
OpenDialog_Start, 'OpenDialog_start'
|
||||
;---------------------------------------------------------------------
|
||||
fileinfo dd 2, 0, 0
|
||||
final_size dd 0
|
||||
final_buffer dd 0
|
||||
db 0
|
||||
dd fname_buf
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
mouse_dd dd 0
|
||||
edit1 edit_box 295, 48, (frame_1.y+10), 0xffffff, 0xff, 0x80ff, 0, 0x8000, URLMAXLEN, document_user, mouse_dd, ed_focus+ed_always_focus, 7, 7
|
||||
editboxes_end:
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
include_debug_strings
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
type_pls db 'URL:', 0
|
||||
button_text:
|
||||
.1: db 'DOWNLOAD',0
|
||||
.2: db 'STOP',0
|
||||
.3: db 'SELECT', 0
|
||||
download_complete db 'FILE SAVED!', 0
|
||||
title db 'HTTP Downloader', 0
|
||||
silently db 0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
select_addr_text db ' NETWORK ADDRESS: ',0
|
||||
select_path_text db ' PATH TO SAVE FILE: ',0
|
||||
;---------------------------------------------------------------------
|
||||
frame_data:
|
||||
.type dd 0 ;+0
|
||||
.x:
|
||||
.x_size dw 0 ;+4
|
||||
.x_start dw 0 ;+6
|
||||
.y:
|
||||
.y_size dw 0 ;+8
|
||||
.y_start dw 0 ;+10
|
||||
.ext_fr_col dd 0x0 ;+12
|
||||
.int_fr_col dd 0xffffff ;+16
|
||||
.draw_text_flag dd 1 ;+20
|
||||
.text_pointer dd 0 ;+24
|
||||
.text_position dd 0 ;+28
|
||||
.font_number dd 0 ;+32
|
||||
.font_size_y dd 9 ;+36
|
||||
.font_color dd 0x0 ;+40
|
||||
.font_backgr_color dd 0xffffff ;+44
|
||||
;---------------------------------------------------------------------
|
||||
PathShow_data_1:
|
||||
.type dd 0 ;+0
|
||||
.start_y dw frame_2.y+14 ;+4
|
||||
.start_x dw frame_2.x+20 ;+6
|
||||
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
|
||||
.area_size_x dw frame_2.width-35 ;+10
|
||||
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
|
||||
.background_flag dd 0 ;+16
|
||||
.font_color dd 0 ;+20
|
||||
.background_color dd 0 ;+24
|
||||
.text_pointer dd fname_buf ;+28
|
||||
.work_area_pointer dd text_work_area ;+32
|
||||
.temp_text_length dd 0 ;+36
|
||||
;---------------------------------------------------------------------
|
||||
OpenDialog_data:
|
||||
.type dd 1 ; Save
|
||||
.procinfo dd procinfo ;+4
|
||||
.com_area_name dd communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_path dd temp_dir_path ;+16
|
||||
.dir_default_path dd communication_area_default_path ;+20
|
||||
.start_path dd open_dialog_path ;+24
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_pach dd fname_buf ;+36
|
||||
.filename_area dd filename_area ;+40
|
||||
.filter_area dd Filter
|
||||
.x:
|
||||
.x_size dw 420 ;+48 ; Window X size
|
||||
.x_start dw 200 ;+50 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ;+52 ; Window y size
|
||||
.y_start dw 120 ;+54 ; Window Y position
|
||||
|
||||
communication_area_name:
|
||||
db 'FFFFFFFF_open_dialog',0
|
||||
open_dialog_path:
|
||||
db '/sys/File Managers/opendial',0
|
||||
communication_area_default_path:
|
||||
db '/sys',0
|
||||
|
||||
Filter:
|
||||
dd Filter.end - Filter
|
||||
.1:
|
||||
db 'IMG',0
|
||||
db 'IMA',0
|
||||
.end:
|
||||
db 0
|
||||
|
||||
start_temp_file_name: db 'some.garbage',0
|
||||
|
||||
start_file_path: db '/sys/.download', 0
|
||||
;---------------------------------------------------------------------
|
||||
document_user db 'http://'
|
||||
;---------------------------------------------------------------------
|
||||
IM_END:
|
||||
;---------------------------------------------------------------------
|
||||
params rb URLMAXLEN
|
||||
;---------------------------------------------------------------------
|
||||
sc system_colors
|
||||
;---------------------------------------------------------------------
|
||||
identifier dd ?
|
||||
;---------------------------------------------------------------------
|
||||
filename_area:
|
||||
rb 256
|
||||
;---------------------------------------------------------------------
|
||||
temp_dir_path:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
procinfo:
|
||||
rb 1024
|
||||
;---------------------------------------------------------------------
|
||||
fname_buf:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
text_work_area:
|
||||
rb 1024
|
||||
;---------------------------------------------------------------------
|
||||
rb 4096
|
||||
stacktop:
|
||||
;---------------------------------------------------------------------
|
||||
I_END:
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2009-2015. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; downloader.asm - HTTP client for KolibriOS ;;
|
||||
;; ;;
|
||||
;; ;;
|
||||
;; GNU GENERAL PUBLIC LICENSE ;;
|
||||
;; Version 2, June 1991 ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
URLMAXLEN = 1024
|
||||
BUFFERSIZE = 4096
|
||||
|
||||
__DEBUG__ = 1
|
||||
__DEBUG_LEVEL__ = 1
|
||||
|
||||
format binary as ""
|
||||
;--------------------------------------
|
||||
frame_1:
|
||||
.x = 5
|
||||
.y = 10
|
||||
.width = 350
|
||||
.height = 55
|
||||
;--------------------------------------
|
||||
frame_2:
|
||||
.x = 5
|
||||
.y = 75
|
||||
.width = 350
|
||||
.height = 55
|
||||
;---------------------------------------------------------------------
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01' ; header
|
||||
dd 0x01 ; header version
|
||||
dd START ; entry point
|
||||
dd IM_END ; image size
|
||||
dd I_END ; required memory
|
||||
dd stacktop ; esp
|
||||
dd params ; I_PARAM
|
||||
dd 0x0 ; I_Path
|
||||
;---------------------------------------------------------------------
|
||||
include '../../../../macros.inc'
|
||||
include '../../../../proc32.inc'
|
||||
include '../../../../dll.inc'
|
||||
include '../../../../debug-fdo.inc'
|
||||
include '../../box_lib/box_lib.mac'
|
||||
include '../../http/http.inc'
|
||||
|
||||
virtual at 0
|
||||
http_msg http_msg
|
||||
end virtual
|
||||
;---------------------------------------------------------------------
|
||||
START:
|
||||
|
||||
mcall 68, 11 ; init heap so we can allocate memory dynamically
|
||||
|
||||
; load libraries
|
||||
stdcall dll.Load, @IMPORT
|
||||
test eax, eax
|
||||
jnz exit
|
||||
;---------------------------------------------------------------------
|
||||
mov edi,filename_area
|
||||
mov esi,start_temp_file_name
|
||||
call copy_file_name_path
|
||||
|
||||
mov edi,fname_buf
|
||||
mov esi,start_file_path
|
||||
call copy_file_name_path
|
||||
|
||||
;OpenDialog initialisation
|
||||
push dword OpenDialog_data
|
||||
call [OpenDialog_Init]
|
||||
|
||||
; prepare for PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_prepare]
|
||||
;---------------------------------------------------------------------
|
||||
; check parameters
|
||||
cmp byte[params], 0 ; no parameters ?
|
||||
je reset_events ; load the GUI
|
||||
|
||||
inc [silently]
|
||||
|
||||
download:
|
||||
call download_1
|
||||
|
||||
test [silently], 0xff
|
||||
jnz save
|
||||
|
||||
reset_events:
|
||||
DEBUGF 1, "resetting events\n"
|
||||
|
||||
; Report events
|
||||
; defaults + mouse
|
||||
mcall 40,EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER
|
||||
;---------------------------------------------------------------------
|
||||
redraw:
|
||||
call draw_window
|
||||
|
||||
still:
|
||||
;; DEBUGF 1, "waiting for events\n"
|
||||
|
||||
mcall 10 ; wait here for event
|
||||
|
||||
cmp eax, EV_REDRAW
|
||||
je redraw
|
||||
|
||||
cmp eax, EV_KEY
|
||||
je key
|
||||
|
||||
cmp eax, EV_BUTTON
|
||||
je button
|
||||
|
||||
cmp eax, EV_MOUSE
|
||||
je mouse
|
||||
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
key:
|
||||
mcall 2 ; read key
|
||||
|
||||
stdcall [edit_box_key], dword edit1
|
||||
|
||||
cmp ax, 13 shl 8
|
||||
je download
|
||||
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
button:
|
||||
|
||||
mcall 17 ; get id
|
||||
|
||||
cmp ah, 26
|
||||
jne @f
|
||||
; invoke OpenDialog
|
||||
push dword OpenDialog_data
|
||||
call [OpenDialog_Start]
|
||||
cmp [OpenDialog_data.status],1
|
||||
jne still
|
||||
|
||||
; prepare for PathShow
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_prepare]
|
||||
call draw_window
|
||||
jmp still
|
||||
@@:
|
||||
cmp ah, 1 ; button id=1 ?
|
||||
je exit
|
||||
|
||||
call download_1
|
||||
jmp save
|
||||
;---------------------------------------------------------------------
|
||||
mouse:
|
||||
stdcall [edit_box_mouse], edit1
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
exit:
|
||||
DEBUGF 1, "Exiting\n"
|
||||
invoke HTTP_free, [identifier] ; free buffer
|
||||
fail:
|
||||
or eax, -1 ; close this program
|
||||
mcall
|
||||
;---------------------------------------------------------------------
|
||||
download_1:
|
||||
DEBUGF 1, "Starting download\n"
|
||||
|
||||
invoke HTTP_get, document_user, 0, params, 0
|
||||
test eax, eax
|
||||
jz fail
|
||||
mov [identifier], eax
|
||||
|
||||
.loop:
|
||||
invoke HTTP_receive, [identifier]
|
||||
test eax, eax
|
||||
jnz .loop
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
save:
|
||||
mov ebp, [identifier]
|
||||
mov eax, [ebp + http_msg.content_received]
|
||||
mov [final_size], eax
|
||||
mov ebx, [ebp + http_msg.content_ptr]
|
||||
mov [final_buffer], ebx
|
||||
mcall 70, fileinfo
|
||||
|
||||
DEBUGF 1, "File saved\n"
|
||||
|
||||
test [silently], 0xff
|
||||
jnz exit
|
||||
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 0x80000000
|
||||
mcall 4, <10, frame_2.y+frame_2.height+7>, , download_complete
|
||||
|
||||
jmp still
|
||||
;---------------------------------------------------------------------
|
||||
copy_file_name_path:
|
||||
xor eax,eax
|
||||
cld
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test eax,eax
|
||||
jnz @r
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
; *********************************************
|
||||
; ******* WINDOW DEFINITIONS AND DRAW ********
|
||||
; *********************************************
|
||||
|
||||
draw_window:
|
||||
|
||||
mcall 12, 1 ; start window draw
|
||||
;-----------------------------------
|
||||
; get system colors
|
||||
mcall 48, 3, sc, 40
|
||||
;-----------------------------------
|
||||
; draw window
|
||||
mov edx, [sc.work]
|
||||
or edx, 0x34000000
|
||||
mcall 0, <50, 370>, <350, 170>, , 0, title
|
||||
;-----------------------------------
|
||||
; draw frames
|
||||
mov [frame_data.x],dword frame_1.x shl 16+frame_1.width
|
||||
mov [frame_data.y],dword frame_1.y shl 16+frame_1.height
|
||||
mov [frame_data.text_pointer],dword select_addr_text
|
||||
mov eax,[sc.work]
|
||||
mov [frame_data.font_backgr_color],eax
|
||||
mov eax,[sc.work_text]
|
||||
mov [frame_data.font_color],eax
|
||||
|
||||
push dword frame_data
|
||||
call [Frame_draw]
|
||||
;-----------------------------------
|
||||
mov [frame_data.x],dword frame_2.x shl 16+frame_2.width
|
||||
mov [frame_data.y],dword frame_2.y shl 16+frame_2.height
|
||||
mov [frame_data.text_pointer],dword select_path_text
|
||||
|
||||
push dword frame_data
|
||||
call [Frame_draw]
|
||||
;-----------------------------------
|
||||
; draw "url:" text
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 80000000h
|
||||
mcall 4, <frame_1.x+10, frame_1.y+15>, , type_pls
|
||||
;-----------------------------------
|
||||
; draw editbox
|
||||
edit_boxes_set_sys_color edit1, editboxes_end, sc
|
||||
stdcall [edit_box_draw], edit1
|
||||
;-----------------------------------
|
||||
; draw buttons
|
||||
mcall 8,<frame_1.x+frame_1.width-(68+15+50+15),68>,<frame_1.y+30,16>,22,[sc.work_button] ; reload
|
||||
mcall ,<frame_1.x+frame_1.width-(50+15),50>,<frame_1.y+30,16>, 24 ; stop
|
||||
|
||||
mcall , <frame_2.x+frame_2.width-(54+15),54>,<frame_2.y+30,16>,26 ; save
|
||||
;-----------------------------------
|
||||
; draw buttons text
|
||||
mov ecx, [sc.work_button_text]
|
||||
or ecx, 80000000h
|
||||
mcall 4, <frame_1.x+frame_1.width-(68+15+50+15)+10,frame_1.y+35>, , button_text.1
|
||||
mcall , <frame_1.x+frame_1.width-(50+15)+15,frame_1.y+35>, , button_text.2
|
||||
mcall , <frame_2.x+frame_2.width-(54+15)+10,frame_2.y+35>, , button_text.3
|
||||
|
||||
mcall 13,<frame_2.x+17,frame_2.width-15*2>,<frame_2.y+10,15>,0xffffff
|
||||
push dword PathShow_data_1
|
||||
call [PathShow_draw]
|
||||
|
||||
mcall 12, 2 ; end window redraw
|
||||
|
||||
ret
|
||||
;---------------------------------------------------------------------
|
||||
; Data area
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
@IMPORT:
|
||||
|
||||
library lib_http, 'http.obj', \
|
||||
box_lib, 'box_lib.obj', \
|
||||
proc_lib, 'proc_lib.obj'
|
||||
|
||||
import lib_http, \
|
||||
HTTP_get , 'get', \
|
||||
HTTP_receive , 'receive', \
|
||||
HTTP_free , 'free'
|
||||
|
||||
import box_lib, \
|
||||
edit_box_draw, 'edit_box_draw', \
|
||||
edit_box_key, 'edit_box_key', \
|
||||
edit_box_mouse, 'edit_box_mouse', \
|
||||
PathShow_prepare, 'PathShow_prepare', \
|
||||
PathShow_draw, 'PathShow_draw', \
|
||||
Frame_draw, 'frame_draw'
|
||||
|
||||
import proc_lib, \
|
||||
OpenDialog_Init, 'OpenDialog_init', \
|
||||
OpenDialog_Start, 'OpenDialog_start'
|
||||
;---------------------------------------------------------------------
|
||||
fileinfo dd 2, 0, 0
|
||||
final_size dd 0
|
||||
final_buffer dd 0
|
||||
db 0
|
||||
dd fname_buf
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
mouse_dd dd 0
|
||||
edit1 edit_box 295, 48, (frame_1.y+10), 0xffffff, 0xff, 0x80ff, 0, 0x8000, URLMAXLEN, document_user, mouse_dd, ed_focus+ed_always_focus, 7, 7
|
||||
editboxes_end:
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
include_debug_strings
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
type_pls db 'URL:', 0
|
||||
button_text:
|
||||
.1: db 'DOWNLOAD',0
|
||||
.2: db 'STOP',0
|
||||
.3: db 'SELECT', 0
|
||||
download_complete db 'FILE SAVED!', 0
|
||||
title db 'HTTP Downloader', 0
|
||||
silently db 0
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
select_addr_text db ' NETWORK ADDRESS: ',0
|
||||
select_path_text db ' PATH TO SAVE FILE: ',0
|
||||
;---------------------------------------------------------------------
|
||||
frame_data:
|
||||
.type dd 0 ;+0
|
||||
.x:
|
||||
.x_size dw 0 ;+4
|
||||
.x_start dw 0 ;+6
|
||||
.y:
|
||||
.y_size dw 0 ;+8
|
||||
.y_start dw 0 ;+10
|
||||
.ext_fr_col dd 0x0 ;+12
|
||||
.int_fr_col dd 0xffffff ;+16
|
||||
.draw_text_flag dd 1 ;+20
|
||||
.text_pointer dd 0 ;+24
|
||||
.text_position dd 0 ;+28
|
||||
.font_number dd 0 ;+32
|
||||
.font_size_y dd 9 ;+36
|
||||
.font_color dd 0x0 ;+40
|
||||
.font_backgr_color dd 0xffffff ;+44
|
||||
;---------------------------------------------------------------------
|
||||
PathShow_data_1:
|
||||
.type dd 0 ;+0
|
||||
.start_y dw frame_2.y+14 ;+4
|
||||
.start_x dw frame_2.x+20 ;+6
|
||||
.font_size_x dw 6 ;+8 ; 6 - for font 0, 8 - for font 1
|
||||
.area_size_x dw frame_2.width-35 ;+10
|
||||
.font_number dd 0 ;+12 ; 0 - monospace, 1 - variable
|
||||
.background_flag dd 0 ;+16
|
||||
.font_color dd 0 ;+20
|
||||
.background_color dd 0 ;+24
|
||||
.text_pointer dd fname_buf ;+28
|
||||
.work_area_pointer dd text_work_area ;+32
|
||||
.temp_text_length dd 0 ;+36
|
||||
;---------------------------------------------------------------------
|
||||
OpenDialog_data:
|
||||
.type dd 1 ; Save
|
||||
.procinfo dd procinfo ;+4
|
||||
.com_area_name dd communication_area_name ;+8
|
||||
.com_area dd 0 ;+12
|
||||
.opendir_path dd temp_dir_path ;+16
|
||||
.dir_default_path dd communication_area_default_path ;+20
|
||||
.start_path dd open_dialog_path ;+24
|
||||
.draw_window dd draw_window ;+28
|
||||
.status dd 0 ;+32
|
||||
.openfile_pach dd fname_buf ;+36
|
||||
.filename_area dd filename_area ;+40
|
||||
.filter_area dd Filter
|
||||
.x:
|
||||
.x_size dw 420 ;+48 ; Window X size
|
||||
.x_start dw 200 ;+50 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ;+52 ; Window y size
|
||||
.y_start dw 120 ;+54 ; Window Y position
|
||||
|
||||
communication_area_name:
|
||||
db 'FFFFFFFF_open_dialog',0
|
||||
open_dialog_path:
|
||||
db '/sys/File Managers/opendial',0
|
||||
communication_area_default_path:
|
||||
db '/sys',0
|
||||
|
||||
Filter:
|
||||
dd Filter.end - Filter
|
||||
.1:
|
||||
db 'IMG',0
|
||||
db 'IMA',0
|
||||
.end:
|
||||
db 0
|
||||
|
||||
start_temp_file_name: db 'some.garbage',0
|
||||
|
||||
start_file_path: db '/sys/.download', 0
|
||||
;---------------------------------------------------------------------
|
||||
document_user db 'http://'
|
||||
;---------------------------------------------------------------------
|
||||
IM_END:
|
||||
;---------------------------------------------------------------------
|
||||
params rb URLMAXLEN
|
||||
;---------------------------------------------------------------------
|
||||
sc system_colors
|
||||
;---------------------------------------------------------------------
|
||||
identifier dd ?
|
||||
;---------------------------------------------------------------------
|
||||
filename_area:
|
||||
rb 256
|
||||
;---------------------------------------------------------------------
|
||||
temp_dir_path:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
procinfo:
|
||||
rb 1024
|
||||
;---------------------------------------------------------------------
|
||||
fname_buf:
|
||||
rb 4096
|
||||
;---------------------------------------------------------------------
|
||||
text_work_area:
|
||||
rb 1024
|
||||
;---------------------------------------------------------------------
|
||||
rb 4096
|
||||
stacktop:
|
||||
;---------------------------------------------------------------------
|
||||
I_END:
|
||||
;---------------------------------------------------------------------
|
||||
|
@@ -24,7 +24,7 @@ include '../../proc32.inc'
|
||||
include '../../macros.inc'
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../develop/libraries/box_lib/box_lib.mac'
|
||||
include '../../develop/info3ds/info_fun_float.inc'
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
|
||||
|
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
;unz - <20><>ᯠ<EFBFBD><E1AFA0><EFBFBD>騪, <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD>騩 archiver.obj. <20><><EFBFBD><EFBFBD><EFBFBD>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD> zip <20> 7z.
|
||||
|
||||
;unz [-o output path] [-f file for unpack] [-f ...] [-h] file.zip
|
||||
@@ -42,7 +48,7 @@ include 'lang.inc' ; Language support for locales: ru_RU (CP866), es_ES, en_US.
|
||||
include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include "../../string.inc"
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../develop/libraries/box_lib/box_lib.mac'
|
||||
include '../../dll.inc'
|
||||
;include '../../debug.inc'
|
||||
include 'debug.inc'
|
||||
@@ -917,5 +923,3 @@ stackDlg:
|
||||
stack_top:
|
||||
|
||||
end_mem:
|
||||
|
||||
|
||||
|
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
;
|
||||
; Screenshooter for Kolibri
|
||||
;
|
||||
@@ -22,7 +28,7 @@ format binary as ""
|
||||
|
||||
title equ 'Screenshooter v1.21' ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
include '../../load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../develop/libraries/box_lib/box_lib.mac'
|
||||
include '../../config.inc' ;for nightbuild
|
||||
include '../../proc32.inc'
|
||||
include '../../macros.inc'
|
||||
|
@@ -1,454 +1,454 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2014-2017. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; downloader.asm - HTTP client for KolibriOS ;;
|
||||
;; ;;
|
||||
;; hidnplayr@kolibrios.org ;;
|
||||
;; ;;
|
||||
;; GNU GENERAL PUBLIC LICENSE ;;
|
||||
;; Version 2, June 1991 ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
URLMAXLEN = 65535
|
||||
|
||||
__DEBUG__ = 1
|
||||
__DEBUG_LEVEL__ = 1
|
||||
|
||||
|
||||
format binary as ""
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01' ; header
|
||||
dd 0x01 ; header version
|
||||
dd START ; entry point
|
||||
dd IM_END ; image size
|
||||
dd I_END+0x1000 ; required memory
|
||||
dd I_END+0x1000 ; esp
|
||||
dd url
|
||||
dd 0x0 ; I_Path
|
||||
|
||||
|
||||
include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../dll.inc'
|
||||
include '../../debug-fdo.inc'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../develop/libraries/http/http.inc'
|
||||
|
||||
virtual at 0
|
||||
http_msg http_msg
|
||||
end virtual
|
||||
|
||||
|
||||
START:
|
||||
mcall 68, 11 ; init heap so we can allocate memory dynamically
|
||||
|
||||
; load libraries
|
||||
stdcall dll.Load, @IMPORT
|
||||
test eax, eax
|
||||
jnz mainloop.exit
|
||||
|
||||
; wanted events
|
||||
mcall 40, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER
|
||||
|
||||
; prepare filename buffers
|
||||
mov edi, fname_buf
|
||||
mov esi, download_file_path
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test al, al
|
||||
jnz @r
|
||||
|
||||
; Initialise OpenDialog
|
||||
invoke OpenDialog_Init, OpenDialog_data
|
||||
|
||||
; If user provided parameters, start download right away!
|
||||
cmp byte[url], 0
|
||||
jne display_url_and_download
|
||||
|
||||
mov [OpenDialog_data.draw_window], draw_window
|
||||
|
||||
redraw:
|
||||
call draw_window
|
||||
|
||||
mainloop:
|
||||
mcall 10 ; wait here for event
|
||||
cmp eax, EV_REDRAW
|
||||
je redraw
|
||||
cmp eax, EV_KEY
|
||||
je .key
|
||||
cmp eax, EV_BUTTON
|
||||
je .button
|
||||
cmp eax, EV_MOUSE
|
||||
je .mouse
|
||||
jmp mainloop
|
||||
|
||||
.key:
|
||||
mcall 2 ; read key
|
||||
invoke edit_box_key, edit1
|
||||
cmp ax, 13 shl 8
|
||||
je download
|
||||
jmp mainloop
|
||||
|
||||
.button:
|
||||
mcall 17 ; get id
|
||||
cmp ah, 1 ; button id=1 ?
|
||||
je .exit
|
||||
|
||||
cmp [btn_text], sz_download
|
||||
je download
|
||||
|
||||
cmp [btn_text], sz_open
|
||||
je open_file
|
||||
|
||||
.exit:
|
||||
mcall -1 ; exit
|
||||
|
||||
.mouse:
|
||||
invoke edit_box_mouse, edit1
|
||||
jmp mainloop
|
||||
|
||||
|
||||
open_file:
|
||||
mcall 70, fileopen
|
||||
jmp mainloop
|
||||
|
||||
display_url_and_download:
|
||||
xor al, al
|
||||
mov ecx, 4096
|
||||
mov edi, url
|
||||
repne scasb
|
||||
sub edi, url+1
|
||||
mov [edit1.size], edi
|
||||
|
||||
download:
|
||||
; Extract the filename from URL
|
||||
mov edi, url
|
||||
xor al, al
|
||||
mov ecx, URLMAXLEN
|
||||
repne scasb
|
||||
mov esi, edi
|
||||
dec esi
|
||||
dec esi
|
||||
std
|
||||
.loop:
|
||||
lodsb
|
||||
cmp al, '/'
|
||||
je .done
|
||||
test al, al
|
||||
jnz .loop
|
||||
.done:
|
||||
cld
|
||||
mov ecx, edi
|
||||
sub ecx, esi
|
||||
inc esi
|
||||
inc esi
|
||||
mov edi, filename_area
|
||||
rep movsb
|
||||
|
||||
; invoke OpenDialog
|
||||
invoke OpenDialog_Start, OpenDialog_data
|
||||
mcall 40, EVM_REDRAW + EVM_BUTTON + EVM_STACK
|
||||
call draw_window
|
||||
|
||||
; Create the local file
|
||||
mov [fileinfo], 2 ; create/write to file
|
||||
xor eax, eax
|
||||
mov [fileinfo.offset], eax
|
||||
mov [fileinfo.offset+4], eax
|
||||
mov [fileinfo.size], eax
|
||||
mcall 70, fileinfo
|
||||
test eax, eax
|
||||
jnz create_error
|
||||
|
||||
; Start the download
|
||||
invoke HTTP_get, url, 0, FLAG_STREAM or FLAG_REUSE_BUFFER, 0
|
||||
test eax, eax
|
||||
jz get_error
|
||||
|
||||
mov [identifier], eax
|
||||
mov [offset], 0
|
||||
mov [btn_text], sz_cancel
|
||||
mov [status], sz_downloading
|
||||
or [edit1.flags], ed_figure_only
|
||||
and [edit1.flags], not ed_focus
|
||||
push [sc.work]
|
||||
pop [edit1.color]
|
||||
call draw_window
|
||||
|
||||
jmp download_loop
|
||||
|
||||
get_error:
|
||||
mov [btn_text], sz_exit
|
||||
mov [status], sz_err_http
|
||||
jmp redraw
|
||||
|
||||
create_error:
|
||||
mov [btn_text], sz_exit
|
||||
mov [status], sz_err_create
|
||||
jmp redraw
|
||||
|
||||
download_loop:
|
||||
mcall 10
|
||||
cmp eax, EV_REDRAW
|
||||
je .redraw
|
||||
cmp eax, EV_BUTTON
|
||||
je .button
|
||||
|
||||
invoke HTTP_receive, [identifier]
|
||||
test eax, eax
|
||||
jz got_data
|
||||
jmp download_loop
|
||||
|
||||
.redraw:
|
||||
call draw_window
|
||||
jmp download_loop
|
||||
|
||||
.button:
|
||||
jmp http_free
|
||||
|
||||
got_data:
|
||||
mov ebp, [identifier]
|
||||
test [ebp + http_msg.flags], 0xffff0000 ; error?
|
||||
jnz http_error
|
||||
|
||||
cmp [fileinfo], 3 ; Did we write before?
|
||||
je .write
|
||||
|
||||
test [ebp + http_msg.flags], FLAG_CONTENT_LENGTH
|
||||
jz .first_write
|
||||
|
||||
mov eax, [ebp + http_msg.content_length]
|
||||
mov [pb.max], eax
|
||||
|
||||
DEBUGF 1, "new file size=%u\n", eax
|
||||
mov [fileinfo], 4 ; set end of file
|
||||
mov [fileinfo.offset], eax ; new file size
|
||||
mcall 70, fileinfo
|
||||
test eax, eax
|
||||
jnz write_error
|
||||
|
||||
|
||||
.first_write:
|
||||
mov [fileinfo], 3 ; write to existing file
|
||||
.write:
|
||||
mov ecx, [ebp + http_msg.content_received]
|
||||
sub ecx, [offset]
|
||||
jz .no_data ; more then 0 data bytes?
|
||||
|
||||
mov [fileinfo.size], ecx
|
||||
mov eax, [ebp + http_msg.content_ptr]
|
||||
mov [fileinfo.buffer], eax
|
||||
mov ebx, [offset]
|
||||
mov [fileinfo.offset], ebx
|
||||
DEBUGF 1, "Writing to disk: size=%u offset=%u\n", ecx, ebx
|
||||
mcall 70, fileinfo
|
||||
test eax, eax ; check error code
|
||||
jnz write_error
|
||||
cmp ebx, ecx ; check if all bytes were written to disk
|
||||
jne write_error
|
||||
|
||||
mov eax, [ebp + http_msg.content_received]
|
||||
mov [offset], eax
|
||||
mov [pb.value], eax
|
||||
|
||||
invoke progressbar_draw, pb
|
||||
|
||||
.no_data:
|
||||
test [ebp + http_msg.flags], FLAG_GOT_ALL_DATA
|
||||
jz download_loop
|
||||
|
||||
; Download completed successfully
|
||||
mov [status], sz_complete
|
||||
mov [pb.progress_color], 0x0000c800 ; green
|
||||
mov [btn_text], sz_open
|
||||
jmp http_free
|
||||
|
||||
write_error:
|
||||
mov [status], sz_err_full
|
||||
mov [pb.progress_color], 0x00c80000 ; red
|
||||
mov [btn_text], sz_exit
|
||||
jmp http_free
|
||||
|
||||
http_error:
|
||||
mov [status], sz_err_http
|
||||
mov [pb.progress_color], 0x00c80000 ; red
|
||||
mov [btn_text], sz_exit
|
||||
; jmp http_free
|
||||
|
||||
http_free:
|
||||
mcall 40, EVM_REDRAW + EVM_BUTTON
|
||||
push [ebp + http_msg.content_received]
|
||||
pop [pb.value]
|
||||
|
||||
mov ecx, [ebp + http_msg.content_ptr]
|
||||
test ecx, ecx
|
||||
jz @f
|
||||
mcall 68, 13 ; free the buffer
|
||||
@@:
|
||||
invoke HTTP_free, [identifier] ; free headers and connection
|
||||
jmp redraw
|
||||
|
||||
draw_window:
|
||||
mcall 12, 1 ; start window draw
|
||||
|
||||
; get system colors
|
||||
mcall 48, 3, sc, 40
|
||||
|
||||
; draw window
|
||||
mov edx, [sc.work]
|
||||
or edx, 0x34000000
|
||||
mcall 0, <50, 420>, <350, 120>, , 0, title
|
||||
|
||||
; draw button
|
||||
mcall 8, <320,75>, <50,24>, 22, [sc.work_button]
|
||||
|
||||
; draw button text
|
||||
mov ecx, [sc.work_button_text]
|
||||
or ecx, 90000000h
|
||||
mcall 4, <325,56>, , [btn_text]
|
||||
|
||||
; draw status text
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 90000000h
|
||||
mcall 4, <10,70>, , [status]
|
||||
|
||||
; draw editbox
|
||||
edit_boxes_set_sys_color edit1, editboxes_end, sc
|
||||
invoke edit_box_draw, edit1
|
||||
|
||||
cmp [identifier], 0
|
||||
je @f
|
||||
; draw progressbar
|
||||
invoke progressbar_draw, pb
|
||||
@@:
|
||||
mcall 12, 2 ; end window draw
|
||||
|
||||
dont_draw:
|
||||
ret
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
; Data area
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
@IMPORT:
|
||||
|
||||
library lib_http, 'http.obj', \
|
||||
box_lib, 'box_lib.obj', \
|
||||
proc_lib, 'proc_lib.obj'
|
||||
|
||||
import lib_http, \
|
||||
HTTP_get, 'get', \
|
||||
HTTP_receive, 'receive', \
|
||||
HTTP_free, 'free'
|
||||
|
||||
import box_lib, \
|
||||
edit_box_draw, 'edit_box_draw', \
|
||||
edit_box_key, 'edit_box_key', \
|
||||
edit_box_mouse, 'edit_box_mouse', \
|
||||
progressbar_draw, 'progressbar_draw', \
|
||||
progressbar_prog, 'progressbar_progress'
|
||||
|
||||
import proc_lib, \
|
||||
OpenDialog_Init, 'OpenDialog_init', \
|
||||
OpenDialog_Start, 'OpenDialog_start'
|
||||
|
||||
|
||||
fileinfo dd 2
|
||||
.offset dd 0, 0
|
||||
.size dd 0
|
||||
.buffer dd 0
|
||||
db 0
|
||||
dd fname_buf
|
||||
|
||||
fileopen dd 7
|
||||
dd 0 ; flags
|
||||
dd fname_buf ; parameters
|
||||
dd 0 ; reserved
|
||||
dd 0 ; reserved
|
||||
db "/sys/@open", 0 ; path
|
||||
|
||||
edit1 edit_box 400, 5, 10, 0xffffff, 0x0000ff, 0x0080ff, 0x000000, 0x90000000, URLMAXLEN, url, mouse_dd, ed_focus+ed_always_focus, 0, 0
|
||||
editboxes_end:
|
||||
|
||||
identifier dd 0
|
||||
btn_text dd sz_download
|
||||
status dd sz_null
|
||||
sz_download db 'Download', 0
|
||||
sz_cancel db ' Cancel ', 0
|
||||
sz_open db ' Open ', 0
|
||||
sz_exit db ' Exit ', 0
|
||||
|
||||
sz_null db 0
|
||||
sz_downloading db 'Downloading..', 0
|
||||
sz_complete db 'Download completed', 0
|
||||
sz_err_create db 'Could not create the local file!', 0
|
||||
sz_err_full db 'Disk full!', 0
|
||||
sz_err_http db 'HTTP error!', 0
|
||||
title db 'HTTP Downloader', 0
|
||||
|
||||
OpenDialog_data:
|
||||
.type dd 1 ; Save
|
||||
.procinfo dd procinfo
|
||||
.com_area_name dd communication_area_name
|
||||
.com_area dd 0
|
||||
.opendir_path dd temp_dir_path
|
||||
.dir_default_path dd communication_area_default_path
|
||||
.start_path dd open_dialog_path
|
||||
.draw_window dd dont_draw
|
||||
.status dd 0
|
||||
.openfile_patch dd fname_buf
|
||||
.filename_area dd filename_area
|
||||
.filter_area dd filter
|
||||
.x:
|
||||
.x_size dw 420 ; Window X size
|
||||
.x_start dw 200 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ; Window y size
|
||||
.y_start dw 140 ; Window Y position
|
||||
|
||||
communication_area_name db 'FFFFFFFF_open_dialog',0
|
||||
open_dialog_path db '/sys/File Managers/opendial',0
|
||||
communication_area_default_path db '/sys',0
|
||||
|
||||
filter:
|
||||
dd 0
|
||||
db 0
|
||||
|
||||
pb:
|
||||
.value dd 0
|
||||
.left dd 5
|
||||
.top dd 45
|
||||
.width dd 300
|
||||
.height dd 16
|
||||
.style dd 1
|
||||
.min dd 0
|
||||
.max dd 0
|
||||
.back_color dd 0xefefef
|
||||
.progress_color dd 0xc8c8c8
|
||||
.frame_color dd 0x94aece
|
||||
.frame_color2 dd 0xffffff
|
||||
|
||||
include_debug_strings
|
||||
|
||||
download_file_path db '/tmp0/1/', 0
|
||||
|
||||
IM_END:
|
||||
|
||||
url rb URLMAXLEN
|
||||
sc system_colors
|
||||
offset dd ?
|
||||
mouse_dd dd ?
|
||||
|
||||
filename_area rb 256
|
||||
temp_dir_path rb 4096
|
||||
procinfo rb 1024
|
||||
fname_buf rb 4096
|
||||
text_work_area rb 1024
|
||||
|
||||
I_END:
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2014-2017. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; downloader.asm - HTTP client for KolibriOS ;;
|
||||
;; ;;
|
||||
;; hidnplayr@kolibrios.org ;;
|
||||
;; ;;
|
||||
;; GNU GENERAL PUBLIC LICENSE ;;
|
||||
;; Version 2, June 1991 ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
URLMAXLEN = 65535
|
||||
|
||||
__DEBUG__ = 1
|
||||
__DEBUG_LEVEL__ = 1
|
||||
|
||||
|
||||
format binary as ""
|
||||
use32
|
||||
org 0x0
|
||||
|
||||
db 'MENUET01' ; header
|
||||
dd 0x01 ; header version
|
||||
dd START ; entry point
|
||||
dd IM_END ; image size
|
||||
dd I_END+0x1000 ; required memory
|
||||
dd I_END+0x1000 ; esp
|
||||
dd url
|
||||
dd 0x0 ; I_Path
|
||||
|
||||
|
||||
include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../dll.inc'
|
||||
include '../../debug-fdo.inc'
|
||||
include '../../develop/libraries/box_lib/box_lib.mac'
|
||||
include '../../develop/libraries/http/http.inc'
|
||||
|
||||
virtual at 0
|
||||
http_msg http_msg
|
||||
end virtual
|
||||
|
||||
|
||||
START:
|
||||
mcall 68, 11 ; init heap so we can allocate memory dynamically
|
||||
|
||||
; load libraries
|
||||
stdcall dll.Load, @IMPORT
|
||||
test eax, eax
|
||||
jnz mainloop.exit
|
||||
|
||||
; wanted events
|
||||
mcall 40, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER
|
||||
|
||||
; prepare filename buffers
|
||||
mov edi, fname_buf
|
||||
mov esi, download_file_path
|
||||
@@:
|
||||
lodsb
|
||||
stosb
|
||||
test al, al
|
||||
jnz @r
|
||||
|
||||
; Initialise OpenDialog
|
||||
invoke OpenDialog_Init, OpenDialog_data
|
||||
|
||||
; If user provided parameters, start download right away!
|
||||
cmp byte[url], 0
|
||||
jne display_url_and_download
|
||||
|
||||
mov [OpenDialog_data.draw_window], draw_window
|
||||
|
||||
redraw:
|
||||
call draw_window
|
||||
|
||||
mainloop:
|
||||
mcall 10 ; wait here for event
|
||||
cmp eax, EV_REDRAW
|
||||
je redraw
|
||||
cmp eax, EV_KEY
|
||||
je .key
|
||||
cmp eax, EV_BUTTON
|
||||
je .button
|
||||
cmp eax, EV_MOUSE
|
||||
je .mouse
|
||||
jmp mainloop
|
||||
|
||||
.key:
|
||||
mcall 2 ; read key
|
||||
invoke edit_box_key, edit1
|
||||
cmp ax, 13 shl 8
|
||||
je download
|
||||
jmp mainloop
|
||||
|
||||
.button:
|
||||
mcall 17 ; get id
|
||||
cmp ah, 1 ; button id=1 ?
|
||||
je .exit
|
||||
|
||||
cmp [btn_text], sz_download
|
||||
je download
|
||||
|
||||
cmp [btn_text], sz_open
|
||||
je open_file
|
||||
|
||||
.exit:
|
||||
mcall -1 ; exit
|
||||
|
||||
.mouse:
|
||||
invoke edit_box_mouse, edit1
|
||||
jmp mainloop
|
||||
|
||||
|
||||
open_file:
|
||||
mcall 70, fileopen
|
||||
jmp mainloop
|
||||
|
||||
display_url_and_download:
|
||||
xor al, al
|
||||
mov ecx, 4096
|
||||
mov edi, url
|
||||
repne scasb
|
||||
sub edi, url+1
|
||||
mov [edit1.size], edi
|
||||
|
||||
download:
|
||||
; Extract the filename from URL
|
||||
mov edi, url
|
||||
xor al, al
|
||||
mov ecx, URLMAXLEN
|
||||
repne scasb
|
||||
mov esi, edi
|
||||
dec esi
|
||||
dec esi
|
||||
std
|
||||
.loop:
|
||||
lodsb
|
||||
cmp al, '/'
|
||||
je .done
|
||||
test al, al
|
||||
jnz .loop
|
||||
.done:
|
||||
cld
|
||||
mov ecx, edi
|
||||
sub ecx, esi
|
||||
inc esi
|
||||
inc esi
|
||||
mov edi, filename_area
|
||||
rep movsb
|
||||
|
||||
; invoke OpenDialog
|
||||
invoke OpenDialog_Start, OpenDialog_data
|
||||
mcall 40, EVM_REDRAW + EVM_BUTTON + EVM_STACK
|
||||
call draw_window
|
||||
|
||||
; Create the local file
|
||||
mov [fileinfo], 2 ; create/write to file
|
||||
xor eax, eax
|
||||
mov [fileinfo.offset], eax
|
||||
mov [fileinfo.offset+4], eax
|
||||
mov [fileinfo.size], eax
|
||||
mcall 70, fileinfo
|
||||
test eax, eax
|
||||
jnz create_error
|
||||
|
||||
; Start the download
|
||||
invoke HTTP_get, url, 0, FLAG_STREAM or FLAG_REUSE_BUFFER, 0
|
||||
test eax, eax
|
||||
jz get_error
|
||||
|
||||
mov [identifier], eax
|
||||
mov [offset], 0
|
||||
mov [btn_text], sz_cancel
|
||||
mov [status], sz_downloading
|
||||
or [edit1.flags], ed_figure_only
|
||||
and [edit1.flags], not ed_focus
|
||||
push [sc.work]
|
||||
pop [edit1.color]
|
||||
call draw_window
|
||||
|
||||
jmp download_loop
|
||||
|
||||
get_error:
|
||||
mov [btn_text], sz_exit
|
||||
mov [status], sz_err_http
|
||||
jmp redraw
|
||||
|
||||
create_error:
|
||||
mov [btn_text], sz_exit
|
||||
mov [status], sz_err_create
|
||||
jmp redraw
|
||||
|
||||
download_loop:
|
||||
mcall 10
|
||||
cmp eax, EV_REDRAW
|
||||
je .redraw
|
||||
cmp eax, EV_BUTTON
|
||||
je .button
|
||||
|
||||
invoke HTTP_receive, [identifier]
|
||||
test eax, eax
|
||||
jz got_data
|
||||
jmp download_loop
|
||||
|
||||
.redraw:
|
||||
call draw_window
|
||||
jmp download_loop
|
||||
|
||||
.button:
|
||||
jmp http_free
|
||||
|
||||
got_data:
|
||||
mov ebp, [identifier]
|
||||
test [ebp + http_msg.flags], 0xffff0000 ; error?
|
||||
jnz http_error
|
||||
|
||||
cmp [fileinfo], 3 ; Did we write before?
|
||||
je .write
|
||||
|
||||
test [ebp + http_msg.flags], FLAG_CONTENT_LENGTH
|
||||
jz .first_write
|
||||
|
||||
mov eax, [ebp + http_msg.content_length]
|
||||
mov [pb.max], eax
|
||||
|
||||
DEBUGF 1, "new file size=%u\n", eax
|
||||
mov [fileinfo], 4 ; set end of file
|
||||
mov [fileinfo.offset], eax ; new file size
|
||||
mcall 70, fileinfo
|
||||
test eax, eax
|
||||
jnz write_error
|
||||
|
||||
|
||||
.first_write:
|
||||
mov [fileinfo], 3 ; write to existing file
|
||||
.write:
|
||||
mov ecx, [ebp + http_msg.content_received]
|
||||
sub ecx, [offset]
|
||||
jz .no_data ; more then 0 data bytes?
|
||||
|
||||
mov [fileinfo.size], ecx
|
||||
mov eax, [ebp + http_msg.content_ptr]
|
||||
mov [fileinfo.buffer], eax
|
||||
mov ebx, [offset]
|
||||
mov [fileinfo.offset], ebx
|
||||
DEBUGF 1, "Writing to disk: size=%u offset=%u\n", ecx, ebx
|
||||
mcall 70, fileinfo
|
||||
test eax, eax ; check error code
|
||||
jnz write_error
|
||||
cmp ebx, ecx ; check if all bytes were written to disk
|
||||
jne write_error
|
||||
|
||||
mov eax, [ebp + http_msg.content_received]
|
||||
mov [offset], eax
|
||||
mov [pb.value], eax
|
||||
|
||||
invoke progressbar_draw, pb
|
||||
|
||||
.no_data:
|
||||
test [ebp + http_msg.flags], FLAG_GOT_ALL_DATA
|
||||
jz download_loop
|
||||
|
||||
; Download completed successfully
|
||||
mov [status], sz_complete
|
||||
mov [pb.progress_color], 0x0000c800 ; green
|
||||
mov [btn_text], sz_open
|
||||
jmp http_free
|
||||
|
||||
write_error:
|
||||
mov [status], sz_err_full
|
||||
mov [pb.progress_color], 0x00c80000 ; red
|
||||
mov [btn_text], sz_exit
|
||||
jmp http_free
|
||||
|
||||
http_error:
|
||||
mov [status], sz_err_http
|
||||
mov [pb.progress_color], 0x00c80000 ; red
|
||||
mov [btn_text], sz_exit
|
||||
; jmp http_free
|
||||
|
||||
http_free:
|
||||
mcall 40, EVM_REDRAW + EVM_BUTTON
|
||||
push [ebp + http_msg.content_received]
|
||||
pop [pb.value]
|
||||
|
||||
mov ecx, [ebp + http_msg.content_ptr]
|
||||
test ecx, ecx
|
||||
jz @f
|
||||
mcall 68, 13 ; free the buffer
|
||||
@@:
|
||||
invoke HTTP_free, [identifier] ; free headers and connection
|
||||
jmp redraw
|
||||
|
||||
draw_window:
|
||||
mcall 12, 1 ; start window draw
|
||||
|
||||
; get system colors
|
||||
mcall 48, 3, sc, 40
|
||||
|
||||
; draw window
|
||||
mov edx, [sc.work]
|
||||
or edx, 0x34000000
|
||||
mcall 0, <50, 420>, <350, 120>, , 0, title
|
||||
|
||||
; draw button
|
||||
mcall 8, <320,75>, <50,24>, 22, [sc.work_button]
|
||||
|
||||
; draw button text
|
||||
mov ecx, [sc.work_button_text]
|
||||
or ecx, 90000000h
|
||||
mcall 4, <325,56>, , [btn_text]
|
||||
|
||||
; draw status text
|
||||
mov ecx, [sc.work_text]
|
||||
or ecx, 90000000h
|
||||
mcall 4, <10,70>, , [status]
|
||||
|
||||
; draw editbox
|
||||
edit_boxes_set_sys_color edit1, editboxes_end, sc
|
||||
invoke edit_box_draw, edit1
|
||||
|
||||
cmp [identifier], 0
|
||||
je @f
|
||||
; draw progressbar
|
||||
invoke progressbar_draw, pb
|
||||
@@:
|
||||
mcall 12, 2 ; end window draw
|
||||
|
||||
dont_draw:
|
||||
ret
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
; Data area
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
@IMPORT:
|
||||
|
||||
library lib_http, 'http.obj', \
|
||||
box_lib, 'box_lib.obj', \
|
||||
proc_lib, 'proc_lib.obj'
|
||||
|
||||
import lib_http, \
|
||||
HTTP_get, 'get', \
|
||||
HTTP_receive, 'receive', \
|
||||
HTTP_free, 'free'
|
||||
|
||||
import box_lib, \
|
||||
edit_box_draw, 'edit_box_draw', \
|
||||
edit_box_key, 'edit_box_key', \
|
||||
edit_box_mouse, 'edit_box_mouse', \
|
||||
progressbar_draw, 'progressbar_draw', \
|
||||
progressbar_prog, 'progressbar_progress'
|
||||
|
||||
import proc_lib, \
|
||||
OpenDialog_Init, 'OpenDialog_init', \
|
||||
OpenDialog_Start, 'OpenDialog_start'
|
||||
|
||||
|
||||
fileinfo dd 2
|
||||
.offset dd 0, 0
|
||||
.size dd 0
|
||||
.buffer dd 0
|
||||
db 0
|
||||
dd fname_buf
|
||||
|
||||
fileopen dd 7
|
||||
dd 0 ; flags
|
||||
dd fname_buf ; parameters
|
||||
dd 0 ; reserved
|
||||
dd 0 ; reserved
|
||||
db "/sys/@open", 0 ; path
|
||||
|
||||
edit1 edit_box 400, 5, 10, 0xffffff, 0x0000ff, 0x0080ff, 0x000000, 0x90000000, URLMAXLEN, url, mouse_dd, ed_focus+ed_always_focus, 0, 0
|
||||
editboxes_end:
|
||||
|
||||
identifier dd 0
|
||||
btn_text dd sz_download
|
||||
status dd sz_null
|
||||
sz_download db 'Download', 0
|
||||
sz_cancel db ' Cancel ', 0
|
||||
sz_open db ' Open ', 0
|
||||
sz_exit db ' Exit ', 0
|
||||
|
||||
sz_null db 0
|
||||
sz_downloading db 'Downloading..', 0
|
||||
sz_complete db 'Download completed', 0
|
||||
sz_err_create db 'Could not create the local file!', 0
|
||||
sz_err_full db 'Disk full!', 0
|
||||
sz_err_http db 'HTTP error!', 0
|
||||
title db 'HTTP Downloader', 0
|
||||
|
||||
OpenDialog_data:
|
||||
.type dd 1 ; Save
|
||||
.procinfo dd procinfo
|
||||
.com_area_name dd communication_area_name
|
||||
.com_area dd 0
|
||||
.opendir_path dd temp_dir_path
|
||||
.dir_default_path dd communication_area_default_path
|
||||
.start_path dd open_dialog_path
|
||||
.draw_window dd dont_draw
|
||||
.status dd 0
|
||||
.openfile_patch dd fname_buf
|
||||
.filename_area dd filename_area
|
||||
.filter_area dd filter
|
||||
.x:
|
||||
.x_size dw 420 ; Window X size
|
||||
.x_start dw 200 ; Window X position
|
||||
.y:
|
||||
.y_size dw 320 ; Window y size
|
||||
.y_start dw 140 ; Window Y position
|
||||
|
||||
communication_area_name db 'FFFFFFFF_open_dialog',0
|
||||
open_dialog_path db '/sys/File Managers/opendial',0
|
||||
communication_area_default_path db '/sys',0
|
||||
|
||||
filter:
|
||||
dd 0
|
||||
db 0
|
||||
|
||||
pb:
|
||||
.value dd 0
|
||||
.left dd 5
|
||||
.top dd 45
|
||||
.width dd 300
|
||||
.height dd 16
|
||||
.style dd 1
|
||||
.min dd 0
|
||||
.max dd 0
|
||||
.back_color dd 0xefefef
|
||||
.progress_color dd 0xc8c8c8
|
||||
.frame_color dd 0x94aece
|
||||
.frame_color2 dd 0xffffff
|
||||
|
||||
include_debug_strings
|
||||
|
||||
download_file_path db '/tmp0/1/', 0
|
||||
|
||||
IM_END:
|
||||
|
||||
url rb URLMAXLEN
|
||||
sc system_colors
|
||||
offset dd ?
|
||||
mouse_dd dd ?
|
||||
|
||||
filename_area rb 256
|
||||
temp_dir_path rb 4096
|
||||
procinfo rb 1024
|
||||
fname_buf rb 4096
|
||||
text_work_area rb 1024
|
||||
|
||||
I_END:
|
||||
|
@@ -1,10 +1,13 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
include '../../load_img.inc'
|
||||
include '../../develop/libraries/libs-dev/libimg/libimg.inc'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../develop/libraries/box_lib/box_lib.mac'
|
||||
include '../../load_lib.mac'
|
||||
|
||||
@use_library
|
||||
|
||||
|
||||
icon_tl_sys dd 0
|
||||
icon_tl_nod dd 0
|
||||
icon_buttons dd 0
|
||||
@@ -82,7 +85,7 @@ gui: ;//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
or dword[tree1.style], 8 ;tl_cursor_pos_limited - restrict cursor move to existing nodes
|
||||
or dword[tree2.style], 8 ;tl_cursor_pos_limited
|
||||
|
||||
|
||||
; read icons
|
||||
mcall SF_SYS_MISC, SSF_MEM_OPEN, str_icon_18,, 0
|
||||
or eax, eax
|
||||
@@ -228,7 +231,7 @@ gui: ;//////////////////////////////////////////////////////////////////////////
|
||||
mcall SF_DEFINE_BUTTON, <TLIST2_X+TLIST_SZ-BT_SZ_X,BT_SZ_X>, <80,20>, 6, BT_COL
|
||||
; string "mkd"
|
||||
mcall SF_DRAW_TEXT, <TLIST2_X+TLIST_SZ-BT_SZ_X+5,80+5>, 0xb0000000+STR_COL, str_mkd
|
||||
|
||||
|
||||
; draw "cancel" button
|
||||
;mcall SF_DEFINE_BUTTON, <555,55>, <308,25>, 10, BT_COL
|
||||
; string "Cancel"
|
||||
@@ -243,7 +246,7 @@ gui: ;//////////////////////////////////////////////////////////////////////////
|
||||
;--------------------------
|
||||
stdcall [tl_draw], tree1
|
||||
stdcall [tl_draw], tree2
|
||||
|
||||
|
||||
mov dword[wScr.all_redraw], 1
|
||||
stdcall [scrollbar_ver_draw], wScr
|
||||
|
||||
@@ -360,7 +363,7 @@ gui: ;//////////////////////////////////////////////////////////////////////////
|
||||
@@:
|
||||
cmp ah, 1
|
||||
je .exit
|
||||
|
||||
|
||||
jmp .still
|
||||
|
||||
.print:
|
||||
@@ -456,7 +459,7 @@ gui: ;//////////////////////////////////////////////////////////////////////////
|
||||
mov ecx, [esp]
|
||||
add ecx, buf_buffer2
|
||||
sub ecx, edi
|
||||
|
||||
|
||||
repne scasb
|
||||
|
||||
; check if the (last) entry is incomplete
|
||||
@@ -466,7 +469,7 @@ gui: ;//////////////////////////////////////////////////////////////////////////
|
||||
rep scasb
|
||||
test ecx, ecx
|
||||
jz .store_last_entry
|
||||
|
||||
|
||||
dec edx
|
||||
jnz @b
|
||||
|
||||
@@ -772,7 +775,7 @@ populate_local_tree_list: ;/////////////////////////////////////////////////////
|
||||
je .outer ; more BDFEs to come
|
||||
|
||||
.done:
|
||||
ret
|
||||
ret
|
||||
|
||||
|
||||
MIN_M_WND_H equ 500 ;
|
||||
@@ -890,7 +893,7 @@ search: ;///////////////////////////////////////////////////////////////////////
|
||||
;;------------------------------------------------------------------------------------------------;;
|
||||
;< al = 0 (not found) / 1 (found) ;;
|
||||
;;================================================================================================;;
|
||||
|
||||
|
||||
push ebx ecx edx esi edi
|
||||
; if length of haystack < length of needle
|
||||
cmp ecx, edx
|
||||
@@ -1073,7 +1076,7 @@ edit_volume edit_box TLIST_SZ-60, TLIST1_X, 80, 0xffffff, 0x94AECE, 0, \
|
||||
; editbox for search
|
||||
edit_search edit_box TLIST_SZ-30, TLIST2_X, 22, 0xffffff, 0x94AECE, 0, \
|
||||
0xAABBCC, 0x10000000, 99, filter,mouse_dd, 0
|
||||
|
||||
|
||||
; A subsidiary structure for scrolling
|
||||
align 4
|
||||
wScr:
|
||||
@@ -1196,7 +1199,7 @@ tedit0:
|
||||
.mode_color db 1 ;+195
|
||||
.mode_invis db 0 ;+196
|
||||
.gp_opt db 0 ;+197
|
||||
dd 0 ;.fun_on_key_ctrl_all dd but_ctrl_all ;+198
|
||||
dd 0 ;.fun_on_key_ctrl_all dd but_ctrl_all ;+198
|
||||
dd 0,0,0 ;reserved
|
||||
.buffer_size dd 4096 ;+214
|
||||
.fun_find_err dd 0 ;+218
|
||||
|
@@ -1,415 +1,419 @@
|
||||
|
||||
use32 ; <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD>騩 32 ࠧ<>來<EFBFBD><EFA4AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
org 0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20>ᥣ<EFBFBD><E1A5A3> 0x0
|
||||
db 'MENUET01' ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> (8 <20><><EFBFBD><EFBFBD>)
|
||||
dd 1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ଠ<EFBFBD><E0ACA0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9>
|
||||
dd start ; <20><><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD> <20><>।<EFBFBD><E0A5A4><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD>
|
||||
; <20><> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>㧪<EFBFBD> <20>ਫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd i_end ; ࠧ<EFBFBD><EFBFBD><EFBFBD> <20>ਫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd mem ; <20><>ꥬ <20>ᯮ<EFBFBD><E1AFAE><EFBFBD>㥬<EFBFBD><E3A5AC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20>⥪<EFBFBD> <20>⢥<EFBFBD><E2A2A5><EFBFBD> 0<>100 <20><><EFBFBD><EFBFBD> <EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20>୨<EFBFBD><E0ADA8> 4 <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd mem ; <20><>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⥪<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>ࠧ<EFBFBD> <20><> ⥫<><E2A5AB> <20>ணࠬ<E0AEA3><E0A0AC>. <20><><EFBFBD>設<EFBFBD> <20>⥪<EFBFBD> <EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 㪠<><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd 0 ; 㪠<EFBFBD><EFBFBD>⥫<EFBFBD> <20><> <20><>ப<EFBFBD> <20> <20><>ࠬ<EFBFBD><E0A0AC>ࠬ<EFBFBD>.
|
||||
dd 0;pathprog ;<3B><><EFBFBD><EFBFBD> <20> <20><><EFBFBD> <20>ண<EFBFBD>
|
||||
|
||||
include "../../../macros.inc"
|
||||
include "../../../proc32.inc"
|
||||
include "API.INC"
|
||||
include "../../../dll.inc"
|
||||
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
;include '../../../KOSfuncs.inc'
|
||||
;include '../../../load_lib.mac'
|
||||
|
||||
start:
|
||||
mcall 68,11 ;<3B><><EFBFBD>樠<EFBFBD><E6A8A0><EFBFBD><EFBFBD><EFBFBD>㥬 <20><><EFBFBD><EFBFBD>
|
||||
test eax,eax
|
||||
jz Win1.Exit
|
||||
stdcall dll.Load, @IMPORT
|
||||
|
||||
|
||||
; mov ecx,1024
|
||||
; mov edi,pathprog
|
||||
; xor al,al
|
||||
;
|
||||
; repne scasb
|
||||
;
|
||||
; dec edi
|
||||
; mov esi,WordFile
|
||||
; @@:
|
||||
; lodsb
|
||||
; stosb
|
||||
; test al,al
|
||||
; jne @b
|
||||
|
||||
;GetFileInfo fStruc,pathprog,fInfo ;<3B><EFBFBD>ઠ <20><> <20><><EFBFBD><EFBFBD>稥 䠩<><E4A0A9>
|
||||
;test eax,eax ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD> 䠩<><E4A0A9>
|
||||
;je WordFileOK
|
||||
|
||||
;stdcall [mb_create],msgNotFound,mbThread
|
||||
;jmp Win1.Redraw
|
||||
|
||||
;WordFileOK:
|
||||
; stdcall mem.Alloc,dword [fInfo+32]
|
||||
; mov ebx,dword [fInfo+32]
|
||||
; mov [filBuffer],eax
|
||||
; add dword[fInfo+32],eax ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD> 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
; ReadFile fStruc,pathprog,ebx,eax,0
|
||||
; test eax,eax
|
||||
; jz Win1.Redraw
|
||||
;
|
||||
; add al,30h
|
||||
; mov [NumErr],al
|
||||
; stdcall [mb_create],msgNotFound1,mbThread
|
||||
;
|
||||
|
||||
|
||||
align 4
|
||||
Win1.Redraw:
|
||||
RedrawWinBeg
|
||||
|
||||
xor eax,eax
|
||||
mov ebx,(524*10000h+500)
|
||||
mov ecx,(548*10000h+200)
|
||||
mov edx,73FFFFFFh
|
||||
mov edi,Win1.Caption
|
||||
int 40h ;<3B><><EFBFBD><EFBFBD> <20> <20><EFBFBD><E0AEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䮭o<E4AEAD>
|
||||
|
||||
mcall 9,ThreadInfo,-1
|
||||
|
||||
mov eax,13
|
||||
mov ebx,[ThreadInfo+3Eh]
|
||||
inc ebx
|
||||
mov ecx,[ThreadInfo+42h]
|
||||
inc ecx
|
||||
mov edx,clWhite
|
||||
int 40h ;<3B> ⥯<><E2A5AF><EFBFBD> <20><> <20><EFBFBD><E0AEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:)
|
||||
|
||||
call Perevod ; <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20>ࠧ<EFBFBD> <20><>ॢ<EFBFBD><E0A5A2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <><E1ABAE>
|
||||
call NextPerev
|
||||
stdcall [edit_box_draw],EditIN
|
||||
RedrawWinEnd
|
||||
|
||||
align 4
|
||||
Win1.Events:
|
||||
WaitMessage
|
||||
dec eax
|
||||
jz Win1.Redraw
|
||||
dec eax
|
||||
jz Win1.Key
|
||||
dec eax
|
||||
jz Win1.ButtonPress
|
||||
|
||||
;stdcall [edit_box_mouse],EditIN
|
||||
|
||||
jmp Win1.Events
|
||||
|
||||
Win1.ButtonPress:
|
||||
GetButtonPressed
|
||||
|
||||
cmp ah,idbExit
|
||||
je Win1.Exit
|
||||
|
||||
jmp Win1.Events
|
||||
|
||||
Win1.Key:
|
||||
GetKeyPressed
|
||||
stdcall [edit_box_key],EditIN
|
||||
jmp Win1.FonRedraw
|
||||
|
||||
|
||||
Win1.Exit:
|
||||
|
||||
ExitProcess
|
||||
|
||||
Win1.FonRedraw: ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>뢮<EFBFBD><EBA2AE>
|
||||
mcall 9,ThreadInfo,-1
|
||||
|
||||
mov eax,13
|
||||
mov ebx,[ThreadInfo+3Eh]
|
||||
inc ebx
|
||||
mov ecx,20
|
||||
shl ecx,16
|
||||
add ecx,[ThreadInfo+42h]
|
||||
sub ecx,19
|
||||
mov edx,clWhite
|
||||
int 40h
|
||||
|
||||
call Perevod
|
||||
call NextPerev
|
||||
jmp Win1.Events
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
|
||||
Perevod: ;ᠬ <20><>ॢ<EFBFBD><E0A5A2>
|
||||
mov edi,dict;[filBuffer]
|
||||
|
||||
Perev:
|
||||
xor ebx,ebx
|
||||
@@: ;<3B>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD> <20><><EFBFBD>. <><E1ABAE> <20><> <><E1ABAE><EFBFBD> <20><><EFBFBD> esi
|
||||
mov al,[text+ebx]
|
||||
test al,al
|
||||
je endWord
|
||||
cmp [ebx+edi],al
|
||||
jne WordNotFound
|
||||
inc ebx
|
||||
jmp @b
|
||||
|
||||
endWord:
|
||||
cmp byte[ebx+edi],20h
|
||||
jne WordNotFound
|
||||
|
||||
add edi,ebx
|
||||
dec edi ;<3B>ய<EFBFBD>᪠<EFBFBD><E1AAA0> <20><EFBFBD><E0AEA1><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AAAE> <><E1ABAE>
|
||||
@@:
|
||||
inc edi
|
||||
cmp byte[edi],20h
|
||||
je @b
|
||||
|
||||
xor ebx,ebx
|
||||
CopyWord: ;<3B><><EFBFBD><EFBFBD><EFBFBD>㥬 <20><>ॢ<EFBFBD><E0A5A2> <20> <20><>ப<EFBFBD> <20><><EFBFBD> <20>뢮<EFBFBD><EBA2AE>
|
||||
mov al,[edi+ebx]
|
||||
cmp al,0Dh
|
||||
je @f
|
||||
mov [perevText+ebx],al
|
||||
inc ebx
|
||||
jmp CopyWord
|
||||
@@:
|
||||
mov byte[perevText+ebx],0
|
||||
|
||||
OutText 7,25,perevText
|
||||
ret
|
||||
|
||||
WordNotFound: ;<3B> <><E1ABAE> <20><> <20><><EFBFBD><EFBFBD>諮
|
||||
add edi,ebx
|
||||
@@:
|
||||
cmp byte[edi],0Dh
|
||||
je NextWord
|
||||
inc edi
|
||||
cmp edi,SizeDict;dword [fInfo+32]
|
||||
jae endPerev
|
||||
jmp @b
|
||||
|
||||
NextWord:
|
||||
add edi,2
|
||||
cmp edi,SizeDict;dword [fInfo+32]
|
||||
jae endPerev
|
||||
jmp Perev
|
||||
endPerev:
|
||||
ret
|
||||
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
NextPerev:
|
||||
mov ecx,Lines
|
||||
mov edi,dict;[filBuffer]
|
||||
LinePerev: ;横<> <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
||||
xor ebx,ebx
|
||||
@@: ;<3B>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD> <20><><EFBFBD>. <><E1ABAE> <20><> <><E1ABAE><EFBFBD> <20><><EFBFBD> esi
|
||||
mov al,[text+ebx]
|
||||
test al,al
|
||||
je N_endWord
|
||||
cmp [ebx+edi],al
|
||||
jne N_WordNotFound
|
||||
inc ebx
|
||||
jmp @b
|
||||
|
||||
N_endWord:
|
||||
cmp ebx,0
|
||||
jne N_Ppoisk
|
||||
ret
|
||||
|
||||
N_Ppoisk: ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><>砫<EFBFBD> <20><>ப<EFBFBD>
|
||||
add edi,ebx
|
||||
@@:
|
||||
dec edi
|
||||
cmp byte[edi],0Ah
|
||||
jne @b
|
||||
inc edi
|
||||
|
||||
;########<23>ய<EFBFBD>᪠<EFBFBD><E1AAA0> 㦥 <20><>ॢ<EFBFBD><E0A5A2><EFBFBD> <><E1ABAE>########
|
||||
xor ebx,ebx
|
||||
N_NoDouble:
|
||||
mov al,[text+ebx]
|
||||
test al,al
|
||||
je N_Double
|
||||
cmp [ebx+edi],al
|
||||
jne N_NoDblOk
|
||||
inc ebx
|
||||
jmp N_NoDouble
|
||||
|
||||
N_Double:
|
||||
cmp byte[ebx+edi],20h
|
||||
jne N_NoDblOk
|
||||
|
||||
add edi,ebx
|
||||
@@:
|
||||
inc edi
|
||||
cmp byte[edi],0Ah
|
||||
jne @b
|
||||
add edi,2
|
||||
jmp LinePerev
|
||||
|
||||
N_NoDblOk: ;############<23>뢮<EFBFBD> १<><E0A5A7><EFBFBD><EFBFBD><EFBFBD>⮢####################
|
||||
xor ebx,ebx ;<3B><><EFBFBD><EFBFBD><EFBFBD>㥬 १<><E0A5A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
N_CopyWord:
|
||||
mov al,[edi+ebx]
|
||||
cmp al,20h
|
||||
je @f
|
||||
mov [perevText+ebx],al
|
||||
inc ebx
|
||||
jmp N_CopyWord
|
||||
@@:
|
||||
mov byte[perevText+ebx],0
|
||||
add edi,ebx
|
||||
|
||||
mov eax,Lines
|
||||
sub eax,ecx
|
||||
dec eax
|
||||
shl eax,3
|
||||
add eax,45
|
||||
push ecx
|
||||
push edi
|
||||
OutText 7,ax,perevText
|
||||
pop edi
|
||||
pop ecx
|
||||
|
||||
@@:
|
||||
inc edi
|
||||
cmp byte[edi],20h
|
||||
je @b
|
||||
|
||||
|
||||
xor ebx,ebx
|
||||
N_CopyPerev:
|
||||
mov al,[edi+ebx]
|
||||
cmp al,0Dh
|
||||
je @f
|
||||
mov [perevText+ebx],al
|
||||
inc ebx
|
||||
jmp N_CopyPerev
|
||||
@@:
|
||||
mov byte[perevText+ebx],0
|
||||
|
||||
mov eax,Lines
|
||||
sub eax,ecx
|
||||
dec eax
|
||||
shl eax,3
|
||||
add eax,45
|
||||
push ecx
|
||||
push edi
|
||||
OutText 127,ax,perevText
|
||||
pop edi
|
||||
pop ecx
|
||||
|
||||
@@:
|
||||
inc edi
|
||||
cmp byte[edi],0Ah
|
||||
jne @b
|
||||
inc edi
|
||||
|
||||
loop @f ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFA3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> LinePerev
|
||||
ret
|
||||
@@:
|
||||
jmp LinePerev
|
||||
|
||||
N_WordNotFound:
|
||||
add edi,ebx
|
||||
@@:
|
||||
cmp byte[edi],0Dh
|
||||
je N_NextWord
|
||||
inc edi
|
||||
cmp edi,SizeDict;dword [fInfo+32]
|
||||
jae N_endPerev
|
||||
jmp @b
|
||||
|
||||
N_NextWord:
|
||||
add edi,2
|
||||
cmp edi,SizeDict;dword [fInfo+32]
|
||||
jae N_endPerev
|
||||
jmp LinePerev
|
||||
N_endPerev:
|
||||
ret
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
;-------------------------------------------------------------------------------
|
||||
;------DATA---------------------------------------------------------------------
|
||||
;-------------------------------------------------------------------------------
|
||||
;-------------------------------------------------------------------------------
|
||||
|
||||
idbExit = 1
|
||||
|
||||
Lines = 16 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப
|
||||
|
||||
clTheme = 080B0FFh
|
||||
|
||||
Win1.Caption db 'Dictionary ENG -> RUS',0
|
||||
Win1X = 524
|
||||
Win1Y = 548
|
||||
Win1W = 500
|
||||
Win1H = 200
|
||||
|
||||
Memo.X = 5
|
||||
Memo.Y = 20
|
||||
Memo.W = 400
|
||||
Memo.H = 370
|
||||
|
||||
EditIN edit_box 350,5,5,0FFFFFFh,06F9480h,0,00h,0,40,\
|
||||
text,mouse_dd,ed_focus,0,0
|
||||
|
||||
|
||||
|
||||
; msgNotFound:
|
||||
; dw 0
|
||||
; db '<27>訡<EFBFBD><E8A8A1>',0
|
||||
; db '<27><><EFBFBD><EFBFBD> dictionary.wrd <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',0
|
||||
; db '<27>᭮',0
|
||||
; db 0
|
||||
;
|
||||
; msgNotFound1:
|
||||
; dw 0
|
||||
; db '!!!',0
|
||||
; db '<27>訡<EFBFBD><E8A8A1> <20>⥭<EFBFBD><E2A5AD> '
|
||||
; NumErr: db 0
|
||||
; db 0
|
||||
; db '<27>᭮',0
|
||||
; db 0
|
||||
;
|
||||
; WordFile db '.wrd',0
|
||||
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
@IMPORT:
|
||||
library box_lib,'box_lib.obj',msgbox,'msgbox.obj'
|
||||
import box_lib,\
|
||||
edit_box_draw,'edit_box_draw',\
|
||||
edit_box_key,'edit_box_key';,\
|
||||
;edit_box_mouse,'edit_box_mouse'
|
||||
import msgbox,\
|
||||
mb_create,'mb_create'
|
||||
|
||||
dict:
|
||||
include 'dictionary.wrd'
|
||||
|
||||
SizeDict = $;-dict
|
||||
|
||||
|
||||
i_end:
|
||||
;-------------------------------------------------------------------------------
|
||||
|
||||
;WordFP rb 1024
|
||||
; m1 dd 0
|
||||
;filBuffer rd 1
|
||||
|
||||
|
||||
ThreadInfo: rb 1024
|
||||
;pathprog
|
||||
mouse_dd rd 1
|
||||
text rb 40
|
||||
perevText rb 300
|
||||
;fStruc rb 30
|
||||
;fInfo rb 40
|
||||
mbThread rb 1024
|
||||
|
||||
|
||||
rb 4096
|
||||
mem:
|
||||
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
use32 ; <20>࠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>ᯮ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>騩 32 ࠧ<>來<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
org 0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>ᥣ<EFBFBD><E1A5A3> 0x0
|
||||
db 'MENUET01' ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><EFBFBD>塞<EFBFBD><EFBFBD><EFBFBD> 䠩<EFBFBD><EFBFBD> (8 <20><><EFBFBD><EFBFBD>)
|
||||
dd 1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ଠ<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><EFBFBD>塞<EFBFBD><EFBFBD><EFBFBD> 䠩<EFBFBD><EFBFBD>
|
||||
dd start ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD> <20><>।<EFBFBD><E0A5A4><EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD>
|
||||
; <20><> <20><><EFBFBD><EFBFBD>㧪<EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd i_end ; ࠧ<><E0A0A7><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd mem ; <20><>ꥬ <20>ᯮ<EFBFBD><E1AFAE><EFBFBD>㥬<EFBFBD><E3A5AC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20>⥪<EFBFBD> <20>⢥<EFBFBD><E2A2A5><EFBFBD> 0<>100 <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><E0AEA2><EFBFBD> <20><> <20>୨<EFBFBD><E0ADA8> 4 <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd mem ; <20><>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⥪<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>ࠧ<EFBFBD> <20><> ⥫<><E2A5AB> <20>ணࠬ<E0AEA3><E0A0AC>. <20><><EFBFBD>設<EFBFBD> <20>⥪<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, 㪠<><E3AAA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
dd 0 ; 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><>ப<EFBFBD> <20> <20><>ࠬ<EFBFBD><E0A0AC>ࠬ<EFBFBD>.
|
||||
dd 0;pathprog ;<3B><><EFBFBD><EFBFBD> <20> <20><><EFBFBD> <20>ண<EFBFBD>
|
||||
|
||||
include "../../../macros.inc"
|
||||
include "../../../proc32.inc"
|
||||
include "API.INC"
|
||||
include "../../../dll.inc"
|
||||
include '../../../develop/libraries/box_lib/box_lib.mac'
|
||||
;include '../../../KOSfuncs.inc'
|
||||
;include '../../../load_lib.mac'
|
||||
|
||||
start:
|
||||
mcall 68,11 ;<3B><><EFBFBD>樠<EFBFBD><E6A8A0><EFBFBD><EFBFBD><EFBFBD>㥬 <20><><EFBFBD><EFBFBD>
|
||||
test eax,eax
|
||||
jz Win1.Exit
|
||||
stdcall dll.Load, @IMPORT
|
||||
|
||||
|
||||
; mov ecx,1024
|
||||
; mov edi,pathprog
|
||||
; xor al,al
|
||||
;
|
||||
; repne scasb
|
||||
;
|
||||
; dec edi
|
||||
; mov esi,WordFile
|
||||
; @@:
|
||||
; lodsb
|
||||
; stosb
|
||||
; test al,al
|
||||
; jne @b
|
||||
|
||||
;GetFileInfo fStruc,pathprog,fInfo ;<3B><EFBFBD>ઠ <20><> <20><><EFBFBD><EFBFBD>稥 䠩<><E4A0A9>
|
||||
;test eax,eax ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD> 䠩<><E4A0A9>
|
||||
;je WordFileOK
|
||||
|
||||
;stdcall [mb_create],msgNotFound,mbThread
|
||||
;jmp Win1.Redraw
|
||||
|
||||
;WordFileOK:
|
||||
; stdcall mem.Alloc,dword [fInfo+32]
|
||||
; mov ebx,dword [fInfo+32]
|
||||
; mov [filBuffer],eax
|
||||
; add dword[fInfo+32],eax ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD> 㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
; ReadFile fStruc,pathprog,ebx,eax,0
|
||||
; test eax,eax
|
||||
; jz Win1.Redraw
|
||||
;
|
||||
; add al,30h
|
||||
; mov [NumErr],al
|
||||
; stdcall [mb_create],msgNotFound1,mbThread
|
||||
;
|
||||
|
||||
|
||||
align 4
|
||||
Win1.Redraw:
|
||||
RedrawWinBeg
|
||||
|
||||
xor eax,eax
|
||||
mov ebx,(524*10000h+500)
|
||||
mov ecx,(548*10000h+200)
|
||||
mov edx,73FFFFFFh
|
||||
mov edi,Win1.Caption
|
||||
int 40h ;<3B><><EFBFBD><EFBFBD> <20> <20><EFBFBD><E0AEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䮭o<E4AEAD>
|
||||
|
||||
mcall 9,ThreadInfo,-1
|
||||
|
||||
mov eax,13
|
||||
mov ebx,[ThreadInfo+3Eh]
|
||||
inc ebx
|
||||
mov ecx,[ThreadInfo+42h]
|
||||
inc ecx
|
||||
mov edx,clWhite
|
||||
int 40h ;<3B> ⥯<><E2A5AF><EFBFBD> <20><> <20><EFBFBD><E0AEA7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:)
|
||||
|
||||
call Perevod ; <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20>ࠧ<EFBFBD> <20><>ॢ<EFBFBD><E0A5A2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <><E1ABAE>
|
||||
call NextPerev
|
||||
stdcall [edit_box_draw],EditIN
|
||||
RedrawWinEnd
|
||||
|
||||
align 4
|
||||
Win1.Events:
|
||||
WaitMessage
|
||||
dec eax
|
||||
jz Win1.Redraw
|
||||
dec eax
|
||||
jz Win1.Key
|
||||
dec eax
|
||||
jz Win1.ButtonPress
|
||||
|
||||
;stdcall [edit_box_mouse],EditIN
|
||||
|
||||
jmp Win1.Events
|
||||
|
||||
Win1.ButtonPress:
|
||||
GetButtonPressed
|
||||
|
||||
cmp ah,idbExit
|
||||
je Win1.Exit
|
||||
|
||||
jmp Win1.Events
|
||||
|
||||
Win1.Key:
|
||||
GetKeyPressed
|
||||
stdcall [edit_box_key],EditIN
|
||||
jmp Win1.FonRedraw
|
||||
|
||||
|
||||
Win1.Exit:
|
||||
|
||||
ExitProcess
|
||||
|
||||
Win1.FonRedraw: ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>뢮<EFBFBD><EBA2AE>
|
||||
mcall 9,ThreadInfo,-1
|
||||
|
||||
mov eax,13
|
||||
mov ebx,[ThreadInfo+3Eh]
|
||||
inc ebx
|
||||
mov ecx,20
|
||||
shl ecx,16
|
||||
add ecx,[ThreadInfo+42h]
|
||||
sub ecx,19
|
||||
mov edx,clWhite
|
||||
int 40h
|
||||
|
||||
call Perevod
|
||||
call NextPerev
|
||||
jmp Win1.Events
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
|
||||
Perevod: ;ᠬ <20><>ॢ<EFBFBD><E0A5A2>
|
||||
mov edi,dict;[filBuffer]
|
||||
|
||||
Perev:
|
||||
xor ebx,ebx
|
||||
@@: ;<3B>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD> <20><><EFBFBD>. <><E1ABAE> <20><> <><E1ABAE><EFBFBD> <20><><EFBFBD> esi
|
||||
mov al,[text+ebx]
|
||||
test al,al
|
||||
je endWord
|
||||
cmp [ebx+edi],al
|
||||
jne WordNotFound
|
||||
inc ebx
|
||||
jmp @b
|
||||
|
||||
endWord:
|
||||
cmp byte[ebx+edi],20h
|
||||
jne WordNotFound
|
||||
|
||||
add edi,ebx
|
||||
dec edi ;<3B>ய<EFBFBD>᪠<EFBFBD><E1AAA0> <20><EFBFBD><E0AEA1><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AAAE> <><E1ABAE>
|
||||
@@:
|
||||
inc edi
|
||||
cmp byte[edi],20h
|
||||
je @b
|
||||
|
||||
xor ebx,ebx
|
||||
CopyWord: ;<3B><><EFBFBD><EFBFBD><EFBFBD>㥬 <20><>ॢ<EFBFBD><E0A5A2> <20> <20><>ப<EFBFBD> <20><><EFBFBD> <20>뢮<EFBFBD><EBA2AE>
|
||||
mov al,[edi+ebx]
|
||||
cmp al,0Dh
|
||||
je @f
|
||||
mov [perevText+ebx],al
|
||||
inc ebx
|
||||
jmp CopyWord
|
||||
@@:
|
||||
mov byte[perevText+ebx],0
|
||||
|
||||
OutText 7,25,perevText
|
||||
ret
|
||||
|
||||
WordNotFound: ;<3B> <><E1ABAE> <20><> <20><><EFBFBD><EFBFBD>諮
|
||||
add edi,ebx
|
||||
@@:
|
||||
cmp byte[edi],0Dh
|
||||
je NextWord
|
||||
inc edi
|
||||
cmp edi,SizeDict;dword [fInfo+32]
|
||||
jae endPerev
|
||||
jmp @b
|
||||
|
||||
NextWord:
|
||||
add edi,2
|
||||
cmp edi,SizeDict;dword [fInfo+32]
|
||||
jae endPerev
|
||||
jmp Perev
|
||||
endPerev:
|
||||
ret
|
||||
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
NextPerev:
|
||||
mov ecx,Lines
|
||||
mov edi,dict;[filBuffer]
|
||||
LinePerev: ;横<> <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><>ப<EFBFBD>
|
||||
xor ebx,ebx
|
||||
@@: ;<3B>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD> <20><><EFBFBD>. <><E1ABAE> <20><> <><E1ABAE><EFBFBD> <20><><EFBFBD> esi
|
||||
mov al,[text+ebx]
|
||||
test al,al
|
||||
je N_endWord
|
||||
cmp [ebx+edi],al
|
||||
jne N_WordNotFound
|
||||
inc ebx
|
||||
jmp @b
|
||||
|
||||
N_endWord:
|
||||
cmp ebx,0
|
||||
jne N_Ppoisk
|
||||
ret
|
||||
|
||||
N_Ppoisk: ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><>砫<EFBFBD> <20><>ப<EFBFBD>
|
||||
add edi,ebx
|
||||
@@:
|
||||
dec edi
|
||||
cmp byte[edi],0Ah
|
||||
jne @b
|
||||
inc edi
|
||||
|
||||
;########<23>ய<EFBFBD>᪠<EFBFBD><E1AAA0> 㦥 <20><>ॢ<EFBFBD><E0A5A2><EFBFBD> <><E1ABAE>########
|
||||
xor ebx,ebx
|
||||
N_NoDouble:
|
||||
mov al,[text+ebx]
|
||||
test al,al
|
||||
je N_Double
|
||||
cmp [ebx+edi],al
|
||||
jne N_NoDblOk
|
||||
inc ebx
|
||||
jmp N_NoDouble
|
||||
|
||||
N_Double:
|
||||
cmp byte[ebx+edi],20h
|
||||
jne N_NoDblOk
|
||||
|
||||
add edi,ebx
|
||||
@@:
|
||||
inc edi
|
||||
cmp byte[edi],0Ah
|
||||
jne @b
|
||||
add edi,2
|
||||
jmp LinePerev
|
||||
|
||||
N_NoDblOk: ;############<23>뢮<EFBFBD> १<><E0A5A7><EFBFBD><EFBFBD><EFBFBD>⮢####################
|
||||
xor ebx,ebx ;<3B><><EFBFBD><EFBFBD><EFBFBD>㥬 १<><E0A5A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
N_CopyWord:
|
||||
mov al,[edi+ebx]
|
||||
cmp al,20h
|
||||
je @f
|
||||
mov [perevText+ebx],al
|
||||
inc ebx
|
||||
jmp N_CopyWord
|
||||
@@:
|
||||
mov byte[perevText+ebx],0
|
||||
add edi,ebx
|
||||
|
||||
mov eax,Lines
|
||||
sub eax,ecx
|
||||
dec eax
|
||||
shl eax,3
|
||||
add eax,45
|
||||
push ecx
|
||||
push edi
|
||||
OutText 7,ax,perevText
|
||||
pop edi
|
||||
pop ecx
|
||||
|
||||
@@:
|
||||
inc edi
|
||||
cmp byte[edi],20h
|
||||
je @b
|
||||
|
||||
|
||||
xor ebx,ebx
|
||||
N_CopyPerev:
|
||||
mov al,[edi+ebx]
|
||||
cmp al,0Dh
|
||||
je @f
|
||||
mov [perevText+ebx],al
|
||||
inc ebx
|
||||
jmp N_CopyPerev
|
||||
@@:
|
||||
mov byte[perevText+ebx],0
|
||||
|
||||
mov eax,Lines
|
||||
sub eax,ecx
|
||||
dec eax
|
||||
shl eax,3
|
||||
add eax,45
|
||||
push ecx
|
||||
push edi
|
||||
OutText 127,ax,perevText
|
||||
pop edi
|
||||
pop ecx
|
||||
|
||||
@@:
|
||||
inc edi
|
||||
cmp byte[edi],0Ah
|
||||
jne @b
|
||||
inc edi
|
||||
|
||||
loop @f ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFA3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> LinePerev
|
||||
ret
|
||||
@@:
|
||||
jmp LinePerev
|
||||
|
||||
N_WordNotFound:
|
||||
add edi,ebx
|
||||
@@:
|
||||
cmp byte[edi],0Dh
|
||||
je N_NextWord
|
||||
inc edi
|
||||
cmp edi,SizeDict;dword [fInfo+32]
|
||||
jae N_endPerev
|
||||
jmp @b
|
||||
|
||||
N_NextWord:
|
||||
add edi,2
|
||||
cmp edi,SizeDict;dword [fInfo+32]
|
||||
jae N_endPerev
|
||||
jmp LinePerev
|
||||
N_endPerev:
|
||||
ret
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
;-------------------------------------------------------------------------------
|
||||
;------DATA---------------------------------------------------------------------
|
||||
;-------------------------------------------------------------------------------
|
||||
;-------------------------------------------------------------------------------
|
||||
|
||||
idbExit = 1
|
||||
|
||||
Lines = 16 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப
|
||||
|
||||
clTheme = 080B0FFh
|
||||
|
||||
Win1.Caption db 'Dictionary ENG -> RUS',0
|
||||
Win1X = 524
|
||||
Win1Y = 548
|
||||
Win1W = 500
|
||||
Win1H = 200
|
||||
|
||||
Memo.X = 5
|
||||
Memo.Y = 20
|
||||
Memo.W = 400
|
||||
Memo.H = 370
|
||||
|
||||
EditIN edit_box 350,5,5,0FFFFFFh,06F9480h,0,00h,0,40,\
|
||||
text,mouse_dd,ed_focus,0,0
|
||||
|
||||
|
||||
|
||||
; msgNotFound:
|
||||
; dw 0
|
||||
; db '<27>訡<EFBFBD><E8A8A1>',0
|
||||
; db '<27><><EFBFBD><EFBFBD> dictionary.wrd <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',0
|
||||
; db '<EFBFBD>᭮',0
|
||||
; db 0
|
||||
;
|
||||
; msgNotFound1:
|
||||
; dw 0
|
||||
; db '!!!',0
|
||||
; db '<27>訡<EFBFBD><E8A8A1> <20>⥭<EFBFBD><E2A5AD> '
|
||||
; NumErr: db 0
|
||||
; db 0
|
||||
; db '<27>᭮',0
|
||||
; db 0
|
||||
;
|
||||
; WordFile db '.wrd',0
|
||||
|
||||
|
||||
;-------------------------------------------------------------------------------
|
||||
@IMPORT:
|
||||
library box_lib,'box_lib.obj',msgbox,'msgbox.obj'
|
||||
import box_lib,\
|
||||
edit_box_draw,'edit_box_draw',\
|
||||
edit_box_key,'edit_box_key';,\
|
||||
;edit_box_mouse,'edit_box_mouse'
|
||||
import msgbox,\
|
||||
mb_create,'mb_create'
|
||||
|
||||
dict:
|
||||
include 'dictionary.wrd'
|
||||
|
||||
SizeDict = $;-dict
|
||||
|
||||
|
||||
i_end:
|
||||
;-------------------------------------------------------------------------------
|
||||
|
||||
;WordFP rb 1024
|
||||
; m1 dd 0
|
||||
;filBuffer rd 1
|
||||
|
||||
|
||||
ThreadInfo: rb 1024
|
||||
;pathprog
|
||||
mouse_dd rd 1
|
||||
text rb 40
|
||||
perevText rb 300
|
||||
;fStruc rb 30
|
||||
;fInfo rb 40
|
||||
mbThread rb 1024
|
||||
|
||||
|
||||
rb 4096
|
||||
mem:
|
||||
|
@@ -1,6 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
; RTF READER FOR KOLIBRI >= 0.7.7.0
|
||||
; Written in pure assembler by Ivushkin Andrey aka Willow
|
||||
; Menu_bar and scroll_bar from box_lib provided by dunkaist
|
||||
@@ -62,7 +65,7 @@ AR_OFFSET equ 10
|
||||
|
||||
include '../../config.inc' ;for nightbuild
|
||||
include '../../macros.inc' ; Macros facilitate the life of assemblers!
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../develop/libraries/box_lib/box_lib.mac'
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../load_lib.mac'
|
||||
|
||||
|
@@ -1,429 +1,435 @@
|
||||
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>୮<EFBFBD><E0ADAE><EFBFBD> <20>ᥬ, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD>/ᮢ<>⮬/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ...
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
||||
dd 1, start, i_end, mem, stacktop, file_name, sys_path
|
||||
|
||||
MAX_COLOR_WORD_LEN equ 40
|
||||
maxChars equ 100002 ;(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD> + 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 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
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 ;<3B><><EFBFBD><EFBFBD><EFBFBD>㥬 <20><><EFBFBD> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD> openfile_path
|
||||
|
||||
load_libraries l_libs_start,load_lib_end
|
||||
|
||||
;<3B><EFBFBD>ઠ <20><> <>쪮 㤠筮 <20><><EFBFBD>㧨<EFBFBD><E3A7A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD>
|
||||
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 <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov eax,[bmp_icon]
|
||||
add eax,TOOLBAR_ICONS_SIZE
|
||||
stdcall img_to_gray, [bmp_icon],eax,(TOOLBAR_ICONS_SIZE)/3
|
||||
;---------------------------------------------------------------------
|
||||
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD>ࠬ<EFBFBD> <20> <20><><EFBFBD><EFBFBD>ﬨ
|
||||
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
|
||||
; <20><><EFBFBD><EFBFBD><EFBFBD>塞 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㧫<><E3A7AB>
|
||||
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 ;<3B><>६ <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||
xor eax,eax
|
||||
mov ecx,4096
|
||||
mov edi,file_name
|
||||
repnz scasb
|
||||
mov byte[edi-2],al ;㡨ࠥ<E3A1A8> '/' <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> (<28>㦭<EFBFBD> <20><><EFBFBD> <20>⥭<EFBFBD><E2A5AD> <20> 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],'.' ;䨫<><E4A8AB><EFBFBD>㥬 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '.' <20> '..'
|
||||
je .filter
|
||||
;0x10000 ;1*2^16 - <20><><EFBFBD> 1 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
stdcall [tl_node_add], tree1,0x10000,eax
|
||||
stdcall [tl_cur_next], tree1
|
||||
.filter:
|
||||
add eax,304
|
||||
loop @b
|
||||
stdcall [tl_cur_beg],tree1 ;<3B>⠢<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD> <20><>砫<EFBFBD> ᯨ᪠
|
||||
or dword[tree1.style], tl_cursor_pos_limited ;<3B><>࠭<EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD> ᯨ᪠
|
||||
.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
|
||||
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
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
|
||||
;䠩<><E4A0A9><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD>
|
||||
xor edx,edx
|
||||
mov ebx,synt_auto_open
|
||||
@@:
|
||||
;<3B><>६ <20><><EFBFBD> 䠩<><E4A0A9>
|
||||
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
|
||||
;<3B><>६ <20><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><EFBFBD>
|
||||
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 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
cmp al,6 ;<3B><><EFBFBD><EFBFBD>
|
||||
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 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 饫<><E9A5AB><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jnc @f
|
||||
stdcall [ted_but_select_word], tedit0
|
||||
ret
|
||||
@@:
|
||||
stdcall [ted_mouse], tedit0
|
||||
.no_edit:
|
||||
|
||||
;<3B><EFBFBD>ઠ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
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 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
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 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>᪫<EFBFBD><E1AAAB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall SF_GET_KEY
|
||||
stdcall [tl_key], tree1
|
||||
|
||||
test word[edit_replace.flags],ed_focus ;<3B> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
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 ;<3B> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
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 ;<3B> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
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: ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ࠡ<><E0A0A1><EFBFBD>
|
||||
rb 4096
|
||||
dir_mem rb 32+304*count_of_dir_list_files
|
||||
wnd_s_pos: ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⮢<EFBFBD><E2AEA2> <20><><EFBFBD><EFBFBD>樨 <20><><EFBFBD><EFBFBD>
|
||||
rq 1
|
||||
last_open_synt_file rb 32 ;<3B><><EFBFBD> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD><EFBFBD><EFBFBD> 䠩<><E4A0A9> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||
buf rb BUF_SIZE ;<3B><><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><>⠢<EFBFBD><EFBFBD>
|
||||
buf_find rb 302 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>᪠ ⥪<><E2A5AA><EFBFBD>
|
||||
buf_replace rb 302 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
||||
buf_goto rb 12 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>室<EFBFBD> <20><> <20><>ப<EFBFBD>
|
||||
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: ;<3B><><EFBFBD><EFBFBD> <20><><EFBFBD>㤠 <20><><EFBFBD><EFBFBD><EFBFBD>⨫<EFBFBD><E2A8AB> <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC> 䠩<>
|
||||
rb 4096
|
||||
file_name: ;<3B><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>᪠
|
||||
rb 4096
|
||||
syntax_path: ;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>砥<EFBFBD><E7A0A5><EFBFBD><EFBFBD> 䠩<><E4A0A9> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||
rb 4096
|
||||
plugin_path:
|
||||
rb 4096
|
||||
text_work_area: ;<3B><><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
||||
rb 4096
|
||||
filename_area: ;<3B><><EFBFBD> 䠩<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rb 256
|
||||
file_info:
|
||||
rb 40
|
||||
mem:
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
;<3B><><EFBFBD><E0AEAC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>୮<EFBFBD><E0ADAE><EFBFBD> <20>ᥬ, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD>/ᮢ<>⮬/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ...
|
||||
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
||||
dd 1, start, i_end, mem, stacktop, file_name, sys_path
|
||||
|
||||
MAX_COLOR_WORD_LEN equ 40
|
||||
maxChars equ 100002 ;(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ ᨬ<><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD> + 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/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 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
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 ;<3B><><EFBFBD><EFBFBD><EFBFBD>㥬 <20><><EFBFBD> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD> openfile_path
|
||||
|
||||
load_libraries l_libs_start,load_lib_end
|
||||
|
||||
;<3B><EFBFBD>ઠ <20><> <>쪮 㤠筮 <20><><EFBFBD>㧨<EFBFBD><E3A7A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD>
|
||||
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 <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov eax,[bmp_icon]
|
||||
add eax,TOOLBAR_ICONS_SIZE
|
||||
stdcall img_to_gray, [bmp_icon],eax,(TOOLBAR_ICONS_SIZE)/3
|
||||
;---------------------------------------------------------------------
|
||||
; <20><><EFBFBD><EFBFBD><EFBFBD>塞 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD>ࠬ<EFBFBD> <20> <20><><EFBFBD><EFBFBD>ﬨ
|
||||
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
|
||||
; <20><><EFBFBD><EFBFBD><EFBFBD>塞 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㧫<><E3A7AB>
|
||||
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 ;<3B><>६ <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||
xor eax,eax
|
||||
mov ecx,4096
|
||||
mov edi,file_name
|
||||
repnz scasb
|
||||
mov byte[edi-2],al ;㡨ࠥ<E3A1A8> '/' <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> (<28>㦭<EFBFBD> <20><><EFBFBD> <20>⥭<EFBFBD><E2A5AD> <20> 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],'.' ;䨫<><E4A8AB><EFBFBD>㥬 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '.' <20> '..'
|
||||
je .filter
|
||||
;0x10000 ;1*2^16 - <20><><EFBFBD> 1 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
stdcall [tl_node_add], tree1,0x10000,eax
|
||||
stdcall [tl_cur_next], tree1
|
||||
.filter:
|
||||
add eax,304
|
||||
loop @b
|
||||
stdcall [tl_cur_beg],tree1 ;<3B>⠢<EFBFBD><E2A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>砫<EFBFBD> ᯨ᪠
|
||||
or dword[tree1.style], tl_cursor_pos_limited ;<3B><>࠭<EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD> ᯨ᪠
|
||||
.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
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
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
|
||||
;䠩<><E4A0A9><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD>
|
||||
xor edx,edx
|
||||
mov ebx,synt_auto_open
|
||||
@@:
|
||||
;<3B><>६ <20><><EFBFBD> 䠩<EFBFBD><EFBFBD>
|
||||
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
|
||||
;<3B><>६ <20><><EFBFBD><EFBFBD><EFBFBD>७<EFBFBD><E0A5AD>
|
||||
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 ;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jz red_win
|
||||
cmp al,2
|
||||
jz key
|
||||
cmp al,3
|
||||
jz button
|
||||
cmp al,6 ;<3B><><EFBFBD><EFBFBD>
|
||||
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 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 饫<><E9A5AB><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
jnc @f
|
||||
stdcall [ted_but_select_word], tedit0
|
||||
ret
|
||||
@@:
|
||||
stdcall [ted_mouse], tedit0
|
||||
.no_edit:
|
||||
|
||||
;<3B><EFBFBD>ઠ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
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 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
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 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>᪫<EFBFBD><E1AAAB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall SF_GET_KEY
|
||||
stdcall [tl_key], tree1
|
||||
|
||||
test word[edit_replace.flags],ed_focus ;<3B> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
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 ;<3B> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
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 ;<3B> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
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: ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ࠡ<><EFBFBD><EFBFBD>
|
||||
rb 4096
|
||||
dir_mem rb 32+304*count_of_dir_list_files
|
||||
wnd_s_pos: ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⮢<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>樨 <20><><EFBFBD><EFBFBD>
|
||||
rq 1
|
||||
last_open_synt_file rb 32 ;<3B><><EFBFBD> <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD><EFBFBD><EFBFBD> 䠩<><E4A0A9> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||
buf rb BUF_SIZE ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> <20> <20><>⠢<EFBFBD><E2A0A2>
|
||||
buf_find rb 302 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>᪠ ⥪<><E2A5AA><EFBFBD>
|
||||
buf_replace rb 302 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
||||
buf_goto rb 12 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>室<EFBFBD> <20><> <20><>ப<EFBFBD>
|
||||
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: ;<3B><><EFBFBD><EFBFBD> <20><><EFBFBD>㤠 <20><><EFBFBD><EFBFBD><EFBFBD>⨫<EFBFBD><E2A8AB> <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC> 䠩<>
|
||||
rb 4096
|
||||
file_name: ;<3B><>ࠬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>᪠
|
||||
rb 4096
|
||||
syntax_path: ;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>砥<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<EFBFBD><EFBFBD> ᨭ⠪<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rb 4096
|
||||
plugin_path:
|
||||
rb 4096
|
||||
text_work_area: ;<3B><><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
||||
rb 4096
|
||||
filename_area: ;<3B><><EFBFBD> 䠩<><E4A0A9> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
rb 256
|
||||
file_info:
|
||||
rb 40
|
||||
mem:
|
||||
|
@@ -1,389 +1,395 @@
|
||||
use32
|
||||
org 0
|
||||
db 'MENUET01' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
||||
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 ;<3B><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>। ⥪<>⮢<EFBFBD><E2AEA2> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
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 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
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
|
||||
|
||||
;<3B><EFBFBD>ઠ <20><> <>쪮 㤠筮 <20><><EFBFBD>㧨<EFBFBD><E3A7A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD>
|
||||
cmp dword[lib0+ll_struc_size-4],0
|
||||
jz @f
|
||||
mcall -1 ;exit not correct
|
||||
@@:
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
stdcall [tl_data_init], tree1
|
||||
|
||||
; <20><>⠥<EFBFBD> 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD>ࠬ<EFBFBD> <20> <20><><EFBFBD><EFBFBD>ﬨ
|
||||
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
|
||||
;---------------------------------------------------------------------
|
||||
; <20><>⠥<EFBFBD> bmp 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㧫<><E3A7AB>
|
||||
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 ;<3B><>६ <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||
mcall SF_FILE,tree_file_struct
|
||||
|
||||
cmp ebx,2
|
||||
jg @f
|
||||
notify_window_run file_name ;ᮮ<>饭<EFBFBD><E9A5AD> <20> <20><> 㤠<><E3A4A0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||
jmp .end_dir_init
|
||||
@@:
|
||||
;cmp ebx,0
|
||||
;jle .end_dir_init
|
||||
mov eax,dir_mem+32+40
|
||||
mov ecx,ebx
|
||||
@@:
|
||||
cmp byte[eax],'.' ;䨫<><E4A8AB><EFBFBD>㥬 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '.' <20> '..'
|
||||
je .filter
|
||||
stdcall [tl_node_add],tree1,0x10000,eax ;1*2^16 - <20><><EFBFBD> 1 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
stdcall [tl_cur_next],tree1
|
||||
.filter:
|
||||
add eax,304
|
||||
loop @b
|
||||
stdcall [tl_cur_beg],tree1 ;<3B>⠢<EFBFBD><E2A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>砫<EFBFBD> ᯨ᪠
|
||||
or dword[tree1.style], tl_cursor_pos_limited ;<3B><>࠭<EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>।<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᯨ᪠
|
||||
.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 ;<3B><><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
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 ;<3B><><EFBFBD>祭<EFBFBD><E7A5AD> edi <20>㦭<EFBFBD> <20><><EFBFBD> EvSize <20> 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 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쭠<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
;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] ;<3B>⠢<EFBFBD><E2A0A2> <20><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠢ<><E0A0A2><EFBFBD> <20><>ਭ<EFBFBD> <20>ᥣ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
mov eax,ted_wnd_l
|
||||
sub ted_wnd_w,eax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><E1ABA5>
|
||||
movzx eax,word[esi+sb_offs_size_x]
|
||||
sub ted_wnd_w,eax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
m2m ted_wnd_h,[procinfo.client_box.height] ;<3B>⠢<EFBFBD><E2A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠢ<><E0A0A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᥣ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
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 ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ਧ. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov eax,ted_wnd_t
|
||||
sub ted_wnd_h,eax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᢥ<><E1A2A5><EFBFBD>
|
||||
|
||||
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 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
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 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>᪫<EFBFBD><E1AAAB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall SF_GET_KEY
|
||||
stdcall [tl_key],tree1
|
||||
|
||||
test word [edit1.flags],10b;ed_focus ; <20> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
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 ;<3B><>室 <20><> <20>ணࠬ<E0AEA3><E0A0AC>
|
||||
|
||||
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:
|
||||
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>⨨ 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
|
||||
|
||||
;ᮧ<><E1AEA7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||
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
|
||||
|
||||
;<3B><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 䮪<><E4AEAA><EFBFBD>
|
||||
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 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
conv_tabl rb 128 ; ⠡<><E2A0A1><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> scan-<2D><><EFBFBD><EFBFBD> <20> ascii-<2D><><EFBFBD>
|
||||
|
||||
txt_load_f db '<27><><EFBFBD><EFBFBD>. 䠩<>',0
|
||||
txt_save_f db '<27><><EFBFBD><EFBFBD>. 䠩<>',0
|
||||
txt_inp_file db '<27><><EFBFBD>. 䠩<>:',0
|
||||
txt_out_file db '<27><><EFBFBD>. 䠩<>:',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' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
||||
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 ;<3B><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>। ⥪<>⮢<EFBFBD><E2AEA2> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../load_img.inc'
|
||||
include '../../load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/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 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
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
|
||||
|
||||
;<EFBFBD><EFBFBD>ઠ <20><> <>쪮 㤠筮 <20><><EFBFBD>㧨<EFBFBD><E3A7A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD>
|
||||
cmp dword[lib0+ll_struc_size-4],0
|
||||
jz @f
|
||||
mcall -1 ;exit not correct
|
||||
@@:
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
stdcall [tl_data_init], tree1
|
||||
|
||||
; <20><>⠥<EFBFBD> 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD>ࠬ<EFBFBD> <20> <20><><EFBFBD><EFBFBD>ﬨ
|
||||
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
|
||||
;---------------------------------------------------------------------
|
||||
; <20><>⠥<EFBFBD> bmp 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㧫<><E3A7AB>
|
||||
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 ;<3B><>६ <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD> ᨭ⠪<E1A8AD><E2A0AA><EFBFBD><EFBFBD>
|
||||
mcall SF_FILE,tree_file_struct
|
||||
|
||||
cmp ebx,2
|
||||
jg @f
|
||||
notify_window_run file_name ;ᮮ<>饭<EFBFBD><E9A5AD> <20> <20><> 㤠<><E3A4A0><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||
jmp .end_dir_init
|
||||
@@:
|
||||
;cmp ebx,0
|
||||
;jle .end_dir_init
|
||||
mov eax,dir_mem+32+40
|
||||
mov ecx,ebx
|
||||
@@:
|
||||
cmp byte[eax],'.' ;䨫<><E4A8AB><EFBFBD>㥬 䠩<><E4A0A9> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '.' <20> '..'
|
||||
je .filter
|
||||
stdcall [tl_node_add],tree1,0x10000,eax ;1*2^16 - <20><><EFBFBD> 1 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
stdcall [tl_cur_next],tree1
|
||||
.filter:
|
||||
add eax,304
|
||||
loop @b
|
||||
stdcall [tl_cur_beg],tree1 ;<3B>⠢<EFBFBD><E2A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>砫<EFBFBD> ᯨ᪠
|
||||
or dword[tree1.style], tl_cursor_pos_limited ;<3B><>࠭<EFBFBD>稢<EFBFBD><E7A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD> ᯨ᪠
|
||||
.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 ;<3B><><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
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 ;<3B><><EFBFBD>祭<EFBFBD><E7A5AD> edi <20>㦭<EFBFBD> <20><><EFBFBD> EvSize <20> 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 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>쭠<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
;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] ;<3B>⠢<EFBFBD><E2A0A2> <20><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠢ<><E0A0A2><EFBFBD> <20><>ਭ<EFBFBD> <20>ᥣ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
mov eax,ted_wnd_l
|
||||
sub ted_wnd_w,eax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><E1ABA5>
|
||||
movzx eax,word[esi+sb_offs_size_x]
|
||||
sub ted_wnd_w,eax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><>ਭ<EFBFBD> <20><><EFBFBD><EFBFBD>. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
m2m ted_wnd_h,[procinfo.client_box.height] ;<3B>⠢<EFBFBD><E2A0A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠢ<><E0A0A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᥣ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
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 ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ਧ. <20><><EFBFBD><E0AEAB><EFBFBD><EFBFBD><EFBFBD>
|
||||
mov eax,ted_wnd_t
|
||||
sub ted_wnd_h,eax ;<3B>⭨<EFBFBD><E2ADA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᢥ<><E1A2A5><EFBFBD>
|
||||
|
||||
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 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ﭨ<EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
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 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>᪫<EFBFBD><E1AAAB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall SF_GET_KEY
|
||||
stdcall [tl_key],tree1
|
||||
|
||||
test word [edit1.flags],10b;ed_focus ; <20> <20><> <20> 䮪<><E4AEAA><EFBFBD>, <20><>室<EFBFBD><E5AEA4>
|
||||
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 ;<3B><>室 <20><> <20>ணࠬ<E0AEA3><E0A0AC>
|
||||
|
||||
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:
|
||||
; <20>㭪<EFBFBD><E3ADAA><EFBFBD> <20><><EFBFBD>뢠<EFBFBD><EBA2A0><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>⨨ 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
|
||||
|
||||
;ᮧ<><E1AEA7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
||||
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
|
||||
|
||||
;<3B><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 䮪<><E4AEAA><EFBFBD>
|
||||
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 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
conv_tabl rb 128 ; ⠡<><E2A0A1><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD><EFBFBD> scan-<2D><><EFBFBD><EFBFBD> <20> ascii-<2D><><EFBFBD>
|
||||
|
||||
txt_load_f db '<27><><EFBFBD><EFBFBD>. 䠩<>',0
|
||||
txt_save_f db '<27><><EFBFBD><EFBFBD>. 䠩<>',0
|
||||
txt_inp_file db '<27><><EFBFBD>. 䠩<>:',0
|
||||
txt_out_file db '<27><><EFBFBD>. 䠩<>:',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
|
||||
;
|
||||
|
||||
;
|
||||
; MyKey. Version 0.2.
|
||||
;
|
||||
@@ -26,7 +29,7 @@ include 'string.inc'
|
||||
include '../../../macros.inc'
|
||||
include 'ASPAPI.INC'
|
||||
;include 'editbox_ex.mac'
|
||||
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../../develop/libraries/box_lib/box_lib.mac'
|
||||
;include 'load_lib.mac'
|
||||
include '../../../develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../../dll.inc'
|
||||
|
@@ -1,3 +1,7 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
|
||||
;-----------------------;
|
||||
; CPU - process manager ;
|
||||
;-----------------------;
|
||||
@@ -18,7 +22,7 @@
|
||||
;-------------------------------------------------------------------------------
|
||||
include "lang.inc" ; Language support for locales (UTF-8): de_DE, et_EE, ru_RU, it_IT, en_US.
|
||||
include "../../../macros.inc"
|
||||
include "../../../develop/libraries/box_lib/trunk/box_lib.mac"
|
||||
include "../../../develop/libraries/box_lib/box_lib.mac"
|
||||
include "../../../KOSfuncs.inc"
|
||||
include "../../../load_lib.mac"
|
||||
;-------------------------------------------------------------------------------
|
||||
|
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
; Formatting Disk Utility ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
@@ -46,7 +52,7 @@ include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../KOSfuncs.inc'
|
||||
include '../../dll.inc'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac' ;for uses checkBox and editBox
|
||||
include '../../develop/libraries/box_lib/box_lib.mac' ;for uses checkBox and editBox
|
||||
include '../../load_lib.mac'
|
||||
@use_library
|
||||
|
||||
@@ -61,7 +67,7 @@ START:
|
||||
stdcall [OpenDialog_Init],OpenDialog_data
|
||||
|
||||
;set mask for events:
|
||||
;<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
;ᮮ<EFBFBD>饭<EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><>।<EFBFBD><EFBFBD><EFBFBD> ࠭<><E0A0AD>, ᮡ<>⨥ <20><> <20><><EFBFBD><EFBFBD> (<28><><EFBFBD>-<2D><> <20><><EFBFBD>稫<EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD>⨥ <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>६<EFBFBD>饭<EFBFBD><EFBFBD>; <20><><EFBFBD><EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>⥭<EFBFBD><EFBFBD>)
|
||||
mcall SF_SET_EVENTS_MASK, 0x27
|
||||
|
||||
mov ecx,[sc.work_text]
|
||||
|
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
ICON_STRIP equ '/sys/icons32.png'
|
||||
ICON_INI equ '/sys/settings/icon.ini'
|
||||
ICON_SIZE equ 68 ;ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@ -38,7 +44,7 @@ BegData equ fiStdIco.point
|
||||
include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US.
|
||||
include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../develop/libraries/box_lib/box_lib.mac'
|
||||
include '../../dll.inc'
|
||||
include '../../debug.inc'
|
||||
|
||||
|
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page Windows 1251 - Cyrillic
|
||||
|
||||
|
||||
; Keyboard indicators v0.2
|
||||
; by Albom and IgorA
|
||||
|
||||
@@ -15,7 +21,7 @@ use32
|
||||
include '../../macros.inc'
|
||||
include '../../proc32.inc'
|
||||
include '../../develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
||||
include '../../develop/libraries/box_lib/box_lib.mac'
|
||||
;include 'mem.inc'
|
||||
;include 'dll.inc'
|
||||
include 'lang.inc' ; Language support for locales: it_IT, en_US.
|
||||
|
@@ -1,3 +1,9 @@
|
||||
; SPDX-License-Identifier: NOASSERTION
|
||||
;
|
||||
|
||||
; Text encoded with Code Page 866 - Cyrillic
|
||||
|
||||
|
||||
DEBUG = 0
|
||||
|
||||
LIST_WIDTH = 256
|
||||
@@ -18,7 +24,7 @@ M01header.params:
|
||||
include "../../macros.inc"
|
||||
include "../../dll.inc"
|
||||
include "../../string.inc"
|
||||
include "../../develop/libraries/box_lib/trunk/box_lib.mac"
|
||||
include "../../develop/libraries/box_lib/box_lib.mac"
|
||||
|
||||
include "lang.inc" ; Language support for locales: ru_RU (CP866), et_EE, it_IT, en_US.
|
||||
|
||||
|