Rev 4540 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4540 | Rev 4544 | ||
---|---|---|---|
Line 28... | Line 28... | ||
28 | //images |
28 | //images |
29 | #include "img\toolbar_icons.c" |
29 | #include "img\toolbar_icons.c" |
30 | #include "img\URLgoto.txt"; |
30 | #include "img\URLgoto.txt"; |
Line 31... | Line 31... | ||
31 | 31 | ||
32 | #ifdef LANG_RUS |
32 | #ifdef LANG_RUS |
33 | char version[]=" ¥ªáâ®¢ë© ¡à 㧥à 0.99.65"; |
33 | char version[]=" ¥ªáâ®¢ë© ¡à 㧥à 0.99.66"; |
34 | ?define IMAGES_CACHE_CLEARED "íè ª à⨮ª ®ç¨é¥" |
34 | ?define IMAGES_CACHE_CLEARED "íè ª à⨮ª ®ç¨é¥" |
35 | ?define T_LAST_SLIDE "â® ¯®á«¥¤¨© á« ©¤" |
35 | ?define T_LAST_SLIDE "â® ¯®á«¥¤¨© á« ©¤" |
36 | char loading[] = "Loading..."; |
36 | char loading[] = " £à㧪 áâà ¨æë..."; |
37 | char page_not_found[] = "âà ¨æ ¥ ©¤¥ . ®¬®¦®, URL ᮤ¥à¦¨â ®è¨¡ªã."; |
- | |
38 | char page_not_found_no_internet[] = "âà ¨æ ¥ ©¤¥ . ®¬®¦®, URL ᮤ¥à¦¨â ®è¨¡ªã. |
37 | unsigned char page_not_found[] = FROM "html\page_not_found_ru.htm"; |
39 | #else |
38 | #else |
40 | char version[]=" Text-based Browser 0.99.65"; |
39 | char version[]=" Text-based Browser 0.99.66"; |
41 | ?define IMAGES_CACHE_CLEARED "Images cache cleared" |
40 | ?define IMAGES_CACHE_CLEARED "Images cache cleared" |
42 | ?define T_LAST_SLIDE "This slide is the last" |
41 | ?define T_LAST_SLIDE "This slide is the last" |
43 | char loading[] = "Loading..."; |
42 | char loading[] = "Loading..."; |
44 | char page_not_found[] = "Page not found. Maybe, URL contains some errors."; |
- | |
45 | char page_not_found_no_internet[] = "Page not found. Maybe, URL contains some errors. |
43 | unsigned char page_not_found[] = FROM "html\page_not_found_en.htm"; |
Line 46... | Line 44... | ||
46 | #endif |
44 | #endif |
47 | 45 | ||
48 | proc_info Form; |
46 | proc_info Form; |
Line 65... | Line 63... | ||
65 | 63 | ||
66 | char editURL[sizeof(URL)]; |
64 | char editURL[sizeof(URL)]; |
67 | int mouse_twb; |
65 | int mouse_twb; |
Line -... | Line 66... | ||
- | 66 | edit_box address_box= {250,207,16,0xffffff,0x94AECE,0xffffff,0xffffff,0,sizeof(URL),#editURL,#mouse_twb,2,19,19}; |
|
Line 68... | Line 67... | ||
68 | edit_box address_box= {250,207,16,0xffffff,0x94AECE,0xffffff,0xffffff,0,sizeof(URL),#editURL,#mouse_twb,2,19,19}; |
67 | |
Line 69... | Line 68... | ||
69 | 68 | #define URL_HISTORY "WebView://history" |
|
Line 282... | Line 281... | ||
282 | ImgCache.Free(); |
281 | ImgCache.Free(); |
283 | notify(IMAGES_CACHE_CLEARED); |
282 | notify(IMAGES_CACHE_CLEARED); |
284 | WB1.ParseHTML(bufpointer); |
283 | WB1.ParseHTML(bufpointer); |
285 | return; |
284 | return; |
Line -... | Line 285... | ||
- | 285 | ||
- | 286 | case 008: //history |
|
- | 287 | strcpy(#URL, URL_HISTORY); |
|
- | 288 | OpenPage(); |
|
- | 289 | return; |
|
286 | 290 | ||
287 | case BACK: |
291 | case BACK: |
288 | if (!BrowserHistory.GoBack()) return; |
292 | if (!BrowserHistory.GoBack()) return; |
289 | OpenPage(); |
293 | OpenPage(); |
290 | return; |
294 | return; |
Line 348... | Line 352... | ||
348 | IF(WB1.list.first < 0) WB1.list.first = 0; |
352 | IF(WB1.list.first < 0) WB1.list.first = 0; |
349 | WB1.ParseHTML(bufpointer); |
353 | WB1.ParseHTML(bufpointer); |
350 | return; |
354 | return; |
Line 351... | Line 355... | ||
351 | 355 | ||
352 | case 178: |
356 | case 178: |
353 | case BTN_UP: //ìîòàåì ââåðõ |
357 | case BTN_UP: |
354 | if (WB1.list.first <= 0) return; |
358 | if (WB1.list.first <= 0) return; |
355 | WB1.list.first--; |
359 | WB1.list.first--; |
356 | WB1.ParseHTML(bufpointer); |
360 | WB1.ParseHTML(bufpointer); |
Line 357... | Line 361... | ||
357 | return; |
361 | return; |
358 | 362 | ||
359 | case 177: |
363 | case 177: |
360 | case BTN_DOWN: //ìîòàåì âíèç |
364 | case BTN_DOWN: |
361 | if (WB1.list.visible + WB1.list.first >= WB1.list.count) return; |
365 | if (WB1.list.visible + WB1.list.first >= WB1.list.count) return; |
362 | WB1.list.first++; |
366 | WB1.list.first++; |
Line 377... | Line 381... | ||
377 | 381 | ||
378 | 382 | ||
379 | void ProcessLinks(int id) |
383 | void ProcessLinks(int id) |
380 | { |
- | |
381 | strcpy(#URL, PageLinks.GetURL(id-401)); |
384 | { |
382 | 385 | strcpy(#URL, PageLinks.GetURL(id-401)); |
|
383 | //$1 - Condition Script |
386 | //$1 - Condition Script |
384 | if (URL[0] == '$') |
387 | if (URL[0] == '$') |
385 | { |
388 | { |
Line 458... | Line 461... | ||
458 | { |
461 | { |
459 | address_box.size = address_box.pos = strlen(#editURL); |
462 | address_box.size = address_box.pos = strlen(#editURL); |
460 | address_box.offset=0; |
463 | address_box.offset=0; |
461 | edit_box_draw stdcall(#address_box); |
464 | edit_box_draw stdcall(#address_box); |
Line -... | Line 465... | ||
- | 465 | ||
462 | 466 | if (strcmp(#URL, URL_HISTORY)==0) ShowHistory(); else |
|
463 | if (!bufsize) |
467 | if (!bufsize) |
464 | { |
468 | { |
465 | PageLinks.Clear(); |
469 | PageLinks.Clear(); |
466 | if (GetProcessSlot(downloader_id)<>0) |
470 | if (GetProcessSlot(downloader_id)<>0) |
467 | { |
471 | { |
468 | bufsize = sizeof(loading); |
472 | bufsize = sizeof(loading); |
469 | WB1.ParseHTML(#loading); |
473 | WB1.ParseHTML(#loading); |
470 | } |
474 | } |
471 | else |
475 | else |
472 | { |
- | |
473 | if (strncmp(#URL,"http:",5)==0) |
- | |
474 | { |
- | |
475 | bufsize = sizeof(page_not_found_no_internet); |
- | |
476 | WB1.ParseHTML(#page_not_found_no_internet); |
- | |
477 | } |
- | |
478 | else |
- | |
479 | { |
476 | { |
480 | bufsize = sizeof(page_not_found); |
477 | bufsize = sizeof(page_not_found); |
481 | WB1.ParseHTML(#page_not_found); |
478 | WB1.ParseHTML(#page_not_found); |
482 | } |
- | |
483 | } |
479 | } |
484 | //return; |
480 | bufsize = 0; |
485 | } |
481 | } |
486 | else |
482 | else |
Line 487... | Line 483... | ||
487 | WB1.ParseHTML(bufpointer); |
483 | WB1.ParseHTML(bufpointer); |
488 | 484 | ||
489 | if (!header) strcpy(#header, #version); |
485 | if (!header) strcpy(#header, #version); |
Line -... | Line 486... | ||
- | 486 | if (!strcmp(#version, #header)) DrawTitle(#header); |
|
- | 487 | } |
|
- | 488 | ||
- | 489 | ShowHistory() |
|
- | 490 | { |
|
- | 491 | int i; |
|
- | 492 | static int history_pointer; |
|
- | 493 | ||
- | 494 | free(history_pointer); |
|
- | 495 | history_pointer = malloc(64000); |
|
- | 496 | strcat(history_pointer, " |
|
- | 497 | strcat(history_pointer, " |
|
- | 498 | for (i=1; i |
|
- | 499 | { |
|
- | 500 | strcat(history_pointer, ""); |
|
- | 503 | strcat(history_pointer, BrowserHistory.GetUrl(i)); |
|
- | 504 | strcat(history_pointer, " |
|
- | 505 | } |
|
- | 506 | strcat(history_pointer, " |
|
- | 507 | for (i=1; i |
|
- | 508 | { |
|
- | 509 | strcat(history_pointer, " |
|
- | 512 | } |
|
- | 513 | bufsize = strlen(history_pointer); |
|
- | 514 | bufpointer = history_pointer; |
|
Line 490... | Line 515... | ||
490 | if (!strcmp(#version, #header)) DrawTitle(#header); |
515 | WB1.ParseHTML(history_pointer); |