From 8ee81af2d314befd4802c725166be8ba806ea4cc Mon Sep 17 00:00:00 2001 From: GerdtR Date: Fri, 11 Oct 2013 12:39:43 +0000 Subject: [PATCH] Modified icon.ini . Icons do not get dirty. Fixed bug with moving icons. git-svn-id: svn://kolibrios.org@4007 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/icon_new/@icon.asm | 28 +++++++++++---------------- programs/system/icon_new/DlgAdd.inc | 24 ++++++++++++++++------- programs/system/icon_new/bgredraw.inc | 10 ++++++++++ programs/system/icon_new/icon.ini | 7 +++---- 4 files changed, 41 insertions(+), 28 deletions(-) diff --git a/programs/system/icon_new/@icon.asm b/programs/system/icon_new/@icon.asm index c6db7aed3..e1185d235 100644 --- a/programs/system/icon_new/@icon.asm +++ b/programs/system/icon_new/@icon.asm @@ -1,5 +1,3 @@ -;На потом: добавит загрузку ico и возможность выбора иконки не из iconstrp - ICONS_DAT equ '/rd/1/icons.dat' ICON_STRIP equ '/rd/1/iconstrp.png' ICON_SIZE equ 68 @@ -29,8 +27,8 @@ BegData equ fiStdIco.point 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 I_END ; size of image + dd ENDMEM ; memory for app dd stack_area ; esp dd 0 ; boot parameters dd 0 ; path @@ -140,14 +138,8 @@ START: ; start of execution and eax,0FFh mov [sbIcons.max_area],eax - ; int3 -; mov eax,1 -; mov eax,[IconsOffs+eax*4] -; stdcall [ini_del_section],IconIni,eax -; ret - ;jmp MSGRedrawIcons mcall 51,1,BGRedrawThread,stack_bredraw - + stdcall [OpenDialog_Init],OpenDialog_data messages: mcall 10 @@ -357,7 +349,7 @@ MovingIcon: mcall 5,1 ;Sleep 1 jmp .WaitLB .endWaitLB: - mov [MovingActiv],0 + mcall 37,0 ;GetMousePos xor ebx,ebx @@ -416,7 +408,8 @@ MovingIcon: mov [bNotSave],1 mov [IconNoDraw],-1 - mcall 15,3 + + mov [MovingActiv],0 ;только теперь отключаем окно с мышью jmp messages @@ -515,8 +508,6 @@ local IconData:DWORD jne GetIconInd PathToIcon: - ;stdcall LoadIcon,edi - ;mov esi,eax mov al,30h ;заглушка!!!!!!!!!!!!! mov byte[edi+1],0 @@ -1158,6 +1149,7 @@ IconNoDraw dd -1 ;-1 bFixIcons dd 1 bNotSave dd 0 +bIcoBuff dd 0 ;1, если IconArea занят LButtonActiv dd 0 RButtonActiv dd 0 @@ -1256,7 +1248,7 @@ else ErrRunProg db 'Error runing program',0 WarningSave db 'Do not forget to save the changes, run the RDSave',0 ErrNotFoundIni db 'icon.ini not found',0 - ErrName db 'The Name "rbmenu" reserved',0 + ErrName db 'The name "rbmenu" reserved',0 end if @@ -1342,7 +1334,7 @@ OpenDialog_data: .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 DRedraw;draw_window_for_OD ;+28 +.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 @@ -1375,6 +1367,8 @@ I_END: IconArea rb 4*ICON_SIZE*ICON_SIZE ;\ + + ScreenX rw 1 ScreenY rw 1 diff --git a/programs/system/icon_new/DlgAdd.inc b/programs/system/icon_new/DlgAdd.inc index a14da80c2..ada57d76d 100644 --- a/programs/system/icon_new/DlgAdd.inc +++ b/programs/system/icon_new/DlgAdd.inc @@ -142,7 +142,7 @@ DReDraw: edit_boxes_set_sys_color edtParams,edtIcon,sc ;edit_boxes_set_sys_color edtIcon,endEdits,sc - call DRedraw + call DRedrawWin DMessages: mcall 10 ;WaitMessage @@ -201,9 +201,9 @@ DNextEdit: .DNE3: and [edtParams.flags],not ed_focus - or [edtIcon.flags],ed_focus + or [edtName.flags],ed_focus stdcall [edit_box_draw],edtParams - stdcall [edit_box_draw],edtIcon + stdcall [edit_box_draw],edtName jmp DMessages ;.DNE4: @@ -312,7 +312,7 @@ DMouse: .RedrawNum: -; stdcall [edit_box_draw],edtIcon + ; stdcall [edit_box_draw],edtIcon call DrawSelIcon @@ -377,7 +377,7 @@ DExit: mcall -1 ;ExitThread ;################################################################## -proc DRedraw +proc DRedrawWin mcall 12,1 ;RedrawWinBeg mov edx,[sc.work] or edx,34000000h @@ -474,6 +474,15 @@ local IcoX:DWORD,\ IcoY:DWORD,\ iIcon:DWORD + @@: ;ждём, когда освободится буффер + cmp [bIcoBuff],1 + jne @f + mcall 5,1 + jmp @b + @@: + + mov [bIcoBuff],1 ;блокируем IconArea + mov ecx,[sbIcons.position] xor eax,eax m2m dword[iIcon],0 @@ -491,7 +500,6 @@ local IcoX:DWORD,\ mov [IcoX],ICONSX - mov ecx,ICONS_DRAW_COUNTW .DrawIcons: push ecx @@ -517,7 +525,7 @@ local IcoX:DWORD,\ mov eax,[sc.work] @@: - mov word[edi],ax + mov [edi],ax shr eax,16 mov [edi+2],al add edi,3 @@ -585,6 +593,8 @@ local IcoX:DWORD,\ loop .DrawIcons2 .endProc: + + mov [bIcoBuff],0 ;разблокируем буфер ret endp diff --git a/programs/system/icon_new/bgredraw.inc b/programs/system/icon_new/bgredraw.inc index 23140bb33..af2725854 100644 --- a/programs/system/icon_new/bgredraw.inc +++ b/programs/system/icon_new/bgredraw.inc @@ -3,6 +3,15 @@ BGRedrawThread: mcall 40,010000b BGRTRedrawIcons: + @@: + cmp [bIcoBuff],1 ;для блокировки пререрисовки иконок + jne @f + mcall 5,1 + jmp @b + @@: + + mov [bIcoBuff],1 + mcall 48,5 mov dx,ax shr eax,16 @@ -27,6 +36,7 @@ BGRTRedrawIcons: loop @b .NoDraw: + mov [bIcoBuff],0 BGRTmessages: diff --git a/programs/system/icon_new/icon.ini b/programs/system/icon_new/icon.ini index 47f09435c..ece8521a9 100644 --- a/programs/system/icon_new/icon.ini +++ b/programs/system/icon_new/icon.ini @@ -1,9 +1,8 @@ [rbmenu] -Консоль=/rd/1/shell -Диспетчер процессов=/rd/1/cpu -Управление темой=desktop Настройка устройств=setup -menucolor=128,128,128 +Управление темой=desktop +Диспетчер процессов=/rd/1/cpu +Консоль=/rd/1/shell [KFM] path=/SYS/FILE MANAGERS/KFM param=