Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

null.c 1.9 KiB

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