diff --git a/programs/demos/timer/trunk/timer.asm b/programs/demos/timer/trunk/timer.asm index 6c599225c..137fdb342 100644 --- a/programs/demos/timer/trunk/timer.asm +++ b/programs/demos/timer/trunk/timer.asm @@ -16,7 +16,7 @@ use32 dd 0x1000 ; esp dd 0x0 , 0x0 ; I_Param , I_Icon -include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US. +include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US. include '..\..\..\macros.inc' START: ; start of execution @@ -138,7 +138,7 @@ draw_window: ; DATA AREA if lang eq ru_RU - title db '������',0 + title db '',0 else ; Default to en_US title db 'TIMER',0 end if diff --git a/programs/develop/info3ds/info_menu.inc b/programs/develop/info3ds/info_menu.inc index 6a2e7ca25..256f8e49f 100644 --- a/programs/develop/info3ds/info_menu.inc +++ b/programs/develop/info3ds/info_menu.inc @@ -1 +1,54 @@ - if lang eq ru sz_main_menu_View db '', 0 sz_main_menu_Veiw_Vertexes db '設 .', 0 sz_main_menu_Veiw_Faces db 'ઠ ࠭ .', 0 sz_main_menu_Veiw_Faces_Fill db ' ࠭ .', 0 sz_main_menu_Veiw_Light db ' ./몫.', 0 sz_main_menu_Veiw_Smooth db ' ./몫.', 0 sz_main_menu_Veiw_Reset db ' ஥', 0 if version_edit eq 0 sz_main_menu_Veiw_Faces_Mat db '梥 ࠭ .', 0 else sz_main_menu_Vertexes db '設', 0 sz_main_menu_Vertexes_Select db '뤥 設', 0 sz_main_menu_Vertexes_Deselect db '⬥ 뤥', 0 sz_main_menu_Average_x db '। x',0 sz_main_menu_Average_y db '। y',0 sz_main_menu_Average_z db '। z',0 end if else sz_main_menu_View db 'View', 0 sz_main_menu_Veiw_Vertexes db 'Vertexes on', 0 sz_main_menu_Veiw_Faces db 'Edges on', 0 sz_main_menu_Veiw_Faces_Fill db 'Faces on', 0 sz_main_menu_Veiw_Light db 'Light on/off', 0 sz_main_menu_Veiw_Smooth db 'Smooth on/off', 0 sz_main_menu_Veiw_Reset db 'Reset settings', 0 if version_edit eq 0 sz_main_menu_Veiw_Faces_Mat db 'Diferent color faces on', 0 else sz_main_menu_Vertexes db 'Vertexes', 0 sz_main_menu_Vertexes_Select db 'Select vertex', 0 sz_main_menu_Vertexes_Deselect db 'Deselect all', 0 sz_main_menu_Average_x db 'Average x',0 sz_main_menu_Average_y db 'Average y',0 sz_main_menu_Average_z db 'Average z',0 end if end if main_menu dd 0 main_menu_file dd 0 main_menu_view dd 0 main_menu_vertexes dd 0 KMENUITEM_NORMAL equ 0 KMENUITEM_SUBMENU equ 1 KMENUITEM_SEPARATOR equ 2 \ No newline at end of file +; Language support for locales: ru_RU (CP866), en_US. + +if lang eq ru_RU + +sz_main_menu_View db '���', 0 +sz_main_menu_Veiw_Vertexes db '���設� ���.', 0 +sz_main_menu_Veiw_Faces db '��ઠ�� �࠭� ���.', 0 +sz_main_menu_Veiw_Faces_Fill db '������ �࠭� ���.', 0 +sz_main_menu_Veiw_Light db '���� ���./�몫.', 0 +sz_main_menu_Veiw_Smooth db '����������� ���./�몫.', 0 +sz_main_menu_Veiw_Reset db '���� ����஥�', 0 + +if version_edit eq 0 +sz_main_menu_Veiw_Faces_Mat db '�����梥�� �࠭� ���.', 0 +else +sz_main_menu_Vertexes db '���設�', 0 +sz_main_menu_Vertexes_Select db '�뤥���� ���設�', 0 +sz_main_menu_Vertexes_Deselect db '�⬥���� ��� �뤥�����', 0 +sz_main_menu_Average_x db '�।��� x',0 +sz_main_menu_Average_y db '�।��� y',0 +sz_main_menu_Average_z db '�।��� z',0 +end if + +else ; Default to en_US + +sz_main_menu_View db 'View', 0 +sz_main_menu_Veiw_Vertexes db 'Vertexes on', 0 +sz_main_menu_Veiw_Faces db 'Edges on', 0 +sz_main_menu_Veiw_Faces_Fill db 'Faces on', 0 +sz_main_menu_Veiw_Light db 'Light on/off', 0 +sz_main_menu_Veiw_Smooth db 'Smooth on/off', 0 +sz_main_menu_Veiw_Reset db 'Reset settings', 0 + +if version_edit eq 0 +sz_main_menu_Veiw_Faces_Mat db 'Diferent color faces on', 0 +else +sz_main_menu_Vertexes db 'Vertexes', 0 +sz_main_menu_Vertexes_Select db 'Select vertex', 0 +sz_main_menu_Vertexes_Deselect db 'Deselect all', 0 +sz_main_menu_Average_x db 'Average x',0 +sz_main_menu_Average_y db 'Average y',0 +sz_main_menu_Average_z db 'Average z',0 +end if + +end if + +main_menu dd 0 +main_menu_file dd 0 +main_menu_view dd 0 +main_menu_vertexes dd 0 + +KMENUITEM_NORMAL equ 0 +KMENUITEM_SUBMENU equ 1 +KMENUITEM_SEPARATOR equ 2 diff --git a/programs/develop/info3ds/info_wnd_coords.inc b/programs/develop/info3ds/info_wnd_coords.inc index f3d4fe71e..b4af7c850 100644 --- a/programs/develop/info3ds/info_wnd_coords.inc +++ b/programs/develop/info3ds/info_wnd_coords.inc @@ -1,827 +1,827 @@ -; -; ⮬ 䠩 ᮡ࠭ 㭪樨 㦭 ᮧ -; ࠡ न⠬ 設 -; - -prop_wnd_width equ 340 ;ਭ ᢮⢠ ꥪ -prop_wnd_height equ 460 ; ᢮⢠ ꥪ -3d_wnd_l equ 5 ; tinygl ᫥ -3d_wnd_t equ 23 ; tinygl ᢥ -3d_wnd_w equ 320 -3d_wnd_h equ 240 -SIZE_ONE_FLOAT equ 14 -MAX_OBJECT_SIZE equ (4+SIZE_ONE_FLOAT*3+1) - -prop_wnd_run db 0 ;६ ᫥ ⥬ - ᪠ 1- ᢮⢠ ६ - -txt_q db '?',0 -txt_space: - db SIZE_ONE_FLOAT dup(' ') -.end: - db 0 - -obj_point: ;塞 ꥪ - dd 0 ;㪠⥫ -.text: - rb MAX_OBJECT_SIZE - -if lang eq ru -txt_select_vert: db '࠭: ' -else -txt_select_vert: db 'Select: ' -end if -.count: -dq 0,0 - -; () 뢠 㭪樥 but_wnd_coords -align 4 -prop_start: -pushad - mcall SF_SET_EVENTS_MASK,0x27 ;᪠ ᮡ⨩ - inc byte[prop_wnd_run] - mov dword[w_scr_t3.type],1 - mov edi,o3d - stdcall obj_clear_param, edi - call mnu_reset_settings - - stdcall [tl_node_get_data],tree1 - xor edx,edx - mov dword[capt_p],txt_q - cmp eax,0 - je .no_points - mov ebx,[eax] ;砥 祭 ᤢ ࠭ - add ebx,[open_file_data] - - cmp word[ebx],CHUNK_OBJBLOCK - jne .end_oblo - mov dword[capt_p],txt_4000 - stdcall obj_init,edi - jmp .no_points - .end_oblo: - cmp word[ebx],CHUNK_TRIMESH - jne .end_trim - mov dword[capt_p],txt_4100 - stdcall obj_init,edi - jmp .no_points - .end_trim: - cmp word[ebx],CHUNK_VERTLIST - jne .end_vlist - mov dword[capt_p],txt_4110 - stdcall obj_init,edi - jmp .no_points - .end_vlist: - cmp word[ebx],CHUNK_TRACKPIVOT - jne @f - inc edx - add ebx,6 - mov dword[capt_p],txt_b013 - jmp .set_points - @@: - cmp word[ebx],0xb014 - jne @f - mov edx,2 - add ebx,6 - mov dword[capt_p],txt_b014 - ;jmp .set_points - @@: - .set_points: - mov [edi+obj_3d.poi_data],ebx - mov [edi+obj_3d.poi_count],edx - .no_points: - - ;ன ᯨ᪠ ꥪ⮢ - mov ebx,[edi+obj_3d.poi_data] - mov dword[tree3.info_max_count],2 - mov edx,[edi+obj_3d.poi_count] - add dword[tree3.info_max_count],edx ;⠢ ᫮ 㧫, ࠢ 祪 (+2 砫 ᯨ᪠) - stdcall dword[tl_data_init], tree3 - mov eax,dword[icon_tl_sys] - mov dword[tree3.data_img_sys],eax - mov eax,dword[icon_toolbar] - mov dword[tree3.data_img],eax - - cmp edx,0 - je .no_object - mov word[NumberSymbolsAD],5 - finit - mov dword[w_scr_t3.redraw],0 - .new_point: - mov dword[obj_point],ebx - mov dword[obj_point.text],0 - cld - mov ecx,3 - @@: - fld dword[ebx] - fstp qword[Data_Double] - call DoubleFloat_to_String - call String_crop_0 - add ebx,4 - stdcall str_len, Data_String - mov esi,txt_space - add esi,eax - cmp esi,txt_space.end - jl .normal_size - mov esi,txt_space.end-1 ; 1 ஡ 㦭 , - ᫨ - .normal_size: - stdcall str_cat, obj_point.text,esi - stdcall str_cat, obj_point.text,Data_String - loop @b - stdcall dword[tl_node_add], tree3,(ID_ICON_POINT shl 16),obj_point - stdcall dword[tl_cur_next], tree3 - dec edx - cmp edx,0 - jg .new_point - mov dword[w_scr_t3.redraw],1 - stdcall dword[tl_cur_beg], tree3 - .no_object: - stdcall obj_set_sizes, o3d - stdcall obj_set_normals, o3d - edit_boxes_set_sys_color edit1,editboxes_end,sc ;⠭ ⥬ 梥⮢ - stdcall [edit_box_set_text], edit1, txt_q - stdcall [edit_box_set_text], edit2, txt_q - stdcall [edit_box_set_text], edit3, txt_q - mov eax,0xc0c0c0 - mov ebx,[color_ox] - shr ebx,2 - and ebx,0x3f3f3f - add eax,ebx - mov [edit1.color],eax - mov eax,0xc0c0c0 - mov ebx,[color_oy] - shr ebx,2 - and ebx,0x3f3f3f - add eax,ebx - mov [edit2.color],eax - mov eax,0xc0c0c0 - mov ebx,[color_oz] - shr ebx,2 - and ebx,0x3f3f3f - add eax,ebx - mov [edit3.color],eax -popad - call prop_red_win - -; 뢠 㭪 ।饩 -align 4 -prop_still: - pushad - - mcall SF_WAIT_EVENT_TIMEOUT,10 - or eax,eax - jnz @f - call prop_timer_funct - jmp .end - @@: - - cmp al,1 ;. - jne @f - call prop_red_win - jmp .end - @@: - cmp al,2 - jne @f - call prop_key - jmp .end - @@: - cmp al,3 - jz prop_button - cmp al,6 - jne @f - call prop_mouse - @@: -.end: - popad - jmp prop_still - -align 4 -prop_red_win: -pushad - mcall SF_REDRAW,SSF_BEGIN_DRAW - - xor eax,eax - mov edi,dword[capt_p] ;children window caption - mov bx,word[procinfo.box.left] - add bx,word[buf_0.l] - add bx,5 ;ਭ ࠬ - shl ebx,16 - mov bx,prop_wnd_width - mov cx,word[procinfo.box.top] - add cx,word[buf_0.t] - shl ecx,16 - mov cx,prop_wnd_height - mov edx,[sc.work] - or edx,0x33000000 - int 0x40 - - mov esi,[sc.work_button] - mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (266 shl 16)+20, 0x40000003 - mcall , (30 shl 16)+20, (266 shl 16)+20, 0x40000004 - - mov ebx,[image_data_toolbar] - add ebx,3*IMAGE_TOOLBAR_ICON_SIZE - mcall SF_PUT_IMAGE, , (21 shl 16)+21, (5 shl 16)+266 ;load - - sub ebx,IMAGE_TOOLBAR_ICON_SIZE - mov edx,(30 shl 16)+266 ;save - int 0x40 - - mov dword[w_scr_t3.all_redraw],1 - stdcall [scrollbar_ver_draw],dword w_scr_t3 - stdcall [tl_draw], tree3 - stdcall [edit_box_draw], edit1 - stdcall [edit_box_draw], edit2 - stdcall [edit_box_draw], edit3 - - stdcall [kmainmenu_draw], [main_menu] - stdcall draw_3d, o3d - mcall SF_REDRAW,SSF_END_DRAW -popad - ret - -align 4 -proc prop_key uses eax ebx - mcall SF_GET_KEY - - test word [edit1.flags],10b ;ed_focus - je @f - stdcall [edit_box_key], edit1 - jmp .end - @@: - test word [edit2.flags],10b - je @f - stdcall [edit_box_key], edit2 - jmp .end - @@: - test word [edit3.flags],10b - je @f - stdcall [edit_box_key], edit3 - jmp .end - @@: - cmp dword[el_focus], tree3 - jne @f - stdcall [tl_key], tree3 - jmp .end - @@: - - cmp ah,178 ;Up - jne @f - fld dword[angle_x] - fadd dword[delt_size] - fstp dword[angle_x] - stdcall draw_3d, o3d - jmp .end - @@: - cmp ah,177 ;Down - jne @f - fld dword[angle_x] - fsub dword[delt_size] - fstp dword[angle_x] - stdcall draw_3d, o3d - jmp .end - @@: - cmp ah,176 ;Left - jne @f - fld dword[angle_y] - fadd dword[delt_size] - fstp dword[angle_y] - stdcall draw_3d, o3d - jmp .end - @@: - cmp ah,179 ;Right - jne @f - fld dword[angle_y] - fsub dword[delt_size] - fstp dword[angle_y] - stdcall draw_3d, o3d - ;jmp .end - @@: - .end: - ret -endp - -align 4 -prop_mouse: - push eax ebx - mcall SF_MOUSE_GET,SSF_BUTTON_EXT - bt eax,0 - jnc .end_m - ;mouse l. but. move - cmp dword[mouse_drag],1 - jne .end_m - mcall SF_MOUSE_GET,SSF_WINDOW_POSITION ;get mouse coords - mov ebx,eax - shr ebx,16 ;mouse.x - cmp ebx,3d_wnd_l - jg @f - mov ebx,3d_wnd_l - @@: - sub ebx,3d_wnd_l - cmp ebx,3d_wnd_w - jle @f - mov ebx,3d_wnd_w - @@: - and eax,0xffff ;mouse.y - cmp eax,3d_wnd_t - jg @f - mov eax,3d_wnd_t - @@: - sub eax,3d_wnd_t - cmp eax,3d_wnd_h - jle @f - mov eax,3d_wnd_h - @@: - finit - fild dword[mouse_y] - mov [mouse_y],eax - fisub dword[mouse_y] - fdiv dword[angle_dxm] ;᫨ y ( ) x - fadd dword[angle_x] - fstp dword[angle_x] - - fild dword[mouse_x] - mov [mouse_x],ebx - fisub dword[mouse_x] - fdiv dword[angle_dym] ;᫨ x ( ) y - fadd dword[angle_y] - fstp dword[angle_y] - - stdcall draw_3d, o3d - jmp .end_d - .end_m: - bt eax,16 - jnc @f - ;mouse l. but. up - mov dword[mouse_drag],0 - jmp .end_d - @@: - bt eax,8 - jnc .end_d - ;mouse l. but. press - mcall SF_MOUSE_GET,SSF_WINDOW_POSITION ;get mouse coords - mov ebx,eax - shr ebx,16 ;mouse.x - cmp ebx,3d_wnd_l - jl .end_d - sub ebx,3d_wnd_l - cmp ebx,3d_wnd_w - jg .end_d - and eax,0xffff ;mouse.y - cmp eax,3d_wnd_t - jl .end_d - sub eax,3d_wnd_t - cmp eax,3d_wnd_h - jg .end_d - mov dword[mouse_drag],1 - mov dword[mouse_x],ebx - mov dword[mouse_y],eax - .end_d: - - stdcall [kmainmenu_dispatch_cursorevent], [main_menu] - stdcall [tl_mouse], tree3 - stdcall [edit_box_mouse], edit1 - stdcall [edit_box_mouse], edit2 - stdcall [edit_box_mouse], edit3 - pop ebx eax - ret - -align 4 -prop_button: - mcall SF_GET_BUTTON - - cmp ah,3 - jne @f - call get_point_coords - stdcall draw_3d, o3d - jmp prop_still.end - @@: - cmp ah,4 - jne @f - push eax ebx ecx edi esi - stdcall [tl_node_get_data],tree3 - cmp eax,0 - je .no_select_1 - mov ebx,[eax] - finit - - mov esi,string1 - mov edi,Data_String - cld - mov ecx,8 - rep movsd - call String_to_DoubleFloat - fld qword[Data_Double] ;뢠 double - fstp dword[ebx] ;࠭塞 float - - mov esi,string2 - mov edi,Data_String - cld - mov ecx,8 - rep movsd - call String_to_DoubleFloat - fld qword[Data_Double] ;뢠 double - fstp dword[ebx+4] ;࠭塞 float - - mov esi,string3 - mov edi,Data_String - cld - mov ecx,8 - rep movsd - call String_to_DoubleFloat - fld qword[Data_Double] ;뢠 double - fstp dword[ebx+8] ;࠭塞 float - - ; 㧫 ᯨ᪥ tree3 ( ⠩) - mov word[NumberSymbolsAD],5 - mov dword[obj_point],ebx - mov dword[obj_point.text],0 - cld - mov ecx,3 - .coord: - fld dword[ebx] - fstp qword[Data_Double] - call DoubleFloat_to_String - call String_crop_0 - add ebx,4 - stdcall str_len, Data_String - mov esi,txt_space - add esi,eax - cmp esi,txt_space.end - jl .normal_size - mov esi,txt_space.end-1 ; 1 ஡ 㦭 , - ᫨ - .normal_size: - stdcall str_cat, obj_point.text,esi - stdcall str_cat, obj_point.text,Data_String - loop .coord - mov byte[obj_point.text],'*' ;⬥砥 設 﫠 - stdcall dword[tl_node_set_data], tree3,obj_point - stdcall dword[tl_draw], tree3 - mov byte[can_save],1 ; '࠭' - mov dword[offs_last_timer],0 ; ⠩ - stdcall draw_3d, o3d - .no_select_1: - pop esi edi ecx ebx eax - jmp prop_still.end - @@: - cmp ah,5 - jne @f - call mnu_vertexes_on - jmp prop_still.end - @@: - cmp ah,6 - jne @f - call mnu_edges_on - jmp prop_still.end - @@: - cmp ah,7 - jne @f - call mnu_faces_on - jmp prop_still.end - @@: - cmp ah,8 - jne @f - call mnu_light_on_off - jmp prop_still.end - @@: - cmp ah,9 - jne @f - call mnu_smooth_on_off - jmp prop_still.end - @@: - cmp ah,10 - jne @f - call mnu_reset_settings - jmp prop_still.end - @@: - cmp ah,11 - jne @f - call mnu_vertexes_select - jmp prop_still.end - @@: - cmp ah,12 - jne @f - call mnu_vertexes_deselect - jmp prop_still.end - @@: - cmp ah,13 - jne @f - call mnu_reset_average_x - jmp prop_still.end - @@: - cmp ah,14 - jne @f - call mnu_reset_average_y - jmp prop_still.end - @@: - cmp ah,15 - jne @f - call mnu_reset_average_z - jmp prop_still.end - @@: - - cmp ah,1 - jne prop_still.end -.exit: - mov dword[tree3.data_img],0 ;⨬ 㪠⥫ - 㤠 - mov dword[tree3.data_img_sys],0 ;. . ᯮ 㣨 - stdcall dword[tl_data_clear], tree3 - mov edi,o3d - stdcall mem.Free,[edi+obj_3d.normals_tri_data] - stdcall mem.Free,[edi+obj_3d.normals_poi_data] - mov dword[edi+obj_3d.normals_tri_data],0 - mov dword[edi+obj_3d.normals_poi_data],0 - mov byte[prop_wnd_run],0 ;塞 稪 - mcall SF_TERMINATE_PROCESS ;室 ணࠬ - -align 4 -get_point_coords: - ;㧪 न editbox- - push eax ebx - stdcall [tl_node_get_data],tree3 - cmp eax,0 - je @f - mov ebx,[eax] - mov word[NumberSymbolsAD],8 - finit - fld dword[ebx] - fstp qword[Data_Double] - call DoubleFloat_to_String - call String_crop_0 - stdcall [edit_box_set_text], edit1, Data_String - fld dword[ebx+4] - fstp qword[Data_Double] - call DoubleFloat_to_String - call String_crop_0 - stdcall [edit_box_set_text], edit2, Data_String - fld dword[ebx+8] - fstp qword[Data_Double] - call DoubleFloat_to_String - call String_crop_0 - stdcall [edit_box_set_text], edit3, Data_String - stdcall [edit_box_draw], edit1 - stdcall [edit_box_draw], edit2 - stdcall [edit_box_draw], edit3 - @@: - pop ebx eax - ret - -align 4 -proc prop_timer_funct uses eax - ;ᬠਢ 뤥 न - stdcall [tl_node_get_data],tree3 - cmp [cursor_last_draw],eax - je @f - mov [cursor_last_draw],eax - stdcall draw_3d, o3d - @@: - ret -endp - -align 4 -proc mnu_vertexes_select uses eax ebx - stdcall [tl_node_get_data],tree3 - cmp eax,0 - je .no_points - stdcall found_block_data,tree3 - cmp eax,0 - je .no_points - mov bx,word[eax] - cmp bx,ID_ICON_POINT_SEL - je @f - mov word[eax],ID_ICON_POINT_SEL - inc dword[obj_poi_sel_c] - jmp .change - @@: - mov word[eax],ID_ICON_POINT - dec dword[obj_poi_sel_c] - .change: - mov eax,[obj_poi_sel_c] - stdcall convert_int_to_str, txt_select_vert.count,16 - .no_points: - ret -endp - -align 4 -proc mnu_vertexes_deselect uses eax - cmp dword[obj_poi_sel_c],0 - je .no_points - mov dword[obj_poi_sel_c],0 - stdcall [tl_node_poi_get_info], tree3,0 - cmp eax,0 - je .no_points - @@: - mov word[eax],ID_ICON_POINT - stdcall [tl_node_poi_get_next_info], tree3,eax - cmp eax,0 - jne @b - .no_points: - ret -endp - -align 4 -proc mnu_reset_average_x uses eax ebx ecx edx edi - cmp dword[obj_poi_sel_c],2 - jl .end_select - finit - fldz - mov ecx,dword[obj_poi_sel_c] - stdcall dword[tl_node_poi_get_info], tree3,0 - @@: - cmp eax,0 - je .end_select - mov ebx,eax - cmp word[ebx],ID_ICON_POINT_SEL - jne .next_sel0 - stdcall [tl_node_poi_get_data], tree3,ebx - mov eax,[eax] - fadd dword[eax] - dec ecx - jz @f - .next_sel0: - stdcall dword[tl_node_poi_get_next_info], tree3,ebx - jmp @b - @@: - fidiv dword[obj_poi_sel_c] - fstp dword[eax] - mov edx,[eax] - mov ecx,dword[obj_poi_sel_c] - stdcall dword[tl_node_poi_get_info], tree3,0 - @@: - cmp eax,0 - je .end_select - mov ebx,eax - cmp word[ebx],ID_ICON_POINT_SEL - jne .next_sel1 - stdcall [tl_node_poi_get_data], tree3,ebx - mov edi,eax - mov eax,[eax] - mov [eax],edx - stdcall update_tree, edi - dec ecx - jz @f - .next_sel1: - stdcall dword[tl_node_poi_get_next_info], tree3,ebx - jmp @b - @@: - .end_select: - ret -endp - -align 4 -proc mnu_reset_average_y uses eax ebx ecx edx edi - cmp dword[obj_poi_sel_c],2 - jl .end_select - finit - fldz - mov ecx,dword[obj_poi_sel_c] - stdcall dword[tl_node_poi_get_info], tree3,0 - @@: - cmp eax,0 - je .end_select - mov ebx,eax - cmp word[ebx],ID_ICON_POINT_SEL - jne .next_sel0 - stdcall [tl_node_poi_get_data], tree3,ebx - mov eax,[eax] - fadd dword[eax+4] - dec ecx - jz @f - .next_sel0: - stdcall dword[tl_node_poi_get_next_info], tree3,ebx - jmp @b - @@: - fidiv dword[obj_poi_sel_c] - fstp dword[eax+4] - mov edx,[eax+4] - mov ecx,dword[obj_poi_sel_c] - stdcall dword[tl_node_poi_get_info], tree3,0 - @@: - cmp eax,0 - je .end_select - mov ebx,eax - cmp word[ebx],ID_ICON_POINT_SEL - jne .next_sel1 - stdcall [tl_node_poi_get_data], tree3,ebx - mov edi,eax - mov eax,[eax] - mov [eax+4],edx - stdcall update_tree, edi - dec ecx - jz @f - .next_sel1: - stdcall dword[tl_node_poi_get_next_info], tree3,ebx - jmp @b - @@: - .end_select: - ret -endp - -align 4 -proc mnu_reset_average_z uses eax ebx ecx edx edi - cmp dword[obj_poi_sel_c],2 - jl .end_select - finit - fldz - mov ecx,dword[obj_poi_sel_c] - stdcall dword[tl_node_poi_get_info], tree3,0 - @@: - cmp eax,0 - je .end_select - mov ebx,eax - cmp word[ebx],ID_ICON_POINT_SEL - jne .next_sel0 - stdcall [tl_node_poi_get_data], tree3,ebx - mov eax,[eax] - fadd dword[eax+8] - dec ecx - jz @f - .next_sel0: - stdcall dword[tl_node_poi_get_next_info], tree3,ebx - jmp @b - @@: - fidiv dword[obj_poi_sel_c] - fstp dword[eax+8] - mov edx,[eax+8] - mov ecx,dword[obj_poi_sel_c] - stdcall dword[tl_node_poi_get_info], tree3,0 - @@: - cmp eax,0 - je .end_select - mov ebx,eax - cmp word[ebx],ID_ICON_POINT_SEL - jne .next_sel1 - stdcall [tl_node_poi_get_data], tree3,ebx - mov edi,eax - mov eax,[eax] - mov [eax+8],edx - stdcall update_tree, edi - dec ecx - jz @f - .next_sel1: - stdcall dword[tl_node_poi_get_next_info], tree3,ebx - jmp @b - @@: - .end_select: - ret -endp - -align 4 -proc update_tree h_mem:dword -pushad - mov edi,[h_mem] - mov ebx,[edi] - finit - - ; 㧫 ᯨ᪥ tree3 ( ⠩) - mov word[NumberSymbolsAD],5 - mov dword[obj_point.text],0 - cld - mov ecx,3 - .coord: - fld dword[ebx] - fstp qword[Data_Double] - call DoubleFloat_to_String - call String_crop_0 - add ebx,4 - stdcall str_len, Data_String - mov esi,txt_space - add esi,eax - cmp esi,txt_space.end - jl .normal_size - mov esi,txt_space.end-1 ; 1 ஡ 㦭 , - ᫨ - .normal_size: - stdcall str_cat, obj_point.text,esi - stdcall str_cat, obj_point.text,Data_String - loop .coord - mov esi,obj_point.text - mov byte[esi],'*' ;⬥砥 設 﫠 - mov byte[can_save],1 ; '࠭' - add edi,4 - mov ecx,MAX_OBJECT_SIZE-4 - rep movsb -popad - ret -endp - -align 4 -angle_dxm dd 1.7775 ;~ 3d_wnd_w/180 - ਡ 㣫 業 饭 襩 -angle_dym dd 1.3335 ;~ 3d_wnd_h/180 -ratio dd 1.3333 ;~ 3d_wnd_w/3d_wnd_h -cursor_last_draw dd 0 ; ᫥ ᮢ 3d -capt_p dd 0 - -;ॢ ꥪ⠬ 짮⥫᪮ 䠩 -tree3 tree_list MAX_OBJECT_SIZE,3, tl_key_no_edit+tl_list_box_mode,\ - 16,16, 0xffffff,0xb0d0ff,0x400040, 5,290,303,140, 16, 4,0, el_focus,\ - w_scr_t3,get_point_coords - -edit1 edit_box 80, 76, 269, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 32, string1, mouse_dd, 0 -edit2 edit_box 80, 160, 269, 0xd0d0ff, 0xff, 0x80ff, 0, 0x8000, 32, string2, mouse_dd, 0 -edit3 edit_box 80, 244, 269, 0xd0ffd0, 0xff, 0x80ff, 0, 0x8000, 32, string3, mouse_dd, 0 -editboxes_end: - -string1 rb 34 -string2 rb 34 -string3 rb 34 - -align 4 -w_scr_t3 scrollbar 16, 0,0,0, 15, 100,0,0, 0,0,0, 1 +; +; ⮬ 䠩 ᮡ࠭ 㭪樨 㦭 ᮧ +; ࠡ न⠬ 設 +; + +prop_wnd_width equ 340 ;ਭ ᢮⢠ ꥪ +prop_wnd_height equ 460 ; ᢮⢠ ꥪ +3d_wnd_l equ 5 ; tinygl ᫥ +3d_wnd_t equ 23 ; tinygl ᢥ +3d_wnd_w equ 320 +3d_wnd_h equ 240 +SIZE_ONE_FLOAT equ 14 +MAX_OBJECT_SIZE equ (4+SIZE_ONE_FLOAT*3+1) + +prop_wnd_run db 0 ;६ ᫥ ⥬ - ᪠ 1- ᢮⢠ ६ + +txt_q db '?',0 +txt_space: + db SIZE_ONE_FLOAT dup(' ') +.end: + db 0 + +obj_point: ;塞 ꥪ + dd 0 ;㪠⥫ +.text: + rb MAX_OBJECT_SIZE + +if lang eq ru_RU +txt_select_vert: db '࠭: ' +else ; Default to en_US +txt_select_vert: db 'Select: ' +end if +.count: +dq 0,0 + +; () 뢠 㭪樥 but_wnd_coords +align 4 +prop_start: +pushad + mcall SF_SET_EVENTS_MASK,0x27 ;᪠ ᮡ⨩ + inc byte[prop_wnd_run] + mov dword[w_scr_t3.type],1 + mov edi,o3d + stdcall obj_clear_param, edi + call mnu_reset_settings + + stdcall [tl_node_get_data],tree1 + xor edx,edx + mov dword[capt_p],txt_q + cmp eax,0 + je .no_points + mov ebx,[eax] ;砥 祭 ᤢ ࠭ + add ebx,[open_file_data] + + cmp word[ebx],CHUNK_OBJBLOCK + jne .end_oblo + mov dword[capt_p],txt_4000 + stdcall obj_init,edi + jmp .no_points + .end_oblo: + cmp word[ebx],CHUNK_TRIMESH + jne .end_trim + mov dword[capt_p],txt_4100 + stdcall obj_init,edi + jmp .no_points + .end_trim: + cmp word[ebx],CHUNK_VERTLIST + jne .end_vlist + mov dword[capt_p],txt_4110 + stdcall obj_init,edi + jmp .no_points + .end_vlist: + cmp word[ebx],CHUNK_TRACKPIVOT + jne @f + inc edx + add ebx,6 + mov dword[capt_p],txt_b013 + jmp .set_points + @@: + cmp word[ebx],0xb014 + jne @f + mov edx,2 + add ebx,6 + mov dword[capt_p],txt_b014 + ;jmp .set_points + @@: + .set_points: + mov [edi+obj_3d.poi_data],ebx + mov [edi+obj_3d.poi_count],edx + .no_points: + + ;ன ᯨ᪠ ꥪ⮢ + mov ebx,[edi+obj_3d.poi_data] + mov dword[tree3.info_max_count],2 + mov edx,[edi+obj_3d.poi_count] + add dword[tree3.info_max_count],edx ;⠢ ᫮ 㧫, ࠢ 祪 (+2 砫 ᯨ᪠) + stdcall dword[tl_data_init], tree3 + mov eax,dword[icon_tl_sys] + mov dword[tree3.data_img_sys],eax + mov eax,dword[icon_toolbar] + mov dword[tree3.data_img],eax + + cmp edx,0 + je .no_object + mov word[NumberSymbolsAD],5 + finit + mov dword[w_scr_t3.redraw],0 + .new_point: + mov dword[obj_point],ebx + mov dword[obj_point.text],0 + cld + mov ecx,3 + @@: + fld dword[ebx] + fstp qword[Data_Double] + call DoubleFloat_to_String + call String_crop_0 + add ebx,4 + stdcall str_len, Data_String + mov esi,txt_space + add esi,eax + cmp esi,txt_space.end + jl .normal_size + mov esi,txt_space.end-1 ; 1 ஡ 㦭 , - ᫨ + .normal_size: + stdcall str_cat, obj_point.text,esi + stdcall str_cat, obj_point.text,Data_String + loop @b + stdcall dword[tl_node_add], tree3,(ID_ICON_POINT shl 16),obj_point + stdcall dword[tl_cur_next], tree3 + dec edx + cmp edx,0 + jg .new_point + mov dword[w_scr_t3.redraw],1 + stdcall dword[tl_cur_beg], tree3 + .no_object: + stdcall obj_set_sizes, o3d + stdcall obj_set_normals, o3d + edit_boxes_set_sys_color edit1,editboxes_end,sc ;⠭ ⥬ 梥⮢ + stdcall [edit_box_set_text], edit1, txt_q + stdcall [edit_box_set_text], edit2, txt_q + stdcall [edit_box_set_text], edit3, txt_q + mov eax,0xc0c0c0 + mov ebx,[color_ox] + shr ebx,2 + and ebx,0x3f3f3f + add eax,ebx + mov [edit1.color],eax + mov eax,0xc0c0c0 + mov ebx,[color_oy] + shr ebx,2 + and ebx,0x3f3f3f + add eax,ebx + mov [edit2.color],eax + mov eax,0xc0c0c0 + mov ebx,[color_oz] + shr ebx,2 + and ebx,0x3f3f3f + add eax,ebx + mov [edit3.color],eax +popad + call prop_red_win + +; 뢠 㭪 ।饩 +align 4 +prop_still: + pushad + + mcall SF_WAIT_EVENT_TIMEOUT,10 + or eax,eax + jnz @f + call prop_timer_funct + jmp .end + @@: + + cmp al,1 ;. + jne @f + call prop_red_win + jmp .end + @@: + cmp al,2 + jne @f + call prop_key + jmp .end + @@: + cmp al,3 + jz prop_button + cmp al,6 + jne @f + call prop_mouse + @@: +.end: + popad + jmp prop_still + +align 4 +prop_red_win: +pushad + mcall SF_REDRAW,SSF_BEGIN_DRAW + + xor eax,eax + mov edi,dword[capt_p] ;children window caption + mov bx,word[procinfo.box.left] + add bx,word[buf_0.l] + add bx,5 ;ਭ ࠬ + shl ebx,16 + mov bx,prop_wnd_width + mov cx,word[procinfo.box.top] + add cx,word[buf_0.t] + shl ecx,16 + mov cx,prop_wnd_height + mov edx,[sc.work] + or edx,0x33000000 + int 0x40 + + mov esi,[sc.work_button] + mcall SF_DEFINE_BUTTON, (5 shl 16)+20, (266 shl 16)+20, 0x40000003 + mcall , (30 shl 16)+20, (266 shl 16)+20, 0x40000004 + + mov ebx,[image_data_toolbar] + add ebx,3*IMAGE_TOOLBAR_ICON_SIZE + mcall SF_PUT_IMAGE, , (21 shl 16)+21, (5 shl 16)+266 ;load + + sub ebx,IMAGE_TOOLBAR_ICON_SIZE + mov edx,(30 shl 16)+266 ;save + int 0x40 + + mov dword[w_scr_t3.all_redraw],1 + stdcall [scrollbar_ver_draw],dword w_scr_t3 + stdcall [tl_draw], tree3 + stdcall [edit_box_draw], edit1 + stdcall [edit_box_draw], edit2 + stdcall [edit_box_draw], edit3 + + stdcall [kmainmenu_draw], [main_menu] + stdcall draw_3d, o3d + mcall SF_REDRAW,SSF_END_DRAW +popad + ret + +align 4 +proc prop_key uses eax ebx + mcall SF_GET_KEY + + test word [edit1.flags],10b ;ed_focus + je @f + stdcall [edit_box_key], edit1 + jmp .end + @@: + test word [edit2.flags],10b + je @f + stdcall [edit_box_key], edit2 + jmp .end + @@: + test word [edit3.flags],10b + je @f + stdcall [edit_box_key], edit3 + jmp .end + @@: + cmp dword[el_focus], tree3 + jne @f + stdcall [tl_key], tree3 + jmp .end + @@: + + cmp ah,178 ;Up + jne @f + fld dword[angle_x] + fadd dword[delt_size] + fstp dword[angle_x] + stdcall draw_3d, o3d + jmp .end + @@: + cmp ah,177 ;Down + jne @f + fld dword[angle_x] + fsub dword[delt_size] + fstp dword[angle_x] + stdcall draw_3d, o3d + jmp .end + @@: + cmp ah,176 ;Left + jne @f + fld dword[angle_y] + fadd dword[delt_size] + fstp dword[angle_y] + stdcall draw_3d, o3d + jmp .end + @@: + cmp ah,179 ;Right + jne @f + fld dword[angle_y] + fsub dword[delt_size] + fstp dword[angle_y] + stdcall draw_3d, o3d + ;jmp .end + @@: + .end: + ret +endp + +align 4 +prop_mouse: + push eax ebx + mcall SF_MOUSE_GET,SSF_BUTTON_EXT + bt eax,0 + jnc .end_m + ;mouse l. but. move + cmp dword[mouse_drag],1 + jne .end_m + mcall SF_MOUSE_GET,SSF_WINDOW_POSITION ;get mouse coords + mov ebx,eax + shr ebx,16 ;mouse.x + cmp ebx,3d_wnd_l + jg @f + mov ebx,3d_wnd_l + @@: + sub ebx,3d_wnd_l + cmp ebx,3d_wnd_w + jle @f + mov ebx,3d_wnd_w + @@: + and eax,0xffff ;mouse.y + cmp eax,3d_wnd_t + jg @f + mov eax,3d_wnd_t + @@: + sub eax,3d_wnd_t + cmp eax,3d_wnd_h + jle @f + mov eax,3d_wnd_h + @@: + finit + fild dword[mouse_y] + mov [mouse_y],eax + fisub dword[mouse_y] + fdiv dword[angle_dxm] ;᫨ y ( ) x + fadd dword[angle_x] + fstp dword[angle_x] + + fild dword[mouse_x] + mov [mouse_x],ebx + fisub dword[mouse_x] + fdiv dword[angle_dym] ;᫨ x ( ) y + fadd dword[angle_y] + fstp dword[angle_y] + + stdcall draw_3d, o3d + jmp .end_d + .end_m: + bt eax,16 + jnc @f + ;mouse l. but. up + mov dword[mouse_drag],0 + jmp .end_d + @@: + bt eax,8 + jnc .end_d + ;mouse l. but. press + mcall SF_MOUSE_GET,SSF_WINDOW_POSITION ;get mouse coords + mov ebx,eax + shr ebx,16 ;mouse.x + cmp ebx,3d_wnd_l + jl .end_d + sub ebx,3d_wnd_l + cmp ebx,3d_wnd_w + jg .end_d + and eax,0xffff ;mouse.y + cmp eax,3d_wnd_t + jl .end_d + sub eax,3d_wnd_t + cmp eax,3d_wnd_h + jg .end_d + mov dword[mouse_drag],1 + mov dword[mouse_x],ebx + mov dword[mouse_y],eax + .end_d: + + stdcall [kmainmenu_dispatch_cursorevent], [main_menu] + stdcall [tl_mouse], tree3 + stdcall [edit_box_mouse], edit1 + stdcall [edit_box_mouse], edit2 + stdcall [edit_box_mouse], edit3 + pop ebx eax + ret + +align 4 +prop_button: + mcall SF_GET_BUTTON + + cmp ah,3 + jne @f + call get_point_coords + stdcall draw_3d, o3d + jmp prop_still.end + @@: + cmp ah,4 + jne @f + push eax ebx ecx edi esi + stdcall [tl_node_get_data],tree3 + cmp eax,0 + je .no_select_1 + mov ebx,[eax] + finit + + mov esi,string1 + mov edi,Data_String + cld + mov ecx,8 + rep movsd + call String_to_DoubleFloat + fld qword[Data_Double] ;뢠 double + fstp dword[ebx] ;࠭塞 float + + mov esi,string2 + mov edi,Data_String + cld + mov ecx,8 + rep movsd + call String_to_DoubleFloat + fld qword[Data_Double] ;뢠 double + fstp dword[ebx+4] ;࠭塞 float + + mov esi,string3 + mov edi,Data_String + cld + mov ecx,8 + rep movsd + call String_to_DoubleFloat + fld qword[Data_Double] ;뢠 double + fstp dword[ebx+8] ;࠭塞 float + + ; 㧫 ᯨ᪥ tree3 ( ⠩) + mov word[NumberSymbolsAD],5 + mov dword[obj_point],ebx + mov dword[obj_point.text],0 + cld + mov ecx,3 + .coord: + fld dword[ebx] + fstp qword[Data_Double] + call DoubleFloat_to_String + call String_crop_0 + add ebx,4 + stdcall str_len, Data_String + mov esi,txt_space + add esi,eax + cmp esi,txt_space.end + jl .normal_size + mov esi,txt_space.end-1 ; 1 ஡ 㦭 , - ᫨ + .normal_size: + stdcall str_cat, obj_point.text,esi + stdcall str_cat, obj_point.text,Data_String + loop .coord + mov byte[obj_point.text],'*' ;⬥砥 設 﫠 + stdcall dword[tl_node_set_data], tree3,obj_point + stdcall dword[tl_draw], tree3 + mov byte[can_save],1 ; '࠭' + mov dword[offs_last_timer],0 ; ⠩ + stdcall draw_3d, o3d + .no_select_1: + pop esi edi ecx ebx eax + jmp prop_still.end + @@: + cmp ah,5 + jne @f + call mnu_vertexes_on + jmp prop_still.end + @@: + cmp ah,6 + jne @f + call mnu_edges_on + jmp prop_still.end + @@: + cmp ah,7 + jne @f + call mnu_faces_on + jmp prop_still.end + @@: + cmp ah,8 + jne @f + call mnu_light_on_off + jmp prop_still.end + @@: + cmp ah,9 + jne @f + call mnu_smooth_on_off + jmp prop_still.end + @@: + cmp ah,10 + jne @f + call mnu_reset_settings + jmp prop_still.end + @@: + cmp ah,11 + jne @f + call mnu_vertexes_select + jmp prop_still.end + @@: + cmp ah,12 + jne @f + call mnu_vertexes_deselect + jmp prop_still.end + @@: + cmp ah,13 + jne @f + call mnu_reset_average_x + jmp prop_still.end + @@: + cmp ah,14 + jne @f + call mnu_reset_average_y + jmp prop_still.end + @@: + cmp ah,15 + jne @f + call mnu_reset_average_z + jmp prop_still.end + @@: + + cmp ah,1 + jne prop_still.end +.exit: + mov dword[tree3.data_img],0 ;⨬ 㪠⥫ - 㤠 + mov dword[tree3.data_img_sys],0 ;. . ᯮ 㣨 + stdcall dword[tl_data_clear], tree3 + mov edi,o3d + stdcall mem.Free,[edi+obj_3d.normals_tri_data] + stdcall mem.Free,[edi+obj_3d.normals_poi_data] + mov dword[edi+obj_3d.normals_tri_data],0 + mov dword[edi+obj_3d.normals_poi_data],0 + mov byte[prop_wnd_run],0 ;塞 稪 + mcall SF_TERMINATE_PROCESS ;室 ணࠬ + +align 4 +get_point_coords: + ;㧪 न editbox- + push eax ebx + stdcall [tl_node_get_data],tree3 + cmp eax,0 + je @f + mov ebx,[eax] + mov word[NumberSymbolsAD],8 + finit + fld dword[ebx] + fstp qword[Data_Double] + call DoubleFloat_to_String + call String_crop_0 + stdcall [edit_box_set_text], edit1, Data_String + fld dword[ebx+4] + fstp qword[Data_Double] + call DoubleFloat_to_String + call String_crop_0 + stdcall [edit_box_set_text], edit2, Data_String + fld dword[ebx+8] + fstp qword[Data_Double] + call DoubleFloat_to_String + call String_crop_0 + stdcall [edit_box_set_text], edit3, Data_String + stdcall [edit_box_draw], edit1 + stdcall [edit_box_draw], edit2 + stdcall [edit_box_draw], edit3 + @@: + pop ebx eax + ret + +align 4 +proc prop_timer_funct uses eax + ;ᬠਢ 뤥 न + stdcall [tl_node_get_data],tree3 + cmp [cursor_last_draw],eax + je @f + mov [cursor_last_draw],eax + stdcall draw_3d, o3d + @@: + ret +endp + +align 4 +proc mnu_vertexes_select uses eax ebx + stdcall [tl_node_get_data],tree3 + cmp eax,0 + je .no_points + stdcall found_block_data,tree3 + cmp eax,0 + je .no_points + mov bx,word[eax] + cmp bx,ID_ICON_POINT_SEL + je @f + mov word[eax],ID_ICON_POINT_SEL + inc dword[obj_poi_sel_c] + jmp .change + @@: + mov word[eax],ID_ICON_POINT + dec dword[obj_poi_sel_c] + .change: + mov eax,[obj_poi_sel_c] + stdcall convert_int_to_str, txt_select_vert.count,16 + .no_points: + ret +endp + +align 4 +proc mnu_vertexes_deselect uses eax + cmp dword[obj_poi_sel_c],0 + je .no_points + mov dword[obj_poi_sel_c],0 + stdcall [tl_node_poi_get_info], tree3,0 + cmp eax,0 + je .no_points + @@: + mov word[eax],ID_ICON_POINT + stdcall [tl_node_poi_get_next_info], tree3,eax + cmp eax,0 + jne @b + .no_points: + ret +endp + +align 4 +proc mnu_reset_average_x uses eax ebx ecx edx edi + cmp dword[obj_poi_sel_c],2 + jl .end_select + finit + fldz + mov ecx,dword[obj_poi_sel_c] + stdcall dword[tl_node_poi_get_info], tree3,0 + @@: + cmp eax,0 + je .end_select + mov ebx,eax + cmp word[ebx],ID_ICON_POINT_SEL + jne .next_sel0 + stdcall [tl_node_poi_get_data], tree3,ebx + mov eax,[eax] + fadd dword[eax] + dec ecx + jz @f + .next_sel0: + stdcall dword[tl_node_poi_get_next_info], tree3,ebx + jmp @b + @@: + fidiv dword[obj_poi_sel_c] + fstp dword[eax] + mov edx,[eax] + mov ecx,dword[obj_poi_sel_c] + stdcall dword[tl_node_poi_get_info], tree3,0 + @@: + cmp eax,0 + je .end_select + mov ebx,eax + cmp word[ebx],ID_ICON_POINT_SEL + jne .next_sel1 + stdcall [tl_node_poi_get_data], tree3,ebx + mov edi,eax + mov eax,[eax] + mov [eax],edx + stdcall update_tree, edi + dec ecx + jz @f + .next_sel1: + stdcall dword[tl_node_poi_get_next_info], tree3,ebx + jmp @b + @@: + .end_select: + ret +endp + +align 4 +proc mnu_reset_average_y uses eax ebx ecx edx edi + cmp dword[obj_poi_sel_c],2 + jl .end_select + finit + fldz + mov ecx,dword[obj_poi_sel_c] + stdcall dword[tl_node_poi_get_info], tree3,0 + @@: + cmp eax,0 + je .end_select + mov ebx,eax + cmp word[ebx],ID_ICON_POINT_SEL + jne .next_sel0 + stdcall [tl_node_poi_get_data], tree3,ebx + mov eax,[eax] + fadd dword[eax+4] + dec ecx + jz @f + .next_sel0: + stdcall dword[tl_node_poi_get_next_info], tree3,ebx + jmp @b + @@: + fidiv dword[obj_poi_sel_c] + fstp dword[eax+4] + mov edx,[eax+4] + mov ecx,dword[obj_poi_sel_c] + stdcall dword[tl_node_poi_get_info], tree3,0 + @@: + cmp eax,0 + je .end_select + mov ebx,eax + cmp word[ebx],ID_ICON_POINT_SEL + jne .next_sel1 + stdcall [tl_node_poi_get_data], tree3,ebx + mov edi,eax + mov eax,[eax] + mov [eax+4],edx + stdcall update_tree, edi + dec ecx + jz @f + .next_sel1: + stdcall dword[tl_node_poi_get_next_info], tree3,ebx + jmp @b + @@: + .end_select: + ret +endp + +align 4 +proc mnu_reset_average_z uses eax ebx ecx edx edi + cmp dword[obj_poi_sel_c],2 + jl .end_select + finit + fldz + mov ecx,dword[obj_poi_sel_c] + stdcall dword[tl_node_poi_get_info], tree3,0 + @@: + cmp eax,0 + je .end_select + mov ebx,eax + cmp word[ebx],ID_ICON_POINT_SEL + jne .next_sel0 + stdcall [tl_node_poi_get_data], tree3,ebx + mov eax,[eax] + fadd dword[eax+8] + dec ecx + jz @f + .next_sel0: + stdcall dword[tl_node_poi_get_next_info], tree3,ebx + jmp @b + @@: + fidiv dword[obj_poi_sel_c] + fstp dword[eax+8] + mov edx,[eax+8] + mov ecx,dword[obj_poi_sel_c] + stdcall dword[tl_node_poi_get_info], tree3,0 + @@: + cmp eax,0 + je .end_select + mov ebx,eax + cmp word[ebx],ID_ICON_POINT_SEL + jne .next_sel1 + stdcall [tl_node_poi_get_data], tree3,ebx + mov edi,eax + mov eax,[eax] + mov [eax+8],edx + stdcall update_tree, edi + dec ecx + jz @f + .next_sel1: + stdcall dword[tl_node_poi_get_next_info], tree3,ebx + jmp @b + @@: + .end_select: + ret +endp + +align 4 +proc update_tree h_mem:dword +pushad + mov edi,[h_mem] + mov ebx,[edi] + finit + + ; 㧫 ᯨ᪥ tree3 ( ⠩) + mov word[NumberSymbolsAD],5 + mov dword[obj_point.text],0 + cld + mov ecx,3 + .coord: + fld dword[ebx] + fstp qword[Data_Double] + call DoubleFloat_to_String + call String_crop_0 + add ebx,4 + stdcall str_len, Data_String + mov esi,txt_space + add esi,eax + cmp esi,txt_space.end + jl .normal_size + mov esi,txt_space.end-1 ; 1 ஡ 㦭 , - ᫨ + .normal_size: + stdcall str_cat, obj_point.text,esi + stdcall str_cat, obj_point.text,Data_String + loop .coord + mov esi,obj_point.text + mov byte[esi],'*' ;⬥砥 設 﫠 + mov byte[can_save],1 ; '࠭' + add edi,4 + mov ecx,MAX_OBJECT_SIZE-4 + rep movsb +popad + ret +endp + +align 4 +angle_dxm dd 1.7775 ;~ 3d_wnd_w/180 - ਡ 㣫 業 饭 襩 +angle_dym dd 1.3335 ;~ 3d_wnd_h/180 +ratio dd 1.3333 ;~ 3d_wnd_w/3d_wnd_h +cursor_last_draw dd 0 ; ᫥ ᮢ 3d +capt_p dd 0 + +;ॢ ꥪ⠬ 짮⥫᪮ 䠩 +tree3 tree_list MAX_OBJECT_SIZE,3, tl_key_no_edit+tl_list_box_mode,\ + 16,16, 0xffffff,0xb0d0ff,0x400040, 5,290,303,140, 16, 4,0, el_focus,\ + w_scr_t3,get_point_coords + +edit1 edit_box 80, 76, 269, 0xffd0d0, 0xff, 0x80ff, 0, 0x8000, 32, string1, mouse_dd, 0 +edit2 edit_box 80, 160, 269, 0xd0d0ff, 0xff, 0x80ff, 0, 0x8000, 32, string2, mouse_dd, 0 +edit3 edit_box 80, 244, 269, 0xd0ffd0, 0xff, 0x80ff, 0, 0x8000, 32, string3, mouse_dd, 0 +editboxes_end: + +string1 rb 34 +string2 rb 34 +string3 rb 34 + +align 4 +w_scr_t3 scrollbar 16, 0,0,0, 15, 100,0,0, 0,0,0, 1 diff --git a/programs/develop/libraries/box_lib/trunk/t_edit.asm b/programs/develop/libraries/box_lib/trunk/t_edit.asm index 5942465f7..534d07ce3 100644 --- a/programs/develop/libraries/box_lib/trunk/t_edit.asm +++ b/programs/develop/libraries/box_lib/trunk/t_edit.asm @@ -1,4486 +1,4482 @@ -; ⥬ ⥪ box_lib.obj -; TextEditor KolibriOS -; 䠩 ᫥ ࠧ 12.01.2021 IgorA -; ਬ GPL2 業 - -;input: -; edi = pointer to tedit struct -; reg = index -;output: -; reg = pointer to 'tex' struct -macro ConvertIndexToPointer reg { - imul reg,sizeof.symbol - add reg,ted_tex -} - -;--- out_reg = ted_key_words_data[ind_reg].Text[0] --- -macro ColToIndexOffset ind_reg,out_reg { - mov out_reg,ind_reg - imul out_reg,sizeof.TexColViv - add out_reg,ted_key_words_data -} - -TED_LINES_IN_NEW_FILE equ 30 ;᫮ ப 䠩 -MAX_COLOR_WORD_LEN equ 40 -;------------------------------------------------------------------------------ -struct TexSelect - x0 dd ? - y0 dd ? - x1 dd ? - y1 dd ? -ends - -struct TexColViv - Text rb MAX_COLOR_WORD_LEN ; ᫮ ᢥ⪨ - f1 dd 0 ; ࠢ ᫮ - flags db ? ; f1+4 䫠 ᯮ㥬 뤥 - endc db ? ; f1+5 ᨬ 뤥 (ᯮ flags&4) - escc db ? ; f1+6 ࠭騩 ᨬ (ᯮ flags&4) - color db ? ; f1+7 梥 -ends - -struct symbol - c db ? ; +0 ᨬ - col db ? ; +1 梥 - perv dd ? ; +2 - next dd ? ; +6 㪠⥫ - tc dd ? ; +10 ६. ᮧ - td dd ? ; +14 ६. 㤠 -ends -;------------------------------------------------------------------------------ - -ted_symbol_space db 32 ;ascii ஡, 뢠 㦥 -ted_symbol_tab db 26 ;ascii ५ ࠢ, ᯮ ᮢ ⠡樨 ० ᨬ - -if lang eq ru - -txtRow db 'ப',0 -txtCol db '',0 -txtOtm db '⬥',0 -txtBuf db ':',0 - -else - -txtRow db 'Rows',0 -txtCol db 'Cols',0 -txtOtm db 'Undo',0 -txtBuf db 'Buffer:',0 - -end if - -;EvChar - ⠡ 䨫஢ 塞 ᨬ, - 譨 -align 16 -EvChar db 0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0 - db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 - db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 - db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - -KM_SHIFT equ 0x00010000 -KM_CTRL equ 0x00020000 -KM_ALT equ 0x00040000 -KM_NUMLOCK equ 0x00080000 - -; KEY CODES -KEY_F1 equ 0x0000003B -KEY_F2 equ 0x0000003C -KEY_F3 equ 0x0000003D - - - -align 16 -proc ted_init uses eax ecx edi, edit:dword - mov edi,[edit] - - mov ecx,sizeof.symbol - imul ecx,ted_max_chars - invoke mem.alloc,ecx ;뤥塞 - mov ted_tex,eax - mov ted_tex_1,eax - add ted_tex_1,sizeof.symbol - add eax,ecx - mov ted_tex_end,eax - - stdcall ted_clear, edi,1 - -;------------------------------------------------- - mov ecx,1024 ;1024 - ᨢ ted_arr_key_pos - add ecx,ted_syntax_file_size - invoke mem.alloc,ecx - mov ted_arr_key_pos,eax - add eax,1024 - mov ted_syntax_file,eax - - stdcall ted_init_scroll_bars,edi,3 - ret -endp - -MIN_W_SCRL_ARE equ 3 ;쭠 ⮡ࠦ . ஫ -MIN_H_SCRL_ARE equ 3 ;쭠 ⮡ࠦ ਧ. ஫ -;input: -; opt = 1 - 梥 ஫, 2 - ࠧ , -; 4 - ࠧ 㬥 -align 16 -proc ted_init_scroll_bars, edit:dword, opt:dword - pushad - mov edi,[edit] - mov esi,ted_scr_w - mov ebx,ted_scr_h - bt dword[opt],0 - jae @f - mov ecx,ted_color_wnd_work - mov dword[esi+sb_offs_bckg_col],ecx - mov dword[ebx+sb_offs_bckg_col],ecx - mov ecx,ted_color_wnd_capt - mov dword[esi+sb_offs_frnt_col],ecx - mov dword[ebx+sb_offs_frnt_col],ecx - mov ecx,ted_color_wnd_bord - mov dword[esi+sb_offs_line_col],ecx - mov dword[ebx+sb_offs_line_col],ecx - @@: - bt dword[opt],2 ; ࠧ 㬥 ? - jae .doc_resize - call ted_get_num_lines - cmp eax,TED_LINES_IN_NEW_FILE - jge @f - mov eax,TED_LINES_IN_NEW_FILE - @@: - mov dword[esi+sb_offs_max_area],eax - .doc_resize: - bt dword[opt],1 ; ࠧ ? - jae .no_size - mov edx,ted_wnd_l - add edx,ted_rec_l - mov word[ebx+sb_offs_start_x],dx ;⠢塞 ਧ. ஫ - mov eax,ted_wnd_h ;calculate lines in page - mov edx,ted_wnd_t - add edx,eax - mov word[ebx+sb_offs_start_y],dx ;⠢塞 孨 ਧ. ஫ - sub eax,ted_rec_t - xor edx,edx - mov ecx,ted_rec_h - div ecx - cmp eax,MIN_W_SCRL_ARE - jg @f - mov eax,MIN_W_SCRL_ARE - @@: - mov dword[esi+sb_offs_cur_area],eax - - mov eax,ted_wnd_w ;calculate cols in page - mov edx,ted_wnd_l ; - add edx,eax ;塞 ਭ - mov word[esi+sb_offs_start_x],dx ;⠢塞 . ஫ - mov edx,ted_wnd_t - mov word[esi+sb_offs_start_y],dx ;⠢塞 孨 . ஫ - mov edx,ted_wnd_h - mov word[esi+sb_offs_size_y],dx ;⠢塞 . ஫ - sub eax,ted_rec_l - mov word[ebx+sb_offs_size_x],ax ;⠢塞 ਭ ਧ. ஫ - xor edx,edx - mov ecx,ted_rec_w - div ecx - cmp eax,MIN_H_SCRL_ARE - jg @f - mov eax,MIN_H_SCRL_ARE - @@: - dec eax - mov dword[ebx+sb_offs_cur_area],eax ;⠭ ᫮ ᨬ, ࠭ ਧ. ஫ - .no_size: - popad - ret -endp - -align 16 -proc ted_delete uses edi, edit:dword - mov edi,[edit] - invoke mem.free,ted_tex - invoke mem.free,ted_arr_key_pos ;ted_syntax_file - ret -endp - - -;input: -; eax = key kodes -align 16 -proc ted_key, edit:dword, table:dword, control:dword - pushad - mov edi,[edit] - mov esi,ted_el_focus - cmp dword[esi],edi - jne .end_key_fun ; 䮪 室 㭪樨 - mov esi,dword[control] - - cmp ah,KEY_F1 ;[F1] - jne @f - stdcall ted_show_help_f1,edi - jmp .end_key_fun - @@: - cmp ah,KEY_F3 ;[F3] - jne @f - stdcall ted_but_find,edi,0 - jmp .end_key_fun - @@: - - test esi,KM_CTRL ;Ctrl+... - jz .key_Ctrl - ; *** 맮 譨 㭪権 ॡ /࠭/᪠/... - cmp ted_fun_on_key_ctrl_all,0 - je .end0 - xor al,al - cmp ah,24 ;Ctrl+O - jne @f - mov al,'O' - @@: - cmp ah,31 ;Ctrl+S - jne @f - mov al,'S' - @@: - cmp ah,33 ;Ctrl+F - jne @f - mov al,'F' - @@: - cmp ah,34 ;Ctrl+G - jne @f - mov al,'G' - @@: - cmp ah,35 ;Ctrl+H - jne @f - mov al,'H' - @@: - cmp ah,49 ;Ctrl+N - jne @f - mov al,'N' - @@: - or al,al - jz .end0 - and eax,0xff - test esi,KM_SHIFT - jz @f - or eax,0x100 - @@: - stdcall ted_fun_on_key_ctrl_all, eax - jmp .end_key_fun - .end0: - - ; *** 맮 ७ 㭪権 - cmp ah,30 ;Ctrl+A - jne @f - call ted_sel_all - @@: - cmp ah,44 ;Ctrl+Z - jne @f - stdcall ted_but_undo,edi - @@: - cmp ah,45 ;Ctrl+X - jne @f - stdcall ted_but_cut,edi - @@: - cmp ah,46 ;Ctrl+C - jne @f - stdcall ted_but_copy,edi - @@: - cmp ah,47 ;Ctrl+V - jne @f - stdcall ted_but_paste,edi - @@: - cmp ah,199 ;Ctrl+Home - jne @f - call ted_key_ctrl_home - @@: - cmp ah,207 ;Ctrl+End - jne @f - call ted_key_ctrl_end - @@: - jmp .end_key_fun - .key_Ctrl: - - test esi,KM_SHIFT ;Shift+... - jz .key_Shift - cmp ah,72 ;Shift+Up - jne @f - call ted_sel_key_up - @@: - cmp ah,75 ;Shift+Left - jne @f - call ted_sel_key_left - @@: - cmp ah,77 ;Shift+Right - jne @f - call ted_sel_key_right - @@: - cmp ah,80 ;Shift+Down - jne @f - call ted_sel_key_down - @@: - ;mov ted_drag_k,1 ;稭 뤥 - jmp .key_MoveCur - .key_Shift: -;------------------------------------------------- - cmp ah,72 ;178 ;Up - jne @f - call ted_draw_cursor_sumb - call ted_cur_move_up - cmp dl,8 - jne .no_red_0 - call ted_scroll_set_redraw - stdcall ted_draw,edi - jmp @f - .no_red_0: - call ted_sel_end - @@: - cmp ah,80 ;177 ;Down - jne @f - call ted_draw_cursor_sumb - call ted_cur_move_down - cmp dl,8 - jne .no_red_1 - call ted_scroll_set_redraw - stdcall ted_draw,edi - jmp @f - .no_red_1: - call ted_sel_end - @@: - cmp ah,75 ;176 ;Left - jne @f - call ted_draw_cursor_sumb - call ted_cur_move_left - cmp dl,8 - jne .no_red_2 - call ted_scroll_set_redraw - stdcall ted_draw,edi - jmp @f - .no_red_2: - call ted_sel_end - @@: - cmp ah,77 ;179 ;Right - jne @f - call ted_draw_cursor_sumb - call ted_cur_move_right - cmp dl,8 - jne .no_red_3 - call ted_scroll_set_redraw - stdcall ted_draw,edi - jmp @f - .no_red_3: - call ted_sel_end - @@: - cmp ah,71 ;180 ;Home - jne @f - call ted_draw_cursor_sumb - call ted_cur_move_x_first_char - cmp dl,8 - jne .no_red_4 - call ted_scroll_set_redraw - stdcall ted_draw,edi - jmp @f - .no_red_4: - call ted_sel_end - @@: - cmp ah,79 ;181 ;End - jne @f - call ted_draw_cursor_sumb - call ted_cur_move_x_last_char - cmp dl,8 - jne .no_red_5 - call ted_scroll_set_redraw - stdcall ted_draw,edi - jmp @f - .no_red_5: - call ted_sel_end - @@: - cmp ah,73 ;184 ;PageUp - jne @f - call ted_cur_move_page_up - cmp dl,0 - je @f - call ted_scroll_set_redraw - stdcall ted_draw,edi - mov ted_drag_k,0 ;稢 뤥 - @@: - cmp ah,81 ;183 ;PageDown - jne @f - call ted_cur_move_page_down - cmp dl,0 - je @f - call ted_scroll_set_redraw - stdcall ted_draw,edi - mov ted_drag_k,0 ;稢 뤥 - @@: -;------------------------------------------------- - .key_MoveCur: - - ; ய᪠ 㦥 , ᨬ - cmp ah,42 ;[L Shift] 㣨 - je .end_key_fun - cmp ah,54 ;[R Shift] 㣨 - je .end_key_fun - cmp ah,58 ;[Caps Lock] - je .end_key_fun - cmp ah,69 ;[Pause Break] - je .end_key_fun - cmp ah,120 ;[Fn] - je .end_key_fun - cmp ah,0x80 ;if key up - ja .end_key_fun - - cmp dword[table],0 - je @f - stdcall KeyConvertToASCII, [table] - @@: - - ;mov ted_drag_k,0 ;稢 뤥 - - lea edx,[EvChar] ;६ ⠡ ⨬묨 ᨬ - add dl,ah - jae @f - add edx,0x100 ;᫨ 뫮 ९ ᨬ - @@: - cmp byte[edx],1 - jne @f - mov ted_key_new,ah - call ted_set_undo - mov edx,ted_opt_ed_change_time+ted_opt_ed_move_cursor - stdcall ted_sel_text_del,edx - cmp al,1 - jne .del - mov edx,ted_opt_ed_move_cursor - .del: - cmp ted_cur_ins,1 - je .no_ins_mod - stdcall ted_text_del,edi,ted_opt_ed_change_time - mov edx,ted_opt_ed_move_cursor - .no_ins_mod: - mov ecx,edi - add ecx,ted_offs_key_new - stdcall ted_text_add,edi,ecx,1,edx ;塞 ᨬ - cmp ted_key_new,13 - jne .dr_m_win - ;᫨ ⠢ ᨬ ப - mov ecx,ted_scr_w - inc dword[ecx+sb_offs_max_area] ;㢥稢 ࠧ ⨪쭮 ஫ - mov edx,ted_cur_y - cmp edx,[ecx+sb_offs_cur_area] - jl .no_change - dec ted_cur_y ; ⠢塞 - inc dword[ecx+sb_offs_position] ;ᤢ 㭮 - .no_change: - stdcall ted_draw,edi - jmp .dr_cur_l - .dr_m_win: - stdcall ted_draw_cur_line,edi - .dr_cur_l: - cmp ted_fun_draw_panel_buttons,0 - je @f - call ted_fun_draw_panel_buttons - @@: - - cmp ah,8 ;[<-] - jne @f - call ted_set_undo - stdcall ted_sel_text_del,ted_opt_ed_change_time - cmp al,1 - je .del_one_b - stdcall ted_text_del,edi,ted_opt_ed_change_time+ted_opt_ed_move_cursor - .del_one_b: - stdcall ted_draw,edi - cmp ted_fun_draw_panel_buttons,0 - je .end_key_fun - call ted_fun_draw_panel_buttons - jmp .end_key_fun -align 4 - @@: - - cmp ah,182 ;Delete - jne @f - call ted_set_undo - stdcall ted_sel_text_del,ted_opt_ed_change_time - cmp al,1 - je .del_one_d - stdcall ted_text_del,edi,ted_opt_ed_change_time - .del_one_d: - stdcall ted_draw,edi - cmp ted_fun_draw_panel_buttons,0 - je .end_key_fun - call ted_fun_draw_panel_buttons - jmp .end_key_fun - @@: - - cmp ah,185 ;Ins - jne @f - call ted_draw_cursor_sumb - xor ted_cur_ins,1 - call ted_draw_main_cursor - @@: - - .end_key_fun: - popad - ret -endp - -;output: -; al = 1 - can save -align 16 -proc ted_can_save uses ecx edi, edit:dword - mov edi,[edit] - - mov ecx,ted_tim_ch - sub ecx,ted_tim_undo - mov al,1 - cmp ted_tim_ls,ecx - jne @f - dec al - @@: - ret -endp - -;input: -; edi = pointer to tedit struct -;output: -; al = 1 - selected -align 16 -proc ted_is_select uses ebx - xor al,al - cmp ted_drag_m,1 - je @f - inc al - mov ebx,ted_sel_x0 - cmp ebx,ted_sel_x1 - jne @f - mov ebx,ted_sel_y0 - cmp ebx,ted_sel_y1 - jne @f - xor al,al - @@: - ret -endp - -;input: -; edi = pointer to tedit struct -align 16 -proc ted_sel_normalize uses ecx esi - push edi - mov esi,edi - add esi,ted_offs_sel - add edi,ted_offs_seln - mov ecx,sizeof.TexSelect/4 - rep movsd - pop edi - - jmp @f - .swp_f: - mov ecx,ted_seln_x0 - m2m ted_seln_x0,ted_seln_x1 - mov ted_seln_x1,ecx - - mov ecx,ted_seln_y0 - cmp ecx,ted_seln_y1 ;(sel_y0>sel_y1) - jle .end_f - m2m ted_seln_y0,ted_seln_y1 - mov ted_seln_y1,ecx - - jmp .end_f -align 4 - @@: - - mov ecx,ted_seln_y0 - cmp ecx,ted_seln_y1 ;(sel_y0>sel_y1) - jg .swp_f - - cmp ecx,ted_seln_y1 ;(sel_y0==sel_y1) - jne .end_f - mov ecx,ted_seln_x0 - cmp ecx,ted_seln_x1 ;(sel_x0>sel_x1) - jg .swp_f - - .end_f: - ret -endp - -;input: -; edi = pointer to tedit struct -;description: -; 㭪 뢠 砫 뤥 -align 16 -proc ted_sel_start uses eax ecx - mov eax,ted_scr_h - mov ecx,ted_cur_x - add ecx,[eax+sb_offs_position] - mov ted_sel_x0,ecx - mov ted_sel_x1,ecx - - mov eax,ted_scr_w - mov ecx,ted_cur_y - add ecx,[eax+sb_offs_position] - mov ted_sel_y0,ecx - mov ted_sel_y1,ecx - ret -endp - -;input: -; edi = pointer to tedit struct -;description: -; 㭪 뢠 ⨨ 뤥 -align 16 -proc ted_sel_end uses eax - mov ted_drag_k,0 ;稢 뤥 - call ted_is_select - or al,al - jz @f - xor eax,eax - mov ted_sel_x0,eax - mov ted_sel_x1,eax - mov ted_sel_y0,eax - mov ted_sel_y1,eax - stdcall ted_draw,edi - jmp .end_f - @@: - call ted_draw_main_cursor - .end_f: - ret -endp - -;input: -; edi = pointer to tedit struct -;description: -; 㭪 뢠 ६饭 뤥 -align 16 -proc ted_sel_move - push eax ecx - mov ecx,ted_cur_x - mov eax,ted_scr_h - add ecx,[eax+sb_offs_position] - mov ted_sel_x1,ecx - - mov eax,ted_scr_w - mov ecx,ted_cur_y - add ecx,[eax+sb_offs_position] - mov ted_sel_y1,ecx - pop ecx eax - cmp ted_fun_draw_panel_buttons,0 ;redraw toolbar (need to button Copy) - je @f - call ted_fun_draw_panel_buttons - @@: - ret -endp - -;input: -; edi = pointer to tedit struct -;description: -; 㭪 뢠 뤥 ᥣ 㬥 -align 16 -proc ted_sel_all - push eax - xor eax,eax - mov ted_sel_x0,eax - mov ted_sel_y0,eax - - mov ted_sel_x1,eax ;??? - call ted_get_num_lines - mov ted_sel_y1,eax - pop eax - stdcall ted_draw,edi - cmp ted_fun_draw_panel_buttons,0 ;redraw toolbar (need to button Copy) - je @f - call ted_fun_draw_panel_buttons - @@: - ret -endp - -;input: -; cl_al_mem = 1 - clear all memory -align 16 -proc ted_clear uses ecx edi, edit:dword, cl_al_mem:dword - mov edi,[edit] - - mov ted_cur_x,0 - mov ted_cur_y,0 - mov ted_tim_ch,0 - mov ted_tim_ls,0 - mov ted_tim_co,0 - mov ted_tim_undo,0 - mov ted_help_id,-1 - mov ecx,sizeof.symbol - shl ecx,1 - add ecx,ted_tex - mov ted_ptr_free_symb,ecx - - mov ecx,ted_scr_w - mov dword[ecx+sb_offs_position],0 - mov dword[ecx+sb_offs_max_area],100 ;᫮ ப 㬥 - mov dword[ecx+sb_offs_redraw],1 - mov ecx,ted_scr_h - mov dword[ecx+sb_offs_position],0 - mov dword[ecx+sb_offs_max_area],100 ;᫮ ᨬ 㬥 - - mov ted_sel_x0,0 - mov ted_sel_y0,0 - mov ted_sel_x1,0 - mov ted_sel_y1,0 - - cmp dword[cl_al_mem],0 - je .exit - - push edx - mov ecx,sizeof.symbol - imul ecx,ted_max_chars - mov edx,ted_tex - @@: - mov byte [edx],0 - inc edx - loop @b - mov edx,ted_tex - mov dword [edx+symbol.next],1 - pop edx - - .exit: - ret -endp - - -align 16 -proc ted_init_syntax_file, edit:dword - pushad - mov edi,[edit] - - mov ecx,0x100 - mov edx,ted_arr_key_pos - @@: - mov dword[edx],-1 - add edx,4 - loop @b - - ;init: ted_colors_text_count, ted_key_words_count, ... - mov ted_colors_text_count,1 - mov ted_help_text_f1,0 - mov ted_help_id,-1 ;䨪 ᫮ ࠢ - - mov eax,edi ;࠭塞 祭 edi - mov esi,ted_syntax_file - add edi,ted_offs_count_colors ;edi = &ted_key_words_count - mov ecx,9 - rep movsd - mov edi,eax ;⠭ 祭 edi - - mov eax,ted_syntax_file - add eax,32 - mov ted_text_colors,eax - - mov eax,ted_colors_text_count ;init: count_colors_text (offset to key words) - lea eax,[4*eax+32] - add eax,ted_syntax_file - mov ted_key_words_data,eax - - mov ecx,ted_key_words_count ;init: ted_arr_key_pos (first key positions) - or ecx,ecx - jz .no_words - xor eax,eax - @@: - ColToIndexOffset eax,edx - movzx ebx,byte[edx] - mov esi,ted_arr_key_pos - lea esi,[esi+4*ebx] - cmp dword[esi],-1 - jne .no_ch_key - mov [esi],eax - .no_ch_key: - inc eax - loop @b - .no_words: - - ;init: ted_help_text_f1 - mov ecx,ted_key_words_count ;⢮ 祢 ᫮ - imul ecx,sizeof.TexColViv ;ࠧ 1- . . - add ecx,ted_key_words_data ;砫 䠩 . . - mov ted_help_text_f1,ecx ;⪠ , 稭 ⥪ ࠢ - - stdcall ted_init_scroll_bars,edi,1 ;塞 梥 ஫ - .no_colors: - popad - ret -endp - -;input: -; ebx = file size -; edi = pointer to tedit struct -;description: -; 㭪 뢠 ⨨ 䠩 -align 16 -proc ted_on_open_file - push eax ;destination - push ecx ;for cycle - push edx ;source - push esi - - or ebx,ebx - jnz @f - ;᫨ 䠩 ⮩ - stdcall ted_clear,edi,1 ;⨬ - jmp .end_opn -align 4 - @@: - stdcall ted_clear,edi,0 ;⨬ , ⮬ 㤥 묨 묨 - - mov edx,ted_tex - mov ecx,ebx - .s_10: - cmp word[edx],0xa0d ;ய᪠ 10- ᨬ ᫨ । ⮨ 13- - jne @f - dec ecx - jz .no_10 - dec ecx - jz .no_10 - add edx,2 - @@: - cmp byte[edx],10 - jne @f - mov byte[edx],13 ;塞 10- ᨬ ப - @@: - inc edx - loop .s_10 - .no_10: - - ;ॢ 䠩 t_edit - mov ecx,ebx - lea eax,[ebx+2] - ConvertIndexToPointer eax - mov edx,ted_tex - add edx,ebx - push ebx - @@: - mov ebx,[edx] - mov byte[eax],bl - mov dword[eax+symbol.perv],ecx - inc dword[eax+symbol.perv] - mov dword[eax+symbol.next],ecx - add dword[eax+symbol.next],3 - ;mov byte[eax+1],0 ;col=0 - mov dword[eax+symbol.tc],-1 - mov dword[eax+symbol.td],0 - - or ecx,ecx - jz @f - dec ecx - dec edx - sub eax,sizeof.symbol - jmp @b -align 4 - @@: - pop ebx - mov dword[eax+symbol.perv],0 ; first sumbol 'perv=0' - - mov edx,ted_tex ; ன 砫쭮 㦥 ᨬ - ; begining sumbol 'perv=0' 'next=2' - mov dword[edx+symbol.perv],0 - mov dword[edx+symbol.next],2 - - add edx,sizeof.symbol ; ன 筮 㦥 ᨬ - mov dword[edx+symbol.next],0 ; last sumbol 'next=0' - mov dword[edx+symbol.perv],ebx ; last sumbol 'perv=last' - inc dword[edx+symbol.perv] - mov dword[edx+symbol.tc],0 ; ⠢ ६ ᮧ ࠢ 0, ᨬ ࠢ쭮 ࠡ뢠 ⨨ 䠩 28 - - mov edx,ebx - inc edx ;2 = rezerv sumbols - imul edx,sizeof.symbol - add edx,ted_tex - mov dword[edx+symbol.next],1 ; last sumbol 'next=1' - - @@: ;clear memory, need if before was open big file - add edx,sizeof.symbol - cmp edx,ted_tex_end - jge .end_opn - mov dword[edx+symbol.tc],0 - mov dword[edx+symbol.td],0 - jmp @b -align 4 - .end_opn: - - call ted_get_num_lines - cmp eax,TED_LINES_IN_NEW_FILE - jge @f - mov eax,TED_LINES_IN_NEW_FILE - @@: - mov esi,ted_scr_w - mov dword[esi+sb_offs_max_area],eax - pop esi edx ecx eax - - call ted_text_colored - stdcall ted_draw,edi - cmp ted_fun_draw_panel_buttons,0 - je @f - call ted_fun_draw_panel_buttons - @@: - ret -endp - -;input: -; edx = pointer to symbol struct -; edi = pointer to tedit struct -;output: -; edx = pointer to 'perv' visible symbol struct -align 16 -ted_iterat_perv: - cmp ted_tim_undo,0 - je .else - push ebx - @@: - mov edx,[edx+symbol.perv] - or edx,edx - jz @f - imul edx,sizeof.symbol - add edx,ted_tex - call ted_symbol_not_vis - cmp bl,1 - je @b - cmp byte[edx],10 ;ய ᨬ 10 - je @b - pop ebx - ret - @@: - mov edx,ted_tex ;砫 䠩 - pop ebx - ret - .else: - mov edx,[edx+symbol.perv] - or edx,edx - jz @f - imul edx,sizeof.symbol - add edx,ted_tex - cmp dword[edx+symbol.td],0 - jne .else - cmp byte[edx],10 ;ய ᨬ 10 - je .else - ret - @@: - mov edx,ted_tex ;砫 䠩 - ret - - -;input: -; edx = pointer to symbol struct -; edi = pointer to tedit struct -;output: -; edx = pointer to 'next' visible symbol struct -align 16 -ted_iterat_next: - cmp ted_tim_undo,0 - je .else - push ebx - @@: - mov edx,[edx+symbol.next] - cmp edx,1 - jle @f - imul edx,sizeof.symbol - add edx,ted_tex - - call ted_symbol_not_vis - cmp bl,1 - je @b - cmp byte[edx],10 ;ய ᨬ 10 - je @b - pop ebx - ret - @@: - mov edx,ted_tex_1 ; 䠩 - pop ebx - ret - .else: - mov edx,[edx+symbol.next] - cmp edx,1 - jle @f - imul edx,sizeof.symbol - add edx,ted_tex - - cmp dword[edx+symbol.td],0 - jne .else - cmp byte[edx],10 ;ய ᨬ 10 - je .else - ret - @@: - mov edx,ted_tex_1 ; 䠩 - ret - -;input: -; bl = symbol end of select -; bh = ࠭騩 ᨬ (= 0 ᫨ ஢ન ) -; edx = pointer to symbol struct -; edi = pointer to tedit struct -;description: -; ᫥ 㪠 ᨬ -align 16 -ted_iterat_next_pos_char: - push ax - mov al,1 ;।騩 ᨬ, 㦨 ࠢ ᨬ bh - @@: - cmp bl,byte[edx] - je .found - .no_found: - cmp edx,ted_tex_1 - jle @f - mov al,byte[edx] - call ted_iterat_next - jmp @b - .found: - cmp bh,al - je .no_found - @@: - call ted_iterat_next - pop ax - ret - -;input: -; edx = pointer to symbol struct -; edi = pointer to tedit struct -align 16 -ted_iterat_perv_color_tag: - @@: - cmp byte[edx+1],0 - jne @f - call ted_iterat_perv - cmp edx,ted_tex_1 - jle @f - jmp @b -align 4 - @@: - ret - -;input: -; edx = pointer to symbol struct -; edi = pointer to tedit struct -align 16 -ted_iterat_next_color_tag: - @@: - call ted_iterat_next - cmp byte[edx+1],0 - jne @f - cmp edx,ted_tex_1 - jle @f - jmp @b -align 4 - @@: - ret - -;input: -; edx = pointer to symbol struct -; edi = pointer to tedit struct -;output: -; bl = 1 if sumbol not visible -; (tex[i].td+ted_tim_undo<=ted_tim_ch && tex[i].td) || (tex[i].tc>ted_tim_ch-ted_tim_undo) -align 16 -ted_symbol_not_vis: - push eax - - xor bl,bl - cmp dword[edx+symbol.td],0 - je @f - mov eax,[edx+symbol.td] ;eax=tex[i].td - add eax,ted_tim_undo - cmp eax,ted_tim_ch - jg @f - mov bl,1 - pop eax - ret - @@: - - mov eax,ted_tim_ch - sub eax,ted_tim_undo - cmp [edx+symbol.tc],eax - jle @f - or bl,1 - @@: - - pop eax - ret - -;input: -; text - pointer to text string -; add_opt - options -align 16 -proc ted_text_add, edit:dword, text:dword, t_len:dword, add_opt:dword - locals - new_spc dd ? ;count new spaces - new_lin dd ? ;count new lines - endl -;ᯮ짮 ॣ஢ 㭪樨: -;eax - ⠢ ⥪ -;ebx - ६ 㦤, ⠢塞 ⥪ -;ecx - ६ 㦤 -;edx - 㪠⥫ ᨬ - pushad - cmp dword[t_len],1 ;஢塞 塞 ⥪ - jl .no_add ; <1 룠 㭪樨,  - - mov edi,[edit] - mov esi,[text] - - call ted_get_pos_by_cursor - call ted_get_text_perv_pos - call ted_get_text_arr_index ;eax=po_t - - mov dword[new_spc],0 - cmp ted_gp_opt,2 - je @f - push eax ;c_sp=cur[cn].x+Scroller->XPos-StrLen(cur[cn].y+Scroller->YPos); - mov eax,ted_scr_h - mov eax,[eax+sb_offs_position] - add eax,ted_cur_x ;eax - ᨬ - mov [new_spc],eax - - mov eax,ted_scr_w - mov eax,[eax+sb_offs_position] - add eax,ted_cur_y ;eax - ப - call ted_strlen ;ebx = line len - sub [new_spc],ebx ; 樨 ⭨ ப, 㧭 ⢮ 塞 ஡ - pop eax - @@: - - mov ebx,[t_len] - - mov dword[new_lin],0 - cmp ted_gp_opt,0 - jne @f - push eax - mov eax,ted_scr_w - mov eax,[eax+sb_offs_position] - add eax,ted_cur_y - inc eax - mov [new_lin],eax - - call ted_get_num_lines - sub [new_lin],eax - ;㢥稢 ஫ ᫮ ⥫ ப - mov ecx,ted_scr_w - add [ecx+sb_offs_max_area],eax ;㢥稢 ࠧ ⨪쭮 ஫ - pop eax - @@: - - mov edx,ted_ptr_free_symb - .beg_cycle: ;for(i=...;i ted_cur_x - mov ted_gp_opt,1 - cmp eax,ecx - jge @f ; Row >= ted_cur_y - .u1_0: - mov ted_gp_opt,0 - inc ebx - cmp byte [edx],13 - jne @b - cmp eax,ecx - jge @f ; Row >= ted_cur_y - inc eax - xor ebx,ebx - jmp @b - @@: - cmp eax,ecx - jne @f ; Row = ted_cur_y - inc ted_gp_opt - @@: - cmp ted_gp_opt,0 - jne @f - mov edx,ted_tex_1 - ;call ted_get_text_perv_pos - @@: - ret -endp - -;input: -; eax = Row -; edi = pointer to tedit struct -;output: -; ebx = str len -align 16 -ted_strlen: - push edx ecx - ;ecx = Row, from cycle - - xor ebx,ebx - xor ecx,ecx - mov edx,ted_tex - @@: - call ted_iterat_next - cmp edx,ted_tex_1 - jle @f - inc ebx - cmp byte [edx],13 - jne @b - dec ebx ;lenght minus 1 sumbol to paragraph - cmp eax,ecx - je @f - xor ebx,ebx - inc ecx - jmp @b - @@: - - cmp eax,ecx - je @f - xor ebx,ebx - @@: - - pop ecx edx - ret - - -;input: -; edx = symbol position -; edi = pointer to tedit struct -;output: -; eax = number of line -; ebx = symbol position in line -align 16 -ted_get_text_coords: - push edx - xor eax,eax - xor ebx,ebx - @@: - call ted_iterat_perv - - or eax,eax - jnz .no_col_mov - inc ebx - .no_col_mov: - - cmp edx,ted_tex_1 - jle @f - cmp byte [edx],13 - jne @b - inc eax - jmp @b - @@: - dec ebx - pop edx - ret - -;input: -; edi = pointer to tedit struct -;output: -; eax = num lines -align 16 -ted_get_num_lines: - push edx - mov eax,1 - mov edx,ted_tex - @@: - call ted_iterat_next - cmp edx,ted_tex_1 - jle @f - cmp byte[edx],13 - jne @b - inc eax - jmp @b - @@: -;... -;dec eax - pop edx - ret - - -;input: -; edi = pointer to tedit struct -;description: -; ⬥ ⬥ ⢨, । 㬥 -align 16 -proc ted_set_undo - mov ted_drag_k,0 ;稢 뤥 - cmp ted_tim_undo,1 - jl .no_work - - push eax ebx edx - mov edx,ted_tex - call ted_get_text_next_pos ;long i=tex[0].next; - mov eax,ted_tim_undo - sub ted_tim_ch,eax ;ted_tim_ch-=ted_tim_undo; - mov eax,ted_tim_ch - cmp ted_tim_ls,eax ;if(ted_tim_ls>ted_tim_ch) - jle @f - mov ted_tim_ls,0 - @@: - cmp edx,ted_tex_1 - jle @f - - ;if(tex[i].tc>ted_tim_ch){ // ᫨ ᮧ ᨬ 뫮 ⬥ - cmp [edx+symbol.tc],eax - jle .no_u1 - mov dword[edx+symbol.tc],0 - mov dword[edx+symbol.td],0 - - mov ebx,[edx+symbol.perv] - imul ebx,sizeof.symbol - add ebx,ted_tex ;ebx=tex[i].perv - m2m dword [ebx+symbol.next],dword [edx+symbol.next] ;tex[tex[i].perv].next=tex[i].next; - - mov ebx,[edx+symbol.next] - imul ebx,sizeof.symbol - add ebx,ted_tex ;ebx=tex[i].next - m2m dword [ebx+symbol.perv],dword [edx+symbol.perv] ;tex[tex[i].next].perv=tex[i].perv; - - cmp ted_ptr_free_symb,edx - jle .no_cor_free - mov ted_ptr_free_symb,edx ;塞 㪠⥫ ᢮ ᨬ, ண ᪠ - .no_cor_free: - mov edx,ebx ;⨬㥬 ᪮ (edx ᫥ 맮 ted_get_text_next_pos 㤥 ࠢ ebx) - jmp @b - .no_u1: - - ;else if(tex[i].td>ted_tim_ch) tex[i].td=0; // ᫨ 㤠 ᨬ 뫮 ⬥ - cmp [edx+symbol.td],eax - jle .no_u2 - mov dword[edx+symbol.td],0 - .no_u2: - - call ted_get_text_next_pos - jmp @b - @@: - mov ted_tim_undo,0 - mov eax,ted_tim_co - cmp ted_tim_ch,eax - jge @f - mov ted_tim_co,0 - @@: - pop edx ebx eax - .no_work: - ret -endp - -;description: -; 室 㪠 -;input: -; row = ப -; col = ᨬ -align 16 -proc ted_go_to_position uses ecx edx edi, edit:dword, row:dword, col:dword - mov edi,[edit] - ; ⮢ ப - mov edx,[row] - call ted_get_num_lines - cmp edx,eax - jle @f - mov edx,eax ;࠭祭 ப max - @@: - dec edx - cmp edx,0 - jge @f - xor edx,edx ;࠭祭 ப min - @@: - ; ⮢ ᨬ - mov ecx,[col] - dec ecx - cmp ecx,0 - jge @f - xor ecx,ecx - @@: - call ted_go_to_pos - stdcall ted_draw,edi - ret -endp - -;input: -; ecx = Col -; edx = Row -; edi = pointer to tedit struct -;output: -; ecx = cursor x -; edx = cursor y -align 16 -ted_go_to_pos: - push eax ebx - mov eax,ted_scr_h - sub ecx,[eax+sb_offs_position] - cmp ecx,0 ;ted_cur_x < 0 - jge @f - add [eax+sb_offs_position],ecx ;ப⪠ ஫ - xor ecx,ecx - @@: - mov ebx,5 ;5 - ᫥ - cmp ecx,ebx - jge .end0 - sub ebx,ecx ;ebx - ᪮쪮 ᨬ 㦭 ᤢ - cmp [eax+sb_offs_position],ebx - jge @f - add ecx,[eax+sb_offs_position] - mov dword[eax+sb_offs_position],0 - jmp .end0 - @@: - sub [eax+sb_offs_position],ebx - add ecx,ebx - .end0: - cmp ecx,[eax+sb_offs_cur_area] ;ted_cur_x > [.cur_area] - jl .end1 - mov ebx,ecx - sub ebx,[eax+sb_offs_cur_area] - inc ebx - add [eax+sb_offs_position],ebx ;ப⪠ ஫ ࠢ - sub ecx,ebx - .end1: - mov ted_cur_x,ecx - - mov eax,ted_scr_w - sub edx,[eax+sb_offs_position] - cmp edx,0 ;ted_cur_y < 0 - jge @f - add [eax+sb_offs_position],edx ;ப⪠ ஫ - xor edx,edx - jmp .end2 - @@: - cmp edx,[eax+sb_offs_cur_area] ;ted_cur_y > [.cur_area] - jl .end2 - mov ebx,edx - sub ebx,[eax+sb_offs_cur_area] - inc ebx - add [eax+sb_offs_position],ebx ;ப⪠ ஫ - sub edx,ebx - .end2: - mov ted_cur_y,edx - pop ebx eax - ret - -;input: -; edi = pointer to tedit struct -align 16 -ted_text_colored: - push eax edx - mov eax,ted_tim_ch - sub eax,ted_tim_undo - mov ted_tim_co,eax - mov edx,ted_tex - @@: - call ted_iterat_next - cmp edx,ted_tex_1 - jle @f - mov byte[edx+1],0 - jmp @b - @@: - - cmp ted_key_words_count,1 - jl .no_colors - mov edx,ted_tex - @@: - call ted_text_find_sel_color - cmp edx,ted_tex_1 - jg @b - - xor ax,ax - mov edx,ted_tex - .cycle0: - call ted_iterat_next - cmp edx,ted_tex_1 - jle .no_colors - mov al,byte[edx+1] - or al,al - jz .cycle0 - cmp ah,al - jne @f - mov byte[edx+1],0 ;᫨ﭨ 冷 ᫮ 梥 - @@: - shl ax,8 - jmp .cycle0 - .no_colors: - pop edx eax - ret - - -;input: -; edx = pointer to start symbol -; edi = pointer to tedit struct -;output: -; edx = pointer to next symbol -;description: -; 㭪 ᪠ 뤥 ᢥ祭 ᫮ -align 16 -proc ted_text_find_sel_color uses eax ebx ecx esi -locals - begPos dd ? ;砫쭠 - endPos dd ? ;筠 - find db ? ;0 - , 1 - , 2 - 䠩 - f_color db ? ; 梥 ᫮ -endl -;eax = word_n ⥪騩 () ஢塞 ᫮ ᯨ᪥ -;ebx = ࠧ 楫 -;ecx = l_pos ᫥ () 室饣 ᫮ ᯨ᪥ -;esi = ࠧ 楫, ஢塞 ᨬ ᫮ - mov dword[begPos],1 - mov dword[endPos],1 - mov byte[find],0 - mov byte[f_color],1 - .cycle0: - call ted_iterat_next - cmp edx,ted_tex_1 - jle .cycle0end - - movzx eax,byte[edx] - shl eax,2 ;eax*=4 - add eax,ted_arr_key_pos - mov eax,[eax] - cmp eax,0 - jl .cycle0 ;if( (word_n=ted_arr_key_pos[(unsigned char)tex[i].c])>-1 ){ - - mov ecx,eax - ;while(l_posword_n && Col[l_pos-1].Text[pos]!=tex[i].c) - @@: - cmp ecx,eax - jle @f - dec ecx - ColToIndexOffset ecx,ebx - inc ecx - ;cmp byte[ebx+esi],byte[edx] - mov bl,byte[ebx+esi] - cmp bl,byte[edx] - je @f - dec ecx - jmp @b - @@: - - ColToIndexOffset eax,ebx - cmp byte[ebx+esi],0 - jne .if_0 ;if(Col[word_n].Text[pos]==0){ - mov [endPos],edx ;eP=i; - ColToIndexOffset eax,ebx - mov bl,[ebx+MAX_COLOR_WORD_LEN+7] - mov [f_color],bl ;f_color=Col[word_n].color; - - mov byte[find],1 - ColToIndexOffset eax,ebx ;... ebx = Col[word_n] - mov bl,[ebx+MAX_COLOR_WORD_LEN+4] - cmp bl,0 ;if(Col[word_n].wwo) - je .if_2n - push edx - mov edx,[begPos] - call ted_iterat_perv - - btr bx,0 ;1-1 - jae @f ;if(Col[word_n].wwo&1) - ;u1= !(isalnum(cont_s)||cont_s=='_') - call isalnum - jae @f - mov byte[find],0 - jmp .if_4e - @@: - - btr bx,3 ;4-1 - jae .if_4e ;if(Col[word_n].wwo&8) - ;u1= !isalpha(cont_s); - call isalpha - jae .if_4e - mov byte[find],0 - .if_4e: - - mov edx,[endPos] - ;call ted_iterat_next - - btr bx,1 ;2-1 - jae @f ;if(Col[word_n].wwo&2) - ;u1= !(isalnum(cont_s)||cont_s=='_') - call isalnum - jae @f - mov byte[find],0 - jmp .if_6e - @@: - - btr bx,4 ;5-1 - jae .if_6e ;if(Col[word_n].wwo&16) - ;u1= !isalpha(cont_s); - call isalpha - jae .if_6e - mov byte[find],0 - .if_6e: - - btr bx,2 ;3-1 - jae .if_7e ;if(Col[word_n].wwo&4) - ColToIndexOffset eax,ebx - mov bx,word[ebx+MAX_COLOR_WORD_LEN+5] - call ted_iterat_next_pos_char - cmp edx,ted_tex_1 - jg @f - ;᫨ 諨 䠩 諨 ᨬ ࠧ⪨ - call ted_iterat_perv - mov byte[find],2 - @@: - mov dword[endPos],edx - .if_7e: - - pop edx - .if_2n: -;if(i!=1){ // 㬥 -; cont_s=tex[eP].c; -; if(Col[word_n].wwo&2) u2= !(isalnum(cont_s)||cont_s=='_'); // 㪢.-. ᨬ -; if(u2 && Col[word_n].wwo&16) u2= !isalpha(cont_s); // . ᨬ -; if(Col[word_n].wwo&4) eP=ted_iterat_next_pos_char(eP,Col[word_n].endc); - - cmp eax,ecx - je .wh_2e ;if(word_n==l_pos) break; // do double - ᫨ ᫮ 筮 ᫥ - .if_0: - - cmp edx,ted_tex_1 - jle .wh_2e ;if(i==1) break; - - ;while(l_pos>word_n && Col[word_n].Text[pos]!=tex[i].c) - .wh_4b: - cmp ecx,eax - jle .wh_4e - ColToIndexOffset eax,ebx - ;cmp byte[ebx+esi],byte[edx] - mov bl,byte[ebx+esi] - cmp bl,byte[edx] - je .wh_4e - inc eax - jmp .wh_4b - .wh_4e: - - cmp eax,ecx - je .wh_2e;if(word_n==l_pos) break; - inc esi ;pos++; - jmp .wh_2b - .wh_2e: - - cmp byte[find],0 ;if(fnd)break; - jne .cycle0end - mov edx,[begPos];i=bP; - jmp .cycle0 - .cycle0end: - - cmp byte[find],0 - je .if_1e ;if(fnd){ // 뤥 ⥪ - ;if(!mode_sf1 || (mode_sf1 && strlen(Col[word_n].f1->c_str())>0)){ - mov eax,[begPos] - mov bl,[f_color] - mov [eax+1],bl ;tex[bP].col=f_color; - mov eax,[endPos] - mov byte[eax+1],0xff ;tex[eP].col=255; - cmp byte[find],2 - je .if_1e - ;return ItPoPerv(eP); // 頥 宦 - mov edx,[endPos] - call ted_get_text_perv_pos - jmp @f - .if_1e: - mov edx,ted_tex - @@: - - ret -endp - -;input: -; edx = pointer to char (byte) -;output: -; cf=1 if symbol is... -align 16 -tab_all_num db 0,0,0,0,0,0,0xff,11b,11111110b,0xff,0xff,10000111b,11111110b,0xff,0xff,111b,0,0,0,0,0,0,0,0;,0,0,0,0,0,0,0,0 - tab_alpha_0,0,0,0,0,0,0,0 -tab_alpha db 0,0,0,0,0,0,0,0,11111110b,0xff,0xff,10000111b,11111110b,0xff,0xff,111b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - -;output: -; cf=1 ᫨ [edx] 㪢, '_' -align 16 -isalnum: - push eax ebx - movzx eax,byte[edx] ;al=offset - shr eax,3 - lea ebx,[tab_all_num] - add ebx,eax - movzx ax,byte[edx] ;al=bit - and ax,111b - bt word[ebx],ax - pop ebx eax - ret - -;output: -; cf=1 ᫨ [edx] 㪢 '_' -align 16 -isalpha: - push eax ebx - movzx eax,byte[edx] ;al=offset - shr eax,3 - lea ebx,[tab_alpha] - add ebx,eax - movzx ax,byte[edx] ;al=bit - and ax,111b - bt word[ebx],ax - pop ebx eax - ret - -align 16 -proc ted_show_help_f1 uses eax edx edi, edit:dword - mov edi,[edit] - - call ted_get_pos_by_cursor - push edx - call ted_iterat_next_color_tag - mov eax,edx - pop edx - call ted_iterat_perv_color_tag - - cmp eax,ted_tex - jle @f - cmp edx,ted_tex_1 - jle @f - stdcall ted_find_help_id,eax - @@: - ;call ted_draw_main_cursor - call ted_draw_help_f1 - ret -endp - -;input: -; edx = position begin 'symbol' struct -; edi = pointer to tedit struct -; end_pos = position end 'symbol' struct -align 16 -proc ted_find_help_id uses ebx ecx, end_pos:dword -; ecx = word_n -; ebx = l_pos - mov ted_help_id,-1 - - movzx ebx,byte[edx] - shl ebx,2 ;ebx*=4 - add ebx,ted_arr_key_pos - mov ecx,[ebx] - cmp ecx,0 - jl .if_0e ;if( (word_n=ted_arr_key_pos[(unsigned char)tf[0]])>-1 ){ - push esi eax - mov ebx,ecx ;l_pos=word_n; - ColToIndexOffset ecx,esi - push cx - mov cl,[esi] - @@: - cmp ebx,ted_key_words_count ;while(l_posword_n - jle .wh_0e - dec ebx - ColToIndexOffset ebx,eax - inc ebx - cmp byte[eax+esi],dl ;&& Col[l_pos-1].Text[pos]!=tf[i]) - je .wh_0e - dec ebx ;l_pos--; - jmp .wh_0b - .wh_0e: - - .wh_1b: - cmp ebx,ecx ;while(l_pos>word_n - jle .wh_1e - ColToIndexOffset ecx,eax - cmp byte[eax+esi],dl - je .wh_1e - inc ecx ;word_n++; - jmp .wh_1b - .wh_1e: - pop dx - - cmp ecx,ebx ;if(word_n==l_pos) break; - je @f - call ted_iterat_next ;pos++; - cmp edx,[end_pos] ;for(...;i y0,y1 - add ecx,ted_rec_t - mov edx,ted_cur_y - imul edx,ted_rec_h - add ecx,edx - shl ecx,16 - add ecx,ted_rec_h - - mov edx,ted_color_wnd_work - call ted_sel_normalize - - mov esi,ted_scr_w - mov eax,[esi+sb_offs_position] - sub ted_seln_y0,eax - sub ted_seln_y1,eax - - mov eax,ted_cur_y - cmp eax,ted_seln_y0 - jl .no_cur_sel - cmp eax,ted_seln_y1 - jg .no_cur_sel - mov edx,ted_color_select ;塞 梥 䮭 梥 뤥 - mov esi,ted_scr_h - cmp eax,ted_seln_y0 - jne @f - mov eax,ted_cur_x - add eax,[esi+sb_offs_position] - cmp eax,ted_seln_x0 - jge @f - mov edx,ted_color_wnd_work - @@: - mov eax,ted_cur_y - cmp eax,ted_seln_y1 - jne .no_cur_sel - mov eax,ted_cur_x - add eax,[esi+sb_offs_position] - cmp eax,ted_seln_x1 - jl .no_cur_sel - mov edx,ted_color_wnd_work - .no_cur_sel: - mcall SF_DRAW_RECT - - call ted_get_pos_by_cursor ;६ ᨬ - cmp ted_gp_opt,2 - jne @f - mov esi,1 - ror ecx,16 - mov bx,cx - add ebx,0x10001 - call ted_get_symb_color - call ted_convert_invis_symb - mcall SF_DRAW_TEXT ;ᮢ ᨬ - @@: -popad - ret -endp - -;input: -; edx -> pointer to text -; edi -> 㪠⥫ tedit -;output: -; ecx = color -; if ted_mode_color=0 then ecx=ted_color_wnd_text -align 16 -ted_get_symb_color: - mov ecx,ted_color_wnd_text ; 梥 ⥪ 㬮砭 - - push eax edx - cmp ted_mode_color,0 - je .exit - jmp .on_first - @@: - call ted_iterat_perv - cmp edx,ted_tex_1 - jle .exit - .on_first: - movzx eax,byte[edx+1] - or eax,eax ;᫨ al=0 梥 - jz @b - - cmp eax,ted_colors_text_count - jge .exit - - mov ecx,ted_text_colors ;ਡ塞 ᬥ饭 1- 梥 - lea ecx,[ecx+4*eax] - mov ecx,[ecx] ;⠭ ⥪騩 梥 ⥪ ᬥ饭 - .exit: - or ecx,ted_font_size - pop edx eax - ret - -;input: -; edx = pointer to text -; edi = pointer to tedit struct -;description: -; 㭪 ८ࠧ ᨬ ⠥ ࠭ -align 16 -ted_convert_invis_symb: - cmp ted_mode_invis,1 - jne .else - cmp byte[edx],9 - jne @f - lea edx,[ted_symbol_tab] - jmp .end_f -align 4 - @@: - cmp byte[edx],13 - jne @f - mov edx,edi - add edx,ted_offs_symbol_new_line - @@: - jmp .end_f -align 4 - .else: - cmp byte[edx],9 - je @f - cmp byte[edx],13 - jne .end_f - @@: - lea edx,[ted_symbol_space] - .end_f: - ret - -;input: -; edi = pointer to tedit struct -align 16 -ted_scroll_set_redraw: - push eax - mov eax,ted_scr_w - mov dword[eax+sb_offs_redraw],1 - mov eax,ted_scr_h - mov dword[eax+sb_offs_redraw],1 - pop eax - ret - -align 16 -proc ted_draw, edit:dword - locals - line_num dd ? - endl - pushad - mov edi,[edit] - - mov eax,SF_DRAW_TEXT - mov ecx,ted_text_colors - mov ecx,[ecx] - - mov ebx,ted_wnd_l - add ebx,ted_rec_l - shl ebx,16 - add ebx,ted_wnd_t - add ebx,ted_rec_t - add ebx,0x10001 ;塞 ࠢ 㪢 業 - - call ted_sel_normalize ;need before draw select - mov esi,ted_scr_w - mov esi,[esi+sb_offs_position] - mov [line_num],esi - - stdcall ted_clear_line_before_draw, edi,ebx,1,esi - call ted_get_first_visible_pos - or edx,edx - jz .no_draw_text - mov esi,1 ; 뢮 ⥪ 1- ᨬ - @@: - call ted_iterat_next - cmp edx,ted_tex_1 - jle .no_draw_text - - ; *** 梥⮢ ࠧ⪠ - cmp ted_mode_color,0 - je .no_col_change - cmp byte[edx+1],0 - je .no_col_change - call ted_get_symb_color - .no_col_change: - - cmp byte[edx],13 - jne .no_13 - cmp ted_mode_invis,1 - jne .no_invis - push edx - mov edx,edi - add edx,ted_offs_symbol_new_line - int 0x40 - pop edx - .no_invis: - add ebx,ted_rec_h - ;optimized output \/ - mov eax,ted_wnd_h - add eax,ted_wnd_t - cmp bx,ax - jg .no_draw_text - mov eax,SF_DRAW_TEXT - ;optimized output /\ - and ebx,0xffff - ror ebx,16 - add ebx,ted_wnd_l - add ebx,ted_rec_l - inc ebx - ror ebx,16 - inc dword[line_num] ;increment line number - stdcall ted_clear_line_before_draw,edi,ebx,1,dword[line_num] - call ted_opt_draw_line_left - jmp @b -align 4 - .no_13: - - int 0x40 - ror ebx,16 - add ebx,ted_rec_w - mov esi,ted_wnd_l - add esi,ted_wnd_w - cmp bx,si - jl .no_opt - call ted_opt_draw_line_right - .no_opt: - mov si,1 - ror ebx,16 - jmp @b - .no_draw_text: - - inc dword[line_num] - stdcall ted_clear_line_before_draw,edi,ebx,0,dword[line_num] - call ted_draw_line_numbers - call ted_draw_main_cursor - -;--------------------------------------------- -; set all_redraw flag for draw all ScrollBar -; In some cases it is necessity to draw only the area -; of moving of a "runner", for acceleration of output - -; in this case the flag needs to be reset to 0 (zero). - mov eax,ted_scr_h - mov esi,ted_scr_w - mov dword[eax+sb_offs_all_redraw],1 - mov dword[esi+sb_offs_all_redraw],1 - -; ᮢ ப⪨ - stdcall scroll_bar_horizontal.draw,eax ;[scrollbar_hor_draw] - stdcall scroll_bar_vertical.draw,esi ;[scrollbar_ver_draw] -; reset all_redraw flag - mov dword[eax+sb_offs_all_redraw],0 - mov dword[esi+sb_offs_all_redraw],0 -;--------------------------------------------- - - ;left-bottom square - mov ebx,ted_wnd_l - shl ebx,16 - add ebx,ted_rec_l - mov ecx,ted_wnd_t - add ecx,ted_wnd_h - shl ecx,16 - mov cx,word[eax+sb_offs_size_y] - inc cx - mcall SF_DRAW_RECT,,,ted_color_wnd_capt ;[sc.work] - - ;right-bottom square - mov ebx,ted_wnd_l - add ebx,ted_wnd_w - shl ebx,16 - mov bx,word[esi+sb_offs_size_x] - inc bx - int 0x40 - - cmp ted_fun_draw_panels,0 - je @f - stdcall ted_fun_draw_panels, edi - @@: - popad - ret -endp - -;input: -; edi = pointer to tedit struct -align 16 -proc ted_draw_main_cursor -pushad - mov eax,SF_DRAW_RECT ;draw cursor - mov ecx,ted_wnd_t ;calc rect -> y0,y1 - add ecx,ted_rec_t - mov edx,ted_cur_y - imul edx,ted_rec_h - add ecx,edx - - shl ecx,16 - add ecx,ted_rec_h - - mov ebx,ted_wnd_l ;calc rect -> x0,x1 - add ebx,ted_rec_l - mov edx,ted_cur_x - imul edx,ted_rec_w - add ebx,edx - shl ebx,16 - add ebx,ted_rec_w - cmp ted_cur_ins,1 ;஢ઠ ० ࠡ ( ⠢) - jne @f - shr bx,2 ;㬥蠥 ਭ - @@: - - mov edx,ted_color_cursor - int 0x40 ;뢮 - - call ted_get_pos_by_cursor - cmp ted_gp_opt,2 - jne @f - mov esi,1 - ror ecx,16 - mov bx,cx - add ebx,0x10001 - mov ecx,ted_color_cur_text - or ecx,ted_font_size - call ted_convert_invis_symb - mcall SF_DRAW_TEXT - @@: - - mov ebx,ted_wnd_l - add ebx,ted_rec_l - shl ebx,16 - add ebx,ted_wnd_t - add ebx,3 - mov ecx,ted_color_wnd_bord - or ecx,0x80000000 - lea edx,[txtRow] - mcall SF_DRAW_TEXT ;뢮 'ப' - - add ebx,0x500000 - lea edx,[txtCol] - int 0x40 ;뢮 '' - - cmp ted_tim_undo,0 - je @f - add ebx,0x500000 - lea edx,[txtOtm] - int 0x40 - sub ebx,0x500000 - @@: - - call ted_draw_buffer - call ted_draw_help_f1 - - mov eax,47 ;draw cursor coords - mov esi,ted_color_wnd_bord - or esi,0x40000000 - - mov edx,ebx - ror edx,16 - sub edx,35 - ror edx,16 - ;add edx,3 - mov ebx,0x40000 ;Row=... - mov ecx,ted_scr_w - mov ecx,[ecx+sb_offs_position] - add ecx,ted_cur_y - inc ecx - -push edi - mov edi,ted_color_wnd_work - int 0x40 ;뢮 ᫠ ⥪饩 ப -pop edi - - ;mov ebx,0x40000 ;Col=... - mov ecx,ted_scr_h - mov ecx,[ecx+sb_offs_position] - add ecx,ted_cur_x - inc ecx - add edx,0x500000 -push edi - mov edi,ted_color_wnd_work - int 0x40 ;뢮 ᫠ -pop edi - - cmp ted_tim_undo,0 - je @f - mov ecx,ted_tim_undo - add edx,0x500000 - mov edi,ted_color_wnd_work ;⨬ ॣ edi, 㭪樨 㦥 - int 0x40 ;뢮 ᫠ ⬥ ⢨ - @@: - -popad - ret -endp - -;input: -; edi = pointer to tedit struct -align 16 -proc ted_draw_buffer - pushad - - mov eax,ted_buffer - cmp dword[eax],1 ;ᬮਬ ࠧ - jl @f - mov ebx,ted_rec_l - add bx,300 - cmp ebx,ted_wnd_w ;ࠢ न 뢮 ⥪ - jge @f ; - - add ebx,ted_wnd_l - shl ebx,16 - add ebx,ted_wnd_t - add ebx,3 - mov ecx,ted_color_wnd_bord - or ecx,0x40000000 - - mov edx,ted_buffer - add edx,12 - mov esi,edx - mov edi,ted_color_wnd_work ;edi - destroy not pointer to tedit - call tl_strlen - ;cmp eax,0 ; - ;je @f - cmp eax,20 - jle .crop_buf - mov eax,20 ;१ 20 ᨬ - .crop_buf: - mov esi,eax - mcall SF_DRAW_TEXT ;뢮 ᮤন - - sub ebx,50 shl 16 - lea edx,[txtBuf] - mov esi,edx - call tl_strlen - mov esi,eax - xor ecx,0x40000000 ;㡨ࠥ 梥 䮭 - mcall SF_DRAW_TEXT ;뢮 - @@: - popad - ret -endp - -;input: -; edi = pointer to tedit struct -align 16 -proc ted_draw_help_f1 - pushad - cmp ted_rec_t,13 ;쭠 ᮢ ࠢ - jle @f - ;clear place before draw help - mov ebx,ted_wnd_l - add ebx,ted_rec_l - shl ebx,16 - add ebx,ted_wnd_w - sub ebx,ted_rec_l - mov ecx,ted_wnd_t - add ecx,13 - shl ecx,16 - add ecx,9 ;9 - 0- , ⠢ ted_rec_h ࠭ - mcall SF_DRAW_RECT,,,ted_color_wnd_capt - - cmp ted_help_id,-1 - je @f - mov eax,ted_help_id - ColToIndexOffset eax,edx - - ;SetCoordinates - mov ebx,ted_wnd_l - add ebx,ted_rec_l - shl ebx,16 - add ebx,ted_wnd_t - add ebx,13 ;=3+10 - - ;SetTextColor - movzx eax,byte[edx+MAX_COLOR_WORD_LEN+7] - shl eax,2 - mov ecx,ted_text_colors - add ecx,eax - mov ecx,[ecx] - or ecx,0xc0000000 ;SetTextStyles - mov esi,edi - mcall SF_DRAW_TEXT,,,,,ted_color_wnd_work - mov edi,esi - - mov esi,edx - call tl_strlen - - ;*** draw help string *** - mov ecx,ted_color_wnd_bord - or ecx,0x80000000 - mov edx,[edx+MAX_COLOR_WORD_LEN] - or edx,edx - jz @f - add edx,ted_help_text_f1 - inc eax - imul eax,6 ;ਭ ᨬ . - shl eax,16 - add ebx,eax - mcall SF_DRAW_TEXT - @@: - popad - ret -endp - -;input: -; edi = pointer to tedit struct -align 16 -proc ted_draw_line_numbers -pushad - ;top panel with caption - mov ebx,ted_wnd_l - ;add ebx,ted_rec_l - shl ebx,16 - add ebx,ted_wnd_w - ;sub ebx,ted_rec_l - mov edx,ted_color_wnd_work - mov ecx,ted_wnd_t - shl ecx,16 - add ecx,ted_rec_t - mov edx,ted_color_wnd_capt - mcall SF_DRAW_RECT - - ;line numbers - mov ebx,0x40000 ;format - mov ecx,ted_scr_w - mov ecx,[ecx+sb_offs_position] - inc ecx - mov edx,3 - add edx,ted_wnd_l - rol edx,16 - add edx,ted_wnd_t - add edx,ted_rec_t - @@: - -push ebx ecx edx - ;left panel with numbers - mov ebx,ted_wnd_l - shl ebx,16 - add ebx,ted_rec_l - mov ecx,ted_rec_h - rol ecx,16 - mov cx,dx - rol ecx,16 - mov edx,ted_color_wnd_capt - mcall SF_DRAW_RECT ;㥬 אַ㣮쭨 ஬ ப -pop edx ecx ebx - - mov esi,ted_color_wnd_bord - mcall SF_DRAW_NUMBER ;㥬 ப - inc ecx - add edx,ted_rec_h - sub edx,ted_wnd_t - mov esi,edx - and esi,0xffff - cmp esi,ted_wnd_h - jge @f - add edx,ted_wnd_t - jmp @b -align 4 - @@: -popad - ret -endp - -;output: -; ah = symbol -align 16 -proc KeyConvertToASCII uses ebx, table:dword - mov ebx,[table] ;convert scan to ascii - shr ax,8 - add bx,ax ;? ebx,eax - mov ah,byte[ebx] - ret -endp - -align 16 -proc ted_draw_cur_line, edit:dword -pushad - mov edi,[edit] - - mov ebx,ted_wnd_l - add ebx,ted_rec_l - shl ebx,16 - mov eax,ted_cur_y - imul eax,ted_rec_h - mov bx,ax - add ebx,ted_wnd_t - add ebx,ted_rec_t ;ebx - न אַ㣮쭨 ⪨ - add ebx,0x10001 ;塞 ࠢ 㪢 業 - - call ted_sel_normalize ;need before draw select - mov ecx,ted_cur_y - mov eax,ted_scr_w - add ecx,[eax+sb_offs_position] - stdcall ted_clear_line_before_draw,edi,ebx,1,ecx - - mov eax,ted_scr_h - mov esi,[eax+sb_offs_position] - call ted_get_pos_by_coords - - cmp ted_gp_opt,2 - jne .no_draw_text - call ted_get_symb_color - mov esi,1 ;draw 1 symbol - @@: - ;call ted_iterat_next - cmp edx,ted_tex_1 - jle .no_draw_text - - ; *** 梥⮢ ࠧ⪠ - cmp ted_mode_color,0 - je .no_col_change - cmp byte[edx+1],0 - je .no_col_change - call ted_get_symb_color - .no_col_change: - - mov eax,SF_DRAW_TEXT - cmp byte [edx],13 - jne .no_13 - cmp ted_mode_invis,1 - jne .no_draw_text - push edx - mov edx,edi - add edx,ted_offs_symbol_new_line - int 0x40 - pop edx - jmp .no_draw_text -align 4 - .no_13: - - int 0x40 - ror ebx,16 - add ebx,ted_rec_w - mov eax,ted_wnd_w - add eax,ted_wnd_l ;ax = x - cmp bx,ax - jge .no_draw_text ;Opt - ror ebx,16 - call ted_iterat_next - jmp @b -align 4 - .no_draw_text: - - call ted_draw_main_cursor -popad - ret -endp - -;input: -; clear_o - ᫨ =1 ப, =0 ப -align 16 -proc ted_clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword - pushad - mov edi,[edit] - mov ebx,[coords] ;ebx = x*2^16+y coords to left up point clear line - mov esi,[numb_lin] ;esi - number text line - - sub ebx,0x10001 ;⭨ ࠢ 㪢 業 - cmp dword[clear_o],0 - jne @f - add ebx,ted_rec_h - ror ebx,16 - xor bx,bx - add ebx,ted_wnd_l - add ebx,ted_rec_l ;bx = ted_wnd_l+ted_rec_l - ror ebx,16 - @@: - - mov eax,ted_wnd_h - add eax,ted_wnd_t - cmp ax,bx - jl .no_clear - sub ax,bx - - mov cx,bx - shl ecx,16 - - xor bx,bx - add ebx,ted_wnd_w - sub ebx,ted_rec_l - xor cx,cx - add ecx,ted_rec_h - mov edx,ted_color_wnd_work - - cmp dword[clear_o],0 - je .pusto - cmp ax,cx - jge @f - .pusto: - mov cx,ax - jmp .no_select ;᫨ ⪠ , ᥣ 䮭 梥⮬ - @@: - - call ted_is_select - or al,al - jz .no_select - cmp ted_seln_y0,esi - jg .no_select - cmp ted_seln_y1,esi - jl .no_select - mov edx,ted_color_select ;draw selected line - .no_select: - - mcall SF_DRAW_RECT ;᪠ ப 梥⮬ 䮭 梥⮬ 뤥 - - call ted_is_select - or al,al - jz .no_clear - - mov al,SF_DRAW_RECT - xor cx,cx - add ecx,ted_rec_h - cmp ted_seln_y0,esi - jne @f - push bx esi - mov edx,ted_seln_x0 ; (ࠥ ᫥) - mov esi,ted_scr_h - cmp edx,[esi+sb_offs_position] - jle .in_wnd - sub edx,[esi+sb_offs_position] - imul edx,ted_rec_w - mov bx,dx - jmp .no_wnd - .in_wnd: - xor bx,bx - .no_wnd: - mov edx,ted_color_wnd_work - int 0x40 - pop esi bx - @@: - cmp ted_seln_y1,esi - jne @f - ;push esi - ;᫨ 뤥 䠩 ᤥ 室, ⮣ 㦭 jmp .no_select - mov edx,ted_seln_x1 ; (ࠥ ࠢ) - mov esi,ted_scr_h - cmp edx,[esi+sb_offs_position] - jle .in_wnd2 - sub edx,[esi+sb_offs_position] - imul edx,ted_rec_w - sub bx,dx - shl edx,16 - add ebx,edx - .in_wnd2: - mov edx,ted_color_wnd_work - int 0x40 - ;pop esi - @@: - - .no_clear: - popad - ret -endp - -;input: -; edi = pointer to tedit struct -;output: -; ecx = 梥 ᨬ -; edx = pointer to symbol -; edx = 0 if text not in screen -align 16 -ted_get_first_visible_pos: - push eax ecx - mov eax,ted_scr_w - mov edx,ted_tex - xor ecx,ecx - @@: - cmp ecx,[eax+sb_offs_position] - je @f - call ted_iterat_next - cmp edx,ted_tex_1 - jle @f - cmp byte[edx],13 - jne @b - inc ecx - jmp @b -align 4 - @@: - - cmp ecx,[eax+sb_offs_position] - je @f - xor edx,edx - @@: - cmp ecx,[eax+sb_offs_max_area] - jle @f - mov [eax+sb_offs_max_area],ecx - @@: - pop ecx eax - call ted_opt_draw_line_left - ret - -;input: -; edx = pointer to symbol -; edi = pointer to tedit struct -;output: -; ecx = 梥 ᨬ -; edx = 㪠⥫ ᨬ -;description: -; 㭪 㦭 ⨬樨 뢮 ⥪ -align 16 -proc ted_opt_draw_line_left uses ebx - mov ebx,ted_scr_h - mov ebx,[ebx+sb_offs_position] - or ebx,ebx - jz .ret_f - push eax - mov eax,edx - - cmp edx,ted_tex - jne @f - call ted_iterat_next - jmp .beg_cycle - @@: - - or ebx,ebx - jz @f - - cmp byte[edx],13 - jne @f - call ted_iterat_next - .beg_cycle: - @@: - cmp edx,ted_tex_1 - jle @f - cmp byte[edx],13 - je @f - or ebx,ebx - jz @f -;-------------------------------------- -;eax 㤥 -movzx eax,byte[edx+1] -or eax,eax -jz .no_color -cmp eax,ted_colors_text_count -jge .no_color - movzx ecx,byte[edx+1] - shl ecx,2 - add ecx,ted_text_colors - mov ecx,[ecx] -.no_color: -;-------------------------------------- - mov eax,edx - call ted_iterat_next - dec ebx - jmp @b -align 4 - @@: - mov edx,eax - pop eax - .ret_f: - call ted_get_symb_color - ret -endp - -;input: -; edx = pointer to symbol -; edi = pointer to tedit struct -;output: -; ecx = symbol color -; edx = pointer to 13 symbol -;description: -; 㭪 㦭 ⨬樨 뢮 ⥪ -align 16 -proc ted_opt_draw_line_right uses eax - mov eax,edx - @@: - cmp edx,ted_tex_1 - jle @f - cmp byte[edx],13 - je @f - mov eax,edx - call ted_iterat_next - jmp @b - @@: - mov edx,eax ;perv sumbol - call ted_get_symb_color - ret -endp - -align 16 -proc ted_mouse, edit:dword - pushad - mov edi,[edit] - - ;ࠡ뢠 ஫ - mov edx,ted_scr_h - mov ecx,ted_scr_w - - cmp word[edx+sb_offs_delta2],0 - jne .horizontal - - mov eax,[ecx+sb_offs_max_area] - cmp eax,[ecx+sb_offs_cur_area] - jbe .horizontal - ; mouse event for Vertical ScrollBar - stdcall scroll_bar_vertical.mouse,ecx ;[scrollbar_ver_mouse] - cmp dword[ecx+sb_offs_redraw],0 - je @f - mov dword[ecx+sb_offs_redraw],0 - stdcall ted_draw,edi - jmp .no_in_wnd - @@: - cmp word[ecx+sb_offs_delta2],0 - jne .no_in_wnd - .horizontal: - mov eax,[edx+sb_offs_max_area] - cmp eax,[edx+sb_offs_cur_area] - jbe .other - ; mouse event for Horizontal ScrollBar - stdcall scroll_bar_horizontal.mouse,edx ;[scrollbar_hor_mouse] - cmp dword[edx+sb_offs_redraw],0 - je .other - mov dword[edx+sb_offs_redraw],0 - stdcall ted_draw,edi - jmp .no_in_wnd - .other: - cmp word[ecx+sb_offs_delta2],0 - jne .no_in_wnd - cmp word[edx+sb_offs_delta2],0 - jne .no_in_wnd - - ;ࠡ뢠 । - mcall SF_MOUSE_GET,SSF_BUTTON - cmp al,1 - jne @f - mcall SF_MOUSE_GET,SSF_WINDOW_POSITION - mov ebx,ted_wnd_t - add ebx,ted_rec_t - cmp ax,bx - jl @f ;y_mousey_wnd - - mov ebx,ted_wnd_l - add ebx,ted_rec_l - mov ecx,eax - shr ecx,16 - cmp cx,bx - jl @f ;x_mousex_wnd - - call ted_draw_cursor_sumb - call ted_wnd_main_click - jmp .no_in_wnd - @@: - mov edx,ted_el_focus - cmp [edx],edi - jne @f - call ted_wnd_main_mouse_scroll ;ᬮਬ ப - @@: - cmp ted_drag_m,0 - je .no_in_wnd - mov ted_drag_m,0 - stdcall ted_draw,edi - cmp ted_fun_draw_panel_buttons,0 - je .no_in_wnd - call ted_fun_draw_panel_buttons - .no_in_wnd: - popad - ret -endp - -;input: -; eax -> (x,y) -; edi -> 㪠⥫ tedit -;description: -; 㭪 뢥 ⨨ ஬ । -align 16 -ted_wnd_main_click: - push ebx ecx edx - mov ebx,ted_el_focus - mov [ebx],edi ;⠢ 䮪 - - push eax - shr eax,16 - sub eax,ted_wnd_l - sub eax,ted_rec_l - - xor edx,edx - mov ecx,ted_rec_w - div cx - ;inc eax - mov ebx,ted_scr_h - cmp eax,[ebx+sb_offs_cur_area] - jle @f - mov eax,[ebx+sb_offs_cur_area] - @@: - ;dec eax - mov ted_cur_x,eax - pop eax - - push eax - and eax,0xffff - sub eax,ted_wnd_t - sub eax,ted_rec_t - - xor edx,edx - mov ecx,ted_rec_h - div cx - inc eax - mov ebx,ted_scr_w - cmp eax,[ebx+sb_offs_cur_area] - jle @f - mov eax,[ebx+sb_offs_cur_area] - @@: - dec eax - mov ted_cur_y,eax - pop eax - - cmp ted_drag_m,0 - je @f - call ted_sel_move - jmp .sel_move - @@: - mov ted_drag_m,1 - call ted_sel_start - .sel_move: - pop edx ecx ebx - ret - -;input: -; edi = pointer to tedit struct -align 16 -ted_wnd_main_mouse_scroll: - push eax ebx ecx - mcall SF_MOUSE_GET,SSF_SCROLL_DATA - or ax,ax - jz .no_scroll - mov ecx,ted_scr_w - movsx eax,ax - lea eax,[eax+eax*2] ;㬭 3 (᫮ ப ப⪨ ) - add eax,[ecx+sb_offs_position] - mov ebx,[ecx+sb_offs_max_area] - shl ebx,1 - sub ebx,[ecx+sb_offs_cur_area] ;⭨ - shr ebx,1 - cmp eax,ebx - jae .no_scroll - mov ebx,ted_cur_y ; - sub ebx,eax ;- ஫ - add ebx,[ecx+sb_offs_position] ;+ ஫ - bt ebx,31 - jnc @f - xor ebx,ebx ;᫨ ⠫ , ⠢ ப - @@: - inc ebx - cmp ebx,[ecx+sb_offs_cur_area] - jle @f - mov ebx,[ecx+sb_offs_cur_area] ;᫨ ⠫ , ⠢ ப - @@: - dec ebx - mov ted_cur_y,ebx - mov [ecx+sb_offs_position],eax - stdcall ted_draw,edi - .no_scroll: - pop ecx ebx eax - ret - -align 16 -proc ted_save_file, edit:dword, file:dword, f_name:dword -pushad - mov edi,[edit] - - stdcall ted_can_save,edi - ;or al,al - ;jz .no_save - - mov ecx,ted_max_chars - invoke mem.alloc,ecx - push eax ; 㪠⥫ 뤥 - - mov edx,ted_tex - xor ecx,ecx - @@: - call ted_iterat_next - cmp edx,ted_tex_1 - jle @f ;edx = ted_tex or edx = ted_tex+sizeof.symbol - mov bl,[edx] - mov byte[eax],bl - inc eax - inc ecx - jmp @b -align 4 - @@: - - or ecx,ecx - jz @f - mov ebx,[file] - pop eax ;뢠 㪠⥫ 뤥 - mov [ebx+16],eax - push eax ;⭮ 㪠⥫ 뤥 - mov dword[ebx], SSF_CREATE_FILE - mov dword[ebx+4], 0 - mov dword[ebx+8], 0 - mov [ebx+12], ecx - mov byte[ebx+20], 0 - push dword[f_name] - pop dword[ebx+21] - mcall SF_FILE - - mov ted_err_save,al - - or eax,eax - jz .no_msg - cmp ax,10 - jl .zifra_0_9 - mov al,'?' - sub ax,48 - .zifra_0_9: - add ax,48 - cmp ted_fun_save_err,0 - je @f - call ted_fun_save_err - jmp @f - .no_msg: - m2m ted_tim_ls,ted_tim_ch - @@: - - pop ecx ;뢠 㪠⥫ 뤥 - invoke mem.free,ecx - .no_save: -popad - ret -endp +; ⥬ ⥪ box_lib.obj +; TextEditor KolibriOS +; 䠩 ᫥ ࠧ 12.01.2021 IgorA +; ਬ GPL2 業 + +;input: +; edi = pointer to tedit struct +; reg = index +;output: +; reg = pointer to 'tex' struct +macro ConvertIndexToPointer reg { + imul reg,sizeof.symbol + add reg,ted_tex +} + +;--- out_reg = ted_key_words_data[ind_reg].Text[0] --- +macro ColToIndexOffset ind_reg,out_reg { + mov out_reg,ind_reg + imul out_reg,sizeof.TexColViv + add out_reg,ted_key_words_data +} + +TED_LINES_IN_NEW_FILE equ 30 ;᫮ ப 䠩 +MAX_COLOR_WORD_LEN equ 40 +;------------------------------------------------------------------------------ +struct TexSelect + x0 dd ? + y0 dd ? + x1 dd ? + y1 dd ? +ends + +struct TexColViv + Text rb MAX_COLOR_WORD_LEN ; ᫮ ᢥ⪨ + f1 dd 0 ; ࠢ ᫮ + flags db ? ; f1+4 䫠 ᯮ㥬 뤥 + endc db ? ; f1+5 ᨬ 뤥 (ᯮ flags&4) + escc db ? ; f1+6 ࠭騩 ᨬ (ᯮ flags&4) + color db ? ; f1+7 梥 +ends + +struct symbol + c db ? ; +0 ᨬ + col db ? ; +1 梥 + perv dd ? ; +2 + next dd ? ; +6 㪠⥫ + tc dd ? ; +10 ६. ᮧ + td dd ? ; +14 ६. 㤠 +ends +;------------------------------------------------------------------------------ + +ted_symbol_space db 32 ;ascii ஡, 뢠 㦥 +ted_symbol_tab db 26 ;ascii ५ ࠢ, ᯮ ᮢ ⠡樨 ० ᨬ + +if lang eq ru_RU + txtRow db 'ப',0 + txtCol db '',0 + txtOtm db '⬥',0 + txtBuf db ':',0 +else ; Default to en_US + txtRow db 'Rows',0 + txtCol db 'Cols',0 + txtOtm db 'Undo',0 + txtBuf db 'Buffer:',0 +end if + +;EvChar - ⠡ 䨫஢ 塞 ᨬ, - 譨 +align 16 +EvChar db 0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 + db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + db 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 + db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + +KM_SHIFT equ 0x00010000 +KM_CTRL equ 0x00020000 +KM_ALT equ 0x00040000 +KM_NUMLOCK equ 0x00080000 + +; KEY CODES +KEY_F1 equ 0x0000003B +KEY_F2 equ 0x0000003C +KEY_F3 equ 0x0000003D + + + +align 16 +proc ted_init uses eax ecx edi, edit:dword + mov edi,[edit] + + mov ecx,sizeof.symbol + imul ecx,ted_max_chars + invoke mem.alloc,ecx ;뤥塞 + mov ted_tex,eax + mov ted_tex_1,eax + add ted_tex_1,sizeof.symbol + add eax,ecx + mov ted_tex_end,eax + + stdcall ted_clear, edi,1 + +;------------------------------------------------- + mov ecx,1024 ;1024 - ᨢ ted_arr_key_pos + add ecx,ted_syntax_file_size + invoke mem.alloc,ecx + mov ted_arr_key_pos,eax + add eax,1024 + mov ted_syntax_file,eax + + stdcall ted_init_scroll_bars,edi,3 + ret +endp + +MIN_W_SCRL_ARE equ 3 ;쭠 ⮡ࠦ . ஫ +MIN_H_SCRL_ARE equ 3 ;쭠 ⮡ࠦ ਧ. ஫ +;input: +; opt = 1 - 梥 ஫, 2 - ࠧ , +; 4 - ࠧ 㬥 +align 16 +proc ted_init_scroll_bars, edit:dword, opt:dword + pushad + mov edi,[edit] + mov esi,ted_scr_w + mov ebx,ted_scr_h + bt dword[opt],0 + jae @f + mov ecx,ted_color_wnd_work + mov dword[esi+sb_offs_bckg_col],ecx + mov dword[ebx+sb_offs_bckg_col],ecx + mov ecx,ted_color_wnd_capt + mov dword[esi+sb_offs_frnt_col],ecx + mov dword[ebx+sb_offs_frnt_col],ecx + mov ecx,ted_color_wnd_bord + mov dword[esi+sb_offs_line_col],ecx + mov dword[ebx+sb_offs_line_col],ecx + @@: + bt dword[opt],2 ; ࠧ 㬥 ? + jae .doc_resize + call ted_get_num_lines + cmp eax,TED_LINES_IN_NEW_FILE + jge @f + mov eax,TED_LINES_IN_NEW_FILE + @@: + mov dword[esi+sb_offs_max_area],eax + .doc_resize: + bt dword[opt],1 ; ࠧ ? + jae .no_size + mov edx,ted_wnd_l + add edx,ted_rec_l + mov word[ebx+sb_offs_start_x],dx ;⠢塞 ਧ. ஫ + mov eax,ted_wnd_h ;calculate lines in page + mov edx,ted_wnd_t + add edx,eax + mov word[ebx+sb_offs_start_y],dx ;⠢塞 孨 ਧ. ஫ + sub eax,ted_rec_t + xor edx,edx + mov ecx,ted_rec_h + div ecx + cmp eax,MIN_W_SCRL_ARE + jg @f + mov eax,MIN_W_SCRL_ARE + @@: + mov dword[esi+sb_offs_cur_area],eax + + mov eax,ted_wnd_w ;calculate cols in page + mov edx,ted_wnd_l ; + add edx,eax ;塞 ਭ + mov word[esi+sb_offs_start_x],dx ;⠢塞 . ஫ + mov edx,ted_wnd_t + mov word[esi+sb_offs_start_y],dx ;⠢塞 孨 . ஫ + mov edx,ted_wnd_h + mov word[esi+sb_offs_size_y],dx ;⠢塞 . ஫ + sub eax,ted_rec_l + mov word[ebx+sb_offs_size_x],ax ;⠢塞 ਭ ਧ. ஫ + xor edx,edx + mov ecx,ted_rec_w + div ecx + cmp eax,MIN_H_SCRL_ARE + jg @f + mov eax,MIN_H_SCRL_ARE + @@: + dec eax + mov dword[ebx+sb_offs_cur_area],eax ;⠭ ᫮ ᨬ, ࠭ ਧ. ஫ + .no_size: + popad + ret +endp + +align 16 +proc ted_delete uses edi, edit:dword + mov edi,[edit] + invoke mem.free,ted_tex + invoke mem.free,ted_arr_key_pos ;ted_syntax_file + ret +endp + + +;input: +; eax = key kodes +align 16 +proc ted_key, edit:dword, table:dword, control:dword + pushad + mov edi,[edit] + mov esi,ted_el_focus + cmp dword[esi],edi + jne .end_key_fun ; 䮪 室 㭪樨 + mov esi,dword[control] + + cmp ah,KEY_F1 ;[F1] + jne @f + stdcall ted_show_help_f1,edi + jmp .end_key_fun + @@: + cmp ah,KEY_F3 ;[F3] + jne @f + stdcall ted_but_find,edi,0 + jmp .end_key_fun + @@: + + test esi,KM_CTRL ;Ctrl+... + jz .key_Ctrl + ; *** 맮 譨 㭪権 ॡ /࠭/᪠/... + cmp ted_fun_on_key_ctrl_all,0 + je .end0 + xor al,al + cmp ah,24 ;Ctrl+O + jne @f + mov al,'O' + @@: + cmp ah,31 ;Ctrl+S + jne @f + mov al,'S' + @@: + cmp ah,33 ;Ctrl+F + jne @f + mov al,'F' + @@: + cmp ah,34 ;Ctrl+G + jne @f + mov al,'G' + @@: + cmp ah,35 ;Ctrl+H + jne @f + mov al,'H' + @@: + cmp ah,49 ;Ctrl+N + jne @f + mov al,'N' + @@: + or al,al + jz .end0 + and eax,0xff + test esi,KM_SHIFT + jz @f + or eax,0x100 + @@: + stdcall ted_fun_on_key_ctrl_all, eax + jmp .end_key_fun + .end0: + + ; *** 맮 ७ 㭪権 + cmp ah,30 ;Ctrl+A + jne @f + call ted_sel_all + @@: + cmp ah,44 ;Ctrl+Z + jne @f + stdcall ted_but_undo,edi + @@: + cmp ah,45 ;Ctrl+X + jne @f + stdcall ted_but_cut,edi + @@: + cmp ah,46 ;Ctrl+C + jne @f + stdcall ted_but_copy,edi + @@: + cmp ah,47 ;Ctrl+V + jne @f + stdcall ted_but_paste,edi + @@: + cmp ah,199 ;Ctrl+Home + jne @f + call ted_key_ctrl_home + @@: + cmp ah,207 ;Ctrl+End + jne @f + call ted_key_ctrl_end + @@: + jmp .end_key_fun + .key_Ctrl: + + test esi,KM_SHIFT ;Shift+... + jz .key_Shift + cmp ah,72 ;Shift+Up + jne @f + call ted_sel_key_up + @@: + cmp ah,75 ;Shift+Left + jne @f + call ted_sel_key_left + @@: + cmp ah,77 ;Shift+Right + jne @f + call ted_sel_key_right + @@: + cmp ah,80 ;Shift+Down + jne @f + call ted_sel_key_down + @@: + ;mov ted_drag_k,1 ;稭 뤥 + jmp .key_MoveCur + .key_Shift: +;------------------------------------------------- + cmp ah,72 ;178 ;Up + jne @f + call ted_draw_cursor_sumb + call ted_cur_move_up + cmp dl,8 + jne .no_red_0 + call ted_scroll_set_redraw + stdcall ted_draw,edi + jmp @f + .no_red_0: + call ted_sel_end + @@: + cmp ah,80 ;177 ;Down + jne @f + call ted_draw_cursor_sumb + call ted_cur_move_down + cmp dl,8 + jne .no_red_1 + call ted_scroll_set_redraw + stdcall ted_draw,edi + jmp @f + .no_red_1: + call ted_sel_end + @@: + cmp ah,75 ;176 ;Left + jne @f + call ted_draw_cursor_sumb + call ted_cur_move_left + cmp dl,8 + jne .no_red_2 + call ted_scroll_set_redraw + stdcall ted_draw,edi + jmp @f + .no_red_2: + call ted_sel_end + @@: + cmp ah,77 ;179 ;Right + jne @f + call ted_draw_cursor_sumb + call ted_cur_move_right + cmp dl,8 + jne .no_red_3 + call ted_scroll_set_redraw + stdcall ted_draw,edi + jmp @f + .no_red_3: + call ted_sel_end + @@: + cmp ah,71 ;180 ;Home + jne @f + call ted_draw_cursor_sumb + call ted_cur_move_x_first_char + cmp dl,8 + jne .no_red_4 + call ted_scroll_set_redraw + stdcall ted_draw,edi + jmp @f + .no_red_4: + call ted_sel_end + @@: + cmp ah,79 ;181 ;End + jne @f + call ted_draw_cursor_sumb + call ted_cur_move_x_last_char + cmp dl,8 + jne .no_red_5 + call ted_scroll_set_redraw + stdcall ted_draw,edi + jmp @f + .no_red_5: + call ted_sel_end + @@: + cmp ah,73 ;184 ;PageUp + jne @f + call ted_cur_move_page_up + cmp dl,0 + je @f + call ted_scroll_set_redraw + stdcall ted_draw,edi + mov ted_drag_k,0 ;稢 뤥 + @@: + cmp ah,81 ;183 ;PageDown + jne @f + call ted_cur_move_page_down + cmp dl,0 + je @f + call ted_scroll_set_redraw + stdcall ted_draw,edi + mov ted_drag_k,0 ;稢 뤥 + @@: +;------------------------------------------------- + .key_MoveCur: + + ; ய᪠ 㦥 , ᨬ + cmp ah,42 ;[L Shift] 㣨 + je .end_key_fun + cmp ah,54 ;[R Shift] 㣨 + je .end_key_fun + cmp ah,58 ;[Caps Lock] + je .end_key_fun + cmp ah,69 ;[Pause Break] + je .end_key_fun + cmp ah,120 ;[Fn] + je .end_key_fun + cmp ah,0x80 ;if key up + ja .end_key_fun + + cmp dword[table],0 + je @f + stdcall KeyConvertToASCII, [table] + @@: + + ;mov ted_drag_k,0 ;稢 뤥 + + lea edx,[EvChar] ;६ ⠡ ⨬묨 ᨬ + add dl,ah + jae @f + add edx,0x100 ;᫨ 뫮 ९ ᨬ + @@: + cmp byte[edx],1 + jne @f + mov ted_key_new,ah + call ted_set_undo + mov edx,ted_opt_ed_change_time+ted_opt_ed_move_cursor + stdcall ted_sel_text_del,edx + cmp al,1 + jne .del + mov edx,ted_opt_ed_move_cursor + .del: + cmp ted_cur_ins,1 + je .no_ins_mod + stdcall ted_text_del,edi,ted_opt_ed_change_time + mov edx,ted_opt_ed_move_cursor + .no_ins_mod: + mov ecx,edi + add ecx,ted_offs_key_new + stdcall ted_text_add,edi,ecx,1,edx ;塞 ᨬ + cmp ted_key_new,13 + jne .dr_m_win + ;᫨ ⠢ ᨬ ப + mov ecx,ted_scr_w + inc dword[ecx+sb_offs_max_area] ;㢥稢 ࠧ ⨪쭮 ஫ + mov edx,ted_cur_y + cmp edx,[ecx+sb_offs_cur_area] + jl .no_change + dec ted_cur_y ; ⠢塞 + inc dword[ecx+sb_offs_position] ;ᤢ 㭮 + .no_change: + stdcall ted_draw,edi + jmp .dr_cur_l + .dr_m_win: + stdcall ted_draw_cur_line,edi + .dr_cur_l: + cmp ted_fun_draw_panel_buttons,0 + je @f + call ted_fun_draw_panel_buttons + @@: + + cmp ah,8 ;[<-] + jne @f + call ted_set_undo + stdcall ted_sel_text_del,ted_opt_ed_change_time + cmp al,1 + je .del_one_b + stdcall ted_text_del,edi,ted_opt_ed_change_time+ted_opt_ed_move_cursor + .del_one_b: + stdcall ted_draw,edi + cmp ted_fun_draw_panel_buttons,0 + je .end_key_fun + call ted_fun_draw_panel_buttons + jmp .end_key_fun +align 4 + @@: + + cmp ah,182 ;Delete + jne @f + call ted_set_undo + stdcall ted_sel_text_del,ted_opt_ed_change_time + cmp al,1 + je .del_one_d + stdcall ted_text_del,edi,ted_opt_ed_change_time + .del_one_d: + stdcall ted_draw,edi + cmp ted_fun_draw_panel_buttons,0 + je .end_key_fun + call ted_fun_draw_panel_buttons + jmp .end_key_fun + @@: + + cmp ah,185 ;Ins + jne @f + call ted_draw_cursor_sumb + xor ted_cur_ins,1 + call ted_draw_main_cursor + @@: + + .end_key_fun: + popad + ret +endp + +;output: +; al = 1 - can save +align 16 +proc ted_can_save uses ecx edi, edit:dword + mov edi,[edit] + + mov ecx,ted_tim_ch + sub ecx,ted_tim_undo + mov al,1 + cmp ted_tim_ls,ecx + jne @f + dec al + @@: + ret +endp + +;input: +; edi = pointer to tedit struct +;output: +; al = 1 - selected +align 16 +proc ted_is_select uses ebx + xor al,al + cmp ted_drag_m,1 + je @f + inc al + mov ebx,ted_sel_x0 + cmp ebx,ted_sel_x1 + jne @f + mov ebx,ted_sel_y0 + cmp ebx,ted_sel_y1 + jne @f + xor al,al + @@: + ret +endp + +;input: +; edi = pointer to tedit struct +align 16 +proc ted_sel_normalize uses ecx esi + push edi + mov esi,edi + add esi,ted_offs_sel + add edi,ted_offs_seln + mov ecx,sizeof.TexSelect/4 + rep movsd + pop edi + + jmp @f + .swp_f: + mov ecx,ted_seln_x0 + m2m ted_seln_x0,ted_seln_x1 + mov ted_seln_x1,ecx + + mov ecx,ted_seln_y0 + cmp ecx,ted_seln_y1 ;(sel_y0>sel_y1) + jle .end_f + m2m ted_seln_y0,ted_seln_y1 + mov ted_seln_y1,ecx + + jmp .end_f +align 4 + @@: + + mov ecx,ted_seln_y0 + cmp ecx,ted_seln_y1 ;(sel_y0>sel_y1) + jg .swp_f + + cmp ecx,ted_seln_y1 ;(sel_y0==sel_y1) + jne .end_f + mov ecx,ted_seln_x0 + cmp ecx,ted_seln_x1 ;(sel_x0>sel_x1) + jg .swp_f + + .end_f: + ret +endp + +;input: +; edi = pointer to tedit struct +;description: +; 㭪 뢠 砫 뤥 +align 16 +proc ted_sel_start uses eax ecx + mov eax,ted_scr_h + mov ecx,ted_cur_x + add ecx,[eax+sb_offs_position] + mov ted_sel_x0,ecx + mov ted_sel_x1,ecx + + mov eax,ted_scr_w + mov ecx,ted_cur_y + add ecx,[eax+sb_offs_position] + mov ted_sel_y0,ecx + mov ted_sel_y1,ecx + ret +endp + +;input: +; edi = pointer to tedit struct +;description: +; 㭪 뢠 ⨨ 뤥 +align 16 +proc ted_sel_end uses eax + mov ted_drag_k,0 ;稢 뤥 + call ted_is_select + or al,al + jz @f + xor eax,eax + mov ted_sel_x0,eax + mov ted_sel_x1,eax + mov ted_sel_y0,eax + mov ted_sel_y1,eax + stdcall ted_draw,edi + jmp .end_f + @@: + call ted_draw_main_cursor + .end_f: + ret +endp + +;input: +; edi = pointer to tedit struct +;description: +; 㭪 뢠 ६饭 뤥 +align 16 +proc ted_sel_move + push eax ecx + mov ecx,ted_cur_x + mov eax,ted_scr_h + add ecx,[eax+sb_offs_position] + mov ted_sel_x1,ecx + + mov eax,ted_scr_w + mov ecx,ted_cur_y + add ecx,[eax+sb_offs_position] + mov ted_sel_y1,ecx + pop ecx eax + cmp ted_fun_draw_panel_buttons,0 ;redraw toolbar (need to button Copy) + je @f + call ted_fun_draw_panel_buttons + @@: + ret +endp + +;input: +; edi = pointer to tedit struct +;description: +; 㭪 뢠 뤥 ᥣ 㬥 +align 16 +proc ted_sel_all + push eax + xor eax,eax + mov ted_sel_x0,eax + mov ted_sel_y0,eax + + mov ted_sel_x1,eax ;??? + call ted_get_num_lines + mov ted_sel_y1,eax + pop eax + stdcall ted_draw,edi + cmp ted_fun_draw_panel_buttons,0 ;redraw toolbar (need to button Copy) + je @f + call ted_fun_draw_panel_buttons + @@: + ret +endp + +;input: +; cl_al_mem = 1 - clear all memory +align 16 +proc ted_clear uses ecx edi, edit:dword, cl_al_mem:dword + mov edi,[edit] + + mov ted_cur_x,0 + mov ted_cur_y,0 + mov ted_tim_ch,0 + mov ted_tim_ls,0 + mov ted_tim_co,0 + mov ted_tim_undo,0 + mov ted_help_id,-1 + mov ecx,sizeof.symbol + shl ecx,1 + add ecx,ted_tex + mov ted_ptr_free_symb,ecx + + mov ecx,ted_scr_w + mov dword[ecx+sb_offs_position],0 + mov dword[ecx+sb_offs_max_area],100 ;᫮ ப 㬥 + mov dword[ecx+sb_offs_redraw],1 + mov ecx,ted_scr_h + mov dword[ecx+sb_offs_position],0 + mov dword[ecx+sb_offs_max_area],100 ;᫮ ᨬ 㬥 + + mov ted_sel_x0,0 + mov ted_sel_y0,0 + mov ted_sel_x1,0 + mov ted_sel_y1,0 + + cmp dword[cl_al_mem],0 + je .exit + + push edx + mov ecx,sizeof.symbol + imul ecx,ted_max_chars + mov edx,ted_tex + @@: + mov byte [edx],0 + inc edx + loop @b + mov edx,ted_tex + mov dword [edx+symbol.next],1 + pop edx + + .exit: + ret +endp + + +align 16 +proc ted_init_syntax_file, edit:dword + pushad + mov edi,[edit] + + mov ecx,0x100 + mov edx,ted_arr_key_pos + @@: + mov dword[edx],-1 + add edx,4 + loop @b + + ;init: ted_colors_text_count, ted_key_words_count, ... + mov ted_colors_text_count,1 + mov ted_help_text_f1,0 + mov ted_help_id,-1 ;䨪 ᫮ ࠢ + + mov eax,edi ;࠭塞 祭 edi + mov esi,ted_syntax_file + add edi,ted_offs_count_colors ;edi = &ted_key_words_count + mov ecx,9 + rep movsd + mov edi,eax ;⠭ 祭 edi + + mov eax,ted_syntax_file + add eax,32 + mov ted_text_colors,eax + + mov eax,ted_colors_text_count ;init: count_colors_text (offset to key words) + lea eax,[4*eax+32] + add eax,ted_syntax_file + mov ted_key_words_data,eax + + mov ecx,ted_key_words_count ;init: ted_arr_key_pos (first key positions) + or ecx,ecx + jz .no_words + xor eax,eax + @@: + ColToIndexOffset eax,edx + movzx ebx,byte[edx] + mov esi,ted_arr_key_pos + lea esi,[esi+4*ebx] + cmp dword[esi],-1 + jne .no_ch_key + mov [esi],eax + .no_ch_key: + inc eax + loop @b + .no_words: + + ;init: ted_help_text_f1 + mov ecx,ted_key_words_count ;⢮ 祢 ᫮ + imul ecx,sizeof.TexColViv ;ࠧ 1- . . + add ecx,ted_key_words_data ;砫 䠩 . . + mov ted_help_text_f1,ecx ;⪠ , 稭 ⥪ ࠢ + + stdcall ted_init_scroll_bars,edi,1 ;塞 梥 ஫ + .no_colors: + popad + ret +endp + +;input: +; ebx = file size +; edi = pointer to tedit struct +;description: +; 㭪 뢠 ⨨ 䠩 +align 16 +proc ted_on_open_file + push eax ;destination + push ecx ;for cycle + push edx ;source + push esi + + or ebx,ebx + jnz @f + ;᫨ 䠩 ⮩ + stdcall ted_clear,edi,1 ;⨬ + jmp .end_opn +align 4 + @@: + stdcall ted_clear,edi,0 ;⨬ , ⮬ 㤥 묨 묨 + + mov edx,ted_tex + mov ecx,ebx + .s_10: + cmp word[edx],0xa0d ;ய᪠ 10- ᨬ ᫨ । ⮨ 13- + jne @f + dec ecx + jz .no_10 + dec ecx + jz .no_10 + add edx,2 + @@: + cmp byte[edx],10 + jne @f + mov byte[edx],13 ;塞 10- ᨬ ப + @@: + inc edx + loop .s_10 + .no_10: + + ;ॢ 䠩 t_edit + mov ecx,ebx + lea eax,[ebx+2] + ConvertIndexToPointer eax + mov edx,ted_tex + add edx,ebx + push ebx + @@: + mov ebx,[edx] + mov byte[eax],bl + mov dword[eax+symbol.perv],ecx + inc dword[eax+symbol.perv] + mov dword[eax+symbol.next],ecx + add dword[eax+symbol.next],3 + ;mov byte[eax+1],0 ;col=0 + mov dword[eax+symbol.tc],-1 + mov dword[eax+symbol.td],0 + + or ecx,ecx + jz @f + dec ecx + dec edx + sub eax,sizeof.symbol + jmp @b +align 4 + @@: + pop ebx + mov dword[eax+symbol.perv],0 ; first sumbol 'perv=0' + + mov edx,ted_tex ; ன 砫쭮 㦥 ᨬ + ; begining sumbol 'perv=0' 'next=2' + mov dword[edx+symbol.perv],0 + mov dword[edx+symbol.next],2 + + add edx,sizeof.symbol ; ன 筮 㦥 ᨬ + mov dword[edx+symbol.next],0 ; last sumbol 'next=0' + mov dword[edx+symbol.perv],ebx ; last sumbol 'perv=last' + inc dword[edx+symbol.perv] + mov dword[edx+symbol.tc],0 ; ⠢ ६ ᮧ ࠢ 0, ᨬ ࠢ쭮 ࠡ뢠 ⨨ 䠩 28 + + mov edx,ebx + inc edx ;2 = rezerv sumbols + imul edx,sizeof.symbol + add edx,ted_tex + mov dword[edx+symbol.next],1 ; last sumbol 'next=1' + + @@: ;clear memory, need if before was open big file + add edx,sizeof.symbol + cmp edx,ted_tex_end + jge .end_opn + mov dword[edx+symbol.tc],0 + mov dword[edx+symbol.td],0 + jmp @b +align 4 + .end_opn: + + call ted_get_num_lines + cmp eax,TED_LINES_IN_NEW_FILE + jge @f + mov eax,TED_LINES_IN_NEW_FILE + @@: + mov esi,ted_scr_w + mov dword[esi+sb_offs_max_area],eax + pop esi edx ecx eax + + call ted_text_colored + stdcall ted_draw,edi + cmp ted_fun_draw_panel_buttons,0 + je @f + call ted_fun_draw_panel_buttons + @@: + ret +endp + +;input: +; edx = pointer to symbol struct +; edi = pointer to tedit struct +;output: +; edx = pointer to 'perv' visible symbol struct +align 16 +ted_iterat_perv: + cmp ted_tim_undo,0 + je .else + push ebx + @@: + mov edx,[edx+symbol.perv] + or edx,edx + jz @f + imul edx,sizeof.symbol + add edx,ted_tex + call ted_symbol_not_vis + cmp bl,1 + je @b + cmp byte[edx],10 ;ய ᨬ 10 + je @b + pop ebx + ret + @@: + mov edx,ted_tex ;砫 䠩 + pop ebx + ret + .else: + mov edx,[edx+symbol.perv] + or edx,edx + jz @f + imul edx,sizeof.symbol + add edx,ted_tex + cmp dword[edx+symbol.td],0 + jne .else + cmp byte[edx],10 ;ய ᨬ 10 + je .else + ret + @@: + mov edx,ted_tex ;砫 䠩 + ret + + +;input: +; edx = pointer to symbol struct +; edi = pointer to tedit struct +;output: +; edx = pointer to 'next' visible symbol struct +align 16 +ted_iterat_next: + cmp ted_tim_undo,0 + je .else + push ebx + @@: + mov edx,[edx+symbol.next] + cmp edx,1 + jle @f + imul edx,sizeof.symbol + add edx,ted_tex + + call ted_symbol_not_vis + cmp bl,1 + je @b + cmp byte[edx],10 ;ய ᨬ 10 + je @b + pop ebx + ret + @@: + mov edx,ted_tex_1 ; 䠩 + pop ebx + ret + .else: + mov edx,[edx+symbol.next] + cmp edx,1 + jle @f + imul edx,sizeof.symbol + add edx,ted_tex + + cmp dword[edx+symbol.td],0 + jne .else + cmp byte[edx],10 ;ய ᨬ 10 + je .else + ret + @@: + mov edx,ted_tex_1 ; 䠩 + ret + +;input: +; bl = symbol end of select +; bh = ࠭騩 ᨬ (= 0 ᫨ ஢ન ) +; edx = pointer to symbol struct +; edi = pointer to tedit struct +;description: +; ᫥ 㪠 ᨬ +align 16 +ted_iterat_next_pos_char: + push ax + mov al,1 ;।騩 ᨬ, 㦨 ࠢ ᨬ bh + @@: + cmp bl,byte[edx] + je .found + .no_found: + cmp edx,ted_tex_1 + jle @f + mov al,byte[edx] + call ted_iterat_next + jmp @b + .found: + cmp bh,al + je .no_found + @@: + call ted_iterat_next + pop ax + ret + +;input: +; edx = pointer to symbol struct +; edi = pointer to tedit struct +align 16 +ted_iterat_perv_color_tag: + @@: + cmp byte[edx+1],0 + jne @f + call ted_iterat_perv + cmp edx,ted_tex_1 + jle @f + jmp @b +align 4 + @@: + ret + +;input: +; edx = pointer to symbol struct +; edi = pointer to tedit struct +align 16 +ted_iterat_next_color_tag: + @@: + call ted_iterat_next + cmp byte[edx+1],0 + jne @f + cmp edx,ted_tex_1 + jle @f + jmp @b +align 4 + @@: + ret + +;input: +; edx = pointer to symbol struct +; edi = pointer to tedit struct +;output: +; bl = 1 if sumbol not visible +; (tex[i].td+ted_tim_undo<=ted_tim_ch && tex[i].td) || (tex[i].tc>ted_tim_ch-ted_tim_undo) +align 16 +ted_symbol_not_vis: + push eax + + xor bl,bl + cmp dword[edx+symbol.td],0 + je @f + mov eax,[edx+symbol.td] ;eax=tex[i].td + add eax,ted_tim_undo + cmp eax,ted_tim_ch + jg @f + mov bl,1 + pop eax + ret + @@: + + mov eax,ted_tim_ch + sub eax,ted_tim_undo + cmp [edx+symbol.tc],eax + jle @f + or bl,1 + @@: + + pop eax + ret + +;input: +; text - pointer to text string +; add_opt - options +align 16 +proc ted_text_add, edit:dword, text:dword, t_len:dword, add_opt:dword + locals + new_spc dd ? ;count new spaces + new_lin dd ? ;count new lines + endl +;ᯮ짮 ॣ஢ 㭪樨: +;eax - ⠢ ⥪ +;ebx - ६ 㦤, ⠢塞 ⥪ +;ecx - ६ 㦤 +;edx - 㪠⥫ ᨬ + pushad + cmp dword[t_len],1 ;஢塞 塞 ⥪ + jl .no_add ; <1 룠 㭪樨,  + + mov edi,[edit] + mov esi,[text] + + call ted_get_pos_by_cursor + call ted_get_text_perv_pos + call ted_get_text_arr_index ;eax=po_t + + mov dword[new_spc],0 + cmp ted_gp_opt,2 + je @f + push eax ;c_sp=cur[cn].x+Scroller->XPos-StrLen(cur[cn].y+Scroller->YPos); + mov eax,ted_scr_h + mov eax,[eax+sb_offs_position] + add eax,ted_cur_x ;eax - ᨬ + mov [new_spc],eax + + mov eax,ted_scr_w + mov eax,[eax+sb_offs_position] + add eax,ted_cur_y ;eax - ப + call ted_strlen ;ebx = line len + sub [new_spc],ebx ; 樨 ⭨ ப, 㧭 ⢮ 塞 ஡ + pop eax + @@: + + mov ebx,[t_len] + + mov dword[new_lin],0 + cmp ted_gp_opt,0 + jne @f + push eax + mov eax,ted_scr_w + mov eax,[eax+sb_offs_position] + add eax,ted_cur_y + inc eax + mov [new_lin],eax + + call ted_get_num_lines + sub [new_lin],eax + ;㢥稢 ஫ ᫮ ⥫ ப + mov ecx,ted_scr_w + add [ecx+sb_offs_max_area],eax ;㢥稢 ࠧ ⨪쭮 ஫ + pop eax + @@: + + mov edx,ted_ptr_free_symb + .beg_cycle: ;for(i=...;i ted_cur_x + mov ted_gp_opt,1 + cmp eax,ecx + jge @f ; Row >= ted_cur_y + .u1_0: + mov ted_gp_opt,0 + inc ebx + cmp byte [edx],13 + jne @b + cmp eax,ecx + jge @f ; Row >= ted_cur_y + inc eax + xor ebx,ebx + jmp @b + @@: + cmp eax,ecx + jne @f ; Row = ted_cur_y + inc ted_gp_opt + @@: + cmp ted_gp_opt,0 + jne @f + mov edx,ted_tex_1 + ;call ted_get_text_perv_pos + @@: + ret +endp + +;input: +; eax = Row +; edi = pointer to tedit struct +;output: +; ebx = str len +align 16 +ted_strlen: + push edx ecx + ;ecx = Row, from cycle + + xor ebx,ebx + xor ecx,ecx + mov edx,ted_tex + @@: + call ted_iterat_next + cmp edx,ted_tex_1 + jle @f + inc ebx + cmp byte [edx],13 + jne @b + dec ebx ;lenght minus 1 sumbol to paragraph + cmp eax,ecx + je @f + xor ebx,ebx + inc ecx + jmp @b + @@: + + cmp eax,ecx + je @f + xor ebx,ebx + @@: + + pop ecx edx + ret + + +;input: +; edx = symbol position +; edi = pointer to tedit struct +;output: +; eax = number of line +; ebx = symbol position in line +align 16 +ted_get_text_coords: + push edx + xor eax,eax + xor ebx,ebx + @@: + call ted_iterat_perv + + or eax,eax + jnz .no_col_mov + inc ebx + .no_col_mov: + + cmp edx,ted_tex_1 + jle @f + cmp byte [edx],13 + jne @b + inc eax + jmp @b + @@: + dec ebx + pop edx + ret + +;input: +; edi = pointer to tedit struct +;output: +; eax = num lines +align 16 +ted_get_num_lines: + push edx + mov eax,1 + mov edx,ted_tex + @@: + call ted_iterat_next + cmp edx,ted_tex_1 + jle @f + cmp byte[edx],13 + jne @b + inc eax + jmp @b + @@: +;... +;dec eax + pop edx + ret + + +;input: +; edi = pointer to tedit struct +;description: +; ⬥ ⬥ ⢨, । 㬥 +align 16 +proc ted_set_undo + mov ted_drag_k,0 ;稢 뤥 + cmp ted_tim_undo,1 + jl .no_work + + push eax ebx edx + mov edx,ted_tex + call ted_get_text_next_pos ;long i=tex[0].next; + mov eax,ted_tim_undo + sub ted_tim_ch,eax ;ted_tim_ch-=ted_tim_undo; + mov eax,ted_tim_ch + cmp ted_tim_ls,eax ;if(ted_tim_ls>ted_tim_ch) + jle @f + mov ted_tim_ls,0 + @@: + cmp edx,ted_tex_1 + jle @f + + ;if(tex[i].tc>ted_tim_ch){ // ᫨ ᮧ ᨬ 뫮 ⬥ + cmp [edx+symbol.tc],eax + jle .no_u1 + mov dword[edx+symbol.tc],0 + mov dword[edx+symbol.td],0 + + mov ebx,[edx+symbol.perv] + imul ebx,sizeof.symbol + add ebx,ted_tex ;ebx=tex[i].perv + m2m dword [ebx+symbol.next],dword [edx+symbol.next] ;tex[tex[i].perv].next=tex[i].next; + + mov ebx,[edx+symbol.next] + imul ebx,sizeof.symbol + add ebx,ted_tex ;ebx=tex[i].next + m2m dword [ebx+symbol.perv],dword [edx+symbol.perv] ;tex[tex[i].next].perv=tex[i].perv; + + cmp ted_ptr_free_symb,edx + jle .no_cor_free + mov ted_ptr_free_symb,edx ;塞 㪠⥫ ᢮ ᨬ, ண ᪠ + .no_cor_free: + mov edx,ebx ;⨬㥬 ᪮ (edx ᫥ 맮 ted_get_text_next_pos 㤥 ࠢ ebx) + jmp @b + .no_u1: + + ;else if(tex[i].td>ted_tim_ch) tex[i].td=0; // ᫨ 㤠 ᨬ 뫮 ⬥ + cmp [edx+symbol.td],eax + jle .no_u2 + mov dword[edx+symbol.td],0 + .no_u2: + + call ted_get_text_next_pos + jmp @b + @@: + mov ted_tim_undo,0 + mov eax,ted_tim_co + cmp ted_tim_ch,eax + jge @f + mov ted_tim_co,0 + @@: + pop edx ebx eax + .no_work: + ret +endp + +;description: +; 室 㪠 +;input: +; row = ப +; col = ᨬ +align 16 +proc ted_go_to_position uses ecx edx edi, edit:dword, row:dword, col:dword + mov edi,[edit] + ; ⮢ ப + mov edx,[row] + call ted_get_num_lines + cmp edx,eax + jle @f + mov edx,eax ;࠭祭 ப max + @@: + dec edx + cmp edx,0 + jge @f + xor edx,edx ;࠭祭 ப min + @@: + ; ⮢ ᨬ + mov ecx,[col] + dec ecx + cmp ecx,0 + jge @f + xor ecx,ecx + @@: + call ted_go_to_pos + stdcall ted_draw,edi + ret +endp + +;input: +; ecx = Col +; edx = Row +; edi = pointer to tedit struct +;output: +; ecx = cursor x +; edx = cursor y +align 16 +ted_go_to_pos: + push eax ebx + mov eax,ted_scr_h + sub ecx,[eax+sb_offs_position] + cmp ecx,0 ;ted_cur_x < 0 + jge @f + add [eax+sb_offs_position],ecx ;ப⪠ ஫ + xor ecx,ecx + @@: + mov ebx,5 ;5 - ᫥ + cmp ecx,ebx + jge .end0 + sub ebx,ecx ;ebx - ᪮쪮 ᨬ 㦭 ᤢ + cmp [eax+sb_offs_position],ebx + jge @f + add ecx,[eax+sb_offs_position] + mov dword[eax+sb_offs_position],0 + jmp .end0 + @@: + sub [eax+sb_offs_position],ebx + add ecx,ebx + .end0: + cmp ecx,[eax+sb_offs_cur_area] ;ted_cur_x > [.cur_area] + jl .end1 + mov ebx,ecx + sub ebx,[eax+sb_offs_cur_area] + inc ebx + add [eax+sb_offs_position],ebx ;ப⪠ ஫ ࠢ + sub ecx,ebx + .end1: + mov ted_cur_x,ecx + + mov eax,ted_scr_w + sub edx,[eax+sb_offs_position] + cmp edx,0 ;ted_cur_y < 0 + jge @f + add [eax+sb_offs_position],edx ;ப⪠ ஫ + xor edx,edx + jmp .end2 + @@: + cmp edx,[eax+sb_offs_cur_area] ;ted_cur_y > [.cur_area] + jl .end2 + mov ebx,edx + sub ebx,[eax+sb_offs_cur_area] + inc ebx + add [eax+sb_offs_position],ebx ;ப⪠ ஫ + sub edx,ebx + .end2: + mov ted_cur_y,edx + pop ebx eax + ret + +;input: +; edi = pointer to tedit struct +align 16 +ted_text_colored: + push eax edx + mov eax,ted_tim_ch + sub eax,ted_tim_undo + mov ted_tim_co,eax + mov edx,ted_tex + @@: + call ted_iterat_next + cmp edx,ted_tex_1 + jle @f + mov byte[edx+1],0 + jmp @b + @@: + + cmp ted_key_words_count,1 + jl .no_colors + mov edx,ted_tex + @@: + call ted_text_find_sel_color + cmp edx,ted_tex_1 + jg @b + + xor ax,ax + mov edx,ted_tex + .cycle0: + call ted_iterat_next + cmp edx,ted_tex_1 + jle .no_colors + mov al,byte[edx+1] + or al,al + jz .cycle0 + cmp ah,al + jne @f + mov byte[edx+1],0 ;᫨ﭨ 冷 ᫮ 梥 + @@: + shl ax,8 + jmp .cycle0 + .no_colors: + pop edx eax + ret + + +;input: +; edx = pointer to start symbol +; edi = pointer to tedit struct +;output: +; edx = pointer to next symbol +;description: +; 㭪 ᪠ 뤥 ᢥ祭 ᫮ +align 16 +proc ted_text_find_sel_color uses eax ebx ecx esi +locals + begPos dd ? ;砫쭠 + endPos dd ? ;筠 + find db ? ;0 - , 1 - , 2 - 䠩 + f_color db ? ; 梥 ᫮ +endl +;eax = word_n ⥪騩 () ஢塞 ᫮ ᯨ᪥ +;ebx = ࠧ 楫 +;ecx = l_pos ᫥ () 室饣 ᫮ ᯨ᪥ +;esi = ࠧ 楫, ஢塞 ᨬ ᫮ + mov dword[begPos],1 + mov dword[endPos],1 + mov byte[find],0 + mov byte[f_color],1 + .cycle0: + call ted_iterat_next + cmp edx,ted_tex_1 + jle .cycle0end + + movzx eax,byte[edx] + shl eax,2 ;eax*=4 + add eax,ted_arr_key_pos + mov eax,[eax] + cmp eax,0 + jl .cycle0 ;if( (word_n=ted_arr_key_pos[(unsigned char)tex[i].c])>-1 ){ + + mov ecx,eax + ;while(l_posword_n && Col[l_pos-1].Text[pos]!=tex[i].c) + @@: + cmp ecx,eax + jle @f + dec ecx + ColToIndexOffset ecx,ebx + inc ecx + ;cmp byte[ebx+esi],byte[edx] + mov bl,byte[ebx+esi] + cmp bl,byte[edx] + je @f + dec ecx + jmp @b + @@: + + ColToIndexOffset eax,ebx + cmp byte[ebx+esi],0 + jne .if_0 ;if(Col[word_n].Text[pos]==0){ + mov [endPos],edx ;eP=i; + ColToIndexOffset eax,ebx + mov bl,[ebx+MAX_COLOR_WORD_LEN+7] + mov [f_color],bl ;f_color=Col[word_n].color; + + mov byte[find],1 + ColToIndexOffset eax,ebx ;... ebx = Col[word_n] + mov bl,[ebx+MAX_COLOR_WORD_LEN+4] + cmp bl,0 ;if(Col[word_n].wwo) + je .if_2n + push edx + mov edx,[begPos] + call ted_iterat_perv + + btr bx,0 ;1-1 + jae @f ;if(Col[word_n].wwo&1) + ;u1= !(isalnum(cont_s)||cont_s=='_') + call isalnum + jae @f + mov byte[find],0 + jmp .if_4e + @@: + + btr bx,3 ;4-1 + jae .if_4e ;if(Col[word_n].wwo&8) + ;u1= !isalpha(cont_s); + call isalpha + jae .if_4e + mov byte[find],0 + .if_4e: + + mov edx,[endPos] + ;call ted_iterat_next + + btr bx,1 ;2-1 + jae @f ;if(Col[word_n].wwo&2) + ;u1= !(isalnum(cont_s)||cont_s=='_') + call isalnum + jae @f + mov byte[find],0 + jmp .if_6e + @@: + + btr bx,4 ;5-1 + jae .if_6e ;if(Col[word_n].wwo&16) + ;u1= !isalpha(cont_s); + call isalpha + jae .if_6e + mov byte[find],0 + .if_6e: + + btr bx,2 ;3-1 + jae .if_7e ;if(Col[word_n].wwo&4) + ColToIndexOffset eax,ebx + mov bx,word[ebx+MAX_COLOR_WORD_LEN+5] + call ted_iterat_next_pos_char + cmp edx,ted_tex_1 + jg @f + ;᫨ 諨 䠩 諨 ᨬ ࠧ⪨ + call ted_iterat_perv + mov byte[find],2 + @@: + mov dword[endPos],edx + .if_7e: + + pop edx + .if_2n: +;if(i!=1){ // 㬥 +; cont_s=tex[eP].c; +; if(Col[word_n].wwo&2) u2= !(isalnum(cont_s)||cont_s=='_'); // 㪢.-. ᨬ +; if(u2 && Col[word_n].wwo&16) u2= !isalpha(cont_s); // . ᨬ +; if(Col[word_n].wwo&4) eP=ted_iterat_next_pos_char(eP,Col[word_n].endc); + + cmp eax,ecx + je .wh_2e ;if(word_n==l_pos) break; // do double - ᫨ ᫮ 筮 ᫥ + .if_0: + + cmp edx,ted_tex_1 + jle .wh_2e ;if(i==1) break; + + ;while(l_pos>word_n && Col[word_n].Text[pos]!=tex[i].c) + .wh_4b: + cmp ecx,eax + jle .wh_4e + ColToIndexOffset eax,ebx + ;cmp byte[ebx+esi],byte[edx] + mov bl,byte[ebx+esi] + cmp bl,byte[edx] + je .wh_4e + inc eax + jmp .wh_4b + .wh_4e: + + cmp eax,ecx + je .wh_2e;if(word_n==l_pos) break; + inc esi ;pos++; + jmp .wh_2b + .wh_2e: + + cmp byte[find],0 ;if(fnd)break; + jne .cycle0end + mov edx,[begPos];i=bP; + jmp .cycle0 + .cycle0end: + + cmp byte[find],0 + je .if_1e ;if(fnd){ // 뤥 ⥪ + ;if(!mode_sf1 || (mode_sf1 && strlen(Col[word_n].f1->c_str())>0)){ + mov eax,[begPos] + mov bl,[f_color] + mov [eax+1],bl ;tex[bP].col=f_color; + mov eax,[endPos] + mov byte[eax+1],0xff ;tex[eP].col=255; + cmp byte[find],2 + je .if_1e + ;return ItPoPerv(eP); // 頥 宦 + mov edx,[endPos] + call ted_get_text_perv_pos + jmp @f + .if_1e: + mov edx,ted_tex + @@: + + ret +endp + +;input: +; edx = pointer to char (byte) +;output: +; cf=1 if symbol is... +align 16 +tab_all_num db 0,0,0,0,0,0,0xff,11b,11111110b,0xff,0xff,10000111b,11111110b,0xff,0xff,111b,0,0,0,0,0,0,0,0;,0,0,0,0,0,0,0,0 - tab_alpha_0,0,0,0,0,0,0,0 +tab_alpha db 0,0,0,0,0,0,0,0,11111110b,0xff,0xff,10000111b,11111110b,0xff,0xff,111b,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 + +;output: +; cf=1 ᫨ [edx] 㪢, '_' +align 16 +isalnum: + push eax ebx + movzx eax,byte[edx] ;al=offset + shr eax,3 + lea ebx,[tab_all_num] + add ebx,eax + movzx ax,byte[edx] ;al=bit + and ax,111b + bt word[ebx],ax + pop ebx eax + ret + +;output: +; cf=1 ᫨ [edx] 㪢 '_' +align 16 +isalpha: + push eax ebx + movzx eax,byte[edx] ;al=offset + shr eax,3 + lea ebx,[tab_alpha] + add ebx,eax + movzx ax,byte[edx] ;al=bit + and ax,111b + bt word[ebx],ax + pop ebx eax + ret + +align 16 +proc ted_show_help_f1 uses eax edx edi, edit:dword + mov edi,[edit] + + call ted_get_pos_by_cursor + push edx + call ted_iterat_next_color_tag + mov eax,edx + pop edx + call ted_iterat_perv_color_tag + + cmp eax,ted_tex + jle @f + cmp edx,ted_tex_1 + jle @f + stdcall ted_find_help_id,eax + @@: + ;call ted_draw_main_cursor + call ted_draw_help_f1 + ret +endp + +;input: +; edx = position begin 'symbol' struct +; edi = pointer to tedit struct +; end_pos = position end 'symbol' struct +align 16 +proc ted_find_help_id uses ebx ecx, end_pos:dword +; ecx = word_n +; ebx = l_pos + mov ted_help_id,-1 + + movzx ebx,byte[edx] + shl ebx,2 ;ebx*=4 + add ebx,ted_arr_key_pos + mov ecx,[ebx] + cmp ecx,0 + jl .if_0e ;if( (word_n=ted_arr_key_pos[(unsigned char)tf[0]])>-1 ){ + push esi eax + mov ebx,ecx ;l_pos=word_n; + ColToIndexOffset ecx,esi + push cx + mov cl,[esi] + @@: + cmp ebx,ted_key_words_count ;while(l_posword_n + jle .wh_0e + dec ebx + ColToIndexOffset ebx,eax + inc ebx + cmp byte[eax+esi],dl ;&& Col[l_pos-1].Text[pos]!=tf[i]) + je .wh_0e + dec ebx ;l_pos--; + jmp .wh_0b + .wh_0e: + + .wh_1b: + cmp ebx,ecx ;while(l_pos>word_n + jle .wh_1e + ColToIndexOffset ecx,eax + cmp byte[eax+esi],dl + je .wh_1e + inc ecx ;word_n++; + jmp .wh_1b + .wh_1e: + pop dx + + cmp ecx,ebx ;if(word_n==l_pos) break; + je @f + call ted_iterat_next ;pos++; + cmp edx,[end_pos] ;for(...;i y0,y1 + add ecx,ted_rec_t + mov edx,ted_cur_y + imul edx,ted_rec_h + add ecx,edx + shl ecx,16 + add ecx,ted_rec_h + + mov edx,ted_color_wnd_work + call ted_sel_normalize + + mov esi,ted_scr_w + mov eax,[esi+sb_offs_position] + sub ted_seln_y0,eax + sub ted_seln_y1,eax + + mov eax,ted_cur_y + cmp eax,ted_seln_y0 + jl .no_cur_sel + cmp eax,ted_seln_y1 + jg .no_cur_sel + mov edx,ted_color_select ;塞 梥 䮭 梥 뤥 + mov esi,ted_scr_h + cmp eax,ted_seln_y0 + jne @f + mov eax,ted_cur_x + add eax,[esi+sb_offs_position] + cmp eax,ted_seln_x0 + jge @f + mov edx,ted_color_wnd_work + @@: + mov eax,ted_cur_y + cmp eax,ted_seln_y1 + jne .no_cur_sel + mov eax,ted_cur_x + add eax,[esi+sb_offs_position] + cmp eax,ted_seln_x1 + jl .no_cur_sel + mov edx,ted_color_wnd_work + .no_cur_sel: + mcall SF_DRAW_RECT + + call ted_get_pos_by_cursor ;६ ᨬ + cmp ted_gp_opt,2 + jne @f + mov esi,1 + ror ecx,16 + mov bx,cx + add ebx,0x10001 + call ted_get_symb_color + call ted_convert_invis_symb + mcall SF_DRAW_TEXT ;ᮢ ᨬ + @@: +popad + ret +endp + +;input: +; edx -> pointer to text +; edi -> 㪠⥫ tedit +;output: +; ecx = color +; if ted_mode_color=0 then ecx=ted_color_wnd_text +align 16 +ted_get_symb_color: + mov ecx,ted_color_wnd_text ; 梥 ⥪ 㬮砭 + + push eax edx + cmp ted_mode_color,0 + je .exit + jmp .on_first + @@: + call ted_iterat_perv + cmp edx,ted_tex_1 + jle .exit + .on_first: + movzx eax,byte[edx+1] + or eax,eax ;᫨ al=0 梥 + jz @b + + cmp eax,ted_colors_text_count + jge .exit + + mov ecx,ted_text_colors ;ਡ塞 ᬥ饭 1- 梥 + lea ecx,[ecx+4*eax] + mov ecx,[ecx] ;⠭ ⥪騩 梥 ⥪ ᬥ饭 + .exit: + or ecx,ted_font_size + pop edx eax + ret + +;input: +; edx = pointer to text +; edi = pointer to tedit struct +;description: +; 㭪 ८ࠧ ᨬ ⠥ ࠭ +align 16 +ted_convert_invis_symb: + cmp ted_mode_invis,1 + jne .else + cmp byte[edx],9 + jne @f + lea edx,[ted_symbol_tab] + jmp .end_f +align 4 + @@: + cmp byte[edx],13 + jne @f + mov edx,edi + add edx,ted_offs_symbol_new_line + @@: + jmp .end_f +align 4 + .else: + cmp byte[edx],9 + je @f + cmp byte[edx],13 + jne .end_f + @@: + lea edx,[ted_symbol_space] + .end_f: + ret + +;input: +; edi = pointer to tedit struct +align 16 +ted_scroll_set_redraw: + push eax + mov eax,ted_scr_w + mov dword[eax+sb_offs_redraw],1 + mov eax,ted_scr_h + mov dword[eax+sb_offs_redraw],1 + pop eax + ret + +align 16 +proc ted_draw, edit:dword + locals + line_num dd ? + endl + pushad + mov edi,[edit] + + mov eax,SF_DRAW_TEXT + mov ecx,ted_text_colors + mov ecx,[ecx] + + mov ebx,ted_wnd_l + add ebx,ted_rec_l + shl ebx,16 + add ebx,ted_wnd_t + add ebx,ted_rec_t + add ebx,0x10001 ;塞 ࠢ 㪢 業 + + call ted_sel_normalize ;need before draw select + mov esi,ted_scr_w + mov esi,[esi+sb_offs_position] + mov [line_num],esi + + stdcall ted_clear_line_before_draw, edi,ebx,1,esi + call ted_get_first_visible_pos + or edx,edx + jz .no_draw_text + mov esi,1 ; 뢮 ⥪ 1- ᨬ + @@: + call ted_iterat_next + cmp edx,ted_tex_1 + jle .no_draw_text + + ; *** 梥⮢ ࠧ⪠ + cmp ted_mode_color,0 + je .no_col_change + cmp byte[edx+1],0 + je .no_col_change + call ted_get_symb_color + .no_col_change: + + cmp byte[edx],13 + jne .no_13 + cmp ted_mode_invis,1 + jne .no_invis + push edx + mov edx,edi + add edx,ted_offs_symbol_new_line + int 0x40 + pop edx + .no_invis: + add ebx,ted_rec_h + ;optimized output \/ + mov eax,ted_wnd_h + add eax,ted_wnd_t + cmp bx,ax + jg .no_draw_text + mov eax,SF_DRAW_TEXT + ;optimized output /\ + and ebx,0xffff + ror ebx,16 + add ebx,ted_wnd_l + add ebx,ted_rec_l + inc ebx + ror ebx,16 + inc dword[line_num] ;increment line number + stdcall ted_clear_line_before_draw,edi,ebx,1,dword[line_num] + call ted_opt_draw_line_left + jmp @b +align 4 + .no_13: + + int 0x40 + ror ebx,16 + add ebx,ted_rec_w + mov esi,ted_wnd_l + add esi,ted_wnd_w + cmp bx,si + jl .no_opt + call ted_opt_draw_line_right + .no_opt: + mov si,1 + ror ebx,16 + jmp @b + .no_draw_text: + + inc dword[line_num] + stdcall ted_clear_line_before_draw,edi,ebx,0,dword[line_num] + call ted_draw_line_numbers + call ted_draw_main_cursor + +;--------------------------------------------- +; set all_redraw flag for draw all ScrollBar +; In some cases it is necessity to draw only the area +; of moving of a "runner", for acceleration of output - +; in this case the flag needs to be reset to 0 (zero). + mov eax,ted_scr_h + mov esi,ted_scr_w + mov dword[eax+sb_offs_all_redraw],1 + mov dword[esi+sb_offs_all_redraw],1 + +; ᮢ ப⪨ + stdcall scroll_bar_horizontal.draw,eax ;[scrollbar_hor_draw] + stdcall scroll_bar_vertical.draw,esi ;[scrollbar_ver_draw] +; reset all_redraw flag + mov dword[eax+sb_offs_all_redraw],0 + mov dword[esi+sb_offs_all_redraw],0 +;--------------------------------------------- + + ;left-bottom square + mov ebx,ted_wnd_l + shl ebx,16 + add ebx,ted_rec_l + mov ecx,ted_wnd_t + add ecx,ted_wnd_h + shl ecx,16 + mov cx,word[eax+sb_offs_size_y] + inc cx + mcall SF_DRAW_RECT,,,ted_color_wnd_capt ;[sc.work] + + ;right-bottom square + mov ebx,ted_wnd_l + add ebx,ted_wnd_w + shl ebx,16 + mov bx,word[esi+sb_offs_size_x] + inc bx + int 0x40 + + cmp ted_fun_draw_panels,0 + je @f + stdcall ted_fun_draw_panels, edi + @@: + popad + ret +endp + +;input: +; edi = pointer to tedit struct +align 16 +proc ted_draw_main_cursor +pushad + mov eax,SF_DRAW_RECT ;draw cursor + mov ecx,ted_wnd_t ;calc rect -> y0,y1 + add ecx,ted_rec_t + mov edx,ted_cur_y + imul edx,ted_rec_h + add ecx,edx + + shl ecx,16 + add ecx,ted_rec_h + + mov ebx,ted_wnd_l ;calc rect -> x0,x1 + add ebx,ted_rec_l + mov edx,ted_cur_x + imul edx,ted_rec_w + add ebx,edx + shl ebx,16 + add ebx,ted_rec_w + cmp ted_cur_ins,1 ;஢ઠ ० ࠡ ( ⠢) + jne @f + shr bx,2 ;㬥蠥 ਭ + @@: + + mov edx,ted_color_cursor + int 0x40 ;뢮 + + call ted_get_pos_by_cursor + cmp ted_gp_opt,2 + jne @f + mov esi,1 + ror ecx,16 + mov bx,cx + add ebx,0x10001 + mov ecx,ted_color_cur_text + or ecx,ted_font_size + call ted_convert_invis_symb + mcall SF_DRAW_TEXT + @@: + + mov ebx,ted_wnd_l + add ebx,ted_rec_l + shl ebx,16 + add ebx,ted_wnd_t + add ebx,3 + mov ecx,ted_color_wnd_bord + or ecx,0x80000000 + lea edx,[txtRow] + mcall SF_DRAW_TEXT ;뢮 'ப' + + add ebx,0x500000 + lea edx,[txtCol] + int 0x40 ;뢮 '' + + cmp ted_tim_undo,0 + je @f + add ebx,0x500000 + lea edx,[txtOtm] + int 0x40 + sub ebx,0x500000 + @@: + + call ted_draw_buffer + call ted_draw_help_f1 + + mov eax,47 ;draw cursor coords + mov esi,ted_color_wnd_bord + or esi,0x40000000 + + mov edx,ebx + ror edx,16 + sub edx,35 + ror edx,16 + ;add edx,3 + mov ebx,0x40000 ;Row=... + mov ecx,ted_scr_w + mov ecx,[ecx+sb_offs_position] + add ecx,ted_cur_y + inc ecx + +push edi + mov edi,ted_color_wnd_work + int 0x40 ;뢮 ᫠ ⥪饩 ப +pop edi + + ;mov ebx,0x40000 ;Col=... + mov ecx,ted_scr_h + mov ecx,[ecx+sb_offs_position] + add ecx,ted_cur_x + inc ecx + add edx,0x500000 +push edi + mov edi,ted_color_wnd_work + int 0x40 ;뢮 ᫠ +pop edi + + cmp ted_tim_undo,0 + je @f + mov ecx,ted_tim_undo + add edx,0x500000 + mov edi,ted_color_wnd_work ;⨬ ॣ edi, 㭪樨 㦥 + int 0x40 ;뢮 ᫠ ⬥ ⢨ + @@: + +popad + ret +endp + +;input: +; edi = pointer to tedit struct +align 16 +proc ted_draw_buffer + pushad + + mov eax,ted_buffer + cmp dword[eax],1 ;ᬮਬ ࠧ + jl @f + mov ebx,ted_rec_l + add bx,300 + cmp ebx,ted_wnd_w ;ࠢ न 뢮 ⥪ + jge @f ; + + add ebx,ted_wnd_l + shl ebx,16 + add ebx,ted_wnd_t + add ebx,3 + mov ecx,ted_color_wnd_bord + or ecx,0x40000000 + + mov edx,ted_buffer + add edx,12 + mov esi,edx + mov edi,ted_color_wnd_work ;edi - destroy not pointer to tedit + call tl_strlen + ;cmp eax,0 ; + ;je @f + cmp eax,20 + jle .crop_buf + mov eax,20 ;१ 20 ᨬ + .crop_buf: + mov esi,eax + mcall SF_DRAW_TEXT ;뢮 ᮤন + + sub ebx,50 shl 16 + lea edx,[txtBuf] + mov esi,edx + call tl_strlen + mov esi,eax + xor ecx,0x40000000 ;㡨ࠥ 梥 䮭 + mcall SF_DRAW_TEXT ;뢮 + @@: + popad + ret +endp + +;input: +; edi = pointer to tedit struct +align 16 +proc ted_draw_help_f1 + pushad + cmp ted_rec_t,13 ;쭠 ᮢ ࠢ + jle @f + ;clear place before draw help + mov ebx,ted_wnd_l + add ebx,ted_rec_l + shl ebx,16 + add ebx,ted_wnd_w + sub ebx,ted_rec_l + mov ecx,ted_wnd_t + add ecx,13 + shl ecx,16 + add ecx,9 ;9 - 0- , ⠢ ted_rec_h ࠭ + mcall SF_DRAW_RECT,,,ted_color_wnd_capt + + cmp ted_help_id,-1 + je @f + mov eax,ted_help_id + ColToIndexOffset eax,edx + + ;SetCoordinates + mov ebx,ted_wnd_l + add ebx,ted_rec_l + shl ebx,16 + add ebx,ted_wnd_t + add ebx,13 ;=3+10 + + ;SetTextColor + movzx eax,byte[edx+MAX_COLOR_WORD_LEN+7] + shl eax,2 + mov ecx,ted_text_colors + add ecx,eax + mov ecx,[ecx] + or ecx,0xc0000000 ;SetTextStyles + mov esi,edi + mcall SF_DRAW_TEXT,,,,,ted_color_wnd_work + mov edi,esi + + mov esi,edx + call tl_strlen + + ;*** draw help string *** + mov ecx,ted_color_wnd_bord + or ecx,0x80000000 + mov edx,[edx+MAX_COLOR_WORD_LEN] + or edx,edx + jz @f + add edx,ted_help_text_f1 + inc eax + imul eax,6 ;ਭ ᨬ . + shl eax,16 + add ebx,eax + mcall SF_DRAW_TEXT + @@: + popad + ret +endp + +;input: +; edi = pointer to tedit struct +align 16 +proc ted_draw_line_numbers +pushad + ;top panel with caption + mov ebx,ted_wnd_l + ;add ebx,ted_rec_l + shl ebx,16 + add ebx,ted_wnd_w + ;sub ebx,ted_rec_l + mov edx,ted_color_wnd_work + mov ecx,ted_wnd_t + shl ecx,16 + add ecx,ted_rec_t + mov edx,ted_color_wnd_capt + mcall SF_DRAW_RECT + + ;line numbers + mov ebx,0x40000 ;format + mov ecx,ted_scr_w + mov ecx,[ecx+sb_offs_position] + inc ecx + mov edx,3 + add edx,ted_wnd_l + rol edx,16 + add edx,ted_wnd_t + add edx,ted_rec_t + @@: + +push ebx ecx edx + ;left panel with numbers + mov ebx,ted_wnd_l + shl ebx,16 + add ebx,ted_rec_l + mov ecx,ted_rec_h + rol ecx,16 + mov cx,dx + rol ecx,16 + mov edx,ted_color_wnd_capt + mcall SF_DRAW_RECT ;㥬 אַ㣮쭨 ஬ ப +pop edx ecx ebx + + mov esi,ted_color_wnd_bord + mcall SF_DRAW_NUMBER ;㥬 ப + inc ecx + add edx,ted_rec_h + sub edx,ted_wnd_t + mov esi,edx + and esi,0xffff + cmp esi,ted_wnd_h + jge @f + add edx,ted_wnd_t + jmp @b +align 4 + @@: +popad + ret +endp + +;output: +; ah = symbol +align 16 +proc KeyConvertToASCII uses ebx, table:dword + mov ebx,[table] ;convert scan to ascii + shr ax,8 + add bx,ax ;? ebx,eax + mov ah,byte[ebx] + ret +endp + +align 16 +proc ted_draw_cur_line, edit:dword +pushad + mov edi,[edit] + + mov ebx,ted_wnd_l + add ebx,ted_rec_l + shl ebx,16 + mov eax,ted_cur_y + imul eax,ted_rec_h + mov bx,ax + add ebx,ted_wnd_t + add ebx,ted_rec_t ;ebx - न אַ㣮쭨 ⪨ + add ebx,0x10001 ;塞 ࠢ 㪢 業 + + call ted_sel_normalize ;need before draw select + mov ecx,ted_cur_y + mov eax,ted_scr_w + add ecx,[eax+sb_offs_position] + stdcall ted_clear_line_before_draw,edi,ebx,1,ecx + + mov eax,ted_scr_h + mov esi,[eax+sb_offs_position] + call ted_get_pos_by_coords + + cmp ted_gp_opt,2 + jne .no_draw_text + call ted_get_symb_color + mov esi,1 ;draw 1 symbol + @@: + ;call ted_iterat_next + cmp edx,ted_tex_1 + jle .no_draw_text + + ; *** 梥⮢ ࠧ⪠ + cmp ted_mode_color,0 + je .no_col_change + cmp byte[edx+1],0 + je .no_col_change + call ted_get_symb_color + .no_col_change: + + mov eax,SF_DRAW_TEXT + cmp byte [edx],13 + jne .no_13 + cmp ted_mode_invis,1 + jne .no_draw_text + push edx + mov edx,edi + add edx,ted_offs_symbol_new_line + int 0x40 + pop edx + jmp .no_draw_text +align 4 + .no_13: + + int 0x40 + ror ebx,16 + add ebx,ted_rec_w + mov eax,ted_wnd_w + add eax,ted_wnd_l ;ax = x + cmp bx,ax + jge .no_draw_text ;Opt + ror ebx,16 + call ted_iterat_next + jmp @b +align 4 + .no_draw_text: + + call ted_draw_main_cursor +popad + ret +endp + +;input: +; clear_o - ᫨ =1 ப, =0 ப +align 16 +proc ted_clear_line_before_draw, edit:dword, coords:dword, clear_o:dword, numb_lin:dword + pushad + mov edi,[edit] + mov ebx,[coords] ;ebx = x*2^16+y coords to left up point clear line + mov esi,[numb_lin] ;esi - number text line + + sub ebx,0x10001 ;⭨ ࠢ 㪢 業 + cmp dword[clear_o],0 + jne @f + add ebx,ted_rec_h + ror ebx,16 + xor bx,bx + add ebx,ted_wnd_l + add ebx,ted_rec_l ;bx = ted_wnd_l+ted_rec_l + ror ebx,16 + @@: + + mov eax,ted_wnd_h + add eax,ted_wnd_t + cmp ax,bx + jl .no_clear + sub ax,bx + + mov cx,bx + shl ecx,16 + + xor bx,bx + add ebx,ted_wnd_w + sub ebx,ted_rec_l + xor cx,cx + add ecx,ted_rec_h + mov edx,ted_color_wnd_work + + cmp dword[clear_o],0 + je .pusto + cmp ax,cx + jge @f + .pusto: + mov cx,ax + jmp .no_select ;᫨ ⪠ , ᥣ 䮭 梥⮬ + @@: + + call ted_is_select + or al,al + jz .no_select + cmp ted_seln_y0,esi + jg .no_select + cmp ted_seln_y1,esi + jl .no_select + mov edx,ted_color_select ;draw selected line + .no_select: + + mcall SF_DRAW_RECT ;᪠ ப 梥⮬ 䮭 梥⮬ 뤥 + + call ted_is_select + or al,al + jz .no_clear + + mov al,SF_DRAW_RECT + xor cx,cx + add ecx,ted_rec_h + cmp ted_seln_y0,esi + jne @f + push bx esi + mov edx,ted_seln_x0 ; (ࠥ ᫥) + mov esi,ted_scr_h + cmp edx,[esi+sb_offs_position] + jle .in_wnd + sub edx,[esi+sb_offs_position] + imul edx,ted_rec_w + mov bx,dx + jmp .no_wnd + .in_wnd: + xor bx,bx + .no_wnd: + mov edx,ted_color_wnd_work + int 0x40 + pop esi bx + @@: + cmp ted_seln_y1,esi + jne @f + ;push esi + ;᫨ 뤥 䠩 ᤥ 室, ⮣ 㦭 jmp .no_select + mov edx,ted_seln_x1 ; (ࠥ ࠢ) + mov esi,ted_scr_h + cmp edx,[esi+sb_offs_position] + jle .in_wnd2 + sub edx,[esi+sb_offs_position] + imul edx,ted_rec_w + sub bx,dx + shl edx,16 + add ebx,edx + .in_wnd2: + mov edx,ted_color_wnd_work + int 0x40 + ;pop esi + @@: + + .no_clear: + popad + ret +endp + +;input: +; edi = pointer to tedit struct +;output: +; ecx = 梥 ᨬ +; edx = pointer to symbol +; edx = 0 if text not in screen +align 16 +ted_get_first_visible_pos: + push eax ecx + mov eax,ted_scr_w + mov edx,ted_tex + xor ecx,ecx + @@: + cmp ecx,[eax+sb_offs_position] + je @f + call ted_iterat_next + cmp edx,ted_tex_1 + jle @f + cmp byte[edx],13 + jne @b + inc ecx + jmp @b +align 4 + @@: + + cmp ecx,[eax+sb_offs_position] + je @f + xor edx,edx + @@: + cmp ecx,[eax+sb_offs_max_area] + jle @f + mov [eax+sb_offs_max_area],ecx + @@: + pop ecx eax + call ted_opt_draw_line_left + ret + +;input: +; edx = pointer to symbol +; edi = pointer to tedit struct +;output: +; ecx = 梥 ᨬ +; edx = 㪠⥫ ᨬ +;description: +; 㭪 㦭 ⨬樨 뢮 ⥪ +align 16 +proc ted_opt_draw_line_left uses ebx + mov ebx,ted_scr_h + mov ebx,[ebx+sb_offs_position] + or ebx,ebx + jz .ret_f + push eax + mov eax,edx + + cmp edx,ted_tex + jne @f + call ted_iterat_next + jmp .beg_cycle + @@: + + or ebx,ebx + jz @f + + cmp byte[edx],13 + jne @f + call ted_iterat_next + .beg_cycle: + @@: + cmp edx,ted_tex_1 + jle @f + cmp byte[edx],13 + je @f + or ebx,ebx + jz @f +;-------------------------------------- +;eax 㤥 +movzx eax,byte[edx+1] +or eax,eax +jz .no_color +cmp eax,ted_colors_text_count +jge .no_color + movzx ecx,byte[edx+1] + shl ecx,2 + add ecx,ted_text_colors + mov ecx,[ecx] +.no_color: +;-------------------------------------- + mov eax,edx + call ted_iterat_next + dec ebx + jmp @b +align 4 + @@: + mov edx,eax + pop eax + .ret_f: + call ted_get_symb_color + ret +endp + +;input: +; edx = pointer to symbol +; edi = pointer to tedit struct +;output: +; ecx = symbol color +; edx = pointer to 13 symbol +;description: +; 㭪 㦭 ⨬樨 뢮 ⥪ +align 16 +proc ted_opt_draw_line_right uses eax + mov eax,edx + @@: + cmp edx,ted_tex_1 + jle @f + cmp byte[edx],13 + je @f + mov eax,edx + call ted_iterat_next + jmp @b + @@: + mov edx,eax ;perv sumbol + call ted_get_symb_color + ret +endp + +align 16 +proc ted_mouse, edit:dword + pushad + mov edi,[edit] + + ;ࠡ뢠 ஫ + mov edx,ted_scr_h + mov ecx,ted_scr_w + + cmp word[edx+sb_offs_delta2],0 + jne .horizontal + + mov eax,[ecx+sb_offs_max_area] + cmp eax,[ecx+sb_offs_cur_area] + jbe .horizontal + ; mouse event for Vertical ScrollBar + stdcall scroll_bar_vertical.mouse,ecx ;[scrollbar_ver_mouse] + cmp dword[ecx+sb_offs_redraw],0 + je @f + mov dword[ecx+sb_offs_redraw],0 + stdcall ted_draw,edi + jmp .no_in_wnd + @@: + cmp word[ecx+sb_offs_delta2],0 + jne .no_in_wnd + .horizontal: + mov eax,[edx+sb_offs_max_area] + cmp eax,[edx+sb_offs_cur_area] + jbe .other + ; mouse event for Horizontal ScrollBar + stdcall scroll_bar_horizontal.mouse,edx ;[scrollbar_hor_mouse] + cmp dword[edx+sb_offs_redraw],0 + je .other + mov dword[edx+sb_offs_redraw],0 + stdcall ted_draw,edi + jmp .no_in_wnd + .other: + cmp word[ecx+sb_offs_delta2],0 + jne .no_in_wnd + cmp word[edx+sb_offs_delta2],0 + jne .no_in_wnd + + ;ࠡ뢠 । + mcall SF_MOUSE_GET,SSF_BUTTON + cmp al,1 + jne @f + mcall SF_MOUSE_GET,SSF_WINDOW_POSITION + mov ebx,ted_wnd_t + add ebx,ted_rec_t + cmp ax,bx + jl @f ;y_mousey_wnd + + mov ebx,ted_wnd_l + add ebx,ted_rec_l + mov ecx,eax + shr ecx,16 + cmp cx,bx + jl @f ;x_mousex_wnd + + call ted_draw_cursor_sumb + call ted_wnd_main_click + jmp .no_in_wnd + @@: + mov edx,ted_el_focus + cmp [edx],edi + jne @f + call ted_wnd_main_mouse_scroll ;ᬮਬ ப + @@: + cmp ted_drag_m,0 + je .no_in_wnd + mov ted_drag_m,0 + stdcall ted_draw,edi + cmp ted_fun_draw_panel_buttons,0 + je .no_in_wnd + call ted_fun_draw_panel_buttons + .no_in_wnd: + popad + ret +endp + +;input: +; eax -> (x,y) +; edi -> 㪠⥫ tedit +;description: +; 㭪 뢥 ⨨ ஬ । +align 16 +ted_wnd_main_click: + push ebx ecx edx + mov ebx,ted_el_focus + mov [ebx],edi ;⠢ 䮪 + + push eax + shr eax,16 + sub eax,ted_wnd_l + sub eax,ted_rec_l + + xor edx,edx + mov ecx,ted_rec_w + div cx + ;inc eax + mov ebx,ted_scr_h + cmp eax,[ebx+sb_offs_cur_area] + jle @f + mov eax,[ebx+sb_offs_cur_area] + @@: + ;dec eax + mov ted_cur_x,eax + pop eax + + push eax + and eax,0xffff + sub eax,ted_wnd_t + sub eax,ted_rec_t + + xor edx,edx + mov ecx,ted_rec_h + div cx + inc eax + mov ebx,ted_scr_w + cmp eax,[ebx+sb_offs_cur_area] + jle @f + mov eax,[ebx+sb_offs_cur_area] + @@: + dec eax + mov ted_cur_y,eax + pop eax + + cmp ted_drag_m,0 + je @f + call ted_sel_move + jmp .sel_move + @@: + mov ted_drag_m,1 + call ted_sel_start + .sel_move: + pop edx ecx ebx + ret + +;input: +; edi = pointer to tedit struct +align 16 +ted_wnd_main_mouse_scroll: + push eax ebx ecx + mcall SF_MOUSE_GET,SSF_SCROLL_DATA + or ax,ax + jz .no_scroll + mov ecx,ted_scr_w + movsx eax,ax + lea eax,[eax+eax*2] ;㬭 3 (᫮ ப ப⪨ ) + add eax,[ecx+sb_offs_position] + mov ebx,[ecx+sb_offs_max_area] + shl ebx,1 + sub ebx,[ecx+sb_offs_cur_area] ;⭨ + shr ebx,1 + cmp eax,ebx + jae .no_scroll + mov ebx,ted_cur_y ; + sub ebx,eax ;- ஫ + add ebx,[ecx+sb_offs_position] ;+ ஫ + bt ebx,31 + jnc @f + xor ebx,ebx ;᫨ ⠫ , ⠢ ப + @@: + inc ebx + cmp ebx,[ecx+sb_offs_cur_area] + jle @f + mov ebx,[ecx+sb_offs_cur_area] ;᫨ ⠫ , ⠢ ப + @@: + dec ebx + mov ted_cur_y,ebx + mov [ecx+sb_offs_position],eax + stdcall ted_draw,edi + .no_scroll: + pop ecx ebx eax + ret + +align 16 +proc ted_save_file, edit:dword, file:dword, f_name:dword +pushad + mov edi,[edit] + + stdcall ted_can_save,edi + ;or al,al + ;jz .no_save + + mov ecx,ted_max_chars + invoke mem.alloc,ecx + push eax ; 㪠⥫ 뤥 + + mov edx,ted_tex + xor ecx,ecx + @@: + call ted_iterat_next + cmp edx,ted_tex_1 + jle @f ;edx = ted_tex or edx = ted_tex+sizeof.symbol + mov bl,[edx] + mov byte[eax],bl + inc eax + inc ecx + jmp @b +align 4 + @@: + + or ecx,ecx + jz @f + mov ebx,[file] + pop eax ;뢠 㪠⥫ 뤥 + mov [ebx+16],eax + push eax ;⭮ 㪠⥫ 뤥 + mov dword[ebx], SSF_CREATE_FILE + mov dword[ebx+4], 0 + mov dword[ebx+8], 0 + mov [ebx+12], ecx + mov byte[ebx+20], 0 + push dword[f_name] + pop dword[ebx+21] + mcall SF_FILE + + mov ted_err_save,al + + or eax,eax + jz .no_msg + cmp ax,10 + jl .zifra_0_9 + mov al,'?' + sub ax,48 + .zifra_0_9: + add ax,48 + cmp ted_fun_save_err,0 + je @f + call ted_fun_save_err + jmp @f + .no_msg: + m2m ted_tim_ls,ted_tim_ch + @@: + + pop ecx ;뢠 㪠⥫ 뤥 + invoke mem.free,ecx + .no_save: +popad + ret +endp diff --git a/programs/develop/str_double/trunk/str_double.asm b/programs/develop/str_double/trunk/str_double.asm index 79403cc6f..170d433e1 100644 --- a/programs/develop/str_double/trunk/str_double.asm +++ b/programs/develop/str_double/trunk/str_double.asm @@ -1,318 +1,318 @@ -; ணࠬ ८ࠧ ᥫ ப -; ଠ float, double, ⠪ 10 16 筮 -; float. -; ᭮ hex2dec2bin ਬ஢ 䠩 list2_05.inc -; ( 㫠 쥢 24.05.2002), -; ChE । 16 32 ᥬ fasm. -; ணࠬ ⠪ : -; 1) ᫮ ப ॢ 4 (float) 設 -; 2) ᫮ ப ॢ 8 (double) 設 -; 3) ᫮ 設 (float) ॢ ப (5 ᫥ ⮩) - -use32 - org 0 - db 'MENUET01' - dd 1,start,i_end,e_end,e_end,0,sys_path - -include '../../../proc32.inc' -include '../../../macros.inc' -include '../../../KOSfuncs.inc' -include '../../../load_lib.mac' -include '../../../develop/libraries/box_lib/trunk/box_lib.mac' -include '../../../develop/info3ds/info_fun_float.inc' -include 'lang.inc' - -@use_library - -align 4 -start: - load_libraries l_libs_start,l_libs_end - ;஢ઠ ᪮쪮 㤠筮 㧨 ⥪ - mov ebp,lib_0 - cmp dword[ebp+ll_struc_size-4],0 - jz @f - mcall SF_TERMINATE_PROCESS - @@: - mcall SF_SET_EVENTS_MASK,0xC0000027 - mcall SF_STYLE_SETTINGS,SSF_GET_COLORS, sys_colors, sizeof.system_colors - edit_boxes_set_sys_color edit1,editboxes_end,sys_colors - option_boxes_set_sys_color sys_colors,Option_boxes1 - -align 4 -red: - call draw_window - -align 4 -still: - mcall SF_WAIT_EVENT - - cmp eax,1 ; ᮢ ? - je red ; ᫨ - red - cmp eax,2 ; ? - je key ; ᫨ - key - cmp eax,3 ; ? - je button ; ᫨ - button - cmp eax,6 - je mouse - - jmp still ; ᫨ 㣮 ᮡ⨥ - 砫 横 - -align 4 -key: ; - mcall SF_GET_KEY - ;cmp ah,13 - stdcall [edit_box_key], edit1 - jmp still ; 砫 横 - -align 4 -button: - mcall SF_GET_BUTTON - cmp ah, 1 ; ᫨ ஬ 1, - jne @f - mcall SF_TERMINATE_PROCESS - @@: - cmp ah, 5 - jne @f - cmp dword[option_group1],opt3 - jne .opt_3_end - stdcall conv_str_to_int,[edit1.text] - mov dword[Data_Double],eax - finit - fld dword[Data_Double] - fstp qword[Data_Double] - - ; Data_Double - ८ࠧ㥬 ᫮ - mov word[NumberSymbolsAD],8 ; ⢮ ᫠ ᫥ ⮩ (1-17) - call DoubleFloat_to_String - call String_crop_0 - mov dword[Data_Double],eax ;⠭ 祭 ଠ float - jmp .opt_all_end - .opt_3_end: - - mov esi,string1 - mov edi,Data_String - cld - mov ecx,32 - rep movsb - - call String_to_DoubleFloat - cmp dword[option_group1],opt1 - jne .opt_all_end ;᫨ ࠭ float, ८ࠧ㥬 ࠭ 祭 double - finit - fld qword[Data_Double] ;⠥ double - fstp dword[Data_Double] ; 頥 float - .opt_all_end: - jmp red - @@: - jmp still - -align 4 -mouse: - stdcall [edit_box_mouse], edit1 - stdcall [option_box_mouse], Option_boxes1 - jmp still - -;------------------------------------------------ -align 4 -draw_window: - mcall SF_STYLE_SETTINGS,SSF_GET_COLORS, sys_colors, sizeof.system_colors - - mcall SF_REDRAW,SSF_BEGIN_DRAW - mov edx, 0x14000000 - or edx, [sys_colors.work] - mcall SF_CREATE_WINDOW, (200 shl 16)+300, (200 shl 16)+175, ,,title - - mcall SF_DEFINE_BUTTON, ((300-53) shl 16)+38, (145 shl 16)+15, 5, [sys_colors.work_button] ; Ok - - mov ecx, 0x80000000 - or ecx, [sys_colors.work_text] - mcall SF_DRAW_TEXT, (15 shl 16) +30,, binstr, - mcall , (15 shl 16) +58,, decstr, - mcall , ((240-56*3) shl 16) +58,, Data_String, - mcall , (15 shl 16) +72,, hexstr, - mcall , (15 shl 16)+150,, numstr, - - mov ecx, 0x80000000 - or ecx, [sys_colors.work_button_text] - mcall , ((300-42) shl 16)+149, , Okstr,3 - - cmp dword[option_group1],opt1 - je @f ;᫨ ࠭ float, 訥 4 ( double) ⠥ - cmp dword[option_group1],opt3 - je @f ;᫨ ࠭ float, 訥 4 ( double) ⠥ - mov ecx, dword[Data_Double+4] - mcall SF_DRAW_NUMBER, (8 shl 16)+256,,(185 shl 16)+72,[sys_colors.work_text] ; 16- - - mov ecx, dword[Data_Double+4] - mcall ,(8 shl 16)+512,,(240 shl 16)+30, ; 2- - ror ecx, 8 - mcall ,,,((240-56) shl 16)+30, - ror ecx, 8 - mcall ,,,((240-56*2) shl 16)+30, - ror ecx, 8 - mcall ,,,((240-56*3) shl 16)+30, - ror ecx, 8 - @@: - - mov ecx,dword[Data_Double] - mcall SF_DRAW_NUMBER, (8 shl 16)+256,,(240 shl 16)+72,[sys_colors.work_text] ; 16- - - mov ecx,dword[Data_Double] - mcall , (8 shl 16)+512,,(240 shl 16)+44, ; 2- - ror ecx, 8 - mcall ,,,((240-56) shl 16)+44, - ror ecx, 8 - mcall ,,,((240-56*2) shl 16)+44, - ror ecx, 8 - mcall ,,,((240-56*3) shl 16)+44, - ror ecx, 8 - - mcall SF_DRAW_LINE, (15 shl 16)+300-15, (137 shl 16)+137, [sys_colors.work_graph] - stdcall [edit_box_draw], edit1 - stdcall [option_box_draw], Option_boxes1 - mcall SF_REDRAW,SSF_END_DRAW - -ret - - -string1 db 32 dup (0) -string1_end: - - -;input: -; buf - 㪠⥫ ப, ᫮ 10 16 筮 -;output: -; eax - ᫮ -align 4 -proc conv_str_to_int uses ebx ecx esi, buf:dword - xor eax,eax - xor ebx,ebx - mov esi,[buf] - ;। ⥫ ᥫ - xor ecx,ecx - inc ecx - cmp byte[esi],'-' - jne @f - dec ecx - inc esi - @@: - - cmp word[esi],'0x' - je .load_digit_16 - - .load_digit_10: ;뢠 10- - mov bl,byte[esi] - cmp bl,'0' - jl @f - cmp bl,'9' - jg @f - sub bl,'0' - imul eax,10 - add eax,ebx - inc esi - jmp .load_digit_10 - jmp @f - - .load_digit_16: ;뢠 16- - add esi,2 - .cycle_16: - mov bl,byte[esi] - cmp bl,'0' - jl @f - cmp bl,'f' - jg @f - cmp bl,'9' - jle .us1 - cmp bl,'A' - jl @f ;ᥨ ᨬ >'9' <'A' - .us1: ;⠢ ᫮ - cmp bl,'F' - jle .us2 - cmp bl,'a' - jl @f ;ᥨ ᨬ >'F' <'a' - sub bl,32 ;ॢ ᨬ 孨 ॣ, 饭 ᫥饩 ࠡ⪨ - .us2: ;⠢ ᫮ - sub bl,'0' - cmp bl,9 - jle .cor1 - sub bl,7 ;convert 'A' to '10' - .cor1: - shl eax,4 - add eax,ebx - inc esi - jmp .cycle_16 - @@: - cmp ecx,0 ;᫨ ᫮ ⥫쭮 - jne @f - sub ecx,eax - mov eax,ecx - @@: - ret -endp - -;------------------------------------------------- -title db 'string to double 03.01.21',0 -hexstr db 'hex:',0 -decstr db 'dec:',0 -binstr db 'bin:',0 - -if lang eq ru - numstr db '᫮:',0 - Okstr db '',0 -else - numstr db 'Number:',0 - Okstr db 'Ok',0 -end if - -mouse_dd dd 0 -edit1 edit_box 182, 59, 146, 0xffffff, 0xff, 0x80ff, 0, 0x8000, (string1_end-string1), string1, mouse_dd, 0 -editboxes_end: - -;option_boxes -opt1 option_box option_group1, 15, 90, 8, 12, 0xffffff, 0x80ff, 0, op_text.1, 17 -opt2 option_box option_group1, 15, 106, 8, 12, 0xffffff, 0x80ff, 0, op_text.2, 18 -opt3 option_box option_group1, 15, 122, 8, 12, 0xffffff, 0x80ff, 0, op_text.3, 21 - -op_text: ;⥪ ࠤ - .1 db 'str(dec) -> float' - .2 db 'str(dec) -> double' - .3 db 'float(dec,hex) -> str' -;㪠⥫ option_box -option_group1 dd opt1 -Option_boxes1 dd opt1, opt2, opt3, 0 - -system_dir_0 db '/sys/lib/' -lib_name_0 db 'box_lib.obj',0 - - -l_libs_start: - lib_0 l_libs lib_name_0, library_path, system_dir_0,import_box_lib -l_libs_end: - -align 4 -import_box_lib: - ;dd sz_init1 - edit_box_draw dd sz_edit_box_draw - edit_box_key dd sz_edit_box_key - edit_box_mouse dd sz_edit_box_mouse - ;edit_box_set_text dd sz_edit_box_set_text - option_box_draw dd aOption_box_draw - option_box_mouse dd aOption_box_mouse - ;version_op dd aVersion_op -dd 0,0 - ;sz_init1 db 'lib_init',0 - sz_edit_box_draw db 'edit_box_draw',0 - sz_edit_box_key db 'edit_box_key',0 - sz_edit_box_mouse db 'edit_box_mouse',0 - ;sz_edit_box_set_text db 'edit_box_set_text',0 - aOption_box_draw db 'option_box_draw',0 - aOption_box_mouse db 'option_box_mouse',0 - ;aVersion_op db 'version_op',0 - -i_end: - sys_colors system_colors -align 16 - sys_path rb 4096 - library_path rb 4096 - rb 0x400 ;stack -e_end: ; ⪠ ணࠬ +; ணࠬ ८ࠧ ᥫ ப +; ଠ float, double, ⠪ 10 16 筮 +; float. +; ᭮ hex2dec2bin ਬ஢ 䠩 list2_05.inc +; ( 㫠 쥢 24.05.2002), +; ChE । 16 32 ᥬ fasm. +; ணࠬ ⠪ : +; 1) ᫮ ப ॢ 4 (float) 設 +; 2) ᫮ ப ॢ 8 (double) 設 +; 3) ᫮ 設 (float) ॢ ப (5 ᫥ ⮩) + +use32 + org 0 + db 'MENUET01' + dd 1,start,i_end,e_end,e_end,0,sys_path + +include '../../../proc32.inc' +include '../../../macros.inc' +include '../../../KOSfuncs.inc' +include '../../../load_lib.mac' +include '../../../develop/libraries/box_lib/trunk/box_lib.mac' +include '../../../develop/info3ds/info_fun_float.inc' +include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US. + +@use_library + +align 4 +start: + load_libraries l_libs_start,l_libs_end + ;஢ઠ ᪮쪮 㤠筮 㧨 ⥪ + mov ebp,lib_0 + cmp dword[ebp+ll_struc_size-4],0 + jz @f + mcall SF_TERMINATE_PROCESS + @@: + mcall SF_SET_EVENTS_MASK,0xC0000027 + mcall SF_STYLE_SETTINGS,SSF_GET_COLORS, sys_colors, sizeof.system_colors + edit_boxes_set_sys_color edit1,editboxes_end,sys_colors + option_boxes_set_sys_color sys_colors,Option_boxes1 + +align 4 +red: + call draw_window + +align 4 +still: + mcall SF_WAIT_EVENT + + cmp eax,1 ; ᮢ ? + je red ; ᫨ - red + cmp eax,2 ; ? + je key ; ᫨ - key + cmp eax,3 ; ? + je button ; ᫨ - button + cmp eax,6 + je mouse + + jmp still ; ᫨ 㣮 ᮡ⨥ - 砫 横 + +align 4 +key: ; + mcall SF_GET_KEY + ;cmp ah,13 + stdcall [edit_box_key], edit1 + jmp still ; 砫 横 + +align 4 +button: + mcall SF_GET_BUTTON + cmp ah, 1 ; ᫨ ஬ 1, + jne @f + mcall SF_TERMINATE_PROCESS + @@: + cmp ah, 5 + jne @f + cmp dword[option_group1],opt3 + jne .opt_3_end + stdcall conv_str_to_int,[edit1.text] + mov dword[Data_Double],eax + finit + fld dword[Data_Double] + fstp qword[Data_Double] + + ; Data_Double - ८ࠧ㥬 ᫮ + mov word[NumberSymbolsAD],8 ; ⢮ ᫠ ᫥ ⮩ (1-17) + call DoubleFloat_to_String + call String_crop_0 + mov dword[Data_Double],eax ;⠭ 祭 ଠ float + jmp .opt_all_end + .opt_3_end: + + mov esi,string1 + mov edi,Data_String + cld + mov ecx,32 + rep movsb + + call String_to_DoubleFloat + cmp dword[option_group1],opt1 + jne .opt_all_end ;᫨ ࠭ float, ८ࠧ㥬 ࠭ 祭 double + finit + fld qword[Data_Double] ;⠥ double + fstp dword[Data_Double] ; 頥 float + .opt_all_end: + jmp red + @@: + jmp still + +align 4 +mouse: + stdcall [edit_box_mouse], edit1 + stdcall [option_box_mouse], Option_boxes1 + jmp still + +;------------------------------------------------ +align 4 +draw_window: + mcall SF_STYLE_SETTINGS,SSF_GET_COLORS, sys_colors, sizeof.system_colors + + mcall SF_REDRAW,SSF_BEGIN_DRAW + mov edx, 0x14000000 + or edx, [sys_colors.work] + mcall SF_CREATE_WINDOW, (200 shl 16)+300, (200 shl 16)+175, ,,title + + mcall SF_DEFINE_BUTTON, ((300-53) shl 16)+38, (145 shl 16)+15, 5, [sys_colors.work_button] ; Ok + + mov ecx, 0x80000000 + or ecx, [sys_colors.work_text] + mcall SF_DRAW_TEXT, (15 shl 16) +30,, binstr, + mcall , (15 shl 16) +58,, decstr, + mcall , ((240-56*3) shl 16) +58,, Data_String, + mcall , (15 shl 16) +72,, hexstr, + mcall , (15 shl 16)+150,, numstr, + + mov ecx, 0x80000000 + or ecx, [sys_colors.work_button_text] + mcall , ((300-42) shl 16)+149, , Okstr,3 + + cmp dword[option_group1],opt1 + je @f ;᫨ ࠭ float, 訥 4 ( double) ⠥ + cmp dword[option_group1],opt3 + je @f ;᫨ ࠭ float, 訥 4 ( double) ⠥ + mov ecx, dword[Data_Double+4] + mcall SF_DRAW_NUMBER, (8 shl 16)+256,,(185 shl 16)+72,[sys_colors.work_text] ; 16- + + mov ecx, dword[Data_Double+4] + mcall ,(8 shl 16)+512,,(240 shl 16)+30, ; 2- + ror ecx, 8 + mcall ,,,((240-56) shl 16)+30, + ror ecx, 8 + mcall ,,,((240-56*2) shl 16)+30, + ror ecx, 8 + mcall ,,,((240-56*3) shl 16)+30, + ror ecx, 8 + @@: + + mov ecx,dword[Data_Double] + mcall SF_DRAW_NUMBER, (8 shl 16)+256,,(240 shl 16)+72,[sys_colors.work_text] ; 16- + + mov ecx,dword[Data_Double] + mcall , (8 shl 16)+512,,(240 shl 16)+44, ; 2- + ror ecx, 8 + mcall ,,,((240-56) shl 16)+44, + ror ecx, 8 + mcall ,,,((240-56*2) shl 16)+44, + ror ecx, 8 + mcall ,,,((240-56*3) shl 16)+44, + ror ecx, 8 + + mcall SF_DRAW_LINE, (15 shl 16)+300-15, (137 shl 16)+137, [sys_colors.work_graph] + stdcall [edit_box_draw], edit1 + stdcall [option_box_draw], Option_boxes1 + mcall SF_REDRAW,SSF_END_DRAW + +ret + + +string1 db 32 dup (0) +string1_end: + + +;input: +; buf - 㪠⥫ ப, ᫮ 10 16 筮 +;output: +; eax - ᫮ +align 4 +proc conv_str_to_int uses ebx ecx esi, buf:dword + xor eax,eax + xor ebx,ebx + mov esi,[buf] + ;। ⥫ ᥫ + xor ecx,ecx + inc ecx + cmp byte[esi],'-' + jne @f + dec ecx + inc esi + @@: + + cmp word[esi],'0x' + je .load_digit_16 + + .load_digit_10: ;뢠 10- + mov bl,byte[esi] + cmp bl,'0' + jl @f + cmp bl,'9' + jg @f + sub bl,'0' + imul eax,10 + add eax,ebx + inc esi + jmp .load_digit_10 + jmp @f + + .load_digit_16: ;뢠 16- + add esi,2 + .cycle_16: + mov bl,byte[esi] + cmp bl,'0' + jl @f + cmp bl,'f' + jg @f + cmp bl,'9' + jle .us1 + cmp bl,'A' + jl @f ;ᥨ ᨬ >'9' <'A' + .us1: ;⠢ ᫮ + cmp bl,'F' + jle .us2 + cmp bl,'a' + jl @f ;ᥨ ᨬ >'F' <'a' + sub bl,32 ;ॢ ᨬ 孨 ॣ, 饭 ᫥饩 ࠡ⪨ + .us2: ;⠢ ᫮ + sub bl,'0' + cmp bl,9 + jle .cor1 + sub bl,7 ;convert 'A' to '10' + .cor1: + shl eax,4 + add eax,ebx + inc esi + jmp .cycle_16 + @@: + cmp ecx,0 ;᫨ ᫮ ⥫쭮 + jne @f + sub ecx,eax + mov eax,ecx + @@: + ret +endp + +;------------------------------------------------- +title db 'string to double 03.01.21',0 +hexstr db 'hex:',0 +decstr db 'dec:',0 +binstr db 'bin:',0 + +if lang eq ru_RU + numstr db '᫮:',0 + Okstr db '',0 +else ; Default to en_US + numstr db 'Number:',0 + Okstr db 'Ok',0 +end if + +mouse_dd dd 0 +edit1 edit_box 182, 59, 146, 0xffffff, 0xff, 0x80ff, 0, 0x8000, (string1_end-string1), string1, mouse_dd, 0 +editboxes_end: + +;option_boxes +opt1 option_box option_group1, 15, 90, 8, 12, 0xffffff, 0x80ff, 0, op_text.1, 17 +opt2 option_box option_group1, 15, 106, 8, 12, 0xffffff, 0x80ff, 0, op_text.2, 18 +opt3 option_box option_group1, 15, 122, 8, 12, 0xffffff, 0x80ff, 0, op_text.3, 21 + +op_text: ;⥪ ࠤ + .1 db 'str(dec) -> float' + .2 db 'str(dec) -> double' + .3 db 'float(dec,hex) -> str' +;㪠⥫ option_box +option_group1 dd opt1 +Option_boxes1 dd opt1, opt2, opt3, 0 + +system_dir_0 db '/sys/lib/' +lib_name_0 db 'box_lib.obj',0 + + +l_libs_start: + lib_0 l_libs lib_name_0, library_path, system_dir_0,import_box_lib +l_libs_end: + +align 4 +import_box_lib: + ;dd sz_init1 + edit_box_draw dd sz_edit_box_draw + edit_box_key dd sz_edit_box_key + edit_box_mouse dd sz_edit_box_mouse + ;edit_box_set_text dd sz_edit_box_set_text + option_box_draw dd aOption_box_draw + option_box_mouse dd aOption_box_mouse + ;version_op dd aVersion_op +dd 0,0 + ;sz_init1 db 'lib_init',0 + sz_edit_box_draw db 'edit_box_draw',0 + sz_edit_box_key db 'edit_box_key',0 + sz_edit_box_mouse db 'edit_box_mouse',0 + ;sz_edit_box_set_text db 'edit_box_set_text',0 + aOption_box_draw db 'option_box_draw',0 + aOption_box_mouse db 'option_box_mouse',0 + ;aVersion_op db 'version_op',0 + +i_end: + sys_colors system_colors +align 16 + sys_path rb 4096 + library_path rb 4096 + rb 0x400 ;stack +e_end: ; ⪠ ணࠬ diff --git a/programs/fs/copyr/trunk/copyr.asm b/programs/fs/copyr/trunk/copyr.asm index 97d570dbc..065c297d6 100644 --- a/programs/fs/copyr/trunk/copyr.asm +++ b/programs/fs/copyr/trunk/copyr.asm @@ -8,7 +8,7 @@ ; ; ; On base SYSTREE FILE COPIER 1.02 ; ; Ivan Poddubny ivan-yar@bk.ru ; -; ; +; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ண 筠 㦥 ࠡ⠥ @@ -23,11 +23,11 @@ dd 0x10000 ; esp dd param_area , 0x0 ; I_Param , I_Icon -include 'lang.inc' -include '..\..\..\macros.inc' ; very useful stuff for MeOS +include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US. +include '..\..\..\macros.inc' ; very useful stuff for MeOS include 'ascl.inc' -START: ; start of execution +START: ; start of execution ; ࠬ: ; db n1 = 筨 @@ -187,7 +187,7 @@ draw_window: mov edi,labelt ; WINDOW LABEL mcall - + mov eax,8 mov ebx,105*65536+290 mov ecx,33*65536+12 @@ -236,7 +236,7 @@ draw_window: ya dd 0x0 temp dd 0 -if lang eq ru +if lang eq ru_RU text: db ' : |, ⨭, ᪢ , 1 ' db ' : | 設 , waptap@mail.ru ' @@ -264,12 +264,13 @@ errors: db "() ⭠ 訡 " db " 筨 ਥ 㪠!!! " db " ਥ 㪠!!! " -else + +else ; Default to en_US text: db 'SOURCE: | ' db 'DESTINATION: | ' db ' ' - db 'x' ; <- END MARKER, DONT DELETE + db 'x' ; <- END MARKER, DO NOT DELETE labelt: db 'SYSTREE FILE COPIER' labellen: @@ -292,6 +293,7 @@ errors: db "(write) unknown error " db "Path to source is not given!!! " db "Path to destination is not given!!! " + end if ;0123456789012345678901234567890123456789012 diff --git a/programs/games/megamaze/trunk/wriggle.inc b/programs/games/megamaze/trunk/wriggle.inc index a48de5aa8..aa5ed1ad4 100644 --- a/programs/games/megamaze/trunk/wriggle.inc +++ b/programs/games/megamaze/trunk/wriggle.inc @@ -233,7 +233,7 @@ WG_mouse: WG_level: file 'wriggle.bin' -if lang eq ru +if lang eq ru_RU WG_help mstr \ ' - 类 ',\ '墮, ஥ ⪨',\ @@ -241,7 +241,7 @@ if lang eq ru '直 ४뢠 ᥪ ',\ '㣠.','',\ 'http://www.clickmazes.com' -else +else ; Default to en_US WG_help mstr \ 'Your aim is to drag the wriggley worms by head or',\ 'tail until each worm covers the squares of its',\ diff --git a/programs/system/calendar/trunk/data.inc b/programs/system/calendar/trunk/data.inc index 774d4f412..6bca6bcb9 100644 --- a/programs/system/calendar/trunk/data.inc +++ b/programs/system/calendar/trunk/data.inc @@ -1,321 +1,323 @@ -; program data - -curMonth dd ? -curYear dd ? -curDay dd ? - -remainder dd ? -quotient dd ? - -firstday dd ? -Year dd ? -Month dd ? -day_sel dd ? - -datestr dd ? -leap_year dd ? -number dd ? - -; colors -COL_WINDOW_BG equ 0x54E7E7E7 -COL_TOOLBAR_BG equ 0x555555 -COL_ACTIVE_TEXT equ 0x10e7c750 -COL_WEEKDAY_BG equ 0xCCCDDD -COL_DATE_BUTTONS equ 0xF3F3F3 -COL_TIME_BUTTONS equ 0x5555dd -COL_GO_TODAY_T equ 0xd048c8 -COL_MONTH_YEAR_B equ 0x555555 -COL_DROPDOWN_BG equ 0x666666 -COL_DROPDOWN_T equ 0x10CCCccc -COL_NEW_STYLE_T equ 0xef3333 - -COL_DATE_INACTIVE_1 equ 0x388CAF -COL_DATE_INACTIVE_2 equ 0x75B9D5 -COL_DATE_INACTIVE_3 equ 0x9ECBDF -COL_DATE_INACTIVE_4 equ 0xABD7E8 - -COL_DATE_ACTIVE_1 equ 0xA57F2C -COL_DATE_ACTIVE_2 equ 0xEFB52D -COL_DATE_ACTIVE_3 equ 0xFAD84C -COL_DATE_ACTIVE_4 equ 0xFAE995 - -COL_DATE_1 equ 0x8C8C8C -COL_DATE_2 equ 0xFFFfff -COL_DATE_3 equ 0xF2F2F2 -COL_DATE_4 equ 0xF2F2F2 - -; definitions -WIN_W equ 275 -WIN_H equ 326 - -DATE_BUTTON_WIDTH equ 32 -DATE_BUTTON_HEIGHT equ 30 - - -LINE1 equ 27 shl 16+16 -B_MONTH_X equ 15 shl 16+158 -B_Y equ LINE1 -B_MONTH equ 63 shl 16+27 - -BT_WBAR_Y equ 283 shl 16+43 - -B_WBAR_X equ 1 shl 16+WIN_W-1 -B_WBAR_Y equ 64 shl 16+20 -B_WEEK equ 34 shl 16+66 -B_WX_SHIFT equ 32 shl 16 - -B_DROP equ B_MONTH+16 -B_DAYS_Y equ 106 -B_DAYS_SHIFT equ 30 - -B_YEAR equ 204 shl 16+28 - -B_SPIN_X equ 186 shl 16+12 -B_SPIN equ 188 shl 16+28 -spinner db '< >' - -B_TODAY_X equ 25 shl 16 -B_TODAY_Y equ 48 shl 16+10 -B_TODAY equ 30 shl 16+50 - -B_NS_X equ 185 shl 16+75 -B_NS_Y equ 48 shl 16+10 -B_NS equ 190 shl 16+50 - -FOCUSABLE equ 4 - -; multilanguage interface - configuratable in lang.inc -day_count db 3,0,3,2,3,2,3,3,2,3,2,3 -Fkeys db 210,211,212,213,214,215,216,217,208,209,228,159 - -month_name: -if lang eq ru - db 8 - db ' ' - db 'ࠫ ' - db ' ' - db '५ ' - db ' ' - db ' ' - db ' ' - db ' ' - db '' - db ' ' - db ' ' - db ' ' -else if lang eq de - db 9 - db 'Januar ' - db 'Februar ' - db 'M+rz ' - db 'April ' - db 'Mai ' - db 'Juni ' - db 'Juli ' - db 'August ' - db 'September' - db 'Oktober ' - db 'November ' - db 'Dezember ' -else if lang eq fr - db 9 - db 'Janvier ' - db 'Fevrier ' - db 'Mars ' - db 'Avril ' - db 'Mai ' - db 'Juin ' - db 'Juliet ' - db 'Aout ' - db 'Septembre' - db 'Octobre ' - db 'Novembre ' - db 'Decembre ' -else if lang eq fi - db 9 - db 'Tammikuu ' - db 'Helmikuu ' - db 'Maaliskuu' - db 'Huhtikuu ' - db 'Toukokuu ' - db 'Kes+kuu ' - db 'Hein+kuu ' - db 'Elokuu ' - db 'Syyskuu ' - db 'Lokakuu ' - db 'Marraskuu' - db 'Joulukuu ' -else if lang eq et - db 9 - db 'Jaanuar ' - db 'Veebruar ' - db 'Mrts ' - db 'Aprill ' - db 'Mai ' - db 'Juuni ' - db 'Juuli ' - db 'August ' - db 'September' - db 'Oktoober ' - db 'November ' - db 'Detsember' -else if lang eq it - db 9 - db 'Gennaio ' - db 'Febbraio ' - db 'Marzo ' - db 'Aprile ' - db 'Maggio ' - db 'Giugno ' - db 'Luglio ' - db 'Agosto ' - db 'Settembre' - db 'Ottobre ' - db 'Novembre ' - db 'Dicembre ' -else - db 9 - db 'January ' - db 'February ' - db 'March ' - db 'April ' - db 'May ' - db 'June ' - db 'July ' - db 'August ' - db 'September' - db 'October ' - db 'November ' - db 'December ' -end if -week_days: -if lang eq ru - db 2 - db 1 - db '' - db '' - db '' - db '' - db '' - db '' - db '' -else if lang eq de - db 2 - db 7 - db 'So' - db 'Mo' - db 'Di' - db 'Mi' - db 'Do' - db 'Fr' - db 'Sa' -else if lang eq fr - db 3 - db 7 - db 'Dim' - db 'Lun' - db 'Mar' - db 'Mer' - db 'Jeu' - db 'Ven' - db 'Sam' -else if lang eq fi - db 2 - db 7 - db 'Su' - db 'Ma' - db 'Ti' - db 'Ke' - db 'To' - db 'Pe' - db 'La' -else if lang eq et - db 3 - db 7 - db 'Esm' - db 'Tei' - db 'Kol' - db 'Nel' - db 'Ree' - db 'Lau' - db 'Ph' -else if lang eq it - db 3 - db 7 - db 'Dom' - db 'Lun' - db 'Mar' - db 'Mer' - db 'Gio' - db 'Ven' - db 'Sab' -else - db 3 - db 7 - db 'Sun' - db 'Mon' - db 'Tue' - db 'Wed' - db 'Thu' - db 'Fri' - db 'Sat' -end if - -title: -if lang eq ru - db '',0 -else if lang eq ge - db 'Kalender',0 -else if lang eq fr - db 'Calendrier',0 -else if lang eq et - db 'Kalender',0 -else if lang eq it - db 'Calendario',0 -else - db 'Calendar',0 -end if - -today_msg: -if lang eq ru - db '' -else if lang eq ge - db 'Heute' -else if lang eq fr - db "Aujourd'hui" -else if lang eq et - db 'Tna' -else if lang eq it - db 'Oggi' -else - db 'Today' -end if -today_end: -focus dd 3 -new_style dd 1 -dropped db 0 - -sys_text: -if lang eq ru - db '६',0 -else if lang eq it - db ' Ora',0 -else if lang eq et - db ' Aeg ',0 -else - db ' Time',0 -end if -separator db ':',0 -plus db '+',0 -minus db '-',0 -set_date_t: -if lang eq ru - db '⠭ ',0 -else if lang eq it - db ' Impostazioni ',0 -else if lang eq et - db ' Mra kuupev ',0 -else - db ' Set date ',0 -end if - +; program data + +curMonth dd ? +curYear dd ? +curDay dd ? + +remainder dd ? +quotient dd ? + +firstday dd ? +Year dd ? +Month dd ? +day_sel dd ? + +datestr dd ? +leap_year dd ? +number dd ? + +; colors +COL_WINDOW_BG equ 0x54E7E7E7 +COL_TOOLBAR_BG equ 0x555555 +COL_ACTIVE_TEXT equ 0x10e7c750 +COL_WEEKDAY_BG equ 0xCCCDDD +COL_DATE_BUTTONS equ 0xF3F3F3 +COL_TIME_BUTTONS equ 0x5555dd +COL_GO_TODAY_T equ 0xd048c8 +COL_MONTH_YEAR_B equ 0x555555 +COL_DROPDOWN_BG equ 0x666666 +COL_DROPDOWN_T equ 0x10CCCccc +COL_NEW_STYLE_T equ 0xef3333 + +COL_DATE_INACTIVE_1 equ 0x388CAF +COL_DATE_INACTIVE_2 equ 0x75B9D5 +COL_DATE_INACTIVE_3 equ 0x9ECBDF +COL_DATE_INACTIVE_4 equ 0xABD7E8 + +COL_DATE_ACTIVE_1 equ 0xA57F2C +COL_DATE_ACTIVE_2 equ 0xEFB52D +COL_DATE_ACTIVE_3 equ 0xFAD84C +COL_DATE_ACTIVE_4 equ 0xFAE995 + +COL_DATE_1 equ 0x8C8C8C +COL_DATE_2 equ 0xFFFfff +COL_DATE_3 equ 0xF2F2F2 +COL_DATE_4 equ 0xF2F2F2 + +; definitions +WIN_W equ 275 +WIN_H equ 326 + +DATE_BUTTON_WIDTH equ 32 +DATE_BUTTON_HEIGHT equ 30 + + +LINE1 equ 27 shl 16+16 +B_MONTH_X equ 15 shl 16+158 +B_Y equ LINE1 +B_MONTH equ 63 shl 16+27 + +BT_WBAR_Y equ 283 shl 16+43 + +B_WBAR_X equ 1 shl 16+WIN_W-1 +B_WBAR_Y equ 64 shl 16+20 +B_WEEK equ 34 shl 16+66 +B_WX_SHIFT equ 32 shl 16 + +B_DROP equ B_MONTH+16 +B_DAYS_Y equ 106 +B_DAYS_SHIFT equ 30 + +B_YEAR equ 204 shl 16+28 + +B_SPIN_X equ 186 shl 16+12 +B_SPIN equ 188 shl 16+28 +spinner db '< >' + +B_TODAY_X equ 25 shl 16 +B_TODAY_Y equ 48 shl 16+10 +B_TODAY equ 30 shl 16+50 + +B_NS_X equ 185 shl 16+75 +B_NS_Y equ 48 shl 16+10 +B_NS equ 190 shl 16+50 + +FOCUSABLE equ 4 + +day_count db 3,0,3,2,3,2,3,3,2,3,2,3 +Fkeys db 210,211,212,213,214,215,216,217,208,209,228,159 + +; Multilanguage interface - configurable in lang.inc +; Language support for locales: ru_RU (CP866), de_DE, fr_FR, fi_FI, et_ES, it_IT, en_US + +month_name: +if lang eq ru_RU + db 8 + db ' ' + db 'ࠫ ' + db ' ' + db '५ ' + db ' ' + db ' ' + db ' ' + db ' ' + db '' + db ' ' + db ' ' + db ' ' +else if lang eq de_DE + db 9 + db 'Januar ' + db 'Februar ' + db 'M+rz ' + db 'April ' + db 'Mai ' + db 'Juni ' + db 'Juli ' + db 'August ' + db 'September' + db 'Oktober ' + db 'November ' + db 'Dezember ' +else if lang eq fr_FR + db 9 + db 'Janvier ' + db 'Fevrier ' + db 'Mars ' + db 'Avril ' + db 'Mai ' + db 'Juin ' + db 'Juliet ' + db 'Aout ' + db 'Septembre' + db 'Octobre ' + db 'Novembre ' + db 'Decembre ' +else if lang eq fi_FI + db 9 + db 'Tammikuu ' + db 'Helmikuu ' + db 'Maaliskuu' + db 'Huhtikuu ' + db 'Toukokuu ' + db 'Kes+kuu ' + db 'Hein+kuu ' + db 'Elokuu ' + db 'Syyskuu ' + db 'Lokakuu ' + db 'Marraskuu' + db 'Joulukuu ' +else if lang eq et_EE + db 9 + db 'Jaanuar ' + db 'Veebruar ' + db 'Mrts ' + db 'Aprill ' + db 'Mai ' + db 'Juuni ' + db 'Juuli ' + db 'August ' + db 'September' + db 'Oktoober ' + db 'November ' + db 'Detsember' +else if lang eq it_IT + db 9 + db 'Gennaio ' + db 'Febbraio ' + db 'Marzo ' + db 'Aprile ' + db 'Maggio ' + db 'Giugno ' + db 'Luglio ' + db 'Agosto ' + db 'Settembre' + db 'Ottobre ' + db 'Novembre ' + db 'Dicembre ' +else ; Default to en_US + db 9 + db 'January ' + db 'February ' + db 'March ' + db 'April ' + db 'May ' + db 'June ' + db 'July ' + db 'August ' + db 'September' + db 'October ' + db 'November ' + db 'December ' +end if +week_days: +if lang eq ru_RU + db 2 + db 1 + db '' + db '' + db '' + db '' + db '' + db '' + db '' +else if lang eq de_DE + db 2 + db 7 + db 'So' + db 'Mo' + db 'Di' + db 'Mi' + db 'Do' + db 'Fr' + db 'Sa' +else if lang eq fr_FR + db 3 + db 7 + db 'Dim' + db 'Lun' + db 'Mar' + db 'Mer' + db 'Jeu' + db 'Ven' + db 'Sam' +else if lang eq fi_FI + db 2 + db 7 + db 'Su' + db 'Ma' + db 'Ti' + db 'Ke' + db 'To' + db 'Pe' + db 'La' +else if lang eq et_EE + db 3 + db 7 + db 'Esm' + db 'Tei' + db 'Kol' + db 'Nel' + db 'Ree' + db 'Lau' + db 'Ph' +else if lang eq it_IT + db 3 + db 7 + db 'Dom' + db 'Lun' + db 'Mar' + db 'Mer' + db 'Gio' + db 'Ven' + db 'Sab' +else ; Default to en_US + db 3 + db 7 + db 'Sun' + db 'Mon' + db 'Tue' + db 'Wed' + db 'Thu' + db 'Fri' + db 'Sat' +end if + +title: +if lang eq ru_RU + db '',0 +else if lang eq de_DE + db 'Kalender',0 +else if lang eq fr_FR + db 'Calendrier',0 +else if lang eq et_EE + db 'Kalender',0 +else if lang eq it_IT + db 'Calendario',0 +else ; Default to en_US + db 'Calendar',0 +end if + +today_msg: +if lang eq ru_RU + db '' +else if lang eq de_DE + db 'Heute' +else if lang eq fr_FR + db "Aujourd'hui" +else if lang eq et_EE + db 'Tna' +else if lang eq it_IT + db 'Oggi' +else ; Default to en_US + db 'Today' +end if +today_end: +focus dd 3 +new_style dd 1 +dropped db 0 + +sys_text: +if lang eq ru_RU + db '६',0 +else if lang eq it_IT + db ' Ora',0 +else if lang eq et_EE + db ' Aeg ',0 +else ; Default to en_US + db ' Time',0 +end if +separator db ':',0 +plus db '+',0 +minus db '-',0 + +set_date_t: +if lang eq ru_RU + db '⠭ ',0 +else if lang eq it_IT + db ' Impostazioni ',0 +else if lang eq et_EE + db ' Mra kuupev ',0 +else ; Default to en_US + db ' Set date ',0 +end if diff --git a/programs/system/docpack/trunk/docpack.asm b/programs/system/docpack/trunk/docpack.asm index ae1d91377..d02dd3530 100755 --- a/programs/system/docpack/trunk/docpack.asm +++ b/programs/system/docpack/trunk/docpack.asm @@ -1,227 +1,227 @@ -;--------------------------------------------------------------------- -; -; DOCPAK FOR KOLIBRI v1.2 -; Written in pure assembly by Ivushkin Andrey aka Willow -; -;--------------------------------------------------------------------- - -FILE_COUNT=0 -DEF_FILE equ 'g' - -macro embed_docdir_file fn -{ - forward - local label,label2,label3 - dd label2-label - dd label-label3 - label3: - db fn - label: - file '%DOCDIR%' # fn - label2: - FILE_COUNT=FILE_COUNT+1 -} -macro embed_local_file fn -{ - forward - local label,label2,label3 - dd label2-label - dd label-label3 - label3: - db fn - label: - file fn - label2: - FILE_COUNT=FILE_COUNT+1 -} - - use32 - org 0x0 - db 'MENUET01' ; 8 byte id - dd 0x01 ; header version - dd start ; start of code - dd I_END ; size of image - dd I_END+0x400 ; memory for app - dd I_END+0x400 ; esp - dd my_param , 0x0 ; I_Param , I_Icon -include '../../../macros.inc' -include 'lang.inc' - -start: - cmp [my_param],0 - je red - cmp [my_param],'a' - jb .par_a - cmp [my_param],'z' - jbe .ok2 - .par_a: - mov [my_param],DEF_FILE - .ok2: - movzx ecx,[my_param] - mov [my_param],'*' - .open: - sub ecx,'a'-1 - mov edx,embedded - xor esi,esi - .list: - lea edx,[edx+esi+8] - mov esi,[edx-8] - add edx,[edx-4] - test esi,esi - jz .close - loop .list - push edx -; convert number in esi to decimal representation - mov ecx, 10 - push -'0' - mov eax, esi -@@: - xor edx, edx - div ecx - push edx - test eax, eax - jnz @b - mov edi, fsize -@@: - pop eax - add al, '0' - stosb - jnz @b - mcall 70,fileinfo - mov ecx,eax - mcall 5,20 - pop edx - mcall 60,2 - cmp [my_param],'*' - jne still - .close: - mcall -1 - -red: - mov [my_param],'a' - - mcall 48, 3, sc, sizeof.system_colors - - mcall 12,1 - -BTN_H equ 21 - - mov edx,[sc.work] - or edx,0x34000000 - mcall 0, <220,141>, <30,FILECOUNT*(BTN_H+3)+37>, , ,title - - mov ecx,FILECOUNT - mov ebx,23 shl 16+100 - mov esi,[sc.work_button] - mov edi,5 shl 16+BTN_H - mov edx,10 - mov eax,8 - .btnlp: - push ecx - mcall ,,edi - add edi,(BTN_H+3) shl 16 - inc edx - pop ecx - loop .btnlp - mov ecx,FILECOUNT - mov edx,embedded - xor edi,edi - mov ebx,30 shl 16+8 - mov eax,4 - .list: - lea edx,[edx+edi+8] - mov edi,[edx-8] - pusha - sub ebx,20 shl 16 - mov ecx, [sc.work_text] - or ecx, 0x30000000 - mcall ,,,my_param,1 - inc [my_param] - popa - push ecx - mov esi, [edx-4] - sub esi, 4 ;remove .txt extension - mov ecx, [sc.work_button_text] - or ecx, 0x30000000 - mcall - pop ecx - add esi, 4 - add edx, esi - add ebx,(BTN_H+3) - loop .list - mcall 12,2 - -still: - mcall 10 - cmp eax,1 - je red - cmp eax,2 - jne .nokey - mcall 2 - cmp ah,27 ;Esc - je start.close - cmp ah,'a' - jb still - cmp ah,'a'+FILECOUNT - jae still - jmp .cxax - .nokey: - mcall 17 - cmp ah,1 - je start.close - sub ah,10-'a' - .cxax: - movzx ecx,ah - jmp start.open - -fileinfo: - dd 7 - dd 0 - dd param - dd 0 ,0 - db '/sys/TINYPAD',0 - -param db '*' -fsize: - times 10 db '0' - db 0 - -embedded: - -; Please use only filenames w/o path! - -; -- Start of embedding area ------ - embed_docdir_file 'CREDITS.TXT' ;a -if lang eq ru_RU - embed_docdir_file 'GNU.TXT' ;b -else - embed_docdir_file 'COPYING.TXT' ;b -end if - embed_docdir_file 'HOT_KEYS.TXT' ;c - embed_local_file 'FASM.TXT' ;d - embed_docdir_file 'MTDBG.TXT' ;e -if lang eq ru_RU - embed_local_file 'SYSFUNCR.TXT' ;f -else - embed_local_file 'SYSFUNCS.TXT' ;f -end if - embed_local_file 'STACK.TXT' ;g - embed_docdir_file 'KFAR_KEYS.TXT' ;h - embed_docdir_file 'INI.TXT' ;i - embed_docdir_file 'OPENDIAL.TXT' ;j -; -- End of embedding area ------- - - dd 0 -FILECOUNT = FILE_COUNT - - if ~ FILECOUNT>0 - error 'No embedded files' - end if - -my_param db 0 - rb 256 -I_END: - -title db 'Doc Pack',0 - -sc system_colors +;--------------------------------------------------------------------- +; +; DOCPAK FOR KOLIBRI v1.2 +; Written in pure assembly by Ivushkin Andrey aka Willow +; +;--------------------------------------------------------------------- + +FILE_COUNT=0 +DEF_FILE equ 'g' + +macro embed_docdir_file fn +{ + forward + local label,label2,label3 + dd label2-label + dd label-label3 + label3: + db fn + label: + file '%DOCDIR%' # fn + label2: + FILE_COUNT=FILE_COUNT+1 +} +macro embed_local_file fn +{ + forward + local label,label2,label3 + dd label2-label + dd label-label3 + label3: + db fn + label: + file fn + label2: + FILE_COUNT=FILE_COUNT+1 +} + + use32 + org 0x0 + db 'MENUET01' ; 8 byte id + dd 0x01 ; header version + dd start ; start of code + dd I_END ; size of image + dd I_END+0x400 ; memory for app + dd I_END+0x400 ; esp + dd my_param , 0x0 ; I_Param , I_Icon +include '../../../macros.inc' +include 'lang.inc' ; Language support for locales: ru_RU, en_US. + +start: + cmp [my_param],0 + je red + cmp [my_param],'a' + jb .par_a + cmp [my_param],'z' + jbe .ok2 + .par_a: + mov [my_param],DEF_FILE + .ok2: + movzx ecx,[my_param] + mov [my_param],'*' + .open: + sub ecx,'a'-1 + mov edx,embedded + xor esi,esi + .list: + lea edx,[edx+esi+8] + mov esi,[edx-8] + add edx,[edx-4] + test esi,esi + jz .close + loop .list + push edx +; convert number in esi to decimal representation + mov ecx, 10 + push -'0' + mov eax, esi +@@: + xor edx, edx + div ecx + push edx + test eax, eax + jnz @b + mov edi, fsize +@@: + pop eax + add al, '0' + stosb + jnz @b + mcall 70,fileinfo + mov ecx,eax + mcall 5,20 + pop edx + mcall 60,2 + cmp [my_param],'*' + jne still + .close: + mcall -1 + +red: + mov [my_param],'a' + + mcall 48, 3, sc, sizeof.system_colors + + mcall 12,1 + +BTN_H equ 21 + + mov edx,[sc.work] + or edx,0x34000000 + mcall 0, <220,141>, <30,FILECOUNT*(BTN_H+3)+37>, , ,title + + mov ecx,FILECOUNT + mov ebx,23 shl 16+100 + mov esi,[sc.work_button] + mov edi,5 shl 16+BTN_H + mov edx,10 + mov eax,8 + .btnlp: + push ecx + mcall ,,edi + add edi,(BTN_H+3) shl 16 + inc edx + pop ecx + loop .btnlp + mov ecx,FILECOUNT + mov edx,embedded + xor edi,edi + mov ebx,30 shl 16+8 + mov eax,4 + .list: + lea edx,[edx+edi+8] + mov edi,[edx-8] + pusha + sub ebx,20 shl 16 + mov ecx, [sc.work_text] + or ecx, 0x30000000 + mcall ,,,my_param,1 + inc [my_param] + popa + push ecx + mov esi, [edx-4] + sub esi, 4 ;remove .txt extension + mov ecx, [sc.work_button_text] + or ecx, 0x30000000 + mcall + pop ecx + add esi, 4 + add edx, esi + add ebx,(BTN_H+3) + loop .list + mcall 12,2 + +still: + mcall 10 + cmp eax,1 + je red + cmp eax,2 + jne .nokey + mcall 2 + cmp ah,27 ;Esc + je start.close + cmp ah,'a' + jb still + cmp ah,'a'+FILECOUNT + jae still + jmp .cxax + .nokey: + mcall 17 + cmp ah,1 + je start.close + sub ah,10-'a' + .cxax: + movzx ecx,ah + jmp start.open + +fileinfo: + dd 7 + dd 0 + dd param + dd 0 ,0 + db '/sys/TINYPAD',0 + +param db '*' +fsize: + times 10 db '0' + db 0 + +embedded: + +; Please use only filenames w/o path! + +; -- Start of embedding area ------ + embed_docdir_file 'CREDITS.TXT' ;a +if lang eq ru_RU + embed_docdir_file 'GNU.TXT' ;b +else ; Default to en_US + embed_docdir_file 'COPYING.TXT' ;b +end if + embed_docdir_file 'HOT_KEYS.TXT' ;c + embed_local_file 'FASM.TXT' ;d + embed_docdir_file 'MTDBG.TXT' ;e +if lang eq ru_RU + embed_local_file 'SYSFUNCR.TXT' ;f +else ; Default to en_US + embed_local_file 'SYSFUNCS.TXT' ;f +end if + embed_local_file 'STACK.TXT' ;g + embed_docdir_file 'KFAR_KEYS.TXT' ;h + embed_docdir_file 'INI.TXT' ;i + embed_docdir_file 'OPENDIAL.TXT' ;j +; -- End of embedding area ------- + + dd 0 +FILECOUNT = FILE_COUNT + + if ~ FILECOUNT>0 + error 'No embedded files' + end if + +my_param db 0 + rb 256 +I_END: + +title db 'Doc Pack',0 + +sc system_colors diff --git a/programs/system/end/light/data.inc b/programs/system/end/light/data.inc index ed6b30c9b..6c3febad7 100644 --- a/programs/system/end/light/data.inc +++ b/programs/system/end/light/data.inc @@ -1,68 +1,71 @@ -WIN_W = 440 -WIN_H = 200 -BOT_PANEL_H = 70 -;--------------------------------------------------------------------- -CANCEL_BUTTON_ID = 1+BT_HIDE -HOME_BUTTON_ID = 2 -REBOOT_BUTTON_ID = 3 -POWEROFF_BUTTON_ID = 4 -CHECKBOX_BUTTON_ID = 5+BT_HIDE -;--------------------------------------------------------------------- -TEXT_HOME: db 'Home',0 -TEXT_ENTER: db 'Enter',0 -TEXT_END: db 'End',0 -TEXT_CANCEL: db 'x',0 -;--------------------------------------------------------------------- -if lang eq ru - TEXT_WTITLE: db '襭 ࠡ',0 - TEXT_RDSAVE1: db '࠭ , ᤥ ',0 - TEXT_RDSAVE2: db ' ࠡ ⥬ (Ctrl+S)',0 - TEXT_KERNEL: db '',0 - TEXT_REBOOT: db '१㧪',0 - TEXT_OFF: db '몫祭',0 - TEXT_SAVING: db '࠭ ࠧ...',0 -else if lang eq ge - TEXT_WTITLE: db 'Shutdown computer',0 - TEXT_RDSAVE1: db 'Save all changes that were done',0 - TEXT_RDSAVE2: db 'during system work (Ctrl+S)',0 - TEXT_KERNEL: db 'Kernel',0 - TEXT_REBOOT: db 'Neustart',0 - TEXT_OFF: db 'Beenden',0 - TEXT_SAVING: db 'Saving RAM-drive...',0 -else if lang eq it - TEXT_WTITLE: db 'Shutdown computer',0 - TEXT_RDSAVE1: db 'Save all changes that were done',0 - TEXT_RDSAVE2: db 'during system work (Ctrl+S)',0 - TEXT_KERNEL: db 'Kernel',0 - TEXT_REBOOT: db 'Riavvio',0 - TEXT_OFF: db 'Spegni',0 - TEXT_SAVING: db 'Saving RAM-drive...',0 -else - TEXT_WTITLE: db 'Shutdown computer',0 - TEXT_RDSAVE1: db 'Save all changes that were done',0 - TEXT_RDSAVE2: db 'during system work (Ctrl+S)',0 - TEXT_KERNEL: db 'Kernel',0 - TEXT_REBOOT: db 'Reboot',0 - TEXT_OFF: db 'Power off',0 - TEXT_SAVING: db 'Saving RAM-drive...',0 -end if -;--------------------------------------------------------------------- -rdsave: - dd SSF_START_APP,0,hide,0,0 - db '/sys/rdsave',0 -hide db 'h',0 -asettings db 'settings',0 -aautosave db 'autosave',0 -ini_file db '/sys/settings/rdsave.ini',0 -;--------------------------------------------------------------------- -importLib: -library \ - libini, 'libini.obj' - -import libini, \ - ini_set_int ,'ini_set_int', \ - ini_get_int ,'ini_get_int' -;--------------------------------------------------------------------- -checkbox_sharedname db 'CHECKBOX',0 -checkbox_img dd ? -;--------------------------------------------------------------------- +WIN_W = 440 +WIN_H = 200 +BOT_PANEL_H = 70 +;--------------------------------------------------------------------- +CANCEL_BUTTON_ID = 1+BT_HIDE +HOME_BUTTON_ID = 2 +REBOOT_BUTTON_ID = 3 +POWEROFF_BUTTON_ID = 4 +CHECKBOX_BUTTON_ID = 5+BT_HIDE +;--------------------------------------------------------------------- +TEXT_HOME: db 'Home',0 +TEXT_ENTER: db 'Enter',0 +TEXT_END: db 'End',0 +TEXT_CANCEL: db 'x',0 +;--------------------------------------------------------------------- + +; Language support for locales: ru_RU (CP866), de_DE, it_IT,en_US + +if lang eq ru_RU + TEXT_WTITLE: db '襭 ࠡ',0 + TEXT_RDSAVE1: db '࠭ , ᤥ ',0 + TEXT_RDSAVE2: db ' ࠡ ⥬ (Ctrl+S)',0 + TEXT_KERNEL: db '',0 + TEXT_REBOOT: db '१㧪',0 + TEXT_OFF: db '몫祭',0 + TEXT_SAVING: db '࠭ ࠧ...',0 +else if lang eq de_DE + TEXT_WTITLE: db 'Shutdown computer',0 + TEXT_RDSAVE1: db 'Save all changes that were done',0 + TEXT_RDSAVE2: db 'during system work (Ctrl+S)',0 + TEXT_KERNEL: db 'Kernel',0 + TEXT_REBOOT: db 'Neustart',0 + TEXT_OFF: db 'Beenden',0 + TEXT_SAVING: db 'Saving RAM-drive...',0 +else if lang eq it_IT + TEXT_WTITLE: db 'Shutdown computer',0 + TEXT_RDSAVE1: db 'Save all changes that were done',0 + TEXT_RDSAVE2: db 'during system work (Ctrl+S)',0 + TEXT_KERNEL: db 'Kernel',0 + TEXT_REBOOT: db 'Riavvio',0 + TEXT_OFF: db 'Spegni',0 + TEXT_SAVING: db 'Saving RAM-drive...',0 +else ; Default to en_US + TEXT_WTITLE: db 'Shutdown computer',0 + TEXT_RDSAVE1: db 'Save all changes that were done',0 + TEXT_RDSAVE2: db 'during system work (Ctrl+S)',0 + TEXT_KERNEL: db 'Kernel',0 + TEXT_REBOOT: db 'Reboot',0 + TEXT_OFF: db 'Power off',0 + TEXT_SAVING: db 'Saving RAM-drive...',0 +end if +;--------------------------------------------------------------------- +rdsave: + dd SSF_START_APP,0,hide,0,0 + db '/sys/rdsave',0 +hide db 'h',0 +asettings db 'settings',0 +aautosave db 'autosave',0 +ini_file db '/sys/settings/rdsave.ini',0 +;--------------------------------------------------------------------- +importLib: +library \ + libini, 'libini.obj' + +import libini, \ + ini_set_int ,'ini_set_int', \ + ini_get_int ,'ini_get_int' +;--------------------------------------------------------------------- +checkbox_sharedname db 'CHECKBOX',0 +checkbox_img dd ? +;--------------------------------------------------------------------- diff --git a/programs/system/icon/trunk/data.inc b/programs/system/icon/trunk/data.inc index 8886ee108..cfdb514e7 100644 --- a/programs/system/icon/trunk/data.inc +++ b/programs/system/icon/trunk/data.inc @@ -1,206 +1,209 @@ -;------------------------------------------------------------------------------ -tl dd 8 -yw: dd 51 -ya dd 0 -cur_btn dd 40 -;------------------------------------------------------------------------------ -; DATA AREA -bcolor dd 0x335599 -;------------------------------------------------------------------------------ -icon_table: - times 4 db 'xxxx xxxx' - times 2 db ' ' - times 1 db ' ' - times 2 db 'xxxx xxxx' -; times 1 db ' ' -;------------------------------------------------------------------------------ -icons_reserved: - times 9 db ' ' -;------------------------------------------------------------------------------ -if lang eq ru -text: - db 255,255,255,0, ' ' - db 255,255,255,0, ' ' - db 255,255,255,0, ' ' - db 255,255,255,0, ' ' - db 255,255,255,0, ' ' - db 0,0,0,0, ' ' - db 'x' ; <- END MARKER, DONT DELETE - -add_text db ' ',0 -rem_text db ' ',0 -title db ' ',0 - -else if lang eq ge -text: - db 255,255,255,0, ' TITLE ' - db 255,255,255,0, ' APP NAME ' - db 255,255,255,0, ' PARAMETER ' - db 255,255,255,0, ' ANWENDEN ' - db 255,255,255,0, ' HINZUFUEGEN ENTFERNEN ' - db 0,0,0,0, 'AUF BUTTON KLICKEN, UM ICON ZU EDITIEREN ' - db 'x' ; <- END MARKER, DONT DELETE - -add_text db 'AUF UNBENUTZTE ICONPOSITION KLICKEN ',0 -rem_text db 'ICON ANKLICKEN; DAS GELOESCHT WERDEN SOLL ',0 -title db 'Icon Manager',0 - -else if lang eq it -text: - db 255,255,255,0, 'Titolo ' - db 255,255,255,0, 'Nome app ' - db 255,255,255,0, 'Parametri ' - db 255,255,255,0, ' Applica modifiche ' - db 255,255,255,0, ' Aggiungi Rimuovi ' - db 0,0,0,0, 'Clicca sull icona per effettuare modifiche ' - db 'x' ; <- END MARKER, DONT DELETE - -add_text db 'Clicca su una posizione non usata ',0 -rem_text db 'Cliccare sull icona da rimuovere ',0 -title db 'Gestore Icone',0 - -else -text: - db 255,255,255,0, ' TITLE ' - db 255,255,255,0, ' APP NAME ' - db 255,255,255,0, ' PARAMETERS ' - db 255,255,255,0, ' APPLY CHANGES ' - db 255,255,255,0, ' ADD ICON REMOVE ICON ' - db 0,0,0,0, 'CLICK BUTTON ON ICON POSITION FOR EDIT ' - db 'x' ; <- END MARKER, DONT DELETE -add_text db 'CLICK ON A NOT USED POSITION ',0 -rem_text db 'CLICK ICON POSITION; YOU WANT TO DELETE ',0 -title db 'Icon Manager',0 - -end if -;------------------------------------------------------------------------------ -arrows db '' -;------------------------------------------------------------------------------ -iconname: - db ICON_APP,0 -;------------------------------------------------------------------------------ -icon_default: - db 'AA-CALC -004-/SYS/CALC ' - db '- *' - db 13,10 -;------------------------------------------------------------------------------ -rep_text: -if lang eq ru - db ' - , #' -;else if lang eq it -; db 'Icone - di , Selezionate' -else - db 'ICONS - OF , SELECTED' -end if - -rep_text_len: -;------------------------------------------------------------------------------ -align 4 -finfo_start: - dd 7 - dd 0 -.params dd 0 - dd 0 - dd 0 - db 0 - dd finfo.path -;------------------------------------------------------------------------------ -align 4 -finfo: - dd 5 - dd 0 - dd 0 -.size dd 0 -.point dd procinfo -.path: - db ICON_STRIP,0 - rb 31-($-.path) -;------------------------------------------------------------------------------ -align 4 -positions dd 3,16,47 -str_lens db 8,30,30 - -current_icon dd icon_data - -iconlst db ICONS_DAT,0 - -;image dd image_area -;------------------------------------------------------------------------------ -; not change this section!!! -; start section -;------------------------------------------------------------------------------ -align 4 -image_file dd 0 ;+0 -raw_pointer dd 0 ;+4 -return_code dd 0 ;+8 -img_size dd 0 ;+12 -deflate_unpack dd 0 ;+16 ; not use for scaling -raw_pointer_2 dd 0 ;+20 ; not use for scaling -;------------------------------------------------------------------------------ -; end section -;------------------------------------------------------------------------------ -system_dir_CnvPNG db '/sys/lib/cnv_png.obj',0 -system_dir_UNPACK db '/sys/lib/archiver.obj',0 - -;plugins_directory db 'plugins/',0 -plugins_directory db 0 -;------------------------------------------------------------------------------ -l_libs_start: - -library01 l_libs system_dir_CnvPNG+9,library_path,system_dir_CnvPNG,\ -cnv_png_import,plugins_directory - -library02 l_libs system_dir_UNPACK+9,library_path,system_dir_UNPACK,\ -UNPACK_import,plugins_directory - -end_l_libs: -;--------------------------------------------------------------------- -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 -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 -;------------------------------------------------------------------------------ +;------------------------------------------------------------------------------ +tl dd 8 +yw: dd 51 +ya dd 0 +cur_btn dd 40 +;------------------------------------------------------------------------------ +; DATA AREA +bcolor dd 0x335599 +;------------------------------------------------------------------------------ +icon_table: + times 4 db 'xxxx xxxx' + times 2 db ' ' + times 1 db ' ' + times 2 db 'xxxx xxxx' +; times 1 db ' ' +;------------------------------------------------------------------------------ +icons_reserved: + times 9 db ' ' +;------------------------------------------------------------------------------ + +; Language support for locales: ru_RU (CP866), de_DE, it_IT, en_US + +if lang eq ru_RU +text: + db 255,255,255,0, ' ' + db 255,255,255,0, ' ' + db 255,255,255,0, ' ' + db 255,255,255,0, ' ' + db 255,255,255,0, ' ' + db 0,0,0,0, ' ' + db 'x' ; <- END MARKER, DO NOT DELETE + +add_text db ' ',0 +rem_text db ' ',0 +title db ' ',0 + +else if lang eq de_DE +text: + db 255,255,255,0, ' TITLE ' + db 255,255,255,0, ' APP NAME ' + db 255,255,255,0, ' PARAMETER ' + db 255,255,255,0, ' ANWENDEN ' + db 255,255,255,0, ' HINZUFUEGEN ENTFERNEN ' + db 0,0,0,0, 'AUF BUTTON KLICKEN, UM ICON ZU EDITIEREN ' + db 'x' ; <- END MARKER, DO NOT DELETE + +add_text db 'AUF UNBENUTZTE ICONPOSITION KLICKEN ',0 +rem_text db 'ICON ANKLICKEN; DAS GELOESCHT WERDEN SOLL ',0 +title db 'Icon Manager',0 + +else if lang eq it_IT +text: + db 255,255,255,0, 'Titolo ' + db 255,255,255,0, 'Nome app ' + db 255,255,255,0, 'Parametri ' + db 255,255,255,0, ' Applica modifiche ' + db 255,255,255,0, ' Aggiungi Rimuovi ' + db 0,0,0,0, 'Clicca sull icona per effettuare modifiche ' + db 'x' ; <- END MARKER, DO NOT DELETE + +add_text db 'Clicca su una posizione non usata ',0 +rem_text db 'Cliccare sull icona da rimuovere ',0 +title db 'Gestore Icone',0 + +else ; Default to en_US +text: + db 255,255,255,0, ' TITLE ' + db 255,255,255,0, ' APP NAME ' + db 255,255,255,0, ' PARAMETERS ' + db 255,255,255,0, ' APPLY CHANGES ' + db 255,255,255,0, ' ADD ICON REMOVE ICON ' + db 0,0,0,0, 'CLICK BUTTON ON ICON POSITION FOR EDIT ' + db 'x' ; <- END MARKER, DO NOT DELETE +add_text db 'CLICK ON A NOT USED POSITION ',0 +rem_text db 'CLICK ICON POSITION; YOU WANT TO DELETE ',0 +title db 'Icon Manager',0 + +end if +;------------------------------------------------------------------------------ +arrows db '' +;------------------------------------------------------------------------------ +iconname: + db ICON_APP,0 +;------------------------------------------------------------------------------ +icon_default: + db 'AA-CALC -004-/SYS/CALC ' + db '- *' + db 13,10 +;------------------------------------------------------------------------------ +rep_text: +if lang eq ru_RU + db ' - , #' +;else if lang eq it_IT +; db 'Icone - di , Selezionate' +else ; Default to en_US + db 'ICONS - OF , SELECTED' +end if + +rep_text_len: +;------------------------------------------------------------------------------ +align 4 +finfo_start: + dd 7 + dd 0 +.params dd 0 + dd 0 + dd 0 + db 0 + dd finfo.path +;------------------------------------------------------------------------------ +align 4 +finfo: + dd 5 + dd 0 + dd 0 +.size dd 0 +.point dd procinfo +.path: + db ICON_STRIP,0 + rb 31-($-.path) +;------------------------------------------------------------------------------ +align 4 +positions dd 3,16,47 +str_lens db 8,30,30 + +current_icon dd icon_data + +iconlst db ICONS_DAT,0 + +;image dd image_area +;------------------------------------------------------------------------------ +; not change this section!!! +; start section +;------------------------------------------------------------------------------ +align 4 +image_file dd 0 ;+0 +raw_pointer dd 0 ;+4 +return_code dd 0 ;+8 +img_size dd 0 ;+12 +deflate_unpack dd 0 ;+16 ; not use for scaling +raw_pointer_2 dd 0 ;+20 ; not use for scaling +;------------------------------------------------------------------------------ +; end section +;------------------------------------------------------------------------------ +system_dir_CnvPNG db '/sys/lib/cnv_png.obj',0 +system_dir_UNPACK db '/sys/lib/archiver.obj',0 + +;plugins_directory db 'plugins/',0 +plugins_directory db 0 +;------------------------------------------------------------------------------ +l_libs_start: + +library01 l_libs system_dir_CnvPNG+9,library_path,system_dir_CnvPNG,\ +cnv_png_import,plugins_directory + +library02 l_libs system_dir_UNPACK+9,library_path,system_dir_UNPACK,\ +UNPACK_import,plugins_directory + +end_l_libs: +;--------------------------------------------------------------------- +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 +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 +;------------------------------------------------------------------------------ diff --git a/programs/system/icon_new/icon.asm b/programs/system/icon_new/icon.asm index e5718b070..f6ff15f7b 100644 --- a/programs/system/icon_new/icon.asm +++ b/programs/system/icon_new/icon.asm @@ -1,1349 +1,1350 @@ -ICON_STRIP equ '/sys/icons32.png' -ICON_INI equ '/sys/settings/icon.ini' -ICON_SIZE equ 68 ;ࠧ -IMG_SIZE equ 32 ;ࠧ -TEXT_BOTTOM_Y equ 14 ; Y ⥪ -IMAGE_TOP_Y equ 10 ;>=1 न Y -ALIGN_SIZE equ 68 ;ࠧ ⪨ ࠢ -NAME_LENGTH equ 11 ; -MIN_NO_MOVING equ 8 ;१ ⮫쪮 ᥫ ᤢ 稭 ᪠ - - ;-------- ᮧ/।஢ -ICONSX equ 20 -ICONSY equ 90 -ICONS_DRAW_COUNTW equ 12 ;⢮ ਭ -ICONS_DRAW_COUNTH equ 6 ;⢮ -SPCW equ 3 ;஡ ਧ⠫ -SPCH equ 3 -END_ICONS_AREAW equ ICONSX+(IMG_SIZE+SPCW)*ICONS_DRAW_COUNTW-SPCW -END_ICONS_AREAH equ ICONSY+(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH-SPCH - - - -SizeData equ bufStdIco+32 -BegData equ fiStdIco.point -;------------------------------------------------------------------------------ - use32 - org 0x0 - db 'MENUET01' ; 8 byte id - dd 0x01 ; header version - dd START ; start of code - dd I_END ; size of image - dd ENDMEM ; memory for app - dd stack_main ; esp - dd 0 ; boot parameters - dd 0 ; path -;------------------------------------------------------------------------------ -include 'lang.inc' -include '../../macros.inc' -include '../../proc32.inc' -include '../../develop/libraries/box_lib/trunk/box_lib.mac' -include '../../dll.inc' -include '../../debug.inc' - - -; include '../include/lang.inc' -; include '../include/macros.inc' -; include '../include/proc32.inc' -; include '../include/box_lib.mac' -; include '../include/dll.inc' - -;------------------------------------------------------------------------------ -START: ; start of execution - - mcall 68,11 - stdcall dll.Load,IMPORTS - test eax,eax - jnz ErrLoadLibs - - mcall 30,1,curpath - -; unpack deflate - mov eax,[unpack_DeflateUnpack2] - mov [deflate_unpack],eax -;--------------------------------------------------------------------- -; get size of file icons32.png - mcall 70,fiStdIco - test eax,eax - jnz ErrorStrp -; get memory for icons32.png - mov ecx,dword[bufStdIco+32] - mov [fiStdIco.size],ecx - mov [img_size],ecx - mcall 68,12 - mov [fiStdIco.point],eax - mov [image_file],eax -; load icons32.png - mov dword[fiStdIco],0 - mcall 70,fiStdIco - test eax,eax - jnz close -; convert PNG to RAW - xor eax,eax - mov [return_code],eax -;int3 - - push image_file - call [cnv_png_import.Start] - - mov eax,[raw_pointer] - mov ebx,[eax+32] - mov [strip_file_size],ebx - mov eax,[eax+28] - add eax,[raw_pointer] - mov [strip_file],eax -; back memory to system - mcall 68,13,[fiStdIco.point] - - mov eax,[raw_pointer] - mov eax,[eax+8] - shr eax,5 - mov [icon_count],eax - - and eax,0x7 - mov [cur_band_compensation],eax - -;########## 㦠 ########################## - - mcall 70,fiIni ;뤥塞 , 筮 ࠭ ini 䠩. - test eax,eax ; 筮 墠 ࠭ - jnz ErrorIni - - cmp dword[bufIni+32],0 - je ErrorIni - mcall 68,12,dword[bufIni+32] - mov dword[BegData],eax - jmp NoErrIni - - ErrorIni: - mcall 70,fiRunProg - mcall -1 - - NoErrIni: - m2m [PIcoDB],[BegData] - - - - mov edi,IconsID - xor eax,eax - mov ecx,100h/4 - rep stosd - mov [nLoadIcon],0 - stdcall [ini_enum_sections],IconIni,LoadIconsData - - mov eax,dword[PIcoDB] - sub eax,[BegData] - mov dword[SizeData],eax - mov eax,[BegData] - cmp eax,[PIcoDB] - jne @f - mov dword[eax],0 - mov dword[SizeData],0 - @@: -;###################################################################### - call FillIconsOffs ; MaxNumIcon,IconsOffs - -;樠 IPC - mov dword[IPCbuffer],0 - mov dword[IPCbuffer+4],8 - mcall 60,1,IPCbuffer,1024 - - mcall 40,EVM_MOUSE+EVM_IPC ;㦭 ⮫쪮 ᮡ IPC, - ;ᮢ 㤥 㣮 ⮪ - mov eax,[icon_count] - mov bl,ICONS_DRAW_COUNTH - div bl - test ah,ah - jz @f - inc al - @@: - and eax,0FFh - mov [sbIcons.max_area],eax - - mcall 51,1,BGRedrawThread,stack_bredraw ;᪠ ⮪ ᮢ - stdcall [OpenDialog_Init],OpenDialog_data - -;dph [MaxNumIcon] - -messages: - mcall 10 - sub eax,6 - jz MSGMouse - dec eax - jz MSGIPC - jmp messages - -MSGIPC: - call IPCCreateIcon - jmp messages - -MSGMouse: - mcall 37,0 ;GetMousePos - xor ebx,ebx - mov bx,ax - shr eax,16 - mov ecx,ebx - mov ebx,eax - - mcall 34 - cmp eax,1 - jne messages - - cmp [RButtonActiv],1 - je messages - - mov [MouseY],ecx - mov [MouseX],ebx - -MOUSE_STATE_LMB_HOLD = $00000001 -MOUSE_STATE_RMB_HOLD = $00000002 -MOUSE_EVENT_LMB_DOWN = $00000100 -MOUSE_EVENT_RMB_DOWN = $00000200 - - mcall 37,3 -;check LMB is pressed - test eax, MOUSE_STATE_LMB_HOLD - jz @f - test eax, MOUSE_EVENT_LMB_DOWN - jz @f - jmp LButtonPress -@@: -;check RMB is pressed - test eax, MOUSE_STATE_RMB_HOLD - jz @f - test eax, MOUSE_EVENT_RMB_DOWN - jz @f - jmp RButtonPress -@@: - jmp messages - -ErrLoadLibs: - ;dps ' 㤠 㧨 室 ⥪' - ;debug_newline - jmp close -ErrorStrp: - ;dps '訡 icons32.png' - ;debug_newline -close: - mcall -1 - -LButtonPress: - - stdcall GetNumIcon,[MouseX],[MouseY],-1 -;int3 - cmp eax,-1 - jnz @f - - WaitLB1: - mcall 37,2 - test al,001b - jz messages - ;Yield - mcall 5,1 - jmp WaitLB1 - - - @@: - push eax - stdcall DrawIcon,eax,1 - WaitLB: - mcall 37,2 - test al,001b - jz endWaitLB - - mcall 37,0 - xor ebx,ebx - mov bx,ax - shr eax,16 - sub eax,[MouseX] - jns @f - neg eax - @@: - sub ebx,[MouseY] - jns @f - neg ebx - @@: - cmp [bFixIcons],0 - jne @f - cmp eax,MIN_NO_MOVING - ja MovingIcon - cmp ebx,MIN_NO_MOVING - ja MovingIcon - @@: - ;Yield - mcall 5,1 ;Sleep 1 - - jmp WaitLB - endWaitLB: - - mcall 37,0 - xor ebx,ebx - mov bx,ax - shr eax,16 - mov ecx,ebx - mov ebx,eax - mov [MouseX],ebx - mov [MouseY],ecx - - stdcall GetNumIcon,[MouseX],[MouseY],-1 - cmp eax,[esp] ;[esp] = - jne @f - - mov edi,[IconsOffs+eax*4] - or ecx,-1 - xor al,al - repne scasb - mov ebx,edi - repne scasb - ;run program - mov dword[fiRunProg+8],edi - mov dword[fiRunProg+21],ebx - mcall 70,fiRunProg - - test eax,80000000h - jz @f - - mov dword[fiRunProg+8],ErrRunProg - mov dword[fiRunProg+21],pthNotify - mcall 70,fiRunProg - - @@: - pop eax - stdcall RestoreBackgrnd,eax - mcall 5, 60 - jmp messages - -;------------------------------------------------------------------------------- -MovingIcon: - stdcall GetNumIcon,[MouseX],[MouseY],-1 - mov [SelIcon],eax - mov [IconNoDraw],eax - stdcall RestoreBackgrnd,[SelIcon] - -; mov ecx,[MaxNumIcon] -; xor ebx,ebx -; .MI: push ecx -; cmp ebx,[SelIcon] -; je @f -; stdcall DrawIcon,ebx,0 -; @@: -; inc ebx -; pop ecx -; loop .MI - - - -;dps 'Moving' -;debug_newline -; mov edi,[SelIcon] -; mov edi,[IconsOffs+edi*4] -; or ecx,-1 -; xor al,al -; repne scasb -; repne scasb -; repne scasb -; repne scasb -; xor ebx,ebx -; xor esi,esi -; mov bx,word[edi+2] -; mov si,word[edi] -; stdcall GetNumIcon,ebx,esi,[SelIcon] -; cmp eax,-1 -; je @f -; dps 'Q' -; stdcall DrawIcon,eax,0 -; @@: -; -; add ebx,ICON_SIZE-1 -; stdcall GetNumIcon,ebx,esi,[SelIcon] -; cmp eax,-1 -; je @f -; dps 'Q' -; stdcall DrawIcon,eax,0 -; -; @@: -; add esi,ICON_SIZE-1 -; stdcall GetNumIcon,ebx,esi,[SelIcon] -; cmp eax,-1 -; je @f -; dps 'Q' -; stdcall DrawIcon,eax,0 -; -; @@: -; sub ebx,ICON_SIZE-1 -; stdcall GetNumIcon,ebx,esi,[SelIcon] -; cmp eax,-1 -; je @f -; dps 'Q' -; stdcall DrawIcon,eax,0 -; @@: - - -; Sleep 40 - -;qweqwe: - - mov [MovingActiv],1 - mcall 51,1,MovingWnd,stack_mov ;CreateThread MovingWnd,stack_dlg - .WaitLB: - mcall 37,2 ;GetMouseKey - test al,001b - jz .endWaitLB - - ;Yield - mcall 5,1 ;Sleep 1 - jmp .WaitLB - .endWaitLB: - - - mcall 37,0 ;GetMousePos - xor ebx,ebx - mov bx,ax - shr eax,16 - - sub eax,1+ICON_SIZE/2 - jnc @f - xor eax,eax - @@: - - sub ebx,ICON_SIZE/2-7 - jnc @f - xor ebx,ebx - @@: - - cmp ax,[wsX] - jae @f - mov ax,[wsX] - @@: - - cmp bx,[wsY] - jae @f - mov bx,[wsY] - @@: ;eax,ebx - ॠ쭠 न. न ண ⭮⥫쭮 孥 㣫 ࠡ祩 - - xor edx,edx - mov dx,[wsXe] - sub edx,ICON_SIZE - cmp eax,edx - jbe @f - mov eax,edx - @@: - - mov dx,[wsYe] - sub edx,ICON_SIZE - cmp ebx,edx - jbe @f - mov ebx,edx - @@: - - xor edx,edx ;८ࠧ뢠 ⭮⥫ - mov dx,[wsW] - shr edx,1 - add dx,[wsX] - cmp eax,edx - jbe @f - sub ax,[wsXe] - inc ax - jmp .mov1 - @@: - sub ax,[wsX] - .mov1: - - xor edx,edx - mov dx,[wsH] - shr edx,1 - add dx,[wsY] - cmp ebx,edx - jbe @f - sub bx,[wsYe] - inc bx - jmp .mov2 - @@: - sub bx,[wsY] - .mov2: - - stdcall SetPosition,[SelIcon],eax,ebx - - m2m [PIcoDB],[BegData] - stdcall [ini_enum_sections],IconIni,Ini_SavePos ;in RButton.inc - - mov [bNotSave],1 - mov [IconNoDraw],-1 - - mov [MovingActiv],0 ;⮫쪮 ⥯ ⪫砥 - - jmp messages - -;------------------------------------------------------------------------------- - -RButtonPress: - mov [RButtonActiv],1 - - @@: - mcall 37,2 ;GetMouseKey - test al,010b - jz @f - mcall 5,1 ;Yield - jmp @b - @@: - - mcall 51,1,RButtonWin,stack_rmenu ;CreateThread RButtonWin,stack_rmenu - - jmp messages - - -;############################################################################### -;ret eax = 1/0 = 㤠/訡 -proc DrawIcon NumIcon:DWORD,Activ:DWORD ;NumIcon = 0..n -local IconData:DWORD - push ebx edi esi - - mov ecx,ICON_SIZE*ICON_SIZE - xor eax,eax - mov edi,IconArea - rep stosd - - mov eax,[NumIcon] - cmp eax,[MaxNumIcon] - jb @f - xor eax,eax - pop esi edi ebx - ret - @@: - - mov esi,[IconsOffs+eax*4] - mov [IconData],esi - - ;㥬 ⥪ - mov edi,esi - xor al,al - or ecx,-1 - repne scasb - mov edx,esi - mov eax,edi - sub eax,esi - dec eax - shl eax,1 ;*6 - lea eax,[eax*2+eax] - mov ebx,ICON_SIZE - sub ebx,eax - shr ebx,1 ;ebx = x ⥪ - shl ebx,16 - mov bx,ICON_SIZE - sub bx,TEXT_BOTTOM_Y - mov ecx,88000000h - mov edi,IconAreaH - add ebx,-1*10000h+0 - mcall 4 - add ebx,2*10000h+0 - mcall ;4 - add ebx,-1*10000h-1 - mcall ;4 - add ebx,0*10000h+2 - mcall ;4 - add ebx,1*10000h+0 - mcall ;4 - inc ebx;add ebx,0*10000h+1 - mcall ;4 - add ebx,-1*10000h+0 - mcall ;4 - add ebx,0*10000h-2 - mov ecx,88FFFFFFh - mcall ;4 - ;㥬 ⨭ - - mov edi,esi - xor al,al - or ecx,-1 - repne scasb - repne scasb - repne scasb - - ;stdcall hexToInt,edi - stdcall strToInt,edi - @@: ;eax=num icon - cmp eax,[icon_count] - jb @f - xor eax,eax - @@: - test eax,eax - je DI1 - mov ecx,eax - xor eax,eax - @@: - add eax,IMG_SIZE*IMG_SIZE*4 - loop @b - DI1: - add eax,[raw_pointer] - add eax,0+4*11 - mov esi,eax - - CopyToMem: - mov edi,IconArea+((IMAGE_TOP_Y*ICON_SIZE)+((ICON_SIZE-IMG_SIZE)/2))*4 - - mov eax,IMG_SIZE - mov edx,eax - @@: - mov ecx,eax - rep movsd - add edi,(ICON_SIZE-IMG_SIZE)*4 - dec edx - jnz @b - -;----------------- - ;᫨ , 㥬 - cmp [Activ],0 - je .NoSelect - - mov edi,IconArea - mov eax,0FF000000h - mov ecx,ICON_SIZE - rep stosd - ;mov edi,IconArea+ICON_SIZE*1 - - mov ecx,ICON_SIZE-1 - @@: mov dword[edi],eax - add edi,(ICON_SIZE)*4 - loop @b - - mov edi,IconArea+ICON_SIZE*2*4-4 - mov ecx,ICON_SIZE-1 - @@: mov dword[edi],eax - add edi,(ICON_SIZE)*4 - loop @b - - mov edi,IconArea+ICON_SIZE*(ICON_SIZE-1)*4+4 - mov ecx,ICON_SIZE-2 - rep stosd - - - mov edi,IconArea+ICON_SIZE*4+4 - mov eax,0FFFFFFFFh - mov ecx,ICON_SIZE-2 - rep stosd - - mov edi,IconArea+ICON_SIZE*4+4 - mov ecx,ICON_SIZE-2 - @@: mov dword[edi],eax - add edi,(ICON_SIZE)*4 - loop @b - - mov edi,IconArea+ICON_SIZE*2*4-4*2 - mov ecx,ICON_SIZE-3 - @@: mov dword[edi],eax - add edi,(ICON_SIZE)*4 - loop @b - - mov edi,IconArea+ICON_SIZE*(ICON_SIZE-2)*4+4*2 - mov ecx,ICON_SIZE-3 - rep stosd -;-------------- - - .NoSelect: - mov edi,[IconData] - xor al,al - or ecx,-1 - repne scasb - repne scasb - repne scasb - repne scasb - mov edx,[edi] - - test edx,00008000h - jz @f - add dx,[wsYe] - jmp .DI11 - @@: - add dx,[wsY] - .DI11: - - test edx,80000000h - jz @f - mov ax,[wsXe] - shl eax,16 - add edx,eax - jmp .DI12 - @@: - mov ax,[wsX] - shl eax,16 - add edx,eax - .DI12: - - mov ebx,IconArea - mov ecx,ICON_SIZE*10000h+ICON_SIZE - mcall 25 - -; mov eax,1 - pop esi edi ebx - ret -endp - -proc RestoreBackgrnd,NumIcon:DWORD - push ebx edi - mov eax,[NumIcon] - cmp eax,[MaxNumIcon] - jb @f - xor eax,eax - pop edi ebx - ret - @@: - - mov edi,[IconsOffs+eax*4] - xor al,al - or ecx,-1 - repne scasb - repne scasb - repne scasb - repne scasb - - mov ax,[edi+2] - test ax,8000h - jz @f - add ax,[wsXe] - jmp .rbg1 - @@: - add ax,[wsX] - .rbg1: - - mov bx,[edi] - test bx,8000h - jz @f - add bx,[wsYe] - jmp .rbg2 - @@: - add bx,[wsY] - .rbg2: - - mov cx,ax - shl ecx,16 - add ax,ICON_SIZE - mov cx,ax - mov dx,bx - shl edx,16 - add bx,ICON_SIZE - mov dx,bx - dec ecx - dec edx - mcall 15,9 - pop edi ebx - ret -endp - - ; MaxNumIcon,IconsOffs -proc FillIconsOffs - push ebx edi - mov edi,[BegData] - mov dword[MaxNumIcon],0 - cmp dword[edi],0 - jne @f - mov dword[IconsOffs],0 - pop edi ebx - ret - @@: - - mov [IconsOffs],edi - xor al,al - xor edx,edx - mov ebx,dword[SizeData] - add ebx,dword[BegData] - or ecx,-1 - .CalcNumIc: - - repne scasb - repne scasb - repne scasb - repne scasb - add edi,4 - mov dword[IconsOffs+edx+4],edi - inc dword[MaxNumIcon] - add edx,4 - - cmp edi,ebx - jae @f - jmp .CalcNumIc - @@: - - mov dword[IconsOffs+edx],0 - - pop edi ebx - ret -endp - -proc LoadIconsData stdcall,f_name,sec_name - push ebx esi edi - - mov edi,secRButt - mov esi,[sec_name] - @@: lodsb - scasb - jnz .lid1 - test al,al - jnz @b - - mov eax,1 - pop edi esi ebx - ret - .lid1: - - - mov ebx,[sec_name] ;㥬 ID - mov ax,[ebx] - mov edi,[nLoadIcon] - mov word[edi*4+IconsID],ax - mov word[edi*4+IconsID+2],0 - - mov edi,[PIcoDB] - stdcall [ini_get_str],[f_name],[sec_name],keyName,edi,4096,0 - test eax,eax - jz @f - xor eax,eax - pop edi esi ebx - ret - @@: - xor al,al - or ecx,-1 - repne scasb - - - - stdcall [ini_get_str],[f_name],[sec_name],keyPath,edi,4096,0 - test eax,eax - jz @f - xor eax,eax - pop edi esi ebx - ret - @@: - xor al,al - or ecx,-1 - repne scasb - - stdcall [ini_get_str],[f_name],[sec_name],keyParams,edi,4096,0 - test eax,eax - jz @f - xor eax,eax - pop edi esi ebx - ret - @@: - xor al,al - or ecx,-1 - repne scasb - - stdcall [ini_get_str],[f_name],[sec_name],keyIco,edi,4096,0 - test eax,eax - jz @f - xor eax,eax - pop edi esi ebx - ret - @@: - xor al,al - or ecx,-1 - repne scasb - - stdcall [ini_get_int],[f_name],[sec_name],keyX,80000000h - cmp eax,80000000h - jne @f - xor eax,eax - pop edi esi ebx - ret - @@: - mov word[edi+2],ax - - stdcall [ini_get_int],[f_name],[sec_name],keyY,80000000h - cmp eax,80000000h - jne @f - xor eax,eax - pop edi esi ebx - ret - @@: - mov word[edi],ax - add edi,4 - mov [PIcoDB],edi - - inc [nLoadIcon] - - mov eax,1 - pop edi esi ebx - ret -endp - -proc GenerateID ;ax = ID - push ebx edi - mov ebx,[MaxNumIcon] - test ebx,ebx - jnz @f - mov eax,'00' - pop edi ebx - ret - @@: - - mov eax,dword[IconsID+ebx*4-4] - .inc: - inc ah - cmp ah,'9'+1 - jne @f - mov ah,'A' - @@: - cmp ah,'F'+1 - jne @f - mov ah,'0' - inc al - @@: - cmp al,'9'+1 - jne @f - mov al,'A' - @@: - cmp al,'F'+1 - jne @f - mov al,'0' - @@: - - - mov edi,IconsID - ;cmp dword[edi],0 - ;je @f - mov ecx,100h - @@: scasd - je .inc - cmp dword[edi],0 - je @f - loop @b - @@: - - pop edi ebx - ret -endp - -;------------------------------------------------------------------------------- - - -;ଠ IPC-ᮮ饭 -;dd X -;dd Y -;asciiz Icon - in decimal -;asciiz Name -;asciiz Path -;asciiz Params -;------------------------------------------------------------------------------- -proc IPCCreateIcon -locals - ix rd 1 - iy rd 1 -endl - - mov eax,IPCbuffer+8 - mov dword[IPCbuffer],1 - lea edx,[eax+8] - - m2m dword[ix],dword[edx] - m2m dword[iy],dword[edx+4] - - lea esi,[edx+8] - - mov ecx,256 - mov edi,DAreaIcon - @@: lodsb - stosb - test al,al - jnz @b - - mov ecx,NAME_LENGTH+1 - mov edi,DAreaName - @@: lodsb - stosb - test al,al - jz @f - loop @b - @@: - - mov edi,DAreaPath - @@: lodsb - stosb - test al,al - jnz @b - - mov edi,DAreaParams - @@: lodsb - stosb - test al,al - jnz @b - - mov dword[IPCbuffer+4],8 - mov dword[IPCbuffer],0 - - stdcall AddIcon,[ix],[iy],DAreaIcon,DAreaName,DAreaPath,DAreaParams - - mcall 15,3 - ret -endp - - -include 'iconman.inc' -include 'bgredraw.inc' -include 'RButton.inc' -include 'DlgAdd.inc' -include 'Moving.inc' - -;'Eolite',0,'/sys/File managers/eolite',0,'/hd0/3/Muzik',0,'1',0,00010001h -;------------------------------------------------------------------------------- -;##### DATA #################################################################### -;------------------------------------------------------------------------------- -; not change this section!!! -; start section -;------------------------------------------------------------------------------ -align 4 -image_file dd 0 ;+0 -raw_pointer dd 0 ;+4 -return_code dd 0 ;+8 -img_size dd 0 ;+12 -deflate_unpack dd 0 ;+16 ; not use for scaling -raw_pointer_2 dd 0 ;+20 ; not use for scaling -;------------------------------------------------------------------------------ -; end section -;------------------------------------------------------------------------------ - - -align 4 -fiStdIco: - dd 5 - dd 0 - dd 0 -.size dd 0 -.point dd bufStdIco - db ICON_STRIP,0 - - -align 4 -fiRunProg: ; ᪠ ணࠬ - dd 7 - dd 0 - dd 0 - dd 0 - dd ErrNotFoundIni - db 0 - dd pthNotify - -fiIni dd 5 ; ini 䠩 - dd 0 - dd 0 - dd 0 - dd bufIni - db 0 - dd IconIni - - -IconsFile db ICON_STRIP,0 - -align 4 -MaxNumIcon dd 0 ;⢮ -IconNoDraw dd -1 ;-1 , ᮢ( ᪠ ) - -bFixIcons dd 1 -bNotSave dd 0 - -LButtonActiv dd 0 -RButtonActiv dd 0 -MovingActiv dd 0 -DlgAddActiv dd 0 - -IconIni db ICON_INI,0 - -pthNotify db '/sys/@notify',0 - -keyName db 'name',0 -keyPath db 'path',0 -keyParams db 'param',0 -keyIco db 'ico',0 -keyX db 'x',0 -keyY db 'y',0 - -;------------------------------------------------------------------------------- -IMPORTS: -library cnv_png ,'cnv_png.obj',\ - archiver,'archiver.obj',\ - box_lib ,'box_lib.obj',\ - proc_lib,'proc_lib.obj',\ - libini ,'libini.obj' - -import cnv_png,\ - cnv_png_import.Start ,'START',\ - cnv_png_import.Version ,'version',\ - cnv_png_import.Check ,'Check_Header',\ - cnv_png_import.Assoc ,'Associations' - -import archiver,\ - unpack_DeflateUnpack2 ,'deflate_unpack2' - -import box_lib,\ - edit_box_draw ,'edit_box_draw',\ - edit_box_key ,'edit_box_key',\ - edit_box_mouse ,'edit_box_mouse',\ - scrollbar_h_draw ,'scrollbar_h_draw',\ - scrollbar_h_mouse ,'scrollbar_h_mouse' - -import proc_lib,\ - OpenDialog_Init ,'OpenDialog_init',\ - OpenDialog_Start ,'OpenDialog_start' - -import libini,\ - ini_enum_sections ,'ini_enum_sections',\ - ini_enum_keys ,'ini_enum_keys',\ - ini_get_str ,'ini_get_str',\ - ini_set_str ,'ini_set_str',\ - ini_get_color ,'ini_get_color',\ - ini_get_int ,'ini_get_int',\ - ini_set_int ,'ini_set_int',\ - ini_del_section ,'ini_del_section',\ - ini_exist_sect ,'ini_exist_sect' - - -;ini.get_str (f_name, sec_name, key_name, buffer, buf_len, def_val) -;ini.set_str (f_name, sec_name, key_name, buffer, buf_len) - - -;------------------------------------------------------------------------------- -;----- RButton.inc ------------------------------------------------------------- -;------------------------------------------------------------------------------- - -if lang eq ru - MinRMenuW dd 18*6+10 -else - MinRMenuW dd 15*6+10 -end if - -secRButt db 'rbmenu',0 - -curpath db '/sys',0 - -PredItem dd -1 - -if lang eq ru - RMenuRedrawFon db 'ᮢ',0 - RMenuAlign db '஢ ⪥',0 - RMenuOffMoving db '९ ',0 - RMenuOnMoving db '९ ',0 - RMenuAdd db '',0 - RMenuDel db '',0 - RMenuProp db '⢠',0 -else - RMenuRedrawFon db 'Redraw',0 - RMenuAlign db 'Snap to grid',0 - RMenuOffMoving db 'Fix the icons',0 - RMenuOnMoving db 'Unfix the icons',0 - RMenuAdd db 'Add',0 - RMenuDel db 'Delete',0 - RMenuProp db 'Properties',0 -end if - -if lang eq ru - ErrRunProg db '訡 ᪠ ணࠬ',0 - WarningSave db ' ࠭ , RDSave',0 - ErrNotFoundIni db ' icon.ini',0 - ErrName db ' "rbmenu" १ࢨ஢',0 -else - ErrRunProg db 'Error running program',0 - WarningSave db 'Remember to save changes with "RDSave"',0 - ErrNotFoundIni db 'icon.ini not found',0 - ErrName db 'The name "rbmenu" reserved',0 -end if - -;------------------------------------------------------------------------------- -;------- AddDlg.inc --------------------------------------------------------------- -;------------------------------------------------------------------------------- -if lang eq ru -DTitleAdd db ' ',0 -DTitleProp db ' ',0 - -DCaptName db ' ',0 -DCaptPath db ' ',0 -DCaptParams db ' ',0 -;DCaptChange db '.',0 -DCaptCreate db '',0 -DCaptProperties db '',0 -DCaptCancel db '⬥',0 - -else -DTitleAdd db 'Add icon',0 -DTitleProp db 'Change icon',0 - -DCaptName db ' Name',0 -DCaptPath db ' Path',0 -DCaptParams db ' Params',0 -DCaptCreate db 'Create',0 -DCaptProperties db 'Change',0 -DCaptCancel db 'Cancel',0 -end if -DCaptDots db '...',0 - -;/ -edtName edit_box NAME_LENGTH*8+4,120+IMG_SIZE,6,0FFFFFFh,06F9480h,0FFh,0h,0x90000000,NAME_LENGTH,\ - DAreaName,mouse_dd,0,0,0 -edtExePath edit_box END_ICONS_AREAW-120-IMG_SIZE-40,120+IMG_SIZE,30,0FFFFFFh,06F9480h,\ - 0FFh,0h,0x90000000,255, DAreaPath,mouse_dd,0,0,0 -edtParams edit_box END_ICONS_AREAW-120-IMG_SIZE, 120+IMG_SIZE,54,0FFFFFFh,06F9480h,\ - 0FFh,0h,0x90000000,255, DAreaParams,mouse_dd,0,0,0 -edtIcon edit_box 28,24,62,0FFFFFFh,0FFFFFFh,0FFh,0h,0x90000000,3,\ - DAreaIcon,0,0,0,0 -endEdits: -;\ - -sbIcons: - dw END_ICONS_AREAW-ICONSX - dw ICONSX - dw 15 - dw END_ICONS_AREAH+3 - dd 0 - dd 1 - .max_area dd 0 - .cur_area dd ICONS_DRAW_COUNTW - .position dd 0 - .bckg_col dd 0 - .frnt_col dd 0 - .line_col dd 0 - .redraw dd 0 - .delta dd 0 - .delta2 dd 0 - .r_size_x dw 0 - .r_start_x dw 0 - .r_size_y dw 0 - - .r_start_y dw 0 - .m_pos dd 0 - .m_pos2 dd 0 - .m_keys dd 0 - .run_size dd 0 - .position2 dd 0 - .work_size dd 0 - .all_redraw dd 0 - .ar_offset dd 0 - -;------------------------------------------------------------------------------- -OpenDialog_data: -.type dd 0 -.procinfo dd RBProcInfo ;+4 -.com_area_name dd communication_area_name ;+8 -.com_area dd 0 ;+12 -.opendir_pach dd temp_dir_pach ;+16 -.dir_default_pach dd communication_area_default_pach ;+20 -.start_path dd open_dialog_path ;+24 -.draw_window dd DRedrawWin;draw_window_for_OD ;+28 -.status dd 0 ;+32 -.openfile_pach dd DAreaPath;fname_Info ;+36 -.filename_area dd 0;DAreaPath ;+40 -.filter_area dd Filter -.x: -.x_size dw 420 ;+48 ; Window X size -.x_start dw 100 ;+50 ; Window X position -.y: -.y_size dw 320 ;+52 ; Window y size -.y_start dw 100 ;+54 ; Window Y position - -communication_area_name: - db 'FFFFFFFF_open_dialog',0 -open_dialog_path: - db '/sys/File managers/opendial',0 - -communication_area_default_pach: - db '/sys',0 - -Filter dd 0 - -;open_dialog db 0 -;------------------------------------------------------------------------------- - -;/ ࠧ -align 4 -IconAreaH dd ICON_SIZE,ICON_SIZE -I_END: -;##### UDATA ################################################################### -IconArea rb 4*ICON_SIZE*ICON_SIZE -;\ - -sc system_colors -sc.workL rd 1 -sc.workH rd 1 - - -align 4 -IPCbuffer rb 1024 - -align 4 - -ScreenW rw 1 -ScreenH rw 1 -wsX rw 1 -wsY rw 1 -wsXe rw 1 -wsYe rw 1 -wsW rw 1 -wsH rw 1 - - -MouseX rd 1 -MouseY rd 1 - -RBSlot rd 1 -AddX rd 1 -AddY rd 1 - -SelIcon rd 1 -DlgSelIcon rd 1 -slotDlgAdd rd 1 -DlgBufImg rb IMG_SIZE*IMG_SIZE*3 - -align 4 -bufStdIco rb 40 -IconsOffs rd 100h ;⠡ 㪠⥫ﬨ ( ᪮७) -PIcoDB rd 1 ;㪠⥫ 䮩 -nLoadIcon rd 1 ; ⠥ ini -IconsID rd 100h ;ID - 2 a + 0 + ࠢ騩 - ப 2 ᭠묨 ࠬ - -nameSection rb 4 - -align 4 -icon_count rd 1 -strip_file rd 1 -strip_file_size rd 1 - -cur_band_compensation rd 1 - -;---- RButton ----------------------------------------------------------------------- - -bufIni rb 40 -NumMenuButt rd 1 -RBMenuCP rd MAX_USER_BUTTONS*2 ;㪠⥫ ண (Caption(dd), Path(dd)) ᭮ (dd) 饣 -RMenuW rw 1 -RMenuH rw 1 - -MaxPage rd 1 -mouse_dd rd 1 - -DAreaName rb NAME_LENGTH+1 -DAreaPath rb 255+1 -DAreaParams rb 255+1 -DAreaIcon rb 255+1 - -align 4 -RBProcInfo rb 1024 -align 4 - - -;------ OpenDialog ------------------------------- -temp_dir_pach rb 1024 -fname_Info rb 1024 - -;------------------------------------------------------------------------------- - rb 512 -stack_mov: ;६ ᪠ ঠ -stack_rmenu: - rb 512 -stack_dlg: - rb 512 -stack_bredraw: - rb 512 -stack_main: -;------------------------------------------------------------------------------ - - - - -ENDMEM: +ICON_STRIP equ '/sys/icons32.png' +ICON_INI equ '/sys/settings/icon.ini' +ICON_SIZE equ 68 ;ࠧ +IMG_SIZE equ 32 ;ࠧ +TEXT_BOTTOM_Y equ 14 ; Y ⥪ +IMAGE_TOP_Y equ 10 ;>=1 न Y +ALIGN_SIZE equ 68 ;ࠧ ⪨ ࠢ +NAME_LENGTH equ 11 ; +MIN_NO_MOVING equ 8 ;१ ⮫쪮 ᥫ ᤢ 稭 ᪠ + + ;-------- ᮧ/।஢ +ICONSX equ 20 +ICONSY equ 90 +ICONS_DRAW_COUNTW equ 12 ;⢮ ਭ +ICONS_DRAW_COUNTH equ 6 ;⢮ +SPCW equ 3 ;஡ ਧ⠫ +SPCH equ 3 +END_ICONS_AREAW equ ICONSX+(IMG_SIZE+SPCW)*ICONS_DRAW_COUNTW-SPCW +END_ICONS_AREAH equ ICONSY+(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH-SPCH + + + +SizeData equ bufStdIco+32 +BegData equ fiStdIco.point +;------------------------------------------------------------------------------ + use32 + org 0x0 + db 'MENUET01' ; 8 byte id + dd 0x01 ; header version + dd START ; start of code + dd I_END ; size of image + dd ENDMEM ; memory for app + dd stack_main ; esp + dd 0 ; boot parameters + dd 0 ; path +;------------------------------------------------------------------------------ + +include 'lang.inc' ; Language support for locales: ru_RU (CP866), en_US. +include '../../macros.inc' +include '../../proc32.inc' +include '../../develop/libraries/box_lib/trunk/box_lib.mac' +include '../../dll.inc' +include '../../debug.inc' + + +; include '../include/lang.inc' +; include '../include/macros.inc' +; include '../include/proc32.inc' +; include '../include/box_lib.mac' +; include '../include/dll.inc' + +;------------------------------------------------------------------------------ +START: ; start of execution + + mcall 68,11 + stdcall dll.Load,IMPORTS + test eax,eax + jnz ErrLoadLibs + + mcall 30,1,curpath + +; unpack deflate + mov eax,[unpack_DeflateUnpack2] + mov [deflate_unpack],eax +;--------------------------------------------------------------------- +; get size of file icons32.png + mcall 70,fiStdIco + test eax,eax + jnz ErrorStrp +; get memory for icons32.png + mov ecx,dword[bufStdIco+32] + mov [fiStdIco.size],ecx + mov [img_size],ecx + mcall 68,12 + mov [fiStdIco.point],eax + mov [image_file],eax +; load icons32.png + mov dword[fiStdIco],0 + mcall 70,fiStdIco + test eax,eax + jnz close +; convert PNG to RAW + xor eax,eax + mov [return_code],eax +;int3 + + push image_file + call [cnv_png_import.Start] + + mov eax,[raw_pointer] + mov ebx,[eax+32] + mov [strip_file_size],ebx + mov eax,[eax+28] + add eax,[raw_pointer] + mov [strip_file],eax +; back memory to system + mcall 68,13,[fiStdIco.point] + + mov eax,[raw_pointer] + mov eax,[eax+8] + shr eax,5 + mov [icon_count],eax + + and eax,0x7 + mov [cur_band_compensation],eax + +;########## 㦠 ########################## + + mcall 70,fiIni ;뤥塞 , 筮 ࠭ ini 䠩. + test eax,eax ; 筮 墠 ࠭ + jnz ErrorIni + + cmp dword[bufIni+32],0 + je ErrorIni + mcall 68,12,dword[bufIni+32] + mov dword[BegData],eax + jmp NoErrIni + + ErrorIni: + mcall 70,fiRunProg + mcall -1 + + NoErrIni: + m2m [PIcoDB],[BegData] + + + + mov edi,IconsID + xor eax,eax + mov ecx,100h/4 + rep stosd + mov [nLoadIcon],0 + stdcall [ini_enum_sections],IconIni,LoadIconsData + + mov eax,dword[PIcoDB] + sub eax,[BegData] + mov dword[SizeData],eax + mov eax,[BegData] + cmp eax,[PIcoDB] + jne @f + mov dword[eax],0 + mov dword[SizeData],0 + @@: +;###################################################################### + call FillIconsOffs ; MaxNumIcon,IconsOffs + +;樠 IPC + mov dword[IPCbuffer],0 + mov dword[IPCbuffer+4],8 + mcall 60,1,IPCbuffer,1024 + + mcall 40,EVM_MOUSE+EVM_IPC ;㦭 ⮫쪮 ᮡ IPC, + ;ᮢ 㤥 㣮 ⮪ + mov eax,[icon_count] + mov bl,ICONS_DRAW_COUNTH + div bl + test ah,ah + jz @f + inc al + @@: + and eax,0FFh + mov [sbIcons.max_area],eax + + mcall 51,1,BGRedrawThread,stack_bredraw ;᪠ ⮪ ᮢ + stdcall [OpenDialog_Init],OpenDialog_data + +;dph [MaxNumIcon] + +messages: + mcall 10 + sub eax,6 + jz MSGMouse + dec eax + jz MSGIPC + jmp messages + +MSGIPC: + call IPCCreateIcon + jmp messages + +MSGMouse: + mcall 37,0 ;GetMousePos + xor ebx,ebx + mov bx,ax + shr eax,16 + mov ecx,ebx + mov ebx,eax + + mcall 34 + cmp eax,1 + jne messages + + cmp [RButtonActiv],1 + je messages + + mov [MouseY],ecx + mov [MouseX],ebx + +MOUSE_STATE_LMB_HOLD = $00000001 +MOUSE_STATE_RMB_HOLD = $00000002 +MOUSE_EVENT_LMB_DOWN = $00000100 +MOUSE_EVENT_RMB_DOWN = $00000200 + + mcall 37,3 +;check LMB is pressed + test eax, MOUSE_STATE_LMB_HOLD + jz @f + test eax, MOUSE_EVENT_LMB_DOWN + jz @f + jmp LButtonPress +@@: +;check RMB is pressed + test eax, MOUSE_STATE_RMB_HOLD + jz @f + test eax, MOUSE_EVENT_RMB_DOWN + jz @f + jmp RButtonPress +@@: + jmp messages + +ErrLoadLibs: + ;dps ' 㤠 㧨 室 ⥪' + ;debug_newline + jmp close +ErrorStrp: + ;dps '訡 icons32.png' + ;debug_newline +close: + mcall -1 + +LButtonPress: + + stdcall GetNumIcon,[MouseX],[MouseY],-1 +;int3 + cmp eax,-1 + jnz @f + + WaitLB1: + mcall 37,2 + test al,001b + jz messages + ;Yield + mcall 5,1 + jmp WaitLB1 + + + @@: + push eax + stdcall DrawIcon,eax,1 + WaitLB: + mcall 37,2 + test al,001b + jz endWaitLB + + mcall 37,0 + xor ebx,ebx + mov bx,ax + shr eax,16 + sub eax,[MouseX] + jns @f + neg eax + @@: + sub ebx,[MouseY] + jns @f + neg ebx + @@: + cmp [bFixIcons],0 + jne @f + cmp eax,MIN_NO_MOVING + ja MovingIcon + cmp ebx,MIN_NO_MOVING + ja MovingIcon + @@: + ;Yield + mcall 5,1 ;Sleep 1 + + jmp WaitLB + endWaitLB: + + mcall 37,0 + xor ebx,ebx + mov bx,ax + shr eax,16 + mov ecx,ebx + mov ebx,eax + mov [MouseX],ebx + mov [MouseY],ecx + + stdcall GetNumIcon,[MouseX],[MouseY],-1 + cmp eax,[esp] ;[esp] = + jne @f + + mov edi,[IconsOffs+eax*4] + or ecx,-1 + xor al,al + repne scasb + mov ebx,edi + repne scasb + ;run program + mov dword[fiRunProg+8],edi + mov dword[fiRunProg+21],ebx + mcall 70,fiRunProg + + test eax,80000000h + jz @f + + mov dword[fiRunProg+8],ErrRunProg + mov dword[fiRunProg+21],pthNotify + mcall 70,fiRunProg + + @@: + pop eax + stdcall RestoreBackgrnd,eax + mcall 5, 60 + jmp messages + +;------------------------------------------------------------------------------- +MovingIcon: + stdcall GetNumIcon,[MouseX],[MouseY],-1 + mov [SelIcon],eax + mov [IconNoDraw],eax + stdcall RestoreBackgrnd,[SelIcon] + +; mov ecx,[MaxNumIcon] +; xor ebx,ebx +; .MI: push ecx +; cmp ebx,[SelIcon] +; je @f +; stdcall DrawIcon,ebx,0 +; @@: +; inc ebx +; pop ecx +; loop .MI + + + +;dps 'Moving' +;debug_newline +; mov edi,[SelIcon] +; mov edi,[IconsOffs+edi*4] +; or ecx,-1 +; xor al,al +; repne scasb +; repne scasb +; repne scasb +; repne scasb +; xor ebx,ebx +; xor esi,esi +; mov bx,word[edi+2] +; mov si,word[edi] +; stdcall GetNumIcon,ebx,esi,[SelIcon] +; cmp eax,-1 +; je @f +; dps 'Q' +; stdcall DrawIcon,eax,0 +; @@: +; +; add ebx,ICON_SIZE-1 +; stdcall GetNumIcon,ebx,esi,[SelIcon] +; cmp eax,-1 +; je @f +; dps 'Q' +; stdcall DrawIcon,eax,0 +; +; @@: +; add esi,ICON_SIZE-1 +; stdcall GetNumIcon,ebx,esi,[SelIcon] +; cmp eax,-1 +; je @f +; dps 'Q' +; stdcall DrawIcon,eax,0 +; +; @@: +; sub ebx,ICON_SIZE-1 +; stdcall GetNumIcon,ebx,esi,[SelIcon] +; cmp eax,-1 +; je @f +; dps 'Q' +; stdcall DrawIcon,eax,0 +; @@: + + +; Sleep 40 + +;qweqwe: + + mov [MovingActiv],1 + mcall 51,1,MovingWnd,stack_mov ;CreateThread MovingWnd,stack_dlg + .WaitLB: + mcall 37,2 ;GetMouseKey + test al,001b + jz .endWaitLB + + ;Yield + mcall 5,1 ;Sleep 1 + jmp .WaitLB + .endWaitLB: + + + mcall 37,0 ;GetMousePos + xor ebx,ebx + mov bx,ax + shr eax,16 + + sub eax,1+ICON_SIZE/2 + jnc @f + xor eax,eax + @@: + + sub ebx,ICON_SIZE/2-7 + jnc @f + xor ebx,ebx + @@: + + cmp ax,[wsX] + jae @f + mov ax,[wsX] + @@: + + cmp bx,[wsY] + jae @f + mov bx,[wsY] + @@: ;eax,ebx - ॠ쭠 न. न ண ⭮⥫쭮 孥 㣫 ࠡ祩 + + xor edx,edx + mov dx,[wsXe] + sub edx,ICON_SIZE + cmp eax,edx + jbe @f + mov eax,edx + @@: + + mov dx,[wsYe] + sub edx,ICON_SIZE + cmp ebx,edx + jbe @f + mov ebx,edx + @@: + + xor edx,edx ;८ࠧ뢠 ⭮⥫ + mov dx,[wsW] + shr edx,1 + add dx,[wsX] + cmp eax,edx + jbe @f + sub ax,[wsXe] + inc ax + jmp .mov1 + @@: + sub ax,[wsX] + .mov1: + + xor edx,edx + mov dx,[wsH] + shr edx,1 + add dx,[wsY] + cmp ebx,edx + jbe @f + sub bx,[wsYe] + inc bx + jmp .mov2 + @@: + sub bx,[wsY] + .mov2: + + stdcall SetPosition,[SelIcon],eax,ebx + + m2m [PIcoDB],[BegData] + stdcall [ini_enum_sections],IconIni,Ini_SavePos ;in RButton.inc + + mov [bNotSave],1 + mov [IconNoDraw],-1 + + mov [MovingActiv],0 ;⮫쪮 ⥯ ⪫砥 + + jmp messages + +;------------------------------------------------------------------------------- + +RButtonPress: + mov [RButtonActiv],1 + + @@: + mcall 37,2 ;GetMouseKey + test al,010b + jz @f + mcall 5,1 ;Yield + jmp @b + @@: + + mcall 51,1,RButtonWin,stack_rmenu ;CreateThread RButtonWin,stack_rmenu + + jmp messages + + +;############################################################################### +;ret eax = 1/0 = 㤠/訡 +proc DrawIcon NumIcon:DWORD,Activ:DWORD ;NumIcon = 0..n +local IconData:DWORD + push ebx edi esi + + mov ecx,ICON_SIZE*ICON_SIZE + xor eax,eax + mov edi,IconArea + rep stosd + + mov eax,[NumIcon] + cmp eax,[MaxNumIcon] + jb @f + xor eax,eax + pop esi edi ebx + ret + @@: + + mov esi,[IconsOffs+eax*4] + mov [IconData],esi + + ;㥬 ⥪ + mov edi,esi + xor al,al + or ecx,-1 + repne scasb + mov edx,esi + mov eax,edi + sub eax,esi + dec eax + shl eax,1 ;*6 + lea eax,[eax*2+eax] + mov ebx,ICON_SIZE + sub ebx,eax + shr ebx,1 ;ebx = x ⥪ + shl ebx,16 + mov bx,ICON_SIZE + sub bx,TEXT_BOTTOM_Y + mov ecx,88000000h + mov edi,IconAreaH + add ebx,-1*10000h+0 + mcall 4 + add ebx,2*10000h+0 + mcall ;4 + add ebx,-1*10000h-1 + mcall ;4 + add ebx,0*10000h+2 + mcall ;4 + add ebx,1*10000h+0 + mcall ;4 + inc ebx;add ebx,0*10000h+1 + mcall ;4 + add ebx,-1*10000h+0 + mcall ;4 + add ebx,0*10000h-2 + mov ecx,88FFFFFFh + mcall ;4 + ;㥬 ⨭ + + mov edi,esi + xor al,al + or ecx,-1 + repne scasb + repne scasb + repne scasb + + ;stdcall hexToInt,edi + stdcall strToInt,edi + @@: ;eax=num icon + cmp eax,[icon_count] + jb @f + xor eax,eax + @@: + test eax,eax + je DI1 + mov ecx,eax + xor eax,eax + @@: + add eax,IMG_SIZE*IMG_SIZE*4 + loop @b + DI1: + add eax,[raw_pointer] + add eax,0+4*11 + mov esi,eax + + CopyToMem: + mov edi,IconArea+((IMAGE_TOP_Y*ICON_SIZE)+((ICON_SIZE-IMG_SIZE)/2))*4 + + mov eax,IMG_SIZE + mov edx,eax + @@: + mov ecx,eax + rep movsd + add edi,(ICON_SIZE-IMG_SIZE)*4 + dec edx + jnz @b + +;----------------- + ;᫨ , 㥬 + cmp [Activ],0 + je .NoSelect + + mov edi,IconArea + mov eax,0FF000000h + mov ecx,ICON_SIZE + rep stosd + ;mov edi,IconArea+ICON_SIZE*1 + + mov ecx,ICON_SIZE-1 + @@: mov dword[edi],eax + add edi,(ICON_SIZE)*4 + loop @b + + mov edi,IconArea+ICON_SIZE*2*4-4 + mov ecx,ICON_SIZE-1 + @@: mov dword[edi],eax + add edi,(ICON_SIZE)*4 + loop @b + + mov edi,IconArea+ICON_SIZE*(ICON_SIZE-1)*4+4 + mov ecx,ICON_SIZE-2 + rep stosd + + + mov edi,IconArea+ICON_SIZE*4+4 + mov eax,0FFFFFFFFh + mov ecx,ICON_SIZE-2 + rep stosd + + mov edi,IconArea+ICON_SIZE*4+4 + mov ecx,ICON_SIZE-2 + @@: mov dword[edi],eax + add edi,(ICON_SIZE)*4 + loop @b + + mov edi,IconArea+ICON_SIZE*2*4-4*2 + mov ecx,ICON_SIZE-3 + @@: mov dword[edi],eax + add edi,(ICON_SIZE)*4 + loop @b + + mov edi,IconArea+ICON_SIZE*(ICON_SIZE-2)*4+4*2 + mov ecx,ICON_SIZE-3 + rep stosd +;-------------- + + .NoSelect: + mov edi,[IconData] + xor al,al + or ecx,-1 + repne scasb + repne scasb + repne scasb + repne scasb + mov edx,[edi] + + test edx,00008000h + jz @f + add dx,[wsYe] + jmp .DI11 + @@: + add dx,[wsY] + .DI11: + + test edx,80000000h + jz @f + mov ax,[wsXe] + shl eax,16 + add edx,eax + jmp .DI12 + @@: + mov ax,[wsX] + shl eax,16 + add edx,eax + .DI12: + + mov ebx,IconArea + mov ecx,ICON_SIZE*10000h+ICON_SIZE + mcall 25 + +; mov eax,1 + pop esi edi ebx + ret +endp + +proc RestoreBackgrnd,NumIcon:DWORD + push ebx edi + mov eax,[NumIcon] + cmp eax,[MaxNumIcon] + jb @f + xor eax,eax + pop edi ebx + ret + @@: + + mov edi,[IconsOffs+eax*4] + xor al,al + or ecx,-1 + repne scasb + repne scasb + repne scasb + repne scasb + + mov ax,[edi+2] + test ax,8000h + jz @f + add ax,[wsXe] + jmp .rbg1 + @@: + add ax,[wsX] + .rbg1: + + mov bx,[edi] + test bx,8000h + jz @f + add bx,[wsYe] + jmp .rbg2 + @@: + add bx,[wsY] + .rbg2: + + mov cx,ax + shl ecx,16 + add ax,ICON_SIZE + mov cx,ax + mov dx,bx + shl edx,16 + add bx,ICON_SIZE + mov dx,bx + dec ecx + dec edx + mcall 15,9 + pop edi ebx + ret +endp + + ; MaxNumIcon,IconsOffs +proc FillIconsOffs + push ebx edi + mov edi,[BegData] + mov dword[MaxNumIcon],0 + cmp dword[edi],0 + jne @f + mov dword[IconsOffs],0 + pop edi ebx + ret + @@: + + mov [IconsOffs],edi + xor al,al + xor edx,edx + mov ebx,dword[SizeData] + add ebx,dword[BegData] + or ecx,-1 + .CalcNumIc: + + repne scasb + repne scasb + repne scasb + repne scasb + add edi,4 + mov dword[IconsOffs+edx+4],edi + inc dword[MaxNumIcon] + add edx,4 + + cmp edi,ebx + jae @f + jmp .CalcNumIc + @@: + + mov dword[IconsOffs+edx],0 + + pop edi ebx + ret +endp + +proc LoadIconsData stdcall,f_name,sec_name + push ebx esi edi + + mov edi,secRButt + mov esi,[sec_name] + @@: lodsb + scasb + jnz .lid1 + test al,al + jnz @b + + mov eax,1 + pop edi esi ebx + ret + .lid1: + + + mov ebx,[sec_name] ;㥬 ID + mov ax,[ebx] + mov edi,[nLoadIcon] + mov word[edi*4+IconsID],ax + mov word[edi*4+IconsID+2],0 + + mov edi,[PIcoDB] + stdcall [ini_get_str],[f_name],[sec_name],keyName,edi,4096,0 + test eax,eax + jz @f + xor eax,eax + pop edi esi ebx + ret + @@: + xor al,al + or ecx,-1 + repne scasb + + + + stdcall [ini_get_str],[f_name],[sec_name],keyPath,edi,4096,0 + test eax,eax + jz @f + xor eax,eax + pop edi esi ebx + ret + @@: + xor al,al + or ecx,-1 + repne scasb + + stdcall [ini_get_str],[f_name],[sec_name],keyParams,edi,4096,0 + test eax,eax + jz @f + xor eax,eax + pop edi esi ebx + ret + @@: + xor al,al + or ecx,-1 + repne scasb + + stdcall [ini_get_str],[f_name],[sec_name],keyIco,edi,4096,0 + test eax,eax + jz @f + xor eax,eax + pop edi esi ebx + ret + @@: + xor al,al + or ecx,-1 + repne scasb + + stdcall [ini_get_int],[f_name],[sec_name],keyX,80000000h + cmp eax,80000000h + jne @f + xor eax,eax + pop edi esi ebx + ret + @@: + mov word[edi+2],ax + + stdcall [ini_get_int],[f_name],[sec_name],keyY,80000000h + cmp eax,80000000h + jne @f + xor eax,eax + pop edi esi ebx + ret + @@: + mov word[edi],ax + add edi,4 + mov [PIcoDB],edi + + inc [nLoadIcon] + + mov eax,1 + pop edi esi ebx + ret +endp + +proc GenerateID ;ax = ID + push ebx edi + mov ebx,[MaxNumIcon] + test ebx,ebx + jnz @f + mov eax,'00' + pop edi ebx + ret + @@: + + mov eax,dword[IconsID+ebx*4-4] + .inc: + inc ah + cmp ah,'9'+1 + jne @f + mov ah,'A' + @@: + cmp ah,'F'+1 + jne @f + mov ah,'0' + inc al + @@: + cmp al,'9'+1 + jne @f + mov al,'A' + @@: + cmp al,'F'+1 + jne @f + mov al,'0' + @@: + + + mov edi,IconsID + ;cmp dword[edi],0 + ;je @f + mov ecx,100h + @@: scasd + je .inc + cmp dword[edi],0 + je @f + loop @b + @@: + + pop edi ebx + ret +endp + +;------------------------------------------------------------------------------- + + +;ଠ IPC-ᮮ饭 +;dd X +;dd Y +;asciiz Icon - in decimal +;asciiz Name +;asciiz Path +;asciiz Params +;------------------------------------------------------------------------------- +proc IPCCreateIcon +locals + ix rd 1 + iy rd 1 +endl + + mov eax,IPCbuffer+8 + mov dword[IPCbuffer],1 + lea edx,[eax+8] + + m2m dword[ix],dword[edx] + m2m dword[iy],dword[edx+4] + + lea esi,[edx+8] + + mov ecx,256 + mov edi,DAreaIcon + @@: lodsb + stosb + test al,al + jnz @b + + mov ecx,NAME_LENGTH+1 + mov edi,DAreaName + @@: lodsb + stosb + test al,al + jz @f + loop @b + @@: + + mov edi,DAreaPath + @@: lodsb + stosb + test al,al + jnz @b + + mov edi,DAreaParams + @@: lodsb + stosb + test al,al + jnz @b + + mov dword[IPCbuffer+4],8 + mov dword[IPCbuffer],0 + + stdcall AddIcon,[ix],[iy],DAreaIcon,DAreaName,DAreaPath,DAreaParams + + mcall 15,3 + ret +endp + + +include 'iconman.inc' +include 'bgredraw.inc' +include 'RButton.inc' +include 'DlgAdd.inc' +include 'Moving.inc' + +;'Eolite',0,'/sys/File managers/eolite',0,'/hd0/3/Muzik',0,'1',0,00010001h +;------------------------------------------------------------------------------- +;##### DATA #################################################################### +;------------------------------------------------------------------------------- +; not change this section!!! +; start section +;------------------------------------------------------------------------------ +align 4 +image_file dd 0 ;+0 +raw_pointer dd 0 ;+4 +return_code dd 0 ;+8 +img_size dd 0 ;+12 +deflate_unpack dd 0 ;+16 ; not use for scaling +raw_pointer_2 dd 0 ;+20 ; not use for scaling +;------------------------------------------------------------------------------ +; end section +;------------------------------------------------------------------------------ + + +align 4 +fiStdIco: + dd 5 + dd 0 + dd 0 +.size dd 0 +.point dd bufStdIco + db ICON_STRIP,0 + + +align 4 +fiRunProg: ; ᪠ ணࠬ + dd 7 + dd 0 + dd 0 + dd 0 + dd ErrNotFoundIni + db 0 + dd pthNotify + +fiIni dd 5 ; ini 䠩 + dd 0 + dd 0 + dd 0 + dd bufIni + db 0 + dd IconIni + + +IconsFile db ICON_STRIP,0 + +align 4 +MaxNumIcon dd 0 ;⢮ +IconNoDraw dd -1 ;-1 , ᮢ( ᪠ ) + +bFixIcons dd 1 +bNotSave dd 0 + +LButtonActiv dd 0 +RButtonActiv dd 0 +MovingActiv dd 0 +DlgAddActiv dd 0 + +IconIni db ICON_INI,0 + +pthNotify db '/sys/@notify',0 + +keyName db 'name',0 +keyPath db 'path',0 +keyParams db 'param',0 +keyIco db 'ico',0 +keyX db 'x',0 +keyY db 'y',0 + +;------------------------------------------------------------------------------- +IMPORTS: +library cnv_png ,'cnv_png.obj',\ + archiver,'archiver.obj',\ + box_lib ,'box_lib.obj',\ + proc_lib,'proc_lib.obj',\ + libini ,'libini.obj' + +import cnv_png,\ + cnv_png_import.Start ,'START',\ + cnv_png_import.Version ,'version',\ + cnv_png_import.Check ,'Check_Header',\ + cnv_png_import.Assoc ,'Associations' + +import archiver,\ + unpack_DeflateUnpack2 ,'deflate_unpack2' + +import box_lib,\ + edit_box_draw ,'edit_box_draw',\ + edit_box_key ,'edit_box_key',\ + edit_box_mouse ,'edit_box_mouse',\ + scrollbar_h_draw ,'scrollbar_h_draw',\ + scrollbar_h_mouse ,'scrollbar_h_mouse' + +import proc_lib,\ + OpenDialog_Init ,'OpenDialog_init',\ + OpenDialog_Start ,'OpenDialog_start' + +import libini,\ + ini_enum_sections ,'ini_enum_sections',\ + ini_enum_keys ,'ini_enum_keys',\ + ini_get_str ,'ini_get_str',\ + ini_set_str ,'ini_set_str',\ + ini_get_color ,'ini_get_color',\ + ini_get_int ,'ini_get_int',\ + ini_set_int ,'ini_set_int',\ + ini_del_section ,'ini_del_section',\ + ini_exist_sect ,'ini_exist_sect' + + +;ini.get_str (f_name, sec_name, key_name, buffer, buf_len, def_val) +;ini.set_str (f_name, sec_name, key_name, buffer, buf_len) + + +;------------------------------------------------------------------------------- +;----- RButton.inc ------------------------------------------------------------- +;------------------------------------------------------------------------------- + +if lang eq ru_RU + MinRMenuW dd 18*6+10 +else ; Default to en_US + MinRMenuW dd 15*6+10 +end if + +secRButt db 'rbmenu',0 + +curpath db '/sys',0 + +PredItem dd -1 + +if lang eq ru_RU + RMenuRedrawFon db 'ᮢ',0 + RMenuAlign db '஢ ⪥',0 + RMenuOffMoving db '९ ',0 + RMenuOnMoving db '९ ',0 + RMenuAdd db '',0 + RMenuDel db '',0 + RMenuProp db '⢠',0 +else ; Default to en_US + RMenuRedrawFon db 'Redraw',0 + RMenuAlign db 'Snap to grid',0 + RMenuOffMoving db 'Fix the icons',0 + RMenuOnMoving db 'Unfix the icons',0 + RMenuAdd db 'Add',0 + RMenuDel db 'Delete',0 + RMenuProp db 'Properties',0 +end if + +if lang eq ru_RU + ErrRunProg db '訡 ᪠ ணࠬ',0 + WarningSave db ' ࠭ , RDSave',0 + ErrNotFoundIni db ' icon.ini',0 + ErrName db ' "rbmenu" १ࢨ஢',0 +else ; Default to en_US + ErrRunProg db 'Error running program',0 + WarningSave db 'Remember to save changes with "RDSave"',0 + ErrNotFoundIni db 'icon.ini not found',0 + ErrName db 'The name "rbmenu" reserved',0 +end if + +;------------------------------------------------------------------------------- +;------- AddDlg.inc --------------------------------------------------------------- +;------------------------------------------------------------------------------- +if lang eq ru_RU +DTitleAdd db ' ',0 +DTitleProp db ' ',0 + +DCaptName db ' ',0 +DCaptPath db ' ',0 +DCaptParams db ' ',0 +;DCaptChange db '.',0 +DCaptCreate db '',0 +DCaptProperties db '',0 +DCaptCancel db '⬥',0 + +else ; Default to en_US +DTitleAdd db 'Add icon',0 +DTitleProp db 'Change icon',0 + +DCaptName db ' Name',0 +DCaptPath db ' Path',0 +DCaptParams db ' Params',0 +DCaptCreate db 'Create',0 +DCaptProperties db 'Change',0 +DCaptCancel db 'Cancel',0 +end if +DCaptDots db '...',0 + +;/ +edtName edit_box NAME_LENGTH*8+4,120+IMG_SIZE,6,0FFFFFFh,06F9480h,0FFh,0h,0x90000000,NAME_LENGTH,\ + DAreaName,mouse_dd,0,0,0 +edtExePath edit_box END_ICONS_AREAW-120-IMG_SIZE-40,120+IMG_SIZE,30,0FFFFFFh,06F9480h,\ + 0FFh,0h,0x90000000,255, DAreaPath,mouse_dd,0,0,0 +edtParams edit_box END_ICONS_AREAW-120-IMG_SIZE, 120+IMG_SIZE,54,0FFFFFFh,06F9480h,\ + 0FFh,0h,0x90000000,255, DAreaParams,mouse_dd,0,0,0 +edtIcon edit_box 28,24,62,0FFFFFFh,0FFFFFFh,0FFh,0h,0x90000000,3,\ + DAreaIcon,0,0,0,0 +endEdits: +;\ + +sbIcons: + dw END_ICONS_AREAW-ICONSX + dw ICONSX + dw 15 + dw END_ICONS_AREAH+3 + dd 0 + dd 1 + .max_area dd 0 + .cur_area dd ICONS_DRAW_COUNTW + .position dd 0 + .bckg_col dd 0 + .frnt_col dd 0 + .line_col dd 0 + .redraw dd 0 + .delta dd 0 + .delta2 dd 0 + .r_size_x dw 0 + .r_start_x dw 0 + .r_size_y dw 0 + + .r_start_y dw 0 + .m_pos dd 0 + .m_pos2 dd 0 + .m_keys dd 0 + .run_size dd 0 + .position2 dd 0 + .work_size dd 0 + .all_redraw dd 0 + .ar_offset dd 0 + +;------------------------------------------------------------------------------- +OpenDialog_data: +.type dd 0 +.procinfo dd RBProcInfo ;+4 +.com_area_name dd communication_area_name ;+8 +.com_area dd 0 ;+12 +.opendir_pach dd temp_dir_pach ;+16 +.dir_default_pach dd communication_area_default_pach ;+20 +.start_path dd open_dialog_path ;+24 +.draw_window dd DRedrawWin;draw_window_for_OD ;+28 +.status dd 0 ;+32 +.openfile_pach dd DAreaPath;fname_Info ;+36 +.filename_area dd 0;DAreaPath ;+40 +.filter_area dd Filter +.x: +.x_size dw 420 ;+48 ; Window X size +.x_start dw 100 ;+50 ; Window X position +.y: +.y_size dw 320 ;+52 ; Window y size +.y_start dw 100 ;+54 ; Window Y position + +communication_area_name: + db 'FFFFFFFF_open_dialog',0 +open_dialog_path: + db '/sys/File managers/opendial',0 + +communication_area_default_pach: + db '/sys',0 + +Filter dd 0 + +;open_dialog db 0 +;------------------------------------------------------------------------------- + +;/ ࠧ +align 4 +IconAreaH dd ICON_SIZE,ICON_SIZE +I_END: +;##### UDATA ################################################################### +IconArea rb 4*ICON_SIZE*ICON_SIZE +;\ + +sc system_colors +sc.workL rd 1 +sc.workH rd 1 + + +align 4 +IPCbuffer rb 1024 + +align 4 + +ScreenW rw 1 +ScreenH rw 1 +wsX rw 1 +wsY rw 1 +wsXe rw 1 +wsYe rw 1 +wsW rw 1 +wsH rw 1 + + +MouseX rd 1 +MouseY rd 1 + +RBSlot rd 1 +AddX rd 1 +AddY rd 1 + +SelIcon rd 1 +DlgSelIcon rd 1 +slotDlgAdd rd 1 +DlgBufImg rb IMG_SIZE*IMG_SIZE*3 + +align 4 +bufStdIco rb 40 +IconsOffs rd 100h ;⠡ 㪠⥫ﬨ ( ᪮७) +PIcoDB rd 1 ;㪠⥫ 䮩 +nLoadIcon rd 1 ; ⠥ ini +IconsID rd 100h ;ID - 2 a + 0 + ࠢ騩 - ப 2 ᭠묨 ࠬ + +nameSection rb 4 + +align 4 +icon_count rd 1 +strip_file rd 1 +strip_file_size rd 1 + +cur_band_compensation rd 1 + +;---- RButton ----------------------------------------------------------------------- + +bufIni rb 40 +NumMenuButt rd 1 +RBMenuCP rd MAX_USER_BUTTONS*2 ;㪠⥫ ண (Caption(dd), Path(dd)) ᭮ (dd) 饣 +RMenuW rw 1 +RMenuH rw 1 + +MaxPage rd 1 +mouse_dd rd 1 + +DAreaName rb NAME_LENGTH+1 +DAreaPath rb 255+1 +DAreaParams rb 255+1 +DAreaIcon rb 255+1 + +align 4 +RBProcInfo rb 1024 +align 4 + + +;------ OpenDialog ------------------------------- +temp_dir_pach rb 1024 +fname_Info rb 1024 + +;------------------------------------------------------------------------------- + rb 512 +stack_mov: ;६ ᪠ ঠ +stack_rmenu: + rb 512 +stack_dlg: + rb 512 +stack_bredraw: + rb 512 +stack_main: +;------------------------------------------------------------------------------ + + + + +ENDMEM: