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.134 1998/07/19 17:57:41 per Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.135 1998/08/02 00:59:35 peter 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:48:    "The gtext tag saves images when they are calculated in this "    "directory.");       defvar("cache_age", 48, "Cache max age",       TYPE_INT,       "If the images in the cache have not been accessed for this "    "number of hours they are removed.");    -  defvar("speedy", 0, "Avoid automatic detection of document colors", +  defvar("speedy", 0, "Avoid automatic detection of document colors in tables",    TYPE_FLAG|VAR_MORE, -  "If this flag is set, the tags 'body', 'tr', 'td', 'font' and 'th' " +  "If this flag is set, the tags 'tr', 'td', 'font' and 'th' "    " will <b>not</b> be parsed to automatically detect the colors of "    " a document. You will then have to specify all colors in all calls " -  +  " to &lt;gtext&gt; or in the 'body' tag"); +  +  defvar("nobody", 0, "Avoid automatic detection of document colors from body", +  TYPE_FLAG|VAR_MORE, +  "If this flag is set, the 'body' tag" +  " will <b>not</b> be parsed to automatically detect the colors of " +  " a document. You will then have to specify all colors in all calls "    " to &lt;gtext&gt;");       defvar("deflen", 300, "Default maximum text-length", TYPE_INT|VAR_MORE,    "The module will, per default, not try to render texts "    "longer than this. This is a safeguard for things like "    "&lt;gh1&gt;&lt;/gh&gt;, which would otherwise parse the"    " whole document. This can be overrided with maxlen=... in the "    "tag.");       defvar("location", "/gtext/", "Mountpoint", TYPE_LOCATION|VAR_MORE,
Roxen.git/server/modules/graphics/graphic_text.pike:760:       if(!args)    {    throw( ({ "Internal error in gtext: Got request for non-existant gtext class", backtrace() }) );    }       if(data = cache_lookup(key, text))    {    if(args->nocache) // Remove from cache. Very useful for access counters    cache_remove(key, text); +  perror("Cache (1)\n");    if(size) return data[1];    return data[0];    } else if(data = get_cache_file( key, text )) {    cache_set(key, text, data); -  +  perror("Cache (2)\n");    if(size) return data[1];    return data[0];    }          // So. We have to actually draw the thing... -  +  perror("Drawing...\n");       err = catch    {    object img;    if(!args)    {    args=(["fg":"black","bg":"white","notrans":"1"]);    text="Please reload this page";    }   
Roxen.git/server/modules/graphics/graphic_text.pike:1523:    defines->bg = c[-i-1][1];    break;    }    c = c[..sizeof(c)-i-2];    id->misc->colors = c;      }      mapping query_tag_callers()   { -  return ([ "gtext-id":tag_gtext_id, ]) | (query("speedy")?([]): +  return ([ "gtext-id":tag_gtext_id, ]) +  | (query("nobody")?([]): +  (["body":tag_body, +  "/body":pop_color])), +  | (query("speedy")?([]):    (["font":tag_fix_color, -  "body":tag_body, +     "table":tag_fix_color,    "tr":tag_fix_color,    "td":tag_fix_color,    "layer":tag_fix_color,    "ilayer":tag_fix_color,    "/td":pop_color,    "/tr":pop_color,    "/font":pop_color, -  "/body":pop_color, +     "/table":pop_color,    "/layer":pop_color,    "/ilayer":pop_color,    ]));   }         mapping query_container_callers()   {    return ([ "anfang":tag_graphicstext,    "gh":tag_graphicstext,    "gh1":tag_graphicstext, "gh2":tag_graphicstext,    "gh3":tag_graphicstext, "gh4":tag_graphicstext,    "gh5":tag_graphicstext, "gh6":tag_graphicstext,    "gtext":tag_graphicstext, ]);   }