Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6044 → Rev 6045

/programs/cmm/TWB/TWB.c
135,12 → 135,12
if (strstri(bufpointer, "html"))
{
style.pre = 0;
cur_encoding = CH_UTF8;
cur_encoding = CH_NULL;
}
else
{
style.pre = 1;
cur_encoding = CH_CP866;
cur_encoding = CH_NULL;
}
for (bufpos=bufpointer ; (bufpos < bufpointer+bufsize) && (ESBYTE[bufpos]!=0) ; bufpos++;)
{
368,7 → 368,7
if (opened)
{
WB1.DrawBuf.zoom=2;
WB1.list.font_type |= 10111001b;
WB1.list.font_type |= 10011001b;
if (isattr("align=")) && (isval("center")) style.align = ALIGN_CENTER;
if (isattr("align=")) && (isval("right")) style.align = ALIGN_RIGHT;
if (stroka>1) NewLine();
376,7 → 376,7
else
{
WB1.DrawBuf.zoom=1;
WB1.list.font_type = 10111000b;
WB1.list.font_type = 10011000b;
style.align = ALIGN_LEFT;
}
return;
416,6 → 416,7
return;
}
if (istag("meta")) || (istag("?xml")) {
meta_encoding = CH_NULL;
do{
if (isattr("charset=")) || (isattr("content=")) || (isattr("encoding="))
{
426,10 → 427,9
else if (isval("windows-1251")) || (isval("windows1251")) meta_encoding = CH_CP1251;
else if (isval("iso-8859-5")) || (isval("iso8859-5")) meta_encoding = CH_ISO8859_5;
else if (isval("dos")) || (isval("cp-866")) meta_encoding = CH_CP866;
if (cur_encoding!=meta_encoding) BufEncode(meta_encoding);
return;
}
} while(GetNextParam());
if (meta_encoding!=CH_NULL) BufEncode(meta_encoding);
return;
}
}
437,7 → 437,6
void TWebBrowser::BufEncode(int set_new_encoding)
{
int bufpointer_realsize;
cur_encoding = set_new_encoding;
if (o_bufpointer==0)
{
o_bufpointer = malloc(bufsize);
447,7 → 446,12
{
strcpy(bufpointer, o_bufpointer);
}
if (cur_encoding!=set_new_encoding) {
cur_encoding = set_new_encoding;
debugln(charsets[cur_encoding]);
bufpointer = ChangeCharset(charsets[cur_encoding], "CP866", bufpointer);
}
}
//============================================================================================
void TWebBrowser::DrawScroller()
{
/programs/cmm/browser/menu.h
File deleted
\ No newline at end of file
/programs/cmm/browser/WebView.c
15,6 → 15,7
#include "..\lib\cursor.h"
#include "..\lib\collection.h"
#include "..\lib\font.h"
#include "..\lib\menu.h"
 
//*.obj libraries
#include "..\lib\obj\box_lib.h"
29,19 → 30,31
char homepage[] = FROM "html\\homepage.htm";
 
#ifdef LANG_RUS
char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 1.42";
char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 1.48";
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
char loading[] = "‡ £à㧪  áâà ­¨æë...<br>";
char page_not_found[] = FROM "html\page_not_found_ru.htm";
char accept_language[]= "Accept-Language: ru\n";
char rmb_menu[] =
"®á¬®âà¥âì ¨á室­¨ª
¥¤ ªâ¨à®¢ âì ¨á室­¨ª
ˆáâ®à¨ï
Žç¨áâ¨âì ªíè ª à⨭®ª
Œ¥­¥¤¦¥à § £à㧮ª";
#else
char version[]=" Text-based Browser 1.42";
char version[]=" Text-based Browser 1.48";
?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...<br>";
char page_not_found[] = FROM "html\page_not_found_en.htm";
char accept_language[]= "Accept-Language: en\n";
char rmb_menu[] =
"View source
Edit source
History
Free image cache
Download Manager";
#endif
 
#define URL_SERVICE_HISTORY "WebView://history"
86,7 → 99,6
};
 
#include "..\TWB\TWB.c"
#include "menu.h"
#include "history.h"
#include "show_src.h"
#include "http_downloader.h"
108,13 → 120,12
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();
CreateDir("/tmp0/1/downloads");
if (param) strcpy(#URL, #param); else strcpy(#URL, URL_SERVICE_HOME);
WB1.DrawBuf.zoom = 1;
WB1.list.SetFont(8, 14, 10111000b);
WB1.list.SetFont(8, 14, 10011000b);
WB1.list.no_selection = true;
label.init(DEFAULT_FONT);
SetEventMask(0xa7);
129,7 → 140,10
if (WB1.list.MouseOver(mouse.x, mouse.y))
{
PageLinks.Hover(mouse.x, WB1.list.first*WB1.list.item_h + mouse.y, link_color_inactive, link_color_active, bg_color);
if (bufsize) && (mouse.pkm) && (mouse.up) { CreateThread(#menu_rmb,#stak+4092); break; }
if (bufsize) && (mouse.pkm) && (mouse.up) {
menu.show(Form.left+mouse.x-6,Form.top+mouse.y+skin_height+3, 180, #rmb_menu, VIEW_SOURCE);
break;
}
if (WB1.list.MouseScroll(mouse.vert)) WB1.DrawPage();
}
scrollbar_v_mouse (#scroll_wv);
161,7 → 175,10
break;
 
case evReDraw:
if (action_buf) Scan(action_buf);
if (menu.list.cur_y) {
Scan(menu.list.cur_y);
menu.list.cur_y = 0;
}
DefineAndDrawWindow(GetScreenWidth()-800/2,GetScreenHeight()-600/2,800,600,0x73,col_bg,0,0);
GetProcessInfo(#Form, SelfInfo);
if (Form.status_window>2) { DrawTitle(#header); break; }
249,8 → 266,11
WB1.list.wheel_size = 7;
WB1.list.column_max = WB1.list.w - scroll_wv.size_x / WB1.list.font_w;
WB1.list.visible = WB1.list.h - 5 / WB1.list.item_h;
if (WB1.list.w!=WB1.DrawBuf.bufw) WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, WB1.list.h * 30);
if (WB1.list.w!=WB1.DrawBuf.bufw) {
WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, WB1.list.h * 30);
Scan(REFRESH_BUTTON);
}
}
 
 
 
332,7 → 352,7
case SANDWICH_BUTTON:
mouse.y = TOOLBAR_H-6;
mouse.x = Form.cwidth - 167;
CreateThread(#menu_rmb,#stak+4092);
menu.show(Form.left+mouse.x-6,Form.top+mouse.y+skin_height+3, 180, #rmb_menu, VIEW_SOURCE);
return;
case VIEW_SOURCE:
WB1.list.first = 0;
/programs/cmm/browser/history.h
8,7 → 8,7
history_pointer = malloc(history.items.data_size+256);
strcat(history_pointer, "<html><head><title>History</title></head><body><h1>History</h1>");
strcat(history_pointer, "<h2>Visited pages</h2><blockquote><br>");
for (i=1; i<history.items.count; i++)
for (i=0; i<history.items.count; i++)
{
strcat(history_pointer, " <a href='");
strcat(history_pointer, history.items.get(i));
/programs/cmm/lib/obj/iconv.h
29,9 → 29,9
iconv_open stdcall (from_chs, to_chs); //CP866, CP1251, CP1252, KOI8-RU, UTF-8, ISO8859-5
if (EAX==-1)
{
debug(from_chs);
debug(to_chs);
debug("iconv: wrong charset,\nuse only CP866, CP1251, CP1252, KOI8-RU, UTF-8, ISO8859-5");
debugln(from_chs);
debugln(to_chs);
debugln("iconv: wrong charset,\nuse only CP866, CP1251, CP1252, KOI8-RU, UTF-8, ISO8859-5");
return 0;
}
cd = EAX;
42,12 → 42,10
cd = EAX;
if (cd!=0)
{
debug("iconv: something is wrong with stdcall iconv()");
debugln("iconv: something is wrong with stdcall iconv()");
debugi(cd);
debug("in_len");
debugi(in_len);
debug("out_len");
debugi(out_len);
debug("in_len:"); debugi(in_len);
debug("out_len:"); debugi(out_len);
new_buf = free(new_buf);
return 0;
}