Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

78 wiersze
1.9 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. 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. #ifndef __CUCUL_INTERNALS_H__
  15. #define __CUCUL_INTERNALS_H__
  16. #if defined(HAVE_INTTYPES_H) && !defined(__KERNEL__)
  17. # include <inttypes.h>
  18. #endif
  19. struct cucul_frame
  20. {
  21. /* Frame size */
  22. unsigned int width, height;
  23. /* Cell information */
  24. uint32_t *chars;
  25. uint32_t *attrs;
  26. /* Painting context */
  27. int x, y;
  28. int handlex, handley;
  29. uint32_t curattr;
  30. /* Frame name */
  31. char *name;
  32. };
  33. struct cucul_canvas
  34. {
  35. /* Frame information */
  36. unsigned int frame, framecount;
  37. struct cucul_frame *frames;
  38. unsigned int refcount;
  39. unsigned int autoinc;
  40. /* Shortcut to the active frame information */
  41. unsigned int width, height;
  42. uint32_t *chars;
  43. uint32_t *attrs;
  44. uint32_t curattr;
  45. };
  46. struct cucul_buffer
  47. {
  48. unsigned long int size;
  49. char *data;
  50. int user_data;
  51. };
  52. /* Canvas functions */
  53. extern int _cucul_set_canvas_size(cucul_canvas_t *, unsigned int, unsigned int);
  54. /* Colour functions */
  55. extern uint16_t _cucul_attr_to_rgb12fg(uint32_t);
  56. extern uint16_t _cucul_attr_to_rgb12bg(uint32_t);
  57. extern uint32_t _cucul_attr_to_rgb24fg(uint32_t);
  58. extern uint32_t _cucul_attr_to_rgb24bg(uint32_t);
  59. extern void _cucul_attr_to_argb4(uint32_t, uint8_t[8]);
  60. /* Frames functions */
  61. extern void _cucul_save_frame_info(cucul_canvas_t *);
  62. extern void _cucul_load_frame_info(cucul_canvas_t *);
  63. #endif /* __CUCUL_INTERNALS_H__ */