skin.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. #ifndef MC_SKIN_H
  2. #define MC_SKIN_H
  3. #include "lib/global.h"
  4. #include "lib/mcconfig.h"
  5. #include "lib/tty/color.h"
  6. /*** typedefs(not structures) and defined constants **********************************************/
  7. /* Beware! When using Slang with color, not all the indexes are free.
  8. See color-slang.h (A_*) */
  9. /* cache often used colors */
  10. #define DEFAULT_COLOR mc_skin_color__cache[0]
  11. #define NORMAL_COLOR mc_skin_color__cache[1]
  12. #define MARKED_COLOR mc_skin_color__cache[2]
  13. #define SELECTED_COLOR mc_skin_color__cache[3]
  14. #define MARKED_SELECTED_COLOR mc_skin_color__cache[4]
  15. #define DISABLED_COLOR mc_skin_color__cache[5]
  16. #define REVERSE_COLOR mc_skin_color__cache[6]
  17. #define COMMAND_MARK_COLOR mc_skin_color__cache[7]
  18. #define HEADER_COLOR mc_skin_color__cache[8]
  19. #define SHADOW_COLOR mc_skin_color__cache[9]
  20. /* Dialog colors */
  21. #define COLOR_NORMAL mc_skin_color__cache[10]
  22. #define COLOR_FOCUS mc_skin_color__cache[11]
  23. #define COLOR_HOT_NORMAL mc_skin_color__cache[12]
  24. #define COLOR_HOT_FOCUS mc_skin_color__cache[13]
  25. #define COLOR_TITLE mc_skin_color__cache[14]
  26. /* Error dialog colors */
  27. #define ERROR_COLOR mc_skin_color__cache[15]
  28. #define ERROR_FOCUS mc_skin_color__cache[16]
  29. #define ERROR_HOT_NORMAL mc_skin_color__cache[17]
  30. #define ERROR_HOT_FOCUS mc_skin_color__cache[18]
  31. #define ERROR_TITLE mc_skin_color__cache[19]
  32. /* Menu colors */
  33. #define MENU_ENTRY_COLOR mc_skin_color__cache[20]
  34. #define MENU_SELECTED_COLOR mc_skin_color__cache[21]
  35. #define MENU_HOT_COLOR mc_skin_color__cache[22]
  36. #define MENU_HOTSEL_COLOR mc_skin_color__cache[23]
  37. #define MENU_INACTIVE_COLOR mc_skin_color__cache[24]
  38. /* Popup menu colors */
  39. #define PMENU_ENTRY_COLOR mc_skin_color__cache[25]
  40. #define PMENU_SELECTED_COLOR mc_skin_color__cache[26]
  41. #define PMENU_HOT_COLOR mc_skin_color__cache[27] /* unused: not implemented yet */
  42. #define PMENU_HOTSEL_COLOR mc_skin_color__cache[28] /* unused: not implemented yet */
  43. #define PMENU_TITLE_COLOR mc_skin_color__cache[29]
  44. #define BUTTONBAR_HOTKEY_COLOR mc_skin_color__cache[30]
  45. #define BUTTONBAR_BUTTON_COLOR mc_skin_color__cache[31]
  46. #define STATUSBAR_COLOR mc_skin_color__cache[32]
  47. /*
  48. * This should be selectable independently. Default has to be black background
  49. * foreground does not matter at all.
  50. */
  51. #define GAUGE_COLOR mc_skin_color__cache[33]
  52. #define INPUT_COLOR mc_skin_color__cache[34]
  53. #define INPUT_UNCHANGED_COLOR mc_skin_color__cache[35]
  54. #define INPUT_MARK_COLOR mc_skin_color__cache[36]
  55. #define INPUT_HISTORY_COLOR mc_skin_color__cache[37]
  56. #define COMMAND_HISTORY_COLOR mc_skin_color__cache[38]
  57. #define HELP_NORMAL_COLOR mc_skin_color__cache[39]
  58. #define HELP_ITALIC_COLOR mc_skin_color__cache[40]
  59. #define HELP_BOLD_COLOR mc_skin_color__cache[41]
  60. #define HELP_LINK_COLOR mc_skin_color__cache[42]
  61. #define HELP_SLINK_COLOR mc_skin_color__cache[43]
  62. #define HELP_TITLE_COLOR mc_skin_color__cache[44]
  63. #define VIEW_NORMAL_COLOR mc_skin_color__cache[45]
  64. #define VIEW_BOLD_COLOR mc_skin_color__cache[46]
  65. #define VIEW_UNDERLINED_COLOR mc_skin_color__cache[47]
  66. #define VIEW_SELECTED_COLOR mc_skin_color__cache[48]
  67. /*
  68. * editor colors - only 4 for normal, search->found, select, and whitespace
  69. * respectively
  70. * Last is defined to view color.
  71. */
  72. #define EDITOR_NORMAL_COLOR mc_skin_color__cache[49]
  73. #define EDITOR_NONPRINTABLE_COLOR mc_skin_color__cache[50]
  74. #define EDITOR_BOLD_COLOR mc_skin_color__cache[51]
  75. #define EDITOR_MARKED_COLOR mc_skin_color__cache[52]
  76. #define EDITOR_WHITESPACE_COLOR mc_skin_color__cache[53]
  77. #define EDITOR_RIGHT_MARGIN_COLOR mc_skin_color__cache[54]
  78. #define EDITOR_BACKGROUND mc_skin_color__cache[55]
  79. #define EDITOR_FRAME mc_skin_color__cache[56]
  80. #define EDITOR_FRAME_ACTIVE mc_skin_color__cache[57]
  81. #define EDITOR_FRAME_DRAG mc_skin_color__cache[58]
  82. /* color of left 8 char status per line */
  83. #define LINE_STATE_COLOR mc_skin_color__cache[59]
  84. #define BOOK_MARK_COLOR mc_skin_color__cache[60]
  85. #define BOOK_MARK_FOUND_COLOR mc_skin_color__cache[61]
  86. /* Diff colors */
  87. #define DFF_ADD_COLOR mc_skin_color__cache[62]
  88. #define DFF_CHG_COLOR mc_skin_color__cache[63]
  89. #define DFF_CHH_COLOR mc_skin_color__cache[64]
  90. #define DFF_CHD_COLOR mc_skin_color__cache[65]
  91. #define DFF_DEL_COLOR mc_skin_color__cache[66]
  92. #define DFF_ERROR_COLOR mc_skin_color__cache[67]
  93. #define MC_SKIN_COLOR_CACHE_COUNT 68
  94. /*** enums ***************************************************************************************/
  95. /*** structures declarations (and typedefs of structures)*****************************************/
  96. typedef struct mc_skin_struct
  97. {
  98. gchar *name;
  99. gchar *description;
  100. mc_config_t *config;
  101. GHashTable *colors;
  102. gboolean have_256_colors;
  103. gboolean have_true_colors;
  104. } mc_skin_t;
  105. /*** global variables defined in .c file *********************************************************/
  106. extern int mc_skin_color__cache[];
  107. extern mc_skin_t mc_skin__default;
  108. /*** declarations of public functions ************************************************************/
  109. gboolean mc_skin_init (const gchar * skin_override, GError ** error);
  110. void mc_skin_deinit (void);
  111. int mc_skin_color_get (const gchar * group, const gchar * name);
  112. void mc_skin_lines_parse_ini_file (mc_skin_t * mc_skin);
  113. gchar *mc_skin_get (const gchar * group, const gchar * key, const gchar * default_value);
  114. GPtrArray *mc_skin_list (void);
  115. #endif /* MC_SKIN_H */