Sfoglia il codice sorgente

Fix import/export related stuff I forgot to update in the Ruby and PHP bindings.

tags/v0.99.beta17
Sam Hocevar sam 15 anni fa
parent
commit
06ca07d381
3 ha cambiato i file con 11 aggiunte e 11 eliminazioni
  1. +4
    -4
      caca-php/php_caca.c
  2. +4
    -4
      ruby/ruby-caca.dox
  3. +3
    -3
      ruby/t/tc_canvas.rb

+ 4
- 4
caca-php/php_caca.c Vedi File

@@ -1550,7 +1550,7 @@ PHP_FUNCTION(caca_file_read) {
}
caca_file_read(file, buffer, len);

RETURN_STRINGL(buffer, len, 1cac);
RETURN_STRINGL(buffer, len, 1);
}

PHP_FUNCTION(caca_file_write) {
@@ -1608,7 +1608,7 @@ PHP_FUNCTION(caca_import_string) {
caca_canvas_t *canvas;
ZEND_FETCH_RESOURCE(canvas, caca_canvas_t*, &_zval, -1, PHP_CACA_CANVAS_RES_NAME, le_caca_canvas);

RETURN_LONG(caca_import_memory(canvas, src, src_len, format));
RETURN_LONG(caca_import_canvas_from_memory(canvas, src, src_len, format));
}

PHP_FUNCTION(caca_import_file) {
@@ -1621,7 +1621,7 @@ PHP_FUNCTION(caca_import_file) {
caca_canvas_t *canvas;
ZEND_FETCH_RESOURCE(canvas, caca_canvas_t*, &_zval, -1, PHP_CACA_CANVAS_RES_NAME, le_caca_canvas);

RETURN_LONG(caca_import_file(canvas, filename, format));
RETURN_LONG(caca_import_canvas_from_file(canvas, filename, format));
}

PHP_FUNCTION(caca_get_import_list) {
@@ -1647,7 +1647,7 @@ PHP_FUNCTION(caca_export_string) {

void *buffer;
size_t len = 0;
buffer = caca_export_memory(canvas, type, &len);
buffer = caca_export_canvas_to_memory(canvas, type, &len);
if (!buffer) {
RETURN_FALSE;
}


+ 4
- 4
ruby/ruby-caca.dox Vedi File

@@ -56,11 +56,11 @@ irb(main):012:0>Caca::Canvas.my_instance_methods
"dither_bitmap","draw_box", "draw_circle", "draw_cp437_box", "draw_ellipse",
"draw_line","draw_polyline", "draw_thin_box", "draw_thin_ellipse",
"draw_thin_line","draw_thin_polyline", "draw_thin_triangle",
"draw_triangle","export_memory", "fill_box", "fill_ellipse",
"draw_triangle","export_to_memory", "fill_box", "fill_ellipse",
"fill_triangle","flip", "flop", "frame=", "frame_count", "frame_name",
"frame_name=","free_frame", "get_attr", "get_char", "gotoxy",
"handle_x","handle_y", "height", "height=", "import_file",
"import_memory","invert", "printf", "put_attr", "put_char", "put_str",
"import_from_memory","invert", "printf", "put_attr", "put_char", "put_str",
"rotate_180","rotate_left", "rotate_right", "set_attr",
"set_boundaries","set_color_ansi", "set_color_argb", "set_frame",
"set_frame_name","set_handle", "set_height", "set_size", "set_width",
@@ -122,7 +122,7 @@ irb(main):015:0>Caca::Event::Resize.my_instance_methods
\code
$ruby -rcaca -e 'c=Caca::Canvas.new(6, 3).fill_box(0,0,2,2,"#"[0]);
c2=Caca::Canvas.new(1,1).put_str(0,0,"x"); c.blit(1,1,c2); puts
c.export_memory("irc")'
c.export_to_memory("irc")'
###
#x#
###
@@ -130,7 +130,7 @@ c.export_memory("irc")'

\code
$ruby -e 'puts Caca::Canvas.new(6,3).draw_thin_polyline([[0,0], [0,2],
[5,2],[0,0]]).export_memory("irc")'
[5,2],[0,0]]).export_to_memory("irc")'
-.
| `.
----`-


+ 3
- 3
ruby/t/tc_canvas.rb Vedi File

@@ -26,8 +26,8 @@ class TC_Canvas < Test::Unit::TestCase
assert(@c.width == 100 && @c.height == 100, 'Failed to set size')
end
def test_import
@c.import_memory("foo", "")
assert_equal("foo\r\n", @c.export_memory("irc"), "Import/Export failed")
@c.import_from_memory("foo", "")
assert_equal("foo\r\n", @c.export_to_memory("irc"), "Import/Export failed")
end
def test_cursor
@c.gotoxy(1,1)
@@ -37,7 +37,7 @@ class TC_Canvas < Test::Unit::TestCase
def test_clear
@c.put_char(1, 1, 64)
@c.clear
assert_equal("", @c.export_memory("irc").strip, "Failed to clear canvas")
assert_equal("", @c.export_to_memory("irc").strip, "Failed to clear canvas")
end
def test_char
@c.put_char(1, 1, 42)


Caricamento…
Annulla
Salva