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.103 2004/05/27 21:24:37 _cvs_stephen Exp $"; + constant cvs_version = "$Id: gbutton.pike,v 1.104 2004/05/31 23:01:52 _cvs_stephen Exp $";   constant thread_safe = 1;      #include <module.h> -  + #include <stat.h>   inherit "module";    - roxen.ImageCache button_cache; + core.ImageCache button_cache;   int do_ext;      constant module_type = MODULE_TAG;   constant module_name = "Graphics: GButton";   constant module_doc =   "Provides the <tt>&lt;gbutton&gt;</tt> tag that is used to draw graphical "   "buttons.";      void create()   {
Roxen.git/server/modules/graphics/gbutton.pike:188: Inside #if 0
   werror("Drawing ... ");    res = f( @args );    werror(" %.1fms\n", (gethrtime()-h)/1000000.0 );    return res;    };   #endif    return f;   }   void start()   { -  button_cache = roxen.ImageCache("gbutton", TIMER(draw_button)); +  button_cache = core.ImageCache("gbutton", TIMER(draw_button));    do_ext = query("ext");   }      string status() {    array s=button_cache->status();    return sprintf("<b>Images in cache:</b> %d images<br />\n"    "<b>Cache size:</b> %s",    s[0], String.int2size(s[1]));   }   
Roxen.git/server/modules/graphics/gbutton.pike:280:    case "background": background = l; break;    case "frame": frame = l; break;    case "mask": mask = l; break;    }    }    };       if( args->border_image )    {    array(Image.Layer)|mapping tmp = -  roxen.load_layers(args->border_image, id, opts); +  core.load_layers(args->border_image, id, opts);       if (mappingp(tmp))    if (tmp->error == 401)    return tmp;    else    report_debug("GButton: Failed to load frame image: %O\n",    args->border_image);    set_image( tmp );    }   
Roxen.git/server/modules/graphics/gbutton.pike:374:    default:    case "middle":    text_height = bottom - top;    break;    }       // Get icon    if (args->icn) {    // Pass error mapping to find out possible errors when loading icon    mapping err = ([ ]); -  icon = roxen.low_load_image(args->icn, id, err); +  icon = core.low_load_image(args->icn, id, err);       // If icon loading fails due to missing authentication we reject the    // gbutton request so that the browser can re-request it with proper    // authentication headers.    if (!icon && err->error == 401)    return err;    } else if (args->icd) -  icon = roxen.low_decode_image(args->icd); +  icon = core.low_decode_image(args->icd);       int i_width = icon && icon->img->xsize();    int i_height = icon && icon->img->ysize();    int i_spc = i_width && sizeof(text) && 5;       // Generate text    if (sizeof(text))    {    int min_font_size = 0;    int max_font_size = text_height * 2;
Roxen.git/server/modules/graphics/gbutton.pike:786:    args->icon_src = args["icon-src"] || args->icon_src;    args->icon_data = args["icon-data"] || args->icon_data;    args->align_icon = args["align-icon"] || args->align_icon;    args->valign_icon = args["valign-icon"] || args->valign_icon;    m_delete(args, "icon-src");    m_delete(args, "icon-data");    m_delete(args, "align-icon");       mapping new_args =    ([ -  "pagebg" :parse_color(args->pagebgcolor || +  "pagebg" :Colors.parse_color(args->pagebgcolor ||    id->misc->defines->theme_bgcolor ||    id->misc->defines->bgcolor ||    args->bgcolor ||    "#eeeeee"), // _page_ bg color -  "bg" : parse_color(args->bgcolor || +  "bg" : Colors.parse_color(args->bgcolor ||    id->misc->defines->theme_bgcolor ||    id->misc->defines->bgcolor ||    "#eeeeee"), // Background color -  "txt" : parse_color(args->textcolor || +  "txt" : Colors.parse_color(args->textcolor ||    id->misc->defines->theme_bgcolor ||    id->misc->defines->fgcolor ||    "#000000"), // Text color    "txtalpha": (args->textalpha?(float)args->textalpha:1.0),    "txtmode": (args->textmode||"normal"),    "cnd" : (args->condensed || // Condensed text    (lower_case(args->textstyle || "") == "condensed")),    "wi" : (int) args->width, // Min button width    "al" : args->align || "left", // Text alignment    "dim" : (args->dim || // Button dimming    (< "dim", "disabled" >)[lower_case(args->state || "")]),    "icn" : args->icon_src &&    Roxen.fix_relative(args->icon_src, id), // Icon URL    "icd" : args->icon_data, // Inline icon data    "ica" : lower_case(args->align_icon || "left"), // Icon alignment    "icva": lower_case(args->valign_icon || "middle"),// Vertical align    "font": (args->font||id->misc->defines->font|| -  roxen->query("default_font")), -  "fontkey": roxen->fonts->verify_font(args->font||id->misc->defines->font), +  core->query("default_font")), +  "fontkey": core->fonts->verify_font(args->font||id->misc->defines->font),    "border_image":fi,    "extra_layers":args["extra-layers"],    "extra_left_layers":args["extra-left-layers"],    "extra_right_layers":args["extra-right-layers"],    "extra_background_layers":args["extra-background-layers"],    "extra_mask_layers":args["extra-mask-layers"],    "extra_frame_layers":args["extra-frame-layers"],    "scale":args["scale"],    "format":args["format"],    "gamma":args["gamma"],