Subversion Repositories Kolibri OS

Rev

Rev 2148 | Rev 2584 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1851 mario79 1
;*****************************************************************************
1792 yogev_ezra 2
; KFM - Kolibri File Manager
1851 mario79 3
; Copyright (c) 2006 - 2010, Marat Zakiyanov aka Mario79, aka Mario
4
; All rights reserved.
5
;
6
; Redistribution and use in source and binary forms, with or without
7
; modification, are permitted provided that the following conditions are met:
8
;        * Redistributions of source code must retain the above copyright
9
;          notice, this list of conditions and the following disclaimer.
10
;        * Redistributions in binary form must reproduce the above copyright
11
;          notice, this list of conditions and the following disclaimer in the
12
;          documentation and/or other materials provided with the distribution.
13
;        * Neither the name of the  nor the
14
;          names of its contributors may be used to endorse or promote products
15
;          derived from this software without specific prior written permission.
16
;
17
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
18
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
; DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
21
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
;*****************************************************************************
2346 mario79 28
; KFM v0.47c 05.02.2012
29
;---------------------------------------------------------------------
1792 yogev_ezra 30
use32
1851 mario79 31
org	0x0
32
 
1792 yogev_ezra 33
    db	  'MENUET01'
34
    dd	  0x01
35
    dd	  START
36
    dd	  I_END
37
    dd	  mem
38
    dd	  stacktop
39
    dd	  0x0
40
    dd	  path
41
 
42
;include   'lang.inc'
43
;include   'kglobals.inc'
1851 mario79 44
;include   'macros.inc'
45
include '../../../macros.inc'
46
include '../../../config.inc'		;for nightbuild
47
 
1792 yogev_ezra 48
include   'editbox.inc'
49
;use_edit_box
50
use_edit_box procinfo
51
;include   'ASCGL.INC'
52
;---------------------------------------------------------------------
53
include   'files.inc'
54
;---------------------------------------------------------------------
55
STRLEN = 1024
56
;---------------------------------------------------------------------
57
START:
2148 mario79 58
;    mcall 9, procinfo, -1
59
;    mov   eax,[ebx+30]
60
;    mov   [PID],eax
61
;    xor   ecx,ecx
62
;@@:
63
;    inc   ecx
64
;    mcall 9, procinfo
65
;    mov   eax,[PID]
66
;    cmp   eax,[ebx+30]
67
;    jne   @r
68
;    mov  [active_process],ecx
69
	mcall	9,procinfo,-1
70
	mov	ecx,[ebx+30]	; PID
71
	mcall	18,21
72
	mov	[active_process],eax	; WINDOW SLOT
1792 yogev_ezra 73
    mov   [appl_memory],mem
74
    mov   ax,[select_disk_char]
75
    mov   [read_folder_name],ax
76
    mov   [read_folder_1_name],ax
77
    call  load_icon_and_convert_to_img
78
    call  load_buttons_and_convert_to_img
79
    call  load_initiation_file
80
    call  add_memory_for_folders
81
    call  device_detect
82
    call  device_detect_f70
83
    mcall 66, 1, 1
84
;    call  draw_window
85
;    xor   eax,eax
86
    mov   eax,1
87
    mov   [left_sort_flag],eax
88
    mov   [right_sort_flag],eax
89
 
90
    call  proc_read_left_folder
91
    test  eax,eax
92
    jz	  @f
93
    cmp   eax,6
94
    jne   read_folder_error
95
@@:
96
    call  proc_read_right_folder
97
    test  eax,eax
98
    jz	  @f
99
    cmp   eax,6
100
    jne   read_folder_1_error
101
@@:
102
	mcall 40, 0x27
103
	jmp   red_1
104
;---------------------------------------------------------------------
105
red:
106
    call  get_window_param
107
    test  [window_status],10b
108
    jnz   red_1   ;still
109
    test  [window_status],100b
110
    jnz   red_1
111
    cmp   [window_high],180
112
    ja	  @f
113
    mov   esi,180
114
    mcall 67,-1,ebx,ebx
115
@@:
116
    cmp   [window_width],495
117
    ja	  red_1
118
    mov   edx,495
119
    mcall 67,-1,ebx, ,ebx
120
red_1:
121
    call  draw_window
122
;---------------------------------------------------------------------
123
still:
124
    mcall 10
125
    cmp   eax,1
126
    je	  red
127
    cmp   eax,2
128
    je	  key
129
    cmp   eax,3
130
    je	  button
131
    cmp   eax,6
132
    je	  mouse
133
    jmp   still
134
;---------------------------------------------------------------------
135
get_window_param:
136
    mcall 9, procinfo, -1
137
    mov   eax,[ebx+46]
138
    mov   [window_high],eax
139
    mov   eax,[ebx+42]
140
    mov   [window_width],eax
141
    mov   eax,[ebx+70]
142
    mov   [window_status],eax
143
    mcall 48,4
144
    mov   [skin_high],eax
145
    ret
146
;---------------------------------------------------------------------
147
draw_window:
148
    mcall 12, 1
149
;    mcall 0, <20,620>, <20,460>, 0x03cccccc   ; 0x805080D0, 0x005080D0
150
	xor	esi,esi
151
    mcall 0, <20,620>, <20,460>, 0x43cccccc   ; 0x805080D0, 0x005080D0
152
    call  get_window_param
153
;    mov   ecx,[temp_esi]
154
    test  [window_status],10b
155
    jnz   @f
1851 mario79 156
    mcall 71, 1 , header_text
1792 yogev_ezra 157
    ; create_dir_name
158
    ; start_parameter
159
    ; file_name
160
    ; [temp_edi]
161
    ; header
162
    ; delete_file_data.name
163
    ; start_file_data.name
164
    ; start_parameter
165
     ; start_file_data.name
166
      ; read_icon_file.name
167
		; read_file_features.name ;path ;header
168
 
169
    cmp   [window_high],180
170
    jb	  @f
171
    cmp   [window_width],495
172
    jb	  @f
173
 
174
;    pusha
175
;    mcall 4,<15,25>,0,read_folder.name,100
176
;    popa
177
    call  draw_fbutton
178
 
179
;    mov   [left_panel_clear_all],1
180
 
181
    call  draw_left_panel
182
 
183
;    mov   [right_panel_clear_all],1
184
 
185
    call  draw_right_panel
186
    call  draw_device_button
187
    call  draw_left_select_disk_button
188
    call  draw_left_sort_button
189
    call  draw_right_select_disk_button
190
    call  draw_right_sort_button
191
    call  draw_menu_bar
192
    call  draw_buttons_panel
193
    call  draw_ATAPI_tray_control
194
 
195
;    mcall 47,0x80000,[left_scroll_compens],<300, 5>,0xffffff
196
;    call  mouse.draw_data
197
;    mcall 18, 7
198
;    mov   [temp_eax],eax
199
;    mcall 47,0x80000,[active_process],<300, 5>,0xffffff
200
;    mcall 47,0x80000,[left_marked_counter],<300, 5>,0xffffff
201
;    mcall 47,0x80000,[right_marked_counter],<400, 5>,0xffffff
202
;    mcall 47,0x80000,[sorting_low_limit],<100, 5>,0xffffff
203
;    mcall 47,0x80000,[sort_counter],<200, 5>,0xffffff
204
;    mcall 47,0x80000,[sorting_high_limit],<300, 5>,0xffffff
205
;    mcall 47,0x80000,[dir_temp_counter],<400, 5>,0xffffff
206
 
207
;    mcall 47,0x80000,[timer_tick],<500, 5>,0xffffff
208
;    mcall 47,0x80000,[temp_eax],<400, 5>,0xffffff
209
;    mcall 47,0x80000,[temp_ebx],<400, 5>,0xffffff
210
;    mcall 47,0x80000,[temp_ecx],<500, 5>,0xffffff
211
;    mcall 47,0x80000,[temp_ebx],<500, 5>,0xffffff
212
;    mcall 47,0x80000,[ini_file_start],<100, 5>,0xffffff
213
;    mcall 47,0x80000,[left_folder_data],<200, 5>,0xffffff
214
;    mcall 47,0x80000,[right_folder_data],<300, 5>,0xffffff
215
;    mcall 47,0x80000,[appl_memory],<500, 5>,0xffffff
216
;    mcall 47,0x80000,[temp_znak],<500, 5>,0xffffff
217
 
218
;    mcall 47,0x80000,[sort_counter],<200, 5>,0xffffff
219
;    mcall 47,0x80000,[temp_edi],<250, 5>,0xffffff
220
;    mcall 47,0x80000,[temp_esi],<300, 5>,0xffffff
221
;    mcall 47,0x80000,[temp_ecx],<350, 5>,0xffffff
222
;    mcall 47,0x80000,[temp_znak],<400, 5>,0xffffff
223
 
224
;    movzx ecx,[left_start_draw_cursor_line]
225
;    mcall 47,0x40000, ,<300, 5>,0xffffff
226
;    mcall 47,0x40000,[left_start_draw_line],<400, 5>,0xffffff
227
 
228
;    mcall 47,0x40000,[window_width],<100, 5>,0xffffff
229
;    mcall 47,0x40000,[window_high],<130, 5>,0xffffff
230
 
231
;    mcall 47,0x80100,[left_panel_x],<200, 5>,0xffffff
232
;    mcall 47,0x80100,[left_panel_y],<250, 5>,0xffffff
233
;    mov   edx,[temp_counter_dword_1]
234
;    mcall 4,<150,3>,0x80000000
235
;    mov   edx,[temp_counter_dword]
236
;    mcall 4,<5,3>,0x80000000
237
@@:
238
    mcall 12, 2
239
    ret
240
;temp_eax dd 0
241
;temp_ebx dd 0
242
;temp_ecx dd 0
243
;temp_edx dd 0
244
;temp_esi dd 0
245
;temp_edi dd 0
246
;temp_ebp dd 0
247
;temp_esp dd 0
248
;temp_znak dd 0
249
;temp_counter_dword_1 dd 0
250
;extension_size_1 dd 0
251
;timer_tick dd 0
252
;---------------------------------------------------------------------
253
prepare_load_data:
254
    mov   esi,path
255
    mov   edi,file_name
256
    call  copy_path
257
    call  get_file_size
258
    test  eax,eax
259
    ret
260
;---------------------------------------------------------------------
261
prepare_load_data_1:
262
    mov   [read_file.return],eax
263
    mov   ebp,eax
264
prepare_load_data_4:
265
    call  load_file
266
    test  eax,eax
267
    ret
268
;---------------------------------------------------------------------
269
prepare_load_data_2:
270
    call  add_application_memory
271
prepare_load_data_3:
272
    call  add_application_memory
273
    mov   eax,[file_features_temp_area+32]
274
    mov   [read_file.size],eax
275
    ret
276
;---------------------------------------------------------------------
277
load_icon_and_convert_to_img:
278
    mov   ebx,icons_file_name
279
    call  prepare_load_data
280
    jnz   icon_error
281
    call  prepare_load_data_2
282
    add   eax,mem
283
    call  prepare_load_data_1
284
    jnz   icon_error
285
    call  convert_bmp_to_img
286
    call  sub_application_memory
287
    ret
288
;---------------------------------------------------------------------
289
load_buttons_and_convert_to_img:
290
    mov   ebx,buttons_file_name
291
    call  prepare_load_data
292
    jnz   buttons_error
293
    mov   eax,[appl_memory]
294
    mov   [buttons_img_start],eax
295
    call  prepare_load_data_2
296
    add   eax,[buttons_img_start]
297
    call  prepare_load_data_1
298
    jnz   buttons_error
299
    call  convert_bmp_to_img
300
    call  sub_application_memory
301
    ret
302
;---------------------------------------------------------------------
303
load_initiation_file:
304
    mov   ebx,ini_file_name
305
    call  prepare_load_data
306
    jnz   initiation_error
307
    call  prepare_load_data_3
308
    mov   eax,[appl_memory]
309
    mov   [left_folder_data],eax
310
    sub   eax,[read_file.size]
311
    mov   [read_file.return],eax
312
    mov   [ini_file_start],eax
313
    call  load_file
314
    test  eax,eax
315
    jnz   initiation_error
316
    mov   ebp,icons_associations
317
    call  search_star_and_end_tags
318
;    cmp   ebp,-1
319
;    je    .end
320
    mov   eax,[end_tag]
321
    mov   [icons_end_tag],eax
322
    ret
323
;---------------------------------------------------------------------
324
add_memory_for_folders:
325
    mov   ecx,[appl_memory]
326
    add   ecx,304*32+32
327
    mov   [right_folder_data],ecx
328
    add   ecx,304*32+32
329
    mov   [appl_memory],ecx
330
    mcall 64,1
331
    ret
332
;---------------------------------------------------------------------
333
copy_path:
334
    xor   eax,eax
335
@@:
336
    cld
337
    lodsb
338
    stosb
339
    test  eax,eax
340
    jnz   @b
341
    mov   esi,edi
342
;    dec   esi
343
@@:
344
    std
345
    lodsb
346
    cmp   al,'/'
347
    jnz   @b
348
    mov   edi,esi
349
    add   edi,2
350
    mov   esi,ebx
351
@@:
352
    cld
353
    lodsb
354
    stosb
355
    test  eax,eax
356
    jnz   @b
357
    ret
358
;---------------------------------------------------------------------
359
copy_path_1:
360
    xor   eax,eax
361
@@:
362
    cld
363
    lodsb
364
    stosb
365
    test  eax,eax
366
    jnz   @b
367
    mov   esi,ebx
368
    mov   [edi-1],byte '/'
369
@@:
370
    cld
371
    lodsb
372
    stosb
373
    test  eax,eax
374
    jnz   @b
375
    ret
376
;---------------------------------------------------------------------
377
add_application_memory:
378
    mov   ecx,[file_features_temp_area+32]
379
.1:
380
    add   ecx,[appl_memory]
381
    mov   [appl_memory],ecx
382
    mcall 64,1
383
    ret
384
;---------------------------------------------------------------------
385
sub_application_memory:
386
    mov   ecx,[appl_memory]
387
    sub   ecx,[file_features_temp_area+32]
388
.1:
389
    mov   [appl_memory],ecx
390
    mcall 64,1
391
    ret
392
;---------------------------------------------------------------------
393
include   'key.inc'
394
;---------------------------------------------------------------------
395
include   'markfile.inc'
396
;---------------------------------------------------------------------
397
include   'button.inc'
398
;---------------------------------------------------------------------
399
include   'mouse.inc'
400
;---------------------------------------------------------------------
401
include   'openfile.inc'
402
;---------------------------------------------------------------------
403
include   'draw.inc'
404
;---------------------------------------------------------------------
405
include   'menu_bar.inc'
406
;---------------------------------------------------------------------
407
include   'menu_drv.inc'
408
;---------------------------------------------------------------------
409
include   'delete.inc'
410
;---------------------------------------------------------------------
411
include   'copy.inc'
412
;---------------------------------------------------------------------
413
include   'creatdir.inc'
414
;---------------------------------------------------------------------
415
include   'confirm.inc'
416
;---------------------------------------------------------------------
417
include   'err_wind.inc'
418
;---------------------------------------------------------------------
419
include   'detect.inc'
420
;---------------------------------------------------------------------
421
include   'conv_bmp.inc'
422
;---------------------------------------------------------------------
423
include   'tran_ini.inc'
424
;---------------------------------------------------------------------
425
include   'help.inc'
426
;---------------------------------------------------------------------
427
include   'convchar.inc'
428
;---------------------------------------------------------------------
429
include   'sort.inc'
430
;---------------------------------------------------------------------
431
include   'exit.inc'
432
;---------------------------------------------------------------------
433
include   'progrbar.inc'
434
;---------------------------------------------------------------------
435
include   'scroll.inc'
436
;---------------------------------------------------------------------
437
include   'file_inf.inc'
438
;---------------------------------------------------------------------
439
include   'text.inc'
440
;---------------------------------------------------------------------
441
I_END:
442
;---------------------------------------------------------------------
443
include   'data.inc'
444
;---------------------------------------------------------------------
445
mem: