Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 661 → Rev 872

/programs/system/icon_new/trunk/hand.cur
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programs/system/icon_new/trunk/icon.asm
21,19 → 21,20
; +0 +4 +8 +38 +68
 
include '..\..\..\macros.inc'
 
;__DEBUG__ fix 1
;__DEBUG_LEVEL__ fix 1
;include 'debug-fdo.inc'
flipdelay = 7
 
flipdelay = 5
 
START: ; start of execution
 
cmp [I_PARAM],byte 0
jne nohalt
or eax,-1
mcall
mcall -1
nohalt:
 
mov eax,[I_PARAM+0]
sub eax,0x01010101
mov [xpos],eax
53,6 → 54,7
mov esi,I_PARAM+8+30
mov edi,start_file
mov ecx,30
cld
rep movsb
call fill_paths
 
62,137 → 64,201
cld
rep movsb
 
mov eax,40 ; get also event background change
mov ebx,10101b
mcall
mcall 40,110001b
 
mcall 37,4,hand,1
mov ecx,eax
mcall 37,5
 
red:
call get_bg
 
red: ; redraw
call draw_window
 
still:
 
mov eax,10 ; wait here for event
mcall
mcall 10 ; wait here for event
 
cmp eax,1 ; redraw request ?
jz red
cmp eax,3 ; button in buffer ?
jz button
cmp eax,6
jz mouse
 
check:
call get_bg
call draw_icon
mcall 5,80
jmp still
 
button: ; button
mov al,17 ; get id
mcall
 
mov eax,70
mov ebx,finfo_start
mcall
mouse:
 
mcall 9,process,-1
xor ebx,ebx
mov bx,[process.window_stack_position]
cmp eax,ebx ;check is this process is active
jne still
 
cmp [mouse_pressed],1
je @f
 
mcall 37,2
test eax,1
jz still
 
mov [icon_moved],0
 
mcall 37,0
mov ebx,eax
shr eax,16 ; eax= abs x
and ebx,0xffff ; ebx= abs y
 
mov [xmouse_old],eax ; saving mouse coordinates
mov [ymouse_old],ebx
 
cmp eax,[process.box.left] ; check is mouse in icon area
jl still
sub eax,[process.box.left]
cmp eax,[process.box.width]
ja still
 
cmp ebx,[process.box.top]
jl still
sub ebx,[process.box.top]
cmp ebx,[process.box.height]
ja still
 
mov [xmouse_rel],eax ; saving relative coordinates
mov [ymouse_rel],ebx
 
mov [mouse_pressed],1
 
jmp still
 
@@:
mcall 37,2
test eax,1
jnz @F
 
mov [mouse_pressed],0
 
@@:
mcall 37,0
mov ecx,eax
shr eax,16 ; eax= abs x
and ecx,0xffff ; ecx= abs y
push eax ecx
 
cmp [icon_moved],1
je move
 
add eax,2
cmp eax,[xmouse_old]
jle move
sub eax,4
cmp eax,[xmouse_old]
jae move
 
add ecx,2
cmp ecx,[ymouse_old]
jle move
sub ecx,4
cmp ecx,[ymouse_old]
jae move
 
cmp [mouse_pressed],1
je still
 
mcall 70,finfo_start
call flip_icon
jmp still
 
move:
mov [icon_moved],1
pop ecx ebx
sub ebx,[xmouse_rel] ; ebx=new_x
sub ecx,[ymouse_rel] ; ecx=new_y
mov [xpos],ebx
mov [ypos],ecx
 
mcall 67,,,-1,-1 ; move
 
jmp still
 
fill_paths:
dec edi
mov ecx,30
std
mov al,' '
repe scasb
cld
mov byte[edi+2],0
ret
 
flip_icon:
 
mov eax,1
call flip
mov eax,2
inc eax
call flip
mov eax,3
inc eax
call flip
mov eax,4
inc eax
call flip
mov eax,5
inc eax
call flip
mov eax,4
dec eax
call flip
mov eax,3
dec eax
call flip
mov eax,2
dec eax
call flip
mov eax,1
dec eax
call flip
mov eax,0
xor eax,eax
call flip
 
ret
 
flip:
push eax
mov [iconstate],eax
call get_bg
call draw_icon
mov eax,5
mov ebx,flipdelay
mcall
mcall 5,flipdelay
pop eax
ret
 
fill_paths:
dec edi
mov ecx,30
std
mov al,' '
repe scasb
cld
mov byte[edi+2],0
ret
 
draw_window:
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
mcall 12,1 ; function 12,1 - tell os about start of draw window
 
; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window
mov ebx,[xpos-2]
add ebx,51 ; [x start] *65536 + [x size]
mov ecx,[ypos-2]
add ebx,[yw] ; [x start] *65536 + [x size]
add ecx,67 ; [y start] *65536 + [y size]
mov edx,0x01000000 ; color of work area RRGGBB,8->color gl
mov edx,0x01000000
mov esi,0x01000000
mcall
 
mov eax,8 ; button
mov ebx,51
mov ecx,67
mov edx,0x60000001
mcall
 
call draw_icon
 
mov eax,12
mov ebx,2
mcall
mcall 12,2 ; function 12,2 - tell os about end of draw window
 
ret
 
get_bg:
 
mov eax,14
mcall
add eax,0x00010001
mcall 61,1
mov [scrxy],eax
 
mov eax,39 ; get background type
mov ebx,4
mcall
mcall 39,4 ; get background type
mov [bgrdrawtype],eax
 
mov eax,39 ; get background size
mov ebx,1
mcall
mcall 39,1 ; get background size
mov [bgrxy],eax
 
mov eax,70
mov ebx,finfo
mcall
mcall 70,finfo
 
mov [itype],0
cmp word[I_END+256],'BM'
200,7 → 266,7
inc [itype]
@@:
 
mov ebx,[yw]
mov ebx,51
xor ecx,ecx ; 10608 = 52*68*3 - bg image
mov esi,I_END+256+9662 ; 9662 - icon file image
mov edi,51*3
211,7 → 277,7
 
yesbpix:
 
cmp [bgrdrawtype],dword 2
cmp [bgrdrawtype],2
jne nostretch
 
mov eax,[ypos]
240,7 → 306,7
 
nostretch:
 
cmp [bgrdrawtype],dword 1
cmp [bgrdrawtype],1
jne notiled
 
mov eax,[ypos]
266,12 → 332,8
notiled:
 
lea ecx,[eax+eax*2]
mcall 39,2
 
mov eax,39
mov ebx,2
 
mcall
 
nobpix:
 
pop ecx ebx
284,7 → 346,7
 
dec ebx
jge newb
mov ebx,[yw]
mov ebx,51
 
add esi,52*3
mov edi,51*3
406,11 → 468,7
ret
 
draw_picture:
mov eax,7
mov ebx,I_END+256+9662
mov ecx,52 shl 16 + 68
xor edx,edx
mcall
mcall 7,I_END+256+9662,52 shl 16+68,0
ret
 
draw_icon:
438,14 → 496,14
shl ecx,16
add ebx,ecx
 
; replaced - delete commented lines below if you like that style
mov eax,4 ; white text
; black shade of text
; uncomment lines below if you like that style
 
xor ecx,ecx
mov edx,labelt
mov esi,labellen-labelt
add ebx,1 shl 16 ;*65536+1
mcall
add ebx,1 shl 16
mcall 4
inc ebx
mcall
add ebx,1 shl 16
454,23 → 512,22
mcall
sub ebx,1 shl 16
mcall
sub ebx,1 shl 16 +1
sub ebx,1*65536+1
mcall
sub ebx,1 shl 16 + 1
sub ebx,1*65536+1
mcall
add ebx,1 shl 16 - 1
add ebx,1*65536-1
mcall
inc ebx
mov ecx,0xffffff
or ecx,0xffffff
mcall
 
;xor ecx,ecx ; black shade of text
;xor ecx,ecx
;mov edx,labelt
;mov esi,labellen-labelt
;add ebx,1*65536+1
;mcall
;mcall 4
;sub ebx,1*65536+1
;mov ecx,0xffffff
;or ecx,0xffffff
;mcall
 
ret
480,18 → 537,17
 
itype db 0
 
align 4
 
tl dd 2
yw dd 51
 
xpos dd 15
ypos dd 185
 
bgrxy dd 0x0
scrxy dd 0x0
bgrdrawtype dd 0x0
 
hand file 'hand.cur'
 
icon_moved dd 0
 
iconstate dd 0
 
add_table0 dd (24-6*4)*3,(24-6*2)*3,(24-6*1)*3,\
530,7 → 586,23
 
pixl dd ?
 
xpos dd ?
ypos dd ?
 
mouse_pressed dd ?
 
xmouse_rel dd ?
ymouse_rel dd ?
 
xmouse_old dd ?
ymouse_old dd ?
processes dd ?
pid dd ?
 
process process_information
 
;include_debug_strings
 
I_PARAM:
 
I_END:
I_END:
/programs/system/icon_new/trunk/iconmngr.asm
30,8 → 30,7
 
still:
 
mov eax,10 ; wait here for event
mcall
mcall 10 ; wait here for event
 
dec eax ; redraw request ?
jz red
39,8 → 38,7
jz key
 
button: ; button
mov al,17 ; get id
mcall
mcall 17 ; get id
 
shr eax,8
 
123,8 → 121,7
sub ebx,eax
imul ebx,70
push ebx
mov eax,14
mcall
mcall 14
pop ebx
shr eax,16
sub eax,51+15
559,12 → 556,9
 
draw_window:
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mcall
mcall 12,1 ; function 12,1 - tell os about start of draw window
 
; DRAW WINDOW
xor eax,eax
xor eax,eax ; DRAW WINDOW
mov ebx,210*65536+300
mov ecx,30*65536+390
mov edx,0x33ffffff
680,9 → 674,7
 
call print_strings
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mcall
mcall 12,2 ; function 12,2 - tell os about end of draw window
 
ret
 
702,7 → 694,6
 
times 10 db ' '
 
 
text:
db 0,0,0,0, 'Click on icon position to edit '
db 0,0,0,0, ' '
/programs/system/icon_new/trunk/icons/vrr.ico
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/system/icon_new/trunk/icons/board.ico
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/system/icon_new/trunk/icons/bug.ico
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/system/icon_new/trunk/icons/calc.ico
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/system/icon_new/trunk/icons/fasm.ico
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/system/icon_new/trunk/icons/floppy.ico
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/system/icon_new/trunk/icons/fs.ico
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/system/icon_new/trunk/icons/write.ico
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/system/icon_new/trunk/icons.dat
1,8 → 1,7
AA-/sys/icons/FS.ICO -/sys/KFAR -FAR *
AA-/sys/icons/FS.ICO -/sys/File Managers/KFAR -FAR *
BA-/sys/icons/FASM.ICO -/sys/develop/FASM -Fasm *
CA-/sys/icons/WRITE.ICO -/sys/TINYPAD -Tinypad *
AB-/sys/icons/FLOPPY.ICO -/sys/RDSAVE -RDsave *
BB-/sys/icons/CALC.ICO -/sys/CALC -Calc *
HA-/sys/icons/BUG.ICO -/sys/develop/MTDBG -Debuger *
IA-/sys/icons/BOARD.ICO -/sys/develop/BOARD -Board *
JA-/sys/icons/VRR.ICO -/sys/VRR -VRR *
IA-/sys/icons/BUG.ICO -/sys/develop/MTDBG -Debuger *
JA-/sys/icons/BOARD.ICO -/sys/develop/BOARD -Board *