選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

cucul_internals.h 1.6 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. #endif /* __CUCUL_INTERNALS_H__ */