2013-05-28 23:10:21 +02:00
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
;; ;;
|
2017-09-17 02:13:55 +02:00
|
|
|
;; Copyright (C) KolibriOS team 2014-2017. All rights reserved. ;;
|
2013-05-28 23:10:21 +02:00
|
|
|
;; Distributed under terms of the GNU General Public License ;;
|
|
|
|
;; ;;
|
|
|
|
;; downloader.asm - HTTP client for KolibriOS ;;
|
|
|
|
;; ;;
|
2015-03-20 22:08:39 +01:00
|
|
|
;; hidnplayr@kolibrios.org ;;
|
2013-05-28 23:10:21 +02:00
|
|
|
;; ;;
|
|
|
|
;; GNU GENERAL PUBLIC LICENSE ;;
|
|
|
|
;; Version 2, June 1991 ;;
|
|
|
|
;; ;;
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
URLMAXLEN = 65535
|
2013-05-28 23:10:21 +02:00
|
|
|
|
|
|
|
__DEBUG__ = 1
|
2013-06-07 19:26:03 +02:00
|
|
|
__DEBUG_LEVEL__ = 1
|
2013-05-28 23:10:21 +02:00
|
|
|
|
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
format binary as ""
|
2013-05-28 23:10:21 +02:00
|
|
|
use32
|
|
|
|
org 0x0
|
|
|
|
|
|
|
|
db 'MENUET01' ; header
|
|
|
|
dd 0x01 ; header version
|
|
|
|
dd START ; entry point
|
|
|
|
dd IM_END ; image size
|
2013-06-08 00:44:40 +02:00
|
|
|
dd I_END+0x1000 ; required memory
|
|
|
|
dd I_END+0x1000 ; esp
|
2015-03-20 22:08:39 +01:00
|
|
|
dd url
|
2013-05-28 23:10:21 +02:00
|
|
|
dd 0x0 ; I_Path
|
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
|
2013-06-07 19:26:03 +02:00
|
|
|
include '../../macros.inc'
|
|
|
|
include '../../proc32.inc'
|
|
|
|
include '../../dll.inc'
|
|
|
|
include '../../debug-fdo.inc'
|
2015-03-20 22:08:39 +01:00
|
|
|
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
|
|
|
|
include '../../develop/libraries/http/http.inc'
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
virtual at 0
|
|
|
|
http_msg http_msg
|
|
|
|
end virtual
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
|
|
|
|
START:
|
2013-05-28 23:10:21 +02:00
|
|
|
mcall 68, 11 ; init heap so we can allocate memory dynamically
|
|
|
|
|
|
|
|
; load libraries
|
|
|
|
stdcall dll.Load, @IMPORT
|
|
|
|
test eax, eax
|
2015-03-21 20:30:57 +01:00
|
|
|
jnz mainloop.exit
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
; wanted events
|
|
|
|
mcall 40, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
; prepare filename buffers
|
|
|
|
mov edi, fname_buf
|
|
|
|
mov esi, download_file_path
|
|
|
|
@@:
|
2013-06-08 00:44:40 +02:00
|
|
|
lodsb
|
|
|
|
stosb
|
2015-03-20 22:08:39 +01:00
|
|
|
test al, al
|
|
|
|
jnz @r
|
2013-06-08 00:44:40 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
; Initialise OpenDialog
|
|
|
|
invoke OpenDialog_Init, OpenDialog_data
|
2013-06-08 00:44:40 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
; If user provided parameters, start download right away!
|
|
|
|
cmp byte[url], 0
|
2017-09-17 02:13:55 +02:00
|
|
|
jne display_url_and_download
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
mov [OpenDialog_data.draw_window], draw_window
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2013-06-08 00:44:40 +02:00
|
|
|
redraw:
|
2013-05-28 23:10:21 +02:00
|
|
|
call draw_window
|
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
mainloop:
|
2013-05-29 14:10:37 +02:00
|
|
|
mcall 10 ; wait here for event
|
2013-06-08 00:44:40 +02:00
|
|
|
cmp eax, EV_REDRAW
|
|
|
|
je redraw
|
|
|
|
cmp eax, EV_KEY
|
2015-03-20 22:08:39 +01:00
|
|
|
je .key
|
2013-06-08 00:44:40 +02:00
|
|
|
cmp eax, EV_BUTTON
|
2015-03-20 22:08:39 +01:00
|
|
|
je .button
|
2013-06-08 00:44:40 +02:00
|
|
|
cmp eax, EV_MOUSE
|
2015-03-20 22:08:39 +01:00
|
|
|
je .mouse
|
|
|
|
jmp mainloop
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
.key:
|
2013-05-28 23:10:21 +02:00
|
|
|
mcall 2 ; read key
|
2015-03-20 22:08:39 +01:00
|
|
|
invoke edit_box_key, edit1
|
2013-05-29 14:10:37 +02:00
|
|
|
cmp ax, 13 shl 8
|
|
|
|
je download
|
2015-03-20 22:08:39 +01:00
|
|
|
jmp mainloop
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
.button:
|
2013-05-28 23:10:21 +02:00
|
|
|
mcall 17 ; get id
|
|
|
|
cmp ah, 1 ; button id=1 ?
|
2015-03-21 20:30:57 +01:00
|
|
|
je .exit
|
2013-05-29 14:10:37 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
cmp [btn_text], sz_download
|
|
|
|
je download
|
2013-05-29 14:10:37 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
cmp [btn_text], sz_open
|
|
|
|
je open_file
|
2013-05-29 14:10:37 +02:00
|
|
|
|
2015-03-21 20:30:57 +01:00
|
|
|
.exit:
|
|
|
|
mcall -1 ; exit
|
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
.mouse:
|
|
|
|
invoke edit_box_mouse, edit1
|
|
|
|
jmp mainloop
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-21 20:30:57 +01:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
open_file:
|
2015-03-21 20:30:57 +01:00
|
|
|
mcall 70, fileopen
|
2015-03-20 22:08:39 +01:00
|
|
|
jmp mainloop
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2017-09-17 02:13:55 +02:00
|
|
|
display_url_and_download:
|
|
|
|
xor al, al
|
|
|
|
mov ecx, 4096
|
|
|
|
mov edi, url
|
|
|
|
repne scasb
|
|
|
|
sub edi, url+1
|
|
|
|
mov [edit1.size], edi
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
download:
|
|
|
|
; Extract the filename from URL
|
|
|
|
mov edi, url
|
|
|
|
xor al, al
|
|
|
|
mov ecx, URLMAXLEN
|
|
|
|
repne scasb
|
2013-05-28 23:10:21 +02:00
|
|
|
mov esi, edi
|
2015-03-20 22:08:39 +01:00
|
|
|
dec esi
|
|
|
|
dec esi
|
|
|
|
std
|
|
|
|
.loop:
|
|
|
|
lodsb
|
|
|
|
cmp al, '/'
|
2013-05-28 23:10:21 +02:00
|
|
|
je .done
|
2015-03-20 22:08:39 +01:00
|
|
|
test al, al
|
|
|
|
jnz .loop
|
2013-06-08 00:44:40 +02:00
|
|
|
.done:
|
2015-03-20 22:08:39 +01:00
|
|
|
cld
|
|
|
|
mov ecx, edi
|
|
|
|
sub ecx, esi
|
2013-05-28 23:10:21 +02:00
|
|
|
inc esi
|
|
|
|
inc esi
|
2015-03-20 22:08:39 +01:00
|
|
|
mov edi, filename_area
|
|
|
|
rep movsb
|
2013-06-08 00:44:40 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
; invoke OpenDialog
|
|
|
|
invoke OpenDialog_Start, OpenDialog_data
|
|
|
|
mcall 40, EVM_REDRAW + EVM_BUTTON + EVM_STACK
|
|
|
|
call draw_window
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-21 20:30:57 +01:00
|
|
|
; Create the local file
|
2015-03-20 22:08:39 +01:00
|
|
|
mov [fileinfo], 2 ; create/write to file
|
|
|
|
xor eax, eax
|
|
|
|
mov [fileinfo.offset], eax
|
|
|
|
mov [fileinfo.offset+4], eax
|
|
|
|
mov [fileinfo.size], eax
|
|
|
|
mcall 70, fileinfo
|
2014-01-08 19:44:09 +01:00
|
|
|
test eax, eax
|
2015-03-21 20:30:57 +01:00
|
|
|
jnz create_error
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-21 20:30:57 +01:00
|
|
|
; Start the download
|
2015-03-20 22:08:39 +01:00
|
|
|
invoke HTTP_get, url, 0, FLAG_STREAM or FLAG_REUSE_BUFFER, 0
|
|
|
|
test eax, eax
|
2015-03-21 20:30:57 +01:00
|
|
|
jz get_error
|
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
mov [identifier], eax
|
|
|
|
mov [offset], 0
|
|
|
|
mov [btn_text], sz_cancel
|
2015-03-21 20:30:57 +01:00
|
|
|
mov [status], sz_downloading
|
2015-03-20 22:08:39 +01:00
|
|
|
or [edit1.flags], ed_figure_only
|
2015-03-21 20:30:57 +01:00
|
|
|
and [edit1.flags], not ed_focus
|
|
|
|
push [sc.work]
|
|
|
|
pop [edit1.color]
|
2015-03-20 22:08:39 +01:00
|
|
|
call draw_window
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-21 20:30:57 +01:00
|
|
|
jmp download_loop
|
|
|
|
|
|
|
|
get_error:
|
|
|
|
mov [btn_text], sz_exit
|
|
|
|
mov [status], sz_err_http
|
|
|
|
jmp redraw
|
|
|
|
|
|
|
|
create_error:
|
|
|
|
mov [btn_text], sz_exit
|
|
|
|
mov [status], sz_err_create
|
|
|
|
jmp redraw
|
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
download_loop:
|
|
|
|
mcall 10
|
|
|
|
cmp eax, EV_REDRAW
|
|
|
|
je .redraw
|
|
|
|
cmp eax, EV_BUTTON
|
|
|
|
je .button
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
invoke HTTP_receive, [identifier]
|
|
|
|
test eax, eax
|
2015-03-21 20:30:57 +01:00
|
|
|
jz got_data
|
2015-03-20 22:08:39 +01:00
|
|
|
jmp download_loop
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
.redraw:
|
|
|
|
call draw_window
|
|
|
|
jmp download_loop
|
|
|
|
|
|
|
|
.button:
|
|
|
|
jmp http_free
|
|
|
|
|
2015-03-21 20:30:57 +01:00
|
|
|
got_data:
|
2015-03-20 22:08:39 +01:00
|
|
|
mov ebp, [identifier]
|
|
|
|
test [ebp + http_msg.flags], 0xffff0000 ; error?
|
2015-03-21 20:30:57 +01:00
|
|
|
jnz http_error
|
|
|
|
|
|
|
|
cmp [fileinfo], 3 ; Did we write before?
|
|
|
|
je .write
|
|
|
|
|
|
|
|
test [ebp + http_msg.flags], FLAG_CONTENT_LENGTH
|
|
|
|
jz .first_write
|
2015-03-20 22:08:39 +01:00
|
|
|
|
|
|
|
mov eax, [ebp + http_msg.content_length]
|
2015-03-21 20:30:57 +01:00
|
|
|
mov [pb.max], eax
|
|
|
|
|
|
|
|
DEBUGF 1, "new file size=%u\n", eax
|
|
|
|
mov [fileinfo], 4 ; set end of file
|
2015-03-20 22:08:39 +01:00
|
|
|
mov [fileinfo.offset], eax ; new file size
|
|
|
|
mcall 70, fileinfo
|
2015-03-21 20:30:57 +01:00
|
|
|
test eax, eax
|
|
|
|
jnz write_error
|
|
|
|
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-21 20:30:57 +01:00
|
|
|
.first_write:
|
2015-03-20 22:08:39 +01:00
|
|
|
mov [fileinfo], 3 ; write to existing file
|
2015-03-21 20:30:57 +01:00
|
|
|
.write:
|
2015-03-20 22:08:39 +01:00
|
|
|
mov ecx, [ebp + http_msg.content_received]
|
|
|
|
sub ecx, [offset]
|
2017-10-14 00:17:40 +02:00
|
|
|
jz .no_data ; more then 0 data bytes?
|
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
mov [fileinfo.size], ecx
|
|
|
|
mov eax, [ebp + http_msg.content_ptr]
|
|
|
|
mov [fileinfo.buffer], eax
|
|
|
|
mov ebx, [offset]
|
|
|
|
mov [fileinfo.offset], ebx
|
|
|
|
DEBUGF 1, "Writing to disk: size=%u offset=%u\n", ecx, ebx
|
|
|
|
mcall 70, fileinfo
|
2015-03-21 20:30:57 +01:00
|
|
|
test eax, eax ; check error code
|
|
|
|
jnz write_error
|
|
|
|
cmp ebx, ecx ; check if all bytes were written to disk
|
|
|
|
jne write_error
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
mov eax, [ebp + http_msg.content_received]
|
|
|
|
mov [offset], eax
|
2015-03-21 20:30:57 +01:00
|
|
|
mov [pb.value], eax
|
|
|
|
|
|
|
|
invoke progressbar_draw, pb
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2017-10-14 00:17:40 +02:00
|
|
|
.no_data:
|
2015-03-20 22:08:39 +01:00
|
|
|
test [ebp + http_msg.flags], FLAG_GOT_ALL_DATA
|
|
|
|
jz download_loop
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-21 20:30:57 +01:00
|
|
|
; Download completed successfully
|
|
|
|
mov [status], sz_complete
|
2015-03-20 22:08:39 +01:00
|
|
|
mov [pb.progress_color], 0x0000c800 ; green
|
2015-03-21 20:30:57 +01:00
|
|
|
mov [btn_text], sz_open
|
|
|
|
jmp http_free
|
|
|
|
|
|
|
|
write_error:
|
|
|
|
mov [status], sz_err_full
|
|
|
|
mov [pb.progress_color], 0x00c80000 ; red
|
|
|
|
mov [btn_text], sz_exit
|
|
|
|
jmp http_free
|
|
|
|
|
|
|
|
http_error:
|
|
|
|
mov [status], sz_err_http
|
|
|
|
mov [pb.progress_color], 0x00c80000 ; red
|
|
|
|
mov [btn_text], sz_exit
|
|
|
|
; jmp http_free
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
http_free:
|
|
|
|
mcall 40, EVM_REDRAW + EVM_BUTTON
|
|
|
|
push [ebp + http_msg.content_received]
|
|
|
|
pop [pb.value]
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
mov ecx, [ebp + http_msg.content_ptr]
|
2013-05-28 23:10:21 +02:00
|
|
|
test ecx, ecx
|
2015-03-20 22:08:39 +01:00
|
|
|
jz @f
|
|
|
|
mcall 68, 13 ; free the buffer
|
|
|
|
@@:
|
|
|
|
invoke HTTP_free, [identifier] ; free headers and connection
|
2015-03-21 20:30:57 +01:00
|
|
|
jmp redraw
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
draw_window:
|
|
|
|
mcall 12, 1 ; start window draw
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
; get system colors
|
|
|
|
mcall 48, 3, sc, 40
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
; draw window
|
2013-05-28 23:10:21 +02:00
|
|
|
mov edx, [sc.work]
|
|
|
|
or edx, 0x34000000
|
2016-11-30 18:05:47 +01:00
|
|
|
mcall 0, <50, 420>, <350, 120>, , 0, title
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
; draw button
|
2016-11-30 18:05:47 +01:00
|
|
|
mcall 8, <320,75>, <50,24>, 22, [sc.work_button]
|
2015-03-20 22:08:39 +01:00
|
|
|
|
|
|
|
; draw button text
|
2013-05-28 23:10:21 +02:00
|
|
|
mov ecx, [sc.work_button_text]
|
2016-11-30 18:05:47 +01:00
|
|
|
or ecx, 90000000h
|
|
|
|
mcall 4, <325,56>, , [btn_text]
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-21 20:30:57 +01:00
|
|
|
; draw status text
|
|
|
|
mov ecx, [sc.work_text]
|
2016-11-30 18:05:47 +01:00
|
|
|
or ecx, 90000000h
|
|
|
|
mcall 4, <10,70>, , [status]
|
2015-03-21 20:30:57 +01:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
; draw editbox
|
|
|
|
edit_boxes_set_sys_color edit1, editboxes_end, sc
|
|
|
|
invoke edit_box_draw, edit1
|
2013-06-08 00:44:40 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
cmp [identifier], 0
|
|
|
|
je @f
|
|
|
|
; draw progressbar
|
|
|
|
invoke progressbar_draw, pb
|
|
|
|
@@:
|
|
|
|
mcall 12, 2 ; end window draw
|
2013-05-29 14:10:37 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
dont_draw:
|
|
|
|
ret
|
|
|
|
|
|
|
|
;---------------------------------------------------------------------
|
2013-05-28 23:10:21 +02:00
|
|
|
; Data area
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
align 4
|
|
|
|
@IMPORT:
|
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
library lib_http, 'http.obj', \
|
|
|
|
box_lib, 'box_lib.obj', \
|
|
|
|
proc_lib, 'proc_lib.obj'
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
import lib_http, \
|
|
|
|
HTTP_get, 'get', \
|
|
|
|
HTTP_receive, 'receive', \
|
|
|
|
HTTP_free, 'free'
|
2013-05-28 23:10:21 +02:00
|
|
|
|
|
|
|
import box_lib, \
|
2022-01-03 22:03:06 +01:00
|
|
|
edit_box_draw, 'edit_box_draw', \
|
2015-03-20 22:08:39 +01:00
|
|
|
edit_box_key, 'edit_box_key', \
|
|
|
|
edit_box_mouse, 'edit_box_mouse', \
|
|
|
|
progressbar_draw, 'progressbar_draw', \
|
|
|
|
progressbar_prog, 'progressbar_progress'
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
import proc_lib, \
|
|
|
|
OpenDialog_Init, 'OpenDialog_init', \
|
|
|
|
OpenDialog_Start, 'OpenDialog_start'
|
2013-05-28 23:10:21 +02:00
|
|
|
|
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
fileinfo dd 2
|
|
|
|
.offset dd 0, 0
|
|
|
|
.size dd 0
|
|
|
|
.buffer dd 0
|
|
|
|
db 0
|
|
|
|
dd fname_buf
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-21 20:30:57 +01:00
|
|
|
fileopen dd 7
|
|
|
|
dd 0 ; flags
|
|
|
|
dd fname_buf ; parameters
|
|
|
|
dd 0 ; reserved
|
|
|
|
dd 0 ; reserved
|
|
|
|
db "/sys/@open", 0 ; path
|
|
|
|
|
2016-11-30 18:05:47 +01:00
|
|
|
edit1 edit_box 400, 5, 10, 0xffffff, 0x0000ff, 0x0080ff, 0x000000, 0x90000000, URLMAXLEN, url, mouse_dd, ed_focus+ed_always_focus, 0, 0
|
2013-05-28 23:10:21 +02:00
|
|
|
editboxes_end:
|
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
identifier dd 0
|
|
|
|
btn_text dd sz_download
|
2015-03-21 20:30:57 +01:00
|
|
|
status dd sz_null
|
2015-03-20 22:08:39 +01:00
|
|
|
sz_download db 'Download', 0
|
|
|
|
sz_cancel db ' Cancel ', 0
|
|
|
|
sz_open db ' Open ', 0
|
2015-03-21 20:30:57 +01:00
|
|
|
sz_exit db ' Exit ', 0
|
|
|
|
|
|
|
|
sz_null db 0
|
|
|
|
sz_downloading db 'Downloading..', 0
|
|
|
|
sz_complete db 'Download completed', 0
|
|
|
|
sz_err_create db 'Could not create the local file!', 0
|
|
|
|
sz_err_full db 'Disk full!', 0
|
|
|
|
sz_err_http db 'HTTP error!', 0
|
2013-05-28 23:10:21 +02:00
|
|
|
title db 'HTTP Downloader', 0
|
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
OpenDialog_data:
|
|
|
|
.type dd 1 ; Save
|
|
|
|
.procinfo dd procinfo
|
|
|
|
.com_area_name dd communication_area_name
|
|
|
|
.com_area dd 0
|
|
|
|
.opendir_path dd temp_dir_path
|
|
|
|
.dir_default_path dd communication_area_default_path
|
|
|
|
.start_path dd open_dialog_path
|
|
|
|
.draw_window dd dont_draw
|
|
|
|
.status dd 0
|
|
|
|
.openfile_patch dd fname_buf
|
|
|
|
.filename_area dd filename_area
|
|
|
|
.filter_area dd filter
|
|
|
|
.x:
|
|
|
|
.x_size dw 420 ; Window X size
|
|
|
|
.x_start dw 200 ; Window X position
|
|
|
|
.y:
|
|
|
|
.y_size dw 320 ; Window y size
|
2016-11-30 18:05:47 +01:00
|
|
|
.y_start dw 140 ; Window Y position
|
2015-03-20 22:08:39 +01:00
|
|
|
|
|
|
|
communication_area_name db 'FFFFFFFF_open_dialog',0
|
|
|
|
open_dialog_path db '/sys/File Managers/opendial',0
|
|
|
|
communication_area_default_path db '/sys',0
|
|
|
|
|
|
|
|
filter:
|
|
|
|
dd 0
|
|
|
|
db 0
|
|
|
|
|
|
|
|
pb:
|
|
|
|
.value dd 0
|
|
|
|
.left dd 5
|
2016-11-30 18:05:47 +01:00
|
|
|
.top dd 45
|
2015-03-20 22:08:39 +01:00
|
|
|
.width dd 300
|
|
|
|
.height dd 16
|
|
|
|
.style dd 1
|
|
|
|
.min dd 0
|
|
|
|
.max dd 0
|
|
|
|
.back_color dd 0xefefef
|
|
|
|
.progress_color dd 0xc8c8c8
|
|
|
|
.frame_color dd 0x94aece
|
|
|
|
.frame_color2 dd 0xffffff
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
include_debug_strings
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
download_file_path db '/tmp0/1/', 0
|
2013-05-28 23:10:21 +02:00
|
|
|
|
|
|
|
IM_END:
|
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
url rb URLMAXLEN
|
|
|
|
sc system_colors
|
|
|
|
offset dd ?
|
|
|
|
mouse_dd dd ?
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
filename_area rb 256
|
|
|
|
temp_dir_path rb 4096
|
|
|
|
procinfo rb 1024
|
|
|
|
fname_buf rb 4096
|
|
|
|
text_work_area rb 1024
|
2013-05-28 23:10:21 +02:00
|
|
|
|
2015-03-20 22:08:39 +01:00
|
|
|
I_END:
|