Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4540 → Rev 4544

/programs/cmm/TWB/TWB.c
632,7 → 632,7
DrawBuf.Fill(bg_color);
}
stroka++;
if (blq_text) stolbec = 8; else stolbec = 0;
if (blq_text) stolbec = 6; else stolbec = 0;
if (li_text) stolbec = li_tab * 5;
}
 
/programs/cmm/TWB/history.h
1,59 → 1,59
struct path_string {
char Item[4096];
};
 
#define MAX_HISTORY_NUM 40
path_string history_list[MAX_HISTORY_NUM];
 
struct UrlsHistory {
int links_count;
int current;
dword CurrentUrl();
dword GetUrl();
void AddUrl();
byte GoBack();
byte GoForward();
};
 
UrlsHistory BrowserHistory;
dword UrlsHistory::CurrentUrl() {
return #history_list[current].Item;
}
 
struct path_string {
char Item[4096];
};
 
#define MAX_HISTORY_NUM 40
path_string history_list[MAX_HISTORY_NUM];
int history_num;
int history_current;
 
dword UrlsHistory::CurrentUrl()
{
return #history_list[history_current].Item;
dword UrlsHistory::GetUrl(int id) {
return #history_list[id].Item;
}
 
void UrlsHistory::AddUrl() //òóò íóæåí ââîäèìûé ýëåìåíò - äëÿ óíèâåðñàëüíîñòè
{
void UrlsHistory::AddUrl() {
int i;
if (history_num>0) && (!strcmp(#URL,#history_list[history_current].Item)) return;
if (links_count>0) && (!strcmp(#URL,#history_list[current].Item)) return;
 
if (history_current>=MAX_HISTORY_NUM-1)
if (current>=MAX_HISTORY_NUM-1)
{
history_current/=2;
for (i=0; i<history_current; i++;)
current/=2;
for (i=0; i<current; i++;)
{
strlcpy(#history_list[i].Item, #history_list[MAX_HISTORY_NUM-i].Item, sizeof(history_list[0].Item));
}
}
history_current++;
strlcpy(#history_list[history_current].Item, #URL, sizeof(history_list[0].Item));
history_num=history_current;
current++;
strlcpy(#history_list[current].Item, #URL, sizeof(history_list[0].Item));
links_count=current;
}
 
 
byte UrlsHistory::GoBack()
{
if (history_current<=1) return 0;
history_current--;
strlcpy(#URL, #history_list[history_current].Item, sizeof(URL));
byte UrlsHistory::GoBack() {
if (current<=1) return 0;
current--;
strlcpy(#URL, #history_list[current].Item, sizeof(URL));
return 1;
}
 
 
byte UrlsHistory::GoForward()
{
if (history_current==history_num) return 0;
history_current++;
strlcpy(#URL, #history_list[history_current].Item, sizeof(URL));
byte UrlsHistory::GoForward() {
if (current==links_count) return 0;
current++;
strlcpy(#URL, #history_list[current].Item, sizeof(URL));
return 1;
}
}
 
UrlsHistory BrowserHistory;
/programs/cmm/TWB/img_cache.h
9,7 → 9,7
struct ImageCache {
int pics_count;
void Free();
int GetImage();
int GetImageNumber();
void Images();
};
 
22,7 → 22,7
}
}
 
int ImageCache::GetImage(dword i_path)
int ImageCache::GetImageNumber(dword i_path)
{
int i;
for (i=0; i<pics_count; i++) if (!strcmp(#pics[i].path, i_path)) return i; //image exists
55,7 → 55,7
img_path[strrchr(#img_path, '/')] = '\0';
strcat(#img_path, #options);
}
cur_pic = GetImage(#img_path);
cur_pic = GetImageNumber(#img_path);
}
}
if (!strcmp(#parametr,"alt="))
/programs/cmm/appearance/appearance.c
24,7 → 24,7
?define T_WALLPAPERS " Wallpappers"
#endif
 
unsigned char icons[sizeof(file "icons.raw")]= FROM "icons.raw";
unsigned char icons[]= FROM "icons.raw";
 
 
#define PANEL_H 30
/programs/cmm/browser/HTMLv.c
30,19 → 30,17
#include "img\URLgoto.txt";
 
#ifdef LANG_RUS
char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.65";
char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.66";
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
char loading[] = "Loading...";
char page_not_found[] = "‘âà ­¨æ  ­¥ ­ ©¤¥­ . ‚®¬®¦­®, URL ᮤ¥à¦¨â ®è¨¡ªã.";
char page_not_found_no_internet[] = "‘âà ­¨æ  ­¥ ­ ©¤¥­ . ‚®¬®¦­®, URL ᮤ¥à¦¨â ®è¨¡ªã.<br>ˆ«¨ ­¥â ¤®áâ㯠 ¢ ˆ­â¥à­¥âë.";
char loading[] = "‡ £à㧪  áâà ­¨æë...";
unsigned char page_not_found[] = FROM "html\page_not_found_ru.htm";
#else
char version[]=" Text-based Browser 0.99.65";
char version[]=" Text-based Browser 0.99.66";
?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...";
char page_not_found[] = "Page not found. Maybe, URL contains some errors.";
char page_not_found_no_internet[] = "Page not found. Maybe, URL contains some errors.<br>Or Internet unavailable for your configuration.";
unsigned char page_not_found[] = FROM "html\page_not_found_en.htm";
#endif
 
proc_info Form;
67,6 → 65,7
int mouse_twb;
edit_box address_box= {250,207,16,0xffffff,0x94AECE,0xffffff,0xffffff,0,sizeof(URL),#editURL,#mouse_twb,2,19,19};
 
#define URL_HISTORY "WebView://history"
 
enum { BACK=300, FORWARD, REFRESH, HOME, NEWTAB, GOTOURL, SEARCHWEB, INPUT_CH, INPUT_BT, BTN_UP, BTN_DOWN };
 
284,6 → 283,11
WB1.ParseHTML(bufpointer);
return;
 
case 008: //history
strcpy(#URL, URL_HISTORY);
OpenPage();
return;
 
case BACK:
if (!BrowserHistory.GoBack()) return;
OpenPage();
350,7 → 354,7
return;
 
case 178:
case BTN_UP: //ìîòàåì ââåðõ
case BTN_UP:
if (WB1.list.first <= 0) return;
WB1.list.first--;
WB1.ParseHTML(bufpointer);
357,7 → 361,7
return;
 
case 177:
case BTN_DOWN: //ìîòàåì âíèç
case BTN_DOWN:
if (WB1.list.visible + WB1.list.first >= WB1.list.count) return;
WB1.list.first++;
WB1.ParseHTML(bufpointer);
379,7 → 383,6
void ProcessLinks(int id)
{
strcpy(#URL, PageLinks.GetURL(id-401));
//$1 - Condition Script
if (URL[0] == '$')
{
460,6 → 463,7
address_box.offset=0;
edit_box_draw stdcall(#address_box);
 
if (strcmp(#URL, URL_HISTORY)==0) ShowHistory(); else
if (!bufsize)
{
PageLinks.Clear();
470,19 → 474,11
}
else
{
if (strncmp(#URL,"http:",5)==0)
{
bufsize = sizeof(page_not_found_no_internet);
WB1.ParseHTML(#page_not_found_no_internet);
}
else
{
bufsize = sizeof(page_not_found);
WB1.ParseHTML(#page_not_found);
}
bufsize = 0;
}
//return;
}
else
WB1.ParseHTML(bufpointer);
 
490,5 → 486,34
if (!strcmp(#version, #header)) DrawTitle(#header);
}
 
ShowHistory()
{
int i;
static int history_pointer;
 
free(history_pointer);
history_pointer = malloc(64000);
strcat(history_pointer, "<h1>History</h1>");
strcat(history_pointer, "<h2>Visited pages</h2><blockquote><br>");
for (i=1; i<BrowserHistory.links_count; i++)
{
strcat(history_pointer, "<a href='");
strcat(history_pointer, BrowserHistory.GetUrl(i));
strcat(history_pointer, "'>");
strcat(history_pointer, BrowserHistory.GetUrl(i));
strcat(history_pointer, "</a><br>");
}
strcat(history_pointer, "</blockquote><h2>Cached images</h2><br>");
for (i=1; i<ImgCache.pics_count; i++)
{
strcat(history_pointer, "<img src='");
strcat(history_pointer, #pics[i].path);
strcat(history_pointer, "' /><br>");
}
bufsize = strlen(history_pointer);
bufpointer = history_pointer;
WB1.ParseHTML(history_pointer);
}
 
 
stop:
/programs/cmm/browser/History.txt
1,4 → 1,14
15.10.13 - 0.99.08
20.11.2013 - 0.99.6
- ïåðåäåëàíû ññûëêè, êóðñîð ïðåâðàùàåòñÿ â ðóêó ïðè íàâåäåíèè
 
29.12.2013 - 0.99.5
- Condition Script
 
27.12.2013 - 0.99.4
- îòäåëåíèå TWB êîìïîíåíòà îò áðàóçåðà
 
15.10.13 - 0.99.1
- ïîääåðæêà òåãîâ <center>, <right> è ïàðàìåòðà align="center/right" äëÿ òåãîâ h1..h4
- óëó÷øåííîå ìåíþ
- ìóëüòèÿçû÷íîñòü
 
/programs/cmm/browser/menu_rmb.h
8,9 → 8,11
#ifdef LANG_RUS
"ˆá室­¨ª áâà ­¨æë F3",52,
"Žç¨áâ¨âì ªíè ª à⨭®ª" ,02,
"ˆáâ®à¨ï" ,08,
#else
"View source F3",52,
"Free image cache" ,09,
"History" ,08,
#endif
0};