forked from KolibriOS/kolibrios
83 lines
5.3 KiB
C
83 lines
5.3 KiB
C
|
struct _favicon
|
||
|
{
|
||
|
DOWNLOADER favget;
|
||
|
void get();
|
||
|
void draw();
|
||
|
} favicon;
|
||
|
|
||
|
void _favicon::get(dword url)
|
||
|
{
|
||
|
if (url==NULL) || (!favget.Start(url)) {
|
||
|
favget.Stop();
|
||
|
favget.bufpointer = NULL;
|
||
|
}
|
||
|
else {
|
||
|
while (favget.state!=STATE_COMPLETED) favget.MonitorProgress();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void _favicon::draw(int x,y)
|
||
|
{
|
||
|
dword favicon_data_decoded;
|
||
|
if (favget.bufpointer) {
|
||
|
img_decode stdcall (favget.bufpointer, favget.data_full_size, 0);
|
||
|
if (EAX==0) return;
|
||
|
favicon_data_decoded = EAX;
|
||
|
img_draw stdcall(favicon_data_decoded, x,y, 16, 16, 0, 0);
|
||
|
}
|
||
|
else {
|
||
|
_PutImage(x,y,16,16,#blank_icon);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
unsigned char blank_icon[768] = {
|
||
|
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||
|
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||
|
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||
|
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||
|
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF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