You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

91 regels
1.9 KiB

  1. /*
  2. * libcaca Colour ASCII-Art library
  3. * Copyright (c) 2002-2012 Sam Hocevar <sam@hocevar.net>
  4. * All Rights Reserved
  5. *
  6. * This library is free software. It comes without any warranty, to
  7. * the extent permitted by applicable law. You can redistribute it
  8. * and/or modify it under the terms of the Do What the Fuck You Want
  9. * to Public License, Version 2, as published by Sam Hocevar. See
  10. * http://www.wtfpl.net/ for more details.
  11. */
  12. /*
  13. * This file contains a null libcaca input and output driver
  14. */
  15. #include "config.h"
  16. #if !defined(__KERNEL__)
  17. #include <stdio.h>
  18. #include "caca.h"
  19. #include "caca_internals.h"
  20. static int null_init_graphics(caca_display_t *dp)
  21. {
  22. return 0;
  23. }
  24. static int null_end_graphics(caca_display_t *dp)
  25. {
  26. return 0;
  27. }
  28. static int null_set_display_title(caca_display_t *dp, char const *title)
  29. {
  30. return -1;
  31. }
  32. static int null_get_display_width(caca_display_t const *dp)
  33. {
  34. return 0;
  35. }
  36. static int null_get_display_height(caca_display_t const *dp)
  37. {
  38. return 0;
  39. }
  40. static void null_display(caca_display_t *dp)
  41. {
  42. ;
  43. }
  44. static void null_handle_resize(caca_display_t *dp)
  45. {
  46. ;
  47. }
  48. static int null_get_event(caca_display_t *dp, caca_privevent_t *ev)
  49. {
  50. ev->type = CACA_EVENT_NONE;
  51. return 0;
  52. }
  53. /*
  54. * Driver initialisation
  55. */
  56. int null_install(caca_display_t *dp)
  57. {
  58. dp->drv.id = CACA_DRIVER_NULL;
  59. dp->drv.driver = "null";
  60. dp->drv.init_graphics = null_init_graphics;
  61. dp->drv.end_graphics = null_end_graphics;
  62. dp->drv.set_display_title = null_set_display_title;
  63. dp->drv.get_display_width = null_get_display_width;
  64. dp->drv.get_display_height = null_get_display_height;
  65. dp->drv.display = null_display;
  66. dp->drv.handle_resize = null_handle_resize;
  67. dp->drv.get_event = null_get_event;
  68. dp->drv.set_mouse = NULL;
  69. dp->drv.set_cursor = NULL;
  70. return 0;
  71. }
  72. #endif /* !__KERNEL__ */