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.
 
 
 
 
 
 

78 lines
2.4 KiB

  1. /*
  2. * libcucul Canvas for ultrafast compositing of Unicode letters
  3. * Copyright (c) 2002-2006 Sam Hocevar <sam@zoy.org>
  4. * All Rights Reserved
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the Do What The Fuck You Want To
  8. * Public License, Version 2, as published by Sam Hocevar. See
  9. * http://sam.zoy.org/wtfpl/COPYING for more details.
  10. */
  11. /** \file cucul_internals.h
  12. * \version \$Id$
  13. * \author Sam Hocevar <sam@zoy.org>
  14. * \brief The \e libcucul private header.
  15. *
  16. * This header contains the private types and functions used by \e libcucul.
  17. */
  18. #ifndef __CUCUL_INTERNALS_H__
  19. #define __CUCUL_INTERNALS_H__
  20. #if defined(HAVE_INTTYPES_H) && !defined(__KERNEL__)
  21. # include <inttypes.h>
  22. #elif !defined(CUSTOM_INTTYPES) && !defined(_DOXYGEN_SKIP_ME)
  23. # define CUSTOM_INTTYPES
  24. typedef unsigned char uint8_t;
  25. typedef unsigned short uint16_t;
  26. typedef unsigned long int uint32_t;
  27. typedef long int intptr_t;
  28. typedef long unsigned int uintptr_t;
  29. #endif
  30. struct cucul_context
  31. {
  32. /* Context size */
  33. unsigned int width, height;
  34. uint32_t *chars;
  35. uint32_t *attr;
  36. char *empty_line, *scratch_line;
  37. uint16_t fgcolor;
  38. uint16_t bgcolor;
  39. unsigned int refcount;
  40. };
  41. /* Bitmap functions */
  42. extern int _cucul_init_dither(void);
  43. extern int _cucul_end_dither(void);
  44. /* Canvas functions */
  45. extern void _cucul_set_size(cucul_t *, unsigned int, unsigned int);
  46. extern void _cucul_putchar32(cucul_t *qq, int x, int y, uint32_t c);
  47. /* Charset functions */
  48. extern unsigned int _cucul_strlen_utf8(char const *);
  49. extern char const *_cucul_skip_utf8(char const *, unsigned int);
  50. extern uint32_t _cucul_utf8_to_utf32(char const *);
  51. extern uint8_t _cucul_utf32_to_cp437(uint32_t);
  52. extern uint32_t _cucul_cp437_to_utf32(uint8_t);
  53. /* Colour functions */
  54. uint8_t _cucul_argb32_to_ansi8(uint32_t);
  55. uint8_t _cucul_argb32_to_ansi4fg(uint32_t);
  56. uint8_t _cucul_argb32_to_ansi4bg(uint32_t);
  57. /* Export functions */
  58. extern void _cucul_get_ansi(cucul_t *, struct cucul_export *);
  59. extern void _cucul_get_html(cucul_t *, struct cucul_export *);
  60. extern void _cucul_get_html3(cucul_t *, struct cucul_export *);
  61. extern void _cucul_get_irc(cucul_t *, struct cucul_export *);
  62. extern void _cucul_get_ps(cucul_t *, struct cucul_export *);
  63. extern void _cucul_get_svg(cucul_t *, struct cucul_export *);
  64. #endif /* __CUCUL_INTERNALS_H__ */