WebView: various fixes

git-svn-id: svn://kolibrios.org@9089 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2021-07-26 07:21:58 +00:00
parent 53e6a25eb8
commit 1ab60232c8
5 changed files with 33 additions and 62 deletions

View File

@ -1,4 +1,3 @@
struct _tag struct _tag
{ {
char name[32]; char name[32];
@ -10,7 +9,6 @@ struct _tag
dword number; dword number;
bool is(); bool is();
bool parse(); bool parse();
void debug_tag();
dword get_next_param(); dword get_next_param();
dword get_value_of(); dword get_value_of();
signed get_number_of(); signed get_number_of();
@ -18,11 +16,7 @@ struct _tag
bool _tag::is(dword _text) bool _tag::is(dword _text)
{ {
if ( !strcmp(#name, _text) ) { return streq(#name, _text);
return true;
} else {
return false;
}
} }
bool _tag::parse(dword _bufpos, bufend) bool _tag::parse(dword _bufpos, bufend)
@ -63,38 +57,22 @@ bool _tag::parse(dword _bufpos, bufend)
closepos = strchr(bufpos, '>'); closepos = strchr(bufpos, '>');
whitepos = strchrw(bufpos, bufend-bufpos); whitepos = strchrw(bufpos, bufend-bufpos);
if (debug_mode) {
if (!closepos) debugln("null closepos");
if (!whitepos) debugln("null whitepos");
}
if (!whitepos) || (whitepos > closepos) { if (!whitepos) || (whitepos > closepos) {
//no param //no param
strncpy(#name, bufpos, math.min(closepos - bufpos, sizeof(tag.name))); strncpy(#name, bufpos, math.min(closepos - bufpos, sizeof(tag.name)));
debug_tag();
bufpos = closepos; bufpos = closepos;
} else { } else {
//we have param //we have param
while (chrlnum(whitepos, '\"', closepos - whitepos)%2) { //alt="Next>>" 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 (openpos < strchr(closepos+1, '>')) break; if (openpos < strchr(closepos+1, '>')) break;
if (!closepos = EAX) {closepos = bufend;break;} if (!closepos = EAX) {closepos = bufend;break;}
} }
strncpy(#name, bufpos, math.min(whitepos - bufpos, sizeof(tag.name))); strncpy(#name, bufpos, math.min(whitepos - bufpos, sizeof(tag.name)));
debug_tag();
bufpos = closepos; bufpos = closepos;
params = malloc(closepos - whitepos + 1); params = malloc(closepos - whitepos + 1);
strncpy(params, whitepos, closepos - whitepos); strncpy(params, whitepos, closepos - whitepos);
if (debug_mode) { debug("params: "); debugln(params+1); }
paramsend = params + closepos - whitepos; paramsend = params + closepos - whitepos;
while (paramsend = get_next_param(params, paramsend-1)); while (paramsend = get_next_param(params, paramsend-1));
free(params); free(params);
@ -120,16 +98,6 @@ _RET:
return retok; return retok;
} }
void _tag::debug_tag()
{
if (debug_mode) {
debugch('<');
if (!opened) debugch('/');
debug(#name);
debugln(">");
}
}
dword _tag::get_next_param(dword ps, pe) dword _tag::get_next_param(dword ps, pe)
{ {
// "ps" - param start // "ps" - param start
@ -189,12 +157,6 @@ dword _tag::get_next_param(dword ps, pe)
attributes.add(attr); attributes.add(attr);
values.add(val); values.add(val);
if (debug_mode) {
debug("atr: "); debugln(attr);
debug("val: "); debugln(val);
debugch('\n');
}
if (pe==ps) return NULL; if (pe==ps) return NULL;
return pe; return pe;
} }
@ -213,7 +175,7 @@ dword _tag::get_value_of(dword _attr_name)
signed _tag::get_number_of(dword _attr_name) signed _tag::get_number_of(dword _attr_name)
{ {
if (get_value_of(_attr_name)) { if (get_value_of(_attr_name)) {
number = atoi(tag.value); number = atoi(value);
} else { } else {
number = 0; number = 0;
} }

View File

@ -11,6 +11,7 @@ char *unicode_symbols[]={
"#171","<<", "laquo","<<", "#171","<<", "laquo","<<",
"#174","(r)", "reg", "(r)", "#174","(r)", "reg", "(r)",
"#187",">>", "raquo",">>", "#187",">>", "raquo",">>",
"hellip", "...",
"trade", "[TM]", "trade", "[TM]",
"bdquo", ",,", "bdquo", ",,",
@ -80,6 +81,7 @@ bool GetUnicodeSymbol(dword _line, line_size, bufpos, buf_end)
{ {
if (__isWhite(ESBYTE[bufpos])) {bufpos--; break;} if (__isWhite(ESBYTE[bufpos])) {bufpos--; break;}
if (ESBYTE[bufpos] == ';') || (bufpos >= buf_end) break; if (ESBYTE[bufpos] == ';') || (bufpos >= buf_end) break;
if (!strchr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", ESBYTE[bufpos])) {bufpos--; break;}
special_code[i] = ESBYTE[bufpos]; special_code[i] = ESBYTE[bufpos];
} }
special_code[i] = '\0'; special_code[i] = '\0';

View File

@ -1,4 +1,4 @@
//Copyright 2007-2020 by Veliant & Leency //Copyright 2007-2021 by Veliant & Leency
//Asper, lev, Lrz, Barsuk, Nable, hidnplayr... //Asper, lev, Lrz, Barsuk, Nable, hidnplayr...
//===================================================// //===================================================//
@ -234,6 +234,7 @@ void main()
} }
LoadInternalPage(http.content_pointer, http.content_received); LoadInternalPage(http.content_pointer, http.content_received);
free(http.content_pointer); free(http.content_pointer);
DrawOmnibox();
} }
else if (http_get_type==IMG) { else if (http_get_type==IMG) {
_IMG_RES: _IMG_RES:
@ -426,10 +427,10 @@ void EventAllTabsClick(dword _n)
void EventEditSource() void EventEditSource()
{ {
if (check_is_the_adress_local(history.current())) { if (check_is_the_adress_local(history.current())) {
RunProgram("/rd/1/quark", history.current()); RunProgram("/rd/1/develop/cedit", history.current());
} else { } else {
CreateFile(WB1.bufsize, WB1.bufpointer, "/tmp0/1/WebView_tmp.htm"); CreateFile(WB1.bufsize, WB1.bufpointer, "/tmp0/1/WebView_tmp.htm");
if (!EAX) RunProgram("/rd/1/quark", "/tmp0/1/WebView_tmp.htm"); if (!EAX) RunProgram("/rd/1/develop/cedit", "/tmp0/1/WebView_tmp.htm");
} }
} }

View File

@ -6,22 +6,28 @@
<a href=//kolibri-n.org>KolibriN10</a> <a href=//kolibri-n.org>KolibriN10</a>
<a href=//store.kolibri-n.org>Kolibri Store</a> <a href=//store.kolibri-n.org>Kolibri Store</a>
<a href=//os-menuet.narod.ru>os-menuet.narod.ru</a> Simplest:
<a href=//coolthemes.narod.ru/indexold.html>coolthemes.narod.ru</a>
<a href=//www.fdd5-25.net/index.htm>fdd5-25.net</a>
<a href=//www.mestack.narod.ru/index.html>mestack.narod.ru</a>
<a href=//dgmag.in>dgmag.in</a>
<a href=//baravy.by/me/b.html>baravy.by/me/b.html</a>
<a href=//www.artcon.ru>artcon.ru</a>
<a href=//acmp.ru/index.asp?main=tasks>acmp.ru</a>
<a href=//edition.cnn.com/EVENTS/1996/year.in.review>cnn 1996</a>
<a href=//vetusware.com>vetusware.com</a>
<a href=//old-dos.ru>old-dos.ru</a>
<a href=//nubo.ru>nubo.ru</a>
<a href=//samlib.ru/b>samlib.ru/b</a>
<a href=//umvirt.com/coins/>UmVirt Conis</a>
<a href=//linux.org.ru>LOR</a>
<a href=//opennet.ru>opennet</a>
<a href=//bash.im>bash.im</a> <a href=//bash.im>bash.im</a>
<a href=//opennet.ru>opennet</a>
<a href=//linux.org.ru>LOR</a>
<a href=//baravy.by/me/b.html>baravy.by/me/b.html</a>
<a href=//samlib.ru/b>samlib.ru/b</a>
<a href=//mirrors.pdp-11.ru>mirrors.pdp-11.ru</a>
Simple:
<a href=//dgmag.in>dgmag.in</a>
<a href=//os-menuet.narod.ru>os-menuet.narod.ru</a>
<a href=//mestack.narod.ru/index.html>mestack.narod.ru</a>
<a href=//coolthemes.narod.ru/indexold.html>coolthemes.narod.ru</a>
<a href=//vetusware.com>vetusware.com</a>
Moderate:
<a href=//fdd5-25.pdp-11.ru>fdd5-25</a>
<a href=//acmp.ru/index.asp?main=tasks>acmp.ru</a>
<a href=//old-dos.ru>old-dos.ru</a>
Complex:
<a href=//artcon.ru>artcon.ru</a>
<a href=//edition.cnn.com/EVENTS/1996/year.in.review>cnn 1996</a>
<a href=//nubo.ru>nubo.ru</a>
<a href=//electromyne.de>electromyne.de</a>

View File

@ -187,7 +187,7 @@ struct proc_info
word status_slot,rezerv3; word status_slot,rezerv3;
dword cleft,ctop,cwidth,cheight; dword cleft,ctop,cwidth,cheight;
char status_window; char status_window;
byte reserved[1024-71-8]; byte reserved[1024-71];
}; };
:void GetProcessInfo(dword _process_struct_pointer, _process_id) :void GetProcessInfo(dword _process_struct_pointer, _process_id)