Roxen.git / server / modules / graphics / gbutton.pike

version» Context lines:

Roxen.git/server/modules/graphics/gbutton.pike:18:   // icon-data -- inline icon data   // align -- left|center|right text alignment   // align-icon -- left|center-before|center-after|right icon alignment   // valign-icon -- above|middle|below icon vertical alignment   // >Button text</gbutton>   //   // Alignment restriction: when text alignment is either left or right, icons   // must also be aligned left or right.       - constant cvs_version = "$Id: gbutton.pike,v 1.98 2003/06/30 16:49:19 jonasw Exp $"; + constant cvs_version = "$Id: gbutton.pike,v 1.99 2003/07/04 12:07:36 jonasw Exp $";   constant thread_safe = 1;      #include <module.h>   inherit "module";      roxen.ImageCache button_cache;   int do_ext;      constant module_type = MODULE_TAG;   constant module_name = "Graphics: GButton";
Roxen.git/server/modules/graphics/gbutton.pike:237:       Image.Layer background;    Image.Layer frame;    Image.Layer mask;       int left, right, top, middle, bottom; /* offsets */    int req_width, noframe;       mapping ll = ([]);    +  // Photoshop layers: don't let individual layers expand the image +  // beyond the bounds of the overall image. +  mapping opts = ([ "crop_to_bounds" : 1 ]); +     void set_image( array layers )    {    foreach( layers||({}), object l )    {    if(!l->get_misc_value( "name" ) ) // Hm. Probably PSD    continue;       ll[lower_case(l->get_misc_value( "name" ))] = l;    switch( lower_case(l->get_misc_value( "name" )) )    {
Roxen.git/server/modules/graphics/gbutton.pike:262:    };       if( args->border_image )    {    array(Image.Layer)|mapping tmp;      #if constant(Sitebuilder)    // Let SiteBuilder get a chance to decode its argument data    if (Sitebuilder.sb_start_use_imagecache) {    Sitebuilder.sb_start_use_imagecache(args, id); -  tmp = roxen.load_layers(args->border_image, id); +  tmp = roxen.load_layers(args->border_image, id, opts);    Sitebuilder.sb_end_use_imagecache(args, id);    } else   #endif    { -  tmp = roxen.load_layers(args->border_image, id); +  tmp = roxen.load_layers(args->border_image, id, opts);    }       if (mappingp(tmp))    if (tmp->error == 401)    return tmp;    else    report_debug("GButton: Failed to load frame image: %O\n",    args->border_image);    set_image( tmp );    }