Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 8489 → Rev 8490

/programs/cmm/browser/TWB/TWB.c
115,6 → 115,7
cur_encoding = custom_encoding;
bufpointer = ChangeCharset(cur_encoding, "CP866", bufpointer);
}
list.SetFont(8, 14, 10011000b);
}
//============================================================================================
void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){
150,7 → 151,7
Render();
NewLine();
} else {
AddCharToTheLine(0x0a);
AddCharToTheLine(' ');
}
break;
case 0x09:
159,7 → 160,7
if (!tab_len) tab_len = 4; else tab_len = 4 - tab_len;
for (j=0; j<tab_len; j++;) chrcat(#line,' ');
} else {
AddCharToTheLine(0x09);
AddCharToTheLine(' ');
}
break;
case '&': //&nbsp; and so on
176,15 → 177,8
break;
case '<':
if (!is_html) goto _DEFAULT;
if (!strchr("!/?abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", ESBYTE[bufpos+1])) goto _DEFAULT;
bufpos++;
switch (ESBYTE[bufpos]) {
case '!': case '/': case '?':
case 'a'...'z': case 'A'...'Z':
goto _TAG;
default:
goto _DEFAULT;
}
_TAG:
if (tag.parse(#bufpos, bufpointer + bufsize)) {
CheckForLineBreak();
Render();
314,6 → 308,11
scroll_wv.start_x = list.x + list.w;
scroll_wv.start_y = list.y;
scroll_wv.size_y = list.h;
 
if (list.count <= list.visible) {
DrawBar(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x,
scroll_wv.size_y, bg_colors.get(0) & 0x00FFFFFF);
} else {
scrollbar_v_draw(#scroll_wv);
 
}
}
/programs/cmm/browser/TWB/parse_tag.h
31,6 → 31,7
 
dword closepos;
dword whitepos;
dword openpos;
 
if (name) strcpy(#prior, #name); else prior = '\0';
name = '\0';
72,6 → 73,19
bufpos = closepos;
} else {
//we have param
while (chrlnum(whitepos, '\"', closepos - whitepos)%2) { //alt="Next>>"
/*
openpos = strchr(closepos+1, '<');
closepos = strchr(closepos+1, '>');
if (openpos) && (openpos < closepos) {
closepos = openpos - 1;
break;
}
*/
if (!openpos = strchr(closepos+1, '<')) break;
if (openpos < strchr(closepos+1, '>')) break;
if (!closepos = EAX) {closepos = bufend;break;}
}
strncpy(#name, bufpos, math.min(whitepos - bufpos, sizeof(tag.name)));
debug_tag();
bufpos = closepos;
/programs/cmm/browser/TWB/set_style.h
52,17 → 52,10
if (tag.is("html")) { t_html = tag.opened; return; }
 
//TO BE REWORKED
//td_x = td_w = tr_y = highest_td = 0;
//if (tag.is("table")) { tag_table(); return; }
//if (tag.is("tr")) { tag_tr(); return; }
//if (tag.is("td")) { tag_td(); return; }
//if (tag.is("tr")) { tag_tr(); return; }
 
if (tag.is("dd")) {
//NewLine();
//if (tag.opened) stolbec += 5; //may overflow!
return;
}
}
 
void TWebBrowser::tag_p()
{
101,6 → 94,8
void TWebBrowser::tag_div()
{
if (streq(#tag.prior,"div")) && (tag.opened) return;
if (streq(#tag.prior,"td")) return;
//if (streq(#tag.prior,"div")) return;
if (!tag.opened) && (style.font) text_colors.pop();
NewLine();
}
287,6 → 282,7
if (!strcmp(tag.value + strrchr(tag.value, '.'), "webp")) goto NOIMG;
 
strlcpy(#img_path, tag.value, sizeof(img_path)-1);
replace_char(#img_path, ' ', '\0', sizeof(img_path));
get_absolute_url(#img_path, history.current());
 
if (check_is_the_adress_local(#img_path)) {
/programs/cmm/browser/WebView.c
41,10 → 41,6
// DATA //
// //
//===================================================//
char version[]="WebView 3.26";
 
#define DEFAULT_URL URL_SERVICE_HOMEPAGE
 
bool debug_mode = false;
bool show_images = true;
 
144,6 → 140,7
 
if (WB1.list.MouseScroll(mouse.vert)) WB1.DrawPage();
 
if (WB1.list.count > WB1.list.visible) {
scrollbar_v_mouse (#scroll_wv);
if (scroll_wv.delta2) {
WB1.list.first = scroll_wv.position;
150,6 → 147,7
WB1.DrawPage();
break;
}
}
 
if (links.hover(WB1.list.y, WB1.list.first))
{
187,8 → 185,9
break;
 
case evReDraw:
DefineAndDrawWindow(GetScreenWidth()-800/2-random(80),
GetScreenHeight()-700/2-random(80),800,700,0x73,0,0,0);
DefineAndDrawWindow(GetScreenWidth()-WIN_W/2-random(80),GetScreenHeight()-WIN_H/2-random(80),
//DefineAndDrawWindow(0,0,
WIN_W,WIN_H,0x73,0,0,0);
GetProcessInfo(#Form, SelfInfo);
ProcessMenuClick();
sc.get();
410,11 → 409,11
 
void EventAllTabsClick(dword _n)
{
if (http.transfer) return;
if (mouse.mkm) {
StopLoading();
EventTabClose(_n);
} else {
EventTabClick(_n);
if (!http.transfer) EventTabClick(_n);
}
}
 
/programs/cmm/browser/const.h
1,4 → 1,9
#ifdef LANG_RUS
//===================================================//
// //
// CYRILLIC //
// //
//===================================================//
char buildin_page_error[] = FROM "res/page_not_found_ru.htm""\0";
char buildin_page_home[] = FROM "res/homepage_ru.htm""\0";
char buildin_page_help[] = FROM "res/help_ru.htm""\0";
31,6 → 36,11
#define T_RENDERING "¥­¤¥à¨­£ áâà ­¨æë..."
#define T_DONE_IN_SEC "ƒ®â®¢®: %i ᥪ"
#else
//===================================================//
// //
// ENGLISH //
// //
//===================================================//
char buildin_page_error[] = FROM "res/page_not_found_en.htm""\0";
char buildin_page_home[] = FROM "res/homepage_en.htm""\0";
char buildin_page_help[] = FROM "res/help_en.htm""\0";
63,6 → 73,12
#define T_DONE_IN_SEC "Done in %i sec"
#endif
 
//===================================================//
// //
// GLOBAL //
// //
//===================================================//
 
char buildin_page_test[] = FROM "res/test.htm""\0";
 
#define URL_SERVICE_HISTORY "WebView:history"
84,4 → 100,11
TAB_CLOSE_ID = 900
};
 
char editbox_icons[] = FROM "res/editbox_icons.raw";
char editbox_icons[] = FROM "res/editbox_icons.raw";
 
#define WIN_W 850
#define WIN_H 920
 
#define DEFAULT_URL URL_SERVICE_HOMEPAGE
 
char version[]="WebView 3.27";
/programs/cmm/browser/tabs.h
7,7 → 7,7
 
#define TABS_MAX 5
 
TWebBrowser data[TABS_MAX+1]=0;
TWebBrowser tabdata[TABS_MAX+1]=0;
_history tabstory[TABS_MAX+1]=0;
 
struct TAB
36,7 → 36,7
int i;
if (count==1) return false;
for (i=_tab_number; i<TABS_MAX; i++) {
data[i] = data[i+1];
tabdata[i] = tabdata[i+1];
tabstory[i] = tabstory[i+1];
}
if (_tab_number<active) && (active>0) active--;
48,13 → 48,13
void TAB::save_state()
{
tabstory[active] = history;
data[active] = WB1;
tabdata[active] = WB1;
}
 
void TAB::restore(int _id)
{
tab.active = _id;
WB1 = data[_id];
WB1 = tabdata[_id];
history = tabstory[_id];
}
 
90,8 → 90,8
bgcol=sc.work;
border_bottom_color = sc.work_graph;
}
if (data[_id].header) {
strncpy(#header_no_version, #data[_id].header, strlen(#data[_id].header)-sizeof(version)-2);
if (tabdata[_id].header) {
strncpy(#header_no_version, #tabdata[_id].header, strlen(#tabdata[_id].header)-sizeof(version)-2);
strncpy(#name, #header_no_version, tab_w-CLOSE_S/6-2);
}
DrawBar(xxx, TOOLBAR_H, 1, TAB_H, sc.work_dark);
/programs/cmm/lib/dll.h
16,15 → 16,6
 
char a_libdir[43] = "/sys/lib/\0";
 
:inline void error_init(dword lirary_path)
{
char error_text[1024];
strcpy(#error_text, _TEXT_ERROR_ADD);
strcat(#error_text, lirary_path);
strcat(#error_text, "' -E");
notify(#error_text);
}
 
// stdcall with 1 parameter
:void dll_Load() {
asm {
188,9 → 179,8
}
}
 
:int load_dll2(dword dllname, import_table, byte need_init)
:void load_dll(dword dllname, import_table, byte need_init)
{
//dword dllentry=0;
// load DLL
$mov eax, 68
$mov ebx, 19
237,20 → 227,19
#ifndef NO_DLL_INIT
IF (need_init) dll_Init (DSDWORD[EDX+4]);
#endif
return 0;
return;
@exit01:
return -1;
error_init(dllname);
}
 
:byte load_dll(dword dllname, import_table, byte need_init)
:inline void error_init(dword lirary_path)
{
if (load_dll2(dllname, import_table, need_init))
{
error_init(dllname);
return false;
char error_text[1024];
strcpy(#error_text, _TEXT_ERROR_ADD);
strcat(#error_text, lirary_path);
strcat(#error_text, "' -E");
notify(#error_text);
}
return true;
}
 
 
#endif