Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

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