Changeset 495

Show
Ignore:
Timestamp:
03/20/2008 21:56:54 (6 months ago)
Author:
why
Message:
  • shoes/canvas.c: firing the start event after the first paint.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/shoes/canvas.c

    r492 r495  
    1818const double PI     = 3.14159265358979323846; 
    1919const double RAD2PI = 0.01745329251994329577; 
     20 
     21static void shoes_canvas_send_start(VALUE); 
    2022 
    2123#ifdef SHOES_GTK 
     
    305307#endif 
    306308 
     309  shoes_canvas_send_start(self); 
    307310quit: 
    308311  return; 
     
    14381441    if (self_t->cr == canvas->cr) 
    14391442      self_t->cr = NULL; 
    1440  
    1441     if (canvas->stage == CANVAS_NADA) 
    1442     { 
    1443       canvas->stage = CANVAS_STARTED; 
    1444       if (!NIL_P(self_t->start)) 
    1445       { 
    1446         shoes_safe_block(self, self_t->start, rb_ary_new()); 
    1447       } 
    1448     } 
    14491443  } 
    14501444 
     
    16991693EVENT_HANDLER(start); 
    17001694EVENT_HANDLER(finish); 
     1695 
     1696static void 
     1697shoes_canvas_send_start(VALUE self) 
     1698{ 
     1699  shoes_canvas *canvas; 
     1700  Data_Get_Struct(self, shoes_canvas, canvas); 
     1701 
     1702  if (canvas->stage == CANVAS_NADA) 
     1703  { 
     1704    int i; 
     1705    canvas->stage = CANVAS_STARTED; 
     1706 
     1707    for (i = RARRAY_LEN(canvas->contents) - 1; i >= 0; i--) 
     1708    { 
     1709      VALUE ele = rb_ary_entry(canvas->contents, i); 
     1710      if (rb_obj_is_kind_of(ele, cCanvas) && shoes_canvas_inherits(ele, canvas)) 
     1711        shoes_canvas_send_start(ele); 
     1712    } 
     1713 
     1714    if (!NIL_P(canvas->start)) 
     1715    { 
     1716      shoes_safe_block(self, canvas->start, rb_ary_new()); 
     1717    } 
     1718  } 
     1719} 
    17011720 
    17021721static VALUE