Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
5183 hidnplayr 1
format binary as ""
2
 
1004 diamond 3
use32
4
org 0x0
5
 
6
db 'MENUET01'
1470 mario79 7
dd 0x01, START, I_END, F_END, stacktop, @PARAMS, 0x0
1004 diamond 8
 
9
;-----------------------------------------------------------------------------
10
 
3116 dunkaist 11
include '../../../config.inc'
1080 diamond 12
include '../../../proc32.inc'
13
include '../../../macros.inc'
3116 dunkaist 14
include '../../../dll.inc'
6801 IgorA 15
include '../../../KOSfuncs.inc'
3116 dunkaist 16
;include '../../../debug.inc'
1004 diamond 17
 
18
include '../../../develop/libraries/libs-dev/libio/libio.inc'
19
include '../../../develop/libraries/libs-dev/libimg/libimg.inc'
20
 
1511 mario79 21
;include '../../../develop/libraries/box_lib/asm/trunk/opendial.mac'
22
;use_OpenDialog
1004 diamond 23
;-----------------------------------------------------------------------------
24
 
25
START:
6801 IgorA 26
    mcall   SF_SYS_MISC, SSF_HEAP_INIT
1004 diamond 27
 
1570 dunkaist 28
    stdcall dll.Load, @IMPORT
29
    or  eax, eax
30
    jnz exit
1004 diamond 31
 
1570 dunkaist 32
    invoke  sort.START, 1
1016 diamond 33
 
1570 dunkaist 34
    mov ecx, 1  ; for 15.4: 1 = tile
35
    cmp word [@PARAMS], '\T'
36
    jz  set_bgr
37
    inc ecx ; for 15.4: 2 = stretch
38
    cmp word [@PARAMS], '\S'
39
    jz  set_bgr
1004 diamond 40
 
1594 mario79 41
    cmp byte [@PARAMS], 0
42
    jz @f
43
    mov esi, @PARAMS
44
    mov edi, path
45
    mov ecx, 4096/4
46
    rep movsd
47
    mov byte [edi-1], 0
48
@@:
49
; OpenDialog initialisation
50
    push    dword OpenDialog_data
51
    call    [OpenDialog_Init]
52
 
1427 diamond 53
; initialize keyboard handling
1570 dunkaist 54
    invoke  ini_get_shortcut, inifilename, aShortcuts, aNext, -1, next_mod
55
    mov [next_key], eax
56
    invoke  ini_get_shortcut, inifilename, aShortcuts, aPrev, -1, prev_mod
57
    mov [prev_key], eax
3116 dunkaist 58
    invoke  ini_get_shortcut, inifilename, aShortcuts, aSlide, -1, slide_mod
59
    mov [slide_key], eax
60
    invoke  ini_get_shortcut, inifilename, aShortcuts, aTglbar, -1, tglbar_mod
61
    mov [tglbar_key], eax
6801 IgorA 62
    mcall   SF_KEYBOARD, SSF_SET_INPUT_MODE, 1    ; set kbd mode to scancodes
1427 diamond 63
 
1570 dunkaist 64
    cmp byte [@PARAMS], 0
65
    jnz params_given
1004 diamond 66
 
1570 dunkaist 67
    mov [OpenDialog_data.draw_window],draw_window_fake
68
 
1511 mario79 69
; OpenDialog Open
1570 dunkaist 70
    push    dword OpenDialog_data
71
    call    [OpenDialog_Start]
1470 mario79 72
 
1570 dunkaist 73
    cmp [OpenDialog_data.status],1
74
    jne exit
1470 mario79 75
 
1570 dunkaist 76
    mov [OpenDialog_data.draw_window],draw_window
1470 mario79 77
 
1570 dunkaist 78
    mov esi, path
79
    mov edi, @PARAMS
80
    mov ecx, 4096/4
81
    rep movsd
82
    mov byte [edi-1], 0
83
    jmp params_given
1004 diamond 84
 
85
set_bgr:
6801 IgorA 86
    mcall   SF_BACKGROUND_SET, SSF_MODE_BG
1570 dunkaist 87
    mov eax, @PARAMS + 4
88
    call    load_image
89
    jc  exit
1004 diamond 90
 
1570 dunkaist 91
    call    set_as_bgr
92
    jmp exit
1004 diamond 93
 
94
params_given:
95
 
1570 dunkaist 96
    mov esi, @PARAMS
97
    push    esi
98
    call    find_last_name_component
1427 diamond 99
 
1570 dunkaist 100
    pop eax
101
    call    load_image
102
    jc  exit
103
    call    generate_header
1004 diamond 104
 
105
;-----------------------------------------------------------------------------
106
 
107
red:
1570 dunkaist 108
    call    draw_window
1004 diamond 109
 
110
still:
1570 dunkaist 111
    mov eax, [image]
112
    test    byte [eax + Image.Flags], Image.IsAnimated
113
    push    10
114
    pop eax
115
    jz  @f
6801 IgorA 116
    mcall   SF_SYSTEM_GET, SSF_TIME_COUNT
1570 dunkaist 117
    mov edx, [cur_frame]
118
    mov ebx, [cur_frame_time]
119
    add ebx, [edx + Image.Delay]
120
    sub ebx, eax
121
    cmp ebx, [edx + Image.Delay]
122
    ja  red_update_frame
123
    test    ebx, ebx
124
    jz  red_update_frame
125
    push    23
126
    pop eax
1080 diamond 127
  @@:
1570 dunkaist 128
    mcall
129
    dec eax
130
    js  red_update_frame
131
    jz  red
132
    dec eax
133
    jnz button
1004 diamond 134
 
1080 diamond 135
key:
1570 dunkaist 136
    xor esi, esi
1427 diamond 137
keyloop:
6801 IgorA 138
    mcall   SF_GET_KEY
1570 dunkaist 139
    test    al, al
140
    jnz keyloopdone
141
    shr eax, 8
142
    mov ecx, eax
6801 IgorA 143
    mcall   SF_KEYBOARD, SSF_GET_CONTROL_KEYS
1570 dunkaist 144
    mov edx, next_mod
145
    call    check_shortcut
146
    jz  .next
147
    add edx, prev_mod - next_mod
148
    call    check_shortcut
3116 dunkaist 149
    jz  .prev
150
    add edx, slide_mod - prev_mod
151
    call    check_shortcut
152
    jz  .slide
153
    add edx, tglbar_mod - slide_mod
154
    call    check_shortcut
155
    jz  .tglbar
156
    cmp cl, 1 ; Esc
157
    jz  .esc
158
    jmp keyloop
159
.esc:
160
    test byte [bSlideShow], 1
161
    jnz .slide
162
    jmp keyloop
163
.tglbar:
164
    mov byte [bTglbar], 1
165
    test byte[bSlideShow], 1
166
    jnz @f
167
    xor [toolbar_height], 31
168
@@:
169
    jmp keyloop
170
.slide:
171
    call slide_show
172
    jmp keyloop
1427 diamond 173
.prev:
1570 dunkaist 174
    dec esi
175
    jmp keyloop
1427 diamond 176
.next:
1570 dunkaist 177
    inc esi
178
    jmp keyloop
1427 diamond 179
keyloopdone:
3116 dunkaist 180
    test esi, esi
181
    jnz next_or_prev_handler
182
    test byte [bSlideShow], 2
183
    jnz red
184
    test byte [bTglbar], 1
185
    jnz red
186
    jmp still
1427 diamond 187
next_or_prev_handler:
1570 dunkaist 188
    call    next_or_prev_image
189
    jmp red
1004 diamond 190
 
1080 diamond 191
red_update_frame:
1570 dunkaist 192
    mov eax, [cur_frame]
193
    mov eax, [eax + Image.Next]
194
    test    eax, eax
195
    jnz @f
196
    mov eax, [image]
1080 diamond 197
  @@:
1570 dunkaist 198
    mov [cur_frame], eax
6801 IgorA 199
    mcall   SF_SYSTEM_GET, SSF_TIME_COUNT
1570 dunkaist 200
    mov [cur_frame_time], eax
6801 IgorA 201
    mcall   SF_THREAD_INFO, procinfo, -1
1570 dunkaist 202
    call    draw_cur_frame
203
    jmp still
1080 diamond 204
 
205
button:
6801 IgorA 206
    mcall   SF_GET_BUTTON
1570 dunkaist 207
    shr eax, 8
1004 diamond 208
 
1570 dunkaist 209
    ; flip horizontally
210
    cmp eax, 'flh'
211
    jne @f
1004 diamond 212
 
1570 dunkaist 213
    invoke  img.flip, [image], FLIP_HORIZONTAL
214
    jmp redraw_image
1004 diamond 215
 
1570 dunkaist 216
    ; flip vertically
217
    @@: cmp eax, 'flv'
218
    jne @f
1004 diamond 219
 
1570 dunkaist 220
    invoke  img.flip, [image], FLIP_VERTICAL
221
    jmp redraw_image
1004 diamond 222
 
1570 dunkaist 223
    ; flip both horizontally and vertically
224
    @@: cmp eax, 'flb'
225
    jne @f
1004 diamond 226
 
1570 dunkaist 227
    invoke  img.flip, [image], FLIP_BOTH
228
    jmp redraw_image
1004 diamond 229
 
1570 dunkaist 230
    ; rotate left
231
    @@: cmp eax, 'rtl'
232
    jne @f
1004 diamond 233
 
1570 dunkaist 234
    push    ROTATE_90_CCW
1004 diamond 235
.rotate_common:
1570 dunkaist 236
    invoke  img.rotate, [image]
237
    mov eax, [image]
238
    test    eax, eax    ; clear ZF flag
239
    call    update_image_sizes
240
    jmp redraw_image
1004 diamond 241
 
1570 dunkaist 242
    ; rotate right
243
    @@: cmp eax, 'rtr'
244
    jne @f
1004 diamond 245
 
1570 dunkaist 246
    push    ROTATE_90_CW
247
    jmp .rotate_common
1004 diamond 248
 
1570 dunkaist 249
    ; open new file
250
    @@: cmp eax, 'opn'
251
    jne @f
252
 
1511 mario79 253
; OpenDialog Open
1570 dunkaist 254
    push    dword OpenDialog_data
255
    call    [OpenDialog_Start]
256
 
257
    cmp [OpenDialog_data.status],1
258
    jne still
259
 
260
    mov esi, path
261
    mov edi, @PARAMS
262
    push    edi
263
    mov ecx, 4096/4
264
    rep movsd
265
    mov byte [edi-1], 0
266
 
267
    pop esi
268
    push    esi
269
    call    find_last_name_component
1475 diamond 270
 
1570 dunkaist 271
    pop eax
272
    push    [image]
273
    call    load_image
274
    jc  .restore_old
275
    call    generate_header
276
 
277
    invoke  img.destroy
278
    call    free_directory
279
    jmp red
280
 
1004 diamond 281
    .restore_old:
1570 dunkaist 282
    pop [image]
283
    call    init_frame
284
    jmp still
1004 diamond 285
 
1570 dunkaist 286
    ; set background
1016 diamond 287
    @@:
1570 dunkaist 288
    cmp eax, 'bgr'
289
    jne @f
1016 diamond 290
 
1570 dunkaist 291
    call    set_as_bgr
292
    jmp still
1016 diamond 293
 
294
    @@:
3116 dunkaist 295
    cmp eax, 'sld'
296
    jne @f
1016 diamond 297
 
3116 dunkaist 298
    call    slide_show
299
    jmp red
300
 
301
    @@:
302
 
1570 dunkaist 303
    or  esi, -1
304
    cmp eax, 'bck'
305
    jz  next_or_prev_handler
306
    neg esi
307
    cmp eax, 'fwd'
308
    jz  next_or_prev_handler
1016 diamond 309
 
1570 dunkaist 310
    cmp eax, 1
311
    jne still
1004 diamond 312
 
313
  exit:
6801 IgorA 314
    mcall   SF_TERMINATE_PROCESS
1004 diamond 315
 
316
  redraw_image = red
317
 
318
load_image:
1570 dunkaist 319
    and [img_data], 0
320
    push    eax
321
    invoke  file.open, eax, O_READ
322
    or  eax, eax
323
    jz  .error_pop
324
    mov [fh], eax
325
    invoke  file.size
326
    mov [img_data_len], ebx
327
    stdcall mem.Alloc, ebx
328
    test    eax, eax
329
    jz  .error_close
330
    mov [img_data], eax
331
    invoke  file.read, [fh], eax, [img_data_len]
332
    cmp eax, -1
333
    jz  .error_close
334
    cmp eax, [img_data_len]
335
    jnz .error_close
336
    invoke  file.close, [fh]
337
    inc eax
338
    jz  .error
1004 diamond 339
 
1570 dunkaist 340
    invoke  img.decode, [img_data], [img_data_len], 0
341
    or  eax, eax
342
    jz  .error
343
    cmp [image], 0
344
    pushf
345
    mov [image], eax
346
    call    init_frame
347
    popf
348
    call    update_image_sizes
349
    call    free_img_data
350
    clc
351
    ret
1004 diamond 352
 
353
.error_free:
1570 dunkaist 354
    invoke  img.destroy, [image]
355
    jmp .error
1004 diamond 356
 
357
.error_pop:
1570 dunkaist 358
    pop eax
359
    jmp .error
1004 diamond 360
.error_close:
1570 dunkaist 361
    invoke  file.close, [fh]
1004 diamond 362
.error:
1570 dunkaist 363
    call    free_img_data
364
    stc
365
    ret
1004 diamond 366
 
367
free_img_data:
1570 dunkaist 368
    mov eax, [img_data]
369
    test    eax, eax
370
    jz  @f
371
    stdcall mem.Free, eax
1004 diamond 372
@@:
1570 dunkaist 373
    ret
1004 diamond 374
 
375
update_image_sizes:
1570 dunkaist 376
    pushf
377
    mov edx, [eax + Image.Width]
2036 dunkaist 378
    test    [eax + Image.Flags], Image.IsAnimated
379
    jnz .not_in_row
380
    push eax
381
@@: cmp [eax + Image.Next], 0
382
    jz  @f
383
    mov eax, [eax + Image.Next]
384
    add edx, [eax + Image.Width]
385
    inc edx
386
    jmp @b
387
@@: pop eax
388
.not_in_row:
1570 dunkaist 389
    mov [draw_width], edx
390
    add edx, 19
3116 dunkaist 391
    cmp edx, 50 + 25*numimages
1570 dunkaist 392
    jae @f
3116 dunkaist 393
    mov edx, 50 + 25*numimages
1004 diamond 394
@@:
3116 dunkaist 395
;    dec edx
1570 dunkaist 396
    mov [wnd_width], edx
397
    mov esi, [eax + Image.Height]
2036 dunkaist 398
    test    [eax + Image.Flags], Image.IsAnimated
399
    jnz .max_equals_first
400
    push eax
401
@@: cmp [eax + Image.Next], 0
402
    jz  @f
403
    mov eax, [eax + Image.Next]
404
    cmp esi, [eax + Image.Height]
405
    jae @b
406
    mov esi, [eax + Image.Height]
407
    jmp @b
408
@@: pop eax
409
.max_equals_first:
1570 dunkaist 410
    mov [draw_height], esi
3116 dunkaist 411
    add esi, [toolbar_height]
412
    add esi, [image_padding]
413
    add esi, [image_padding]
414
    add esi, 5  ; window bottom frame height
415
    dec esi
1570 dunkaist 416
    mov [wnd_height], esi
417
    popf
418
    jz  .no_resize
3116 dunkaist 419
    test [wnd_style], 1 SHL 25
420
    jz .no_resize
6801 IgorA 421
    mcall   SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
1570 dunkaist 422
    add esi, eax
6801 IgorA 423
    mcall   SF_CHANGE_WINDOW,-1,-1
1004 diamond 424
.no_resize:
1570 dunkaist 425
    ret
1004 diamond 426
 
1016 diamond 427
set_as_bgr:
1570 dunkaist 428
    mov esi, [image]
429
    mov ecx, [esi + Image.Width]
430
    mov edx, [esi + Image.Height]
6801 IgorA 431
    mcall   SF_BACKGROUND_SET, SSF_SIZE_BG
1016 diamond 432
 
6801 IgorA 433
    mcall   SF_BACKGROUND_SET, SSF_MAP_BG
1570 dunkaist 434
    test    eax, eax
435
    jz  @f
1016 diamond 436
 
1570 dunkaist 437
    push    eax
438
    invoke  img.to_rgb2, esi, eax
439
    pop ecx
6801 IgorA 440
    mcall   SF_BACKGROUND_SET, SSF_UNMAP_BG
1016 diamond 441
 
442
@@:
6801 IgorA 443
    mcall   SF_BACKGROUND_SET, SSF_REDRAW_BG
1570 dunkaist 444
    ret
1016 diamond 445
 
3116 dunkaist 446
slide_show:
447
    or  byte [bSlideShow], 2
448
    xor byte [bSlideShow], 1
449
    btc dword [wnd_style], 25
450
    jc  @f
451
    mov eax, [toolbar_height_old]
452
    mov [toolbar_height], eax
453
    mov [image_padding], 5
454
    jmp .toolbar_height_done
455
@@:
456
    mov eax, [toolbar_height]
457
    mov [toolbar_height_old], eax
458
    mov [toolbar_height], 0
459
    mov [image_padding], 0
460
.toolbar_height_done:
461
    ret
462
 
1427 diamond 463
; seek to ESI image files
464
; esi>0 means next file, esi<0 - prev file
465
next_or_prev_image:
1570 dunkaist 466
    push    esi
467
    call    load_directory
468
    pop esi
469
    mov ebx, [directory_ptr]
470
    test    ebx, ebx
471
    jz  .ret
472
    cmp dword[ebx+4], 0
473
    jz  .ret
474
    mov eax, [cur_file_idx]
475
    cmp eax, -1
476
    jnz @f
477
    test    esi, esi
478
    jns @f
479
    mov eax, [ebx+4]
1016 diamond 480
@@:
1570 dunkaist 481
    push    [image]
482
    add eax, esi
1427 diamond 483
@@:
1570 dunkaist 484
    test    eax, eax
485
    jns @f
486
    add eax, [ebx+4]
487
    jmp @b
1016 diamond 488
@@:
1570 dunkaist 489
    cmp eax, [ebx+4]
490
    jb  @f
491
    sub eax, [ebx+4]
492
    jmp @b
1427 diamond 493
@@:
1570 dunkaist 494
    push    eax
1427 diamond 495
.scanloop:
1570 dunkaist 496
    push    eax ebx esi
497
    imul    esi, eax, 304
498
    add esi, [directory_ptr]
499
    add esi, 32 + 40
500
    mov edi, curdir
1016 diamond 501
@@:
1570 dunkaist 502
    inc edi
503
    cmp byte [edi-1], 0
504
    jnz @b
505
    mov byte [edi-1], '/'
1016 diamond 506
@@:
1570 dunkaist 507
    lodsb
508
    stosb
509
    test    al, al
510
    jnz @b
511
    mov eax, curdir
512
    call    load_image
513
    pushf
514
    mov esi, curdir
515
    push    esi
516
    mov edi, @PARAMS
517
    mov ecx, 4096/4
518
    rep movsd
519
    mov byte [edi-1], 0
520
    pop esi
1040 diamond 521
@@:
1570 dunkaist 522
    lodsb
523
    test    al, al
524
    jnz @b
1040 diamond 525
@@:
1570 dunkaist 526
    dec esi
527
    cmp byte [esi], '/'
528
    jnz @b
529
    mov byte [esi], 0
530
    popf
531
    pop esi ebx eax
532
    jnc .loadedok
533
    test    esi, esi
534
    js  .try_prev
1427 diamond 535
.try_next:
1570 dunkaist 536
    inc eax
537
    cmp eax, [ebx+4]
538
    jb  @f
539
    xor eax, eax
1016 diamond 540
@@:
1427 diamond 541
.try_common:
1570 dunkaist 542
    cmp eax, [esp]
543
    jz  .notfound
544
    jmp .scanloop
1427 diamond 545
.try_prev:
1570 dunkaist 546
    dec eax
547
    jns @f
548
    mov eax, [ebx+4]
549
    dec eax
1016 diamond 550
@@:
1570 dunkaist 551
    jmp .try_common
1427 diamond 552
.loadedok:
1570 dunkaist 553
    mov [cur_file_idx], eax
554
    pop eax
555
    invoke  img.destroy
556
    call    generate_header
1016 diamond 557
.ret:
1570 dunkaist 558
    ret
1016 diamond 559
.notfound:
1570 dunkaist 560
    pop eax
561
    pop [image]
562
    call    init_frame
563
    ret
1016 diamond 564
 
565
load_directory:
1570 dunkaist 566
    cmp [directory_ptr], 0
567
    jnz .ret
568
    mov esi, @PARAMS
569
    mov edi, curdir
570
    mov ecx, [last_name_component]
571
    sub ecx, esi
572
    dec ecx
573
    js  @f
574
    rep movsb
1427 diamond 575
@@:
1570 dunkaist 576
    mov byte [edi], 0
6801 IgorA 577
    mcall   SF_SYS_MISC, SSF_MEM_ALLOC, 0x1000
1570 dunkaist 578
    test    eax, eax
579
    jz  .ret
580
    mov ebx, readdir_fileinfo
581
    mov dword [ebx+12], (0x1000 - 32) / 304
582
    mov dword [ebx+16], eax
6801 IgorA 583
    mcall   SF_FILE
1570 dunkaist 584
    cmp eax, 6
585
    jz  .dirok
586
    test    eax, eax
587
    jnz free_directory
588
    mov edx, [directory_ptr]
589
    mov ecx, [edx+8]
590
    mov [readblocks], ecx
591
    imul    ecx, 304
592
    add ecx, 32
6801 IgorA 593
    mcall   SF_SYS_MISC, SSF_MEM_REALLOC
1570 dunkaist 594
    test    eax, eax
595
    jz  free_directory
596
    mov [directory_ptr], eax
6801 IgorA 597
    mcall   SF_FILE, readdir_fileinfo
1016 diamond 598
.dirok:
1570 dunkaist 599
    cmp ebx, 0
600
    jle free_directory
601
    mov eax, [directory_ptr]
602
    add eax, 32
603
    mov edi, eax
604
    push    0
1016 diamond 605
.dirskip:
1570 dunkaist 606
    push    eax
607
    test    byte [eax], 18h
608
    jnz .nocopy
609
    lea esi, [eax+40]
610
    mov ecx, esi
1016 diamond 611
@@:
1570 dunkaist 612
    lodsb
613
    test    al, al
614
    jnz @b
1016 diamond 615
@@:
1570 dunkaist 616
    dec esi
617
    cmp esi, ecx
618
    jb  .noext
619
    cmp byte [esi], '.'
620
    jnz @b
621
    inc esi
622
    mov ecx, [esi]
5183 hidnplayr 623
    cmp byte[esi+3], 0
624
    jne .not_3
1570 dunkaist 625
    or  ecx, 0x202020
626
    cmp ecx, 'jpg'
627
    jz  .copy
628
    cmp ecx, 'bmp'
629
    jz  .copy
630
    cmp ecx, 'gif'
631
    jz  .copy
632
    cmp ecx, 'png'
633
    jz  .copy
634
    cmp ecx, 'jpe'
635
    jz  .copy
636
    cmp ecx, 'ico'
637
    jz  .copy
638
    cmp ecx, 'cur'
639
    jz  .copy
3116 dunkaist 640
    cmp ecx, 'tga'
641
    jz  .copy
1575 dunkaist 642
    cmp ecx, 'pcx'
643
    jz  .copy
1922 dunkaist 644
    cmp ecx, 'xcf'
645
    jz  .copy
2389 dunkaist 646
    cmp ecx, 'pbm'
647
    jz  .copy
648
    cmp ecx, 'pgm'
649
    jz  .copy
650
    cmp ecx, 'pnm'
651
    jz  .copy
652
    cmp ecx, 'tif'
653
    jz  .copy
5183 hidnplayr 654
  .not_3:
655
    cmp byte[esi+4], 0
656
    jne .nocopy
657
    or  ecx, 0x20202020
2389 dunkaist 658
    cmp ecx, 'tiff'
659
    jz  @f
2394 dunkaist 660
    cmp ecx, 'wbmp'
661
    jz  @f
1570 dunkaist 662
    cmp ecx, 'jpeg'
663
    jnz .nocopy
1016 diamond 664
@@:
1570 dunkaist 665
    cmp byte [esi+4], 0
666
    jnz .nocopy
1016 diamond 667
.copy:
1570 dunkaist 668
    mov esi, [esp]
669
    mov ecx, 304 / 4
670
    rep movsd
671
    inc dword [esp+4]
1016 diamond 672
.nocopy:
673
.noext:
1570 dunkaist 674
    pop eax
675
    add eax, 304
676
    dec ebx
677
    jnz .dirskip
678
    mov eax, [directory_ptr]
679
    pop ebx
680
    mov [eax+4], ebx
681
    test    ebx, ebx
682
    jz  free_directory
683
    push    0   ; sort mode
684
    push    ebx
685
    add eax, 32
686
    push    eax
687
    call    [SortDir]
688
    xor eax, eax
689
    mov edi, [directory_ptr]
690
    add edi, 32 + 40
1016 diamond 691
.scan:
1570 dunkaist 692
    mov esi, [last_name_component]
693
    push    edi
694
    invoke  strcmpi
695
    pop edi
696
    jz  .found
697
    inc eax
698
    add edi, 304
699
    dec ebx
700
    jnz .scan
701
    or  eax, -1
1016 diamond 702
.found:
1570 dunkaist 703
    mov [cur_file_idx], eax
1016 diamond 704
.ret:
1570 dunkaist 705
    ret
1016 diamond 706
 
707
free_directory:
6801 IgorA 708
    mcall   SF_SYS_MISC, SSF_MEM_FREE, [directory_ptr]
1570 dunkaist 709
    and [directory_ptr], 0
710
    ret
1016 diamond 711
 
1427 diamond 712
; in: esi->full name (e.g. /path/to/file.png)
713
; out: [last_name_component]->last component (e.g. file.png)
714
find_last_name_component:
1570 dunkaist 715
    mov ecx, esi
1427 diamond 716
@@:
1570 dunkaist 717
    lodsb
718
    test    al, al
719
    jnz @b
1427 diamond 720
@@:
1570 dunkaist 721
    dec esi
722
    cmp esi, ecx
723
    jb  @f
724
    cmp byte [esi], '/'
725
    jnz @b
1427 diamond 726
@@:
1570 dunkaist 727
    inc esi
728
    mov [last_name_component], esi
729
    ret
1427 diamond 730
 
1080 diamond 731
init_frame:
1570 dunkaist 732
    push    eax
733
    mov eax, [image]
734
    mov [cur_frame], eax
735
    test    byte [eax + Image.Flags], Image.IsAnimated
736
    jz  @f
737
    push    ebx
6801 IgorA 738
    mcall   SF_SYSTEM_GET, SSF_TIME_COUNT
1570 dunkaist 739
    pop ebx
740
    mov [cur_frame_time], eax
1080 diamond 741
@@:
1570 dunkaist 742
    pop eax
743
    ret
1080 diamond 744
 
1004 diamond 745
draw_window:
3116 dunkaist 746
    btr  word [bSlideShow], 1  ; mode changed
747
    jc .mode_changed
748
    test byte [bTglbar], 1
749
    jz .mode_not_changed
750
.mode_changed:
751
    test [wnd_style], 1 SHL 25
752
    jz .mode_slide
753
    mov [bg_color], 0x00ffffff
754
    mov eax, [image]
755
    cmp eax, eax
756
    call update_image_sizes
6801 IgorA 757
    mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
3116 dunkaist 758
    mov esi, [wnd_height]
759
    add esi, eax
760
    test byte [bTglbar], 1
761
    jz @f
6801 IgorA 762
    mcall SF_CHANGE_WINDOW, -1, -1, [wnd_width],
3116 dunkaist 763
    jmp .mode_not_changed
764
@@:
6801 IgorA 765
    mcall SF_CHANGE_WINDOW, [wnd_x], [wnd_y], [wnd_width],
3116 dunkaist 766
    jmp .mode_not_changed
767
.mode_slide:
768
    mov [bg_color], 0x00000000
769
    mov eax, [procinfo.box.left]
770
    mov [wnd_x], eax
771
    mov eax, [procinfo.box.top]
772
    mov [wnd_y], eax
6801 IgorA 773
    mcall SF_GET_SCREEN_SIZE
3116 dunkaist 774
    mov edx, eax
775
    shr edx, 16
776
    movzx eax, ax
777
    mov esi, eax
6801 IgorA 778
    mcall SF_CHANGE_WINDOW, 0, 0, ,
3116 dunkaist 779
    jmp .posok.slide_show
780
 
781
.mode_not_changed:
1570 dunkaist 782
    cmp [bFirstDraw], 0
783
    jz  .posok
784
    or  ecx, -1
6801 IgorA 785
    mcall   SF_THREAD_INFO, procinfo
1040 diamond 786
 
3116 dunkaist 787
    test byte [procinfo.wnd_state], 0x04
788
    jnz .posok
1040 diamond 789
 
1570 dunkaist 790
    mov edx, ecx
791
    mov esi, ecx
3116 dunkaist 792
    cmp dword [procinfo.box.width], 50 + 25 * numimages
1570 dunkaist 793
    jae @f
3116 dunkaist 794
    mov edx, 50 + 25 * numimages
1040 diamond 795
@@:
3116 dunkaist 796
    cmp dword [procinfo.box.height], 70
1570 dunkaist 797
    jae @f
798
    mov esi, 70
1040 diamond 799
@@:
1570 dunkaist 800
    mov eax, edx
801
    and eax, esi
802
    cmp eax, -1
803
    jz  @f
804
    mov ebx, ecx
6801 IgorA 805
    mcall   SF_CHANGE_WINDOW
1040 diamond 806
@@:
807
 
808
.posok:
3116 dunkaist 809
    test [wnd_style], 1 SHL 25
810
    jz .posok.slide_show
6801 IgorA 811
    mcall   SF_REDRAW, SSF_BEGIN_DRAW
812
    mcall   SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
1570 dunkaist 813
    mov ebp, eax    ; save skin height
814
    add eax, [wnd_height]
3116 dunkaist 815
    mov ebx, [wnd_x]
816
    shl ebx, 16
1570 dunkaist 817
    add ebx, [wnd_width]
3116 dunkaist 818
    mov ecx, [wnd_y]
819
    shl ecx, 16
820
    add ecx, eax
6801 IgorA 821
    mcall   SF_CREATE_WINDOW, , , [wnd_style], 0, real_header
3116 dunkaist 822
    jmp .posok.common
823
.posok.slide_show:
6801 IgorA 824
    mcall   SF_REDRAW, SSF_BEGIN_DRAW
825
    mcall SF_GET_SCREEN_SIZE
3116 dunkaist 826
    mov ebx, eax
827
    shr ebx, 16
828
    movzx eax, ax
829
    mov ecx, eax
6801 IgorA 830
    mcall   SF_CREATE_WINDOW, , , [wnd_style], 0, real_header
3116 dunkaist 831
.posok.common:
6801 IgorA 832
    mcall   SF_THREAD_INFO, procinfo, -1
3116 dunkaist 833
    mov eax, [procinfo.client_box.width]
834
    sub eax, [image_padding]
835
    sub eax, [image_padding]
836
    sub eax, [draw_width]
837
    sar eax, 1
838
    test eax, eax
839
    jns @f
840
    mov eax, 0
841
@@:
842
    add eax, [image_padding]
843
    mov [draw_x], eax
844
    mov eax, [procinfo.client_box.height]
845
    sub eax, [toolbar_height]
846
    sub eax, [image_padding]
847
    sub eax, [image_padding]
848
    sub eax, [draw_height]
849
    sar eax, 1
850
    test eax, eax
851
    jns @f
852
    mov eax, 0
853
@@:
854
    add eax, [toolbar_height]
855
    add eax, [image_padding]
856
    mov [draw_y], eax
1570 dunkaist 857
    mov [bFirstDraw], 1
3116 dunkaist 858
    cmp dword [procinfo.client_box.height], 0
1570 dunkaist 859
    jle .nodraw
3116 dunkaist 860
    mov ebx, [procinfo.client_box.width]
1570 dunkaist 861
    inc ebx
3116 dunkaist 862
    mov ecx, [draw_y]
6801 IgorA 863
    mcall   SF_DRAW_RECT, , , [bg_color]
3116 dunkaist 864
    mov ecx, [procinfo.client_box.height]
1570 dunkaist 865
    inc ecx
3116 dunkaist 866
    mov esi, [cur_frame]
867
    mov esi, [esi + Image.Height]
868
    add esi, [draw_y]
1570 dunkaist 869
    sub ecx, esi
870
    jbe @f
871
    push    esi
872
    shl esi, 16
873
    add ecx, esi
874
    pop esi
875
    mcall
876
    xor ecx, ecx
1040 diamond 877
@@:
1570 dunkaist 878
    add ecx, esi
3116 dunkaist 879
    mov ebx, [draw_y]
880
    sub ecx, ebx
881
    shl ebx, 16
882
    add ecx, ebx
883
    mov ebx, [draw_x]
1570 dunkaist 884
    mcall
3116 dunkaist 885
    mov esi, [cur_frame]
886
    mov esi, [esi + Image.Width]
1570 dunkaist 887
    add esi, ebx
3116 dunkaist 888
    mov ebx, [procinfo.client_box.width]
1570 dunkaist 889
    inc ebx
890
    sub ebx, esi
891
    jbe @f
892
    shl esi, 16
893
    add ebx, esi
894
    mcall
1040 diamond 895
@@:
1004 diamond 896
 
3116 dunkaist 897
    test [wnd_style], 1 SHL 25
898
    jz .slide_show_mode
899
    mov byte [bTglbar], 0
900
    cmp byte [toolbar_height], 0
901
    je .decorations_done
902
    mov ebx, [procinfo.client_box.width]
1570 dunkaist 903
    push    ebx
6801 IgorA 904
    mcall   SF_DRAW_LINE, , <30, 30>, 0x007F7F7F
1570 dunkaist 905
    mcall   , <5 + 25 * 1, 5 + 25 * 1>, <0, 30>
906
    mcall   , <10 + 25 * 3, 10 + 25 * 3>
3116 dunkaist 907
    mcall   , <15 + 25 * 5, 15 + 25 * 5>
1570 dunkaist 908
    pop ebx
3116 dunkaist 909
    sub ebx, 25 * 5 + 10
1570 dunkaist 910
    push    ebx
911
    imul    ebx, 10001h
912
    mcall
1004 diamond 913
 
6801 IgorA 914
    mcall   SF_DEFINE_BUTTON, <5 + 25 * 0, 20>, <5, 20>, 'opn'+40000000h
1570 dunkaist 915
    mcall   , <10 + 25 * 1, 20>, , 'bck'+40000000h
916
    mcall   , <10 + 25 * 2, 20>, , 'fwd'+40000000h
917
    mcall   , <15 + 25 * 3, 20>, , 'bgr'+40000000h
3116 dunkaist 918
    mcall   , <15 + 25 * 4, 20>, , 'sld'+40000000h
1570 dunkaist 919
    pop ebx
920
    add ebx, 5
921
    shl ebx, 16
922
    mov bl, 20
923
    mcall   , , , 'flh'+40000000h
924
    add ebx, 25 * 65536
925
    mcall   , , , 'flv'+40000000h
926
    add ebx, 30 * 65536
927
    mcall   , , , 'rtr'+40000000h
928
    add ebx, 25 * 65536
929
    mcall   , , , 'rtl'+40000000h
930
    add ebx, 25 * 65536
931
    mcall   , , , 'flb'+40000000h
1004 diamond 932
 
1570 dunkaist 933
    mov ebp, (numimages-1)*20
1004 diamond 934
 
6801 IgorA 935
    mcall   SF_PUT_IMAGE_EXT, buttons+openbtn*20, <20, 20>, <5 + 25 * 0, 5>, 8, palette
3116 dunkaist 936
    mcall   , buttons+backbtn*20,    , <10 + 25 * 1, 5>
1570 dunkaist 937
    mcall   , buttons+forwardbtn*20, , <10 + 25 * 2, 5>
3116 dunkaist 938
    mcall   , buttons+bgrbtn*20,     , <15 + 25 * 3, 5>
939
    mcall   , buttons+slidebtn*20,   , <15 + 25 * 4, 5>
940
    mov edx, [procinfo.client_box.width]
1570 dunkaist 941
    sub edx, 25 * 5 + 4
942
    shl edx, 16
943
    mov dl, 5
944
    mcall   , buttons+fliphorzbtn*20
945
    add edx, 25 * 65536
946
    mcall   , buttons+flipvertbtn*20
947
    add edx, 30 * 65536
948
    mcall   , buttons+rotcwbtn*20
949
    add edx, 25 * 65536
950
    mcall   , buttons+rotccwbtn*20
951
    add edx, 25 * 65536
952
    mcall   , buttons+rot180btn*20
3116 dunkaist 953
    jmp .decorations_done
1004 diamond 954
 
3116 dunkaist 955
.slide_show_mode:
956
 
957
.decorations_done:
1570 dunkaist 958
    call    draw_cur_frame
1004 diamond 959
 
1087 diamond 960
.nodraw:
6801 IgorA 961
    mcall   SF_REDRAW, SSF_END_DRAW
1040 diamond 962
 
1570 dunkaist 963
    ret
1004 diamond 964
 
1080 diamond 965
draw_cur_frame:
1570 dunkaist 966
    push    0   ; ypos
967
    push    0   ; xpos
3116 dunkaist 968
    mov eax, [procinfo.client_box.height]
969
    sub eax, [toolbar_height]
970
    sub eax, [image_padding]
971
    inc eax
1570 dunkaist 972
    push    eax ; max height
3116 dunkaist 973
    mov eax, [procinfo.client_box.width]
974
    sub eax, [image_padding]
975
    inc eax
1570 dunkaist 976
    push    eax ; max width
3116 dunkaist 977
    push [draw_y]
978
    push [draw_x]
1570 dunkaist 979
    push    [cur_frame]
980
    call    [img.draw]
981
    mov eax, [image]
982
    test    [eax + Image.Flags], Image.IsAnimated
983
    jnz .done
984
    cmp [eax + Image.Next], 0
985
    jnz .additional_frames
1102 diamond 986
.done:
1570 dunkaist 987
    ret
1102 diamond 988
.additional_frames:
3116 dunkaist 989
    mov ebx, [procinfo.client_box.width]
990
    sub ebx, [image_padding]
991
    inc ebx
1570 dunkaist 992
    jbe .done
3116 dunkaist 993
    mov esi, [draw_x]
1102 diamond 994
.afloop:
1570 dunkaist 995
    sub ebx, [eax + Image.Width]
996
    jbe .done
997
    dec ebx
998
    jz  .done
999
    add esi, [eax + Image.Width]
1000
    mov eax, [eax + Image.Next]
1001
    push    eax
1002
    inc esi
1003
    push    0   ; ypos
1004
    push    0   ; xpos
3116 dunkaist 1005
    mov ecx, [procinfo.client_box.height]
1006
    sub ecx, [toolbar_height]
1007
    sub ecx, [image_padding]
1008
    inc ecx
1009
;    inc ebx
1570 dunkaist 1010
    push    ecx ; max height
1011
    push    ebx ; max width
3116 dunkaist 1012
    push    [draw_y]  ; y
1570 dunkaist 1013
    push    esi ; x
1014
    push    eax ; image
1015
    call    [img.draw]
1016
    pop eax
1017
    cmp [eax + Image.Next], 0
1018
    jnz .afloop
1019
    ret
1080 diamond 1020
 
1004 diamond 1021
 
1427 diamond 1022
check_shortcut:
1570 dunkaist 1023
; in:   cl = scancode (from sysfn 2),
1024
;   eax = state of modifiers (from sysfn 66.3),
1025
;   edx -> shortcut descriptor
1026
; out:  ZF set <=> fail
1027
    cmp cl, [edx+4]
1028
    jnz .not
1029
    push    eax
1030
    mov esi, [edx]
1031
    and esi, 0xF
1032
    and al, 3
1033
    call    dword [check_modifier_table+esi*4]
1034
    test    al, al
1035
    pop eax
1036
    jnz .not
1037
    push    eax
1038
    mov esi, [edx]
1039
    shr esi, 4
1040
    and esi, 0xF
1041
    shr al, 2
1042
    and al, 3
1043
    call    dword [check_modifier_table+esi*4]
1044
    test    al, al
1045
    pop eax
1046
    jnz .not
1047
    push    eax
1048
    mov esi, [edx]
1049
    shr esi, 8
1050
    and esi, 0xF
1051
    shr al, 4
1052
    and al, 3
1053
    call    dword [check_modifier_table+esi*4]
1054
    test    al, al
1055
    pop eax
1056
;   jnz .not
1427 diamond 1057
.not:
1570 dunkaist 1058
    ret
1427 diamond 1059
 
1060
check_modifier_0:
1570 dunkaist 1061
    setnz   al
1062
    ret
1427 diamond 1063
check_modifier_1:
1570 dunkaist 1064
    setp    al
1065
    ret
1427 diamond 1066
check_modifier_2:
1570 dunkaist 1067
    cmp al, 3
1068
    setnz   al
1069
    ret
1427 diamond 1070
check_modifier_3:
1570 dunkaist 1071
    cmp al, 1
1072
    setnz   al
1073
    ret
1427 diamond 1074
check_modifier_4:
1570 dunkaist 1075
    cmp al, 2
1076
    setnz   al
1077
    ret
1427 diamond 1078
 
1079
; fills real_header with window title
1080
; window title is generated as ' - Kolibri Image Viewer'
1081
generate_header:
1570 dunkaist 1082
    push    eax
1083
    mov esi, [last_name_component]
1084
    mov edi, real_header
1427 diamond 1085
@@:
1570 dunkaist 1086
    lodsb
1087
    test    al, al
1088
    jz  @f
1089
    stosb
1090
    cmp edi, real_header+256
1091
    jb  @b
1427 diamond 1092
.overflow:
1570 dunkaist 1093
    mov dword [edi-4], '...'
1427 diamond 1094
.ret:
1570 dunkaist 1095
    pop eax
1096
    ret
1427 diamond 1097
@@:
1570 dunkaist 1098
    mov esi, s_header
1427 diamond 1099
@@:
1570 dunkaist 1100
    lodsb
1101
    stosb
1102
    test    al, al
1103
    jz  .ret
1104
    cmp edi, real_header+256
1105
    jb  @b
1106
    jmp .overflow
1004 diamond 1107
;-----------------------------------------------------------------------------
1108
 
1427 diamond 1109
s_header db ' - Kolibri Image Viewer', 0
3116 dunkaist 1110
wnd_style        dd 0x73FFFFFF
1111
wnd_x            dd 100
1112
wnd_y            dd 100
1113
image_padding    dd 5
1114
toolbar_height   dd 31
1115
bg_color         dd 0x00ffffff
1004 diamond 1116
 
1117
;-----------------------------------------------------------------------------
1118
;-----------------------------------------------------------------------------
1119
 
1120
align 4
1121
@IMPORT:
1122
 
1570 dunkaist 1123
library             \
1124
    libio  , 'libio.obj'  , \
1125
    libgfx , 'libgfx.obj' , \
1126
    libimg , 'libimg.obj' , \
1127
    libini , 'libini.obj' , \
1128
    sort   , 'sort.obj'   , \
1129
    proc_lib ,'proc_lib.obj'
1004 diamond 1130
 
1511 mario79 1131
 
1570 dunkaist 1132
import  libio             , \
1133
    libio.init , 'lib_init'   , \
1134
    file.size  , 'file_size'  , \
1135
    file.open  , 'file_open'  , \
1136
    file.read  , 'file_read'  , \
1137
    file.close , 'file_close'
1004 diamond 1138
 
1570 dunkaist 1139
import  libgfx              , \
1140
    libgfx.init   , 'lib_init'  , \
1141
    gfx.open      , 'gfx_open'  , \
1142
    gfx.close     , 'gfx_close' , \
1143
    gfx.pen.color , 'gfx_pen_color' , \
1144
    gfx.line      , 'gfx_line'
1004 diamond 1145
 
1570 dunkaist 1146
import  libimg             , \
1147
    libimg.init , 'lib_init'   , \
1148
    img.is_img  , 'img_is_img' , \
1149
    img.to_rgb2 , 'img_to_rgb2', \
1150
    img.decode  , 'img_decode' , \
1151
    img.flip    , 'img_flip'   , \
1152
    img.rotate  , 'img_rotate' , \
1153
    img.destroy , 'img_destroy', \
1154
    img.draw    , 'img_draw'
1004 diamond 1155
 
1570 dunkaist 1156
import  libini, \
1157
    ini_get_shortcut, 'ini_get_shortcut'
1427 diamond 1158
 
1144 diamond 1159
import  sort, sort.START, 'START', SortDir, 'SortDir', strcmpi, 'strcmpi'
1016 diamond 1160
 
1570 dunkaist 1161
import  proc_lib, \
1162
    OpenDialog_Init, 'OpenDialog_init', \
1163
    OpenDialog_Start,'OpenDialog_start'
1511 mario79 1164
 
1570 dunkaist 1165
bFirstDraw  db  0
3116 dunkaist 1166
bSlideShow  db  0
1167
bTglbar     db  0
1004 diamond 1168
;-----------------------------------------------------------------------------
1169
 
1016 diamond 1170
virtual at 0
1171
file 'kivicons.bmp':0xA,4
1172
load offbits dword from 0
1173
end virtual
3116 dunkaist 1174
numimages = 10
1016 diamond 1175
openbtn = 0
1176
backbtn = 1
1177
forwardbtn = 2
1178
bgrbtn = 3
1179
fliphorzbtn = 4
1180
flipvertbtn = 5
1181
rotcwbtn = 6
1182
rotccwbtn = 7
1183
rot180btn = 8
3116 dunkaist 1184
slidebtn = 9
1016 diamond 1185
 
1004 diamond 1186
palette:
1570 dunkaist 1187
    file 'kivicons.bmp':0x36,offbits-0x36
1016 diamond 1188
buttons:
1570 dunkaist 1189
    file 'kivicons.bmp':offbits
1004 diamond 1190
repeat 10
1191
y = % - 1
1192
z = 20 - %
1016 diamond 1193
repeat numimages*5
1194
load a dword from $ - numimages*20*20 + numimages*20*y + (%-1)*4
1195
load b dword from $ - numimages*20*20 + numimages*20*z + (%-1)*4
1196
store dword a at $ - numimages*20*20 + numimages*20*z + (%-1)*4
1197
store dword b at $ - numimages*20*20 + numimages*20*y + (%-1)*4
1004 diamond 1198
end repeat
1199
end repeat
1200
 
1570 dunkaist 1201
inifilename db  '/sys/media/kiv.ini',0
1202
aShortcuts  db  'Shortcuts',0
1203
aNext       db  'Next',0
1204
aPrev       db  'Prev',0
3116 dunkaist 1205
aSlide      db  'SlideShow',0
1206
aTglbar     db  'ToggleBar',0
1427 diamond 1207
 
1208
align 4
1209
check_modifier_table:
1570 dunkaist 1210
    dd  check_modifier_0
1211
    dd  check_modifier_1
1212
    dd  check_modifier_2
1213
    dd  check_modifier_3
1214
    dd  check_modifier_4
1427 diamond 1215
 
1470 mario79 1216
;---------------------------------------------------------------------
1217
align 4
1218
OpenDialog_data:
1570 dunkaist 1219
.type           dd 0
1220
.procinfo       dd procinfo ;+4
1221
.com_area_name      dd communication_area_name ;+8
1222
.com_area       dd 0 ;+12
1223
.opendir_pach       dd temp_dir_pach ;+16
1224
.dir_default_pach   dd communication_area_default_pach ;+20
1225
.start_path     dd open_dialog_path ;+24
1226
.draw_window        dd draw_window ;+28
1227
.status         dd 0 ;+32
1228
.openfile_pach      dd path  ;openfile_pach ;+36
1229
.filename_area      dd 0    ;+40
1230
.filter_area        dd Filter
1582 mario79 1231
.x:
5183 hidnplayr 1232
.x_size                 dw 420 ;+48 ; Window X size
1233
.x_start                dw 10 ;+50 ; Window X position
1582 mario79 1234
.y:
5183 hidnplayr 1235
.y_size                 dw 320 ;+52 ; Window y size
1236
.y_start                dw 10 ;+54 ; Window Y position
1004 diamond 1237
 
1470 mario79 1238
communication_area_name:
1570 dunkaist 1239
    db 'FFFFFFFF_open_dialog',0
1701 lrz 1240
 
1470 mario79 1241
open_dialog_path:
1701 lrz 1242
if __nightbuild eq yes
1243
    db '/sys/MANAGERS/opendial',0
1244
else
1570 dunkaist 1245
    db '/sys/File Managers/opendial',0
1701 lrz 1246
end if
1470 mario79 1247
communication_area_default_pach:
1570 dunkaist 1248
    db '/rd/1',0
1004 diamond 1249
 
1470 mario79 1250
Filter:
1251
dd Filter.end - Filter
1252
.1:
1253
db 'BMP',0
1254
db 'GIF',0
1255
db 'JPG',0
1256
db 'JPEG',0
1257
db 'JPE',0
1258
db 'PNG',0
1259
db 'ICO',0
1260
db 'CUR',0
3116 dunkaist 1261
db 'TGA',0
1570 dunkaist 1262
db 'PCX',0
1922 dunkaist 1263
db 'XCF',0
2389 dunkaist 1264
db 'PBM',0
1265
db 'PGM',0
1266
db 'PNM',0
1267
db 'TIF',0
1268
db 'TIFF',0
2394 dunkaist 1269
db 'WBMP',0
1470 mario79 1270
.end:
1271
db 0
1004 diamond 1272
 
1470 mario79 1273
draw_window_fake:
1570 dunkaist 1274
    ret
1470 mario79 1275
;------------------------------------------------------------------------------
1016 diamond 1276
readdir_fileinfo:
1570 dunkaist 1277
    dd  1
1278
    dd  0
1279
    dd  0
1280
readblocks dd   0
1281
directory_ptr   dd  0
1470 mario79 1282
;------------------------------------------------------------------------------
1004 diamond 1283
I_END:
1570 dunkaist 1284
curdir      rb  1024
1016 diamond 1285
 
1286
align 4
1004 diamond 1287
img_data     dd ?
1288
img_data_len dd ?
1570 dunkaist 1289
fh       dd ?
1290
image        dd ?
3116 dunkaist 1291
wnd_width   dd  100
1292
wnd_height  dd  100
1293
draw_x      dd  ?
1294
draw_y      dd  ?
1570 dunkaist 1295
draw_width  dd  ?
1296
draw_height dd  ?
1297
last_name_component dd  ?
1298
cur_file_idx    dd  ?
1299
cur_frame_time  dd  ?
1300
cur_frame   dd  ?
1004 diamond 1301
 
1570 dunkaist 1302
next_mod    dd  ?
1303
next_key    dd  ?
1304
prev_mod    dd  ?
1305
prev_key    dd  ?
3116 dunkaist 1306
slide_mod   dd  ?
1307
slide_key   dd  ?
1308
tglbar_mod  dd  ?
1309
tglbar_key  dd  ?
1004 diamond 1310
 
3116 dunkaist 1311
toolbar_height_old   rd 1
1312
 
1313
procinfo    process_information
1570 dunkaist 1314
path:       rb  4096  ;1024+16
1315
real_header rb  256
1470 mario79 1316
@PARAMS rb 4096  ;512
1317
;---------------------------------------------------------------------
1318
temp_dir_pach:
1319
        rb 4096
1320
;---------------------------------------------------------------------
1570 dunkaist 1321
    rb 4096
1470 mario79 1322
stacktop:
1323
;---------------------------------------------------------------------
1922 dunkaist 1324
F_END: