themes.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef BDE_THEMES_H
  2. #define BDE_THEMES_H
  3. #include <config.h>
  4. #define MENUBAR_ATTR 10
  5. #define MENU_ATTR 11
  6. #define MENU_SELECTED_ATTR 12
  7. #define MENU_FRAME_ATTR 13
  8. #define MENU_LETTER_ATTR 14
  9. #define MENU_LETTER_SELECTED_ATTR 15
  10. #define MENU_INDICATOR_ATTR 16
  11. #define MENU_INDICATOR_SELECTED_ATTR 17
  12. #define STATUSLINE_ATTR 18
  13. #define EDIT_ATTR 19
  14. #define DIALOGLINE_ATTR 20
  15. #define SCROLLBAR_ATTR 21
  16. #define SCROLLBAR_THUMB_ATTR 22
  17. #define EDIT_FAILED_CONV_ATTR 23
  18. #define EDIT_CONTROL_ATTR 24
  19. #define EDIT_EOP_ATTR 25
  20. #define EDIT_EXPLICIT_ATTR 26
  21. #define EDIT_NSM_ATTR 27
  22. #define EDIT_NSM_HEBREW_ATTR 28
  23. #define EDIT_NSM_CANTILLATION_ATTR 29
  24. #define EDIT_NSM_ARABIC_ATTR 30
  25. #define EDIT_TAB_ATTR 31
  26. #define EDIT_WIDE_ATTR 32
  27. #define EDIT_TRIM_ATTR 33
  28. #define EDIT_WRAP_ATTR 34
  29. #define EDIT_MAQAF_ATTR 35
  30. #define EDIT_UNICODE_LS_ATTR 36
  31. #define EDIT_SELECTED_ATTR 37
  32. #define EDIT_HTML_TAG_ATTR 38
  33. #define EDIT_EMPHASIZED_ATTR 39
  34. #define EDIT_LINKS_ATTR 40
  35. #define EDIT_EMAIL_QUOTE1_ATTR 101
  36. #define EDIT_EMAIL_QUOTE2_ATTR 102
  37. #define EDIT_EMAIL_QUOTE3_ATTR 103
  38. #define EDIT_EMAIL_QUOTE4_ATTR 104
  39. #define EDIT_EMAIL_QUOTE5_ATTR 105
  40. #define EDIT_EMAIL_QUOTE6_ATTR 106
  41. #define EDIT_EMAIL_QUOTE7_ATTR 107
  42. #define EDIT_EMAIL_QUOTE8_ATTR 108
  43. #define EDIT_EMAIL_QUOTE9_ATTR 109
  44. struct ThemeError {
  45. enum { errNone, errNotFound, errIO,
  46. errSyntax, errNoColorTerminal, errNotEnoughColorPairs } what;
  47. int sys_errno; // for errIO
  48. int line_no; // for errSytax
  49. u8string filename;
  50. u8string format() const;
  51. };
  52. int get_attr(int ident);
  53. #ifdef HAVE_COLOR
  54. # define contains_color(attr) PAIR_NUMBER(attr)
  55. #else
  56. # define contains_color(attr) 0
  57. #endif
  58. bool load_theme(const char *basefilename, ThemeError &theme_error);
  59. bool load_default_theme(ThemeError &theme_error);
  60. const char *get_theme_name();
  61. #endif