Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

cucul_internals.h 2.1 KiB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. typedef struct cucul_figfont cucul_figfont_t;
  20. struct cucul_frame
  21. {
  22. /* Frame size */
  23. unsigned int width, height;
  24. /* Cell information */
  25. uint32_t *chars;
  26. uint32_t *attrs;
  27. /* Painting context */
  28. int x, y;
  29. int handlex, handley;
  30. uint32_t curattr;
  31. /* Frame name */
  32. char *name;
  33. };
  34. struct cucul_canvas
  35. {
  36. /* XXX: look at cucul_set_canvas_boundaries() before adding anything
  37. * to this structure. The function is quite hacky. */
  38. /* Frame information */
  39. unsigned int frame, framecount;
  40. struct cucul_frame *frames;
  41. /* Canvas management */
  42. unsigned int refcount;
  43. unsigned int autoinc;
  44. int (*resize_callback)(void *);
  45. void *resize_data;
  46. /* Shortcut to the active frame information */
  47. unsigned int width, height;
  48. uint32_t *chars;
  49. uint32_t *attrs;
  50. uint32_t curattr;
  51. /* FIGfont management */
  52. cucul_figfont_t *ff;
  53. };
  54. struct cucul_buffer
  55. {
  56. unsigned long int size;
  57. char *data;
  58. int user_data;
  59. };
  60. /* Colour functions */
  61. extern uint32_t _cucul_attr_to_rgb24fg(uint32_t);
  62. extern uint32_t _cucul_attr_to_rgb24bg(uint32_t);
  63. /* Frames functions */
  64. extern void _cucul_save_frame_info(cucul_canvas_t *);
  65. extern void _cucul_load_frame_info(cucul_canvas_t *);
  66. /* File functions */
  67. extern cucul_file_t *_cucul_file_open(const char *, const char *);
  68. extern int _cucul_file_close(cucul_file_t *);
  69. extern int _cucul_file_eof(cucul_file_t *);
  70. extern char *_cucul_file_gets(char *, int, cucul_file_t *);
  71. #endif /* __CUCUL_INTERNALS_H__ */