7 typedef struct Canvas Canvas;
10 void (*hit)(Panel *, Mouse *);
12 void pl_drawcanvas(Panel *p){
15 if(c->draw) c->draw(p);
17 int pl_hitcanvas(Panel *p, Mouse *m){
20 if(c->hit) c->hit(p, m);
23 void pl_typecanvas(Panel *p, Rune c){
26 Point pl_getsizecanvas(Panel *p, Point children){
30 void pl_childspacecanvas(Panel *p, Point *ul, Point *size){
33 void plinitcanvas(Panel *v, int flags, void (*draw)(Panel *), void (*hit)(Panel *, Mouse *)){
36 v->draw=pl_drawcanvas;
38 v->type=pl_typecanvas;
39 v->getsize=pl_getsizecanvas;
40 v->childspace=pl_childspacecanvas;
46 Panel *plcanvas(Panel *parent, int flags, void (*draw)(Panel *), void (*hit)(Panel *, Mouse *)){
48 p=pl_newpanel(parent, sizeof(Canvas));
49 plinitcanvas(p, flags, draw, hit);