Subversion Repositories Kolibri OS

Rev

Rev 2394 | Rev 5183 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2394 Rev 3116
Line 4... Line 4...
4
db 'MENUET01'
4
db 'MENUET01'
5
dd 0x01, START, I_END, F_END, stacktop, @PARAMS, 0x0
5
dd 0x01, START, I_END, F_END, stacktop, @PARAMS, 0x0
Line 6... Line 6...
6
 
6
 
Line 7... Line -...
7
;-----------------------------------------------------------------------------
-
 
8
 
-
 
9
FALSE = 0
7
;-----------------------------------------------------------------------------
10
TRUE  = 1
8
 
11
include '../../../config.inc'		;for nightbuild
9
include '../../../config.inc'
12
include '../../../proc32.inc'
10
include '../../../proc32.inc'
-
 
11
include '../../../macros.inc'
Line 13... Line 12...
13
include '../../../macros.inc'
12
include '../../../dll.inc'
14
include 'dll.inc'
13
;include '../../../debug.inc'
Line 15... Line 14...
15
 
14
 
Line 51... Line 50...
51
; initialize keyboard handling
50
; initialize keyboard handling
52
    invoke  ini_get_shortcut, inifilename, aShortcuts, aNext, -1, next_mod
51
    invoke  ini_get_shortcut, inifilename, aShortcuts, aNext, -1, next_mod
53
    mov [next_key], eax
52
    mov [next_key], eax
54
    invoke  ini_get_shortcut, inifilename, aShortcuts, aPrev, -1, prev_mod
53
    invoke  ini_get_shortcut, inifilename, aShortcuts, aPrev, -1, prev_mod
55
    mov [prev_key], eax
54
    mov [prev_key], eax
-
 
55
    invoke  ini_get_shortcut, inifilename, aShortcuts, aSlide, -1, slide_mod
-
 
56
    mov [slide_key], eax
-
 
57
    invoke  ini_get_shortcut, inifilename, aShortcuts, aTglbar, -1, tglbar_mod
-
 
58
    mov [tglbar_key], eax
56
    mcall   66, 1, 1    ; set kbd mode to scancodes
59
    mcall   66, 1, 1    ; set kbd mode to scancodes
Line 57... Line 60...
57
 
60
 
58
    cmp byte [@PARAMS], 0
61
    cmp byte [@PARAMS], 0
Line 138... Line 141...
138
    mov edx, next_mod
141
    mov edx, next_mod
139
    call    check_shortcut
142
    call    check_shortcut
140
    jz  .next
143
    jz  .next
141
    add edx, prev_mod - next_mod
144
    add edx, prev_mod - next_mod
142
    call    check_shortcut
145
    call    check_shortcut
-
 
146
    jz  .prev
-
 
147
    add edx, slide_mod - prev_mod
-
 
148
    call    check_shortcut
-
 
149
    jz  .slide
-
 
150
    add edx, tglbar_mod - slide_mod
-
 
151
    call    check_shortcut
-
 
152
    jz  .tglbar
-
 
153
    cmp cl, 1 ; Esc
-
 
154
    jz  .esc
143
    jnz keyloop
155
    jmp keyloop
-
 
156
.esc:
-
 
157
    test byte [bSlideShow], 1
-
 
158
    jnz .slide
-
 
159
    jmp keyloop
-
 
160
.tglbar:
-
 
161
    mov byte [bTglbar], 1
-
 
162
    test byte[bSlideShow], 1
-
 
163
    jnz @f
-
 
164
    xor [toolbar_height], 31
-
 
165
@@:
-
 
166
    jmp keyloop
-
 
167
.slide:
-
 
168
    call slide_show
-
 
169
    jmp keyloop
144
.prev:
170
.prev:
145
    dec esi
171
    dec esi
146
    jmp keyloop
172
    jmp keyloop
147
.next:
173
.next:
148
    inc esi
174
    inc esi
149
    jmp keyloop
175
    jmp keyloop
150
keyloopdone:
176
keyloopdone:
151
    test    esi, esi
177
    test esi, esi
-
 
178
    jnz next_or_prev_handler
-
 
179
    test byte [bSlideShow], 2
-
 
180
    jnz red
-
 
181
    test byte [bTglbar], 1
-
 
182
    jnz red
152
    jz  still
183
    jmp still
153
next_or_prev_handler:
184
next_or_prev_handler:
154
    call    next_or_prev_image
185
    call    next_or_prev_image
155
    jmp red
186
    jmp red
Line 156... Line 187...
156
 
187
 
Line 256... Line 287...
256
 
287
 
257
    call    set_as_bgr
288
    call    set_as_bgr
Line 258... Line 289...
258
    jmp still
289
    jmp still
-
 
290
 
-
 
291
    @@:
-
 
292
    cmp eax, 'sld'
-
 
293
    jne @f
-
 
294
 
-
 
295
    call    slide_show
-
 
296
    jmp red
Line 259... Line 297...
259
 
297
 
260
    @@:
298
    @@:
261
 
299
 
262
    or  esi, -1
300
    or  esi, -1
Line 294... Line 332...
294
    jnz .error_close
332
    jnz .error_close
295
    invoke  file.close, [fh]
333
    invoke  file.close, [fh]
296
    inc eax
334
    inc eax
297
    jz  .error
335
    jz  .error
Line 298... Line -...
298
 
-
 
299
; img.decode checks for img.is_img
-
 
300
;   invoke  img.is_img, [img_data], [img_data_len]
-
 
301
;   or  eax, eax
-
 
302
;   jz  exit
336
 
303
    invoke  img.decode, [img_data], [img_data_len], 0
337
    invoke  img.decode, [img_data], [img_data_len], 0
304
    or  eax, eax
338
    or  eax, eax
305
    jz  .error
339
    jz  .error
306
    cmp [image], 0
340
    cmp [image], 0
Line 349... Line 383...
349
    jmp @b
383
    jmp @b
350
@@: pop eax
384
@@: pop eax
351
.not_in_row:
385
.not_in_row:
352
    mov [draw_width], edx
386
    mov [draw_width], edx
353
    add edx, 19
387
    add edx, 19
354
    cmp edx, 40 + 25*9
388
    cmp edx, 50 + 25*numimages
355
    jae @f
389
    jae @f
356
    mov edx, 40 + 25*9
390
    mov edx, 50 + 25*numimages
357
@@:
391
@@:
-
 
392
;    dec edx
358
    mov [wnd_width], edx
393
    mov [wnd_width], edx
359
    mov esi, [eax + Image.Height]
394
    mov esi, [eax + Image.Height]
360
    test    [eax + Image.Flags], Image.IsAnimated
395
    test    [eax + Image.Flags], Image.IsAnimated
361
    jnz .max_equals_first
396
    jnz .max_equals_first
362
    push eax
397
    push eax
Line 368... Line 403...
368
    mov esi, [eax + Image.Height]
403
    mov esi, [eax + Image.Height]
369
    jmp @b
404
    jmp @b
370
@@: pop eax
405
@@: pop eax
371
.max_equals_first:
406
.max_equals_first:
372
    mov [draw_height], esi
407
    mov [draw_height], esi
-
 
408
    add esi, [toolbar_height]
-
 
409
    add esi, [image_padding]
-
 
410
    add esi, [image_padding]
-
 
411
    add esi, 5  ; window bottom frame height
373
    add esi, 44
412
    dec esi
374
    mov [wnd_height], esi
413
    mov [wnd_height], esi
375
    popf
414
    popf
376
    jz  .no_resize
415
    jz  .no_resize
-
 
416
    test [wnd_style], 1 SHL 25
-
 
417
    jz .no_resize
377
    mcall   48, 4
418
    mcall   48, 4
378
    add esi, eax
419
    add esi, eax
379
    mcall   67,-1,-1
420
    mcall   67,-1,-1
380
.no_resize:
421
.no_resize:
381
    ret
422
    ret
Line 397... Line 438...
397
 
438
 
398
@@:
439
@@:
399
    mcall   15, 3
440
    mcall   15, 3
Line -... Line 441...
-
 
441
    ret
-
 
442
 
-
 
443
slide_show:
-
 
444
    or  byte [bSlideShow], 2
-
 
445
    xor byte [bSlideShow], 1
-
 
446
    btc dword [wnd_style], 25
-
 
447
    jc  @f
-
 
448
    mov eax, [toolbar_height_old]
-
 
449
    mov [toolbar_height], eax
-
 
450
    mov [image_padding], 5
-
 
451
    jmp .toolbar_height_done
-
 
452
@@:
-
 
453
    mov eax, [toolbar_height]
-
 
454
    mov [toolbar_height_old], eax
-
 
455
    mov [toolbar_height], 0
-
 
456
    mov [image_padding], 0
-
 
457
.toolbar_height_done:
400
    ret
458
    ret
401
 
459
 
402
; seek to ESI image files
460
; seek to ESI image files
403
; esi>0 means next file, esi<0 - prev file
461
; esi>0 means next file, esi<0 - prev file
404
next_or_prev_image:
462
next_or_prev_image:
Line 572... Line 630...
572
    jz  .copy
630
    jz  .copy
573
    cmp ecx, 'ico'
631
    cmp ecx, 'ico'
574
    jz  .copy
632
    jz  .copy
575
    cmp ecx, 'cur'
633
    cmp ecx, 'cur'
576
    jz  .copy
634
    jz  .copy
-
 
635
    cmp ecx, 'tga'
577
; dunkaist [
636
    jz  .copy
578
    cmp ecx, 'pcx'
637
    cmp ecx, 'pcx'
579
    jz  .copy
638
    jz  .copy
580
    cmp ecx, 'xcf'
639
    cmp ecx, 'xcf'
581
    jz  .copy
640
    jz  .copy
582
    cmp ecx, 'pbm'
641
    cmp ecx, 'pbm'
Line 589... Line 648...
589
    jz  .copy
648
    jz  .copy
590
    cmp ecx, 'tiff'
649
    cmp ecx, 'tiff'
591
    jz  @f
650
    jz  @f
592
    cmp ecx, 'wbmp'
651
    cmp ecx, 'wbmp'
593
    jz  @f
652
    jz  @f
594
; dunkaist ]
-
 
595
    cmp ecx, 'jpeg'
653
    cmp ecx, 'jpeg'
596
    jz  @f
654
    jz  @f
597
    cmp ecx, 'jpeG'
655
    cmp ecx, 'jpeG'
598
    jnz .nocopy
656
    jnz .nocopy
599
@@:
657
@@:
Line 676... Line 734...
676
@@:
734
@@:
677
    pop eax
735
    pop eax
678
    ret
736
    ret
Line 679... Line 737...
679
 
737
 
-
 
738
draw_window:
-
 
739
    btr  word [bSlideShow], 1  ; mode changed
-
 
740
    jc .mode_changed
-
 
741
    test byte [bTglbar], 1
-
 
742
    jz .mode_not_changed
-
 
743
.mode_changed:
-
 
744
    test [wnd_style], 1 SHL 25
-
 
745
    jz .mode_slide
-
 
746
    mov [bg_color], 0x00ffffff
-
 
747
    mov eax, [image]
-
 
748
    cmp eax, eax
-
 
749
    call update_image_sizes
-
 
750
    mcall 48, 4
-
 
751
    mov esi, [wnd_height]
-
 
752
    add esi, eax
-
 
753
    test byte [bTglbar], 1
-
 
754
    jz @f
-
 
755
    mcall 67, -1, -1, [wnd_width], 
-
 
756
    jmp .mode_not_changed
-
 
757
@@:
-
 
758
    mcall 67, [wnd_x], [wnd_y], [wnd_width], 
-
 
759
    jmp .mode_not_changed
-
 
760
.mode_slide:
-
 
761
    mov [bg_color], 0x00000000
-
 
762
    mov eax, [procinfo.box.left]
-
 
763
    mov [wnd_x], eax
-
 
764
    mov eax, [procinfo.box.top]
-
 
765
    mov [wnd_y], eax
-
 
766
    mcall 14
-
 
767
    mov edx, eax
-
 
768
    shr edx, 16
-
 
769
    movzx eax, ax
-
 
770
    mov esi, eax
-
 
771
    mcall 67, 0, 0, ,
-
 
772
    jmp .posok.slide_show
-
 
773
 
680
draw_window:
774
.mode_not_changed:
681
    cmp [bFirstDraw], 0
775
    cmp [bFirstDraw], 0
682
    jz  .posok
776
    jz  .posok
683
    or  ecx, -1
777
    or  ecx, -1
Line 684... Line 778...
684
    mcall   9, procinfo
778
    mcall   9, procinfo
685
 
779
 
Line 686... Line 780...
686
    cmp dword [ebx + 66], 0
780
    test byte [procinfo.wnd_state], 0x04
687
    jle .posok
781
    jnz .posok
688
 
782
 
689
    mov edx, ecx
783
    mov edx, ecx
690
    mov esi, ecx
784
    mov esi, ecx
691
    cmp dword [ebx + 42], 40 + 25 * 9
785
    cmp dword [procinfo.box.width], 50 + 25 * numimages
692
    jae @f
786
    jae @f
693
    mov edx, 40 + 25 * 9
787
    mov edx, 50 + 25 * numimages
694
@@:
788
@@:
695
    cmp dword [ebx + 46], 70
789
    cmp dword [procinfo.box.height], 70
696
    jae @f
790
    jae @f
697
    mov esi, 70
791
    mov esi, 70
Line 703... Line 797...
703
    mov ebx, ecx
797
    mov ebx, ecx
704
    mcall   67
798
    mcall   67
705
@@:
799
@@:
Line 706... Line 800...
706
 
800
 
-
 
801
.posok:
-
 
802
    test [wnd_style], 1 SHL 25
707
.posok:
803
    jz .posok.slide_show
708
    mcall   12, 1
804
    mcall   12, 1
709
    mcall   48, 4
805
    mcall   48, 4
710
    mov ebp, eax    ; save skin height
806
    mov ebp, eax    ; save skin height
711
    add eax, [wnd_height]
807
    add eax, [wnd_height]
-
 
808
    mov ebx, [wnd_x]
712
    __mov   ebx, 100, 0
809
    shl ebx, 16
713
    add ebx, [wnd_width]
810
    add ebx, [wnd_width]
-
 
811
    mov ecx, [wnd_y]
-
 
812
    shl ecx, 16
714
    lea ecx, [100*65536 + eax]
813
    add ecx, eax
-
 
814
    mcall   0, , , [wnd_style], 0, real_header
-
 
815
    jmp .posok.common
-
 
816
.posok.slide_show:
715
    mcall   0, , , 0x73FFFFFF, 0, real_header
817
    mcall   12, 1
-
 
818
    mcall 14
-
 
819
    mov ebx, eax
-
 
820
    shr ebx, 16
-
 
821
    movzx eax, ax
-
 
822
    mov ecx, eax
-
 
823
    mcall   0, , , [wnd_style], 0, real_header
716
 
824
.posok.common:
-
 
825
    mcall   9, procinfo, -1
-
 
826
    mov eax, [procinfo.client_box.width]
-
 
827
    sub eax, [image_padding]
-
 
828
    sub eax, [image_padding]
-
 
829
    sub eax, [draw_width]
-
 
830
    sar eax, 1
-
 
831
    test eax, eax
-
 
832
    jns @f
-
 
833
    mov eax, 0
-
 
834
@@:
-
 
835
    add eax, [image_padding]
-
 
836
    mov [draw_x], eax
-
 
837
    mov eax, [procinfo.client_box.height]
-
 
838
    sub eax, [toolbar_height]
-
 
839
    sub eax, [image_padding]
-
 
840
    sub eax, [image_padding]
-
 
841
    sub eax, [draw_height]
-
 
842
    sar eax, 1
-
 
843
    test eax, eax
-
 
844
    jns @f
-
 
845
    mov eax, 0
-
 
846
@@:
-
 
847
    add eax, [toolbar_height]
-
 
848
    add eax, [image_padding]
717
    mcall   9, procinfo, -1
849
    mov [draw_y], eax
718
    mov [bFirstDraw], 1
850
    mov [bFirstDraw], 1
719
    cmp dword [ebx + 66], 0
851
    cmp dword [procinfo.client_box.height], 0
720
    jle .nodraw
852
    jle .nodraw
721
    mov ebx, [ebx + 62]
853
    mov ebx, [procinfo.client_box.width]
-
 
854
    inc ebx
722
    inc ebx
855
    mov ecx, [draw_y]
723
    mcall   13, , <0, 35>, 0xFFFFFF
856
    mcall   13, , , [bg_color]
724
    mov ecx, [procinfo + 66]
857
    mov ecx, [procinfo.client_box.height]
725
    inc ecx
858
    inc ecx
726
;    mov esi, [draw_height]          ; we can not use [draw_height] here because for *.ico files containing several frames
-
 
727
    mov esi, [image]                 ; with different size window height should depend on maximum frame height, not the first one
859
    mov esi, [cur_frame]
728
    mov esi, [esi+Image.Height]      ; 
860
    mov esi, [esi + Image.Height]
729
    add esi, 35
861
    add esi, [draw_y]
730
    sub ecx, esi
862
    sub ecx, esi
731
    jbe @f
863
    jbe @f
732
    push    esi
864
    push    esi
733
    shl esi, 16
865
    shl esi, 16
734
    add ecx, esi
866
    add ecx, esi
735
    pop esi
867
    pop esi
736
    mcall
868
    mcall
737
    xor ecx, ecx
869
    xor ecx, ecx
738
@@:
870
@@:
-
 
871
    add ecx, esi
-
 
872
    mov ebx, [draw_y]
-
 
873
    sub ecx, ebx
739
    add ecx, esi
874
    shl ebx, 16
740
    add ecx, 35*10000h - 35
875
    add ecx, ebx
741
    __mov   ebx, 0, 5
876
    mov ebx, [draw_x]
742
    mcall
877
    mcall
743
;    mov esi, [draw_width]           ; we can not use [draw_width] here because for *.ico files containing several frames
-
 
744
    mov esi, [image]                 ; with different size window width should depend on the sum of width of all frames
878
    mov esi, [cur_frame]
745
    mov esi, [esi + Image.Width]     ; 
879
    mov esi, [esi + Image.Width]
746
    add esi, ebx
880
    add esi, ebx
747
    mov ebx, [procinfo+62]
881
    mov ebx, [procinfo.client_box.width]
748
    inc ebx
882
    inc ebx
749
    sub ebx, esi
883
    sub ebx, esi
750
    jbe @f
884
    jbe @f
751
    shl esi, 16
885
    shl esi, 16
752
    add ebx, esi
886
    add ebx, esi
753
    mcall
887
    mcall
Line -... Line 888...
-
 
888
@@:
-
 
889
 
-
 
890
    test [wnd_style], 1 SHL 25
-
 
891
    jz .slide_show_mode
-
 
892
    mov byte [bTglbar], 0
754
@@:
893
    cmp byte [toolbar_height], 0
755
 
894
    je .decorations_done
756
    mov ebx, [procinfo + 62]
895
    mov ebx, [procinfo.client_box.width]
757
    push    ebx
896
    push    ebx
758
    mcall   38, , <30, 30>, 0x007F7F7F
897
    mcall   38, , <30, 30>, 0x007F7F7F
759
    mcall   , <5 + 25 * 1, 5 + 25 * 1>, <0, 30>
898
    mcall   , <5 + 25 * 1, 5 + 25 * 1>, <0, 30>
760
    mcall   , <10 + 25 * 3, 10 + 25 * 3>
899
    mcall   , <10 + 25 * 3, 10 + 25 * 3>
761
    mcall   , <15 + 25 * 4, 15 + 25 * 4>
900
    mcall   , <15 + 25 * 5, 15 + 25 * 5>
762
    pop ebx
901
    pop ebx
763
    sub ebx, 25 * 5 + 10
902
    sub ebx, 25 * 5 + 10 
764
    push    ebx
903
    push    ebx
Line 765... Line 904...
765
    imul    ebx, 10001h
904
    imul    ebx, 10001h
766
    mcall
905
    mcall
767
 
906
 
768
    mcall   8, <5 + 25 * 0, 20>, <5, 20>, 'opn'+40000000h
907
    mcall   8, <5 + 25 * 0, 20>, <5, 20>, 'opn'+40000000h
-
 
908
    mcall   , <10 + 25 * 1, 20>, , 'bck'+40000000h
769
    mcall   , <10 + 25 * 1, 20>, , 'bck'+40000000h
909
    mcall   , <10 + 25 * 2, 20>, , 'fwd'+40000000h
770
    mcall   , <10 + 25 * 2, 20>, , 'fwd'+40000000h
910
    mcall   , <15 + 25 * 3, 20>, , 'bgr'+40000000h
771
    mcall   , <15 + 25 * 3, 20>, , 'bgr'+40000000h
911
    mcall   , <15 + 25 * 4, 20>, , 'sld'+40000000h
772
    pop ebx
912
    pop ebx
773
    add ebx, 5
913
    add ebx, 5
Line 787... Line 927...
787
 
927
 
788
    mcall   65, buttons+openbtn*20, <20, 20>, <5 + 25 * 0, 5>, 8, palette
928
    mcall   65, buttons+openbtn*20, <20, 20>, <5 + 25 * 0, 5>, 8, palette
789
    mcall   , buttons+backbtn*20, , <10 + 25 * 1, 5>
929
    mcall   , buttons+backbtn*20,    , <10 + 25 * 1, 5>
790
    mcall   , buttons+forwardbtn*20, , <10 + 25 * 2, 5>
930
    mcall   , buttons+forwardbtn*20, , <10 + 25 * 2, 5>
-
 
931
    mcall   , buttons+bgrbtn*20,     , <15 + 25 * 3, 5>
791
    mcall   , buttons+bgrbtn*20, , <15 + 25 * 3, 5>
932
    mcall   , buttons+slidebtn*20,   , <15 + 25 * 4, 5>
792
    mov edx, [procinfo + 62]
933
    mov edx, [procinfo.client_box.width]
793
    sub edx, 25 * 5 + 4
934
    sub edx, 25 * 5 + 4
794
    shl edx, 16
935
    shl edx, 16
795
    mov dl, 5
936
    mov dl, 5
796
    mcall   , buttons+fliphorzbtn*20
937
    mcall   , buttons+fliphorzbtn*20
Line 800... Line 941...
800
    mcall   , buttons+rotcwbtn*20
941
    mcall   , buttons+rotcwbtn*20
801
    add edx, 25 * 65536
942
    add edx, 25 * 65536
802
    mcall   , buttons+rotccwbtn*20
943
    mcall   , buttons+rotccwbtn*20
803
    add edx, 25 * 65536
944
    add edx, 25 * 65536
804
    mcall   , buttons+rot180btn*20
945
    mcall   , buttons+rot180btn*20
-
 
946
    jmp .decorations_done
-
 
947
 
-
 
948
.slide_show_mode:
Line -... Line 949...
-
 
949
 
805
 
950
.decorations_done:
Line 806... Line 951...
806
    call    draw_cur_frame
951
    call    draw_cur_frame
807
 
952
 
Line 808... Line 953...
808
.nodraw:
953
.nodraw:
Line 809... Line 954...
809
    mcall   12, 2
954
    mcall   12, 2
810
 
955
 
811
    ret
956
    ret
812
 
957
 
-
 
958
draw_cur_frame:
-
 
959
    push    0   ; ypos
813
draw_cur_frame:
960
    push    0   ; xpos
814
    push    0   ; ypos
961
    mov eax, [procinfo.client_box.height]
815
    push    0   ; xpos
962
    sub eax, [toolbar_height]
-
 
963
    sub eax, [image_padding]
816
    mov eax, [procinfo+66]
964
    inc eax
817
    sub eax, 34
965
    push    eax ; max height
818
    push    eax ; max height
966
    mov eax, [procinfo.client_box.width]
819
    mov eax, [procinfo+62]
967
    sub eax, [image_padding]
820
    sub eax, 4
968
    inc eax
821
    push    eax ; max width
969
    push    eax ; max width
822
    push    35  ; y
970
    push [draw_y]
823
    push    5   ; x
971
    push [draw_x]
824
    push    [cur_frame]
972
    push    [cur_frame]
825
    call    [img.draw]
973
    call    [img.draw]
826
    mov eax, [image]
974
    mov eax, [image]
827
    test    [eax + Image.Flags], Image.IsAnimated
975
    test    [eax + Image.Flags], Image.IsAnimated
828
    jnz .done
976
    jnz .done
829
    cmp [eax + Image.Next], 0
977
    cmp [eax + Image.Next], 0
830
    jnz .additional_frames
978
    jnz .additional_frames
-
 
979
.done:
831
.done:
980
    ret
832
    ret
981
.additional_frames:
833
.additional_frames:
-
 
834
    mov ebx, [procinfo+62]
982
    mov ebx, [procinfo.client_box.width]
835
    sub ebx, 4
983
    sub ebx, [image_padding]
836
    jbe .done
984
    inc ebx
837
    push    5
985
    jbe .done
838
    pop esi
986
    mov esi, [draw_x]
839
.afloop:
987
.afloop:
Line 845... Line 993...
845
    mov eax, [eax + Image.Next]
993
    mov eax, [eax + Image.Next]
846
    push    eax
994
    push    eax
847
    inc esi
995
    inc esi
848
    push    0   ; ypos
996
    push    0   ; ypos
849
    push    0   ; xpos
997
    push    0   ; xpos
850
    mov ecx, [procinfo+66]
998
    mov ecx, [procinfo.client_box.height]
-
 
999
    sub ecx, [toolbar_height]
-
 
1000
    sub ecx, [image_padding]
851
    sub ecx, 34
1001
    inc ecx
-
 
1002
;    inc ebx
852
    push    ecx ; max height
1003
    push    ecx ; max height
853
    push    ebx ; max width
1004
    push    ebx ; max width
854
    push    35  ; y
1005
    push    [draw_y]  ; y
855
    push    esi ; x
1006
    push    esi ; x
856
    push    eax ; image
1007
    push    eax ; image
857
    call    [img.draw]
1008
    call    [img.draw]
858
    pop eax
1009
    pop eax
859
    cmp [eax + Image.Next], 0
1010
    cmp [eax + Image.Next], 0
860
    jnz .afloop
1011
    jnz .afloop
861
    ret
1012
    ret
Line 862... Line -...
862
 
-
 
863
; void* __stdcall mem.Alloc(unsigned size);
-
 
864
mem.Alloc:
-
 
865
    push    ebx ecx
-
 
866
    mov ecx, [esp+12]
-
 
867
    mcall   68, 12
-
 
868
    pop ecx ebx
-
 
869
    ret 4
-
 
870
 
-
 
871
; void* __stdcall mem.ReAlloc(void* mptr, unsigned size);
-
 
872
mem.ReAlloc:
-
 
873
    push    ebx ecx edx
-
 
874
    mov edx, [esp+16]
-
 
875
    mov ecx, [esp+20]
-
 
876
    mcall   68, 20
-
 
877
    pop edx ecx ebx
-
 
878
    ret 8
-
 
879
 
-
 
880
; void __stdcall mem.Free(void* mptr);
-
 
881
mem.Free:
-
 
882
    push    ebx ecx
-
 
883
    mov ecx, [esp+12]
-
 
884
    mcall   68, 13
-
 
885
    pop ecx ebx
-
 
Line 886... Line 1013...
886
    ret 4
1013
 
887
 
1014
 
888
check_shortcut:
1015
check_shortcut:
889
; in:   cl = scancode (from sysfn 2),
1016
; in:   cl = scancode (from sysfn 2),
Line 971... Line 1098...
971
    jb  @b
1098
    jb  @b
972
    jmp .overflow
1099
    jmp .overflow
973
;-----------------------------------------------------------------------------
1100
;-----------------------------------------------------------------------------
Line 974... Line 1101...
974
 
1101
 
-
 
1102
s_header db ' - Kolibri Image Viewer', 0
-
 
1103
wnd_style        dd 0x73FFFFFF
-
 
1104
wnd_x            dd 100
-
 
1105
wnd_y            dd 100
-
 
1106
image_padding    dd 5
-
 
1107
toolbar_height   dd 31
Line 975... Line 1108...
975
s_header db ' - Kolibri Image Viewer', 0
1108
bg_color         dd 0x00ffffff
976
 
1109
 
Line 977... Line 1110...
977
;-----------------------------------------------------------------------------
1110
;-----------------------------------------------------------------------------
Line 1021... Line 1154...
1021
import  proc_lib, \
1154
import  proc_lib, \
1022
    OpenDialog_Init, 'OpenDialog_init', \
1155
    OpenDialog_Init, 'OpenDialog_init', \
1023
    OpenDialog_Start,'OpenDialog_start'
1156
    OpenDialog_Start,'OpenDialog_start'
Line 1024... Line 1157...
1024
 
1157
 
-
 
1158
bFirstDraw  db  0
-
 
1159
bSlideShow  db  0
1025
bFirstDraw  db  0
1160
bTglbar     db  0
Line 1026... Line 1161...
1026
;-----------------------------------------------------------------------------
1161
;-----------------------------------------------------------------------------
1027
 
1162
 
1028
virtual at 0
1163
virtual at 0
1029
file 'kivicons.bmp':0xA,4
1164
file 'kivicons.bmp':0xA,4
1030
load offbits dword from 0
1165
load offbits dword from 0
1031
end virtual
1166
end virtual
1032
numimages = 9
1167
numimages = 10
1033
openbtn = 0
1168
openbtn = 0
1034
backbtn = 1
1169
backbtn = 1
1035
forwardbtn = 2
1170
forwardbtn = 2
1036
bgrbtn = 3
1171
bgrbtn = 3
1037
fliphorzbtn = 4
1172
fliphorzbtn = 4
1038
flipvertbtn = 5
1173
flipvertbtn = 5
1039
rotcwbtn = 6
1174
rotcwbtn = 6
-
 
1175
rotccwbtn = 7
Line 1040... Line 1176...
1040
rotccwbtn = 7
1176
rot180btn = 8
1041
rot180btn = 8
1177
slidebtn = 9
1042
 
1178
 
1043
palette:
1179
palette:
Line 1057... Line 1193...
1057
 
1193
 
1058
inifilename db  '/sys/media/kiv.ini',0
1194
inifilename db  '/sys/media/kiv.ini',0
1059
aShortcuts  db  'Shortcuts',0
1195
aShortcuts  db  'Shortcuts',0
1060
aNext       db  'Next',0
1196
aNext       db  'Next',0
-
 
1197
aPrev       db  'Prev',0
-
 
1198
aSlide      db  'SlideShow',0
Line 1061... Line 1199...
1061
aPrev       db  'Prev',0
1199
aTglbar     db  'ToggleBar',0
1062
 
1200
 
1063
align 4
1201
align 4
1064
check_modifier_table:
1202
check_modifier_table:
Line 1111... Line 1249...
1111
db 'JPEG',0
1249
db 'JPEG',0
1112
db 'JPE',0
1250
db 'JPE',0
1113
db 'PNG',0
1251
db 'PNG',0
1114
db 'ICO',0
1252
db 'ICO',0
1115
db 'CUR',0
1253
db 'CUR',0
1116
; dunkaist [
1254
db 'TGA',0
1117
db 'PCX',0
1255
db 'PCX',0
1118
db 'XCF',0
1256
db 'XCF',0
1119
db 'PBM',0
1257
db 'PBM',0
1120
db 'PGM',0
1258
db 'PGM',0
1121
db 'PNM',0
1259
db 'PNM',0
1122
db 'TIF',0
1260
db 'TIF',0
1123
db 'TIFF',0
1261
db 'TIFF',0
1124
db 'WBMP',0
1262
db 'WBMP',0
1125
; dunkaist ]
-
 
1126
.end:
1263
.end:
1127
db 0
1264
db 0
Line 1128... Line 1265...
1128
 
1265
 
1129
draw_window_fake:
1266
draw_window_fake:
Line 1142... Line 1279...
1142
align 4
1279
align 4
1143
img_data     dd ?
1280
img_data     dd ?
1144
img_data_len dd ?
1281
img_data_len dd ?
1145
fh       dd ?
1282
fh       dd ?
1146
image        dd ?
1283
image        dd ?
1147
wnd_width   dd  ?
1284
wnd_width   dd  100
1148
wnd_height  dd  ?
1285
wnd_height  dd  100
-
 
1286
draw_x      dd  ?
-
 
1287
draw_y      dd  ?
1149
draw_width  dd  ?
1288
draw_width  dd  ?
1150
draw_height dd  ?
1289
draw_height dd  ?
1151
last_name_component dd  ?
1290
last_name_component dd  ?
1152
cur_file_idx    dd  ?
1291
cur_file_idx    dd  ?
1153
cur_frame_time  dd  ?
1292
cur_frame_time  dd  ?
Line 1155... Line 1294...
1155
 
1294
 
1156
next_mod    dd  ?
1295
next_mod    dd  ?
1157
next_key    dd  ?
1296
next_key    dd  ?
1158
prev_mod    dd  ?
1297
prev_mod    dd  ?
-
 
1298
prev_key    dd  ?
-
 
1299
slide_mod   dd  ?
-
 
1300
slide_key   dd  ?
-
 
1301
tglbar_mod  dd  ?
-
 
1302
tglbar_key  dd  ?
-
 
1303
 
Line 1159... Line 1304...
1159
prev_key    dd  ?
1304
toolbar_height_old   rd 1
1160
 
1305
 
1161
procinfo:   rb  1024
1306
procinfo    process_information
1162
path:       rb  4096  ;1024+16
1307
path:       rb  4096  ;1024+16
1163
real_header rb  256
1308
real_header rb  256
1164
@PARAMS rb 4096  ;512
1309
@PARAMS rb 4096  ;512