Changeset 443
- Timestamp:
- 03/04/2008 00:13:21 (6 months ago)
- Location:
- trunk
- Files:
-
- 7 modified
-
lib/shoes.rb (modified) (1 diff)
-
samples/book.rb (modified) (1 diff)
-
shoes/app.c (modified) (2 diffs)
-
shoes/canvas.c (modified) (3 diffs)
-
shoes/canvas.h (modified) (1 diff)
-
shoes/ruby.c (modified) (1 diff)
-
shoes/ruby.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/shoes.rb
r441 r443 194 194 Shoes.debug "Loaded SHY: #{shy.name} #{shy.version} by #{shy.creator}" 195 195 path = shy.launch 196 else 197 Dir.chdir(File.dirname(path)) 198 path = File.basename(path) 196 199 end 197 200 eval(File.read(path), TOPLEVEL_BINDING) -
trunk/samples/book.rb
r306 r443 7 7 end 8 8 9 INCIDENTS = YAML.load_file(' samples/book.yaml')9 INCIDENTS = YAML.load_file('book.yaml') 10 10 11 11 def table_of_contents -
trunk/shoes/app.c
r442 r443 72 72 shoes_app_remove(shoes_app *app) 73 73 { 74 shoes_ele_remove_all(app->timers); 74 75 rb_ary_delete(shoes_world->apps, app->self); 75 76 return (RARRAY_LEN(shoes_world->apps) == 0); … … 1972 1973 shoes_app_close_window(shoes_app *app) 1973 1974 { 1975 shoes_ele_remove_all(app->timers); 1974 1976 #ifdef SHOES_GTK 1975 gtk_widget_destroy(GTK_WIDGET(APP_WINDOW(app))); 1977 shoes_app_gtk_quit(app->os.window, NULL, (gpointer)app); 1978 gtk_widget_destroy(app->os.window); 1979 app->os.window = NULL; 1976 1980 #endif 1977 1981 #ifdef SHOES_WIN32 -
trunk/shoes/canvas.c
r439 r443 345 345 rb_gc_mark_maybe(canvas->bg); 346 346 rb_gc_mark_maybe(canvas->contents); 347 rb_gc_mark_maybe(canvas->timers);348 347 rb_gc_mark_maybe(canvas->click); 349 348 rb_gc_mark_maybe(canvas->release); … … 391 390 shoes_canvas_empty(shoes_canvas *canvas) 392 391 { 393 if (!NIL_P(canvas->contents)) 394 { 395 long i; 396 VALUE ary; 397 ary = rb_ary_dup(canvas->contents); 398 for (i = 0; i < RARRAY_LEN(ary); i++) 399 rb_funcall(rb_ary_entry(ary, i), s_remove, 0); 400 rb_ary_clear(canvas->contents); 401 } 392 shoes_ele_remove_all(canvas->contents); 402 393 } 403 394 … … 1253 1244 Data_Get_Struct(self, shoes_canvas, self_t); 1254 1245 shoes_canvas_empty(self_t); 1255 shoes_canvas_remove_item(self_t->parent, self, 0, 0); 1246 if (!NIL_P(self_t->parent)) 1247 shoes_canvas_remove_item(self_t->parent, self, 0, 0); 1256 1248 return self; 1257 1249 } -
trunk/shoes/canvas.h
r439 r443 219 219 ID mode; 220 220 VALUE contents; 221 VALUE timers;222 221 VALUE parent; 223 222 VALUE attr; -
trunk/shoes/ruby.c
r435 r443 392 392 place->ih = place->h - (tmargin + bmargin); 393 393 INFO("PLACE: (%d, %d), (%d, %d) [%d, %d] %d %x\n", place->x, place->y, place->w, place->h, ABSX(*place), ABSY(*place), place->flags, canvas->marginy); 394 } 395 396 void 397 shoes_ele_remove_all(VALUE contents) 398 { 399 if (!NIL_P(contents)) 400 { 401 long i; 402 VALUE ary; 403 ary = rb_ary_dup(contents); 404 for (i = 0; i < RARRAY_LEN(ary); i++) 405 rb_funcall(rb_ary_entry(ary, i), s_remove, 0); 406 rb_ary_clear(contents); 407 } 394 408 } 395 409 -
trunk/shoes/ruby.h
r439 r443 100 100 VALUE rb_str_to_pas(VALUE); 101 101 void shoes_place_decide(shoes_place *, VALUE, VALUE, int, int, unsigned char, int); 102 void shoes_ele_remove_all(VALUE); 102 103 void shoes_cairo_rect(cairo_t *, double, double, double, double, double); 103 104
