Branch: Tag:

1997-03-26

1997-03-26 05:54:17 by Per Hedbor <ph@opera.com>

Fixes to support the newest pike

Rev: server/base_server/cache.pike:1.11
Rev: server/base_server/config/builders.pike:1.5
Rev: server/base_server/config/describers.pike:1.21
Rev: server/base_server/config/low_describers.pike:1.6
Rev: server/base_server/configuration.pike:1.19
Rev: server/base_server/mainconfig.pike:1.36
Rev: server/base_server/module.pike:1.12
Rev: server/base_server/persistent.pike:1.16
Rev: server/base_server/roxen.pike:1.46
Rev: server/base_server/roxenlib.pike:1.19
Rev: server/base_server/roxenloader.pike:1.11
Rev: server/etc/extensions:1.4
Rev: server/etc/include/module.h:1.7
Rev: server/etc/roxen_master.pike:1.29
Rev: server/etc/supports:1.14
Rev: server/modules/directories/directories.pike:1.9
Rev: server/modules/directories/fastdir.pike:1.7
Rev: server/modules/filesystems/filesystem.pike:1.11
Rev: server/modules/filesystems/userfs.pike:1.11
Rev: server/modules/filters/hostredirect.pike:1.8
Rev: server/modules/filters/redirect.pike:1.7
Rev: server/modules/filters/relay.pike:1.6
Rev: server/modules/graphics/graphic_text.pike:1.39
Rev: server/modules/misc/userdb.pike:1.11
Rev: server/modules/scripting/cgi.pike:1.13
Rev: server/modules/scripting/pikescript.pike:1.9
Rev: server/modules/tags/htmlparse.pike:1.25
Rev: server/protocols/http.pike:1.21

1: - string cvs_version="$Id: graphic_text.pike,v 1.38 1997/03/11 01:19:34 per Exp $"; + string cvs_version="$Id: graphic_text.pike,v 1.39 1997/03/26 05:54:13 per Exp $";   #include <module.h>   inherit "module";   inherit "roxenlib";
64:    " xpad=Y% Increase padding between lines with Y%\n"    " shadow=int,dist Draw a drop-shadow (variable distance/intensity)\n"    " bshadow=dist Draw a blured drop-shadow (variable distance)\n" +  " ghost=dist,blur,col\n" +  " Do a 'ghost text'. Do NOT use together with " +  " 'shadow'. Magic coloring won't work with it."    " glow=color Draw a 'glow' outline around the text.\n"    " opaque=0-100% Draw with more or less opaque text (100%\n"    " is default)\n"
112:    "tag.");       defvar("location", "/gtext/", "Mountpoint", TYPE_LOCATION, -  "The URL-prefix for the anfang characters."); +  "The URL-prefix for the graphic characters.");       defvar("cols", 16, "Default number of colors per image", TYPE_INT_LIST,    "The default number of colors to use. 16 seems to be enough. "
133:   {    object fnt = font();    -  if(!name) name=""; +  if(!name) name="foo";    if(sscanf(name, "%*s/%*s") != 2)    name=QUERY(default_size)+"/"+name;   
338:    yoffset += dy;    }    +  if(args->ghost) +  { +  int howmuch=(int)args->ghost; +  xsize+=howmuch*2+10; +  xoffset += 3; +  ysize+=howmuch*2+10; +  } +  +     if(args->xspacing)    {    xoffset += (int)args->xspacing;
439:    255-(alpha*255/100),xoffset-border,yoffset-border);    }    +  if(args->ghost) +  { // Francesco.. +  int sdist = (int)args->ghost; +  int bl=(int)(args->ghost/",")[1]; +  array(int)clr=parse_color((args->ghost/",")[-1]); +  int j; +  object base = image(xsize,ysize,@clr)->invert(); +  object ta = text_alpha->copy(); +  for (j=0;j<bl;j++) +  ta=ta->apply_matrix(({ +  ({6,7,7,7,6}),({7,8,8,8,7}),({7,8,8,8,7}),({7,8,8,8,7}),({6,7,7,7,6}) +  })); +  background->paste_mask(base->invert(),ta,xoffset+sdist,yoffset+sdist); +  fgcolor=bgcolor; +  }    -  +     if(args->shadow)    {    int sd = ((int)args->shadow+10)*2;
608:      mapping find_file(string f, object rid)   { -  string id; +  int id;    sscanf(f,"%d/%s", id, f); -  return http_string_answer(write_text((int)id,f,0,rid), "image/gif"); +  return http_string_answer(write_text(id,f,0,rid), "image/gif");   }      string quote(string in)
673:    if(!id->supports->images) return alt;    if(!id->supports->javascript)    return (!input)? -  ("<a "+extra_args+"href=\""+url+"\"><img _parsed=1 src="+image_1+" name="+ -  sn+" border=0 alt=\""+alt+"\" ></a>\n"): -  ("<input type=image "+extra_args+" src="+image_1+" name="+input+">"); +  ("<a "+extra_args+"href=\""+url+"\"><img _parsed=1 src=\""+image_1+"\" name="+sn+" border=0 alt=\""+alt+"\" ></a>\n"): +  ("<input type=image "+extra_args+" src=\""+image_1+"\" name="+input+">");       return    ("<script>\n"
686:    (input?"onClick='document.forms[0].submit();' ":"")    +"onMouseover=\"img_act('"+sn+"',"+sn+"h,'"+(mess||url)+"');\"\n"    "onMouseout='document.images[\""+sn+"\"].src = "+sn+"l.src;'><img " -  "_parsed=1 width="+xs+" height="+ys+" src="+image_1+" name="+sn+ +  "_parsed=1 width="+xs+" height="+ys+" src=\""+image_1+"\" name="+sn+    " border=0 alt=\""+alt+"\" ></a>\n"));   }   
719:    extra_args(arg); m_delete(arg,"split");    if(defines->fg && !arg->fg) arg->fg=defines->fg;    if(defines->bg && !arg->bg) arg->bg=defines->bg; -  if(!arg->font) arg->font=defines->font||QUERY(default_font); + // if(!arg->font) arg->font=defines->font||QUERY(default_font); +  if(!arg->nfont) arg->nfont=defines->nfont;       int num = find_or_insert( arg );   
798:       if(defines->fg && !arg->fg) arg->fg=defines->fg;    if(defines->bg && !arg->bg) arg->bg=defines->bg; -  if(!arg->font) arg->font=defines->font||QUERY(default_font); + // if(!arg->font) arg->font=defines->font||QUERY(default_font); +  if(!arg->nfont) arg->nfont=defines->nfont; +  if(!arg->bold) arg->bold=defines->bold; +  if(!arg->italic) arg->italic=defines->italic; +  if(!arg->black) arg->black=defines->black; +  if(!arg->narrow) arg->narrow=defines->narrow;       if(arg->split)    {
828:    gt=contents;    rest="";    +  switch(t) +  { +  case "gh1": case "gh2": case "gh3": case "gh4": +  case "gh5": case "gh6": case "gh7": +  case "gh": pre="<p>"; post="<br>"; defalign="top"; break; +  case "gtext": +  pre=""; post=""; defalign="bottom"; +  break; +  case "anfang": +  gt=contents[0..0]; rest=contents[1..]; +  pre="<br clear=left>"; post=""; defalign="left"; +  break; +  } +     if(split)    {    string word; -  array res = ({}); +  array res = ({pre});    string pre = query_location()+num+"/";       if(lp) res+=({ lp });
842:    {    array size = write_text(num,word,1,id);    res += ({ "<img _parsed=1 border=0 alt=\""+replace(word,"\"","'") -  +"\" src=\'"+pre+quote(word)+"\' width="+ +  +"\" src=\""+pre+quote(word)+"\" width="+    size[0]+" height="+size[1]+" "+ea+">\n"    });    } -  if(lp) res+=({ "</a>" }); +  if(lp) res+=({ "</a>"+post });    return res*"";    }    -  switch(t) -  { -  case "gh1": case "gh2": case "gh3": case "gh4": -  case "gh5": case "gh6": case "gh7": -  case "gh": pre="<p>"; post="<br>"; defalign="top"; break; -  case "gtext": -  pre=""; post=""; defalign="bottom"; -  break; -  case "anfang": -  gt=contents[0..0]; rest=contents[1..]; -  pre="<br clear=left>"; post=""; defalign="left"; -  break; -  } -  +     array size = write_text(num,gt,1,id);       if(magic)
900:    +" align="+(al || defalign)+ea+    " width="+size[0]+" height="+size[1]+">"+rest+post);    return (pre+(lp?lp:"")+ -  "<img _parsed=1 border=0 alt=\""+replace(gt,"\"","'")+"\" src="+ -  query_location()+num+"/"+quote(gt)+" "+ea +  "<img _parsed=1 border=0 alt=\""+replace(gt,"\"","'")+"\" src=\""+ +  query_location()+num+"/"+quote(gt)+"\" "+ea    +" align="+(al || defalign)+    " width="+size[0]+" height="+size[1]+">"+rest+(lp?"</a>":"")+post);   }