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.146 1998/08/26 14:34:14 wellhard Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.147 1998/08/26 17:48:03 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:50:    "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("colorparse", 1, "Parse tags for document colors", TYPE_FLAG, +  "If set, parse the specified tags for document colors."); +     defvar("colorparsing", ({"body", "td", "layer", "ilayer", "table"}),    "Tags to parse for color",    TYPE_STRING_LIST,    "Which tags should be parsed for document colors? "    "This will affect documents without gtext as well as documents "    "with it, the parsing time is relative to the number of parsed "    "tags in a document. You have to reload this module or restart " -  "roxen for changes of this variable to take effect."); +  "roxen for changes of this variable to take effect.", 0, +  lambda(){return !query("colorparse");});       defvar("colormode", 1, "Normalize colors in parsed tags", TYPE_FLAG,    "If set, replace 'roxen' colors (@c,m,y,k etc) with " -  "'netscape' colors (#rrggbb). Setting this to off will make the " +  "'netscape' colors (#rrggbb). Setting this to off will lessen the "    "performance impact of the 'Tags to parse for color' option quite" -  " dramatically. You can try this out with the &lt;gauge&gt; tag."); +  " dramatically. You can try this out with the &lt;gauge&gt; tag.", +  0, lambda(){return !query("colorparse");});    - // defvar("notspeedy", 0, "Automaticaly detect colors in tables", - // TYPE_FLAG, - // "If this flag is set, the tags 'table', 'th', 'tr', 'td', 'font'" - // " 'layer' and 'ilayer'" - // " will be parsed to automatically detect the colors of" - // " a document. This will slow down the parser in a noticeable way, " - // "but it will be easier to use &lt;gtext&gt; since the colors " - // "will almost always have the correct default values"); -  - // defvar("body", 1, "Automatically detect colors in the &lt;body&gt; tag", - // TYPE_FLAG, - // "If this flag is not 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,    "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. "    "The size of the image depends on the number of colors",    ({ 1,2,3,4,5,6,7,8,10,16,32,64,128,256 }));       defvar("gif", 0, "Append .gif to all images", TYPE_FLAG|VAR_MORE,    "Append .gif to all images made by gtext. Normally this will "    "only waste bandwidth");    -  +    #ifdef TYPE_FONT    // compatibility variables...    defvar("default_size", 32, 0, TYPE_INT,0,0,1);    defvar("default_font", "urw_itc_avant_garde-demi-r",0,TYPE_STRING,0,0,1);   #else    defvar("default_size", 32, "Default font size", TYPE_INT_LIST,    "The default size for the font. This is used for the 'base' size, "    "and can be scaled up or down in the tags.",    ({ 16, 32, 64 }));   
Roxen.git/server/modules/graphics/graphic_text.pike:1581:    defines->bg = c[-i-1][1];    break;    }    c = c[..sizeof(c)-i-2];    id->misc->colors = c;   }      mapping query_tag_callers()   {    mapping tags = ([ "gtext-id":tag_gtext_id]); +  if(query("colorparse"))    foreach(query("colorparsing"), string t)    {    switch(t)    {    case "body":    tags[t] = tag_body;    break;    default:    tags[t] = tag_fix_color;    tags["/"+t]=pop_color;