Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7758 → Rev 7759

/programs/cmm/lib/gui.h
274,6 → 274,23
ESBYTE[next_word_pointer] = '\n';
}
 
:void DrawOvalBorder(dword x,y,w,h, light,dark,right,dots)
{
DrawBar(x+1, y, w, 1, light);
DrawBar(x+1, y+h+1, w, 1, dark);
DrawBar(x, y+1, 1, h-1, light);
DrawBar(x+w+1, y+2, 1, h-2, right);
 
PutPixel(x, y, dots);
PutPixel(x+w+1, y+h+1, dots);
PutPixel(x, y+h+1, dots);
PutPixel(x+w+1, y, dots);
PutPixel(x, y+h, dark);
PutPixel(x+w+1, y+1, light);
PutPixel(x+w+1, y+h, dark);
}
 
//this function increase falue and return it
//useful for list of controls which goes one after one
:struct incn
/programs/cmm/lib/obj/iconv.h
16,17 → 16,19
char aIconv_open[] = "iconv_open";
char aIconv[] = "iconv";
 
char charsets[] = "UTF-8\0 KOI8-RU\0 CP1251\0 CP1252\0 ISO8859-5\0CP866";
enum { CH_UTF8, CH_KOI8, CH_CP1251, CH_CP1252, CH_ISO8859_5, CH_CP866, CH_NULL };
 
dword ChangeCharset(dword from_chs, to_chs, conv_buf)
{
dword cd, in_len, out_len, new_buf;
 
debug("iconv: from_chs = "); debugln(from_chs);
debug("iconv: to_chs = "); debugln(to_chs);
 
iconv_open stdcall (from_chs, to_chs); //CP866, CP1251, CP1252, KOI8-RU, UTF-8, ISO8859-5
if (EAX==-1)
{
debugln(from_chs);
debugln(to_chs);
debugln("iconv: wrong charset,\nuse only CP866, CP1251, CP1252, KOI8-RU, UTF-8, ISO8859-5");
if (EAX==-1) {
debugln("iconv: unsupported charset");
return 0;
}
cd = EAX;
41,7 → 43,7
debugval("in_len", in_len);
debugval("out_len", out_len);
new_buf = free(new_buf);
return 0;
return conv_buf;
}
strcpy(conv_buf, new_buf);
free(new_buf);
48,9 → 50,4
return conv_buf;
}
 
 
:int cur_charset;
:char *charsets[] = { "UTF-8", "KOI8-RU", "CP1251", "CP1252", "ISO8859-5", "CP866", 0 };
enum { CH_UTF8, CH_KOI8, CH_CP1251, CH_CP1252, CH_ISO8859_5, CH_CP866, CH_NULL };
 
#endif
/programs/cmm/lib/patterns/toolbar_button.h
0,0 → 1,29
 
void DrawTopPanelButton(dword _button_id, _x, _y, signed int _icon_n)
{
#define TSZE 25
static libimg_image top_icons;
static dword semi_white=0, bg_col, bg_col_light, bg_col_dark, bg_dark;
if (!semi_white) {
bg_col = system.color.work;
if (GrayScaleImage(#bg_col,1,1)<65) bg_dark=true; else bg_dark=false;
Libimg_LoadImage(#top_icons, "/sys/icons16.png");
 
semi_white = MixColors(system.color.work, 0xFFFfff, bg_dark*90 + 96);
bg_col_dark = MixColors(system.color.work, system.color.work_graph, 90);
bg_col_light = MixColors(semi_white, 0xFFFfff, bg_dark*90 + 10);
 
Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffFFFfff, semi_white);
Libimg_ReplaceColor(top_icons.image, top_icons.w, top_icons.h, 0xffCACBD6, MixColors(semi_white, 0, 220));
}
 
DrawWideRectangle(_x+1, _y+1, TSZE, TSZE, 5, semi_white);
DrawOvalBorder(_x, _y, TSZE, TSZE, bg_col_light, bg_col_dark, semi_white, system.color.work);
 
DefineHiddenButton(_x, _y, TSZE+1, TSZE+1, _button_id);
if (_icon_n==-1) {
DrawBar(_x+6, _y+5, 16, 16, semi_white);
} else {
img_draw stdcall(top_icons.image, _x+6, _y+5, 16, 16, 0, _icon_n*16);
}
}