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.

cucul_internals.h 1.8 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. #include "stubs.h"
  17. typedef struct cucul_figfont cucul_figfont_t;
  18. struct cucul_frame
  19. {
  20. /* Frame size */
  21. 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. /* Frame name */
  30. char *name;
  31. };
  32. struct cucul_canvas
  33. {
  34. /* XXX: look at cucul_set_canvas_boundaries() before adding anything
  35. * to this structure. The function is quite hacky. */
  36. /* Frame information */
  37. int frame, framecount;
  38. struct cucul_frame *frames;
  39. /* Canvas management */
  40. int refcount;
  41. int autoinc;
  42. int (*resize_callback)(void *);
  43. void *resize_data;
  44. /* Shortcut to the active frame information */
  45. int width, height;
  46. uint32_t *chars;
  47. uint32_t *attrs;
  48. uint32_t curattr;
  49. /* FIGfont management */
  50. cucul_figfont_t *ff;
  51. };
  52. struct cucul_buffer
  53. {
  54. size_t size;
  55. char *data;
  56. int user_data;
  57. };
  58. /* Colour functions */
  59. extern uint32_t _cucul_attr_to_rgb24fg(uint32_t);
  60. extern uint32_t _cucul_attr_to_rgb24bg(uint32_t);
  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__ */