Subversion Repositories Kolibri OS

Rev

Rev 5781 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5781 Rev 5825
Line 28... Line 28...
28
} WB1;
28
} WB1;
29
 
29
 
30
 
30
 
Line 31... Line -...
31
 
-
 
32
byte 	
31
byte 	
33
	link,
32
	link,
34
	ignor_text,
33
	ignor_text,
35
	cur_encoding,
34
	cur_encoding,
36
	t_html,
35
	t_html,
Line 88... Line 87...
88
	if (line) && (!anchor)
87
	if (line) && (!anchor)
Line 89... Line 88...
89
	{
88
	{
90
		start_x = stolbec * list.font_w + body_magrin * DrawBuf.zoom + list.x;
89
		start_x = stolbec * list.font_w + body_magrin * DrawBuf.zoom + list.x;
91
		start_y = stroka * list.line_h + body_magrin;
90
		start_y = stroka * list.item_h + body_magrin;
92
		stolbec_len = utf8_strlen(#line) * DrawBuf.zoom;
91
		stolbec_len = utf8_strlen(#line) * DrawBuf.zoom;
93
		line_length = stolbec_len * list.font_w;
92
		line_length = stolbec_len * list.font_w;
94
 
93
 
Line 95... Line 94...
95
		if (style.h) stroka++;
94
		if (style.h) stroka++;
96
		WriteBufText(start_x, start_y, list.font_type, text_colors[text_color_index], #line, buf_data);
95
		WriteBufText(start_x, start_y, list.font_type, text_colors[text_color_index], #line, buf_data);
97
		if (style.b) WriteBufText(start_x+1, start_y, list.font_type, text_colors[text_color_index], #line, buf_data);
96
		if (style.b) WriteBufText(start_x+1, start_y, list.font_type, text_colors[text_color_index], #line, buf_data);
98
		if (style.i) { stolbec++; DrawBuf.Skew(start_x, start_y, line_length, list.line_h); } // bug with zoom>1
97
		if (style.i) { stolbec++; DrawBuf.Skew(start_x, start_y, line_length, list.item_h); } // bug with zoom>1
99
		if (style.s) DrawBuf.DrawBar(start_x, list.line_h / 2 - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]);
98
		if (style.s) DrawBuf.DrawBar(start_x, list.item_h / 2 - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]);
100
		if (style.u) DrawBuf.DrawBar(start_x, list.line_h - DrawBuf.zoom - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]);
99
		if (style.u) DrawBuf.DrawBar(start_x, list.item_h - DrawBuf.zoom - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]);
101
		if (link) {
100
		if (link) {
102
			DrawBuf.DrawBar(start_x, list.line_h*style.h + list.line_h - DrawBuf.zoom - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]);
101
			DrawBuf.DrawBar(start_x, list.item_h*style.h + list.item_h - DrawBuf.zoom - DrawBuf.zoom + start_y, line_length, DrawBuf.zoom, text_colors[text_color_index]);
103
			PageLinks.AddText(#line, line_length, list.line_h*style.h + list.line_h, UNDERLINE);
102
			PageLinks.AddText(#line, line_length, list.item_h*style.h + list.item_h, UNDERLINE);
104
		}
103
		}
105
		stolbec += stolbec_len;
104
		stolbec += stolbec_len;
106
	}
105
	}
107
}
106
}
108
//============================================================================================
107
//============================================================================================
Line 249... Line 248...
249
//============================================================================================
248
//============================================================================================
250
void TWebBrowser::SetStyle() {
249
void TWebBrowser::SetStyle() {
251
	int left1 = 5 + list.x;
250
	int left1 = 5 + list.x;
252
	int top1 = stroka * list.line_h + list.y + 5;
251
	int top1 = stroka * list.item_h + list.y + 5;
253
	byte opened;
252
	byte opened;
254
	byte meta_encoding;
253
	byte meta_encoding;
255
	//ïðîâåðÿåì òåã îòêðûâàåòñÿ èëè çàêðûâàåòñÿ
254
	//ïðîâåðÿåì òåã îòêðûâàåòñÿ èëè çàêðûâàåòñÿ
256
	if (tag[0] == '/') 
255
	if (tag[0] == '/') 
257
	{
256
	{
258
		 opened = 0;
257
		 opened = 0;
259
		 strcpy(#tag, #tag+1);
258
		 strcpy(#tag, #tag+1);
Line 392... Line 391...
392
		if (opened)
391
		if (opened)
393
		{
392
		{
394
			NewLine();
393
			NewLine();
395
			DrawBuf.DrawBar(style.li_tab * 5 * list.font_w * DrawBuf.zoom + list.x, stroka +1 * list.line_h - 3
394
			DrawBuf.DrawBar(style.li_tab * 5 * list.font_w * DrawBuf.zoom + list.x, stroka +1 * list.item_h - 3
396
			 - DrawBuf.zoom - DrawBuf.zoom, DrawBuf.zoom*2, DrawBuf.zoom*2, 0x454545);
395
			 - DrawBuf.zoom - DrawBuf.zoom, DrawBuf.zoom*2, DrawBuf.zoom*2, 0x454545);
397
		}
396
		}
398
		return;
397
		return;
399
	}
398
	}
400
	if (istag("ul")) || (istag("ol")) {
399
	if (istag("ul")) || (istag("ol")) {
401
		if (!opened)
400
		if (!opened)
402
		{
401
		{
Line 411... Line 410...
411
		$push edi;
410
		$push edi;
412
		NewLine();
411
		NewLine();
413
		$pop edi;
412
		$pop edi;
414
		DrawBuf.DrawBar(5, list.line_h*stroka+4, list.w-10, 1, EDI);
413
		DrawBuf.DrawBar(5, list.item_h*stroka+4, list.w-10, 1, EDI);
415
		NewLine();
414
		NewLine();
416
		return;
415
		return;
417
	}
416
	}
418
	if (istag("meta")) || (istag("?xml")) {
417
	if (istag("meta")) || (istag("?xml")) {
419
		do{
418
		do{
420
			if (isattr("charset=")) || (isattr("content=")) || (isattr("encoding="))
419
			if (isattr("charset=")) || (isattr("content=")) || (isattr("encoding="))
421
			{
420
			{
Line 470... Line 469...
470
	int onleft, ontop;
469
	int onleft, ontop;
471
 
470
 
472
	onleft = list.x + 5;
471
	onleft = list.x + 5;
Line 473... Line 472...
473
	ontop = stroka * list.line_h + list.y + 5;
472
	ontop = stroka * list.item_h + list.y + 5;
474
	if (t_html) && (!t_body) return;
473
	if (t_html) && (!t_body) return;
475
	if (stroka * list.line_h + 5 >= 0) && ( stroka + 1 * list.line_h + 5 < list.h) && (!anchor)
474
	if (stroka * list.item_h + 5 >= 0) && ( stroka + 1 * list.item_h + 5 < list.h) && (!anchor)
476
	{
475
	{
477
		if (style.align == ALIGN_CENTER) && (DrawBuf.zoom==1) DrawBuf.AlignCenter(onleft,ontop,list.w,list.line_h,stolbec * list.font_w);
476
		if (style.align == ALIGN_CENTER) && (DrawBuf.zoom==1) DrawBuf.AlignCenter(onleft,ontop,list.w,list.item_h,stolbec * list.font_w);
478
		if (style.align == ALIGN_RIGHT) && (DrawBuf.zoom==1)  DrawBuf.AlignRight(onleft,ontop,list.w,list.line_h,stolbec * list.font_w);
477
		if (style.align == ALIGN_RIGHT) && (DrawBuf.zoom==1)  DrawBuf.AlignRight(onleft,ontop,list.w,list.item_h,stolbec * list.font_w);
479
	}
478
	}
480
	stroka++;
479
	stroka++;
481
	if (style.blq) stolbec = 6; else stolbec = 0;
480
	if (style.blq) stolbec = 6; else stolbec = 0;
482
	if (style.li) stolbec = style.li_tab * 5;
481
	if (style.li) stolbec = style.li_tab * 5;
483
}
482
}
484
//============================================================================================
483
//============================================================================================
Line 488... Line 487...
488
//============================================================================================
487
//============================================================================================
489
void TWebBrowser::DrawPage()
488
void TWebBrowser::DrawPage()
490
{
489
{
491
	PutPaletteImage(list.first * list.line_h * DrawBuf.bufw * 4 + buf_data+8, DrawBuf.bufw, list.h, DrawBuf.bufx, DrawBuf.bufy, 32, 0);	
490
	PutPaletteImage(list.first * list.item_h * DrawBuf.bufw * 4 + buf_data+8, DrawBuf.bufw, list.h, DrawBuf.bufx, DrawBuf.bufy, 32, 0);	
492
	DrawScroller();
491
	DrawScroller();
493
}
492
}
494
>
493
>
495
494
496
495