2000-04-26 04:03:38 -04:00
|
|
|
#ifndef __THEMES_H
|
|
|
|
#define __THEMES_H
|
|
|
|
|
2000-05-15 04:25:45 -04:00
|
|
|
typedef struct {
|
2000-04-26 04:03:38 -04:00
|
|
|
char *name;
|
|
|
|
|
2000-05-15 04:25:45 -04:00
|
|
|
int count;
|
|
|
|
char **formats; /* in same order as in module's default formats */
|
2000-10-27 19:06:26 -04:00
|
|
|
char **expanded_formats; /* this contains the formats after
|
|
|
|
expanding {templates} */
|
2000-05-15 04:25:45 -04:00
|
|
|
} MODULE_THEME_REC;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char *path;
|
|
|
|
char *name;
|
2001-02-19 20:12:47 -05:00
|
|
|
time_t last_modify;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
2001-03-12 14:43:32 -05:00
|
|
|
int default_color; /* default color to use with text with default
|
2001-10-28 06:30:26 -05:00
|
|
|
background. default is -1 which means the
|
|
|
|
default color set by terminal */
|
2000-04-26 04:03:38 -04:00
|
|
|
GHashTable *modules;
|
|
|
|
|
2001-03-14 21:26:12 -05:00
|
|
|
int replace_keys[256]; /* index to replace_values for each char */
|
2000-10-27 19:06:26 -04:00
|
|
|
GSList *replace_values;
|
|
|
|
GHashTable *abstracts;
|
|
|
|
|
2000-07-31 17:16:09 -04:00
|
|
|
void *gui_data;
|
2000-04-26 04:03:38 -04:00
|
|
|
} THEME_REC;
|
|
|
|
|
2000-10-28 16:14:19 -04:00
|
|
|
typedef struct _FORMAT_REC FORMAT_REC;
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
extern GSList *themes;
|
|
|
|
extern THEME_REC *current_theme;
|
2000-05-15 04:25:45 -04:00
|
|
|
extern GHashTable *default_formats;
|
2000-04-26 04:03:38 -04:00
|
|
|
|
|
|
|
THEME_REC *theme_create(const char *path, const char *name);
|
|
|
|
void theme_destroy(THEME_REC *rec);
|
|
|
|
|
2000-07-31 17:16:09 -04:00
|
|
|
THEME_REC *theme_load(const char *name);
|
|
|
|
|
2000-05-15 04:25:45 -04:00
|
|
|
#define theme_register(formats) theme_register_module(MODULE_NAME, formats)
|
|
|
|
#define theme_unregister() theme_unregister_module(MODULE_NAME)
|
|
|
|
void theme_register_module(const char *module, FORMAT_REC *formats);
|
|
|
|
void theme_unregister_module(const char *module);
|
|
|
|
|
2001-03-14 21:26:12 -05:00
|
|
|
#define EXPAND_FLAG_IGNORE_REPLACES 0x01 /* don't use the character replaces when expanding */
|
|
|
|
#define EXPAND_FLAG_IGNORE_EMPTY 0x02 /* if abstract's argument is empty, don't try to expand it (ie. {xx }, but not {xx}) */
|
|
|
|
#define EXPAND_FLAG_RECURSIVE_MASK 0x0f
|
|
|
|
/* private */
|
|
|
|
#define EXPAND_FLAG_ROOT 0x10
|
|
|
|
#define EXPAND_FLAG_LASTCOLOR_ARG 0x20
|
|
|
|
|
|
|
|
char *theme_format_expand(THEME_REC *theme, const char *format);
|
|
|
|
char *theme_format_expand_data(THEME_REC *theme, const char **format,
|
|
|
|
char default_fg, char default_bg,
|
|
|
|
char *save_last_fg, char *save_last_bg,
|
|
|
|
int flags);
|
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
void themes_init(void);
|
|
|
|
void themes_deinit(void);
|
|
|
|
|
|
|
|
#endif
|