Roxen.git
/
server
/
modules
/
graphics
/
gbutton.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/modules/graphics/gbutton.pike:17:
// icon-src -- icon reference // icon-data -- inline icon data // align -- left|center|right text alignment // align-icon -- left|center-before|center-after|right icon 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.
52
2000/07/
21
12
:
42
:
28
kuntri
Exp $";
+
constant cvs_version = "$Id: gbutton.pike,v 1.
53
2000/07/
24
00
:
58
:
37
nilsson
Exp $";
constant thread_safe = 1; #include <module.h> inherit "module"; roxen.ImageCache button_cache; constant module_type = MODULE_PARSER; constant module_name = "GButton"; constant module_doc =
Roxen.git/server/modules/graphics/gbutton.pike:207:
Inside #if 0
return res; }; #endif return f; } void start() { button_cache = roxen.ImageCache("gbutton", TIMER(draw_button)); }
+
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]/2, Roxen.sizetostring(s[1]));
+
}
+
+
mapping(string:function) query_action_buttons() {
+
return ([ "Clear cache":flush_cache ]);
+
}
+
+
void flush_cache() {
+
button_cache->flush();
+
}
+
Image.Layer layer_slice( Image.Layer l, int from, int to ) { return Image.Layer( ([ "image":l->image()->copy( from,0, to-1, l->ysize()-1 ), "alpha":l->alpha()->copy( from,0, to-1, l->ysize()-1 ), ]) ); } Image.Layer stretch_layer( Image.Layer o, int x1, int x2, int w ) {