Changeset 686


Ignore:
Timestamp:
Mar 24, 2006, 4:00:47 PM (14 years ago)
Author:
Jean-Yves Lamoureux
Message:
  • Added caca_show/hide_cursor, and corresponding GL binding
Location:
libcaca/trunk/caca
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/caca.h

    r685 r686  
    245245unsigned int caca_get_mouse_x(caca_t *kk);
    246246unsigned int caca_get_mouse_y(caca_t *kk);
     247void caca_hide_cursor(caca_t *kk);
     248void caca_show_cursor(caca_t *kk);
    247249/*  @} */
    248250
  • libcaca/trunk/caca/caca_internals.h

    r684 r686  
    118118        void (* handle_resize) (caca_t *);
    119119        int (* get_event) (caca_t *, struct caca_event *);
     120        void (* show_cursor) (caca_t *);
     121        void (* hide_cursor) (caca_t *);
    120122    } drv;
    121123
  • libcaca/trunk/caca/driver_conio.c

    r684 r686  
    164164    kk->drv.handle_resize = conio_handle_resize;
    165165    kk->drv.get_event = conio_get_event;
     166    kk->drv.show_cursor = NULL;
     167    kk->drv.hide_cursor = NULL;
    166168
    167169    return 0;
  • libcaca/trunk/caca/driver_gl.c

    r684 r686  
    387387}
    388388
     389
     390static void gl_show_cursor(caca_t *kk)
     391{
     392    glutSetCursor(GLUT_CURSOR_RIGHT_ARROW);
     393}
     394
     395static void gl_hide_cursor(caca_t *kk)
     396{
     397    glutSetCursor(GLUT_CURSOR_NONE);
     398}
     399
     400
     401
    389402/*
    390403 * XXX: following functions are local
     
    465478    kk->drv.handle_resize = gl_handle_resize;
    466479    kk->drv.get_event = gl_get_event;
    467 
     480    kk->drv.show_cursor = gl_show_cursor;
     481    kk->drv.hide_cursor = gl_hide_cursor;
    468482    return 0;
    469483}
  • libcaca/trunk/caca/driver_ncurses.c

    r684 r686  
    543543    kk->drv.handle_resize = ncurses_handle_resize;
    544544    kk->drv.get_event = ncurses_get_event;
    545 
     545    kk->drv.show_cursor = NULL;
     546    kk->drv.hide_cursor = NULL;
    546547    return 0;
    547548}
  • libcaca/trunk/caca/driver_network.c

    r684 r686  
    563563    kk->drv.handle_resize = network_handle_resize;
    564564    kk->drv.get_event = network_get_event;
     565    kk->drv.show_cursor = NULL;
     566    kk->drv.hide_cursor = NULL;
    565567
    566568    return 0;
  • libcaca/trunk/caca/driver_slang.c

    r684 r686  
    481481    kk->drv.handle_resize = slang_handle_resize;
    482482    kk->drv.get_event = slang_get_event;
     483    kk->drv.show_cursor = NULL;
     484    kk->drv.hide_cursor = NULL;
    483485
    484486    return 0;
  • libcaca/trunk/caca/driver_vga.c

    r684 r686  
    158158    kk->drv.handle_resize = vga_handle_resize;
    159159    kk->drv.get_event = vga_get_event;
     160    kk->drv.show_cursor = NULL;
     161    kk->drv.hide_cursor = NULL;
    160162
    161163    return 0;
  • libcaca/trunk/caca/driver_win32.c

    r684 r686  
    346346    kk->drv.handle_resize = win32_handle_resize;
    347347    kk->drv.get_event = win32_get_event;
     348    kk->drv.show_cursor = NULL;
     349    kk->drv.hide_cursor = NULL;
    348350
    349351    return 0;
  • libcaca/trunk/caca/graphics.c

    r672 r686  
    144144}
    145145
     146/** \brief Show cursor on capable drivers
     147 *
     148 *  This function shows the cursor on drivers permitting it.
     149 *
     150 */
     151void caca_show_cursor(caca_t *kk)
     152{
     153    if(kk->drv.show_cursor)
     154        kk->drv.show_cursor(kk);
     155}
     156
     157/** \brief Hide cursor on capable drivers
     158 *
     159 *  This function hides the cursor on drivers permitting it.
     160 *
     161 */
     162void caca_hide_cursor(caca_t *kk)
     163{
     164    if(kk->drv.show_cursor)
     165        kk->drv.show_cursor(kk);
     166}
     167
     168
    146169/*
    147170 * XXX: following functions are local
Note: See TracChangeset for help on using the changeset viewer.