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.
 
 
 
 
 
 

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