CMM: minor optimizations, Eolite: better about window

git-svn-id: svn://kolibrios.org@6005 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2015-12-26 01:32:07 +00:00
parent 720c97cadc
commit 451e903f9a
7 changed files with 33 additions and 88 deletions

View File

@ -82,7 +82,7 @@ void Downloader()
if (downloader.state == STATE_COMPLETED)
{
strcpy(#filepath, #save_to);
strcat(#filepath, #downloader.url+strrchr(#downloader.url, '/'));
strcat(#filepath, #save_to+strrchr(#save_to, '/'));
if (WriteFile(downloader.bufsize, downloader.bufpointer, #filepath)==0)
sprintf(#notify_message, "%s%s%s",FILE_SAVED_AS,#filepath,"' -Dt");
else

View File

@ -6,7 +6,6 @@ enum {
};
struct DOWNLOADER {
char url[10000];
int data_downloaded_size, data_full_size;
dword bufpointer, bufsize;
byte state;
@ -20,8 +19,7 @@ struct DOWNLOADER {
dword DOWNLOADER::Start(dword _url)
{
state = STATE_IN_PROGRESS;
strcpy(#url, _url); //need to replace my malloc()
http_get stdcall (#url, 0, 0, #accept_language);
http_get stdcall (_url, 0, 0, #accept_language);
http_transfer = EAX;
return http_transfer;
}

View File

@ -22,38 +22,4 @@ unsigned char devices[18*204]= FROM "imgs\dev.raw";
unsigned char factions[14*39] = FROM "imgs\actions.raw";
unsigned char logo[7225] = FROM "imgs\logo8b.raw";
dword logo_pal[]= {0x8096C0,0x7D93BC,0x7D76B0,0x8094BE,0x7C83B3,0x7D0C82,
0x7B73AC,0x7B90B7,0x7D7AB0,0x8C1B8C,0x74378B,0x7488AE,0x7C8EB8,0x846BAB,
0xAF63B0,0x821C89,0x697A9C,0x768AB1,0x8B66A9,0xBF80BF,0x993399,0x6B5C90,
0x975EA9,0xC48BC4,0xA955A9,0x72438B,0x7083A7,0x798DB5,0xA45CAA,0xC993C9,
0xB164B1,0x793A8C,0x8185B5,0xB46CB5,0xC791C7,0xB873B8,0x84328F,0x7D54A0,
0x840B84,0x82238B,0x7C539D,0x8A4C9F,0x8C3B95,0x637393,0x824399,0x9D409D,
0x942B94,0x83288E,0x7B599E,0x833C94,0xA043A0,0x8B4194,0xA264AA,0xAC5BAC,
0x9C3B9C,0x7982AE,0x861588,0xBC7BBC,0x7E4C90,0xAC6AB0,0xC083C0,0x7F4199,
0xA650A6,0x68628B,0x7D73A6,0xB670B7,0x95449A,0x7D6BAA,0x953195,0x8B5C9B,
0x60708E,0x8E519F,0x835598,0x7E65A9,0x7E2D91,0x7D5AA2,0x64648A,0xAD61AE,
0x8B3594,0x8D218E,0x796BA5,0x902390,0x735B90,0x7384AA,0x756294,0xA752A8,
0x76669F,0x8C2A91,0x965DA1,0x5D6C89,0x6C7EA2,0x8175AF,0x7474A5,0xB773B8,
0x6E80A4,0x9254A2,0x814D9B,0x6B6B98,0x832F91,0x9F60A7,0x8D419A,0x6B6992,
0x933A9A,0x8089B6,0x9C52A3,0x696492,0xA44AA4,0x606A8B,0x666690,0x75689F,
0x79498E,0x7D3492,0x8C2791,0x795390,0x71709C,0x964E9D,0x7E1E89,0x7B2A8B,
0x95539E,0x9C4A9B,0x645B88,0x7C4C9C,0x8E5FA8,0x891489,0x7D238B,0x824D95,
0x963398,0x6B5A8A,0x774B94,0x810481,0x7A7CAE,0x7C2386,0x814494,0x753B89,
0x861186,0x6F3C85,0x7C3D94,0x782D86,0x5C6B87,0x7C63A5,0x685187,0x6B5089,
0xA4499B,0xB9656E,0xC77647,0xD08131,0xD1842C,0x8060A3,0xAB528D,0xCA7937,
0xDE9408,0xE19808,0xE3A01C,0xE6AB36,0xE4A426,0xE29D14,0x655785,0x745A9A,
0xBC6655,0xE6AE42,0x705593,0x717AA4,0x843291,0x7B308E,0xA34285,0x694B86,
0x7F0280,0x7667A0,0x743484,0x615A85,0x7478A8,0x676892,0x703C86,0x9A3290,
0x862186,0x6E5491,0x6F3E89,0xAD5066,0x764F98,0xC06947,0xCE8031,0x6F75A1,
0xE3DEE0,0xE1DCDE,0xDAD5D7,0xC0ABBD,0x7F027F,0xBF6948,0x914490,0xCAC5C8,
0xB38CB1,0xAA4964,0xE8B247,0xA887A6,0xD4CDD1,0xB089AE,0x8E1C84,0xE09F26,
0xEAB855,0x8B328B,0xB7A9B5,0xD1CBCE,0xA677A5,0x8C2C8B,0x942577,0xC6BAC4,
0xC1BABE,0xB09BAD,0x966695,0x883387,0x978495,0x987997,0x8D458D,0x985A97,
0xB88AB6,0xAD6EAB,0x9D5C9C,0xCC8048,0x90468F,0xBAB5B7,0x851B85,0xA86AA6,
0xC09EBE,0x943A94,0x882387,0x9E519D,0xBB96B9,0x8D3B8C,0x924C91,0x9A327D,
0xC77C59,0xB0AAAD,0x872887,0xA599A3,0xB682B4,0xA0869E,0x935292,0x922488,
0xB1576D,0xD49256,0x8F558E,0xAAA5A7,0xC39BC1,0xC6A8C4,0xA763A5,0xB47CB3,
0x925A91,0x90578F,0xA09B9D,0xA06F9F,0x9E949C,0xB077AE,0xA66EA5,0xA75FA5,
0xB98EB8};
unsigned char logo[] = FROM "imgs\logo.raw";

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -1,23 +1,14 @@
//Leency 2008-2013
//Leency 2008-2016
#define BROWSER_PATH "/sys/network/webview"
#define BROWSER_LINK "http://kolibri-n.org/index.php"
#define BROWSER_LINK "http://kolibri-n.org/inf/eolite/eolite_p1"
#ifdef LANG_RUS
?define INTRO_TEXT_1 "Ž Eolite"
?define INTRO_TEXT_2 "<EFBFBD> §à ¡®â稪¨:"
?define INTRO_TEXT_3 "<EFBFBD>®á¥â¨â¥"
?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"
?define DEVELOPERS_TEXT "<EFBFBD> §à ¡®â稪¨:\nLeency Veliant PunkJoker Pavelyakov\nKolibriOS Team\n2008-2016"
?define CLOSE_BUTTON_TEXT "‡ ªàëâì"
#else
?define INTRO_TEXT_1 "About Eolite"
?define INTRO_TEXT_2 "Developers:"
?define INTRO_TEXT_3 "Visit"
?define INTRO_TEXT_4 "Close"
?define DEVELOPERS_TEXT "Developers:\nLeency Veliant PunkJoker Pavelyakov\nKolibriOS Team\n2008-2016"
?define CLOSE_BUTTON_TEXT "Close"
#endif
void about_dialog()
@ -25,8 +16,7 @@ void about_dialog()
byte id;
proc_info about_form;
IF (active_about){cmd_free = 2;ExitProcess();}
active_about=1;
if (active_about) {cmd_free=2;ExitProcess();} else active_about=1;
loop() switch(WaitEvent())
{
case evButton:
@ -37,7 +27,7 @@ void about_dialog()
cmd_free = 2;
ExitProcess();
}
IF (id==23) RunProgram(BROWSER_PATH, BROWSER_LINK);
IF (id==11) RunProgram(BROWSER_PATH, BROWSER_LINK);
break;
case evKey:
@ -50,18 +40,15 @@ void about_dialog()
break;
case evReDraw:
DefineAndDrawWindow(Form.left+Form.width/2,Form.top+Form.height/2-114,300,248+GetSkinHeight(),0x34,system.color.work,INTRO_TEXT_1);
DefineAndDrawWindow(Form.left+Form.width/2,Form.top+Form.height/2-114,440,200+GetSkinHeight(),0x34,system.color.work,0);
GetProcessInfo(#about_form, SelfInfo);
if (Form.status_window>2) break;
DrawBar(0,0,about_form.cwidth,50,0x8494C4);
PutPaletteImage(#logo,85,85,about_form.cwidth/2-43,7,8,#logo_pal);
WriteTextB(-strlen(ABOUT_TITLE)*12+about_form.cwidth/2,100,0x81,0xBF40BF,ABOUT_TITLE);
WriteTextCenter(0,130,about_form.cwidth,0,INTRO_TEXT_2);
WriteTextCenter(0,143,about_form.cwidth,0,"Leency Veliant PunkJoker Pavelyakov");
WriteTextCenter(0,156,about_form.cwidth,0,"KolibriOS Team");
WriteTextCenter(0,169,about_form.cwidth,0,"2008-2015");
WriteTextCenter(10,182,about_form.width-125,0,INTRO_TEXT_3);
DrawLink(about_form.cwidth/2-15,182,0x80,23, "kolibri-n.org");
DrawFlatButton(about_form.cwidth/2-35,about_form.cheight-35,70,22,10,0xE4DFE1, INTRO_TEXT_4);
_PutImage(10, 15, 86, 86, #logo);
WriteTextB(110,15,0x81,0xBF40BF,ABOUT_TITLE);
WriteTextLines(110,53,10010000b,0,DEVELOPERS_TEXT,21);
#ifdef LANG_RUS
DrawFlatButton(about_form.cwidth-250,about_form.cheight-35,130,22,11,0xE4DFE1,"ˆáâ®à¨ï ࠧࠡ®âª¨");
#endif
DrawFlatButton(about_form.cwidth-100,about_form.cheight-35,70,22,10,0xE4DFE1,CLOSE_BUTTON_TEXT);
}
}

View File

@ -1,7 +1,6 @@
//HTTP library
#ifndef INCLUDE_LIBHTTP_H
#define INCLUDE_LIBHTTP_H
#print "[include <obj/http.h>]\n"
#print "[include <obj/http.h]\n"
#ifndef INCLUDE_KOLIBRI_H
#include "../lib/kolibri.h"
@ -11,9 +10,8 @@
#include "../lib/dll.h"
#endif
dword NOT_INIT_LIBHTTP = true;
dword libHTTP = #alibHTTP;
char alibHTTP[23] = "/sys/lib/http.obj\0";
char alibHTTP[] = "/sys/lib/http.obj";
dword http_lib_init = #aLib_init;
dword http_get = #aHTTPget;
@ -28,17 +26,17 @@ dword uri_escape = #aURIescape;
dword uri_unescape = #aURIunescape;
$DD 2 dup 0
char aLib_init[9] = "lib_init\0";
char aHTTPget[4] = "get\0";
char aHTTPhead[5] = "head\0";
char aHTTPpost[5] = "post\0";
char aFHF[18] = "find_header_field\0";
char aHTTPsend[5] = "send\0";
char aHTTPreceive[8] = "receive\0";
char aHTTPdisconnect[11] = "disconnect\0";
char aHTTPfree[5] = "free\0";
char aURIescape[7] = "escape\0";
char aURIunescape[9] = "unescape\0";
char aLib_init[] = "lib_init";
char aHTTPget[] = "get";
char aHTTPhead[] = "head";
char aHTTPpost[] = "post";
char aFHF[] = "find_header_field";
char aHTTPsend[] = "send";
char aHTTPreceive[] = "receive";
char aHTTPdisconnect[] = "disconnect";
char aHTTPfree[] = "free";
char aURIescape[] = "escape";
char aURIunescape[] = "unescape";
// status flags
#define FLAG_HTTP11 1 << 0
@ -74,9 +72,5 @@ struct http_msg{
char http_header;
};
:dword file_get_contents(dword url,...)
{
http_get(url,FLAG_HTTP11,"");
}
#endif