Ignore:
Timestamp:
Nov 24, 2006, 6:51:10 AM (13 years ago)
Author:
Sam Hocevar
Message:
  • Added caca_set_cursor(). Not yet functional.
Location:
libcaca/trunk/caca
Files:
11 edited

Legend:

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

    r1386 r1430  
    200200unsigned int caca_get_mouse_y(caca_display_t *);
    201201int caca_set_mouse(caca_display_t *, int);
     202int caca_set_cursor(caca_display_t *, int);
    202203/*  @} */
    203204
  • libcaca/trunk/caca/caca_internals.h

    r1396 r1430  
    114114        int (* get_event) (caca_display_t *, caca_event_t *);
    115115        void (* set_mouse) (caca_display_t *, int);
     116        void (* set_cursor) (caca_display_t *, int);
    116117    } drv;
    117118
  • libcaca/trunk/caca/driver_conio.c

    r1333 r1430  
    173173    dp->drv.get_event = conio_get_event;
    174174    dp->drv.set_mouse = NULL;
     175    dp->drv.set_cursor = NULL;
    175176
    176177    return 0;
  • libcaca/trunk/caca/driver_gl.c

    r1347 r1430  
    591591    dp->drv.get_event = gl_get_event;
    592592    dp->drv.set_mouse = gl_set_mouse;
     593    dp->drv.set_cursor = NULL;
    593594
    594595    return 0;
  • libcaca/trunk/caca/driver_ncurses.c

    r1429 r1430  
    476476    dp->drv.get_event = ncurses_get_event;
    477477    dp->drv.set_mouse = NULL;
     478    dp->drv.set_cursor = NULL;
    478479
    479480    return 0;
  • libcaca/trunk/caca/driver_raw.c

    r1353 r1430  
    106106    dp->drv.get_event = raw_get_event;
    107107    dp->drv.set_mouse = NULL;
     108    dp->drv.set_cursor = NULL;
    108109
    109110    return 0;
  • libcaca/trunk/caca/driver_slang.c

    r1429 r1430  
    520520    dp->drv.get_event = slang_get_event;
    521521    dp->drv.set_mouse = NULL;
     522    dp->drv.set_cursor = NULL;
    522523
    523524    return 0;
  • libcaca/trunk/caca/driver_vga.c

    r1333 r1430  
    167167    dp->drv.get_event = vga_get_event;
    168168    dp->drv.set_mouse = NULL;
     169    dp->drv.set_cursor = NULL;
    169170
    170171    return 0;
  • libcaca/trunk/caca/driver_win32.c

    r1332 r1430  
    352352    dp->drv.get_event = win32_get_event;
    353353    dp->drv.set_mouse = NULL;
     354    dp->drv.set_cursor = NULL;
    354355
    355356    return 0;
  • libcaca/trunk/caca/driver_x11.c

    r1264 r1430  
    644644    dp->drv.get_event = x11_get_event;
    645645    dp->drv.set_mouse = x11_set_mouse;
     646    dp->drv.set_cursor = NULL;
    646647
    647648    return 0;
  • libcaca/trunk/caca/graphics.c

    r1392 r1430  
    178178}
    179179
     180/** \brief Show or hide the cursor.
     181 *
     182 *  Show or hide the cursor, for devices that support such a feature.
     183 *
     184 *  If an error occurs, -1 is returned and \b errno is set accordingly:
     185 *  - \c ENOSYS Display driver does not support showing the cursor.
     186 *
     187 *  \param dp The libcaca display context.
     188 *  \param flag 0 hides the cursor, 1 shows the system's default cursor
     189 *              (usually a white rectangle). Other values are reserved for
     190 *              future use.
     191 *  \return 0 upon success, -1 if an error occurred.
     192 */
     193int caca_set_cursor(caca_display_t *dp, int flag)
     194{
     195    if(!dp->drv.set_cursor)
     196    {
     197        seterrno(ENOSYS);
     198        return -1;
     199    }
     200
     201    dp->drv.set_cursor(dp, flag);
     202    return 0;
     203}
     204
    180205/** \brief Show or hide the mouse pointer.
    181206 *
Note: See TracChangeset for help on using the changeset viewer.