Subversion Repositories Kolibri OS

Rev

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

Rev 5183 Rev 6801
Line 10... Line 10...
10
 
10
 
11
include '../../../config.inc'
11
include '../../../config.inc'
12
include '../../../proc32.inc'
12
include '../../../proc32.inc'
13
include '../../../macros.inc'
13
include '../../../macros.inc'
-
 
14
include '../../../dll.inc'
14
include '../../../dll.inc'
15
include '../../../KOSfuncs.inc'
Line 15... Line 16...
15
;include '../../../debug.inc'
16
;include '../../../debug.inc'
16
 
17
 
Line 17... Line 18...
17
include '../../../develop/libraries/libs-dev/libio/libio.inc'
18
include '../../../develop/libraries/libs-dev/libio/libio.inc'
18
include '../../../develop/libraries/libs-dev/libimg/libimg.inc'
19
include '../../../develop/libraries/libs-dev/libimg/libimg.inc'
19
 
20
 
Line 20... Line 21...
20
;include '../../../develop/libraries/box_lib/asm/trunk/opendial.mac'
21
;include '../../../develop/libraries/box_lib/asm/trunk/opendial.mac'
21
;use_OpenDialog
22
;use_OpenDialog
Line 22... Line 23...
22
;-----------------------------------------------------------------------------
23
;-----------------------------------------------------------------------------
23
 
24
 
24
START:
25
START:
Line 56... Line 57...
56
    mov [prev_key], eax
57
    mov [prev_key], eax
57
    invoke  ini_get_shortcut, inifilename, aShortcuts, aSlide, -1, slide_mod
58
    invoke  ini_get_shortcut, inifilename, aShortcuts, aSlide, -1, slide_mod
58
    mov [slide_key], eax
59
    mov [slide_key], eax
59
    invoke  ini_get_shortcut, inifilename, aShortcuts, aTglbar, -1, tglbar_mod
60
    invoke  ini_get_shortcut, inifilename, aShortcuts, aTglbar, -1, tglbar_mod
60
    mov [tglbar_key], eax
61
    mov [tglbar_key], eax
61
    mcall   66, 1, 1    ; set kbd mode to scancodes
62
    mcall   SF_KEYBOARD, SSF_SET_INPUT_MODE, 1    ; set kbd mode to scancodes
Line 62... Line 63...
62
 
63
 
63
    cmp byte [@PARAMS], 0
64
    cmp byte [@PARAMS], 0
Line 64... Line 65...
64
    jnz params_given
65
    jnz params_given
Line 80... Line 81...
80
    rep movsd
81
    rep movsd
81
    mov byte [edi-1], 0
82
    mov byte [edi-1], 0
82
    jmp params_given
83
    jmp params_given
Line 83... Line 84...
83
 
84
 
84
set_bgr:
85
set_bgr:
85
    mcall   15, 4
86
    mcall   SF_BACKGROUND_SET, SSF_MODE_BG
86
    mov eax, @PARAMS + 4
87
    mov eax, @PARAMS + 4
87
    call    load_image
88
    call    load_image
Line 88... Line 89...
88
    jc  exit
89
    jc  exit
Line 110... Line 111...
110
    mov eax, [image]
111
    mov eax, [image]
111
    test    byte [eax + Image.Flags], Image.IsAnimated
112
    test    byte [eax + Image.Flags], Image.IsAnimated
112
    push    10
113
    push    10
113
    pop eax
114
    pop eax
114
    jz  @f
115
    jz  @f
115
    mcall   26, 9
116
    mcall   SF_SYSTEM_GET, SSF_TIME_COUNT
116
    mov edx, [cur_frame]
117
    mov edx, [cur_frame]
117
    mov ebx, [cur_frame_time]
118
    mov ebx, [cur_frame_time]
118
    add ebx, [edx + Image.Delay]
119
    add ebx, [edx + Image.Delay]
119
    sub ebx, eax
120
    sub ebx, eax
120
    cmp ebx, [edx + Image.Delay]
121
    cmp ebx, [edx + Image.Delay]
Line 132... Line 133...
132
    jnz button
133
    jnz button
Line 133... Line 134...
133
 
134
 
134
key:
135
key:
135
    xor esi, esi
136
    xor esi, esi
136
keyloop:
137
keyloop:
137
    mcall   2
138
    mcall   SF_GET_KEY
138
    test    al, al
139
    test    al, al
139
    jnz keyloopdone
140
    jnz keyloopdone
140
    shr eax, 8
141
    shr eax, 8
141
    mov ecx, eax
142
    mov ecx, eax
142
    mcall   66, 3
143
    mcall   SF_KEYBOARD, SSF_GET_CONTROL_KEYS
143
    mov edx, next_mod
144
    mov edx, next_mod
144
    call    check_shortcut
145
    call    check_shortcut
145
    jz  .next
146
    jz  .next
146
    add edx, prev_mod - next_mod
147
    add edx, prev_mod - next_mod
Line 193... Line 194...
193
    test    eax, eax
194
    test    eax, eax
194
    jnz @f
195
    jnz @f
195
    mov eax, [image]
196
    mov eax, [image]
196
  @@:
197
  @@:
197
    mov [cur_frame], eax
198
    mov [cur_frame], eax
198
    mcall   26, 9
199
    mcall   SF_SYSTEM_GET, SSF_TIME_COUNT
199
    mov [cur_frame_time], eax
200
    mov [cur_frame_time], eax
200
    mcall   9, procinfo, -1
201
    mcall   SF_THREAD_INFO, procinfo, -1
201
    call    draw_cur_frame
202
    call    draw_cur_frame
202
    jmp still
203
    jmp still
Line 203... Line 204...
203
 
204
 
204
button:
205
button:
205
    mcall   17
206
    mcall   SF_GET_BUTTON
Line 206... Line 207...
206
    shr eax, 8
207
    shr eax, 8
207
 
208
 
208
    ; flip horizontally
209
    ; flip horizontally
Line 308... Line 309...
308
 
309
 
309
    cmp eax, 1
310
    cmp eax, 1
Line 310... Line 311...
310
    jne still
311
    jne still
311
 
312
 
Line 312... Line 313...
312
  exit:
313
  exit:
Line 313... Line 314...
313
    mcall   -1
314
    mcall   SF_TERMINATE_PROCESS
314
 
315
 
Line 415... Line 416...
415
    mov [wnd_height], esi
416
    mov [wnd_height], esi
416
    popf
417
    popf
417
    jz  .no_resize
418
    jz  .no_resize
418
    test [wnd_style], 1 SHL 25
419
    test [wnd_style], 1 SHL 25
419
    jz .no_resize
420
    jz .no_resize
420
    mcall   48, 4
421
    mcall   SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
421
    add esi, eax
422
    add esi, eax
422
    mcall   67,-1,-1
423
    mcall   SF_CHANGE_WINDOW,-1,-1
423
.no_resize:
424
.no_resize:
424
    ret
425
    ret
Line 425... Line 426...
425
 
426
 
426
set_as_bgr:
427
set_as_bgr:
427
    mov esi, [image]
428
    mov esi, [image]
428
    mov ecx, [esi + Image.Width]
429
    mov ecx, [esi + Image.Width]
429
    mov edx, [esi + Image.Height]
430
    mov edx, [esi + Image.Height]
Line 430... Line 431...
430
    mcall   15, 1
431
    mcall   SF_BACKGROUND_SET, SSF_SIZE_BG
431
 
432
 
432
    mcall   15, 6
433
    mcall   SF_BACKGROUND_SET, SSF_MAP_BG
Line 433... Line 434...
433
    test    eax, eax
434
    test    eax, eax
434
    jz  @f
435
    jz  @f
435
 
436
 
436
    push    eax
437
    push    eax
Line 437... Line 438...
437
    invoke  img.to_rgb2, esi, eax
438
    invoke  img.to_rgb2, esi, eax
438
    pop ecx
439
    pop ecx
439
    mcall   15, 7
440
    mcall   SF_BACKGROUND_SET, SSF_UNMAP_BG
Line 440... Line 441...
440
 
441
 
441
@@:
442
@@:
442
    mcall   15, 3
443
    mcall   SF_BACKGROUND_SET, SSF_REDRAW_BG
Line 571... Line 572...
571
    dec ecx
572
    dec ecx
572
    js  @f
573
    js  @f
573
    rep movsb
574
    rep movsb
574
@@:
575
@@:
575
    mov byte [edi], 0
576
    mov byte [edi], 0
576
    mcall   68, 12, 0x1000
577
    mcall   SF_SYS_MISC, SSF_MEM_ALLOC, 0x1000
577
    test    eax, eax
578
    test    eax, eax
578
    jz  .ret
579
    jz  .ret
579
    mov ebx, readdir_fileinfo
580
    mov ebx, readdir_fileinfo
580
    mov dword [ebx+12], (0x1000 - 32) / 304
581
    mov dword [ebx+12], (0x1000 - 32) / 304
581
    mov dword [ebx+16], eax
582
    mov dword [ebx+16], eax
582
    mcall   70
583
    mcall   SF_FILE
583
    cmp eax, 6
584
    cmp eax, 6
584
    jz  .dirok
585
    jz  .dirok
585
    test    eax, eax
586
    test    eax, eax
586
    jnz free_directory
587
    jnz free_directory
587
    mov edx, [directory_ptr]
588
    mov edx, [directory_ptr]
588
    mov ecx, [edx+8]
589
    mov ecx, [edx+8]
589
    mov [readblocks], ecx
590
    mov [readblocks], ecx
590
    imul    ecx, 304
591
    imul    ecx, 304
591
    add ecx, 32
592
    add ecx, 32
592
    mcall   68, 20
593
    mcall   SF_SYS_MISC, SSF_MEM_REALLOC
593
    test    eax, eax
594
    test    eax, eax
594
    jz  free_directory
595
    jz  free_directory
595
    mov [directory_ptr], eax
596
    mov [directory_ptr], eax
596
    mcall   70, readdir_fileinfo
597
    mcall   SF_FILE, readdir_fileinfo
597
.dirok:
598
.dirok:
598
    cmp ebx, 0
599
    cmp ebx, 0
599
    jle free_directory
600
    jle free_directory
600
    mov eax, [directory_ptr]
601
    mov eax, [directory_ptr]
601
    add eax, 32
602
    add eax, 32
Line 702... Line 703...
702
    mov [cur_file_idx], eax
703
    mov [cur_file_idx], eax
703
.ret:
704
.ret:
704
    ret
705
    ret
Line 705... Line 706...
705
 
706
 
706
free_directory:
707
free_directory:
707
    mcall   68, 13, [directory_ptr]
708
    mcall   SF_SYS_MISC, SSF_MEM_FREE, [directory_ptr]
708
    and [directory_ptr], 0
709
    and [directory_ptr], 0
Line 709... Line 710...
709
    ret
710
    ret
710
 
711
 
Line 732... Line 733...
732
    mov eax, [image]
733
    mov eax, [image]
733
    mov [cur_frame], eax
734
    mov [cur_frame], eax
734
    test    byte [eax + Image.Flags], Image.IsAnimated
735
    test    byte [eax + Image.Flags], Image.IsAnimated
735
    jz  @f
736
    jz  @f
736
    push    ebx
737
    push    ebx
737
    mcall   26, 9
738
    mcall   SF_SYSTEM_GET, SSF_TIME_COUNT
738
    pop ebx
739
    pop ebx
739
    mov [cur_frame_time], eax
740
    mov [cur_frame_time], eax
740
@@:
741
@@:
741
    pop eax
742
    pop eax
742
    ret
743
    ret
Line 751... Line 752...
751
    jz .mode_slide
752
    jz .mode_slide
752
    mov [bg_color], 0x00ffffff
753
    mov [bg_color], 0x00ffffff
753
    mov eax, [image]
754
    mov eax, [image]
754
    cmp eax, eax
755
    cmp eax, eax
755
    call update_image_sizes
756
    call update_image_sizes
756
    mcall 48, 4
757
    mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
757
    mov esi, [wnd_height]
758
    mov esi, [wnd_height]
758
    add esi, eax
759
    add esi, eax
759
    test byte [bTglbar], 1
760
    test byte [bTglbar], 1
760
    jz @f
761
    jz @f
761
    mcall 67, -1, -1, [wnd_width], 
762
    mcall SF_CHANGE_WINDOW, -1, -1, [wnd_width], 
762
    jmp .mode_not_changed
763
    jmp .mode_not_changed
763
@@:
764
@@:
764
    mcall 67, [wnd_x], [wnd_y], [wnd_width], 
765
    mcall SF_CHANGE_WINDOW, [wnd_x], [wnd_y], [wnd_width], 
765
    jmp .mode_not_changed
766
    jmp .mode_not_changed
766
.mode_slide:
767
.mode_slide:
767
    mov [bg_color], 0x00000000
768
    mov [bg_color], 0x00000000
768
    mov eax, [procinfo.box.left]
769
    mov eax, [procinfo.box.left]
769
    mov [wnd_x], eax
770
    mov [wnd_x], eax
770
    mov eax, [procinfo.box.top]
771
    mov eax, [procinfo.box.top]
771
    mov [wnd_y], eax
772
    mov [wnd_y], eax
772
    mcall 14
773
    mcall SF_GET_SCREEN_SIZE
773
    mov edx, eax
774
    mov edx, eax
774
    shr edx, 16
775
    shr edx, 16
775
    movzx eax, ax
776
    movzx eax, ax
776
    mov esi, eax
777
    mov esi, eax
777
    mcall 67, 0, 0, ,
778
    mcall SF_CHANGE_WINDOW, 0, 0, ,
778
    jmp .posok.slide_show
779
    jmp .posok.slide_show
Line 779... Line 780...
779
 
780
 
780
.mode_not_changed:
781
.mode_not_changed:
781
    cmp [bFirstDraw], 0
782
    cmp [bFirstDraw], 0
782
    jz  .posok
783
    jz  .posok
783
    or  ecx, -1
784
    or  ecx, -1
Line 784... Line 785...
784
    mcall   9, procinfo
785
    mcall   SF_THREAD_INFO, procinfo
785
 
786
 
Line 786... Line 787...
786
    test byte [procinfo.wnd_state], 0x04
787
    test byte [procinfo.wnd_state], 0x04
Line 799... Line 800...
799
    mov eax, edx
800
    mov eax, edx
800
    and eax, esi
801
    and eax, esi
801
    cmp eax, -1
802
    cmp eax, -1
802
    jz  @f
803
    jz  @f
803
    mov ebx, ecx
804
    mov ebx, ecx
804
    mcall   67
805
    mcall   SF_CHANGE_WINDOW
805
@@:
806
@@:
Line 806... Line 807...
806
 
807
 
807
.posok:
808
.posok:
808
    test [wnd_style], 1 SHL 25
809
    test [wnd_style], 1 SHL 25
809
    jz .posok.slide_show
810
    jz .posok.slide_show
810
    mcall   12, 1
811
    mcall   SF_REDRAW, SSF_BEGIN_DRAW
811
    mcall   48, 4
812
    mcall   SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
812
    mov ebp, eax    ; save skin height
813
    mov ebp, eax    ; save skin height
813
    add eax, [wnd_height]
814
    add eax, [wnd_height]
814
    mov ebx, [wnd_x]
815
    mov ebx, [wnd_x]
815
    shl ebx, 16
816
    shl ebx, 16
816
    add ebx, [wnd_width]
817
    add ebx, [wnd_width]
817
    mov ecx, [wnd_y]
818
    mov ecx, [wnd_y]
818
    shl ecx, 16
819
    shl ecx, 16
819
    add ecx, eax
820
    add ecx, eax
820
    mcall   0, , , [wnd_style], 0, real_header
821
    mcall   SF_CREATE_WINDOW, , , [wnd_style], 0, real_header
821
    jmp .posok.common
822
    jmp .posok.common
822
.posok.slide_show:
823
.posok.slide_show:
823
    mcall   12, 1
824
    mcall   SF_REDRAW, SSF_BEGIN_DRAW
824
    mcall 14
825
    mcall SF_GET_SCREEN_SIZE
825
    mov ebx, eax
826
    mov ebx, eax
826
    shr ebx, 16
827
    shr ebx, 16
827
    movzx eax, ax
828
    movzx eax, ax
828
    mov ecx, eax
829
    mov ecx, eax
829
    mcall   0, , , [wnd_style], 0, real_header
830
    mcall   SF_CREATE_WINDOW, , , [wnd_style], 0, real_header
830
.posok.common:
831
.posok.common:
831
    mcall   9, procinfo, -1
832
    mcall   SF_THREAD_INFO, procinfo, -1
832
    mov eax, [procinfo.client_box.width]
833
    mov eax, [procinfo.client_box.width]
833
    sub eax, [image_padding]
834
    sub eax, [image_padding]
834
    sub eax, [image_padding]
835
    sub eax, [image_padding]
835
    sub eax, [draw_width]
836
    sub eax, [draw_width]
Line 857... Line 858...
857
    cmp dword [procinfo.client_box.height], 0
858
    cmp dword [procinfo.client_box.height], 0
858
    jle .nodraw
859
    jle .nodraw
859
    mov ebx, [procinfo.client_box.width]
860
    mov ebx, [procinfo.client_box.width]
860
    inc ebx
861
    inc ebx
861
    mov ecx, [draw_y]
862
    mov ecx, [draw_y]
862
    mcall   13, , , [bg_color]
863
    mcall   SF_DRAW_RECT, , , [bg_color]
863
    mov ecx, [procinfo.client_box.height]
864
    mov ecx, [procinfo.client_box.height]
864
    inc ecx
865
    inc ecx
865
    mov esi, [cur_frame]
866
    mov esi, [cur_frame]
866
    mov esi, [esi + Image.Height]
867
    mov esi, [esi + Image.Height]
867
    add esi, [draw_y]
868
    add esi, [draw_y]
Line 898... Line 899...
898
    mov byte [bTglbar], 0
899
    mov byte [bTglbar], 0
899
    cmp byte [toolbar_height], 0
900
    cmp byte [toolbar_height], 0
900
    je .decorations_done
901
    je .decorations_done
901
    mov ebx, [procinfo.client_box.width]
902
    mov ebx, [procinfo.client_box.width]
902
    push    ebx
903
    push    ebx
903
    mcall   38, , <30, 30>, 0x007F7F7F
904
    mcall   SF_DRAW_LINE, , <30, 30>, 0x007F7F7F
904
    mcall   , <5 + 25 * 1, 5 + 25 * 1>, <0, 30>
905
    mcall   , <5 + 25 * 1, 5 + 25 * 1>, <0, 30>
905
    mcall   , <10 + 25 * 3, 10 + 25 * 3>
906
    mcall   , <10 + 25 * 3, 10 + 25 * 3>
906
    mcall   , <15 + 25 * 5, 15 + 25 * 5>
907
    mcall   , <15 + 25 * 5, 15 + 25 * 5>
907
    pop ebx
908
    pop ebx
908
    sub ebx, 25 * 5 + 10 
909
    sub ebx, 25 * 5 + 10 
909
    push    ebx
910
    push    ebx
910
    imul    ebx, 10001h
911
    imul    ebx, 10001h
911
    mcall
912
    mcall
Line 912... Line 913...
912
 
913
 
913
    mcall   8, <5 + 25 * 0, 20>, <5, 20>, 'opn'+40000000h
914
    mcall   SF_DEFINE_BUTTON, <5 + 25 * 0, 20>, <5, 20>, 'opn'+40000000h
914
    mcall   , <10 + 25 * 1, 20>, , 'bck'+40000000h
915
    mcall   , <10 + 25 * 1, 20>, , 'bck'+40000000h
915
    mcall   , <10 + 25 * 2, 20>, , 'fwd'+40000000h
916
    mcall   , <10 + 25 * 2, 20>, , 'fwd'+40000000h
916
    mcall   , <15 + 25 * 3, 20>, , 'bgr'+40000000h
917
    mcall   , <15 + 25 * 3, 20>, , 'bgr'+40000000h
917
    mcall   , <15 + 25 * 4, 20>, , 'sld'+40000000h
918
    mcall   , <15 + 25 * 4, 20>, , 'sld'+40000000h
Line 929... Line 930...
929
    add ebx, 25 * 65536
930
    add ebx, 25 * 65536
930
    mcall   , , , 'flb'+40000000h
931
    mcall   , , , 'flb'+40000000h
Line 931... Line 932...
931
 
932
 
Line 932... Line 933...
932
    mov ebp, (numimages-1)*20
933
    mov ebp, (numimages-1)*20
933
 
934
 
934
    mcall   65, buttons+openbtn*20, <20, 20>, <5 + 25 * 0, 5>, 8, palette
935
    mcall   SF_PUT_IMAGE_EXT, buttons+openbtn*20, <20, 20>, <5 + 25 * 0, 5>, 8, palette
935
    mcall   , buttons+backbtn*20,    , <10 + 25 * 1, 5>
936
    mcall   , buttons+backbtn*20,    , <10 + 25 * 1, 5>
936
    mcall   , buttons+forwardbtn*20, , <10 + 25 * 2, 5>
937
    mcall   , buttons+forwardbtn*20, , <10 + 25 * 2, 5>
937
    mcall   , buttons+bgrbtn*20,     , <15 + 25 * 3, 5>
938
    mcall   , buttons+bgrbtn*20,     , <15 + 25 * 3, 5>
Line 955... Line 956...
955
 
956
 
956
.decorations_done:
957
.decorations_done:
Line 957... Line 958...
957
    call    draw_cur_frame
958
    call    draw_cur_frame
958
 
959
 
Line 959... Line 960...
959
.nodraw:
960
.nodraw:
Line 960... Line 961...
960
    mcall   12, 2
961
    mcall   SF_REDRAW, SSF_END_DRAW
961
 
962