Subversion Repositories Kolibri OS

Rev

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

Rev 7748 Rev 7749
Line 94... Line 94...
94
		start_x = stolbec * list.font_w + body_magrin + list.x;
94
		start_x = stolbec * list.font_w + body_magrin + list.x;
95
		stolbec_len = strlen(#line) * zoom;
95
		stolbec_len = strlen(#line) * zoom;
96
		line_length = stolbec_len * list.font_w;
96
		line_length = stolbec_len * list.font_w;
97
 
97
 
Line -... Line 98...
-
 
98
		if (debug_mode) {
-
 
99
			DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h-1, 0xDDDddd);
-
 
100
		}
-
 
101
 
98
		if (style.bg_color!=page_bg) {
102
		if (style.bg_color!=page_bg) {
99
			DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h-1, style.bg_color);
103
			DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h-1, style.bg_color);
100
		}
104
		}
Line 101... Line 105...
101
 
105
 
Line 152... Line 156...
152
	bool ignor_param;
156
	bool ignor_param;
153
	dword bufpos;
157
	dword bufpos;
154
	dword line_len;
158
	dword line_len;
155
	SetPageDefaults();
159
	SetPageDefaults();
156
	if (strstri(bufpointer, "
160
	if (strstri(bufpointer, "
-
 
161
		t_body = true;
-
 
162
		if (strstri(bufpointer, "
157
	else if (strstri(bufpointer, "
163
	} 
158
	for (bufpos=bufpointer ; (bufpos < bufpointer+bufsize) && (ESBYTE[bufpos]!=0) ; bufpos++;)
-
 
-
 
164
	for (bufpos=bufpointer ; (bufpos < bufpointer+bufsize) && (ESBYTE[bufpos]!=0) ; bufpos++;)
159
	{
165
	{
160
		bukva = ESBYTE[bufpos];
166
		bukva = ESBYTE[bufpos];
161
		switch (bukva)
167
		switch (bukva)
162
		{
168
		{
163
		case 0x0a:
169
		case 0x0a:
Line 178... Line 184...
178
				break;
184
				break;
179
			}
185
			}
180
			goto DEFAULT_MARK;
186
			goto DEFAULT_MARK;
181
		case '&': //  and so on
187
		case '&': //  and so on
182
			bufpos++;
188
			for (j=1, tag=0; (ESBYTE[bufpos+j]<>';') && (j<8); j++)
183
			tag=0;
-
 
184
			for (j=0; (ESBYTE[bufpos]<>';') && (j<7);   j++, bufpos++;)
-
 
185
			{
189
			{
186
				bukva = ESBYTE[bufpos];
190
				bukva = ESBYTE[bufpos+j];
187
				chrcat(#tag, bukva);
191
				chrcat(#tag, bukva);
188
			}
192
			}
189
			if (bukva = GetUnicodeSymbol()) goto DEFAULT_MARK;
193
			if (bukva = GetUnicodeSymbol(#tag)) {
190
			break;
194
				bufpos += j;
-
 
195
			} else {
-
 
196
				bukva = '&';
-
 
197
			}
-
 
198
			goto DEFAULT_MARK;
-
 
199
			break;
191
		case '<':
200
		case '<':
192
			bufpos++;
201
			bufpos++;
193
			if (!strncmp(bufpos,"!--",3))
202
			if (!strncmp(bufpos,"!--",3))
194
			{
203
			{
195
				bufpos+=3;
204
				bufpos+=3;
Line 222... Line 231...
222
			if (istag("script")) || (istag("style")) || (istag("binary")) || (istag("select"))  { 
231
			if (istag("script")) || (istag("style")) || (istag("binary")) || (istag("select"))  { 
223
				sprintf(#tagparam, "", #tag);
232
				sprintf(#tagparam, "", #tag);
224
				j = strstri(bufpos, #tagparam);
233
				j = strstri(bufpos, #tagparam);
225
				if (j!=-1) {
234
				if (j!=-1) {
226
					bufpos = j;
235
					bufpos = j-1;
227
				}
236
				}
228
				tag = tagparam = NULL;
237
				tag = tagparam = NULL;
229
				break;
238
				break;
230
			}
239
			}
231
 
240
 
Line 284... Line 293...
284
	NewLine();
293
	NewLine();
285
}
294
}
286
//============================================================================================
295
//============================================================================================
287
void TWebBrowser::SetStyle() {
296
void TWebBrowser::SetStyle() {
288
	char img_path[4096];
297
	char img_path[4096]=0;
289
	int left1 = body_magrin + list.x;
298
	int left1 = body_magrin + list.x;
290
	int meta_encoding;
299
	int meta_encoding;
291
	if (istag("html")) {
300
	if (istag("html")) {
292
		t_html = opened;
301
		t_html = opened;
293
		return;
302
		return;
294
	}
303
	}
Line 394... Line 403...
394
	if (istag("pre")) || (istag("code")) { style.pre = opened; return; }
403
	if (istag("pre")) || (istag("code")) { style.pre = opened; return; }
395
	if (istag("img")) {
404
	if (istag("img")) {
396
		do{
405
		do{
397
			if (isattr("src=")) strncpy(#img_path, #val, sizeof(img_path)-1);
406
			if (isattr("src=")) strncpy(#img_path, #val, sizeof(img_path)-1);
398
			if (isattr("alt=")) && (strlen(#val)
407
			if (isattr("title=")) && (strlen(#val)
399
			if (isattr("title=")) && (strlen(#val)
408
			if (isattr("alt=")) && (strlen(#val)
400
		} while(GetNextParam());
409
		} while(GetNextParam());
401
		style.image = true;
410
		if (!img_path) return;
-
 
411
		style.image = true;
402
		text_color_index++;
412
		text_color_index++;
403
		text_colors[text_color_index] = 0x9A6F29;
413
		text_colors[text_color_index] = 0x9A6F29;
404
		if (!line) {
414
		if (!line) {
405
			if (!strncmp(#img_path, "data:", 5)) img_path=0;
415
			if (!strncmp(#img_path, "data:", 5)) img_path=0;
406
			sprintf(#line, "[%s]", #img_path+strrchr(#img_path, '/'));
416
			replace_char(#img_path, '?', NULL, strlen(#img_path));
-
 
417
			sprintf(#line, "[%s]", #img_path+strrchr(#img_path, '/'));
407
			line[50]= NULL;
418
			line[50]= NULL;
408
		}
419
		}
409
		if (strlen(#line) + stolbec > list.column_max) Perenos();
420
		if (strlen(#line) + stolbec > list.column_max) Perenos();
410
		DrawStyle();
421
		DrawStyle();
411
		line=0;
422
		line=0;
Line 530... Line 541...
530
	static int empty_line=0;
541
	static int empty_line=0;
531
 
542
 
Line 532... Line 543...
532
	if (!stolbec) && (draw_y==body_magrin) return;
543
	if (!stolbec) && (draw_y==body_magrin) return;
Line -... Line 544...
-
 
544
	
-
 
545
	if (style.li) && (stolbec == style.li_tab * 5) { 
-
 
546
		if (empty_line<1) empty_line++;
533
	
547
		else return;
534
	if (!stolbec) { 
548
	} else if (!stolbec) { 
535
		if (empty_line<1) empty_line++;
549
		if (empty_line<1) empty_line++;
536
		else return;
550
		else return;
537
	} else {
551
	} else {
538
		empty_line=0;
552
		empty_line=0;