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.106 1998/02/22 20:10:15 neotron Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.107 1998/02/27 05:19:21 per Exp $";   constant thread_safe=1;      #include <module.h>   #include <stat.h>   inherit "module";   inherit "roxenlib";      #ifndef VAR_MORE   #define VAR_MORE 0   #endif /* VAR_MORE */
Roxen.git/server/modules/graphics/graphic_text.pike:1138:    if(cached_args[num]) return cached_args[num];    return 0;   }            int find_or_insert(mapping find)   {    mapping f2 = copy_value(find);    foreach(glob("magic_*", indices(f2)), string q) m_delete(f2,q); -  if(!args_restored) restore_cached_args(); +  if(!args_restored)    array a = indices(cached_args);    array b = values(cached_args);    int i;    -  for(i=0; i<sizeof(a); i++) -  if(equal(f2, b[i])) -  return a[i]; -  +  for(i=0; i<sizeof(a); i++) if(equal(f2, b[i])) return a[i]; +  restore_cached_args(); +  for(i=0; i<sizeof(a); i++) if(equal(f2, b[i])) return a[i];    cached_args[number]=find;    remove_call_out(save_cached_args);    call_out(save_cached_args, 10);    return number++;   }         string magic_javascript_header(object id)   {    if(!id->supports->netscape_javascript || !id->supports->images) return "";
Roxen.git/server/modules/graphics/graphic_text.pike:1517:    FIX(link, "#0000b0",link);    FIX(alink, "#3f0f7b",alink);    FIX(vlink, "#ff0000",vlink);    } else {    FIX(bgcolor,"#c0c0c0",bg);    FIX(text, "#000000",fg);    FIX(link, "#0000ee",link);    FIX(alink, "#ff0000",alink);    FIX(vlink, "#551a8b",vlink);    } -  if(changed) return ({"<body "+make_args(args)+">"}); +  if(changed) return ({make_tag("body", args); })   }         array (string) tag_fix_color(string tagname, mapping args, object id, object file,    mapping defines)   {    int changed;       if(!id->misc->colors)    id->misc->colors = ({ ({ defines->fg, defines->bg, tagname }) });
Roxen.git/server/modules/graphics/graphic_text.pike:1544:    FIX(text,fg);    FIX(color,fg);    if(changed) return ({"<"+tagname+" "+make_args(args)+">"});    return 0;   }      void pop_color(string tagname,mapping args,object id,object file,    mapping defines)   {    array c = id->misc->colors; -  sscanf(tagname, "/%s", tagname); -  while(c && sizeof(c)) +  int i; +  tagname = tagname[1..]; +  +  for(i=0;i<sizeof(c);i++) +  if(c[-i-1][2]==tagname)    { -  if(c[-1][2]==tagname) -  { -  defines->fg = c[-1][0]; -  defines->bg = c[-1][1]; +  defines->fg = c[-i-1][0]; +  defines->bg = c[-i-1][1];    break;    } -  c = c[..sizeof(c)-2]; -  } +  +  c = c[..-i-2];    id->misc->colors = c;   }      mapping query_tag_callers()   {    return ([ "gtext-id":tag_gtext_id, ]) | (query("speedy")?([]):    (["font":tag_fix_color,    "body":tag_body,    "table":tag_fix_color,    "tr":tag_fix_color,