1 ;*****************************************************************************
2 ;*****************************************************************************
3 ; zSea - advanced image viewer for KolibriOS
4 ; Copyright (c) 2008-2014, Marat Zakiyanov aka Mario79, aka Mario
7 ; Redistribution and use in source and binary forms, with or without
8 ; modification, are permitted provided that the following conditions are met:
9 ; * Redistributions of source code must retain the above copyright
10 ; notice, this list of conditions and the following disclaimer.
11 ; * Redistributions in binary form must reproduce the above copyright
12 ; notice, this list of conditions and the following disclaimer in the
13 ; documentation and/or other materials provided with the distribution.
14 ; * Neither the name of the <organization> nor the
15 ; names of its contributors may be used to endorse or promote products
16 ; derived from this software without specific prior written permission.
18 ; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
19 ; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20 ; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21 ; DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
22 ; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 ; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 ; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 ; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 ; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 ; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 ;*****************************************************************************
29 ; v.1.0 rñ5 22.04.2014
30 ;******************************************************************************
33 db 'MENUET01' ; 8 byte id
34 dd 0x01 ; header version
35 dd START
; start of code
36 dd IM_END
; size of image
37 dd I_END
; memory for app
39 dd dest_cmdline
; I_Param
40 dd path
; APPLICATION PACH
44 ;include 'editbox_ex.mac'
46 include '../../macros.inc'
47 include '../../develop/libraries/box_lib/trunk/box_lib.mac'
48 include '../../proc32.inc'
50 include '../../KOSfuncs.inc'
51 include '../../load_lib.mac'
52 @use_library ;use load lib macros
53 ;******************************************************************************
54 ;------------------------------------------------------------------------------
55 START: ; start of execution
70 mov [active_process
],ecx
76 mov [menu_data_1.procinfo
],eax
77 mov [menu_data_2.procinfo
],eax
78 mov [menu_data_3.procinfo
],eax
79 mov [menu_data_4.procinfo
],eax
80 mov [menu_data_5.procinfo
],eax
81 mov [menu_data_6.procinfo
],eax
83 mov [load_directory_pointer
],dir_header
88 ;init_checkboxes2 check1,...
96 ; call init_data_OpenDialog
98 ;init_OpenDialog OpenDialog_data
99 push dword OpenDialog_data
100 call [OpenDialog_Init
]
102 ;init_ColorDialog ColorDialog_data
103 push dword ColorDialog_data
104 call [ColorDialog_Init
]
108 ;-----------------------------------------------------
109 ; check for parameters
111 cmp dword [esi],'BOOT'
138 ;-----------------------------------------------------
148 mov edi,string
; clear string
149 mov ecx,4096/4 ;256/4 ; length of a string
150 xor eax,eax ; symbol <0>
154 mov edi, [28] ; look for <0> in temp_area
160 mov [bgrmode],dword 1
165 mov [bgrmode],dword 2
170 mov ecx,4095 ;257 ; strlen
176 rep movsb ; copy string from temp_area to "string
" (filename)
189 mov [load_directory_pointer
],dir_header
192 ;-----------------------------------------------------
194 ; or ecx,-1 ; get information about me
197 ; mov edx,[process_info+30] ; òåïåðü â edx íàø èäåíòèôèêàòîð
202 ; cmp edx,[process_info+30]
203 ; je @f ; åñëè íàø PID ñîâïàë ñ PID ðàññìàòðèâàåìîãî ïðîöåññà, ìû íàøëè ñåáÿ
204 ; dec ecx ; èíà÷å ñìîòðèì ñëåäóþùèé ïðîöåññ
205 ; jne @b ; âîçâðàùàåìñÿ, åñëè íå âñå ïðîöåññû ðàññìîòðåíû
208 ; òåïåðü â ecx íîìåð ïðîöåññà
210 ;---------------------------------------------------------------------
215 mcall
48, 5 ; GetClientTop, fix for case when @patel in the top
219 add ecx,523 ; [y start] *65536 + [y size]
228 call get_window_param
229 test [window_status
],10b
231 test [window_status
],100b
233 test [window_status
],1b
239 ; cmp [window_high],150
248 ; cmp [window_width],635
251 mcall
67,-1,ebx, ,ebx
258 ; mov [scroll_bar_data_vertical.position],eax
259 ; mov [scroll_bar_data_horizontal.position],eax
263 cmp [redraw_wallpaper_flag
],0
265 mov [redraw_wallpaper_flag
],0
276 cmp [skin_height
],eax
278 mov [skin_height
],eax
279 call convert.img_resolution_ok
284 cmp [open_file_flag
],1
286 cmp [sort_directory_flag
],byte 1
287 je red_sort_directory
288 cmp [redraw_flag
],byte 1
290 cmp eax,1 ; ïåðåðèñîâàòü îêíî ?
291 je red
; åñëè äà - íà ìåòêó red
292 cmp eax,2 ; íàæàòà êëàâèøà ?
293 je key
; åñëè äà - íà key
294 cmp eax,3 ; íàæàòà êíîïêà ?
295 je button
; åñëè äà - íà button
298 ; cmp [redraw_wallpaper_flag],1
300 ; mov [redraw_wallpaper_flag],0
302 jmp still
; åñëè äðóãîå ñîáûòèå - â íà÷àëî öèêëà
305 mov [sort_directory_flag
],byte 0
309 mov [redraw_flag
],byte 0
312 ;---------------------------------------------------------------------
314 ; test dword [status], 4
319 ; mcall 18,3,[active_process]
320 ; and byte [status], not 4
322 ;---------------------------------------------------------------------
326 cmp ah,1 ; button id=1 ?
330 ; mov eax,-1 ; close this program
334 je slide_show
.3 ;still
336 ;---------------------------------------------------------------------
341 mov eax,[procinfo
+70] ;status of window
362 ;---------------------------------------------------------------------
371 lea esi,[esi+esi*2] ; x 3
373 add esi,dword Convert_plugin_0.Assoc
398 ;---------------------------------------------------------------------
401 mov [open_file_flag
],0
406 mov [load_directory_pointer
],dir_header
425 call get_window_param
426 test [window_status
],1b
428 mov [no_draw_window
],1
431 ; mov edx,size_after_convert_2
432 ; call write_memory_size
437 mov [no_draw_window
],0
440 ;---------------------------------------------------------------------
446 ;---------------------------------------------------------------------
448 mcall
9, procinfo
, -1
450 mov [window_start_x
],eax
452 mov [window_start_y
],eax
453 mov eax,[ebx+66] ;46]
455 mov [window_high
],eax
456 mov eax,[ebx+62] ;42]
458 mov [window_width
],eax
460 mov [window_status
],eax
462 ; mov [skin_high],eax
464 ;---------------------------------------------------------------------
467 ; mcall 9, procinfo, -1
472 ;---------------------------------------------------------------------
473 include 'backgrnd.inc'
474 include 'draw_win.inc'
475 include 'full_win.inc'
478 include 'menu_key.inc'
479 include 'clr_bcgr.inc'
480 include 'w_error.inc'
483 include 'draw_img.inc'
484 include 'convert.inc'
486 include 'w_about.inc'
487 include 'win_file.inc'
488 include 'win_info.inc'
489 include 'win_bcgr.inc'
490 include 'win_sort.inc'
491 include 'win_opti.inc'
493 include '../../dll.inc'
495 ;---------------------------------------------------------------------
497 include 'dat_area.inc'