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

version» Context lines:

Roxen.git/server/modules/graphics/graphic_text.pike:1: - constant cvs_version="$Id: graphic_text.pike,v 1.168 1999/07/19 22:05:03 neotron Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.169 2001/04/07 11:45:27 per Exp $";   constant thread_safe=1;      #include <config.h>   #include <module.h>   #include <stat.h>   inherit "module";   inherit "roxenlib";      #ifndef VAR_MORE   #define VAR_MORE 0
Roxen.git/server/modules/graphics/graphic_text.pike:92:    array (int) color, int radie, int x, int y)   {    int steps=10;    for(int j=0; j<=steps; j++)    on->paste_alpha_color(with, @color,    (int)(0.5+x-(sin((float)j/steps*3.145*2)*radie)),    (int)(0.5+y-(cos((float)j/steps*3.145*2)*radie)));    return on;   }    - constant white = ({ 255,255,255 }); - constant lgrey = ({ 200,200,200 }); - constant grey = ({ 128,128,128 }); - constant black = ({ 0,0,0 }); - constant wwwb = ({ lgrey,lgrey,grey,black }); + array white = ({ 255,255,255 }); + array lgrey = ({ 200,200,200 }); + array grey = ({ 128,128,128 }); + array black = ({ 0,0,0 }); + array wwwb = ({ lgrey,lgrey,grey,black });      object bevel(object in, int width, int|void invert)   {    int h=in->ysize();    int w=in->xsize();       object corner = Image.image(width+1,width+1);    object corner2 = Image.image(width+1,width+1);    object pix = Image.image(1,1);   
Roxen.git/server/modules/graphics/graphic_text.pike:398:    else    background = background->scale(xs, ys);    }       if(args->turbulence)    {    array (float|array(int)) arg=({});    foreach((args->turbulence/";"), string s)    {    array q= s/","; -  if(sizeof(q)<2) args+=({ ((float)s)||0.2, ({ 255,255,255 }) }); +  if(sizeof(q)<2) +  arg+=({ ((float)s)||0.2, ({ 255,255,255 }) }); +  else    arg+=({ ((float)q[0])||0.2, parse_color(q[1]) });    }    background=background->turbulence(arg);    }          if(args->bevel)    background = bevel(background,(int)args->bevel,!!args->pressed);       if(args->textbox) // Draw a text-box on the background.
Roxen.git/server/modules/graphics/graphic_text.pike:548:   }      roxen.ImageCache image_cache;      void start(int|void val, object|void conf)   {    image_cache = roxen.ImageCache( "gtext", draw_callback );   }      constant nbsp = iso88591["&nbsp;"]; - constant replace_from = indices( iso88591 )+ ({"&ss;","&lt;","&gt;","&amp;",}); - constant replace_to = values( iso88591 ) + ({ nbsp, "<", ">", "&", }); + array replace_from = indices( iso88591 )+ ({"&ss;","&lt;","&gt;","&amp;",}); + array replace_to = values( iso88591 ) + ({ nbsp, "<", ">", "&", });      #define simplify_text( from ) replace(from,replace_from,replace_to)         mixed draw_callback(mapping args, string text, object id)   {    array err;    mixed data;    int elapsed;    string orig_text = text;