Subversion Repositories Kolibri OS

Rev

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

Rev 5749 Rev 5766
Line 28... Line 28...
28
#include "..\lib\patterns\libimg_load_skin.h"
28
#include "..\lib\patterns\libimg_load_skin.h"
Line 29... Line 29...
29
 
29
 
Line 30... Line 30...
30
char homepage[] = FROM "html\\homepage.htm";
30
char homepage[] = FROM "html\\homepage.htm";
31
 
31
 
32
#ifdef LANG_RUS
32
#ifdef LANG_RUS
33
	char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 1.23";
33
	char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 1.3 UNSTABLE";
34
	?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
34
	?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
35
	?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
35
	?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
36
	char loading[] = "‡ £à㧪  áâà ­¨æë...
";
36
	char loading[] = "‡ £à㧪  áâà ­¨æë...
";
37
	char page_not_found[] = FROM "html\page_not_found_ru.htm";
37
	char page_not_found[] = FROM "html\page_not_found_ru.htm";
38
	char accept_language[]= "Accept-Language: ru\n";
38
	char accept_language[]= "Accept-Language: ru\n";
39
#else
39
#else
40
	char version[]=" Text-based Browser 1.23";
40
	char version[]=" Text-based Browser 1.3 UNSTABLE";
41
	?define IMAGES_CACHE_CLEARED "Images cache cleared"
41
	?define IMAGES_CACHE_CLEARED "Images cache cleared"
42
	?define T_LAST_SLIDE "This slide is the last"
42
	?define T_LAST_SLIDE "This slide is the last"
43
	char loading[] = "Loading...
";
43
	char loading[] = "Loading...
";
Line 180... Line 180...
180
					}
180
					}
181
				}
181
				}
182
				//Mouse scroll
182
				//Mouse scroll
183
				if (mouse.vert)
183
				if (mouse.vert)
184
				{
184
				{
185
					if (WB1.list.MouseScroll(mouse.vert)) WB1.Parse();
185
					if (WB1.list.MouseScroll(mouse.vert)) WB1.DrawPage();
186
				}
186
				}
187
				//Drag scroller
187
				//Drag scroller
188
				scroll_wv.all_redraw = 0;
188
				scroll_wv.all_redraw = 0;
189
				if (!mouse.lkm) scroll_used=0;
189
				if (!mouse.lkm) scroll_used=0;
190
				if (mouse.x>=scroll_wv.start_x) && (mouse.x<=scroll_wv.start_x+scroll_wv.size_x) 
190
				if (mouse.x>=scroll_wv.start_x) && (mouse.x<=scroll_wv.start_x+scroll_wv.size_x) 
Line 199... Line 199...
199
					half_scroll_size = WB1.list.h - 16 * WB1.list.visible / WB1.list.count - 3 /2;
199
					half_scroll_size = WB1.list.h - 16 * WB1.list.visible / WB1.list.count - 3 /2;
200
					if (half_scroll_size+WB1.list.y>mouse.y) || (mouse.y<0) || (mouse.y>4000) mouse.y=half_scroll_size+WB1.list.y;
200
					if (half_scroll_size+WB1.list.y>mouse.y) || (mouse.y<0) || (mouse.y>4000) mouse.y=half_scroll_size+WB1.list.y;
201
					btn=WB1.list.first;
201
					btn=WB1.list.first;
202
					WB1.list.first = mouse.y -half_scroll_size -WB1.list.y * WB1.list.count / WB1.list.h;
202
					WB1.list.first = mouse.y -half_scroll_size -WB1.list.y * WB1.list.count / WB1.list.h;
203
					if (WB1.list.visible+WB1.list.first>WB1.list.count) WB1.list.first=WB1.list.count-WB1.list.visible;
203
					if (WB1.list.visible+WB1.list.first>WB1.list.count) WB1.list.first=WB1.list.count-WB1.list.visible;
204
					if (btn!=WB1.list.first) WB1.Parse();
204
					if (btn!=WB1.list.first) WB1.DrawPage();
205
				}
205
				}
206
				break;
206
				break;
Line 207... Line 207...
207
 
207
 
208
			case evButton:
208
			case evButton:
Line 309... Line 309...
309
	WB1.list.SetSizes(0, TOOLBAR_H, Form.width - 10 - scroll_wv.size_x / WB1.DrawBuf.zoom, 
309
	WB1.list.SetSizes(0, TOOLBAR_H, Form.width - 10 - scroll_wv.size_x / WB1.DrawBuf.zoom, 
310
		Form.cheight - TOOLBAR_H - STATUSBAR_H, WB1.list.font_h + WB1.DrawBuf.zoom + WB1.DrawBuf.zoom * WB1.DrawBuf.zoom);
310
		Form.cheight - TOOLBAR_H - STATUSBAR_H, WB1.list.font_h + WB1.DrawBuf.zoom + WB1.DrawBuf.zoom * WB1.DrawBuf.zoom);
311
	WB1.list.wheel_size = 7;
311
	WB1.list.wheel_size = 7;
312
	WB1.list.column_max = WB1.list.w - scroll_wv.size_x / WB1.list.font_w;
312
	WB1.list.column_max = WB1.list.w - scroll_wv.size_x / WB1.list.font_w;
313
	WB1.list.visible = WB1.list.h - 5 / WB1.list.line_h;
313
	WB1.list.visible = WB1.list.h - 5 / WB1.list.line_h;
314
	WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, WB1.list.line_h);
314
	WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, WB1.list.h * 20);
315
}
315
}
Line 316... Line 316...
316
 
316
 
317
void Draw_Window()
317
void Draw_Window()
318
{
318
{
Line 380... Line 380...
380
 
380
 
381
		case SCAN_CODE_HOME:
381
		case SCAN_CODE_HOME:
382
		case SCAN_CODE_END:
382
		case SCAN_CODE_END:
383
		case SCAN_CODE_PGUP:
383
		case SCAN_CODE_PGUP:
384
		case SCAN_CODE_PGDN:
384
		case SCAN_CODE_PGDN:
385
			if (WB1.list.ProcessKey(key_scancode)) WB1.Parse();
385
			if (WB1.list.ProcessKey(key_scancode)) WB1.DrawPage();
Line 386... Line 386...
386
			return;
386
			return;
387
 
387
 
388
		case SCAN_CODE_UP:
388
		case SCAN_CODE_UP:
389
			if (WB1.list.first <= 0) return;
389
			if (WB1.list.first <= 0) return;
390
			WB1.list.first--;
390
			WB1.list.first--;
Line 391... Line 391...
391
			WB1.Parse();
391
			WB1.DrawPage();
392
			return;
392
			return;
393
 
393
 
394
		case SCAN_CODE_DOWN:
394
		case SCAN_CODE_DOWN:
395
			if (WB1.list.visible + WB1.list.first >= WB1.list.count) return;
395
			if (WB1.list.visible + WB1.list.first >= WB1.list.count) return;
Line 396... Line 396...
396
			WB1.list.first++;
396
			WB1.list.first++;
397
			WB1.Parse();
397
			WB1.DrawPage();
398
			return;
398
			return;
Line 439... Line 439...
439
			return;
439
			return;
Line 440... Line 440...
440
 
440
 
441
		case VIEW_SOURCE:
441
		case VIEW_SOURCE:
442
			WB1.list.first = 0;
442
			WB1.list.first = 0;
443
			ShowSource();
443
			ShowSource();
444
			WB1.Parse();
444
			WB1.DrawPage();
Line 445... Line 445...
445
			break;
445
			break;
446
 
446
 
447
		case EDIT_SOURCE:
447
		case EDIT_SOURCE:
Line 454... Line 454...
454
			return;
454
			return;
Line 455... Line 455...
455
 
455
 
456
		case FREE_IMG_CACHE:
456
		case FREE_IMG_CACHE:
457
			ImgCache.Free();
457
			ImgCache.Free();
458
			notify(IMAGES_CACHE_CLEARED);
458
			notify(IMAGES_CACHE_CLEARED);
459
			WB1.Parse();
459
			WB1.DrawPage();
Line 460... Line 460...
460
			return;
460
			return;
461
 
461
 
462
		case VIEW_HISTORY:
462
		case VIEW_HISTORY:
Line 631... Line 631...
631
		}
631
		}
632
		else
632
		else
633
			WB1.LoadInternalPage(#page_not_found, sizeof(page_not_found));
633
			WB1.LoadInternalPage(#page_not_found, sizeof(page_not_found));
634
	}
634
	}
635
	else
635
	else
636
		WB1.Parse();
636
		WB1.Prepare();
Line 637... Line 637...
637
 
637
 
638
	if (!header) strcpy(#header, #version);
638
	if (!header) strcpy(#header, #version);
639
	if (!strcmp(#version, #header)) DrawTitle(#header);
639
	if (!strcmp(#version, #header)) DrawTitle(#header);