17#ifdef FREECIV_HAVE_DIRENT_H
70 log_fatal(
_(
"No Sdl2-client theme was found. For instructions on how to "
71 "get one, please visit %s"), WIKI_URL);
90 char buf[strlen(data_dir) + strlen(
"/themes/gui-sdl2") + 1];
92 fc_snprintf(buf,
sizeof(buf),
"%s/themes/gui-sdl2", data_dir);
109 struct dirent *
entry;
110 char **theme_names =
fc_malloc(
sizeof(
char *) * 2);
122 while ((
entry = readdir(dir))) {
124 struct stat stat_result;
129 if (
fc_stat(buf, &stat_result) != 0) {
134 if (!S_ISREG(stat_result.st_mode)) {
142 if (*count == t_size) {
143 theme_names =
fc_realloc(theme_names, t_size * 2 *
sizeof(
char *));
DIR * fc_opendir(const char *dir_to_open)
char ** get_gui_specific_themes_directories(int *count)
void gui_clear_theme(void)
void gui_load_theme(const char *directory, const char *theme_name)
void update_font_from_theme(int theme_font_size)
unsigned default_font_size(struct theme *act_theme)
#define log_fatal(message,...)
#define fc_realloc(ptr, sz)
struct client_options gui_options
const struct strvec * get_data_dirs(void)
size_t strvec_size(const struct strvec *psv)
#define strvec_iterate(psv, str)
#define strvec_iterate_end
char gui_sdl2_default_theme_name[512]
int fc_snprintf(char *str, size_t n, const char *format,...)
int fc_stat(const char *filename, struct stat *buf)
struct theme_directory * directories
get_usable_themes_in_directory
void theme_free(struct theme *ftheme)
void theme_load_sprites(struct theme *t)
void themespec_try_read(const char *theme_name)
struct theme * active_theme