Subversion Repositories Kolibri OS

Rev

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

Rev 5746 Rev 5747
Line 23... Line 23...
23
	DrawBufer DrawBuf;
23
	DrawBufer DrawBuf;
24
	void Parse();
24
	void Parse();
25
	void SetTextStyle();
25
	void SetTextStyle();
26
	void DrawPage();
26
	void DrawPage();
27
	void DrawScroller();
27
	void DrawScroller();
-
 
28
	void LoadInternalPage();
28
	void NewLine();
29
	void NewLine();
29
	void Perenos();
30
	void Perenos();
30
	byte end_parsing;
31
	byte end_parsing;
31
} WB1;
32
} WB1;
Line 78... Line 79...
78
#include "..\TWB\img_cache.h"
79
#include "..\TWB\img_cache.h"
79
#include "..\TWB\parce_tag.h"
80
#include "..\TWB\parce_tag.h"
80
#include "..\TWB\table.h"
81
#include "..\TWB\table.h"
Line 81... Line 82...
81
 
82
 
82
 
-
 
83
//=======================================================================
-
 
84
 
83
 
85
 
84
//============================================================================================
86
void TWebBrowser::DrawPage()
85
void TWebBrowser::DrawPage()
Line 87... Line 86...
87
{
86
{
Line 116... Line 115...
116
			PageLinks.AddText(#line, line_length, list.line_h, UNDERLINE);
115
			PageLinks.AddText(#line, line_length, list.line_h, UNDERLINE);
117
		}
116
		}
118
		stolbec += stolbec_len;
117
		stolbec += stolbec_len;
119
	}
118
	}
120
}
119
}
121
//=======================================================================
120
//============================================================================================
-
 
121
void TWebBrowser::LoadInternalPage(dword bufpos, in_filesize){
-
 
122
	bufsize = in_filesize;
-
 
123
	bufpointer = bufpos;
122
 
124
	Parse();
123
 
125
}
-
 
126
//============================================================================================
124
void TWebBrowser::Parse(){
127
void TWebBrowser::Parse(){
125
	word bukva[2];
128
	word bukva[2];
126
	int j;
129
	int j;
127
	byte ignor_param;
130
	byte ignor_param;
128
	char temp[768];
131
	char temp[768];
Line 260... Line 263...
260
		list.first=anchor_line_num;
263
		list.first=anchor_line_num;
261
		Parse();
264
		Parse();
262
	}
265
	}
263
	DrawScroller();
266
	DrawScroller();
264
}
267
}
265
 
-
 
-
 
268
//============================================================================================
266
void TWebBrowser::Perenos()
269
void TWebBrowser::Perenos()
267
{
270
{
268
	int perenos_num;
271
	int perenos_num;
269
	char new_line_text[4096];
272
	char new_line_text[4096];
270
	perenos_num = strrchr(#line, ' ');
273
	perenos_num = strrchr(#line, ' ');
Line 274... Line 277...
274
	if (stroka-1 > list.visible) && (list.first <>0) end_parsing=true;
277
	if (stroka-1 > list.visible) && (list.first <>0) end_parsing=true;
275
	DrawPage();
278
	DrawPage();
276
	strcpy(#line, #new_line_text);
279
	strcpy(#line, #new_line_text);
277
	NewLine();
280
	NewLine();
278
}
281
}
279
 
-
 
280
 
-
 
-
 
282
//============================================================================================
281
char oldtag[100];
283
char oldtag[100];
282
void TWebBrowser::SetTextStyle(int left1, top1) {
284
void TWebBrowser::SetTextStyle(int left1, top1) {
283
	dword hr_color;
285
	dword hr_color;
284
	byte opened;
286
	byte opened;
285
	byte meta_encoding;
287
	byte meta_encoding;
Line 525... Line 527...
525
		style.li = opened;
527
		style.li = opened;
526
		if (opened)
528
		if (opened)
527
		{
529
		{
528
			NewLine();
530
			NewLine();
529
			if (stroka > -1) && (stroka - 2 < list.visible) 
531
			if (stroka > -1) && (stroka - 2 < list.visible) 
530
				DrawBuf.DrawBar(style.li_tab * 5 * list.font_w * DrawBuf.zoom + list.x, list.line_h / 2 - DrawBuf.zoom - DrawBuf.zoom, DrawBuf.zoom*2, DrawBuf.zoom*2, 0x555555);
532
				DrawBuf.DrawBar(style.li_tab * 5 * list.font_w * DrawBuf.zoom + list.x, list.line_h 
-
 
533
					/ 2 - DrawBuf.zoom - DrawBuf.zoom, DrawBuf.zoom*2, DrawBuf.zoom*2, 0x555555);
531
		}
534
		}
532
		return;
535
		return;
533
	}
536
	}
534
	if (istag("u")) || (istag("ins")) style.u = opened;
537
	if (istag("u")) || (istag("ins")) style.u = opened;
535
	if (istag("s")) || (istag("strike")) || (istag("del")) style.s = opened;
538
	if (istag("s")) || (istag("strike")) || (istag("del")) style.s = opened;
Line 597... Line 600...
597
	if (set_new_encoding == CH_CP1251)
600
	if (set_new_encoding == CH_CP1251)
598
	{
601
	{
599
		 bufpointer = ChangeCharset("CP1251", "UTF-8", bufpointer);
602
		 bufpointer = ChangeCharset("CP1251", "UTF-8", bufpointer);
600
	}
603
	}
601
}
604
}
602
 
-
 
603
 
-
 
-
 
605
//============================================================================================
604
void TWebBrowser::DrawScroller()
606
void TWebBrowser::DrawScroller()
605
{
607
{
606
	scroll_wv.max_area = list.count;
608
	scroll_wv.max_area = list.count;
607
	scroll_wv.cur_area = list.visible;
609
	scroll_wv.cur_area = list.visible;
608
	scroll_wv.position = list.first;
610
	scroll_wv.position = list.first;
Line 614... Line 616...
614
	scroll_wv.size_y = list.h;
616
	scroll_wv.size_y = list.h;
615
	scroll_wv.start_x = list.w * DrawBuf.zoom + list.x;
617
	scroll_wv.start_x = list.w * DrawBuf.zoom + list.x;
Line 616... Line 618...
616
 
618
 
617
	scrollbar_v_draw(#scroll_wv);
619
	scrollbar_v_draw(#scroll_wv);
618
}
-
 
619
 
-
 
-
 
620
}
620
 
621
//============================================================================================
621
void TWebBrowser::NewLine()
622
void TWebBrowser::NewLine()
622
{
623
{
Line 623... Line 624...
623
	int onleft, ontop;
624
	int onleft, ontop;
Line 636... Line 637...
636
	}
637
	}
637
	stroka++;
638
	stroka++;
638
	if (style.blq) stolbec = 6; else stolbec = 0;
639
	if (style.blq) stolbec = 6; else stolbec = 0;
639
	if (style.li) stolbec = style.li_tab * 5;
640
	if (style.li) stolbec = style.li_tab * 5;
640
}
641
}
641
 
-
 
642
 
-
 
643
 
-
 
-
 
642
//============================================================================================
644
int istag(dword text) { if (!strcmp(#tag,text)) return 1; else return 0; }
643
int istag(dword text) { if (!strcmp(#tag,text)) return 1; else return 0; }
645
int isattr(dword text) { if (!strcmp(#attr,text)) return 1; else return 0; }
644
int isattr(dword text) { if (!strcmp(#attr,text)) return 1; else return 0; }
646
int isval(dword text) { if (!strcmp(#val,text)) return 1; else return 0; }
645
int isval(dword text) { if (!strcmp(#val,text)) return 1; else return 0; }