From f1e4d83cf0aaf8a96f97771b141ea875baaa4c4c Mon Sep 17 00:00:00 2001 From: "Evgeny Grechnikov (Diamond)" Date: Sat, 31 Jan 2009 03:32:49 +0000 Subject: [PATCH] kiv: new icons from Leency; can set wallpaper, can jump to prev/next images git-svn-id: svn://kolibrios.org@1016 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/media/kiv/trunk/dll.inc | 6 + programs/media/kiv/trunk/fliphorz.bmp | Bin 358 -> 0 bytes programs/media/kiv/trunk/flipvert.bmp | Bin 358 -> 0 bytes programs/media/kiv/trunk/kiv.asm | 460 +++++++++++++++++++++----- programs/media/kiv/trunk/kivicons.bmp | Bin 0 -> 3930 bytes programs/media/kiv/trunk/open.bmp | Bin 358 -> 0 bytes programs/media/kiv/trunk/rot180.bmp | Bin 358 -> 0 bytes programs/media/kiv/trunk/rotccw.bmp | Bin 358 -> 0 bytes programs/media/kiv/trunk/rotcw.bmp | Bin 358 -> 0 bytes 9 files changed, 385 insertions(+), 81 deletions(-) delete mode 100644 programs/media/kiv/trunk/fliphorz.bmp delete mode 100644 programs/media/kiv/trunk/flipvert.bmp create mode 100644 programs/media/kiv/trunk/kivicons.bmp delete mode 100644 programs/media/kiv/trunk/open.bmp delete mode 100644 programs/media/kiv/trunk/rot180.bmp delete mode 100644 programs/media/kiv/trunk/rotccw.bmp delete mode 100644 programs/media/kiv/trunk/rotcw.bmp diff --git a/programs/media/kiv/trunk/dll.inc b/programs/media/kiv/trunk/dll.inc index e1cb98d178..5f13fbbc16 100644 --- a/programs/media/kiv/trunk/dll.inc +++ b/programs/media/kiv/trunk/dll.inc @@ -15,7 +15,13 @@ proc dll.Load, import_table:dword or eax,eax jz .fail stdcall dll.Link,eax,edx + push eax + mov eax, [eax] + cmp dword [eax], 'lib_' + pop eax + jnz @f stdcall dll.Init,[eax+4] + @@: pop esi add esi,8 jmp .next_lib diff --git a/programs/media/kiv/trunk/fliphorz.bmp b/programs/media/kiv/trunk/fliphorz.bmp deleted file mode 100644 index 024688269705f83ad4084c1b4bec6d031e0b4573..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 358 zcmbV_u?@r^3`HI3x@#ikhR7V(XAQyxp{24Ii;=Pcc{Wilx-uWWdGZJIUBV!)jXLAc z=|NuJ->K8PdxXthS%fV)_k#-JEVWjG=381b!Ypf1$|ZTi8Z|P(->y-&lQo5q2&}&* aL;$N{BKYeQ{O*_AoN}MfY?J@h@c|!pz, 0xFFFFFF - mov ecx, [procinfo + 46] - sub ecx, ebp - sub ecx, 9 + mov ecx, [procinfo + 66] + sub ecx, 4 shl ecx, 16 mov cl, 5 mcall @@ -284,31 +550,55 @@ draw_window: add ebx, esi mcall - invoke gfx.pen.color, [ctx], 0x007F7F7F - mov eax, [procinfo + 42] - sub eax, 10 - invoke gfx.line, [ctx], 0, 30, eax, 30 - - xor ebp, ebp + mov ebx, [procinfo + 62] + push ebx + mcall 38, , <30, 30>, 0x007F7F7F + mcall , <5 + 25 * 1, 5 + 25 * 1>, <0, 30> + mcall , <10 + 25 * 3, 10 + 25 * 3> + mcall , <15 + 25 * 4, 15 + 25 * 4> + pop ebx + sub ebx, 25 * 5 + 10 + push ebx + imul ebx, 10001h + mcall mcall 8, <5 + 25 * 0, 20>, <5, 20>, 'opn'+40000000h - mcall 65, openbtn, <20, 20>, <5 + 25 * 0, 5>, 4, palette + mcall , <10 + 25 * 1, 20>, , 'bck'+40000000h + mcall , <10 + 25 * 2, 20>, , 'fwd'+40000000h + mcall , <15 + 25 * 3, 20>, , 'bgr'+40000000h + pop ebx + add ebx, 5 + shl ebx, 16 + mov bl, 20 + mcall , , , 'flh'+40000000h + add ebx, 25 * 65536 + mcall , , , 'flv'+40000000h + add ebx, 30 * 65536 + mcall , , , 'rtr'+40000000h + add ebx, 25 * 65536 + mcall , , , 'rtl'+40000000h + add ebx, 25 * 65536 + mcall , , , 'flb'+40000000h - invoke gfx.line, [ctx], 5 + 25 * 1, 0, 5 + 25 * 1, 30 + mov ebp, (numimages-1)*20 - mcall 8, <10 + 25 * 1, 20>, <5, 20>, 'flh'+40000000h - mcall 65, fliphorzbtn, <20, 20>, <10 + 25 * 1, 5>, 4, palette - mcall 8, <10 + 25 * 2, 20>, <5, 20>, 'flv'+40000000h - mcall 65, flipvertbtn, <20, 20>, <10 + 25 * 2, 5>, 4, palette - - invoke gfx.line, [ctx], 10 + 25 * 3, 0, 10 + 25 * 3, 30 - - mcall 8, <15 + 25 * 3, 20>, <5, 20>, 'rtr'+40000000h - mcall 65, rotcwbtn, <20, 20>, <15 + 25 * 3, 5>, 4, palette - mcall 8, <15 + 25 * 4, 20>, <5, 20>, 'rtl'+40000000h - mcall 65, rotccwbtn, <20, 20>, <15 + 25 * 4, 5>, 4, palette - mcall 8, <15 + 25 * 5, 20>, <5, 20>, 'flb'+40000000h - mcall 65, rot180btn, <20, 20>, <15 + 25 * 5, 5>, 4, palette + mcall 65, buttons+openbtn*20, <20, 20>, <5 + 25 * 0, 5>, 8, palette + mcall , buttons+backbtn*20, , <10 + 25 * 1, 5> + mcall , buttons+forwardbtn*20, , <10 + 25 * 2, 5> + mcall , buttons+bgrbtn*20, , <15 + 25 * 3, 5> + mov edx, [procinfo + 62] + sub edx, 25 * 5 + 4 + shl edx, 16 + mov dl, 5 + mcall , buttons+fliphorzbtn*20 + add edx, 25 * 65536 + mcall , buttons+flipvertbtn*20 + add edx, 30 * 65536 + mcall , buttons+rotcwbtn*20 + add edx, 25 * 65536 + mcall , buttons+rotccwbtn*20 + add edx, 25 * 65536 + mcall , buttons+rot180btn*20 mov ebx, [image] mov ecx, [ebx + Image.Width] @@ -328,7 +618,6 @@ draw_window: xor ebp, ebp mcall 65 - invoke gfx.close, [ctx] ret ; void* __stdcall mem.Alloc(unsigned size); @@ -563,7 +852,8 @@ align 4 library \ libio , 'libio.obj' , \ libgfx , 'libgfx.obj' , \ - libimg , 'libimg.obj' + libimg , 'libimg.obj' , \ + sort , 'sort.obj' import libio , \ libio.init , 'lib_init' , \ @@ -588,43 +878,39 @@ import libimg , \ img.rotate , 'img.rotate' , \ img.destroy , 'img.destroy' +import sort, sort.START, 'START', SortDir, 'SortDir', strcmpi, 'strcmpi' + ;----------------------------------------------------------------------------- -palette: - dd 0x000000, 0x800000, 0x008000, 0x808000 - dd 0x000080, 0x800080, 0x008080, 0x808080 - dd 0xC0C0C0, 0xFF0000, 0x00FF00, 0xFFFF00 - dd 0x0000FF, 0xFF00FF, 0x00FFFF, 0xFFFFFF +virtual at 0 +file 'kivicons.bmp':0xA,4 +load offbits dword from 0 +end virtual +numimages = 9 +openbtn = 0 +backbtn = 1 +forwardbtn = 2 +bgrbtn = 3 +fliphorzbtn = 4 +flipvertbtn = 5 +rotcwbtn = 6 +rotccwbtn = 7 +rot180btn = 8 -macro loadbtn filename -{ -repeat 20 -file filename:76h+(%-1)*12,10 -end repeat +palette: + file 'kivicons.bmp':0x36,offbits-0x36 +buttons: + file 'kivicons.bmp':offbits repeat 10 y = % - 1 z = 20 - % -repeat 10 -load a byte from $ - 20*10 + y*10 + (%-1) -load b byte from $ - 20*10 + z*10 + (%-1) -store byte a at $ - 20*10 + z*10 + (%-1) -store byte b at $ - 20*10 + y*10 + (%-1) +repeat numimages*5 +load a dword from $ - numimages*20*20 + numimages*20*y + (%-1)*4 +load b dword from $ - numimages*20*20 + numimages*20*z + (%-1)*4 +store dword a at $ - numimages*20*20 + numimages*20*z + (%-1)*4 +store dword b at $ - numimages*20*20 + numimages*20*y + (%-1)*4 end repeat end repeat -} - -openbtn: - loadbtn 'open.bmp' -fliphorzbtn: - loadbtn 'fliphorz.bmp' -flipvertbtn: - loadbtn 'flipvert.bmp' -rotcwbtn: - loadbtn 'rotcw.bmp' -rotccwbtn: - loadbtn 'rotccw.bmp' -rot180btn: - loadbtn 'rot180.bmp' ; DATA AREA get_loops dd 0 @@ -644,16 +930,28 @@ run_fileinfo: ;run_filepath db '/sys/SYSXTREE',0 +readdir_fileinfo: + dd 1 + dd 0 + dd 0 +readblocks dd 0 +directory_ptr dd 0 + ;----------------------------------------------------------------------------- I_END: +curdir rb 1024 + +align 4 img_data dd ? img_data_len dd ? fh dd ? image dd ? wnd_width dd ? wnd_height dd ? +last_name_component dd ? +cur_file_idx dd ? ctx dd ? diff --git a/programs/media/kiv/trunk/kivicons.bmp b/programs/media/kiv/trunk/kivicons.bmp new file mode 100644 index 0000000000000000000000000000000000000000..4fbdf3641f409d7637ff4911d705961d7f523c54 GIT binary patch literal 3930 zcmeH}U2IfE6vxlb?z*>Sx7~j5(WSaTyZzo?y|lK{ZP_l65EG;FUmBnFG;%*UO%d)FWYUkv}v z&D?wD%*^kcId|^n9@$k5Tn`5T+VJi(yz21^fW__cDuB8b;@XB5x=4Y6$Kb==gE0Ec zbC7s50gZ1pL(Bel7~A(ebRTr!tJj|eXQCgDyz>eidiMZi@>^jrzYVf8+u_FNFGGH8 zKg@jk0X$mR2|J3r;PEq0!V}+*z>e9cVCR|LQ2g>EczSjZjLhzZk+XZDdHe>WYzIsY9TygClc z^E0sY%a1U2Z4%!8eHkYHJPLnYnulwbF2dpK$KlxZlW^kdGT3+Z|H}Ylw;j{J9U2a| zlv%^HMoU!2-7vA*6=k6PG=7WCydwiz#{762w#qXb=4db&8IXzugHd+^&Q=1*YTNJg zE=}(KK>QX&PBN03KM?4Ux;LO~)P}8CxJ63X#X~rzp`*b_+*L#~i`n%WG#-&VlRjvF zAbtxWCmTo#I?z!T8j)k+kdP>md&EOHrlF$-ay%YUd1f^t&!Q0lBg)3kWGS>i5Wj_x zTZI%f5(l;p33a%c4p+uvv6ZX2LW0?9=1(iJqf%B)bRbTZAyYjdnOTk4NtV>mw6hO( zCL7Eh=DBygfgtkzUJGqernR*b)#@@25wz5hgr+Pjtyavv%Hn2PF$-|X%xcz)ooq<1 z*U-3fKQW7}%iLoG8BZV-(gPj~_hgxN#wtu^g4QCZkkyt*)Kyn;$P(tN>bgXt%?goU zIcChVAp@FWZFre+2Ej~oDfunf!!pcf9%h6lxrJeeQd@e`snoi)s~XqTYv%ejjjPtK zOQq61TT+_2t4kJ$$TQ12w2wkgRwtG{bo+jpx-{+Xf{@S2IsNl7sa!f7Ha|QL8R_ZYFjKH!o3@3u_$>lZ=ZtB&{ zy_*I%=W;zRGBI-@Gq&zKn007L#tdY7Xx8GmXNT?hf0lX|I=9~DuNk>VY6X}j)-Kfi)=G~fR$ku2b*?8W(q>*SwZqvGgEoU z1Ht zeY=MpGs|MbY12K(w%tTFl0v~&#!>2O8-*dfL;P$oM)F(B(w36HNa{PN9Xxkz*vzu0 b>t+uk2p{szhTVaFPwMW#e0Qh#Pc!g0N9?*z literal 0 HcmV?d00001 diff --git a/programs/media/kiv/trunk/open.bmp b/programs/media/kiv/trunk/open.bmp deleted file mode 100644 index 2f2a00e80c15177cf15b19128718ca849c6d13e4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 358 zcma)$F%H5o3`JeR5Gg~E;1G;R+<={H^a#uzdz{{&ITCw@@N7q6LgF{yeX)PiKAy`Y zt{3%+FWr+Iz5k}3bNB?CLn^`&)p$`stWrv0(0oa2MwrK1lyyk{W6p~tPLY>8x&`Nh vZ5Ys>w?2S#?E~xYn;*AKuBhKL@2GRG-}}{niLa3l>EN`c!JZo#lE3)_SbA)Z diff --git a/programs/media/kiv/trunk/rot180.bmp b/programs/media/kiv/trunk/rot180.bmp deleted file mode 100644 index 9406004867723c34e887f61e1fd5b5968a6afbef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 358 zcmZvW!41PO2t|q1TQ8B?Au>nqT?1zV_v#a3ERWO;+z&W*r3U-srw=mhFJ8zaBX7{N zYoVL_ALPe9w1Q0$g$S2Qi3b@76{@wO(EL(sMi7o!NIHW4n7!t{NoN{x+bv7BN5?JO8y`Np+uz=G^$;yRSCk;64KR!{&Uu$=0DEPSz_ly1P$|K5p6iL fM1E&Ke`eI%Y_pqR8TOYWRys3l*>@@+{{8;}*_VDD