forked from KolibriOS/kolibrios
WebView 3.31: speed up text rendering (less strcpy, use pointers), fix click on a non-existing link in the toolbar, use // instwead of http:// in buildin pages
git-svn-id: svn://kolibrios.org@8500 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
941fdfeadc
commit
0d2bbcbde7
@ -56,6 +56,7 @@ struct TWebBrowser {
|
|||||||
|
|
||||||
void SetPageDefaults();
|
void SetPageDefaults();
|
||||||
void ParseHtml();
|
void ParseHtml();
|
||||||
|
void Reparse();
|
||||||
void NewLine();
|
void NewLine();
|
||||||
void ChangeEncoding();
|
void ChangeEncoding();
|
||||||
void AddCharToTheLine();
|
void AddCharToTheLine();
|
||||||
@ -110,6 +111,11 @@ void TWebBrowser::SetPageDefaults()
|
|||||||
tag_table_reset();
|
tag_table_reset();
|
||||||
}
|
}
|
||||||
//============================================================================================
|
//============================================================================================
|
||||||
|
void TWebBrowser::Reparse()
|
||||||
|
{
|
||||||
|
ParseHtml(bufpointer, bufsize);
|
||||||
|
}
|
||||||
|
//============================================================================================
|
||||||
void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){
|
void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){
|
||||||
int tab_len;
|
int tab_len;
|
||||||
dword bufpos;
|
dword bufpos;
|
||||||
@ -223,25 +229,6 @@ void TWebBrowser::AddCharToTheLine(unsigned char _char)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//============================================================================================
|
//============================================================================================
|
||||||
void TWebBrowser::NewLine()
|
|
||||||
{
|
|
||||||
static bool empty_line = true;
|
|
||||||
|
|
||||||
if (draw_x==left_gap) && (draw_y==BODY_MARGIN) return;
|
|
||||||
if (t_html) && (!t_body) return;
|
|
||||||
|
|
||||||
if (draw_x == style.tag_list.level * 5 * list.font_w + left_gap) {
|
|
||||||
if (!empty_line) empty_line=true; else return;
|
|
||||||
} else {
|
|
||||||
empty_line = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
draw_y += style.cur_line_h;
|
|
||||||
style.cur_line_h = list.item_h;
|
|
||||||
if (style.blq) draw_x = 6 * list.font_w; else draw_x = 0;
|
|
||||||
draw_x += style.tag_list.level * 5 * list.font_w + left_gap;
|
|
||||||
}
|
|
||||||
//============================================================================================
|
|
||||||
void TWebBrowser::ChangeEncoding(int _new_encoding)
|
void TWebBrowser::ChangeEncoding(int _new_encoding)
|
||||||
{
|
{
|
||||||
if (cur_encoding == _new_encoding) return;
|
if (cur_encoding == _new_encoding) return;
|
||||||
@ -258,9 +245,7 @@ scroll_bar scroll_wv = { 15,NULL,NULL,NULL,
|
|||||||
|
|
||||||
void TWebBrowser::DrawPage()
|
void TWebBrowser::DrawPage()
|
||||||
{
|
{
|
||||||
if (list.w!=canvas.bufw) {
|
if (list.w!=canvas.bufw) Reparse();
|
||||||
ParseHtml(bufpointer, bufsize);
|
|
||||||
}
|
|
||||||
canvas.Show(list.first, list.h);
|
canvas.Show(list.first, list.h);
|
||||||
|
|
||||||
scroll_wv.max_area = list.count;
|
scroll_wv.max_area = list.count;
|
||||||
|
@ -7,11 +7,13 @@ struct _tag
|
|||||||
collection attributes;
|
collection attributes;
|
||||||
collection values;
|
collection values;
|
||||||
dword value;
|
dword value;
|
||||||
|
dword number;
|
||||||
bool is();
|
bool is();
|
||||||
bool parse();
|
bool parse();
|
||||||
void debug_tag();
|
void debug_tag();
|
||||||
dword get_next_param();
|
dword get_next_param();
|
||||||
dword get_value_of();
|
dword get_value_of();
|
||||||
|
signed get_number_of();
|
||||||
} tag=0;
|
} tag=0;
|
||||||
|
|
||||||
bool _tag::is(dword _text)
|
bool _tag::is(dword _text)
|
||||||
@ -207,3 +209,13 @@ dword _tag::get_value_of(dword _attr_name)
|
|||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
signed _tag::get_number_of(dword _attr_name)
|
||||||
|
{
|
||||||
|
if (get_value_of(_attr_name)) {
|
||||||
|
number = atoi(tag.value);
|
||||||
|
} else {
|
||||||
|
number = 0;
|
||||||
|
}
|
||||||
|
return number;
|
||||||
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
CANVAS canvas;
|
CANVAS canvas;
|
||||||
|
|
||||||
void TWebBrowser::RenderLine()
|
void TWebBrowser::RenderLine(dword _line)
|
||||||
{
|
{
|
||||||
unsigned px; //paint x coordinate
|
unsigned px; //paint x coordinate
|
||||||
unsigned pw; //paint y coordinate
|
unsigned pw; //paint y coordinate
|
||||||
@ -9,22 +9,28 @@ void TWebBrowser::RenderLine()
|
|||||||
|
|
||||||
if (style.title)
|
if (style.title)
|
||||||
{
|
{
|
||||||
strncpy(#header, #linebuf, sizeof(TWebBrowser.header)-1);
|
strncpy(#header, _line, sizeof(TWebBrowser.header)-1);
|
||||||
strncat(#header, " - ", sizeof(TWebBrowser.header)-1);
|
strncat(#header, " - ", sizeof(TWebBrowser.header)-1);
|
||||||
strncat(#header, #version, sizeof(TWebBrowser.header)-1);
|
strncat(#header, #version, sizeof(TWebBrowser.header)-1);
|
||||||
linebuf = 0;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if (t_html) && (!t_body) {
|
else if (t_html) && (!t_body) {
|
||||||
linebuf = 0;
|
//
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else if (ESBYTE[_line])
|
||||||
if (linebuf)
|
|
||||||
{
|
{
|
||||||
pw = strlen(#linebuf) * list.font_w;
|
pw = strlen(_line) * list.font_w;
|
||||||
zoom = list.font_w / BASIC_CHAR_W;
|
zoom = list.font_w / BASIC_CHAR_W;
|
||||||
|
|
||||||
|
if (pw > draw_w) {
|
||||||
|
draw_w = pw;
|
||||||
|
NewLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (debug_mode) {
|
||||||
|
canvas.DrawBar(draw_x, draw_y, pw, list.item_h, 0xCCCccc);
|
||||||
|
debugln(_line);
|
||||||
|
}
|
||||||
|
|
||||||
style.cur_line_h = math.max(style.cur_line_h, list.item_h);
|
style.cur_line_h = math.max(style.cur_line_h, list.item_h);
|
||||||
|
|
||||||
if (bg_colors.get_last() - bg_colors.get(0)) {
|
if (bg_colors.get_last() - bg_colors.get(0)) {
|
||||||
@ -42,63 +48,81 @@ void TWebBrowser::RenderLine()
|
|||||||
pc = text_colors.get_last();
|
pc = text_colors.get_last();
|
||||||
if (link) && (pc == text_colors.get(0)) pc = link_color_default;
|
if (link) && (pc == text_colors.get(0)) pc = link_color_default;
|
||||||
|
|
||||||
canvas.WriteText(draw_x, draw_y, list.font_type, pc, #linebuf, NULL);
|
canvas.WriteText(draw_x, draw_y, list.font_type, pc, _line, NULL);
|
||||||
if (style.b) canvas.WriteText(draw_x+1, draw_y, list.font_type, pc, #linebuf, NULL);
|
if (style.b) canvas.WriteText(draw_x+1, draw_y, list.font_type, pc, _line, NULL);
|
||||||
if (style.s) canvas.DrawBar(draw_x, list.item_h / 2 - zoom + draw_y, pw, zoom, pc);
|
if (style.s) canvas.DrawBar(draw_x, list.item_h / 2 - zoom + draw_y, pw, zoom, pc);
|
||||||
if (style.u) canvas.DrawBar(draw_x, list.item_h - zoom - zoom + draw_y, pw, zoom, pc);
|
if (style.u) canvas.DrawBar(draw_x, list.item_h - zoom - zoom + draw_y, pw, zoom, pc);
|
||||||
if (link) {
|
if (link) {
|
||||||
if (linebuf[0]==' ') && (linebuf[1]==NULL) {} else {
|
if (ESBYTE[_line]==' ') && (ESBYTE[_line+1]==NULL) {} else {
|
||||||
canvas.DrawBar(draw_x, draw_y + list.item_h - calc(zoom*2)-1, pw, zoom, link_color_default);
|
canvas.DrawBar(draw_x, draw_y + list.item_h - calc(zoom*2)-1, pw, zoom, link_color_default);
|
||||||
links.add_text(draw_x, draw_y + list.y, pw, list.item_h - calc(zoom*2)-1, zoom);
|
links.add_text(draw_x, draw_y + list.y, pw, list.item_h - calc(zoom*2)-1, zoom);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
draw_x += pw;
|
draw_x += pw;
|
||||||
if (debug_mode) debugln(#linebuf);
|
|
||||||
}
|
}
|
||||||
linebuf = NULL;
|
ESBYTE[_line] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TWebBrowser::RenderTextbuf()
|
void TWebBrowser::RenderTextbuf()
|
||||||
{
|
{
|
||||||
int break_pos;
|
dword lbp = #linebuf;
|
||||||
char next_line[sizeof(TWebBrowser.linebuf)];
|
int br; //break position
|
||||||
int zoom = list.font_w / BASIC_CHAR_W;
|
char nul = '\0';
|
||||||
|
int len;
|
||||||
|
|
||||||
//Do we need a line break?
|
//Do we need a line break?
|
||||||
while (strlen(#linebuf) * list.font_w + draw_x >= draw_w) {
|
while (len = strlen(lbp)) && (len * list.font_w + draw_x >= draw_w) {
|
||||||
//Yes, we do. Lets calculate where...
|
//Yes, we do. Lets calculate where...
|
||||||
break_pos = strrchr(#linebuf, ' ');
|
br = strrchr(lbp, ' ');
|
||||||
|
|
||||||
//Is a new line fits in the current line?
|
//Is a new line fits in the current line?
|
||||||
if (break_pos * list.font_w + draw_x > draw_w) {
|
if (br * list.font_w + draw_x >= draw_w) {
|
||||||
break_pos = draw_w - draw_x /list.font_w;
|
br = draw_w - draw_x /list.font_w;
|
||||||
while(break_pos) {
|
while(br) {
|
||||||
if (linebuf[break_pos]==' ') {
|
if (ESBYTE[lbp + br]==' ') {
|
||||||
break_pos++;
|
br++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break_pos--;
|
br--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Maybe a new line is too big for the whole new line? Then we have to split it
|
//Maybe a new line is too big for the whole new line? Then we have to split it
|
||||||
if (!break_pos) && (style.tag_list.level*5 + strlen(#linebuf) * zoom >= list.column_max) {
|
if (!br) && (len * list.font_w >= draw_w) {
|
||||||
break_pos = draw_w - draw_x / list.font_w;
|
br = draw_w - draw_x / list.font_w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (br) {
|
||||||
if (break_pos) {
|
ESBYTE[lbp + br] >< nul;
|
||||||
strlcpy(#next_line, #linebuf + break_pos, sizeof(next_line));
|
RenderLine(lbp);
|
||||||
linebuf[break_pos] = 0x00;
|
ESBYTE[lbp + br] >< nul;
|
||||||
RenderLine();
|
lbp += br;
|
||||||
strlcpy(#linebuf, #next_line, sizeof(TWebBrowser.linebuf));
|
while (ESBYTE[lbp]==' ') && (ESBYTE[lbp]) lbp++;
|
||||||
NewLine();
|
if (ESBYTE[lbp]) NewLine();
|
||||||
} else {
|
} else {
|
||||||
NewLine();
|
NewLine();
|
||||||
RenderLine();
|
RenderLine(lbp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RenderLine();
|
RenderLine(lbp);
|
||||||
|
}
|
||||||
|
|
||||||
|
void TWebBrowser::NewLine()
|
||||||
|
{
|
||||||
|
static bool empty_line = true;
|
||||||
|
|
||||||
|
if (draw_x==left_gap) && (draw_y==BODY_MARGIN) return;
|
||||||
|
if (t_html) && (!t_body) return;
|
||||||
|
|
||||||
|
if (draw_x == style.tag_list.level * 5 * list.font_w + left_gap) {
|
||||||
|
if (!empty_line) empty_line=true; else return;
|
||||||
|
} else {
|
||||||
|
empty_line = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
draw_y += style.cur_line_h;
|
||||||
|
style.cur_line_h = list.item_h;
|
||||||
|
if (style.blq) draw_x = 6 * list.font_w; else draw_x = 0; //left_gap += style.tag_list.level * 5 * list.font_w ???
|
||||||
|
draw_x += style.tag_list.level * 5 * list.font_w + left_gap;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TWebBrowser::RenderImage(dword cur_img)
|
bool TWebBrowser::RenderImage(dword cur_img)
|
||||||
|
@ -11,7 +11,7 @@ void TWebBrowser::SetStyle()
|
|||||||
if (tag.is("p")) { tag_p(); return; }
|
if (tag.is("p")) { tag_p(); return; }
|
||||||
if (tag.is("img")) { tag_img(); return; }
|
if (tag.is("img")) { tag_img(); return; }
|
||||||
if (tag.is("div")) { tag_div(); return; }
|
if (tag.is("div")) { tag_div(); return; }
|
||||||
if (tag.is("br")) { NewLine(); return; }
|
if (tag.is("br")) { /*draw_x++;*/NewLine(); return; }
|
||||||
if (tag.is("header")) { NewLine(); return; }
|
if (tag.is("header")) { NewLine(); return; }
|
||||||
if (tag.is("article")) { NewLine(); return; }
|
if (tag.is("article")) { NewLine(); return; }
|
||||||
if (tag.is("footer")) { NewLine(); return; }
|
if (tag.is("footer")) { NewLine(); return; }
|
||||||
@ -202,6 +202,7 @@ void TWebBrowser::tag_hr()
|
|||||||
if (tag.get_value_of("color")) hrcol = GetColor(tag.value);
|
if (tag.get_value_of("color")) hrcol = GetColor(tag.value);
|
||||||
if (draw_x != left_gap) NewLine();
|
if (draw_x != left_gap) NewLine();
|
||||||
canvas.DrawBar(5, style.cur_line_h / 2 + draw_y - 1, draw_w-10, 1, hrcol);
|
canvas.DrawBar(5, style.cur_line_h / 2 + draw_y - 1, draw_w-10, 1, hrcol);
|
||||||
|
draw_x++;
|
||||||
NewLine();
|
NewLine();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -319,82 +320,101 @@ NOIMG:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int tdepth;
|
||||||
|
int col_n;
|
||||||
|
|
||||||
struct TABLE {
|
struct TABLE {
|
||||||
int count;
|
collection_int col_w;
|
||||||
int col;
|
collection_int col_span;
|
||||||
collection_int cx;
|
collection_int row_h;
|
||||||
int row_y, next_row_y;
|
int row_y, next_row_y;
|
||||||
} table;
|
int colcount;
|
||||||
|
} t[5];
|
||||||
|
|
||||||
void TWebBrowser::tag_table_reset()
|
void TWebBrowser::tag_table_reset()
|
||||||
{
|
{
|
||||||
table.count = 0;
|
int i;
|
||||||
table.cx.drop();
|
tdepth = 0;
|
||||||
table.row_y = 0;
|
for (i=0; i<5; i++) {
|
||||||
table.next_row_y = 0;
|
t[i].col_w.drop();
|
||||||
|
t[i].row_h.drop();
|
||||||
|
t[i].col_span.drop();
|
||||||
|
t[i].row_y = 0;
|
||||||
|
t[i].next_row_y = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TWebBrowser::tag_table()
|
void TWebBrowser::tag_table()
|
||||||
{
|
{
|
||||||
if (tag.opened) {
|
if (tag.opened) {
|
||||||
if (!table.count) {
|
if (tdepth==0) {
|
||||||
table.next_row_y = table.row_y = draw_y;
|
t[0].next_row_y = t[0].row_y = draw_y;
|
||||||
}
|
}
|
||||||
table.count++;
|
tdepth++;
|
||||||
} else {
|
} else {
|
||||||
table.count--;
|
tdepth--;
|
||||||
if (!table.count) {
|
if (tdepth==0) {
|
||||||
draw_y = math.max(draw_y + style.cur_line_h, table.next_row_y);
|
draw_y = math.max(draw_y + style.cur_line_h, t[0].next_row_y);
|
||||||
left_gap = BODY_MARGIN;
|
left_gap = BODY_MARGIN;
|
||||||
|
draw_w = list.w - BODY_MARGIN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TWebBrowser::tag_tr()
|
:void TWebBrowser::tag_tr()
|
||||||
{
|
{
|
||||||
if (tag.opened) {
|
if (tag.opened) {
|
||||||
if (table.count>1) {
|
if (tdepth>1) {
|
||||||
NewLine();
|
NewLine();
|
||||||
} else {
|
} else {
|
||||||
table.col = 0;
|
t[0].colcount = math.max(t[0].colcount, col_n);
|
||||||
table.row_y = math.max(draw_y + style.cur_line_h, table.next_row_y);
|
col_n = 0;
|
||||||
|
t[0].row_y = math.max(draw_y + style.cur_line_h, t[0].next_row_y);
|
||||||
left_gap = BODY_MARGIN;
|
left_gap = BODY_MARGIN;
|
||||||
NewLine();
|
NewLine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TWebBrowser::tag_td()
|
:void TWebBrowser::tag_td()
|
||||||
{
|
{
|
||||||
if (table.count>1) return;
|
if (tdepth>1) return;
|
||||||
if (tag.opened) {
|
if (tag.opened) {
|
||||||
table.next_row_y = math.max(draw_y + style.cur_line_h, table.next_row_y);
|
|
||||||
draw_y = table.row_y;
|
t[0].next_row_y = math.max(draw_y + style.cur_line_h, t[0].next_row_y);
|
||||||
table.cx.set(table.col, math.max(draw_x,table.cx.get(table.col)) );
|
style.cur_line_h = list.item_h;
|
||||||
draw_x = left_gap = table.cx.get(table.col);
|
t[0].col_w.set(col_n, math.max(draw_x,t[0].col_w.get(col_n)) );
|
||||||
table.col++;
|
draw_x = left_gap = t[0].col_w.get(col_n);
|
||||||
if (tag.get_value_of("width")) {
|
draw_w = list.w - left_gap;
|
||||||
draw_w = EAX;
|
draw_y = t[0].row_y;
|
||||||
//debugval("draw_w", atoi(tag.value));
|
if (tag.get_number_of("width")) {
|
||||||
table.cx.set(table.col, draw_x + atoi(tag.value));
|
if (!strchr(tag.value, '%')) {
|
||||||
|
draw_w = tag.number;
|
||||||
|
} else {
|
||||||
|
if (tag.number < 100) {
|
||||||
|
draw_w = draw_w - left_gap * tag.number / 100;
|
||||||
|
if (draw_w > list.w - left_gap) draw_w = list.w - left_gap;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
col_n++;
|
||||||
|
t[0].col_w.set(col_n, draw_x + draw_w);
|
||||||
|
|
||||||
|
if (left_gap >= list.w - list.font_w - 10) {
|
||||||
|
debugln("left_gap overflow");
|
||||||
|
draw_x = left_gap = BODY_MARGIN;
|
||||||
|
t[0].col_w.drop();
|
||||||
|
NewLine();
|
||||||
|
canvas.WriteText(draw_x, draw_y, 10011001b, 0xFE0000, "lgo", NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (draw_w < 0) || (draw_w >= list.w) {
|
||||||
|
debugln("draw_w overflow");
|
||||||
|
draw_x = left_gap = BODY_MARGIN;
|
||||||
|
draw_w = list.w - left_gap;
|
||||||
|
NewLine();
|
||||||
|
canvas.WriteText(draw_x, draw_y, 10011001b, 0x0000FE, "drwo", NULL);
|
||||||
}
|
}
|
||||||
//if (tag.get_value_of("height")) table.next_row_y = draw_y + atoi(tag.value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (left_gap >= list.w - list.font_w - 10) {
|
|
||||||
debugln("left_gap overflow");
|
|
||||||
draw_x = left_gap = BODY_MARGIN;
|
|
||||||
table.cx.drop();
|
|
||||||
table.count = 999;
|
|
||||||
NewLine();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (draw_w < 0) || (draw_w >= list.w) {
|
|
||||||
debugln("draw_w overflow");
|
|
||||||
draw_x = left_gap = BODY_MARGIN;
|
|
||||||
draw_w = list.w - left_gap;
|
|
||||||
NewLine();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -149,9 +149,10 @@ void main()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (links.hover(WB1.list.y, WB1.list.first))
|
if (WB1.list.MouseOver(mouse.x, mouse.y)) && (links.hover(WB1.list.y, WB1.list.first))
|
||||||
{
|
{
|
||||||
if (mouse.key&MOUSE_MIDDLE) && (mouse.up) {
|
if (mouse.key&MOUSE_MIDDLE) && (mouse.up) {
|
||||||
|
GetKeyModifier();
|
||||||
if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) {
|
if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) {
|
||||||
EventClickLink(TARGET_NEW_WINDOW);
|
EventClickLink(TARGET_NEW_WINDOW);
|
||||||
} else {
|
} else {
|
||||||
@ -298,29 +299,30 @@ void ProcessButtonClick(dword id__)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProcessKeyEvent()
|
void ProcessKeyEvent()
|
||||||
{
|
{
|
||||||
if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT)
|
if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT)
|
||||||
{
|
{
|
||||||
if (key_scancode == SCAN_CODE_TAB) {EventActivatePreviousTab();return;}
|
if (key_scancode == SCAN_CODE_TAB) {EventActivatePreviousTab();return;}
|
||||||
|
if (key_scancode == SCAN_CODE_KEY_T) {EventOpenNewTab(URL_SERVICE_TEST);return;}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) switch(key_scancode)
|
if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) switch(key_scancode)
|
||||||
{
|
{
|
||||||
case SCAN_CODE_KEY_O: EventOpenDialog(); return true;
|
case SCAN_CODE_KEY_O: EventOpenDialog(); return;
|
||||||
case SCAN_CODE_KEY_H: ProcessButtonClick(VIEW_HISTORY); return true;
|
case SCAN_CODE_KEY_H: ProcessButtonClick(VIEW_HISTORY); return;
|
||||||
case SCAN_CODE_KEY_U: EventViewSource(); return true;
|
case SCAN_CODE_KEY_U: EventViewSource(); return;
|
||||||
case SCAN_CODE_KEY_T: EventOpenNewTab(URL_SERVICE_HOMEPAGE); return true;
|
case SCAN_CODE_KEY_T: EventOpenNewTab(URL_SERVICE_HOMEPAGE); return;
|
||||||
case SCAN_CODE_KEY_N: RunProgram(#program_path, NULL); return true;
|
case SCAN_CODE_KEY_N: RunProgram(#program_path, NULL); return;
|
||||||
case SCAN_CODE_KEY_J: ProcessButtonClick(DOWNLOAD_MANAGER); return true;
|
case SCAN_CODE_KEY_J: ProcessButtonClick(DOWNLOAD_MANAGER); return;
|
||||||
case SCAN_CODE_KEY_R: ProcessButtonClick(REFRESH_BUTTON); return true;
|
case SCAN_CODE_KEY_R: ProcessButtonClick(REFRESH_BUTTON); return;
|
||||||
case SCAN_CODE_ENTER: EventSeachWeb(); return true;
|
case SCAN_CODE_ENTER: EventSeachWeb(); return;
|
||||||
case SCAN_CODE_LEFT: ProcessButtonClick(BACK_BUTTON); return true;
|
case SCAN_CODE_LEFT: ProcessButtonClick(BACK_BUTTON); return;
|
||||||
case SCAN_CODE_RIGHT: ProcessButtonClick(FORWARD_BUTTON); return true;
|
case SCAN_CODE_RIGHT: ProcessButtonClick(FORWARD_BUTTON); return;
|
||||||
case SCAN_CODE_KEY_W: EventCloseActiveTab(); return true;
|
case SCAN_CODE_KEY_W: EventCloseActiveTab(); return;
|
||||||
case SCAN_CODE_TAB: EventActivateNextTab(); return true;
|
case SCAN_CODE_TAB: EventActivateNextTab(); return;
|
||||||
case SCAN_CODE_F5: EventClearCache(); return;
|
case SCAN_CODE_F5: EventClearCache(); return;
|
||||||
default: return false;
|
default: return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(key_scancode)
|
switch(key_scancode)
|
||||||
@ -371,7 +373,7 @@ void draw_window()
|
|||||||
WB1.list.h-1, scroll_wv.bckg_col);
|
WB1.list.h-1, scroll_wv.bckg_col);
|
||||||
|
|
||||||
if (!canvas.bufw) {
|
if (!canvas.bufw) {
|
||||||
OpenPage(history.current());
|
EventOpenFirstPage();
|
||||||
} else {
|
} else {
|
||||||
WB1.DrawPage();
|
WB1.DrawPage();
|
||||||
DrawOmnibox();
|
DrawOmnibox();
|
||||||
@ -381,6 +383,11 @@ void draw_window()
|
|||||||
DrawTabsBar();
|
DrawTabsBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EventOpenFirstPage()
|
||||||
|
{
|
||||||
|
OpenPage(history.current());
|
||||||
|
}
|
||||||
|
|
||||||
void EventManuallyChangeEncoding(int _new_encoding)
|
void EventManuallyChangeEncoding(int _new_encoding)
|
||||||
{
|
{
|
||||||
dword newbuf, newsize;
|
dword newbuf, newsize;
|
||||||
@ -921,12 +928,13 @@ void EventDownloadAndOpenImage(dword _url)
|
|||||||
|
|
||||||
void HandleRedirect()
|
void HandleRedirect()
|
||||||
{
|
{
|
||||||
char redirect_url[URL_SIZE];
|
dword redirect_url = malloc(URL_SIZE);
|
||||||
http.header_field("location", #redirect_url, URL_SIZE);
|
http.header_field("location", redirect_url, URL_SIZE);
|
||||||
get_absolute_url(#redirect_url, http.cur_url);
|
get_absolute_url(redirect_url, http.cur_url);
|
||||||
http.hfree();
|
http.hfree();
|
||||||
if (http_get_type==PAGE) OpenPage(#redirect_url);
|
if (http_get_type==PAGE) OpenPage(redirect_url);
|
||||||
else if (http_get_type==IMG) GetUrl(#redirect_url);
|
else if (http_get_type==IMG) GetUrl(redirect_url);
|
||||||
|
free(redirect_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
dword GetImg(bool _new)
|
dword GetImg(bool _new)
|
||||||
@ -948,7 +956,7 @@ dword GetImg(bool _new)
|
|||||||
if (_new) return;
|
if (_new) return;
|
||||||
DrawOmnibox();
|
DrawOmnibox();
|
||||||
DrawStatusBar(T_RENDERING);
|
DrawStatusBar(T_RENDERING);
|
||||||
WB1.ParseHtml(WB1.bufpointer, WB1.bufsize);
|
WB1.Reparse();
|
||||||
WB1.DrawPage();
|
WB1.DrawPage();
|
||||||
debugln(sprintf(#param, T_DONE_IN_SEC, GetStartTime()-render_start_time/100));
|
debugln(sprintf(#param, T_DONE_IN_SEC, GetStartTime()-render_start_time/100));
|
||||||
DrawStatusBar(NULL);
|
DrawStatusBar(NULL);
|
||||||
|
@ -107,4 +107,4 @@ char editbox_icons[] = FROM "res/editbox_icons.raw";
|
|||||||
|
|
||||||
#define DEFAULT_URL URL_SERVICE_HOMEPAGE
|
#define DEFAULT_URL URL_SERVICE_HOMEPAGE
|
||||||
|
|
||||||
char version[]="WebView 3.30";
|
char version[]="WebView 3.31";
|
@ -1,8 +1,8 @@
|
|||||||
<html><head><title>WebView Help</title></head><body>
|
<html><title>WebView Help</title><body>
|
||||||
|
|
||||||
<h1>WebView Text-Based Browser</h1>
|
<h1>WebView Text-Based Browser</h1>
|
||||||
|
|
||||||
It is free and open-source. If you have any suggestions or want to help improving it please visit its topic at <a href="http://board.kolibrios.org/viewtopic.php?f=40&t=1075">board.kolibrios.org</a><pre>
|
It is free and open-source. If you have any suggestions or want to help improving it please visit its topic at <a href="//board.kolibrios.org/viewtopic.php?f=40&t=1075">board.kolibrios.org</a><pre>
|
||||||
|
|
||||||
<b>Shortcut keys</b>
|
<b>Shortcut keys</b>
|
||||||
|
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
|
||||||
<meta charset="cp-866">
|
<meta charset="cp-866">
|
||||||
<title>‘¯à ¢ª WebView</title>
|
<title>‘¯à ¢ª WebView</title>
|
||||||
</head>
|
|
||||||
<body><pre><h1>‘¯à ¢ª WebView</h1>
|
<body><pre><h1>‘¯à ¢ª WebView</h1>
|
||||||
|
|
||||||
<b>Š« ¢¨è¨ ¡ëáâண® ¢ë§®¢ </b>
|
<b>Š« ¢¨è¨ ¡ëáâண® ¢ë§®¢ </b>
|
||||||
|
|
||||||
<font bg=C7CEE4>[CTRL + N ¨«¨ CTRL + T]</font> <20>®¢®¥ ®ª®
|
<font bg=C7CEE4>[CTRL + N ¨«¨ CTRL + T]</font> <20>®¢®¥ ®ª®
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="uft">
|
|
||||||
<title>Homepage</title>
|
<title>Homepage</title>
|
||||||
</head>
|
</head>
|
||||||
<body><pre>Bookmarks:
|
<body><pre>Bookmarks:
|
||||||
1. <a href=http://kolibrios.org>KolibriOS homepage</a>
|
1. <a href=//kolibrios.org>KolibriOS homepage</a>
|
||||||
2. <a href=http://kolibri-n.org>KolibriN homepage</a>
|
2. <a href=//kolibri-n.org>KolibriN homepage</a>
|
||||||
3. <a href="http://store.kolibri-n.org">Kolibri Stuff</a>
|
3. <a href="//store.kolibri-n.org">Kolibri Stuff</a>
|
||||||
|
|
||||||
<font bg=#F8F15B>By the way,</font>
|
<font bg=#F8F15B>By the way,</font>
|
||||||
<font color="#555555">• You can check for browser updates from the main menu.
|
<font color="#555555">• You can check for browser updates from the main menu.
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
<title>„®¬ èïï áâà ¨æ </title>
|
<title>„®¬ èïï áâà ¨æ </title>
|
||||||
</head>
|
</head>
|
||||||
<body><pre>‡ ª« ¤ª¨:
|
<body><pre>‡ ª« ¤ª¨:
|
||||||
1. <a href=http://kolibrios.org>„®¬ èïï áâà ¨æ KolibriOS</a>
|
1. <a href=//kolibrios.org>„®¬ èïï áâà ¨æ KolibriOS</a>
|
||||||
2. <a href=http://kolibri-n.org>KolibriN10</a>
|
2. <a href=//kolibri-n.org>KolibriN10</a>
|
||||||
3. <a href="http://store.kolibri-n.org">Kolibri Store</a>
|
3. <a href="//store.kolibri-n.org">Kolibri Store</a>
|
||||||
|
|
||||||
<font bg=#F8F15B>Šáâ â¨,</font>
|
<font bg=#F8F15B>Šáâ â¨,</font>
|
||||||
<font color="#555555">• ˆ§ £« ¢®£® ¬¥î ¬®¦® ¯à®¢¥à¨âì «¨ç¨¥ ®¡®¢«¥¨©
|
<font color="#555555">• ˆ§ £« ¢®£® ¬¥î ¬®¦® ¯à®¢¥à¨âì «¨ç¨¥ ®¡®¢«¥¨©
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
<html>
|
<html>
|
||||||
<head><title>WebView Test Page</title></head>
|
<title>TEST</title>
|
||||||
<body>
|
<body>
|
||||||
<pre>
|
<pre>
|
||||||
<a href=http://kolibrios.org>KolibriOS</a>
|
<a href=//kolibrios.org>KolibriOS</a>
|
||||||
<a href=http://kolibri-n.org>KolibriN10</a>
|
<a href=//kolibri-n.org>KolibriN10</a>
|
||||||
<a href=http://store.kolibri-n.org>Kolibri Store</a>
|
<a href=//store.kolibri-n.org>Kolibri Store</a>
|
||||||
|
|
||||||
<a href=http://os-menuet.narod.ru>os-menuet.narod.ru</a>
|
<a href=//os-menuet.narod.ru>os-menuet.narod.ru</a>
|
||||||
<a href=http://coolthemes.narod.ru/indexold.html>coolthemes.narod.ru</a>
|
<a href=//coolthemes.narod.ru/indexold.html>coolthemes.narod.ru</a>
|
||||||
<a href=http://www.fdd5-25.net/index.htm>fdd5-25.net</a>
|
<a href=//www.fdd5-25.net/index.htm>fdd5-25.net</a>
|
||||||
<a href=http://www.mestack.narod.ru/index.html>mestack.narod.ru</a>
|
<a href=//www.mestack.narod.ru/index.html>mestack.narod.ru</a>
|
||||||
<a href=http://dgmag.in>dgmag.in</a>
|
<a href=//dgmag.in>dgmag.in</a>
|
||||||
<a href=http://baravy.by/me/b.html>http://baravy.by/me/b.html</a>
|
<a href=//baravy.by/me/b.html>baravy.by/me/b.html</a>
|
||||||
|
|
||||||
<a href=http://www.artcon.ru>artcon.ru</a>
|
<a href=//www.artcon.ru>artcon.ru</a>
|
||||||
<a href=https://acmp.ru/index.asp?main=tasks>acmp.ru</a>
|
<a href=//acmp.ru/index.asp?main=tasks>acmp.ru</a>
|
||||||
<a href=http://edition.cnn.com/EVENTS/1996/year.in.review>cnn 1996</a>
|
<a href=//edition.cnn.com/EVENTS/1996/year.in.review>cnn 1996</a>
|
||||||
<a href=https://vetusware.com>vetusware.com</a>
|
<a href=//vetusware.com>vetusware.com</a>
|
||||||
<a href=http://old-dos.ru>old-dos.ru</a>
|
<a href=//old-dos.ru>old-dos.ru</a>
|
||||||
<a href=http://nubo.ru>nubo.ru</a>
|
<a href=//nubo.ru>nubo.ru</a>
|
||||||
<a href=http://samlib.ru/b>samlib.ru/b</a>
|
<a href=//samlib.ru/b>samlib.ru/b</a>
|
||||||
|
|
||||||
<a href=http://umvirt.com/coins>UmVirt Conis</a>
|
<a href=//umvirt.com/coins/>UmVirt Conis</a>
|
||||||
<a href=http://linux.org.ru>LOR</a>
|
<a href=//linux.org.ru>LOR</a>
|
||||||
<a href=http://opennet.ru>opennet</a>
|
<a href=//opennet.ru>opennet</a>
|
||||||
<a href=https://bash.im>bash.im</a>
|
<a href=//bash.im>bash.im</a>
|
@ -147,7 +147,7 @@ void EventTabClose(int _id)
|
|||||||
tab.close(_id);
|
tab.close(_id);
|
||||||
tab.restore(tab.active);
|
tab.restore(tab.active);
|
||||||
SetElementSizes();
|
SetElementSizes();
|
||||||
WB1.ParseHtml(WB1.bufpointer, WB1.bufsize);
|
WB1.Reparse();
|
||||||
WB1.DrawPage();
|
WB1.DrawPage();
|
||||||
SetOmniboxText(history.current());
|
SetOmniboxText(history.current());
|
||||||
} else {
|
} else {
|
||||||
@ -170,7 +170,7 @@ void EventTabClick(int _id)
|
|||||||
tab.restore(_id);
|
tab.restore(_id);
|
||||||
DrawTabsBar();
|
DrawTabsBar();
|
||||||
SetElementSizes();
|
SetElementSizes();
|
||||||
WB1.ParseHtml(WB1.bufpointer, WB1.bufsize);
|
WB1.Reparse();
|
||||||
WB1.DrawPage();
|
WB1.DrawPage();
|
||||||
SetOmniboxText(history.current());
|
SetOmniboxText(history.current());
|
||||||
DrawStatusBar(NULL);
|
DrawStatusBar(NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user