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

version» Context lines:

Roxen.git/server/modules/graphics/gbutton.pike:18:   // icon_src -- icon reference   // icon_data -- inline icon data   // align -- left|center|right text alignment   // align_icon -- left|center_before|center_after|right icon 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.29 2000/02/21 17:50:48 per Exp $"; + constant cvs_version = "$Id: gbutton.pike,v 1.30 2000/02/21 18:57:05 per Exp $";   constant thread_safe = 1;      #include <module.h>   inherit "module";   inherit "roxenlib";         roxen.ImageCache button_cache;      constant module_type = MODULE_PARSER;
Roxen.git/server/modules/graphics/gbutton.pike:381:    Image.Layer( h )->set_mode( "red" ),    Image.Layer( s )->set_mode( "green" ),    Image.Layer( v )->set_mode( "blue" ),    }) )->image();    button = button->hsv_to_rgb();       // if there is a background, draw it.    if( background )    button->paste_mask( background->image(), background->alpha() );    -  // fix transparency (somewhat) -  if( !equal( args->pagebg, args->bg ) ) -  button->paste_alpha_color( mask->alpha()->invert()->threshold( 200 ), -  args->pagebg ); -  -  +     // Draw icon.    if (icon)    {    int icn_y = (button->ysize() - icon->img->ysize()) / 2;       if (!icon->alpha)    icon->alpha = icon->img->clone()->clear(({255,255,255}));       if (args->dim)    icon->alpha *= 0.3;
Roxen.git/server/modules/graphics/gbutton.pike:436:    // for these, but that is not a problem most of the time.    if( args->extra_left_layers )    {    array l = ({ });    foreach( args->extra_left_layers/",", string q )    l += ({ ll[q] });    l-=({ 0 });    if( sizeof( l ) )    {    object q = Image.lay( l ); +  q->set_offset( 0, 0 );    object b2 = Image.Image( button->xsize()+q->xsize(),    button->ysize(), @args->pagebg ); -  b2->paste( button, q->xsize() ); +  b2->paste( button, q->xsize(),0 );    b2->paste_mask( q->image(), q->alpha() );    button = b2; -  mask = Image.lay( ({q, mask->set_offset( q->xsize(),0 )}) ); +  mask->set_offset( q->xsize(), 0 ); +  mask = Image.lay( ({q, mask}) );    }    }       // right layers are added to the right of the image, and the mask is    // extended using their mask. There is no corresponding 'mask' layers    // for these, but that is not a problem most of the time.    if( args->extra_right_layers )    {    array l = ({ });    foreach( args->extra_right_layers/",", string q )    l += ({ ll[q] });    l-=({ 0 });    if( sizeof( l ) )    {    object q = Image.lay( l ); -  +  q->set_offset( 0, 0 );    object b2 = Image.Image( button->xsize()+q->xsize(),    button->ysize(), @args->pagebg );    b2->paste( button );    b2->paste_mask( q->image(), q->alpha(), button->xsize(), 0 );    button = b2; -  mask = Image.lay( ({q->set_offset( mask->xsize(),0), mask }) ); +  q->set_offset( mask->xsize(),0); +  mask = Image.lay( ({q, mask }) );    }    }    -  +  // fix transparency (somewhat) +  if( !equal( args->pagebg, args->bg ) ) +  button->paste_alpha_color( mask->alpha()->invert()->threshold( 200 ), +  args->pagebg ); +  +     return    ([    "img":button,    "alpha":mask->alpha()->threshold( 40 ),    ]);   }         mapping find_internal(string f, RequestID id)   {