Changeset 205
- Timestamp:
- 09/25/2007 00:57:39 (11 months ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
samples/mask.rb (modified) (1 diff)
-
shoes/ruby.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/samples/mask.rb
r204 r205 7 7 8 8 mask do 9 t ext "<span font_desc='34px'>Shoes</span>"9 title "Shoes" 10 10 end 11 11 end -
trunk/shoes/ruby.c
r203 r205 32 32 { 33 33 return rb_funcall2(tmp[0], (ID)tmp[1], (int)tmp[2], (VALUE *)tmp[3]); 34 } 35 36 VALUE 37 ts_funcall2(VALUE obj, ID meth, int argc, VALUE *argv) 38 { 39 VALUE tmp[4]; 40 tmp[0] = obj; 41 tmp[1] = (VALUE)meth; 42 tmp[2] = (VALUE)argc; 43 tmp[3] = (VALUE)argv; 44 return rb_iterate((VALUE(*)(VALUE))ts_each, (VALUE)tmp, CASTHOOK(rb_yield), 0); 34 45 } 35 46 … … 1119 1130 1120 1131 VALUE 1121 shoes_method_missing_color(int argc, VALUE *argv, VALUE self) 1122 { 1123 VALUE c, cname, alpha; 1124 rb_scan_args(argc, argv, "11", &cname, &alpha); 1132 shoes_app_method_missing(int argc, VALUE *argv, VALUE self) 1133 { 1134 shoes_app *app; 1135 VALUE c, cname, alpha, canvas; 1136 1137 cname = argv[0]; 1138 Data_Get_Struct(self, shoes_app, app); 1139 1140 canvas = rb_ary_entry(app->nesting, RARRAY_LEN(app->nesting) - 1); 1141 if (!NIL_P(canvas) && rb_respond_to(canvas, SYM2ID(cname))) 1142 { 1143 return ts_funcall2(canvas, SYM2ID(cname), argc - 1, argv + 1); 1144 } 1145 1146 // 1147 // Create colors by name 1148 // 1125 1149 c = rb_hash_aref(cColors, cname); 1126 1150 if (NIL_P(c)) … … 1131 1155 } 1132 1156 1157 rb_scan_args(argc, argv, "11", &cname, &alpha); 1133 1158 if (!NIL_P(alpha)) 1134 1159 { … … 2544 2569 rb_define_method(cColor, "to_pattern", CASTHOOK(shoes_color_to_pattern), 0); 2545 2570 2546 rb_define_method(cApp, "method_missing", CASTHOOK(shoes_ method_missing_color), -1);2571 rb_define_method(cApp, "method_missing", CASTHOOK(shoes_app_method_missing), -1); 2547 2572 2548 2573 rb_const_set(cShoes, rb_intern("COLORS"), rb_hash_new());
