forked from KolibriOS/kolibrios
WebView 1.21 stable
git-svn-id: svn://kolibrios.org@5718 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
afa564b4d7
commit
93bb33137f
@ -64,6 +64,7 @@ void TWebBrowser::DrawPage()
|
||||
|
||||
if (!header)
|
||||
{
|
||||
ChangeCharset("UTF-8", "CP866", #line);
|
||||
strcpy(#header, #line);
|
||||
strcat(#header, " -");
|
||||
strcat(#header, #version);
|
||||
@ -585,7 +586,10 @@ void BufEncode(int set_new_encoding)
|
||||
{
|
||||
strcpy(bufpointer, o_bufpointer);
|
||||
}
|
||||
//bufpointer = ChangeCharset(charsets[set_new_encoding], "CP866", bufpointer);
|
||||
if (set_new_encoding == CH_CP1251)
|
||||
{
|
||||
bufpointer = ChangeCharset("CP1251", "UTF-8", bufpointer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
<!--doctype html public "-//w3c//dtd html 4.0 transitional//ru"-->
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
|
||||
<title>Тест Acid 0.1</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Тест Acid 0.1</title>
|
||||
</head>
|
||||
<body bgcolor="#000000" link="#0066FF" text="#FFFFFF">
|
||||
<h1 align=center>Это тестовая страница для проверки WebViewer</h1>
|
||||
<h1 align=center>Это тестовая страница для проверки WebViewer</h1>
|
||||
<br />
|
||||
<p>WebViewer является текстовым браузером и поддерживает все популярные кодировки (cp1251, koi-8, cp866, unicode)
|
||||
и некоторые теги. Поддержка таблииц (<table>), CSS, Javascript'a и Контактика пока не реализована :)
|
||||
<p>WebViewer является текстовым браузером и поддерживает все популярные кодировки (cp1251, koi-8, cp866, unicode)
|
||||
и некоторые теги. Поддержка таблииц (<table>), CSS, Javascript'a и Контактика пока не реализована :)
|
||||
</p>
|
||||
<br />
|
||||
|
||||
@ -34,33 +34,33 @@
|
||||
<br>
|
||||
|
||||
<p>
|
||||
Небольшой список:<ol>
|
||||
<li><q>Этот текст в кавычках</q></li>
|
||||
<li><u>Это подчеркнутый текст</u></li>
|
||||
<li><s>Это перечеркнутый текст</s></li>
|
||||
<li><i>Это наклонный текст</i></li>
|
||||
<li><strong>Это текст с усиленным выделением</strong></li>
|
||||
<li><b><u><s><font color="#777444">Много тегов</font></s></u></b></ol>
|
||||
Небольшой список:<ol>
|
||||
<li><q>Этот текст в кавычках</q></li>
|
||||
<li><u>Это подчеркнутый текст</u></li>
|
||||
<li><s>Это перечеркнутый текст</s></li>
|
||||
<li><i>Это наклонный текст</i></li>
|
||||
<li><strong>Это текст с усиленным выделением</strong></li>
|
||||
<li><b><u><s><font color="#777444">Много тегов</font></s></u></b></ol>
|
||||
</p>
|
||||
<br>
|
||||
|
||||
<pre>
|
||||
"Осень уже пришла!"-
|
||||
Шепнул мне на ухо ветер,
|
||||
Подкравшись к подушке моей.
|
||||
"Осень уже пришла!"-
|
||||
Шепнул мне на ухо ветер,
|
||||
Подкравшись к подушке моей.
|
||||
|
||||
Басе
|
||||
Басе
|
||||
</pre>
|
||||
<!-- комментарий: этого текста здесь <нет> -->
|
||||
<!-- комментарий: этого текста здесь <нет> -->
|
||||
|
||||
<br>
|
||||
|
||||
<a href="http://kolibrios.org/i/logo.png"><img id="2.1.4" src="http://kolibrios.org/i/logo.png" alt="logo"><br>Открыть</a><br>
|
||||
<a href="http://kolibrios.org/i/logo.png"><img id="2.1.4" src="http://kolibrios.org/i/logo.png" alt="logo"><br>Открыть</a><br>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<a href='./index.htm'>./index.htm</a><br>
|
||||
<a href='/sys/index.htm'>Незакрытый тег а - index.htm<br>
|
||||
<a href='/sys/index.htm'>Незакрытый тег а - index.htm<br>
|
||||
<a href="/sys/kernel.mnt">kernel.mnt</a><br>
|
||||
<a href="#2.1.4">#2.1.4</a><br>
|
||||
<a href="http://bash.im">http://bash.im</a><br>
|
||||
@ -68,20 +68,20 @@
|
||||
<br>
|
||||
<br>
|
||||
|
||||
В этом тексте есть переход на следующую строку, но браузер
|
||||
его должен проигнорировать. Еще много пробелов. А тут есть
|
||||
табы. Кое-какие символы: " & < > •
|
||||
© ® „ “ — Їжачок іншого боку р. Євфрат з'їв ґрунт та єврейський ґербалайф.
|
||||
В этом тексте есть переход на следующую строку, но браузер
|
||||
его должен проигнорировать. Еще много пробелов. А тут есть
|
||||
табы. Кое-какие символы: " & < > •
|
||||
© ® „ “ — Їжачок іншого боку р. Євфрат з'їв ґрунт та єврейський ґербалайф.
|
||||
|
||||
<condition show_if=1>
|
||||
<p>61055, г.
|
||||
Харьков, ул. Краснознаменная, 16</SPAN>, радиофизический
|
||||
корпус на территории НТУ «ХПИ»
|
||||
корпус на территории НТУ «ХПИ»
|
||||
</p>
|
||||
</condition>
|
||||
|
||||
<hr color="#758999">
|
||||
<center>Zhitomyr 2008-2014</center>
|
||||
<center>Zhitomyr 2008-2015</center>
|
||||
|
||||
|
||||
</body>
|
||||
|
@ -9,7 +9,7 @@ s_image pics[100]; //pics = mem_Alloc( 100*sizeof(s_image) );
|
||||
struct ImageCache {
|
||||
int pics_count;
|
||||
void Free();
|
||||
int GetImageNumber();
|
||||
int GetImage();
|
||||
void Images();
|
||||
};
|
||||
|
||||
@ -22,7 +22,7 @@ void ImageCache::Free()
|
||||
}
|
||||
}
|
||||
|
||||
int ImageCache::GetImageNumber(dword i_path)
|
||||
int ImageCache::GetImage(dword i_path)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i<=pics_count; i++) if (!strcmp(#pics[i].path, i_path)) return i; //image exists
|
||||
@ -43,10 +43,15 @@ void ImageCache::Images(int left1, top1, width1)
|
||||
do{
|
||||
if (!strcmp(#parametr,"src=")) //íàäî îáúåäèíèòü ñ GetNewUrl()
|
||||
{
|
||||
if (http_transfer<>0) strcpy(#img_path, #history_list[BrowserHistory.current-1].Item); else
|
||||
strcpy(#img_path, #options);
|
||||
if (http_transfer!=0)
|
||||
strcpy(#img_path, #history_list[BrowserHistory.current-1].Item);
|
||||
else
|
||||
{
|
||||
//if (strcmp(#options))
|
||||
strcpy(#img_path, #options);
|
||||
}
|
||||
PageLinks.GetAbsoluteURL(#img_path);
|
||||
cur_pic = GetImageNumber(#img_path);
|
||||
cur_pic = GetImage(#img_path);
|
||||
}
|
||||
if (!strcmp(#parametr,"alt="))
|
||||
{
|
||||
@ -67,17 +72,17 @@ void ImageCache::Images(int left1, top1, width1)
|
||||
imgh = DSWORD[pics[cur_pic].image+8];
|
||||
if (imgw > width1) imgw = width1;
|
||||
|
||||
if (stroka==0) DrawBar(WB1.list.x, WB1.list.y, WB1.list.w-15, 5, bg_color); //çàêðàøèâàåì ïåðâóþ ñòðîêó
|
||||
if (stroka==0) DrawBar(WB1.list.x, WB1.list.y, WB1.list.w-15, 5, bg_color); //fill first line
|
||||
stroka += imgh / WB1.list.line_h;
|
||||
if (imgh % WB1.list.line_h) stroka++;
|
||||
if (top1+imgh<WB1.list.y) || (top1>WB1.list.y+WB1.list.h-10) return; //åñëè ÂѨ èçîáðàæåíèå óøëî ÂÅÐÕ èëè ÂÍÈÇ
|
||||
if (top1<WB1.list.y) //åñëè ÷àñòü èçîáðàæåíèÿ ñâåðõó
|
||||
if (top1+imgh<WB1.list.y) || (top1>WB1.list.y+WB1.list.h-10) return; //if all image is out of visible area
|
||||
if (top1<WB1.list.y) //if image partly visible (at the top)
|
||||
{
|
||||
img_lines_first=WB1.list.y-top1;
|
||||
imgh=imgh-img_lines_first;
|
||||
top1=WB1.list.y;
|
||||
}
|
||||
if (top1>WB1.list.y+WB1.list.h-imgh-5) //åñëè ÷àñòü èçîáðàæåíèÿ ñíèçó
|
||||
if (top1>WB1.list.y+WB1.list.h-imgh-5) //if image partly visible (at the bottom)
|
||||
{
|
||||
imgh=WB1.list.y+WB1.list.h-top1-5;
|
||||
}
|
||||
@ -87,7 +92,7 @@ void ImageCache::Images(int left1, top1, width1)
|
||||
img_draw stdcall (pics[cur_pic].image, left1-5, top1, imgw, imgh,0,img_lines_first);
|
||||
DrawBar(left1+imgw - 5, top1, WB1.list.w-imgw, imgh, bg_color);
|
||||
DrawBar(WB1.list.x, top1+imgh, WB1.list.w, -imgh % WB1.list.line_h + WB1.list.line_h, bg_color);
|
||||
IF (link)
|
||||
if (link)
|
||||
{
|
||||
UnsafeDefineButton(left1 - 5, top1, imgw, imgh-1, PageLinks.count + 400 + BT_HIDE, 0xB5BFC9);
|
||||
PageLinks.AddText(0, imgw, imgh-1, NOLINE);
|
||||
|
@ -24,7 +24,8 @@ struct LinksArray
|
||||
dword GetURL();
|
||||
void Clear();
|
||||
void GetAbsoluteURL();
|
||||
};
|
||||
int UrlAbsolute();
|
||||
} PageLinks;
|
||||
|
||||
void LinksArray::AddLink(dword new_link, int link_x, link_y)
|
||||
{
|
||||
@ -98,18 +99,33 @@ void LinksArray::Hover(dword mx, my, link_col_in, link_col_a, bg_col)
|
||||
}
|
||||
}
|
||||
|
||||
char *ABSOLUTE_LINKS[]={ "http:", "mailto:", "ftp:", "/sys/",
|
||||
"/kolibrios/", "/rd/", "/bd", "/hd", "/cd", "/tmp", "/usbhd", "WebView:", 0};
|
||||
void LinksArray::GetAbsoluteURL(dword in_URL){
|
||||
int i, len;
|
||||
int LinksArray::UrlAbsolute(dword in_URL)
|
||||
{
|
||||
if(!strncmp(in_URL,"http:",5)) return 1;
|
||||
if(!strncmp(in_URL,"https:",6)) return 1;
|
||||
if(!strncmp(in_URL,"mailto:",7)) return 1;
|
||||
if(!strncmp(in_URL,"ftp:",4)) return 1;
|
||||
if(!strncmp(in_URL,"WebView:",8)) return 1;
|
||||
if(!strncmp(in_URL,"/sys/",5)) return 1;
|
||||
if(!strncmp(in_URL,"/hd/",4)) return 1;
|
||||
if(!strncmp(in_URL,"/fd/",4)) return 1;
|
||||
if(!strncmp(in_URL,"/rd/",4)) return 1;
|
||||
if(!strncmp(in_URL,"/tmp/",5)) return 1;
|
||||
if(!strncmp(in_URL,"/cd/",4)) return 1;
|
||||
if(!strncmp(in_URL,"/bd/",4)) return 1;
|
||||
if(!strncmp(in_URL,"/usbhd/",7)) return 1;
|
||||
if(!strncmp(in_URL,"/kolibrios/",11)) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void LinksArray::GetAbsoluteURL(dword in_URL)
|
||||
{
|
||||
int i;
|
||||
dword orig_URL = in_URL;
|
||||
char newurl[sizeof(URL)];
|
||||
|
||||
if (UrlAbsolute(in_URL)) return;
|
||||
|
||||
for (i=0; ABSOLUTE_LINKS[i]; i++)
|
||||
{
|
||||
len=strlen(ABSOLUTE_LINKS[i]);
|
||||
if (!strcmpn(in_URL, ABSOLUTE_LINKS[i], len)) return;
|
||||
}
|
||||
IF (!strcmpn(in_URL,"./", 2)) in_URL+=2;
|
||||
strcpy(#newurl, BrowserHistory.CurrentUrl());
|
||||
|
||||
@ -141,5 +157,3 @@ void LinksArray::GetAbsoluteURL(dword in_URL){
|
||||
}
|
||||
|
||||
|
||||
|
||||
LinksArray PageLinks;
|
||||
|
@ -30,14 +30,14 @@
|
||||
char homepage[] = FROM "html\\homepage.htm";
|
||||
|
||||
#ifdef LANG_RUS
|
||||
char version[]=" ’¥ªáâ®¢ë© ¡à 㧥à 1.2";
|
||||
char version[]=" ’¥ªáâ®¢ë© ¡à 㧥à 1.21";
|
||||
?define IMAGES_CACHE_CLEARED "Šíè ª à⨮ª ®ç¨é¥"
|
||||
?define T_LAST_SLIDE "<EFBFBD>â® ¯®á«¥¤¨© á« ©¤"
|
||||
char loading[] = "‡ £à㧪 áâà ¨æë...<br>";
|
||||
char page_not_found[] = FROM "html\page_not_found_ru.htm";
|
||||
char accept_language[]= "Accept-Language: ru\n";
|
||||
#else
|
||||
char version[]=" Text-based Browser 1.2";
|
||||
char version[]=" Text-based Browser 1.21";
|
||||
?define IMAGES_CACHE_CLEARED "Images cache cleared"
|
||||
?define T_LAST_SLIDE "This slide is the last"
|
||||
char loading[] = "Loading...<br>";
|
||||
@ -70,9 +70,27 @@ dword col_bg;
|
||||
dword panel_color;
|
||||
dword border_color;
|
||||
|
||||
progress_bar wv_progress_bar = {0, 10, 83, 150, 12, 0, 0, 100, 0xeeeEEE, 8072B7EBh, 0x9F9F9F};
|
||||
progress_bar wv_progress_bar;
|
||||
byte souce_mode = false;
|
||||
|
||||
enum {
|
||||
BACK_BUTTON=1000,
|
||||
FORWARD_BUTTON,
|
||||
REFRESH_BUTTON,
|
||||
GOTOURL_BUTTON,
|
||||
SEARCHWEB_BUTTON,
|
||||
SANDWICH_BUTTON
|
||||
};
|
||||
|
||||
enum {
|
||||
ZOOM2x=1100,
|
||||
VIEW_SOURCE,
|
||||
EDIT_SOURCE,
|
||||
VIEW_HISTORY,
|
||||
FREE_IMG_CACHE,
|
||||
DOWNLOAD_MANAGER
|
||||
};
|
||||
|
||||
#include "..\TWB\TWB.c"
|
||||
#include "menu_rmb.h"
|
||||
#include "history.h"
|
||||
@ -88,7 +106,6 @@ edit_box address_box = {250,55,34,0xffffff,0x94AECE,0xffffff,0xffffff,0,sizeof(U
|
||||
#define URL_SERVICE_HOME "WebView://home"
|
||||
#define URL_SERVICE_SOURCE "WebView://source:"
|
||||
|
||||
enum { BUTTON_BACK=1000, FORWARD, REFRESH, HOME, NEWTAB, GOTOURL, SEARCHWEB, INPUT_CH, INPUT_BT };
|
||||
|
||||
libimg_image skin;
|
||||
|
||||
@ -109,11 +126,9 @@ int SetSkinColors()
|
||||
void DrawProgress()
|
||||
{
|
||||
unsigned long btn;
|
||||
//progressbar_draw stdcall(#wv_progress_bar);
|
||||
wv_progress_bar.width = wv_progress_bar.left = 0;
|
||||
if (http_transfer == 0) return;
|
||||
if (wv_progress_bar.max) btn = address_box.width*wv_progress_bar.value/wv_progress_bar.max; else btn = 30;
|
||||
DrawBar(address_box.left-1, address_box.top+14, btn, 2, wv_progress_bar.progress_color);
|
||||
DrawBar(address_box.left-1, address_box.top+15, btn, 2, wv_progress_bar.progress_color);
|
||||
}
|
||||
|
||||
|
||||
@ -122,13 +137,14 @@ void main()
|
||||
dword btn;
|
||||
int half_scroll_size;
|
||||
int scroll_used=0, show_menu;
|
||||
|
||||
|
||||
CursorPointer.Load(#CursorFile);
|
||||
load_dll(boxlib, #box_lib_init,0);
|
||||
load_dll(libio, #libio_init,1);
|
||||
load_dll(libimg, #libimg_init,1);
|
||||
load_dll(libHTTP, #http_lib_init,1);
|
||||
load_dll(iconv_lib, #iconv_open,0);
|
||||
//load_dll(kmenu, #akmenu_init,0);
|
||||
Libimg_LoadImage(#skin, abspath("wv_skin.png"));
|
||||
SetSkinColors();
|
||||
|
||||
@ -159,7 +175,6 @@ void main()
|
||||
{
|
||||
if (mouse.pkm) && (mouse.up)
|
||||
{
|
||||
SwitchToAnotherThread();
|
||||
CreateThread(#menu_rmb,#stak+4092);
|
||||
break;
|
||||
}
|
||||
@ -267,6 +282,7 @@ void main()
|
||||
PageLinks.GetAbsoluteURL(#URL);
|
||||
BrowserHistory.current--;
|
||||
strcpy(#editURL, #URL);
|
||||
DrawEditBox();
|
||||
OpenPage();
|
||||
}
|
||||
else
|
||||
@ -313,26 +329,26 @@ void Draw_Window()
|
||||
else DrawBar(0,0, Form.cwidth,1, col_bg);
|
||||
// }
|
||||
DrawBar(0,TAB_H+1, Form.cwidth,TOOLBAR_H-TAB_H-3, panel_color);
|
||||
DrawBar(0,TOOLBAR_H-2, Form.cwidth,1, 0xe9e9e9);
|
||||
DrawBar(0,TOOLBAR_H-2, Form.cwidth,1, 0xD7D0D3);
|
||||
DrawBar(0,TOOLBAR_H-1, Form.cwidth,1, border_color);
|
||||
SetElementSizes();
|
||||
DrawRectangle(address_box.left-2, address_box.top-3, address_box.width+4, 20,border_color);
|
||||
DrawRectangle(address_box.left-1, address_box.top-2, address_box.width+2, 18,address_box.color);
|
||||
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, BUTTON_BACK+BT_HIDE, 0);
|
||||
DefineButton(address_box.left-25, address_box.top-1, 23, skin.h-2, FORWARD+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);
|
||||
DefineButton(address_box.left-49, address_box.top-2, 23, skin.h-2, BACK_BUTTON+BT_HIDE, 0);
|
||||
DefineButton(address_box.left-25, address_box.top-2, 23, skin.h-2, FORWARD_BUTTON+BT_HIDE, 0);
|
||||
img_draw stdcall(skin.image, address_box.left-50, address_box.top-3, 48, skin.h, 3, 0);
|
||||
// refresh_BUTTON
|
||||
DefineButton(address_box.left+address_box.width+1, address_box.top-3, 16, skin.h-1, REFRESH_BUTTON+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);
|
||||
img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 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);
|
||||
DefineButton(Form.cwidth-24, address_box.top-3, 19, skin.h-1, SANDWICH_BUTTON+BT_HIDE, 0);
|
||||
img_draw stdcall(skin.image, Form.cwidth-22, address_box.top-3, 16, skin.h, 85, 0);
|
||||
//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);
|
||||
wv_progress_bar.top = Form.cheight - STATUSBAR_H + 4;
|
||||
ShowPage();
|
||||
DrawRectangle(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x, scroll_wv.size_y-1, scroll_wv.bckg_col);
|
||||
DrawProgress();
|
||||
@ -342,7 +358,7 @@ void Draw_Window()
|
||||
void Scan(dword id__)
|
||||
{
|
||||
action_buf=0;
|
||||
if (id__ >= 400)
|
||||
if (id__ >= 400) && (id__ < 1000)
|
||||
{
|
||||
ProcessLinks(id__);
|
||||
return;
|
||||
@ -350,12 +366,12 @@ void Scan(dword id__)
|
||||
switch (id__)
|
||||
{
|
||||
case SCAN_CODE_BS:
|
||||
case BUTTON_BACK:
|
||||
case BACK_BUTTON:
|
||||
if (!BrowserHistory.GoBack()) return;
|
||||
OpenPage();
|
||||
return;
|
||||
|
||||
case FORWARD:
|
||||
case FORWARD_BUTTON:
|
||||
if (!BrowserHistory.GoForward()) return;
|
||||
OpenPage();
|
||||
return;
|
||||
@ -379,7 +395,34 @@ void Scan(dword id__)
|
||||
WB1.Parse();
|
||||
return;
|
||||
|
||||
case 44: //Z-key down
|
||||
case GOTOURL_BUTTON:
|
||||
case SCAN_CODE_ENTER: //enter
|
||||
if (!editURL[0]) return;
|
||||
if (strncmp(#editURL,"http:",5)) && (editURL[0]!='/') && (strncmp(#editURL,"WebView:",9)) strncpy(#URL,"http://",7);
|
||||
else
|
||||
URL[0] = 0;
|
||||
strcat(#URL, #editURL);
|
||||
OpenPage();
|
||||
return;
|
||||
|
||||
case 063: //F5
|
||||
IF(address_box.flags & 0b10) return;
|
||||
case REFRESH_BUTTON:
|
||||
if (http_transfer > 0)
|
||||
{
|
||||
StopLoading();
|
||||
Draw_Window();
|
||||
}
|
||||
else OpenPage();
|
||||
return;
|
||||
|
||||
case SANDWICH_BUTTON:
|
||||
mouse.y = TOOLBAR_H-6;
|
||||
mouse.x = Form.cwidth - 167;
|
||||
CreateThread(#menu_rmb,#stak+4092);
|
||||
return;
|
||||
|
||||
case ZOOM2x:
|
||||
if (WB1.DrawBuf.zoom==2)
|
||||
{
|
||||
WB1.DrawBuf.zoom=1;
|
||||
@ -393,64 +436,13 @@ void Scan(dword id__)
|
||||
Draw_Window();
|
||||
return;
|
||||
|
||||
case GOTOURL:
|
||||
case SCAN_CODE_ENTER: //enter
|
||||
if (!editURL[0]) return;
|
||||
if (strncmp(#editURL,"http:",5)) && (editURL[0]!='/') && (strncmp(#editURL,"WebView:",9)) strncpy(#URL,"http://",7);
|
||||
else
|
||||
URL[0] = 0;
|
||||
strcat(#URL, #editURL);
|
||||
OpenPage();
|
||||
return;
|
||||
|
||||
case REFRESH:
|
||||
if (http_transfer > 0)
|
||||
{
|
||||
StopLoading();
|
||||
Draw_Window();
|
||||
}
|
||||
else OpenPage();
|
||||
return;
|
||||
|
||||
/*
|
||||
case 011: //Ctrk+K
|
||||
BufEncode(CH_KOI8);
|
||||
WB1.Parse();
|
||||
return;
|
||||
case 021: //Ctrl+U
|
||||
BufEncode(CH_UTF8);
|
||||
WB1.Parse();
|
||||
return;
|
||||
case 004: //Ctrl+D
|
||||
BufEncode(CH_CP866);
|
||||
WB1.Parse();
|
||||
return;
|
||||
case 005: //Win encoding
|
||||
BufEncode(CH_CP1251);
|
||||
WB1.Parse();
|
||||
return;
|
||||
case 009: //free img cache
|
||||
ImgCache.Free();
|
||||
notify(IMAGES_CACHE_CLEARED);
|
||||
WB1.Parse();
|
||||
return;
|
||||
case 003: //history
|
||||
strcpy(#URL, URL_SERVICE_HISTORY);
|
||||
OpenPage();
|
||||
return;
|
||||
case 006: //download manager
|
||||
if (!downloader_opened) {
|
||||
strncpy(#DL_URL, "http://",7);
|
||||
CreateThread(#Downloader,#downloader_stak+4092);
|
||||
}
|
||||
return;
|
||||
|
||||
case 052: //F3
|
||||
case VIEW_SOURCE:
|
||||
WB1.list.first = 0;
|
||||
ShowSource();
|
||||
WB1.Parse();
|
||||
break;
|
||||
case 053: //F4
|
||||
|
||||
case EDIT_SOURCE:
|
||||
if (!strncmp(#URL,"http:",5))
|
||||
{
|
||||
WriteFile(bufsize, bufpointer, "/tmp0/1/WebView_tmp.htm");
|
||||
@ -458,26 +450,35 @@ void Scan(dword id__)
|
||||
}
|
||||
else RunProgram("/rd/1/tinypad", #URL);
|
||||
return;
|
||||
case 054: //F5
|
||||
IF(address_box.flags & 0b10) return;
|
||||
|
||||
case FREE_IMG_CACHE:
|
||||
ImgCache.Free();
|
||||
notify(IMAGES_CACHE_CLEARED);
|
||||
WB1.Parse();
|
||||
return;
|
||||
|
||||
case VIEW_HISTORY:
|
||||
strcpy(#URL, URL_SERVICE_HISTORY);
|
||||
OpenPage();
|
||||
return;
|
||||
|
||||
case DOWNLOAD_MANAGER:
|
||||
if (!downloader_opened) {
|
||||
strncpy(#DL_URL, "http://",7);
|
||||
CreateThread(#Downloader,#downloader_stak+4092);
|
||||
}
|
||||
return;
|
||||
/*
|
||||
case 020:
|
||||
case NEWTAB:
|
||||
MoveSize(190,80,OLD,OLD);
|
||||
RunProgram(#program_path, #URL);
|
||||
return;
|
||||
|
||||
case SEARCHWEB:
|
||||
case SEARCHWEB_BUTTON:
|
||||
sprintf(#URL,"%s%s",#search_path,#editURL);
|
||||
OpenPage();
|
||||
return;
|
||||
|
||||
case 312:
|
||||
SwitchToAnotherThread();
|
||||
mouse.y = TOOLBAR_H-6;
|
||||
mouse.x = Form.cwidth - 167;
|
||||
CreateThread(#menu_rmb,#stak+4092);
|
||||
return;
|
||||
*/
|
||||
}
|
||||
}
|
||||
@ -564,7 +565,7 @@ void StopLoading()
|
||||
bufpointer = free(bufpointer);
|
||||
}
|
||||
wv_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);
|
||||
img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 17, skin.h, 52, 0);
|
||||
}
|
||||
|
||||
void SetPageDefaults()
|
||||
@ -594,7 +595,7 @@ void OpenPage()
|
||||
}
|
||||
if (!strncmp(#URL,"http:",5))
|
||||
{
|
||||
img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-2, 17, skin.h, 131, 0);
|
||||
img_draw stdcall(skin.image, address_box.left+address_box.width+1, address_box.top-3, 17, skin.h, 131, 0);
|
||||
http_get stdcall (#URL, 0, 0, #accept_language);
|
||||
http_transfer = EAX;
|
||||
if (!http_transfer)
|
||||
|
@ -1,26 +1,22 @@
|
||||
//Leency - 2012-2013
|
||||
|
||||
char *ITEMS_LIST[]={
|
||||
"WIN Ctrl+E",05,
|
||||
"DOS Ctrl+D",04,
|
||||
"KOI Ctrl+K",11,
|
||||
"UTF Ctrl+U",21,
|
||||
#ifdef LANG_RUS
|
||||
"Zoom 2x Z",122,
|
||||
"<EFBFBD>®á¬®âà¥âì ¨á室¨ª F3",52,
|
||||
"<EFBFBD>¥¤ ªâ¨à®¢ âì ¨á室¨ª F4",53,
|
||||
"Žç¨áâ¨âì ªíè ª à⨮ª" ,02,
|
||||
"ˆáâ®à¨ï" ,03,
|
||||
"Œ¥¥¤¦¥à § £à㧮ª" ,06,
|
||||
"Zoom 2x",
|
||||
"<EFBFBD>®á¬®âà¥âì ¨á室¨ª",
|
||||
"<EFBFBD>¥¤ ªâ¨à®¢ âì ¨á室¨ª",
|
||||
"ˆáâ®à¨ï",
|
||||
"Žç¨áâ¨âì ªíè ª à⨮ª",
|
||||
"Œ¥¥¤¦¥à § £à㧮ª",
|
||||
#else
|
||||
"Zoom 2x Z",122,
|
||||
"View source F3",52,
|
||||
"Edit source F4",53,
|
||||
"Free image cache" ,09,
|
||||
"History" ,03,
|
||||
"Download Manager" ,06,
|
||||
"Zoom 2x",
|
||||
"View source",
|
||||
"Edit source",
|
||||
"History",
|
||||
"Free image cache",
|
||||
"Download Manager",
|
||||
#endif
|
||||
0};
|
||||
0};
|
||||
|
||||
llist menu;
|
||||
|
||||
@ -29,8 +25,8 @@ void menu_rmb()
|
||||
proc_info MenuForm;
|
||||
int key;
|
||||
|
||||
menu.first = menu.current = 0;
|
||||
while (ITEMS_LIST[menu.count*2]) menu.count++;
|
||||
menu.ClearList();
|
||||
while (ITEMS_LIST[menu.count]) menu.count++;
|
||||
menu.SetSizes(2,2,177,menu.count*19,19);
|
||||
SetEventMask(100111b);
|
||||
|
||||
@ -43,18 +39,14 @@ void menu_rmb()
|
||||
|
||||
mouse.get();
|
||||
if (menu.ProcessMouse(mouse.x, mouse.y)) DrawMenuList();
|
||||
if (mouse.lkm)&&(mouse.up) { action_buf = ITEMS_LIST[menu.current*2+1]; ExitProcess(); }
|
||||
if (mouse.lkm)&&(mouse.up) ItemClick();
|
||||
break;
|
||||
|
||||
case evKey:
|
||||
key = GetKey();
|
||||
if (key==27) ExitProcess();
|
||||
if (key==13) ItemClick();
|
||||
if (menu.ProcessKey(key)) DrawMenuList();
|
||||
if (key==13)
|
||||
{
|
||||
action_buf = ITEMS_LIST[menu.current*2+1];
|
||||
ExitProcess();
|
||||
}
|
||||
break;
|
||||
|
||||
case evReDraw:
|
||||
@ -76,14 +68,15 @@ void DrawMenuList()
|
||||
else
|
||||
{
|
||||
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(19,N*menu.line_h+9,0x80,0xf2f2f2,ITEMS_LIST[N]);
|
||||
}
|
||||
WriteText(18,N*menu.line_h+8,0x80,0x000000,ITEMS_LIST[N*2]);
|
||||
WriteText(18,N*menu.line_h+8,0x80,0x000000,ITEMS_LIST[N]);
|
||||
}
|
||||
if (cur_encoding!=CH_NULL)
|
||||
WriteText(5, cur_encoding*menu.line_h+7, 0x80, 0x777777, "\x10"); //show current encoding
|
||||
else
|
||||
WriteText(5, CH_CP866*menu.line_h+7, 0x80, 0x777777, "\x10"); //show current encoding
|
||||
|
||||
if (WB1.DrawBuf.zoom == 2) DrawBar(6, 4*menu.line_h+8, 6, 6, 0x777777);
|
||||
if (WB1.DrawBuf.zoom == 2) DrawBar(6, 8, 6, 6, 0x777777);
|
||||
}
|
||||
|
||||
void ItemClick()
|
||||
{
|
||||
action_buf = ZOOM2x + menu.current;
|
||||
ExitProcess();
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 1.9 KiB |
@ -233,6 +233,7 @@
|
||||
{
|
||||
pos++;
|
||||
if(!strncmp(pos,"sys/",4)) return PATH;
|
||||
if(!strncmp(pos,"kolibrios/",10)) return PATH;
|
||||
if(!strncmp(pos,"hd/",3)) return PATH;
|
||||
if(!strncmp(pos,"fd/",3)) return PATH;
|
||||
if(!strncmp(pos,"rd/",3)) return PATH;
|
||||
|
Loading…
Reference in New Issue
Block a user