The new manager of desktop icons

git-svn-id: svn://kolibrios.org@3850 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
GerdtR 2013-08-04 20:43:44 +00:00
parent 3a6bd45826
commit bd0955cc94
6 changed files with 2930 additions and 0 deletions

1453
programs/system/@ICON.ASM Normal file

File diff suppressed because it is too large Load Diff

633
programs/system/DLGADD.INC Normal file
View File

@ -0,0 +1,633 @@
idbChange equ 2
idbCreate equ 3
idbLeft equ 4
idbRight equ 5
idbCancel equ 1
DlgAdd:
DlgProp:
mov eax,[SelIcon]
cmp eax,-1
jne SetProp
m2m dword[AddX],dword[MouseX]
m2m dword[AddY],dword[MouseY]
mov ecx,NAME_LENGTH
mov edi,DAreaName
xor al,al
rep stosb
mov dword[edtName.size],0
mov dword[edtName.pos],0
mov ecx,256
mov edi,DAreaPath
rep stosb
mov dword[edtExePath.size],0
mov dword[edtExePath.pos],0
mov ecx,256
mov edi,DAreaParams
rep stosb
mov dword[edtParams.size],0
mov dword[edtParams.pos],0
mov ecx,256
mov edi,DAreaIcon
rep stosb
mov dword[edtIcon.size],0
mov dword[edtIcon.pos],0
jmp startDlg
;--------
SetProp:
mov esi,[IconsOffs+eax*4]
mov edi,DAreaName
xor ecx,ecx
@@:
lodsb
stosb
inc ecx
test al,al
jnz @b
dec ecx
mov dword[edtName.size],ecx
mov dword[edtName.pos],ecx
xor ecx,ecx
mov edi,DAreaPath
@@:
lodsb
stosb
inc ecx
test al,al
jnz @b
dec ecx
mov dword[edtExePath.size],ecx
mov dword[edtExePath.pos],ecx
xor ecx,ecx
mov edi,DAreaParams
@@:
lodsb
stosb
inc ecx
test al,al
jnz @b
dec ecx
mov dword[edtParams.size],ecx
mov dword[edtParams.pos],ecx
xor ecx,ecx
mov edi,DAreaIcon
@@:
lodsb
stosb
inc ecx
test al,al
jnz @b
dec ecx
mov dword[edtIcon.size],ecx
mov dword[edtIcon.pos],ecx
startDlg:
or [edtName.flags],ed_focus
mcall 40,100111b ;SetMaskMessage 100111b
xor eax,eax
mov dword[MaxPage],0
@@:
add eax,ICONS_DRAW_COUNTW
inc dword[MaxPage]
cmp eax,[icon_count]
jb @b
dec dword[MaxPage]
cmp dword[MaxPage],0
jne @f
mov dword[MaxPage],1
@@:
stdcall [OpenDialog_Init],OpenDialog_data
DReDraw:
mcall 48,3,sc,40
mov eax,[sc.work]
rol eax,16
add al,9
jnc @f
mov al,0FFh
@@:
rol eax,16
add al,9
jnc @f
mov al,0FFh
@@:
add ah,9
jnc @f
mov ah,0FFh
@@:
mov [sbIcons.bckg_col],eax
m2m [sbIcons.frnt_col],[sc.work]
m2m [sbIcons.line_col],[sc.work_graph]
edit_boxes_set_sys_color edtName,edtExePath,sc
edit_boxes_set_sys_color edtExePath,edtParams,sc
edit_boxes_set_sys_color edtParams,edtIcon,sc
edit_boxes_set_sys_color edtIcon,endEdits,sc
call DRedraw
DMessages:
mcall 10 ;WaitMessage
dec eax
jz DReDraw
dec eax
jz DKey
dec eax
jz DButton
sub eax,3
jz DMouse
jmp DMessages
;---------------------------------------------------------------------
DKey:
mcall 2 ;GetKeyPressed
cmp ah,1Bh
je DExit
cmp ah,9 ;Tab
je DNextEdit
stdcall [edit_box_key],edtName
stdcall [edit_box_key],edtExePath
stdcall [edit_box_key],edtParams
stdcall [edit_box_key],edtIcon
jmp DMessages
DNextEdit:
test [edtName.flags],ed_focus
jne .DNE1
test [edtExePath.flags],ed_focus
jne .DNE2
test [edtParams.flags],ed_focus
jne .DNE3
test [edtIcon.flags],ed_focus
jne .DNE4
jmp DMessages
.DNE1:
and [edtName.flags],not ed_focus
or [edtExePath.flags],ed_focus
stdcall [edit_box_draw],edtName
stdcall [edit_box_draw],edtExePath
jmp DMessages
.DNE2:
and [edtExePath.flags],not ed_focus
or [edtParams.flags],ed_focus
stdcall [edit_box_draw],edtExePath
stdcall [edit_box_draw],edtParams
jmp DMessages
.DNE3:
and [edtParams.flags],not ed_focus
or [edtIcon.flags],ed_focus
stdcall [edit_box_draw],edtParams
stdcall [edit_box_draw],edtIcon
jmp DMessages
.DNE4:
and [edtIcon.flags],not ed_focus
or [edtName.flags],ed_focus
stdcall [edit_box_draw],edtName
stdcall [edit_box_draw],edtIcon
jmp DMessages
;---------------------------------------------------------------------
DButton:
mcall 17 ;GetButtonPressed
cmp ah, idbCancel
je DExit
cmp ah,idbChange
je DSetExePath
cmp ah,idbCreate
je DSaveIcon
jmp DMessages
;-------------------------------------------------------------------------------
DMouse:
stdcall [edit_box_mouse],edtName
stdcall [edit_box_mouse],edtExePath
stdcall [edit_box_mouse],edtParams
stdcall [edit_box_mouse],edtIcon
push [sbIcons.position]
stdcall [scrollbar_h_mouse],sbIcons
pop eax
cmp eax,[sbIcons.position]
je @f
call DrawStdIcons
@@:
mcall 37,2 ;GetMouseKey
test eax,1
jz DMessages
mcall 37,1 ;GetMouseWinPos
test eax,10001000h
jne DMessages
xor edx,edx
mov dx,ax ;y
shr eax,16 ;x
sub eax,ICONSX
js DMessages
sub edx,ICONSY
js DMessages
cmp eax,(IMG_SIZE+SPCW)*ICONS_DRAW_COUNTW-SPCW
ja DMessages
cmp edx,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH-SPCH
ja DMessages
xor ebx,ebx
mov ecx,[sbIcons.position]
test ecx,ecx
jz .DM
@@:
add ebx,ICONS_DRAW_COUNTH
loop @b
.DM:
sub eax,IMG_SIZE+SPCW
js .DM1
@@:
add ebx,ICONS_DRAW_COUNTH
sub eax,IMG_SIZE+SPCW
jns @b
.DM1:
sub edx,IMG_SIZE+SPCH
js .DM2
@@:
inc ebx
sub edx,IMG_SIZE+SPCH
jns @b
.DM2:
mov eax,ebx
cmp eax,[icon_count]
jae DMessages
mov bl,10
div bl
add ah,30h
test al,al
jz @f
add al,30h
mov byte[DAreaIcon],al
mov byte[DAreaIcon+1],ah
mov byte[DAreaIcon+2],0
mov dword[edtIcon.size],2
jmp .RedrawNum
@@:
mov byte[DAreaIcon],ah
mov byte[DAreaIcon+1],0
mov dword[edtIcon.size],1
jmp .RedrawNum
.RedrawNum:
stdcall [edit_box_draw],edtIcon
call DrawSelIcon
jmp DReDraw;DMessages;
;-------------------------------------------------------------------------------
DSetExePath:
stdcall [OpenDialog_Start],OpenDialog_data
mov edi,DAreaPath
xor al,al
or ecx,-1
repne scasb
sub edi,DAreaPath
dec edi
mov dword[edtExePath+12*4],edi
jmp DMessages;DReDraw;
DSaveIcon:
mov dword[fiRunProg+8],WarningSave
mov dword[fiRunProg+21],pthNotify
mcall 70,fiRunProg
cmp [SelIcon],-1
je @f
;㤠«ï¥¬ ¨§ ini áâ àãî ¨ª®­ªã
mov ebx,[SelIcon]
mov eax,[IconsOffs+ebx*4]
stdcall [ini_del_section],IconIni,eax
stdcall EditIcon,[SelIcon],DAreaIcon,DAreaName,DAreaPath,DAreaParams
jmp DExitAndSave
@@:
stdcall AddIcon,[AddX],[AddY],DAreaIcon,DAreaName,DAreaPath,DAreaParams
;jmp DExitAndSave
;-------------------------------------------------------------------------------
DExitAndSave:
stdcall [ini_set_str],IconIni,DAreaName,keyPath,DAreaPath,dword[edtExePath.size]
stdcall [ini_set_str],IconIni,DAreaName,keyParams,DAreaParams,dword[edtParams.size]
stdcall [ini_set_str],IconIni,DAreaName,keyIco,DAreaIcon,dword[edtIcon.size]
stdcall [ini_set_int],IconIni,DAreaName,keyX,[MouseX]
stdcall [ini_set_int],IconIni,DAreaName,keyY,[MouseY]
DExit:
mcall -1 ;ExitProcess
;##################################################################
proc DRedraw
mcall 12,1 ;RedrawWinBeg
mov edx,[sc.work]
or edx,33000000h
mcall 0,<100,400>,<100,(IMG_SIZE+SPCH)*ICONS_DRAW_COUNTH+185>,,,DTitle
stdcall [edit_box_draw],edtName
stdcall [edit_box_draw],edtExePath
stdcall [edit_box_draw],edtParams
stdcall [edit_box_draw],edtIcon
call DrawStdIcons
stdcall [scrollbar_h_draw],sbIcons
mcall 38,<ICONSX+1,END_ICONS_AREAW-2>,\
<END_ICONS_AREAH+3,END_ICONS_AREAH+3>,\
[sc.work_graph]
mcall ,<ICONSX+1,END_ICONS_AREAW-2>,\
<END_ICONS_AREAH+3+15,END_ICONS_AREAH+3+15>,\
[sc.work_graph]
mcall ,<ICONSX,ICONSX>,\
<END_ICONS_AREAH+3+1,END_ICONS_AREAH+3+15-1>,\
[sc.work_graph]
mcall ,<END_ICONS_AREAW-1,END_ICONS_AREAW-1>,\
<END_ICONS_AREAH+3+1,END_ICONS_AREAH+3+15-1>,\
[sc.work_graph]
;BUTTONS
mcall 8,<250,49>,<30+END_ICONS_AREAH,16>,idbCreate,[sc.work_button]
mcall ,<305,54>, ,idbCancel
mcall ,<351,14>,<26,14> ,idbChange
;CAPTIONS
mov ecx,[sc.work_text]
or ecx,80000000h
mcall 4,<30+IMG_SIZE,10>,,DCaptName
mcall ,<30+IMG_SIZE,30>,,DCaptPath
mcall ,<30+IMG_SIZE,50>,,DCaptParams
mcall ,<30+IMG_SIZE,70>,,DCaptIcon
if lang eq ru
mov ecx,[sc.work_button_text]
or ecx,80000000h
mcall ,<309,35+END_ICONS_AREAH>,,DCaptCancel
cmp [SelIcon],-1
jne @f
mpack ebx,255,35+END_ICONS_AREAH
mov edx,DCaptCreate
jmp .DRD1
@@:
mpack ebx,252,35+END_ICONS_AREAH
mov edx,DCaptProperties
.DRD1:
else
mov ecx,[sc.work_button_text]
or ecx,80000000h
mcall ,<315,35+END_ICONS_AREAH>,,DCaptCancel
cmp [SelIcon],-1
jne @f
mpack ebx,257,35+END_ICONS_AREAH
mov edx,DCaptCreate
jmp .DRD1
@@:
mpack ebx,257,35+END_ICONS_AREAH
mov edx,DCaptProperties
.DRD1:
end if
mcall
mcall 1,351+4 ,26+10,[sc.work_button_text]
mcall ,351+4+3,26+10,
mcall ,351+4+6,26+10,
call DrawSelIcon
mcall 12,2 ;RedrawWinEnd
ret
endp
proc DrawStdIcons
local IcoX:DWORD,\
IcoY:DWORD,\
iIcon:DWORD
mov ecx,[sbIcons.position]
xor eax,eax
m2m dword[iIcon],0
test ecx,ecx
jz .DST1
@@:
add [iIcon],ICONS_DRAW_COUNTH
add eax,IMG_SIZE*IMG_SIZE*4*ICONS_DRAW_COUNTH
loop @b
.DST1:
lea esi,[eax+44]
add esi,[raw_pointer]
mov [IcoX],ICONSX
mov ecx,ICONS_DRAW_COUNTW
.DrawIcons:
push ecx
mov [IcoY],ICONSY
mov ecx,ICONS_DRAW_COUNTH
.DrawIcoStolb:
push ecx
mov edi,IconArea
mov edx,IMG_SIZE
.DrawLine:
mov ecx,IMG_SIZE
.DrawPix:
lodsd
test eax,0FF000000h
jnz @f
mov eax,[sc.work]
@@:
mov word[edi],ax
shr eax,16
mov [edi+2],al
add edi,3
loop .DrawPix
dec edx
jnz .DrawLine
mov edx,[IcoX]
shl edx,16
mov dx,word[IcoY]
mcall 7,IconArea,<IMG_SIZE,IMG_SIZE>
inc [iIcon]
mov eax,[iIcon]
cmp eax,[icon_count]
jae .endDrawIcon
add dword[IcoY],IMG_SIZE+SPCH
pop ecx
loop .DrawIcoStolb
add dword[IcoX],IMG_SIZE+SPCW
pop ecx
loop .DrawIcons
jmp .endProc
.endDrawIcon:
mov ecx,IMG_SIZE*IMG_SIZE
mov edi,IconArea
mov eax,[sc.work]
mov ebx,eax
shr ebx,16
@@:
mov word[edi],ax
mov [edi+2],bl
add edi,3
loop @b
;§ â¨à ­¨¥ ­¥ ¨á¯®«ì§®¢ ­ëå ¬¥áâ
jmp .Dalee
.DrawIcons2:
push ecx
mov [IcoY],ICONSY
mov ecx,ICONS_DRAW_COUNTH
.DrawIcoStolb2:
push ecx
mov edx,[IcoX]
shl edx,16
mov dx,word[IcoY]
mcall 7,IconArea,<IMG_SIZE,IMG_SIZE>
.Dalee:
add dword[IcoY],IMG_SIZE+SPCH
pop ecx
loop .DrawIcoStolb2
add dword[IcoX],IMG_SIZE+SPCW
pop ecx
loop .DrawIcons2
.endProc:
ret
endp
proc DrawSelIcon
mov edi,DAreaIcon
cmp byte[edi],0
jne @f
ret
@@:
mov al,[edi]
cmp al,'9'
ja .PathToIcon
cmp al,'/'
jne .GetIconInd
.PathToIcon:
mov al,30h ;§ £«ã誠!!!!!!!!!!!!!
mov byte[edi+1],0
.GetIconInd:
;int3
sub al,30h
cmp byte[edi+1],0
je @f
shl eax,1
lea eax,[eax*4+eax]
xor edx,edx
mov dl,[edi+1]
sub dl,30h
add eax,edx
@@: ;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:
mov esi,eax
add esi,[raw_pointer]
add esi,44
mov edi,IconArea
mov edx,IMG_SIZE
.DrawLine:
mov ecx,IMG_SIZE
.DrawPix:
lodsd
test eax,0FF000000h
jnz @f
mov eax,[sc.work]
@@:
mov word[edi],ax
shr eax,16
mov [edi+2],al
add edi,3
loop .DrawPix
dec edx
jnz .DrawLine
mcall 7,IconArea,<IMG_SIZE,IMG_SIZE>,<15,25>
ret
endp

173
programs/system/ICON.INI Normal file
View File

@ -0,0 +1,173 @@
[rbmenu]
Š®­á®«ì=/rd/1/shell
„¨á¯¥âç¥à ¯à®æ¥áᮢ=/rd/1/cpu
“¯à ¢«¥­¨¥ ⥬®©=desktop
<EFBFBD> áâனª  ãáâனáâ¢=setup
[KFM]
path=/SYS/FILE MANAGERS/KFM
param=
ico=5
x=0
y=0
[TINYPAD]
path=/SYS/TINYPAD
param=
ico=9
x=0
y=68
[EOLITE]
path=/SYS/FILE MANAGERS/EOLITE
param=
ico=2
x=68
y=0
[SHELL]
path=/SYS/SHELL
param=
ico=20
x=136
y=0
[KFAR]
path=/SYS/FILE MANAGERS/KFAR
param=
ico=16
x=68
y=68
[RDSAVE]
path=/SYS/RDSAVE
param=
ico=17
x=0
y=136
[CALC]
path=/SYS/CALC
param=
ico=4
x=68
y=136
[ANIMAGE]
path=/SYS/MEDIA/ANIMAGE
param=
ico=15
x=136
y=68
[KPACK]
path=/SYS/KPACK
param=
ico=10
x=-67
y=0
[SNAKE]
path=/SYS/GAMES/SNAKE
param=
ico=3
x=-135
y=-135
[MINE]
path=/SYS/GAMES/MINE
param=
ico=14
x=-67
y=-67
[LIFE2]
path=/SYS/DEMOS/LIFE2
param=
ico=13
x=-135
y=-67
[MBLOCKS]
path=/SYS/GAMES/MBLOCKS
param=
ico=11
x=-67
y=-135
[PONG]
path=/SYS/GAMES/PONG3
param=
ico=12
x=-203
y=-67
[15]
path=/SYS/GAMES/15
param=
ico=0
x=-271
y=-67
[DOCPACK]
path=/SYS/DOCPACK
param=
ico=8
x=-67
y=68
[BOARD]
path=/SYS/DEVELOP/BOARD
param=
ico=19
x=-135
y=0
[HEXEDIT]
path=/SYS/DEVELOP/HEED
param=
ico=22
x=-67
y=136
[MTDBG]
path=/SYS/DEVELOP/MTDBG
param=
ico=6
x=-203
y=0
[PIPES]
path=/SYS/GAMES/PIPES
param=
ico=26
x=0
y=-135
[SUDOKU]
path=/SYS/GAMES/SUDOKU
param=
ico=25
x=0
y=-67
[GOMOKU]
path=/SYS/GAMES/GOMOKU
param=
ico=24
x=68
y=-67
[XONIX]
path=/SYS/GAMES/XONIX
param=
ico=21
x=68
y=-135
[CHECKERS]
path=/SYS/GAMES/CHECKERS
param=
ico=1
x=-271
y=-135
[KOSILKA]
path=/SYS/GAMES/KOSILKA
param=
ico=23
x=136
y=-67
[FLOOD-IT]
path=/SYS/GAMES/FLOOD-IT
param=
ico=27
x=136
y=-135
[FASM]
path=/SYS/DEVELOP/FASM
param=
ico=10
x=-135
y=68
[CLICKS]
path=/SYS/GAMES/CLICKS
param=
ico=18
x=513
y=287

121
programs/system/MOVING.INC Normal file
View File

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

545
programs/system/RBUTTON.INC Normal file
View File

@ -0,0 +1,545 @@
if lang eq ru
MinRMenuW equ 18*6+10
else
MinRMenuW equ 15*6+10
end if
idbRRedrawFon equ 100
idbRAlign equ 101
idbRFixIcons equ 102
idbRAdd equ 103
idbRDel equ 104
idbRProp equ 105
;---- thread for rbutton -----------------------------------------------------------------------
RButtonWin:
mcall 40,100101b ;SetMaskMessage 100101b
stdcall GetNumIcon,[MouseX],[MouseY],-1
mov [SelIcon],eax
cmp eax,-1
jne @f
mov [RMenuH],16*4+3+3
mov [RMenuHsb],16*4+3+3
jmp .rbw1
@@:
mov [RMenuH],16*5+3+3
mov [RMenuHsb],16*5+3+3
.rbw1:
mov [NumUserButt],0
mov [RMenuW],0
mcall 70,fiIni
mcall 68,12,dword[bufIni+32]
mov [RBUser],eax
stdcall [ini_enum_keys],IconIni,secRButt,GetUserBut
RBWRedraw:
mcall 12,1 ;RedrawWinBeg
mov ebx,[MouseX]
shl ebx,16
mov bx,[RMenuW]
mov ecx,[MouseY]
shl ecx,16
mov cx,[RMenuH]
mov edx,0177CCFFh
mov esi,01000000h
xor eax,eax
int 40h
;-----------
mov ecx,[NumUserButt]
.DrawUB:
push ecx
mov eax,[NumUserButt]
sub eax,ecx
mov edx,eax ;button ID
shl eax,4+16 ;*16*10000h
mov ecx,eax
mov cx,16
xor ebx,ebx
mov bx,[RMenuW]
mov esi,0888888h
mcall 8
mov ebx,50000h
shr ecx,16
mov bx,cx
add bx,5
mov ecx,80000000h
mov eax,[NumUserButt]
sub eax,[esp]
mov edx,[RBUser+eax*8]
mcall 4
pop ecx
loop .DrawUB
;-----------
xor ebx,ebx
mov bx,[RMenuW]
mov cx,[RMenuH]
sub cx,[RMenuHsb]
push ecx
mov dx,cx
shl ecx,16
mov cx,dx
;¯¥à¢ ï à §¤¥«¨â¥«ì­ ï «¨­¨ï
mcall 38,,,0888888h
add ecx,00010001h
mcall ,,,
;------------
mov ecx,[esp]
add ecx,2
shl ecx,16
mov cx,16
mcall 8,,,idbRRedrawFon,0888888h ;3 ª­®¯ª¨ ¢â®à®£® ¡«®ª 
add ecx,00100000h
mcall ,,,idbRAlign
add ecx,00100000h
mcall ,,,idbRFixIcons
mov ebx,50000h
mov bx,word[esp]
add bx,2+5
mcall 4,,80000000h,RMenuRedrawFon
add ebx,16
mcall ,,,RMenuAlign
add ebx,16
cmp [bFixIcons],0
jne @f
mov edx,RMenuOffMoving
jmp .RBWR1
@@:
mov edx,RMenuOnMoving
.RBWR1:
mcall
;------------
xor ebx,ebx ;¢â®à ï à §¤¥«¨â¥«ì­ ï «¨­¨ï
mov bx,[RMenuW]
mov ecx,[esp]
add ecx,16*3+2
mov dx,cx
shl ecx,16
mov cx,dx
mcall 38,,,0888888h
add ecx,00010001h
mcall ,,,
;------------
;1 ¨«¨ 2 ª­®¯ª¨ âà¥â쥣® ¡«®ª 
mov ecx,[esp]
add ecx,16*3+4
shl ecx,16
mov cx,16
cmp dword[SelIcon],-1
je @f
mcall 8,,,idbRDel,0888888h
add ecx,00100000h
mcall ,,,idbRProp,0888888h
mov ebx,50000h
mov bx,word[esp]
add bx,16*3+4+5
mcall 4,,80000000h,RMenuDel
add bx,16
mcall ,, ,RMenuProp
jmp .endRM
@@:
mcall 8,,,idbRAdd,0888888h
mov ebx,50000h
mov bx,word[esp]
add bx,16*3+4+5
mcall 4,,80000000h,RMenuAdd
.endRM:
pop ecx
mcall 12,2 ;RedrawWinEnd
mcall 9,RBProcInfo,-1 ;GetThreadInfo RBProcInfo,-1
mcall 18,21,dword[RBProcInfo+30]
m2m dword[RBSlot],eax
RBWMessages:
mcall 10 ;WaitMessage
dec eax
jz RBWRedraw
sub eax,2
jz RBWButton
sub eax,3
jz RBWMouse
jmp RBWMessages
RBWButton:
mcall 17 ;GetButtonPressed
shr eax,8
cmp eax,idbRRedrawFon
jz RBRedrawFon
cmp eax,idbRAlign
jz RBAlign
cmp eax,idbRFixIcons
jz RBFixIcons
cmp eax,idbRAdd
jz RBAdd
cmp eax,idbRDel
jz RBDelete
cmp eax,idbRProp
jz RBPropeties
cmp eax,[NumUserButt]
ja @f
mov eax,[RBUser+eax*8+4]
mov dword[fiRunProg+8],0
mov dword[fiRunProg+21],eax
mcall 70,fiRunProg
@@:
jmp RBWExit
RBWMouse:
mcall 37,2 ;GetMouseKey
test eax,111b
jz RBWMessages
mcall 37,0 ;GetMousePos
xor ebx,ebx
mov bx,ax ;y
shr eax,16 ;x
xor ecx,ecx
mov cx,bx
mov bx,ax
mcall 34
cmp eax,[RBSlot]
je RBWMessages
RBWExit:
mcall 68,13,[RBUser]
mov [RButtonActiv],0
mcall -1 ;ExitProcess
RBRedrawFon:
mcall 15,3
jmp RBWExit
RBAlign:
call AlignIcons
m2m [PIcoDB],[BegData]
stdcall [ini_enum_sections],IconIni,Ini_SavePos
mov dword[fiRunProg+8],WarningSave
mov dword[fiRunProg+21],pthNotify
mcall 70,fiRunProg
mov [bNotSave],0
jmp RBRedrawFon
RBFixIcons:
xor dword[bFixIcons],1
cmp [bNotSave],0
je @f
mov dword[fiRunProg+8],WarningSave
mov dword[fiRunProg+21],pthNotify
mcall 70,fiRunProg
mov [bNotSave],0
@@:
jmp RBWExit
RBAdd:
; mov [DlgAddActiv],1
mcall 51,1,DlgAdd,stack_dlg ;CreateThread DlgAdd,stack_dlg
jmp RBWExit
RBDelete:
mov eax,[SelIcon]
mov eax,[IconsOffs+eax*4]
stdcall [ini_del_section],IconIni,eax
stdcall DelIcon,[SelIcon]
; mov dword[fiStdIco],2
; m2m dword[fInfo+12],dword[SizeData]
; mcall 70,fInfo
mov dword[fiRunProg+8],WarningSave
mov dword[fiRunProg+21],pthNotify
mcall 70,fiRunProg
mov [bNotSave],0
jmp RBRedrawFon
RBPropeties:
; mov [DlgAddActiv],1
mcall 51,1,DlgProp,stack_dlg ;CreateThread DlgProp,stack_dlg
jmp RBWExit
proc AlignIcons
local posX:WORD,\
posY:WORD,\
negatX:WORD,\
negatY:WORD
xor ebx,ebx
mov ecx,[MaxNumIcon]
test ecx,ecx
jnz .AlignIco
ret
.AlignIco:
push ecx
or ecx,-1
mov edi,dword[IconsOffs+ebx]
xor eax,eax
repne scasb
repne scasb
repne scasb
repne scasb
mov dword[negatX],0
;-------- ¯à¥®¡à §ã¥¬ ª®®à¤¨­ âë ¢ ¯®«®¦¨â¥«ì­ë¥
mov ax,[edi+2]
test ax,8000h
jz @f
neg ax
mov word[negatX],1
@@:
mov [posX],ax
mov ax,[edi]
test ax,8000h
jz @f
neg ax
mov word[negatY],1
@@:
mov [posY],ax
;-----
mov ax,[posY]
mov dx,ALIGN_SIZE
cmp ax,dx
jb .AI0
@@: sub ax,dx
cmp ax,dx
jae @b
.AI0:
mov dx,ax
cmp dx,ALIGN_SIZE/2
jb .AI1
mov ax,ALIGN_SIZE
sub ax,dx
add [posY],ax
jmp .AI2
.AI1:
sub [posY],dx
.AI2:
;-----
mov ax,[posX]
mov dx,ALIGN_SIZE
cmp ax,dx
jb .AI3
@@: sub ax,dx
cmp ax,dx
jae @b
.AI3:
mov dx,ax
cmp dx,ALIGN_SIZE/2
jb .AI4
mov ax,ALIGN_SIZE
sub ax,dx
add [posX],ax
jmp .AI5
.AI4:
sub [posX],dx
.AI5:
;----- ¯à¥®¡à §®¢ ­¨¥ ­ § ¤ ¨ ¯®¯à ¢ª  ¢ ®âà¨æ â¥«ì­ëå ª®®à¤¨­ â
mov ax,[posX]
cmp [negatX],1
jne @f
neg ax
inc ax
jmp .AI6
@@:
mov dx,[ScreenX]
shr dx,1
cmp ax,dx
jbe .AI6
sub ax,[ScreenX]
.AI6:
mov word[edi+2],ax
mov ax,[posY]
cmp [negatY],1
jne @f
neg ax
inc ax
jmp .AI7
@@:
mov dx,[ScreenY]
shr dx,1
cmp ax,dx
jbe .AI7
sub ax,[ScreenY]
.AI7:
mov word[edi],ax
;--------
pop ecx
add ebx,4
dec ecx
jnz .AlignIco
; loop .AlignIco
; mov dword[fInfo],2
; mcall 70,fInfo
ret
endp
;-------------------------------------------------------------------------------
proc GetUserBut stdcall,f_name,sec_name,key_name,key_value
cmp [NumUserButt],16
jne @f
ret
@@:
push ebx esi edi
mov edi,[key_name] ;®¯à¥¤¥«ï¥¬ è¨à¨­ã ¬¥­î
xor eax,eax
or ecx,-1
repne scasb
sub edi,[key_name]
mov eax,edi
shl eax,1
lea eax,[eax*2+eax+5*2]
cmp ax,[RMenuW]
jbe @f
mov [RMenuW],ax
@@:
cmp [RMenuW],MinRMenuW
jae @f
mov [RMenuW],MinRMenuW
@@:
mov ebx,[NumUserButt]
mov esi,[key_name]
mov edi,[RBUser+ebx*8]
@@: lodsb
stosb
test al,al
jnz @b
;debug_newline
mov [RBUser+ebx*8+4],edi
mov esi,[key_value]
@@: lodsb
stosb
test al,al
jnz @b
mov [RBUser+ebx*8+8],edi
inc [NumUserButt]
add [RMenuH],16
pop edi esi ebx
mov eax,1
ret
endp
proc Ini_SavePos stdcall,f_name,sec_name
push ebx edi esi
;int3
xor ebx,ebx
.SearchSect:
mov edi,[IconsOffs+ebx*4]
mov esi,[sec_name]
@@:
lodsb
scasb
jne @f
test al,al
jnz @b
jmp .IcoDataFound
@@:
inc ebx
cmp ebx,[MaxNumIcon]
jb .SearchSect
mov eax,1
pop esi edi ebx
ret
.IcoDataFound:
or ecx,-1
repne scasb
repne scasb
repne scasb
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]
test eax,8000h
jz @f
or eax,0FFFF0000h
@@:
stdcall [ini_set_int],[f_name],[sec_name],keyY,eax
mov eax,1
pop esi edi ebx
ret
endp

View File

@ -0,0 +1,5 @@
Данная программа заменяет стандартный icon.
Для установки в систему скопируйте @icon и icon.ini в системный
диск. Уберите из Autorun.dat строки с запуском @rb и icon и добавьте
строку с запуском @icon (без параметров, хотя это не важно). Сохраните
системный диск и перезагрузите. Всё, программа установлена.