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

version» Context lines:

Roxen.git/server/modules/graphics/gbutton.pike:20:   // icon-data -- inline icon data   // align -- left|center|right text alignment   // align-icon -- left|center-before|center-after|right icon alignment   // valign-icon -- above|middle|below icon vertical alignment   // >Button text</gbutton>   //   // Alignment restriction: when text alignment is either left or right, icons   // must also be aligned left or right.       - constant cvs_version = "$Id: gbutton.pike,v 1.116 2009/11/26 15:43:48 grubba Exp $"; + constant cvs_version = "$Id: gbutton.pike,v 1.117 2009/12/01 18:06:52 grubba Exp $";   constant thread_safe = 1;      #include <module.h>   inherit "module";      roxen.ImageCache button_cache;   int do_ext;      constant module_type = MODULE_TAG;   constant module_name = "Graphics: GButton";
Roxen.git/server/modules/graphics/gbutton.pike:879:      // t = gethrtime();    string img_src =    query_absolute_internal_location(id) +    button_cache->store( ({ new_args, (string)content }), id, timeout);       if(do_ext)    img_src += "." + (new_args->format || "gif");      // werror("argcache->store took %dµs\n", gethrtime()-t ); -  return ({ img_src, new_args }); +  return ({ img_src, new_args, timeout });    }   }      class TagGButtonURL {    inherit RXML.Tag;    constant name = "gbutton-url";    constant flags = RXML.FLAG_DONT_REPORT_ERRORS;    RXML.Type content_type = RXML.t_text(RXML.PXml);       class Frame {
Roxen.git/server/modules/graphics/gbutton.pike:913:       class Frame {    inherit ButtonFrame;    array do_return(RequestID id) {    // Peek at img-align and remove it so it won't be copied by "*-*" glob    // in mk_url().    string img_align = args["img-align"];    string title = args->title;    m_delete(args, "img-align");    -  [string img_src, mapping new_args]=mk_url(id); +  [string img_src, mapping new_args, int timeout]=mk_url(id);       mapping img_attrs = ([ "src" : img_src,    "alt" : args->alt || (string)content,    "border" : args->border,    "hspace" : args->hspace,    "vspace" : args->vspace ]);    if (img_align)    img_attrs->align = img_align;    if (title)    img_attrs->title = title;       int no_draw = !id->misc->generate_images;    if (mapping size = button_cache->metadata( ({ new_args, (string)content }), -  id, no_draw)) { +  id, no_draw, timeout)) {    // Image in cache (no_draw above prevents generation on-the-fly, i.e.    // first image will lack sizes).    img_attrs->width = size->xsize;    img_attrs->height = size->ysize;    }       result = Roxen.make_tag("img", img_attrs, !args->noxml);       // Make button clickable if not dimmed    if(args->href && !new_args->dim)