--- parser3/src/classes/image.C 2003/02/04 14:12:41 1.90.2.5 +++ parser3/src/classes/image.C 2003/02/04 15:15:01 1.90.2.6 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_IMAGE_C="$Date: 2003/02/04 14:12:41 $"; +static const char* IDENT_IMAGE_C="$Date: 2003/02/04 15:15:01 $"; /* jpegsize: gets the width and height (in pixels) of a jpeg file @@ -667,7 +667,7 @@ static void _html(Request& r, StringPtr attribs->for_each(append_attrib_pair, &attrib_info); } else throw Exception("parser.runtime", - &method_name, + method_name, "attributes must be hash"); } @@ -694,7 +694,7 @@ static gdImage *load(Request& r, const S return ℑ } else { throw Exception("file.missing", - &method_name, + method_name, "can not open '%s'", file_name_cstr); return 0; } @@ -732,7 +732,7 @@ static void _gif(Request& r, StringPtr m gdImage *image=static_cast(r.get_self())->image; if(!image) throw Exception(0, - &method_name, + method_name, "does not contain an image"); // could _ but don't thing it's wise to use $image.src for vfile.name @@ -753,7 +753,7 @@ static void _line(Request& r, StringPtr gdImage *image=static_cast(r.get_self())->image; if(!image) throw Exception(0, - &method_name, + method_name, "does not contain an image"); image->Line( @@ -770,7 +770,7 @@ static void _fill(Request& r, StringPtr gdImage *image=static_cast(r.get_self())->image; if(!image) throw Exception(0, - &method_name, + method_name, "does not contain an image"); image->Fill( @@ -785,7 +785,7 @@ static void _rectangle(Request& r, Strin gdImage *image=static_cast(r.get_self())->image; if(!image) throw Exception(0, - &method_name, + method_name, "does not contain an image"); image->Rectangle( @@ -802,7 +802,7 @@ static void _bar(Request& r, StringPtr m gdImage *image=static_cast(r.get_self())->image; if(!image) throw Exception(0, - &method_name, + method_name, "does not contain an image"); image->FilledRectangle( @@ -829,13 +829,13 @@ static void _replace(Request& r, StringP gdImage *image=static_cast(r.get_self())->image; if(!image) throw Exception(0, - &method_name, + method_name, "does not contain an image"); Table *table=params.as_no_junction(2, "coordinates must not be code").get_table(); if(!table) throw Exception(0, - &method_name, + method_name, "coordinates must be table"); gdImage::Point *all_p=(gdImage::Point *)pool.malloc(sizeof(gdImage::Point)*table->size()); @@ -852,13 +852,13 @@ static void _polyline(Request& r, String gdImage *image=static_cast(r.get_self())->image; if(!image) throw Exception(0, - &method_name, + method_name, "does not contain an image"); Table *table=params.as_no_junction(1, "coordinates must not be code").get_table(); if(!table) throw Exception(0, - &method_name, + method_name, "coordinates must be table"); gdImage::Point *all_p=(gdImage::Point *)pool.malloc(sizeof(gdImage::Point)*table->size()); @@ -875,13 +875,13 @@ static void _polygon(Request& r, StringP gdImage *image=static_cast(r.get_self())->image; if(!image) throw Exception(0, - &method_name, + method_name, "does not contain an image"); Table *table=params.as_no_junction(1, "coordinates must not be code").get_table(); if(!table) throw Exception(0, - &method_name, + method_name, "coordinates must be table"); gdImage::Point *all_p=(gdImage::Point *)pool.malloc(sizeof(gdImage::Point)*table->size()); @@ -897,13 +897,13 @@ static void _polybar(Request& r, StringP gdImage *image=static_cast(r.get_self())->image; if(!image) throw Exception(0, - &method_name, + method_name, "does not contain an image"); Table *table=params.as_no_junction(1, "coordinates must not be code").get_table(); if(!table) throw Exception("parser.runtime", - &method_name, + method_name, "coordinates must be table"); gdImage::Point *all_p=(gdImage::Point *)pool.malloc(sizeof(gdImage::Point)*table->size()); @@ -1003,12 +1003,12 @@ static void _font(Request& r, StringPtr if(!alphabet.size()) throw Exception("parser.runtime", - &method_name, + method_name, "alphabet must not be empty"); if(int remainder=image.SY() % alphabet.size()) throw Exception("parser.runtime", - &method_name, + method_name, "font-file height(%d) not divisable by alphabet size(%d), remainder=%d", image.SY(), alphabet.size(), remainder); @@ -1031,11 +1031,11 @@ static void _text(Request& r, StringPtr vimage.font->string_display(*vimage.image, x, y, s); else throw Exception("parser.runtime", - &method_name, + method_name, "set the font first"); else throw Exception(0, - &method_name, + method_name, "does not contain an image"); } @@ -1050,11 +1050,11 @@ static void _length(Request& r, StringPt r.write_no_lang(*new(pool) VInt(pool, vimage.font->string_width(s))); } else throw Exception("parser.runtime", - &method_name, + method_name, "set the font first"); else throw Exception(0, - &method_name, + method_name, "does not contain an image"); } @@ -1064,7 +1064,7 @@ static void _arc(Request& r, StringPtr m gdImage *image=static_cast(r.get_self())->image; if(!image) throw Exception(0, - &method_name, + method_name, "does not contain an image"); image->Arc( @@ -1083,7 +1083,7 @@ static void _sector(Request& r, StringPt gdImage *image=static_cast(r.get_self())->image; if(!image) throw Exception(0, - &method_name, + method_name, "does not contain an image"); image->Sector( @@ -1102,7 +1102,7 @@ static void _circle(Request& r, StringPt gdImage *image=static_cast(r.get_self())->image; if(!image) throw Exception(0, - &method_name, + method_name, "does not contain an image"); int size=params.as_int(2, "radius must be int", r)*2; @@ -1126,11 +1126,11 @@ gdImage& as_image(Pool& pool, StringPtr src=static_cast(vimage)->image; if(!src) throw Exception("parser.runtime", - &method_name, + method_name, msg); } else throw Exception("parser.runtime", - &method_name, + method_name, msg); return *src; @@ -1142,7 +1142,7 @@ static void _copy(Request& r, StringPtr gdImage *dest=static_cast(r.get_self())->image; if(!dest) throw Exception(0, - &method_name, + method_name, "self does not contain an image"); gdImage& src=as_image(pool, method_name, params, 0, "src must be image");