25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

cucul_internals.h 2.1 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. 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. /* 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. unsigned int frame, framecount;
  38. struct cucul_frame *frames;
  39. /* Canvas management */
  40. unsigned int refcount;
  41. unsigned int autoinc;
  42. int (*resize_callback)(void *);
  43. void *resize_data;
  44. /* Shortcut to the active frame information */
  45. unsigned 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. unsigned long int 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. /* File functions */
  65. extern cucul_file_t *_cucul_file_open(const char *, const char *);
  66. extern int _cucul_file_close(cucul_file_t *);
  67. extern int _cucul_file_eof(cucul_file_t *);
  68. extern char *_cucul_file_gets(char *, int, cucul_file_t *);
  69. #endif /* __CUCUL_INTERNALS_H__ */