Branch: Tag:

2000-02-21

2000-02-21 20:45:26 by Per Hedbor <ph@opera.com>

Allow layer objects and array of layer objects as the return type from the draw callback in the image cache.

Rev: server/base_server/roxen.pike:1.439

4:   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.      // ABS and suicide systems contributed freely by Francesco Chemolli - constant cvs_version="$Id: roxen.pike,v 1.438 2000/02/20 17:41:34 nilsson Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.439 2000/02/21 20:45:26 per Exp $";      object backend_thread;   ArgCache argcache;
1857:    mixed args = Array.map( Array.map( name/"$", argcache->lookup, id->client ), frommapp);    mapping meta;    string data; +     mixed reply = draw_function( @copy_value(args), id );       if( arrayp( args ) )    args = args[0];    -  +  if( arrayp( reply ) ) // layers. +  reply = Image.lay( reply );    -  +  if( objectp( reply ) && reply->image ) // layer. +  { +  reply = ([ +  "img":reply->image(), +  "alpha":reply->alpha(), +  ]); +  } +  +     if( objectp( reply ) || (mappingp(reply) && reply->img) )    {    int quant = (int)args->quant;
2168:       static mapping restore( string id )    { -  string|object(Stdio.File) f; +  mixed f;    mapping m; -  +     if( data_cache[ id ] )    f = data_cache[ id ];    else -  +  {    f = Stdio.File( ); -  +     if(!f->open(dir+id+".d", "r" ))    return 0; -  +  }       m = restore_meta( id );