Subversion Repositories Kolibri OS

Rev

Rev 4243 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4243 Rev 5094
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                                 ;;
2
;;                                                                 ;;
3
;; Copyright (C) KolibriOS team 2009-2013. All rights reserved.    ;;
3
;; Copyright (C) KolibriOS team 2009-2013. All rights reserved.    ;;
4
;; Distributed under terms of the GNU General Public License       ;;
4
;; Distributed under terms of the GNU General Public License       ;;
5
;;                                                                 ;;
5
;;                                                                 ;;
6
;;  downloader.asm - HTTP client for KolibriOS                     ;;
6
;;  downloader.asm - HTTP client for KolibriOS                     ;;
7
;;                                                                 ;;
7
;;                                                                 ;;
8
;;                                                                 ;;
8
;;                                                                 ;;
9
;;          GNU GENERAL PUBLIC LICENSE                             ;;
9
;;          GNU GENERAL PUBLIC LICENSE                             ;;
10
;;             Version 2, June 1991                                ;;
10
;;             Version 2, June 1991                                ;;
11
;;                                                                 ;;
11
;;                                                                 ;;
12
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13
 
13
 
14
URLMAXLEN       = 1024
14
URLMAXLEN       = 1024
15
BUFFERSIZE      = 4096
15
BUFFERSIZE      = 4096
16
 
16
 
17
__DEBUG__       = 1
17
__DEBUG__       = 1
18
__DEBUG_LEVEL__ = 1
18
__DEBUG_LEVEL__ = 1
19
 
19
 
20
format binary as ""
20
format binary as ""
21
;--------------------------------------
21
;--------------------------------------
22
frame_1:
22
frame_1:
23
  .x      = 5
23
  .x      = 5
24
  .y      = 10
24
  .y      = 10
25
  .width  = 350
25
  .width  = 350
26
  .height = 55
26
  .height = 55
27
;--------------------------------------  
27
;--------------------------------------  
28
frame_2:
28
frame_2:
29
  .x      = 5
29
  .x      = 5
30
  .y      = 75
30
  .y      = 75
31
  .width  = 350
31
  .width  = 350
32
  .height = 55
32
  .height = 55
33
;---------------------------------------------------------------------
33
;---------------------------------------------------------------------
34
use32
34
use32
35
        org     0x0
35
        org     0x0
36
 
36
 
37
        db      'MENUET01'      ; header
37
        db      'MENUET01'      ; header
38
        dd      0x01            ; header version
38
        dd      0x01            ; header version
39
        dd      START           ; entry point
39
        dd      START           ; entry point
40
        dd      IM_END          ; image size
40
        dd      IM_END          ; image size
41
        dd      I_END           ; required memory
41
        dd      I_END           ; required memory
42
        dd      stacktop        ; esp
42
        dd      stacktop        ; esp
43
        dd      params          ; I_PARAM
43
        dd      params          ; I_PARAM
44
        dd      0x0             ; I_Path
44
        dd      0x0             ; I_Path
45
;---------------------------------------------------------------------
45
;---------------------------------------------------------------------
46
include '../../../../macros.inc'
46
include '../../../../macros.inc'
47
include '../../../../proc32.inc'
47
include '../../../../proc32.inc'
48
include '../../../../dll.inc'
48
include '../../../../dll.inc'
49
include '../../../../debug-fdo.inc'
49
include '../../../../debug-fdo.inc'
50
include '../../box_lib/trunk/box_lib.mac'
50
include '../../box_lib/trunk/box_lib.mac'
51
include '../../http/http.inc'
51
include '../../http/http.inc'
52
 
52
 
53
virtual at 0
53
virtual at 0
54
        http_msg http_msg
54
        http_msg http_msg
55
end virtual
55
end virtual
56
;---------------------------------------------------------------------
56
;---------------------------------------------------------------------
57
START:
57
START:
58
 
58
 
59
        mcall   68, 11                  ; init heap so we can allocate memory dynamically
59
        mcall   68, 11                  ; init heap so we can allocate memory dynamically
60
 
60
 
61
; load libraries
61
; load libraries
62
        stdcall dll.Load, @IMPORT
62
        stdcall dll.Load, @IMPORT
63
        test    eax, eax
63
        test    eax, eax
64
        jnz     exit
64
        jnz     exit
65
;---------------------------------------------------------------------
65
;---------------------------------------------------------------------
66
	mov	edi,filename_area
66
	mov	edi,filename_area
67
	mov	esi,start_temp_file_name
67
	mov	esi,start_temp_file_name
68
	call	copy_file_name_path
68
	call	copy_file_name_path
69
 
69
 
70
	mov	edi,fname_buf
70
	mov	edi,fname_buf
71
	mov	esi,start_file_path
71
	mov	esi,start_file_path
72
	call	copy_file_name_path
72
	call	copy_file_name_path
73
 
73
 
74
;OpenDialog     initialisation
74
;OpenDialog     initialisation
75
        push    dword OpenDialog_data
75
        push    dword OpenDialog_data
76
        call    [OpenDialog_Init]
76
        call    [OpenDialog_Init]
77
 
77
 
78
; prepare for PathShow
78
; prepare for PathShow
79
        push    dword PathShow_data_1
79
        push    dword PathShow_data_1
80
        call    [PathShow_prepare]
80
        call    [PathShow_prepare]
81
;---------------------------------------------------------------------
81
;---------------------------------------------------------------------
82
; check parameters
82
; check parameters
83
        cmp     byte[params], 0         ; no parameters ?
83
        cmp     byte[params], 0         ; no parameters ?
84
        je      reset_events            ; load the GUI
84
        je      reset_events            ; load the GUI
85
 
85
 
86
        inc     [silently]
86
        inc     [silently]
87
 
87
 
88
download:
88
download:
89
	call	download_1
89
	call	download_1
90
 
90
 
91
        test    [silently], 0xff
91
        test    [silently], 0xff
92
        jnz     save
92
        jnz     save
93
 
93
 
94
reset_events:
94
reset_events:
95
        DEBUGF  1, "resetting events\n"
95
        DEBUGF  1, "resetting events\n"
96
 
96
 
97
; Report events
97
; Report events
98
; defaults + mouse
98
; defaults + mouse
99
        mcall   40,EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER
99
        mcall   40,EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER
100
;---------------------------------------------------------------------
100
;---------------------------------------------------------------------
101
redraw:
101
redraw:
102
        call    draw_window
102
        call    draw_window
103
 
103
 
104
still:
104
still:
105
;;        DEBUGF  1, "waiting for events\n"
105
;;        DEBUGF  1, "waiting for events\n"
106
 
106
 
107
        mcall   10      ; wait here for event
107
        mcall   10      ; wait here for event
108
 
108
 
109
        cmp     eax, EV_REDRAW
109
        cmp     eax, EV_REDRAW
110
        je      redraw
110
        je      redraw
111
 
111
 
112
        cmp     eax, EV_KEY
112
        cmp     eax, EV_KEY
113
        je      key
113
        je      key
114
 
114
 
115
        cmp     eax, EV_BUTTON
115
        cmp     eax, EV_BUTTON
116
        je      button
116
        je      button
117
        
117
        
118
        cmp     eax, EV_MOUSE
118
        cmp     eax, EV_MOUSE
119
        je      mouse
119
        je      mouse
120
 
120
 
121
        jmp     still
121
        jmp     still
122
;---------------------------------------------------------------------
122
;---------------------------------------------------------------------
123
key:
123
key:
124
        mcall   2       ; read key
124
        mcall   2       ; read key
125
 
125
 
126
        stdcall [edit_box_key], dword edit1
126
        stdcall [edit_box_key], dword edit1
127
 
127
 
128
        cmp     ax, 13 shl 8
128
        cmp     ax, 13 shl 8
129
        je      download
129
        je      download
130
        
130
        
131
        jmp     still
131
        jmp     still
132
;---------------------------------------------------------------------        
132
;---------------------------------------------------------------------        
133
button:
133
button:
134
 
134
 
135
        mcall   17      ; get id
135
        mcall   17      ; get id
136
 
136
 
137
        cmp     ah, 26
137
        cmp     ah, 26
138
        jne     @f
138
        jne     @f
139
; invoke OpenDialog
139
; invoke OpenDialog
140
        push    dword OpenDialog_data
140
        push    dword OpenDialog_data
141
        call    [OpenDialog_Start]
141
        call    [OpenDialog_Start]
142
        cmp     [OpenDialog_data.status],1
142
        cmp     [OpenDialog_data.status],1
143
        jne     still
143
        jne     still
144
 
144
 
145
; prepare for PathShow
145
; prepare for PathShow
146
        push    dword PathShow_data_1
146
        push    dword PathShow_data_1
147
        call    [PathShow_prepare]
147
        call    [PathShow_prepare]
148
        call    draw_window
148
        call    draw_window
149
        jmp     still
149
        jmp     still
150
@@:
150
@@:
151
        cmp     ah, 1   ; button id=1 ?
151
        cmp     ah, 1   ; button id=1 ?
152
        je      exit
152
        je      exit
153
 
153
 
154
	call	download_1
154
	call	download_1
155
        jmp     save
155
        jmp     save
156
;---------------------------------------------------------------------
156
;---------------------------------------------------------------------
157
mouse:
157
mouse:
158
        stdcall [edit_box_mouse], edit1
158
        stdcall [edit_box_mouse], edit1
159
        jmp     still
159
        jmp     still
160
;---------------------------------------------------------------------
160
;---------------------------------------------------------------------
161
exit:
161
exit:
162
        DEBUGF  1, "Exiting\n"
162
        DEBUGF  1, "Exiting\n"
163
        invoke  HTTP_free, [identifier] ; free buffer
163
        invoke  HTTP_free, [identifier] ; free buffer
164
fail:
164
fail:
165
        or      eax, -1 ; close this program
165
        or      eax, -1 ; close this program
166
        mcall
166
        mcall
167
;---------------------------------------------------------------------
167
;---------------------------------------------------------------------
168
download_1:
168
download_1:
169
        DEBUGF  1, "Starting download\n"
169
        DEBUGF  1, "Starting download\n"
170
 
170
 
171
        invoke  HTTP_get, params, 0
171
        invoke  HTTP_get, params, 0
172
        test    eax, eax
172
        test    eax, eax
173
        jz      fail
173
        jz      fail
174
        mov     [identifier], eax
174
        mov     [identifier], eax
175
 
175
 
176
  .loop:
176
  .loop:
177
        invoke  HTTP_process, [identifier]
177
        invoke  HTTP_process, [identifier]
178
        test    eax, eax
178
        test    eax, eax
179
        jnz     .loop
179
        jnz     .loop
180
	ret
180
	ret
181
;---------------------------------------------------------------------
181
;---------------------------------------------------------------------
182
save:
182
save:
183
        mov     ebp, [identifier]
183
        mov     ebp, [identifier]
184
        mov     eax, [ebp + http_msg.content_received]
184
        mov     eax, [ebp + http_msg.content_received]
185
        mov     [final_size], eax
185
        mov     [final_size], eax
186
        lea     ebx, [ebp + http_msg.data]
-
 
187
        add     ebx, [ebp + http_msg.header_length]
186
        mov     ebx, [ebp + http_msg.content_ptr]
188
        mov     [final_buffer], ebx
187
        mov     [final_buffer], ebx
189
        mcall   70, fileinfo
188
        mcall   70, fileinfo
190
 
189
 
191
        DEBUGF  1, "File saved\n"
190
        DEBUGF  1, "File saved\n"
192
 
191
 
193
        test    [silently], 0xff
192
        test    [silently], 0xff
194
        jnz     exit
193
        jnz     exit
195
 
194
 
196
        mov     ecx, [sc.work_text]
195
        mov     ecx, [sc.work_text]
197
        or      ecx, 0x80000000
196
        or      ecx, 0x80000000
198
        mcall   4, <10, frame_2.y+frame_2.height+7>, , download_complete
197
        mcall   4, <10, frame_2.y+frame_2.height+7>, , download_complete
199
 
198
 
200
        jmp     still
199
        jmp     still
201
;---------------------------------------------------------------------
200
;---------------------------------------------------------------------
202
copy_file_name_path:
201
copy_file_name_path:
203
	xor	eax,eax
202
	xor	eax,eax
204
	cld
203
	cld
205
@@:
204
@@:
206
	lodsb
205
	lodsb
207
	stosb
206
	stosb
208
	test	eax,eax
207
	test	eax,eax
209
	jnz	@r
208
	jnz	@r
210
	ret
209
	ret
211
;---------------------------------------------------------------------
210
;---------------------------------------------------------------------
212
;   *********************************************
211
;   *********************************************
213
;   *******  WINDOW DEFINITIONS AND DRAW ********
212
;   *******  WINDOW DEFINITIONS AND DRAW ********
214
;   *********************************************
213
;   *********************************************
215
 
214
 
216
draw_window:
215
draw_window:
217
 
216
 
218
        mcall   12, 1   ; start window draw
217
        mcall   12, 1   ; start window draw
219
;-----------------------------------
218
;-----------------------------------
220
; get system colors
219
; get system colors
221
        mcall   48, 3, sc, 40
220
        mcall   48, 3, sc, 40
222
;-----------------------------------
221
;-----------------------------------
223
; draw window
222
; draw window
224
        mov     edx, [sc.work]
223
        mov     edx, [sc.work]
225
        or      edx, 0x34000000
224
        or      edx, 0x34000000
226
        mcall   0, <50, 370>, <350, 170>, , 0, title
225
        mcall   0, <50, 370>, <350, 170>, , 0, title
227
;-----------------------------------
226
;-----------------------------------
228
; draw frames
227
; draw frames
229
	mov	[frame_data.x],dword frame_1.x shl 16+frame_1.width
228
	mov	[frame_data.x],dword frame_1.x shl 16+frame_1.width
230
	mov	[frame_data.y],dword frame_1.y shl 16+frame_1.height
229
	mov	[frame_data.y],dword frame_1.y shl 16+frame_1.height
231
	mov	[frame_data.text_pointer],dword select_addr_text
230
	mov	[frame_data.text_pointer],dword select_addr_text
232
	mov	eax,[sc.work]
231
	mov	eax,[sc.work]
233
	mov	[frame_data.font_backgr_color],eax
232
	mov	[frame_data.font_backgr_color],eax
234
	mov	eax,[sc.work_text]
233
	mov	eax,[sc.work_text]
235
	mov	[frame_data.font_color],eax
234
	mov	[frame_data.font_color],eax
236
	
235
	
237
	push	dword frame_data
236
	push	dword frame_data
238
	call	[Frame_draw]
237
	call	[Frame_draw]
239
;-----------------------------------
238
;-----------------------------------
240
	mov	[frame_data.x],dword frame_2.x shl 16+frame_2.width
239
	mov	[frame_data.x],dword frame_2.x shl 16+frame_2.width
241
	mov	[frame_data.y],dword frame_2.y shl 16+frame_2.height
240
	mov	[frame_data.y],dword frame_2.y shl 16+frame_2.height
242
	mov	[frame_data.text_pointer],dword select_path_text
241
	mov	[frame_data.text_pointer],dword select_path_text
243
 
242
 
244
	push	dword frame_data
243
	push	dword frame_data
245
	call	[Frame_draw]
244
	call	[Frame_draw]
246
;-----------------------------------
245
;-----------------------------------
247
; draw "url:" text
246
; draw "url:" text
248
        mov     ecx, [sc.work_text]
247
        mov     ecx, [sc.work_text]
249
        or      ecx, 80000000h
248
        or      ecx, 80000000h
250
        mcall   4, , , type_pls
249
        mcall   4, , , type_pls
251
;-----------------------------------
250
;-----------------------------------
252
; draw editbox
251
; draw editbox
253
        edit_boxes_set_sys_color edit1, editboxes_end, sc
252
        edit_boxes_set_sys_color edit1, editboxes_end, sc
254
        stdcall [edit_box_draw], edit1
253
        stdcall [edit_box_draw], edit1
255
;-----------------------------------
254
;-----------------------------------
256
; draw buttons
255
; draw buttons
257
        mcall   8,,,22,[sc.work_button] ; reload
256
        mcall   8,,,22,[sc.work_button] ; reload
258
        mcall   ,,, 24 ; stop
257
        mcall   ,,, 24 ; stop
259
	
258
	
260
        mcall   , ,,26 ; save
259
        mcall   , ,,26 ; save
261
;-----------------------------------
260
;-----------------------------------
262
; draw buttons text
261
; draw buttons text
263
        mov     ecx, [sc.work_button_text]
262
        mov     ecx, [sc.work_button_text]
264
        or      ecx, 80000000h
263
        or      ecx, 80000000h
265
        mcall   4, , , button_text.1
264
        mcall   4, , , button_text.1
266
        mcall   , , , button_text.2
265
        mcall   , , , button_text.2
267
        mcall   , , , button_text.3
266
        mcall   , , , button_text.3
268
	
267
	
269
        mcall   13,,,0xffffff
268
        mcall   13,,,0xffffff
270
        push    dword PathShow_data_1
269
        push    dword PathShow_data_1
271
        call    [PathShow_draw]
270
        call    [PathShow_draw]
272
	
271
	
273
        mcall   12, 2   ; end window redraw
272
        mcall   12, 2   ; end window redraw
274
 
273
 
275
        ret
274
        ret
276
;---------------------------------------------------------------------
275
;---------------------------------------------------------------------
277
; Data area
276
; Data area
278
;-----------------------------------------------------------------------------
277
;-----------------------------------------------------------------------------
279
align   4
278
align   4
280
@IMPORT:
279
@IMPORT:
281
 
280
 
282
library lib_http,       'http.obj', \
281
library lib_http,       'http.obj', \
283
        box_lib,        'box_lib.obj', \
282
        box_lib,        'box_lib.obj', \
284
        proc_lib,       'proc_lib.obj'
283
        proc_lib,       'proc_lib.obj'
285
 
284
 
286
import  lib_http, \
285
import  lib_http, \
287
        HTTP_get                , 'get' , \
286
        HTTP_get                , 'get' , \
288
        HTTP_process            , 'process'     ,\
287
        HTTP_process            , 'process'     ,\
289
        HTTP_free               , 'free'
288
        HTTP_free               , 'free'
290
 
289
 
291
import  box_lib, \
290
import  box_lib, \
292
        edit_box_draw,    'edit_box', \
291
        edit_box_draw,    'edit_box', \
293
        edit_box_key,     'edit_box_key', \
292
        edit_box_key,     'edit_box_key', \
294
        edit_box_mouse,   'edit_box_mouse', \
293
        edit_box_mouse,   'edit_box_mouse', \
295
        PathShow_prepare, 'PathShow_prepare', \
294
        PathShow_prepare, 'PathShow_prepare', \
296
        PathShow_draw,    'PathShow_draw', \
295
        PathShow_draw,    'PathShow_draw', \
297
        Frame_draw,       'frame_draw'
296
        Frame_draw,       'frame_draw'
298
 
297
 
299
import  proc_lib, \
298
import  proc_lib, \
300
        OpenDialog_Init,  'OpenDialog_init', \
299
        OpenDialog_Init,  'OpenDialog_init', \
301
        OpenDialog_Start, 'OpenDialog_start'
300
        OpenDialog_Start, 'OpenDialog_start'
302
;---------------------------------------------------------------------
301
;---------------------------------------------------------------------
303
fileinfo        dd 2, 0, 0
302
fileinfo        dd 2, 0, 0
304
final_size      dd 0
303
final_size      dd 0
305
final_buffer    dd 0
304
final_buffer    dd 0
306
                db 0
305
                db 0
307
                dd fname_buf
306
                dd fname_buf
308
;---------------------------------------------------------------------
307
;---------------------------------------------------------------------
309
 
308
 
310
mouse_dd        dd 0
309
mouse_dd        dd 0
311
edit1           edit_box 295, 48, (frame_1.y+10), 0xffffff, 0xff, 0x80ff, 0, 0x8000, URLMAXLEN, document_user, mouse_dd, ed_focus+ed_always_focus, 7, 7
310
edit1           edit_box 295, 48, (frame_1.y+10), 0xffffff, 0xff, 0x80ff, 0, 0x8000, URLMAXLEN, document_user, mouse_dd, ed_focus+ed_always_focus, 7, 7
312
editboxes_end:
311
editboxes_end:
313
 
312
 
314
;---------------------------------------------------------------------
313
;---------------------------------------------------------------------
315
 
314
 
316
include_debug_strings
315
include_debug_strings
317
 
316
 
318
;---------------------------------------------------------------------
317
;---------------------------------------------------------------------
319
 
318
 
320
type_pls        db 'URL:', 0
319
type_pls        db 'URL:', 0
321
button_text:
320
button_text:
322
.1:             db 'DOWNLOAD',0
321
.1:             db 'DOWNLOAD',0
323
.2:             db 'STOP',0
322
.2:             db 'STOP',0
324
.3:             db 'SELECT', 0
323
.3:             db 'SELECT', 0
325
download_complete db 'FILE SAVED!', 0
324
download_complete db 'FILE SAVED!', 0
326
title           db 'HTTP Downloader', 0
325
title           db 'HTTP Downloader', 0
327
silently        db 0
326
silently        db 0
328
 
327
 
329
;---------------------------------------------------------------------
328
;---------------------------------------------------------------------
330
select_addr_text db ' NETWORK ADDRESS: ',0
329
select_addr_text db ' NETWORK ADDRESS: ',0
331
select_path_text db ' PATH TO SAVE FILE: ',0
330
select_path_text db ' PATH TO SAVE FILE: ',0
332
;---------------------------------------------------------------------
331
;---------------------------------------------------------------------
333
frame_data:
332
frame_data:
334
.type			dd 0 ;+0
333
.type			dd 0 ;+0
335
.x:
334
.x:
336
.x_size			dw 0 ;+4
335
.x_size			dw 0 ;+4
337
.x_start		dw 0 ;+6
336
.x_start		dw 0 ;+6
338
.y:
337
.y:
339
.y_size			dw 0 ;+8
338
.y_size			dw 0 ;+8
340
.y_start		dw 0 ;+10
339
.y_start		dw 0 ;+10
341
.ext_fr_col		dd 0x0 ;+12
340
.ext_fr_col		dd 0x0 ;+12
342
.int_fr_col		dd 0xffffff ;+16
341
.int_fr_col		dd 0xffffff ;+16
343
.draw_text_flag		dd 1 ;+20
342
.draw_text_flag		dd 1 ;+20
344
.text_pointer		dd 0 ;+24
343
.text_pointer		dd 0 ;+24
345
.text_position		dd 0 ;+28
344
.text_position		dd 0 ;+28
346
.font_number		dd 0 ;+32
345
.font_number		dd 0 ;+32
347
.font_size_y		dd 9 ;+36
346
.font_size_y		dd 9 ;+36
348
.font_color		dd 0x0 ;+40
347
.font_color		dd 0x0 ;+40
349
.font_backgr_color	dd 0xffffff ;+44
348
.font_backgr_color	dd 0xffffff ;+44
350
;---------------------------------------------------------------------
349
;---------------------------------------------------------------------
351
PathShow_data_1:
350
PathShow_data_1:
352
.type                   dd 0    ;+0
351
.type                   dd 0    ;+0
353
.start_y                dw frame_2.y+14   ;+4
352
.start_y                dw frame_2.y+14   ;+4
354
.start_x                dw frame_2.x+20   ;+6
353
.start_x                dw frame_2.x+20   ;+6
355
.font_size_x            dw 6    ;+8     ; 6 - for font 0, 8 - for font 1
354
.font_size_x            dw 6    ;+8     ; 6 - for font 0, 8 - for font 1
356
.area_size_x            dw frame_2.width-35  ;+10
355
.area_size_x            dw frame_2.width-35  ;+10
357
.font_number            dd 0    ;+12    ; 0 - monospace, 1 - variable
356
.font_number            dd 0    ;+12    ; 0 - monospace, 1 - variable
358
.background_flag        dd 0    ;+16
357
.background_flag        dd 0    ;+16
359
.font_color             dd 0    ;+20
358
.font_color             dd 0    ;+20
360
.background_color       dd 0    ;+24
359
.background_color       dd 0    ;+24
361
.text_pointer           dd fname_buf    ;+28
360
.text_pointer           dd fname_buf    ;+28
362
.work_area_pointer      dd text_work_area       ;+32
361
.work_area_pointer      dd text_work_area       ;+32
363
.temp_text_length       dd 0    ;+36
362
.temp_text_length       dd 0    ;+36
364
;---------------------------------------------------------------------
363
;---------------------------------------------------------------------
365
OpenDialog_data:
364
OpenDialog_data:
366
.type                   dd 1    ; Save
365
.type                   dd 1    ; Save
367
.procinfo               dd procinfo     ;+4
366
.procinfo               dd procinfo     ;+4
368
.com_area_name          dd communication_area_name      ;+8
367
.com_area_name          dd communication_area_name      ;+8
369
.com_area               dd 0    ;+12
368
.com_area               dd 0    ;+12
370
.opendir_path           dd temp_dir_path        ;+16
369
.opendir_path           dd temp_dir_path        ;+16
371
.dir_default_path       dd communication_area_default_path      ;+20
370
.dir_default_path       dd communication_area_default_path      ;+20
372
.start_path             dd open_dialog_path     ;+24
371
.start_path             dd open_dialog_path     ;+24
373
.draw_window            dd draw_window  ;+28
372
.draw_window            dd draw_window  ;+28
374
.status                 dd 0    ;+32
373
.status                 dd 0    ;+32
375
.openfile_pach          dd fname_buf    ;+36
374
.openfile_pach          dd fname_buf    ;+36
376
.filename_area          dd filename_area        ;+40
375
.filename_area          dd filename_area        ;+40
377
.filter_area            dd Filter
376
.filter_area            dd Filter
378
.x:
377
.x:
379
.x_size                 dw 420 ;+48 ; Window X size
378
.x_size                 dw 420 ;+48 ; Window X size
380
.x_start                dw 200 ;+50 ; Window X position
379
.x_start                dw 200 ;+50 ; Window X position
381
.y:
380
.y:
382
.y_size                 dw 320 ;+52 ; Window y size
381
.y_size                 dw 320 ;+52 ; Window y size
383
.y_start                dw 120 ;+54 ; Window Y position
382
.y_start                dw 120 ;+54 ; Window Y position
384
 
383
 
385
communication_area_name:
384
communication_area_name:
386
        db 'FFFFFFFF_open_dialog',0
385
        db 'FFFFFFFF_open_dialog',0
387
open_dialog_path:
386
open_dialog_path:
388
    db '/sys/File Managers/opendial',0
387
    db '/sys/File Managers/opendial',0
389
communication_area_default_path:
388
communication_area_default_path:
390
        db '/sys',0
389
        db '/sys',0
391
 
390
 
392
Filter:
391
Filter:
393
dd      Filter.end - Filter
392
dd      Filter.end - Filter
394
.1:
393
.1:
395
db      'IMG',0
394
db      'IMG',0
396
db      'IMA',0
395
db      'IMA',0
397
.end:
396
.end:
398
db      0
397
db      0
399
 
398
 
400
start_temp_file_name:   db 'some.garbage',0
399
start_temp_file_name:   db 'some.garbage',0
401
 
400
 
402
start_file_path:  db '/sys/.download', 0
401
start_file_path:  db '/sys/.download', 0
403
;---------------------------------------------------------------------
402
;---------------------------------------------------------------------
404
document_user   db 'http://'
403
document_user   db 'http://'
405
;---------------------------------------------------------------------
404
;---------------------------------------------------------------------
406
IM_END:
405
IM_END:
407
;---------------------------------------------------------------------
406
;---------------------------------------------------------------------
408
params          rb URLMAXLEN
407
params          rb URLMAXLEN
409
;---------------------------------------------------------------------
408
;---------------------------------------------------------------------
410
                sc system_colors
409
                sc system_colors
411
;---------------------------------------------------------------------
410
;---------------------------------------------------------------------
412
identifier      dd ?
411
identifier      dd ?
413
;---------------------------------------------------------------------
412
;---------------------------------------------------------------------
414
filename_area:
413
filename_area:
415
                rb 256
414
                rb 256
416
;---------------------------------------------------------------------
415
;---------------------------------------------------------------------
417
temp_dir_path:
416
temp_dir_path:
418
                rb 4096
417
                rb 4096
419
;---------------------------------------------------------------------
418
;---------------------------------------------------------------------
420
procinfo:
419
procinfo:
421
                rb 1024
420
                rb 1024
422
;---------------------------------------------------------------------
421
;---------------------------------------------------------------------
423
fname_buf:
422
fname_buf:
424
                rb 4096
423
                rb 4096
425
;---------------------------------------------------------------------
424
;---------------------------------------------------------------------
426
text_work_area:
425
text_work_area:
427
                rb 1024
426
                rb 1024
428
;---------------------------------------------------------------------
427
;---------------------------------------------------------------------
429
                rb 4096
428
                rb 4096
430
stacktop:
429
stacktop:
431
;---------------------------------------------------------------------
430
;---------------------------------------------------------------------
432
I_END:
431
I_END:
433
;---------------------------------------------------------------------
432
;---------------------------------------------------------------------