ICON v3.00 -

1) Program used only 2 threads: draw and mouse.
2) Used new kernel functions: 25, 34, 15.8, 4 (redirect).
3) Used PNG icons with transparent.

git-svn-id: svn://kolibrios.org@2538 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2012-04-01 23:55:52 +00:00
parent bd6c0291ed
commit 38b226fb8d
20 changed files with 949 additions and 1228 deletions

View File

@ -239,7 +239,7 @@ CMM_PROGRAMS:=\
OTHER_FILES:=autorun.dat:AUTORUN.DAT \ OTHER_FILES:=autorun.dat:AUTORUN.DAT \
background.gif:background.gif default.skn:DEFAULT.SKN \ background.gif:background.gif default.skn:DEFAULT.SKN \
e80:E80 graph:GRAPH hdread:HDREAD \ e80:E80 graph:GRAPH hdread:HDREAD \
icons.dat:ICONS.DAT iconstrp.gif:ICONSTRP.GIF index_htm:INDEX.HTM \ icons.dat:ICONS.DAT iconstrp.png:ICONSTRP.PNG index_htm:INDEX.HTM \
kernel.mnt:KERNEL.MNT kerpack:KERPACK keymap.key:KEYMAP.KEY \ kernel.mnt:KERNEL.MNT kerpack:KERPACK keymap.key:KEYMAP.KEY \
kuzkina.mid:KUZKINA.MID lang.inc:LANG.INC lang.ini:LANG.INI \ kuzkina.mid:KUZKINA.MID lang.inc:LANG.INC lang.ini:LANG.INI \
menu.dat:MENU.DAT \ menu.dat:MENU.DAT \

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -245,7 +245,7 @@ CMM_PROGRAMS:=\
OTHER_FILES:=autorun.dat:AUTORUN.DAT \ OTHER_FILES:=autorun.dat:AUTORUN.DAT \
background.gif:background.gif default.skn:DEFAULT.SKN \ background.gif:background.gif default.skn:DEFAULT.SKN \
e80:E80 graph:GRAPH hdread:HDREAD \ e80:E80 graph:GRAPH hdread:HDREAD \
icons.dat:ICONS.DAT iconstrp.gif:ICONSTRP.GIF index_htm:INDEX.HTM \ icons.dat:ICONS.DAT iconstrp.png:ICONSTRP.PNG index_htm:INDEX.HTM \
kernel.mnt:KERNEL.MNT kerpack:KERPACK keymap.key:KEYMAP.KEY \ kernel.mnt:KERNEL.MNT kerpack:KERPACK keymap.key:KEYMAP.KEY \
kuzkina.mid:KUZKINA.MID lang.inc:LANG.INC lang.ini:LANG.INI \ kuzkina.mid:KUZKINA.MID lang.inc:LANG.INC lang.ini:LANG.INI \
menu.dat:MENU.DAT \ menu.dat:MENU.DAT \

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

BIN
data/eng/iconstrp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -169,7 +169,7 @@ CMM_PROGRAMS:=\
# Spaces should be represented as |. # Spaces should be represented as |.
OTHER_FILES:=autorun.dat:AUTORUN.DAT \ OTHER_FILES:=autorun.dat:AUTORUN.DAT \
background.gif:background.gif default.skn:DEFAULT.SKN \ background.gif:background.gif default.skn:DEFAULT.SKN \
icons.dat:ICONS.DAT iconstrp.gif:ICONSTRP.GIF index_htm:INDEX.HTM \ icons.dat:ICONS.DAT iconstrp.png:ICONSTRP.PNG index_htm:INDEX.HTM \
kernel.mnt:KERNEL.MNT kerpack:KERPACK keymap.key:KEYMAP.KEY \ kernel.mnt:KERNEL.MNT kerpack:KERPACK keymap.key:KEYMAP.KEY \
lang.inc:LANG.INC lang.ini:LANG.INI \ lang.inc:LANG.INC lang.ini:LANG.INI \
menu.dat:MENU.DAT \ menu.dat:MENU.DAT \

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

BIN
data/new-stack/iconstrp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -238,7 +238,7 @@ CMM_PROGRAMS:=\
OTHER_FILES:=autorun.dat:AUTORUN.DAT \ OTHER_FILES:=autorun.dat:AUTORUN.DAT \
background.gif:background.gif default.skn:DEFAULT.SKN \ background.gif:background.gif default.skn:DEFAULT.SKN \
e80:E80 graph:GRAPH hdread:HDREAD \ e80:E80 graph:GRAPH hdread:HDREAD \
icons.dat:ICONS.DAT iconstrp.gif:ICONSTRP.GIF index_htm:INDEX.HTM \ icons.dat:ICONS.DAT iconstrp.png:ICONSTRP.PNG index_htm:INDEX.HTM \
kernel.mnt:KERNEL.MNT kerpack:KERPACK keymap.key:KEYMAP.KEY \ kernel.mnt:KERNEL.MNT kerpack:KERPACK keymap.key:KEYMAP.KEY \
kuzkina.mid:KUZKINA.MID lang.inc:LANG.INC lang.ini:LANG.INI \ kuzkina.mid:KUZKINA.MID lang.inc:LANG.INC lang.ini:LANG.INI \
menu.dat:MENU.DAT \ menu.dat:MENU.DAT \

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

BIN
data/rus/iconstrp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,78 @@
;------------------------------------------------------------------------------
align 4
bgrx rd 1
bgry rd 1
bgrxy rd 1
warea:
.by_x:
.right rw 1
.left rw 1
.by_y:
.bottom rw 1
.top rw 1
scrxy rd 1
icons rd 1
addr rd 1
cur_str rd 1
cur_band rd 1
icon_count rd 1
strip_file rd 1
icon_position: rd 1 ; [ebp-4] 'AA-F' or...
adress_of_icon_data: rd 1 ; [ebp+8]
adress_of_icon_data_2: rd 1 ; [ebp+8]
current_X: rd 1
current_Y: rd 1
current_X_mouse_thread: rd 1
current_Y_mouse_thread: rd 1
draw_area: rd 1
x_left: rd 1
x_right: rd 1
y_top: rd 1
y_bottom: rd 1
;------------------------------------------------------------------------------
curx1 rd 1
cury1 rd 1
curx2 rd 1
cury2 rd 1
click_pos rd 1
;------------------------------------------------------------------------------
align 4
redraw_all_icon: rb 1
;------------------------------------------------------------------------------
align 4
param_str rb 31
;------------------------------------------------------------------------------
align 4
procinfo process_information
;------------------------------------------------------------------------------
align 4
path:
icon_data:
rb 0x1000
;------------------------------------------------------------------------------
align 4
rb 0x400
stack_mouse_thread:
;------------------------------------------------------------------------------
align 4
rb 0x400
stack_area:
;------------------------------------------------------------------------------
align 4
I_Param:
rb 0x100 ; max 256
;------------------------------------------------------------------------------
align 4
library_path:
rb 0x1000
;------------------------------------------------------------------------------

View File

@ -0,0 +1,199 @@
;------------------------------------------------------------------------------
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, ' <20><>Žƒ<C5BD>€ŒŒ€ '
db 255,255,255,0, ' <20><EFBFBD>€Œ…<E280A6> '
db 255,255,255,0, ' <20><>ˆŒ…<C592>ˆœ '
db 255,255,255,0, ' „Ž<E2809E>ˆœ “„€‹ˆ’œ '
db 0,0,0,0, '<27>€†Œˆ<20><20>Ž‡ˆˆž ˆŠŽ<C5A0>Šˆ „‹Ÿ <20>…„€Šˆ<E28099>Ž<E2809A>ˆŸ '
db 'x' ; <- END MARKER, DONT DELETE
add_text db '<27>€†Œˆ<20><20>Ž‡ˆˆž <20>ˆ<CB86>Žœ‡“…ŒŽ‰ ˆŠŽ<C5A0>Šˆ ',0
rem_text db '<27>€†Œˆ<20><20>Ž‡ˆˆž ˆ<CB86>Žœ‡“…ŒŽ‰ ˆŠŽ<C5A0>Šˆ ',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
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-SYSXTREE-000-/RD/1/SYSXTREE '
db '- *'
db 13,10
;------------------------------------------------------------------------------
rep_text:
if lang eq ru
db '‡<>€—Šˆ - ˆ‡ , <E2809A><E280BA><EFBFBD> #'
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
er_message_found_lib1 db 'cnv_png.obj - Not found!',0
er_message_import1 db 'cnv_png.obj - Wrong import!',0
err_message_found_lib2 db 'archiver.obj - Not found!',0
err_message_import2 db 'archiver.obj - Wrong import!',0
ihead_f_i:
ihead_f_l db 'Errors of plugins:',0
;plugins_directory db 'plugins/',0
plugins_directory db 0
;------------------------------------------------------------------------------
l_libs_start:
library01 l_libs system_dir_CnvPNG+9,path,library_path,system_dir_CnvPNG,\
er_message_found_lib1,ihead_f_l,cnv_png_import,er_message_import1,ihead_f_i,plugins_directory
library02 l_libs system_dir_UNPACK+9,path,library_path,system_dir_UNPACK,\
err_message_found_lib2,ihead_f_l,UNPACK_import,err_message_import2,ihead_f_i,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
;------------------------------------------------------------------------------

View File

@ -0,0 +1,147 @@
macro debug_print str
{
local ..string, ..label
jmp ..label
..string db str,0
..label:
pushf
pushad
mov edx,..string
call debug_outstr
popad
popf
}
dps fix debug_print
macro debug_print_dec arg
{
pushf
pushad
if ~arg eq eax
mov eax,arg
end if
call debug_outdec
popad
popf
}
dpd fix debug_print_dec
;---------------------------------
debug_outdec: ;(eax - num, edi-str)
push 10 ;2
pop ecx ;1
push -'0' ;2
.l0:
xor edx,edx ;2
div ecx ;2
push edx ;1
test eax,eax ;2
jnz .l0 ;2
.l1:
pop eax ;1
add al,'0' ;2
call debug_outchar ; stosb
jnz .l1 ;2
ret ;1
;---------------------------------
debug_outchar: ; al - char
pushf
pushad
mov cl,al
mov eax,63
mov ebx,1
int 0x40
popad
popf
ret
debug_outstr:
mov eax,63
mov ebx,1
@@:
mov cl,[edx]
test cl,cl
jz @f
int 40h
inc edx
jmp @b
@@:
ret
_debug_crlf db 13, 10, 0
macro newline_1
{
pushf
pushad
mov edx, _debug_crlf
call debug_outstr
popad
popf
}
macro newline
{
pushf
pushad
mov edx, _debug_crlf
call debug_outstr
popad
popf
}
macro print message
{
dps message
newline
}
macro pregs
{
dps "EAX: "
dpd eax
dps " EBX: "
dpd ebx
newline
dps "ECX: "
dpd ecx
dps " EDX: "
dpd edx
newline
}
macro debug_print_hex arg
{
pushf
pushad
if ~arg eq eax
mov eax, arg
end if
call debug_outhex
popad
popf
}
dph fix debug_print_hex
debug_outhex:
; eax - number
mov edx, 8
.new_char:
rol eax, 4
movzx ecx, al
and cl, 0x0f
mov cl, [__hexdigits + ecx]
pushad
mcall 63, 1
popad
dec edx
jnz .new_char
ret
__hexdigits:
db '0123456789ABCDEF'

View File

@ -1,485 +0,0 @@
; GIF LITE v3.0 by Willow
; Written in pure assembler by Ivushkin Andrey aka Willow
; Modified by Diamond
;
; This include file will contain functions to handle GIF image format
;
; Created: August 15, 2004
; Last changed: June 24, 2007
; Requires kglobals.inc (iglobal/uglobal macro)
; (program must 'include "kglobals.inc"' and say 'IncludeUGlobal'
; somewhere in uninitialized data area).
; Configuration: [changed from program which includes this file]
; 1. The constant COLOR_ORDER: must be one of
; PALETTE - for 8-bit image with palette (sysfunction 65)
; MENUETOS - for MenuetOS and KolibriOS color order (sysfunction 7)
; OTHER - for standard color order
; 2. Define constant GIF_SUPPORT_INTERLACED if you want to support interlaced
; GIFs.
; 3. Single image mode vs multiple image mode:
; if the program defines the variable 'gif_img_count' of type dword
; somewhere, ReadGIF will enter multiple image mode: gif_img_count
; will be initialized with image count, output format is GIF_list,
; the function GetGIFinfo retrieves Nth image info. Otherwise, ReadGIF
; uses single image mode: exit after end of first image, output is
; <dd width,height, times width*height[*3] db image>
if ~ (COLOR_ORDER in <PALETTE,MENUETOS,OTHER>)
; This message may not appear under MenuetOS, so watch...
display 'Please define COLOR_ORDER: PALETTE, MENUETOS or OTHER',13,10
end if
if defined gif_img_count
; virtual structure, used internally
struct GIF_list
NextImg rd 1
Left rw 1
Top rw 1
Width rw 1
Height rw 1
Delay rd 1
Displacement rd 1 ; 0 = not specified
; 1 = do not dispose
; 2 = restore to background color
; 3 = restore to previous
if COLOR_ORDER eq PALETTE
Image rd 1
end if
ends
struct GIF_info
Left rw 1
Top rw 1
Width rw 1
Height rw 1
Delay rd 1
Displacement rd 1
if COLOR_ORDER eq PALETTE
Palette rd 1
end if
ends
; ****************************************
; FUNCTION GetGIFinfo - retrieve Nth image info
; ****************************************
; in:
; esi - pointer to image list header
; ecx - image_index (0...img_count-1)
; edi - pointer to GIF_info structure to be filled
; out:
; eax - pointer to RAW data, or 0, if error
GetGIFinfo:
push esi ecx edi
xor eax,eax
jecxz .eloop
.lp:
mov esi,[esi]
test esi,esi
jz .error
loop .lp
.eloop:
lodsd
movsd
movsd
movsd
movsd
if COLOR_ORDER eq PALETTE
lodsd
mov [edi],esi
else
mov eax,esi
end if
.error:
pop edi ecx esi
ret
end if
_null fix 0x1000
; ****************************************
; FUNCTION ReadGIF - unpacks GIF image
; ****************************************
; in:
; esi - pointer to GIF file in memory
; edi - pointer to output image list
; out:
; eax - 0, all OK;
; eax - 1, invalid signature;
; eax >=8, unsupported image attributes
;
ReadGIF:
push esi edi
mov [.cur_info],edi
xor eax,eax
mov [.globalColor],eax
if defined gif_img_count
mov [gif_img_count],eax
mov [.anim_delay],eax
mov [.anim_disp],eax
end if
inc eax
cmp dword[esi],'GIF8'
jne .ex ; signature
mov ecx,[esi+0xa]
add esi,0xd
mov edi,esi
test cl,cl
jns .nextblock
mov [.globalColor],esi
call .Gif_skipmap
.nextblock:
cmp byte[edi],0x21
jne .noextblock
inc edi
if defined gif_img_count
cmp byte[edi],0xf9 ; Graphic Control Ext
jne .no_gc
movzx eax,word [edi+3]
mov [.anim_delay],eax
mov al,[edi+2]
shr al,2
and eax,7
mov [.anim_disp],eax
add edi,7
jmp .nextblock
.no_gc:
end if
inc edi
.block_skip:
movzx eax,byte[edi]
lea edi,[edi+eax+1]
test eax,eax
jnz .block_skip
jmp .nextblock
.noextblock:
mov al,8
cmp byte[edi],0x2c ; image beginning
jne .ex
if defined gif_img_count
inc [gif_img_count]
end if
inc edi
mov esi,[.cur_info]
if defined gif_img_count
add esi,4
end if
xchg esi,edi
if defined GIF_SUPPORT_INTERLACED
movzx ecx,word[esi+4]
mov [.width],ecx
movzx eax,word[esi+6]
imul eax,ecx
if ~(COLOR_ORDER eq PALETTE)
lea eax,[eax*3]
end if
mov [.img_end],eax
inc eax
mov [.row_end],eax
and [.pass],0
test byte[esi+8],40h
jz @f
if ~(COLOR_ORDER eq PALETTE)
lea ecx,[ecx*3]
end if
mov [.row_end],ecx
@@:
end if
if defined gif_img_count
movsd
movsd
mov eax,[.anim_delay]
stosd
mov eax,[.anim_disp]
stosd
else
movzx eax,word[esi+4]
stosd
movzx eax,word[esi+6]
stosd
add esi,8
end if
push edi
mov ecx,[esi]
inc esi
test cl,cl
js .uselocal
push [.globalColor]
mov edi,esi
jmp .setPal
.uselocal:
call .Gif_skipmap
push esi
.setPal:
movzx ecx,byte[edi]
inc ecx
mov [.codesize],ecx
dec ecx
if ~(COLOR_ORDER eq PALETTE)
pop [.Palette]
end if
lea esi,[edi+1]
mov edi,.gif_workarea
xor eax,eax
lodsb ; eax - block_count
add eax,esi
mov [.block_ofs],eax
mov [.bit_count],8
mov eax,1
shl eax,cl
mov [.CC],eax
mov ecx,eax
inc eax
mov [.EOI],eax
mov eax, _null shl 16
.filltable:
stosd
inc eax
loop .filltable
if COLOR_ORDER eq PALETTE
pop eax
pop edi
push edi
scasd
push esi
mov esi,eax
mov ecx,[.CC]
@@:
lodsd
dec esi
bswap eax
shr eax,8
stosd
loop @b
pop esi
pop eax
mov [eax],edi
else
pop edi
end if
if defined GIF_SUPPORT_INTERLACED
mov [.img_start],edi
add [.img_end],edi
add [.row_end],edi
end if
.reinit:
mov edx,[.EOI]
inc edx
push [.codesize]
pop [.compsize]
call .Gif_get_sym
cmp eax,[.CC]
je .reinit
call .Gif_output
.cycle:
movzx ebx,ax
call .Gif_get_sym
cmp eax,edx
jae .notintable
cmp eax,[.CC]
je .reinit
cmp eax,[.EOI]
je .end
call .Gif_output
.add:
mov dword [.gif_workarea+edx*4],ebx
cmp edx,0xFFF
jae .cycle
inc edx
bsr ebx,edx
cmp ebx,[.compsize]
jne .noinc
inc [.compsize]
.noinc:
jmp .cycle
.notintable:
push eax
mov eax,ebx
call .Gif_output
push ebx
movzx eax,bx
call .Gif_output
pop ebx eax
jmp .add
.end:
if defined GIF_SUPPORT_INTERLACED
mov edi,[.img_end]
end if
if defined gif_img_count
mov eax,[.cur_info]
mov [eax],edi
mov [.cur_info],edi
add esi,2
xchg esi,edi
.nxt:
cmp byte[edi],0
jnz .continue
inc edi
jmp .nxt
.continue:
cmp byte[edi],0x3b
jne .nextblock
xchg esi,edi
and dword [eax],0
end if
xor eax,eax
.ex:
pop edi esi
ret
.Gif_skipmap:
; in: ecx - image descriptor, esi - pointer to colormap
; out: edi - pointer to area after colormap
and ecx,111b
inc ecx ; color map size
mov ebx,1
shl ebx,cl
lea ebx,[ebx*2+ebx]
lea edi,[esi+ebx]
ret
.Gif_get_sym:
mov ecx,[.compsize]
push ecx
xor eax,eax
.shift:
ror byte[esi],1
rcr eax,1
dec [.bit_count]
jnz .loop1
inc esi
cmp esi,[.block_ofs]
jb .noblock
push eax
xor eax,eax
lodsb
test eax,eax
jnz .nextbl
mov eax,[.EOI]
sub esi,2
add esp,8
jmp .exx
.nextbl:
add eax,esi
mov [.block_ofs],eax
pop eax
.noblock:
mov [.bit_count],8
.loop1:
loop .shift
pop ecx
rol eax,cl
.exx:
xor ecx,ecx
ret
.Gif_output:
push esi eax edx
mov edx,.gif_workarea
.next:
push word[edx+eax*4]
mov ax,word[edx+eax*4+2]
inc ecx
cmp ax,_null
jnz .next
shl ebx,16
mov bx,[esp]
.loop2:
pop ax
if COLOR_ORDER eq PALETTE
stosb
else
lea esi,[eax+eax*2]
add esi,[.Palette]
if COLOR_ORDER eq MENUETOS
mov esi,[esi]
bswap esi
shr esi,8
mov [edi],esi
add edi,3
else
movsb
movsb
movsb
end if
end if
if defined GIF_SUPPORT_INTERLACED
cmp edi,[.row_end]
jb .norowend
mov eax,[.width]
if ~(COLOR_ORDER eq PALETTE)
lea eax,[eax*3]
end if
push eax
sub edi,eax
add eax,eax
cmp [.pass],3
jz @f
add eax,eax
cmp [.pass],2
jz @f
add eax,eax
@@:
add edi,eax
pop eax
cmp edi,[.img_end]
jb .nextrow
mov edi,[.img_start]
inc [.pass]
add edi,eax
cmp [.pass],3
jz @f
add edi,eax
cmp [.pass],2
jz @f
add edi,eax
add edi,eax
@@:
.nextrow:
add eax,edi
mov [.row_end],eax
xor eax,eax
.norowend:
end if
loop .loop2
pop edx eax esi
ret
uglobal
align 4
ReadGIF.globalColor rd 1
ReadGIF.cur_info rd 1 ; image table pointer
ReadGIF.codesize rd 1
ReadGIF.compsize rd 1
ReadGIF.bit_count rd 1
ReadGIF.CC rd 1
ReadGIF.EOI rd 1
if ~(COLOR_ORDER eq PALETTE)
ReadGIF.Palette rd 1
end if
ReadGIF.block_ofs rd 1
if defined GIF_SUPPORT_INTERLACED
ReadGIF.row_end rd 1
ReadGIF.img_end rd 1
ReadGIF.img_start rd 1
ReadGIF.pass rd 1
ReadGIF.width rd 1
end if
if defined gif_img_count
ReadGIF.anim_delay rd 1
ReadGIF.anim_disp rd 1
end if
ReadGIF.gif_workarea rb 16*1024
endg

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,174 @@
;------------------------------------------------------------------------------
align 4
START_mouse_thread:
mcall 40,100000b ; only Event 6 - Mouse
;------------------------------------------------------------------------------
align 4
still_mouse:
mcall 10
align 4
mouse:
mcall 37,2
cmp eax,1 ; åñëè íå ëåâàÿ, âîçâðàò
jne still_mouse
; êîîðäèíàòû êóðñîðà
xor ebx,ebx
mcall 37
mov ebx,eax ; eax = cursor_x
shr eax,16 ; ebx = cursor_y
and ebx,0xffff
mov [curx1],eax ; curx1 = cursor_x
mov [cury1],ebx ; cury1 = cursor_y
; êîìó ïðèíàäëåæèò òî÷êà?
mcall 34,[curx1],[cury1]
cmp al,1 ; 1 - ÿäðî
jne still_mouse
;--------------------------------------
align 4
@@: ; ïîäîæä¸ì, ïîêà ïîëüçîâàòåëü íå îòïóñòèë ïðàâóþ êíîïêó ìûøè
mcall 37,2 ; íàæàòû ëè êíîïêè ìûøè?
test eax,1 ; åñëè îòïóñòèë
jz @f ; èä¸ì â íà÷àëî ãëàâíîãî öèêëà
mcall 68,1 ; èíà÷å ïåðåêëþ÷èìñÿ íà ñëåäóþùèé ïîòîê ñèñòåìû è êîãäà
jmp @b ; âûïîëíåíèå âåðíåòñÿ ýòîìó ïîòîêó, ïðîâåðèì ìûøü îïÿòü
;--------------------------------------
align 4
@@:
; êîîðäèíàòû êóðñîðà
xor ebx,ebx
mcall 37
mov ebx,eax ; eax = cursor_x
shr eax,16 ; ebx = cursor_y
and ebx,0xffff
mov [curx2],eax ; curx1 = cursor_x
mov [cury2],ebx ; cury1 = cursor_y
; êîìó ïðèíàäëåæèò òî÷êà?
mcall 34,[curx2],[cury2]
cmp al,1 ; 1 - ÿäðî
jne still_mouse
; check for icon by click down
call check_icons_position
mov eax,[click_pos]
test eax,eax
jz still_mouse
push eax
mov eax,[curx2]
mov [curx1],eax
mov eax,[cury2]
mov [cury1],eax
; check for icon by click up
call check_icons_position
pop eax
mov ebx,[click_pos]
test ebx,ebx
jz still_mouse
cmp eax,ebx
jne still_mouse
;--------------------------------------
align 4
start_appl:
mov esi,[adress_of_icon_data_2] ;[ebp+8]
mov ebx,1
mov edi,finfo.path
call fill_paths
inc ebx
mov edi,param_str
mov dword[finfo_start+8],edi
call fill_paths
cmp byte[edi],0
jne .no0
and dword[finfo_start+8],0
;--------------------------------------
align 4
.no0:
mov ebx,finfo_start
mcall 70
jmp still_mouse
;------------------------------------------------------------------------------
align 4
fill_paths:
push esi edi
movzx ecx,byte[str_lens+ebx]
add esi,[positions+ebx*4]
push esi
add esi,ecx
;--------------------------------------
align 4
.l1:
dec esi
cmp byte[esi],' '
jnz .found
loop .l1
pop esi
jmp .noms
;--------------------------------------
align 4
.found:
lea ecx,[esi+1]
pop esi
sub ecx,esi
rep movsb
;--------------------------------------
align 4
.noms:
and byte[edi],0
pop edi esi
ret
;------------------------------------------------------------------------------
align 4
check_icons_position:
mov ecx,[icons]
mov ebx,icon_data
;--------------------------------------
align 4
.loop:
push ebx ecx
mov [adress_of_icon_data_2],ebx
mov eax,[ebx]
call calc_icon_pos
mov [current_X_mouse_thread],ebx
mov [current_Y_mouse_thread],eax
mov eax,[curx1]
mov ebx,[current_X_mouse_thread]
cmp eax,ebx
jb .next
add ebx,52
cmp eax,ebx
ja .next
mov eax,[cury1]
mov ebx,[current_Y_mouse_thread]
cmp eax,ebx
jb .next
add ebx,52
cmp eax,ebx
ja .next
pop ecx ebx
mov eax,[adress_of_icon_data_2]
mov [click_pos],eax
ret
;--------------------------------------
align 4
.next:
pop ecx ebx
add ebx,REC_SIZE
dec ecx
jnz .loop
; all icons survived!
xor eax,eax
mov [click_pos],eax
ret
;------------------------------------------------------------------------------