Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 *,
  54. unsigned int, unsigned int);
  55. /* Colour functions */
  56. extern uint16_t _cucul_attr_to_rgb12fg(uint32_t);
  57. extern uint16_t _cucul_attr_to_rgb12bg(uint32_t);
  58. extern uint32_t _cucul_attr_to_rgb24fg(uint32_t);
  59. extern uint32_t _cucul_attr_to_rgb24bg(uint32_t);
  60. extern void _cucul_attr_to_argb4(uint32_t, uint8_t[8]);
  61. /* Frames functions */
  62. extern void _cucul_save_frame_info(cucul_canvas_t *);
  63. extern void _cucul_load_frame_info(cucul_canvas_t *);
  64. #endif /* __CUCUL_INTERNALS_H__ */