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

version» Context lines:

Roxen.git/server/modules/graphics/graphic_text.pike:1:   // This is a roxen module. Copyright © 1996 - 2004, Roxen IS.   //    - constant cvs_version="$Id: graphic_text.pike,v 1.301 2006/09/06 14:18:31 stewa Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.302 2006/09/13 14:48:17 stewa Exp $";      #include <module.h>   inherit "module";         // ------------------- Module registration ---------------------      constant module_type = MODULE_TAG;   constant module_name = "Graphics: Graphic text";   constant module_doc =
Roxen.git/server/modules/graphics/graphic_text.pike:1060:       class Frame {    inherit RXML.Frame;       array do_return(RequestID id) {    return ({ do_gtext(args, (string) content, id) });    }    }   }    + #ifdef GTEXT_RANDOM_PREFIX + constant random_chars = "abcdefghijklmnopqrstuvwxyz" / ""; +  + string random_pfx() { +  string s = ""; +  for(int i=0; i < 4; i++) +  s += random_chars[random(sizeof(random_chars))]; +  return s; + } +  + string get_gtext_pfx(RequestID id) { +  if(!id->root_id->misc->gtext_pfx) { +  id->root_id->misc->gtext_pfx = random_pfx(); +  RXML_CONTEXT->set_root_id_misc("gtext_pfx", id->root_id->misc->gtext_pfx); +  } +  return id->root_id->misc->gtext_pfx; + } + #endif +    private string do_gtext(mapping arg, string c, RequestID id)   {    if((c-" ")=="") return "";       c=fix_text(c,arg,id);    mapping p=mk_gtext_arg(arg,id);       string ext="";    if(query("ext")) ext="."+(p->format || "gif");   
Roxen.git/server/modules/graphics/graphic_text.pike:1160:    if(!p->fgcolor) p->fgcolor=id->misc->defines->theme_alink||    id->misc->defines->alink||"#ff0000";       string num2 = image_cache->store( ({ p, c }),id );    size = image_cache->metadata( num2, id );    if(size) {    arg->width=(string)max(arg->xsize,size->xsize);    arg->height=(string)max(arg->ysize,size->ysize);    }    + #ifdef GTEXT_RANDOM_PREFIX +  string sn = "gtext" + get_gtext_pfx(id) + id->root_id->misc->gtext_mi++; + #else    string sn = "gtext" + id->root_id->misc->gtext_mi++; -  + #endif    RXML_CONTEXT->set_root_id_misc("gtext_mi", id->root_id->misc->gtext_mi);       if(honor_supports && !id->supports->js_image_object) {    return (!input)?    ("<a"+ea+"href=\""+url+"\">"+Roxen.make_tag("img",arg+(["name":sn]),xml)+"</a>"):    Roxen.make_tag("input",arg+(["type":"image"]),xml);    }       arg->name=sn;    string res="<script type='text/javascript'>\n";