skin.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 REVERSE_COLOR mc_skin_color__cache[5]
  16. /* Dialog colors */
  17. #define COLOR_NORMAL mc_skin_color__cache[6]
  18. #define COLOR_FOCUS mc_skin_color__cache[7]
  19. #define COLOR_HOT_NORMAL mc_skin_color__cache[8]
  20. #define COLOR_HOT_FOCUS mc_skin_color__cache[9]
  21. /* Error dialog colors */
  22. #define ERROR_COLOR mc_skin_color__cache[10]
  23. #define ERROR_HOT_NORMAL mc_skin_color__cache[11]
  24. #define ERROR_HOT_FOCUS mc_skin_color__cache[12]
  25. /* Menu colors */
  26. #define MENU_ENTRY_COLOR mc_skin_color__cache[13]
  27. #define MENU_SELECTED_COLOR mc_skin_color__cache[14]
  28. #define MENU_HOT_COLOR mc_skin_color__cache[15]
  29. #define MENU_HOTSEL_COLOR mc_skin_color__cache[16]
  30. #define MENU_INACTIVE_COLOR mc_skin_color__cache[17]
  31. /*
  32. * This should be selectable independently. Default has to be black background
  33. * foreground does not matter at all.
  34. */
  35. #define GAUGE_COLOR mc_skin_color__cache[18]
  36. #define INPUT_COLOR mc_skin_color__cache[19]
  37. #define HELP_NORMAL_COLOR mc_skin_color__cache[20]
  38. #define HELP_ITALIC_COLOR mc_skin_color__cache[21]
  39. #define HELP_BOLD_COLOR mc_skin_color__cache[22]
  40. #define HELP_LINK_COLOR mc_skin_color__cache[23]
  41. #define HELP_SLINK_COLOR mc_skin_color__cache[24]
  42. #define VIEW_UNDERLINED_COLOR mc_skin_color__cache[25]
  43. /*
  44. * editor colors - only 4 for normal, search->found, select, and whitespace
  45. * respectively
  46. * Last is defined to view color.
  47. */
  48. #define EDITOR_NORMAL_COLOR mc_skin_color__cache[26]
  49. #define EDITOR_BOLD_COLOR mc_skin_color__cache[27]
  50. #define EDITOR_MARKED_COLOR mc_skin_color__cache[28]
  51. #define EDITOR_WHITESPACE_COLOR mc_skin_color__cache[29]
  52. #define EDITOR_RIGHT_MARGIN_COLOR mc_skin_color__cache[30]
  53. /* color of left 8 char status per line */
  54. #define LINE_STATE_COLOR mc_skin_color__cache[31]
  55. #define BOOK_MARK_COLOR mc_skin_color__cache[32]
  56. #define BOOK_MARK_FOUND_COLOR mc_skin_color__cache[33]
  57. #define BUTTONBAR_HOTKEY_COLOR mc_skin_color__cache[34]
  58. #define BUTTONBAR_BUTTON_COLOR mc_skin_color__cache[35]
  59. #define MC_SKIN_COLOR_CACHE_COUNT 36
  60. /*** enums ***************************************************************************************/
  61. /*** structures declarations (and typedefs of structures)*****************************************/
  62. typedef struct mc_skin_struct {
  63. gchar *name;
  64. gchar *description;
  65. mc_config_t *config;
  66. GHashTable *colors;
  67. } mc_skin_t;
  68. /*** global variables defined in .c file *********************************************************/
  69. extern int mc_skin_color__cache[];
  70. extern mc_skin_t mc_skin__default;
  71. /*** declarations of public functions ************************************************************/
  72. gboolean mc_skin_init (GError **);
  73. void mc_skin_deinit (void);
  74. int mc_skin_color_get (const gchar *, const gchar *);
  75. void mc_skin_lines_parse_ini_file (mc_skin_t *);
  76. gchar *mc_skin_get(const gchar *, const gchar *, const gchar *);
  77. #endif