Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4040 → Rev 4042

/programs/cmm/eolite/include/file_menu.h
File deleted
\ No newline at end of file
/programs/cmm/eolite/include/some_code.h
File deleted
\ No newline at end of file
/programs/cmm/eolite/include/about_dialog.h
File deleted
\ No newline at end of file
/programs/cmm/eolite/include/icons_f.h
File deleted
/programs/cmm/eolite/include/copypaste.h
File deleted
/programs/cmm/eolite/include/about.h
0,0 → 1,71
//Leency 2008-2013
 
#define EDITOR_PATH "/sys/tinypad"
#define BROWSER_PATH "/sys/htmlv"
#define BROWSER_LINK "http://kolibri-n.org/index.php"
 
#ifdef LANG_RUS
?define INTRO_TEXT_1 "Ž Eolite"
?define INTRO_TEXT_2 " §à ¡®â稪¨:"
?define INTRO_TEXT_3 "®á¥â¨â¥"
?define INTRO_TEXT_4 "‡ ªàëâì"
#elif LANG_EST
?define INTRO_TEXT_1 "Programmis Eolite"
?define INTRO_TEXT_2 "Arendajad:"
?define INTRO_TEXT_3 "Külasta"
?define INTRO_TEXT_4 "Sulge"
#else
?define INTRO_TEXT_1 "About Eolite"
?define INTRO_TEXT_2 "Developers:"
?define INTRO_TEXT_3 "Visit"
?define INTRO_TEXT_4 "Close"
#endif
 
void about_dialog()
{
byte id;
IF (active_about) ExitProcess();
active_about=1;
loop() switch(WaitEvent())
{
case evButton:
id=GetButtonID();
IF (id==1) || (id==10)
{
active_about=0;
ExitProcess();
}
IF (id==23) RunProgram(BROWSER_PATH, BROWSER_LINK);
break;
case evKey:
IF (GetKey()==27)
{
active_about=0;
ExitProcess();
}
break;
case evReDraw:
DefineAndDrawWindow(600,150,181,232+GetSkinHeight(),0x34,col_work,INTRO_TEXT_1);
DrawBar(0,0,172,50,0x8494C4);
PutPaletteImage(#logo,85,85,43,7,8,#logo_pal);
WriteTextB(46,100,0x90,0xBF40BF,ABOUT_TITLE);
#ifdef LANG_RUS
WriteText(50,120,0x80,0,INTRO_TEXT_2);
#else
WriteText(55,120,0x80,0,INTRO_TEXT_2);
#endif
WriteText(39,130,0x80,0,"Leency & Veliant");
WriteText(45,140,0x80,0,"KolibriOS Team");
WriteText(61,150,0x80,0,"2008-2013");
#ifdef LANG_RUS
WriteText(19,170,0x80,0,INTRO_TEXT_3);
#else
WriteText(29,170,0x80,0,INTRO_TEXT_3);
#endif
DrawLink(71,170,0x80,23, "kolibri-n.org");
DrawFlatButton(85,190,70,22,10,0xE4DFE1, INTRO_TEXT_4);
DrawFilledBar(0, 216, 172, 12);
}
}
/programs/cmm/eolite/include/copy.h
0,0 → 1,61
//Leency 2008-2013
 
 
byte copy_from[4096], copy_to[4096], cut_active=0;
enum {NOCUT, CUT, COPY_PASTE_END};
#define WIN_W 300
#define WIN_H 50
 
 
void Copy(dword pcth, char cut)
{
strcpy(#copy_from, pcth);
cut_active = cut;
}
 
void copyf_Draw_Progress(dword filename) {
DefineAndDrawWindow(Form.left+Form.width-200,Form.top+90,WIN_W,GetSkinHeight()+WIN_H-1,0x34,col_work,T_PASTE_WINDOW);
WriteText(5,8, 0x80, 0, T_PASTE_WINDOW_TEXT);
DrawBar(5, 26, WIN_W-10, 10, col_work);
WriteText(5,26, 0x80, 0, filename);
if (CheckEvent()==evButton)
{
notify(T_CANCEL_PASTE);
ExitProcess();
}
}
 
 
void Paste()
{
char copy_rezult;
if (!copy_from) ExitProcess();
strcpy(#copy_to, #path);
strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
if (!strcmp(#copy_from,#copy_to))
{
strcpy(#copy_to, #path);
strcat(#copy_to, "new_");
strcat(#copy_to, #copy_from+strrchr(#copy_from,'/'));
}
if (strstr(#copy_to, #copy_from))
{
notify("Copy directory into itself is a bad idea...");
ExitProcess();
}
if (copy_rezult = copyf(#copy_from,#copy_to))
{
Write_Error(copy_rezult);
}
else if (cut_active)
{
strcpy(#file_path, #copy_from);
Del_File(true);
copy_from=NULL;
cut_active=false;
}
action_buf = COPY_PASTE_END;
ActivateWindow(GetProcessSlot(Form.ID));
ExitProcess();
}
/programs/cmm/eolite/include/icons.h
0,0 → 1,145
char *ext[]={
"..", 17,
"<DIR>",16,
"txt", 1, "doc", 1, "rtf", 1, "odt", 1, "log", 1, "docx",1,
"htm", 2, "html",2, "mht", 2,
"ini", 3, "js", 3, "conf",3, "inf", 3,
"xlt", 4, "xls", 4, "ods", 4, "xlsx",4,
"cmd", 5, "bat", 5, "py", 5, "sh", 5, "ksh", 5, "com", 5,
"kex", 6, "lua", 6,
"exe", 7, "msi", 7,
"sys", 8, "ocx", 8, "drv", 8, "so", 8,
"inc", 9,
"chr", 10, "mt", 10, "ttf", 10, "fon", 10,
"asm", 11,
"mp3", 12, "wav", 12, "mid", 12, "midi",12, "ogg", 12, "wma", 12, "flac",12,
"skn", 13,
"avi", 14, "flv", 14, "mpg", 14, "wmv", 14, "mov", 14, "mkv", 14, "mp4", 14, "vob", 14, "webm", 14,
"djvu",15, "pdf", 15, "fb2", 15,
"nes", 18, "smc", 18,
"gif", 19, "bmp", 19, "tga", 19, "pcx", 19, "png", 19, "pnm", 19, "jpg", 19, "xcf", 19, "ai", 19,
"jpeg",19, "raw", 19, "psd", 19, "wbmp",19, "tiff",19, "tif", 19,
"3ds", 20, "ico", 20, "cur", 20, "ani", 20, "vox", 20,
"img", 21, "ima", 21,
"dll", 22, "obj", 22, "dict",22,
"rar", 23, "zip", 23, "cab", 23, "tar", 23, "ajr", 23, "jar", 23, "7z", 23, "gz", 23,
"iso", 24, "cue", 24, "nrg", 24, "mdf", 24,
"grf", 25,
0,0};
 
 
#include "imgs\icons.txt"
 
void Put_icon(dword extension, yy, fairing_color)
{
int icon_n=0, i;
for (i=0; ext[i]!=0; i+=2;) if (!strcmp(extension, ext[i])) { icon_n = ext[i+1]; break; }
 
ficons_pal[0] = fairing_color;
PutPaletteImage(icon_n*16*15+#ficons,16,15,files.x+3,yy,8,#ficons_pal);
if (fairing_color!=0xFFFfff) IconFairing(icon_n, files.x+3, yy, fairing_color);
if (icon_n<>17) && (strlen(extension)<9) WriteText(-strlen(extension)*3+Form.cwidth-120,yy+4,0x80,0,extension);
}
 
 
void IconFairing(dword filenum, x,y, color)
{
switch(filenum)
{
case 0...1: //file
case 3: //íàñòðîéêè
RIGHT_PAINT:
DrawBar(205,y,4,1,color);
DrawBar(206,y+1,3,1,color);
DrawBar(207,y+2,2,1,color);
PutPixel(208,y+3,color);
return;
case 2: //html
DrawBar(195,y,1,7,color);
DrawBar(196,y,1,6,color);
DrawBar(195,y+10,1,5,color);
DrawBar(196,y+11,1,4,color);
GOTO RIGHT_PAINT;
case 9: //inc
DrawBar(208,y,1,3,color);
DrawBar(209,y,2,4,color);
DrawBar(210,y,1,15,color);
PutPixel(198,y+14,color);
DrawBar(199,y+13,1,2,color);
DrawBar(200,y+12,10,3,color);
PutPixel(205,y+11,color);
DrawBar(206,y+10,1,2,color);
DrawBar(207,y+9,1,3,color);
PutPixel(207,y+7,color);
DrawBar(208,y+6,2,7,color);
PutPixel(209,y+5,color);
return;
case 10: //font
DrawBar(196,y+1,1,13,color);
DrawBar(197,y+1,1,11,color);
DrawBar(198,y+1,1,10,color);
DrawBar(199,y+1,1,9,color);
DrawBar(200,y+1,1,7,color);
DrawBar(201,y+1,1,5,color);
DrawBar(202,y+1,1,4,color);
DrawBar(203,y+1,1,2,color);
DrawBar(209,y+1,1,13,color);
DrawBar(208,y+1,1,11,color);
PutPixel(204,y+6,color);
DrawBar(203,y+10,2,1,color);
DrawBar(202,y+11,2,3,color);
return;
case 12: //audio
PutPixel(x+2,y+9,color);
PutPixel(x+1,y+10,color);
PutPixel(x+10,y+8,color);
PutPixel(x+9,y+9,color);
 
PutPixel(x+6,y+13,color);
PutPixel(x+5,y+14,color);
PutPixel(x+14,y+12,color);
PutPixel(x+13,y+13,color);
return;
case 13: //skin
PutPixel(210,y,color);
return;
case 16...17: //folder
DrawBar(195,y,1,15,color);
DrawBar(203,y,8,2,color);
IF (filenum==17) PutPixel(206,y+1,0x1A7B17); //green arrow part
DrawBar(196,y+13,15,2,color);
PutPixel(196,y,color); //.òî÷êè
PutPixel(202,y,color);
PutPixel(210,y+2,color);
PutPixel(196,y+12,color);
PutPixel(210,y+12,color);
return;
case 18: //êàðòðèäæ
DrawBar(195,y+11,1,2,color);
DrawBar(210,y+11,1,2,color);
DrawBar(195,y+13,16,1,color);
return;
case 24: //îáðàç
DrawBar(195,y,6,1,color);
DrawBar(195,y+1,4,1,color);
DrawBar(195,y+2,3,1,color);
DrawBar(195,y+3,2,2,color);
DrawBar(195,y+5,1,5,color);
DrawBar(195,y+10,2,2,color);
DrawBar(195,y+12,3,1,color);
DrawBar(195,y+13,4,1,color);
DrawBar(195,y+14,6,1,color);
 
DrawBar(195+11,y,5,1,color);
DrawBar(195+13,y+1,3,1,color);
DrawBar(195+14,y+2,2,1,color);
DrawBar(195+15,y+3,1,2,color);
DrawBar(195+15,y+10,1,2,color);
DrawBar(195+14,y+12,2,1,color);
DrawBar(195+13,y+13,3,1,color);
DrawBar(195+11,y+14,5,1,color);
}
}
/programs/cmm/eolite/include/menu.h
0,0 → 1,119
//Leency 2008-2013
 
//pay attension: >200 this is only file actions, not supported by folders
#ifdef LANG_RUS
char *file_captions[] = {
"Žâªàëâì", "Enter",100,
"Žâªàëâì á ¯®¬®éìî...", "CrlEnt",201,
"Žâªàëâì ª ª ⥪áâ", "F3",202,
"Žâªàëâì ª ª HEX", "F4",203,
"Š®¯¨à®¢ âì", "Crl+C",104,
"‚ë१ âì", "Crl+X",105,
"‚áâ ¢¨âì", "Crl+V",106,
"¥à¥¨¬¥­®¢ âì", "F2",207,
"“¤ «¨âì", "Del",108,
"Ž¡­®¢¨âì ¯ ¯ªã", "F5",109,
0, 0, 0};
#elif LANG_EST
char *file_captions[] = {
"Ava", "Enter",100,
"Ava ...", "CrlEnt",201,
"Vaata tekstina", "F3",202,
"Vaata HEX", "F4",203,
"Kopeeri", "Crl+C",104,
"Lõika", "Crl+X",105,
"Aseta", "Crl+V",106,
"Nimeta ümber", "F2",207,
"Kustuta", "Del",108,
"Värskenda", "F5",109,
0, 0, 0};
#else
char *file_captions[] = {
"Open", "Enter",100,
"Open with...", "CrlEnt",201,
"View as text", "F3",202,
"View as HEX", "F4",203,
"Copy", "Crl+C",104,
"Cut", "Crl+X",105,
"Paste", "Crl+V",106,
"Rename", "F2",207,
"Delete", "Del",108,
"Refresh", "F5",109,
0, 0, 0};
#endif
 
 
void FileMenu()
{
mouse mm;
word slot, index, start_y;
llist menu;
proc_info MenuForm;
int texty, newi;
 
menu.ClearList();
menu.SetSizes(m.x+Form.left+5,m.y+Form.top+GetSkinHeight(),10,0,0,18);
for (index=0; file_captions[index]!=0; index+=3)
{
if (itdir) && (file_captions[index+2]>=200) continue;
if (strlen(file_captions[index])>menu.w) menu.w = strlen(file_captions[index]);
menu.count++;
}
menu.w = menu.w + 3 * 6 + 50;
menu.h = menu.count*menu.line_h;
texty = menu.line_h/2-4;
SetEventMask(100111b);
goto _MENU_DRAW;
loop() switch(WaitEvent())
{
case evMouse:
slot = GetProcessSlot(MenuForm.ID);
if (slot != GetActiveProcess()) ExitProcess();
mm.get();
newi = mm.y - 1 / menu.line_h;
if (mm.y<=0) || (mm.y>menu.h+5) || (mm.x<0) || (mm.x>menu.w) newi=-1;
if (menu.current<>newi)
{
menu.current=newi;
goto _ITEMS_DRAW;
}
break;
 
case evButton:
action_buf = GetButtonID();
ExitProcess();
break;
case evKey:
if (GetKey()==27) ExitProcess();
break;
case evReDraw: _MENU_DRAW:
DefineAndDrawWindow(menu.x, menu.y,menu.w+3,menu.h+6,0x01, 0, 0, 0x01fffFFF);
GetProcessInfo(#MenuForm, SelfInfo);
DrawRectangle(0,0,menu.w+1,menu.h+2,col_border);
DrawBar(1,1,menu.w,1,0xFFFfff);
DrawPopupShadow(1,1,menu.w,menu.h,0);
 
_ITEMS_DRAW:
for (index=0, start_y=0; file_captions[index*3]!=0; index++)
{
DefineButton(1,start_y+1,menu.w,menu.line_h-1,file_captions[index*3+2]+BT_HIDE+BT_NOFRAME,0xFFFFFF);
if ((itdir) && (file_captions[index*3+2]>=200)) continue;
DrawBar(1,start_y+2,1,menu.line_h,0xFFFfff);
if (start_y/menu.line_h==menu.current)
{
DrawBar(2,start_y+2,menu.w-1,menu.line_h,0xFFFfff);
}
else
{
DrawBar(2,start_y+2,menu.w-1,menu.line_h,col_work);
WriteText(8,start_y+texty+3,0x80,0xf2f2f2,file_captions[index*3]);
}
WriteText(7,start_y+texty+2,0x80,0x000000,file_captions[index*3]);
WriteText(-strlen(file_captions[index*3+1])*6-6+menu.w,start_y+texty+2,0x80,0x888888,file_captions[index*3+1]);
start_y+=menu.line_h;
}
}
}
/programs/cmm/eolite/include/open_with.h
0,0 → 1,43
//Leency 2013
 
void OpenWith()
{
?define OPEN_LIST_W 300
?define OPEN_LIST_H 300
mouse mm;
word key, slot, index, start_y;
llist app_list;
proc_info MenuForm;
int texty, newi;
 
app_list.ClearList();
app_list.SetSizes(files.w-OPEN_LIST_W/2+files.x+Form.left+4,files.h-OPEN_LIST_H/2+files.y+Form.top+GetSkinHeight(),OPEN_LIST_W,OPEN_LIST_H,150,18);
SetEventMask(100111b);
goto _APP_LIST_DRAW;
 
loop() switch(WaitEvent())
{
case evMouse:
slot = GetProcessSlot(MenuForm.ID);
if (slot != GetActiveProcess()) ExitProcess();
mm.get();
if (m.lkm) ExitProcess();
break;
case evKey:
key = GetKey();
if (key==27) ExitProcess();
break;
case evReDraw: _APP_LIST_DRAW:
DefineAndDrawWindow(app_list.x, app_list.y,app_list.w+3,app_list.h+6,0x01, 0, 0, 0x01fffFFF);
GetProcessInfo(#MenuForm, SelfInfo);
DrawPopup(0,0,app_list.w,app_list.h,0, col_work,col_border);
WriteText(10,10, 0x80, 0, "Select application to open file"w);
WriteText(10,23, 0x80, 0, #file_name);
WriteTextB(app_list.w/2-25,app_list.h/2, 0x90, 0, "S O O N");
 
_APP_LIST_ITEMS_DRAW:
break;
}
}
/programs/cmm/eolite/include/other.h
0,0 → 1,77
//Leency 2008-2013
 
 
dword onLeft(dword right,left) {EAX=Form.width-right-left;}
dword onTop(dword down,up) {EAX=Form.height-GetSkinHeight()-down-up;}
 
 
void ShowMessage(dword message, pause_duration)
{
int form_x=files.w-220/2+files.x;
int form_y=160;
DrawPopup(form_x,form_y,220,80,1,col_work,col_border);
WriteText(-strlen(message)*3+110+form_x,80/2-4+form_y,0x80,0,message);
pause(pause_duration);
if (pause_duration) List_ReDraw();
}
 
inline fastcall signed int _strrchr( ESI,BL)
{
int jj=0, last=strlen(ESI);
do{
jj++;
$lodsb
IF(AL==BL) last=jj;
} while(AL!=0);
return last;
}
 
 
dword col_palette[14] = {0xD2D3D3,0xD4D4D4,0xD6D5D6,0xD8D7D8,0xDAD8D9,0xDCDADB,
0xDFDCDD,0xE1DDDE,0xE2DEE0,0xE4DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1,0xE3DFE1};
 
inline fastcall void Scroll() { //Ïðîêðóòêà
dword on_y, i;
if (files.count<=0)
{
on_y = 57;
scroll_size = onTop(22,58);
}
else
{
on_y = files.first * onTop(22,57) / files.count +57;
scroll_size=onTop(22,57) * files.visible - files.visible / files.count;
if (scroll_size<20) scroll_size = 20; //óñòàíàâëèâàåì ìèíèìàëüíûé ðàçìåð ñêðîëëà
if (scroll_size>onTop(22,57)-on_y+56) || (files.first+files.visible>=files.count) on_y=onTop(23+scroll_size,0); //äëÿ áîëüøîãî ñïèñêà
}
DrawFlatButton(onLeft(27,0),on_y,16,scroll_size,0,-1,"");//ïîëçóíîê
if (!scroll_used) for (i=0; i<13; i++) DrawBar(onLeft(25-i,0), on_y+2, 1, scroll_size-3, col_palette[13-i]);
if (scroll_used) for (i=0; i<13; i++) DrawBar(onLeft(25-i,0), on_y+2, 1, scroll_size-3, col_palette[i]);
//ïîëå äî ïîëçóíêà
if (on_y>58) DrawBar(onLeft(26,0),57,15,1, 0xC7C9C9);
DrawBar(onLeft(26,0),58,1, on_y-58,0xC7C9C9);
DrawBar(onLeft(25,0),58,14,on_y-58,0xCED0D0);
//ïîëå ïîñëå ïîëçóíêà
if (onTop(22,57)-scroll_size+55>on_y) DrawBar(onLeft(26,0),on_y+scroll_size+1,15,1,0xC7C9C9);
DrawBar(onLeft(26,0),on_y+scroll_size+2,1,onTop(22,57)-scroll_size-on_y+55,0xC7C9C9);
DrawBar(onLeft(25,0),on_y+scroll_size+2,14,onTop(22,57)-scroll_size-on_y+55,0xCED0D0);
}
 
void DrawFlatButton(dword x,y,width,height,id,color,text)
{
int fill_h;
DrawRectangle(x,y,width,height,col_border);
DrawRectangle3D(x+1,y+1,width-2,height-2,0xFEFEFE,col_padding);
PutPixel(x+width-1, y+1, col_work);
if (color!=-1) DrawFilledBar(x+2, y+2, width-3, height-3);
IF (id<>0) DefineButton(x+1,y+1,width-2,height-2,id+BT_HIDE,0xEFEBEF);
WriteText(-strlen(text)*6+width/2+x+1,height/2-3+y,0x80,0,text);
}
 
void DrawFilledBar(dword x, y, w, h)
{
int i, fill_h;
if (h <= 14) fill_h = h; else fill_h = 14;
for (i=0; i<fill_h; i++) DrawBar(x, y+i, w, 1, col_palette[14-i]);
DrawBar(x, y+i, w, h-fill_h, col_palette[14-i]);
}