Rev 6730 | Rev 6738 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6730 | Rev 6731 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | #include "..\lib\patterns\http_downloader.h" |
28 | #include "..\lib\patterns\http_downloader.h" |
Line 29... | Line 29... | ||
29 | 29 | ||
Line 30... | Line 30... | ||
30 | char homepage[] = FROM "html\\homepage.htm""\0"; |
30 | char homepage[] = FROM "html\\homepage.htm""\0"; |
31 | 31 | ||
32 | #ifdef LANG_RUS |
32 | #ifdef LANG_RUS |
33 | char version[]="¥ªáâ®¢ë© ¡à 㧥à 1.52"; |
33 | char version[]="¥ªáâ®¢ë© ¡à 㧥à 1.53"; |
34 | ?define IMAGES_CACHE_CLEARED "íè ª à⨮ª ®ç¨é¥" |
34 | ?define IMAGES_CACHE_CLEARED "íè ª à⨮ª ®ç¨é¥" |
35 | ?define T_LAST_SLIDE "â® ¯®á«¥¤¨© á« ©¤" |
35 | ?define T_LAST_SLIDE "â® ¯®á«¥¤¨© á« ©¤" |
36 | char loading[] = " £à㧪 áâà ¨æë... |
36 | char loading[] = " £à㧪 áâà ¨æë... |
Line 41... | Line 41... | ||
41 | ¥¤ ªâ¨à®¢ âì ¨á室¨ª |
41 | ¥¤ ªâ¨à®¢ âì ¨á室¨ª |
42 | áâ®à¨ï |
42 | áâ®à¨ï |
43 | ç¨áâ¨âì ªíè ª à⨮ª |
43 | ç¨áâ¨âì ªíè ª à⨮ª |
44 | ¥¥¤¦¥à § £à㧮ª"; |
44 | ¥¥¤¦¥à § £à㧮ª"; |
45 | #else |
45 | #else |
46 | char version[]="Text-based Browser 1.52"; |
46 | char version[]="Text-based Browser 1.53"; |
47 | ?define IMAGES_CACHE_CLEARED "Images cache cleared" |
47 | ?define IMAGES_CACHE_CLEARED "Images cache cleared" |
48 | ?define T_LAST_SLIDE "This slide is the last" |
48 | ?define T_LAST_SLIDE "This slide is the last" |
49 | char loading[] = "Loading... |
49 | char loading[] = "Loading... |
50 | char page_not_found[] = FROM "html\\page_not_found_en.htm""\0"; |
50 | char page_not_found[] = FROM "html\\page_not_found_en.htm""\0"; |
51 | char accept_language[]= "Accept-Language: en\n"; |
51 | char accept_language[]= "Accept-Language: en\n"; |
Line 71... | Line 71... | ||
71 | int action_buf; |
71 | int action_buf; |
Line 72... | Line 72... | ||
72 | 72 | ||
73 | dword http_transfer = 0; |
73 | dword http_transfer = 0; |
Line 74... | Line 74... | ||
74 | dword http_buffer; |
74 | dword http_buffer; |
75 | 75 | ||
76 | dword TOOLBAR_H = 33; |
76 | dword TOOLBAR_H = 40; |
77 | dword STATUSBAR_H = 15; |
77 | dword STATUSBAR_H = 15; |
78 | dword col_bg; |
78 | dword col_bg; |
Line 103... | Line 103... | ||
103 | #include "show_src.h" |
103 | #include "show_src.h" |
104 | #include "download_manager.h" |
104 | #include "download_manager.h" |
Line 105... | Line 105... | ||
105 | 105 | ||
106 | char editURL[sizeof(URL)]; |
106 | char editURL[sizeof(URL)]; |
107 | int mouse_twb; |
107 | int mouse_twb; |
Line 108... | Line 108... | ||
108 | edit_box address_box = {250,56,34,0xffffff,0x94AECE,0xffffff,0xffffff,0,sizeof(URL),#editURL,#mouse_twb,2,19,19}; |
108 | edit_box address_box = {250,60,30,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,sizeof(URL),#editURL,#mouse_twb,2,19,19}; |
109 | 109 | ||
110 | 110 | ||
Line 258... | Line 258... | ||
258 | goto BEGIN_LOOP_APPLICATION; |
258 | goto BEGIN_LOOP_APPLICATION; |
259 | } |
259 | } |
Line 260... | Line 260... | ||
260 | 260 | ||
261 | void SetElementSizes() |
261 | void SetElementSizes() |
262 | { |
262 | { |
263 | address_box.top = TOOLBAR_H/2-7; |
263 | address_box.top = TOOLBAR_H/2-10; |
264 | address_box.width = Form.cwidth - address_box.left - 25 - 22; |
264 | address_box.width = Form.cwidth - address_box.left - 50; |
265 | WB1.list.SetSizes(0, TOOLBAR_H, Form.width - 10 - scroll_wv.size_x / WB1.DrawBuf.zoom, |
265 | WB1.list.SetSizes(0, TOOLBAR_H, Form.width - 10 - scroll_wv.size_x / WB1.DrawBuf.zoom, |
266 | Form.cheight - TOOLBAR_H - STATUSBAR_H, WB1.list.font_h + WB1.DrawBuf.zoom + WB1.DrawBuf.zoom * WB1.DrawBuf.zoom); |
266 | Form.cheight - TOOLBAR_H - STATUSBAR_H, WB1.list.font_h + WB1.DrawBuf.zoom + WB1.DrawBuf.zoom * WB1.DrawBuf.zoom); |
267 | WB1.list.wheel_size = 7; |
267 | WB1.list.wheel_size = 7; |
268 | WB1.list.column_max = WB1.list.w - scroll_wv.size_x / WB1.list.font_w; |
268 | WB1.list.column_max = WB1.list.w - scroll_wv.size_x / WB1.list.font_w; |
Line 279... | Line 279... | ||
279 | { |
279 | { |
280 | DrawBar(0,0, Form.cwidth,TOOLBAR_H-2, panel_color); |
280 | DrawBar(0,0, Form.cwidth,TOOLBAR_H-2, panel_color); |
281 | DrawBar(0,TOOLBAR_H-2, Form.cwidth,1, 0xD7D0D3); |
281 | DrawBar(0,TOOLBAR_H-2, Form.cwidth,1, 0xD7D0D3); |
282 | DrawBar(0,TOOLBAR_H-1, Form.cwidth,1, border_color); |
282 | DrawBar(0,TOOLBAR_H-1, Form.cwidth,1, border_color); |
283 | SetElementSizes(); |
283 | SetElementSizes(); |
284 | DrawRectangle(address_box.left-3, address_box.top-3, address_box.width+5, 20,border_color); |
284 | DrawRectangle(address_box.left-3, address_box.top-3, address_box.width+5, 25,border_color); |
285 | DefineButton(address_box.left-50, address_box.top-2, 23, skin.h-2, BACK_BUTTON+BT_HIDE, 0); |
285 | DefineButton(address_box.left-52, address_box.top-2, 24, skin.h-2, BACK_BUTTON+BT_HIDE, 0); |
286 | DefineButton(address_box.left-26, address_box.top-2, 23, skin.h-2, FORWARD_BUTTON+BT_HIDE, 0); |
286 | DefineButton(address_box.left-27, address_box.top-2, 24, skin.h-2, FORWARD_BUTTON+BT_HIDE, 0); |
287 | img_draw stdcall(skin.image, address_box.left-51, address_box.top-3, 48, skin.h, 3, 0); |
287 | img_draw stdcall(skin.image, address_box.left-53, address_box.top-3, 51, skin.h, 3, 0); |
288 | DefineButton(address_box.left+address_box.width+1, address_box.top-3, 16, skin.h-1, REFRESH_BUTTON+BT_HIDE+BT_NOFRAME, 0); |
288 | DefineButton(address_box.left+address_box.width+1, address_box.top-3, 16, skin.h-1, REFRESH_BUTTON+BT_HIDE+BT_NOFRAME, 0); |
289 | DefineButton(Form.cwidth-24, address_box.top-3, 19, skin.h-1, SANDWICH_BUTTON+BT_HIDE, 0); |
289 | DefineButton(Form.cwidth-27, address_box.top-3, 23, skin.h-1, SANDWICH_BUTTON+BT_HIDE, 0); |
290 | img_draw stdcall(skin.image, Form.cwidth-22, address_box.top-3, 16, skin.h, 85, 0); |
290 | img_draw stdcall(skin.image, Form.cwidth-24, address_box.top-3, 17, skin.h, 87, 0); |
291 | DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,STATUSBAR_H, col_bg); |
291 | DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,STATUSBAR_H, col_bg); |
292 | DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,1, border_color); |
292 | DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,1, border_color); |
293 | if (!header) OpenPage(); else { WB1.DrawPage(); DrawEditBoxWebView(); } |
293 | if (!header) OpenPage(); else { WB1.DrawPage(); DrawEditBoxWebView(); } |
294 | DrawRectangle(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x, scroll_wv.size_y-1, scroll_wv.bckg_col); |
294 | DrawRectangle(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x, scroll_wv.size_y-1, scroll_wv.bckg_col); |
295 | DrawProgress(); |
295 | DrawProgress(); |
Line 390... | Line 390... | ||
390 | http_transfer=0; |
390 | http_transfer=0; |
391 | bufsize = 0; |
391 | bufsize = 0; |
392 | bufpointer = free(bufpointer); |
392 | bufpointer = free(bufpointer); |
393 | } |
393 | } |
394 | wv_progress_bar.value = 0; |
394 | wv_progress_bar.value = 0; |
395 | img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 17, skin.h, 52, 0); |
395 | DrawEditBoxWebView(); |
396 | } |
396 | } |
Line 397... | Line 397... | ||
397 | 397 | ||
398 | void SetPageDefaults() |
398 | void SetPageDefaults() |
399 | { |
399 | { |
Line 449... | Line 449... | ||
449 | } |
449 | } |
450 | } |
450 | } |
Line 451... | Line 451... | ||
451 | 451 | ||
452 | DrawEditBoxWebView() |
452 | DrawEditBoxWebView() |
453 | { |
453 | { |
- | 454 | DrawBar(address_box.left-2, address_box.top-2, address_box.width+3, 2, address_box.color); |
|
454 | DrawWideRectangle(address_box.left-2, address_box.top-2, address_box.width+3, 19, 2, address_box.color); |
455 | DrawBar(address_box.left-2, address_box.top, 2, 22, address_box.color); |
455 | address_box.size = address_box.pos = address_box.shift = address_box.shift_old = strlen(#editURL); |
456 | address_box.size = address_box.pos = address_box.shift = address_box.shift_old = strlen(#editURL); |
456 | address_box.offset = 0; |
457 | address_box.offset = 0; |
457 | edit_box_draw stdcall(#address_box); |
458 | edit_box_draw stdcall(#address_box); |
458 | if (http_transfer > 0) EAX = 131; else EAX = 52; |
459 | if (http_transfer > 0) EAX = 131; else EAX = 54; |
459 | img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 17, skin.h, EAX, 0); |
460 | img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 17, skin.h, EAX, 0); |
Line 460... | Line 461... | ||
460 | } |
461 | } |
Line 498... | Line 499... | ||
498 | void DrawProgress() |
499 | void DrawProgress() |
499 | { |
500 | { |
500 | unsigned long btn; |
501 | unsigned long btn; |
501 | if (http_transfer == 0) return; |
502 | if (http_transfer == 0) return; |
502 | if (wv_progress_bar.max) btn = address_box.width*wv_progress_bar.value/wv_progress_bar.max; else btn = 30; |
503 | if (wv_progress_bar.max) btn = address_box.width*wv_progress_bar.value/wv_progress_bar.max; else btn = 30; |
503 | DrawBar(address_box.left-2, address_box.top+15, btn, 2, wv_progress_bar.progress_color); |
504 | DrawBar(address_box.left-2, address_box.top+20, btn, 2, wv_progress_bar.progress_color); |
504 | } |
505 | } |
Line 505... | Line 506... | ||
505 | 506 | ||
506 | void ClickLink() |
507 | void ClickLink() |
507 | { |
508 | { |
Line 539... | Line 540... | ||
539 | strcpy(#editURL, history.current()); |
540 | strcpy(#editURL, history.current()); |
540 | strcpy(#URL, history.current()); |
541 | strcpy(#URL, history.current()); |
541 | return; |
542 | return; |
542 | } |
543 | } |
Line 543... | Line 544... | ||
543 | 544 | ||
544 | if (!strcmp(#URL,"https://")) |
545 | if (!strncmp(#URL,"https://",8)) |
545 | { |
546 | { |
546 | notify("HTTPS protocol is not supported yet"); |
547 | notify("'HTTPS protocol is not supported yet' -E"); |
Line 547... | Line 548... | ||
547 | } |
548 | } |
Line 548... | Line 549... | ||
548 | 549 |