Browse Source

* Added caca_set_cursor(). Not yet functional.

tags/v0.99.beta14
Sam Hocevar sam 18 years ago
parent
commit
e1a42d9b42
11 changed files with 35 additions and 0 deletions
  1. +1
    -0
      caca/caca.h
  2. +1
    -0
      caca/caca_internals.h
  3. +1
    -0
      caca/driver_conio.c
  4. +1
    -0
      caca/driver_gl.c
  5. +1
    -0
      caca/driver_ncurses.c
  6. +1
    -0
      caca/driver_raw.c
  7. +1
    -0
      caca/driver_slang.c
  8. +1
    -0
      caca/driver_vga.c
  9. +1
    -0
      caca/driver_win32.c
  10. +1
    -0
      caca/driver_x11.c
  11. +25
    -0
      caca/graphics.c

+ 1
- 0
caca/caca.h View File

@@ -199,6 +199,7 @@ int caca_get_event(caca_display_t *, unsigned int, caca_event_t *, int);
unsigned int caca_get_mouse_x(caca_display_t *);
unsigned int caca_get_mouse_y(caca_display_t *);
int caca_set_mouse(caca_display_t *, int);
int caca_set_cursor(caca_display_t *, int);
/* @} */

#ifdef __cplusplus


+ 1
- 0
caca/caca_internals.h View File

@@ -113,6 +113,7 @@ struct caca_display
void (* handle_resize) (caca_display_t *);
int (* get_event) (caca_display_t *, caca_event_t *);
void (* set_mouse) (caca_display_t *, int);
void (* set_cursor) (caca_display_t *, int);
} drv;

/* Mouse position */


+ 1
- 0
caca/driver_conio.c View File

@@ -172,6 +172,7 @@ int conio_install(caca_display_t *dp)
dp->drv.handle_resize = conio_handle_resize;
dp->drv.get_event = conio_get_event;
dp->drv.set_mouse = NULL;
dp->drv.set_cursor = NULL;

return 0;
}


+ 1
- 0
caca/driver_gl.c View File

@@ -590,6 +590,7 @@ int gl_install(caca_display_t *dp)
dp->drv.handle_resize = gl_handle_resize;
dp->drv.get_event = gl_get_event;
dp->drv.set_mouse = gl_set_mouse;
dp->drv.set_cursor = NULL;

return 0;
}


+ 1
- 0
caca/driver_ncurses.c View File

@@ -475,6 +475,7 @@ int ncurses_install(caca_display_t *dp)
dp->drv.handle_resize = ncurses_handle_resize;
dp->drv.get_event = ncurses_get_event;
dp->drv.set_mouse = NULL;
dp->drv.set_cursor = NULL;

return 0;
}


+ 1
- 0
caca/driver_raw.c View File

@@ -105,6 +105,7 @@ int raw_install(caca_display_t *dp)
dp->drv.handle_resize = raw_handle_resize;
dp->drv.get_event = raw_get_event;
dp->drv.set_mouse = NULL;
dp->drv.set_cursor = NULL;

return 0;
}


+ 1
- 0
caca/driver_slang.c View File

@@ -519,6 +519,7 @@ int slang_install(caca_display_t *dp)
dp->drv.handle_resize = slang_handle_resize;
dp->drv.get_event = slang_get_event;
dp->drv.set_mouse = NULL;
dp->drv.set_cursor = NULL;

return 0;
}


+ 1
- 0
caca/driver_vga.c View File

@@ -166,6 +166,7 @@ int vga_install(caca_display_t *dp)
dp->drv.handle_resize = vga_handle_resize;
dp->drv.get_event = vga_get_event;
dp->drv.set_mouse = NULL;
dp->drv.set_cursor = NULL;

return 0;
}


+ 1
- 0
caca/driver_win32.c View File

@@ -351,6 +351,7 @@ int win32_install(caca_display_t *dp)
dp->drv.handle_resize = win32_handle_resize;
dp->drv.get_event = win32_get_event;
dp->drv.set_mouse = NULL;
dp->drv.set_cursor = NULL;

return 0;
}


+ 1
- 0
caca/driver_x11.c View File

@@ -643,6 +643,7 @@ int x11_install(caca_display_t *dp)
dp->drv.handle_resize = x11_handle_resize;
dp->drv.get_event = x11_get_event;
dp->drv.set_mouse = x11_set_mouse;
dp->drv.set_cursor = NULL;

return 0;
}


+ 25
- 0
caca/graphics.c View File

@@ -177,6 +177,31 @@ int caca_refresh_display(caca_display_t *dp)
return 0;
}

/** \brief Show or hide the cursor.
*
* Show or hide the cursor, for devices that support such a feature.
*
* If an error occurs, -1 is returned and \b errno is set accordingly:
* - \c ENOSYS Display driver does not support showing the cursor.
*
* \param dp The libcaca display context.
* \param flag 0 hides the cursor, 1 shows the system's default cursor
* (usually a white rectangle). Other values are reserved for
* future use.
* \return 0 upon success, -1 if an error occurred.
*/
int caca_set_cursor(caca_display_t *dp, int flag)
{
if(!dp->drv.set_cursor)
{
seterrno(ENOSYS);
return -1;
}

dp->drv.set_cursor(dp, flag);
return 0;
}

/** \brief Show or hide the mouse pointer.
*
* Show or hide the mouse pointer, for devices that support such a feature.


Loading…
Cancel
Save