Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 4676 → Rev 4677

/programs/cmm/TWB/TWB.c
6,7 → 6,7
 
#define URL param
 
scroll_bar scroll_wv = { 17,200,398, 44,17,0,115,15,0,0xeeeeee,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1};
scroll_bar scroll_wv = { 15,200,398,44,0,2,115,15,0,0xeeeeee,0xBBBbbb,0xeeeeee,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1};
 
char header[2048];
 
647,7 → 647,7
if (!strcmp(#options, "utf-8")) || (!strcmp(#options,"utf8")) meta_encoding = _UTF;
if (!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u")) meta_encoding = _KOI;
if (!strcmp(#options, "windows-1251")) || (!strcmp(#options, "windows1251")) meta_encoding = _WIN;
//if (!strcmp(#options, "dos")) || (!strcmp(#options, "cp-866")) meta_encoding = _DOS;
if (!strcmp(#options, "dos")) || (!strcmp(#options, "cp-866")) meta_encoding = _DOS;
if (cur_encoding==_DEFAULT) BufEncode(meta_encoding);
return;
}
662,7 → 662,7
scroll_wv.cur_area = list.visible;
scroll_wv.position = list.first;
 
scroll_wv.all_redraw=1;
scroll_wv.all_redraw=0;
scroll_wv.start_x = list.x + list.w;
scroll_wv.start_y = list.y;
scroll_wv.size_y=list.h;
/programs/cmm/TWB/links.h
63,6 → 63,8
CursorPointer.Restore();
}
 
char temp[4096];
PathShow_data status_text = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, 0, #temp, 0};
 
void LinksArray::Hover(dword mx, my, link_col_in, link_col_a, bg_col)
{
76,6 → 78,13
if (links[active].underline) DrawBar(links[active].x,links[active].y+8,links[active].w,1, link_col_in);
if (links[i].underline) DrawBar(links[i].x,links[i].y+8,links[i].w,1, bg_col);
active = i;
DrawBar(progress_bar.left+progress_bar.width+10, progress_bar.top+2, Form.cwidth-progress_bar.left-progress_bar.width-10, 9, col_bg);
status_text.start_x = progress_bar.left+progress_bar.width+10;
status_text.start_y = progress_bar.top+2;
status_text.area_size_x = Form.cwidth-progress_bar.left-progress_bar.width-10;
status_text.text_pointer = links[active].link;
PathShow_prepare stdcall(#status_text);
PathShow_draw stdcall(#status_text);
return;
}
}
83,6 → 92,7
{
CursorPointer.Restore();
if (links[active].underline) DrawBar(links[active].x,links[active].y+8,links[active].w,1, link_col_in);
DrawBar(progress_bar.left+progress_bar.width+10, progress_bar.top+2, Form.cwidth-progress_bar.left-progress_bar.width-10, 9, col_bg);
active = -1;
}
}
/programs/cmm/browser/img/URLgoto.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/cmm/browser/img/toolbar_icons.c
File deleted
\ No newline at end of file
/programs/cmm/browser/img/toolbar_icons.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/cmm/browser/img/URLgoto.txt
File deleted
\ No newline at end of file
/programs/cmm/browser/img
Property changes:
Deleted: tsvn:logminsize
-5
\ No newline at end of property
/programs/cmm/browser/WebView.c
25,23 → 25,22
#include "..\lib\lib.obj\libio_lib.h"
#include "..\lib\lib.obj\libimg_lib.h"
#include "..\lib\lib.obj\http.h"
//images
#include "img\toolbar_icons.c"
#include "img\URLgoto.txt";
 
char homepage[] = FROM "html\homepage.htm";
 
#ifdef LANG_RUS
char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 0.99.76";
char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 1.0 Beta 1";
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
char loading[] = "‡ £à㧪  áâà ­¨æë...<br>";
unsigned char page_not_found[] = FROM "html\page_not_found_ru.htm";
char page_not_found[] = FROM "html\page_not_found_ru.htm";
char accept_language[]= "Accept-Language: ru\n";
#else
char version[]=" Text-based Browser 0.99.76";
char version[]=" Text-based Browser 1.0 Beta 1";
?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...<br>";
unsigned char page_not_found[] = FROM "html\page_not_found_en.htm";
char page_not_found[] = FROM "html\page_not_found_en.htm";
char accept_language[]= "Accept-Language: en\n";
#endif
 
60,6 → 59,16
dword http_transfer = 0;
dword http_buffer;
 
dword TAB_H = 19;
dword TAB_W = 150;
dword TOOLBAR_H = 50;
dword STATUSBAR_H =18;
dword col_bg = 0xE4DFE1;
dword panel_color = 0xF1F1F1;
dword border_color = 0x9F9F9F;
 
pb progress_bar = {0, 10, 83, 150, 13, 0, 0, 100, 0xeeeEEE, 8072B7EBh, 0x9F9F9F};
 
#include "..\TWB\TWB.c"
#include "menu_rmb.h"
#include "history.h"
66,13 → 75,24
 
char editURL[sizeof(URL)];
int mouse_twb;
edit_box address_box= {250,207,16,0xffffff,0x94AECE,0xffffff,0xffffff,0,sizeof(URL),#editURL,#mouse_twb,2,19,19};
edit_box address_box = {250,55,34,0xffffff,0x94AECE,0xffffff,0xffffff,0,sizeof(URL),#editURL,#mouse_twb,2,19,19};
 
#define URL_HISTORY "WebView://history"
#define URL_SERVICE_HISTORY "WebView://history"
#define URL_SERVICE_HOME "WebView://home"
 
enum { BACK=300, FORWARD, REFRESH, HOME, NEWTAB, GOTOURL, SEARCHWEB, INPUT_CH, INPUT_BT, BTN_UP, BTN_DOWN };
 
struct skin {
dword image, w, h;
} skin;
 
int LoadSkin()
{
skin.image = load_image(abspath("wv_skin.png"));
skin.w = DSWORD[skin.image+4];
skin.h = DSWORD[skin.image+8];
}
 
void main()
{
int key, btn;
85,11 → 105,12
if (load_dll2(libio, #libio_init,1)!=0) notify("Error: library doesn't exists - libio");
if (load_dll2(libimg, #libimg_init,1)!=0) notify("Error: library doesn't exists - libimg");
if (load_dll2(libHTTP, #http_lib_init,1)!=0) notify("Error: library doesn't exists - http");
LoadSkin();
if (!URL) strcpy(#URL, "/sys/index.htm");
Form.width=WIN_W;
Form.height=WIN_H;
SetElementSizes();
if (!URL) strcpy(#URL, URL_SERVICE_HOME);
OpenPage();
 
SetEventMask(0xa7);
126,6 → 147,7
if (WB1.list.MouseScroll(m.vert)) WB1.Parse();
}
//Drag scroller
scroll_wv.all_redraw = 0;
if (!m.lkm) scroll_used=0;
if (m.x>=scroll_wv.start_x) && (m.x<=scroll_wv.start_x+scroll_wv.size_x)
&& (m.y>=scroll_wv.start_y+scroll_wv.btn_height) && (-scroll_wv.btn_height+scroll_wv.start_y+scroll_wv.size_y>m.y)
167,6 → 189,12
case evNetwork:
if (http_transfer > 0) {
http_process stdcall (http_transfer);
$push EAX
ESI = http_transfer;
progress_bar.max = ESI.http_msg.content_length;
progress_bar.value = ESI.http_msg.content_received;
progressbar_draw stdcall(#progress_bar);
$pop EAX
if (EAX == 0) {
ESI = http_transfer;
// Handle redirects
223,46 → 251,55
 
void SetElementSizes()
{
address_box.width = Form.width - 266;
WB1.list.SetSizes(0, 44, Form.width - 10 - scroll_wv.size_x, Form.cheight - 44, 0, 10);
address_box.top = TOOLBAR_H-TAB_H/2-7+TAB_H;
address_box.width = Form.cwidth - address_box.left - 25 - 22;
WB1.list.SetSizes(0, TOOLBAR_H, Form.width - 10 - scroll_wv.size_x, Form.cheight - TOOLBAR_H - STATUSBAR_H, 0, 10);
WB1.list.column_max = WB1.list.w - scroll_wv.size_x / 6;
WB1.list.visible = WB1.list.h - 3 / WB1.list.line_h - 2;
WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, WB1.list.line_h);
}
 
 
void Draw_Window()
{
int j;
DefineAndDrawWindow(215,100,WIN_W,WIN_H,0x73,0xE4DFE1,0,0);
 
int img_off;
DefineAndDrawWindow(GetScreenWidth()-WIN_W/2,GetScreenHeight()-WIN_H/2,WIN_W,WIN_H,0x73,col_bg,0,0);
GetProcessInfo(#Form, SelfInfo);
if (Form.status_window>2)
{
DrawTitle(#header);
return;
}
if (Form.status_window>2) { DrawTitle(#header); return; }
if (Form.height<120) MoveSize(OLD,OLD,OLD,120);
if (Form.width<280) MoveSize(OLD,OLD,280,OLD);
// tab {
DrawBar(0, 0, TAB_W, TAB_H+1, panel_color);
WriteText(5, 7, 0x80, 0xfdfdFd, "Index.htm");
WriteText(4, 6, 0x80, 0, "Index.htm");
// }
DrawBar(TAB_W,0, Form.cwidth-TAB_W,TAB_H, col_bg);
DrawBar(TAB_W-1,TAB_H, Form.cwidth-TAB_W+1,1, border_color);
DrawBar(0,TAB_H+1, Form.cwidth,TOOLBAR_H-TAB_H-2, panel_color);
DrawBar(0,TOOLBAR_H-1, Form.cwidth,1, border_color);
img_draw stdcall(skin.image, TAB_W-13, 0, 30, skin.h, 101, 0);
PutPaletteImage(#toolbar,200,42,0,0,8,#toolbar_pal);
if (http_transfer > 0) _PutImage(88,10, 24,24, #stop_btn);
SetElementSizes();
DrawRectangle(address_box.left-1, address_box.top-1, address_box.width+2, 16,address_box.color);
DrawRectangle(address_box.left-2, address_box.top-2, address_box.width+4, 18,border_color);
// < / >
DefineButton(address_box.left-49, address_box.top-1, 23, skin.h-2, 300+BT_HIDE, 0);
DefineButton(address_box.left-25, address_box.top-1, 23, skin.h-2, 301+BT_HIDE, 0);
img_draw stdcall(skin.image, address_box.left-50, address_box.top-2, 48, skin.h, 3, 0);
// refrash
DefineButton(address_box.left+address_box.width+1, address_box.top-2, 16, skin.h-1, REFRESH+BT_HIDE+BT_NOFRAME, 0);
if (http_transfer > 0) img_off = 131; else img_off = 52;
img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-2, 17, skin.h, img_off, 0);
// config
DefineButton(Form.cwidth-23, address_box.top-2, 17, skin.h-1, 312+BT_HIDE, 0);
img_draw stdcall(skin.image, Form.cwidth-22, address_box.top-2, 16, skin.h, 85, 0);
DrawBar(200,0,Form.cwidth-200,43,0xE4DFE1);
DrawBar(0,42,Form.cwidth,1,0xE2DBDC);
DrawBar(0,43,Form.cwidth,1,0xD2CED0);
for (j=0; j<5; j++) DefineButton(j*37+11, 7, 29, 29, 300+j+BT_HIDE, 0xE4DFE1);
_PutImage(Form.cwidth-48,14, 40,19, #URLgoto);
DefineButton(Form.cwidth-28,15, 18, 16, GOTOURL+BT_HIDE, 0xE4DFE1);
DefineButton(Form.cwidth-47,15, 17, 16, SEARCHWEB+BT_HIDE, 0xE4DFE1);
DrawRectangle(205,14,Form.cwidth-205-49,18,0x94AECE); //around adress bar
DrawRectangle(206,15,Form.cwidth-205-50,16,0xE4ECF3);
 
SetElementSizes();
ShowPage();
 
DefineButton(scroll_wv.start_x+1, scroll_wv.start_y+1, 16, 16, BTN_UP+BT_HIDE, 0xE4DFE1);
DefineButton(scroll_wv.start_x+1, scroll_wv.start_y+scroll_wv.size_y-18, 16, 16, BTN_DOWN+BT_HIDE, 0xE4DFE1);
DrawRectangle(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x, scroll_wv.size_y-1, scroll_wv.bckg_col);
//status bar
DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,STATUSBAR_H, col_bg);
DrawBar(0,Form.cheight - STATUSBAR_H, Form.cwidth,1, border_color);
progress_bar.top = Form.cheight - STATUSBAR_H + 4;
progressbar_draw stdcall(#progress_bar);
}
 
 
305,7 → 342,7
return;
 
case 003: //history
strcpy(#URL, URL_HISTORY);
strcpy(#URL, URL_SERVICE_HISTORY);
OpenPage();
return;
 
399,6 → 436,11
if (WB1.list.count < WB1.list.visible) return;
if (WB1.list.KeyEnd()) WB1.Parse();
return;
case 312:
SwitchToAnotherThread();
m.y = TOOLBAR_H-6;
m.x = Form.cwidth - 167;
CreateThread(#menu_rmb,#stak+4092);
}
}
 
471,7 → 513,8
bufsize = 0;
bufpointer = mem_Free(bufpointer);
}
PutPaletteImage(#toolbar,200,42,0,0,8,#toolbar_pal);
progress_bar.value = 0;
img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-2, 17, skin.h, 52, 0);
}
 
void SetPageDefaults()
491,9 → 534,10
StopLoading();
strcpy(#editURL, #URL);
BrowserHistory.AddUrl();
if (strncmp(#URL,"WebView:",8)==0) return;
if (strncmp(#URL,"http:",5)==0)
{
_PutImage(88,10, 24,24, #stop_btn);
img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-2, 17, skin.h, 131, 0);
http_get stdcall (#URL, #accept_language);
http_transfer = EAX;
if (http_transfer == 0)
526,7 → 570,8
address_box.offset=0;
edit_box_draw stdcall(#address_box);
 
if (strcmp(#URL, URL_HISTORY)==0) ShowHistory(); else
if (strcmp(#URL, URL_SERVICE_HOME)==0) WB1.Prepare(#homepage, sizeof(homepage)); else
if (strcmp(#URL, URL_SERVICE_HISTORY)==0) ShowHistory(); else
if (!bufsize)
{
PageLinks.Clear();
/programs/cmm/browser/html/homepage.htm
0,0 → 1,16
<html>
<head>
<meta>
<meta http-equiv="content-type" content="text/html; charset=cp-866" />
<title>Homepage</title>
</head>
<body>
 
<br>
Bookmarks:<br>
1. <a href="http://kolibrios.org">KolibriOS homepage</a><br>
2. <a href="http://kolibri-n.org">KolibriN homepage</a>
 
 
</body>
</html>
/programs/cmm/browser/html/page_not_found_en.htm
1,5 → 1,6
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=cp-866" />
<title>Page not found</title>
</head>
<body>
/programs/cmm/browser/html/page_not_found_ru.htm
1,6 → 1,7
<html>
<head>
<meta>
<meta http-equiv="content-type" content="text/html; charset=cp-866" />
<title>‘âà ­¨æ  ­¥ ­ ©¤¥­ </title>
</head>
<body>
/programs/cmm/browser/menu_rmb.h
17,8 → 17,6
0};
 
llist menu;
dword col_work = 0xE4DFE1;
dword col_border = 0x9098B0;
 
void menu_rmb()
{
55,7 → 53,7
case evReDraw:
DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinHeight()+3,menu.w+2,menu.h+4,0x01, 0, 0, 0x01fffFFF);
DrawPopup(0,0,menu.w,menu.h+3,0, col_work,col_border);
DrawPopup(0,0,menu.w,menu.h+3,0, col_bg,border_color);
DrawMenuList();
}
}
70,7 → 68,7
DrawBar(menu.x, N*menu.line_h+menu.y, menu.w-3, menu.line_h, 0x94AECE);
else
{
DrawBar(menu.x, N*menu.line_h+menu.y, menu.w-3, menu.line_h, col_work);
DrawBar(menu.x, N*menu.line_h+menu.y, menu.w-3, menu.line_h, col_bg);
WriteText(19,N*menu.line_h+9,0x80,0xf2f2f2,ITEMS_LIST[N*2]);
}
WriteText(18,N*menu.line_h+8,0x80,0x000000,ITEMS_LIST[N*2]);
/programs/cmm/browser/wv_skin.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property