From 2aad33c4e527db65832c85f08dffed942c195017 Mon Sep 17 00:00:00 2001 From: IgorA Date: Sat, 9 Jan 2010 22:01:26 +0000 Subject: [PATCH] deleted file 'editbox_ex.mac' all programs git-svn-id: svn://kolibrios.org@1373 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../branches/net/applications/tftpc/TFTP.asm | 2 +- .../net/applications/tftpc/editbox_ex.mac | 77 - programs/develop/fasm/trunk/fasm.asm | 6 +- .../develop/libraries/box_lib/!readme.txt | 2 +- .../libraries/box_lib/asm/trunk/OpenDial.asm | 5348 ++++++++--------- .../box_lib/asm/trunk/editbox_ex.asm | 188 +- .../box_lib/asm/trunk/editbox_ex.mac | 21 - .../libraries/box_lib/trunk/checkbox.mac | 42 +- .../libraries/box_lib/trunk/doc/box_lib.htm | 71 + .../trunk/doc/editbox/info_editbox.htm | 109 + .../box_lib/trunk/tree_list_doc/info_size.png | Bin 9682 -> 0 bytes .../trunk/tree_list_doc/info_treelist.htm | 271 - .../trunk/tree_list_doc/window_tree_list.png | Bin 10961 -> 0 bytes .../libraries/fontslib/trunk/font_ex.asm | 226 +- programs/media/scrshoot/scrshoot.asm | 828 +-- programs/system/cpu/trunk/cpu.asm | 236 +- programs/system/rdsave/trunk/rdsave.asm | 296 +- programs/system/run/trunk/run.asm | 379 +- 18 files changed, 3964 insertions(+), 4138 deletions(-) delete mode 100644 kernel/branches/net/applications/tftpc/editbox_ex.mac delete mode 100644 programs/develop/libraries/box_lib/asm/trunk/editbox_ex.mac create mode 100644 programs/develop/libraries/box_lib/trunk/doc/box_lib.htm create mode 100644 programs/develop/libraries/box_lib/trunk/doc/editbox/info_editbox.htm delete mode 100644 programs/develop/libraries/box_lib/trunk/tree_list_doc/info_size.png delete mode 100644 programs/develop/libraries/box_lib/trunk/tree_list_doc/info_treelist.htm delete mode 100644 programs/develop/libraries/box_lib/trunk/tree_list_doc/window_tree_list.png diff --git a/kernel/branches/net/applications/tftpc/TFTP.asm b/kernel/branches/net/applications/tftpc/TFTP.asm index 924ab0b7d8..d23fc45bd1 100644 --- a/kernel/branches/net/applications/tftpc/TFTP.asm +++ b/kernel/branches/net/applications/tftpc/TFTP.asm @@ -9,7 +9,7 @@ include '../proc32.inc' include '../macros.inc' include '../dll.inc' include '../libio.inc' -include 'editbox_ex.mac' +include '../../../../../programs/develop/libraries/box_lib/trunk/box_lib.mac' include '../network.inc' diff --git a/kernel/branches/net/applications/tftpc/editbox_ex.mac b/kernel/branches/net/applications/tftpc/editbox_ex.mac deleted file mode 100644 index e9200b74bc..0000000000 --- a/kernel/branches/net/applications/tftpc/editbox_ex.mac +++ /dev/null @@ -1,77 +0,0 @@ -ed_struc_size=72 -struc edit_box width,left,top,color,shift_color,focus_border_color,\ - blur_border_color,text_color,max,text,flags,size,pos -{ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;Bit mask from editbox -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -ed_figure_only= 1000000000000000b ;одни символы -ed_always_focus= 100000000000000b -ed_focus= 10b ;фокус приложения -ed_shift_on= 1000b ;если не установлен -значит впервые нажат shift,если был установлен, значит мы уже что - то делали удерживая shift -ed_shift_on_off=1111111111110111b -ed_shift= 100b ;включается при нажатии на shift т.е. если нажимаю -ed_shift_off= 1111111111111011b -ed_shift_bac= 10000b ;бит для очистки выделеного shift т.е. при установке говорит что есть выделение -ed_shift_bac_cl=1111111111101111b ;очистка при удалении выделения -ed_shift_cl= 1111111111100011b -ed_shift_mcl= 1111111111111011b -ed_left_fl= 100000b -ed_right_fl= 1111111111011111b -ed_offset_fl= 1000000b -ed_offset_cl= 1111111110111111b -ed_insert= 10000000b -ed_insert_cl= 1111111101111111b -ed_mouse_on = 100000000b -ed_mous_adn_b= 100011000b -ed_mouse_on_off=1111111011111111b -ed_height=14 ; высота - -.width dd width -.left dd left -.top dd top -.color dd color -.shift_color dd shift_color -.focus_border_color dd focus_border_color -.blur_border_color dd blur_border_color -.text_color dd text_color -.max dd max -.text dd text -.flags dd flags+0 -.size dd size+0 -.pos dd pos+0 -.offset dd 0 -.cl_curs_x dd 0 -.cl_curs_y dd 0 -.shift dd 0 -.shift_old dd 0 -} -struc check_box left,top,ch_text_margin,ch_size,color,border_color,text_color,text,ch_text_length,flags -{ ;структура параметров для чек бокса -ch_flag_en=10b -.left: dw left ;+0 ;положение по х -.top: dw top ;положение по у -.ch_text_margin: dd ch_text_margin ;расстояние от прямоугольника чек бокса до надписи -.ch_size: dd ch_size ;размер квадрата чек бокса, для примера 12 -.color: dd color ;цвет внутри чекбокса -.border_color: dd border_color ;цвет рамки -.text_color: dd text_color ;цвет надписи -.text: dd text ;адрес в коде программы где расположен текст -.ch_text_length: dd ch_text_length ;длинна строки с символами -.flags: dd flags+0 ; флаги -} -struc option_box point_gr,left,top,op_text_margin,op_size,color,border_color,text_color,text,op_text_length,flags -{ ;структура параметров для чек бокса -op_flag_en=10b -.option_group: dd point_gr -.left: dw left ;+0 ;положение по х -.top: dw top ;положение по у -.ch_text_margin: dd op_text_margin ;расстояние от прямоугольника чек бокса до надписи -.ch_size: dd op_size ;размер квадрата чек бокса, для примера 12 -.color: dd color ;цвет внутри чекбокса -.border_color: dd border_color ;цвет рамки -.text_color: dd text_color ;цвет надписи -.text: dd text ;адрес в коде программы где расположен текст -.ch_text_length: dd op_text_length ;длинна строки с символами -.flags: dd flags+0 ; флаги -} diff --git a/programs/develop/fasm/trunk/fasm.asm b/programs/develop/fasm/trunk/fasm.asm index 8431039a8a..5e8a6720ba 100644 --- a/programs/develop/fasm/trunk/fasm.asm +++ b/programs/develop/fasm/trunk/fasm.asm @@ -36,9 +36,9 @@ include '..\..\..\macros.inc' purge add,sub ; macros.inc does incorrect substitution include 'fasm.inc' -include '..\..\..\develop\libraries\box_lib\trunk\editbox.mac' -include '..\..\..\develop\libraries\box_lib\trunk\checkbox.mac' -;include '..\..\..\develop\libraries\box_lib\asm\trunk\editbox_ex.mac' +include '..\..\..\develop\libraries\box_lib\trunk\box_lib.mac' +;include '..\..\..\develop\libraries\box_lib\trunk\editbox.mac' +;include '..\..\..\develop\libraries\box_lib\trunk\checkbox.mac' include '..\..\..\develop\libraries\box_lib\load_lib.mac' @use_library diff --git a/programs/develop/libraries/box_lib/!readme.txt b/programs/develop/libraries/box_lib/!readme.txt index 6461c8ad11..dded8abe37 100644 --- a/programs/develop/libraries/box_lib/!readme.txt +++ b/programs/develop/libraries/box_lib/!readme.txt @@ -221,7 +221,7 @@ use32 ; dd 0x0 ; єърчрЄхы№ эр ёЄЁюъє ё ярЁрьхЄЁрьш. dd cur_dir_path include 'macros.inc' -include 'editbox_ex.mac' +include 'box_lib.mac' include 'load_lib.mac' @use_library ;use load lib macros start: diff --git a/programs/develop/libraries/box_lib/asm/trunk/OpenDial.asm b/programs/develop/libraries/box_lib/asm/trunk/OpenDial.asm index a353f4108b..6b10f0e041 100644 --- a/programs/develop/libraries/box_lib/asm/trunk/OpenDial.asm +++ b/programs/develop/libraries/box_lib/asm/trunk/OpenDial.asm @@ -1,2674 +1,2674 @@ -;***************************************************************************** -; Open Dialog - for Kolibri OS -; 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 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 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. -;***************************************************************************** - -use32 -org 0x0 - -db 'MENUET01' -dd 0x01 -dd START -dd IM_END -dd I_END -dd stacktop -dd param -dd path - -include '../../../../../macros.inc' -include '../../load_lib.mac' -include 'editbox_ex.mac' -;include 'macros.inc' -;include 'load_lib.mac' -@use_library -;--------------------------------------------------------------------- -;--------------------------------------------------------------------- -START: - mcall 68,11 - mcall 66,1,1 - mcall 40,0x27 - call get_active_pocess - - call get_communication_area - - - load_libraries l_libs_start,end_l_libs - test eax,eax - jnz button.exit -; initialize sort - push dword 1 - call dword [sort_init] -; unpack deflate - mov eax,[unpack_DeflateUnpack2] - mov [deflate_unpack],eax - - call load_root_directory - call load_start_directory - call sort_directory - call load_icons - call convert_icons - call load_ini - call calc_ini -;--------------------------------------------------------------------- -red: - call control_minimal_window_size -red_1: - 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 -;--------------------------------------------------------------------- -control_minimal_window_size: - pusha - call get_window_param - test [window_status],10b - jnz .end ;red_1 - test [window_status],100b - jnz .end ;red_1 - test [window_status],1b - jnz .end ;red_1 - mov esi,-1 - mov eax,procinfo - mov eax,[eax+66] - cmp eax,200 - jae @f - mov esi,200 - mcall 67,-1,ebx,ebx -@@: - mov edx,-1 - mov eax,procinfo - mov eax,[eax+62] - cmp eax,300 - jae @f - mov edx,300 - mcall 67,-1,ebx, ,ebx -@@: -.end: - popa - ret -;--------------------------------------------------------------------- -key: - mov al,[focus_pointer] - test al,al - jne key_ASCII - mcall 2 - xor ebx,ebx - cmp [extended_key],1 - je .extended_key - test al, al - jnz still - cmp ah, 0xE0 - jne @f - mov [extended_key],1 - jmp still -@@: - cmp ah,72 ; arrow up - je .2 - cmp ah,80 ; arrow down - je .1 - cmp ah,28 ; Enter - je .7 - cmp ah,1 ; Esc - je button.exit - cmp ah,14 ; Backspace - je button.exit_dir - cmp ah,187 ; F1 - je select_disk - cmp ah,188 ; F2 - je select_sort - cmp ah,189 ; F3 - je select_filter - cmp ah,19 ; R - je button.reload_dir - cmp ah,42 - je key_shift_up - cmp ah,54 - je key_shift_up - cmp ah,170 - je key_shift_down - cmp ah,182 - je key_shift_down - cmp ah,29 - je key_ctrl_up - cmp ah,157 - je key_ctrl_down - cmp ah,56 - je key_alt_up - cmp ah,184 - je key_alt_down - cmp ah,206 ; NumPad+ Up - je NumPad_plus_Up - cmp ah,202 ; NumPad- Up - je NumPad_minus_Up - cmp ah,183 ; NumPad* Up - je NumPad_invert_Up - cmp ah,158 - je symbol_a_up - cmp ah,15 ; Tab down - je change_focus_area_press_Tab_key - cmp ah,143 ; Tab up - je change_focus_area_check_Tab_key - jmp still -.extended_key: - mov [extended_key],0 - cmp ah,80 ; arrow down - je .1 - cmp ah,72 ; arrow up - je .2 - cmp ah,81 ; PageDown - je .3 - cmp ah,73 ; PageUp - je .4 - cmp ah,71 ; Home - je .5 - cmp ah,79 ; End - je .6 - cmp ah,28 ; Enter - je .7 - cmp ah,82 ; Insert - je .8 - - cmp ah,29 - je key_ctrl_up - cmp ah,157 - je key_ctrl_down - cmp ah,56 - je key_alt_up - cmp ah,184 - je key_alt_down - jmp still -;--------------------------------- -.11: - inc ebx ; 11 -;--------------------------------- -.10: - inc ebx ; 10 -;--------------------------------- -.9: - inc ebx ; 9 -;--------------------------------- -.8: - inc ebx ; 8 -;--------------------------------- -.7: - inc ebx ; 7 -;--------------------------------- -.6: - inc ebx ; 6 -;--------------------------------- -.5: - inc ebx ; 5 -;--------------------------------- -.4: - inc ebx ; 4 -;--------------------------------- -.3: - inc ebx ; 3 -;--------------------------------- -.2: - inc ebx ; 2 -;--------------------------------- -.1: - inc ebx ; 1 -;--------------------------------- - call .key_action - -; movzx ecx,word [file_browser_data_1.start_draw_cursor_line] -; mcall 47,0x80000,,<50,0>,0x40000000,0xffffff -; movzx ecx,word [file_browser_data_1.size_y] -; mcall 47,0x80000,,<150,0>,0x40000000,0xffffff - - mov eax,file_browser_data_1.mouse_keys_delta - cmp [eax],dword 3 - jne still - xor ebx,ebx - mov [eax],ebx - call load_next_dir - jmp still -;------------------------------------------------------- -.key_action: - mov [file_browser_data_1.key_action],ebx - - push dword file_browser_data_1 - call [FileBrowser_key] - - cmp [file_browser_data_1.draw_scroll_bar],0 - je @f - call draw_scrollbar1 - mov [file_browser_data_1.draw_scroll_bar],0 -@@: - ret -;--------------------------------------------------------------------- -change_focus_area_Tab_key_ASCII: - xor eax,eax - inc eax - mov [Tab_key_block],al - jmp change_focus_area -;--------------------------------------------------------------------- -change_focus_area_press_Tab_key: - mov al,[Tab_key_block] - test al,al - jnz still - xor eax,eax - inc eax - mov [Tab_key],al - jmp still -;--------------------------------------------------------------------- -change_focus_area_check_Tab_key: - xor eax,eax - mov [Tab_key_block],al - mov al,[Tab_key] - test al,al - jz still - xor eax,eax - mov [Tab_key],al -;--------------------------------------------------------------------- -change_focus_area: - mov al,[focus_pointer] - inc al - and al,1 - mov [focus_pointer],al -.1: - mov edi,edit1 - test al,al - jne @f - mov [file_browser_data_1.select_panel_counter],1 - and [edi+44],dword 0xFFFFFFFD ; ed_focus - mov [edi+12],dword 0xffffff; color white - call draw_draw_file_browser1 - mcall 66, 1, 1 - jmp still -@@: - mov [file_browser_data_1.select_panel_counter],0 - or [edi+44],dword ed_focus - mov [edi+12],dword 0xffffb0 ; color yellow - call draw_draw_file_browser1 - mcall 66, 1, 0 - jmp still -;--------------------------------------------------------------------- -key_ASCII: - mcall 2 - cmp ah,9 - je change_focus_area_Tab_key_ASCII - cmp ah,13 - je .load_dir - cmp ah,27 - je button.exit - push dword name_editboxes - call [edit_box_key] - jmp still -.load_dir: - mov [file_browser_data_1.select_panel_counter],1 - xor eax,eax - mov [focus_pointer],al - mcall 66, 1, 1 - - xor eax,eax - mov esi,dir_pach - cld -@@: - lodsb - test al,al - jne @r - sub esi,2 - cmp [esi],byte '/' - jne @f - xor eax,eax - mov [esi],al -@@: - call load_next_dir.1 - jmp still -;--------------------------------------------------------------------- -select_disk: - call check_alt -.1: - xor eax,eax - mov [menu_data_1.ret_key],eax - - push dword menu_data_1 - call [menu_bar_activate] - - call clear_control_key_flag - - mov eax,[menu_data_1.ret_key] - mov [menu_data_1.ret_key],dword 0 - cmp eax,1 - je select_filter.1 - - cmp eax,2 - je select_sort.1 - - cmp [menu_data_1.click],dword 1 - jne still - - cmp [menu_data_1.cursor_out],dword 0 - jne analyse_out_menu_1 - jmp still -;--------------------------------------------------------------------- -select_sort: - call check_alt -.1: - xor eax,eax - mov [menu_data_2.ret_key],eax - - push dword menu_data_2 - call [menu_bar_activate] - - call clear_control_key_flag - - mov eax,[menu_data_2.ret_key] - mov [menu_data_2.ret_key],dword 0 - cmp eax,1 - je select_disk.1 - - cmp eax,2 - je select_filter.1 - - - cmp [menu_data_2.click],dword 1 - jne still - - cmp [menu_data_2.cursor_out],dword 0 - jne analyse_out_menu_2 - jmp still -;--------------------------------------------------------------------- -select_filter: - call check_alt -.1: - xor eax,eax - mov [menu_data_3.ret_key],eax - - push dword menu_data_3 - call [menu_bar_activate] - - call clear_control_key_flag - - mov eax,[menu_data_3.ret_key] - mov [menu_data_3.ret_key],dword 0 - cmp eax,1 - je select_sort.1 - - cmp eax,2 - je select_disk.1 - - - cmp [menu_data_3.click],dword 1 - jne still - - cmp [menu_data_3.cursor_out],dword 0 - jne analyse_out_menu_3 - jmp still -;--------------------------------------------------------------------- -symbol_a_up: -NumPad_plus_Up: - call check_ctrl - jmp key.9 -;--------------------------------------- -NumPad_minus_Up: - call check_ctrl - jmp key.10 -;--------------------------------------- -NumPad_invert_Up: - call check_ctrl - jmp key.11 -;--------------------------------------- -check_alt: - xor eax,eax - mov al,[alt_flag] - test eax,eax - jz @f - xor ebx,ebx - ret -@@: - add esp,4 - jmp still -;--------------------------------------- -check_ctrl: - xor eax,eax - mov al,[ctrl_flag] - test eax,eax - jz @f - xor ebx,ebx - ret -@@: - add esp,4 - jmp still -;--------------------------------------------------------------------- -clear_control_key_flag: - xor eax,eax - mov [shift_flag],al - mov [ctrl_flag],al - mov [alt_flag],al - ret -;--------------------------------------------------------------------- -key_shift_up: - mov [shift_flag],1 - jmp still -;--------------------------------------------------------------------- -key_shift_down: - mov [shift_flag],0 - jmp still -;--------------------------------------------------------------------- -key_ctrl_up: - mov [ctrl_flag],1 - jmp still -;--------------------------------------------------------------------- -key_ctrl_down: - mov [ctrl_flag],0 - jmp still -;--------------------------------------------------------------------- -key_alt_up: - mov [alt_flag],1 - jmp still -;--------------------------------------------------------------------- -key_alt_down: - mov [alt_flag],0 - jmp still -;--------------------------------------------------------------------- -button: - mcall 17 - cmp ah,6 - je .reload_dir_1 - cmp ah,4 - je .exit - cmp ah,3 - je .open_dir_or_file - cmp ah,2 - je .exit_dir - cmp ah, 1 - jne still -.exit: - mov eax,[communication_area] - test eax,eax - jz @f - cmp [eax],dword 1 - je @f - mov [eax],dword 3 -@@: - mov eax,[N_error] - test eax,eax - jz @f - call start_error_window_thread -@@: - mcall -1 -;--------------------------------------------------------------------- -.reload_dir: - call check_ctrl -.reload_dir_1: - call load_next_dir.1 - jmp still -;--------------------------------------------------------------------- -.exit_dir: - call load_next_dir.exit_dir - jmp still -;--------------------------------------------------------------------- -.open_dir_or_file: - xor ebx,ebx - jmp key.7 -;--------------------------------------------------------------------- -thread_start: - mov eax,[N_error] - cmp al,1 - jne @f - mov [N_error],load_ini_error_type - mov [error_path],file_name - jmp .error_type -@@: - cmp al,2 - jne @f - mov [N_error],load_icons_error_type - mov [error_path],file_name - jmp .error_type -@@: - cmp al,3 - jne @f - mov [N_error],memory_free_error_type - xor eax,eax - mov [error_path],eax - mov [error_type],eax - jmp .red -@@: - cmp al,4 - jne @f - mov [N_error],memory_get_error_type - xor eax,eax - mov [error_path],eax - mov [error_type],eax - jmp .red -@@: - cmp al,5 - jne @f - mov [N_error],load_directory_error_type - mov [error_path],dir_pach - jmp .error_type -@@: - cmp al,6 - jne .button - mov [N_error],convert_icons_error_type - mov [error_path],file_name - xor eax,eax - mov [error_type],eax - jmp .red -.error_type: - mov eax,[error_type] - shl eax,2 - add eax,error_fs_text_pointers - mov eax,[eax] - mov [error_type],eax -.red: - call draw_error_window -.still: - mcall 10 - cmp eax,1 - je .red - cmp eax,2 - je .key - cmp eax,3 - je .button - jmp .still -.key: - mcall 2 - jmp .still -.button: - mcall -1 - jmp .still -;--------------------------------------------------------------------- -draw_error_window: - mcall 12, 1 - mcall 0,[error_window_x] ,[error_window_y], 0x03ff0000 - mcall 71,1,title - mcall 4,<10,30>,0x90ffffff,[N_error] - mov eax,[error_path] - test eax,eax - jz @f - mcall 4,<10,50>, ,[error_path] -@@: - mov eax,[error_type] - test eax,eax - jz @f - mcall 4,<10,70>, ,[error_type] -@@: - mcall 12, 2 - ret -;--------------------------------------------------------------------- -start_error_window_thread: - mcall 9, procinfo, -1 - mov eax,[ebx+46] - shr eax,1 - add eax,[ebx+38] - sub eax,40 - mov [error_window_y+2],ax - mov eax,[ebx+42] - shr eax,1 - add eax,[ebx+34] - sub eax,125 - mov [error_window_x+2],ax - mcall 51,1,thread_start,thread_stack - ret -;--------------------------------------------------------------------- -mouse: - mcall 18,7 - cmp [active_process],eax - jne still - - mcall 37,7 - mov [mouse_scroll_data],eax - - mcall 37,1 - mov [mouse_position],eax - - cmp [scroll_bar_data_vertical.delta2],0 - jne .scrollbar - - mov [file_browser_data_1.select_flag],0 - - push dword file_browser_data_1 - call [FileBrowser_mouse] - - mov eax,file_browser_data_1.mouse_keys_delta - cmp [eax],dword 3 - jne .check_focus ;.scrollbar - mov [eax],dword 0 - call load_next_dir - jmp still -;--------------------------------------------------- -.check_focus: - mov ebx,[file_browser_data_1.select_flag] - test ebx,ebx - jz .scrollbar ;@f - mov al,[focus_pointer] - test al,al - jz .scrollbar - xor eax,eax - mov [focus_pointer],al - jmp change_focus_area.1 -;--------------------------------------------------- -.scrollbar: - mov eax,[scroll_bar_data_vertical.max_area] - cmp eax,[scroll_bar_data_vertical.cur_area] - jbe .menu_bar ;still - - push dword scroll_bar_data_vertical - call [scrollbar_ver_mouse] - - cmp [scroll_bar_data_vertical.redraw],0 - je .menu_bar ;still - mov [scroll_bar_data_vertical.redraw],0 -.draw: - call draw_draw_file_browser2 - jmp still - -;--------------------------------------------------- -.menu_bar: - cmp [scroll_bar_data_vertical.delta2],0 - jne still - -.menu_bar_1: - call .set_mouse_flag -@@: - 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: - push dword menu_data_2 - call [menu_bar_mouse] - - cmp [menu_data_2.click],dword 1 - jne .menu_bar_3 - - cmp [menu_data_2.cursor_out],dword 0 - jne analyse_out_menu_2 - jmp .menu_bar_1 -;--------------------------------------------------- -.menu_bar_3: - push dword menu_data_3 - call [menu_bar_mouse] - - cmp [menu_data_3.click],dword 1 - jne .check_editboxes - - cmp [menu_data_3.cursor_out],dword 0 - jne analyse_out_menu_3 - jmp .menu_bar_1 -;--------------------------------------------------- -.check_editboxes: - mov eax,[edit1+44] - and eax,10b - push dword name_editboxes - call [edit_box_mouse] - mov ebx,[edit1+44] - and ebx,10b - cmp eax,ebx - je .check_scroll_event - mov al,[focus_pointer] - test al,al - jnz .check_scroll_event - xor eax,eax - test ebx,10b - jz @f - inc eax -@@: - mov [focus_pointer],al - jmp change_focus_area.1 -;--------------------------------------------------- -.check_scroll_event: - mov eax,[mouse_position] - xor ebx,ebx - mov bx,ax ; EBX mouse y - shr eax,16 ; EAX mouse x - - mov cx,[file_browser_data_1.start_x] - mov dx,[file_browser_data_1.start_y] - - cmp ax,cx - jb .mouse_next ; min x - - cmp bx,dx - jb .mouse_next ; min y - - add cx,[file_browser_data_1.size_x] - cmp ax,cx - ja .mouse_next ; max x - - add dx,[file_browser_data_1.size_y] - cmp bx,dx - ja .mouse_next ; max y - - xor ecx,ecx - xor ebx,ebx - mov eax,[mouse_scroll_data] - test eax,eax - jz .mouse_next - test ax,0x8000 - jnz .decr - shr eax,16 - test ax,0x8000 - jnz .decr_1 - - mov cx,[mouse_scroll_data.vertical] - test ecx,ecx - jnz @f - mov cx,[mouse_scroll_data.horizontal] - test ecx,ecx - jz .mouse_next -@@: - mov ebx,1 -@@: - push ebx ecx - call key.key_action - pop ecx ebx - dec ecx - jnz @r - jmp still -;---------------------------------------- -.decr: - mov bx,[mouse_scroll_data.vertical] - jmp @f -.decr_1: - mov bx,[mouse_scroll_data.horizontal] -@@: - mov ecx,0xffff - sub ecx,ebx - inc ecx - mov ebx,2 -@@: - push ebx ecx - call key.key_action - pop ecx ebx - dec ecx - jnz @r - jmp still -;--------------------------------------------------- -.mouse_next: - jmp still -;--------------------------------------------------------------------- -.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: -; Available disks - mov eax,[menu_data_1.cursor_out] - dec eax - imul esi,eax,10 - add esi,retrieved_devices_table - mov edi,dir_pach - call copy_dir_name - call load_next_dir.1 - jmp still -;--------------------------------------------------------------------- -analyse_out_menu_2: -; Sort - mov eax,[menu_data_2.cursor_out] - xor ebx,ebx - cmp eax,dword 1 - je .1 - cmp eax,dword 2 - je .2 - cmp eax,dword 3 - je .3 - cmp eax,dword 4 - je .4 - jmp still -.4: - add ebx,2 -.3: - add ebx,2 -.2: - add ebx,2 -.1: - mov [sort_type],ebx - call sort_directory - call draw_draw_file_browser1 - jmp still -;--------------------------------------------------------------------- -analyse_out_menu_3: -; Filter - mov eax,[menu_data_3.cursor_out] - cmp eax,dword 1 - jne @f - mov [filter_flag],0 - call load_next_dir.1 - jmp still -@@: - cmp eax,dword 2 - jne still - mov [filter_flag],1 - call load_next_dir.1 - jmp still -;--------------------------------------------------------------------- -get_communication_area: - xor eax,eax - mov al,[param] - test eax,eax - jz @f - mcall 68,22,param,,0x01 - mov [communication_area],eax -@@: - ret -;--------------------------------------------------------------------- -load_start_directory: - mov eax,[communication_area] - test eax,eax - jz @f - mov ebx,[eax] - test eax,eax - jz @f - add eax,4 - mov esi,eax - jmp .1 -@@: - mov esi,start_pach -.1: - mov edi,dir_pach - call copy_dir_name - call load_directory - mov eax,[N_error] - test eax,eax - jnz button.exit - ret -;--------------------------------------------------------------------- -load_next_dir: - mov ebx,[file_browser_data_1.selected_BDVK_adress] - add ebx,40 - test [ebx-40],byte 0x10 - jz file_no_folder - cmp [ebx],word '..' - jne @f - cmp [ebx+2],byte 0 - je .exit_dir -@@: - mov esi,dir_pach - call copy_dir_path - -@@: -.1: - call load_directory - mov eax,[N_error] - test eax,eax - jz @f - call error_handler - jmp .1 -@@: - call sort_directory - - mov ebx,[scroll_bar_data_vertical.x] - inc ebx - mov ecx,[scroll_bar_data_vertical.y] - inc ecx - mcall 13,,,0xcccccc - mov edi,edit1 - xor eax,eax - mov [edi+44],eax - mov [edi+12],dword 0xffffff ; color white - call draw_draw_file_browser1 - ret -.exit_dir: - mov esi,dir_pach - call copy_exit_dir - jmp .1 -;--------------------------------------------------------------------- -error_handler: -.red: - call .draw_window -;------------------------------------ -.still: - mcall 10 - cmp eax,1 - je .red - cmp eax,2 - je .key - cmp eax,3 - je .button - jmp .still -;------------------------------------ -.draw_window: - xor eax,eax - inc eax - mov [error_window],al - call control_minimal_window_size - call draw_window - xor eax,eax - mov [error_window],al - ret -;------------------------------------ -.key: - mcall 2 - xor ebx,ebx - cmp [extended_key],1 - je .extended_key - test al, al - jnz .still - cmp ah, 0xE0 - jne @f - mov [extended_key],1 - jmp .still -@@: - cmp ah,129 ; Esc - je .exit - jmp .still -.extended_key: - jmp .still -;------------------------------------ -.button: - mcall 17 - cmp ah,5 - je .exit - cmp ah, 1 - jne .still - xor eax,eax - mov [N_error],eax - jmp button.exit -;------------------------------------ -.exit: - mov esi,start_pach - mov edi,dir_pach - call copy_dir_name - ret -;--------------------------------------------------------------------- -file_no_folder: - mov esi,dir_pach - mov edi,file_name - call copy_dir_name - - mov esi,file_name - call copy_dir_path - - mov eax,[communication_area] - test eax,eax - jnz @f - call control_minimal_window_size - call draw_window - ret -@@: - mov edi,eax - add edi,4 - mov esi,file_name - call copy_dir_name - mov eax,[communication_area] - mov [eax],dword 1 - jmp button.exit -;--------------------------------------------------------------------- -load_root_directory: - mov esi,root_pach - mov edi,dir_pach - call copy_dir_name - call load_directory - mov eax,[N_error] - test eax,eax - jnz button.exit - - mov eax,[dirinfo.return] - mov [root_folder_area],eax - mov eax,[eax+4] - mov [root_folder_block],eax - - xor eax,eax - mov [dirinfo.return],eax - mov [file_browser_data_1.folder_data],eax - mov [temp_counter_1],eax ;0 - - mov [retrieved_devices_table_counter],eax ;0 -.start_temp_counter_1: - imul esi,[temp_counter_1],304 - add esi,[root_folder_area] - add esi,32+40 - mov edi,dir_pach+1 - mov [edi-1],byte '/' - call copy_dir_name - call load_directory - mov eax,[N_error] - test eax,eax - jnz button.exit - - mov eax,[dirinfo.return] - mov [root1_folder_area],eax - mov eax,[eax+4] - test eax,eax - jz .continue - mov [root1_folder_block],eax - - mov ebp,0 -.start_copy_device_patch: - imul edi,[retrieved_devices_table_counter],10 - add edi,retrieved_devices_table - mov [edi],byte '/' - inc edi - imul esi,[temp_counter_1],304 - add esi,[root_folder_area] - add esi,32+40 - - call copy_dir_name - - imul esi,ebp,304 - add esi,[root1_folder_area] - add esi,32+40 - mov [edi-1],byte '/' - - call copy_dir_name - - inc [retrieved_devices_table_counter] - inc ebp - cmp ebp,[root1_folder_block] - jb .start_copy_device_patch -.continue: - inc [temp_counter_1] - mov eax,[temp_counter_1] - cmp eax,[root_folder_block] - jb .start_temp_counter_1 - - cmp [root_folder_area],dword 0 - je @f - mcall 68, 13, [root_folder_area] - test eax,eax - jz memory_free_error -@@: - - xor ecx,ecx - mov edi,menu_text_area_1_1 ;.1 -@@: - imul esi,ecx,10 - add esi,retrieved_devices_table - call copy_dir_name - inc ecx - cmp ecx,[retrieved_devices_table_counter] - jb @b - mov [menu_data_1.text_end],edi - xor eax,eax - mov [edi],eax - ret -;--------------------------------------------------------------------- -memory_free_error: - mov [N_error],3 - jmp button.exit -;--------------------------------------------------------------------- -memory_get_error: - mov [N_error],4 - jmp button.exit -;--------------------------------------------------------------------- -draw_window: - - mcall 12,1 - - mcall 0,<10,420>,<10,320>,0x63AABBCC, - -; mov ecx,[communication_area] -; add ecx,4096+4+4 - - mcall 71,1, title ;;param ;file_name ;dir_pach - - call get_window_param - - mov eax,[window_high] - sub eax,25+45 - mov [file_browser_data_1.size_y],ax - mov [scroll_bar_data_vertical.size_y],ax - - mov eax,[window_width] - sub eax,10+20 - mov [file_browser_data_1.size_x],ax - add ax,10 - mov [scroll_bar_data_vertical.start_x],ax - - - mcall 13,[window_width],45,0xcccccc - - push ecx - rol ecx,16 - add cx,[file_browser_data_1.size_y] - add cx,45 - ror ecx,16 - mov cx,25 - mcall - pop ecx - add ecx,45 shl 16 - mov cx,[file_browser_data_1.size_y] - mov bx,10 - mcall - mov bx,[file_browser_data_1.size_x] - add bx,10 - shl ebx,16 - mov bx,20 - mcall - - cmp [error_window],0 - je @f - call draw_for_fs_errors - jmp .1 -@@: - call draw_draw_file_browser1 -.1: - push dword menu_data_1 - call [menu_bar_draw] - push dword menu_data_2 - call [menu_bar_draw] - push dword menu_data_3 - call [menu_bar_draw] - - mov ebx,[file_browser_data_1.x] - mov ax,bx - shl eax,16 - add ebx,eax - mov eax,50 - mov bx,ax - shl eax,16 - sub ebx,eax - mov ecx,26 shl 16+15 - - mcall 8,,,2,0xffffff - - pusha - shr ecx,16 - mov bx,cx - add ebx,20 shl 16+ 2 - mcall 4,,0x90000000,message_ExitDir_button - add ebx,4 - mcall - add ebx,4 - mcall - popa - - push ebx - sub ebx,70 shl 16 - mov bx,60 - mcall 8,,,6 - - shr ecx,16 - mov bx,cx - add ebx,5 shl 16+ 4 - mcall 4,,0x90000000,message_ReloadDir_button - pop ebx - - mov ebx,[file_browser_data_1.x] - - mov ax,bx - shl eax,16 - add ebx,eax - mov eax,55 - mov bx,ax - shl eax,16 - sub ebx,eax - - mov ecx,[file_browser_data_1.y] - mov ax,cx - add eax,3 - shl eax,16 - add ecx,eax - mov cx,15 - - mcall 8,,,3 - - pusha - shr ecx,16 - mov bx,cx - add ebx,12 shl 16+ 4 - mcall 4,,0x90000000,message_open_button - popa - - - sub ebx, 65 shl 16 - mcall 8,,,4 - - shr ecx,16 - mov bx,cx - add ebx,6 shl 16+ 4 - mcall 4,,0x90000000,message_cancel_button - - -; mcall 47,0x80000,[file_browser_data_1.ini_file_start],<250, 0>,0x0 -; mcall 4, <3, 420>, 0, fb_extension_start, 3 - mcall 12,2 - - ret -;--------------------------------------------------------------------- -draw_for_fs_errors: - call draw_dir_pach - - mov ebx,[file_browser_data_1.x] - mov ecx,[file_browser_data_1.y] - mcall 13,,,[file_browser_data_1.background_color] - push ebx ecx - add ebx,10 shl 16 - sub ebx,20 - add ecx,10 shl 16 - sub ecx,20 - mov edx,0xff0000 - mcall - - shr ecx,16 - mov bx,cx - add ebx,5 shl 16+15 - mcall 4,,0x90ffffff,load_directory_error_type - - add ebx,20 - mcall 4,,,dir_pach - - mov eax,[error_type] - shl eax,2 - add eax,error_fs_text_pointers - mov edx,[eax] - add ebx,20 - mcall 4 - - pop ecx ebx - - mov ebx,[file_browser_data_1.x] - mov ax,bx - shr eax,1 - shl eax,16 - add ebx,eax - mov eax,50 - mov bx,ax - shr eax,1 - shl eax,16 - sub ebx,eax - - mov ecx,[file_browser_data_1.y] - mov ax,cx - sub eax,40 - shl eax,16 - add ecx,eax - mov cx,15 - - mcall 8,,,5,0xffffff - - shr ecx,16 - mov bx,cx - add ebx,4 shl 16+ 4 - mcall 4,,0x90000000,message_cancel_button - - - ret -;--------------------------------------------------------------------- -draw_dir_pach: - mov esi,dir_pach - cld -@@: - lodsb - test al,al - jne @r - sub esi,dir_pach - mov eax,esi - dec eax - mov edi, edit1 - mov [edi+48], eax ;ed_size - mov [edi+52], eax ;ed_pos - - mov eax,[file_browser_data_1.x] - mov ebx,eax - shr ebx,16 - and eax,0xffff - - mov [edi],eax - mov [edi+4],ebx - - push dword name_editboxes - call [edit_box_draw] - ret - -draw_dir_pach_1: - mov ebx,[file_browser_data_1.x] - mcall 13,,<7,15>,0xffffb0 - mov bx,10 - add ebx,4 shl 16 - mcall 4,,0xC0000000,dir_pach,,0xffffb0 - ret -;--------------------------------------------------------------------- -draw_draw_file_browser1: - call draw_dir_pach - xor eax,eax - inc eax - mov [file_browser_data_1.all_redraw],eax - mov [scroll_bar_data_vertical.all_redraw],eax - - push dword file_browser_data_1 - call [FileBrowser_draw] - - - call prepare_scrollbar_data - - call draw_scrollbar - - xor eax,eax - mov [file_browser_data_1.all_redraw],eax - mov [scroll_bar_data_vertical.all_redraw],eax - ret -;--------------------------------------------------------------------- -draw_draw_file_browser2: - mov eax,2 - mov [file_browser_data_1.all_redraw],eax - - call get_scrollbar_data - - push dword file_browser_data_1 - call [FileBrowser_draw] - - xor eax,eax - mov [file_browser_data_1.all_redraw],eax - ret -;--------------------------------------------------------------------- -draw_scrollbar1: - mov eax,[file_browser_data_1.start_draw_line] - mov [scroll_bar_data_vertical.position],eax - - call draw_scrollbar - - ret -;--------------------------------------------------------------------- -draw_scrollbar: - mov eax,[scroll_bar_data_vertical.max_area] - cmp eax,[scroll_bar_data_vertical.cur_area] - jbe @f - cmp [scroll_bar_data_vertical.cur_area],0 - je @f - push dword scroll_bar_data_vertical - call [scrollbar_ver_draw] -@@: - ret -;--------------------------------------------------------------------- -get_scrollbar_data: - mov eax,[scroll_bar_data_vertical.position] - mov [file_browser_data_1.start_draw_line],eax - ret -;--------------------------------------------------------------------- -prepare_scrollbar_data: - mov eax,[file_browser_data_1.folder_block] - mov [scroll_bar_data_vertical.max_area],eax - mov eax,[file_browser_data_1.max_panel_line] - mov [scroll_bar_data_vertical.cur_area],eax - ret -;--------------------------------------------------------------------- -get_active_pocess: - mcall 9, procinfo, -1 - mov eax,[ebx+30] - mov [PID],eax - xor ecx,ecx -@@: - inc ecx - mcall 9, procinfo - mov eax,[PID] - cmp eax,[ebx+30] - jne @r - mov [active_process],ecx - ret -;--------------------------------------------------------------------- -get_window_param: - mcall 9, procinfo, -1 - mov eax,[ebx+66] - inc eax - mov [window_high],eax - mov eax,[ebx+62] - inc eax - mov [window_width],eax - mov eax,[ebx+70] - mov [window_status],eax - ret -;--------------------------------------------------------------------- -convert_icons: - xor eax,eax - mov [return_code],eax - mov eax,image_file - call [cnv_png_import.Start] - - mov ecx,[image_file] - mcall 68, 13, - test eax,eax - jz memory_free_error - - cmp [return_code],dword 0 - je @f - mov [N_error],6 - jmp button.exit -@@: - - mov ebx,[raw_pointer] - mov eax,[ebx+4] -; set of icon size x - mov [file_browser_data_1.icon_size_x],ax -; mov eax,[ebx+8] -; set of icon size y - mov [file_browser_data_1.icon_size_y],ax - inc ax - mov [file_browser_data_1.line_size_y],ax - mov eax,[ebx+12] -; set of RAW resolution to pixel - mov [file_browser_data_1.resolution_raw],eax - - mov eax,[ebx+20] - add eax,ebx -; set RAW palette, use else resolution 8bit or less - mov [file_browser_data_1.palette_raw],eax - - mov eax,[ebx+28] - add eax,ebx -; set RAW area for icon - mov [file_browser_data_1.icon_raw_area],eax - ret -;--------------------------------------------------------------------- -calc_ini: - mov eax,[image_file] - mov [file_browser_data_1.ini_file_start],eax - add eax,[img_size] - mov [file_browser_data_1.ini_file_end],eax - ret -;--------------------------------------------------------------------- -load_ini: - mov ebx,ini_file_name - mov esi,path - mov edi,file_name - call copy_file_path - - mov [fileinfo.subfunction],dword 5 - mov [fileinfo.size],dword 0 - mov [fileinfo.return],dword file_info - mcall 70, fileinfo - test eax,eax - jnz .error - - mov [fileinfo.subfunction],dword 0 - - mov ecx,[file_info+32] - mov [fileinfo.size],ecx - mov [img_size],ecx - - mcall 68, 12 - test eax,eax - jz memory_get_error - - mov [fileinfo.return],eax - mov [image_file],eax - - mcall 70, fileinfo - test eax,eax - jnz .error - ret -.error: - mov [N_error],1 - mov [error_type],eax - jmp button.exit -;--------------------------------------------------------------------- -load_icons: - mov ebx,icons_file_name_2 - mov esi,path - mov edi,file_name - call copy_file_path - - mov [fileinfo.subfunction],dword 5 - mov [fileinfo.size],dword 0 - mov [fileinfo.return],dword file_info - mcall 70, fileinfo - test eax,eax - jz @f - - mov ebx,icons_file_name - mov esi,path - mov edi,file_name - call copy_file_path - - mov [fileinfo.subfunction],dword 5 - mov [fileinfo.size],dword 0 - mov [fileinfo.return],dword file_info - mcall 70, fileinfo - test eax,eax - jnz .error -@@: - mov [fileinfo.subfunction],dword 0 - - mov ecx,[file_info+32] - mov [fileinfo.size],ecx - mov [img_size],ecx - - mcall 68, 12 - test eax,eax - jz memory_get_error - - mov [fileinfo.return],eax - mov [image_file],eax - - mcall 70, fileinfo - test eax,eax - jnz .error - ret -.error: - mov [N_error],2 - mov [error_type],eax - jmp button.exit -;--------------------------------------------------------------------- -sort_directory: - mov eax,[file_browser_data_1.folder_data] - mov ebx,[eax+4] ; number of files - add eax,32 - cmp [eax+40],word '..' - jne @f - cmp [eax+40+2],byte 0 - jne @f - dec ebx - add eax,304 -@@: - push dword [sort_type] ; sort mode - push ebx ; number of files - push eax ; data files - call [sort_dir] - ret -;-------------------------------------------------------------------- -load_directory: - xor eax,eax - mov [N_error],eax - cmp [file_browser_data_1.folder_data],eax - je @f - mcall 68, 13, [file_browser_data_1.folder_data] - test eax,eax - jz memory_free_error - -@@: - mov [dirinfo.size],dword 0 - mov [dirinfo.return],dir_header - mcall 70, dirinfo - test eax,eax - jz @f - xor ebx,ebx - mov [file_browser_data_1.folder_data],ebx - jmp .error -@@: - - mov ecx,[dir_header.totl_blocks] - mov [dirinfo.size],ecx - imul ecx,304 - add ecx,32 - mcall 68, 12 - test eax,eax - jz memory_get_error - - mov [dirinfo.return],eax - mov [file_browser_data_1.folder_data],eax - - mcall 70, dirinfo - test eax,eax - jnz .error - - call delete_point_dir - call files_name_normalize - call check_filter - call prepare_extension_and_mark - call clear_data_fb_and_sb - - ret - -.error: - mov [N_error],5 - mov [error_type],eax - ret -;--------------------------------------------------------------------- -clear_data_fb_and_sb: - xor eax,eax - mov [file_browser_data_1.start_draw_cursor_line],ax - mov [file_browser_data_1.start_draw_line],eax - mov [scroll_bar_data_vertical.position],eax - ret -;--------------------------------------------------------------------- -check_filter: - xor eax,eax - mov al,[filter_flag] - test eax,eax - jz @f - - mov eax,[communication_area] - test eax,eax - jz @f - mov eax,[eax+4096] - test eax,eax - jz @f - call delete_unsupported_BDFE -@@: - ret -;--------------------------------------------------------------------- -delete_unsupported_BDFE: - mov ebx,[file_browser_data_1.folder_data] - add ebx,4 - xor ecx,ecx - dec ecx - - mov eax,[file_browser_data_1.folder_data] - add eax,32+40 - sub eax,304 -.start: - inc ecx - add eax,304 -.1: - cmp [ebx],ecx - je .end - cmp [eax],byte '.' - jne @f - cmp [eax+1],byte 0 - je .delete -@@: - test [eax-40],byte 0x10 - jnz .start - - push eax ebx - mov esi,eax - call search_expansion - test eax,eax - pop ebx eax - jnz .delete - - push eax ebx ecx esi - mov edi,[communication_area] - add edi,4096+4 - call compare_expansion - test eax,eax - pop esi ecx ebx eax - jz .start - -;------------------------------------------- -.delete: - dec dword [ebx] - mov esi,[ebx] - sub esi,ecx - - push ecx - mov ecx,esi - imul ecx,304/4 - mov edi,eax - sub edi,40 - mov esi,edi - add esi,304 - cld - rep movsd - pop ecx - - jmp .1 -.end: - ret -;--------------------------------------------------------------------- -search_expansion: - mov edi,esi - xor eax,eax -@@: - cld - lodsb - test eax,eax - jnz @b - mov ebx,esi - dec esi -@@: - std - lodsb - cmp esi,edi - jb .end_err - cmp al,'.' - jne @b - - add esi,2 - sub ebx,esi - dec ebx - mov [expansion_length],ebx - cld - xor eax,eax - ret - -.end_err: - cld - xor eax,eax - inc eax - ret -;--------------------------------------------------------------------- -compare_expansion: - mov ebx,[edi] - add ebx,edi - add edi,3 -.start: - cmp ebx,edi - jb .end_err - mov ecx,[expansion_length] - inc edi - - push esi edi -@@: - cld - lodsb - xchg esi,edi - shl eax,8 - lodsb - xchg esi,edi - call char_todown - xchg al,ah - call char_todown - cmp al,ah - jne @f - dec ecx - jnz @b - jmp .end -@@: - pop edi esi - jmp .start -.end: - pop edi esi - xor eax,eax - ret - -.end_err: - xor eax,eax - inc eax - ret -;--------------------------------------------------------------------- -prepare_extension_and_mark: - mov esi,[dirinfo.return] - mov ebp,[esi+4] - add esi,32+40 -.start: - push esi - call search_extension_start - mov eax,esi - pop esi - sub eax,esi - sub ebx,esi - shl eax,16 - mov ax,bx - mov [esi+300-40],eax - mov [esi+299-40],byte 0 - add esi,304 - dec ebp - jnz .start - ret -;--------------------------------------------------------------------- -search_extension_start: - mov edx,esi - xor eax,eax - cld -@@: - lodsb - test eax,eax - jnz @b - dec esi - dec edx - push esi - std -@@: - lodsb - cmp esi,edx - je .end - cmp al,'.' - jnz @b - add esi,2 - cld - pop ebx - ret -.end: - cld - pop esi - mov ebx,esi - ret -;--------------------------------------------------------------------- -delete_point_dir: - mov eax,[dirinfo.return] - cmp [eax+32+40],byte '.' - jne @f - cmp [eax+32+40+1],byte 0 - jne @f - mov edi,eax - add edi,32 - mov esi,edi - add esi,304 - mov ecx,[eax+4] - dec ecx - mov [eax+4],ecx - imul ecx,304 - shr ecx,2 - cld - rep movsd -@@: - ret -;--------------------------------------------------------------------- -files_name_normalize: - mov esi,[dirinfo.return] - mov ebp,[esi+4] - add esi,32+40 -.start: - push esi - mov al,[esi] - call char_toupper - mov [esi],al -@@: - inc esi - mov al,[esi] - test al,al - jz @f - call char_todown - mov [esi],al - jmp @b -@@: - pop esi - add esi,304 - dec ebp - jnz .start - ret -;--------------------------------------------------------------------- -char_toupper: -; convert character to uppercase, using cp866 encoding -; in: al=symbol -; out: al=converted symbol - cmp al,'a' - jb .ret - cmp al,'z' - jbe .az - cmp al,'а' - jb .ret - cmp al,'р' - jb .rus1 - cmp al,'я' - ja .ret -; 0xE0-0xEF -> 0x90-0x9F - sub al,'р'-'Р' -.ret: - ret -.rus1: -; 0xA0-0xAF -> 0x80-0x8F -.az: - and al,not 0x20 - ret -;--------------------------------------------------------------------- -char_todown: -; convert character to uppercase, using cp866 encoding -; in: al=symbol -; out: al=converted symbol - cmp al,'A' - jb .ret - cmp al,'Z' - jbe .az - cmp al,'А' - jb .ret - cmp al,'Р' - jb .rus1 - cmp al,'Я' - ja .ret -; 0x90-0x9F -> 0xE0-0xEF - add al,'р'-'Р' -.ret: - ret -.rus1: -; 0x80-0x8F -> 0xA0-0xAF -.az: - add al, 0x20 - ret -;--------------------------------------------------------------------- -copy_file_path: - xor eax,eax - cld -@@: - lodsb - stosb - test eax,eax - jnz @b - mov esi,edi - dec esi - std -@@: - lodsb - cmp al,'/' - jnz @b - mov edi,esi - add edi,2 - mov esi,ebx - cld -@@: - lodsb - stosb - test eax,eax - jnz @b - ret -;--------------------------------------------------------------------- -copy_dir_path: - mov ecx,esi - inc ecx - inc ecx - xor eax,eax - cld -@@: - lodsb - test eax,eax - jnz @b - - cmp ecx,esi - jb @f - dec esi -@@: - mov [esi-1],byte '/' - mov edi,esi - mov esi,ebx -@@: - lodsb - stosb - test eax,eax - jnz @b - ret -;--------------------------------------------------------------------- -copy_exit_dir: - mov ebx,esi - inc ebx - xor eax,eax - cld -@@: - lodsb - test eax,eax - jnz @b - sub esi,2 - std -@@: - lodsb - cmp al,'/' - jnz @b - xor eax,eax - cmp ebx,esi - jb @f - inc esi -@@: - mov [esi+1],al - cld - ret -;--------------------------------------------------------------------- -copy_dir_name: - xor eax,eax - cld -@@: - lodsb - stosb - test eax,eax - jnz @b - ret -;--------------------------------------------------------------------- -;--------------------------------------------------------------------- - -;plugins_directory db 'plugins/',0 -plugins_directory db 0 - -system_dir_Boxlib db '/sys/lib/box_lib.obj',0 -system_dir_CnvPNG db '/sys/lib/cnv_png.obj',0 -system_dir_Sort db '/sys/lib/sort.obj',0 -system_dir_UNPACK db '/sys/lib/archiver.obj',0 - -ihead_f_i: -ihead_f_l db 'System error',0 - -er_message_found_lib db 'box_lib.obj - Not found!',0 -er_message_import db 'box_lib.obj - Wrong import!',0 - -er_message_found_lib2 db 'cnv_png.obj - Not found!',0 -er_message_import2 db 'cnv_png.obj - Wrong import!',0 - -err_message_found_lib3 db 'sort.obj - Not found!',0 -err_message_import3 db 'sort.obj - Wrong import!',0 - -err_message_found_lib4 db 'archiver.obj - Not found!',0 -err_message_import4 db 'archiver.obj - Wrong import!',0 - -align 4 -l_libs_start: -library01 l_libs system_dir_Boxlib+9, path, file_name, system_dir_Boxlib, \ -er_message_found_lib, ihead_f_l, Box_lib_import, er_message_import, ihead_f_i, plugins_directory - -library02 l_libs system_dir_CnvPNG+9, path, file_name, system_dir_CnvPNG,\ -er_message_found_lib2, ihead_f_l, cnv_png_import, er_message_import2, ihead_f_i, plugins_directory - -library03 l_libs system_dir_Sort+9, path, file_name, system_dir_Sort, \ -err_message_found_lib3, ihead_f_l, Sort_import, err_message_import3, ihead_f_i, plugins_directory - -library04 l_libs system_dir_UNPACK+9, path, file_name, system_dir_UNPACK, \ -err_message_found_lib4, ihead_f_l, UNPACK_import, err_message_import4, ihead_f_i, plugins_directory - -end_l_libs: - -;--------------------------------------------------------------------- -align 4 -UNPACK_import: -;unpack_Version dd aUnpack_Version -;unpack_PluginLoad dd aUnpack_PluginLoad -;unpack_OpenFilePlugin dd aUnpack_OpenFilePlugin -;unpack_ClosePlugin dd aUnpack_ClosePlugin -;unpack_ReadFolder dd aUnpack_ReadFolder -;unpack_SetFolder dd aUnpack_SetFolder -;unpack_GetFiles dd aUnpack_GetFiles -;unpack_GetOpenPluginInfo dd aUnpack_GetOpenPluginInfo -;unpack_Getattr dd aUnpack_Getattr -;unpack_Open dd aUnpack_Open -;unpack_Read dd aUnpack_Read -;unpack_Setpos dd aUnpack_Setpos -;unpack_Close dd aUnpack_Close -;unpack_DeflateUnpack dd aUnpack_DeflateUnpack -unpack_DeflateUnpack2 dd aUnpack_DeflateUnpack2 - dd 0 - dd 0 - -;aUnpack_Version db 'version',0 -;aUnpack_PluginLoad db 'plugin_load',0 -;aUnpack_OpenFilePlugin db 'OpenFilePlugin',0 -;aUnpack_ClosePlugin db 'ClosePlugin',0 -;aUnpack_ReadFolder db 'ReadFolder',0 -;aUnpack_SetFolder db 'SetFolder',0 -;aUnpack_GetFiles db 'GetFiles',0 -;aUnpack_GetOpenPluginInfo db 'GetOpenPluginInfo',0 -;aUnpack_Getattr db 'getattr',0 -;aUnpack_Open db 'open',0 -;aUnpack_Read db 'read',0 -;aUnpack_Setpos db 'setpos',0 -;aUnpack_Close db 'close',0 -;aUnpack_DeflateUnpack db 'deflate_unpack',0 -aUnpack_DeflateUnpack2 db 'deflate_unpack2',0 - -;--------------------------------------------------------------------- -;--------------------------------------------------------------------- -align 4 -Sort_import: -sort_init dd aSort_init -sort_version dd aSort_version -sort_dir dd aSort_SortDir -sort_strcmpi dd aSort_strcmpi - dd 0 - dd 0 - -aSort_init db 'START',0 -aSort_version db 'version',0 -aSort_SortDir db 'SortDir',0 -aSort_strcmpi db 'strcmpi',0 - -;--------------------------------------------------------------------- -align 4 -cnv_png_import: -.Start dd aCP_Start -.Version dd aCP_Version -.Check dd aCP_Check -.Assoc dd aCP_Assoc - dd 0 - dd 0 -aCP_Start db 'START',0 -aCP_Version db 'version',0 -aCP_Check db 'Check_Header',0 -aCP_Assoc db 'Associations',0 -;--------------------------------------------------------------------- -align 4 -Box_lib_import: -;init_lib dd a_init -;version_lib dd a_version - - -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 - -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 - -scrollbar_ver_draw dd aScrollbar_ver_draw -scrollbar_ver_mouse dd aScrollbar_ver_mouse -scrollbar_hor_draw dd aScrollbar_hor_draw -scrollbar_hor_mouse dd aScrollbar_hor_mouse -;version_scrollbar dd aVersion_scrollbar - -dinamic_button_draw dd aDbutton_draw -dinamic_button_mouse dd aDbutton_mouse -;version_dbutton dd aVersion_dbutton - -menu_bar_draw dd aMenu_bar_draw -menu_bar_mouse dd aMenu_bar_mouse -menu_bar_activate dd aMenu_bar_activate -;version_menu_bar dd aVersion_menu_bar - -FileBrowser_draw dd aFileBrowser_draw -FileBrowser_mouse dd aFileBrowser_mouse -FileBrowser_key dd aFileBrowser_key -;Version_FileBrowser dd aVersion_FileBrowser - dd 0 - dd 0 - -;a_init db 'lib_init',0 -;a_version db 'version',0 - -aEdit_box_draw db 'edit_box',0 -aEdit_box_key db 'edit_box_key',0 -aEdit_box_mouse db 'edit_box_mouse',0 -;aVersion_ed db 'version_ed',0 - -aCheck_box_draw db 'check_box_draw',0 -aCheck_box_mouse db 'check_box_mouse',0 -;aVersion_ch db 'version_ch',0 - -aOption_box_draw db 'option_box_draw',0 -aOption_box_mouse db 'option_box_mouse',0 -;aVersion_op db 'version_op',0 - -aScrollbar_ver_draw db 'scrollbar_v_draw',0 -aScrollbar_ver_mouse db 'scrollbar_v_mouse',0 -aScrollbar_hor_draw db 'scrollbar_h_draw',0 -aScrollbar_hor_mouse db 'scrollbar_h_mouse',0 -;aVersion_scrollbar db 'version_scrollbar',0 - -aDbutton_draw db 'dbutton_draw',0 -aDbutton_mouse db 'dbutton_mouse',0 -;aVersion_dbutton db 'version_dbutton',0 - -aMenu_bar_draw db 'menu_bar_draw',0 -aMenu_bar_mouse db 'menu_bar_mouse',0 -aMenu_bar_activate db 'menu_bar_activate',0 -;aVersion_menu_bar db 'version_menu_bar',0 - -aFileBrowser_draw db 'FileBrowser_draw',0 -aFileBrowser_mouse db 'FileBrowser_mouse',0 -aFileBrowser_key db 'FileBrowser_key',0 -;aVersion_FileBrowser db 'version_FileBrowser',0 -;--------------------------------------------------------------------- -;--------------------------------------------------------------------- -align 4 -window_high dd 0 -window_width dd 0 -window_status dd 0 - -active_process dd 0 -PID dd 0 -sort_type dd 2 -root_folder_area dd 0 -root_folder_block dd 0 -root1_folder_area dd 0 -root1_folder_block dd 0 -temp_counter_1 dd 0 -retrieved_devices_table_counter dd 0 -communication_area dd 0 -;--------------------------------------------------------------------- -expansion_length dd 0 -;--------------------------------------------------------------------- -N_error dd 0 -error_type dd 0 -error_path dd 0 -error_window_x: dd 100 shl 16 + 250 -error_window_y: dd 100 shl 16 + 120 -;--------------------------------------------------------------------- -mouse_scroll_data: - .vertical dw 0 - .horizontal dw 0 - -mouse_position: - .y dw 0 - .x dw 0 -;--------------------------------------------------------------------- -; not change this section!!! -; start section -;--------------------------------------------------------------------- -align 4 -image_file dd 0 -raw_pointer dd 0 -return_code dd 0 -img_size dd 0 -deflate_unpack dd 0 -raw_pointer_2 dd 0 ;+20 -;--------------------------------------------------------------------- -; end section -;--------------------------------------------------------------------- -align 4 -fileinfo: -.subfunction dd 5 -.Offset dd 0 -.Offset_1 dd 0 -.size dd 0 -.return dd file_info - db 0 -.name: dd file_name -;--------------------------------------------------------------------- -align 4 -dirinfo: -.subfunction dd 1 -.start dd 0 -.flags dd 0 -.size dd 0 -.return dd 0 - db 0 -.name: dd dir_pach -;--------------------------------------------------------------------- -align 4 -dir_header: -.version dd 0 ;+0 -.curn_blocks dd 0 ;+4 -.totl_blocks dd 0 ;+8 -.other rb 20 -;--------------------------------------------------------------------- -load_ini_error_type: - db 'Error loading INI file',0 - -load_icons_error_type: - db 'Error loading of icons file',0 - -memory_free_error_type: - db 'Error of free memory',0 - -memory_get_error_type: - db 'Memory allocation error',0 - -load_directory_error_type: - db 'Error loading directory',0 - -convert_icons_error_type: - db 'Unsupported or corrupt data for icons file',0 -;--------------------------------------------------------------------- -align 4 -error_fs_text_pointers: - dd error_fs_text_0 - dd error_fs_text_1 - dd error_fs_text_2 - dd error_fs_text_3 - dd error_fs_text_4 - dd error_fs_text_5 - dd error_fs_text_6 - dd error_fs_text_7 - dd error_fs_text_8 - dd error_fs_text_9 - dd error_fs_text_10 - dd error_fs_text_11 - -error_fs_text_0: db '0 - Success full',0 -error_fs_text_1: db '1 - Base and/or partition of a hard disk is not defined',0 -error_fs_text_2: db '2 - Function is not supported for the given file system',0 -error_fs_text_3: db '3 - Unknown file system',0 -error_fs_text_4: db '4 - Reserved, is never returned in the current implementation',0 -error_fs_text_5: db '5 - File not found',0 -error_fs_text_6: db '6 - End of file, EOF',0 -error_fs_text_7: db '7 - Pointer lies outside of application memory',0 -error_fs_text_8: db '8 - Disk is full',0 -error_fs_text_9: db '9 - FAT table is destroyed',0 -error_fs_text_10: db '10 - Access denied',0 -error_fs_text_11: db '11 - Device error',0 -;--------------------------------------------------------------------- - -extended_key db 0 - -shift_flag db 0 -ctrl_flag db 0 -alt_flag db 0 - -error_window db 0 - -Tab_key db 0 -Tab_key_block db 0 - -filter_flag db 1 - -focus_pointer db 0 -;--------------------------------------------------------------------- -start_pach: - db '/rd/1',0 - -root_pach: - db '/',0 - -icons_file_name_2 db 'buttons/' -icons_file_name db 'z_icons.png',0 -ini_file_name db 'icons.ini',0 -;--------------------------------------------------------------------- - -message: - db 'Press any key...',0 - -message_cancel_button: - db 'Cancel',0 - -message_open_button: - db 'Open',0 - -message_ReloadDir_button: - db 'Refresh',0 - -message_ExitDir_button: - db '^',0 - -title: - db 'Open Dialog',0 -;--------------------------------------------------------------------- -align 4 -menu_data_1: -.type: dd 0 ;+0 -.x: -.size_x dw 80 ;+4 -.start_x dw 10 ;+6 -.y: -.size_y dw 15 ;+8 -.start_y dw 26 ;+10 -.text_pointer: dd menu_text_area_1 ;0 ;+12 -.pos_pointer: dd menu_text_area_1_1 ;0 ;+16 -.text_end dd menu_text_area_1_1 ;0 ;+20 -.ret_key dd 0 ;+24 -.mouse_keys dd 0 ;+28 -.x1: -.size_x1 dw 80 ;+32 -.start_x1 dw 10 ;+34 -.y1: -.size_y1 dw 100 ;+36 -.start_y1 dw 41 ;+38 -.bckg_col dd 0xffffff ;0xe5e5e5 ;+40 -.frnt_col dd 0xff ;+44 -.menu_col dd 0xeef0ff ;0xffffff ;+48 -.select dd 0 ;+52 -.out_select dd 0 ;+56 -.buf_adress dd 0 ;+60 -.procinfo dd procinfo ;+64 -.click dd 0 ;+68 -.cursor dd 0 ;+72 -.cursor_old dd 0 ;+76 -.interval dd 16 ;+80 -.cursor_max dd 0 ;+84 -.extended_key dd 0 ;+88 -.menu_sel_col dd 0x00cc00 ;+92 -.bckg_text_col dd 0 ; +96 -.frnt_text_col dd 0xffffff ;+100 -.mouse_keys_old dd 0 ;+104 -.font_height dd 8 ;+108 -.cursor_out dd 0 ;+112 -.get_mouse_flag dd 0 ;+116 -;--------------------------------------------------------------------- -menu_text_area_1: -db 'Select Disk',0 -;--------------------------------------------------------------------- -align 4 -menu_data_2: -.type: dd 0 ;+0 -.x: -.size_x dw 30 ;+4 -.start_x dw 95 ;+6 -.y: -.size_y dw 15 ;+8 -.start_y dw 26 ;+10 -.text_pointer: dd menu_text_area_2 ;0 ;+12 -.pos_pointer: dd menu_text_area_2.1 ;0 ;+16 -.text_end dd menu_text_area_2.end ;0 ;+20 -.ret_key dd 0 ;+24 -.mouse_keys dd 0 ;+28 -.x1: -.size_x1 dw 30 ;+32 -.start_x1 dw 95 ;+34 -.y1: -.size_y1 dw 100 ;+36 -.start_y1 dw 41 ;+38 -.bckg_col dd 0xffffff ; 0xe5e5e5 ;+40 -.frnt_col dd 0xff ;+44 -.menu_col dd 0xeef0ff ;0xffffff ;+48 -.select dd 0 ;+52 -.out_select dd 0 ;+56 -.buf_adress dd 0 ;+60 -.procinfo dd procinfo ;+64 -.click dd 0 ;+68 -.cursor dd 0 ;+72 -.cursor_old dd 0 ;+76 -.interval dd 16 ;+80 -.cursor_max dd 0 ;+84 -.extended_key dd 0 ;+88 -.menu_sel_col dd 0x00cc00 ;+92 -.bckg_text_col dd 0 ; +96 -.frnt_text_col dd 0xffffff ;+100 -.mouse_keys_old dd 0 ;+104 -.font_height dd 8 ;+108 -.cursor_out dd 0 ;+112 -.get_mouse_flag dd 0 ;+116 -;--------------------------------------------------------------------- -menu_text_area_2: -db 'Sort',0 -.1: -db 'Name',0 -db 'Type',0 -db 'Date',0 -db 'Size',0 -.end: -db 0 -;--------------------------------------------------------------------- -align 4 -menu_data_3: -.type: dd 0 ;+0 -.x: -.size_x dw 45 ;+4 -.start_x dw 130 ;+6 -.y: -.size_y dw 15 ;+8 -.start_y dw 26 ;+10 -.text_pointer: dd menu_text_area_3 ;0 ;+12 -.pos_pointer: dd menu_text_area_3.1 ;0 ;+16 -.text_end dd menu_text_area_3.end ;0 ;+20 -.ret_key dd 0 ;+24 -.mouse_keys dd 0 ;+28 -.x1: -.size_x1 dw 95 ;+32 -.start_x1 dw 130 ;+34 -.y1: -.size_y1 dw 100 ;+36 -.start_y1 dw 41 ;+38 -.bckg_col dd 0xffffff ; 0xe5e5e5 ;+40 -.frnt_col dd 0xff ;+44 -.menu_col dd 0xeef0ff ;0xffffff ;+48 -.select dd 0 ;+52 -.out_select dd 0 ;+56 -.buf_adress dd 0 ;+60 -.procinfo dd procinfo ;+64 -.click dd 0 ;+68 -.cursor dd 0 ;+72 -.cursor_old dd 0 ;+76 -.interval dd 16 ;+80 -.cursor_max dd 0 ;+84 -.extended_key dd 0 ;+88 -.menu_sel_col dd 0x00cc00 ;+92 -.bckg_text_col dd 0 ; +96 -.frnt_text_col dd 0xffffff ;+100 -.mouse_keys_old dd 0 ;+104 -.font_height dd 8 ;+108 -.cursor_out dd 0 ;+112 -.get_mouse_flag dd 0 ;+116 -;--------------------------------------------------------------------- -menu_text_area_3: -db 'Filter',0 -.1: -db '*.* - show all',0 -db 'Only supported',0 -.end: -db 0 -;--------------------------------------------------------------------- - -align 4 -scroll_bar_data_vertical: -.x: -.size_x dw 15 ;+0 -.start_x dw 500 ;+2 -.y: -.size_y dw 300 ;+4 -.start_y dw 45 ;+6 -.btn_high dd 15 ;+8 -.type dd 1 ;+12 -.max_area dd 10 ;+16 -.cur_area dd 2 ;+20 -.position dd 0 ;+24 -.bckg_col dd 0xeeeeee ;+28 -.frnt_col dd 0xbbddff ;+32 ;0x8aeaa0 -.line_col dd 0 ;+36 -.redraw dd 0 ;+40 -.delta dw 0 ;+44 -.delta2 dw 0 ;+46 -.run_x: -.r_size_x dw 0 ;+48 -.r_start_x dw 0 ;+50 -.run_y: -.r_size_y dw 0 ;+52 -.r_start_y dw 0 ;+54 -.m_pos dd 0 ;+56 -.m_pos_2 dd 0 ;+60 -.m_keys dd 0 ;+64 -.run_size dd 0 ;+68 -.position2 dd 0 ;+72 -.work_size dd 0 ;+76 -.all_redraw dd 0 ;+80 -.ar_offset dd 1 ;+84 -;--------------------------------------------------------------------- -align 4 -file_browser_data_1: -.type dd 0 ;+0 -.x: -.size_x dw 400 ;+4 -.start_x dw 10 ;+6 -.y: -.size_y dw 550 ;+8 -.start_y dw 45 ;+10 -.icon_size_y dw 16 ; +12 -.icon_size_x dw 16 ; +14 -.line_size_x dw 0 ; +16 -.line_size_y dw 18 ; +18 -.type_size_x dw 0 ; +20 -.size_size_x dw 0 ; +22 -.date_size_x dw 0 ; +24 -.attributes_size_x dw 0 ; +26 -.icon_assoc_area dd 0 ; +28 -.icon_raw_area dd 0 ; +32 -.resolution_raw dd 0 ; +36 -.palette_raw dd 0 ; +40 -.directory_path_area dd 0 ; +44 -.file_name_area dd 0 ; +48 -.select_flag dd 0 ; +52 -.background_color dd 0xffffff ; +56 -.select_color dd 0xbbddff ; +60 -.seclect_text_color dd 0 ; +64 -.text_color dd 0 ; +68 -.reduct_text_color dd 0xff0000 ; +72 -.marked_text_color dd 0 ; +76 -.max_panel_line dd 0 ; +80 -.select_panel_counter dd 1 ; +84 -.folder_block dd 0 ; +88 -.start_draw_line dd 0 ; +92 -.start_draw_cursor_line dw 0 ; +96 ; pixels -.folder_data dd 0 ; +98 -.temp_counter dd 0 ; +102 -.file_name_length dd 0 ; +106 -.marked_file dd 0 ; +110 -.extension_size dd 0 ; +114 -.extension_start dd 0 ; +118 -.type_table dd features_table ; +122 -.ini_file_start dd 0 ; +126 -.ini_file_end dd 0 ; +130 -.draw_scroll_bar dd 0 ; +134 -.font_size_y dw 9 ; +138 -.font_size_x dw 6 ; +140 -.mouse_keys dd 0 ; +142 -.mouse_keys_old dd 0 ; +146 -.mouse_pos dd 0 ; +150 -.mouse_keys_delta dd 0 ; +154 -.mouse_key_delay dd 50 ; +158 -.mouse_keys_tick dd 0 ; +162 -.start_draw_cursor_line_2 dw 0 ;+166 -.all_redraw dd 0 ;+168 -.selected_BDVK_adress dd 0 ;+172 -.key_action dd 0 ;+176 -.name_temp_area dd name_temp_area ;+180 -.max_name_temp_size dd 0 ;+184 -.display_name_max_length dd 0 ;+188 -.draw_panel_selection_flag dd 0 ;+192 -.mouse_pos_old dd 0 ;+196 -.marked_counter dd 0 ;+200 -;--------------------------------------------------------------------- -; for EDITBOX -align 4 -name_editboxes: -edit1 edit_box 200,10,7,0xffffff,0xbbddff,0,0,0,4095,dir_pach,mouse_dd,,0 -name_editboxes_end: - -;mouse_flag: dd 0x0 - -mouse_dd rd 1 -;--------------------------------------------------------------------- -;--------------------------------------------------------------------- -features_table: -.type_table: - db ' ' -;--------------------------------------------------------------------- -.size_table: - db '1023b ' -;--------------------------------------------------------------------- -.date_table: - db '00.00.00 00:00 ' -;--------------------------------------------------------------------- -.year_table: - db ' ' -;--------------------------------------------------------------------- -IM_END: -menu_text_area_1_1: -rb 256 -;--------------------------------------------------------------------- - rb 1024 -stacktop: -;--------------------------------------------------------------------- -; window error message - rb 1024 -thread_stack: -;--------------------------------------------------------------------- -retrieved_devices_table: - rb 200 -;--------------------------------------------------------------------- -name_temp_area: - rb 256 -;--------------------------------------------------------------------- -param: - rb 256 -;--------------------------------------------------------------------- -path: - rb 4096 -;--------------------------------------------------------------------- -file_name: - rb 4096 -;--------------------------------------------------------------------- -dir_pach: - rb 4096 -;--------------------------------------------------------------------- -procinfo: -process_info: - rb 1024 -;---------------------- -file_info: - rb 40 -I_END: - +;***************************************************************************** +; Open Dialog - for Kolibri OS +; 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 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 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. +;***************************************************************************** + +use32 +org 0x0 + +db 'MENUET01' +dd 0x01 +dd START +dd IM_END +dd I_END +dd stacktop +dd param +dd path + +include '../../../../../macros.inc' +include '../../load_lib.mac' +include '../../trunk/box_lib.mac' +;include 'macros.inc' +;include 'load_lib.mac' +@use_library +;--------------------------------------------------------------------- +;--------------------------------------------------------------------- +START: + mcall 68,11 + mcall 66,1,1 + mcall 40,0x27 + call get_active_pocess + + call get_communication_area + + + load_libraries l_libs_start,end_l_libs + test eax,eax + jnz button.exit +; initialize sort + push dword 1 + call dword [sort_init] +; unpack deflate + mov eax,[unpack_DeflateUnpack2] + mov [deflate_unpack],eax + + call load_root_directory + call load_start_directory + call sort_directory + call load_icons + call convert_icons + call load_ini + call calc_ini +;--------------------------------------------------------------------- +red: + call control_minimal_window_size +red_1: + 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 +;--------------------------------------------------------------------- +control_minimal_window_size: + pusha + call get_window_param + test [window_status],10b + jnz .end ;red_1 + test [window_status],100b + jnz .end ;red_1 + test [window_status],1b + jnz .end ;red_1 + mov esi,-1 + mov eax,procinfo + mov eax,[eax+66] + cmp eax,200 + jae @f + mov esi,200 + mcall 67,-1,ebx,ebx +@@: + mov edx,-1 + mov eax,procinfo + mov eax,[eax+62] + cmp eax,300 + jae @f + mov edx,300 + mcall 67,-1,ebx, ,ebx +@@: +.end: + popa + ret +;--------------------------------------------------------------------- +key: + mov al,[focus_pointer] + test al,al + jne key_ASCII + mcall 2 + xor ebx,ebx + cmp [extended_key],1 + je .extended_key + test al, al + jnz still + cmp ah, 0xE0 + jne @f + mov [extended_key],1 + jmp still +@@: + cmp ah,72 ; arrow up + je .2 + cmp ah,80 ; arrow down + je .1 + cmp ah,28 ; Enter + je .7 + cmp ah,1 ; Esc + je button.exit + cmp ah,14 ; Backspace + je button.exit_dir + cmp ah,187 ; F1 + je select_disk + cmp ah,188 ; F2 + je select_sort + cmp ah,189 ; F3 + je select_filter + cmp ah,19 ; R + je button.reload_dir + cmp ah,42 + je key_shift_up + cmp ah,54 + je key_shift_up + cmp ah,170 + je key_shift_down + cmp ah,182 + je key_shift_down + cmp ah,29 + je key_ctrl_up + cmp ah,157 + je key_ctrl_down + cmp ah,56 + je key_alt_up + cmp ah,184 + je key_alt_down + cmp ah,206 ; NumPad+ Up + je NumPad_plus_Up + cmp ah,202 ; NumPad- Up + je NumPad_minus_Up + cmp ah,183 ; NumPad* Up + je NumPad_invert_Up + cmp ah,158 + je symbol_a_up + cmp ah,15 ; Tab down + je change_focus_area_press_Tab_key + cmp ah,143 ; Tab up + je change_focus_area_check_Tab_key + jmp still +.extended_key: + mov [extended_key],0 + cmp ah,80 ; arrow down + je .1 + cmp ah,72 ; arrow up + je .2 + cmp ah,81 ; PageDown + je .3 + cmp ah,73 ; PageUp + je .4 + cmp ah,71 ; Home + je .5 + cmp ah,79 ; End + je .6 + cmp ah,28 ; Enter + je .7 + cmp ah,82 ; Insert + je .8 + + cmp ah,29 + je key_ctrl_up + cmp ah,157 + je key_ctrl_down + cmp ah,56 + je key_alt_up + cmp ah,184 + je key_alt_down + jmp still +;--------------------------------- +.11: + inc ebx ; 11 +;--------------------------------- +.10: + inc ebx ; 10 +;--------------------------------- +.9: + inc ebx ; 9 +;--------------------------------- +.8: + inc ebx ; 8 +;--------------------------------- +.7: + inc ebx ; 7 +;--------------------------------- +.6: + inc ebx ; 6 +;--------------------------------- +.5: + inc ebx ; 5 +;--------------------------------- +.4: + inc ebx ; 4 +;--------------------------------- +.3: + inc ebx ; 3 +;--------------------------------- +.2: + inc ebx ; 2 +;--------------------------------- +.1: + inc ebx ; 1 +;--------------------------------- + call .key_action + +; movzx ecx,word [file_browser_data_1.start_draw_cursor_line] +; mcall 47,0x80000,,<50,0>,0x40000000,0xffffff +; movzx ecx,word [file_browser_data_1.size_y] +; mcall 47,0x80000,,<150,0>,0x40000000,0xffffff + + mov eax,file_browser_data_1.mouse_keys_delta + cmp [eax],dword 3 + jne still + xor ebx,ebx + mov [eax],ebx + call load_next_dir + jmp still +;------------------------------------------------------- +.key_action: + mov [file_browser_data_1.key_action],ebx + + push dword file_browser_data_1 + call [FileBrowser_key] + + cmp [file_browser_data_1.draw_scroll_bar],0 + je @f + call draw_scrollbar1 + mov [file_browser_data_1.draw_scroll_bar],0 +@@: + ret +;--------------------------------------------------------------------- +change_focus_area_Tab_key_ASCII: + xor eax,eax + inc eax + mov [Tab_key_block],al + jmp change_focus_area +;--------------------------------------------------------------------- +change_focus_area_press_Tab_key: + mov al,[Tab_key_block] + test al,al + jnz still + xor eax,eax + inc eax + mov [Tab_key],al + jmp still +;--------------------------------------------------------------------- +change_focus_area_check_Tab_key: + xor eax,eax + mov [Tab_key_block],al + mov al,[Tab_key] + test al,al + jz still + xor eax,eax + mov [Tab_key],al +;--------------------------------------------------------------------- +change_focus_area: + mov al,[focus_pointer] + inc al + and al,1 + mov [focus_pointer],al +.1: + mov edi,edit1 + test al,al + jne @f + mov [file_browser_data_1.select_panel_counter],1 + and [edi+44],dword 0xFFFFFFFD ; ed_focus + mov [edi+12],dword 0xffffff; color white + call draw_draw_file_browser1 + mcall 66, 1, 1 + jmp still +@@: + mov [file_browser_data_1.select_panel_counter],0 + or [edi+44],dword ed_focus + mov [edi+12],dword 0xffffb0 ; color yellow + call draw_draw_file_browser1 + mcall 66, 1, 0 + jmp still +;--------------------------------------------------------------------- +key_ASCII: + mcall 2 + cmp ah,9 + je change_focus_area_Tab_key_ASCII + cmp ah,13 + je .load_dir + cmp ah,27 + je button.exit + push dword name_editboxes + call [edit_box_key] + jmp still +.load_dir: + mov [file_browser_data_1.select_panel_counter],1 + xor eax,eax + mov [focus_pointer],al + mcall 66, 1, 1 + + xor eax,eax + mov esi,dir_pach + cld +@@: + lodsb + test al,al + jne @r + sub esi,2 + cmp [esi],byte '/' + jne @f + xor eax,eax + mov [esi],al +@@: + call load_next_dir.1 + jmp still +;--------------------------------------------------------------------- +select_disk: + call check_alt +.1: + xor eax,eax + mov [menu_data_1.ret_key],eax + + push dword menu_data_1 + call [menu_bar_activate] + + call clear_control_key_flag + + mov eax,[menu_data_1.ret_key] + mov [menu_data_1.ret_key],dword 0 + cmp eax,1 + je select_filter.1 + + cmp eax,2 + je select_sort.1 + + cmp [menu_data_1.click],dword 1 + jne still + + cmp [menu_data_1.cursor_out],dword 0 + jne analyse_out_menu_1 + jmp still +;--------------------------------------------------------------------- +select_sort: + call check_alt +.1: + xor eax,eax + mov [menu_data_2.ret_key],eax + + push dword menu_data_2 + call [menu_bar_activate] + + call clear_control_key_flag + + mov eax,[menu_data_2.ret_key] + mov [menu_data_2.ret_key],dword 0 + cmp eax,1 + je select_disk.1 + + cmp eax,2 + je select_filter.1 + + + cmp [menu_data_2.click],dword 1 + jne still + + cmp [menu_data_2.cursor_out],dword 0 + jne analyse_out_menu_2 + jmp still +;--------------------------------------------------------------------- +select_filter: + call check_alt +.1: + xor eax,eax + mov [menu_data_3.ret_key],eax + + push dword menu_data_3 + call [menu_bar_activate] + + call clear_control_key_flag + + mov eax,[menu_data_3.ret_key] + mov [menu_data_3.ret_key],dword 0 + cmp eax,1 + je select_sort.1 + + cmp eax,2 + je select_disk.1 + + + cmp [menu_data_3.click],dword 1 + jne still + + cmp [menu_data_3.cursor_out],dword 0 + jne analyse_out_menu_3 + jmp still +;--------------------------------------------------------------------- +symbol_a_up: +NumPad_plus_Up: + call check_ctrl + jmp key.9 +;--------------------------------------- +NumPad_minus_Up: + call check_ctrl + jmp key.10 +;--------------------------------------- +NumPad_invert_Up: + call check_ctrl + jmp key.11 +;--------------------------------------- +check_alt: + xor eax,eax + mov al,[alt_flag] + test eax,eax + jz @f + xor ebx,ebx + ret +@@: + add esp,4 + jmp still +;--------------------------------------- +check_ctrl: + xor eax,eax + mov al,[ctrl_flag] + test eax,eax + jz @f + xor ebx,ebx + ret +@@: + add esp,4 + jmp still +;--------------------------------------------------------------------- +clear_control_key_flag: + xor eax,eax + mov [shift_flag],al + mov [ctrl_flag],al + mov [alt_flag],al + ret +;--------------------------------------------------------------------- +key_shift_up: + mov [shift_flag],1 + jmp still +;--------------------------------------------------------------------- +key_shift_down: + mov [shift_flag],0 + jmp still +;--------------------------------------------------------------------- +key_ctrl_up: + mov [ctrl_flag],1 + jmp still +;--------------------------------------------------------------------- +key_ctrl_down: + mov [ctrl_flag],0 + jmp still +;--------------------------------------------------------------------- +key_alt_up: + mov [alt_flag],1 + jmp still +;--------------------------------------------------------------------- +key_alt_down: + mov [alt_flag],0 + jmp still +;--------------------------------------------------------------------- +button: + mcall 17 + cmp ah,6 + je .reload_dir_1 + cmp ah,4 + je .exit + cmp ah,3 + je .open_dir_or_file + cmp ah,2 + je .exit_dir + cmp ah, 1 + jne still +.exit: + mov eax,[communication_area] + test eax,eax + jz @f + cmp [eax],dword 1 + je @f + mov [eax],dword 3 +@@: + mov eax,[N_error] + test eax,eax + jz @f + call start_error_window_thread +@@: + mcall -1 +;--------------------------------------------------------------------- +.reload_dir: + call check_ctrl +.reload_dir_1: + call load_next_dir.1 + jmp still +;--------------------------------------------------------------------- +.exit_dir: + call load_next_dir.exit_dir + jmp still +;--------------------------------------------------------------------- +.open_dir_or_file: + xor ebx,ebx + jmp key.7 +;--------------------------------------------------------------------- +thread_start: + mov eax,[N_error] + cmp al,1 + jne @f + mov [N_error],load_ini_error_type + mov [error_path],file_name + jmp .error_type +@@: + cmp al,2 + jne @f + mov [N_error],load_icons_error_type + mov [error_path],file_name + jmp .error_type +@@: + cmp al,3 + jne @f + mov [N_error],memory_free_error_type + xor eax,eax + mov [error_path],eax + mov [error_type],eax + jmp .red +@@: + cmp al,4 + jne @f + mov [N_error],memory_get_error_type + xor eax,eax + mov [error_path],eax + mov [error_type],eax + jmp .red +@@: + cmp al,5 + jne @f + mov [N_error],load_directory_error_type + mov [error_path],dir_pach + jmp .error_type +@@: + cmp al,6 + jne .button + mov [N_error],convert_icons_error_type + mov [error_path],file_name + xor eax,eax + mov [error_type],eax + jmp .red +.error_type: + mov eax,[error_type] + shl eax,2 + add eax,error_fs_text_pointers + mov eax,[eax] + mov [error_type],eax +.red: + call draw_error_window +.still: + mcall 10 + cmp eax,1 + je .red + cmp eax,2 + je .key + cmp eax,3 + je .button + jmp .still +.key: + mcall 2 + jmp .still +.button: + mcall -1 + jmp .still +;--------------------------------------------------------------------- +draw_error_window: + mcall 12, 1 + mcall 0,[error_window_x] ,[error_window_y], 0x03ff0000 + mcall 71,1,title + mcall 4,<10,30>,0x90ffffff,[N_error] + mov eax,[error_path] + test eax,eax + jz @f + mcall 4,<10,50>, ,[error_path] +@@: + mov eax,[error_type] + test eax,eax + jz @f + mcall 4,<10,70>, ,[error_type] +@@: + mcall 12, 2 + ret +;--------------------------------------------------------------------- +start_error_window_thread: + mcall 9, procinfo, -1 + mov eax,[ebx+46] + shr eax,1 + add eax,[ebx+38] + sub eax,40 + mov [error_window_y+2],ax + mov eax,[ebx+42] + shr eax,1 + add eax,[ebx+34] + sub eax,125 + mov [error_window_x+2],ax + mcall 51,1,thread_start,thread_stack + ret +;--------------------------------------------------------------------- +mouse: + mcall 18,7 + cmp [active_process],eax + jne still + + mcall 37,7 + mov [mouse_scroll_data],eax + + mcall 37,1 + mov [mouse_position],eax + + cmp [scroll_bar_data_vertical.delta2],0 + jne .scrollbar + + mov [file_browser_data_1.select_flag],0 + + push dword file_browser_data_1 + call [FileBrowser_mouse] + + mov eax,file_browser_data_1.mouse_keys_delta + cmp [eax],dword 3 + jne .check_focus ;.scrollbar + mov [eax],dword 0 + call load_next_dir + jmp still +;--------------------------------------------------- +.check_focus: + mov ebx,[file_browser_data_1.select_flag] + test ebx,ebx + jz .scrollbar ;@f + mov al,[focus_pointer] + test al,al + jz .scrollbar + xor eax,eax + mov [focus_pointer],al + jmp change_focus_area.1 +;--------------------------------------------------- +.scrollbar: + mov eax,[scroll_bar_data_vertical.max_area] + cmp eax,[scroll_bar_data_vertical.cur_area] + jbe .menu_bar ;still + + push dword scroll_bar_data_vertical + call [scrollbar_ver_mouse] + + cmp [scroll_bar_data_vertical.redraw],0 + je .menu_bar ;still + mov [scroll_bar_data_vertical.redraw],0 +.draw: + call draw_draw_file_browser2 + jmp still + +;--------------------------------------------------- +.menu_bar: + cmp [scroll_bar_data_vertical.delta2],0 + jne still + +.menu_bar_1: + call .set_mouse_flag +@@: + 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: + push dword menu_data_2 + call [menu_bar_mouse] + + cmp [menu_data_2.click],dword 1 + jne .menu_bar_3 + + cmp [menu_data_2.cursor_out],dword 0 + jne analyse_out_menu_2 + jmp .menu_bar_1 +;--------------------------------------------------- +.menu_bar_3: + push dword menu_data_3 + call [menu_bar_mouse] + + cmp [menu_data_3.click],dword 1 + jne .check_editboxes + + cmp [menu_data_3.cursor_out],dword 0 + jne analyse_out_menu_3 + jmp .menu_bar_1 +;--------------------------------------------------- +.check_editboxes: + mov eax,[edit1+44] + and eax,10b + push dword name_editboxes + call [edit_box_mouse] + mov ebx,[edit1+44] + and ebx,10b + cmp eax,ebx + je .check_scroll_event + mov al,[focus_pointer] + test al,al + jnz .check_scroll_event + xor eax,eax + test ebx,10b + jz @f + inc eax +@@: + mov [focus_pointer],al + jmp change_focus_area.1 +;--------------------------------------------------- +.check_scroll_event: + mov eax,[mouse_position] + xor ebx,ebx + mov bx,ax ; EBX mouse y + shr eax,16 ; EAX mouse x + + mov cx,[file_browser_data_1.start_x] + mov dx,[file_browser_data_1.start_y] + + cmp ax,cx + jb .mouse_next ; min x + + cmp bx,dx + jb .mouse_next ; min y + + add cx,[file_browser_data_1.size_x] + cmp ax,cx + ja .mouse_next ; max x + + add dx,[file_browser_data_1.size_y] + cmp bx,dx + ja .mouse_next ; max y + + xor ecx,ecx + xor ebx,ebx + mov eax,[mouse_scroll_data] + test eax,eax + jz .mouse_next + test ax,0x8000 + jnz .decr + shr eax,16 + test ax,0x8000 + jnz .decr_1 + + mov cx,[mouse_scroll_data.vertical] + test ecx,ecx + jnz @f + mov cx,[mouse_scroll_data.horizontal] + test ecx,ecx + jz .mouse_next +@@: + mov ebx,1 +@@: + push ebx ecx + call key.key_action + pop ecx ebx + dec ecx + jnz @r + jmp still +;---------------------------------------- +.decr: + mov bx,[mouse_scroll_data.vertical] + jmp @f +.decr_1: + mov bx,[mouse_scroll_data.horizontal] +@@: + mov ecx,0xffff + sub ecx,ebx + inc ecx + mov ebx,2 +@@: + push ebx ecx + call key.key_action + pop ecx ebx + dec ecx + jnz @r + jmp still +;--------------------------------------------------- +.mouse_next: + jmp still +;--------------------------------------------------------------------- +.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: +; Available disks + mov eax,[menu_data_1.cursor_out] + dec eax + imul esi,eax,10 + add esi,retrieved_devices_table + mov edi,dir_pach + call copy_dir_name + call load_next_dir.1 + jmp still +;--------------------------------------------------------------------- +analyse_out_menu_2: +; Sort + mov eax,[menu_data_2.cursor_out] + xor ebx,ebx + cmp eax,dword 1 + je .1 + cmp eax,dword 2 + je .2 + cmp eax,dword 3 + je .3 + cmp eax,dword 4 + je .4 + jmp still +.4: + add ebx,2 +.3: + add ebx,2 +.2: + add ebx,2 +.1: + mov [sort_type],ebx + call sort_directory + call draw_draw_file_browser1 + jmp still +;--------------------------------------------------------------------- +analyse_out_menu_3: +; Filter + mov eax,[menu_data_3.cursor_out] + cmp eax,dword 1 + jne @f + mov [filter_flag],0 + call load_next_dir.1 + jmp still +@@: + cmp eax,dword 2 + jne still + mov [filter_flag],1 + call load_next_dir.1 + jmp still +;--------------------------------------------------------------------- +get_communication_area: + xor eax,eax + mov al,[param] + test eax,eax + jz @f + mcall 68,22,param,,0x01 + mov [communication_area],eax +@@: + ret +;--------------------------------------------------------------------- +load_start_directory: + mov eax,[communication_area] + test eax,eax + jz @f + mov ebx,[eax] + test eax,eax + jz @f + add eax,4 + mov esi,eax + jmp .1 +@@: + mov esi,start_pach +.1: + mov edi,dir_pach + call copy_dir_name + call load_directory + mov eax,[N_error] + test eax,eax + jnz button.exit + ret +;--------------------------------------------------------------------- +load_next_dir: + mov ebx,[file_browser_data_1.selected_BDVK_adress] + add ebx,40 + test [ebx-40],byte 0x10 + jz file_no_folder + cmp [ebx],word '..' + jne @f + cmp [ebx+2],byte 0 + je .exit_dir +@@: + mov esi,dir_pach + call copy_dir_path + +@@: +.1: + call load_directory + mov eax,[N_error] + test eax,eax + jz @f + call error_handler + jmp .1 +@@: + call sort_directory + + mov ebx,[scroll_bar_data_vertical.x] + inc ebx + mov ecx,[scroll_bar_data_vertical.y] + inc ecx + mcall 13,,,0xcccccc + mov edi,edit1 + xor eax,eax + mov [edi+44],eax + mov [edi+12],dword 0xffffff ; color white + call draw_draw_file_browser1 + ret +.exit_dir: + mov esi,dir_pach + call copy_exit_dir + jmp .1 +;--------------------------------------------------------------------- +error_handler: +.red: + call .draw_window +;------------------------------------ +.still: + mcall 10 + cmp eax,1 + je .red + cmp eax,2 + je .key + cmp eax,3 + je .button + jmp .still +;------------------------------------ +.draw_window: + xor eax,eax + inc eax + mov [error_window],al + call control_minimal_window_size + call draw_window + xor eax,eax + mov [error_window],al + ret +;------------------------------------ +.key: + mcall 2 + xor ebx,ebx + cmp [extended_key],1 + je .extended_key + test al, al + jnz .still + cmp ah, 0xE0 + jne @f + mov [extended_key],1 + jmp .still +@@: + cmp ah,129 ; Esc + je .exit + jmp .still +.extended_key: + jmp .still +;------------------------------------ +.button: + mcall 17 + cmp ah,5 + je .exit + cmp ah, 1 + jne .still + xor eax,eax + mov [N_error],eax + jmp button.exit +;------------------------------------ +.exit: + mov esi,start_pach + mov edi,dir_pach + call copy_dir_name + ret +;--------------------------------------------------------------------- +file_no_folder: + mov esi,dir_pach + mov edi,file_name + call copy_dir_name + + mov esi,file_name + call copy_dir_path + + mov eax,[communication_area] + test eax,eax + jnz @f + call control_minimal_window_size + call draw_window + ret +@@: + mov edi,eax + add edi,4 + mov esi,file_name + call copy_dir_name + mov eax,[communication_area] + mov [eax],dword 1 + jmp button.exit +;--------------------------------------------------------------------- +load_root_directory: + mov esi,root_pach + mov edi,dir_pach + call copy_dir_name + call load_directory + mov eax,[N_error] + test eax,eax + jnz button.exit + + mov eax,[dirinfo.return] + mov [root_folder_area],eax + mov eax,[eax+4] + mov [root_folder_block],eax + + xor eax,eax + mov [dirinfo.return],eax + mov [file_browser_data_1.folder_data],eax + mov [temp_counter_1],eax ;0 + + mov [retrieved_devices_table_counter],eax ;0 +.start_temp_counter_1: + imul esi,[temp_counter_1],304 + add esi,[root_folder_area] + add esi,32+40 + mov edi,dir_pach+1 + mov [edi-1],byte '/' + call copy_dir_name + call load_directory + mov eax,[N_error] + test eax,eax + jnz button.exit + + mov eax,[dirinfo.return] + mov [root1_folder_area],eax + mov eax,[eax+4] + test eax,eax + jz .continue + mov [root1_folder_block],eax + + mov ebp,0 +.start_copy_device_patch: + imul edi,[retrieved_devices_table_counter],10 + add edi,retrieved_devices_table + mov [edi],byte '/' + inc edi + imul esi,[temp_counter_1],304 + add esi,[root_folder_area] + add esi,32+40 + + call copy_dir_name + + imul esi,ebp,304 + add esi,[root1_folder_area] + add esi,32+40 + mov [edi-1],byte '/' + + call copy_dir_name + + inc [retrieved_devices_table_counter] + inc ebp + cmp ebp,[root1_folder_block] + jb .start_copy_device_patch +.continue: + inc [temp_counter_1] + mov eax,[temp_counter_1] + cmp eax,[root_folder_block] + jb .start_temp_counter_1 + + cmp [root_folder_area],dword 0 + je @f + mcall 68, 13, [root_folder_area] + test eax,eax + jz memory_free_error +@@: + + xor ecx,ecx + mov edi,menu_text_area_1_1 ;.1 +@@: + imul esi,ecx,10 + add esi,retrieved_devices_table + call copy_dir_name + inc ecx + cmp ecx,[retrieved_devices_table_counter] + jb @b + mov [menu_data_1.text_end],edi + xor eax,eax + mov [edi],eax + ret +;--------------------------------------------------------------------- +memory_free_error: + mov [N_error],3 + jmp button.exit +;--------------------------------------------------------------------- +memory_get_error: + mov [N_error],4 + jmp button.exit +;--------------------------------------------------------------------- +draw_window: + + mcall 12,1 + + mcall 0,<10,420>,<10,320>,0x63AABBCC, + +; mov ecx,[communication_area] +; add ecx,4096+4+4 + + mcall 71,1, title ;;param ;file_name ;dir_pach + + call get_window_param + + mov eax,[window_high] + sub eax,25+45 + mov [file_browser_data_1.size_y],ax + mov [scroll_bar_data_vertical.size_y],ax + + mov eax,[window_width] + sub eax,10+20 + mov [file_browser_data_1.size_x],ax + add ax,10 + mov [scroll_bar_data_vertical.start_x],ax + + + mcall 13,[window_width],45,0xcccccc + + push ecx + rol ecx,16 + add cx,[file_browser_data_1.size_y] + add cx,45 + ror ecx,16 + mov cx,25 + mcall + pop ecx + add ecx,45 shl 16 + mov cx,[file_browser_data_1.size_y] + mov bx,10 + mcall + mov bx,[file_browser_data_1.size_x] + add bx,10 + shl ebx,16 + mov bx,20 + mcall + + cmp [error_window],0 + je @f + call draw_for_fs_errors + jmp .1 +@@: + call draw_draw_file_browser1 +.1: + push dword menu_data_1 + call [menu_bar_draw] + push dword menu_data_2 + call [menu_bar_draw] + push dword menu_data_3 + call [menu_bar_draw] + + mov ebx,[file_browser_data_1.x] + mov ax,bx + shl eax,16 + add ebx,eax + mov eax,50 + mov bx,ax + shl eax,16 + sub ebx,eax + mov ecx,26 shl 16+15 + + mcall 8,,,2,0xffffff + + pusha + shr ecx,16 + mov bx,cx + add ebx,20 shl 16+ 2 + mcall 4,,0x90000000,message_ExitDir_button + add ebx,4 + mcall + add ebx,4 + mcall + popa + + push ebx + sub ebx,70 shl 16 + mov bx,60 + mcall 8,,,6 + + shr ecx,16 + mov bx,cx + add ebx,5 shl 16+ 4 + mcall 4,,0x90000000,message_ReloadDir_button + pop ebx + + mov ebx,[file_browser_data_1.x] + + mov ax,bx + shl eax,16 + add ebx,eax + mov eax,55 + mov bx,ax + shl eax,16 + sub ebx,eax + + mov ecx,[file_browser_data_1.y] + mov ax,cx + add eax,3 + shl eax,16 + add ecx,eax + mov cx,15 + + mcall 8,,,3 + + pusha + shr ecx,16 + mov bx,cx + add ebx,12 shl 16+ 4 + mcall 4,,0x90000000,message_open_button + popa + + + sub ebx, 65 shl 16 + mcall 8,,,4 + + shr ecx,16 + mov bx,cx + add ebx,6 shl 16+ 4 + mcall 4,,0x90000000,message_cancel_button + + +; mcall 47,0x80000,[file_browser_data_1.ini_file_start],<250, 0>,0x0 +; mcall 4, <3, 420>, 0, fb_extension_start, 3 + mcall 12,2 + + ret +;--------------------------------------------------------------------- +draw_for_fs_errors: + call draw_dir_pach + + mov ebx,[file_browser_data_1.x] + mov ecx,[file_browser_data_1.y] + mcall 13,,,[file_browser_data_1.background_color] + push ebx ecx + add ebx,10 shl 16 + sub ebx,20 + add ecx,10 shl 16 + sub ecx,20 + mov edx,0xff0000 + mcall + + shr ecx,16 + mov bx,cx + add ebx,5 shl 16+15 + mcall 4,,0x90ffffff,load_directory_error_type + + add ebx,20 + mcall 4,,,dir_pach + + mov eax,[error_type] + shl eax,2 + add eax,error_fs_text_pointers + mov edx,[eax] + add ebx,20 + mcall 4 + + pop ecx ebx + + mov ebx,[file_browser_data_1.x] + mov ax,bx + shr eax,1 + shl eax,16 + add ebx,eax + mov eax,50 + mov bx,ax + shr eax,1 + shl eax,16 + sub ebx,eax + + mov ecx,[file_browser_data_1.y] + mov ax,cx + sub eax,40 + shl eax,16 + add ecx,eax + mov cx,15 + + mcall 8,,,5,0xffffff + + shr ecx,16 + mov bx,cx + add ebx,4 shl 16+ 4 + mcall 4,,0x90000000,message_cancel_button + + + ret +;--------------------------------------------------------------------- +draw_dir_pach: + mov esi,dir_pach + cld +@@: + lodsb + test al,al + jne @r + sub esi,dir_pach + mov eax,esi + dec eax + mov edi, edit1 + mov [edi+48], eax ;ed_size + mov [edi+52], eax ;ed_pos + + mov eax,[file_browser_data_1.x] + mov ebx,eax + shr ebx,16 + and eax,0xffff + + mov [edi],eax + mov [edi+4],ebx + + push dword name_editboxes + call [edit_box_draw] + ret + +draw_dir_pach_1: + mov ebx,[file_browser_data_1.x] + mcall 13,,<7,15>,0xffffb0 + mov bx,10 + add ebx,4 shl 16 + mcall 4,,0xC0000000,dir_pach,,0xffffb0 + ret +;--------------------------------------------------------------------- +draw_draw_file_browser1: + call draw_dir_pach + xor eax,eax + inc eax + mov [file_browser_data_1.all_redraw],eax + mov [scroll_bar_data_vertical.all_redraw],eax + + push dword file_browser_data_1 + call [FileBrowser_draw] + + + call prepare_scrollbar_data + + call draw_scrollbar + + xor eax,eax + mov [file_browser_data_1.all_redraw],eax + mov [scroll_bar_data_vertical.all_redraw],eax + ret +;--------------------------------------------------------------------- +draw_draw_file_browser2: + mov eax,2 + mov [file_browser_data_1.all_redraw],eax + + call get_scrollbar_data + + push dword file_browser_data_1 + call [FileBrowser_draw] + + xor eax,eax + mov [file_browser_data_1.all_redraw],eax + ret +;--------------------------------------------------------------------- +draw_scrollbar1: + mov eax,[file_browser_data_1.start_draw_line] + mov [scroll_bar_data_vertical.position],eax + + call draw_scrollbar + + ret +;--------------------------------------------------------------------- +draw_scrollbar: + mov eax,[scroll_bar_data_vertical.max_area] + cmp eax,[scroll_bar_data_vertical.cur_area] + jbe @f + cmp [scroll_bar_data_vertical.cur_area],0 + je @f + push dword scroll_bar_data_vertical + call [scrollbar_ver_draw] +@@: + ret +;--------------------------------------------------------------------- +get_scrollbar_data: + mov eax,[scroll_bar_data_vertical.position] + mov [file_browser_data_1.start_draw_line],eax + ret +;--------------------------------------------------------------------- +prepare_scrollbar_data: + mov eax,[file_browser_data_1.folder_block] + mov [scroll_bar_data_vertical.max_area],eax + mov eax,[file_browser_data_1.max_panel_line] + mov [scroll_bar_data_vertical.cur_area],eax + ret +;--------------------------------------------------------------------- +get_active_pocess: + mcall 9, procinfo, -1 + mov eax,[ebx+30] + mov [PID],eax + xor ecx,ecx +@@: + inc ecx + mcall 9, procinfo + mov eax,[PID] + cmp eax,[ebx+30] + jne @r + mov [active_process],ecx + ret +;--------------------------------------------------------------------- +get_window_param: + mcall 9, procinfo, -1 + mov eax,[ebx+66] + inc eax + mov [window_high],eax + mov eax,[ebx+62] + inc eax + mov [window_width],eax + mov eax,[ebx+70] + mov [window_status],eax + ret +;--------------------------------------------------------------------- +convert_icons: + xor eax,eax + mov [return_code],eax + mov eax,image_file + call [cnv_png_import.Start] + + mov ecx,[image_file] + mcall 68, 13, + test eax,eax + jz memory_free_error + + cmp [return_code],dword 0 + je @f + mov [N_error],6 + jmp button.exit +@@: + + mov ebx,[raw_pointer] + mov eax,[ebx+4] +; set of icon size x + mov [file_browser_data_1.icon_size_x],ax +; mov eax,[ebx+8] +; set of icon size y + mov [file_browser_data_1.icon_size_y],ax + inc ax + mov [file_browser_data_1.line_size_y],ax + mov eax,[ebx+12] +; set of RAW resolution to pixel + mov [file_browser_data_1.resolution_raw],eax + + mov eax,[ebx+20] + add eax,ebx +; set RAW palette, use else resolution 8bit or less + mov [file_browser_data_1.palette_raw],eax + + mov eax,[ebx+28] + add eax,ebx +; set RAW area for icon + mov [file_browser_data_1.icon_raw_area],eax + ret +;--------------------------------------------------------------------- +calc_ini: + mov eax,[image_file] + mov [file_browser_data_1.ini_file_start],eax + add eax,[img_size] + mov [file_browser_data_1.ini_file_end],eax + ret +;--------------------------------------------------------------------- +load_ini: + mov ebx,ini_file_name + mov esi,path + mov edi,file_name + call copy_file_path + + mov [fileinfo.subfunction],dword 5 + mov [fileinfo.size],dword 0 + mov [fileinfo.return],dword file_info + mcall 70, fileinfo + test eax,eax + jnz .error + + mov [fileinfo.subfunction],dword 0 + + mov ecx,[file_info+32] + mov [fileinfo.size],ecx + mov [img_size],ecx + + mcall 68, 12 + test eax,eax + jz memory_get_error + + mov [fileinfo.return],eax + mov [image_file],eax + + mcall 70, fileinfo + test eax,eax + jnz .error + ret +.error: + mov [N_error],1 + mov [error_type],eax + jmp button.exit +;--------------------------------------------------------------------- +load_icons: + mov ebx,icons_file_name_2 + mov esi,path + mov edi,file_name + call copy_file_path + + mov [fileinfo.subfunction],dword 5 + mov [fileinfo.size],dword 0 + mov [fileinfo.return],dword file_info + mcall 70, fileinfo + test eax,eax + jz @f + + mov ebx,icons_file_name + mov esi,path + mov edi,file_name + call copy_file_path + + mov [fileinfo.subfunction],dword 5 + mov [fileinfo.size],dword 0 + mov [fileinfo.return],dword file_info + mcall 70, fileinfo + test eax,eax + jnz .error +@@: + mov [fileinfo.subfunction],dword 0 + + mov ecx,[file_info+32] + mov [fileinfo.size],ecx + mov [img_size],ecx + + mcall 68, 12 + test eax,eax + jz memory_get_error + + mov [fileinfo.return],eax + mov [image_file],eax + + mcall 70, fileinfo + test eax,eax + jnz .error + ret +.error: + mov [N_error],2 + mov [error_type],eax + jmp button.exit +;--------------------------------------------------------------------- +sort_directory: + mov eax,[file_browser_data_1.folder_data] + mov ebx,[eax+4] ; number of files + add eax,32 + cmp [eax+40],word '..' + jne @f + cmp [eax+40+2],byte 0 + jne @f + dec ebx + add eax,304 +@@: + push dword [sort_type] ; sort mode + push ebx ; number of files + push eax ; data files + call [sort_dir] + ret +;-------------------------------------------------------------------- +load_directory: + xor eax,eax + mov [N_error],eax + cmp [file_browser_data_1.folder_data],eax + je @f + mcall 68, 13, [file_browser_data_1.folder_data] + test eax,eax + jz memory_free_error + +@@: + mov [dirinfo.size],dword 0 + mov [dirinfo.return],dir_header + mcall 70, dirinfo + test eax,eax + jz @f + xor ebx,ebx + mov [file_browser_data_1.folder_data],ebx + jmp .error +@@: + + mov ecx,[dir_header.totl_blocks] + mov [dirinfo.size],ecx + imul ecx,304 + add ecx,32 + mcall 68, 12 + test eax,eax + jz memory_get_error + + mov [dirinfo.return],eax + mov [file_browser_data_1.folder_data],eax + + mcall 70, dirinfo + test eax,eax + jnz .error + + call delete_point_dir + call files_name_normalize + call check_filter + call prepare_extension_and_mark + call clear_data_fb_and_sb + + ret + +.error: + mov [N_error],5 + mov [error_type],eax + ret +;--------------------------------------------------------------------- +clear_data_fb_and_sb: + xor eax,eax + mov [file_browser_data_1.start_draw_cursor_line],ax + mov [file_browser_data_1.start_draw_line],eax + mov [scroll_bar_data_vertical.position],eax + ret +;--------------------------------------------------------------------- +check_filter: + xor eax,eax + mov al,[filter_flag] + test eax,eax + jz @f + + mov eax,[communication_area] + test eax,eax + jz @f + mov eax,[eax+4096] + test eax,eax + jz @f + call delete_unsupported_BDFE +@@: + ret +;--------------------------------------------------------------------- +delete_unsupported_BDFE: + mov ebx,[file_browser_data_1.folder_data] + add ebx,4 + xor ecx,ecx + dec ecx + + mov eax,[file_browser_data_1.folder_data] + add eax,32+40 + sub eax,304 +.start: + inc ecx + add eax,304 +.1: + cmp [ebx],ecx + je .end + cmp [eax],byte '.' + jne @f + cmp [eax+1],byte 0 + je .delete +@@: + test [eax-40],byte 0x10 + jnz .start + + push eax ebx + mov esi,eax + call search_expansion + test eax,eax + pop ebx eax + jnz .delete + + push eax ebx ecx esi + mov edi,[communication_area] + add edi,4096+4 + call compare_expansion + test eax,eax + pop esi ecx ebx eax + jz .start + +;------------------------------------------- +.delete: + dec dword [ebx] + mov esi,[ebx] + sub esi,ecx + + push ecx + mov ecx,esi + imul ecx,304/4 + mov edi,eax + sub edi,40 + mov esi,edi + add esi,304 + cld + rep movsd + pop ecx + + jmp .1 +.end: + ret +;--------------------------------------------------------------------- +search_expansion: + mov edi,esi + xor eax,eax +@@: + cld + lodsb + test eax,eax + jnz @b + mov ebx,esi + dec esi +@@: + std + lodsb + cmp esi,edi + jb .end_err + cmp al,'.' + jne @b + + add esi,2 + sub ebx,esi + dec ebx + mov [expansion_length],ebx + cld + xor eax,eax + ret + +.end_err: + cld + xor eax,eax + inc eax + ret +;--------------------------------------------------------------------- +compare_expansion: + mov ebx,[edi] + add ebx,edi + add edi,3 +.start: + cmp ebx,edi + jb .end_err + mov ecx,[expansion_length] + inc edi + + push esi edi +@@: + cld + lodsb + xchg esi,edi + shl eax,8 + lodsb + xchg esi,edi + call char_todown + xchg al,ah + call char_todown + cmp al,ah + jne @f + dec ecx + jnz @b + jmp .end +@@: + pop edi esi + jmp .start +.end: + pop edi esi + xor eax,eax + ret + +.end_err: + xor eax,eax + inc eax + ret +;--------------------------------------------------------------------- +prepare_extension_and_mark: + mov esi,[dirinfo.return] + mov ebp,[esi+4] + add esi,32+40 +.start: + push esi + call search_extension_start + mov eax,esi + pop esi + sub eax,esi + sub ebx,esi + shl eax,16 + mov ax,bx + mov [esi+300-40],eax + mov [esi+299-40],byte 0 + add esi,304 + dec ebp + jnz .start + ret +;--------------------------------------------------------------------- +search_extension_start: + mov edx,esi + xor eax,eax + cld +@@: + lodsb + test eax,eax + jnz @b + dec esi + dec edx + push esi + std +@@: + lodsb + cmp esi,edx + je .end + cmp al,'.' + jnz @b + add esi,2 + cld + pop ebx + ret +.end: + cld + pop esi + mov ebx,esi + ret +;--------------------------------------------------------------------- +delete_point_dir: + mov eax,[dirinfo.return] + cmp [eax+32+40],byte '.' + jne @f + cmp [eax+32+40+1],byte 0 + jne @f + mov edi,eax + add edi,32 + mov esi,edi + add esi,304 + mov ecx,[eax+4] + dec ecx + mov [eax+4],ecx + imul ecx,304 + shr ecx,2 + cld + rep movsd +@@: + ret +;--------------------------------------------------------------------- +files_name_normalize: + mov esi,[dirinfo.return] + mov ebp,[esi+4] + add esi,32+40 +.start: + push esi + mov al,[esi] + call char_toupper + mov [esi],al +@@: + inc esi + mov al,[esi] + test al,al + jz @f + call char_todown + mov [esi],al + jmp @b +@@: + pop esi + add esi,304 + dec ebp + jnz .start + ret +;--------------------------------------------------------------------- +char_toupper: +; convert character to uppercase, using cp866 encoding +; in: al=symbol +; out: al=converted symbol + cmp al,'a' + jb .ret + cmp al,'z' + jbe .az + cmp al,'а' + jb .ret + cmp al,'р' + jb .rus1 + cmp al,'я' + ja .ret +; 0xE0-0xEF -> 0x90-0x9F + sub al,'р'-'Р' +.ret: + ret +.rus1: +; 0xA0-0xAF -> 0x80-0x8F +.az: + and al,not 0x20 + ret +;--------------------------------------------------------------------- +char_todown: +; convert character to uppercase, using cp866 encoding +; in: al=symbol +; out: al=converted symbol + cmp al,'A' + jb .ret + cmp al,'Z' + jbe .az + cmp al,'А' + jb .ret + cmp al,'Р' + jb .rus1 + cmp al,'Я' + ja .ret +; 0x90-0x9F -> 0xE0-0xEF + add al,'р'-'Р' +.ret: + ret +.rus1: +; 0x80-0x8F -> 0xA0-0xAF +.az: + add al, 0x20 + ret +;--------------------------------------------------------------------- +copy_file_path: + xor eax,eax + cld +@@: + lodsb + stosb + test eax,eax + jnz @b + mov esi,edi + dec esi + std +@@: + lodsb + cmp al,'/' + jnz @b + mov edi,esi + add edi,2 + mov esi,ebx + cld +@@: + lodsb + stosb + test eax,eax + jnz @b + ret +;--------------------------------------------------------------------- +copy_dir_path: + mov ecx,esi + inc ecx + inc ecx + xor eax,eax + cld +@@: + lodsb + test eax,eax + jnz @b + + cmp ecx,esi + jb @f + dec esi +@@: + mov [esi-1],byte '/' + mov edi,esi + mov esi,ebx +@@: + lodsb + stosb + test eax,eax + jnz @b + ret +;--------------------------------------------------------------------- +copy_exit_dir: + mov ebx,esi + inc ebx + xor eax,eax + cld +@@: + lodsb + test eax,eax + jnz @b + sub esi,2 + std +@@: + lodsb + cmp al,'/' + jnz @b + xor eax,eax + cmp ebx,esi + jb @f + inc esi +@@: + mov [esi+1],al + cld + ret +;--------------------------------------------------------------------- +copy_dir_name: + xor eax,eax + cld +@@: + lodsb + stosb + test eax,eax + jnz @b + ret +;--------------------------------------------------------------------- +;--------------------------------------------------------------------- + +;plugins_directory db 'plugins/',0 +plugins_directory db 0 + +system_dir_Boxlib db '/sys/lib/box_lib.obj',0 +system_dir_CnvPNG db '/sys/lib/cnv_png.obj',0 +system_dir_Sort db '/sys/lib/sort.obj',0 +system_dir_UNPACK db '/sys/lib/archiver.obj',0 + +ihead_f_i: +ihead_f_l db 'System error',0 + +er_message_found_lib db 'box_lib.obj - Not found!',0 +er_message_import db 'box_lib.obj - Wrong import!',0 + +er_message_found_lib2 db 'cnv_png.obj - Not found!',0 +er_message_import2 db 'cnv_png.obj - Wrong import!',0 + +err_message_found_lib3 db 'sort.obj - Not found!',0 +err_message_import3 db 'sort.obj - Wrong import!',0 + +err_message_found_lib4 db 'archiver.obj - Not found!',0 +err_message_import4 db 'archiver.obj - Wrong import!',0 + +align 4 +l_libs_start: +library01 l_libs system_dir_Boxlib+9, path, file_name, system_dir_Boxlib, \ +er_message_found_lib, ihead_f_l, Box_lib_import, er_message_import, ihead_f_i, plugins_directory + +library02 l_libs system_dir_CnvPNG+9, path, file_name, system_dir_CnvPNG,\ +er_message_found_lib2, ihead_f_l, cnv_png_import, er_message_import2, ihead_f_i, plugins_directory + +library03 l_libs system_dir_Sort+9, path, file_name, system_dir_Sort, \ +err_message_found_lib3, ihead_f_l, Sort_import, err_message_import3, ihead_f_i, plugins_directory + +library04 l_libs system_dir_UNPACK+9, path, file_name, system_dir_UNPACK, \ +err_message_found_lib4, ihead_f_l, UNPACK_import, err_message_import4, ihead_f_i, plugins_directory + +end_l_libs: + +;--------------------------------------------------------------------- +align 4 +UNPACK_import: +;unpack_Version dd aUnpack_Version +;unpack_PluginLoad dd aUnpack_PluginLoad +;unpack_OpenFilePlugin dd aUnpack_OpenFilePlugin +;unpack_ClosePlugin dd aUnpack_ClosePlugin +;unpack_ReadFolder dd aUnpack_ReadFolder +;unpack_SetFolder dd aUnpack_SetFolder +;unpack_GetFiles dd aUnpack_GetFiles +;unpack_GetOpenPluginInfo dd aUnpack_GetOpenPluginInfo +;unpack_Getattr dd aUnpack_Getattr +;unpack_Open dd aUnpack_Open +;unpack_Read dd aUnpack_Read +;unpack_Setpos dd aUnpack_Setpos +;unpack_Close dd aUnpack_Close +;unpack_DeflateUnpack dd aUnpack_DeflateUnpack +unpack_DeflateUnpack2 dd aUnpack_DeflateUnpack2 + dd 0 + dd 0 + +;aUnpack_Version db 'version',0 +;aUnpack_PluginLoad db 'plugin_load',0 +;aUnpack_OpenFilePlugin db 'OpenFilePlugin',0 +;aUnpack_ClosePlugin db 'ClosePlugin',0 +;aUnpack_ReadFolder db 'ReadFolder',0 +;aUnpack_SetFolder db 'SetFolder',0 +;aUnpack_GetFiles db 'GetFiles',0 +;aUnpack_GetOpenPluginInfo db 'GetOpenPluginInfo',0 +;aUnpack_Getattr db 'getattr',0 +;aUnpack_Open db 'open',0 +;aUnpack_Read db 'read',0 +;aUnpack_Setpos db 'setpos',0 +;aUnpack_Close db 'close',0 +;aUnpack_DeflateUnpack db 'deflate_unpack',0 +aUnpack_DeflateUnpack2 db 'deflate_unpack2',0 + +;--------------------------------------------------------------------- +;--------------------------------------------------------------------- +align 4 +Sort_import: +sort_init dd aSort_init +sort_version dd aSort_version +sort_dir dd aSort_SortDir +sort_strcmpi dd aSort_strcmpi + dd 0 + dd 0 + +aSort_init db 'START',0 +aSort_version db 'version',0 +aSort_SortDir db 'SortDir',0 +aSort_strcmpi db 'strcmpi',0 + +;--------------------------------------------------------------------- +align 4 +cnv_png_import: +.Start dd aCP_Start +.Version dd aCP_Version +.Check dd aCP_Check +.Assoc dd aCP_Assoc + dd 0 + dd 0 +aCP_Start db 'START',0 +aCP_Version db 'version',0 +aCP_Check db 'Check_Header',0 +aCP_Assoc db 'Associations',0 +;--------------------------------------------------------------------- +align 4 +Box_lib_import: +;init_lib dd a_init +;version_lib dd a_version + + +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 + +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 + +scrollbar_ver_draw dd aScrollbar_ver_draw +scrollbar_ver_mouse dd aScrollbar_ver_mouse +scrollbar_hor_draw dd aScrollbar_hor_draw +scrollbar_hor_mouse dd aScrollbar_hor_mouse +;version_scrollbar dd aVersion_scrollbar + +dinamic_button_draw dd aDbutton_draw +dinamic_button_mouse dd aDbutton_mouse +;version_dbutton dd aVersion_dbutton + +menu_bar_draw dd aMenu_bar_draw +menu_bar_mouse dd aMenu_bar_mouse +menu_bar_activate dd aMenu_bar_activate +;version_menu_bar dd aVersion_menu_bar + +FileBrowser_draw dd aFileBrowser_draw +FileBrowser_mouse dd aFileBrowser_mouse +FileBrowser_key dd aFileBrowser_key +;Version_FileBrowser dd aVersion_FileBrowser + dd 0 + dd 0 + +;a_init db 'lib_init',0 +;a_version db 'version',0 + +aEdit_box_draw db 'edit_box',0 +aEdit_box_key db 'edit_box_key',0 +aEdit_box_mouse db 'edit_box_mouse',0 +;aVersion_ed db 'version_ed',0 + +aCheck_box_draw db 'check_box_draw',0 +aCheck_box_mouse db 'check_box_mouse',0 +;aVersion_ch db 'version_ch',0 + +aOption_box_draw db 'option_box_draw',0 +aOption_box_mouse db 'option_box_mouse',0 +;aVersion_op db 'version_op',0 + +aScrollbar_ver_draw db 'scrollbar_v_draw',0 +aScrollbar_ver_mouse db 'scrollbar_v_mouse',0 +aScrollbar_hor_draw db 'scrollbar_h_draw',0 +aScrollbar_hor_mouse db 'scrollbar_h_mouse',0 +;aVersion_scrollbar db 'version_scrollbar',0 + +aDbutton_draw db 'dbutton_draw',0 +aDbutton_mouse db 'dbutton_mouse',0 +;aVersion_dbutton db 'version_dbutton',0 + +aMenu_bar_draw db 'menu_bar_draw',0 +aMenu_bar_mouse db 'menu_bar_mouse',0 +aMenu_bar_activate db 'menu_bar_activate',0 +;aVersion_menu_bar db 'version_menu_bar',0 + +aFileBrowser_draw db 'FileBrowser_draw',0 +aFileBrowser_mouse db 'FileBrowser_mouse',0 +aFileBrowser_key db 'FileBrowser_key',0 +;aVersion_FileBrowser db 'version_FileBrowser',0 +;--------------------------------------------------------------------- +;--------------------------------------------------------------------- +align 4 +window_high dd 0 +window_width dd 0 +window_status dd 0 + +active_process dd 0 +PID dd 0 +sort_type dd 2 +root_folder_area dd 0 +root_folder_block dd 0 +root1_folder_area dd 0 +root1_folder_block dd 0 +temp_counter_1 dd 0 +retrieved_devices_table_counter dd 0 +communication_area dd 0 +;--------------------------------------------------------------------- +expansion_length dd 0 +;--------------------------------------------------------------------- +N_error dd 0 +error_type dd 0 +error_path dd 0 +error_window_x: dd 100 shl 16 + 250 +error_window_y: dd 100 shl 16 + 120 +;--------------------------------------------------------------------- +mouse_scroll_data: + .vertical dw 0 + .horizontal dw 0 + +mouse_position: + .y dw 0 + .x dw 0 +;--------------------------------------------------------------------- +; not change this section!!! +; start section +;--------------------------------------------------------------------- +align 4 +image_file dd 0 +raw_pointer dd 0 +return_code dd 0 +img_size dd 0 +deflate_unpack dd 0 +raw_pointer_2 dd 0 ;+20 +;--------------------------------------------------------------------- +; end section +;--------------------------------------------------------------------- +align 4 +fileinfo: +.subfunction dd 5 +.Offset dd 0 +.Offset_1 dd 0 +.size dd 0 +.return dd file_info + db 0 +.name: dd file_name +;--------------------------------------------------------------------- +align 4 +dirinfo: +.subfunction dd 1 +.start dd 0 +.flags dd 0 +.size dd 0 +.return dd 0 + db 0 +.name: dd dir_pach +;--------------------------------------------------------------------- +align 4 +dir_header: +.version dd 0 ;+0 +.curn_blocks dd 0 ;+4 +.totl_blocks dd 0 ;+8 +.other rb 20 +;--------------------------------------------------------------------- +load_ini_error_type: + db 'Error loading INI file',0 + +load_icons_error_type: + db 'Error loading of icons file',0 + +memory_free_error_type: + db 'Error of free memory',0 + +memory_get_error_type: + db 'Memory allocation error',0 + +load_directory_error_type: + db 'Error loading directory',0 + +convert_icons_error_type: + db 'Unsupported or corrupt data for icons file',0 +;--------------------------------------------------------------------- +align 4 +error_fs_text_pointers: + dd error_fs_text_0 + dd error_fs_text_1 + dd error_fs_text_2 + dd error_fs_text_3 + dd error_fs_text_4 + dd error_fs_text_5 + dd error_fs_text_6 + dd error_fs_text_7 + dd error_fs_text_8 + dd error_fs_text_9 + dd error_fs_text_10 + dd error_fs_text_11 + +error_fs_text_0: db '0 - Success full',0 +error_fs_text_1: db '1 - Base and/or partition of a hard disk is not defined',0 +error_fs_text_2: db '2 - Function is not supported for the given file system',0 +error_fs_text_3: db '3 - Unknown file system',0 +error_fs_text_4: db '4 - Reserved, is never returned in the current implementation',0 +error_fs_text_5: db '5 - File not found',0 +error_fs_text_6: db '6 - End of file, EOF',0 +error_fs_text_7: db '7 - Pointer lies outside of application memory',0 +error_fs_text_8: db '8 - Disk is full',0 +error_fs_text_9: db '9 - FAT table is destroyed',0 +error_fs_text_10: db '10 - Access denied',0 +error_fs_text_11: db '11 - Device error',0 +;--------------------------------------------------------------------- + +extended_key db 0 + +shift_flag db 0 +ctrl_flag db 0 +alt_flag db 0 + +error_window db 0 + +Tab_key db 0 +Tab_key_block db 0 + +filter_flag db 1 + +focus_pointer db 0 +;--------------------------------------------------------------------- +start_pach: + db '/rd/1',0 + +root_pach: + db '/',0 + +icons_file_name_2 db 'buttons/' +icons_file_name db 'z_icons.png',0 +ini_file_name db 'icons.ini',0 +;--------------------------------------------------------------------- + +message: + db 'Press any key...',0 + +message_cancel_button: + db 'Cancel',0 + +message_open_button: + db 'Open',0 + +message_ReloadDir_button: + db 'Refresh',0 + +message_ExitDir_button: + db '^',0 + +title: + db 'Open Dialog',0 +;--------------------------------------------------------------------- +align 4 +menu_data_1: +.type: dd 0 ;+0 +.x: +.size_x dw 80 ;+4 +.start_x dw 10 ;+6 +.y: +.size_y dw 15 ;+8 +.start_y dw 26 ;+10 +.text_pointer: dd menu_text_area_1 ;0 ;+12 +.pos_pointer: dd menu_text_area_1_1 ;0 ;+16 +.text_end dd menu_text_area_1_1 ;0 ;+20 +.ret_key dd 0 ;+24 +.mouse_keys dd 0 ;+28 +.x1: +.size_x1 dw 80 ;+32 +.start_x1 dw 10 ;+34 +.y1: +.size_y1 dw 100 ;+36 +.start_y1 dw 41 ;+38 +.bckg_col dd 0xffffff ;0xe5e5e5 ;+40 +.frnt_col dd 0xff ;+44 +.menu_col dd 0xeef0ff ;0xffffff ;+48 +.select dd 0 ;+52 +.out_select dd 0 ;+56 +.buf_adress dd 0 ;+60 +.procinfo dd procinfo ;+64 +.click dd 0 ;+68 +.cursor dd 0 ;+72 +.cursor_old dd 0 ;+76 +.interval dd 16 ;+80 +.cursor_max dd 0 ;+84 +.extended_key dd 0 ;+88 +.menu_sel_col dd 0x00cc00 ;+92 +.bckg_text_col dd 0 ; +96 +.frnt_text_col dd 0xffffff ;+100 +.mouse_keys_old dd 0 ;+104 +.font_height dd 8 ;+108 +.cursor_out dd 0 ;+112 +.get_mouse_flag dd 0 ;+116 +;--------------------------------------------------------------------- +menu_text_area_1: +db 'Select Disk',0 +;--------------------------------------------------------------------- +align 4 +menu_data_2: +.type: dd 0 ;+0 +.x: +.size_x dw 30 ;+4 +.start_x dw 95 ;+6 +.y: +.size_y dw 15 ;+8 +.start_y dw 26 ;+10 +.text_pointer: dd menu_text_area_2 ;0 ;+12 +.pos_pointer: dd menu_text_area_2.1 ;0 ;+16 +.text_end dd menu_text_area_2.end ;0 ;+20 +.ret_key dd 0 ;+24 +.mouse_keys dd 0 ;+28 +.x1: +.size_x1 dw 30 ;+32 +.start_x1 dw 95 ;+34 +.y1: +.size_y1 dw 100 ;+36 +.start_y1 dw 41 ;+38 +.bckg_col dd 0xffffff ; 0xe5e5e5 ;+40 +.frnt_col dd 0xff ;+44 +.menu_col dd 0xeef0ff ;0xffffff ;+48 +.select dd 0 ;+52 +.out_select dd 0 ;+56 +.buf_adress dd 0 ;+60 +.procinfo dd procinfo ;+64 +.click dd 0 ;+68 +.cursor dd 0 ;+72 +.cursor_old dd 0 ;+76 +.interval dd 16 ;+80 +.cursor_max dd 0 ;+84 +.extended_key dd 0 ;+88 +.menu_sel_col dd 0x00cc00 ;+92 +.bckg_text_col dd 0 ; +96 +.frnt_text_col dd 0xffffff ;+100 +.mouse_keys_old dd 0 ;+104 +.font_height dd 8 ;+108 +.cursor_out dd 0 ;+112 +.get_mouse_flag dd 0 ;+116 +;--------------------------------------------------------------------- +menu_text_area_2: +db 'Sort',0 +.1: +db 'Name',0 +db 'Type',0 +db 'Date',0 +db 'Size',0 +.end: +db 0 +;--------------------------------------------------------------------- +align 4 +menu_data_3: +.type: dd 0 ;+0 +.x: +.size_x dw 45 ;+4 +.start_x dw 130 ;+6 +.y: +.size_y dw 15 ;+8 +.start_y dw 26 ;+10 +.text_pointer: dd menu_text_area_3 ;0 ;+12 +.pos_pointer: dd menu_text_area_3.1 ;0 ;+16 +.text_end dd menu_text_area_3.end ;0 ;+20 +.ret_key dd 0 ;+24 +.mouse_keys dd 0 ;+28 +.x1: +.size_x1 dw 95 ;+32 +.start_x1 dw 130 ;+34 +.y1: +.size_y1 dw 100 ;+36 +.start_y1 dw 41 ;+38 +.bckg_col dd 0xffffff ; 0xe5e5e5 ;+40 +.frnt_col dd 0xff ;+44 +.menu_col dd 0xeef0ff ;0xffffff ;+48 +.select dd 0 ;+52 +.out_select dd 0 ;+56 +.buf_adress dd 0 ;+60 +.procinfo dd procinfo ;+64 +.click dd 0 ;+68 +.cursor dd 0 ;+72 +.cursor_old dd 0 ;+76 +.interval dd 16 ;+80 +.cursor_max dd 0 ;+84 +.extended_key dd 0 ;+88 +.menu_sel_col dd 0x00cc00 ;+92 +.bckg_text_col dd 0 ; +96 +.frnt_text_col dd 0xffffff ;+100 +.mouse_keys_old dd 0 ;+104 +.font_height dd 8 ;+108 +.cursor_out dd 0 ;+112 +.get_mouse_flag dd 0 ;+116 +;--------------------------------------------------------------------- +menu_text_area_3: +db 'Filter',0 +.1: +db '*.* - show all',0 +db 'Only supported',0 +.end: +db 0 +;--------------------------------------------------------------------- + +align 4 +scroll_bar_data_vertical: +.x: +.size_x dw 15 ;+0 +.start_x dw 500 ;+2 +.y: +.size_y dw 300 ;+4 +.start_y dw 45 ;+6 +.btn_high dd 15 ;+8 +.type dd 1 ;+12 +.max_area dd 10 ;+16 +.cur_area dd 2 ;+20 +.position dd 0 ;+24 +.bckg_col dd 0xeeeeee ;+28 +.frnt_col dd 0xbbddff ;+32 ;0x8aeaa0 +.line_col dd 0 ;+36 +.redraw dd 0 ;+40 +.delta dw 0 ;+44 +.delta2 dw 0 ;+46 +.run_x: +.r_size_x dw 0 ;+48 +.r_start_x dw 0 ;+50 +.run_y: +.r_size_y dw 0 ;+52 +.r_start_y dw 0 ;+54 +.m_pos dd 0 ;+56 +.m_pos_2 dd 0 ;+60 +.m_keys dd 0 ;+64 +.run_size dd 0 ;+68 +.position2 dd 0 ;+72 +.work_size dd 0 ;+76 +.all_redraw dd 0 ;+80 +.ar_offset dd 1 ;+84 +;--------------------------------------------------------------------- +align 4 +file_browser_data_1: +.type dd 0 ;+0 +.x: +.size_x dw 400 ;+4 +.start_x dw 10 ;+6 +.y: +.size_y dw 550 ;+8 +.start_y dw 45 ;+10 +.icon_size_y dw 16 ; +12 +.icon_size_x dw 16 ; +14 +.line_size_x dw 0 ; +16 +.line_size_y dw 18 ; +18 +.type_size_x dw 0 ; +20 +.size_size_x dw 0 ; +22 +.date_size_x dw 0 ; +24 +.attributes_size_x dw 0 ; +26 +.icon_assoc_area dd 0 ; +28 +.icon_raw_area dd 0 ; +32 +.resolution_raw dd 0 ; +36 +.palette_raw dd 0 ; +40 +.directory_path_area dd 0 ; +44 +.file_name_area dd 0 ; +48 +.select_flag dd 0 ; +52 +.background_color dd 0xffffff ; +56 +.select_color dd 0xbbddff ; +60 +.seclect_text_color dd 0 ; +64 +.text_color dd 0 ; +68 +.reduct_text_color dd 0xff0000 ; +72 +.marked_text_color dd 0 ; +76 +.max_panel_line dd 0 ; +80 +.select_panel_counter dd 1 ; +84 +.folder_block dd 0 ; +88 +.start_draw_line dd 0 ; +92 +.start_draw_cursor_line dw 0 ; +96 ; pixels +.folder_data dd 0 ; +98 +.temp_counter dd 0 ; +102 +.file_name_length dd 0 ; +106 +.marked_file dd 0 ; +110 +.extension_size dd 0 ; +114 +.extension_start dd 0 ; +118 +.type_table dd features_table ; +122 +.ini_file_start dd 0 ; +126 +.ini_file_end dd 0 ; +130 +.draw_scroll_bar dd 0 ; +134 +.font_size_y dw 9 ; +138 +.font_size_x dw 6 ; +140 +.mouse_keys dd 0 ; +142 +.mouse_keys_old dd 0 ; +146 +.mouse_pos dd 0 ; +150 +.mouse_keys_delta dd 0 ; +154 +.mouse_key_delay dd 50 ; +158 +.mouse_keys_tick dd 0 ; +162 +.start_draw_cursor_line_2 dw 0 ;+166 +.all_redraw dd 0 ;+168 +.selected_BDVK_adress dd 0 ;+172 +.key_action dd 0 ;+176 +.name_temp_area dd name_temp_area ;+180 +.max_name_temp_size dd 0 ;+184 +.display_name_max_length dd 0 ;+188 +.draw_panel_selection_flag dd 0 ;+192 +.mouse_pos_old dd 0 ;+196 +.marked_counter dd 0 ;+200 +;--------------------------------------------------------------------- +; for EDITBOX +align 4 +name_editboxes: +edit1 edit_box 200,10,7,0xffffff,0xbbddff,0,0,0,4095,dir_pach,mouse_dd,,0 +name_editboxes_end: + +;mouse_flag: dd 0x0 + +mouse_dd rd 1 +;--------------------------------------------------------------------- +;--------------------------------------------------------------------- +features_table: +.type_table: + db ' ' +;--------------------------------------------------------------------- +.size_table: + db '1023b ' +;--------------------------------------------------------------------- +.date_table: + db '00.00.00 00:00 ' +;--------------------------------------------------------------------- +.year_table: + db ' ' +;--------------------------------------------------------------------- +IM_END: +menu_text_area_1_1: +rb 256 +;--------------------------------------------------------------------- + rb 1024 +stacktop: +;--------------------------------------------------------------------- +; window error message + rb 1024 +thread_stack: +;--------------------------------------------------------------------- +retrieved_devices_table: + rb 200 +;--------------------------------------------------------------------- +name_temp_area: + rb 256 +;--------------------------------------------------------------------- +param: + rb 256 +;--------------------------------------------------------------------- +path: + rb 4096 +;--------------------------------------------------------------------- +file_name: + rb 4096 +;--------------------------------------------------------------------- +dir_pach: + rb 4096 +;--------------------------------------------------------------------- +procinfo: +process_info: + rb 1024 +;---------------------- +file_info: + rb 40 +I_END: + diff --git a/programs/develop/libraries/box_lib/asm/trunk/editbox_ex.asm b/programs/develop/libraries/box_lib/asm/trunk/editbox_ex.asm index 29e64b78de..fcfaa9643a 100644 --- a/programs/develop/libraries/box_lib/asm/trunk/editbox_ex.asm +++ b/programs/develop/libraries/box_lib/asm/trunk/editbox_ex.asm @@ -1,19 +1,19 @@ ;заголовок приложения -use32 ; транслятор, использующий 32 разрядных команды - org 0x0 ; базовый адрес кода, всегда 0x0 - db 'MENUET01' ; идентификатор исполняемого файла (8 байт) - dd 0x1 ; версия формата заголовка исполняемого файла - dd start ; адрес, на который система передаёт управление - ; после загрузки приложения в память - dd i_end ; размер приложения - dd mem ; Объем используемой памяти, для стека отведем 0х100 байт и выровним на грницу 4 байта - dd mem ; расположим позицию стека в области памяти, сразу за телом программы. Вершина стека в диапазоне памяти, указанном выше - dd 0x0 ; указатель на строку с параметрами. +use32 ; транслятор, использующий 32 разрядных команды + org 0x0 ; базовый адрес кода, всегда 0x0 + db 'MENUET01' ; идентификатор исполняемого файла (8 байт) + dd 0x1 ; версия формата заголовка исполняемого файла + dd start ; адрес, на который система передаёт управление + ; после загрузки приложения в память + dd i_end ; размер приложения + dd mem ; Объем используемой памяти, для стека отведем 0х100 байт и выровним на грницу 4 байта + dd mem ; расположим позицию стека в области памяти, сразу за телом программы. Вершина стека в диапазоне памяти, указанном выше + dd 0x0 ; указатель на строку с параметрами. dd cur_dir_path include '../../../../../macros.inc' -include 'editbox_ex.mac' +include '../../trunk/box_lib.mac' include '../../load_lib.mac' @use_library ;use load lib macros start: @@ -21,129 +21,129 @@ start: sys_load_library library_name, cur_dir_path, library_path, system_path, \ err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i ;if return code =-1 then exit, else nornary work - cmp eax,-1 - jz exit - mcall 40,0x27 ;установить маску для ожидаемых событий + cmp eax,-1 + jz exit + mcall 40,0x27 ;установить маску для ожидаемых событий red_win: - call draw_window ;первоначально необходимо нарисовать окно + call draw_window ;первоначально необходимо нарисовать окно align 4 -still: ;основной обработчик - mcall 10 ;Ожидать события - dec eax - jz red_win - dec eax - jz key - dec eax - jz button +still: ;основной обработчик + mcall 10 ;Ожидать события + dec eax + jz red_win + dec eax + jz key + dec eax + jz button - push dword edit1 - call [edit_box_mouse] + push dword edit1 + call [edit_box_mouse] - push dword edit2 - call [edit_box_mouse] + push dword edit2 + call [edit_box_mouse] - push dword check1 - call [check_box_mouse] + push dword check1 + call [check_box_mouse] - push dword check2 - call [check_box_mouse] + push dword check2 + call [check_box_mouse] - push dword Option_boxs - call [option_box_mouse] + push dword Option_boxs + call [option_box_mouse] - push dword Option_boxs2 - call [option_box_mouse] + push dword Option_boxs2 + call [option_box_mouse] - jmp still ;если ничего из перечисленного то снова в цикл + jmp still ;если ничего из перечисленного то снова в цикл ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; button: - mcall 17 ;получить идентификатор нажатой клавиши - test ah,ah ;если в ah 0, то перейти на обработчик событий still - jz still -exit: mcall -1 + mcall 17 ;получить идентификатор нажатой клавиши + test ah,ah ;если в ah 0, то перейти на обработчик событий still + jz still +exit: mcall -1 key: - mcall 2 ;загрузим значение 2 в регистор eax и получим код нажатой клавиши + mcall 2 ;загрузим значение 2 в регистор eax и получим код нажатой клавиши - push dword edit1 - call [edit_box_key] + push dword edit1 + call [edit_box_key] - push dword edit2 - call [edit_box_key] + push dword edit2 + call [edit_box_key] - jmp still + jmp still ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>> align 4 -draw_window: ;рисование окна приложения - mcall 12,1 - mcall 0,(50*65536+390),(30*65536+200),0x33AABBCC,0x805080DD,hed +draw_window: ;рисование окна приложения + mcall 12,1 + mcall 0,(50*65536+390),(30*65536+200),0x33AABBCC,0x805080DD,hed - push dword edit1 - call [edit_box_draw] + push dword edit1 + call [edit_box_draw] - push dword edit2 - call [edit_box_draw] + push dword edit2 + call [edit_box_draw] - push dword check1 - call [check_box_draw] + push dword check1 + call [check_box_draw] - push dword check2 - call [check_box_draw] + push dword check2 + call [check_box_draw] - push dword Option_boxs - call [option_box_draw] + push dword Option_boxs + call [option_box_draw] - push dword Option_boxs2 - call [option_box_draw] + push dword Option_boxs2 + call [option_box_draw] - mcall 12,2 + mcall 12,2 ret ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;DATA данные ;Всегда соблюдать последовательность в имени. -system_path db '/sys/lib/' -library_name db 'box_lib.obj',0 +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 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -err_message_found_lib db 'Sorry I cannot load library box_lib.obj',0 +err_message_found_lib db 'Sorry I cannot load library box_lib.obj',0 head_f_i: -head_f_l db 'System error',0 -err_message_import db 'Error on load import library box_lib.obj',0 +head_f_l db 'System error',0 +err_message_import db 'Error on load import library 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 +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 -check_box_draw dd aCheck_box_draw -check_box_mouse dd aCheck_box_mouse -version_ch dd aVersion_ch +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 +option_box_draw dd aOption_box_draw +option_box_mouse dd aOption_box_mouse +version_op dd aVersion_op - dd 0 - dd 0 + dd 0 + dd 0 -aEdit_box_draw db 'edit_box',0 -aEdit_box_key db 'edit_box_key',0 +aEdit_box_draw db 'edit_box',0 +aEdit_box_key db 'edit_box_key',0 aEdit_box_mouse db 'edit_box_mouse',0 -aVersion_ed db 'version_ed',0 +aVersion_ed db 'version_ed',0 aCheck_box_draw db 'check_box_draw',0 aCheck_box_mouse db 'check_box_mouse',0 -aVersion_ch db 'version_ch',0 +aVersion_ch db 'version_ch',0 aOption_box_draw db 'option_box_draw',0 aOption_box_mouse db 'option_box_mouse',0 -aVersion_op db 'version_op',0 +aVersion_op db 'version_op',0 @@ -161,30 +161,30 @@ op11 option_box option_group2,120,90,6,12,0xffffff,0,0,op_text.1,op_text.e1-op_t 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 date 27.04.2009',0 +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 date 27.04.2009',0 hed_end: rb 256 check_text db 'First checkbox' check_text2 db 'Second checkbox' -op_text: ; Сопровождающий текст для чек боксов +op_text: ; Сопровождающий текст для чек боксов .1 db 'Option_Box #1' .e1: .2 db 'Option_Box #2' .e2: .3 db 'Option_Box #3' .e3: -ed_buffer rb 100 +ed_buffer rb 100 ;----------------------- ;sc system_colors mouse_dd rd 1 -p_info process_information -cur_dir_path rb 4096 -library_path rb 4096 +p_info process_information +cur_dir_path rb 4096 +library_path rb 4096 i_end: rb 1024 mem: \ No newline at end of file diff --git a/programs/develop/libraries/box_lib/asm/trunk/editbox_ex.mac b/programs/develop/libraries/box_lib/asm/trunk/editbox_ex.mac deleted file mode 100644 index 3ba048a562..0000000000 --- a/programs/develop/libraries/box_lib/asm/trunk/editbox_ex.mac +++ /dev/null @@ -1,21 +0,0 @@ -include '../../trunk/editbox.mac' -include '../../trunk/checkbox.mac' -include '../../trunk/optionbox.mac' - -macro get_sys_colors col_buf -{ - ;mov eax,48 - push 48 - pop eax - ;mov ebx,3 - push 3 - pop ebx - ;mov ecx,col_buf - push col_buf - pop ecx - ;mov edx,40 - push 40 - pop edx - mcall -} - diff --git a/programs/develop/libraries/box_lib/trunk/checkbox.mac b/programs/develop/libraries/box_lib/trunk/checkbox.mac index 2f73bb30ae..8f27877bd6 100644 --- a/programs/develop/libraries/box_lib/trunk/checkbox.mac +++ b/programs/develop/libraries/box_lib/trunk/checkbox.mac @@ -3,7 +3,7 @@ ;Checkbox ch_struc_size=36 -ch_flag_en=10b +ch_flag_en=10b ;¤ыхьхэЄ т√сЁрэ ch_left equ [edi] ;координата начала рисования по х ch_top equ [edi+2] ;координата начала рисования по у @@ -18,38 +18,28 @@ ch_flags equ [edi+32] ;фла macro check_boxes_set_sys_color start,end,color_table { -ch_left equ [edi] ;координата начала рисования по х -ch_top equ [edi+2] ;координата начала рисования по у -ch_text_margin equ [edi+4] ;=4 расстояние от прямоугольника чек бокса до надписи -ch_size equ [edi+8] ;12 размер квадрата чек бокса -ch_color equ [edi+12] ;цвет внутри checkbox -ch_border_color equ [edi+16] ; or [edi+4] ;цвет рамки checkbox ее можно задать самостоятельно -ch_text_color equ [edi+20];[edi+4] ;цвет текста -ch_text_ptr equ [edi+24] ;указатель на начало текстовой строки -ch_text_length equ [edi+28] -ch_flags equ [edi+32] ;флаги - - mov edi,start - mov ecx,((end-start)/ch_struc_size) - mov esi,color_table + mov edi,start + mov ecx,((end-start)/ch_struc_size) + mov esi,color_table @@: - push dword [esi+32] - pop dword ch_text_color - push dword [esi+36] - pop dword ch_border_color - add edi,ch_struc_size - loop @b +; push dword [esi+20] ;цвет рабочей области окна +; pop dword ch_color + push dword [esi+32] ;цвет текста в рабочей области окна + pop dword ch_text_color + push dword [esi+36] ;цвет графики в окне (разделительные линии и т.п.) + pop dword ch_border_color + add edi,ch_struc_size + loop @b } struc check_box left,top,ch_text_margin,ch_size,color,border_color,text_color,text,ch_text_length,flags { ;структура параметров для чек бокса -ch_flag_en=10b -.left: dw left ;+0 ;положение по х -.top: dw top ;положение по у +.left: dw left ;+0 положение по х +.top: dw top ;+2 положение по у .ch_text_margin: dd ch_text_margin ;расстояние от прямоугольника чек бокса до надписи .ch_size: dd ch_size ;размер квадрата чек бокса, для примера 12 -.color: dd color ;цвет внутри чекбокса +.color: dd color ;цвет внутри чекбокса .border_color: dd border_color ;цвет рамки -.text_color: dd text_color ;цвет надписи +.text_color: dd text_color ;цвет надписи .text: dd text ;адрес в коде программы где расположен текст .ch_text_length: dd ch_text_length ;длинна строки с символами .flags: dd flags+0 ; флаги diff --git a/programs/develop/libraries/box_lib/trunk/doc/box_lib.htm b/programs/develop/libraries/box_lib/trunk/doc/box_lib.htm new file mode 100644 index 0000000000..de6c621a54 --- /dev/null +++ b/programs/develop/libraries/box_lib/trunk/doc/box_lib.htm @@ -0,0 +1,71 @@ + + +сшсышюЄхър boxlib + + + + +

╬уыртыхэшх

+

┬тхфхэшх

+

▌ыхьхэЄ√ сшсышюЄхъш

+ +

┬тхфхэшх

+

┴шсышюЄхър box_lib.obj ёюфхЁцшЄ Ёрчэ√х ¤ыхьхэЄ√ єяЁртыхэш , ъюЄюЁ√х ьюцэю + шёяюы№чютрЄ№ яЁш эряшёрэшш яЁшыюцхэшщ. ╘рщы box_lib.mac яюфъы■ўрхЄ ьръЁюё√ + фы  ъюьяшы Ўшш сшсышюЄхъш ш фы  шёяюы№чютрэш  ¤ыхьхэЄют.

+ +

▌ыхьхэЄ√ сшсышюЄхъш

+
    +
  • editbox
  • +
  • checkbox
  • +
  • optionbox
  • +
  • scrollbar
  • +
  • d_button
  • +
  • menubar
  • +
  • filebrowser
  • +
  • tree_list
  • +
+ +
+

─юъєьхэЄрЎш  юсэюты ырё№ яюёыхфэшщ Ёрч 09.01.10.

+ + \ No newline at end of file diff --git a/programs/develop/libraries/box_lib/trunk/doc/editbox/info_editbox.htm b/programs/develop/libraries/box_lib/trunk/doc/editbox/info_editbox.htm new file mode 100644 index 0000000000..d47258478d --- /dev/null +++ b/programs/develop/libraries/box_lib/trunk/doc/editbox/info_editbox.htm @@ -0,0 +1,109 @@ + + +¤ыхьхэЄ Edit Box + + + + +

╬уыртыхэшх

+

┬тхфхэшх

+

╘єэъЎшш

+ +

╤ЄЁєъЄєЁр editbox

+

╤Єшыш ¤ыхьхэЄр

+ +

┬тхфхэшх

+

╥хъёЄютюх яюых, шёяюы№чєхЄё  яЁш ттюфх ЄхъёЄютющ/ўшёыютющ шэЇюЁьрЎшш.

+ +

╘єэъЎшш

+ +

edit_box_key

+

▌Єр ЇєэъЎш  фюыцэр т√ч√трЄё  яЁш ттюфх шэЇюЁьрЎшш ё ъыртшрЄєЁ√.

+ +

edit_box_mouse

+

▌Єр ЇєэъЎш  фюыцэр т√ч√трЄё  яЁш ттюфх шэЇюЁьрЎшш ё ь√°ш.

+ +

version_ed

+

┬хЁёш  ¤ыхьхэЄр

+ +

╤ЄЁєъЄєЁр editbox

+
struc  edit_box width,left,top,color,shift_color,focus_border_color,\
+       blur_border_color,text_color,max,text,mouse_variable,flags,size,pos
+{
+.width dd width
+.left  dd left
+.top   dd top
+.color dd color
+.shift_color dd shift_color
+.focus_border_color dd focus_border_color
+.blur_border_color  dd blur_border_color
+.text_color dd text_color
+.max  dd max
+.text dd text
+.mouse_variable dd mouse_variable
+.flags  dd flags+0
+.size   dd size+0
+.pos    dd pos+0
+.offset dd 0
+.cl_curs_x dd 0
+.cl_curs_y dd 0
+.shift     dd 0
+.shift_old dd 0
+}
+

width - °шЁшэр ¤ыхьхэЄр.

+

left - юЄёЄєя ёыхтр.

+ +

╤Єшыш ¤ыхьхэЄр

+ +

ed_figure_only

+

╨рчЁх°рхЄё  ттюф ўшёхы юЄ 0 фю 9.

+

ed_focus

+

╥хъёЄютюх яюых т Їюъєёх.

+ +
+

─юъєьхэЄрЎш  юсэюты ырё№ яюёыхфэшщ Ёрч 09.01.10.

+ + \ No newline at end of file diff --git a/programs/develop/libraries/box_lib/trunk/tree_list_doc/info_size.png b/programs/develop/libraries/box_lib/trunk/tree_list_doc/info_size.png deleted file mode 100644 index 5876da4a31e420fb1b97bb3ad1ccd1e21a5fd1ad..0000000000000000000000000000000000000000 GIT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sw$D^o8y4fEbF*->&XeKvmDH}~;RrXT-I9BQg+KE`5X({|yAC437 z<8T&@H-~8Jjzf&R8D-Ir7lhHI2>$9J<>kkmOV4=(*W~10EQC)_BVQ72u(@$VsS%PH zawK_>l09qss;s5sK#s;nl8ukI$5u?BV@JJ7zd?Iusy#A;XVNO2oijpR@pQS5NrcDl zdeiFAk*?!Sv%Yq*i9hZaREh$q6ryMb7e{@PUtCqy|MOIBN3e z?tASYi|$;(EW~#>7lsgeZ=0GCN9?94sLc+$je4SuCuWi&&tX$$wNK9T(Z1iH!;BkG zCFwToMB1Wu4wRgzU&eS8>cL4w`w1SSdW=hjcWnIhBVfytN_0EYx`PUI6KeyF>+AP0 zn^mko3L|>7OJC>WjfJYJDiH8S_3WXW(038GQ~64G)D5f~R&jjtrGBZX%$lPk)-z57 zcG2Q2EQAZ$f7s_OYchT2X9O!ij>`BV^ON)#n+o7v^&Fw96qREu2Uewa0j=B!@+8yQ zgJpFRCS+`sic@Km-X-oiV@XwO=d?wP=)c1(E$+%NjakC;fw{+zOi9KZ`f^N1Ju^#i zDa|erw{T{oMX_5xoaQToirsd3nfeczD$D|2TASw!uOcP(&4UOtj8Z%nE~U4=`SL<3 zN=yw*xAjgOWydJ_5qc-(Ui|rH@<&O+)H9D2HYuB#jrVO6HAoT)~$2i`9-aZT?nj^hN5Ph350ch?%?Xg)yRvr+eslEXiCN VBXijPfX`n+RF$8>${(7({(oVQ=*Iv6 diff --git a/programs/develop/libraries/box_lib/trunk/tree_list_doc/info_treelist.htm b/programs/develop/libraries/box_lib/trunk/tree_list_doc/info_treelist.htm deleted file mode 100644 index 537d68c763..0000000000 --- a/programs/develop/libraries/box_lib/trunk/tree_list_doc/info_treelist.htm +++ /dev/null @@ -1,271 +0,0 @@ - - -¤ыхьхэЄ Tree List - - - - -

╬уыртыхэшх

-

┬тхфхэшх

-

╘єэъЎшш

- -

╤ЄЁєъЄєЁр tree_list

-

╤Єшыш ¤ыхьхэЄр

- -

┬тхфхэшх

-

┬эх°эшщ тшф ¤ыхьхэЄр єяЁртыхэш  TreeList:

-

-

╨шё. 1. ╬ъэю яЁюуЁрьь√ ё ¤ыхьхэЄюь TreeList

- -

╘єэъЎшш

- -

tl_data_init

-

╩юэёЄЁєъЄюЁ ¤ыхьхэЄр, эєцэю т√ч√трЄ№ яхЁхф шёяюы№чютрэшхь ¤ыхьхэЄр фы  т√фхыхэш  ярь Єш ш фЁєушї эрёЄЁюхъ.

-

tl_data_clear

-

─хёЄЁєъЄюЁ ¤ыхьхэЄр, ўшёЄшЄ ярь Є№ яю єърчрЄхы ь: data_info, data_nodes, data_img ш data_img_sys. ┼ёыш т яЁюуЁрььх шёяюы№чєхЄё  эхёъюы№ъю ¤ыхьхэЄют ё юфшэръют√ьш шъюэърьш, Єю єърчрЄхыш data_img ш data_img_sys эєцэю яЁшЁртэ Є№ ъ 0 т фЁєушї ¤ыхьхэЄрї, Єръ ўЄю-с√ яЁш т√чютх фхёЄЁєъЄюЁют эх с√ыю яютЄюЁэюую єфрыхэш  юфэшї ш Єхї цх шъюэюъ.

- -

tl_info_clear

-

╬ўшёЄър ёяшёър юЄ тёхї єчыют. ▌Єю фхщёЄтшх эхы№ч  юЄьхэшЄ№ ЇєэъЎшхщ tl_info_undo.

- -

tl_key

-

╘єэъЎш  ъюЄюЁє■ эєцэю т√ч√трЄ№ яЁш эрцрЄшш эр ъыртшрЄєЁє. - ╩эюяъш, ъюЄюЁ√х эх фюёЄєяэ√ хёыш хёЄ№ ёЄшы№ tl_key_no_edit: [Enter], [Delete], [], []. - ┬ёхуфр фюёЄєяэ√: [], [], [Page Up], [Page Dn], [Space]. - ╘єэъЎш  яЁютхЁ хЄ тъы■ўхэ ыш Ёхцшь scan ъюфют, ш т ёыєўрх эхюсїюфшьюёЄш ёрьр яЁхюсЁрчєхЄ ъюф√.

- -

tl_mouse

-

╘єэъЎш  фы  ёюс√Єшщ юЄ ь√°ш.

- -

tl_draw

-

╧юыэр  яхЁхЁшёютър юъэр ¤ыхьхэЄр.

- -

tl_info_undo

-

╬Єьхэ хЄ фюсртыхэшх єчыют. ─хщёЄтєхЄ Єюы№ъю эр тхё№ єчхы Ўхышъюь, эх єўшЄ√тр  шчьхэхэш  тэєЄЁш єчыют. ╥. х. эхы№ч  юЄьхэшЄ№ фхщёЄтш  т√яюыэхээ√х эряЁшьхЁ ЇєэъЎш ьш: tl_node_set_data, tl_node_lev_inc ш шь яюфюсэ√ь.

- -

tl_info_redo

-

╧ютЄюЁ юЄьхэхээ√ї фхщёЄтшщ. ╬сЁрЄэр  ЇєэъЎш  яю юЄэю°хэш■ ъ tl_info_undo.

- -

tl_node_add

-

─юсрты хЄ єчхы, т яючшЎш■ єърчрээє■ ъєЁёюЁюь. ╧ЁшьхЁ фюсртыхэш  єчыр:

-
  push dword tree1
-  push dword 0x10002
-  push dword data_buffer
-  call dword[tl_node_add]
-

уфх: tree1 - ёЄЁєъЄєЁр tree_list; - 0x10002 - ярЁрьхЄЁ√ єчыр (ёЄрЁ°шх срщЄ√ 0x0001 - шэфхъё шъюэъш, юЄюсЁрцрхьющ тючых єчыр; ьхэ№°шщ срщЄ 0x02 - єЁютхэ№ тыюцхэюёЄш єчыр); data_buffer - єърчрЄхы№ эр ф√ээ√х, фюсрты хь√х т єчхы.

- -

tl_node_set_data

-

╙ёЄрэртыштрхЄ эют√х фрээ√х (яюы№чютрЄхы№ёъшх ш яюфяшё№) т єчхы яюф ъєЁёюЁюь.

- -

tl_node_get_data

-

┴хЁхЄ єърчрЄхы№ эр фрээ√х (яюы№чютрЄхы№ёъшх ш яюфяшё№) шч єчыр яюф ъєЁёюЁюь.

- -

tl_node_delete

-

╙фры хЄ єчхы, эю эх юъюэўрЄхы№эю, яЁш эхюсїюфшьюёЄш єчхы ьюцэю тхЁэєЄ№ ЇєэъЎшхщ tl_info_undo.

- -

tl_cur_beg

-

╤ЄртшЄ ъєЁёюЁ т эрўрыю ёяшёър, яхЁхьрЄ√трхЄ ёъЁюыышэу хёыш эєцэю.

-

tl_cur_next

-

╧хЁхэюёшЄ ъєЁёюЁ эшцх.

-

tl_cur_perv

-

╧хЁхэюёшЄ ъєЁёюЁ т√°х.

-

tl_node_close_open

-

╬ЄъЁ√трхЄ шыш чръЁ√трхЄ ЁюфшЄхы№ёъшщ єчхы. ┼ёыш є єчыр эхЄ фюўхЁэшї ¤ыхьхэЄют, - Єю эшўхую эх фхырхЄ. └тЄюьрЄшўхёъш яхЁхЁшёют√трхЄ юъэю хёыш ёюёЄю эшх єчыр шчьхэшыюё№.

-

tl_node_lev_inc

-

─юсртшЄ№ єЁютхэ№ єчыр яюф ъєЁёюЁюь. ─хырхЄ єчхы фюўхЁэшь.

-

tl_node_lev_dec

-

╙ьхэ№°рхЄ єЁютхэ№ єчыр яюф ъєЁёюЁюь. ─хырхЄ єчхы ЁюфшЄхы№ёъшь.

- -

tl_node_move_up

-

╧хЁхьх∙рхЄ ттхЁї єчхы яюф ъєЁёюЁюь. ┬ьхёЄх ё єчыюь фтшурхЄё  Єръцх ш ъєЁёюЁ. ╧ЁшьхЁ шёяюы№чютрэш  ЇєэъЎшш:

-
  push dword tree1
-  call dword[tl_node_move_up] ;яхЁхьхёЄшЄ№ єчхы
-

уфх: tree1 - ёЄЁєъЄєЁр tree_list

- -

tl_node_move_down

-

╧хЁхьх∙рхЄ тэшч єчхы яюф ъєЁёюЁюь. ┬ьхёЄх ё єчыюь фтшурхЄё  Єръцх ш ъєЁёюЁ. ╧ЁшьхЁ шёяюы№чютрэш  ЇєэъЎшш:

-
  push dword tree1
-  call dword[tl_node_move_down] ;яхЁхьхёЄшЄ№ єчхы
-

уфх: tree1 - ёЄЁєъЄєЁр tree_list

- -

tl_node_poi_get_info

-

┴хЁхЄ тэєЄЁхээшщ єърчрЄхы№ эр ёЄЁєъЄєЁє юяшё√тр■∙є■ єчхы.

-

tl_node_poi_get_next_info

-

┴хЁхЄ єърчрЄхы№ эр ёыхфє■∙шщ ¤ыхьхэЄ т Ўхяш, схч єўхЄр юЄъЁ√Єш /чръЁ√Єш  фюўхЁэшї єчыют.

-

tl_node_poi_get_data

-

┴хЁхЄ єърчрЄхы№ эр фрээ√х (яюы№чютрЄхы№ёъшх ш яюфяшё№) шч єчыр єърчрээюую т єърчрЄхых.

- -

╘єэъЎш ьш tl_node_poi_get_info, tl_node_poi_get_next_info ш tl_node_poi_get_data ьюцэю ёўшЄ√трЄ№ шэЇюЁьрЎш■ ю єчырї ¤ыхьхэЄр, яЁш ¤Єюь эх ьхэ   Єхъє∙хую яюыюцхэш  ъєЁёюЁр. ╥. х. ьюцэю юЁурэшчютрЄ№ фюёЄєя ъ фрэ√ь ¤ыхьхэЄр т "Їюэютюь Ёхцшьх".

- -

tl_save_mem

-

╤юїЁрэ хЄ шэЇюЁьрЎш■ юс єчырї ¤ыхьхэЄр т ярь Є№. ╧ЁшьхЁ шёяюы№чютрэш  ЇєэъЎшш:

-
  MEM_SIZE equ 5000
-  node_data rb MEM_SIZE
-.........
-  push dword tree1
-  push dword 0
-  push dword node_data
-  push dword MEM_SIZE
-  call dword[tl_save_mem]
-  pop eax
-

уфх: tree1 - ёЄЁєъЄєЁр tree_list; - 0 - юяЎш  ёюїЁрэхэш  т эрўрыю сыюър ярь Єш (хёыш = 1, Єю фюсрты хЄ ¤ыхьхэЄ яюёых фЁєушї ёюїЁрэхээ√ї Ёрэхх); - node_data - єърчрЄхы№ эр сыюъ ярь Єш; - MEM_SIZE - ЁрчьхЁ сыюър ярь Єш фы  ёюїЁрэхэш . -┬ ЁхушёЄЁ eax яш°хЄё  чэрўхэшх 0 шыш чряшё√тр■Єё  ъюф√ ю°шсюъ ёюїЁрэхэш .

- -

tl_load_mem

-

╟руЁєцрхЄ шэЇюЁьрЎш■ юс єчырї ¤ыхьхэЄр шч ярь Єш. ╧ЁшьхЁ шёяюы№чютрэш  ЇєэъЎшш:

-
  MEM_SIZE equ 5000
-  node_data rb MEM_SIZE
-.........
-  push dword tree1
-  push dword 0
-  push dword node_data
-  push dword MEM_SIZE
-  call dword[tl_load_mem]
-  pop eax
-

уфх: tree1 - ёЄЁєъЄєЁр tree_list; - 0 - шэфхъё ёўшЄ√трхьюую ¤ыхьхэЄр; - node_data - єърчрЄхы№ эр сыюъ ярь Єш; - MEM_SIZE - ЁрчьхЁ сыюър ярь Єш фы  ёюїЁрэхэш . -┬ ЁхушёЄЁ eax яш°хЄё  чэрўхэшх 0 шыш чряшё√тр■Єё  ъюф√ ю°шсюъ ёўшЄ√трэш .

- -

tl_get_mem_size

-

┬√ўшёы хЄ ЁрчьхЁ сыюър ярь Єш (т ъюЄюЁ√щ с√ыш Ёрэ№°х ёюїЁрэхэ√ ¤ыхьхэЄ√).

- -

version_tree_list

-

┬хЁёш  ¤ыхьхэЄр

- -

╤ЄЁєъЄєЁр tree_list

-
struc tree_list info_size,info_max_count,style, img_cx,img_cy,\
-    col_bkg,col_zag,col_txt, box_l,box_t,box_w,box_h, capt_cy,info_capt_offs,\
-    info_capt_len,el_focus, p_scrol,on_press {
-  .data_info  dd 0
-  .info_size  dw info_size
-  .info_max_count dd info_max_count
-  .style      dd style
-  .data_nodes dd 0
-  .data_img   dd 0
-  .img_cx     dw img_cx
-  .img_cy     dw img_cy
-  .data_img_sys dd 0
-  .ch_tim     dd 0
-  .ls_tim     dd 0
-  .tim_undo   dd 0
-  .cur_pos    dd 0
-  .col_bkg    dd col_bkg
-  .col_zag    dd col_zag
-  .col_txt    dd col_txt
-  .box_left   dd box_l
-  .box_top    dd box_t
-  .box_width  dd box_w
-  .box_height dd box_h
-  .capt_cy    dw capt_cy
-  .info_capt_offs dw info_capt_offs
-  .info_capt_len  dw info_capt_len
-  .el_focus    dd el_focus
-  .p_scrol     dd p_scrol
-  rb 4
-  .on_activate dd 0
-  .on_press    dd on_press
-}
-

info_size - ъюышўхёЄтю срщЄ, ъюЄюЁюх сєфхЄ т√фхыхэю фы  ърцфюую єчыр. ╫рёЄ№ ¤Єющ ярь Єш яюы№чютрЄхы№ ьюцхЄ шёяюы№чютрЄ№ фы  ётюшї Ўхыхщ (ЁхуєышЁєхЄё  ўхЁхч info_capt_offs ш info_capt_len ёь. Ёшё. 2) р юёЄры№эр  ўрёЄ№ сєфхЄ шёяюы№чютрэр ъръ яюфяшё№ єчыр.

-

info_max_count - ьръёшьры№эюх ъюышўхёЄтю єчыют, ъюЄюЁ√х ьюцэю фюсртшЄ№ т ¤ыхьхэЄ.

-

style - ёЄшыш ¤ыхьхэЄр.

-

data_nodes - єърчрЄхы№ эр тэєЄЁхээшх ёЄЁєъЄєЁ√ єчыют (TreeList).

-

data_img - єърчрЄхы№ эр шчюсЁрцхэш  ё шъюэърьш єчыют.

-

data_img_sys - єърчрЄхы№ эр ёшёЄхьэ√х шчюсЁрцхэш  (ъєЁёюЁ, яы■ёшъш, ышэшш, ... тёх ъЁюьх шъюэюъ єчыют).

-

capt_cy - т√ёюЄр ёЄЁюъш фы  яюфяшёш ттхЁїє ¤ыхьхэЄр, хёыш ьхэ№°х 9 яюфяшё№ эх т√тюфшЄё .

-

info_capt_len - фышээр ЄхъёЄр фы  яюфяшёш. ┼ёыш Ёртэю 0, Єю фышээр ёўшЄрхЄё  Єръ: info_size - info_capt_offs.

-

p_scrol - єърчрЄхы№ эр ёЄЁєъЄєЁє ёъЁюыышэур, ёт чрээюую ё фрээ√ь ¤ыхьхэЄюь.

-

on_press - єърчрЄхы№ эр ЇєэъЎш■, ъюЄюЁр  сєфхЄ т√чтрэр яЁш эрцшЄшш [Enter]. ┼ёыш єърчрЄхы№ Ёртхэ 0 Єю эшўхую эх сєфхЄ т√ч√трЄё .

- -

-

╨шё. 2. ╧рЁрьхЄЁ√ info_size, info_capt_offs ш info_capt_len т єчых

- -

╧ЁшьхЁ ёючфрэш  ёЄЁєъЄєЁ√:

-
tree1 tree_list 24,500, tl_draw_par_line+tl_list_box_mode, 16,16,\
-    0x8080ff,0x0000ff,0xffffff, 10,35,200-16,285, 14,4,0,\
-    el_focus, wScr,fun_on_enter
- -

╤Єшыш ¤ыхьхэЄр

-

tl_key_no_edit

-

▌ыхьхэЄ эхы№ч  ЁхфръЄшЁютрЄ№ эр ъыртшрЄєЁх (шчьхэ Є№ єЁютэш, єфры Є№). ╤Єрт№Єх ¤ЄюЄ ёЄшы№ хёыш эєцэю ёючфрЄ№ ¤ыхьхэЄ Єюы№ъю фы  яЁюёьюЄЁр фрээ√ї.

-

tl_draw_par_line

-

╨шёютрЄ№ ышэшш ъ ЁюфшЄхы№ёъюьє єчыє.

-

tl_list_box_mode

-

╤Єшы№ эх юЄюсЁрцрхЄ єЁютэш (ъръ т ListBox тёх єчы√ юфэюую єЁютэ ).

- -
-

─юъєьхэЄрЎш  юсэюты ырё№ яюёыхфэшщ Ёрч 23.12.09.

- - \ No newline at end of file diff --git a/programs/develop/libraries/box_lib/trunk/tree_list_doc/window_tree_list.png b/programs/develop/libraries/box_lib/trunk/tree_list_doc/window_tree_list.png deleted file mode 100644 index 20087d5cbc889069313aef810dd031fdab9e15d3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10961 zcmZvCcUTk7vUUOiLJtCpKp=ofQ3Mo`PC^x=DIh3aM0(Ru4J{xbD4-+-gVe!%mpkra{guJDttOs+ybL)<8Gv`dQ5(jsJXaWVH#c zBg~mO#P|&5VTv5bUW}HwF_NqR9088l8b{ay`yBK*k|69o^JZ}=THC#E^e(38L6rB{^5Is}wl0O$)_wZFhCByR9>I$Bc*L`?>Edt@jy@ zdWrsAI(*~xf@8)0vMo4+v?$!6wV$At*a=QQmcT!jqsPk|au!{DoOg**=@hQ!)UwH?vH6QmyEj?v zCx{mD1%G89CYbmgkglT+X2`*~t7j6j@|i{*f?Q?4t0&bVQ0y5Lu+Oqzb|36CR`J2z zH(!=~oMNYS!=%xlkHY;6#@gL}_N!oEIu&}1!#e|57Rl)olNMoPA5>ky{X2m3m|w1z zCwTgE4?SZbUu3vqlq*h^@|KsgoSWON)vI*jP^H}soe$8^RN-{Kh0GDJo>W|0sWI-B z*S)6nEFS%nstt#}!PM1{oD-*Z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xo+NqyfH+f#K+4}_xR+z9C`)dFa zbgUC;+8c(%?I)&-b;XB@Obr(B%w8SAr>CD`*4`gj)kXY5t$alO){mCD$pOR-pn)K5 z>Xfs|Qx^Rq@|L773=_T|xH9x7e8c8GuF4VocMJKuupwRl%z;-F8B=+xF+WIuP5)MO z$Qy?7X~BEo-_Z4YMZ~S2&7`qH|JOzJ*G!I>Qe5watHB|Tuq9%bZ=|3JAoiUI1=U~g z`tRo)lnTT;)rFNVB;*HU9YUv|K~fhlA^UN(GW+AYOaqvSr^da%JNw*`G0=-86&)btw$LVw6;%&to+_0Jz@l7f~O<7ARPr)4h EKR4~nl>h($ diff --git a/programs/develop/libraries/fontslib/trunk/font_ex.asm b/programs/develop/libraries/fontslib/trunk/font_ex.asm index d2d6fd4927..99ff1183cc 100644 --- a/programs/develop/libraries/fontslib/trunk/font_ex.asm +++ b/programs/develop/libraries/fontslib/trunk/font_ex.asm @@ -25,113 +25,113 @@ ;***************************************************************************** ;заголовок приложения -use32 ; транслятор, использующий 32 разрядных команды - org 0x0 ; базовый адрес кода, всегда 0x0 - db 'MENUET01' ; идентификатор исполняемого файла (8 байт) - dd 0x1 ; версия формата заголовка исполняемого файла - dd start ; адрес, на который система передаёт управление - ; после загрузки приложения в память - dd mem ; размер приложения - dd mem ; Объем используемой памяти, для стека отведем 0х100 байт и выровним на грницу 4 байта - dd mem ; расположим позицию стека в области памяти, сразу за телом программы. Вершина стека в диапазоне памяти, указанном выше - dd 0x0 ; указатель на строку с параметрами. +use32 ; транслятор, использующий 32 разрядных команды + org 0x0 ; базовый адрес кода, всегда 0x0 + db 'MENUET01' ; идентификатор исполняемого файла (8 байт) + dd 0x1 ; версия формата заголовка исполняемого файла + dd start ; адрес, на который система передаёт управление + ; после загрузки приложения в память + dd mem ; размер приложения + dd mem ; Объем используемой памяти, для стека отведем 0х100 байт и выровним на грницу 4 байта + dd mem ; расположим позицию стека в области памяти, сразу за телом программы. Вершина стека в диапазоне памяти, указанном выше + dd 0x0 ; указатель на строку с параметрами. dd way_of_ini include '../../../../macros.inc' -include '../../box_lib/asm/trunk/editbox_ex.mac' +include '../../box_lib/trunk/box_lib.mac' include '../../box_lib/load_lib.mac' - @use_library ;use load lib macros + @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 ;установить маску для ожидаемых событий + cmp eax,-1 + jz exit + mcall 40,0x27 ;установить маску для ожидаемых событий - 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 + 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] ; инициализация списка шрифтов - push dword (8 shl 16 +16) ; поиск нужного шрифта в наборе шрифтов (пока доступен только 8х16) + call [initialization_font] ; инициализация списка шрифтов + push dword (8 shl 16 +16) ; поиск нужного шрифта в наборе шрифтов (пока доступен только 8х16) call [get_font] - test eax,eax ;нашли ? - jnz exit + test eax,eax ;нашли ? + jnz exit ;;;;;;;;;;;;;;;;;;;; - mcall 40,0x27 ;установить маску для ожидаемых событий + mcall 40,0x27 ;установить маску для ожидаемых событий red_win: - call draw_window ;первоначально необходимо нарисовать окно + call draw_window ;первоначально необходимо нарисовать окно align 4 -still: ;основной обработчик - mcall 10 ;Ожидать события - dec eax - jz red_win - dec eax - jz key - dec eax - jz button +still: ;основной обработчик + mcall 10 ;Ожидать события + dec eax + jz red_win + dec eax + jz key + dec eax + jz button - push dword edit1 - call [edit_box_mouse] + push dword edit1 + call [edit_box_mouse] - jmp still ;если ничего из перечисленного то снова в цикл + jmp still ;если ничего из перечисленного то снова в цикл ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; button: - mcall 17 ;получить идентификатор нажатой клавиши - test ah,ah ;если в ah 0, то перейти на обработчик событий still - jz still -exit: - call [free_fulder_info] - call [free_font] - mcall -1 + mcall 17 ;получить идентификатор нажатой клавиши + test ah,ah ;если в ah 0, то перейти на обработчик событий still + jz still +exit: + call [free_fulder_info] + call [free_font] + mcall -1 key: - mcall 2 ;загрузим значение 2 в регистор eax и получим код нажатой клавиши + mcall 2 ;загрузим значение 2 в регистор eax и получим код нажатой клавиши - push dword edit1 - call [edit_box_key] + push dword edit1 + call [edit_box_key] - mcall 13,<20,650>,<40,16>, dword[con_colors+4] + mcall 13,<20,650>,<40,16>, dword[con_colors+4] - push dword 20 shl 16 + 40 ; esp+12= dd x shl 16 + y x- координата по Х, y - координата по Y - push dword con_colors ; esp+8 = dd point to color of background and font - push dword text ; esp+4 = dd point to ASCIIZ + push dword 20 shl 16 + 40 ; esp+12= dd x shl 16 + y x- координата по Х, y - координата по 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] ; вывести по глифам строчку + call [font_draw_on_string] ; вывести по глифам строчку - jmp still + jmp still ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>> align 4 -draw_window: ;рисование окна приложения - mcall 12,1 - xor eax,eax ;обнулить eax - mov ebx,50*65536+680 ;[координата по оси x]*65536 + [размер по оси x] - mov ecx,30*65536+200 ;[координата по оси y]*65536 + [размер по оси y] - mov edx,[sc.work] ; color of work area RRGGBB,8->color gl - or edx,0x34000000 - mov edi,hed - mcall ;нарисовать окно приложения - - push dword edit1 - call [edit_box_draw] +draw_window: ;рисование окна приложения + mcall 12,1 + xor eax,eax ;обнулить eax + mov ebx,50*65536+680 ;[координата по оси x]*65536 + [размер по оси x] + mov ecx,30*65536+200 ;[координата по оси y]*65536 + [размер по оси y] + mov edx,[sc.work] ; color of work area RRGGBB,8->color gl + or edx,0x34000000 + mov edi,hed + mcall ;нарисовать окно приложения + + push dword edit1 + call [edit_box_draw] ; - push dword 20 shl 16 + 40 ; esp+12= dd x shl 16 + y x- координата по Х, y - координата по Y - push dword con_colors ; esp+8 = dd point to color of background and font - push dword text; esp+4 = dd point to ASCIIZ + push dword 20 shl 16 + 40 ; esp+12= dd x shl 16 + y x- координата по Х, y - координата по 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] ; вывести по глифам строчку - mov eax,12 ;Функция 12 - начать/закончить перерисовку окна. - mov ebx,2 ;Подфункция 2 - закончить перерисовку окна. - mcall - ret + call [font_draw_on_string] ; вывести по глифам строчку + mov eax,12 ;Функция 12 - начать/закончить перерисовку окна. + mov ebx,2 ;Подфункция 2 - закончить перерисовку окна. + mcall + ret ;;;;;;;;;;;; ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;DATA данные @@ -143,53 +143,53 @@ library02 l_libs library_name1, way_of_ini, library_path, system_path1, err_mess end_l_libs: ; -system_path db '/sys/lib/' -library_name db 'fonts_lib.obj',0 +system_path db '/sys/lib/' +library_name db 'fonts_lib.obj',0 -system_path1 db '/sys/lib/' -library_name1 db 'box_lib.obj',0 +system_path1 db '/sys/lib/' +library_name1 db 'box_lib.obj',0 -err_message_found_lib db 'Sorry I cannot load library fonts_lib.obj',0 -err_message_found_lib1 db 'Sorry I cannot load library box_lib.obj',0 +err_message_found_lib db 'Sorry I cannot load library fonts_lib.obj',0 +err_message_found_lib1 db 'Sorry I cannot load library box_lib.obj',0 head_f_i: -head_f_l db 'System error',0 -err_message_import db 'Error on load import library fonts_lib.obj',0 -err_message_import1 db 'Error on load import library box_lib.obj',0 +head_f_l db 'System error',0 +err_message_import db 'Error on load import library fonts_lib.obj',0 +err_message_import1 db 'Error on load import library 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 +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 - dd 0 + dd 0 + dd 0 -aEdit_box_draw db 'edit_box',0 -aEdit_box_key db 'edit_box_key',0 +aEdit_box_draw db 'edit_box',0 +aEdit_box_key db 'edit_box_key',0 aEdit_box_mouse db 'edit_box_mouse',0 -aVersion_ed db 'version_ed',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 +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 +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 @@ -200,17 +200,17 @@ text_end: rb 256 test_leght = ($-text)-1 -hed db "Font's demo ",0 +hed db "Font's demo ",0 align 4 -con_colors dd 0x1E1EFF, 0x96FFCF +con_colors dd 0x1E1EFF, 0x96FFCF align 4 sc system_colors -way_of_ini rb 4096 -library_path rb 4096 +way_of_ini rb 4096 +library_path rb 4096 align 4 i_end: rb 1024 mem: - ;конец кода \ No newline at end of file + ;конец кода \ No newline at end of file diff --git a/programs/media/scrshoot/scrshoot.asm b/programs/media/scrshoot/scrshoot.asm index 3460f138c5..d54a618b2f 100644 --- a/programs/media/scrshoot/scrshoot.asm +++ b/programs/media/scrshoot/scrshoot.asm @@ -1,4 +1,4 @@ -; 01.06.09 - Компоненты беруться из системной библиотеки +; 01.06.09 - Компоненты беруться из системной библиотеки ; Автор программы Евтихов Максим (Maxxxx32) ; 24.07.2008 обновлен editbox ; 01.02.07 - обновлён editbox @@ -6,7 +6,7 @@ title equ 'Screenshooter v 0.92' ; Заголовок окна include '../../develop/libraries/box_lib/load_lib.mac' -include '../../develop/libraries/box_lib/asm/trunk/editbox_ex.mac' +include '../../develop/libraries/box_lib/trunk/box_lib.mac' ;include '../../develop/examples/editbox/trunk/editbox.inc' include '../../macros.inc' include 'txtbut.inc' @@ -16,7 +16,7 @@ include 'scrshoot.mac' ;include 'macros.inc' ; вставляем макросы ; meos_header cmdstr ; вставляем заголовок программы -use32 +use32 org 0x0 db 'MENUET01' dd 0x1 @@ -28,16 +28,34 @@ use32 dd cur_dir_path align 4 - @use_library - use_txt_button ; | - use_label ; |-- GUI компоненты и некоторые процедуры - use_text_work ; / + @use_library + use_txt_button ; | + use_label ; |-- GUI компоненты и некоторые процедуры + use_text_work ; / include 'scrwin.inc' ; вставляем код окна прдпросмотра include 'scrsavef.inc'; вставляем процедуру сохранения файла include 'gp.inc' include 'srectwin.inc' include 'lang.inc' + +macro get_sys_colors col_buf +{ + ;mov eax,48 + push 48 + pop eax + ;mov ebx,3 + push 3 + pop ebx + ;mov ecx,col_buf + push col_buf + pop ecx + ;mov edx,40 + push 40 + pop edx + mcall +} + ;--- начало программы --- align 4 start: @@ -45,534 +63,534 @@ sys_load_library library_name, cur_dir_path, library_path, system_path, \ err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i ;if return code =-1 then exit, else nornary work ; cmp eax,-1 - inc eax - test eax,eax - jz close + inc eax + test eax,eax + jz close ;;;;;;;;;;;;;;;; init memory 68/11 - mov eax,68 - mov ebx,11 - mcall - test eax,eax - jz close + mov eax,68 + mov ebx,11 + mcall + test eax,eax + jz close - ;mov al,[gs:1280*4*1024] - ; устанавливаем ipc буффер - push 60 - pop eax - ;mov ebx,1 - xor ebx,ebx - inc ebx - mov ecx,app_ipc - mov edx,32 - mcall + ;mov al,[gs:1280*4*1024] + ; устанавливаем ipc буффер + push 60 + pop eax + ;mov ebx,1 + xor ebx,ebx + inc ebx + mov ecx,app_ipc + mov edx,32 + mcall - push 66 ; устанавливаем глобальную горячую клавишу - pop eax - push eax - mov ebx,4 - mov cl,55 ; 55 - PrintScrn - xor edx,edx - mcall + push 66 ; устанавливаем глобальную горячую клавишу + pop eax + push eax + mov ebx,4 + mov cl,55 ; 55 - PrintScrn + xor edx,edx + mcall - mov ebx,app - call get_slot_n - mov [slot_n],ecx + mov ebx,app + call get_slot_n + mov [slot_n],ecx - ; устанавливаем маску событий - set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse+evm_ipc) + ; устанавливаем маску событий + set_events_mask (evm_redraw+evm_key+evm_button+evm_mouse+evm_ipc) ; сюда прыгаем при каждой перерисовке red: - get_procinfo app ; получаем информацию о процессе - get_sys_colors sc ; получаем системные цвета + get_procinfo app ; получаем информацию о процессе + get_sys_colors sc ; получаем системные цвета - ; устанавливаем системные цвета у GUI компонентов - txt_but_set_sys_color buttons,buttons_end,sc ; \ - labels_set_sys_color labels,labels_end,sc ; | - check_boxes_set_sys_color check_boxes,check_boxes_end,sc ; | - edit_boxes_set_sys_color editboxes,editboxes_end,sc ; / + ; устанавливаем системные цвета у GUI компонентов + txt_but_set_sys_color buttons,buttons_end,sc ; \ + labels_set_sys_color labels,labels_end,sc ; | + check_boxes_set_sys_color check_boxes,check_boxes_end,sc ; | + edit_boxes_set_sys_color editboxes,editboxes_end,sc ; / - get_screen_prop scr ; получаем информацию об экране - call draw_window ; перерисовываем окно + get_screen_prop scr ; получаем информацию об экране + call draw_window ; перерисовываем окно still: - wait_event red,key,button,mouse,ipc,still ; ждем событий + wait_event red,key,button,mouse,ipc,still ; ждем событий key: - get_key - cmp al,2 - jne @f - cmp ah,55 - jne @f - call shoot - jmp still + get_key + cmp al,2 + jne @f + cmp ah,55 + jne @f + call shoot + jmp still @@: ; key_edit_boxes editboxes,editboxes_end - push dword edit1 - call [edit_box_key] + push dword edit1 + call [edit_box_key] - push dword edit2 - call [edit_box_key] + push dword edit2 + call [edit_box_key] - push dword edit3 - call [edit_box_key] + push dword edit3 + call [edit_box_key] - push dword edit4 - call [edit_box_key] + push dword edit4 + call [edit_box_key] - jmp still + jmp still button: - get_pressed_button - cmp ah,1 - je p_close - txt_but_ev buttons,buttons_end - jmp still + get_pressed_button + cmp ah,1 + je p_close + txt_but_ev buttons,buttons_end + jmp still mouse: - get_active_window - cmp eax,[slot_n] - jne still + get_active_window + cmp eax,[slot_n] + jne still ;---------------------------------- - push dword edit1 - call [edit_box_mouse] - push dword edit2 - call [edit_box_mouse] - push dword edit3 - call [edit_box_mouse] - push dword edit4 - call [edit_box_mouse] + push dword edit1 + call [edit_box_mouse] + push dword edit2 + call [edit_box_mouse] + push dword edit3 + call [edit_box_mouse] + push dword edit4 + call [edit_box_mouse] ;---------------------------------- - push dword ch1 - call [check_box_mouse] - push dword ch2 - call [check_box_mouse] - push dword ch3 - call [check_box_mouse] - push dword ch4 - call [check_box_mouse] - push dword ch5 - call [check_box_mouse] - push dword ch6 - call [check_box_mouse] - push dword use_rect - call [check_box_mouse] + push dword ch1 + call [check_box_mouse] + push dword ch2 + call [check_box_mouse] + push dword ch3 + call [check_box_mouse] + push dword ch4 + call [check_box_mouse] + push dword ch5 + call [check_box_mouse] + push dword ch6 + call [check_box_mouse] + push dword use_rect + call [check_box_mouse] ;----------------------------------- ; mouse_check_boxes check_boxes,check_boxes_end ; mouse_edit_boxes editboxes,editboxes_end - jmp still + jmp still ipc: - cmp word [app_ipc+8],2 - jne @f - min_window - jmp .clear_ipc + cmp word [app_ipc+8],2 + jne @f + min_window + jmp .clear_ipc @@: - cmp word [app_ipc+8],3 - jne @f - mov ecx,[slot_n] - activ_window - jmp .clear_ipc + cmp word [app_ipc+8],3 + jne @f + mov ecx,[slot_n] + activ_window + jmp .clear_ipc @@: - call draw_number - call dr_st + call draw_number + call dr_st .clear_ipc: - cld - xor eax,eax - mov ecx,32/4 - mov edi,app_ipc - rep stosd - jmp still + cld + xor eax,eax + mov ecx,32/4 + mov edi,app_ipc + rep stosd + jmp still p_close: - btr dword [flags],1 + btr dword [flags],1 - bt dword [flags],3 - jnc @f - mov eax,18 - mov ebx,eax - mov ecx,[set_rect_window_pid] - mcall + bt dword [flags],3 + jnc @f + mov eax,18 + mov ebx,eax + mov ecx,[set_rect_window_pid] + mcall @@: close: - app_close + app_close ;-------------------------------------------------------------------- ;--- прооцедура перерисовки главного окна --------------------------- ;-------------------------------------------------------------------- draw_window: -start_draw_window ; начало перерисовки - ; определяем окно - get_skin_height - mov ebx,100*65536+320 - mov ecx,100*65536+220 - add cx,ax - mov edx,[sc.work] - or edx,0x34000000;0x33000000 - xor esi,esi - ;xor edi,edi - mov edi,grab_text - xor eax,eax - mcall +start_draw_window ; начало перерисовки + ; определяем окно + get_skin_height + mov ebx,100*65536+320 + mov ecx,100*65536+220 + add cx,ax + mov edx,[sc.work] + or edx,0x34000000;0x33000000 + xor esi,esi + ;xor edi,edi + mov edi,grab_text + xor eax,eax + mcall - mov eax,47 ; выводим числа в окно - mov bx,4 - shl ebx,16 - movsx ecx,word [scr.width] ; ширина экрана - mov dx,95 - shl edx,16 - mov dx,[label1.top] - push dx - mov esi,[sc.work_text] - mcall - movsx ecx,word [scr.height] ; высота экрана - mov dx,[label2.top] - mcall - mov bx,2 - shl ebx,16 - movsx ecx,word [scr.bitspp] ; бит на пиксель - mov dx,240 - shl edx,16 - pop dx - mcall - mov bx,6 - shl ebx,16 - mov ecx,[scr.bytesps] ; байт на строку - mov dx,[label2.top] - mcall + mov eax,47 ; выводим числа в окно + mov bx,4 + shl ebx,16 + movsx ecx,word [scr.width] ; ширина экрана + mov dx,95 + shl edx,16 + mov dx,[label1.top] + push dx + mov esi,[sc.work_text] + mcall + movsx ecx,word [scr.height] ; высота экрана + mov dx,[label2.top] + mcall + mov bx,2 + shl ebx,16 + movsx ecx,word [scr.bitspp] ; бит на пиксель + mov dx,240 + shl edx,16 + pop dx + mcall + mov bx,6 + shl ebx,16 + mov ecx,[scr.bytesps] ; байт на строку + mov dx,[label2.top] + mcall - call draw_number ; прорисовываем номер снимка - call dr_st + call draw_number ; прорисовываем номер снимка + call dr_st - draw_labels labels,labels_end ; метки + draw_labels labels,labels_end ; метки ; draw_edit_boxes editboxes,editboxes_end ; edit_box ;------ show check editbox ----------- - push dword edit1 - call [edit_box_draw] - push dword edit2 - call [edit_box_draw] - push dword edit3 - call [edit_box_draw] - push dword edit4 - call [edit_box_draw] + push dword edit1 + call [edit_box_draw] + push dword edit2 + call [edit_box_draw] + push dword edit3 + call [edit_box_draw] + push dword edit4 + call [edit_box_draw] ;------ end check all editbox ------- - draw_txt_buttons buttons,buttons_end ; кнопки + draw_txt_buttons buttons,buttons_end ; кнопки ; draw_check_boxes check_boxes,check_boxes_end ; флажки ;------ check all checkbox --------- - push dword ch1 - call [check_box_draw] - push dword ch2 - call [check_box_draw] - push dword ch3 - call [check_box_draw] - push dword ch4 - call [check_box_draw] - push dword ch5 - call [check_box_draw] - push dword ch6 - call [check_box_draw] - push dword use_rect - call [check_box_draw] + push dword ch1 + call [check_box_draw] + push dword ch2 + call [check_box_draw] + push dword ch3 + call [check_box_draw] + push dword ch4 + call [check_box_draw] + push dword ch5 + call [check_box_draw] + push dword ch6 + call [check_box_draw] + push dword use_rect + call [check_box_draw] ;------ end check all checkbox ------ stop_draw_window ; конец перерисовки ret shoot: - bt dword [ch4.flags],1 ; включена ли задержка ? - jnc @f - draw_status delay_now - mov edi,ed_buffer.2 - call zstr_to_int - mov ebx,eax - delay + bt dword [ch4.flags],1 ; включена ли задержка ? + jnc @f + draw_status delay_now + mov edi,ed_buffer.2 + call zstr_to_int + mov ebx,eax + delay @@: - call get_mem_for_shoot; получаем память для снимка + call get_mem_for_shoot; получаем память для снимка - bts dword [flags],0 ; нулевой флаг - снимок есть в памяти + bts dword [flags],0 ; нулевой флаг - снимок есть в памяти - ; делаем снимок - draw_status shooting - mov esi,scr - mov edi,[scr_buf.ptr] - call copy_screen_to_image + ; делаем снимок + draw_status shooting + mov esi,scr + mov edi,[scr_buf.ptr] + call copy_screen_to_image - bt dword [use_rect.flags],1 - jc .use_rect - push dword [scr] - jmp @f + bt dword [use_rect.flags],1 + jc .use_rect + push dword [scr] + jmp @f .use_rect: - push dword [rect.height] + push dword [rect.height] @@: - pop dword [scr_buf.size] + pop dword [scr_buf.size] - bt dword [ch5.flags],1 ; включено ли автосохранение ? - jnc @f - call save_file + bt dword [ch5.flags],1 ; включено ли автосохранение ? + jnc @f + call save_file @@: - draw_status shooted_ok + draw_status shooted_ok - bt dword [flags],1 - jnc @f - ret -@@: - - bt dword [ch2.flags],1 ; показать окно предпросмотра ? - jnc @f - - call show_scr_window + bt dword [flags],1 + jnc @f ret @@: - bt word [ch3.flags],1 ; восстановить окно ? - jnc @f - delay 100 - mov ecx,[slot_n] - activ_window + bt dword [ch2.flags],1 ; показать окно предпросмотра ? + jnc @f + + call show_scr_window + ret +@@: + bt word [ch3.flags],1 ; восстановить окно ? + jnc @f + + delay 100 + mov ecx,[slot_n] + activ_window @@: ret ;--- получить память для снимка --- get_mem_for_shoot: ;clean memory - mov ecx,dword [scr_buf.ptr] - mov ebx,13 - mov eax,68 - mcall + mov ecx,dword [scr_buf.ptr] + mov ebx,13 + mov eax,68 + mcall - bt dword [use_rect.flags],1 ; фоткать область экрана - jc .use_area - movzx ecx, word [scr.width] - movzx ebx, word [scr.height] - jmp @f + bt dword [use_rect.flags],1 ; фоткать область экрана + jc .use_area + movzx ecx, word [scr.width] + movzx ebx, word [scr.height] + jmp @f .use_area: - call read_rect - movzx ecx, word [rect.width] - movzx ebx, word [rect.height] + call read_rect + movzx ecx, word [rect.width] + movzx ebx, word [rect.height] @@: - imul ecx,ebx - lea ecx,[ecx*3] + imul ecx,ebx + lea ecx,[ecx*3] ; add ecx,i_end - mov ebx,12 - mov eax,68 - mcall - mov [scr_buf.ptr],eax - add eax,ecx - mov [scr_buf.end_ptr],ecx + mov ebx,12 + mov eax,68 + mcall + mov [scr_buf.ptr],eax + add eax,ecx + mov [scr_buf.end_ptr],ecx ret ;--- содать окно проедпросмотра --- show_scr_window: pusha - bt dword [flags],0 - jnc @f - mov eax,51 - xor ebx,ebx - inc ebx - mov ecx,scr_window - mov edx,i_end_tread-1000 - mcall + bt dword [flags],0 + jnc @f + mov eax,51 + xor ebx,ebx + inc ebx + mov ecx,scr_window + mov edx,i_end_tread-1000 + mcall @@: popa ret ;--- прочитать и нарисовать текущий номер --- apply_number: - mov edi,ed_buffer.3 - call zstr_to_int - mov [cur_number],eax - call draw_number + mov edi,ed_buffer.3 + call zstr_to_int + mov [cur_number],eax + call draw_number ret ;--- процедура прорисовки текущего номера --- draw_number: - mov edi,sign_n_input - call zstr_to_int - mov [sign_n],al - mov eax,13 - mov ebx,150*65536+96 - mov cx,[label9.top] - shl ecx,16 - mov cx,10 - mov edx,[sc.work] - mcall - mov eax,47 - movsx bx,byte [sign_n] - shl ebx,16 - mov ecx,[cur_number] - mov dx,150 - shl edx,16 - mov dx,[label9.top] - mov esi,[sc.work_text] - mcall + mov edi,sign_n_input + call zstr_to_int + mov [sign_n],al + mov eax,13 + mov ebx,150*65536+96 + mov cx,[label9.top] + shl ecx,16 + mov cx,10 + mov edx,[sc.work] + mcall + mov eax,47 + movsx bx,byte [sign_n] + shl ebx,16 + mov ecx,[cur_number] + mov dx,150 + shl edx,16 + mov dx,[label9.top] + mov esi,[sc.work_text] + mcall ret ;--- процедура, запускающая поток автосъемки --- start_autoshoot: - bts dword [flags],1 - jc @f - mov eax,51 - ;mov ebx,1 - xor ebx,ebx - inc ebx - mov ecx,autoshoot - mov edx,i_end_tread-512 - mcall + bts dword [flags],1 + jc @f + mov eax,51 + ;mov ebx,1 + xor ebx,ebx + inc ebx + mov ecx,autoshoot + mov edx,i_end_tread-512 + mcall @@: ret ;--- останавливает этот поток --- stop_autoshoot: - btr dword [flags],1 + btr dword [flags],1 ret ;--- цикл потока автосъемки --- autoshoot: - mov ecx,[slot_n] - activ_window + mov ecx,[slot_n] + activ_window .next: - bt dword [flags],1 - jnc close - mov eax,60 - mov ebx,2 - mov ecx,[app.pid] - mov edx,messages.draw_number - mov esi,2 - mcall - call shoot - jmp autoshoot.next + bt dword [flags],1 + jnc close + mov eax,60 + mov ebx,2 + mov ecx,[app.pid] + mov edx,messages.draw_number + mov esi,2 + mcall + call shoot + jmp autoshoot.next ;--- процедура прорисовки строки состояния --- ; (должна вызываться потоком главного окна) dr_st: - mov eax,38 ; отрезок - mov ebx,0*65536+310 - mov ecx,198*65536+198 - mov edx,[sc.work_graph] - mcall + mov eax,38 ; отрезок + mov ebx,0*65536+310 + mov ecx,198*65536+198 + mov edx,[sc.work_graph] + mcall - mov eax,13 ; полоска - mov bx,310 - mov ecx,199*65536+15 - mov edx,[sc.work] - mcall + mov eax,13 ; полоска + mov bx,310 + mov ecx,199*65536+15 + mov edx,[sc.work] + mcall - mov edi,status - call draw_label + mov edi,status + call draw_label ret ;--- процедура получения номера слота потока --- ; вход ebx - буффер 1024 байт ; выход ecx - номер слота get_slot_n: - mov eax,9 - xor ecx,ecx - dec ecx - mcall + mov eax,9 + xor ecx,ecx + dec ecx + mcall - mov edx,[ebx+30] - xor ecx,ecx + mov edx,[ebx+30] + xor ecx,ecx @@: - mov eax,9 - inc ecx - mcall - cmp [ebx+30],edx - je @f - jmp @b + mov eax,9 + inc ecx + mcall + cmp [ebx+30],edx + je @f + jmp @b @@: ret ;--- процедура, запускающая поток, делающий 1 снимок --- one_shoot: - mov ecx,one_shoot_thread - mov edx,shoot_esp - jmp @f + mov ecx,one_shoot_thread + mov edx,shoot_esp + jmp @f ;--- процедра, запускающая поток, сохраняющий снимок --- save_shoot: - mov ecx,save_shoot_thread - mov edx,shoot_esp + mov ecx,save_shoot_thread + mov edx,shoot_esp @@: - bts dword [flags],2 - jc .running - bt dword [flags],1 - jc .running + bts dword [flags],2 + jc .running + bt dword [flags],1 + jc .running - mov eax,51 - ;mov ebx,1 - xor ebx,ebx - inc ebx - mcall + mov eax,51 + ;mov ebx,1 + xor ebx,ebx + inc ebx + mcall .running: ret ;--- поток, делающий 1 снимок --- one_shoot_thread: - mov ecx,[slot_n] - activ_window - bt dword [ch1.flags],1 ; минимизировать окно ? - jnc @f - mov eax,60 - mov ebx,2 - mov ecx,[app.pid] - mov edx,messages.min_window - mov esi,2 - mcall + mov ecx,[slot_n] + activ_window + bt dword [ch1.flags],1 ; минимизировать окно ? + jnc @f + mov eax,60 + mov ebx,2 + mov ecx,[app.pid] + mov edx,messages.min_window + mov esi,2 + mcall @@: - call shoot - btr dword [flags],2 - jmp close + call shoot + btr dword [flags],2 + jmp close ;--- процедура, отправляющая главному окну сообщение о перерисовке ; строки состояния --- send_draw_status: - mov eax,60 - mov ebx,2 - mov ecx,[app.pid] - mov edx,messages.draw_status - mov esi,2 - mcall + mov eax,60 + mov ebx,2 + mov ecx,[app.pid] + mov edx,messages.draw_status + mov esi,2 + mcall ret ;--- поток, сохраняюий файл --- save_shoot_thread: - mov ecx,[slot_n] - activ_window - call save_file - btr dword [flags],2 - jmp close + mov ecx,[slot_n] + activ_window + call save_file + btr dword [flags],2 + jmp close ;--- процедура, запускающая поток окна установки области съемки --- show_set_rect_window: - bts dword [flags],3 - jc @f - mov eax,51 - xor ebx,ebx - inc ebx - mov ecx,set_rect_window - mov edx,set_rect_window_esp - mcall + bts dword [flags],3 + jc @f + mov eax,51 + xor ebx,ebx + inc ebx + mov ecx,set_rect_window + mov edx,set_rect_window_esp + mcall - mov [set_rect_window_pid],eax + mov [set_rect_window_pid],eax ret @@: - mov eax,18 - mov ebx,eax - mov ecx,[set_rect_window_pid] - mcall - btr dword [flags],3 + mov eax,18 + mov ebx,eax + mov ecx,[set_rect_window_pid] + mcall + btr dword [flags],3 ret ;--- получение информации об активном окне --- get_active_window_info: - mov eax,18 - mov ebx,7 - mcall + mov eax,18 + mov ebx,7 + mcall - mov ecx,eax - mov eax,9 - mov ebx,active_app - mcall + mov ecx,eax + mov eax,9 + mov ebx,active_app + mcall ret ;==================================================================== @@ -585,7 +603,7 @@ messages: .act_window dw 3 grab_text: - db title,0 + db title,0 labels: label1 label 5,5,0,text.1 ; ширина экрана @@ -602,19 +620,19 @@ status label 5,201,0,no_shoot labels_end: editboxes: -edit1 edit_box 300,5,35,cl_white,0,0,0,0,300,ed_buffer.1,mouse_dd,ed_focus,10,10 ; путь к файлу -edit2 edit_box 35,75,134,cl_white,0,0,0,0,9,ed_buffer.2,mouse_dd,ed_figure_only,3,3 ; задержка +edit1 edit_box 300,5,35,cl_white,0,0,0,0,300,ed_buffer.1,mouse_dd,ed_focus,10,10 ; путь к файлу +edit2 edit_box 35,75,134,cl_white,0,0,0,0,9,ed_buffer.2,mouse_dd,ed_figure_only,3,3 ; задержка edit3 edit_box 35,165,164,cl_white,0,0,0,0,9,ed_buffer.3,mouse_dd,ed_figure_only ; автонумерация edit4 edit_box 16,165,181,cl_white,0,0,0,0,1,sign_n_input,mouse_dd,ed_figure_only,1 editboxes_end: buttons: -but1 txt_button 150,5,15,65,2,0,0,but_text.1,one_shoot ; сделать снимок -but2 txt_button 145,160,15,65,3,0,0,but_text.2,save_shoot ; сохранить снимок +but1 txt_button 150,5,15,65,2,0,0,but_text.1,one_shoot ; сделать снимок +but2 txt_button 145,160,15,65,3,0,0,but_text.2,save_shoot ; сохранить снимок but3 txt_button 140,115,12,120,4,0,0,but_text.3,show_scr_window ; показать снимок -but4 txt_button 80,205,15,163,5,0,0,but_text.4,apply_number ; применить номер -but5 txt_button 150,5,15,85,6,0,0,but_text.5,start_autoshoot ; начать автосъёмку -but6 txt_button 145,160,15,85,7,0,0,but_text.6,stop_autoshoot ; остановить автосъёмку +but4 txt_button 80,205,15,163,5,0,0,but_text.4,apply_number ; применить номер +but5 txt_button 150,5,15,85,6,0,0,but_text.5,start_autoshoot ; начать автосъёмку +but6 txt_button 145,160,15,85,7,0,0,but_text.6,stop_autoshoot ; остановить автосъёмку but7 txt_button 40,205,10,150,8,0,0,but_text.7,show_set_rect_window ; задать область buttons_end: @@ -726,7 +744,7 @@ invalid_rect db 'Wrong area size',0 end if sign_n_input: - db '2',0 + db '2',0 app_ipc ipc_buffer 32 align 4 @@ -737,33 +755,33 @@ rb 100 align 4 -cur_number dd ? +cur_number dd ? -sign_n db ? +sign_n db ? -slot_n dd ? +slot_n dd ? -flags dd ? +flags dd ? scr_buf: -.ptr dd ? -.end_ptr dd ? +.ptr dd ? +.end_ptr dd ? .size: .height dw ? -.width dw ? +.width dw ? fs_struc: .funk_n dd ? - dd ? - dd ? -.bytes_to_write dd ? -.data_ptr dd ?,? + dd ? + dd ? +.bytes_to_write dd ? +.data_ptr dd ?,? .fn_ptr dd ? sf_buf: .bmp_header dd ? .bmp_area dd ? -.end dd ? +.end dd ? set_rect_window_pid dd ? set_rect_window_slot dd ? @@ -782,7 +800,7 @@ align 4 rect_input_buffer: .left rb 6 .top rb 6 -.width rb 6 +.width rb 6 .height rb 6 cmdstr rb 257 @@ -790,7 +808,7 @@ cmdstr rb 257 align 4 file_name: - rb 1058 + rb 1058 scr screen_prop rect: @@ -800,16 +818,16 @@ rect: .width dw ? sc sys_color_table -app procinfo ; информация о главном окне +app procinfo ; информация о главном окне active_app procinfo ; информация об активном окне set_rect_window_procinfo procinfo ; информация об окне области -shoot_esp rb 512 ; стек потока фотканья -set_rect_window_esp rb 512 ; стек окна области +shoot_esp rb 512 ; стек потока фотканья +set_rect_window_esp rb 512 ; стек окна области ; app_end ; конец программы mouse_dd rd 1 align 4 -cur_dir_path rb 4096 -library_path rb 4096 +cur_dir_path rb 4096 +library_path rb 4096 i_end_tread: rb 1024 align 4 diff --git a/programs/system/cpu/trunk/cpu.asm b/programs/system/cpu/trunk/cpu.asm index 9dd220e240..945fc25901 100644 --- a/programs/system/cpu/trunk/cpu.asm +++ b/programs/system/cpu/trunk/cpu.asm @@ -8,103 +8,103 @@ ; use32 - org 0x0 + org 0x0 STACK_SIZE=1024 offset_y=22 ; Correction for skin offset_x=5 - db 'MENUET01' ; 8 byte id - dd 0x01 ; header version - dd START ; start of code - dd I_END ; size of image - dd U_END+STACK_SIZE ; memory for app - dd U_END+STACK_SIZE ; esp - dd 0x0 , 0x0 ; I_Param , I_Icon + db 'MENUET01' ; 8 byte id + dd 0x01 ; header version + dd START ; start of code + dd I_END ; size of image + dd U_END+STACK_SIZE ; memory for app + dd U_END+STACK_SIZE ; esp + dd 0x0 , 0x0 ; I_Param , I_Icon include 'lang.inc' include '../../../macros.inc' -include '../../../develop/libraries/box_lib/asm/trunk/editbox_ex.mac' +include '../../../develop/libraries/box_lib/trunk/box_lib.mac' include '../../../develop/libraries/box_lib/load_lib.mac' -display_processes=32 ; number of processes to show +display_processes=32 ; number of processes to show @use_library ;use load lib macros -START: ; start of execution +START: ; start of execution sys_load_library library_name, cur_dir_path, library_path, system_path, \ err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i - inc eax - jz close + inc eax + jz close ; calculate window position ; at the center of the screen mcall 40,0x27 ;set event call calculate_window_pos ;main loop when process name isn't edited. -red: - mcall 48,3,sc,40 - edit_boxes_set_sys_color edit1,edit1_end,sc ;set color - check_boxes_set_sys_color check1,check1_end,sc ;set color +red: + mcall 48,3,sc,40 + edit_boxes_set_sys_color edit1,edit1_end,sc ;set color + check_boxes_set_sys_color check1,check1_end,sc ;set color xor ebp,ebp inc ebp ; mov ebp,1 - call draw_window ; redraw all window + call draw_window ; redraw all window still: - mov eax,23 ; wait here for event - mov ebx,100 ; 1 sec. + mov eax,23 ; wait here for event + mov ebx,100 ; 1 sec. mcall - dec eax ; redraw request ? - jz red - dec eax ; key in buffer ? - jz key - dec eax ; button in buffer ? - jz button + dec eax ; redraw request ? + jz red + dec eax ; key in buffer ? + jz key + dec eax ; button in buffer ? + jz button - sub eax,3 ; If not use mouse - show + sub eax,3 ; If not use mouse - show jnz still_end - push dword edit1 - call [edit_box_mouse] + push dword edit1 + call [edit_box_mouse] push dword check1 call [check_box_mouse] jmp still still_end: - xor ebp,ebp ; draw new state of processes + xor ebp,ebp ; draw new state of processes call draw_window jmp still - key: ; key - mov eax,2 + key: ; key + mov eax,2 mcall - cmp ah,184 ; PageUp - jz pgdn + cmp ah,184 ; PageUp + jz pgdn cmp ah,183 - jz pgup ; PageDown + jz pgup ; PageDown cmp ah,27 - jz close ; Esc + jz close ; Esc - push dword edit1 - call [edit_box_key] + push dword edit1 + call [edit_box_key] ; Check ENTER with ed_focus edit_box lea edi,[edit1] test word ed_flags,ed_focus - jz still_end - sub ah,13 ; ENTER? - jz program_start ; RUN a program + jz still_end + sub ah,13 ; ENTER? + jz program_start ; RUN a program jmp still - button: + button: ; get button id - mov eax,17 + mov eax,17 mcall - shr eax,8 + shr eax,8 ;id in [10,50] corresponds to terminate buttons. cmp eax,10 - jb noterm + jb noterm cmp eax,50 - jg noterm + jg noterm ;calculate button index sub eax,11 @@ -125,18 +125,18 @@ still_end: ;special buttons dec eax - jz close + jz close sub eax,50 - jz pgdn ;51 + jz pgdn ;51 dec eax - jz pgup ;52 + jz pgup ;52 ; dec eax ; jz read_string dec eax - jz program_start ;53 + jz program_start ;53 dec eax - jz reboot ;54 + jz reboot ;54 jmp still_end ;buttons handlers @@ -166,7 +166,7 @@ still_end: ;close program if we going to reboot close: - or eax,-1 ; close this program + or eax,-1 ; close this program mcall draw_next_process: @@ -198,7 +198,7 @@ draw_next_process: mov esi,0xaabbcc ;contrast test dword [index],1 - jz .change_color_button + jz .change_color_button mov esi,0x8899aa .change_color_button: @@ -211,7 +211,7 @@ draw_next_process: mov edx,0x88ff88 ;contrast test dword [index],1 - jz .change_color_info + jz .change_color_info mov edx,0xddffdd .change_color_info: @@ -220,7 +220,7 @@ draw_next_process: ;nothing else should be done ;if there is no process for this button test edi,edi - jl .ret + jl .ret ;find process .return_1: @@ -244,7 +244,7 @@ draw_next_process: ;if current slot greater than maximal slot, ;there is no more proccesses. cmp ecx,eax - jg .no_processes + jg .no_processes ;if slot state is equal to 9, it is empty. cmp [process_info_buffer+process_information.slot_state],9 @@ -254,7 +254,7 @@ draw_next_process: jmp .find_loop .no_processes: - or edi,-1 + or edi,-1 ret .process_found: @@ -265,11 +265,11 @@ draw_next_process: pop edi jnz @f cmp dword [process_info_buffer+10],'ICON' - jz .return_1 + jz .return_1 cmp dword [process_info_buffer+10],'OS/I' - jz .return_1 + jz .return_1 cmp byte [process_info_buffer+10],'@' - jz .return_1 + jz .return_1 @@: mov edi,ecx @@ -307,7 +307,7 @@ draw_next_process: .no_black: cmp eax,80 - ja .no_green + ja .no_green mov dword [tcolor],0x107a30 jmp .color_set @@ -316,7 +316,7 @@ draw_next_process: .color_set: ;show slot number - mov eax,47 + mov eax,47 mov ebx,2*65536+1*256 ;ecx haven't changed since .process_found ; mov ecx,edi @@ -377,11 +377,11 @@ draw_next_process: add ecx,[process_info_buffer.box.top] add edx,60*65536 mcall - + .ret: ;build index->slot map for terminating processes. mov eax,[index] - mov [tasklist+4*eax],edi + mov [tasklist+4*eax],edi ret ;read_string: @@ -535,33 +535,33 @@ draw_window: ;ebp=0 - redraw only process information test ebp,ebp - jz .show_process_info + jz .show_process_info - mov eax,12 ; function 12:tell os about windowdraw + mov eax,12 ; function 12:tell os about windowdraw ; mov ebx,1 ; 1, start of draw - xor ebx,ebx + xor ebx,ebx inc ebx - mcall + mcall - ; DRAW WINDOW - xor eax,eax ; function 0 : define and draw window - mov ebx,[winxpos] ; [x start] *65536 + [x size] - mov ecx,[winypos] ; [y start] *65536 + [y size] + ; DRAW WINDOW + xor eax,eax ; function 0 : define and draw window + mov ebx,[winxpos] ; [x start] *65536 + [x size] + mov ecx,[winypos] ; [y start] *65536 + [y size] mov edx,0x34ddffdd ;ffffff ; color of work area RRGGBB,8->color - mov edi,title ; WINDOW CAPTION; + mov edi,title ; WINDOW CAPTION; mcall - - add eax,4 ; function 4 : write text to window - mov ebx,(22-offset_x)*65536+35-offset_y ; draw info text with function 4 + + add eax,4 ; function 4 : write text to window + mov ebx,(22-offset_x)*65536+35-offset_y ; draw info text with function 4 xor ecx,ecx mov edx,text mov esi,text_len mcall - push dword edit1 - call [edit_box_draw] - push dword check1 + push dword edit1 + call [edit_box_draw] + push dword check1 call [check_box_draw] align 16 @@ -576,37 +576,37 @@ align 16 inc dword [index] add dword [curposy],10 cmp [index],display_processes - jl .loop_draw + jl .loop_draw test ebp,ebp - jz .end_redraw + jz .end_redraw mov eax,8 mov esi,0xaabbcc - + ; previous page button mov ebx,(30-offset_x)*65536+96 mov ecx,(380-offset_y)*65536+10 mov edx,51 mcall - + ; next page button 52 mov ebx,(130-offset_x)*65536+96 inc edx mcall - + ; ">" (text enter) button ; mov ebx,30*65536+20 add ecx,20 shl 16 ; inc edx ; mcall - + ; run button 53 mov ebx,(456-offset_x)*65536+50 inc edx mcall ; reboot button - sub ebx,120*65536 + sub ebx,120*65536 add ebx,60 sub ecx,20 shl 16 inc edx @@ -639,8 +639,8 @@ align 16 ;print application name in text box ; call print_text - mov eax,12 ; function 12:tell os about windowdraw - mov ebx,2 ; 2, end of draw + mov eax,12 ; function 12:tell os about windowdraw + mov ebx,2 ; 2, end of draw mcall .end_redraw: @@ -648,35 +648,35 @@ align 16 ; DATA AREA -system_path db '/sys/lib/' -library_name db 'box_lib.obj',0 +system_path db '/sys/lib/' +library_name db 'box_lib.obj',0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -err_message_found_lib db 'Sorry I cannot load library box_lib.obj',0 +err_message_found_lib db 'Sorry I cannot load library box_lib.obj',0 head_f_i: -head_f_l db 'System error',0 -err_message_import db 'Error on load import library box_lib.obj',0 +head_f_l db 'System error',0 +err_message_import db 'Error on load import library 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 +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 -check_box_draw dd aCheck_box_draw -check_box_mouse dd aCheck_box_mouse +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 - dd 0 + dd 0 + dd 0 -aEdit_box_draw db 'edit_box',0 -aEdit_box_key db 'edit_box_key',0 +aEdit_box_draw db 'edit_box',0 +aEdit_box_key db 'edit_box_key',0 aEdit_box_mouse db 'edit_box_mouse',0 ;aVersion_ed db 'version_ed',0 @@ -694,12 +694,12 @@ edit1_end: list_start dd 0 sys_reboot: - dd 7 - dd 0 - dd 0 - dd 0 - dd 0 - db '/sys/end',0 + dd 7 + dd 0 + dd 0 + dd 0 + dd 0 + db '/sys/end',0 if lang eq de text: @@ -707,10 +707,10 @@ text: db 'SPEICHER START/NUTZUNG W-STACK W-SIZE' text_len = $-text -tbts: db 'SEITE ZURUECK SEITE VOR REBOOT SYSTEM' +tbts: db 'SEITE ZURUECK SEITE VOR REBOOT SYSTEM' tbte: ;tbts_2 db '>' -tbts_3 db 'START' +tbts_3 db 'START' tbte_2: check_text db '@ gehoren/aus' check_t_e=$-check_text @@ -724,7 +724,7 @@ text_len = $-text tbts: db 'EELMINE LEHT J─RGMINE LEHT REBOODI S▄STEEM' tbte: -;tbts_2 db '>' +;tbts_2 db '>' tbts_3 db 'START' tbte_2: check_text db '@ on/off' @@ -737,10 +737,10 @@ text: db 'MEMORY START/USAGE W-STACK W-SIZE' text_len = $-text -tbts: db 'PREV PAGE NEXT PAGE REBOOT SYSTEM' +tbts: db 'PREV PAGE NEXT PAGE REBOOT SYSTEM' tbte: ;tbts_2 db '>' -tbts_3 db 'RUN' +tbts_3 db 'RUN' tbte_2: check_text db '@ on/off' check_t_e=$-check_text @@ -748,7 +748,7 @@ title db 'Processes - Ctrl/Alt/Del',0 end if file_start: dd 7 - dd 0,0,0,0 + dd 0,0,0,0 start_application: db '/sys/LAUNCHER',0 start_application_e=$-start_application-1 ; times 60 db 0 @@ -761,13 +761,13 @@ winxpos rd 1 winypos rd 1 mouse_dd rd 1 cpu_percent rd 1 -tcolor rd 1 +tcolor rd 1 list_add rd 1 curposy rd 1 -index rd 1 +index rd 1 tasklist rd display_processes process_info_buffer process_information -cur_dir_path rb 1024 -library_path rb 1024 +cur_dir_path rb 1024 +library_path rb 1024 U_END: diff --git a/programs/system/rdsave/trunk/rdsave.asm b/programs/system/rdsave/trunk/rdsave.asm index 3ba9e238ce..ced142949e 100644 --- a/programs/system/rdsave/trunk/rdsave.asm +++ b/programs/system/rdsave/trunk/rdsave.asm @@ -13,21 +13,21 @@ include '..\..\..\macros.inc' appname equ 'RDsave ' version equ '1.2' - use32 ; включить 32-битный режим ассемблера - org 0x0 ; адресация с нуля + use32 ; включить 32-битный режим ассемблера + org 0x0 ; адресация с нуля - db 'MENUET01' ; 8-байтный идентификатор MenuetOS - dd 0x01 ; версия заголовка (всегда 1) - dd START ; адрес первой команды - dd I_END ; размер программы - dd I_END ; количество памяти - dd I_END ; адрес вершины стэка - dd 0x0 ; адрес буфера для параметров (не используется) + db 'MENUET01' ; 8-байтный идентификатор MenuetOS + dd 0x01 ; версия заголовка (всегда 1) + dd START ; адрес первой команды + dd I_END ; размер программы + dd I_END ; количество памяти + dd I_END ; адрес вершины стэка + dd 0x0 ; адрес буфера для параметров (не используется) dd cur_dir_path ;include '..\..\..\develop\examples\editbox\trunk\editbox.inc' include '../../../develop/libraries/box_lib/load_lib.mac' -include '../../../develop/libraries/box_lib/asm/trunk/editbox_ex.mac' +include '../../../develop/libraries/box_lib/trunk/box_lib.mac' @use_library ;use_edit_box @@ -41,21 +41,21 @@ align 4 START: sys_load_library library_name, cur_dir_path, library_path, system_path, \ err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i - cmp eax,-1 - jz close + cmp eax,-1 + jz close mov eax, 40 mov ebx, 100111b mcall -red: ; перерисовать окно - mov eax,48 - mov ebx,3 - mov ecx,sc - mov edx,sizeof.system_colors +red: ; перерисовать окно + mov eax,48 + mov ebx,3 + mov ecx,sc + mov edx,sizeof.system_colors mcall - edit_boxes_set_sys_color editbox,editbox_end,sc - call draw_window ; вызываем процедуру отрисовки окна + edit_boxes_set_sys_color editbox,editbox_end,sc + call draw_window ; вызываем процедуру отрисовки окна ;--------------------------------------------------------------------- ;--- ЦИКЛ ОБРАБОТКИ СОБЫТИЙ ---------------------------------------- @@ -64,99 +64,99 @@ red: ; still: mcall 10 - dec eax ; перерисовать окно? - jz red ; если да - на метку red + dec eax ; перерисовать окно? + jz red ; если да - на метку red dec eax - jz key + jz key dec eax - jz button + jz button mouse: ; mouse_edit_box editbox - push dword editbox - call [edit_box_mouse] + push dword editbox + call [edit_box_mouse] - jmp still + jmp still button: - mov al,17 ; получить идентификатор нажатой кнопки + mov al,17 ; получить идентификатор нажатой кнопки mcall - cmp ah,1 ; кнопка с id=1("закрыть")? + cmp ah,1 ; кнопка с id=1("закрыть")? jne noclose close: - or eax,-1 ; функция -1: завершить программу + or eax,-1 ; функция -1: завершить программу mcall noclose: - push eax - call clear_err - pop eax - push 16 - xor ebx, ebx - inc ebx ; 16.1 = save to /FD/1 - cmp ah, 2 - je doit - inc ebx ; 16.2 = save to /FD/2 - cmp ah, 3 - je doit - pop ebx - push 18 - mov bl, 6 ; 18.6 = save to specified folder - mov ecx, path3 - cmp ah, 4 - je doit - mov ecx, path4 + push eax + call clear_err + pop eax + push 16 + xor ebx, ebx + inc ebx ; 16.1 = save to /FD/1 + cmp ah, 2 + je doit + inc ebx ; 16.2 = save to /FD/2 + cmp ah, 3 + je doit + pop ebx + push 18 + mov bl, 6 ; 18.6 = save to specified folder + mov ecx, path3 + cmp ah, 4 + je doit + mov ecx, path4 doit: - pop eax - mcall - call check_for_error - jmp still + pop eax + mcall + call check_for_error + jmp still -key: +key: mov al,2 mcall ; key_edit_box editbox - push dword editbox - call [edit_box_key] + push dword editbox + call [edit_box_key] jmp still -check_for_error: ;Обработчик ошибок - mov ecx, [sc.work_text] - mov edx, ok - test eax, eax - jz print - mov ecx, 0xdd2222 - add edx, error3 - ok - dec eax - dec eax - jz print - add edx, error5 - error3 - dec eax - dec eax - jz print - add edx, error8 - error5 - dec eax - dec eax - dec eax - jz print - add edx, error9 - error8 - dec eax - jz print - add edx, error10 - error9 - dec eax - jz print - add edx, error11 - error10 - dec eax - jz print - add edx, aUnknownError - error11 +check_for_error: ;Обработчик ошибок + mov ecx, [sc.work_text] + mov edx, ok + test eax, eax + jz print + mov ecx, 0xdd2222 + add edx, error3 - ok + dec eax + dec eax + jz print + add edx, error5 - error3 + dec eax + dec eax + jz print + add edx, error8 - error5 + dec eax + dec eax + dec eax + jz print + add edx, error9 - error8 + dec eax + jz print + add edx, error10 - error9 + dec eax + jz print + add edx, error11 - error10 + dec eax + jz print + add edx, aUnknownError - error11 print: - mov eax,4 ;надписи + mov eax,4 ;надписи mov ebx,20 shl 16 + 148 - or ecx,0x80000000 + or ecx,0x80000000 mcall ret @@ -174,25 +174,25 @@ clear_err: draw_window: - mov eax,12 ; функция 12: сообщить ОС об отрисовке окна - mov bl,1 ; 1 - начинаем рисовать + mov eax,12 ; функция 12: сообщить ОС об отрисовке окна + mov bl,1 ; 1 - начинаем рисовать mcall - ; СОЗДАЁМ ОКНО - xor eax,eax ; функция 0 : определить и отрисовать окно - mov ebx,200 shl 16 + 270 ; [x старт] *65536 + [x размер] - mov ecx,200 shl 16 + 190 ; [y старт] *65536 + [y размер] - mov edx,[sc.work] ; цвет рабочей области RRGGBB,8->color gl + ; СОЗДАЁМ ОКНО + xor eax,eax ; функция 0 : определить и отрисовать окно + mov ebx,200 shl 16 + 270 ; [x старт] *65536 + [x размер] + mov ecx,200 shl 16 + 190 ; [y старт] *65536 + [y размер] + mov edx,[sc.work] ; цвет рабочей области RRGGBB,8->color gl or edx,0x34000000 - mov edi,title ; ЗАГОЛОВОК ОКНА + mov edi,title ; ЗАГОЛОВОК ОКНА mcall - push dword editbox - call [edit_box_draw] + push dword editbox + call [edit_box_draw] ;draw_edit_box editbox ;рисование edit box - mov al,13 ;отрисовка теней кнопок + mov al,13 ;отрисовка теней кнопок mov ebx,194 shl 16 + 60 mov ecx,34 shl 16 +15 mov edx,0x444444 @@ -207,7 +207,7 @@ draw_window: add ecx,40 shl 16 mcall - mov eax,8 ;отрисовка кнопок + mov eax,8 ;отрисовка кнопок sub ebx,4 shl 16 sub ecx,4 shl 16 mov edx,5 @@ -226,7 +226,7 @@ draw_window: dec edx mcall - mov al,4 ;надписи + mov al,4 ;надписи mov ebx,45 shl 16 + 12 mov ecx,[sc.work_text] or ecx,0x80000000 @@ -268,11 +268,11 @@ draw_window: add ebx,40 mcall - mov al,12 ; функция 12: сообщить ОС об отрисовке окна - mov ebx,2 ; 2, закончили рисовать + mov al,12 ; функция 12: сообщить ОС об отрисовке окна + mov ebx,2 ; 2, закончили рисовать mcall - ret ; выходим из процедуры + ret ; выходим из процедуры ;--------------------------------------------------------------------- @@ -286,42 +286,42 @@ edit1 edit_box 170,10,113,0xffffff,0xaabbcc,0,0,0,512,path4,mouse_dd,ed_focus,26 editbox_end: if lang eq ru -save db 'Сохранить',0 -label1 db 'Выберите один из вариантов:',0 -label2 db 'Или введите полный путь к файлу:',0 -label3 db 'Все папки должны существовать',0 -ok db 'RAM-диск сохранен успешно',0 -error3 db 'Неизвестная файловая система',0 -error5 db 'Несуществующий путь',0 -error8 db 'Нет места на диске',0 -error9 db 'Таблица FAT разрушена',0 +save db 'Сохранить',0 +label1 db 'Выберите один из вариантов:',0 +label2 db 'Или введите полный путь к файлу:',0 +label3 db 'Все папки должны существовать',0 +ok db 'RAM-диск сохранен успешно',0 +error3 db 'Неизвестная файловая система',0 +error5 db 'Несуществующий путь',0 +error8 db 'Нет места на диске',0 +error9 db 'Таблица FAT разрушена',0 error10 db 'Доступ запрещен',0 error11 db 'Ошибка устройства',0 aUnknownError db 'Неизвестная ошибка',0 else if lang eq et -save db 'Salvesta',0 -label1 db 'Vali №ks variantidest:',0 -label2 db 'Vїi sisesta teekond failinimeni:',0 -label3 db 'Kїik kataloogid peavad eksisteerima',0 -ok db 'RAM-ketas salvestatud edukalt',0 -error3 db 'Tundmatu failis№steem',0 -error5 db 'Vigane teekond',0 -error8 db 'Ketas tфis',0 -error9 db 'FAT tabel vigane',0 +save db 'Salvesta',0 +label1 db 'Vali №ks variantidest:',0 +label2 db 'Vїi sisesta teekond failinimeni:',0 +label3 db 'Kїik kataloogid peavad eksisteerima',0 +ok db 'RAM-ketas salvestatud edukalt',0 +error3 db 'Tundmatu failis№steem',0 +error5 db 'Vigane teekond',0 +error8 db 'Ketas tфis',0 +error9 db 'FAT tabel vigane',0 error10 db 'Juurdepффs keelatud',0 error11 db 'Seadme viga',0 aUnknownError db 'Tundmatu viga',0 else -save db ' Save',0 -label1 db 'Select one of the variants:',0 -label2 db ' Or enter full path to file:',0 -label3 db ' All folders must exist',0 -ok db 'RAM-drive was saved successfully',0 -error3 db 'Unknown file system',0 -error5 db 'Incorrect path',0 -error8 db 'Disk is full',0 -error9 db 'FAT table corrupted',0 +save db ' Save',0 +label1 db 'Select one of the variants:',0 +label2 db ' Or enter full path to file:',0 +label3 db ' All folders must exist',0 +ok db 'RAM-drive was saved successfully',0 +error3 db 'Unknown file system',0 +error5 db 'Incorrect path',0 +error8 db 'Disk is full',0 +error9 db 'FAT table corrupted',0 error10 db 'Access denied',0 error11 db 'Device error',0 aUnknownError db 'Unknown error',0 @@ -330,37 +330,37 @@ end if ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;DATA данные ;Всегда соблюдать последовательность в имени. -system_path db '/sys/lib/' -library_name db 'box_lib.obj',0 +system_path db '/sys/lib/' +library_name db 'box_lib.obj',0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -err_message_found_lib db 'Sorry I cannot load library box_lib.obj',0 +err_message_found_lib db 'Sorry I cannot load library box_lib.obj',0 head_f_i: -head_f_l db 'System error',0 -err_message_import db 'Error on load import library box_lib.obj',0 +head_f_l db 'System error',0 +err_message_import db 'Error on load import library box_lib.obj',0 align 4 myimport: -edit_box_draw dd aEdit_box_draw -edit_box_key dd aEdit_box_key -edit_box_mouse dd aEdit_box_mouse +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 - dd 0 + dd 0 + dd 0 -aEdit_box_draw db 'edit_box',0 -aEdit_box_key db 'edit_box_key',0 +aEdit_box_draw db 'edit_box',0 +aEdit_box_key db 'edit_box_key',0 aEdit_box_mouse db 'edit_box_mouse',0 ;aVersion_ed db 'version_ed',0 ;mouse_flag: dd 0x0 -path1 db '/fd/1/',0 -path2 db '/fd/2/',0 -path3 db '/hd0/1/kolibri.img',0 -path4 db '/hd0/1/kolibri/kolibri.img',0 ;для резервного сохранения +path1 db '/fd/1/',0 +path2 db '/fd/2/',0 +path3 db '/hd0/1/kolibri.img',0 +path4 db '/hd0/1/kolibri/kolibri.img',0 ;для резервного сохранения ;--------------------------------------------------------------------- @@ -368,8 +368,8 @@ rb 514 sc system_colors mouse_dd rd 1 -cur_dir_path rb 1096 -library_path rb 1096 +cur_dir_path rb 1096 +library_path rb 1096 align 4 -rb 0x100 ; for stack -I_END: ; метка конца программы +rb 0x100 ; for stack +I_END: ; метка конца программы diff --git a/programs/system/run/trunk/run.asm b/programs/system/run/trunk/run.asm index f743f834d8..dbbf4b9959 100644 --- a/programs/system/run/trunk/run.asm +++ b/programs/system/run/trunk/run.asm @@ -8,14 +8,14 @@ window_x=640 ;--- другие макросы --- ;include '../../../develop/examples/editbox/trunk/editbox.inc' include '../../../develop/libraries/box_lib/load_lib.mac' -include '../../../develop/libraries/box_lib/asm/trunk/editbox_ex.mac' +include '../../../develop/libraries/box_lib/trunk/box_lib.mac' ;include 'editbox.inc' include 'txtbut.inc' include '../../../macros.inc' ;include 'macros.inc' include 'run.mac' include 'lang.inc' -use32 +use32 org 0x0 db 'MENUET01' dd 0x1 @@ -30,212 +30,212 @@ use32 ; meos_app_start ; use_edit_box @use_library - use_txt_button + use_txt_button ; code ;load system lib align 4 start: sys_load_library library_name, cur_dir_path, library_path, system_path, \ err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i - cmp eax,-1 - jz close + cmp eax,-1 + jz close - cmp [par],byte 0 - jne read_par - mcall 40,EVM_MOUSE+EVM_BUTTON+EVM_KEY+EVM_REDRAW + cmp [par],byte 0 + jne read_par + mcall 40,EVM_MOUSE+EVM_BUTTON+EVM_KEY+EVM_REDRAW red: - mcall 48,3,sc,40 - edit_boxes_set_sys_color input_fn,input_fn_end,sc - set_sys_colors_txt_button run_but,sc - push dword [sc.work_graph] - pop [input_fn.focus_border_color] - call draw_window -still: ;основной обработчик - mcall 10 ;Ожидать события - dec eax - jz red - dec eax - jz key - dec eax - jz button + mcall 48,3,sc,40 + edit_boxes_set_sys_color input_fn,input_fn_end,sc + set_sys_colors_txt_button run_but,sc + push dword [sc.work_graph] + pop [input_fn.focus_border_color] + call draw_window +still: ;основной обработчик + mcall 10 ;Ожидать события + dec eax + jz red + dec eax + jz key + dec eax + jz button ; mouse_edit_box input_fn - push dword input_fn - call [edit_box_mouse] + push dword input_fn + call [edit_box_mouse] - jmp still ;если ничего из перечисленного то снова в цикл + jmp still ;если ничего из перечисленного то снова в цикл key: - mcall 2 - cmp ah,13 - je run + mcall 2 + cmp ah,13 + je run ; key_edit_box input_fn - push dword input_fn - call [edit_box_key] + push dword input_fn + call [edit_box_key] - jmp still + jmp still button: - mcall 17 - dec ah - jz close - dec ah - jz run - jmp still + mcall 17 + dec ah + jz close + dec ah + jz run + jmp still read_par: - mov esi,par - mov edi,fn - mov ecx,256 - rep movsb + mov esi,par + mov edi,fn + mov ecx,256 + rep movsb run: - xor eax,eax - mov edi,file_info.name - mov ecx,512 - rep stosb - mov edi,run_par - mov ecx,256 - rep stosb + xor eax,eax + mov edi,file_info.name + mov ecx,512 + rep stosb + mov edi,run_par + mov ecx,256 + rep stosb - mov esi,fn - mov edi,file_info.name - cmp [esi],byte '"' - je copy_fn_with_spaces + mov esi,fn + mov edi,file_info.name + cmp [esi],byte '"' + je copy_fn_with_spaces copy_fn: - cmp [esi],byte ' ' - je .stop - cmp [esi],byte 0 - je .stop - mov al,[esi] - mov [edi],al - inc esi - inc edi - jmp copy_fn + cmp [esi],byte ' ' + je .stop + cmp [esi],byte 0 + je .stop + mov al,[esi] + mov [edi],al + inc esi + inc edi + jmp copy_fn .stop: - jmp copy_par + jmp copy_par copy_fn_with_spaces: - inc esi + inc esi @@: - cmp [esi],byte '"' - je .stop - cmp [esi],byte 0 - je .stop - mov al,[esi] - mov [edi],al - inc esi - inc edi - jmp @b + cmp [esi],byte '"' + je .stop + cmp [esi],byte 0 + je .stop + mov al,[esi] + mov [edi],al + inc esi + inc edi + jmp @b .stop: copy_par: @@: - inc esi - cmp [esi],byte ' ' - je @b - mov edi,run_par + inc esi + cmp [esi],byte ' ' + je @b + mov edi,run_par @@: - cmp [esi],byte 0 - je .stop - mov al,[esi] - mov [edi],al - inc esi - inc edi - jmp @b + cmp [esi],byte 0 + je .stop + mov al,[esi] + mov [edi],al + inc esi + inc edi + jmp @b .stop: - mcall 70,file_info + mcall 70,file_info - cmp eax,0 - jl error - mov [status],run_ok - call draw_status - jmp still + cmp eax,0 + jl error + mov [status],run_ok + call draw_status + jmp still close: - mcall -1 + mcall -1 error: - neg eax - cmp_err 3,bad_file_sys - cmp_err 5,file_not_find - cmp_err 9,bad_fat_table - cmp_err 10,acces_denyied - cmp_err 11,device_error - cmp_err 30,out_of_memory - cmp_err 31,file_not_executable - cmp_err 32,many_processes + neg eax + cmp_err 3,bad_file_sys + cmp_err 5,file_not_find + cmp_err 9,bad_fat_table + cmp_err 10,acces_denyied + cmp_err 11,device_error + cmp_err 30,out_of_memory + cmp_err 31,file_not_executable + cmp_err 32,many_processes - call draw_status - jmp still + call draw_status + jmp still draw_window: - mcall 48,5 - mov si,bx + mcall 48,5 + mov si,bx - mcall 12,1 - mcall 48,4 - mov dx,ax - mcall 14 - xor ecx,ecx - sub cx,window_y+2 - sub cx,dx - add cx,si - shl ecx,16 - mov cx,dx - add cx,window_y - shr eax,16 - mov bx,ax - sub bx,window_x - shl ebx,15 - mov bx,window_x - mov edx,[sc.work] - or edx,0x33000000 - xor esi,esi - mov edi,grab_text - mcall 0 + mcall 12,1 + mcall 48,4 + mov dx,ax + mcall 14 + xor ecx,ecx + sub cx,window_y+2 + sub cx,dx + add cx,si + shl ecx,16 + mov cx,dx + add cx,window_y + shr eax,16 + mov bx,ax + sub bx,window_x + shl ebx,15 + mov bx,window_x + mov edx,[sc.work] + or edx,0x33000000 + xor esi,esi + mov edi,grab_text + mcall 0 - mcall 9,procinfo,-1 + mcall 9,procinfo,-1 - mov eax,[procinfo.box.width] - sub eax,20 - mov [input_fn.width],eax - mov [run_but.width],ax + mov eax,[procinfo.box.width] + sub eax,20 + mov [input_fn.width],eax + mov [run_but.width],ax - xor bx,bx - shl ebx,16 - mov bx,ax - add bx,10 - mov cx,45 - push cx - shl ecx,16 - pop cx - mov edx,[sc.work_graph] - mcall 38 + xor bx,bx + shl ebx,16 + mov bx,ax + add bx,10 + mov cx,45 + push cx + shl ecx,16 + pop cx + mov edx,[sc.work_graph] + mcall 38 ; draw_edit_box input_fn - push dword input_fn - call [edit_box_draw] + push dword input_fn + call [edit_box_draw] - draw_txt_button run_but + draw_txt_button run_but - call draw_status_text + call draw_status_text - mcall 12,2 + mcall 12,2 ret draw_status: - mov ebx,[procinfo.box.width] - sub bx,10 - mov ecx,(50)*65536+12 - mov edx,[sc.work] - mcall 13 + mov ebx,[procinfo.box.width] + sub bx,10 + mov ecx,(50)*65536+12 + mov edx,[sc.work] + mcall 13 draw_status_text: - mov edx,[status] - xor esi,esi + mov edx,[status] + xor esi,esi @@: - cmp [edx+esi],byte 0 - je @f - inc esi - jmp @b + cmp [edx+esi],byte 0 + je @f + inc esi + jmp @b @@: - mov ecx,[sc.work_text] - mcall 4,5*65536+(50) + mov ecx,[sc.work_text] + mcall 4,5*65536+(50) ret run_but txt_button 0,5,15,25,2,0,0,run_but_text, @@ -245,26 +245,26 @@ input_fn_end: if lang eq ru hello db 'Введите полный путь к файлу и нажмите Enter',0 bad_file_sys db 'Неизвестная файловая система',0 ; 3 -file_not_find db 'Файл не найден',0 ; 5 -bad_fat_table db 'Таблица FAT разрушена',0 ; 9 -acces_denyied db 'Доступ запрещен',0 ; 10 -device_error db 'Ошибка устройства',0 ; 11 -out_of_memory db 'Недостаточно памяти',0 ; 30 +file_not_find db 'Файл не найден',0 ; 5 +bad_fat_table db 'Таблица FAT разрушена',0 ; 9 +acces_denyied db 'Доступ запрещен',0 ; 10 +device_error db 'Ошибка устройства',0 ; 11 +out_of_memory db 'Недостаточно памяти',0 ; 30 file_not_executable db 'Файл не является исполняемым',0 ; 31 -many_processes db 'Слишком много процессов',0 ; 32 +many_processes db 'Слишком много процессов',0 ; 32 run_ok db 'Программа успешно запущена',0 grab_text db 'ЗАПУСК ПРОГРАММЫ',0 run_but_text db 'ЗАПУСТИТЬ',0 else hello db 'Enter full path to file and press ',0 -bad_file_sys db 'Unknown file system',0 ; 3 -file_not_find db 'File not found',0 ; 5 -bad_fat_table db 'FAT table corrupted',0 ; 9 -acces_denyied db 'Access denied',0 ; 10 -device_error db 'Device error',0 ; 11 -out_of_memory db 'Out of memory',0 ; 30 +bad_file_sys db 'Unknown file system',0 ; 3 +file_not_find db 'File not found',0 ; 5 +bad_fat_table db 'FAT table corrupted',0 ; 9 +acces_denyied db 'Access denied',0 ; 10 +device_error db 'Device error',0 ; 11 +out_of_memory db 'Out of memory',0 ; 30 file_not_executable db 'File is not executable',0 ; 31 -many_processes db 'Too many processes',0 ; 32 +many_processes db 'Too many processes',0 ; 32 run_ok db 'The program was started successfully',0 grab_text db 'RUN',0 run_but_text db 'RUN',0 @@ -274,29 +274,36 @@ status dd hello ;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ;DATA данные ;Всегда соблюдать последовательность в имени. -system_path db '/sys/lib/' -library_name db 'box_lib.obj',0 +system_path db '/sys/lib/' +library_name db 'box_lib.obj',0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -err_message_found_lib db 'Sorry I cannot load library box_lib.obj',0 +if lang eq ru +err_message_found_lib db 'Ошибка при поиске box_lib.obj',0 head_f_i: -head_f_l db 'System error',0 -err_message_import db 'Error on load import library box_lib.obj',0 +head_f_l db 'Системная ошибка',0 +err_message_import db 'Ошибка при импорте box_lib.obj',0 +else +err_message_found_lib db 'Sorry I cannot load library box_lib.obj',0 +head_f_i: +head_f_l db 'System error',0 +err_message_import db 'Error on load import library box_lib.obj',0 +end if 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 +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 - dd 0 + dd 0 + dd 0 -aEdit_box_draw db 'edit_box',0 -aEdit_box_key db 'edit_box_key',0 +aEdit_box_draw db 'edit_box',0 +aEdit_box_key db 'edit_box_key',0 aEdit_box_mouse db 'edit_box_mouse',0 -aVersion_ed db 'version_ed',0 +aVersion_ed db 'version_ed',0 @@ -319,8 +326,8 @@ par rb 256 fn rb 512 mouse_dd rd 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -cur_dir_path rb 4096 -library_path rb 4096 +cur_dir_path rb 4096 +library_path rb 4096 i_end: rb 1024 mem: