Changeset 446
- Timestamp:
- 03/04/2008 01:46:17 (6 months ago)
- Location:
- trunk/shoes
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/shoes/app.c
r445 r446 23 23 rb_gc_mark_maybe(app->location); 24 24 rb_gc_mark_maybe(app->canvas); 25 rb_gc_mark_maybe(app->nestslot); 25 26 rb_gc_mark_maybe(app->nesting); 26 27 rb_gc_mark_maybe(app->timers); … … 41 42 app->location = Qnil; 42 43 app->canvas = shoes_canvas_new(cShoes, app); 44 app->nestslot = Qnil; 43 45 app->nesting = rb_ary_new(); 44 46 app->timers = rb_ary_new(); … … 74 76 shoes_ele_remove_all(app->timers); 75 77 shoes_canvas_clear(app->canvas); 78 app->nestslot = Qnil; 76 79 } 77 80 … … 1805 1808 if (rb_obj_is_kind_of(exec.block, rb_cUnboundMethod)) { 1806 1809 VALUE klass = rb_unbound_get_class(exec.block); 1807 exec.canvas = shoes_slot_new(klass, Qnil, app->canvas);1810 exec.canvas = app->nestslot = shoes_slot_new(klass, Qnil, app->canvas); 1808 1811 exec.block = rb_funcall(exec.block, s_bind, 1, exec.canvas); 1809 1812 exec.ieval = 0; 1810 1813 rb_ary_push(canvas->contents, exec.canvas); 1811 1814 } else { 1812 exec.canvas = app-> canvas;1815 exec.canvas = app->nestslot = app->canvas; 1813 1816 exec.ieval = 1; 1814 1817 } -
trunk/shoes/app.h
r439 r446 34 34 VALUE self; 35 35 VALUE canvas; 36 VALUE nestslot; 36 37 VALUE nesting; 37 38 VALUE timers; -
trunk/shoes/canvas.c
r443 r446 1493 1493 1494 1494 #define DRAW(c, app, blk) \ 1495 rb_ary_push(app->nesting, c); \ 1496 rb_funcall(blk, s_call, 0); \ 1497 rb_ary_pop(app->nesting) 1495 { \ 1496 unsigned char alter = 0; \ 1497 if (RARRAY_LEN(app->nesting) == 0) \ 1498 { \ 1499 alter = 1; \ 1500 rb_ary_push(app->nesting, app->nestslot); \ 1501 } \ 1502 rb_ary_push(app->nesting, c); \ 1503 rb_funcall(blk, s_call, 0); \ 1504 rb_ary_pop(app->nesting); \ 1505 if (alter) \ 1506 rb_ary_pop(app->nesting); \ 1507 } 1508 1498 1509 1499 1510 static void
