zori_longtext.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef zori_longtext_H_INCLUDED
  2. #define zori_longtext_H_INCLUDED
  3. #include "zori.h"
  4. #define ZORI_WIDGET_TYPE_LONGTEXT ZORI_WIDGET_TYPE('z','l','t','x')
  5. /* A descriptor for the current state of the longtext */
  6. struct zori_longtext_state {
  7. /*- Time waited between display of characters */
  8. double wait;
  9. /*- Virtual text page we are currently on. */
  10. int page;
  11. /*- Line of text we are currently on. */
  12. int line;
  13. /*- Currently paused or not. */
  14. int paused;
  15. /*- Total amount of lines to display for this text. */
  16. int total;
  17. /*- Current position in current line. */
  18. int position;
  19. /*- Animation timer. */
  20. double anitime;
  21. };
  22. /** Flags for the settings of a longtext widget.*/
  23. enum zori_longtext_setting_flag {
  24. /*- Disable animation of pause marker. */
  25. ZORI_LONGTEXT_SETTING_FLAG_STATIC_MARKER = 1 << 0,
  26. /*- Show letters oneby one in stead of space separated words. */
  27. ZORI_LONGTEXT_SETTING_FLAG_SHOW_LETTERS = 1 << 1,
  28. };
  29. /* A descriptor for the configurable size settings of a
  30. * longtext. */
  31. struct zori_longtext_settings {
  32. /*- Amount of lines to display in one virtual page of text. */
  33. int lines;
  34. /*- Vertcal spacing between lines. */
  35. int spacing;
  36. /*- Delay between display of the individual characters. */
  37. double delay;
  38. /*- Several flags that modify the behavior of the box. */
  39. enum zori_longtext_setting_flag flags;
  40. };
  41. struct zori_longtext {
  42. struct zori_widget widget;
  43. int align;
  44. zori_string * caption;
  45. zori_string * text;
  46. /*- Configurable settings. */
  47. struct zori_longtext_settings settings;
  48. /*- Current state. */
  49. struct zori_longtext_state state;
  50. };
  51. #include "zori_longtext_proto.h"
  52. #endif