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.
 
 
 
 
 
 

81 lines
2.0 KiB

  1. /*
  2. * libee ASCII-Art library
  3. * Copyright (c) 2002, 2003 Sam Hocevar <sam@zoy.org>
  4. * All Rights Reserved
  5. *
  6. * $Id$
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. */
  22. /*
  23. * Graphics primitives
  24. */
  25. #ifdef USE_SLANG
  26. # include <slang.h>
  27. # define ee_color(x) SLsmg_set_color(x)
  28. # define ee_goto(x,y) SLsmg_gotorc(y,x)
  29. # define ee_putchar(x) SLsmg_write_char(x)
  30. # define ee_putstr(x) SLsmg_write_string(x)
  31. #elif USE_NCURSES
  32. # define box box_divert
  33. # include <curses.h>
  34. # undef box
  35. # define ee_color(x) attrset(COLOR_PAIR(x))
  36. # define ee_goto(x,y) move(y,x)
  37. # define ee_putchar(x) addch(x)
  38. # define ee_putstr(x) addstr(x)
  39. #else
  40. # define ee_color(x) (void)(x)
  41. # define ee_goto(x,y) do{ (void)(x); (void)(y); } while(0)
  42. # define ee_putchar(x) (void)(x)
  43. # define ee_putstr(x) (void)(x)
  44. #endif
  45. #define ee_putcharTO(x,y,c) do{ ee_goto(x,y); ee_putchar(c); }while(0)
  46. /*
  47. * Colours
  48. */
  49. #define EE_BLACK 1
  50. #define EE_GREEN 2
  51. #define EE_YELLOW 3
  52. #define EE_WHITE 4
  53. #define EE_RED 5
  54. #define EE_GRAY 6
  55. #define EE_LIGHTGRAY 7
  56. #define EE_BLUE 8
  57. #define EE_CYAN 9
  58. #define EE_MAGENTA 10
  59. /*
  60. * Prototypes
  61. */
  62. int ee_init(void);
  63. void ee_set_delay(int);
  64. int ee_get_width(void);
  65. int ee_get_height(void);
  66. void ee_clear(void);
  67. void ee_refresh(void);
  68. void ee_end(void);
  69. char ee_get_key(void);
  70. void ee_draw_line(int, int, int, int, char);
  71. int ee_rand(int, int);
  72. int ee_sqrt(int);