Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 4869 → Rev 4870

/programs/cmm/example/example.c
4,29 → 4,9
#include "..\lib\mem.h"
#include "..\lib\file_system.h"
 
void str_replace(dword buf_in, what_replace, to_what_replace) {
dword start_pos=0;
dword buf_from;
 
buf_from = malloc(strlen(buf_in));
loop() {
strcpy(buf_from, buf_in);
start_pos = strstr(buf_from, what_replace);
if (start_pos == 0) break;
strlcpy(buf_in, buf_from, start_pos-buf_from);
strcat(buf_in, to_what_replace);
start_pos += strlen(what_replace);
strcat(buf_in, start_pos);
}
free(buf_from);
}
 
void main()
{
int id, key;
strcpy(#param, " <html>lorem</html>");
str_replace(#param, "<", "&lt");
str_replace(#param, ">", "&gt");
loop()
{
/programs/cmm/game_center/compile.bat
0,0 → 1,5
C-- game_center.c
@del game_center
@rename game_center.com game_center
@pause
@del warning.txt
/programs/cmm/game_center/game_center.c
0,0 → 1,157
/*
GAME CENTER v1.0
*/
 
#define MEMSIZE 0x3E80
#include "..\lib\kolibri.h"
#include "..\lib\strings.h"
#include "..\lib\mem.h"
#include "..\lib\file_system.h"
#include "..\lib\dll.h"
#include "..\lib\figures.h"
 
#include "..\lib\lib.obj\libio_lib.h"
#include "..\lib\lib.obj\libimg_lib.h"
 
system_colors sc;
proc_info Form;
 
struct link {
char *name;
char *path;
int icon;
};
 
struct link games[] = {
"Bomber", "/kolibrios/games/bomber/bomber", 35,
"DOOM1", "/kolibrios/games/doom1/doom", 43,
"DOOM2", "/kolibrios/games/doom2/doom", 43,
"Fara", "/kolibrios/games/fara/fara", 42,
"JumpBump", "/kolibrios/games/jumpbump/jumpbump", 35,
"Loderunner", "/kolibrios/games/LRL/LRL", 41,
"BabyPainter", "/kolibrios/games/baby painter", 35,
"Knight", "/kolibrios/games/knight", 35,
"Pinton", "/kolibrios/games/piton", 32,
 
"15", "/sys/games/15", 34,
"Arcanii", "/sys/games/arcanii", 12,
"Ataka", "/sys/games/ataka", 35,
"C4", "/sys/games/c4", 35,
"Checkers", "/sys/games/checkers", 20,
"Clicks", "/sys/games/clicks", 18,
"FNumbers", "/sys/games/FindNumbers", 35,
"Flood-It", "/sys/games/flood-it", 27,
"Freecell", "/sys/games/freecell", 35,
"Gomoku", "/sys/games/gomoku", 24,
"Invaders", "/kolibrios/games/invaders", 35,
"Klavisha", "/sys/games/klavisha", 35,
"Kosilka", "/sys/games/kosilka", 23,
"Lines", "/sys/games/lines", 35,
"MBlocks", "/sys/games/mblocks", 11,
"Megamaze", "/sys/games/megamaze", 35,
"Mine", "/sys/games/mine", 14,
"Square", "/sys/games/msquare", 35,
"Padenie", "/sys/games/padenie", 35,
"Phenix", "/sys/games/phenix", 35,
"Pipes", "/sys/games/pipes", 26,
"Pong", "/sys/games/pong", 12,
"Pong3", "/sys/games/pong3", 12,
"Reversi", "/sys/games/reversi", 35,
"Rforces", "/sys/games/rforces", 35,
"Rsquare", "/sys/games/rsquare", 35,
"Snake", "/sys/games/snake", 32,
"Sq game", "/sys/games/sq_game", 35,
"Sudoku", "/sys/games/sudoku", 25,
"Sea War", "/sys/games/SW", 35,
"Tanks", "/sys/games/tanks", 35,
"Tetris", "/sys/games/tetris", 35,
"Whowtbam", "/sys/games/whowtbam", 35,
"Xonix", "/sys/games/xonix", 21,
0
};
 
struct struct_skin {
dword image, w, h;
int Load();
} skin;
 
int struct_skin::Load()
{
int i;
dword image_data;
skin.image = load_image("/sys/iconstrp.png");
if (!skin.image) notify("'iconstrp.png not found' -E");
skin.w = DSWORD[skin.image+4];
skin.h = DSWORD[skin.image+8];
image_data = DSDWORD[skin.image+24];
sc.get();
 
for (i=0; i<w*h*4; i+=4)
{
if (DSDWORD[image_data + i]==0) DSDWORD[image_data + i] = 0xF3F3F3;
}
}
 
 
void main()
{
int id, key;
mem_Init();
if (load_dll2(libio, #libio_init,1)!=0) notify("Error: library doesn't exists - libio");
if (load_dll2(libimg, #libimg_init,1)!=0) notify("Error: library doesn't exists - libimg");
skin.Load();
loop()
{
switch(WaitEvent())
{
case evButton:
id=GetButtonID();
if (id==1) ExitProcess();
if (id>=100) RunProgram(games[id-100].path, "");
break;
case evKey:
key = GetKey();
break;
case evReDraw:
sc.get();
DefineAndDrawWindow(215,100,568,390+60+GetSkinHeight(),0x74,sc.work," ");
GetProcessInfo(#Form, SelfInfo);
if (Form.status_window>2) break;
draw_window();
break;
}
}
}
 
 
void draw_window()
{
int row, col, col_max=8;
int col_w=68, col_h=70;
int tmp,y=25;
DrawBar(0,0,Form.cwidth, y-1, sc.work);
DrawBar(0,y-1, Form.cwidth, 1, sc.work_graph);
DrawBar(0,y, Form.cwidth, Form.cheight-y, 0xF3F3F3);
WriteTextB(Form.cwidth/2-70, 9, 0x90, sc.work_text, "KolibriOS Game Center");
 
y += 7;
for (col=0, row=0; games[row*col_max+col].name!=0; col++)
{
if (col==col_max) {
row++;
col=0;
}
DefineButton(col*col_w+6,row*col_h+y,col_w,col_h,row*col_max+col+100+BT_HIDE,0);
tmp = col_w/2;
img_draw stdcall(skin.image, col*col_w+tmp-10, row*col_h+5+y, 32, 32, 0, games[row*col_max+col].icon*32);
WriteTextCenter(col*col_w+7,row*col_h+47+y,col_w,0xD4D4d4,games[row*col_max+col].name);
WriteTextCenter(col*col_w+6,row*col_h+46+y,col_w,0x000000,games[row*col_max+col].name);
}
}
 
 
 
stop:
/programs/cmm/game_center
Property changes:
Added: tsvn:logminsize
+5
\ No newline at end of property
/programs/cmm/kolibrin/kolibrin.c
38,8 → 38,7
}
}
}
if (GetSystemLanguage()==4) notify("¥ ¬®£ã ­ ©â¨ installer.kex ­¨ ¢ ®¤­®¬ ª®à­¥ ¤¨áª ! ®¯à®¡ã©â¥ ­ ©â¨ ¨ § ¯ãáâ¨âì ¥£® ¢àãç­ãî.");
else notify("Can't find installer.kex at the root of all disks! Try to find and run it manually."w);
notify("'¥ ¬®£ã ­ ©â¨ installer.kex ­¨ ¢ ®¤­®¬ ª®à­¥ ¤¨áª !\n®¯à®¡ã©â¥ ­ ©â¨ ¨ § ¯ãáâ¨âì ¥£® ¢àãç­ãî.' -dE");
ExitProcess();
}
 
/programs/cmm/liza/liza.c
79,6 → 79,17
llist mail_list;
llist letter_view;
 
dword TAB_H = false; //19;
dword TAB_W = 150;
dword TOOLBAR_H = 31; //50;
dword STATUSBAR_H =15;
dword col_bg;
dword panel_color;
dword border_color;
 
pb progress_bar = {0, 10, 83, 150, 12, 0, 0, 100, 0xeeeEEE, 8072B7EBh, 0x9F9F9F};
 
int http_transfer;
char version[]=" WebView 0.1";
#include "..\TWB\TWB.c"
 
/programs/cmm/liza/mail_box.c
100,6 → 100,7
mailsize = atr.GetSize(mail_list.current+1) + 1024;
free(mailstart);
mailstart = malloc(mailsize);
mailend = mailstart;
if (!mailstart)
{
debugln("alloc error!");
106,15 → 107,18
aim=NULL;
break;
}
mailend = mailstart;
debug("mailsize: "); debugi(mailsize);
aim = GET_ANSWER_RETR;
debugln("goto GET_ANSWER_RETR");
break;
case GET_ANSWER_RETR:
debug("mailsize: "); debugi(mailsize);
debug("mailstart: "); debugi(mailstart);
debug("mailend: "); debugi(mailend);
ticks = Receive(socketnum, mailend, mailsize + mailstart - mailend, MSG_DONTWAIT);
if (ticks == 0xffffffff) break;
mailend += ticks;
mailend = mailend + ticks;
if (mailsize + mailstart - mailend - 2 < 0)
{
debugln("Resizing buffer");
122,6 → 126,7
mailstart = realloc(mailstart, mailsize);
if (!mailstart) { StopConnect("Realloc error!"); break;}
}
/*
if (mailsize>9000)
{
load_persent = mailend - mailstart * 100 ;
128,7 → 133,8
load_persent /= mailsize - 1024;
if (load_persent != cur_st_percent) SetMailBoxStatus( load_persent , NULL);
}
ParseMail();
*/
//ParseMail();
}
}
 
315,7 → 321,7
WriteText(on_x + 42, on_y+5, 0x80, 0, atr.GetSubject(i+mail_list.first+1));
DrawBar(0, on_y + mail_list.line_h-1, mail_list.w, 1, 0xCCCccc);
WriteText(10, on_y+5, 0x80, 0, itoa(i+mail_list.first+1));
WriteText(mail_list.w - 40, on_y+5, 0x80, 0, ConvertMemSize(atr.GetSize(i+mail_list.first+1)));
WriteText(mail_list.w - 40, on_y+5, 0x80, 0, ConvertSize(atr.GetSize(i+mail_list.first+1)));
}
DrawBar(0, i*mail_list.line_h + mail_list.y, mail_list.w, -i*mail_list.line_h+mail_list.h, 0xFFFfff);
DrawScroller1();
328,9 → 334,9
DrawBar(0, lt_y+2, Form.cwidth, LIST_INFO_H-4, sc.work);
WriteText(mail_list.w-30/2, lt_y, 0x80, 0x888888, "= = =");
WriteText(mail_list.w-30/2, lt_y+1, 0x80, 0xEeeeee, "= = =");
DrawBar(0, lt_y+LIST_INFO_H-2, mail_list.w, 1, sc.work_graph); //bottom
DrawBar(0, lt_y+LIST_INFO_H-1, mail_list.w, 1, 0xdfdfdf);
DrawBar(0, lt_y+LIST_INFO_H , mail_list.w, 1, 0xf0f0f0);
DrawBar(0, lt_y+LIST_INFO_H-2, Form.cwidth, 1, sc.work_graph); //bottom
DrawBar(0, lt_y+LIST_INFO_H-1, Form.cwidth, 1, 0xdfdfdf);
DrawBar(0, lt_y+LIST_INFO_H , Form.cwidth, 1, 0xf0f0f0);
WriteTextB(10, lt_y+8 , 0x80, sc.work_text, "From:");
WriteText (45, lt_y+8 , 0x80, sc.work_text, #from);
WriteTextB(10, lt_y+20, 0x80, sc.work_text, "To:");
347,7 → 353,7
Form.cheight - mail_list.y - mail_list.h - LIST_INFO_H - 1 - status_bar_h, 60, 12);
WB1.list.column_max = WB1.list.w - 30 / 6;
WB1.list.visible = WB1.list.h / WB1.list.line_h;
WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, WB1.list.h, WB1.list.line_h);
WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, WB1.list.h);
 
strcpy(#header, #version);
pre_text = 0;
359,6 → 365,7
bufsize = strlen(mdata);
WB1.Prepare(bufsize, mdata);
if (bufsize) WB1.Parse();
DrawRectangle(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x, scroll_wv.size_y-1, 0xFFFfff);
}
 
 
388,7 → 395,8
 
 
void SetMailBoxStatus(dword percent1, text1) {
DrawProgressBar(3, Form.cheight -status_bar_h + 1, 220, 12, sc.work, 0xC3C3C3, 0x54B1D6, sc.work_text, percent1, text1);
DrawProgressBar(3, Form.cheight -status_bar_h + 1, 220, 12, sc.work, 0xC3C3C3, 0x54B1D6, sc.work_text, percent1);
WriteText(3, Form.cheight -status_bar_h + 1, 0x80, sc.work_text, text1);
cur_st_percent = percent1;
cur_st_text = text1;
}