Changeset 3582 for libcaca/trunk/ruby
- Timestamp:
- Jul 26, 2009, 9:17:28 PM (13 years ago)
- Location:
- libcaca/trunk/ruby
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/ruby/caca-canvas.c
r3495 r3582 226 226 else 227 227 cmask = NULL; 228 228 229 229 if(caca_blit(_SELF, NUM2INT(x), NUM2INT(y), csrc, cmask)<0) 230 230 rb_raise(rb_eRuntimeError, strerror(errno)); … … 296 296 error = 1; 297 297 } 298 298 else 299 299 error = 1; 300 300 } … … 358 358 error = 1; 359 359 } 360 360 else 361 361 error = 1; 362 362 } … … 584 584 rb_define_method(cCanvas, "set_height", set_canvas_height2, 1); 585 585 rb_define_method(cCanvas, "set_size", set_canvas_size, 2); 586 586 587 587 rb_define_method(cCanvas, "gotoxy", gotoxy, 2); 588 588 rb_define_method(cCanvas, "cursor_x", get_cursor_x, 0); … … 595 595 596 596 rb_define_method(cCanvas, "clear", clear_canvas, 0); 597 597 598 598 rb_define_method(cCanvas, "put_char", put_char, 3); 599 599 rb_define_method(cCanvas, "get_char", get_char, 2); -
libcaca/trunk/ruby/caca-display.c
r3157 r3582 73 73 { 74 74 display = caca_create_display(canvas); 75 76 75 if(display && NIL_P(cv)) 76 { 77 77 cv = canvas_create(caca_get_canvas(display)); 78 78 } 79 79 } 80 80 else -
libcaca/trunk/ruby/caca-dither.c
r2822 r3582 25 25 { 26 26 VALUE obj; 27 obj = Data_Wrap_Struct(klass, 0, dither_free, NULL); 27 obj = Data_Wrap_Struct(klass, 0, dither_free, NULL); 28 28 return obj; 29 29 } … … 103 103 error = 1; 104 104 } 105 105 else 106 106 error = 1; 107 107 } … … 112 112 free(green); 113 113 free(blue); 114 free(alpha); 114 free(alpha); 115 115 rb_raise(rb_eArgError, "Invalid palette"); 116 116 } … … 121 121 free(green); 122 122 free(blue); 123 free(alpha); 123 free(alpha); 124 124 rb_raise(rb_eRuntimeError, strerror(errno)); 125 125 } … … 129 129 free(blue); 130 130 free(alpha); 131 131 132 132 return palette; 133 133 } … … 140 140 141 141 #define set_float(x) \ 142 static VALUE set_##x(VALUE self, VALUE x) \142 static VALUE set_##x(VALUE self, VALUE x) \ 143 143 { \ 144 if(caca_set_dither_##x(_SELF, (float)NUM2DBL(x))<0) \144 if(caca_set_dither_##x(_SELF, (float)NUM2DBL(x))<0) \ 145 145 rb_raise(rb_eRuntimeError, strerror(errno)); \ 146 146 \ … … 148 148 } \ 149 149 \ 150 static VALUE set_##x##2(VALUE self, VALUE x) \150 static VALUE set_##x##2(VALUE self, VALUE x) \ 151 151 { \ 152 152 set_##x(self, x); \ … … 162 162 static VALUE set_dither_##x(VALUE self, VALUE x) \ 163 163 { \ 164 if(caca_set_dither_##x(_SELF, StringValuePtr(x))<0) \164 if(caca_set_dither_##x(_SELF, StringValuePtr(x))<0) \ 165 165 { \ 166 166 rb_raise(rb_eRuntimeError, strerror(errno)); \ -
libcaca/trunk/ruby/caca-event.c
r2019 r3582 32 32 33 33 cEventKey = rb_define_class_under(cEvent, "Key", cEvent); 34 rb_define_const(cEventKey, "TYPE", 34 rb_define_const(cEventKey, "TYPE", 35 35 INT2FIX(CACA_EVENT_KEY_PRESS| 36 36 CACA_EVENT_KEY_RELEASE)); … … 43 43 rb_define_const(cEventKeyRelease, "TYPE", 44 44 INT2FIX(CACA_EVENT_KEY_RELEASE)); 45 45 46 46 cEventMouse = rb_define_class_under(cEvent, "Mouse", cEvent); 47 47 rb_define_const(cEventMouse, "TYPE", -
libcaca/trunk/ruby/caca-font.c
r2822 r3582 25 25 { 26 26 VALUE obj; 27 obj = Data_Wrap_Struct(klass, 0, font_free, NULL); 27 obj = Data_Wrap_Struct(klass, 0, font_free, NULL); 28 28 return obj; 29 29 } … … 46 46 VALUE ary; 47 47 char const* const* list; 48 48 49 49 list = caca_get_font_list(); 50 51 ary = rb_ary_new(); 50 51 ary = rb_ary_new(); 52 52 while (*list != NULL) 53 53 { … … 73 73 VALUE ary; 74 74 uint32_t const *list; 75 75 76 76 list = caca_get_font_blocks(_SELF); 77 78 ary = rb_ary_new(); 77 78 ary = rb_ary_new(); 79 79 while (*list != 0L) 80 80 {
Note: See TracChangeset
for help on using the changeset viewer.