kolibrios/programs/cmm/browser/include/some_code.h
Kirill Lipatov (Leency) 8b12b27e11 cmm: small improvements
git-svn-id: svn://kolibrios.org@3458 a494cfbc-eb01-0410-851d-a64ba20cac60
2013-04-08 13:21:32 +00:00

59 lines
1.3 KiB
C

enum { BACK=300, FORWARD, REFRESH, HOME, NEWTAB, GOTOURL, SEARCHWEB, INPUT_CH, INPUT_BT };
enum { _WIN, _DOS, _KOI, _UTF };
#define ID1 178
#define ID2 177
dword get_URL_part(int len) {
char temp1[sizeof(URL)];
strcpy(#temp1, #URL);
temp1[len] = 0x00;
return #temp1;
}
inline byte chTag(dword text) {return strcmp(#tag,text);}
void GetURLfromPageLinks(int id)
{
int i, j = 0;
for (i = 0; i <= id - 401; i++)
{
do
{
j++;
if (j>=strlen(#page_links)) return;
}
while (page_links[j] <>'|');
}
page_links[j] = 0x00;
strcpy(#URL, #page_links+strrchr(#page_links, '|'));
}
//Ó íàñ íåò íàêëîííûõ øðèôòîâ, ïîýòîìó äåëàåì êîñòûëü èç
//ïàëî÷åê äëÿ ìîðîæåíîãî è æåâàòåëüíîé ðåçèíêè:
//Ñíèìàåì îáëàñòü ýêðàíà è âûâîäèì å¸ îáðàòíî ïîëîñêàìè ñî ñìåùåíèåì,
//÷òî äà¸ò ïåðåêîñ êàðòèíêè
//Ïðè íàëè÷èè ôîíà è ò.ï. ïðîÿâèòñÿ âñÿ êîñòûëüíîñòü ðåøåíèÿ :)
inline void Skew(dword x,y,w,h)
{
dword italic_buf;
int tile_height=2,
shift=-2,
i, skin_height;
italic_buf = mem_Alloc(w*h*3);
skin_height = GetSkinHeight();
CopyScreen(italic_buf, x+Form.left+2, y+Form.top+skin_height, w, h);
FOR (i=0;i*tile_height<h;i++)
_PutImage(x+shift-i+1,i*tile_height+y, w,tile_height, w*3*tile_height*i+italic_buf);
mem_Free(italic_buf);
}