/programs/cmm/TWB/TWB.c |
---|
113,9 → 113,9 |
{ |
strcpy(bufpointer, o_bufpointer); |
} |
if (set_new_encoding==_WIN) wintodos(bufpointer); |
if (set_new_encoding==_UTF) utf8rutodos(bufpointer); |
if (set_new_encoding==_KOI) koitodos(bufpointer); |
if (set_new_encoding==_WIN) bufpointer = ChangeCharset("CP1251", "CP866", bufpointer); |
if (set_new_encoding==_UTF) bufpointer = ChangeCharset("UTF-8", "CP866", bufpointer); |
if (set_new_encoding==_KOI) bufpointer = ChangeCharset("KOI8-RU", "CP866", bufpointer); |
} |
void TWebBrowser::Prepare(dword bufpos, in_filesize){ |
653,3 → 653,19 |
} |
:dword Hex2Symb(char* htmlcolor) |
{ |
dword j=0, symbol=0; |
char ch=0x00; |
for (;j<2;j++) |
{ |
ch=ESBYTE[htmlcolor+j]; |
if (ch==0x0d) || (ch=='\9') RETURN 0; |
if ((ch>='0') && (ch<='9')) ch -= '0'; |
if ((ch>='A') && (ch<='F')) ch -= 'A'-10; |
if ((ch>='a') && (ch<='f')) ch -= 'a'-10; |
symbol = symbol*0x10 + ch; |
} |
AL=symbol; |
} |
/programs/cmm/browser/WebView.c |
---|
11,7 → 11,6 |
#define MEMSIZE 0x100000 |
#include "..\lib\strings.h" |
#include "..\lib\gui.h" |
#include "..\lib\encoding.h" |
#include "..\lib\file_system.h" |
#include "..\lib\mem.h" |
#include "..\lib\draw_buf.h" |
23,6 → 22,7 |
#include "..\lib\obj\libio_lib.h" |
#include "..\lib\obj\libimg_lib.h" |
#include "..\lib\obj\http.h" |
#include "..\lib\obj\iconv.h" |
//useful patterns |
#include "..\lib\patterns\libimg_load_skin.h" |
30,7 → 30,7 |
char homepage[] = FROM "html\\homepage.htm"; |
#ifdef LANG_RUS |
char version[]=" ¥ªáâ®¢ë© ¡à 㧥à 1.15"; |
char version[]=" ¥ªáâ®¢ë© ¡à 㧥à 1.16"; |
?define IMAGES_CACHE_CLEARED "íè ª à⨮ª ®ç¨é¥" |
?define T_LAST_SLIDE "â® ¯®á«¥¤¨© á« ©¤" |
char loading[] = " £à㧪 áâà ¨æë...<br>"; |
37,7 → 37,7 |
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.15"; |
char version[]=" Text-based Browser 1.16"; |
?define IMAGES_CACHE_CLEARED "Images cache cleared" |
?define T_LAST_SLIDE "This slide is the last" |
char loading[] = "Loading...<br>"; |
128,6 → 128,7 |
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); |
Libimg_LoadImage(#skin, abspath("wv_skin.png")); |
SetSkinColors(); |
332,7 → 333,7 |
} |
void ChangeCharset(byte new_charset) |
void ChangeCharset1(byte new_charset) |
{ |
BufEncode(new_charset); |
WB1.Parse(); |
349,19 → 350,19 |
switch (id) |
{ |
case 011: //Ctrk+K |
ChangeCharset(_KOI); |
ChangeCharset1(_KOI); |
return; |
case 021: //Ctrl+U |
ChangeCharset(_UTF); |
ChangeCharset1(_UTF); |
return; |
case 004: //Ctrl+D |
ChangeCharset(_DOS); |
ChangeCharset1(_DOS); |
return; |
case 005: //Win encoding |
ChangeCharset(_WIN); |
ChangeCharset1(_WIN); |
return; |
case 009: //free img cache |
/programs/cmm/downloader/Downloader.c |
---|
3,7 → 3,6 |
#include "..\lib\kolibri.h" |
#include "..\lib\strings.h" |
#include "..\lib\gui.h" |
#include "..\lib\encoding.h" |
#include "..\lib\draw_buf.h" |
#include "..\lib\file_system.h" |
#include "..\lib\mem.h" |
/programs/cmm/lib/encoding.h |
---|
File deleted |
\ No newline at end of file |
/programs/cmm/lib/dll.h |
---|
19,7 → 19,7 |
:inline void error_init(dword text) |
{ |
dword TEXT_ERROR = malloc(1024); |
sprintf("%s `%s`' -E",_TEXT_ERROR_ADD,text); |
sprintf(TEXT_ERROR, "%s `%s`' -E",_TEXT_ERROR_ADD,text); |
notify(TEXT_ERROR); |
free(TEXT_ERROR); |
} |
/programs/cmm/lib/obj/iconv.h |
---|
57,8 → 57,8 |
} |
char *charsets[] = { " ", "UTF-8", "KOI8-RU", "CP1251", "CP1252", "ISO8859-5", "CP866"}; |
int cur_charset; |
:char *charsets[] = { " ", "UTF-8", "KOI8-RU", "CP1251", "CP1252", "ISO8859-5", "CP866"}; |
:int cur_charset; |
enum { |
CH_NULL, |
CH_UTF8, |
/programs/cmm/lib/strings.h |
---|
21,7 → 21,7 |
// itoa(signed long number) --- convert the number as a string |
// atoi(dword text) --- convert a string as a number |
// strupr( ESI) |
// strlwr( ESI) --- kyrillic symbols may not work |
// strlwr( ESI) --- Cyrillic symbols may not work |
// strttl( EDX) |
// strtok( ESI) |
// strltrim(dword text) --- removes "blank" characters on the left (\r, \n and space) |
/programs/cmm/liza/liza.c |
---|
6,7 → 6,6 |
#include "../lib/strings.h" |
#include "../lib/mem.h" |
#include "../lib/dll.h" |
#include "../lib/encoding.h" |
#include "../lib/gui.h" |
#include "../lib/file_system.h" |
#include "../lib/list_box.h" |
106,7 → 105,7 |
load_dll(netcode_lib, #base64_encode,0); |
load_dll(libio, #libio_init,1); |
load_dll(libimg, #libimg_init,1); |
if (load_dll2(iconv_lib, #iconv_open,0)!=0) { notify("Error while loading library - iconv.obj"); use_iconv=2; } |
load_dll(iconv_lib, #iconv_open,0); |
OpenMailDat(); |
SetEventMask(0x27); |
LoginBoxLoop(); |
/programs/cmm/liza/parselist.c |
---|
52,8 → 52,6 |
void ConvertToDOS(dword inbuf, searchin) |
{ |
dword dos_buf=0; |
if (use_iconv==1) |
{ |
cur_charset = CH_CP866; |
if (strstri(searchin, "windows-1251")!=0) || (strstri(searchin, "windows1251")!=0) |
{ dos_buf = ChangeCharset("CP1251", "CP866", inbuf); cur_charset = CH_CP1251;} |
66,13 → 64,6 |
else if (strstri(searchin, "windows-1252")!=0) || (strstri(searchin, "windows1252")!=0) |
{ dos_buf = ChangeCharset("CP1252", "CP866", inbuf); cur_charset = CH_CP1252;} |
} |
else |
{ |
if (strstri(searchin, "windows-1251")!=0) wintodos( inbuf); else |
if (strstri(searchin, "koi8-")!=0) koitodos( inbuf); else |
if (strstri(searchin, "utf-8")!=0) utf8rutodos( inbuf); |
} |
} |
dword CopyBetweenOffsets(dword start, end) //do not forget to free(line) after use |
/programs/cmm/liza/settings.c |
---|
3,7 → 3,6 |
#define CUSTOM 0 |
#define MANUAL 1 |
char checked[3] = { 1, 0 }; |
int use_iconv = 1; |
char *text1[] = {"POP server adress:", "POP server port:", "SMTP server adress:", "SMTP server port:", '\0'}; |
62,12 → 61,6 |
} |
OptionsWindow(); |
} |
if (id==20) |
{ |
if (use_iconv==2) break; |
if (use_iconv==1) use_iconv=0; else use_iconv=1; |
OptionsWindow(); |
} |
break; |
case evKey: |
120,7 → 113,4 |
edit_box_draw stdcall(#POP_server_port_box); |
edit_box_draw stdcall(#SMTP_server_box); |
edit_box_draw stdcall(#SMTP_server_port_box); |
WriteTextB(ELEM_X, 205, 0x90, system.color.work_text, "MailBox settings"); |
CheckBox(ELEM_X, 230,12, 12, 20, "Use iconv library for converting text charsets", system.color.work_graph, system.color.work_text, use_iconv); |
} |
/programs/cmm/tmpdisk/t_gui.c |
---|
227,7 → 227,7 |
for (i=0; i<disk_num; i++) |
{ |
DefineButton(disk_pos_x[i], disk_pos_y[i], 65, 30, 20+i, 0xFFFfff); |
WriteText(disk_pos_x[i]+25,disk_pos_y[i]+6, 0x90, 0, #disk_list[i].Item); |
WriteText(disk_pos_x[i]+25,disk_pos_y[i]+2, 10110000b, 0, #disk_list[i].Item); |
real_id = disk_list[i].Item[3] - '0'; |
WriteText(disk_pos_x[i]+25,disk_pos_y[i]+19, 0x80, 0x888888, ConvertSize(disk_sizes[real_id])); |
_PutImage(disk_pos_x[i]+5,disk_pos_y[i]+4, 14,14, 2*14*14*3+#icons); |