Subversion Repositories Kolibri OS

Rev

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

Rev 8462 Rev 8491
Line 1... Line 1...
1
CANVAS canvas;
1
CANVAS canvas;
Line 2... Line 2...
2
 
2
 
3
void TWebBrowser::Render()
3
void TWebBrowser::RenderLine()
4
{
4
{
5
	unsigned px; //paint x coordinate
5
	unsigned px; //paint x coordinate
6
	unsigned pw; //paint y coordinate
6
	unsigned pw; //paint y coordinate
7
	   dword pc; //paint color
7
	   dword pc; //paint color
Line 56... Line 56...
56
		if (debug_mode) debugln(#line);
56
		if (debug_mode) debugln(#line);
57
		line = NULL;
57
		line = NULL;
58
	}
58
	}
59
}
59
}
Line -... Line 60...
-
 
60
 
-
 
61
void TWebBrowser::RenderTextbuf()
-
 
62
{
-
 
63
	int break_pos;
-
 
64
	char next_line[4096];
-
 
65
	int zoom = list.font_w / BASIC_CHAR_W;
-
 
66
 
-
 
67
	//Do we need a line break?
-
 
68
	while (strlen(#line) * list.font_w + draw_x >= draw_w) {
-
 
69
		//Yes, we do. Lets calculate where...
-
 
70
		break_pos = strrchr(#line, ' ');
-
 
71
 
-
 
72
		//Is a new line fits in the current line?
-
 
73
		if (break_pos * list.font_w + draw_x > draw_w) {
-
 
74
			break_pos = draw_w - draw_x /list.font_w;
-
 
75
			while(break_pos) && (line[break_pos]!=' ') break_pos--;
-
 
76
		}
-
 
77
		//Maybe a new line is too big for the whole new line? Then we have to split it
-
 
78
		if (!break_pos) && (style.tag_list.level*5 + strlen(#line) * zoom >= list.column_max) {
-
 
79
			break_pos = draw_w  - draw_x / list.font_w;
-
 
80
		}
-
 
81
 
-
 
82
		strcpy(#next_line, #line + break_pos);
-
 
83
		line[break_pos] = 0x00;		
-
 
84
		
-
 
85
		RenderLine();
-
 
86
 
-
 
87
		strcpy(#line, #next_line);
-
 
88
		NewLine();		
-
 
89
	}
-
 
90
	RenderLine();
-
 
91
}
60
 
92
 
61
bool TWebBrowser::RenderImage(dword cur_img)
93
bool TWebBrowser::RenderImage(dword cur_img)
62
{
94
{
63
	int img_x, img_y, img_w, img_h;
95
	int img_x, img_y, img_w, img_h;