Changeset 2059 for lang/ruby/RubyESRIShape/RubyESRIShape.c
- Timestamp:
- 11/27/07 17:21:31 (14 months ago)
- Files:
-
- 1 modified
-
lang/ruby/RubyESRIShape/RubyESRIShape.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/RubyESRIShape/RubyESRIShape.c
r2057 r2059 4 4 static VALUE rb_cShape = 0; 5 5 static VALUE rb_cPolygon = 0; 6 static VALUE rb_cPolyline = 0; 6 7 static VALUE rb_cPoint = 0; 7 8 static VALUE rb_cBoundingBox = 0; … … 10 11 { 11 12 return rb_cPolygon; 13 } 14 15 VALUE getRubyESRIShapePolylineClass() 16 { 17 return rb_cPolyline; 12 18 } 13 19 … … 31 37 static void rb_polygon_free(void *ptr); 32 38 static void rb_polygon_mark(void *ptr); 39 40 static VALUE rb_polyline_allocate(VALUE klass); 41 static void rb_polyline_free(void *ptr); 33 42 34 43 static void rb_point_free(void *ptr); … … 185 194 186 195 return c_Polygon_getBoundingBox(indata->pThis); 196 } 197 198 // Polyline 199 200 static VALUE rb_polyline_allocate(VALUE klass) 201 { 202 RPolylineData* indata = ALLOC(RPolylineData); 203 indata->pThis = NULL; 204 205 return Data_Wrap_Struct(klass, 0, rb_polyline_free, indata); 206 } 207 208 static void rb_polyline_free(void *ptr) 209 { 210 if (ptr) 211 { 212 if (((RPolylineData*)ptr)->pThis) 213 c_Polyline_delete(((RPolylineData*)ptr)->pThis); 214 free(ptr); 215 } 187 216 } 188 217 … … 311 340 rb_define_method(rb_cPolygon, "each" , rb_polygon_each , 0); 312 341 rb_define_method(rb_cPolygon, "bounding_box", rb_polygon_bounding_box, 0); 342 343 // class 344 rb_cPolyline = rb_define_class_under (rb_mRubyESRIShape, "Polyline", rb_cObject); 345 rb_define_alloc_func(rb_cPolyline, rb_polyline_allocate); 313 346 314 347 // class
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)