|
|
| version 1.70, 2002/04/15 10:35:21 | version 1.71, 2002/04/18 10:50:59 |
|---|---|
| Line 25 | Line 25 |
| #include "pa_vfile.h" | #include "pa_vfile.h" |
| #include "pa_vimage.h" | #include "pa_vimage.h" |
| // defines | |
| #define IMAGE_CLASS_NAME "image" | |
| // class | // class |
| class MImage : public Methoded { | class MImage : public Methoded { |
| Line 693 static void _length(Request& r, const St | Line 689 static void _length(Request& r, const St |
| VImage& vimage=*static_cast<VImage *>(r.self); | VImage& vimage=*static_cast<VImage *>(r.self); |
| if(vimage.image) | if(vimage.image) |
| if(vimage.font) { | if(vimage.font) { |
| VInt& result=*new(pool) VInt(pool, vimage.font->string_width(s)); | r.write_no_lang(*new(pool) VInt(pool, vimage.font->string_width(s))); |
| result.set_name(method_name); | |
| r.write_assign_lang(result); | |
| } else | } else |
| throw Exception("parser.runtime", | throw Exception("parser.runtime", |
| &method_name, | &method_name, |
| Line 814 static void _copy(Request& r, const Stri | Line 808 static void _copy(Request& r, const Stri |
| // constructor | // constructor |
| MImage::MImage(Pool& apool) : Methoded(apool) { | MImage::MImage(Pool& apool) : Methoded(apool, "image") { |
| set_name(*NEW String(pool(), IMAGE_CLASS_NAME)); | |
| // ^image:measure[DATA] | // ^image:measure[DATA] |
| add_native_method("measure", Method::CT_DYNAMIC, _measure, 1, 1); | add_native_method("measure", Method::CT_DYNAMIC, _measure, 1, 1); |