Changed the structure icon.ini. Now you can create icons with repetitive or empty names.

git-svn-id: svn://kolibrios.org@4336 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
GerdtR 2013-12-09 21:02:13 +00:00
parent 6680b2725e
commit f7d0d2b128
6 changed files with 688 additions and 535 deletions

View File

@ -1,15 +1,14 @@
;¨­®£¤  ­¥¢¥à­® ®¯à¥¤¥«ï¥âáï è¨à¨­  ¬¥­î誨
ICONS_DAT equ '/rd/1/icons.dat'
ICON_STRIP equ '/rd/1/iconstrp.png' ICON_STRIP equ '/rd/1/iconstrp.png'
ICON_SIZE equ 68 ICON_INI equ '/rd/1/settings/icon.ini'
IMG_SIZE equ 32 ICON_SIZE equ 68 ;à §¬¥à ®¡« á⨠¤«ï ¨ª®­ª¨ á ­ ¤¯¨áìî
TEXT_BOTTOM_Y equ 14 IMG_SIZE equ 32 ;à §¬¥à ¨ª®­®ª
IMAGE_TOP_Y equ 10 ;>=1 TEXT_BOTTOM_Y equ 14 ;®âáâ㯠¯® Y ⥪áâ  ®â ­¨§  ¨ª®­ª¨
ALIGN_SIZE equ 68 IMAGE_TOP_Y equ 10 ;>=1 Š®®à¤¨­ â  Y ¨ª®­ª¨ ¢ ®¡« á⨠¤«ï ¤ ­­®© ¨ª®­ª¨
NAME_LENGTH equ 11 ALIGN_SIZE equ 68 ;à §¬¥à á¥âª¨ ¢ëà ¢­¨¢ ­¨ï
MIN_NO_MOVING equ 8 NAME_LENGTH equ 11 ;¤«¨­  ¨¬¥­¨ ¨ª®­ª¨
;¤«ï ¤¨ «®£  ᮧ¤ ­¨ï/। ªâ¨à®¢ ­¨ï MIN_NO_MOVING equ 8 ;ç¥à¥§ á⮫쪮 ¯¨ªá¥«¥© ᤢ¨£  ¬ëè¨ ­ ç¨­ ¥âáï â áª ­¨¥ ¨ª®­ª¨
;--------¤«ï ¤¨ «®£  ᮧ¤ ­¨ï/। ªâ¨à®¢ ­¨ï
ICONSX equ 20 ICONSX equ 20
ICONSY equ 80 ICONSY equ 80
ICONS_DRAW_COUNTW equ 10 ;ª®«¨ç¥á⢮ ¨ª®­®ª ¢ è¨à¨­ã ICONS_DRAW_COUNTW equ 10 ;ª®«¨ç¥á⢮ ¨ª®­®ª ¢ è¨à¨­ã
@ -41,7 +40,6 @@ include '../../proc32.inc'
include '../../develop/libraries/box_lib/trunk/box_lib.mac' include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../dll.inc' include '../../dll.inc'
;include '../../debug.inc' ;include '../../debug.inc'
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
START: ; start of execution START: ; start of execution
mcall 68,11 mcall 68,11
@ -96,8 +94,8 @@ START: ; start of execution
;########## § £à㦠¥¬ ¤ ­­ë¥ ¨ª®­®ª ¢ ¯ ¬ïâì ########################## ;########## § £à㦠¥¬ ¤ ­­ë¥ ¨ª®­®ª ¢ ¯ ¬ïâì ##########################
mcall 70,fiIni ;¢ë¤¥«ï¥¬ ¯ ¬ïâì, ¤®áâ â®ç­®© ¤«ï åà ­¥­¨ï ini ä ©« . …ñ â®ç­® 墠â¨â ¤«ï åà ­¥­¨ï ¤ ­­ëå ®¡ ¨ª®­ª å mcall 70,fiIni ;¢ë¤¥«ï¥¬ ¯ ¬ïâì, ¤®áâ â®ç­®© ¤«ï åà ­¥­¨ï ini ä ©« .
test eax,eax test eax,eax ;…ñ â®ç­® 墠â¨â ¤«ï åà ­¥­¨ï ¤ ­­ëå ®¡ ¨ª®­ª å
jnz ErrorIni jnz ErrorIni
cmp dword[bufIni+32],0 cmp dword[bufIni+32],0
@ -113,6 +111,13 @@ START: ; start of execution
NoErrIni: NoErrIni:
m2m [PIcoDB],[BegData] m2m [PIcoDB],[BegData]
mov edi,IconsID
xor eax,eax
mov ecx,100h/4
rep stosd
mov [nLoadIcon],0
stdcall [ini_enum_sections],IconIni,LoadIconsData stdcall [ini_enum_sections],IconIni,LoadIconsData
;int3 ;int3
mov eax,dword[PIcoDB] mov eax,dword[PIcoDB]
@ -125,7 +130,6 @@ START: ; start of execution
mov dword[SizeData],0 mov dword[SizeData],0
@@: @@:
;###################################################################### ;######################################################################
call FillIconsOffs ;§ ¯®«­ï¥â MaxNumIcon,IconsOffs call FillIconsOffs ;§ ¯®«­ï¥â MaxNumIcon,IconsOffs
mcall 40,0100000b ;­ã¦­ë ⮫쪮 ᮡëâ¨ï ¬ëè¨, ¯¥à¥à¨á®¢ª  ¨ª®­®ª ¡ã¤¥â ¢ ¤à㣮¬ ¯®â®ª¥ mcall 40,0100000b ;­ã¦­ë ⮫쪮 ᮡëâ¨ï ¬ëè¨, ¯¥à¥à¨á®¢ª  ¨ª®­®ª ¡ã¤¥â ¢ ¤à㣮¬ ¯®â®ª¥
@ -143,6 +147,8 @@ START: ; start of execution
mcall 51,1,BGRedrawThread,stack_bredraw ;§ ¯ã᪠¥¬ ¯®â®ª ¯¥à¥à¨á®¢ª¨ ¨ª®­®ª mcall 51,1,BGRedrawThread,stack_bredraw ;§ ¯ã᪠¥¬ ¯®â®ª ¯¥à¥à¨á®¢ª¨ ¨ª®­®ª
stdcall [OpenDialog_Init],OpenDialog_data stdcall [OpenDialog_Init],OpenDialog_data
;dph [MaxNumIcon]
messages: messages:
mcall 10 mcall 10
sub eax,6 sub eax,6
@ -188,6 +194,7 @@ close:
mcall -1 mcall -1
LButtonPress: LButtonPress:
stdcall GetNumIcon,[MouseX],[MouseY],-1 stdcall GetNumIcon,[MouseX],[MouseY],-1
;int3 ;int3
cmp eax,-1 cmp eax,-1
@ -421,7 +428,6 @@ MovingIcon:
stdcall SetPosition,[SelIcon],eax,ebx stdcall SetPosition,[SelIcon],eax,ebx
m2m [PIcoDB],[BegData] m2m [PIcoDB],[BegData]
stdcall [ini_enum_sections],IconIni,Ini_SavePos ;in RButton.inc stdcall [ini_enum_sections],IconIni,Ini_SavePos ;in RButton.inc
@ -435,8 +441,6 @@ MovingIcon:
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
RButtonPress: RButtonPress:
cmp [RButtonActiv],1
je messages
mov [RButtonActiv],1 mov [RButtonActiv],1
@@: @@:
@ -657,8 +661,6 @@ local IconData:DWORD
ret ret
endp endp
proc RestoreBackgrnd,NumIcon:DWORD proc RestoreBackgrnd,NumIcon:DWORD
push ebx edi push ebx edi
mov eax,[NumIcon] mov eax,[NumIcon]
@ -710,308 +712,6 @@ proc RestoreBackgrnd,NumIcon:DWORD
ret ret
endp endp
;ret eax=numIcon
proc AddIcon stdcall,x,y,lpIcon,lpName,lpExeFile,lpParams
push ebx edi esi
mov eax,[x]
mov ebx,[y]
xor edx,edx
test eax,8000h
jnz @f
mov dx,[wsW] ;¥á«¨ ­ ¤®, â® ¯à¥®¡à §®¢ë¢ ¥¬ ¢
shr edx,1 ;®âà¨æ â¥«ì­ë¥ ª®®à¤¨­ âë
add dx,[wsX]
cmp eax,edx
jbe @f
sub ax,[wsW]
inc eax
@@:
test ebx,8000h
jnz @f
mov dx,[wsY]
shr edx,1
add dx,[wsH]
cmp ebx,edx
jbe @f
sub bx,[wsH]
inc ebx
@@:
;¯®¯à ¢ª  ­  á«ãç © ¢ë室  §  ªà © íªà ­ 
test eax,8000h
jnz @f
mov dx,[wsXe]
sub edx,ICON_SIZE
cmp eax,edx
jbe @f
mov eax,edx
@@:
test ebx,8000h
jnz @f
mov dx,[wsYe]
sub edx,ICON_SIZE
cmp ebx,edx
jbe @f
mov ebx,edx
@@:
mov [x],eax
mov [y],ebx
xor al,al
or ecx,-1
mov edi,[lpName]
repne scasb
sub edi,[lpName]
mov ebx,edi
mov edi,[lpExeFile]
repne scasb
sub edi,[lpExeFile]
add ebx,edi
mov edi,[lpParams]
repne scasb
sub edi,[lpParams]
add ebx,edi
mov edi,[lpIcon]
repne scasb
sub edi,[lpIcon]
add ebx,edi
add ebx,4
mov ecx,dword[SizeData]
add ecx,ebx
mov edx,[IconsOffs]
mcall 68,20
mov edx,dword[SizeData]
mov dword[SizeData],ecx
mov dword[BegData],eax
mov edi,eax
add edi,edx
mov esi,[lpName]
@@: lodsb
stosb
test al,al
jnz @b
mov esi,[lpExeFile]
@@: lodsb
stosb
test al,al
jnz @b
mov esi,[lpParams]
@@: lodsb
stosb
test al,al
jnz @b
mov esi,[lpIcon]
@@: lodsb
stosb
test al,al
jnz @b
mov eax,[x]
mov ebx,[y]
shl eax,16
mov ax,bx
mov dword[edi],eax
stdcall FillIconsOffs
pop esi edi ebx
ret
endp
proc EditIcon stdcall,NumIcon,lpIcon,lpName,lpExeFile,lpParams
push edi
mov eax,[NumIcon]
mov edi,[IconsOffs+eax*4]
xor al,al
or ecx,-1
repne scasb
repne scasb
repne scasb
repne scasb
push dword[edi]
stdcall DelIcon,[NumIcon]
pop edx
xor eax,eax
mov ax,dx
shr edx,16
stdcall AddIcon,edx,eax,DAreaIcon,DAreaName,DAreaPath,DAreaParams
pop edi
ret
endp
proc SetPosition stdcall,NumIcon,x,y
push edi
mov eax,[NumIcon]
mov edi,[IconsOffs+eax*4]
xor al,al
or ecx,-1
repne scasb
repne scasb
repne scasb
repne scasb
mov eax,[x]
shl eax,16
mov ax,word[y]
mov dword[edi],eax
pop edi
ret
endp
proc GetNumIcon stdcall,x,y,NumIconI ;­®¬¥à ¨ª®­ª¨, ª®â®àë© ¯à®¢¥àïâì ­¥ ­ ¤® ¨«¨ -1
local posX:WORD,\
posY:WORD
push ebx edi
mov ecx,[MaxNumIcon]
test ecx,ecx
jnz @f
or eax,-1
pop edi ebx
ret
@@:
mov ebx,ecx
dec ebx
.TestIcon:
cmp dword[NumIconI],-1
je @f
cmp ebx,[NumIconI]
jne @f
dec ebx
dec ecx
test ecx,ecx
jz .NoIcon
@@:
push ecx
or ecx,-1
xor al,al
mov edi,[IconsOffs+ebx*4]
repne scasb
repne scasb
repne scasb
repne scasb
mov ax,[edi+2]
test ax,8000h
jz @f
add ax,[wsXe]
jmp .gni1
@@:
add ax,[wsX]
.gni1:
mov [posX],ax
mov ax,[edi]
test ax,8000h
jz @f
add ax,[wsYe]
jmp .gni2
@@:
add ax,[wsY]
.gni2:
mov [posY],ax
mov eax,[x]
mov edx,[y]
cmp ax,[posX]
jb @f
add word[posX],ICON_SIZE
cmp ax,[posX]
ja @f
cmp dx,[posY]
jb @f
add word[posY],ICON_SIZE
cmp dx,[posY]
ja @f
jmp .OkIcon
@@:
dec ebx
pop ecx
;loop .TestIcon
dec ecx
jnz .TestIcon
jmp .NoIcon
.OkIcon:
mov eax,ebx
pop edi ebx
ret
.NoIcon:
or eax,-1
pop edi ebx
ret
endp
proc DelIcon stdcall,NumIcon
push ebx edi esi
cmp [MaxNumIcon],0
je .end
cmp [MaxNumIcon],1
je .OhneIco
mov ebx,[NumIcon]
mov eax,[MaxNumIcon]
dec eax
mov [MaxNumIcon],eax
cmp ebx,eax
je @f
shl ebx,2
mov ecx,dword[BegData]
add ecx,dword[SizeData]
sub ecx,[IconsOffs+4+ebx]
mov edx,[IconsOffs+4+ebx]
sub edx,[IconsOffs+ebx]
sub dword[SizeData],edx
mov esi,[IconsOffs+4+ebx]
mov edi,[IconsOffs+ebx]
rep movsb
jmp .endDel
@@:
mov ecx,dword[BegData]
add ecx,dword[SizeData]
sub ecx,[IconsOffs+ebx*4]
sub dword[SizeData],ecx
.endDel:
stdcall FillIconsOffs
jmp .end
.OhneIco:
mov edi,[BegData]
mov [SizeData],0
mov dword[edi],0
mov [MaxNumIcon],0
mov dword[IconsOffs],0
.end:
mcall 15,3
pop esi edi ebx
ret
endp
;§ ¯®«­ï¥â MaxNumIcon,IconsOffs ;§ ¯®«­ï¥â MaxNumIcon,IconsOffs
proc FillIconsOffs proc FillIconsOffs
push ebx edi push ebx edi
@ -1031,6 +731,7 @@ proc FillIconsOffs
add ebx,dword[BegData] add ebx,dword[BegData]
or ecx,-1 or ecx,-1
.CalcNumIc: .CalcNumIc:
repne scasb repne scasb
repne scasb repne scasb
repne scasb repne scasb
@ -1046,6 +747,7 @@ proc FillIconsOffs
@@: @@:
mov dword[IconsOffs+edx],0 mov dword[IconsOffs+edx],0
pop edi ebx pop edi ebx
ret ret
endp endp
@ -1066,12 +768,26 @@ proc LoadIconsData stdcall,f_name,sec_name
ret ret
.lid1: .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] mov edi,[PIcoDB]
mov esi,[sec_name] stdcall [ini_get_str],[f_name],[sec_name],keyName,edi,4096,0
@@: lodsb test eax,eax
stosb jz @f
test al,al xor eax,eax
jnz @b 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 stdcall [ini_get_str],[f_name],[sec_name],keyPath,edi,4096,0
test eax,eax test eax,eax
@ -1126,11 +842,61 @@ proc LoadIconsData stdcall,f_name,sec_name
add edi,4 add edi,4
mov [PIcoDB],edi mov [PIcoDB],edi
inc [nLoadIcon]
mov eax,1 mov eax,1
pop edi esi ebx pop edi esi ebx
ret ret
endp 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
include 'iconman.inc'
include 'bgredraw.inc' include 'bgredraw.inc'
include 'RButton.inc' include 'RButton.inc'
include 'DlgAdd.inc' include 'DlgAdd.inc'
@ -1180,14 +946,15 @@ fiIni dd 5 ;
dd 0 dd 0
dd 0 dd 0
dd bufIni dd bufIni
db '/rd/1/settings/icon.ini',0 db 0
dd IconIni
IconsFile db ICON_STRIP,0 IconsFile db ICON_STRIP,0
NameIconsDat db ICONS_DAT,0
align 4 align 4
MaxNumIcon dd 0 ;ª®«¨ç¥á⢮ ¨ª®­®ª MaxNumIcon dd 0 ;ª®«¨ç¥á⢮ ¨ª®­®ª
IconNoDraw dd -1 ;-1 «¨¡® ­®¬¥à ¨ª®­ª¨, ª®â®àãî ­¥ ­ ¤® à¨á®¢ âì( ª®£¤  ¥ñ â áª îâ :)) IconNoDraw dd -1 ;-1 «¨¡® ­®¬¥à ¨ª®­ª¨, ª®â®àãî ­¥ ­ ¤® à¨á®¢ âì( ª®£¤  ¥ñ â áª îâ )
bFixIcons dd 1 bFixIcons dd 1
bNotSave dd 0 bNotSave dd 0
@ -1197,11 +964,11 @@ RButtonActiv dd 0
MovingActiv dd 0 MovingActiv dd 0
DlgAddActiv dd 0 DlgAddActiv dd 0
IconIni db '/rd/1/settings/icon.ini',0 IconIni db ICON_INI,0
pthNotify db '/rd/1/@notify',0 pthNotify db '/rd/1/@notify',0
;keyName db 'name',0 keyName db 'name',0
keyPath db 'path',0 keyPath db 'path',0
keyParams db 'param',0 keyParams db 'param',0
keyIco db 'ico',0 keyIco db 'ico',0
@ -1210,41 +977,42 @@ keyY db 'y',0
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
IMPORTS: IMPORTS:
library cnv_png,'cnv_png.obj',\ library cnv_png ,'cnv_png.obj',\
archiver,'archiver.obj',\ archiver,'archiver.obj',\
box_lib,'box_lib.obj',\ box_lib ,'box_lib.obj',\
proc_lib,'proc_lib.obj',\ proc_lib,'proc_lib.obj',\
libini,'libini.obj' libini ,'libini.obj'
import cnv_png,\ import cnv_png,\
cnv_png_import.Start,'START',\ cnv_png_import.Start ,'START',\
cnv_png_import.Version,'version',\ cnv_png_import.Version ,'version',\
cnv_png_import.Check,'Check_Header',\ cnv_png_import.Check ,'Check_Header',\
cnv_png_import.Assoc,'Associations' cnv_png_import.Assoc ,'Associations'
import archiver,\ import archiver,\
unpack_DeflateUnpack2,'deflate_unpack2' unpack_DeflateUnpack2 ,'deflate_unpack2'
import box_lib,\ import box_lib,\
edit_box_draw,'edit_box',\ edit_box_draw ,'edit_box',\
edit_box_key,'edit_box_key',\ edit_box_key ,'edit_box_key',\
edit_box_mouse,'edit_box_mouse',\ edit_box_mouse ,'edit_box_mouse',\
scrollbar_h_draw,'scrollbar_h_draw',\ scrollbar_h_draw ,'scrollbar_h_draw',\
scrollbar_h_mouse,'scrollbar_h_mouse' scrollbar_h_mouse ,'scrollbar_h_mouse'
import proc_lib,\ import proc_lib,\
OpenDialog_Init,'OpenDialog_init',\ OpenDialog_Init ,'OpenDialog_init',\
OpenDialog_Start,'OpenDialog_start' OpenDialog_Start ,'OpenDialog_start'
import libini,\ import libini,\
ini_enum_sections,'ini_enum_sections',\ ini_enum_sections ,'ini_enum_sections',\
ini_enum_keys,'ini_enum_keys',\ ini_enum_keys ,'ini_enum_keys',\
ini_get_str,'ini_get_str',\ ini_get_str ,'ini_get_str',\
ini_set_str,'ini_set_str',\ ini_set_str ,'ini_set_str',\
ini_get_color,'ini_get_color',\ ini_get_color ,'ini_get_color',\
ini_get_int,'ini_get_int',\ ini_get_int ,'ini_get_int',\
ini_set_int,'ini_set_int',\ ini_set_int ,'ini_set_int',\
ini_del_section,'ini_del_section' 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.get_str (f_name, sec_name, key_name, buffer, buf_len, def_val)
@ -1254,6 +1022,13 @@ import libini,\
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
;----- RButton.inc ------------------------------------------------------------- ;----- RButton.inc -------------------------------------------------------------
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
if lang eq ru
MinRMenuW dd 18*6+10
else
MinRMenuW dd 15*6+10
end if
secRButt db 'rbmenu',0 secRButt db 'rbmenu',0
PredItem dd -1 PredItem dd -1
@ -1267,13 +1042,13 @@ if lang eq ru
RMenuDel db '“¤ «¨âì',0 RMenuDel db '“¤ «¨âì',0
RMenuProp db '‘¢®©á⢠',0 RMenuProp db '‘¢®©á⢠',0
else else
RMenuRedrawFon db 'Refresh',0 RMenuRedrawFon db 'Redraw',0
RMenuAlign db 'Snap to Grid',0 RMenuAlign db 'Snap to Grid',0
RMenuOffMoving db 'Lock icons',0 RMenuOffMoving db 'Fix the icons',0
RMenuOnMoving db 'Unlock icons',0 RMenuOnMoving db 'Unfix the icons',0
RMenuAdd db 'New icon',0 RMenuAdd db 'Add',0
RMenuDel db 'Delete',0 RMenuDel db 'Delete',0
RMenuProp db 'Properties',0 RMenuProp db 'Properties',0
end if end if
if lang eq ru if lang eq ru
@ -1285,7 +1060,7 @@ else
ErrRunProg db 'Error runing program',0 ErrRunProg db 'Error runing program',0
WarningSave db 'Do not forget to save the changes, run the RDSave',0 WarningSave db 'Do not forget to save the changes, run the RDSave',0
ErrNotFoundIni db 'icon.ini not found',0 ErrNotFoundIni db 'icon.ini not found',0
ErrName db 'The name "rbmenu" is reserved',0 ErrName db 'The name "rbmenu" reserved',0
end if end if
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
@ -1320,11 +1095,11 @@ end if
;/­¥ ¬¥­ïâì ¯®«®¦¥­¨¥ ;/­¥ ¬¥­ïâì ¯®«®¦¥­¨¥
edtName edit_box NAME_LENGTH*6+4,70+20+IMG_SIZE,6,0FFFFFFh,06F9480h,0FFh,0h,0,NAME_LENGTH,\ edtName edit_box NAME_LENGTH*6+4,70+20+IMG_SIZE,6,0FFFFFFh,06F9480h,0FFh,0h,0,NAME_LENGTH,\
DAreaName,mouse_dd,0,0,0 DAreaName,mouse_dd,0,0,0
edtExePath edit_box 281-3-20-IMG_SIZE,70+20+IMG_SIZE,26,0FFFFFFh,06F9480h,0FFh,0h,0,256,\ edtExePath edit_box 281-3-20-IMG_SIZE,70+20+IMG_SIZE,26,0FFFFFFh,06F9480h,0FFh,0h,0,255,\
DAreaPath,mouse_dd,0,0,0 DAreaPath,mouse_dd,0,0,0
edtParams edit_box 295-20-IMG_SIZE,70+20+IMG_SIZE,46,0FFFFFFh,06F9480h,0FFh,0h,0,256,\ edtParams edit_box 295-20-IMG_SIZE,70+20+IMG_SIZE,46,0FFFFFFh,06F9480h,0FFh,0h,0,255,\
DAreaParams,mouse_dd,0,0,0 DAreaParams,mouse_dd,0,0,0
edtIcon edit_box 295-20-IMG_SIZE,70+20+IMG_SIZE,66,0FFFFFFh,06F9480h,0FFh,0h,0,256,\ edtIcon edit_box 295-20-IMG_SIZE,70+20+IMG_SIZE,66,0FFFFFFh,06F9480h,0FFh,0h,0,255,\
DAreaIcon,mouse_dd,0,0,0 DAreaIcon,mouse_dd,0,0,0
endEdits: endEdits:
;\ ;\
@ -1421,7 +1196,6 @@ MouseX rd 1
MouseY rd 1 MouseY rd 1
RBSlot rd 1 RBSlot rd 1
AddX rd 1 AddX rd 1
AddY rd 1 AddY rd 1
@ -1430,11 +1204,14 @@ DlgSelIcon rd 1
slotDlgAdd rd 1 slotDlgAdd rd 1
DlgBufImg rb IMG_SIZE*IMG_SIZE*3 DlgBufImg rb IMG_SIZE*IMG_SIZE*3
align 4
bufStdIco rb 40 bufStdIco rb 40
IconsOffs rd 100 IconsOffs rd 100 ;â ¡«¨æ  á 㪠§ â¥«ï¬¨ ­  ª®­ªà¥â­ë¥ ¨ª®­ª¨(¤«ï ã᪮७¨ï)
PIcoDB rd 1 PIcoDB rd 1
nLoadIcon rd 1 ;­®¬¥à ç¨â ¥¬®© ¨§ ini ¨ª®­ª¨
IconsID rd 100 ;ID ¨ª®­®ª - 2 ¡ ©âa + ¡ ©â 0 + ¢ëà ¢­¨¢ î騩 ¡ ©â - áâப  á 2¬ï è¥á­ ¤æ¥â¨à¨ç­ë¬¨ æ¨äà ¬¨
nameSection rb 4
align 4 align 4
icon_count rd 1 icon_count rd 1
@ -1444,7 +1221,6 @@ strip_file_size rd 1
cur_band_compensation rd 1 cur_band_compensation rd 1
;---- RButton ----------------------------------------------------------------------- ;---- RButton -----------------------------------------------------------------------
MinRMenuW rd 1
bufIni rb 40 bufIni rb 40
NumMenuButt rd 1 NumMenuButt rd 1
@ -1456,9 +1232,9 @@ MaxPage rd 1
mouse_dd rd 1 mouse_dd rd 1
DAreaName rb NAME_LENGTH+1 DAreaName rb NAME_LENGTH+1
DAreaPath rb 256+1 DAreaPath rb 255+1
DAreaParams rb 256+1 DAreaParams rb 255+1
DAreaIcon rb 256+1 DAreaIcon rb 255+1
align 4 align 4
RBProcInfo rb 1024 RBProcInfo rb 1024

View File

@ -24,7 +24,7 @@ DlgProp:
cmp bx,[wsY] cmp bx,[wsY]
jae @f jae @f
mov bx,[wsY] mov bx,[wsY]
@@: ;eax,ebx - ॠ«ì­ ï ª®®à¤¨­ â . ‚ᥠª®®à¤¨­ âë ¢ ¯à®£¥ ®â­®á¨â¥«ì­® «¥¢®£® ¢¥àå­¥£® 㣫  à ¡®ç¥© ®¡« á⨠@@: ;eax,ebx - ðåàëüíàÿ êîîðäèíàòà. Âñå êîîðäèíàòû â ïðîãå îòíîñèòåëüíî ëåâîãî âåðõíåãî óãëà ðàáî÷åé îáëàñòè
xor edx,edx xor edx,edx
mov dx,[wsXe] mov dx,[wsXe]
@ -41,7 +41,7 @@ DlgProp:
mov ebx,edx mov ebx,edx
@@: @@:
xor edx,edx ;¯à¥®¡à §®¢ë¢ ¥¬ ¢ ®â­®á¨â¥«ì­ë¥ xor edx,edx ;ïðåîáðàçîâûâàåì â îòíîñèòåëüíûå
mov dx,[wsW] mov dx,[wsW]
shr edx,1 shr edx,1
add dx,[wsX] add dx,[wsX]
@ -408,25 +408,35 @@ DSaveIcon:
cmp [DlgSelIcon],-1 cmp [DlgSelIcon],-1
je @f je @f
;㤠«ï¥¬ ¨§ ini áâ àãî ¨ª®­ªã
mov ebx,[DlgSelIcon]
mov eax,[IconsOffs+ebx*4]
stdcall [ini_del_section],IconIni,eax
stdcall EditIcon,[DlgSelIcon],DAreaIcon,DAreaName,DAreaPath,DAreaParams stdcall EditIcon,[DlgSelIcon],DAreaIcon,DAreaName,DAreaPath,DAreaParams
mov ebx,[DlgSelIcon]
mov eax,[IconsID+ebx*4]
jmp DExitAndSave jmp DExitAndSave
@@: @@:
call GenerateID
mov ebx,[MaxNumIcon]
mov [IconsID+ebx*4],eax
push eax
stdcall AddIcon,[AddX],[AddY],DAreaIcon,DAreaName,DAreaPath,DAreaParams stdcall AddIcon,[AddX],[AddY],DAreaIcon,DAreaName,DAreaPath,DAreaParams
;jmp DExitAndSave pop eax
;------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------
DExitAndSave: DExitAndSave:
stdcall [ini_set_str],IconIni,DAreaName,keyPath,DAreaPath,dword[edtExePath.size] mov dword[nameSection],eax
stdcall [ini_set_str],IconIni,DAreaName,keyParams,DAreaParams,dword[edtParams.size] stdcall [ini_set_str],IconIni,nameSection,keyName,DAreaName,dword[edtName.size]
stdcall [ini_set_str],IconIni,DAreaName,keyIco,DAreaIcon,dword[edtIcon.size] stdcall [ini_set_str],IconIni,nameSection,keyPath,DAreaPath,dword[edtExePath.size]
stdcall [ini_set_int],IconIni,DAreaName,keyX,[MouseX] stdcall [ini_set_str],IconIni,nameSection,keyParams,DAreaParams,dword[edtParams.size]
stdcall [ini_set_int],IconIni,DAreaName,keyY,[MouseY] stdcall [ini_set_str],IconIni,nameSection,keyIco,DAreaIcon,dword[edtIcon.size]
cmp [DlgSelIcon],-1
jne @f
stdcall [ini_set_int],IconIni,nameSection,keyX,[MouseX]
stdcall [ini_set_int],IconIni,nameSection,keyY,[MouseY]
@@:
DExit: DExit:
mov [DlgAddActiv],0 mov [DlgAddActiv],0
mov [slotDlgAdd],0 mov [slotDlgAdd],0
@ -614,7 +624,7 @@ local IcoX:DWORD,\
add edi,3 add edi,3
loop @b loop @b
;§ â¨à ­¨¥ ­¥ ¨á¯®«ì§®¢ ­ëå ¬¥áâ ;çàòèðàíèå íå èñïîëüçîâàíûõ ìåñò
jmp .Dalee jmp .Dalee
.DrawIcons2: .DrawIcons2:
@ -657,7 +667,7 @@ proc DrawSelIcon
cmp al,'/' cmp al,'/'
jne .GetIconInd jne .GetIconInd
.PathToIcon: .PathToIcon:
mov al,30h ;§ £«ã誠!!!!!!!!!!!!! mov al,30h ;çàãëóøêà!!!!!!!!!!!!!
mov byte[edi+1],0 mov byte[edi+1],0
.GetIconInd: .GetIconInd:
;int3 ;int3

View File

@ -1,58 +1,57 @@
proc MovingWnd proc MovingWnd
local MySlot:DWORD local MySlot:DWORD
mcall 40,0 ;SetMaskMessage 000b mcall 40,0 ;SetMaskMessage 000b
mcall 12,1 ;RedrawWinBeg mcall 12,1 ;RedrawWinBeg
mcall 14 mcall 14
xor ebx,ebx xor ebx,ebx
xor ecx,ecx xor ecx,ecx
mov cx,ax mov cx,ax
shr eax,16 shr eax,16
mov cx,ax mov cx,ax
dec ebx dec ebx
dec ecx dec ecx
mcall 0,,,01000000h mcall 0,,,01000000h
;mcall 0,IMG_SIZE,IMG_SIZE,01000000h mcall 12,2 ;RedrawWinEnd
mcall 12,2 ;RedrawWinEnd
mov eax,[SelIcon] mov eax,[SelIcon]
call DrawIconToArea call DrawIconToArea
mcall 37,4,IconArea,10100002h mcall 37,4,IconArea,10100002h
push eax push eax
test eax,eax test eax,eax
jz @f jz @f
mov ecx,eax mov ecx,eax
mcall 37,5 mcall 37,5
@@: @@:
mcall 9,RBProcInfo,-1 ;+30 mcall 9,RBProcInfo,-1 ;+30
mcall 18,21,dword[RBProcInfo+30] mcall 18,21,dword[RBProcInfo+30]
mov [MySlot],eax mov [MySlot],eax
.messages: .messages:
cmp [MovingActiv],1 cmp [MovingActiv],1
jne .close jne .close
mcall 18,7 mcall 18,7
cmp eax,[MySlot] cmp eax,[MySlot]
je @f je @f
mcall 18,3,[MySlot] mcall 18,3,[MySlot]
@@: @@:
mcall 5,1 ;Yield mcall 5,1 ;Yield
jmp .messages jmp .messages
.close: .close:
pop ecx pop ecx
test ecx,ecx test ecx,ecx
jz @f jz @f
mcall 37,6 mcall 37,6
@@: @@:
mcall -1 mcall -1
endp endp
@ -60,62 +59,62 @@ endp
;eax = NumIcon ;eax = NumIcon
proc DrawIconToArea ;¯à¥¤­ §­ ç¥­ ¤«ï ¨ª®­®ª à §¬¥à®¬ = 32x32 proc DrawIconToArea ;¯à¥¤­ §­ ç¥­ ¤«ï ¨ª®­®ª à §¬¥à®¬ = 32x32
push edi esi push edi esi
;mov eax,[NumIcon] ;mov eax,[NumIcon]
mov edi,[IconsOffs+eax*4] mov edi,[IconsOffs+eax*4]
xor al,al xor al,al
or ecx,-1 or ecx,-1
repne scasb repne scasb
repne scasb repne scasb
repne scasb repne scasb
mov al,[edi] mov al,[edi]
cmp al,'9' cmp al,'9'
ja .PathToIcon ja .PathToIcon
cmp al,'/' cmp al,'/'
jne .GetIconInd jne .GetIconInd
.PathToIcon: .PathToIcon:
mov al,30h ;§ £«ã誠!!!!!!!!!!!!! mov al,30h ;§ £«ã誠!!!!!!!!!!!!!
mov byte[edi+1],0 mov byte[edi+1],0
.GetIconInd: .GetIconInd:
;int3 ;int3
sub al,30h sub al,30h
cmp byte[edi+1],0 cmp byte[edi+1],0
je @f je @f
shl eax,1 shl eax,1
lea eax,[eax*4+eax] lea eax,[eax*4+eax]
xor edx,edx xor edx,edx
mov dl,[edi+1] mov dl,[edi+1]
sub dl,30h sub dl,30h
add eax,edx add eax,edx
@@: ;eax=num icon @@: ;eax=num icon
cmp eax,[icon_count] cmp eax,[icon_count]
jb @f jb @f
xor eax,eax xor eax,eax
@@: @@:
test eax,eax test eax,eax
je .DIA je .DIA
mov ecx,eax mov ecx,eax
xor eax,eax xor eax,eax
@@: @@:
add eax,32*32*4;IMG_SIZE*IMG_SIZE*4 add eax,32*32*4;IMG_SIZE*IMG_SIZE*4
loop @b loop @b
.DIA: .DIA:
mov esi,eax mov esi,eax
add esi,[raw_pointer] add esi,[raw_pointer]
add esi,44 add esi,44
mov edi,IconArea;+((IMAGE_TOP_Y*ICON_SIZE)+((ICON_SIZE-IMG_SIZE)/2))*4 mov edi,IconArea;+((IMAGE_TOP_Y*ICON_SIZE)+((ICON_SIZE-IMG_SIZE)/2))*4
;int3 ;int3
mov eax,32;IMG_SIZE mov eax,32;IMG_SIZE
mov edx,eax mov edx,eax
@@: @@:
mov ecx,eax mov ecx,eax
rep movsd rep movsd
; add edi,32*4 ; add edi,32*4
dec edx dec edx
jnz @b jnz @b
pop esi edi pop esi edi
ret ret
endp endp

View File

@ -1,18 +1,10 @@
DELTA_COLOR equ 70 DELTA_COLOR equ 70
COLOR_SEL_BUT equ 00F7092Dh COLOR_SEL_BUT equ 00F7092Dh
MAX_USER_BUTTONS equ 30 MAX_USER_BUTTONS equ 30
;---- thread for rbutton ----------------------------------------------------------------------- ;---- thread for rbutton -----------------------------------------------------------------------
RButtonWin: RButtonWin:
if lang eq ru
mov [MinRMenuW],18*6+10
else
mov [MinRMenuW],15*6+10
end if
mcall 40,100101b ;SetMaskMessage 100101b mcall 40,100101b ;SetMaskMessage 100101b
mcall 48,3,sc,40 mcall 48,3,sc,40
@ -372,10 +364,58 @@ RBAdd:
RBDelete: RBDelete:
mov eax,[SelIcon] mov eax,[SelIcon]
mov eax,[IconsOffs+eax*4] lea eax,[IconsID+eax*4]
stdcall [ini_del_section],IconIni,eax stdcall [ini_del_section],IconIni,eax
stdcall DelIcon,[SelIcon] stdcall DelIcon,[SelIcon]
mov ebx,[SelIcon]
lea edi,[IconsID+ebx*4-4]
lea esi,[edi+4]
mov ecx,[MaxNumIcon]
sub ecx,[SelIcon]
;dph ecx
test ecx,ecx
jz @f
rep movsd
@@:
;debug_newline
;dpsP IconsID+4*0
;dps ' '
;dpsP IconsID+4*1
;dps ' '
;dpsP IconsID+4*2
;dps ' '
;dpsP IconsID+4*3
;dps ' '
;dpsP IconsID+4*4
;dps ' '
;dpsP IconsID+4*5
;dps ' '
;dpsP IconsID+4*6
;dps ' '
;dpsP IconsID+4*7
;dps ' '
;dpsP IconsID+4*8
;dps ' '
;dpsP IconsID+4*9
;dps ' '
;dpsP IconsID+4*10
;dps ' '
;dpsP IconsID+4*11
;dps ' '
;dpsP IconsID+4*12
;dps ' '
;dpsP IconsID+4*13
;dps ' '
;dpsP IconsID+4*14
;dps ' '
;dpsP IconsID+4*15
;dps ' '
;dpsP IconsID+4*16
;dps ' '
;dpsP IconsID+4*17
;debug_newline
mov dword[fiRunProg+8],WarningSave mov dword[fiRunProg+8],WarningSave
mov dword[fiRunProg+21],pthNotify mov dword[fiRunProg+21],pthNotify
@ -501,7 +541,6 @@ proc DrawRBLine y,active
ret ret
endp endp
proc MouseInWin ;Carry flag = 1, ¥á«¨ ª«¨ª ¢ ®ª­¥ proc MouseInWin ;Carry flag = 1, ¥á«¨ ª«¨ª ¢ ®ª­¥
mcall 37,0 ;GetMousePos mcall 37,0 ;GetMousePos
xor ebx,ebx xor ebx,ebx
@ -522,7 +561,6 @@ proc MouseInWin ;Carry flag = 1,
ret ret
endp endp
proc AlignIcons proc AlignIcons
local posX:WORD,\ local posX:WORD,\
posY:WORD,\ posY:WORD,\
@ -715,19 +753,14 @@ endp
proc Ini_SavePos stdcall,f_name,sec_name proc Ini_SavePos stdcall,f_name,sec_name
push ebx edi esi push ebx edi esi
mov ebx,[sec_name]
xor eax,eax
mov ax,[ebx]
xor ebx,ebx xor ebx,ebx
.SearchSect: .SearchSect:
mov edi,[IconsOffs+ebx*4] cmp eax,[IconsID+ebx*4]
mov esi,[sec_name] je .IcoDataFound
@@:
lodsb
scasb
jne @f
test al,al
jnz @b
jmp .IcoDataFound
@@:
inc ebx inc ebx
cmp ebx,[MaxNumIcon] cmp ebx,[MaxNumIcon]
@ -738,19 +771,14 @@ proc Ini_SavePos stdcall,f_name,sec_name
ret ret
.IcoDataFound: .IcoDataFound:
xor al,al
mov edi,[IconsOffs+ebx*4]
or ecx,-1 or ecx,-1
repne scasb repne scasb
repne scasb repne scasb
repne scasb repne scasb
repne scasb
;int3
movzx eax,word[edi+2]
test eax,8000h
jz @f
or eax,0FFFF0000h
@@:
stdcall [ini_set_int],[f_name],[sec_name],keyX,eax
movzx eax,word[edi] movzx eax,word[edi]
test eax,8000h test eax,8000h
@ -760,6 +788,15 @@ proc Ini_SavePos stdcall,f_name,sec_name
stdcall [ini_set_int],[f_name],[sec_name],keyY,eax stdcall [ini_set_int],[f_name],[sec_name],keyY,eax
movzx eax,word[edi+2]
test eax,8000h
jz @f
or eax,0FFFF0000h
@@:
stdcall [ini_set_int],[f_name],[sec_name],keyX,eax
mov eax,1 mov eax,1
pop esi edi ebx pop esi edi ebx
ret ret

View File

@ -1,171 +1,201 @@
[rbmenu] [rbmenu]
<EFBFBD> áâனª  ãáâனáâ¢=setup „¨áŻĄâçĄŕ Żŕ®ćĄáᮢ=cpu
“¯à ¢«¥­¨¥ ⥬®©=desktop “¯à ¢«¥­¨¥ ⥬®©=desktop
„¨á¯¥âç¥à ¯à®æ¥áᮢ=/rd/1/cpu Ť áâŕ®©Ş  ä®­ =/sys/media/palitra
Ť áâŕ®©Ş  ăáâனáâ˘=setup
Š®­á®«ì=/rd/1/shell Š®­á®«ì=/rd/1/shell
[KFM]
[00]
name=KFM
path=/SYS/FILE MANAGERS/KFM path=/SYS/FILE MANAGERS/KFM
param= param=
ico=5 ico=5
x=0 x=0
y=0 y=0
[TINYPAD] [01]
name=TINYPAD
path=/SYS/TINYPAD path=/SYS/TINYPAD
param= param=
ico=9 ico=9
x=0 x=0
y=68 y=68
[EOLITE] [02]
name=EOLITE
path=/SYS/FILE MANAGERS/EOLITE path=/SYS/FILE MANAGERS/EOLITE
param= param=
ico=2 ico=2
x=68 x=68
y=0 y=0
[SHELL] [03]
name=SHELL
path=/SYS/SHELL path=/SYS/SHELL
param= param=
ico=20 ico=20
x=136 x=136
y=0 y=0
[KFAR] [04]
name=KFAR
path=/SYS/FILE MANAGERS/KFAR path=/SYS/FILE MANAGERS/KFAR
param= param=
ico=16 ico=16
x=68 x=68
y=68 y=68
[RDSAVE] [05]
name=RDSAVE
path=/SYS/RDSAVE path=/SYS/RDSAVE
param= param=
ico=17 ico=17
x=0 x=0
y=136 y=136
[CALC] [06]
name=CALC
path=/SYS/CALC path=/SYS/CALC
param= param=
ico=4 ico=4
x=68 x=68
y=136 y=136
[ANIMAGE] [07]
name=ANIMAGE
path=/SYS/MEDIA/ANIMAGE path=/SYS/MEDIA/ANIMAGE
param= param=
ico=15 ico=15
x=136 x=136
y=68 y=68
[KPACK] [08]
name=KPACK
path=/SYS/KPACK path=/SYS/KPACK
param= param=
ico=10 ico=10
x=-67 x=-67
y=0 y=0
[SNAKE] [09]
name=SNAKE
path=/SYS/GAMES/SNAKE path=/SYS/GAMES/SNAKE
param= param=
ico=3 ico=3
x=-135 x=-135
y=-135 y=-135
[MINE] [0A]
name=MINE
path=/SYS/GAMES/MINE path=/SYS/GAMES/MINE
param= param=
ico=14 ico=14
x=-67 x=-67
y=-67 y=-67
[LIFE2] [0B]
name=LIFE2
path=/SYS/DEMOS/LIFE2 path=/SYS/DEMOS/LIFE2
param= param=
ico=13 ico=13
x=-135 x=-135
y=-67 y=-67
[MBLOCKS] [0C]
name=MBLOCKS
path=/SYS/GAMES/MBLOCKS path=/SYS/GAMES/MBLOCKS
param= param=
ico=11 ico=11
x=-67 x=-67
y=-135 y=-135
[PONG] [0D]
name=PONG
path=/SYS/GAMES/PONG3 path=/SYS/GAMES/PONG3
param= param=
ico=12 ico=12
x=-203 x=-203
y=-67 y=-67
[15] [0E]
name=15
path=/SYS/GAMES/15 path=/SYS/GAMES/15
param= param=
ico=0 ico=0
x=-271 x=-271
y=-67 y=-67
[DOCPACK] [0F]
name=DOCPACK
path=/SYS/DOCPACK path=/SYS/DOCPACK
param= param=
ico=8 ico=8
x=-67 x=-67
y=68 y=68
[BOARD] [10]
name=BOARD
path=/SYS/DEVELOP/BOARD path=/SYS/DEVELOP/BOARD
param= param=
ico=19 ico=19
x=-135 x=-135
y=0 y=0
[HEXEDIT] [11]
name=HEXEDIT
path=/SYS/DEVELOP/HEED path=/SYS/DEVELOP/HEED
param= param=
ico=22 ico=22
x=-67 x=-67
y=136 y=136
[MTDBG] [12]
name=MTDBG
path=/SYS/DEVELOP/MTDBG path=/SYS/DEVELOP/MTDBG
param= param=
ico=6 ico=6
x=-203 x=-203
y=0 y=0
[PIPES] [13]
name=PIPES
path=/SYS/GAMES/PIPES path=/SYS/GAMES/PIPES
param= param=
ico=26 ico=26
x=0 x=0
y=-135 y=-135
[SUDOKU] [14]
name=SUDOKU
path=/SYS/GAMES/SUDOKU path=/SYS/GAMES/SUDOKU
param= param=
ico=25 ico=25
x=0 x=0
y=-67 y=-67
[GOMOKU] [15]
name=GOMOKU
path=/SYS/GAMES/GOMOKU path=/SYS/GAMES/GOMOKU
param= param=
ico=24 ico=24
x=68 x=68
y=-67 y=-67
[XONIX] [16]
name=XONIX
path=/SYS/GAMES/XONIX path=/SYS/GAMES/XONIX
param= param=
ico=21 ico=21
x=68 x=68
y=-135 y=-135
[CHECKERS] [17]
name=CHECKERS
path=/SYS/GAMES/CHECKERS path=/SYS/GAMES/CHECKERS
param= param=
ico=1 ico=1
x=-271 x=-271
y=-135 y=-135
[KOSILKA] [18]
name=KOSILKA
path=/SYS/GAMES/KOSILKA path=/SYS/GAMES/KOSILKA
param= param=
ico=23 ico=23
x=136 x=136
y=-67 y=-67
[FLOOD-IT] [19]
name=FLOOD-IT
path=/SYS/GAMES/FLOOD-IT path=/SYS/GAMES/FLOOD-IT
param= param=
ico=27 ico=27
x=136 x=136
y=-135 y=-135
[FASM] [1A]
name=FASM
path=/SYS/DEVELOP/FASM path=/SYS/DEVELOP/FASM
param= param=
ico=10 ico=10
x=-135 x=-135
y=68 y=68
[CLICKS] [1B]
name=CLICKS
path=/SYS/GAMES/CLICKS path=/SYS/GAMES/CLICKS
param= param=
ico=18 ico=18

View File

@ -0,0 +1,301 @@
;ret eax=numIcon
proc AddIcon stdcall,x,y,lpIcon,lpName,lpExeFile,lpParams
push ebx edi esi
mov eax,[x]
mov ebx,[y]
xor edx,edx
test eax,8000h
jnz @f
mov dx,[wsW] ;¥á«¨ ­ ¤®, â® ¯à¥®¡à §®¢ë¢ ¥¬ ¢
shr edx,1 ;®âà¨æ â¥«ì­ë¥ ª®®à¤¨­ âë
add dx,[wsX]
cmp eax,edx
jbe @f
sub ax,[wsW]
inc eax
@@:
test ebx,8000h
jnz @f
mov dx,[wsY]
shr edx,1
add dx,[wsH]
cmp ebx,edx
jbe @f
sub bx,[wsH]
inc ebx
@@:
;¯®¯à ¢ª  ­  á«ãç © ¢ë室  §  ªà © íªà ­ 
test eax,8000h
jnz @f
mov dx,[wsXe]
sub edx,ICON_SIZE
cmp eax,edx
jbe @f
mov eax,edx
@@:
test ebx,8000h
jnz @f
mov dx,[wsYe]
sub edx,ICON_SIZE
cmp ebx,edx
jbe @f
mov ebx,edx
@@:
mov [x],eax
mov [y],ebx
xor al,al
or ecx,-1
mov edi,[lpName]
repne scasb
sub edi,[lpName]
mov ebx,edi
mov edi,[lpExeFile]
repne scasb
sub edi,[lpExeFile]
add ebx,edi
mov edi,[lpParams]
repne scasb
sub edi,[lpParams]
add ebx,edi
mov edi,[lpIcon]
repne scasb
sub edi,[lpIcon]
add ebx,edi
add ebx,4
mov ecx,dword[SizeData]
add ecx,ebx
mov edx,[IconsOffs]
mcall 68,20
mov edx,dword[SizeData]
mov dword[SizeData],ecx
mov dword[BegData],eax
mov edi,eax
add edi,edx
mov esi,[lpName]
@@: lodsb
stosb
test al,al
jnz @b
mov esi,[lpExeFile]
@@: lodsb
stosb
test al,al
jnz @b
mov esi,[lpParams]
@@: lodsb
stosb
test al,al
jnz @b
mov esi,[lpIcon]
@@: lodsb
stosb
test al,al
jnz @b
mov eax,[x]
mov ebx,[y]
shl eax,16
mov ax,bx
mov dword[edi],eax
stdcall FillIconsOffs
pop esi edi ebx
ret
endp
proc EditIcon stdcall,NumIcon,lpIcon,lpName,lpExeFile,lpParams
push edi
mov eax,[NumIcon]
mov edi,[IconsOffs+eax*4]
xor al,al
or ecx,-1
repne scasb
repne scasb
repne scasb
repne scasb
push dword[edi]
stdcall DelIcon,[NumIcon]
pop edx
xor eax,eax
mov ax,dx
shr edx,16
stdcall AddIcon,edx,eax,DAreaIcon,DAreaName,DAreaPath,DAreaParams
pop edi
ret
endp
proc SetPosition stdcall,NumIcon,x,y
push edi
mov eax,[NumIcon]
mov edi,[IconsOffs+eax*4]
xor al,al
or ecx,-1
repne scasb
repne scasb
repne scasb
repne scasb
mov eax,[x]
shl eax,16
mov ax,word[y]
mov dword[edi],eax
pop edi
ret
endp
proc GetNumIcon stdcall,x,y,NumIconI ;­®¬¥à ¨ª®­ª¨, ª®â®àë© ¯à®¢¥àïâì ­¥ ­ ¤® ¨«¨ -1
local posX:WORD,\
posY:WORD
push ebx edi
mov ecx,[MaxNumIcon]
test ecx,ecx
jnz @f
or eax,-1
pop edi ebx
ret
@@:
mov ebx,ecx
dec ebx
.TestIcon:
cmp dword[NumIconI],-1
je @f
cmp ebx,[NumIconI]
jne @f
dec ebx
dec ecx
test ecx,ecx
jz .NoIcon
@@:
push ecx
or ecx,-1
xor al,al
mov edi,[IconsOffs+ebx*4]
repne scasb
repne scasb
repne scasb
repne scasb
mov ax,[edi+2]
test ax,8000h
jz @f
add ax,[wsXe]
jmp .gni1
@@:
add ax,[wsX]
.gni1:
mov [posX],ax
mov ax,[edi]
test ax,8000h
jz @f
add ax,[wsYe]
jmp .gni2
@@:
add ax,[wsY]
.gni2:
mov [posY],ax
mov eax,[x]
mov edx,[y]
cmp ax,[posX]
jb @f
add word[posX],ICON_SIZE
cmp ax,[posX]
ja @f
cmp dx,[posY]
jb @f
add word[posY],ICON_SIZE
cmp dx,[posY]
ja @f
jmp .OkIcon
@@:
dec ebx
pop ecx
;loop .TestIcon
dec ecx
jnz .TestIcon
jmp .NoIcon
.OkIcon:
mov eax,ebx
pop edi ebx
ret
.NoIcon:
or eax,-1
pop edi ebx
ret
endp
proc DelIcon stdcall,NumIcon
push ebx edi esi
cmp [MaxNumIcon],0
je .end
cmp [MaxNumIcon],1
je .OhneIco
mov ebx,[NumIcon]
mov eax,[MaxNumIcon]
dec eax
mov [MaxNumIcon],eax
cmp ebx,eax
je @f
shl ebx,2
mov ecx,dword[BegData]
add ecx,dword[SizeData]
sub ecx,[IconsOffs+4+ebx]
mov edx,[IconsOffs+4+ebx]
sub edx,[IconsOffs+ebx]
sub dword[SizeData],edx
mov esi,[IconsOffs+4+ebx]
mov edi,[IconsOffs+ebx]
rep movsb
jmp .endDel
@@:
mov ecx,dword[BegData]
add ecx,dword[SizeData]
sub ecx,[IconsOffs+ebx*4]
sub dword[SizeData],ecx
.endDel:
stdcall FillIconsOffs
jmp .end
.OhneIco:
mov edi,[BegData]
mov [SizeData],0
mov dword[edi],0
mov [MaxNumIcon],0
mov dword[IconsOffs],0
.end:
mcall 15,3
pop esi edi ebx
ret
endp