[BMP] "bmp -9t",
};
-void storebitmap(Rtext *t, Image *b){
- t->b=b;
- free(t->text);
- t->text=0;
-}
-
void getimage(Rtext *t, Www *w){
int pfd[2];
Action *ap;
seturl(&url, ap->image, w->url->fullname);
for(p=w->pix;p!=nil; p=p->next)
if(strcmp(ap->image, p->name)==0 && ap->width==p->width && ap->height==p->height){
- storebitmap(t, p->b);
- w->changed=1;
+ t->b = p->b;
+ update(w);
return;
}
fd=urlopen(&url, GET, 0);
snprint(err, sizeof(err), "[%s: %r]", url.fullname);
free(t->text);
t->text=strdup(err);
- w->changed=1;
+ update(w);
close(fd);
return;
}
p->height=ap->height;
p->next=w->pix;
w->pix=p;
- storebitmap(t, b);
- w->changed=1;
+ t->b=b;
+ update(w);
}
void getpix(Rtext *t, Www *w){
}
}
-void freepix(void *p)
-{
+ulong countpix(void *p){
+ ulong n=0;
+ Pix *x;
+ for(x = p; x; x = x->next)
+ n += Dy(x->b->r)*bytesperline(x->b->r, x->b->depth);
+ return n;
+}
+
+void freepix(void *p){
Pix *x, *xx;
xx = p;
while(x = xx){