- Timestamp:
- Jul 27, 2009, 1:26:15 AM (13 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca-php/caca.php
r3295 r3587 121 121 } 122 122 123 function getCursorX() {124 return caca_ get_cursor_x($this->cv);125 } 126 127 function getCursorY() {128 return caca_ get_cursor_y($this->cv);123 function whereX() { 124 return caca_wherex($this->cv); 125 } 126 127 function whereY() { 128 return caca_wherey($this->cv); 129 129 } 130 130 -
libcaca/trunk/caca-php/php_caca.c
r3582 r3587 32 32 PHP_FE(caca_get_version, NULL) 33 33 PHP_FE(caca_gotoxy, NULL) 34 PHP_FE(caca_ get_cursor_x, NULL)35 PHP_FE(caca_ get_cursor_y, NULL)34 PHP_FE(caca_wherex, NULL) 35 PHP_FE(caca_wherey, NULL) 36 36 PHP_FE(caca_put_char, NULL) 37 37 PHP_FE(caca_get_char, NULL) … … 493 493 } 494 494 495 PHP_FUNCTION(caca_ get_cursor_x) {495 PHP_FUNCTION(caca_wherex) { 496 496 caca_canvas_t *canvas; 497 497 FETCH_CANVAS(canvas); 498 RETURN_LONG(caca_ get_cursor_x(canvas));499 } 500 501 PHP_FUNCTION(caca_ get_cursor_y) {498 RETURN_LONG(caca_wherex(canvas)); 499 } 500 501 PHP_FUNCTION(caca_wherey) { 502 502 caca_canvas_t *canvas; 503 503 FETCH_CANVAS(canvas); 504 RETURN_LONG(caca_ get_cursor_y(canvas));504 RETURN_LONG(caca_wherey(canvas)); 505 505 } 506 506 -
libcaca/trunk/caca-php/php_caca.h
r3149 r3587 45 45 PHP_FUNCTION(caca_get_version); 46 46 PHP_FUNCTION(caca_gotoxy); 47 PHP_FUNCTION(caca_ get_cursor_x);48 PHP_FUNCTION(caca_ get_cursor_y);47 PHP_FUNCTION(caca_wherex); 48 PHP_FUNCTION(caca_wherey); 49 49 PHP_FUNCTION(caca_put_char); 50 50 PHP_FUNCTION(caca_get_char); -
libcaca/trunk/caca-sharp/Canvas.cs
r2867 r3587 2 2 * libcaca .NET bindings for libcaca 3 3 * Copyright (c) 2006 Jean-Yves Lamoureux <jylam@lnxscene.org> 4 * 2007 Sam Hocevar <sam@zoy.org>4 * 2007-2009 Sam Hocevar <sam@hocevar.net> 5 5 * All Rights Reserved 6 6 * … … 116 116 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), 117 117 SuppressUnmanagedCodeSecurity] 118 private static extern int caca_ get_cursor_x(IntPtr cv);119 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), 120 SuppressUnmanagedCodeSecurity] 121 private static extern int caca_ get_cursor_y(IntPtr cv);118 private static extern int caca_wherex(IntPtr cv); 119 [DllImport("libcaca.dll", CallingConvention=CallingConvention.Cdecl), 120 SuppressUnmanagedCodeSecurity] 121 private static extern int caca_wherey(IntPtr cv); 122 122 public Point Cursor 123 123 { 124 get { return new Point(caca_get_cursor_x(_c_cv), 125 caca_get_cursor_y(_c_cv)); } 124 get { return new Point(caca_wherex(_c_cv), caca_wherey(_c_cv)); } 126 125 set { caca_gotoxy(_c_cv, value.X, value.Y); } 127 126 } -
libcaca/trunk/caca/caca.h
r3586 r3587 226 226 #define CACA_MAGIC_FULLWIDTH 0x000ffffe /**< Used to indicate that the previous character was a fullwidth glyph. */ 227 227 __extern int caca_gotoxy(caca_canvas_t *, int, int); 228 __extern int caca_ get_cursor_x(caca_canvas_t const *);229 __extern int caca_ get_cursor_y(caca_canvas_t const *);228 __extern int caca_wherex(caca_canvas_t const *); 229 __extern int caca_wherey(caca_canvas_t const *); 230 230 __extern int caca_put_char(caca_canvas_t *, int, int, uint32_t); 231 231 __extern uint32_t caca_get_char(caca_canvas_t const *, int, int); … … 507 507 508 508 509 /* Aliases from old libc ucul functions */509 /* Aliases from old libcaca and libcucul functions */ 510 510 __extern int cucul_putchar(caca_canvas_t *, int, int, 511 511 unsigned long int) CACA_DEPRECATED; … … 601 601 602 602 # if !defined __LIBCACA__ 603 # define caca_get_cursor_x caca_wherex 604 # define caca_get_cursor_y caca_wherey 603 605 # define cucul_draw_triangle caca_draw_triangle 604 606 # define cucul_draw_thin_triangle caca_draw_thin_triangle … … 612 614 # define cucul_free_font caca_free_font 613 615 # define cucul_gotoxy caca_gotoxy 614 # define cucul_get_cursor_x caca_ get_cursor_x615 # define cucul_get_cursor_y caca_ get_cursor_y616 # define cucul_get_cursor_x caca_wherex 617 # define cucul_get_cursor_y caca_wherey 616 618 # define cucul_put_char caca_put_char 617 619 # define cucul_get_char caca_get_char -
libcaca/trunk/caca/driver/ncurses.c
r3578 r3587 376 376 } 377 377 378 x = caca_ get_cursor_x(dp->cv);379 y = caca_ get_cursor_y(dp->cv);378 x = caca_wherex(dp->cv); 379 y = caca_wherey(dp->cv); 380 380 move(y, x); 381 381 -
libcaca/trunk/caca/driver/slang.c
r3569 r3587 288 288 } 289 289 } 290 SLsmg_gotorc(caca_ get_cursor_y(dp->cv), caca_get_cursor_x(dp->cv));290 SLsmg_gotorc(caca_wherey(dp->cv), caca_wherex(dp->cv)); 291 291 SLsmg_refresh(); 292 292 } -
libcaca/trunk/caca/driver/x11.c
r3581 r3587 377 377 XSetForeground(dp->drv.p->dpy, dp->drv.p->gc, 378 378 dp->drv.p->colors[0xfff]); 379 x = caca_ get_cursor_x(dp->cv);380 y = caca_ get_cursor_y(dp->cv);379 x = caca_wherex(dp->cv); 380 y = caca_wherey(dp->cv); 381 381 XFillRectangle(dp->drv.p->dpy, dp->drv.p->pixmap, dp->drv.p->gc, 382 382 x * dp->drv.p->font_width, y * dp->drv.p->font_height, -
libcaca/trunk/caca/string.c
r3586 r3587 69 69 * \return The cursor's X coordinate. 70 70 */ 71 int caca_ get_cursor_x(caca_canvas_t const *cv)71 int caca_wherex(caca_canvas_t const *cv) 72 72 { 73 73 return cv->frames[cv->frame].x; … … 83 83 * \return The cursor's Y coordinate. 84 84 */ 85 int caca_ get_cursor_y(caca_canvas_t const *cv)85 int caca_wherey(caca_canvas_t const *cv) 86 86 { 87 87 return cv->frames[cv->frame].y; … … 583 583 584 584 int cucul_gotoxy(cucul_canvas_t *, int, int) CACA_ALIAS(caca_gotoxy); 585 int cucul_get_cursor_x(cucul_canvas_t const *) CACA_ALIAS(caca_get_cursor_x); 586 int cucul_get_cursor_y(cucul_canvas_t const *) CACA_ALIAS(caca_get_cursor_y); 585 int cucul_get_cursor_x(cucul_canvas_t const *) CACA_ALIAS(caca_wherex); 586 int cucul_get_cursor_y(cucul_canvas_t const *) CACA_ALIAS(caca_wherey); 587 int caca_get_cursor_x(caca_canvas_t const *) CACA_ALIAS(caca_wherex); 588 int caca_get_cursor_y(caca_canvas_t const *) CACA_ALIAS(caca_wherey); 587 589 int cucul_put_char(cucul_canvas_t *, int, int, uint32_t) 588 590 CACA_ALIAS(caca_put_char); -
libcaca/trunk/ruby/caca-canvas.c
r3582 r3587 110 110 } 111 111 112 get_int(cursor_x) 113 get_int(cursor_y) 112 static VALUE wherex(VALUE self) 113 { 114 return INT2NUM(caca_wherex(_SELF)); 115 } 116 117 static VALUE wherey(VALUE self) 118 { 119 return INT2NUM(caca_wherey(_SELF)); 120 } 114 121 115 122 simple_func(clear_canvas) … … 586 593 587 594 rb_define_method(cCanvas, "gotoxy", gotoxy, 2); 588 rb_define_method(cCanvas, " cursor_x", get_cursor_x, 0);589 rb_define_method(cCanvas, " cursor_y", get_cursor_y, 0);595 rb_define_method(cCanvas, "wherex", wherex, 0); 596 rb_define_method(cCanvas, "wherey", wherey, 0); 590 597 rb_define_method(cCanvas, "handle_x", get_canvas_handle_x, 0); 591 598 rb_define_method(cCanvas, "handle_y", get_canvas_handle_y, 0); -
libcaca/trunk/ruby/ruby-caca.dox
r3553 r3587 38 38 irb(main):009:0>Caca.constants 39 39 =>["BROWN", "BOLD", "GREEN", "LIGHTMAGENTA", "LIGHTBLUE", "BLINK", 40 "MAGENTA", "DEFAULT", "TRANSPARENT", "BLUE", "LIGHTRED", "DARKGRAY",41 "UNDERLINE", "RED", "WHITE", "BLACK", "LIGHTCYAN", "LIGHTGRAY",42 "ITALICS", "CYAN", "YELLOW", "LIGHTGREEN", "Canvas", "Dither", "Font"]40 "MAGENTA", "DEFAULT", "TRANSPARENT", "BLUE", "LIGHTRED", "DARKGRAY", 41 "UNDERLINE", "RED", "WHITE", "BLACK", "LIGHTCYAN", "LIGHTGRAY", 42 "ITALICS", "CYAN", "YELLOW", "LIGHTGREEN", "Canvas", "Dither", "Font"] 43 43 \endcode 44 44 … … 55 55 \code 56 56 irb(main):012:0>Caca::Canvas.my_instance_methods 57 =>["attr=", "blit", "clear", "create_frame", "cursor_x", "cursor_y",58 "dither_bitmap", "draw_box", "draw_circle", "draw_cp437_box", "draw_ellipse",59 "draw_line", "draw_polyline", "draw_thin_box", "draw_thin_ellipse",60 "draw_thin_line", "draw_thin_polyline", "draw_thin_triangle",61 "draw_triangle", "export_to_memory", "fill_box", "fill_ellipse",62 "fill_triangle", "flip", "flop", "frame=", "frame_count", "frame_name",63 "frame_name=", "free_frame", "get_attr", "get_char", "gotoxy",64 "handle_x", "handle_y", "height", "height=", "import_file",65 "import_from_memory", "invert", "printf", "put_attr", "put_char", "put_str",66 "rotate_180", "rotate_left", "rotate_right", "set_attr",67 "set_boundaries", "set_color_ansi", "set_color_argb", "set_frame",68 "set_frame_name", "set_handle", "set_height", "set_size", "set_width",69 "stretch_left", "stretch_right", "width", "width="]57 =>["attr=", "blit", "clear", "create_frame", 58 "dither_bitmap", "draw_box", "draw_circle", "draw_cp437_box", "draw_ellipse", 59 "draw_line", "draw_polyline", "draw_thin_box", "draw_thin_ellipse", 60 "draw_thin_line", "draw_thin_polyline", "draw_thin_triangle", 61 "draw_triangle", "export_to_memory", "fill_box", "fill_ellipse", 62 "fill_triangle", "flip", "flop", "frame=", "frame_count", "frame_name", 63 "frame_name=", "free_frame", "get_attr", "get_char", "gotoxy", 64 "handle_x", "handle_y", "height", "height=", "import_file", 65 "import_from_memory", "invert", "printf", "put_attr", "put_char", "put_str", 66 "rotate_180", "rotate_left", "rotate_right", "set_attr", 67 "set_boundaries", "set_color_ansi", "set_color_argb", "set_frame", 68 "set_frame_name", "set_handle", "set_height", "set_size", "set_width", 69 "stretch_left", "stretch_right", "wherex", "wherey", "width", "width="] 70 70 \endcode 71 71 … … 83 83 irb(main):015:0>Caca::Dither.my_instance_methods 84 84 =>["algorithm=", "algorithm_list", "antialias=", "antialias_list", 85 "brightness=", "charset=", "charset_list", "color=", "color_list",86 "contrast=", "gamma=", "palette=", "set_algorithm", "set_antialias",87 "set_brightness", "set_charset", "set_color", "set_contrast",88 "set_gamma", "set_palette"]85 "brightness=", "charset=", "charset_list", "color=", "color_list", 86 "contrast=", "gamma=", "palette=", "set_algorithm", "set_antialias", 87 "set_brightness", "set_charset", "set_color", "set_contrast", 88 "set_gamma", "set_palette"] 89 89 \endcode 90 90 … … 92 92 irb(main):010:0>Caca::Display.my_instance_methods 93 93 =>["canvas", "get_event", "height", "mouse=", "mouse_x", "mouse_y", "refresh", 94 "set_mouse", "set_time", "set_title", "time", "time=", "title=", "width"]94 "set_mouse", "set_time", "set_title", "time", "time=", "title=", "width"] 95 95 \endcode 96 96 … … 141 141 \code 142 142 $ruby -rcaca -e 'p Caca::Canvas.export_list' 143 [["caca", "native libcaca format"], ["ansi", "ANSI"], ["utf8", "UTF-8143 [["caca", "native libcaca format"], ["ansi", "ANSI"], ["utf8", "UTF-8 144 144 withANSI escape codes"], ["utf8cr", "UTF-8 with ANSI escape codes and 145 145 MS-DOS\\r"], ["html", "HTML"], ["html3", "backwards-compatible HTML"], 146 ["irc", "IRC with mIRC colours"], ["ps", "PostScript document"], ["svg",146 ["irc", "IRC with mIRC colours"], ["ps", "PostScript document"], ["svg", 147 147 "SVGvector image"], ["tga", "TGA image"]] 148 148 \endcode -
libcaca/trunk/ruby/t/tc_canvas.rb
r3511 r3587 32 32 def test_cursor 33 33 @c.gotoxy(1,1) 34 assert_equal(1, @c. cursor_x)35 assert_equal(1, @c. cursor_y)34 assert_equal(1, @c.wherex) 35 assert_equal(1, @c.wherey) 36 36 end 37 37 def test_clear
Note: See TracChangeset
for help on using the changeset viewer.